aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python
diff options
context:
space:
mode:
authorSteve Czabaniuk <steve.czabaniuk@ni.com>2020-06-29 15:43:28 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2020-07-31 14:32:54 -0500
commit5e0cebdc19eecad0cceac2d81bee0405a89cfe5a (patch)
tree5e1d1e84a184e3349be09c90be426407088455e5 /mpm/python
parenta68e7101167a4b5bf7b60ed90d963982aae735b8 (diff)
downloaduhd-5e0cebdc19eecad0cceac2d81bee0405a89cfe5a.tar.gz
uhd-5e0cebdc19eecad0cceac2d81bee0405a89cfe5a.tar.bz2
uhd-5e0cebdc19eecad0cceac2d81bee0405a89cfe5a.zip
mpm: n3xx: bist: Read mboard and dboard eeprom to determine product
The routine to identify products currently only reads the motherboard EEPROM. The N310 and N320/N321 use the same motherboard so these devices can't be distinguished using the motherboard EEPROM alone. This change makes get_product_id() read both the motherboard and daughterboard EEPROM in order to determine which N3xx it actually is.
Diffstat (limited to 'mpm/python')
-rwxr-xr-xmpm/python/n3xx_bist14
-rw-r--r--mpm/python/usrp_mpm/bist.py5
2 files changed, 14 insertions, 5 deletions
diff --git a/mpm/python/n3xx_bist b/mpm/python/n3xx_bist
index 1202fe121..c125ac1ae 100755
--- a/mpm/python/n3xx_bist
+++ b/mpm/python/n3xx_bist
@@ -111,7 +111,17 @@ class N3XXBIST(bist.UsrpBIST):
def get_product_id(self):
"""Return the mboard product ID (n310 or n300):"""
- return bist.get_product_id_from_eeprom(valid_ids=['n300', 'n310', 'n320'])
+ product_map = {
+ #(mboard, dboard): product
+ ('n300', 'magnesium'): 'n300',
+ ('n300', ''): 'n300', # n300 mboard with no dboard
+ ('n310', 'magnesium'): 'n310',
+ ('n310', ''): 'n310', # n310 mboard with no dboard
+ ('n310', 'rhodium'): 'n320',
+ }
+ mb_id = bist.get_product_id_from_eeprom(valid_ids=['n300', 'n310'], cmd='eeprom-id')
+ db_id = bist.get_product_id_from_eeprom(valid_ids=['magnesium', 'rhodium', ''], cmd='db-id')
+ return product_map[(mb_id, db_id)]
#############################################################################
# BISTS
@@ -154,7 +164,7 @@ class N3XXBIST(bist.UsrpBIST):
self.get_product_id(),
)
except Exception as ex:
- return {
+ return False, {
'throughput': 0,
'error_msg': "Failed to load AA image: {}".format(str(ex)),
}
diff --git a/mpm/python/usrp_mpm/bist.py b/mpm/python/usrp_mpm/bist.py
index b20020e1f..2287d79ab 100644
--- a/mpm/python/usrp_mpm/bist.py
+++ b/mpm/python/usrp_mpm/bist.py
@@ -216,14 +216,13 @@ def filter_results_for_lv(results, lv_compat_format):
}
return results
-def get_product_id_from_eeprom(valid_ids):
+def get_product_id_from_eeprom(valid_ids, cmd='eeprom-id'):
"""Return the mboard product ID
Returns something like n300, n310, e320...
"""
- cmd = ['eeprom-id']
output = subprocess.check_output(
- cmd,
+ [cmd],
stderr=subprocess.STDOUT,
shell=True,
).decode('utf-8')