Skip to content

sc84x: platform fixes for adsp-6.18.31-y (interrupts, DT correctness, driver fixes) - #3480

Merged
mhennerich merged 14 commits into
adsp-6.18.31-yfrom
staging/sc84x-platform-fixes
Aug 10, 2026
Merged

sc84x: platform fixes for adsp-6.18.31-y (interrupts, DT correctness, driver fixes)#3480
mhennerich merged 14 commits into
adsp-6.18.31-yfrom
staging/sc84x-platform-fixes

Conversation

@mhennerich

Copy link
Copy Markdown
Contributor

Platform-level fixes for SC846/SC84x on adsp-6.18.31-y, independent of
any new peripheral drivers. All hardware-validated on the SC846 SOM
EZ-kit (MUN lab) unless noted.

Interrupt and device-tree correctness (sc846.dtsi)

  • PINT interrupt numbers: the pint nodes carried the SC59x GIC
    SPIs (65..72); on SC846 they are 217..224 (SVD + HRM, verified on
    hardware — with the old numbers every pint consumer silently gets
    zero interrupts). Also adds the standard interrupt-controller
    binding to each PINT so consumer nodes can take PINT-domain
    interrupts directly.
  • HADC interrupt: 186 (SC59x) -> 118 (HADC0_EVT per HRM).
  • Remaining SC59x-inherited interrupts in (mostly disabled) nodes
    corrected against the SC846 HRM interrupt list/SVD: TMU thermal,
    CAN FD 0/1, link ports, PKTE, CRC2/3 + their MDMA channels,
    L2CTL0/sram-controller, and the eMMC host (EMSI0 is at 0x31152000,
    IRQs 214/215 — the node pointed at the SC59x MSHC address).
  • Remove nodes for hardware SC846 does not have: emac1 (SC84x has
    one EMAC), rtc0, and the SC59x OSPI node at an unmapped address
    (flash on SC84x is served by the quad-capable SPI1/SPI2 and the two
    xSPI octal/HyperBus controllers, which need their own support).

Stability fixes

  • emac0: fixed-burst DMA: with snps,mixed-burst, sustained MAC
    DMA traffic hard-hangs the SoC silently (no exception, no watchdog;
    reproducible within a few hundred MB of streaming). Fixed bursts run
    the same workloads indefinitely; pbl/TSO unchanged. Validated with
    multi-GB streams and long iiod captures.
  • serial: adi_uart4: remove three bogus dma_unmap_sg calls on
    the TX scatterlist (DMA-API debug flagged map/unmap size mismatch).
  • spi: adi: read the SPI functional clock rate after enabling the
    clock, and fail probe loudly if it reads 0.

Usability / enablement

  • dmaengine: adi-dma + DT labels: name each DMA channel's IRQs
    after its peripheral (adi-dma uart0-tx etc. in /proc/interrupts),
    with label properties added for all SC846 and SC59x channels.
  • pinctrl: adi-adsp: enable the pad input buffer on
    peripheral-muxed pins (peripheral inputs don't see the pin without
    INEN) and support PIN_CONFIG_INPUT_ENABLE.
  • soc: adi: icc: demote the per-route TRU message to dev_dbg.
  • dt-bindings: add the SC5xx TRU trigger ID header and use it in
    the SC846 SOM device tree instead of magic numbers.

Validation

Boot-tested on SC846 SOM EZ-kit (base sc846-som-ezkit.dtb): clean
boot, Ethernet stable under multi-GB streaming, named DMA IRQs
visible, no DMA-API warnings. DTBs for all SC59x/SC84x boards build
cleanly.

@mhennerich mhennerich added sc846 Support for the ADSP-SC846 llm review Request a review from a LLM Reviewer labels Aug 6, 2026
@mhennerich
mhennerich requested review from a team August 6, 2026 10:07
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

LLM Review

run: 31091956263
didn't generate any comment, but you can still review the workflow run, job 'llm'.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

LLM review

This series adds SC846 (ADSP-SC84x) bring-up fixes to sc846.dtsi/sc846-som.dts
(PINT domains, GigE fixed-burst DMA, HADC/TMU/CAN/LP/PKTE/CRC/SRAM interrupt
corrections, removal of hardware the SoC does not have), a TRU trigger-ID
dt-bindings header, DMA channel IRQ naming, and fixes in spi-adi,
adi_uart4, and pinctrl-adsp (sclk rate read timing, TX scatterlist
double-unmap, and PORT_INEN/input-enable handling).

run: 31112768014

857284f6a5e7d - correct SC59x-inherited interrupt numbers

Ordering bug: the diff clobbers hadc's interrupt instead of fixing
lp0's. hadc (status = "okay") was correctly set to GIC_SPI 118
(HADC0_EVT) two commits earlier in c223cb6591b90, but this commit's own
message never mentions hadc — only thermal/can0/can1/lp0/lp1/pkte/crc2/ crc3/sram-controller/mmc0. The actual diff rewrites hadc's 118 -> 153,
while lp0's intended second-interrupt change (118 -> 153, LP0_STAT per
the commit message) never happens — only the first line of lp0's
interrupts property (117 -> 152) is changed. Net effect on the current
tree: hadc = 153 (wrong, reproduces exactly the bug c223cb6591b90
fixed), lp0 2nd irq = 118 (still wrong). Looks like a global/first-match
text substitution matched hadc's 118 occurrence (earlier in the file)
instead of lp0's.

c35506053785b - add SC5xx TRU trigger ID header

The header claims "The SC59x uses the same assignment for the subsets
below," but every existing SC59x board file in this tree uses a different
absolute ID for the same named SOFT0..SOFT5 triggers (sc573: SOFT4=71,
sc589: SOFT4=97, sc594: SOFT4=140, sc598: SOFT4=135), none matching this
header's ADI_TRU_MST_SOFT(4) == 171. TRU wiring is per-die and clearly
differs even between SC59x variants. Not a live bug (the header is only used
by sc846-som.dts today), but the comment should not claim cross-family
portability.

CI warnings

Most smatch/coccicheck/gcc -fanalyzer warnings on
pinctrl-adsp.c (NULL-deref on all_pins, sizeof on a pointer, unsigned
num_pins <= 0) and icc.c (missing put_device), and the spi-adi.c:800
platform_get_irq() smatch warning, all trace via git blame to
f402ec2e7ce4d, before this review range — pre-existing, not introduced
here. checkpatch also flags 3024b6645c7ce's commit message for a line
starting with # (git strips it as a comment on amend/reword) — message-only,
no code fix needed.

Verification data

No public ADSP-SC84x / SC846 HRM or SVD is listed on the ADI PDF sitemap
(only SC59x/SC58x/SC57x/SC83x manuals are published), so the absolute GIC SPI
numbers claimed for TMU/CAN/LP/PKTE/CRC/SRAM/PINT/HADC could not be checked
against a primary datasheet. Findings above instead came from internal
consistency checks: diffing each commit's stated intent against its actual
hunks, cross-referencing the final sc846.dtsi state, and grepping existing
SC59x board files for the TRU master IDs. Also rebuilt arm64 (gcc_aarch64,
W=1) for the five touched .c files and sc846-som-ezkit.dtb (dtc W=1):
both clean / matching the pre-existing warning set, confirming no new
regressions from a build standpoint.

Suggested patches

Apply the suggested patches with:

cd path/to/repository
export GITHUB_TOKEN=ghp_***
apply-patches --repo=analogdevicesinc/linux 31112768014
Install instructions

The following one-liner installs the script if not present already:

curl -fSsL "https://raw.githubusercontent.com/analogdevicesinc/doctools/refs/heads/main/ci/scripts/apply-patches.sh"      -o ~/.local/bin/apply-patches.sh &&   grep -q "/apply-patches.sh" ~/.bashrc || echo "source ~/.local/bin/apply-patches.sh" >> $_ ; . $_

More information at AI Usage.

@mhennerich
mhennerich force-pushed the staging/sc84x-platform-fixes branch from 531fe7f to 3f89a33 Compare August 6, 2026 15:21
@mhennerich

Copy link
Copy Markdown
Contributor Author

LLM review issues should be addressed now.

@nunojsa nunojsa 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.

Nice cleanup. Just some minor comments from me...

Comment thread drivers/spi/spi-adi.c Outdated
Comment thread drivers/spi/spi-adi.c Outdated
Comment thread drivers/pinctrl/adi/pinctrl-adsp.c
Comment thread arch/arm64/boot/dts/adi/sc846.dtsi Outdated
Comment thread drivers/dma/adi-dma.c Outdated
Comment thread drivers/pinctrl/adi/pinctrl-adsp.c
The DMA channel <-> peripheral assignment is fixed in silicon (HRM
"DMA Channel List"), so a bare IRQ entry in /proc/interrupts makes
users cross-reference the manual to find out which channel
interrupted. Name each channel IRQ after the controller instance and
the hardware channel id, which together identify the serviced
peripheral:

  24:  0  GICv3 286 Level  31022000.dma ch0
  25:  0  GICv3 322 Level  31022000.dma ch0 err
  40: 12  GICv3 263 Level  3102d000.dma ch23

MDMA destination-side IRQs get a "dst" suffix. The names are derived
entirely in the driver; no devicetree property is involved.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Every TRU route change logged at info level; SPI-offload consumers
connect and disconnect their trigger routes on each buffer
enable/disable cycle, which puts four log lines into dmesg per
capture. Demote to dev_dbg.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Named constants for the Trigger Routing Unit generator and receiver
IDs used by board files (software triggers, GP timer generators, SPI
DMA receivers) so device trees stop hard-coding magic numbers. Values
verified against the ADSP-SC84x HRM trigger lists; the SC59x uses the
same assignment for these subsets.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Replace the hard-coded SOFT4 trigger master ID in the SHARC
remoteproc node with the named constant.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
The ADSP-SC5xx / SC84x port-multiplex hardware separates the pad's
output driver (FER) from its input buffer (INEN). When both drivers
are disabled, the pad reads back as 0 regardless of the physical
level. Selecting a peripheral function (writing PORT_MUX and setting
FER) only enables the pad's output path -- INEN stays whatever it was
at reset (typically 0), which means any peripheral that needs to
sample data back from the pad (SPI MISO/RDY, UART RX, TWI SDA input
phase, ...) reads 0.

Set INEN unconditionally whenever the pin transitions from GPIO to a
peripheral function. This is harmless for output-only signals -- the
peripheral drives via the output driver, and the enabled input buffer
just reads the driven level.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>

@nunojsa nunojsa 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 comments now look much better 😄

Comment thread drivers/spi/spi-adi.c
adi_spi_probe() captured drv_data->sclk_rate via clk_get_rate() before
clk_prepare_enable() and never checked the result. If the rate ever
reads zero (misconfigured or orphaned clock tree), hz_to_spi_clock()
programs SPI_CLOCK to 0 on every transfer: SCLK never toggles and
every RX byte silently reads back 0x00 with no error anywhere.

Read the rate after clk_prepare_enable() -- a rate read before
prepare/enable is not guaranteed valid in general (e.g.
CLK_GET_RATE_NOCACHE clocks) -- and fail probe outright on a zero rate
instead of producing a silently dead bus.

On the SC846 SOM EZ-Kit the rate reads 125 MHz at either position;
this is a robustness cleanup, not a bug fix there.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Handle the generic PIN_CONFIG_INPUT_ENABLE pinconf param so board
DTSes can enable a pad's input buffer (PORT_INEN) without also
having to claim the pin as a GPIO consumer.

Rationale: HRM §16 (line 941 on the SC84x HRM) says PORT_INEN gates
the input driver. The pinX block observes the pad AFTER this buffer,
so a pin used purely as an edge IRQ source (e.g. an ADC's DREADY
line) sees no edges when INEN=0. Today the only way to get INEN=1
on such a pin is:

  * mux it to a peripheral function -- the driver's portmux_setup
    already writes INEN_SET (see the earlier "pinctrl: adi-adsp:
    enable input buffer on peripheral-muxed pins" patch), OR
  * gpiod_get(..., GPIOD_IN) it from somewhere -- which forces
    direction_input(), which writes INEN_SET as a side-effect.

Neither is possible for a bare interrupt-only consumer whose driver
already uses `interrupts=`/`interrupt-names=` (and not `-gpios=`).
The generic `input-enable` pinconf property in the consumer's
`pinctrl-N` group is the right knob for this. The port-gpio driver
already exposes the underlying MMR helpers; wire them up.

`arg == 0` -> disable (INEN_CLEAR), `arg != 0` -> enable (INEN_SET).

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
The TX xmit buffer is mapped once for the port's lifetime with
dma_map_single() in startup and unmapped in shutdown. Each transfer
only builds a scatterlist VIEW into that mapping via
kfifo_dma_out_prepare_mapped() — no per-transfer mapping exists, yet
the completion callback, the prep-failure path and stop_tx all called
dma_unmap_sg() on it. CONFIG_DMA_API_DEBUG flags this on every TX
burst:

  DMA-API: adi-uart4 31003000.uart: device driver frees DMA memory
  with different size [map size=4096 bytes] [unmap size=52 bytes]

On the current coherent dma-direct platforms this only corrupts the
DMA-API bookkeeping, but behind an IOMMU it would tear down the live
xmit-buffer mapping mid-lifetime. Drop the bogus unmaps; the cache
maintenance for the device remains the dma_sync_single_for_device()
performed before every submit.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
… domains

The PINT nodes carried the SC59x GIC SPI numbers (65..72), but on
SC846 the PINT interrupts sit on GIC SPI 217..224 (per the SC846 SVD,
verified on the SC846 SOM EZ-kit: with 65..72 the chained handler
installs on lines nothing is wired to and every pint consumer silently
receives zero interrupts).

Also add the standard interrupt-controller binding (plus the
"#interrupt-cells" property) to each PINT: the pint driver already
supports irq_domain_xlate_onecell, so consumer nodes can use plain
interrupt-parent = <&pintN>; interrupts = <M>; to receive a
PINT-domain interrupt (e.g. a data-ready GPIO).

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
With snps,mixed-burst (inherited from the SC59x configuration),
sustained MAC DMA traffic hard-hangs the SC846 SoC silently -- no
exception, no panic, no watchdog -- independent of which DDR region
the buffers live in. Observed on the SC846 SOM EZ-kit: ssh streams die
after ~150 MB, low-CPU UDP streaming after ~750 MB, and a 1 Gb/s iiod
buffer capture within seconds of starting.

Switching to snps,fixed-burst makes the same workloads run
indefinitely (validated with multi-GB UDP/TCP streams and long iiod
captures). Burst length (snps,pbl = 8) and TSO are not part of the
problem and keep their values, so throughput is unaffected.

This is a workaround, marked REVISIT in the dtsi: the root cause of
the hang is not yet confirmed and may be related to the Rev B SOM
LPDDR4 signal-margin issue (fixed in Rev C of the SOM).

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
The HADC node carried GIC SPI 186 over from the SC59x device tree, but
per the SC846 HRM interrupt list (and SVD) HADC0_EVT is GIC SPI 118,
edge sensitive. With the stale number the enabled HADC never receives
its event interrupt.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Several (mostly disabled) peripheral nodes still carried the SC59x GIC
SPI numbers. Correct them per the SC846 HRM system interrupt list and
SVD:

- thermal (TMU0):     7/8   -> 347 (TMU0_FAULT) / 348 (TMU0_ALERT)
  (7/8 are the SC846 CGU0/CGU1 event interrupts)
- can0 (CANFD0):      84-86 -> 1/2/3   (WU / IRQ / MSG)
- can1 (CANFD1):      87-89 -> 4/5/6
  (84-89 are EMAC0 DMA channel interrupts on SC846)
- lp0:                117/118 -> 152 (LP0_DMA) / 153 (LP0_STAT)
- lp1:                119/120 -> 154 (LP1_DMA) / 155 (LP1_STAT)
- pkte (0x310CD000):  161  -> 226 (PKTE0_IRQ)
- crc2 / crc3:        204/205 -> 48/49 (DCNTEXP, matching crc0/crc1)
- crc2_dma / crc3_dma (MDMA4/5 source channels):
                      200/289, 202/291 -> 44/54, 46/56
- sram-controller (L2CTL0): 10 -> 143 (L2CTL0_ECC_ERR)
- mmc0: the eMMC host on SC846 is EMSI0 at 0x31152000 with interrupts
  214 (MSHC) / 215 (wakeup) -- the node pointed at the SC59x MSHC
  address and interrupts

Also note on the CAN nodes that the SC846 hardware is CAN FD, which
the legacy adi,can binding does not cover.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Drop three nodes inherited from the SC59x device tree that describe
peripherals which do not exist on the SC846:

- emac1 (plus its alias and emac1_clkin): the SC84x has a single
  10/100/1000 EMAC per the datasheet feature table; the node's
  interrupt (227) is PWM0_TRIP on SC846, and no second EMAC appears
  in the SC846 interrupt list or SVD.
- rtc0: no RTC block exists in the SC846 memory map or interrupt list.
- ospi: the SC59x Cadence OSPI controller does not exist at
  0x31027000 on SC846 (nothing is mapped there). Serial flash on
  SC84x is served by two different facilities, both still described
  or describable:
    * the two "Quad-Data Bit SPI" instances from the datasheet
      feature table are SPI1/SPI2 (the adi,spi3 IP with quad data
      pins and memory-mapped ranges at 0x60000000), whose nodes
      remain in this file, and
    * the two xSPI octal/HyperBus flash controllers (XSPI0 at
      0x3101C000, IRQ 386; XSPI1 at 0x3114C000, IRQ 387; HRM ch.24),
      a new IP needing its own binding and driver support.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Unlike the other SPI controller nodes, spi0 carried no clocks
reference on either SoC. The adi,spi3 driver requires its "spi"
functional clock -- the CDU gate for the SPI clock domain -- and only
clk_prepare_enable() on that reference switches the gate on, so a
board enabling spi0 had to know to add the clock itself (and getting
the ID wrong, e.g. by porting the SC598 value, silently enables the
wrong gate: index 63 is the LP clock on the SC846 provider). The
functional clock is a property of the SoC, not the board: add it to
the spi0 nodes in both SoC dtsi files, matching spi1/spi2/spi5.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
@mhennerich
mhennerich force-pushed the staging/sc84x-platform-fixes branch from 6fbda9d to 8f1da79 Compare August 7, 2026 15:47
@mhennerich
mhennerich merged commit 2328bc2 into adsp-6.18.31-y Aug 10, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this to Done in ADSP Aug 10, 2026
@mhennerich
mhennerich deleted the staging/sc84x-platform-fixes branch August 10, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llm review Request a review from a LLM Reviewer sc846 Support for the ADSP-SC846

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants