mpm: n3xx: Don't set time and clock source without dboards

When there are no daughterboards present, clock and time source are
meaningless. It's also possible that corresponding FPGA images are not
loaded, in which case trying to set those could crash the system. Unless
daughterboards are actually present, these settings won't get applied
any more.
This commit is contained in:
Martin Braun 2017-08-09 13:22:27 -07:00
parent 8ecb09be8b
commit 8ee3da3ef9

View File

@ -229,12 +229,20 @@ class n310(PeriphManagerBase):
self._ext_clock_freq = float(
default_args.get('ext_clock_freq', N3XX_DEFAULT_EXT_CLOCK_FREQ)
)
self.set_clock_source(
default_args.get('clock_source', N3XX_DEFAULT_CLOCK_SOURCE)
)
self.set_time_source(
default_args.get('time_source', N3XX_DEFAULT_TIME_SOURCE)
)
if len(self.dboards) == 0:
self.log.warning(
"No dboards found, skipping setting clock and time source " \
"configuration."
)
self._clock_source = N3XX_DEFAULT_CLOCK_SOURCE
self._time_source = N3XX_DEFAULT_TIME_SOURCE
else:
self.set_clock_source(
default_args.get('clock_source', N3XX_DEFAULT_CLOCK_SOURCE)
)
self.set_time_source(
default_args.get('time_source', N3XX_DEFAULT_TIME_SOURCE)
)
def init(self, args):
"""