diff options
author | Moritz Fischer <moritz.fischer@ettus.com> | 2015-01-13 10:21:10 +0100 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2015-01-20 10:13:13 +0100 |
commit | 39b17fd7c18ad7896823f1d45bbb65e27325e198 (patch) | |
tree | 565aa8db2e2146da63c9b7956828f38cbf0b862f | |
parent | 2a49dbbc8acdd601eb4d541b43bcfa6724333785 (diff) | |
download | uhd-39b17fd7c18ad7896823f1d45bbb65e27325e198.tar.gz uhd-39b17fd7c18ad7896823f1d45bbb65e27325e198.tar.bz2 uhd-39b17fd7c18ad7896823f1d45bbb65e27325e198.zip |
e300: Changed (max) serial number from 6 to 8.
This works without hickup because we store the serial
as a \0 terminated string.
Note: We now also write the data version fields,
as they might come in handy one day.
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
-rw-r--r-- | host/lib/usrp/e300/e300_eeprom_manager.cpp | 9 | ||||
-rw-r--r-- | host/lib/usrp/e300/e300_eeprom_manager.hpp | 14 |
2 files changed, 19 insertions, 4 deletions
diff --git a/host/lib/usrp/e300/e300_eeprom_manager.cpp b/host/lib/usrp/e300/e300_eeprom_manager.cpp index af1235b6b..dad6741f5 100644 --- a/host/lib/usrp/e300/e300_eeprom_manager.cpp +++ b/host/lib/usrp/e300/e300_eeprom_manager.cpp @@ -126,6 +126,10 @@ void e300_eeprom_manager::write_db_eeprom(const dboard_eeprom_t& eeprom) db_eeprom_map_t &map = *map_ptr; + // set the data version, that can be used to distinguish eeprom layouts + map.data_version_major = E310_DB_MAP_MAJOR; + map.data_version_minor = E310_DB_MAP_MINOR; + if (_db_eeprom.id != dboard_id_t::none()) { map.hw_product = uhd::htonx<boost::uint16_t>( _db_eeprom.id.to_uint16()); @@ -160,6 +164,11 @@ void e300_eeprom_manager::write_mb_eeprom(const mboard_eeprom_t& eeprom) mb_eeprom_map_t &map = *map_ptr; + // set the data version, that can be used to distinguish eeprom layouts + map.data_version_major = E310_MB_MAP_MAJOR; + map.data_version_minor = E310_MB_MAP_MINOR; + + if (_mb_eeprom.has_key("product")) { map.hw_product = uhd::htonx<boost::uint16_t>( boost::lexical_cast<boost::uint16_t>(_mb_eeprom["product"])); diff --git a/host/lib/usrp/e300/e300_eeprom_manager.hpp b/host/lib/usrp/e300/e300_eeprom_manager.hpp index e77f25ed5..86d7c3463 100644 --- a/host/lib/usrp/e300/e300_eeprom_manager.hpp +++ b/host/lib/usrp/e300/e300_eeprom_manager.hpp @@ -34,6 +34,12 @@ static const boost::uint16_t E310_MB_PID = 0x77d2; static const boost::uint16_t E300_DB_PID = 0x0100; static const boost::uint16_t E310_DB_PID = 0x0110; +static const boost::uint16_t E310_MB_MAP_MAJOR = 0x0001; +static const boost::uint16_t E310_MB_MAP_MINOR = 0x0000; + +static const boost::uint16_t E310_DB_MAP_MAJOR = 0x0001; +static const boost::uint16_t E310_DB_MAP_MINOR = 0x0000; + class e300_eeprom_manager : boost::noncopyable { public: @@ -69,11 +75,11 @@ public: std::string get_mb_type_string(void) const; private: // types - const static size_t MB_SERIAL_LEN = 6; + const static size_t MB_SERIAL_LEN = 8; const static size_t MB_NAME_LEN = 32; const static size_t MB_ADDR = 0x51; - const static size_t DB_SERIAL_LEN = 6; + const static size_t DB_SERIAL_LEN = 8; const static size_t DB_ADDR = 0x50; struct mb_eeprom_map_t @@ -108,8 +114,8 @@ private: // types boost::uint16_t hw_revision; // serial - boost::uint8_t serial[MB_SERIAL_LEN]; - boost::uint8_t pad[20 - MB_SERIAL_LEN]; + boost::uint8_t serial[DB_SERIAL_LEN]; + boost::uint8_t pad[20 - DB_SERIAL_LEN]; }; private: // members |