Commit graph

739 commits

Author SHA1 Message Date
Aaron Rossetto
2da39536bb mpm: Fix calculation of link_rate for UDP xports 2019-11-26 12:21:32 -08:00
Alex Williams
f3a86a3294 rfnoc: Unify endianness of transports
Ethernet now uses the same serialization of the RFNoC stream as all
the other transports.
2019-11-26 12:21:31 -08:00
Martin Braun
7d69dcdcc3 Remove proto-RFNoC files
This commit removes all files and parts of files that are used by
proto-RFNoC only.

uhd: Fix include CMakeLists.txt, add missing files
2019-11-26 12:16:25 -08:00
Martin Braun
c256b9df65 x300/mpmd: Port all RFNoC devices to the new RFNoC framework
Co-Authored-By: Alex Williams <alex.williams@ni.com>
Co-Authored-By: Sugandha Gupta <sugandha.gupta@ettus.com>
Co-Authored-By: Brent Stapleton <brent.stapleton@ettus.com>
Co-Authored-By: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
2019-11-26 12:16:25 -08:00
Martin Braun
3b161d6f49 mpm: gpsd_iface: Sanitize return values for get_gps_info()
get_gps_info() can time out, or fail for other reasons. This adds some
checks to see if the return value is as expected.
2019-11-21 15:02:39 -08:00
Martin Braun
9d75460d36 mpm: rpc_server: Reenable timeouts after components have been updated
When updating a component like the FPGA, the timeouts for reclaiming get
disabled, because the update can potentially take a long time, during
which the RPC server might not be available.
There was a bug that didn't re-enable the timeouts. The most common case
where this causes issues was when the Ethernet connection was severed
during FPGA reloading, which could lead to UHD losing connection with
MPM altogether (for example because SFPs would come up with a different
IP address). In that case, MPM would remain unreachable until the next
reboot.
2019-10-28 14:39:16 -07:00
michael-west
c2f1f21d41 MPM: Add check for valid EEPROM address
Provides a more useful error message if the EEPROM cannot be found at
the specified address.  Without this change a generic index out of range
error is raised.

Signed-off-by: michael-west <michael.west@ettus.com>
2019-10-15 15:21:52 -07:00
Michael West
4042a319fd N3xx: Remove close-in noise on TX
Some close-in noise was observed on TX when using external references.
This change reduces the noise by changing U19 to select the GPSDO when
references are set to external.  Also included is a change to properly
read and apply settings from the configuration file.  This allows the
user to further quiet the transmission by adding 'enable_gps=False' to
the configuration file in order to power off the GPSDO.

Signed-off-by: Michael West <michael.west@ettus.com>
2019-10-11 12:26:12 -07:00
Martin Braun
96dd54c77a n3xx: Disable gpsdo reference source when enable_gps=0
When using enable_gps=0, the power to the LTE-Lite GPS chip is turned
off, and neither the reference sources (time/clock) nor the
location/time data (via gpsd) can be used.

This commit disables the gpsdo options for the set_time_source,
set_clock_source, and set_sync_source when enable_gps=0 is used, and
adds logging to inform the user about this.

This behaviour is consistent with X310, where `gpsdo` is only a valid
reference if the GPSDO module is plugged in.

The manual was also updated accordingly.
2019-10-11 12:25:52 -07:00
Martin Braun
da6bf176aa mpm: periph manager: Fix typo in docstring (update default args) 2019-10-11 12:25:52 -07:00
Joerg Hofrichter
3c38411bb6 mpm: usrp_hwd: fix for gevent 1.4.0
Openembedded release warrior includes python3-gevent 1.4.0 which
leads to the following error when starting usrp-hwd.py:

ImportError: cannot import name 'BlockingSwitchOutError' from 'gevent.hub'

This commit fixes the issue.

Signed-off-by: Joerg Hofrichter <joerg.hofrichter@ni.com>
2019-10-08 12:03:47 -07:00
michael-west
abedbfe548 MPM: Increase E320 max rev to 4
Increase to currently shipping rev.

Signed-off-by: michael-west <michael.west@ettus.com>
2019-09-24 17:23:44 -07:00
Matthew Crymble
f47d805cc3 mpm: fixed mboard_max_revision value
This value should be 9 to correspond with the rev J motherboards.
This property was renamed to mboard_last_rev_compat in a previous commit.
But mboard_max_rev is actually a more accurate description,
since it specifies the latest hardware revision that the software
is aware of.  I renamed all references back to mboard_max_rev.
2019-09-24 17:23:44 -07:00
Martin Braun
227fe34217 n3xx: mg: Make set_freq() call asynchronous
This does not change the MPM/UHD API, but it makes the set_freq() call
asynchronous on the MPM side. The upside is that it will release the GIL
if the set_freq() call takes too long, e.g., because of MPM
calibrations.
2019-08-22 10:35:13 -07:00
Martin Braun
78f453f8b5 mpm: mg: Only import AD9371 API calls if not yet on Magnesium
This will avoid importing API calls from the self.mykonos object onto
the Magnesium class if the Magnesium class already has such a method.
2019-08-22 10:35:13 -07:00
Mark Meserve
0280a82aa0 e320: fix time source clobbering ref source
- Fixes a case where the e320 would be unable to lock to an external 10 MHz
  reference
- Previously, calling set_time_source would set the reference clock source to
  internal as a side effect
2019-08-15 09:00:09 -07:00
Martin Braun
e8b3319531 mpm: net: Fix typo in docstring 2019-07-20 14:41:00 -07:00
Patrick Sisterhen
c0f34ddf82 mpm: cmake: removing unnecessary destination prefix
Removing unnecessary CMAKE_INSTALL_PREFIX to destination for usrp mpm
python dir
2019-07-17 11:44:47 -07:00
Thomas Vogel
b89f76bd4d n3xx: bugfix for mpm set_db_eeprom access via network
access or data as bytes instead of str was not possible due to unconditional assert check for str
2019-06-13 09:00:46 -07:00
Trung Tran
75dc7a1d64 mpm: Change SW/HW compat check to use last_rev_compat
Newer revisions of the E320 and N3xx motherboards use EEPROM version 3,
and store a rev_compat field. The rev_compat is the last revision that
this hardware is compatible with. We now use that instead of simply the
revision.
2019-05-10 16:59:58 -07:00
Martin Braun
0812a5f6bf mpm: Add MB-EEPROMv3
This includes a rev_compat field, which we can use to identify the last
hardware revision this hardware is compatible with. Example: Say the
current hardware revision is 7, but it is compatible with version 5,
then we store 7 as the current rev, and 5 as the rev_compat. Software
can now check the rev_compat rather than the current rev for
compatibility. This makes MPM more future-proof against minor,
compatible hardware changes.
2019-05-10 16:59:58 -07:00
michael-west
436df1087b E320: Add support for rev E
- No driver changes required

Signed-off-by: michael-west <michael.west@ettus.com>
2019-05-02 08:35:59 -07:00
Sugandha Gupta
178b35569b e310/e320: Move E310 to MPM architecture and refactor
- Turns the E310 into an MPM device (like N3xx, E320)
- Factor out common code between E320 and E310, maximize sharing between
  the two devices
- Remove all pre-MPM E310 code that is no longer needed
- Modify MPM to remove all existing overlays before applying new ones
  (this is necessary to enable idle image mode for E310)

Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
2019-05-01 15:17:23 -07:00
Sugandha Gupta
8a400f6a30 mpm: Add option for muxed data stream for liberio transport
If the number of channels for embedded mode streaming is 4
(1 for ctrl, 1 for async messages and 2 for data ), we need to
mux the data transport. This is needed for E310
2019-05-01 15:17:23 -07:00
Sugandha Gupta
b709c03e8b mpm: sys_utils: Remove hardcoded 'subsystem' for temp sensor
This is needed for E31x with thermal sensors on different
subsystems e.g. iio, hwmon.
2019-05-01 15:17:23 -07:00
Toni Jones
3642ac013e mpm: Generalize unittest Test Case functionality
Pull some general functionality out of a specific test case and create
a TestBase class. Future test cases will inherit from TestBase and have
access to this general functionality.
2019-04-11 09:11:43 -07:00
Martin Braun
164d76dcfd mpm: python: Move from Boost.Python to PyBind11 2019-04-02 10:39:57 -07:00
Toni Jones
8b080a8a14 cmake: Add unit testing framework to MPM
Add unit testing framework to MPM which can be run by calling
"make test". The testing is done using the built in unittest Python
module. Tests can be run on a dev machine or on the USRP itself when
compiling natively.
2019-03-26 15:15:05 -07:00
Martin Braun
d399ff0ac8 mpm: python: Clean out cruft
Remove some unused files.
2019-03-21 12:06:26 -07:00
Brent Stapleton
431deb855b uhd: mpm: update all license header w/ "-or-later"
Updating all SPDX license identifiers to include "-or-later"
2019-03-08 00:43:07 +01:00
Martin Braun
435a1f13b8 mpm: rpc_server: Improve error message on double-claim
The error message will now include the IP address of the client trying
to double-claim a device.
2019-02-22 16:12:23 -08:00
Martin Braun
2a4f196068 mpm: rhodium: Fix clock value log formatting
Before, the log messages would occasionally print 6 digits worth of
precision for sample clock values that only require 2.
2019-02-22 16:12:23 -08:00
Martin Braun
0c658067bd mpm: rhodium: Fix typo in log message 2019-02-22 09:20:10 -08:00
Martin Braun
f0da25b14d mpm: n320: Update FPGA type if QSFP board is available
The N320 has FPGA types (XQ, AQ) which cannot be derived from the mboard
regs in the same way as the non-QSFP variants. We therefore bite the
bullet and hardcode those.
2019-02-22 09:20:10 -08:00
Martin Braun
356d623c23 mpm: n320: Demote warning on absence of QSFP board
The QSFP board can't be detected if support for it is not baked into
the current FPGA image, so the warning on its absence may be incorrect.
2019-02-22 09:20:10 -08:00
Martin Braun
1e5674967d mpm: bist: DDR3 test only enumerates first block 2019-02-20 12:31:49 -08:00
Martin Braun
fa52c97c00 mpm: n3xx: bist: Auto-load the AA image for the ddr3 BIST
When running

    $ n3xx_bist ddr3

The test will now load the AA image if the BIST fails, unless the user
specifies

    $ n3xx_bist ddr3 -o skip_load_fpga=1

The rationale is that by default, the AA image is the only one that
includes the DmaFIFO block.
2019-02-20 12:31:49 -08:00
Martin Braun
694538f595 mpm: n3xx: BIST: Improve DDR3 BIST to check for DmaFIFO
The capability to run the DDR3 BIST is built into the DmaFIFO RFNoC
block, which is not always available. This change performs a quick check
before for its existence before retrieving the throughput values, and
thus can provide a better error message in that case.
2019-02-20 12:31:49 -08:00
Martin Braun
564a106bd8 mpm: n3xx: Remove DDR3 from standard BIST collection
We can't guarantee that there is actually a DDR3/DRAM FIFO block on the
image. So, don't run that test by default.
In order to run the DDR3 bist, running `n3xx_bist ddr3` is still valid.
However, it requires an image with the DRAM FIFO enabled.
2019-02-20 12:31:49 -08:00
Sugandha Gupta
effa0dacad e320: add fpga_version_hash to e320 device info
Fixes uhd_usrp_probe FPGA version githash to report the
correct hash and not 'UNKNOWN'.
2019-02-19 18:12:11 -08:00
Martin Braun
94bc1897c9 mpm: n320: Properly check for the LO distribution board
Without this patch, the N320 code will rely on an error to occur to
determine the non-existence of the N321 LO distribution board. While
this works, it forces an error message where there's no error. This will
first check for the existence of the board before trying to initialize
it.
2019-02-19 15:33:05 -08:00
michael-west
a8109bc170 N3xx: Update max rev to 7
Hardware revision was increased due to new firmware.  No software
changes are required.

Signed-off-by: michael-west <michael.west@ettus.com>
2019-02-19 13:58:39 -08:00
Brent Stapleton
6bc92ce1e2 mpm: xport: add commit_xport docstring 2019-02-11 17:12:52 -08:00
Trung Tran
3fb8cfe96c n3xx: init peripherals before loading FPGA
Issue: Current code loads FPGA too early while many
essential peripherals such as net clocks are not brought up.

This change will make sure those are got init before FPGA loaded.

Signed-off-by: Trung Tran<trung.tran@ettus.com>
2019-02-01 15:28:35 -08:00
Alex Williams
6e8b0ec413 mpm: Parameterize max UDP link allocation
Add an argument to the UDP xport_mgr to adjust the xport sorting. This
enables Rhodium to use a different limit from Magnesium. Previously, the
sorting method would overload a link with both of Rhodium's higher-rate
streams.
2019-01-25 15:01:03 -08:00
Alex Williams
10ad1a6626 mpm: Fix up Rhodium EEPROM handling for BfrfsEEPROM
Fixes Rhodium for changes introduced in b7bab6a. The constructor call
for BfrfsEEPROM didn't match the signature, and Rhodium's EEPROM map
referred to the wrong revision.
2019-01-23 13:21:15 -08:00
Martin Braun
9e14b14485 rhodium: Fix some Pylint warnings
Remove some semicolons and superfluous imports.
2019-01-21 13:41:22 -08:00
Ryan Marlow
18cfd25129 mpm: n3xx: e320: Add bridge mode support 2019-01-17 15:38:23 -08:00
Sugandha Gupta
a4289bca10 mpm: xportmgr_udp: Add bridge mode support 2019-01-17 15:38:23 -08:00
Sugandha Gupta
169e3c4bef mpm: ethtable: Add support for bridge mode to Ethernet dispatcher
In bridge mode, packets may be arriving at the Ethernet device which
aren't meant for this device, and thus need different routing
instructions.
2019-01-17 15:38:23 -08:00
Sugandha Gupta
c81b4ac99f mpm: net: Add bridge utilities 2019-01-17 15:38:23 -08:00
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
Brent Stapleton
90f2d1579a mpm: add Git hash, version to device info
Adding MPM Git hash and version to the MPM device info. This
information is currently only available through logs when MPM starts
(it is the first log message in usrp_hwd.py). Adding it to the device
info makes it accessible to any application which checks that, such as
uhd_usrp_probe.
2018-08-20 17:57:16 -07:00
Trung Tran
3b42e6f029 mpm: mg: move init_rf_cal before JESD de/framer bringup
This sequence is the one as described by the AD9371 user guide.
2018-08-16 13:02:38 -07:00
Martin Braun
276cd040f3 mpm: n3xx: Improve error messages for invalid clock/time settings 2018-08-13 13:32:04 -07:00
Martin Braun
f2914ff437 mpm: n3xx: Bump max rev to G/6 2018-08-10 13:10:35 -07:00
Sugandha Gupta
4683f0fa18 e320: Add all 5 temp sensors, fan sensor and rssi sensors per channel 2018-08-09 17:39:14 -07:00
Sugandha Gupta
2c91648c7f mpm: sys_utils: Get list of temperatures from all thermal zones 2018-08-09 17:39:14 -07:00
Sugandha Gupta
79cad066ab e320: bist: Add link_up test
- Returns true if the link of sfp0 is up (1G/10G)
2018-08-06 11:14:33 -07:00
Sugandha Gupta
61ac937294 adf400x: Fix adf400x driver for ref counter and charge pump mode
- For different ref clock frequencies, the ref_counter should change
and not the n_counter.
- The charge pump should be set to normal mode and tristate as that
would prevent the PLL to lock.
2018-08-02 16:07:15 -07:00
Sugandha Gupta
327ea7540b e320: bist: Fix ref_clock lock test implementation
- ref_clock_(int/ext) test was not changing adf400x driver settings
for new ref clock frequency. Therefore, changed the implementation
to use uhd_usrp_probe --sensor to set clock_source and get
'ref_locked' sensor value
2018-08-02 16:07:15 -07:00
Daniel Jepson
065740babd mpm: n3xx: clocking API changes for transitioning clock and time sources
Added set_sync_source method to set both the time and clock sources
without forcing a re-init twice. Modified the existing set_time_source
and set_clock_source methods to call into set_sync_source.
2018-08-02 12:37:34 -07:00
Martin Braun
5f624d6592 mpm: mg: periphs: Modify AD9361 reset function to keep it in reset 2018-08-02 12:37:34 -07:00
Sugandha Gupta
0d45bda1c4 e320: Update temp and fan bist
- Add mapping for 5 thermal zones for TMP464
- Update to one cooling_device as e320 has 1 fan (optional)
2018-07-31 14:02:02 -07:00
Sugandha Gupta
4f51e3307f e320: update sfp loopback test to load AA FPGA image
- Load AA FPGA image before sfp bist and load default image
after the test
2018-07-31 14:02:02 -07:00
Sugandha Gupta
07ea501abe e320: Fix front panel gpio to support 3.3V
- E320 will support only 3.3 V for the front panel GPIO
- Remove other voltage options
2018-07-31 14:02:02 -07:00
Sugandha Gupta
0e0b62baf8 e320: Add 'ref_locked' sensor to mboard sensors 2018-07-31 14:02:02 -07:00
Brent Stapleton
476b65f35e n3xx: Fixup for parsing the EEPROM
EEPROM parsing in MPM was ignoring the dt_compat number (MPM doesn't
need it), so when the dt_compat number was non-zero, the CRC
calculation was incorrect. CRC calculations are now done on the raw
data.
2018-07-30 18:17:29 -07:00
Brent Stapleton
204d3c96a8 n3xx: Fix UIO usage in Aurora BIST 2018-07-26 15:05:03 -07:00
Trung Tran
a39b6680a5 mpm: n3xx: Allow to run without daughterboards connected
The product ID will fall back to the motherboard ID (n300, n310). This
will load FPGA images even if there is no daughterboard connected.
2018-07-23 18:11:32 -07:00
Brent Stapleton
5b18614d39 uio: mpm: Fixup for opening mboard-regs UIO
- Fix the syntax to open mboard-regs UIO objects, and change the open()
and close() functions to be private.
- We were calling open() twice in every context manager line- once
manually, and once in __enter__. This commit corrects those usages, and
allows the context manager to fully manage the opening and closing of
UIO objects.
2018-07-23 10:33:34 -07:00
Martin Braun
c2d22b75d5 mpm: n3xx: bist: Only conditionally reload FPGA image
The tests for white rabbit and SFP loopback require a specific FPGA
image. We now check if that image is already available before running
uhd_image_loader.
2018-07-19 10:31:40 -07:00
Martin Braun
fc95b29280 mpm: n3xx: bist: Provide switch for not reloading default FPGA image 2018-07-19 10:31:40 -07:00
Martin Braun
e56d9188f7 mpm: uio: Fix use of logger
When logger==None, it uio.py would fail.
2018-07-19 10:31:40 -07:00
Martin Braun
04064035f4 mpm: n3xx: bist: Add White Rabbit lock test 2018-07-19 10:31:40 -07:00
Trung Tran
cb54b9b7e3 n3xx_bist: update sfp loopback test
Load AA image  before doing the bist and load HG image after the bist.
2018-07-18 18:57:47 -07:00
Martin Braun
118e7a21bf mpm: n3xx: Init device on boot
Specify skip_boot_init=1 to not init during boot. This will increase
boot time for an N310, typically by around 15 seconds.
2018-07-18 17:55:50 -07:00
Sugandha Gupta
59b4e8f892 mpm: e320_bist: Add tests for running BIST on E320 2018-07-18 15:37:27 -07:00
Sugandha Gupta
1e4649ce29 e320: mpm: Add dboard and mboard sensors
Adding the following sensors:
- Catalina temperature, RSSI, and LO Lock sensors
- GPS lock, time, TPV, and SKY sensors

Co-authored-by: Brent Stapleton <brent.stapleton@ettus.com>
2018-07-18 15:37:27 -07:00
Brent Stapleton
300a5e3f6e mpm: initial commit of E320 code
Co-authored-by: Sugandha Gupta <sugandha.gupta@ettus.com>
2018-07-18 15:37:27 -07:00
Martin Braun
2787e2dee4 mpm: mg: Adding fast-reinit mode
When a device is re-initialized without any changes (e.g.,
master_clock_rate, ref_clock_freq) then we can skip the initialization
sequence and move on. This shaves a significant amount of time from the
init sequence.

Fast re-init can be overridden by providing the `force_reinit=1` device
arg.
2018-07-17 10:49:21 -07:00
Martin Braun
4a4d1d797f mpm: mg: Move RF cal initialization after JESD init 2018-07-17 10:49:21 -07:00
Martin Braun
e364ad4281 mpm: mg: Store init args between runs 2018-07-17 10:49:21 -07:00
Martin Braun
c8c4cf1b0c mpm: Remove unused _init_args from PeriphManagerBase 2018-07-17 10:49:21 -07:00
Martin Braun
8e02dec0fb mpm: n3xx: mg: Refactor init code
All code relevant to initializing an N310/N300 daughterboard is moved to
its own module (mg_init.py).

No functional changes.
2018-07-17 10:49:21 -07:00
Martin Braun
2fce1974d9 mpm: n3xx: Remove unused imports 2018-07-17 10:49:21 -07:00
Martin Braun
6c7a4193a3 mpm: mg: Print AD9371 info as debug message during init 2018-07-17 10:49:21 -07:00
Brent Stapleton
05722dcc51 mpm: n3xx: Factor out component updating
- Refactoring component (FPGA, DTS) updating functions out of
n3xx.py into their own components.py. The ZynqComponent class now
defines the methods to update these two components.
- Adding super().__init__() to the PeriphManagerBase class. This is
needed to get the multiple inheritance used in N3XX now to work, and
(apparently) good Python practice.
2018-07-11 12:42:45 -07:00
Brent Stapleton
6eaf521d2b mpm: n3xx: Factor out GPSd Iface functions
- Refactoring GPSd interface to be instead wrapped by a
GPSDIfaceExtension class. This class will faciliate "extending" an
object, allowing that object to call the GPSDIfaceExtension methods as
their own.
- New MPM devices (or whatever else) can now use the GPSDIfaceExtension
class instead of writing their own GPSDIface handling functions.
- N3XX now instantiates a GPSDIfaceExtension object, and extends
itself. This means that an n3xx object can call the `get_gps_time`
method as its own, for example.
- N3XX must get through initialization in order for the GPSd methods
to be registered.
2018-07-06 15:00:20 -07:00
Brent Stapleton
9c2e1907e9 mpm: n3xx: Overridable crossbar base port
Moving the RFNoC crossbar base port to the class overridables. MPM
devices may need to reserve different numbers of ports for non-blocks;
this can now be done by overriding the crossbar_base_port.
2018-07-06 14:53:40 -07:00
Brent Stapleton
4f49b4a937 mpm: adding adf400x support to chips
Adding ADF400X driver to MPM. This uses the Boost.Python bound spidev,
and is largely a translation from the C++ driver in UHD.
2018-06-27 10:22:25 -07:00
Moritz Fischer
91a5518443 mpm: tools: Introduce dt-compat and mcu-compat fields
Introduce dt-compat and mcu-compat fields into the eeprom
structure.
For the motherboard eeprom this is straightforward, since
there's still padding bytes that could be (ab)used for this.
On the dboard side more creativity is required and the
original revision field of 2 bytes is reduced to only
one byte revision and one byte dt-compat.
Since this will only affect new units being backwards
compatible with older versions of the bootloader is not
an issue.

Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
2018-06-20 17:10:05 -05:00
Martin Braun
0935bf5c2a mpm: dboard_manager: Fix docstring for get_serial() 2018-06-18 17:37:11 -07:00
Mark Meserve
f473df0a0b mpm: fix sanity check in _init_peripherals
- change scoping of product_map in n3xx
2018-06-13 14:09:13 -07:00
Martin Braun
444857598f mpm: xportmgr_udp: Catch inconsistent Ethernet device detections
This manager first detects all valid Ethernet devices. The checks for
validity happen across multiple calls in a non-atomic fashion, so it's
possible to end up with inconsistent results. To avoid such issues, we
filter results without talking to the network stack as a final pass.
2018-06-08 14:58:20 -07:00
Martin Braun
8762a4d444 mpm: net: Fix rare failures for IP addr detection
Because the detection of valid Ethernet devices happens across multiple
calls in a non-atomic fashion, we cannot assume that a device passed to
net.get_iface_info() actually has a valid IP address, so we don't make
that assumption.
2018-06-08 14:58:20 -07:00
Martin Braun
22d684c3c8 mpm: Use device_info to determine overlay list 2018-06-08 13:27:13 -07:00
Martin Braun
cd716e264e mpm: n3xx: Derive product key programmatically
Since there is no simple mapping from an arbitrary tuple of mboard- and
dboard info dictionaries, we use generate_device_info() to figure out
the product key.
2018-06-08 13:27:13 -07:00
Martin Braun
30cc2e9982 mpm: Distinguish mboard_info and device_info
In the N3xx series, the motherboard ID and the device ID can differ. For
example, the N310 could share the same motherboard with a different
device that uses different daughterboards.
2018-06-08 13:27:13 -07:00
Martin Braun
d1e1ac71be mpm: Remove 'test' periph_manager 2018-06-08 13:27:13 -07:00
Martin Braun
aa0cc703fe mpm: Refactor periph manager init; split EEPROM read from rest
The readout of EEPROMs is moved to their own functions. This will allow
us to read out EEPROM values before starting the initialization.
2018-06-08 13:27:13 -07:00
Brent Stapleton
cc6121e0ac mpm: Adding FPGA type to device info 2018-06-06 08:19:48 -07:00
Mark Meserve
e942181f60 mpm: allow multiple spi device objects to use the same chip select 2018-05-14 17:55:15 -07:00
Martin Braun
5df5177d49 n3x0: Pick different standard tests for BIST
Replaced 'clock_int' (which is not implemented) with 'fan'.
2018-05-14 14:46:25 -07:00
Martin Braun
9cf1a8e99a mpm: n3xx: Refactor n3xx_periphs into its own module 2018-05-08 11:37:12 -07:00
Martin Braun
2970aa27ce mpm: xportmgr_udp: Assign xports to previously used SFPs
This changes the sorting algorithm for the xport<->SFP mapping. When
multiple SFPs are used, this sorting will avoid a criss-cross mapping
(e.g., mapping ports 0 and 1 of 0/Radio_0 to different SFPs).
2018-04-30 16:57:45 -07:00
Trung Tran
d5da0f44d4 mpm: types: Add getters for dst_ep and dts_block to SID 2018-04-30 16:57:45 -07:00
Trung Trang
0f7d3b6f71 mpm: rpc server: Remove disable_commit for init()
The async calls to long C++ methods allows the claimer loop to smoothly
continue during init, so this hack is no longer necessary.
2018-04-30 14:36:29 -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
Trung Trang
bd14776500 mpm: rpc server: Increase claim timeout to 5 seconds
Usually, the current timeout is fine, but there are cases when a lot of
RPC traffic could drown out the reclaim calls. 5 seconds is an
experimentally derived safe value.
2018-04-30 14:36:29 -07:00
Brent Stapleton
13b45a08c9 mpm: add device-specific Boost.Python bindings
Separating Boost.Python bindings into device-specific files. N3XX code
now lives in n3xx/pyusrp_periphs. Only one src file should be added for
pyusrp_periphs.so by CMake.
2018-04-18 15:34:51 -07:00
Alex Williams
7dcd16f5a6 mpm: Use configurable components for build system
For a minimal build, default to off for components unless the MPM_DEVICE
or the user requests it specifically.
2018-04-18 15:34:51 -07:00
Moritz Fischer
fbb407f2d0 mpm: n3xx: Bump maximum supported revision to 5 (RevF)
Bump maximum supported motherboard revision to 5 (RevF),
to support upcoming motherboard revisions.

Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
2018-04-17 13:26:55 -07:00
Daniel Jepson
d107f0e775 jesd: add rx and tx SYSREF delay control in MPM 2018-04-10 09:58:34 -07:00
Daniel Jepson
e2f9120331 mg: implement digital loopback arg for the rfic 2018-04-10 09:58:34 -07:00
Daniel Jepson
0430819e47 fixup! n3xx: add White Rabbit support 2018-04-03 17:02:13 -07:00
Martin Braun
a5b87ab7c4 mpm: cmake: Add git hash and version info to Python module
Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
2018-04-02 15:27:05 -07:00
Trung N Tran
6e66bd7d7b mpm: increase timeout interval for claiming 2018-04-02 14:57:21 -07:00
Martin Braun
08245bb92c mpm: n3xx: Disable PPS out during initialization 2018-04-02 14:56:39 -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
Trung N Tran
4e34d35ec4 mpm: improve logging on exception 2018-03-30 11:05:53 -07:00
Brent Stapleton
93617aa25c mpm: Adding offset to EEPROM reads
Adding address offset to all MBoard and DBoard EEPROM reads. This
matches what we're doing for the user portion of the EEPROM, and
allows us to share access to an EEPROM.
2018-03-20 16:47:24 -07:00
Brent Stapleton
86dbaee5b8 mpm: adding reference counters to UIO
UIO objects now count references on open and close calls. This should
prevent problems with nested function calls that open/close the same
UIO object.

References counts are not atomic -- this is intended for nesting with
statements within the same thread context.

Reviewed-by: Martin Braun <martin.braun@ettus.com>
Reviewed-by: Trung Tran <trung.tran@ettus.com>
2018-03-14 16:45:45 -07:00
Martin Braun
86b95486ed mpm: Add INFO log statements on MPM reset and component update 2018-03-13 16:19:03 -07:00
Martin Braun
398d7bb587 mpm: n3xx: Fix failure on get_device_info() when uninitialized 2018-03-13 16:19:03 -07:00
Martin Braun
7a8967e71e mpm: n300: Warn when user tries to use external LOs
The N300-variant has no front-panel LO connectors, so we need to warn
ther user when trying to use them.
2018-03-09 11:54:53 -08:00
Martin Braun
37e49f56b1 mpm: sysfs_gpio: Throw exception on unsuccessful init
In case of a lost connection to a sysfs-gpio device, this will trigger
the correct errors.
2018-03-08 10:54:19 -08:00
Daniel Jepson
caf3cb87d2 tdc: support for White Rabbit 2018-03-07 12:40:28 -08: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
sugandhagupta
38a7bcbff4 n3xx_bist: Ignore errors from uhd_usrp_probe on running ddr3 test
we only care about getting a valid throughput regex match, and can
ignore errors from uhd_usrp_probe, e.g. no daughterboards, etc.
2018-03-06 12:04:08 -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
9d55c58858 mpm: n300/n310: Select correct overlay based on product ID 2018-03-05 15:56:41 -08:00
Martin Braun
d150449822 n310: Make MPM report FPGA version and description, UHD read it
The FPGA and MPM version as well as the description of the device
("N300-Series Device") and its name (its the hostname) are now properly
reported coming from MPM, properly saved in the prop tree, and
uhd_usrp_probe can nicely display them this way.
2018-03-02 13:48:14 -08:00
Martin Braun
d04b6e3a62 mpm: uhd: RPC server reports MPM version, uhd_usrp_probe reads it 2018-03-02 13:48:14 -08:00
Martin Braun
0cb30c8412 mpm: net: Add get_hostname() 2018-03-02 13:48:14 -08:00
Martin Braun
c3cc98cc76 mpm: n3xx: Fix usage of UIO in Aurora tests 2018-03-01 18:34:28 -08:00
sugandhagupta
8ff6175960 mpm: n3xx_bist: Fix regex to match with optional space
Fix regex so it matches an optional additional space.

Signed-off-by: Sugandha Gupta <sugandha.gupta@ettus.com>
2018-03-01 18:22:51 -08:00
Martin Braun
7e5fffa3cc mpm: n310: Default-initialize some members
This allows flawless execution of code paths regardless of
initialization status.
2018-02-28 15:20:58 -08:00
Martin Braun
c73a013d01 mpm: periph_manager: Guarantee self.dboards exists
Other components assume the existence of mgr.dboards, and so it needs to
be default-initialized before doing any code that can go wrong.
2018-02-28 15:20:12 -08:00
Trung N Tran
cf7667fe71 n3xx_bist: set fp_gpio master to PS 2018-02-21 16:58:51 -08:00
Trung N Tran
6d0404c678 n3xx: add front panel gpio control registers 2018-02-21 16:58:51 -08:00
Brent Stapleton
a9ba8a9fd9 mpm: N310 updates FPGA information on init
-Adding MboardRegsControl.get_fpga_type(), which reads the SFP info
registers and determines the FPGA image type (HG, XG, AA, etc). This is
a minor FPGA compat number bump.
-Adding N310._update_fpga_type(), which updates the component
information using the get_fpga_type() function described above. This
information can then be accessed through get_component_info().
2018-02-19 16:58:52 -08:00
Brent Stapleton
94aedfd2d9 mpm: adding get_component_info
Add getter function for updateable component information. This is a
minor compat number bump.
2018-02-19 16:58:52 -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
Martin Braun
d58cadb8b0 mpm: Add RAII style GIL release mechanism to Python library
Note: This commit does not actually apply the GIL release, it only
provides the class to do so.
2018-02-13 19:58:32 -08:00
Moritz Fischer
e2a6b2e077 mpm: n310: Remove some leftover cruft
The lines removed here are no longer needed, get rid of them

Suggested-by: Martin Braun <martin.braun@ettus.com>
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
2018-02-13 19:04:16 +01:00
Moritz Fischer
8f153c9497 mpm: Add entries for renamed sfps
In order to match the front panel 0 and 1 for the SFPs, as well as for
clarity and consistency reasons, udev rules will be put onto future
filesystems in order to rename the eth1 eth2 devices to sfp0 and sfp1.

This change *should* be backwards compatible, nevertheless, be careful
and bump compat number.

This also updates the uhd image loader manifest.

Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
2018-02-13 19:04:16 +01: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
Brent Stapleton
167bc5942e fixup! mpm: magnesium_update_cpld.py: Add axi_bitq support 2018-02-09 21:20:45 +01:00
Trung N Tran
43969f4758 mpm: remove GPIOBank.set_all function
-set_all function doesn't fit well with the GPIO api. It is rather
a test sepecific function.
-Add gpio_set_all helper to n3xx_bist.

Reviewed-by: Martin Braun <martin.braun@ettus.com>
2018-02-09 18:02:44 +01:00
Martin Braun
832cbe095a mpm: Use prefs API for periph manager
- Allow to set default args via config file
- Read them from prefs API
- override-db-pids uses the same APIs now ([overrides] section in
  config file, prefs API, and same dictionary as --default-args when
  used on the command line
2018-02-08 22:18:14 +01:00
Martin Braun
44533fb035 mpm: Use prefs API in logging module
This allows to set the default log level from the config file.
2018-02-08 22:18:14 +01:00
Martin Braun
e6dc09470d mpm: Add prefs modules
- prefs is a module for centralized preferences management
- Uses Python's ConfigParser module
2018-02-08 22:18:14 +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
852bf3aa10 mpm: n310: Return CHDR addresses as part of device_info
Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
2018-02-07 14:04:30 -08:00
Martin Braun
88ab35529b fixup! mpm: Fixup for argument parsing in N310 2018-02-07 13:59:23 -08:00
Martin Braun
0d73d8ab81 mpm: rpc_server: Declare local connection for *all* local IPs
Before, it was possible to trick the RPC server in believing a
connection was remote when the incoming connection was from a local IP
address that was not 127.0.0.1.
2018-02-07 13:46:53 -08:00
Martin Braun
0e285428df mpm: net: Add get_local_ip_addrs() method 2018-02-07 13:44:54 -08:00
Martin Braun
c2747ed0ce mpm: n310: Removed superfluous import 2018-02-07 13:41:27 -08:00
Brent Stapleton
d9366ba7d4 mpm: Fixup for argument parsing in N310
Adding helper function to parse strings to a boolean value. We can
then use that function to parse MPM's default_args, and set enable_gps
and enable_fp_gpio. This replaces the usages of the Python builtin
bool(), which returns True for any non-empty string.
2018-02-07 17:21:43 +01:00
Martin Braun
31f9d3dce7 mpm: n310: bist: Add error_msg for temp bist if no sensores were found 2018-02-07 08:21:06 -08:00
Trung N Tran
8f5f38e4f9 mpm: convert to string explicitly in GPIOBank 2018-01-24 17:33:34 -08:00
Ashish Chaudhari
081e81274d usrp3: Changes for Vivado 2017.4
- Bumped compat number for e3xx, n230, x3xx, n3xx
- Updated images package for e3xx, n230, x3xx, n3xx
- Updated fpga-src submodule
2018-01-24 15:09:29 -08:00
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