Commit graph

307 commits

Author SHA1 Message Date
Martin Braun
3d2a9ac551 mpm: n310: Refactor N3xx periph manager
- Sort methods by functional groups
- Reorder init from less likely to fail to more likely (this enables
  the LINK LED on claim for when FPGA fails to initialize, e.g. on
  compat errors)
2018-01-16 12:55:24 -08:00
Martin Braun
2d424a54fc mpm: Refactor PeriphManager classes
- Sort methods by functional groups
- Removed some cruft
2018-01-16 12:10:37 -08:00
Trung N Tran
400713fba4 mpm: add init clock and time source from args
Reviewed-by: Martin Braun <martin.braun@ettus.com>
2018-01-16 09:51:51 -08:00
Martin Braun
66d0257b2e mpm: Enable systemd watchdog and update it from MPM
- Updated systemd service file
- Added health status flag in shared data object
- Added thread in RPC process to update watchdog

Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com>
2018-01-15 10:45:07 -08:00
Martin Braun
032e483adc mpm: sys_utils: Add watchdog module
Reviewed-by: Moritz Fischer <moritz.fischer@ettus.com>
2018-01-15 10:45:07 -08:00
Martin Braun
4e873a4cb1 mpm: n310: Check all periphs for initialization status 2018-01-12 18:17:54 -08:00
Trung N Tran
7ffea3746b mpm: mg: Pass deserializer_lane_xbar to ad937x_config
Slot A and Slot B are different in how the JESD lanes are connected.
We now pass in different deserializer_lane_xbar config values for each slot.

Reviewed-by: Martin Braun <martin.braun@ettus.com>
Reviewed-by: Daniel Jepson <daniel.jepson@ettus.com>
Reviewed-by: Mark Meserve <mark.meserve@ni.com>
2018-01-12 16:21:15 -08:00
Martin Braun
1821168103 mpm: n310: Fix various bugs in sensor API 2018-01-12 16:18:01 -08:00
djepson1
ebfd551c35 mpm: tdc: add signature/revision checks and master reset routine
Reviewed-by: Martin Braun <martin.braun@ettus.com>
2018-01-12 13:14:05 -08:00
Brent Stapleton
536ea85497 fixup! mpm: adding GPS sensor functions 2018-01-11 14:56:14 -08:00
Martin Braun
ca74d5cd8c mpm: periph_manager: Pass default args to dboard manager 2018-01-11 14:50:12 -08:00
Martin Braun
cdc9d60e73 mpm: utils: Fix to_native_str for non-string types
Before, you couldn't use to_native_str for objects such as integers
(i.e., anything that was not a bytes-like object).
2018-01-11 14:50:12 -08:00
Martin Braun
dd29b7be30 mpm: dboard_manager: Use mpmutils.to_native_str instead of local hack 2018-01-11 14:50:12 -08:00
Martin Braun
1889469efc mpm: usrp_hwd: Fix logging issue on default_args failure
Failure to provide valid default args no longer results in an
unexpected error.
Also fixed minor formatting issues (PyLint).
2018-01-11 14:50:12 -08:00
Martin Braun
d682a90255 mpm: Factor GPIO panel code into common module
GPIOBank is the new class, n310.FrontpanelGPIO and BackpanelGPIO now
derive from that.

Other minor changes:
- Renamed classes to FrontpanelGPIO and BackpanelGPIO in accordance
  with coding guidelines
- Moved MboardRegsControl before n310 class for consistent code layout
2018-01-10 17:31:21 -08:00
Moritz Fischer
ab1148d62d mpm: Add code to drive the back panel LEDs
Add code to drive back panel LEDs for GPS, Link (claim) and REF

Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
Reviewed-By: Martin Braun <martin.braun@ettus.com>
2018-01-10 17:31:21 -08:00
Martin Braun
7d428c1b8e mpm: n310: Add status monitor thread
This thread is able to update software-controlled status pins, such as
back-panel LEDs.
2018-01-10 17:31:21 -08:00
Martin Braun
7d67fe5c29 mpm: n310: Shuffle around location of functions for better browsability 2018-01-10 17:31:21 -08:00
Martin Braun
410e87e282 mpm: Add API call for claim and unclaim
These are hooks that the RPC server calls into when claiming a device,
and allow the device implementation to trigger user-definable actions
on claiming/unclaiming.
2018-01-10 17:31:21 -08:00
Martin Braun
0691c5ea75 mpm: Spawn periph manager inside the RPC process
Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
2018-01-10 17:29:49 -08:00
Martin Braun
c5acc08e67 mpm: Bump default log level to INFO 2018-01-10 13:42:28 -08:00
Martin Braun
02b407c921 mpmd: Add API to read back logs from device and send to native logging 2018-01-10 12:25:13 -08:00
Martin Braun
838b71902f mpm: n310: Factor out compat number check
Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
2018-01-08 16:33:10 -08:00
Martin Braun
877f833983 mpm: utils: Add assert_compat_number function
Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
2018-01-08 16:33:10 -08:00
Martin Braun
de88d61c54 mpm: n310: Move SID re-alloc log message to right spot 2018-01-08 16:28:00 -08:00
Martin Braun
121c37751c mpm: Add API to read back log buffer
Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
2018-01-08 11:48:25 -08:00
djepson1
476f888392 jesd: mg bug fix: default state of the RX link is scrambled
Reviewed-by: Trung Trang <trung.tran@ettus.com>
2018-01-05 14:05:17 -08:00
Brent Stapleton
1398aaab34 fixup! mpm: mg: Added magnesium_update_cpld.py 2018-01-05 10:28:09 -08:00
Martin Braun
33c944dbdf mpm: mg: Assert that ref clock freq was actually set before init()
There was a theoretical chance otherwise that we forgot to set the
ref_clock_freq value and it set up the LMK incorrectly.

Reviewed-by: Daniel Jepson <daniel.jepson@ettus.com>
2018-01-05 10:26:00 -08:00
djepson1
f5cf6460e8 mg cpld: update compatibility checking to major/minor
Reviewed-by: Ashish Chaudhari <ashish.chaudhari@ettus.com>
Reviewed-by: Martin Braun <martin.braun@ettus.com>
2018-01-04 14:13:33 -08:00
djepson1
d36c3a7f8c jesd: add in detailed error reporting for JESD204b links
- add version control checks and bump to match latest core
 - add detailed mykonos reporting
 - add detailed fpga deframer reporting
 - misc cleanup

Reviewed-by: Ashish Chaudhari <ashish.chaudhari@ettus.com>
Reviewed-by: Martin Braun <martin.braun@ettus.com>
2018-01-04 07:27:00 -08:00
Martin Braun
7a588a5645 mpm: n310: Fix setting time source 2017-12-22 16:47:50 -08:00
Ashish Chaudhari
57ec3d765a n3xx: MPM: Add FPGA build timestamp
- Fixed the interpretation of the git hash

Reviewed-by: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:06:11 -08:00
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