Commit graph

488 commits

Author SHA1 Message Date
Brent Stapleton
967be2a4e8 uhd: mpm: apply clang-format to all files
Applying formatting changes to all .cpp and .hpp files in the following
directories:
```
find host/examples/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/tests/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/dboard/neon/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/dboard/magnesium/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/device3/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/mpmd/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/lib/usrp/x300/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find host/utils/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
find mpm/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
```

Also formatted host/include/, except Cpp03 was used as a the language
standard instead of Cpp11.
```
sed -i 's/ Cpp11/ Cpp03/g' .clang-format
find host/include/ -iname *.hpp -o -iname *.cpp | \
    xargs clang-format -i -style=file
```

Formatting style was designated by the .clang-format file.
2019-01-16 11:40:23 -08:00
Mark Meserve
ec0b4dd127 rh: general code cleanup
- Add default bandwidth range
- Add default mash order constant
- Delete MPM todos
- Cleanup whitespace in MPM python code
- Add docstring for is_lo_dist_present
2019-01-10 09:50:16 -08:00
Toni Jones
f63c089a34 mpm: Add gpgga sensor function to GPSd iface
Add method to generate GPGGA sensor data in MPM devices. This needs to
be constructed from TPV and SKY sensor data, and matches the GPGGA
sensor functionality in gpsd_iface.cpp.
2019-01-03 18:54:43 -08:00
Martin Braun
b7bab6a44f mpm: Factor out user EEPROM code into own module
Affects Magnesium and Rhodium classes, which where duplicating this
code.
2018-12-20 14:57:54 -08:00
Ryan Marlow
5a5f604994 uhd/mpm: eiscat: Various changes
- correct lmk initialization parameters
- adding missing parameters and consts wrt clock synchronization.
- fixed default master clock rate
- eiscat, ddc: update xml.
 - remove references to CORDIC_FREQ in ddc_eiscat
 - update readback reg addr in radio_eiscat
 - set default spp from 3992 to 3968.
- updated jesd mode sequence initialization
- updating eiscat_radio_ctrl_impl
 - add rx_codecs to property tree to display correct ADC chip.
 - updated issue_stream_cmd
2018-12-19 09:36:51 -08:00
Mark Meserve
22836d65e7 rh: remove polarity setting for sdclkout11
- output 11 is unused, a value of 0 will leave the polarity as normal
2018-12-12 16:27:25 -08:00
Mark Meserve
75ee8e0314 rh: add functions to toggle lowband lo 2018-12-12 16:27:25 -08:00
Sugandha Gupta
f4a8e6fc4a e320: Fix return value of get_fpga_type
Return value should be fpga image type and not
sfp type, fixes a bug with uhd_image_loader while
trying to update XG and AA images
2018-11-30 16:43:02 -08:00
Humberto Jimenez
3c134a2941 rh: Enable clock synchronization error checking 2018-11-29 11:38:43 -08:00
Alex Williams
a8ae5d433b mpm: rh: Remove n321 overlay
The n321 overlay is no longer needed. The devices have been added to the
n320 overlay because the kernel cannot tear down multiple overlays
reliably.
2018-11-27 16:45:23 -08:00
Humberto Jimenez
c34fa6d84e n3xx: Change init() procedure to reduce configuration time
Previously, the init() procedure of the n3xx class passed either
the user-provided or the default clock_source and time_source values
to initialize the clocking configuration.
When the user did not provide these parameters, the default values
were assigned, overriding whatever configuration the device was
previously initialized with. Therefore, a dboard reinit was forced
when the currently configured state of the N3xx device did not match
the default configuration (i.e. internal sources).

Now, the init() procedure still provides the clock_source and
time_source values; but, if the user does not provide the
parameters, the previously used values are assigned (i.e.
self._clock_source and/or self._time_source).
By the time MPM runs this n3xx init() procedure for the first time,
both self._clock_source and self._time_source have been initialized
with the default internal values anyways in the
_init_ref_clock_and_time() procedure.

This change prevents additional, unnecessary calls to the
set_sync_source() procedure, which ultimately causes a daughterboard
reinitialization when either a new clock or time source is requested.
2018-11-26 13:34:01 -08:00
Humberto Jimenez
f36a8dd853 rh: Fix update_ref_clock_freq() to update init args
The update_ref_clock_freq() procedure now updates the self._init_args
value of the Rhodium class daugtherboard objects in MPM to propagate
the latest user-selected arguments for future reference.
2018-11-26 13:34:01 -08:00
Mark Meserve
e8143acd3e rh: fix typo in set_clk_safe_state 2018-11-16 15:18:54 -08:00
Trung Tran
371ed0ba37 mpm: add fpga githash to device info 2018-11-16 15:13:30 -08:00
Martin Braun
a69ab0c23a cmake: Update coding style to use lowercase commands
Also updates our coding style file.

Ancient CMake versions required upper-case commands.  Later command
names became case-insensitive.  Now the preferred style is lower-case.

Run the following shell code (with GNU compliant sed):

cmake --help-command-list | grep -v "cmake version" | while read c; do
  echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done > convert.sed \
&& git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \
'*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed

(Make sure the backslashes don't get mangled!)
2018-11-14 14:10:09 -08:00
Trung Tran
f779745dcf mpm:e320: fixup gps_locked type
gps_locked should be a bool not int.
2018-11-13 17:12:38 -08:00
Trung Tran
15051a3703 mpm:gpsd_iface: handle errors from gpsd
gpsd connection is not reliable.
Adding more error handling to re-connect during polling.
Add control flows to get_gps_time in order to give an effect of getting
the value on pps edge.
2018-11-13 17:12:38 -08:00
Mark Meserve
930bd09457 rh: change uio access to utilize with-as 2018-11-12 16:08:34 -08:00
Alex Williams
d8c72d4270 mpm: n3xx_bist: Add QSFP loopback to BIST tests 2018-11-07 18:26:13 -08:00
Alex Williams
5c991d82f7 mpm: Add basic driver for QSFP board's retimer 2018-11-07 18:26:13 -08:00
Alex Williams
738b9ec102 mpm: Add convenience function to pull i2c bus from device tree
This function grabs the i2c character device path from the OF_NAME
property. That property must be unique in the device tree!
2018-11-07 18:26:13 -08:00
Alex Williams
2493f31820 mpm: rh: Add MAX 10 update script 2018-11-07 09:39:18 -08:00
Mark Meserve
728d9abfe7 rh: add lo distribution support
- This is a combination of 5 commits.
- rh: add lo distribution board gpio expander
- rh: add lo distribution mpm functions
- rh: add code to conditionally initialize lo distribution
- rh: change empty i2c device from exception to assertion
- rh: add lo distribution board control
2018-11-05 13:43:07 -08:00
Mark Meserve
77bd367016 rh: disable lmk test output
- Improves spur performance
2018-10-30 10:13:59 -07:00
Humberto Jimenez
5c9c7b3dd3 rh: Phase DAC configuration clean-up
- Confirmed the Phase DAC to be initialized at mid-scale.
- Confirmed the Phase DAC step resolution for fine clock shifting.

The clock synchronization algorithm relies on the Phase DAC to fine
shift the sampling clocks on each daughterboard.

Only a certain number of DAC codes are required for the actual clock
adjustment, thus a different range of codes may be chosen by
initializing the Phase DAC with a given value. With the selected range,
one may measure the Phase DAC's linearity and step resolution, which
defines how many steps are required when performing the fine shifting
of the clocks.

After initializing the 16-bit Phase DAC at 25%, 50% (mid-scale), and
75%; it was found that the clock distribution PLL locks relatively
faster when using mid-scale (2^15). By testing the Phase DAC's
linearity, it was confirmed that the circuit resolution is 1.11 ps per
code.
2018-10-30 09:57:55 -07:00
Humberto Jimenez
eb4a609ec8 rh: Deterministic latency optimization in JESD204B
- Optimized JESD204B RX/TX links' latency.
- Made JESD latency constant across supported frequencies.
- Checking RX SYSREF capture in the FPGA deframer block.

The JESD204B standard can be linked in such a way to produce a
repeatable, deterministic delay from the framer to deframer. This is
accomplished by setting up a LMFC (local multiframe clock) in both
devices.

The LMFCs are reset whenever a SYSREF edge is captured by the framer
and deframer. Therefore, it is simple to control the LMFC rising edges
in each device by implementing variable delay elements on the SYSREF
pulses to the framer and deframer.

Latency across the JESD204B TX/RX links should remain constant and
deterministic across the supported sampling_clock_rate values. By
testing the roundtrip latency (i.e. FPGA -> TX -> RX -> FPGA) with
different delay values in the FPGA, one may decrease the latency and
provide enough setup and hold margin for the data to be transfered
through each JESD link.

It was found that a different set of SYSREF delay values are required
for sampling_clock_rate = 400 MSPS to match the latency of the other
supported rates.
2018-10-30 09:57:55 -07:00
Mark Meserve
d87ae61d04 rh: add support for rhodium devices
Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com>
Co-authored-by: Alex Williams <alex.williams@ni.com>
Co-authored-by: Derek Kozel <derek.kozel@ni.com>
2018-10-25 10:30:59 -07:00
Mark Meserve
ec2977d8cb nijesdcore: add PRBS-31 testing 2018-10-25 10:30:59 -07:00
Mark Meserve
a49a03aa60 nijesdcore: add eyescan utility 2018-10-25 10:30:59 -07:00
Mark Meserve
fad36514e5 nijesdcore: add variable configuration support 2018-10-25 10:30:59 -07:00
Martin Braun
bf353515b6 mpm: e320: n3xx: Factor BIST code to common module 2018-10-24 18:53:16 -07:00
Mark Meserve
2801dc0f4e n3xx: output exception string on boot init failure 2018-10-24 15:20:27 -07:00
Martin Braun
f23c8cd140 mpm: Add lock_guard() function
This allows sharing mutexes between C++ and Python, and uses the with
statement to provide a locked-out context.
2018-10-23 10:13:00 -07:00
Trung Tran
b24f8495c5 mpm:n3xx: improve set_time_source,set_clock_source
Add coercing behavior to set_time_source and set_clock_source to
a valid sync source. Also, skip set_sync_source if device already
set to the corresponding one.
2018-10-22 10:37:09 -07:00
Alex Williams
a830fab2a0 mpm: Add i2c APIs for simple transfers 2018-10-19 10:17:08 -07:00
Trung Tran
0e30a5ca08 mg: adding skip_rfic argument
This change to add skip_rfic as an device argument.
skip_rfic should be only used in ref_clock bist tests
to bring down the test time.
2018-10-18 18:20:14 -07:00
Trung Tran
327893e505 e320_bist: print extra output ref_clock tests 2018-10-18 18:20:14 -07:00
Trung Tran
370d464739 n3xx_bist: add ref_clock bist 2018-10-18 18:20:14 -07:00
Mark Meserve
d0de7a5812 mpm: identify sysfs gpios more generically
- Allow generic path names to be given for each search parameter instead of
  only checking the label
2018-10-18 18:15:25 -07:00
Trung Tran
e0d4f92d05 N310: Clarify logging for when re-inits occur 2018-10-16 10:00:59 -07:00
Martin Braun
b0bf984a99 mpm: n3xx: Fix Pylint warnings
This commit contains whitespace and formatting changes only. No
functional changes.
2018-10-12 16:39:36 -07:00
Trung Tran
22ec3e4bd6 mpm: dboard_manager: add more args to update_ref_clock_freq
Summary:
This change will allow correct args to pass from mboard to dboards,
that in turn can be useful for dboard manager.

Details:
In N310, the dboard manager needs the  time source to be updated before
calling update_ref_clock_source(), because it will trigger a reinit of
the dboard, for which the time_source is essential to determine correct
clock synchronizer settings.
The special case is the white rabbit time source needs a different
internal ref_clock_frequency for the clock synchronizer than the passed
in ref_clock_freq.
2018-10-12 10:59:02 -07:00
Martin Braun
e5782693ca mpm: Add usrp_update_fs
This provides a new utility for MPM devices (usrp_update_fs.py), which
goes through all the necessary steps to update a filesystem.
Will trigger a mender update, but the tool is not specific to Mender
and can be changed to use other methods in the future.
2018-10-09 17:11:08 -07:00
Martin Braun
6466ae1d3e mpm: Add __mpm_device__ as usrp_hwd module variable 2018-10-09 17:11:08 -07:00
Brent Stapleton
d50e013646 n3xx: e320: fixing GPSDIface sensor names
N3xx and E320 were registering GPSDIface names as get_*_sensor instead
of just the sensor name. Fixing this to now register the sensor name.
2018-09-26 11:48:44 -07:00
Trung Tran
b357278c1b mpm: add link_speed xport_info 2018-09-13 14:47:54 -07:00
Brent Stapleton
ad0bd0d915 n3xx: Get RFNoC crossbar baseport from FPGA 2018-09-06 15:59:25 -07:00
Brent Stapleton
ec0bf1add3 e320: Get RFNoC crossbar baseport from FPGA 2018-09-06 15:59:25 -07:00
Daniel Jepson
77631f3603 mpm: tdc: update PDAC BIST and flatness test to use latest APIs 2018-09-05 15:04:02 -07:00
Brent Stapleton
191e250827 mpm: reset the RPC server upon reload
When reloading the Periph Manager (as when we run the image loader),
we need to run the RPCServer `__init__` function in order to reset the
cache of RPC methods. Otherwise, that cache keeps stale references to
old functions (and prevents garbage collection).

It may be possible to reset the method cache some other way, but the
`_methods` attribute of RPCServer is Cython, and doesn't seem to be
accessible in our Python code.
2018-08-27 18:14:23 -07:00