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/tools/eeprom.h | |
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/tools/eeprom.h')
-rw-r--r-- | mpm/tools/eeprom.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/mpm/tools/eeprom.h b/mpm/tools/eeprom.h index fc5b47426..04f468dd9 100644 --- a/mpm/tools/eeprom.h +++ b/mpm/tools/eeprom.h @@ -29,32 +29,41 @@ struct usrp_sulfur_eeprom { u16 rev; u8 serial[8]; u8 eth_addr0[ETH_ALEN]; - u8 __pad_0[2]; + u16 dt_compat; u8 eth_addr1[ETH_ALEN]; - u8 __pad_1[2]; + u16 mcu_compat; u8 eth_addr2[ETH_ALEN]; u8 __pad_2[2]; u32 crc; } __attribute__((packed)); +struct db_rev { + u8 rev; + u8 dt_compat; +} __attribute__((packed)); + struct usrp_sulfur_db_eeprom { u32 magic; u32 version; u16 pid; - u16 rev; - u8 serial[8]; + union rev { + u16 v1_rev; + struct db_rev v2_rev; + } rev; + char serial[8]; u32 crc; - } __attribute__((packed)); /* Motherboard EEPROM stuff */ struct usrp_sulfur_eeprom *usrp_sulfur_eeprom_new(const u32 *mcu_flags, const u16 pid, const u16 rev, - const u8 *serial, + const char *serial, const char *eth_addr0, const char *eth_addr1, - const char *eth_addr2); + const char *eth_addr2, + const u16 dt_compat, + const u16 mcu_compat); void usrp_sulfur_eeprom_to_i2c(struct usrp_sulfur_eeprom *ep, const char *path); @@ -70,7 +79,8 @@ void usrp_sulfur_eeprom_print(const struct usrp_sulfur_eeprom *ep); /* Daughterboard EEPROM stuff */ struct usrp_sulfur_db_eeprom *usrp_sulfur_db_eeprom_new(const u16 pid, const u16 rev, - const u8 *serial); + const char *serial, + const u16 dt_compat); void usrp_sulfur_db_eeprom_to_file(struct usrp_sulfur_db_eeprom *ep, const char *path); |