diff options
author | Moritz Fischer <moritz.fischer@ettus.com> | 2018-04-25 18:01:09 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-06-20 17:10:05 -0500 |
commit | 91a5518443f4ff938f67a2f1bd1b09b24bceecd5 (patch) | |
tree | eb4adccd6d3c687d157d4a4073e76970a5ed0a69 /mpm/python/usrp_mpm/eeprom.py | |
parent | 0935bf5c2a6952fd07bc4b6c618d12b0bd79ca78 (diff) | |
download | uhd-91a5518443f4ff938f67a2f1bd1b09b24bceecd5.tar.gz uhd-91a5518443f4ff938f67a2f1bd1b09b24bceecd5.tar.bz2 uhd-91a5518443f4ff938f67a2f1bd1b09b24bceecd5.zip |
mpm: tools: Introduce dt-compat and mcu-compat fields
Introduce dt-compat and mcu-compat fields into the eeprom
structure.
For the motherboard eeprom this is straightforward, since
there's still padding bytes that could be (ab)used for this.
On the dboard side more creativity is required and the
original revision field of 2 bytes is reduced to only
one byte revision and one byte dt-compat.
Since this will only affect new units being backwards
compatible with older versions of the bootloader is not
an issue.
Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
Diffstat (limited to 'mpm/python/usrp_mpm/eeprom.py')
-rw-r--r-- | mpm/python/usrp_mpm/eeprom.py | 28 |
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) ) |