Skip to content

Commit d150449

Browse files
committed
n310: Make MPM report FPGA version and description, UHD read it
The FPGA and MPM version as well as the description of the device ("N300-Series Device") and its name (its the hostname) are now properly reported coming from MPM, properly saved in the prop tree, and uhd_usrp_probe can nicely display them this way.
1 parent d04b6e3 commit d150449

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

host/lib/usrp/mpmd/mpmd_prop_tree.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,20 @@ void mpmd_impl::init_property_tree(
9494
/*** Device info ****************************************************/
9595
if (not tree->exists("/name")) {
9696
tree->create<std::string>("/name")
97-
.set(mb->device_info.get("name", "Unknown MPM device"))
97+
.set(mb->device_info.get("description", "Unknown MPM device"))
9898
;
9999
}
100100
tree->create<std::string>(mb_path / "name")
101-
.set(mb->device_info.get("type", "UNKNOWN"));
101+
.set(mb->device_info.get("name", "UNKNOWN"));
102102
tree->create<std::string>(mb_path / "serial")
103103
.set(mb->device_info.get("serial", "n/a"));
104104
tree->create<std::string>(mb_path / "connection")
105105
.set(mb->device_info.get("connection", "UNKNOWN"));
106106
tree->create<size_t>(mb_path / "link_max_rate").set(1e9 / 8);
107+
tree->create<std::string>(mb_path / "mpm_version")
108+
.set(mb->device_info.get("mpm_version", "UNKNOWN"));
109+
tree->create<std::string>(mb_path / "fpga_version")
110+
.set(mb->device_info.get("fpga_version", "UNKNOWN"));
107111

108112
/*** Clocking *******************************************************/
109113
tree->create<std::string>(mb_path / "clock_source/value")

mpm/python/usrp_mpm/periph_manager/base.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from usrp_mpm.sys_utils.udev import get_eeprom_paths
2121
from usrp_mpm.sys_utils.udev import get_spidev_nodes
2222
from usrp_mpm.sys_utils import dtoverlay
23+
from usrp_mpm.sys_utils import net
2324
from usrp_mpm import eeprom
2425
from usrp_mpm.rpc_server import no_claim, no_rpc
2526
from usrp_mpm import prefs
@@ -54,6 +55,8 @@ class PeriphManagerBase(object):
5455
# Very important: A list of PIDs that apply to the current device. Must be
5556
# list, even if there's only one entry.
5657
pids = []
58+
# A textual description of this device type
59+
description = "MPM Device"
5760
# Address of the motherboard EEPROM. This could be something like
5861
# "e0005000.i2c". This value will be passed to get_eeprom_paths() tos
5962
# determine a full path to an EEPROM device.
@@ -447,6 +450,10 @@ def get_device_info(self):
447450
"""
448451
result = {"claimed": str(self.claimed)}
449452
result.update(self.mboard_info)
453+
result.update({
454+
'name': net.get_hostname(),
455+
'description': self.description,
456+
})
450457
result.update(self.get_device_info_dyn())
451458
return result
452459

mpm/python/usrp_mpm/periph_manager/n310.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ class n310(PeriphManagerBase):
456456
# See PeriphManagerBase for documentation on these fields
457457
#########################################################################
458458
pids = [0x4242,]
459+
description = "N300-Series Device"
459460
mboard_eeprom_addr = "e0005000.i2c"
460461
mboard_eeprom_max_len = 256
461462
mboard_info = {"type": "n3xx",
@@ -782,8 +783,13 @@ def get_device_info_dyn(self):
782783
"""
783784
Append the device info with current IP addresses.
784785
"""
785-
return self._xport_mgrs['udp'].get_xport_info() \
786+
device_info = self._xport_mgrs['udp'].get_xport_info() \
786787
if self._device_initialized else {}
788+
device_info.update({
789+
'fpga_version': "{}.{}".format(
790+
*self.mboard_regs_control.get_compat_number())
791+
})
792+
return device_info
787793

788794
###########################################################################
789795
# Clock/Time API

0 commit comments

Comments
 (0)