Commit graph

89 commits

Author SHA1 Message Date
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
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
4205c7b3da mpm: n310: Remove unused imports (linter warnings) 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
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
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
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
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
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
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
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
Ryan Marlow
c6f228452d n3xx: enable 1G clock with gpio settings. 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
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
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
Martin Braun
5c489c2597 mpm/n310: Moved the mboard ref_locked sensor into MPM
An N310 device will query all its dboards for ref lock status and
return a Boolean combination as a motherboard sensors (note: the N310
does not actually have a ref_locked sensor on the motherboard, this is
mostly for backwards-compat with UHD applications that expect a
motherboard ref lock sensor).
2017-12-22 15:04:02 -08:00
Martin Braun
e2f8f8e0bd mpm: Added sensor API
- Motherboard sensors are automatically populated into the property
  tree, they can be automatically enumerated and queried
- Daughterboard sensors have an API for querying and enumerating
  sensors, but this commit does not automatically add them to the
  property tree
2017-12-22 15:04:02 -08:00
Trung N Tran
aeaea49360 mpm: add n310 motherboard revD support
This will enable both RevC and RevD from an MPM perspective. The
revision read back from the EEPROM is used to enable the code for either
rev.

The impact on the code is limited to the port expander GPIOs. Port
expander objects are instantiated in both the N310 MPM module as well as
the n3xx_bist executable.
2017-12-22 15:04:02 -08:00
Martin Braun
688637522a mpm: Added max rev check overridable
When reading revision numbers from EEPROM, we now have an easy way of
checking of our version MPM is sufficient to run on the current device.
N310 implicitly makes use of this starting with this commit.
2017-12-22 15:04:01 -08:00
Martin Braun
8ee3da3ef9 mpm: n3xx: Don't set time and clock source without dboards
When there are no daughterboards present, clock and time source are
meaningless. It's also possible that corresponding FPGA images are not
loaded, in which case trying to set those could crash the system. Unless
daughterboards are actually present, these settings won't get applied
any more.
2017-12-22 15:04:00 -08:00
Martin Braun
8ecb09be8b mpm: Overlay handling functions use dtoverlay module 2017-12-22 15:04:00 -08:00
Martin Braun
fa07fd53f0 mpm: n3xx: Fix TCA GPIO read function
Used to always return None, now returns the actual pin value.
2017-12-22 15:04:00 -08:00
Martin Braun
a2f0269a1e mpm: n3xx: Change default state for TCA GPIOs
This makes the GPS reset go high by default (i.e., takes it out of reset
by default) and the init survey pin go high (i.e., take it out of survey
mode).
2017-12-22 15:04:00 -08:00
Trung N Tran
c07af7edfe n310: enable CLK-MGT156MHz at init n310 call 2017-12-22 15:04:00 -08:00
Martin Braun
7cd6758336 n310/eiscat: Removed 20 MHz as a valid ref clock frequency 2017-12-22 15:04:00 -08:00
Martin Braun
053e6b5aee n3xx mpm: Refactored peripheral init code 2017-12-22 15:04:00 -08:00
Martin Braun
90f608fa75 n3xx mpm: Enable more subcomponents through API calls 2017-12-22 15:04:00 -08:00
Martin Braun
eb2b11524b n3xx mpm: Set call for TCA6424 pins gets value arg 2017-12-22 15:04:00 -08:00
Trung N Tran
a745877cc9 n310: gpio bist 2017-12-22 15:04:00 -08:00
Trung N Tran
1db37316eb n3xx: enable all pins on tca6424 2017-12-22 15:04:00 -08:00
Martin Braun
3bd01c27a3 mpm/n310: Moved eth dispatcher setup into __init__ 2017-12-22 15:04:00 -08:00
sugandhagupta
113e425613 n3xx: added args for ethernet crossover path 2017-12-22 15:03:59 -08:00
Martin Braun
e7f7f06b49 mpm: Added eth table preloading capability 2017-12-22 15:03:59 -08:00
Martin Braun
c34a36853e n310: Allow --override-db-pids to skip dbs 2017-12-22 15:03:59 -08:00
Martin Braun
b14bc217e9 mpm/mpmd: Dboard info is now stored in mboard info; refactored initialization 2017-12-22 15:03:59 -08:00
Martin Braun
eb4a0cb6eb mpmd/mpm/n310: Added clock and time source APIs 2017-12-22 15:03:59 -08:00
Martin Braun
40235b8c5a mpm/mpmd: Call init() during UHD session init, not on hwd spawn 2017-12-22 15:03:59 -08:00
Martin Braun
039de2841b mpm/mpmd: Allow SID increment; more fixes for multi-usrp operation 2017-12-22 15:03:59 -08:00
Martin Braun
664f471baf mpm: Addition Py3k fixes, all related to string/UTF-8/ascii differences
- Also fixed some error handling in various cases
2017-12-22 15:03:58 -08:00