Commit Graph

114 Commits

Author SHA1 Message Date
Martin Anderseck
df31d13cbc uhd: Add support for USRP X420 (20 GHz USRP)
This adds support for the new USRP X420. It is the latest addition to
our X4xx series and comes with two HBX daughterboards. The HBX is
a one-channel direct conversion transceiver that covers 5G NR FR3 and
X-/KU-Band needs for Research and Prototyping in a frequency range of 10
MHz up to 20 GHz. It supports analog bandwidths of up to 1 GHz.

This commit is the UHD/host portion of the X420 support.

Co-authored-by: Martin Anderseck <martin.anderseck@emerson.com>
Co-authored-by: Ahmed Salman <ahmed.salman@emerson.com>
Co-authored-by: Max Köhler <max.koehler@emerson.com>
Co-authored-by: Markus Schill <markus.schill@emerson.com>
2026-03-20 16:14:54 +01:00
Martin Anderseck
5bd1cf3459 mpm: Enable sub-channels per channel
With this change, it is possible to have different sub-channels within
one channel to serve different purposes. For instance it is possible to
have one converter run in Real mode while two other converters serve I
and Q respectively. They all count as the same channel for UHD and the
driver software needs to take care to switch between them if required.
For the IQ architecture we also disable the NCO in the RFDC.
2026-03-09 16:13:22 +01:00
NI\asalman
fef432b75a host: default to rw regs in get_changed_addrs() 2025-04-02 09:26:26 +02:00
Max Köhler
780b1a3887 mpm: reset ADC & DAC chains after synchronize 2025-04-02 08:02:11 +02:00
Max Köhler
24dd961f10 mpm: read ADC/DAC mapping from RFDC memory 2025-03-20 09:07:06 +01:00
Martin Anderseck
ad6cf18399 ic_reg_maps: Add/repair array functionality
This enables the regmap to handle arrays properly. There are some
changes required to use this properly in MPM, but since the new
registers are not yet used by anything else, going without the MPM
changes doesn't do any harm, either. The array handling is basically a
Python copy of the C++ variant of the ZBX CPLD regmap.
2024-09-02 09:40:54 +02:00
Niels Garibaldi
147604555b Fixed error in lmx2572 regmap
Fixed an error where the bitrange for register 125 was falsely set to 17 bits instead of 16 within the lmx2572
register map generation script.
2024-05-16 15:22:58 -05:00
Grant Meyerhoff
f6124f48b5 tests: add unit test for max2871 chip 2024-05-16 14:53:43 -05:00
Grant Meyerhoff
9f14035440 max287x: add set_reg function for max2871 and expose get/set 2024-05-16 14:53:43 -05:00
Grant Meyerhoff
faced79647 ic_reg_maps: apply python black formatting 2024-05-16 14:53:43 -05:00
Martin Braun
89091c1edd lib: ic_reg_maps: Fix Python warning regarding \w
We were using \w as part of a regular expression without declaring the
string 'r', which caused warnings while running the regmap generator.
2024-04-02 11:02:11 +02:00
Martin Anderseck
f5bb3e0275 lib: Add X440/FBX support
Co-authored-by: Lars Amsel <lars.amsel@ni.com>
Co-authored-by: Martin Braun <martin.braun@ettus.com>
2023-06-12 10:27:29 -05:00
Martin Braun
371c4c139c mpm: Add support for X440/FBX
Co-authored-by: Lars Amsel <lars.amsel@ni.com>
Co-authored-by: Martin Anderseck <martin.anderseck@ni.com>
Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
Co-authored-by: Javier Valenzuela <javier.valenzuela@ni.com>
2023-06-12 10:27:29 -05:00
Javier Valenzuela
c1d268917e mpm/fpga: x4xx: Major updates in preparation for future devices
FPGA:
- Split up MB registers that control daughterboard specific settings so
  that daughterboards 0 and 1 could have different setings, in
  preparation for future devices that require different settings.
  This requires a compat number bump to 8.0.
- Add registers for additional RFDC information, including the
  block/tile mapping of the individual channels, and information about
  resampling capabilities
- Identify sections of code that would be specific to X410/ZBX and move
  them to their own headers, so it's trivial to add device-specific
  sections of code instead for other devices in the future.
  - This includes constraints for clocks and I/O pins.
- Remove ability to do timed ctrlport transactions to the MB CPLD, this
  was unused and possibly broken.
- Move daughterboard-specific code into its own code location
  (dboards/zbx)
- Move X410-specific register documentation to its own location
  (doc/X410)
- Refactor Makefiles to split out X410/ZBX specific components and allow
  switching between device types
- Add 512-bit AXI interconnects
- Make number of timekeepers configurable (X410 keeps the single
  timekeeper)

MPM:
- Required compat is bumped to 8.0
- Now supports new registers for detecting DSP capabilities and
  multi-rate settings for the daughterboards
- Adds MMCM controls (currently unused)

Co-authored-by: Wade Fife <wade.fife@ni.com>
Co-authored-by: Ryan Marlow <ryan@lmarlow.com>
Co-authored-by: Martin Braun <martin.braun@ettus.com>
Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com>
2023-05-23 09:06:17 +02:00
Humberto Jimenez
bf4fd50cb1 fixup! uhd: change default into option flag in register definition 2022-07-19 09:36:31 -05:00
Steven Koo
cc2bdeeff9 uhd: refactor get_all_addrs to remove duplicates
This commit refactors the existing register definitions, so that
duplicate entries don't get added to the get_all_addrs method.
Duplicates caused long builds on macOS/Clang, where build times
would go from sub 5 min to 50 min or more likely because
of the compiler trying to optimize.

Signed-off-by: Steven Koo <steven.koo@ni.com>
2022-06-17 06:44:36 -07:00
Lars Amsel
2c213d492d uhd: change default into option flag in register definition
This adds support for read only registers in generated interfaces.

For this the default is extended to an option string. The old format
is still supported for backward compability, so if options string is
just a number it will be handled as a writable number.

The option string is a comma separated list with key=value pairs. The
value is optional and treated as None if missing.

common.py now allows to pass in **kwargs to the generate method which
is used by gen_zbx_cpld_regs.py to pass a filter function for registers
used by mpm only.

get_all_addr now has an additional (optional, defaults to false) flag
to indicate whether read only addresses are to be returned or not.
It also supports type generic for the result to align with
get_changed_addr function.

The ZBX CPLD CTRL map is adapted accordingly to reflect read only
registers. The power registers are flagged as MPM scope only (and not
used in ZBX CPLD control of UHD).

Co-authored-by: Martin Braun <martin.braun@ettus.com>
2022-05-06 06:45:30 -07:00
mattprost
14a4b969b6 ic_reg_maps: Generate save state read functions
Auto-generated IC Register Maps (e.g. magnesium_cpld_regs,
rhodium_cpld_regs, etc.) now provide getter methods for all attributes.
This gives access to the save state information for the device.

Signed-off-by: mattprost <matt.prost@ni.com>
2022-04-07 13:28:02 -07:00
David Raeman
7a303df8e4 n320: fix issue that occasionally prevents lo_locked upon first set_freq
For certain frequencies, the LMX2592 will sporadically fail to lock upon
the very first tune. When this happens, subsequent tunes (even to the same
frequency) do lock. This issue seems to be resolved by programming the FCAL
adjustment register fields (FCAL_LPFD_ADJ/FCAL_HPFD_ADJ) as described in
the LMX2592 datasheet. These fields adjust the FCAL calibration speed to
better accomodate PFD frequencies below 20MHz or above 100MHz.

This patch also fixes a few name typos in the register map that were
directly in the scope of this change.
2022-04-01 13:30:05 -07:00
Michael Dickens
6fddabf5d8 cmake: remove duplicate entry in LIBUHD_PYTHON_GEN_SOURCE
Closes: https://github.com/EttusResearch/uhd/issues/478
2021-08-20 15:55:13 -05:00
Lars Amsel
2a575bf9b5 uhd: Add support for the USRP X410
Co-authored-by: Lars Amsel <lars.amsel@ni.com>
Co-authored-by: Michael Auchter <michael.auchter@ni.com>
Co-authored-by: Martin Braun <martin.braun@ettus.com>
Co-authored-by: Paul Butler <paul.butler@ni.com>
Co-authored-by: Cristina Fuentes <cristina.fuentes-curiel@ni.com>
Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com>
Co-authored-by: Virendra Kakade <virendra.kakade@ni.com>
Co-authored-by: Lane Kolbly <lane.kolbly@ni.com>
Co-authored-by: Max Köhler <max.koehler@ni.com>
Co-authored-by: Andrew Lynch <andrew.lynch@ni.com>
Co-authored-by: Grant Meyerhoff <grant.meyerhoff@ni.com>
Co-authored-by: Ciro Nishiguchi <ciro.nishiguchi@ni.com>
Co-authored-by: Thomas Vogel <thomas.vogel@ni.com>
2021-06-10 12:01:53 -05:00
Lars Amsel
eccaea4b20 ic_reg_maps: Remove SPCC core reg map
These registers aren't used anywhere in UHD.
2021-05-27 12:13:48 -07:00
Toni Jones
f2ae3e93f7 ic_reg_maps: Add SPCC reg map
Add SPCC reg map for reference and testing.
2021-03-01 15:57:01 -06:00
Martin Braun
34733e473e ic_reg_map: Allow registers to be arrays
This lets you declare registers like this:

REG_NAME[ARRAY_LEN] ADDRESS[BITS] DEFAULT ENUMS

The reg object will now carray REG_NAME as an array. So, you can do

    regs.REG_NAME[0] = VALUE;
2020-10-06 15:20:37 -05:00
Toni Jones
f8674adcd3 ic_reg_maps: Add common regmap template for Python
Add COMMON_PY_TMPL which is identical to COMMON_TMPL in functionality
but generates Python syntax rather than C++ header syntax. Modify the
generate function which will now determine if the destination regmap
file is a Python file or not and will use the appropriate template.
2020-10-06 15:20:37 -05:00
mattprost
fc3f91e0cf twinrx: update synthesizer register values for improved rf performance
Updated Register values for ADF5356:
R2) Expand Frac2 to a 28-bit value for ADF5356
R6) Use negative bleed current for improved spurious performance
R7) Set Fractional-N Lock Detect Precision to 12.0 ns because of bleed
currents
R8) Use magic number for reserved bits
R9) Fix VCO Band Division calculation for ADF5356
RD) Expand Frac2 to a 28-bit value for ADF5356

Signed-off-by: mattprost <matt.prost@ni.com>
2020-08-11 16:07:16 -05:00
Ryan Volz
f0fd3619cf uhd: Make sure generated file is closed
Letting garbage collection close the file works when using CPython, but
it fails with PyPy which uses a different garbage collection strategy.
This makes sure that the file is closed by using a file context manager.
2020-07-09 09:33:05 -07:00
Martin Braun
1bba62a75a Remove remaining Python 2 references
This changes two things in all applicable files:
- Remove imports from __future__
- Change default shebangs from /usr/bin/env python to /usr/bin/env
  python3
2020-05-07 15:10:41 -05:00
Mark Meserve
6a290dbf60 twinrx: increase rev c lo1 charge pump default value
- This change improves spur performance for the Rev C TwinRX daughterboard
2019-05-28 17:03:51 -07:00
Brent Stapleton
431deb855b uhd: mpm: update all license header w/ "-or-later"
Updating all SPDX license identifiers to include "-or-later"
2019-03-08 00:43:07 +01:00
Martin Braun
a69ab0c23a cmake: Update coding style to use lowercase commands
Also updates our coding style file.

Ancient CMake versions required upper-case commands.  Later command
names became case-insensitive.  Now the preferred style is lower-case.

Run the following shell code (with GNU compliant sed):

cmake --help-command-list | grep -v "cmake version" | while read c; do
  echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done > convert.sed \
&& git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \
'*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed

(Make sure the backslashes don't get mangled!)
2018-11-14 14:10:09 -08:00
Mark Meserve
d87ae61d04 rh: add support for rhodium devices
Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com>
Co-authored-by: Alex Williams <alex.williams@ni.com>
Co-authored-by: Derek Kozel <derek.kozel@ni.com>
2018-10-25 10:30:59 -07:00
Mark Meserve
a1fa68d730 lmx2592: correct bit 15 of register 39 2018-06-14 06:59:41 -07:00
Derek Kozel
3615873fee uhd: Added LMX2592 driver 2018-05-03 11:30:34 -07:00
Martin Braun
ae5211d71d uhd: Update license headers
All copyright is now attributed to "Ettus Research, a National
Instruments company".

SPDX headers were also updated to latest version 3.0.
2018-02-19 16:54:52 -08:00
Trung N Tran
8c4894534e mg: turn on tx power amplifiers when idle
Without turning on tx power amplifer when being idle, the TX settling time is
100ms. Turning these power amplifiers on "all time" results in tx settling time
around 140us.
2018-02-14 01:25:24 +01:00
Martin Braun
b0dc9fd677 Move all headers to SPDX format, harmonize license headers 2017-12-22 15:47:10 -08:00
Trung N Tran
de7ed3081b mg: Fix TX power issues
- Fixed incorrect register address for channel 1 lowband mixer select
- Fixed enabling of bypass path
2017-12-22 15:05:57 -08:00
Martin Braun
4087126476 ic_reg_maps: Add reg map for the Magnesium CPLD 2017-12-22 15:04:03 -08:00
Martin Braun
1a4348038d Initial commit for N3xx development.
- Creates mpm/ subdirectory
- First pass at hardware daemon/MPM
- New code for LMK04828, AD9371
- spidev integration

Contributions by:

Martin Braun <martin.braun@ettus.com>
Derek Kozel <derek.kozel@ettus.com>
Mark Meserve <mark.meserve@ni.com>
Andrej Rode <andrej.rode@ettus.com>
2017-12-22 15:03:44 -08:00
Martin Braun
4f948e2c8b Move all license headers to SPDX format. 2017-12-22 10:45:51 -08:00
Derek Kozel
85a707d7ff TwinRX: Added ADF5356 synth and TwinRX Rev C support
ADF5355 and ADF5356 support merged into adf535x class
Default register values moved into regmap

Reviewed-By: Martin Braun <martin.braun@ettus.com>
Reviewed-By: Ashish Chaudhari <ashish@ettus.com>
Reviewed-By: Mark Meserve <mark.meserve@ni.com>
2017-12-08 12:07:52 -08:00
Alex Williams
7fe9973f76 adf435x: Add APIs for cp current and aux level 2017-10-30 09:49:31 -07:00
Derek Kozel
75e6ae59b3 Moved default register values into ic_reg_map 2017-01-30 09:38:04 +01:00
Martin Braun
99c2730bc9 Remove all boost:: namespace prefix for uint32_t, int32_t etc. (fixed-width types)
- Also removes all references to boost/cstdint.hpp and replaces it with
  stdint.h (The 'correct' replacement would be <cstdint>, but not all of our
  compilers support that).
2016-11-08 08:02:22 -08:00
Paul David
ed3be5607d max2871: Added label for the bit region VAS_DLY
- Also added a template specialization for enabling the VAS_DLY bit locations based on VAS_TEMP setting (aka retune)
2016-10-05 14:31:53 -07:00
Ashish Chaudhari
fd8cf20253 twinrx: Added ADF5355 control module
- Added regmap
- Added controller class
2016-07-19 09:20:06 -07:00
Nicholas Corgan
8057c17458 build: Python 3 compatibility for build scripts 2015-07-14 14:51:32 -07:00
Martin Braun
4b1034b29e uhd: Replacing Cheetah w/ Mako 0.4.2 (allows Python 3 compat) 2015-07-14 14:51:32 -07:00
Ashish Chaudhari
e59ce9d103 x300: Added set/get_clock_delay to x300_clock_ctrl
- This function allows delaying divider pairs using the digital and analog
  delay blocks in the LMK divider
- ctrl object caches delay for later retrieval
- Minor fixes to LMK regmap
2015-07-01 17:07:58 -07:00