aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/periph_manager
diff options
context:
space:
mode:
Diffstat (limited to 'mpm/python/usrp_mpm/periph_manager')
-rw-r--r--mpm/python/usrp_mpm/periph_manager/base.py8
-rw-r--r--mpm/python/usrp_mpm/periph_manager/n310.py16
2 files changed, 23 insertions, 1 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py
index 87544e451..2be8c7570 100644
--- a/mpm/python/usrp_mpm/periph_manager/base.py
+++ b/mpm/python/usrp_mpm/periph_manager/base.py
@@ -352,6 +352,13 @@ class PeriphManagerBase(object):
self.log.trace("Resetting SID pool...")
self._available_endpoints = list(range(256))
+ def tear_down(self):
+ """
+ Tear down all members that need to be specially handled before
+ deconstruction.
+ """
+ self.log.debug("Teardown called for Peripheral Manager base.")
+
@no_claim
def list_updateable_components(self):
"""
@@ -456,7 +463,6 @@ class PeriphManagerBase(object):
update_func(filepath, metadata)
return True
-
def load_fpga_image(self, target=None):
"""
load a new fpga image
diff --git a/mpm/python/usrp_mpm/periph_manager/n310.py b/mpm/python/usrp_mpm/periph_manager/n310.py
index 7adbc85f0..79c866aa4 100644
--- a/mpm/python/usrp_mpm/periph_manager/n310.py
+++ b/mpm/python/usrp_mpm/periph_manager/n310.py
@@ -31,6 +31,7 @@ from ..net import get_mac_addr
from ..mpmtypes import SID
from usrp_mpm.rpc_server import no_rpc
from usrp_mpm import net
+from usrp_mpm import dtoverlay
from ..sysfs_gpio import SysFSGPIO
from ..ethtable import EthDispatcherTable
from ..liberiotable import LiberioDispatcherTable
@@ -476,10 +477,12 @@ class n310(PeriphManagerBase):
'fpga': {
'callback': "update_fpga",
'path': '/lib/firmware/n3xx.bin',
+ 'reset': True,
},
'dts': {
'callback': "update_dts",
'path': '/lib/firmware/n3xx.dts',
+ 'reset': False,
},
}
@@ -586,6 +589,19 @@ class n310(PeriphManagerBase):
for xport_mgr in itervalues(self._xport_mgrs):
xport_mgr.deinit()
+ def tear_down(self):
+ """
+ Tear down all members that need to be specially handled before
+ deconstruction.
+ For N310, this means the overlay.
+ """
+ active_overlays = self.list_active_overlays()
+ self.log.trace("N310 has active device tree overlays: {}".format(
+ active_overlays
+ ))
+ for overlay in active_overlays:
+ dtoverlay.rm_overlay(overlay)
+
###########################################################################
# Transport API
###########################################################################