diff options
author | Martin Braun <martin.braun@ettus.com> | 2019-05-09 16:25:11 -0700 |
---|---|---|
committer | Brent Stapleton <brent.stapleton@ettus.com> | 2019-05-10 16:59:58 -0700 |
commit | 0812a5f6bf600f3d09e40f55b02de91a3b82dd75 (patch) | |
tree | 41adfcb06150bf8515d3e4afe4c632df5ea6d89e /mpm/python/usrp_mpm | |
parent | e0e61a5a5eb2442c14f11298c358d8492c037a68 (diff) | |
download | uhd-0812a5f6bf600f3d09e40f55b02de91a3b82dd75.tar.gz uhd-0812a5f6bf600f3d09e40f55b02de91a3b82dd75.tar.bz2 uhd-0812a5f6bf600f3d09e40f55b02de91a3b82dd75.zip |
mpm: Add MB-EEPROMv3
This includes a rev_compat field, which we can use to identify the last
hardware revision this hardware is compatible with. Example: Say the
current hardware revision is 7, but it is compatible with version 5,
then we store 7 as the current rev, and 5 as the rev_compat. Software
can now check the rev_compat rather than the current rev for
compatibility. This makes MPM more future-proof against minor,
compatible hardware changes.
Diffstat (limited to 'mpm/python/usrp_mpm')
-rw-r--r-- | mpm/python/usrp_mpm/eeprom.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/mpm/python/usrp_mpm/eeprom.py b/mpm/python/usrp_mpm/eeprom.py index 97a450ca6..3a839d3a6 100644 --- a/mpm/python/usrp_mpm/eeprom.py +++ b/mpm/python/usrp_mpm/eeprom.py @@ -53,6 +53,20 @@ class MboardEEPROM(object): - 2 bytes padding - 4 bytes CRC + Version 3: (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 rev_compat + - 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. @@ -61,12 +75,14 @@ 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) + "!I I 16s H H 7s 1x 6s H 6s H 6s 2x I", # Version 2 (Ignore the extra fields, it doesn't matter to MPM) + "!I I 16s H H 7s 1x 6s H 6s H 6s H I", # Version 3 (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 2 (Ignore the extra fields, it doesn't matter to MPM) + ('magic', 'eeprom_version', 'mcu_flags', 'pid', 'rev', 'serial', 'mac_eth0', 'dt_compat', 'mac_eth1', 'ec_compat', 'mac_eth2', 'CRC'), # Version 2 (Ignore the extra fields, it doesn't matter to MPM) + ('magic', 'eeprom_version', 'mcu_flags', 'pid', 'rev', 'serial', 'mac_eth0', 'dt_compat', 'mac_eth1', 'ec_compat', 'mac_eth2', 'rev_compat', 'CRC'), # Version 3 ) class DboardEEPROM(object): |