Commit graph

604 commits

Author SHA1 Message Date
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
Martin Braun
410e87e282 mpm: Add API call for claim and unclaim
These are hooks that the RPC server calls into when claiming a device,
and allow the device implementation to trigger user-definable actions
on claiming/unclaiming.
2018-01-10 17:31:21 -08:00
Martin Braun
0691c5ea75 mpm: Spawn periph manager inside the RPC process
Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
2018-01-10 17:29:49 -08:00
Martin Braun
c5acc08e67 mpm: Bump default log level to INFO 2018-01-10 13:42:28 -08:00
Martin Braun
02b407c921 mpmd: Add API to read back logs from device and send to native logging 2018-01-10 12:25:13 -08:00
Martin Braun
838b71902f mpm: n310: Factor out compat number check
Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
2018-01-08 16:33:10 -08:00
Martin Braun
877f833983 mpm: utils: Add assert_compat_number function
Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
2018-01-08 16:33:10 -08:00
Martin Braun
de88d61c54 mpm: n310: Move SID re-alloc log message to right spot 2018-01-08 16:28:00 -08:00
Martin Braun
121c37751c mpm: Add API to read back log buffer
Reviewed-by: Brent Stapleton <brent.stapleton@ettus.com>
2018-01-08 11:48:25 -08:00
djepson1
476f888392 jesd: mg bug fix: default state of the RX link is scrambled
Reviewed-by: Trung Trang <trung.tran@ettus.com>
2018-01-05 14:05:17 -08:00
Brent Stapleton
1398aaab34 fixup! mpm: mg: Added magnesium_update_cpld.py 2018-01-05 10:28:09 -08:00
Martin Braun
33c944dbdf mpm: mg: Assert that ref clock freq was actually set before init()
There was a theoretical chance otherwise that we forgot to set the
ref_clock_freq value and it set up the LMK incorrectly.

Reviewed-by: Daniel Jepson <daniel.jepson@ettus.com>
2018-01-05 10:26:00 -08:00
djepson1
f5cf6460e8 mg cpld: update compatibility checking to major/minor
Reviewed-by: Ashish Chaudhari <ashish.chaudhari@ettus.com>
Reviewed-by: Martin Braun <martin.braun@ettus.com>
2018-01-04 14:13:33 -08:00
djepson1
d36c3a7f8c jesd: add in detailed error reporting for JESD204b links
- add version control checks and bump to match latest core
 - add detailed mykonos reporting
 - add detailed fpga deframer reporting
 - misc cleanup

Reviewed-by: Ashish Chaudhari <ashish.chaudhari@ettus.com>
Reviewed-by: Martin Braun <martin.braun@ettus.com>
2018-01-04 07:27:00 -08:00
Martin Braun
7a588a5645 mpm: n310: Fix setting time source 2017-12-22 16:47:50 -08:00
Ashish Chaudhari
57ec3d765a n3xx: MPM: Add FPGA build timestamp
- Fixed the interpretation of the git hash

Reviewed-by: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:06:11 -08:00
Martin Braun
29bff463b2 mpm: n310: Add temp and fan sensors 2017-12-22 15:06:11 -08:00
Trung Tran
0db52a520b mpm: Add sysfs_thermal module
This will provide an API call to read thermal values via udev.
2017-12-22 15:06:11 -08:00
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
Ashish Chaudhari
8eeb664b67 n3xx: Removed PHY reset after Aurora BIST
- A PHY reset is not needed for SFP Aurora. It is only really
  useful when the entire quad including the commong clocking
  block needs to be reset
2017-12-22 15:06:03 -08:00
Martin Braun
edc8170246 mpm: Drop default log level to DEBUG 2017-12-22 15:06:03 -08:00
Martin Braun
27f2aa86ac n310: Move SID framing all the way to n310.py
MPM will now no longer keep a SID framer variable.

Reviewed-by: Trung Tran <trung.tran@ettus.com>
Reviewed-by: Brent Stapleton <brent.stapleton@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
Ashish Chaudhari
2e32f96291 n3xx: Updated Aurora BIST reg offsets
- Aurora registers moved around after SFP refactoring
  in the FPGA. Reflecting changes in MPM
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
Martin Braun
5599b95b78 mpm: n310: Set default clock source to 'internal' 2017-12-22 15:06:03 -08:00
Martin Braun
08be477b88 mpm: periph_manager: Clarify request/commit protocol 2017-12-22 15:05:59 -08:00
Martin Braun
f45e3c3df0 mpm: xports: Sort requested transport options by QoS
Reviewed-by: Trung Tran <trung.tran@ettus.com>
2017-12-22 15:05:59 -08:00
Martin Braun
77dd58640c mpm: udp xport: Bind SID addr 0 and 1 to respective SFP ports
Reviewed-by: Trung Tran <trung.tran@ettus.com>
2017-12-22 15:05:59 -08:00
Martin Braun
8b700c7e08 mpm: udp xport: Increment TX/RX allocations for streamers
Reviewed-by: Trung Tran <trung.tran@ettus.com>
2017-12-22 15:05:59 -08:00
Martin Braun
a3cbdf481b mpm: xports: Amend protocol for request/commit xport, add allocation
Reviewed-by: Trung Tran <trung.tran@ettus.com>
2017-12-22 15:05:59 -08:00
Martin Braun
7c7d509017 mpm: Fix ECHO command
The echo server was using the wrong socket options, allowing responses
to be fragmented. Since we use the echo server for MTU discovery, that
would have beaten the purpose.

Also includes minor formatting fixes.
2017-12-22 15:05:59 -08:00
Martin Braun
87dbcd9f1a mpmd: Refactor MPM transport architecture, use managers
This splits up the transport code in mpmd_impl across multiple classes
to properly leverage the request_xport/commit_xport API in MPM.
Different types of transport (UDP, liberio) use their own distinct
classes, which are generated dynamically on request.

This is a true refactoring despite the large amount of changes; there
are no functional differences.

Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
Reviewed-By: Trung Tran <trung.tran@ettus.com>
Reviewed-By: Ashish Chaudhari <ashish.chaudhari@ettus.com>
2017-12-22 15:05:58 -08:00
Brent Stapleton
a927a364c5 mpm: mpmd: Add MPM compat number check
Reviewed-by: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:58 -08:00
Martin Braun
0c94fff330 mpm: rpc_server: Unregister old RPC calls _init_rpc_calls()
On FPGA loads, when the periph_manager is respawned, this will now
clear the previously registered methods.

Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
2017-12-22 15:05:58 -08:00
Martin Braun
20160e8061 mpm: rpc_server: Fix use of to_binary_str()
Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
2017-12-22 15:05:58 -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
Brent Stapleton
f7e88fbf03 mpm: adding GPS time sensor
Adding GPS time sensor to MPM, and its respective getter.

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
Daniel Jepson
cb44bccd1e mpm: tdc: compensate for the trace delay differences between daughterboards
Reviewed-By: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:58 -08:00
Martin Braun
d5e44fe6e4 mpm: n310: Support RevE
Bump the max supported rev accordingly.

Reviewed-By: Trung Tran <trung.tran@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
Trung N Tran
d899f160d8 mpm: n310: add fpga compat number check
Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
Reviewed-By: Sugandha Gupta <sugandha.gupta@ettus.com>
Reviewed-By: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:58 -08:00
Martin Braun
8210fc9b17 mpm: xport: Let UDP manager re-enumerate available CHDR ifaces on init()
This will enumerate CHDR interfaces as late as possible, so that the
user changing the IP address will not affect operations. Note that IP
is considered static during a UHD session.
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
Brent Stapleton
cb6d78d9e8 mpm: adding GPS sensor functions
Adding GPS TPV and SKY sensors to MPM, and their respective getters.

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
Martin Braun
58a096dbb6 mpm: bfrfs: Assert reference buffer is a byte string
Reviewed-By: Brent Stapleton <brent.stapleton@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
Daniel Jepson
d7c6c35216 mpm: add all time_source options and complete MB clk control
- complete time_source options to match updates to fpga registers
 - add methods for each of the bitfields in the clock control register
 - add init sequences for the meas_clk MMCM and PPS output

Reviewed-By: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:57 -08:00
sugandhagupta
b0a045f069 mpm: added uio for motherboard regs
Reviewed-By: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:57 -08:00
Martin Braun
58e7022062 mpm: Factor out xport managers as own objects
- Move XportMgr classes out of n310.py
- Subclass them there and apply N310-specific settings
- Remove chdr_interfaces option from PeriphManagerBase
2017-12-22 15:05:57 -08:00
Martin Braun
06f6156f85 mpm: utils: Add string conversion utilities
Adds conversions for:
- Any-to-binary
- Any-to-UTF8
- Any-to-native
2017-12-22 15:05:57 -08:00
Trung N Tran
73334b188a mpm: close unused pyroute objects
Current code have couple places that open pyroute2 without closing it.
That seems to cause the file descriptor leakage.
This change effectively fix the issue #1964
2017-12-22 15:05:57 -08:00
Martin Braun
f357dee69c mpm: Return correct value for usrp_hwd.py --init-only
Before, it would always return success even if that failed.
2017-12-22 15:05:57 -08:00
Steven Bingler
0cb800e001 mpm: Fix python2 vs python3 zlib.crc32 output difference
Zlib's crc32 outputs signed values in python2 and unsigned values in
python3. As per this page (https://docs.python.org/2/library/zlib.html)
0xffffffff can be AND'd to the result to get the same value between
Python versions
2017-12-22 15:05:57 -08:00
Martin Braun
1e4e90d240 mpm: n310: Compile .dts files to .dtbo on update
Reviewed-By: Brent Stapleton <brent.stapleton@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
Martin Braun
b3662efeb3 mpm: Add temporary failure for FPGA reload
Note: This is subject to removal, but makes the FPGA reloading code
available to all until we fix the reload bug.
2017-12-22 15:05:57 -08:00
Brent Stapleton
19cdfb4148 mpm: Reset periph manager on update
Upon updating certain components (the FPGA, for example), the
Peripheral Manager is restarted, and the overlay is reapplied. In order
to facilitate this, the RPC server intercepts and handles the
update_component function.

Tested on the RJ45 ethernet connection. It probably won't work as well
if the SFP connection goes down when the overlay is removed.
2017-12-22 15:05:57 -08:00
Brent Stapleton
48d5d72fd7 mpm: adding destructor for UIO
UIO object now has an explicit destructor to properly tear down.
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
Brent Stapleton
2eb1a5cfc3 fpga load: Components file paths in component dict
Paths to the component files is now stored in the updateable_components
dictionary. This makes them accessible in the base class, and generally cleans
up the member variables.
2017-12-22 15:05:57 -08:00
Brent Stapleton
a2029b0439 fpga load: Atomic updating of multiple components
- The MPM function update_component now accepts multiple components to
  be updated in one RPC call.
- Updated the property tree and image loader to match this change.
- Also added DTS loading to the image loader.
2017-12-22 15:05:43 -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
c22ba82562 mpm: lmk04828: Fix docstring
Says check_plls_locked() would throw an exception. That's not true.
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
Martin Braun
4205c7b3da mpm: n310: Remove unused imports (linter warnings) 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
djepson1
bf09c9c79b jesd: add reset routine and make portions more generic for various links 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
Martin Braun
63f4049a10 mg: Enable variable master clock rates
The master_clock_rate argument is passed to init() during
initialization; this change allows to query the correct MCR at
initialization time. It does not allow changing the MCR while a session
is active.

The MCR also affects the LO settings; it is the reference clock for the
lowband LOs.
2017-12-22 15:05:07 -08:00
Martin Braun
b14cafd90c mpm: mg: Add dboard sensors for low- and highband LO lock status
- Add LO locked APIs to Magnesium
- Add LO locked sensor APIs for RX/TX and highband/lowband LOs
- Poll all those sensors from magnesium_radio_ctrl_impl

Reviewed-By: Steven Bingler <steven.bingler@ni.com>
Reviewed-By: Trung Tran <trung.tran@ettus.com>
2017-12-22 15:05:07 -08:00
Martin Braun
6701025706 mpm: Let usrp_hwd.py --init-only show init status and duration
Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
2017-12-22 15:05:07 -08:00
Martin Braun
afe889af2b mpm: mg: Optionally parallelize init calls to dboard
Default is to run in parallel. serialize_init=1 will run them serially.

Reviewed-By: Brent Stapleton <brent.stapleton@ettus.com>
2017-12-22 15:05:06 -08:00
Martin Braun
ba6e9e801c mpm: n310: Made n310.__init__() more exception-safe 2017-12-22 15:05:06 -08:00
Martin Braun
2ab5a0f6aa mpm: Made PeriphManagerBase.__init__ more exception-safe 2017-12-22 15:05:06 -08:00
Brent Stapleton
23e1187538 mpm: discovery returns 'product' information
- Added 'product' information to N310
- MPM discovery checks for 'product' field
2017-12-22 15:05:06 -08:00
Trung N Tran
07ef7e3e61 n3xx_bist: remove unused python package
This tqdm is not using anywhere and causing trouble for the sdimage; so
I remove it.
2017-12-22 15:05:06 -08:00
Martin Braun
50a8624a4b mpm: mg: Make Magnesium __init__ exception-safe 2017-12-22 15:05:06 -08:00
Martin Braun
0fdf93748a mpm: Make dboard manager __init__ exception-safe 2017-12-22 15:05:06 -08:00
Martin Braun
e75497921e mpm: net: Add ip_addr_to_iface() function
Reviewed-By: Trung Tran <trung.tran@ettus.com>
2017-12-22 15:05:06 -08:00
Martin Braun
ecaa81beaf mpm: n310: Allow Ethernet connections to both SFPs
Reviewed-By: Trung Tran <trung.tran@ettus.com>
2017-12-22 15:05:06 -08:00
Trung N Tran
db7039f8be mpm: enable RX external LO set through args
This change allow user to set RX LO of ad9371 to external or internal from args
constructor of usrp device.
 new args is rx_lo_source value can be either internal or external:
 If there's no rx_lo_source specified or invalid value, default rx_lo is used;  which is internal LO.
Usage example:
 usrp_application --args "rx_lo_source=external"
2017-12-22 15:05:06 -08:00
Trung Tran
9ea0d6da9e mg: enable init and track calibration API
Currently, AD9371 turned on most of the calibration and hard coding the turning
on process during bringup time.
This change enables users to pass in a mask field for init ARM calibration and
tracking arm calibration at the time creating USRP device reference.
This mask field can be passed through device arguments of:
 1/ init_cals : for init ARM  calibration masks. This is defined in AD9371 UG-992
table 65. Default to 0x4DFF
 2/ tracking_cals : for tracking calibration masks. This is defined in AD9371
UG-992 table 66. Default to 0xC3

Example of pasing in init calibration and tracking calibration mask
      usrp_application --args "init_cals=0x4f, tracking_cals=0xC3"
NOTE: UHD currently expect user to input the correct init_cals and
tracking_cals. There's no mechanism to check if init mask and tracking mask are
valid. For example if the init mask field not mask 0x4f, the AD9371 will failed
to setup.
2017-12-22 15:05:06 -08:00
Martin Braun
fa765de7db mpm: Run C++ logger through central logging
Reviewed-By: Mark Meserve <mark.meserve@ni.com>
2017-12-22 15:05:06 -08:00
Martin Braun
96f209a561 mpm: mg: Add lowband LO lock and AD9371 lock sensors
Note: The AD9371 lock sensors are only stubbed out for now.
2017-12-22 15:05:06 -08:00
Martin Braun
b12b9465ed mpm/mpmd: Move to request_xport()/commit_xport() architecture
This commit combines code from various branches to finally enable both
UDP and Liberio transports.
2017-12-22 15:05:06 -08:00
Martin Braun
d327a93530 mpm: Lower logging level for PeriphManagerBase.deinit() 2017-12-22 15:05:06 -08:00
Martin Braun
03e088ed49 mpm: n310: Load Liberio dispatcher
Note: The dispatcher is not yet used at this point. However, it will
check the existence of certain devices.
2017-12-22 15:05:06 -08:00
Martin Braun
61aac1dd72 mpm: mg: Refactor some periph inits into __init__
SPI interfaces and -lock, user EEPROM, radio regs, CPLD, dboard clock
control and GPIO expander can be initialized in Magnesium.__init__().
This shaves a little time off of the actual init() call and allows for
earlier failures.
2017-12-22 15:05:06 -08:00
Martin Braun
ba25633132 mpm: mg: Fix linting issues and warnings
- Removed superfluous code
- Fixed most PyLint warnings
- Reordered methods to match call order
2017-12-22 15:05:06 -08:00
Martin Braun
e9a7db19ab mpm: Fix minor logging issues with LMK04828 code
Log prefixes weren't properly being set.
2017-12-22 15:05:05 -08:00
Martin Braun
08d8a34a2a mpm: mg: Move CPLD controls to dedicated class 2017-12-22 15:05:05 -08:00
Martin Braun
eccd185efb mpm: Add configurable log levels 2017-12-22 15:05:05 -08:00
Martin Braun
fb5e10a8e4 mpm: Cache connection type in PeriphManagerBase
Now, when claiming a device, the connection type will be stored as a
string in PeriphManagerBase. This way we can read out the current
connection type even when not currently inside an RPC call.
2017-12-22 15:05:05 -08:00
Trung Tran
db121800e7 mpm: Add LiberioDispatcherTable 2017-12-22 15:05:05 -08:00
Martin Braun
16da5da375 mpm: Remove leading _ from _get_device_info()
Use @norpc instead. This fixes some linting issues.
2017-12-22 15:05:05 -08:00
Martin Braun
a972069f07 mpm: Make list_updateable_components return something 2017-12-22 15:05:05 -08:00
Martin Braun
bcf3f28e15 mpm: Improve exception/error handling
- Any RPC call with uncaught exceptions will result in additional
  logging on MPM side
- Adds get_last_error() API call
- get_last_error() is populated by various methods within rpc_server.py,
  but also from every uncaught exception
2017-12-22 15:05:05 -08:00
Brent Stapleton
b4ba46cbf2 fpga load: add N310 update FPGA function
-update_fpga loads the FPGA image from the base class's update_component function
-checks if FPGA image is a bit or bin file, and converts to Zynq-compatible binfile if necessary
2017-12-22 15:05:05 -08:00
Brent Stapleton
e63a3e8b74 fpga load: add update_component function to MPM
-update_component takes a byte array containing the data to be written,
 and a dictionary containing the metadata of the component to be
 updated
-The metadata must contain 'id' and 'filename'
-The metadata may contain an md5 hash ('md5')
2017-12-22 15:04:28 -08:00
Martin Braun
983bea69e5 mpm: Minor refactoring of PeriphManagerBase attributes 2017-12-22 15:04:03 -08:00
djepson1
d302015966 sync: add PDAC BIST test 2017-12-22 15:04:03 -08:00
Martin Braun
1cf5c1600f n3xx_bist: Fix spurious reference to self.REV 2017-12-22 15:04:03 -08:00
Brent Stapleton
2196878439 mpm: server supports binary strings being sent across rpc 2017-12-22 15:04:03 -08:00
Martin Braun
89420d97b9 n3xx_bist: Specify localhost for opening UHD sessions 2017-12-22 15:04:03 -08:00
Martin Braun
4bcdcbdd90 mpm: tdc_sync: Fix number of samples, formatting issues
- Number of samples for TDC measurement bumped back up to 512 (was
  previously reduced because of slow sampling speed)
- Non-functional changes: Modified formatting to pacify PyLint
2017-12-22 15:04:02 -08:00
Martin Braun
f2bcec5945 mpm: Replace MMCM lock and TDC PPS sleeps with poll_with_timeout
This increases init speed by replacing worst-case sleeps with polls.
2017-12-22 15:04:02 -08:00
Martin Braun
99c5b6fff8 mpm: Add mpmutils module, includes poll_with_timeout
This is a convenience function for polling with sleeps and timeouts.
2017-12-22 15:04:02 -08:00
Martin Braun
219b04e99d mpm: tdc_sync: Remove sleeps in offset polling
On the N310, there's a penalty for calling time.sleep(). This means the
polling loop was extremely slow for polling TDC updates. Now, it simply
polls as fast as possible. Note: This could hog the bus if run outside
of an initialization sequence, where no one else is using the bus.
2017-12-22 15:04:02 -08:00
djepson1
5eb49364ce lmk: change holdover settings to reduce lock time
- Register 0x150 bit [1] to '0'
  - Change lock detect to poll operation
2017-12-22 15:04:02 -08:00
Martin Braun
e212936218 mpm: mg: Minor cleanup in __init__
- Moved AD9371 API generation around
- Fixed some PyLint warnings
2017-12-22 15:04:02 -08:00
Martin Braun
be7e72ed1d mpm: mg: Enable user EEPROM data read/write 2017-12-22 15:04:02 -08:00
Martin Braun
f3a6a013c3 mpm: n310: Enable read/write of user EEPROM data
This exposes two new API calls to read and write arbitrary data to the
device's EEPROM.
Please keep in mind that EEPROMs have limited write cycles!
2017-12-22 15:04:02 -08:00
Martin Braun
221805d8b1 mpm: Add BufferFS serialization library
BufferFS is a serialization format with CRC checking and optional
byte-alignment for records. It allows storing arbitrary blobs, together
with a 8-character identifier, in a contiguous buffer that supports
random access. This is suitable for storing arbitrary blobs in EEPROM,
but could also support other things.

Signed-off-by: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:04:02 -08:00
Ryan Marlow
c6f228452d n3xx: enable 1G clock with gpio settings. 2017-12-22 15:04:02 -08:00
Trung N Tran
832e9fc794 mpm: mg: Specify I2C parents for GPIO devices
The Magnesium daughterboards have GPIO port expanders, but both have the
same udev label. In order to specify which port expander to use, we pass
in the parent udev I2c device.
2017-12-22 15:04:02 -08:00
Trung N Tran
894d1a1a0a mpm: n3xx: Add GPS locked sensor 2017-12-22 15:04:02 -08:00
Martin Braun
c8094c0e51 mpm: mg: Specify the required overlay for FPGA auto-loading 2017-12-22 15:04:02 -08:00
Martin Braun
016866d3f1 mpm: Provide default dboard EEPROM getter/setters
The setter will throw an exception though. It is supposed to be
overriden by device-specific classes.
2017-12-22 15:04:02 -08:00
Martin Braun
d601fd03d5 mpm: Properly populate device_info dict for dboard classes
Prior to this commit, device_info was always an empty dictionary on all
dboard classes. The device_info dict is now auto-populated from the
EEPROM contents, if any were provided.

Dboard classes can still opt to amend that dictionary in specific class
implementations.

Signed-off-by: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:04:02 -08:00
Trung Tran
4e9b707a66 mpm: sysfsgpio: Allow to filter by parent device
There are cases where we need to specify a parent device in order to
disambiguate GPIO devices with the same label. This lets you passing in
a parent udev device to clarify.
2017-12-22 15:04:02 -08:00
Brent Stapleton
d7df618524 bit to bin: initial commit of converter script 2017-12-22 15:04:02 -08:00
Martin Braun
96f012a14a mpm: n310: Add mboard EEPROM support
This is a specific override for the N310. It returns all the default
device info as a dict.
2017-12-22 15:04:02 -08:00
Martin Braun
cea45dda8f mpm: Add mboard EEPROM support
MPMD binds a property for the mboard EEPROM to the appropriate RPC
calls. PeriphManager now provides default implementations for an mboard
EEPROM.
2017-12-22 15:04:02 -08:00
djepson1
9a9759e2cf Sync: Improved range checking for offset measurements. 2017-12-22 15:04:02 -08:00
djepson1
4e0600b00a mg: Updated JESD204b init seq and documentation.
- Based on feedback from ADI, updated SYSREF sequencing for
    meeting deterministic latency requirements.
  - Changed majority of register addresses in nijesdcore.py to
    constants.
  - Corrected write data to SYSREF_CAPTURE_CONTROL to produce
    the correct SYSREF toggle rate inside the FPGA.

Signed-off-by: djepson1 <daniel.jepson@ni.com>
2017-12-22 15:04:02 -08:00