aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/periph_manager/n310.py
diff options
context:
space:
mode:
authorBrent Stapleton <brent.stapleton@ettus.com>2017-11-27 18:21:23 -0800
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:05:57 -0800
commit19cdfb4148338a94bdc75194e0fadad993c37758 (patch)
treeb308cd3225fae0c68551c21ad19941d22b56176b /mpm/python/usrp_mpm/periph_manager/n310.py
parent48d5d72fd76bbf615ea88fa9d5177471ed3d15a9 (diff)
downloaduhd-19cdfb4148338a94bdc75194e0fadad993c37758.tar.gz
uhd-19cdfb4148338a94bdc75194e0fadad993c37758.tar.bz2
uhd-19cdfb4148338a94bdc75194e0fadad993c37758.zip
mpm: Reset periph manager on update
Upon updating certain components (the FPGA, for example), the Peripheral Manager is restarted, and the overlay is reapplied. In order to facilitate this, the RPC server intercepts and handles the update_component function. Tested on the RJ45 ethernet connection. It probably won't work as well if the SFP connection goes down when the overlay is removed.
Diffstat (limited to 'mpm/python/usrp_mpm/periph_manager/n310.py')
-rw-r--r--mpm/python/usrp_mpm/periph_manager/n310.py16
1 files changed, 16 insertions, 0 deletions
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
###########################################################################