Commit graph

201 commits

Author SHA1 Message Date
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
djepson1
6858b05357 mg: Fix debug support for CPLD accesses
Signed-off-by: djepson1 <daniel.jepson@ni.com>
2017-12-22 15:04:02 -08:00
djepson1
58e83611f4 mg: Clean up CPLD initialization.
Signed-off-by: djepson1 <daniel.jepson@ni.com>
2017-12-22 15:04:02 -08:00
djepson1
ca847bb474 mg: Preliminary clock sync support
Signed-off-by: djepson1 <daniel.jepson@ni.com>
2017-12-22 15:04:02 -08:00