diff options
author | Ashish Chaudhari <ashish@ettus.com> | 2015-07-18 22:26:25 -0700 |
---|---|---|
committer | Ashish Chaudhari <ashish@ettus.com> | 2015-07-18 22:26:25 -0700 |
commit | 410b2447769ada7142c164cdfde7eefb8270bef8 (patch) | |
tree | 3a55ef1ae0273695398588a0b1c6b5088b82cff6 /host/lib/usrp/mboard_eeprom.cpp | |
parent | 722f6f6b398e7698089138ed41824b48b569c4ca (diff) | |
download | uhd-410b2447769ada7142c164cdfde7eefb8270bef8.tar.gz uhd-410b2447769ada7142c164cdfde7eefb8270bef8.tar.bz2 uhd-410b2447769ada7142c164cdfde7eefb8270bef8.zip |
x300: Added HW rev compat number support
- Added new field "revision_compat" to mb_eeprom
- Enforce a revision_compat of 7
Diffstat (limited to 'host/lib/usrp/mboard_eeprom.cpp')
-rw-r--r-- | host/lib/usrp/mboard_eeprom.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/host/lib/usrp/mboard_eeprom.cpp b/host/lib/usrp/mboard_eeprom.cpp index 9c92fe252..c2415763b 100644 --- a/host/lib/usrp/mboard_eeprom.cpp +++ b/host/lib/usrp/mboard_eeprom.cpp @@ -213,7 +213,8 @@ struct x300_eeprom_map //indentifying numbers unsigned char revision[2]; unsigned char product[2]; - boost::uint8_t _pad0[4]; + unsigned char revision_compat[2]; + boost::uint8_t _pad0[2]; //all the mac addrs boost::uint8_t mac_addr0[6]; @@ -244,6 +245,11 @@ static void load_x300(mboard_eeprom_t &mb_eeprom, i2c_iface &iface) iface.read_eeprom(X300_EEPROM_ADDR, offsetof(x300_eeprom_map, product), 2) ); + //extract the revision compat number + mb_eeprom["revision_compat"] = uint16_bytes_to_string( + iface.read_eeprom(X300_EEPROM_ADDR, offsetof(x300_eeprom_map, revision_compat), 2) + ); + //extract the mac addresses mb_eeprom["mac-addr0"] = mac_addr_t::from_bytes(iface.read_eeprom( X300_EEPROM_ADDR, offsetof(x300_eeprom_map, mac_addr0), 6 @@ -291,6 +297,12 @@ static void store_x300(const mboard_eeprom_t &mb_eeprom, i2c_iface &iface) string_to_uint16_bytes(mb_eeprom["product"]) ); + //parse the revision compat number + if (mb_eeprom.has_key("revision_compat")) iface.write_eeprom( + X300_EEPROM_ADDR, offsetof(x300_eeprom_map, revision_compat), + string_to_uint16_bytes(mb_eeprom["revision_compat"]) + ); + //store the mac addresses if (mb_eeprom.has_key("mac-addr0")) iface.write_eeprom( X300_EEPROM_ADDR, offsetof(x300_eeprom_map, mac_addr0), |