diff options
author | Martin Braun <martin.braun@ettus.com> | 2017-05-23 16:11:07 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2017-12-22 15:03:53 -0800 |
commit | 5926f1b9d9f67856dac2849e9ce9961220e4e0c1 (patch) | |
tree | b1476e19cb75a31bf4129062b8bf3b5cbf235a82 /mpm/python/usrp_mpm/periph_manager/base.py | |
parent | 245b96a777afbeb84990ebb377def658879c2fa1 (diff) | |
download | uhd-5926f1b9d9f67856dac2849e9ce9961220e4e0c1.tar.gz uhd-5926f1b9d9f67856dac2849e9ce9961220e4e0c1.tar.bz2 uhd-5926f1b9d9f67856dac2849e9ce9961220e4e0c1.zip |
mpm: dt overlay handling: Better error handling, fewer FIXMEs
Diffstat (limited to 'mpm/python/usrp_mpm/periph_manager/base.py')
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/base.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py index a9259f304..143243f7a 100644 --- a/mpm/python/usrp_mpm/periph_manager/base.py +++ b/mpm/python/usrp_mpm/periph_manager/base.py @@ -324,6 +324,16 @@ class PeriphManagerBase(object): self.log.warning("No dboard PID found!") else: self.log.debug("Found dboard PID in EEPROM: 0x{:04X}".format(db_pid)) + db_class = get_dboard_class_from_pid(db_pid) + if db_class is None: + self.log.warning("Could not identify daughterboard class for PID {:04X}!".format(db_pid)) + continue + self.log.trace("Dboard requires device tree overlays: {}".format( + db_class.dt_overlays + )) + for overlay in db_class.dt_overlays: + # FIXME don't hardcode XG + dtoverlay.apply_overlay_safe(overlay.format(sfp="XG")) 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)) @@ -337,16 +347,6 @@ class PeriphManagerBase(object): 'spi_nodes': spi_nodes, } # This will actually instantiate the dboard class: - db_class = get_dboard_class_from_pid(db_pid) - if db_class is None: - self.log.warning("Could not identify daughterboard class for PID {:04X}!".format(db_pid)) - continue - self.log.trace("Dboard requires device tree overlays: {}".format( - db_class.dt_overlays - )) - for overlay in db_class.dt_overlays: - # FIXME don't hardcode XG - dtoverlay.apply_overlay_safe(overlay.format(sfp="XG")) self.dboards.append(db_class(dboard_idx, **dboard_info)) self.log.info("Found {} daughterboard(s).".format(len(self.dboards))) |