Commit graph

322 commits

Author SHA1 Message Date
Martin Braun
4c81ed0a5d fixup! mpm: Log timeouts during API calls, reset timer on claimed calls 2018-01-23 15:21:28 -08:00
Martin Braun
37d4eabf27 mpm: mg: Remove superfluous import 2018-01-23 13:08:50 -08:00
Trung N Tran
58eda20beb mg: ease the usage of init and tracking cal
Using string expression instead of passing in a total hex value.
Now user can passed in for example: init_cals=DEFAULT or
init_cals=BASIC|TX_QEC_INIT

Reviewed-by: Martin Braun <martin.braun@ettus.com>
2018-01-23 12:36:42 -08:00
Martin Braun
f83f6fb464 mpm: Log timeouts during API calls, reset timer on claimed calls
Reviewed-by: Trung Tran <trung.tran@ettus.com>
2018-01-22 15:36:13 -08:00
Martin Braun
dee1d75339 mpm: n310: Fix setting time source depending on clock source
- When clock source is set, but time source is not, still set time
  source to guarantee correct ref clock freq
- Enable unconditional setting of time source

Reviewed-by: Daniel Jepson <daniel.jepson@ettus.com>
2018-01-22 14:02:24 -08:00
Martin Braun
de51d0ec9c fixup! mpm: Harmonize imports, tidy + sort modules
- Fixes n3xx_bist, which failed on a an import
2018-01-22 14:00:20 -08:00
Brent Stapleton
2ba7dba5f4 n310: removed orphaned comments 2018-01-19 17:10:09 -08:00
Brent Stapleton
ba4d59d7f2 n310: Update the dboard UIO usage
Updating the UIO usage in the debug functions in magnesium.py. Somehow
this didn't get updated before.
2018-01-19 17:10:09 -08:00
Martin Braun
15e36d8c36 mpm: Demoting watchdog related log message to DEBUG 2018-01-19 17:00:48 -08:00
Martin Braun
1400004154 mpm: Update unclaim timeout logic
- Allow configurable timeout values from the command line
- Add flag to disable timeouts for long calls; this fixes the case
  where reclaimers re-initialize a disabled timer
- Add methods for timeout event for better tracking
2018-01-18 18:26:55 -08:00
Martin Braun
b18b304f03 mpm: mg: Demote notice on LMK not being locked b/c of lacking init 2018-01-18 11:24:46 -08:00
Martin Braun
5eb2a59e1d mpm: Demoted some log statements from INFO to TRACE or DEBUG 2018-01-17 10:45:00 -08:00
Martin Braun
40c5b598c0 mpm: Refactored RPC server
- No functional changes
- Grouped methods by function
- Improved some comments
2018-01-17 10:44:50 -08:00
Martin Braun
3a58a5f03c mpm: n310: Bump compat number to 2.0
- Updated fpga-src submodule pointer
2018-01-16 13:13:51 -08:00
Martin Braun
0da3eefcc3 mpm/mpmd: Report device state using get_init_status() and verify
When trying to run init(), mpmd will first query the initialization
status of the MPM device. If it is found to be in a bad state, it will
not go forward with initialization, but instead print the error message.
2018-01-16 13:10:37 -08:00
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