Skip to content

Commit 9d8c094

Browse files
committed
fix(adrv937x): wire clkgen clkin1 to AD9528 ch1 to fix clock-rate mismatch
Diagnostic output from the JESD-status assert added in e4065c1 showed the real cause of the DMA timeout: === JESD204 RX status (sysfs) === Link is disabled Measured Link Clock: 122.882 MHz Reported Link Clock: 245.760 MHz ... 2× mismatch between measured and reported — the DT was telling the driver ``clkin1 = 245.76 MHz`` (via the ``misc_clk_0`` fixed-clock overlay) while the physical clock routed into the clkgen from the AD9528 FMC output is actually 122.88 MHz. The driver couldn't resolve the mismatch so it marked the link disabled, which stalls the TPL DMA even though the Mykonos-side jesd204 FSM reaches ``opt_post_running_stage``. Minimum targeted fix: swap the clkgen's ``clkin1`` reference from ``misc_clk_0`` to ``<&clk0_ad9528 1>`` (the same wiring the Kuiper reference DT uses) and drop the now-unused ``misc_clk_0`` overlay. Adxcvr is untouched — still routes through the clkgen for both conv + div40. This is a clocks-only change, no behavioural change on any other property, so it avoids the kernel-hang class the full rewire (commit 607663b) triggered. Unit tests: 449 passed, 13 skipped, 4 xfailed. Hw CI will tell us on the next bq leg whether "Link status: DATA" comes back and the DMA starts streaming.
1 parent e4065c1 commit 9d8c094

2 files changed

Lines changed: 30 additions & 19 deletions

File tree

adidt/xsa/builders/adrv937x.py

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -523,34 +523,46 @@ def build_model(
523523
)
524524

525525
# --- Clkgen overlay nodes ---
526+
# Point ``clkin1`` at AD9528 channel 1 (FMC_CLK) to match the
527+
# physical clock routing. The previous overlay left
528+
# ``clkin1`` bound to the sdtgen-inherited ``misc_clk_0``
529+
# fixed-clock (which we were setting to 245.76 MHz), but the
530+
# physical FMC clock from AD9528 is 122.88 MHz. The
531+
# axi-jesd204-rx sysfs status directly showed the
532+
# consequence: ``Measured Link Clock: 122.882 MHz`` +
533+
# ``Reported Link Clock: 245.760 MHz`` → "Link is disabled"
534+
# → TPL DMA never sees valid samples. Ref DT on bq uses
535+
# the same AD9528-ch1 clkin1 wiring. ``clocks`` with
536+
# explicit ``/delete-property/`` of the inherited xlnx
537+
# clocks list forces the overlay's value to win.
538+
clkgen_clocks = (
539+
f"<&{ps_clk_label} {ps_clk_index}>, <&{clock_chip_label} 1>"
540+
)
541+
clkgen_clock_names = '"s_axi_aclk", "clkin1"'
526542
rx_clkgen_node = (
527543
f"\t&{rx_clkgen_label} {{\n"
544+
"\t\t/delete-property/ clocks;\n"
528545
'\t\tcompatible = "adi,axi-clkgen-2.00.a";\n'
529546
"\t\t#clock-cells = <0>;\n"
530547
f'\t\tclock-output-names = "{rx_clkgen_label}";\n'
531-
'\t\tclock-names = "clkin1", "s_axi_aclk";\n'
548+
f"\t\tclocks = {clkgen_clocks};\n"
549+
f"\t\tclock-names = {clkgen_clock_names};\n"
532550
"\t};"
533551
)
534552
tx_clkgen_node = (
535553
f"\t&{tx_clkgen_label} {{\n"
554+
"\t\t/delete-property/ clocks;\n"
536555
'\t\tcompatible = "adi,axi-clkgen-2.00.a";\n'
537556
"\t\t#clock-cells = <0>;\n"
538557
f'\t\tclock-output-names = "{tx_clkgen_label}";\n'
539-
'\t\tclock-names = "clkin1", "s_axi_aclk";\n'
540-
"\t};"
541-
)
542-
543-
# --- Misc fixed-clock node (provides reference clock) ---
544-
misc_clk_node = (
545-
"\t&misc_clk_0 {\n"
546-
'\t\tcompatible = "fixed-clock";\n'
547-
"\t\t#clock-cells = <0>;\n"
548-
f"\t\tclock-frequency = <{misc_clk_hz}>;\n"
558+
f"\t\tclocks = {clkgen_clocks};\n"
559+
f"\t\tclock-names = {clkgen_clock_names};\n"
549560
"\t};"
550561
)
551562

563+
# ``misc_clk_0`` is no longer referenced now that clkgen
564+
# points at AD9528 — emit no overlay for it.
552565
extra_before: list[str] = [
553-
misc_clk_node,
554566
rx_clkgen_node,
555567
tx_clkgen_node,
556568
rx_xcvr_node,

test/devices/fixtures/adrv9371_zc706_xsa_reference.dts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,22 +132,21 @@
132132
};
133133
};
134134

135-
&misc_clk_0 {
136-
compatible = "fixed-clock";
137-
#clock-cells = <0>;
138-
clock-frequency = <245760000>;
139-
};
140135
&axi_ad9371_rx_clkgen {
136+
/delete-property/ clocks;
141137
compatible = "adi,axi-clkgen-2.00.a";
142138
#clock-cells = <0>;
143139
clock-output-names = "axi_ad9371_rx_clkgen";
144-
clock-names = "clkin1", "s_axi_aclk";
140+
clocks = <&clkc 15>, <&clk0_ad9528 1>;
141+
clock-names = "s_axi_aclk", "clkin1";
145142
};
146143
&axi_ad9371_tx_clkgen {
144+
/delete-property/ clocks;
147145
compatible = "adi,axi-clkgen-2.00.a";
148146
#clock-cells = <0>;
149147
clock-output-names = "axi_ad9371_tx_clkgen";
150-
clock-names = "clkin1", "s_axi_aclk";
148+
clocks = <&clkc 15>, <&clk0_ad9528 1>;
149+
clock-names = "s_axi_aclk", "clkin1";
151150
};
152151
&axi_ad9371_rx_xcvr {
153152
compatible = "adi,axi-adxcvr-1.0";

0 commit comments

Comments
 (0)