Commit graph

91 commits

Author SHA1 Message Date
Martin Braun
ec488d49c0 mpm/mpmd: Remove token requirement for device info
This removes the token requirement for get_proto_ver() and
get_chdr_width().
2019-11-26 12:21:33 -08:00
Martin Braun
025ffdce34 mpm: Move common mboard regs code to common location
This assumes an existence of mboard_regs_control in PeriphManagerBase
and implements most TK controls there. All the *_periphs.py files can
now use a common class for registers, including the TK access, but also
git hash, build date, and device ID access.

This also fixes two issues:
- set_timekeeper_time() and set_tick_period() had a bug that would
  incorrectly calculate the upper 32 bits of their respective registers.
- N3xx had a bug that would swap around set time now and next PPS. This
  got auto-fixed because the common code never had this bug.
2019-11-26 12:21:33 -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
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
Martin Braun
da6bf176aa mpm: periph manager: Fix typo in docstring (update default args) 2019-10-11 12:25:52 -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
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
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
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
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
Martin Braun
c8c4cf1b0c mpm: Remove unused _init_args from PeriphManagerBase 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
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
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
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
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
Martin Braun
86b95486ed mpm: Add INFO log statements on MPM reset and component update 2018-03-13 16:19:03 -07:00
Martin Braun
f9a8098cae mpm: Fix some Pylint warnings
No functional changes.
2018-03-06 15:45:15 -08:00
Martin Braun
ed2d1ac3e4 mpm: Demote some log messages
The log output at level 'INFO' was pretty cluttered. This cleans up the
log messages at the higher levels. In some cases, log message typos or
capitalizations were also fixed.
2018-03-06 15:28:33 -08:00
Martin Braun
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
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
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
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
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
4c81ed0a5d fixup! mpm: Log timeouts during API calls, reset timer on claimed calls 2018-01-23 15:21:28 -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
2d424a54fc mpm: Refactor PeriphManager classes
- Sort methods by functional groups
- Removed some cruft
2018-01-16 12:10:37 -08:00
Martin Braun
4e873a4cb1 mpm: n310: Check all periphs for initialization status 2018-01-12 18:17:54 -08:00
Martin Braun
ca74d5cd8c mpm: periph_manager: Pass default args to dboard manager 2018-01-11 14:50:12 -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
de88d61c54 mpm: n310: Move SID re-alloc log message to right spot 2018-01-08 16:28:00 -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
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
08be477b88 mpm: periph_manager: Clarify request/commit protocol 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
8815098747 mpm: Harmonize all license header
Now uses SPDX headers everywhere.
2017-12-22 15:05:58 -08:00
Brent Stapleton
0bf22a3e57 mpm: UIOs now open only when necessary
Refactoring to use the C++-based UIO objects. The Liberio and Ethernet
objects now open the UIO before using it, and close it once done.

Reviewed-By: Martin Braun <martin.braun@ettus.com>
2017-12-22 15:05:58 -08:00
Martin Braun
d3e6dd1140 mpm: Harmonize imports, tidy + sort modules
- Moved nijesdcore to cores/
- Moved udev, net, dtoverlay, uio to sys_utils/
- Made all imports non-relative (except in __init__.py files)
- Removed some unnecessary imports
- Reordered some imports for Python conventions
2017-12-22 15:05:58 -08:00
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
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
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
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
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
2ab5a0f6aa mpm: Made PeriphManagerBase.__init__ more exception-safe 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