Commit Graph

1107 Commits

Author SHA1 Message Date
Jörg Hofrichter
752b878a08 mpm: tlv_eeprom: added eeprom IDs for X4XX L variants 2026-08-10 16:40:53 +02:00
Jörg Hofrichter
d46c011757 mpm: tlv_eeprom: print addtl. info in eeprom-id 2026-08-10 16:40:53 +02:00
Jörg Hofrichter
6284863e14 mpm: handle bootgen generated .bin files
- Verify signature in case the device does not support customizable
  FPGA (just as sanity check before actual loading the bitstream).
- Extract the bitstream from the bootgen generated .bin file
  otherwise.
2026-08-10 16:40:53 +02:00
Jörg Hofrichter
d4828aa208 mpm: add bootgen_wrapper script
Provide the following two functions by wrapping the "bootgen"
command line tool:

verify: verify the validity of the signature of the .bin file.

extract_bitstream: extract the FPGA bitstream from the .bin file.
This works if the .bin file includes the FPGA bitstream as a
single partition.
2026-08-10 16:40:53 +02:00
Jörg Hofrichter
eb21a19deb mpm: expose customizable_fpga flag 2026-08-10 16:40:53 +02:00
Jörg Hofrichter
4bf18365d8 mpm: support new L variants in x4xx_update_cpld 2026-08-10 16:40:53 +02:00
Jörg Hofrichter
294ced36f6 mpm: x4xx: l device only supports "bin" file extension for FPGA 2026-08-10 16:40:53 +02:00
Jörg Hofrichter
a58a06f50c mpm: x4xx: add l variant PIDs 2026-08-10 16:40:53 +02:00
Jörg Hofrichter
ffcce2e62d mpm: check-filesystem: correct condition for mpm init successful
With gRPC being used as RPC technology, the MPM function
get_init_status now returns the values as list instead of a set.
2026-07-23 10:49:27 +02:00
Ahmed Salman
0201e62616 x4xx: SelfCal: honor skip_adc_selfcal during clock reconfiguration
add helper to clear pending db ADCSelfCal host tasks
clear any existing ADC SelfCal tasks in init() when
skip_adc_selfcal is enabled
prevent restart_tiles() from re-scheduling
ADC SelfCal tasks when skip_adc_selfcal=1
log when ADC self-cal task scheduling is intentionally skipped
2026-07-20 12:31:25 +02:00
Grant Meyerhoff
206a7b183b lmk05318: add sleep before busy check 2026-07-16 13:00:41 +02:00
Grant Meyerhoff
760058e236 lmk05318: add note about code duplication 2026-07-16 13:00:41 +02:00
Grant Meyerhoff
966e91e0eb lmk04832: add note about code duplication 2026-07-16 12:57:44 +02:00
Abhishek Verma
e24b1cb8bb host/mpm: replace mpRPC with gRPC transport
host:
Replace the msgpack-RPC (rpclib) client with a gRPC-based
implementation. Add auto-generated C++ client and Python bindings
from protobuf definitions. Remove rpclib dependency and integrate
FindgRPC into CMake.

mpm:
Replace the msgpack-RPC server with a gRPC server generated from
protobuf definitions. Add pb_utils.py for type conversion between
Python and protobuf. Update rpc_server.py to dispatch calls via
gRPC stubs. Update mpm_shell to use gRPC. Replace pyudev with sysfs
scan in uio device discovery.

Bump MPM compatibility number to 7.0 and RPC version to 2.

This change requires new depedencies. E.g. for Ubuntu 24.04 or 25.10:
libgrpc++-dev, libprotobuf-dev, protobuf-compiler-grpc, python3-grpcio
2026-07-09 12:12:04 +02:00
Max Köhler
24d9c6f0db mpm: hbx: add support for fabric resamplers 2026-07-01 10:01:05 +02:00
Abhishek Verma
a27f09dd5a mpm: gpio: typecast to int before set 2026-06-25 14:47:14 +02:00
Jörg Hofrichter
521dc737a7 mpm: bist: fix temp and fan tests for e320, n3xx, x4xx
Use HwmonTempSensors based tests for bist tests.
2026-06-25 14:47:14 +02:00
Jörg Hofrichter
8d2addaf1f mpm: HwmonTempSensors: fix double listed temp sensors, et. al.
- Fix double-listed temp sensors
- Implement mapping fan1_input -> fan0, etc. to remain backward
  compatibility
- add function to read sensor names
2026-06-25 14:47:14 +02:00
Bjoern Bachmann
d468872d40 mpm: refactor thermal/fan sensor handling with unified hwmon/sysfs abstraction
Introduce HwmonTempSensors (sysfs_hwmon.py) and refactor
SysfsThermalSensors (sysfs_thermal.py) to enumerate available sensors
once at construction time and cache device references in a sensor_map
dict, avoiding repeated udev context creation and device-tree walks on
every readout.

HwmonTempSensors supports the cros-ec hwmon subsystem and accepts a
sensor_list parameter to discover both temp and fan sensors. A new
read_fan_sensor_value() method is added alongside the existing
read_thermal_sensor_value(). Multiple subsystems (hwmon, iio) and
sensor formats are supported via a read_sysfs_sensors_value() utility.

SysfsThermalSensors is extended to support multiple subsystems (IIO
and thermal) and a data_probe parameter for flexible attribute reading.
A read_fan_sensor_value() method is added to match the hwmon interface.

Both classes expose the same read_thermal_sensor_value(sensor_names,
reduce_fn) interface, making them interchangeable at the call site.

All affected peripheral managers are updated:
- E320: updated to use the new sensor abstraction pattern
- N3xx: refactored temp and fan sensor methods for hwmon/thermal backends
- X4xx: unified _temp_fan_sensors handle with hwmon/thermal dispatch,
  add missing HwmonTempSensors import
- E310: add dynamic MB temperature sensor type detection instead of
  hardcoding "jc-42.4-temp", fixing usrp_list_sensors compatibility

A _hwmon_based_sensors flag at init time selects the correct backend
for fan and temperature reads on all platforms.
2026-06-25 14:47:14 +02:00
Bjoern Bachmann
975e87b085 mpm: tools: Use dts labels for mb, db eeproms 2026-06-25 14:47:14 +02:00
Jörg Hofrichter
5d70afebb4 mpm: tools: apply clang-format 2026-06-25 14:47:14 +02:00
Jörg Hofrichter
99faba1fe4 mpm: sys_utils.i2c_dev: rework, e.g. don't rely on i2c-adapter
The i2c-adapter subsystem was meant as a temporary compatibility
layer. The recommended option always was to rely on i2c-dev
subsystem only. With commit 7e722083fc the i2c-adapter subsystem
was finally removed from Linux kernel 6.12.

The logic for resolving the i2c-dev device node was changed
accordingly.

This change also adopts all occurances in the code where the I2C
bus or device node is resolved to use resolving by devicetree
symbol. E.g. in n3xx.py, the N32X QSFP I2C node was resolved by
devicetree label before.

Overall, two functions are now provided by sys_utils.i2c_dev:

- dt_symbol_get_i2c_bus: Get the I2C bus (as pyudev.Device) for
  a given device tree symbol. This function is used if the
  returned value is further used for filtering devices using
  udev, e.g. searching for certain devices on the same I2C bus.
- dt_symbol_get_i2c_device_node: Get the i2c-dev device node
  (e.g. "/dev/i2c-0") for a given device tree symbol. This function
  is used in cases where only the device node is of interest, e.g.
  when passing it to a C/C++ library.
2026-06-25 14:47:14 +02:00
Jörg Hofrichter
a65baff474 mpm: apply ni-python-styleguide fix to *_bist 2026-06-25 14:47:14 +02:00
Jörg Hofrichter
1f22068c97 mpm: add executable flags to x4xx_bist
This ensures that the ni-python-styleguide-fix pre-commit
hook is being executed.
2026-06-25 14:47:14 +02:00
Martin Braun
af151f4f8f mpm: x4xx: Make init clocking sequence more robust
The recent change in 2e7ec47 exposed a new corner case:

- Assume two consecutive sessions with external clock and otherwise
  identical device args. In this case, the second session would usually
  start without forcing a re-init, because we assume the clocks are
  still fine.
- Now what if the external ref clock glitches between sessions, i.e.,
  when no UHD is running? In this case, the `spll_unlock_event` flag
  would never be set
- Because the reference lock check was implicitly sticky before the
  change, this would still cause a forced re-init in the past, but not
  anymore

This commit calls get_ref_stable() during session initialization to
scoop up any sticky bits that occurred between the last successful UHD
session and the new one. The ref-stable sensor state will be
reconfigured during device initialization, so this does not lose any
information.
2026-06-17 09:20:22 +02:00
Martin Braun
673f54ade9 mpm: x4xx: Allow resyncing SPLL R-dividers
When the SPLL loses reference lock and then re-locks to the reference,
its R-dividers will be out of sync. This change allows a new argument to
the set_sync_source() API call to resynchronize SPLL R-dividers to the
PPS flank. This is not a supported operation, and it may leave the FPGA
in an unknown state. For this reason, this option should only be
exercised by experienced users who know exactly which consequences this
may have.

To call this feature, use the reset_spll_r_divider key in the sync args:

```python
my_usrp.set_sync_source("reset_spll_r_divider=1")
```

If a reset was necessary and the R-divider reset was successful, it will
be necessary to also resynchronize timestamps between devices and
timekeepers.
2026-06-15 14:47:36 +02:00
Martin Braun
736fd1b85c cmake: Remove some Boost dependencies
With the most recent changes, Boost.Thread and all Boost date/time
libraries are no longer required. This updates the CMake and Debian
files to reflect those changes.
2026-06-15 09:50:16 +02:00
Martin Braun
fa0c49e074 mpm: x4xx: Add sticky LMK DLD bits back as ref_stable sensor
This adds a new sensor called `ref_stable` to the X4xx series. Unlike
`ref_locked`, which only checks the current ref-lock status, this will
also query the sticky bits of the LMK04832 lock-detect circuitry, and
then clear them. This allows checking if ref-lock was lost any time
between queries to the `ref_stable` sensor (unlike the `ref_locked`
sensor, which queries the current ref-lock status).
2026-06-12 15:19:41 +02:00
Martin Braun
2e7ec477cd mpm: x4xx: Make ref-lock sensor non-sticky
This changes the LMK04832 class to only optionally (and not always)
check the sticky LD_LOST flags in the 0x182 lock-detect register of the
LMK04832. As a result, the ref_locked sensor will now only return the
current lock status of this PLL, and the ref-locked LED
2026-06-12 15:19:41 +02:00
Martin Braun
b29cbbaf4f mpm: x4xx: Improve comments and annotations in clocking code
This updates comments and type annotations in x4xx_clock_{ctrl,mgr}.py
for better readability. No functional changes.
2026-06-12 15:19:41 +02:00
Martin Braun
4d71a19259 mpm: Fix linter issues on sample-PLL-related files 2026-06-12 15:19:41 +02:00
Martin Braun
94f09a671e x4xx_bist: nsync_gty: Separately report APLL1 and 2 lock bits
This splits the lock bits for APLL1 and 2, resulting in more detailed
reporting.
2026-06-12 15:19:41 +02:00
Max Köhler
49bf95f310 mpm: x400: resolving RFDC gearbox issues during start 2026-06-12 14:06:13 +02:00
Max Köhler
4bf834a9a8 mpm: x440: add fabric resampling to clock policy
Adjusting the MPM code to enable the correct generation of data_clk and
data_clk_2x based on the fabric resampler rate. Further increasing the
rfdc_clocks to match the desired higher sampling rates of the RFDC.
2026-06-12 14:06:13 +02:00
Max Köhler
94dd1084f8 mpm: fbx: add 200 MHz RF core version check 2026-06-12 14:06:13 +02:00
Lars Amsel
985f5e6eac MPM: Fix log typo for metadata output 2026-06-09 11:10:23 +02:00
Martin Anderseck
51037a3e7a mpm: hbx: Handle PG glitch on power-up
In rare cases it was observed that the power good bits of the mixer
chips used in HBX show `1` already before they are really up. That could
cause the power-up sequence to continue even though those chips are not
yet up which needs to be avoided. This is accomplished by querying the
PG bits twice before and evaluating both, so any short glitches get
ironed out.
In addition, because the code for ADMV1420 and 1320 was similar enough,
it was changed to be a bit shorter and more pythonic.
2026-06-01 16:25:06 +02:00
Martin Anderseck
eb7d518899 x4xx_bist: Change retval for tests not running
The SPI flash BiSTs can only run for X410 as only the X410
daughterboards have a flash memory on them. There is a check for that in
the tests already, but if they aren't running on X410 they used to
return `False` indicating some kind of error. But since it is not an
error if a test tries to test something that is definitely not there on
a different device it now only reports that but returns `True` to not
cause confusion for X420/X440 users.
2026-06-01 12:58:12 +02:00
Lars Amsel
32f56047f7 MPM: Fix regular expression
The regular expression used to validate the mpm shell output uses
backslash characters but does not escape them. Prepended the string
with "r" so that it is treated as a raw string.
2026-05-28 14:14:53 +02:00
Martin Anderseck
40d6cf61aa doc: Fix documentation for Doxygen
This fixes many documentation issues where in the Doxygen output
sentences were incomplete and information was missing that is there in
the source files actually.
2026-05-07 14:58:01 +02:00
Martin Braun
2d430f98c3 mpm: Add rpc_version key in device find routine
This adds a new key to the discovery information coming from MPM
devices (rpc_version). The purpose of this is to smooth a transition to
alternative RPC subsystems other than mprpc.

If a device reports a different RPC version than supported by UHD, it
can still be found, but cannot be used for UHD sessions.
2026-04-09 10:23:59 +02:00
NIDvoez
a95c20357f fpga: x4xx: Update SYSREF LMK delay to improve RFDC Multi-Tile Sync
Increase analog delay on x4xx sysref.

Co-Authored-By: Volkan Oez <volkan.oez@emerson.com>
Co-Authored-By: Markus Schill <markus.schill@emerson.com>
2026-04-06 00:04:02 +02:00
Marian Koop
7ba8fbf584 python: Remove obsolete license classifiers and update license field
Removed deprecated 'license classifiers' and updated license field with
valid SPDX license expression to to comply with Python packaging standards
(PEP 639).
2026-03-24 11:37:20 +01:00
Bjoern Bachmann
339f9aa681 mpm: xportmgr_udp: add support for forwarding using nftables
Co-authored-by: Jörg Hofrichter <joerg.hofrichter@emerson.com>
2026-03-24 11:29:27 +01:00
Jörg Hofrichter
b3f713ee92 mpm: include missing header in mykonos lib 2026-03-24 11:29:27 +01:00
Jörg Hofrichter
f2dc595748 mpm: sysfs_gpio: return error early if GPIO was not created
Also, add the "device_number" to the map_info returned by
get_gpio_map_info.
2026-03-24 11:29:27 +01:00
Jörg Hofrichter
5777e2b9ad mpm: adopt sys_utils.net to pyroute2 version 0.7.0 2026-03-24 11:29:27 +01:00
Jörg Hofrichter
51b7654216 mpm: adopt sys_utils.gpio to gpiod version 2.0.2 2026-03-24 11:29:27 +01:00
Jörg Hofrichter
633098281d mpm: rfdc: applied patch to fix C++ compilation issue
This is the following patch adopted to MPM:
32d1f20562.patch

Original author: Conall O'Griofa <conall.o'griofa@xilinx.com>
Original commit message: rfdc: Header File Clean Up

    Header clean up to:
    1. Fix C++ compilation issue
    2. Remove duplicate including of headers

    Signed-off-by: Conall O'Griofa <conall.o'griofa@xilinx.com>

    Acked-for-series: Dragan Cvetic <dragan.m.cvetic@gmail.com>
2026-03-24 11:29:27 +01:00
Max Köhler
dc6323fa9a mpm: 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 MPM 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:33 +01:00