From 22d684c3c8db8644cbdaf7b2955048050007ec30 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 7 May 2018 18:22:52 -0700 Subject: mpm: Use device_info to determine overlay list --- mpm/python/usrp_mpm/periph_manager/base.py | 12 +++++------- mpm/python/usrp_mpm/periph_manager/n3xx.py | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'mpm/python/usrp_mpm') diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py index 7d811af3f..d1f2c9f92 100644 --- a/mpm/python/usrp_mpm/periph_manager/base.py +++ b/mpm/python/usrp_mpm/periph_manager/base.py @@ -141,7 +141,7 @@ class PeriphManagerBase(object): @staticmethod # Yes, this is overridable too: List the required device tree overlays - def list_required_dt_overlays(eeprom_md, device_args): + def list_required_dt_overlays(device_info): """ Lists device tree overlays that need to be applied before this class can be used. List of strings. @@ -181,10 +181,9 @@ class PeriphManagerBase(object): self.mboard_info, dboard_infos ) - self.log.warning(self.device_info) self._default_args = self._update_default_args(args) self.log.debug("Using default args: {}".format(self._default_args)) - self._init_mboard_overlays(self._eeprom_head, self._default_args) + self._init_mboard_overlays() override_db_pids_str = self._default_args.get('override_db_pids') if override_db_pids_str: override_db_pids = [ @@ -346,15 +345,14 @@ class PeriphManagerBase(object): else: return default_args - def _init_mboard_overlays(self, eeprom_md, device_args): + def _init_mboard_overlays(self): """ Load all required overlays for this motherboard """ requested_overlays = self.list_required_dt_overlays( - eeprom_md, - device_args, + self.device_info, ) - self.log.trace("Motherboard requests device tree overlays: {}".format( + self.log.debug("Motherboard requests device tree overlays: {}".format( requested_overlays )) for overlay in requested_overlays: diff --git a/mpm/python/usrp_mpm/periph_manager/n3xx.py b/mpm/python/usrp_mpm/periph_manager/n3xx.py index 2887df052..0b7c40c24 100644 --- a/mpm/python/usrp_mpm/periph_manager/n3xx.py +++ b/mpm/python/usrp_mpm/periph_manager/n3xx.py @@ -166,7 +166,7 @@ class n3xx(PeriphManagerBase): return device_info @staticmethod - def list_required_dt_overlays(eeprom_md, device_args): + def list_required_dt_overlays(device_info): """ Lists device tree overlays that need to be applied before this class can be used. List of strings. @@ -177,7 +177,7 @@ class n3xx(PeriphManagerBase): """ # In the N3xx case, we name the dtbo file the same as the product. # N310 -> n310.dtbo, N300 -> n300.dtbo and so on. - return [n3xx.pids[eeprom_md['pid']]] + return [device_info['product']] ########################################################################### # Ctor and device initialization tasks -- cgit v1.2.3