Skip to content

Staging/fix orx channels madura#3402

Open
RaulGeo289 wants to merge 4 commits into
mainfrom
staging/fix_ORX_channels_madura
Open

Staging/fix orx channels madura#3402
RaulGeo289 wants to merge 4 commits into
mainfrom
staging/fix_ORX_channels_madura

Conversation

@RaulGeo289

Copy link
Copy Markdown
Collaborator

PR Description

There is a problem in IIO oscilloscope:
if i use 2 TXs using loopbacks to 2 ORXs and i enable them both,i can only
see on both ORXs only one TX.This usually happens when i enable the second
digital chennel first,then the first one.After this sequence,it looks like the SPI
mode can only control 1 digital channel.This isn't addressed in the user guide,
so it could be only a guess.And at the same time,following the enables for
the ORX channels in the 0x106 register,it looks like the stream processors
also modify the routing of the channels,so the write on the crossbar registers
is required.

The device tree change only selects the GPIO pins used for ORx control.
The profile switches the ORx enable mode from SPI mode to dual-channel
4-pin mode, where the ORx channels are controlled through GPIO pins
instead of the 0x106 SPI enable register.

In the driver, the enable functionality is removed from rf_port_select;
enable is now driven solely from in_voltage4_en (write_raw). So in
dual-channel 4-pin mode, enabling a channel just drives the GPIO pins
described in the user guide, based on the channel in use: CTRL_A enables
the first digital channel, CTRL_C the second.

On every ORx enable edge the on-chip stream processor alters the ADC
sample crossbar state, collapsing the dual-channel split. To keep the two
ORx channels routed to separate converters, the driver re-asserts the ADC
sample crossbar (with a mask) after the enable change. This crossbar
re-assert is a required part of the fix: without it, the stream processor
leaves both channels routed together. As described in the user guide:

"A stream processor ... performs a series of configuration tasks based
on some event. ... The stream processor executes streams ... for:
ORx1/ORx2/ORx3/ORx4 enable/disable."

In set_obs_rx_path(), the driver only sets the select pin: CTRL_B for the
first digital channel or CTRL_D for the second. The 'mode' value comes
from rf_port_select (set via IIO oscilloscope): 0 selects ORx2/ORx4,
1 selects the other two. So selection is purely a GPIO set through IIO.

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have conducted a self-review of my own code changes
  • I have compiled my changes, including the documentation
  • I have tested the changes on the relevant hardware
  • I have updated the documentation outside this repo accordingly
  • I have provided links for the relevant upstream lore

@RaulGeo289

RaulGeo289 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator Author

I think it would be appropriate to add a section in the driver documentation that addresses the change of mode from the profile, so the client knows he can use SPI mode, if he wants to.

@stefpopa stefpopa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be careful at the commit title style:
drivers: iio: → iio:, arch: arm64: xilinx: → arm64: dts: zynqmp-zcu102:

API cleanup should be separate — removing "OFF" from rf_port_select is a distinct change from the 4-pin GPIO feature

Comment thread arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev10-adrv9025-nls.dts
Comment thread drivers/iio/adc/adrv902x/adrv9025.c Outdated
Comment thread drivers/iio/adc/adrv902x/adrv9025.c
Comment thread drivers/iio/adc/adrv902x/adrv9025.c Outdated
@stefpopa

Copy link
Copy Markdown
Collaborator

I think it would be appropriate to add a section in the driver documentation that addresses the change of mode from the profile, so the client knows he can use SPI mode, if he wants to.

should be documented in github.io/wiki and as part of th DT bindings YAML

@RaulGeo289
RaulGeo289 force-pushed the staging/fix_ORX_channels_madura branch from 6b7f637 to 4dc3d1d Compare June 26, 2026 13:17
@RaulGeo289

Copy link
Copy Markdown
Collaborator Author

Changelog v1:
-added error checks and fixed commit titles

@RaulGeo289
RaulGeo289 force-pushed the staging/fix_ORX_channels_madura branch from 4dc3d1d to ea44e5d Compare June 26, 2026 13:34
Comment thread firmware/ActiveUtilInit.profile
@RaulGeo289
RaulGeo289 force-pushed the staging/fix_ORX_channels_madura branch 2 times, most recently from 2ee90a0 to 6e5d488 Compare June 30, 2026 12:03
@RaulGeo289

Copy link
Copy Markdown
Collaborator Author

Changelog V2:
-split the commit that modified the driver into 2 parts:
one that handled removing OFF from rf_port_select attribute and handles enabling only from write_raw
one that implemented the fix for the main issue

@RaulGeo289
RaulGeo289 force-pushed the staging/fix_ORX_channels_madura branch from 6e5d488 to e4b88d7 Compare July 1, 2026 11:57
The dual-channel 4-pin ORx fix changes rf_port_select to a SELECT-only
attribute with two items per pair (lower/upper ORx); the "OFF" entry no
longer applies. Remove "OFF" from adrv9025_obs1_rx_port,
adrv9025_obs2_rx_port and ad9371_obs_rx_port_lut, and have
adrv9025_get_obs_rx_path parse the enable bits into the 2-item select
index (upper bit => 1, else 0) so the readback always lands on a valid
enum item.

Signed-off-by: Georgian Raul <Raul.Georgian@analog.com>
Implement dual-channel 4-pin ORx mode (orxEnableMode=4). The ORx side
enable and channel select are driven by the ORX_CTRL pins instead of the
0x106 SPI enable: A/C enable side-A/side-B, B/D select the ORx of each
pair. Acquire the four optional orx-ctrl gpios at probe and add them to
struct adrv9025_rf_phy.

adrv9025_orx_dual_4pin() gates the new path on the gpios being wired and
the cached init profile reporting orxEnableMode=4. In this mode
rf_port_select becomes select-only (B/D pins) and _en drives the side
enable (A/C pins) in read_raw/write_raw. The on-chip stream collapses the
framer-1 ADC sample crossbar on every ORx enable edge, so
adrv9025_orx_xbar_reassert() re-splits conv0/1 (side-A I/Q) and conv2/3
(side-B I/Q) after each enable/select change. Boards without the
ORX_CTRL pins keep the legacy SPI select+enable path.

Signed-off-by: Georgian Raul <Raul.Georgian@analog.com>
The dual -channel 4 pin mode uses 4 GPIO pins to control
the enable and the selection of the ORX channels

Signed-off-by: Georgian Raul <Raul.Georgian@analog.com>
Nodify the profile to use dual-channel 4 pin mode, instead of SPI mode
by modifying the number of pins used from 0 to 4.

Signed-off-by: Georgian Raul <Raul.Georgian@analog.com>
@RaulGeo289
RaulGeo289 force-pushed the staging/fix_ORX_channels_madura branch from e4b88d7 to 6eeb4c9 Compare July 1, 2026 12:33

@stefpopa stefpopa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The PR title could be cleaner, for example: iio: adc: adrv9025: add dual-channel 4-pin ORx GPIO mode
  • There is missing dt bindings documentation, but this can be added in a follow-up PR.

However, it looks good overall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants