From 1a9033b3e96654dcd374f9d2effe5751b36130f2 Mon Sep 17 00:00:00 2001 From: Toni Jones Date: Fri, 12 Apr 2019 15:12:06 -0500 Subject: mpm: Add DboardIface for MB DB driver control Add DboardIface class which will act as an interface to bridge the gap between MB and DB drivers in MPM. The DboardIface will be implemented by each Motherboard with MB specific information. Dboard objects will then instantiate the class in order to utilize the implemented control functions. --- mpm/python/usrp_mpm/periph_manager/base.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mpm/python/usrp_mpm/periph_manager/base.py') diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py index c2da31b8f..2b4b297ed 100644 --- a/mpm/python/usrp_mpm/periph_manager/base.py +++ b/mpm/python/usrp_mpm/periph_manager/base.py @@ -117,6 +117,10 @@ class PeriphManagerBase(object): # The index of the first port of the RFNoC crossbar which is connected to # an RFNoC block crossbar_base_port = 0 + # A DboardIface class which will be passed to the discovered DB + # constructors. + # If None, the MB does not support the DB Iface architecture. + db_iface = None # Address of the daughterboard EEPROMs. This could be something like # "e0004000.i2c". This value will be passed to get_eeprom_paths() to # determine a full path to an EEPROM device. @@ -488,6 +492,10 @@ class PeriphManagerBase(object): 'spi_nodes': spi_nodes, 'default_args': default_args, }) + # If the MB supports the DB Iface architecture, pass + # the corresponding DB Iface to the dboard class + if self.db_iface is not None: + dboard_info['db_iface'] = self.db_iface(dboard_idx, self) # This will actually instantiate the dboard class: self.dboards.append(db_class(dboard_idx, **dboard_info)) self.log.info("Initialized %d daughterboard(s).", len(self.dboards)) -- cgit v1.2.3