diff options
author | Brent Stapleton <brent.stapleton@ettus.com> | 2017-11-20 14:35:07 -0800 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:05:57 -0800 |
commit | d0cb6de41061be2a3eaecefe3bd7874e9a7470ff (patch) | |
tree | 2397e629f1b7cb66a59c620b49d7ee93e3f083e9 /mpm/python | |
parent | 2eb1a5cfc37606939c2d348273d938e9e97949a5 (diff) | |
download | uhd-d0cb6de41061be2a3eaecefe3bd7874e9a7470ff.tar.gz uhd-d0cb6de41061be2a3eaecefe3bd7874e9a7470ff.tar.bz2 uhd-d0cb6de41061be2a3eaecefe3bd7874e9a7470ff.zip |
mpm: PeriphManager decides and applies overlay
Previously, the daughterboard requested an overlay file based on SFP
preference using magic values. This commit moves the decision making to
the peripheral manager, which uses our singular name (ie 'n3xx' for the
N310).
Diffstat (limited to 'mpm/python')
-rw-r--r-- | mpm/python/usrp_mpm/dboard_manager/base.py | 13 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/dboard_manager/eiscat.py | 13 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/dboard_manager/magnesium.py | 14 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/base.py | 15 | ||||
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/n310.py | 16 |
5 files changed, 14 insertions, 57 deletions
diff --git a/mpm/python/usrp_mpm/dboard_manager/base.py b/mpm/python/usrp_mpm/dboard_manager/base.py index 82263bddc..3f5f3adb8 100644 --- a/mpm/python/usrp_mpm/dboard_manager/base.py +++ b/mpm/python/usrp_mpm/dboard_manager/base.py @@ -43,19 +43,6 @@ class DboardManagerBase(object): # maps these keys to actual spidev paths. Also throws a warning/error if # the SPI configuration is invalid. spi_chipselect = {} - @staticmethod - def list_required_dt_overlays(eeprom_md, sfp_config, device_args): - """ - Lists device tree overlays that need to be applied before this class can - be used. List of strings. - Are applied in order. - - eeprom_md -- Dictionary of info read out from the dboard EEPROM - sfp_config -- A string identifying the configuration of the SFP ports. - Example: "XG", "HG", "XA", ... - device_args -- Arbitrary dictionary of info, typically user-defined - """ - return [] ### End of overridables ################################################# def __init__(self, slot_idx, **kwargs): diff --git a/mpm/python/usrp_mpm/dboard_manager/eiscat.py b/mpm/python/usrp_mpm/dboard_manager/eiscat.py index 06b647eec..15037086f 100644 --- a/mpm/python/usrp_mpm/dboard_manager/eiscat.py +++ b/mpm/python/usrp_mpm/dboard_manager/eiscat.py @@ -407,19 +407,6 @@ class EISCAT(DboardManagerBase): "phase_dac": create_spidev_iface_phasedac, } - @staticmethod - def list_required_dt_overlays(eeprom_md, sfp_config, device_args): - """ - Lists device tree overlays that need to be applied before this class can - be used. List of strings. - Are applied in order. - - eeprom_md -- Dictionary of info read out from the dboard EEPROM - sfp_config -- A string identifying the configuration of the SFP ports. - Example: "XG", "HG", "XA", ... - device_args -- Arbitrary dictionary of info, typically user-defined - """ - return ['eiscat-{sfp}'.format(sfp=sfp_config)] # Daughterboard Control Register address constants ADC_CONTROL = 0x0600 diff --git a/mpm/python/usrp_mpm/dboard_manager/magnesium.py b/mpm/python/usrp_mpm/dboard_manager/magnesium.py index ae854ec81..2c418859b 100644 --- a/mpm/python/usrp_mpm/dboard_manager/magnesium.py +++ b/mpm/python/usrp_mpm/dboard_manager/magnesium.py @@ -284,20 +284,6 @@ class Magnesium(DboardManagerBase): } # Maps the chipselects to the corresponding devices: spi_chipselect = {"cpld": 0, "lmk": 1, "mykonos": 2, "phase_dac": 3} - @staticmethod - def list_required_dt_overlays(eeprom_md, sfp_config, device_args): - """ - Lists device tree overlays that need to be applied before this class can - be used. List of strings. - Are applied in order. - - eeprom_md -- Dictionary of info read out from the dboard EEPROM - sfp_config -- A string identifying the configuration of the SFP ports. - Example: "XG", "HG", "XA", ... - device_args -- Arbitrary dictionary of info, typically user-defined - """ - return ['magnesium-{sfp}'.format(sfp=sfp_config)] - ### End of overridables ################################################# # Class-specific, but constant settings: spi_factories = { diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py index 4d58b0933..87544e451 100644 --- a/mpm/python/usrp_mpm/periph_manager/base.py +++ b/mpm/python/usrp_mpm/periph_manager/base.py @@ -237,20 +237,6 @@ class PeriphManagerBase(object): """ Initialize all the daughterboards """ - def _init_dboards_overlay(db_class): - """ - Load the required overlays for this dboard. - """ - requested_overlays = db_class.list_required_dt_overlays( - dboard_eeprom_md, - 'XG', # FIXME don't hardcode - {}, # FIXME don't hardcode - ) - self.log.trace("Dboard requires device tree overlays: {}".format( - requested_overlays - )) - for overlay in requested_overlays: - dtoverlay.apply_overlay_safe(overlay) # Go, go, go! override_dboard_pids = override_dboard_pids or [] dboard_eeprom_addrs = self.dboard_eeprom_addr \ @@ -295,7 +281,6 @@ class PeriphManagerBase(object): if db_class is None: self.log.warning("Could not identify daughterboard class for PID {:04X}!".format(db_pid)) continue - _init_dboards_overlay(db_class) if len(self.dboard_spimaster_addrs) > dboard_idx: spi_nodes = sorted(get_spidev_nodes(self.dboard_spimaster_addrs[dboard_idx])) self.log.debug("Found spidev nodes: {0}".format(spi_nodes)) diff --git a/mpm/python/usrp_mpm/periph_manager/n310.py b/mpm/python/usrp_mpm/periph_manager/n310.py index 912b7678b..7adbc85f0 100644 --- a/mpm/python/usrp_mpm/periph_manager/n310.py +++ b/mpm/python/usrp_mpm/periph_manager/n310.py @@ -475,14 +475,26 @@ class n310(PeriphManagerBase): updateable_components = { 'fpga': { 'callback': "update_fpga", - 'path': '/lib/firmware/n310.bin', + 'path': '/lib/firmware/n3xx.bin', }, 'dts': { 'callback': "update_dts", - 'path': '/lib/firmware/n310.dts', + 'path': '/lib/firmware/n3xx.dts', }, } + @staticmethod + def list_required_dt_overlays(eeprom_md, device_args): + """ + Lists device tree overlays that need to be applied before this class can + be used. List of strings. + Are applied in order. + + eeprom_md -- Dictionary of info read out from the mboard EEPROM + device_args -- Arbitrary dictionary of info, typically user-defined + """ + return ['n3xx'] + def __init__(self, args): super(n310, self).__init__(args) self._device_initialized = False |