Commit graph

274 commits

Author SHA1 Message Date
Martin Braun
29bff463b2 mpm: n310: Add temp and fan sensors 2017-12-22 15:06:11 -08:00
Trung Tran
0db52a520b mpm: Add sysfs_thermal module
This will provide an API call to read thermal values via udev.
2017-12-22 15:06:11 -08:00
Martin Braun
e2b155726e mpm: mg: Fix CPLD rev check
Now checks the oldest-compat-rev register. Current rev is read out for
logging purposes.

Reviewed-by: Daniel Jepson <daniel.jepson@ettus.com>
Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com>
2017-12-22 15:06:03 -08:00
Ashish Chaudhari
8eeb664b67 n3xx: Removed PHY reset after Aurora BIST
- A PHY reset is not needed for SFP Aurora. It is only really
  useful when the entire quad including the commong clocking
  block needs to be reset
2017-12-22 15:06:03 -08:00
Martin Braun
edc8170246 mpm: Drop default log level to DEBUG 2017-12-22 15:06:03 -08:00
Martin Braun
27f2aa86ac n310: Move SID framing all the way to n310.py
MPM will now no longer keep a SID framer variable.

Reviewed-by: Trung Tran <trung.tran@ettus.com>
Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
2017-12-22 15:06:03 -08:00
djepson1
2a83c6133f mg: ignore Mykonos framer error
According to ADI, this bit toggles a lot so ignoring it for now.
2017-12-22 15:06:03 -08:00
djepson1
62efbfff1e mpm: mg: Repeat deframer init upon failure
This is a band-aid solution.
2017-12-22 15:06:03 -08:00
Ashish Chaudhari
2e32f96291 n3xx: Updated Aurora BIST reg offsets
- Aurora registers moved around after SFP refactoring
  in the FPGA. Reflecting changes in MPM
2017-12-22 15:06:03 -08:00
Martin Braun
a5432174b9 mpm: Fix linter warnings
- Magnesium: Bad formatting in DRP setup
- PeriphManagerBase: Import order
- dtoverlay: Missed default value for param
2017-12-22 15:06:03 -08:00
Martin Braun
5599b95b78 mpm: n310: Set default clock source to 'internal' 2017-12-22 15:06:03 -08:00
Martin Braun
08be477b88 mpm: periph_manager: Clarify request/commit protocol 2017-12-22 15:05:59 -08:00
Martin Braun
f45e3c3df0 mpm: xports: Sort requested transport options by QoS
Reviewed-by: Trung Tran <trung.tran@ettus.com>
2017-12-22 15:05:59 -08:00
Martin Braun
77dd58640c mpm: udp xport: Bind SID addr 0 and 1 to respective SFP ports
Reviewed-by: Trung Tran <trung.tran@ettus.com>
2017-12-22 15:05:59 -08:00
Martin Braun
8b700c7e08 mpm: udp xport: Increment TX/RX allocations for streamers
Reviewed-by: Trung Tran <trung.tran@ettus.com>
2017-12-22 15:05:59 -08:00
Martin Braun
a3cbdf481b mpm: xports: Amend protocol for request/commit xport, add allocation
Reviewed-by: Trung Tran <trung.tran@ettus.com>
2017-12-22 15:05:59 -08:00
Martin Braun
7c7d509017 mpm: Fix ECHO command
The echo server was using the wrong socket options, allowing responses
to be fragmented. Since we use the echo server for MTU discovery, that
would have beaten the purpose.

Also includes minor formatting fixes.
2017-12-22 15:05:59 -08:00
Martin Braun
87dbcd9f1a mpmd: Refactor MPM transport architecture, use managers
This splits up the transport code in mpmd_impl across multiple classes
to properly leverage the request_xport/commit_xport API in MPM.
Different types of transport (UDP, liberio) use their own distinct
classes, which are generated dynamically on request.

This is a true refactoring despite the large amount of changes; there
are no functional differences.

Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
Reviewed-By: Trung Tran <trung.tran@ettus.com>
Reviewed-By: Ashish Chaudhari <ashish.chaudhari@ettus.com>
2017-12-22 15:05:58 -08:00
Brent Stapleton
a927a364c5 mpm: mpmd: Add MPM compat number check
Reviewed-by: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:58 -08:00
Martin Braun
0c94fff330 mpm: rpc_server: Unregister old RPC calls _init_rpc_calls()
On FPGA loads, when the periph_manager is respawned, this will now
clear the previously registered methods.

Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
2017-12-22 15:05:58 -08:00
Martin Braun
20160e8061 mpm: rpc_server: Fix use of to_binary_str()
Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
2017-12-22 15:05:58 -08:00
Brent Stapleton
02cbe06c30 mpm: mg: Added magnesium_update_cpld.py
Reviewed-by: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:58 -08:00
Brent Stapleton
f7e88fbf03 mpm: adding GPS time sensor
Adding GPS time sensor to MPM, and its respective getter.

Reviewed-By: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:58 -08:00
Daniel Jepson
6e1213149a mpm: tdc: fixed typos in comments
Reviewed-By: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:58 -08:00
Daniel Jepson
cb44bccd1e mpm: tdc: compensate for the trace delay differences between daughterboards
Reviewed-By: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:58 -08:00
Martin Braun
d5e44fe6e4 mpm: n310: Support RevE
Bump the max supported rev accordingly.

Reviewed-By: Trung Tran <trung.tran@ettus.com>
2017-12-22 15:05:58 -08:00
Martin Braun
fadf6e2eba mpm: mg: Fix lookup of user EEPROM map
For unknown revs, this now scales back to the last known rev.

Reviewed-By: Trung Tran <trung.tran@ettus.com>
2017-12-22 15:05:58 -08:00
Martin Braun
8815098747 mpm: Harmonize all license header
Now uses SPDX headers everywhere.
2017-12-22 15:05:58 -08:00
Trung N Tran
d899f160d8 mpm: n310: add fpga compat number check
Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
Reviewed-By: Sugandha Gupta <sugandha.gupta@ettus.com>
Reviewed-By: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:58 -08:00
Martin Braun
8210fc9b17 mpm: xport: Let UDP manager re-enumerate available CHDR ifaces on init()
This will enumerate CHDR interfaces as late as possible, so that the
user changing the IP address will not affect operations. Note that IP
is considered static during a UHD session.
2017-12-22 15:05:58 -08:00
Brent Stapleton
0bf22a3e57 mpm: UIOs now open only when necessary
Refactoring to use the C++-based UIO objects. The Liberio and Ethernet
objects now open the UIO before using it, and close it once done.

Reviewed-By: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:58 -08:00
Brent Stapleton
cb6d78d9e8 mpm: adding GPS sensor functions
Adding GPS TPV and SKY sensors to MPM, and their respective getters.

Reviewed-By: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:58 -08:00
Martin Braun
d3e6dd1140 mpm: Harmonize imports, tidy + sort modules
- Moved nijesdcore to cores/
- Moved udev, net, dtoverlay, uio to sys_utils/
- Made all imports non-relative (except in __init__.py files)
- Removed some unnecessary imports
- Reordered some imports for Python conventions
2017-12-22 15:05:58 -08:00
djepson1
66af893e43 n3xx: enable DRP access to DB MGTS & QPLLs
- re-structured Magnesium.init_jesd() sequence to accomodate the reconfiguration
 - added DRP access protocols to nijesdcore.py
 - cleaned up a few comments and log statements in nijesdcore.py for flow

Reviewed-By: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:58 -08:00
Martin Braun
58a096dbb6 mpm: bfrfs: Assert reference buffer is a byte string
Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
2017-12-22 15:05:58 -08:00
Trung N Tran
b9a0cf1467 mpm: Enable TX external LO set through args, simplify code
Simplify the process of setting external LO without calling through many API
layers.

Reviewed-By: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:57 -08:00
Daniel Jepson
7766d5ef39 tdc: fix bug in pps capture reporting
Reviewed-By: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:57 -08:00
Daniel Jepson
d7c6c35216 mpm: add all time_source options and complete MB clk control
- complete time_source options to match updates to fpga registers
 - add methods for each of the bitfields in the clock control register
 - add init sequences for the meas_clk MMCM and PPS output

Reviewed-By: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:57 -08:00
sugandhagupta
b0a045f069 mpm: added uio for motherboard regs
Reviewed-By: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:57 -08:00
Martin Braun
58e7022062 mpm: Factor out xport managers as own objects
- Move XportMgr classes out of n310.py
- Subclass them there and apply N310-specific settings
- Remove chdr_interfaces option from PeriphManagerBase
2017-12-22 15:05:57 -08:00
Martin Braun
06f6156f85 mpm: utils: Add string conversion utilities
Adds conversions for:
- Any-to-binary
- Any-to-UTF8
- Any-to-native
2017-12-22 15:05:57 -08:00
Trung N Tran
73334b188a mpm: close unused pyroute objects
Current code have couple places that open pyroute2 without closing it.
That seems to cause the file descriptor leakage.
This change effectively fix the issue #1964
2017-12-22 15:05:57 -08:00
Martin Braun
f357dee69c mpm: Return correct value for usrp_hwd.py --init-only
Before, it would always return success even if that failed.
2017-12-22 15:05:57 -08:00
Steven Bingler
0cb800e001 mpm: Fix python2 vs python3 zlib.crc32 output difference
Zlib's crc32 outputs signed values in python2 and unsigned values in
python3. As per this page (https://docs.python.org/2/library/zlib.html)
0xffffffff can be AND'd to the result to get the same value between
Python versions
2017-12-22 15:05:57 -08:00
Martin Braun
1e4e90d240 mpm: n310: Compile .dts files to .dtbo on update
Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
2017-12-22 15:05:57 -08:00
Martin Braun
d5d7b84ac8 mpm: mg: Refactor init(), limit object scopes
- ClockSynchronizer object has no more permanent lifetime
- DboardClockControl object lives within `with' statement
- dboard_ctrl_regs are limited to init()
2017-12-22 15:05:57 -08:00
Martin Braun
b3662efeb3 mpm: Add temporary failure for FPGA reload
Note: This is subject to removal, but makes the FPGA reloading code
available to all until we fix the reload bug.
2017-12-22 15:05:57 -08:00
Brent Stapleton
19cdfb4148 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.
2017-12-22 15:05:57 -08:00
Brent Stapleton
48d5d72fd7 mpm: adding destructor for UIO
UIO object now has an explicit destructor to properly tear down.
2017-12-22 15:05:57 -08:00
Brent Stapleton
d0cb6de410 mpm: PeriphManager decides and applies overlay
Previously, the daughterboard requested an overlay file based on SFP
preference using magic values. This commit moves the decision making to
the peripheral manager, which uses our singular name (ie 'n3xx' for the
N310).
2017-12-22 15:05:57 -08:00