Commit graph

64 commits

Author SHA1 Message Date
Vanya A. Sergeev
ca0dc6b348 fpga_common: fix overrun in 16x64 NIOS II packet packing 2017-12-21 12:54:57 -05:00
Robert Ghilduta
026e4d11f6 Add INA219 FPGA read/write elements 2017-12-21 12:54:56 -05:00
Robert Ghilduta
b8719317b2 Add ADI AXI FPGA read/write elements 2017-12-21 12:54:56 -05:00
Brian Glod
85b0af2b88 bladerf-micro: nios: Connect ADF400x to 8x32 target 2017-12-21 12:54:55 -05:00
Brian Glod
134d061c2f bladerf-micro: nios: Connect AD5621 to 8x16 packet 2017-12-21 12:54:55 -05:00
Brian Glod
b235397036 bladerf-micro: nios: Add NIOS_PKT_8x32_TARGET_RFFE_CSR
This new 8x32 target is for a 32-bit GPIO for controlling RFFE
signals. Examples include TX/RX band selection switches, resets, and
readback of status outputs.

New default is such that AD9361 is held in reset and not enabled. The
host will have to deassert reset and assert the enable signal before the
AD9361 can be configured.
2017-12-21 12:54:55 -05:00
Brian Glod
088f455277 libbladeRF: Add BLADERF_NIOS_BUILD functions 2017-12-21 12:54:55 -05:00
Vanya A. Sergeev
604337d7d6 fpga_common: add 16x64 NIOS II packet format 2017-12-15 18:15:56 -05:00
Vanya A. Sergeev
562243c80d libbladeRF: refactor codebase for multi-board support
Includes fixups for clean rebase atop bladeRF commit 8b420eb
2017-12-15 18:15:06 -05:00
Robert Ghilduta
d8aa462e6a add libbladeRF and bladeRF-cli support for setting AGC DC correction LUT 2017-07-05 08:58:53 -07:00
Jan Dohl
0d765b70ab fpga_common: Added 8x8 packet IDs RX & TX trigger control packets 2016-05-08 23:17:05 -04:00
Jon Szymaniak
ccce423cff libbladeRF: Added BLADERF_MODULE_INVALID enumeration value 2015-12-28 22:20:20 -05:00
Jon Szymaniak
6cf29edca5 lms: Use internal termination when running calibration routines
In terms of avoiding interference from external signals, the
internal termination may be a better option than exposing the
signal path to external pads.
2015-12-28 16:10:39 -05:00
Jon Szymaniak
9cdfbedd5d libbladeRF: Adding VCTCXO tamer mode selection support 2015-12-14 15:29:59 -05:00
Jon Szymaniak
77b8e019f4 nios: Added VCTCXO tamer mode access via 8x8 packet ID 0x02 2015-12-14 15:29:59 -05:00
Jon Szymaniak
859377326b nios, lms, libbladeRF: Utilize FPGA support for atomic NINT/NFRAC write
Both the host and NIOS II FPGA retuning modes now make use of
FPGA v0.4.0's atomic write of the LMS6002D NINT and NFRAC PLL registers.

This helps avoid changing the PLL multiple times when attempting to
configure it.
2015-08-27 15:54:25 -04:00
Jon Szymaniak
d0f8af8d8e lms: Adjusted debug/warning level for tuning events 2015-08-25 13:28:05 -04:00
Jon Szymaniak
91b5c474da lms: Further relaxed VCO4 upper limit
We were still seeing some boards that wind up a bit too near the
upper edge of the VCO4 range. This change resolves this on the boards
we've tested.
2015-08-25 13:28:05 -04:00
Jon Szymaniak
df4a48fffd lms: Removed disabled code 2015-08-25 13:28:05 -04:00
Jon Szymaniak
a29bf54e78 lms: Account for long VTUNE transitions during HIGH<->LOW change
The cause of tuning failures in "FPGA tuning" mode is caused by
long VTUNE settling times when switching between the search for
VTUNE HIGH and VTUNE LOW.

We now try to force VTUNE to the opposite value and poll for the
expected change instead of simply delaying and hoping VTUNE
has settled before we sample it. If we don't hit the expected VTUNE
value, we'll attempt to walk VTUNE into that region.
2015-08-25 13:28:05 -04:00
Jon Szymaniak
d919a173be lms: Adjusted upper limit of VCO4 range
With the addition of a warning to the lms.c code, we've been seeing
some codes hit a max VCOCAP value before hitting a VCO limit, indicating
that we're too close to the edge of a band.
2015-08-25 13:28:05 -04:00
Jon Szymaniak
75e7793636 libbladeRF: Added bug catcher for CID 1308077
This addresses an item picked up by Coverity. Defects in bands[] or
frequency checks could potentially cause an out-of-bounds memory access.

A bounds check has been added to avoid an invalid access, should one of
the aforementioned defect ever creep in.
2015-08-12 15:50:00 -04:00
Jon Szymaniak
093aed7288 fpga_common/lms: Fixed #405: Fail to exit loopback mode for f >= 1.5 GHz
This defect was introduced when changing the second parameter to
lms_select_band().
2015-07-15 18:45:19 -04:00
Jon Szymaniak
23ecfad9ed fpga_common: Fixed data unpacking for pkt_8x16 format 2015-06-23 23:12:04 -04:00
Jon Szymaniak
be019d6a3a fpga_common: Addressed MSVC type conversion warnings
These type conversions (and associated truncations) are intentional.
2015-06-18 20:20:58 -04:00
Jon Szymaniak
81a330f010 fpga_common: Added missing #include's 2015-06-18 20:20:58 -04:00
Jon Szymaniak
d28a953ab9 libbladeRF: Use updated NIOS II packet formats for FPGA >= v0.3.0 2015-06-18 20:20:58 -04:00
Jon Szymaniak
8a9572780c hdl, nios: Added 8x8, 8x16, 8x32, 8x64, and 32x32 packet handlers
This packet handlers replace the pkt_legacy function to use
message formats that require only a single request to perform
the specific action.
2015-06-18 20:20:58 -04:00
Jon Szymaniak
3b0d65ca7f nios: Added VCTCXO trim DAC read routine 2015-06-18 20:20:58 -04:00
Jon Szymaniak
a219666893 libbladeRF: Decoupling correction calls from USB code
The backend interface now presents functions for IQ gain/phase
access, instead of lumping it all under "FPGA corrections."

There is no need for the USB code to know anything about LMS
corrections, so this has been moved back up the top level,
with bladerf.c calling into the lms.c functions that now
provide this functionality.

The USB backend now hooks up calls to nios_legacy_* routines.
In the future we can maintain a USB backend that uses these, while
another backend structure proivdes the use of new NIOS packet handlers.
2015-06-18 20:20:57 -04:00
Jon Szymaniak
9bd4ce9157 nios, libbladeRF: Macro renaming, added PIO addr defs
The legacy packet format uses magic values for the "address" for
PIO accesses. This commit adds some definitions of these to be shared
between the NIOS II code and the host code, to help reduce the
use of magic values.

Some general macro naming has been done to keep the macro naming
scheme for packet handlers more consistent.
2015-06-18 20:20:57 -04:00
Jon Szymaniak
4f37d2b202 libbladeRF, fpga_common: Fixed typo in legacy subdevice address macro 2015-06-18 20:20:57 -04:00
Jon Szymaniak
f4a9ec5dca fpga_common: Added <addr>x<data> packet format definitions 2015-06-18 20:20:57 -04:00
Jon Szymaniak
88bb372cf5 fpga_common: Cleaned up header for NIOS II legacy packet format
Removed unused struct and union.

Added summary of the packet format and its response.
2015-06-18 18:34:30 -04:00
Jon Szymaniak
56916e3c54 fpga_common: Updated NIOS Retune packet format to include queue clear 2015-06-18 18:34:29 -04:00
Jon Szymaniak
196abbbea3 nios: Time all operations performed by retune handler 2015-06-18 18:34:29 -04:00
Jon Szymaniak
6c9d15c518 fpga_common: Updated retune packet Success/Failure flag semantics 2015-06-18 18:34:29 -04:00
Jon Szymaniak
a9b90f6bd3 lms: Fixed VCO4 limit that was yielding bad VCOCAP values
This change ensures we are able to hit VCO_LOW on the upper
range of VCO4 (as verified by a handful of boards).
2015-06-18 18:34:29 -04:00
Brian Padalino
74e19c3202 lms: Removed library warning messages for debug. 2015-06-18 18:34:29 -04:00
Brian Padalino
a7e914cb17 hdl: Upgraded to the Fast NIOS and whatnot. 2015-06-18 18:34:29 -04:00
Jon Szymaniak
c9fefe0cb5 lms: Added lms_get_quick_tune() implementation 2015-06-18 18:34:29 -04:00
Jon Szymaniak
bf24f9ae50 fpga_common: Fixed retune packet pack() param order 2015-06-18 18:34:29 -04:00
Jon Szymaniak
37eebaf9d9 nios: Added "Quick Tune" flag to retune packet 2015-06-18 18:34:28 -04:00
Jon Szymaniak
9f0c6fd2f7 lms: Added flags with "force VCOCAP" option 2015-06-18 18:34:28 -04:00
Jon Szymaniak
80fb8ee526 lms: Struct re-order nitpick 2015-06-18 18:34:28 -04:00
Jon Szymaniak
cbcca71de5 lms: Provided VCOCAP back to caller 2015-06-18 18:34:28 -04:00
Jon Szymaniak
1208818e26 lms: Rewrote LMS6002D Tuning algorithm
A VCOCAP hint is used as a starting point. The algorithm then walks
either up or down to first find the high or low limit, and then walks
the other way to find the other limit.

These seems to be working well, except we commonly run into a situation
where we never actually see VTUNE = LOW when our estimate is 54 or 55.
2015-06-18 18:34:28 -04:00
Jon Szymaniak
090c05d6bd libbladeRF, nios: Added VCOCAP hint to nios retune pkt 2015-06-18 18:34:28 -04:00
Jon Szymaniak
e339d88931 lms: Restored UPOFF and DOWNOFF values to 30 uA default value.
This appears to quicken the change in our VTUNE values.
2015-06-18 18:34:28 -04:00
Jon Szymaniak
bbbe04816f lms, libbladeRF: Moved LMS charge pump offset current configuration
This only needs to be done once per initialization, not every time
the device is re-tuned. Moved this to init_device() to cut down
on SPI transactions required to complete tuning operation.
2015-06-18 18:34:28 -04:00