aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python
diff options
context:
space:
mode:
Diffstat (limited to 'mpm/python')
-rw-r--r--mpm/python/usrp_mpm/eeprom.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/mpm/python/usrp_mpm/eeprom.py b/mpm/python/usrp_mpm/eeprom.py
index 79532f9f8..d189f7a8b 100644
--- a/mpm/python/usrp_mpm/eeprom.py
+++ b/mpm/python/usrp_mpm/eeprom.py
@@ -39,6 +39,20 @@ class MboardEEPROM(object):
- 2 bytes padding
- 4 bytes CRC
+ Version 2: (FWIW MPM doesn't care about the extra bytes)
+
+ - 4x4 bytes mcu_flags -> throw them away
+ - 2 bytes hw_pid
+ - 2 bytes hw_rev (starting at 0)
+ - 8 bytes serial number (zero-terminated string of 7 characters)
+ - 6 bytes MAC address for eth0
+ - 2 bytes Devicetree compatible -> throw them away
+ - 6 bytes MAC address for eth1
+ - 2 bytes EC compatible -> throw them away
+ - 6 bytes MAC address for eth2
+ - 2 bytes padding
+ - 4 bytes CRC
+
MAC addresses are ignored here; they are read elsewhere. If we really need
to know the MAC address of an interface, we can fish it out the raw data,
or ask the system.
@@ -47,10 +61,12 @@ class MboardEEPROM(object):
eeprom_header_format = (
None, # For laziness, we start at version 1 and thus index 0 stays empty
"!I I 16s H H 7s 1x 24s I", # Version 1
+ "!I I 16s H H 7s 1x 24s I", # Version 2 (Ignore the extra fields, it doesn't matter to MPM)
)
eeprom_header_keys = (
None, # For laziness, we start at version 1 and thus index 0 stays empty
- ('magic', 'eeprom_version', 'mcu_flags', 'pid', 'rev', 'serial', 'mac_addresses', 'CRC') # Version 1
+ ('magic', 'eeprom_version', 'mcu_flags', 'pid', 'rev', 'serial', 'mac_addresses', 'CRC'), # Version 1
+ ('magic', 'eeprom_version', 'mcu_flags', 'pid', 'rev', 'serial', 'mac_addresses', 'CRC') # Version 2 (Ignore the extra fields, it doesn't matter to MPM)
)
class DboardEEPROM(object):
@@ -71,6 +87,14 @@ class DboardEEPROM(object):
- 8 bytes serial number (zero-terminated string of 7 characters)
- 4 bytes CRC
+ Version 2:
+
+ - 2 bytes hw_pid
+ - 1 byte hw_rev (starting at 0)
+ - 1 byte dt_compat (starting at 0, MPM can ignore that)
+ - 8 bytes serial number (zero-terminated string of 7 characters)
+ - 4 bytes CRC
+
MAC addresses are ignored here; they are read elsewhere. If we really need
to know the MAC address of an interface, we can fish it out the raw data,
or ask the system.
@@ -79,10 +103,12 @@ class DboardEEPROM(object):
eeprom_header_format = (
None, # For laziness, we start at version 1 and thus index 0 stays empty
"!I I H H 7s 1x I", # Version 1
+ "!I I H B 1x 7s 1x I", # Version 2
)
eeprom_header_keys = (
None, # For laziness, we start at version 1 and thus index 0 stays empty
('magic', 'eeprom_version', 'pid', 'rev', 'serial', 'CRC'), # Version 1
+ ('magic', 'eeprom_version', 'pid', 'rev', 'serial', 'CRC'), # Version 2 (Ignore the extra field, it doesn't matter to MPM)
)