Skip to content

Commit 4783354

Browse files
committed
refactor(adrv937x): move Mykonos profile into per-board profile JSON
Structural move — no functional change to the DT emitted for ``adrv937x_zc706``. Shift the 51-line ``_DEFAULT_MYKONOS_PROFILE_PROPS`` tuple out of the Python builder into ``adidt/xsa/profiles/adrv937x_zc706.json`` as a ``trx_profile_props`` field on ``adrv9009_board``. Builder default becomes an empty tuple. Why: the profile's implied JESD framing (M, L, F, K, Np, CS, CF) has to match the HDL's compile-time ``TX_JESD_*`` / ``RX_JESD_*`` knobs (see ``analogdevicesinc/hdl/projects/adrv937x/zc706/README.md``), and that's board-build-specific — hard-coding one profile in the generic builder was both wrong in content and wrong in scope. Per-board profile JSONs are the natural home. No change to what the bq CI leg builds today (the values in the JSON are identical to what the builder default used to provide, still copied verbatim from the Kuiper SD-card DT). The remaining ILAS mismatch is therefore still present and still needs a profile-regeneration pass — but this commit shapes the codebase so that fix can drop into one JSON file rather than a Python constant shared across every board using this builder. Unit tests: 449 passed, 13 skipped, 4 xfailed. Fixture regenerated; 51 ``adi,*-profile-*`` / ``adi,clocks-*`` lines still emit on ``ad9371-phy@1``.
1 parent 1cad33a commit 4783354

2 files changed

Lines changed: 71 additions & 85 deletions

File tree

adidt/xsa/builders/adrv937x.py

Lines changed: 17 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -24,91 +24,24 @@
2424
_ADRV937X_KEYWORDS = ("ad9371", "adrv937")
2525

2626

27-
# Default Mykonos (AD9371) initial device profile — baked into the DT as
28-
# ``adi,*-profile-*`` / ``adi,clocks-*`` properties on ``ad9371-phy@1``.
29-
# The AD9371 driver consumes these at probe to configure the ARM before
30-
# userspace ever sees the chip; without them the DMA stays silent even
31-
# after JESD lane training completes.
27+
# Default Mykonos (AD9371) initial device profile — baked into the DT
28+
# as ``adi,*-profile-*`` / ``adi,clocks-*`` properties on
29+
# ``ad9371-phy@1`` when the caller doesn't supply a per-profile
30+
# override.
3231
#
33-
# Values extracted verbatim from the reference ``zc706-adrv9371``
34-
# devicetree shipped by Kuiper's SD-card image (the 100 MHz RF-BW
35-
# profile with deviceClock=122.88 MHz). Override per-board by passing
36-
# ``adrv9009_board.trx_profile_props`` in the pipeline cfg.
37-
_DEFAULT_MYKONOS_PROFILE_PROPS: tuple[str, ...] = (
38-
"adi,clocks-clk-pll-vco-freq_khz = <0x960000>;",
39-
"adi,clocks-device-clock_khz = <0x1e000>;",
40-
"adi,clocks-clk-pll-hs-div = <0x04>;",
41-
"adi,clocks-clk-pll-vco-div = <0x02>;",
42-
"adi,jesd204-obs-framer-over-sample = <0x00>;",
43-
"adi,rx-profile-adc-div = <0x01>;",
44-
"adi,rx-profile-en-high-rej-dec5 = <0x01>;",
45-
"adi,rx-profile-iq-rate_khz = <0x1e000>;",
46-
"adi,rx-profile-rf-bandwidth_hz = <0x5f5e100>;",
47-
"adi,rx-profile-rhb1-decimation = <0x01>;",
48-
"adi,rx-profile-rx-bbf-3db-corner_khz = <0x186a0>;",
49-
"adi,rx-profile-rx-dec5-decimation = <0x05>;",
50-
"adi,rx-profile-rx-fir-decimation = <0x02>;",
51-
"adi,rx-profile-rx-fir-gain_db = <0xfffffffa>;",
52-
"adi,rx-profile-rx-fir-num-fir-coefs = <0x30>;",
53-
(
54-
"adi,rx-profile-rx-fir-coefs = <0xfffbffe6 0x200033 0xffbdff8c 0x8c00d4 "
55-
"0xff04fe91 0x1ad0253 0xfd50fc5d 0x4300593 0xf98ef774 0xa340da8 "
56-
"0xed3ee259 0x25b87e3d 0x7e3d25b8 0xe259ed3e 0xda80a34 0xf774f98e "
57-
"0x5930430 0xfc5dfd50 0x25301ad 0xfe91ff04 0xd4008c 0xff8cffbd "
58-
"0x330020 0xffe6fffb>;"
59-
),
60-
(
61-
"adi,rx-profile-custom-adc-profile = <0x2160182 0xc90062 0x50001eb "
62-
"0x6370117 0x51a0068 0x318001c 0x300027 0x1700bb>;"
63-
),
64-
"adi,obs-profile-adc-div = <0x01>;",
65-
"adi,obs-profile-en-high-rej-dec5 = <0x01>;",
66-
"adi,obs-profile-iq-rate_khz = <0x3c000>;",
67-
"adi,obs-profile-rf-bandwidth_hz = <0xbebc200>;",
68-
"adi,obs-profile-rhb1-decimation = <0x01>;",
69-
"adi,obs-profile-rx-bbf-3db-corner_khz = <0x186a0>;",
70-
"adi,obs-profile-rx-dec5-decimation = <0x05>;",
71-
"adi,obs-profile-rx-fir-decimation = <0x01>;",
72-
"adi,obs-profile-rx-fir-gain_db = <0x06>;",
73-
"adi,obs-profile-rx-fir-num-fir-coefs = <0x18>;",
74-
(
75-
"adi,obs-profile-rx-fir-coefs = <0xfedf0051 0xffe9ffaa 0xe5fe9e "
76-
"0x18dff17 0xfd6f06a3 0xefb459e2 0xefb406a3 0xfd6fff17 0x18dfe9e "
77-
"0xe5ffaa 0xffe90051 0xfedf0000>;"
78-
),
79-
(
80-
"adi,obs-profile-custom-adc-profile = <0x1c2015d 0xc90062 0x50002da "
81-
"0x65a0332 0x5c402dc 0x3420014 0x290024 0x1800c8>;"
82-
),
83-
(
84-
"adi,obs-settings-custom-loopback-adc-profile = <0x2390171 0xc90062 "
85-
"0x5000123 0x6050095 0x528003a 0x3270022 0x300028 0x1700bd>;"
86-
),
87-
"adi,tx-profile-dac-div = <0x01>;",
88-
"adi,tx-profile-iq-rate_khz = <0x3c000>;",
89-
"adi,tx-profile-primary-sig-bandwidth_hz = <0x47868c0>;",
90-
"adi,tx-profile-rf-bandwidth_hz = <0xbebc200>;",
91-
"adi,tx-profile-thb1-interpolation = <0x02>;",
92-
"adi,tx-profile-thb2-interpolation = <0x01>;",
93-
"adi,tx-profile-tx-bbf-3db-corner_khz = <0x186a0>;",
94-
"adi,tx-profile-tx-dac-3db-corner_khz = <0x2da78>;",
95-
"adi,tx-profile-tx-fir-interpolation = <0x01>;",
96-
"adi,tx-profile-tx-input-hb-interpolation = <0x01>;",
97-
"adi,tx-profile-tx-fir-gain_db = <0x06>;",
98-
"adi,tx-profile-tx-fir-num-fir-coefs = <0x10>;",
99-
(
100-
"adi,tx-profile-tx-fir-coefs = <0x6fef2 0xcbff58 0xffac03d7 "
101-
"0xf36a5297 0xf36a03d7 0xffacff58 0xcbfef2 0x60000>;"
102-
),
103-
"adi,sniffer-profile-adc-div = <0x01>;",
104-
"adi,sniffer-profile-en-high-rej-dec5 = <0x00>;",
105-
"adi,sniffer-profile-iq-rate_khz = <0x7800>;",
106-
"adi,sniffer-profile-rf-bandwidth_hz = <0x1312d00>;",
107-
"adi,sniffer-profile-rhb1-decimation = <0x02>;",
108-
"adi,sniffer-profile-rx-bbf-3db-corner_khz = <0x186a0>;",
109-
"adi,sniffer-profile-rx-dec5-decimation = <0x05>;",
110-
"adi,sniffer-profile-rx-fir-decimation = <0x04>;",
111-
)
32+
# The AD9371 driver consumes these at probe to configure the Mykonos
33+
# ARM before userspace ever sees the chip; the values must encode a
34+
# configuration whose JESD framing (M, L, F, K, Np, CS, CF) matches
35+
# the FPGA's compiled-in ``axi-jesd204-{tx,rx}`` overlays, otherwise
36+
# the deframer reports an ILAS mismatch at link-up and the TPL DMA
37+
# sits idle. Because "matching" is HDL-build-specific (see the
38+
# ``TX_JESD_*`` / ``RX_JESD_*`` knobs in
39+
# ``analogdevicesinc/hdl/projects/adrv937x/zc706/README.md``), this
40+
# module ships an empty default and expects the per-board profile
41+
# JSON (e.g. ``adidt/xsa/profiles/adrv937x_zc706.json``) to supply a
42+
# full ``trx_profile_props`` list. Callers without a profile JSON
43+
# can still override via ``board_cfg["trx_profile_props"]``.
44+
_DEFAULT_MYKONOS_PROFILE_PROPS: tuple[str, ...] = ()
11245

11346

11447
# AD9528 output-channel map baked into the DT so the clock distributor

adidt/xsa/profiles/adrv937x_zc706.json

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,60 @@
1515
"rx_os_link_id": 2,
1616
"tx_link_id": 0,
1717
"tx_octets_per_frame": 2,
18-
"rx_os_octets_per_frame": 2
18+
"rx_os_octets_per_frame": 2,
19+
"trx_profile_props": [
20+
"adi,clocks-clk-pll-vco-freq_khz = <0x960000>;",
21+
"adi,clocks-device-clock_khz = <0x1e000>;",
22+
"adi,clocks-clk-pll-hs-div = <0x04>;",
23+
"adi,clocks-clk-pll-vco-div = <0x02>;",
24+
"adi,jesd204-obs-framer-over-sample = <0x00>;",
25+
"adi,rx-profile-adc-div = <0x01>;",
26+
"adi,rx-profile-en-high-rej-dec5 = <0x01>;",
27+
"adi,rx-profile-iq-rate_khz = <0x1e000>;",
28+
"adi,rx-profile-rf-bandwidth_hz = <0x5f5e100>;",
29+
"adi,rx-profile-rhb1-decimation = <0x01>;",
30+
"adi,rx-profile-rx-bbf-3db-corner_khz = <0x186a0>;",
31+
"adi,rx-profile-rx-dec5-decimation = <0x05>;",
32+
"adi,rx-profile-rx-fir-decimation = <0x02>;",
33+
"adi,rx-profile-rx-fir-gain_db = <0xfffffffa>;",
34+
"adi,rx-profile-rx-fir-num-fir-coefs = <0x30>;",
35+
"adi,rx-profile-rx-fir-coefs = <0xfffbffe6 0x200033 0xffbdff8c 0x8c00d4 0xff04fe91 0x1ad0253 0xfd50fc5d 0x4300593 0xf98ef774 0xa340da8 0xed3ee259 0x25b87e3d 0x7e3d25b8 0xe259ed3e 0xda80a34 0xf774f98e 0x5930430 0xfc5dfd50 0x25301ad 0xfe91ff04 0xd4008c 0xff8cffbd 0x330020 0xffe6fffb>;",
36+
"adi,rx-profile-custom-adc-profile = <0x2160182 0xc90062 0x50001eb 0x6370117 0x51a0068 0x318001c 0x300027 0x1700bb>;",
37+
"adi,obs-profile-adc-div = <0x01>;",
38+
"adi,obs-profile-en-high-rej-dec5 = <0x01>;",
39+
"adi,obs-profile-iq-rate_khz = <0x3c000>;",
40+
"adi,obs-profile-rf-bandwidth_hz = <0xbebc200>;",
41+
"adi,obs-profile-rhb1-decimation = <0x01>;",
42+
"adi,obs-profile-rx-bbf-3db-corner_khz = <0x186a0>;",
43+
"adi,obs-profile-rx-dec5-decimation = <0x05>;",
44+
"adi,obs-profile-rx-fir-decimation = <0x01>;",
45+
"adi,obs-profile-rx-fir-gain_db = <0x06>;",
46+
"adi,obs-profile-rx-fir-num-fir-coefs = <0x18>;",
47+
"adi,obs-profile-rx-fir-coefs = <0xfedf0051 0xffe9ffaa 0xe5fe9e 0x18dff17 0xfd6f06a3 0xefb459e2 0xefb406a3 0xfd6fff17 0x18dfe9e 0xe5ffaa 0xffe90051 0xfedf0000>;",
48+
"adi,obs-profile-custom-adc-profile = <0x1c2015d 0xc90062 0x50002da 0x65a0332 0x5c402dc 0x3420014 0x290024 0x1800c8>;",
49+
"adi,obs-settings-custom-loopback-adc-profile = <0x2390171 0xc90062 0x5000123 0x6050095 0x528003a 0x3270022 0x300028 0x1700bd>;",
50+
"adi,tx-profile-dac-div = <0x01>;",
51+
"adi,tx-profile-iq-rate_khz = <0x3c000>;",
52+
"adi,tx-profile-primary-sig-bandwidth_hz = <0x47868c0>;",
53+
"adi,tx-profile-rf-bandwidth_hz = <0xbebc200>;",
54+
"adi,tx-profile-thb1-interpolation = <0x02>;",
55+
"adi,tx-profile-thb2-interpolation = <0x01>;",
56+
"adi,tx-profile-tx-bbf-3db-corner_khz = <0x186a0>;",
57+
"adi,tx-profile-tx-dac-3db-corner_khz = <0x2da78>;",
58+
"adi,tx-profile-tx-fir-interpolation = <0x01>;",
59+
"adi,tx-profile-tx-input-hb-interpolation = <0x01>;",
60+
"adi,tx-profile-tx-fir-gain_db = <0x06>;",
61+
"adi,tx-profile-tx-fir-num-fir-coefs = <0x10>;",
62+
"adi,tx-profile-tx-fir-coefs = <0x6fef2 0xcbff58 0xffac03d7 0xf36a5297 0xf36a03d7 0xffacff58 0xcbfef2 0x60000>;",
63+
"adi,sniffer-profile-adc-div = <0x01>;",
64+
"adi,sniffer-profile-en-high-rej-dec5 = <0x00>;",
65+
"adi,sniffer-profile-iq-rate_khz = <0x7800>;",
66+
"adi,sniffer-profile-rf-bandwidth_hz = <0x1312d00>;",
67+
"adi,sniffer-profile-rhb1-decimation = <0x02>;",
68+
"adi,sniffer-profile-rx-bbf-3db-corner_khz = <0x186a0>;",
69+
"adi,sniffer-profile-rx-dec5-decimation = <0x05>;",
70+
"adi,sniffer-profile-rx-fir-decimation = <0x04>;"
71+
]
1972
}
2073
}
2174
}

0 commit comments

Comments
 (0)