Commit graph

123 commits

Author SHA1 Message Date
Mark Meserve
e942181f60 mpm: allow multiple spi device objects to use the same chip select 2018-05-14 17:55:15 -07:00
Trung N Tran
546aa04355 mpm: replace long execution function with async call
- Replace mykonos finish_initialization with async version
- Replace myknonos setup_cal with async version
- Remove disable_timeout on rpc_server init()
2018-04-30 14:36:29 -07:00
Daniel Jepson
e2f9120331 mg: implement digital loopback arg for the rfic 2018-04-10 09:58:34 -07:00
Daniel Jepson
7ced80becc n3xx: add White Rabbit support
Reviewed-by: Martin Braun <martin.braun@ettus.com>
2018-03-30 11:32:07 -07:00
djepson1
38771b0f2f lmk: clean up logging statements 2018-03-07 12:40:28 -08:00
djepson1
7d0aec1890 tdc: support for tdc 2.0 2018-03-07 12:40:28 -08:00
Martin Braun
f9a8098cae mpm: Fix some Pylint warnings
No functional changes.
2018-03-06 15:45:15 -08:00
Martin Braun
ed2d1ac3e4 mpm: Demote some log messages
The log output at level 'INFO' was pretty cluttered. This cleans up the
log messages at the higher levels. In some cases, log message typos or
capitalizations were also fixed.
2018-03-06 15:28:33 -08:00
Martin Braun
725debb964 mpm: Rename n310 to n3xx
This module (and class) are, in fact, used for all N3xx-derivates so
renaming it is the more correct thing to do.
2018-03-05 15:56:41 -08:00
Martin Braun
e9288a439c mpm: Update all license headers
- Fix typo in company name (missing 'a')
- Updated SPDX license identifier to version 3.0
2018-02-19 16:55:08 -08:00
Martin Braun
2a508aabd3 mpm: mg: Move MgCPLD, TCA6408, DboardClockControl class to own module 2018-02-14 15:46:39 -08:00
Trung N Tran
a69e9fc98c mpm: mg: add cpld revision to dboard info
Reviewed-by: Martin Braun <martin.braun@ettus.com>
2018-02-12 19:57:24 +01:00
Moritz Fischer
342971d268 fixup! mpm: Changed mpm_shell to support scripted use
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
2018-02-07 16:47:50 -08:00
Moritz Fischer
2e6146707b mpm: magnesium_update_cpld.py: Add axi_bitq support
Add axi_bitq support. In order for this to work we need several
conditions to be true:

- Updated openocd
- FPGA image with axi_bitq built in and hooked up to correct pins
- Updated overlays matching the FPGA image
- An svf file with correct max frequency <= 10MHz

Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
2018-02-07 16:47:50 -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
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
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
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
Martin Braun
dd29b7be30 mpm: dboard_manager: Use mpmutils.to_native_str instead of local hack 2018-01-11 14:50:12 -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
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
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
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
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
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
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
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
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
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
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
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
Martin Braun
44b117be95 mpm: mg: Add ref lock sensor
Note: The sensor API for this lives in n310, but it queries the dboards
for a ref lock status, which is now no longer a stub.
2017-12-22 15:05:07 -08:00
Martin Braun
d2594f9a92 mpm: mg: Add flag to see if master clock rate is being changed
Note: On the first run, this flag will always assert.
2017-12-22 15:05:07 -08:00
Martin Braun
064faf09c3 mpm: mg: Fix linter errors, compacted SPI factories 2017-12-22 15:05:07 -08:00
Martin Braun
ee00c0384e mpm: mg: Move some class attributes to local scopes
The clock_synchronizer, jesdcore, and dboard_clk_control objects don't
need to exist for the full lifetime of the Magnesium class. Having them
around complicates management of UIO file descriptors.
2017-12-22 15:05:07 -08:00
Trung N Tran
d8ebabaa12 mpm: mg: Remove unused spi_factories key 2017-12-22 15:05:07 -08:00
Trung Tran
201761cfa6 mpm: mg: Set default master_clock_rate to 125 MHz at every init 2017-12-22 15:05:07 -08:00
Trung N Tran
2467deeb17 mpm: mykonos: Add API to change master clock rate 2017-12-22 15:05:07 -08:00
Martin Braun
f14b49ff5b n3xx: add support for 122.88 and 153.6 MHz sample clock rates
- re-wrote portions of the LMK driver for flexible rates and configuration
 - tweaked TDC driver for compatibility and ease of debugging
 - updated comments and log statements throughout for uniformity
2017-12-22 15:05:07 -08:00