aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/periph_manager/n3xx.py
diff options
context:
space:
mode:
Diffstat (limited to 'mpm/python/usrp_mpm/periph_manager/n3xx.py')
-rw-r--r--mpm/python/usrp_mpm/periph_manager/n3xx.py53
1 files changed, 29 insertions, 24 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/n3xx.py b/mpm/python/usrp_mpm/periph_manager/n3xx.py
index b018d055e..cd80d0d33 100644
--- a/mpm/python/usrp_mpm/periph_manager/n3xx.py
+++ b/mpm/python/usrp_mpm/periph_manager/n3xx.py
@@ -219,11 +219,36 @@ class n3xx(ZynqComponents, PeriphManagerBase):
self._available_endpoints = list(range(256))
self._bp_leds = None
self._gpsd = None
- super(n3xx, self).__init__(args)
- if not self._device_initialized:
- # Don't try and figure out what's going on. Just give up.
- return
+ super(n3xx, self).__init__()
try:
+ # Init peripherals
+ # these peripherals are specific to mboard and
+ # need to configured before applying fpga overlay
+ self._gpios = TCA6424(int(self.mboard_info['rev']))
+ self.log.trace("Enabling power of MGT156MHZ clk")
+ self._gpios.set("PWREN-CLK-MGT156MHz")
+ self.enable_1g_ref_clock()
+ self.enable_wr_ref_clock()
+ self.enable_gps(
+ enable=str2bool(
+ args.get('enable_gps', N3XX_DEFAULT_ENABLE_GPS)
+ )
+ )
+ self.enable_fp_gpio(
+ enable=str2bool(
+ args.get(
+ 'enable_fp_gpio',
+ N3XX_DEFAULT_ENABLE_FPGPIO
+ )
+ )
+ )
+ # Apply overlay
+ self.overlay_apply()
+ # Run dboards init
+ self.init_dboards(args)
+ if not self._device_initialized:
+ # Don't try and figure out what's going on. Just give up.
+ return
self._init_peripherals(args)
except Exception as ex:
self.log.error("Failed to initialize motherboard: %s", str(ex))
@@ -317,28 +342,8 @@ class n3xx(ZynqComponents, PeriphManagerBase):
# Sanity checks
assert self.device_info.get('product') in self.product_map.values(), \
"Device product could not be determined!"
- # Init peripherals
- self.log.trace("Initializing TCA6424 port expander controls...")
- self._gpios = TCA6424(int(self.mboard_info['rev']))
self.log.trace("Initializing back panel LED controls...")
self._bp_leds = BackpanelGPIO()
- self.log.trace("Enabling power of MGT156MHZ clk")
- self._gpios.set("PWREN-CLK-MGT156MHz")
- self.enable_1g_ref_clock()
- self.enable_wr_ref_clock()
- self.enable_gps(
- enable=str2bool(
- args.get('enable_gps', N3XX_DEFAULT_ENABLE_GPS)
- )
- )
- self.enable_fp_gpio(
- enable=str2bool(
- args.get(
- 'enable_fp_gpio',
- N3XX_DEFAULT_ENABLE_FPGPIO
- )
- )
- )
# Init Mboard Regs
self.mboard_regs_control = MboardRegsControl(
self.mboard_regs_label, self.log)