Commit graph

34 commits

Author SHA1 Message Date
Martin Braun
d98e0e4994 mpm: Refactor LMK04832X4xx and LMK03328X4xx
- Add class-level attributes to store constants on the chips
- LMK04832X4xx.config() is changed use a SpllConfig object, which is
  temporarily defined in x4xx_clk_mgr.py before calling config()
2023-04-27 22:38:59 -05:00
Martin Braun
36be4006d9 mpm: lmk04832: Move general APIs to base class
The X4xx-specific child class of LMK04832 had implemented some generic
APIs, which are moved into the parent class.
2023-04-03 22:10:45 -05:00
Virendra Kakade
4b94840abf fixup! uhd: add support for max10 variants 2022-03-28 12:47:17 -07:00
Virendra Kakade
6d6fc2a01d uhd: add support for max10 variants
Signed-off-by: Virendra Kakade <virendra.kakade@ni.com>
2021-12-02 06:42:09 -08:00
Martin Braun
09d94529e5 cmake: Replace CMAKE_{SOURCE,BINARY}_DIR with UHD_*_DIR
See the CMake 3.8 documentation on these two variables:
https://cmake.org/cmake/help/v3.8/variable/PROJECT-NAME_SOURCE_DIR.html
https://cmake.org/cmake/help/v3.8/variable/CMAKE_SOURCE_DIR.html

Under normal circumstances, these two are identical. For sub-projects
(i.e., when building UHD as part of something else that is also a CMake
project), only the former is useful. There is no discernible downside of
using UHD_SOURCE_DIR over CMAKE_SOURCE_DIR.

This was changed using sed:

$ sed -i "s/CMAKE_SOURCE_DIR/UHD_SOURCE_DIR/g" \
    `ag -l CMAKE_SOURCE_DIR **/{CMakeLists.txt,*.cmake}`
$ sed -i "s/CMAKE_BINARY_DIR/UHD_BINARY_DIR/g" \
    `ag -l CMAKE_BINARY_DIR **/{CMakeLists.txt,*.cmake}`

At the same time, we also replace the CMake variable UHD_HOST_ROOT (used
in MPM) with UHD_SOURCE_DIR. There's no reason to have two variables
with the same meaning and different names, but more importantly, this
means that UHD_SOURCE_DIR is defined even in those cases where MPM calls
into CMake files from UHD without any additional patches.

Shoutout to GitHub user marcobergamin for bringing this up.
2021-09-10 15:08:10 -05:00
Humberto Jimenez
5b31c2964d mpm: max10_cpld_flash_ctrl: improve programming log 2021-07-07 00:15:31 -07:00
Michael Auchter
b9816d806d mpm: max10_cpld_flash_ctrl: only reprogram cpld if necessary
When updating the CPLD via the flash method, first read back the CPLD
image from flash and compare it with the image to be programmed. If they
match, the CPLD is already running the correct image and reprogramming
it is not necessary.
2021-06-10 12:01:53 -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
Thomas Vogel
747746f390 mpm: Add chip driver for LMK05318 PLL 2021-06-03 10:21:00 -05:00
michael-west
fa997d52cc fixup! ic_reg_maps: Remove SPCC core reg map 2021-05-28 05:48:50 -07:00
Martin Braun
d44d871243 mpm: lmk04832: Clean up driver
Mostly cosmetic and Pylint fixes.
2021-05-10 15:03:00 -05: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
Toni Jones
902f458137 cmake: Add RegMaps build component to MPM
Add RegMaps build component to MPM. The PYTHON_CHECK_MODULE is
included from UHDPython in order to look up the presence of Mako.
Mako is required for generating the regmaps and RegMap will be
disabled without it. The RegMaps component creates custom commands for
generating all regmaps, creates a Python submodule "ic_reg_maps" with a
custom __init__.py file, and creates a target "ic_reg_maps" which gets
installed with usrp_mpm.
2021-03-01 15:57:01 -06:00
Toni Jones
394530777b mpm: Add an LMK03328 base chip driver
Added an LMK03328 base chip driver which does basic register access, ID
validation, and PLL lock validation. This will act as the base class for
device specific drivers which control the chip. The code it similar to
the LMK04828 and LMK04832 base driver classes but has a different
register map structure. Register bitfield definitions were omitted and
will be added on an as needed basis.
2021-02-22 10:15:13 -06:00
Toni Jones
2e441d296b mpm: Add an LMK04832 base chip driver
Added an LMK04832 base chip driver which does basic register access, ID
validation, and PLL lock validation. This will act as the base class for
device specific drivers which control the chip. The code is similar to
the LMK04828 base driver class, but has a different register map
structure.
2021-02-22 10:15:13 -06: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
Alex Williams
5c991d82f7 mpm: Add basic driver for QSFP board's retimer 2018-11-07 18:26:13 -08:00
Sugandha Gupta
61ac937294 adf400x: Fix adf400x driver for ref counter and charge pump mode
- For different ref clock frequencies, the ref_counter should change
and not the n_counter.
- The charge pump should be set to normal mode and tristate as that
would prevent the PLL to lock.
2018-08-02 16:07:15 -07:00
Brent Stapleton
4f49b4a937 mpm: adding adf400x support to chips
Adding ADF400X driver to MPM. This uses the Boost.Python bound spidev,
and is largely a translation from the C++ driver in UHD.
2018-06-27 10:22:25 -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
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
8815098747 mpm: Harmonize all license header
Now uses SPDX headers everywhere.
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
c22ba82562 mpm: lmk04828: Fix docstring
Says check_plls_locked() would throw an exception. That's not true.
2017-12-22 15:05:07 -08:00
Martin Braun
ee00c0384e mpm: mg: Move some class attributes to local scopes
The clock_synchronizer, jesdcore, and dboard_clk_control objects don't
need to exist for the full lifetime of the Magnesium class. Having them
around complicates management of UIO file descriptors.
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
e9a7db19ab mpm: Fix minor logging issues with LMK04828 code
Log prefixes weren't properly being set.
2017-12-22 15:05:05 -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
365c57b356 mpm: Minor logging improvement for LMK04828 classes 2017-12-22 15:03:59 -08:00
Martin Braun
6183d9eeaa mpm: Made code Python3-compatible 2017-12-22 15:03:58 -08:00
Daniel Jepson
273b959fd3 mpm/eiscat: Updates to LMK04828 driver 2017-12-22 15:03:58 -08:00
Martin Braun
5a4a78de61 mpm: Factored out common LMK04828 code 2017-12-22 15:03:53 -08:00