Commit graph

525 commits

Author SHA1 Message Date
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