diff options
author | Trung Tran <trung.tran@ettus.com> | 2019-01-31 18:36:31 -0800 |
---|---|---|
committer | Ashish Chaudhari <ashish.chaudhari@ettus.com> | 2019-02-01 15:28:35 -0800 |
commit | 3fb8cfe96c293e892a02a94c5c2e51e8d2705791 (patch) | |
tree | 069914e09077bf39243d3e831dbd6e498e1df710 /mpm/python/usrp_mpm/periph_manager/base.py | |
parent | 045bee8abcc371724dd062f527ec36cccb6c187b (diff) | |
download | uhd-3fb8cfe96c293e892a02a94c5c2e51e8d2705791.tar.gz uhd-3fb8cfe96c293e892a02a94c5c2e51e8d2705791.tar.bz2 uhd-3fb8cfe96c293e892a02a94c5c2e51e8d2705791.zip |
n3xx: init peripherals before loading FPGA
Issue: Current code loads FPGA too early while many
essential peripherals such as net clocks are not brought up.
This change will make sure those are got init before FPGA loaded.
Signed-off-by: Trung Tran<trung.tran@ettus.com>
Diffstat (limited to 'mpm/python/usrp_mpm/periph_manager/base.py')
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/base.py | 52 |
1 files changed, 32 insertions, 20 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py index 1206289b9..2dc69e908 100644 --- a/mpm/python/usrp_mpm/periph_manager/base.py +++ b/mpm/python/usrp_mpm/periph_manager/base.py @@ -169,11 +169,12 @@ class PeriphManagerBase(object): ########################################################################### # Device initialization (at MPM startup) ########################################################################### - def __init__(self, args): + def __init__(self): # Note: args is a dictionary. assert len(self.pids) > 0 assert self.mboard_eeprom_magic is not None self.dboards = [] + self._default_args = "" # Set up logging self.log = get_logger('PeriphManager') self.claimed = False @@ -183,36 +184,47 @@ class PeriphManagerBase(object): self.mboard_info = self._get_mboard_info(self._eeprom_head) self.log.info("Device serial number: {}" .format(self.mboard_info.get('serial', 'n/a'))) - dboard_infos = self._get_dboard_eeprom_info() + self.dboard_infos = self._get_dboard_eeprom_info() self.device_info = \ self.generate_device_info( self._eeprom_head, self.mboard_info, - dboard_infos + self.dboard_infos ) - self._default_args = self._update_default_args(args) - self.log.debug("Using default args: {}".format(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 = [ - int(x, 0) for x in override_db_pids_str.split(",") - ] - else: - override_db_pids = [] - self._init_dboards( - dboard_infos, - override_db_pids, - self._default_args - ) - self._device_initialized = True - self._initialization_status = "No errors." except Exception as ex: self.log.error("Failed to initialize device: %s", str(ex)) self._device_initialized = False self._initialization_status = str(ex) super(PeriphManagerBase, self).__init__() + def overlay_apply(self): + """ + Apply FPGA overlay + """ + self._init_mboard_overlays() + + def init_dboards(self, args): + """ + Run full initialization of daugther boards if they're exist + Using 'override_db_pids' args to overwrite number of dboards that need to be init. + """ + self._default_args = self._update_default_args(args) + self.log.debug("Using default args: {}".format(self._default_args)) + override_db_pids_str = self._default_args.get('override_db_pids') + if override_db_pids_str: + override_db_pids = [ + int(x, 0) for x in override_db_pids_str.split(",") + ] + else: + override_db_pids = [] + self._init_dboards( + self.dboard_infos, + override_db_pids, + self._default_args + ) + self._device_initialized = True + self._initialization_status = "No errors." + def _read_mboard_eeprom(self): """ Read out mboard EEPROM. |