Skip to content

FP3 (SDM632/msm8953): WCD9326 (Tasha-lite) SLIMbus framer never comes up on mainline — earpiece/in-call/mic silent #255

Description

@llg179

The issue was investigated on my device by Anthropic's Claude code with Opus. See "What we're asking" section on how to make SLIMbus framer come up.

Summary

On a mainline kernel (postmarketOS, msm8953-mainline) the LPASS/ADSP never becomes
SLIMbus framer master, so the WCD9326 (Tasha-lite) codec never gets a logical address.
Result: earpiece / in-call / mic are silent (only the aw8898 speaker on Quinary MI2S
works). The AP-side satellite NGD sits waiting for a capability/reconfiguration that
the ADSP framer never drives.

We have exhaustively ruled out the AP/kernel side and would like a pointer from the
BSP side (details/ask at the bottom).

Environment

  • Device: Fairphone 3 (FP3), SoC SDM632 (msm8953), codec WCD9326 (Tasha-lite) on SLIMbus (c140000.slim-ngd). The codec is bound by the mainline wcd9335 driver (Tasha family), so dmesg reads wcd9335-slim; ALSA card is msm8953-tashalite-snd-card.
  • OS: postmarketOS, kernel 7.0.9-msm8953 (msm8953-mainline tree), lk2nd chainload.
  • Firmware: stock FP3 adsp.mbn (Oct-2021 build). XBL / ABL / TZ / RPM / ADSP firmware are all identical to the stock Android boot — only boot.img is replaced by lk2nd.
  • Reference: on msm8996 (full WCD9335/Tasha, same codec family, same mainline driver) the mainline SLIMbus stack brings the framer up correctly; on msm8953 it does not (family-wide: same pattern on sdm660/sdm670). This points at the msm8953 LPASS/ADSP side, not the codec variant.

Symptom (exact, reproducible)

qcom,slim-ngd-ctrl c140000.slim-ngd: DBG power_up: QMI power request OK
qcom,slim-ngd-ctrl c140000.slim-ngd: DBG power_up: ver=0x105 ngd_status=0x40c
qcom,slim-ngd-ctrl c140000.slim-ngd: DBG power_up: NGD setup done, waiting for capability (reconf)
qcom,slim-ngd-ctrl c140000.slim-ngd: capability exchange timed-out STATUS=0x40c CFG=0x0 INT_STAT=0x0
qcom,slim-ngd   qcom,slim-ngd.1: TX timed out:MC:0xd,mt:0x2
wcd9335-slim 217:1a0:1:0: Failed to get logical address
  • INT_STAT=0x0 over the whole timeout window: the NGD receives zero interrupts —
    the ADSP never frames the bus (never sends SLIM_USR_MC_MASTER_CAPABILITY).
  • Reproducible on demand via a clean ADSP restart:
    echo stop > /sys/class/remoteproc/<adsp>/state; echo start > .../state
    adsp is now up, APR audio services register, then the exact same
    ngd_status=0x40c → waiting for capability → timeout → Failed to get logical address.

Ruled out (AP/kernel side)

  • QMI SLIMbus (SvcId 0x301): SELECT_INSTANCE + POWER_REQ payloads and sequence
    are byte-identical to the working downstream capture; POWER_REQ returns OK.
  • TZ/PAS bring-up: mainline qcom_q6v5_pas vs downstream subsys-pil-tz use the
    same PAS SCM path (init_image → mem_setup → auth_and_reset); equivalent.
  • SMEM, clocks (incl. bb_clk1), regulators, power-domains, pinctrl: present/identical.
  • Firmware swap: flashing the authentic stock adsp.mbn on mainline does not change it.
  • NGD register programming: identical to the mainline msm8996 reference (where it works).
  • msm8996 vs msm8953: the only DT delta is the LPASS SMMU/GDSC that msm8953 lacks in
    HW — not a fix, but it shows msm8953's LPASS is "AP-opaque".

Golden reference (working downstream, driver-internal ipc_logging)

Captured live on the FP3 stock 4.9.218 stack (/d/ipc_logging/c140000.slim), the
working framer bring-up is entirely ADSP-driven — the AP is a passive satellite:

[22.960] Slimbus QMI NGD CB received event:2   (QMI_SERVER_ARRIVE, SLIMbus SvcId 0x301)
         QCCI TX MI:0x20 ML:0x15 SvcId:301     (SELECT_INSTANCE req)  -> RX OK
         QCCI TX MI:0x21 ML:0x0e SvcId:301     (POWER_REQ req)        -> RX OK
[22.989] SLIM SAT: Rcvd master capability      (ADSP broadcast MASTER_CAPABILITY on the bus)
[22.989] SLIM SAT: capability exchange successful
         slimbus:1 laddr:0xc8 / laddr:0xc7      (codec enumerated)

The AP does only SELECT_INSTANCE + POWER_REQ on SvcId 0x301; it never sends
CHECK_FRAMER (MI:0x22). ~1.3 ms after POWER_REQ the ADSP frames the bus and the AP's
NGD RX message queue receives SLIM_USR_MC_MASTER_CAPABILITY, to which it replies with
SLIM_USR_MC_REPORT_SATELLITE. The AP cannot and does not drive the framer — it waits
for the ADSP to broadcast capability.

On mainline the two QMI requests are byte-identical and the ADSP accepts them (POWER_REQ
returns OK), but the master-capability broadcast never happens. Decoding the failing
NGD registers confirms it precisely:

  • STATUS=0x40cNGD_LADDR (BIT1) is clear: the framer never enumerated the NGD.
  • INT_STAT=0x0NGD_INT_RX_MSG_RCVD (BIT30) is clear: the NGD received zero
    slim RX messages — the ADSP never put MASTER_CAPABILITY on the bus.
  • CFG=0x0 → even though the AP writes NGD_CFG = RX_MSGQ_EN|TX_MSGQ_EN|ENABLE (0x7)
    during setup, it reads back 0 one second later: the NGD is never handed to the AP
    because the framer never framed.

New finding (ADSP side, via rpmsg diag on mainline)

We exposed the ADSP's own DIAG SMD channel through rpmsg_char and read its F3 log
during the reproduced framer failure:

  • The ADSP boots fine and its APR audio services register.
  • During the framer failure the ADSP emits zero unmasked/error F3 — it does not
    treat "SLIMbus not framed" as an error/assert.
  • Interpretation: the framer-master role is simply never triggered/requested on
    mainline; the ADSP isn't failing, it's never asked to frame.
    (We could not enable masked/debug F3: binding the ADSP DIAG_CNTL control channel
    triggers a firmware/TZ-level SoC reset without the proprietary diag handshake — so the
    masked debug log needs your build's diag .dci DB / QXDM.)

What we're asking (answerable with BSP access)

  1. On mainline the ADSP accepts the SLIMbus POWER_REQ (QMI OK) but never broadcasts
    SLIM_USR_MC_MASTER_CAPABILITY
    on the bus (NGD_INT_RX_MSG_RCVD never fires). On your
    downstream boot the identical POWER_REQ is followed ~1.3 ms later by the ADSP framing
    the bus. What, beyond SELECT_INSTANCE+POWER_REQ on SvcId 0x301, makes the ADSP
    actually start framing and broadcast master capability?
    An ADSP boot argument, a
    device.cfg/ACDB/static-image config flag, or an SMD/GLINK/APR handshake it expects?
  2. Is the framer election gated by an ADSP-firmware config (ADSP static image /
    device.cfg / ACDB) that is present in your downstream boot but absent on a bare
    mainline boot?
  3. Does the audio userspace (ACDB loader / audio HAL) send an early
    AFE/SLIMBUS command that kicks off the framer? (On downstream the framer comes up
    ~25 ms after ADSP boot, before the audio HAL — suggesting it's ADSP-internal, but we
    want to confirm.)
  4. If possible: a QXDM / ADSP diag F3 capture of the SLIMbus framer bring-up on a
    working downstream boot (and/or of the failing mainline case). The .dci message DB
    is build-specific and only available on your side, so this is the one artifact we
    cannot produce ourselves.

Suspected mechanism (hypothesis — for BSP/QXDM verification)

We cannot see inside the ADSP, so the following is a hypothesis, not a claim. Given that
the AP side is byte-identical (QMI), the firmware is bit-identical (verified by loading
the authentic stock adsp.mbn on mainline — still silent), SMEM is bit-identical, the
ADSP load address matches (0x8d600000), and the PAS SCM sequence is equivalent
(PAS_INIT_IMAGE/AUTH_AND_RESET, pas-id=1, no restore_sec_cfg, no extra SMC —
downstream also uses qcom,pil-tz-generic, i.e. the same PAS path), the divergence
appears to live in the ADSP firmware's early SLIMbus-controller init branch behaving
differently under a mainline PAS boot vs a downstream boot — e.g. an xPU/access-control
or internal LPASS clock/reset that is implicitly opened during the downstream
auth_and_reset, or a platform-context/role variable that leaves the ADSP in a
"satellite/slave" state where it waits to be framed instead of framing.

Concrete questions for someone with source/QXDM access:

  1. In the msm8953/sdm632 ADSP image, what internal variable or register gates the early
    SLIMbus-controller init branch (the framer-master vs satellite/idle decision)?
  2. During auth_and_reset (pas-id=1), does the downstream TZ/PIL path implicitly open an
    LPASS/SLIMbus xPU or ungate an internal LPASS clock/reset that the mainline PAS path
    does not? (Note: on mainline MI2S/LPAIF works, so the LPASS is powered — this would
    have to be SLIMbus-macro-specific.)
  3. The SoC-ID/platform-subtype the ADSP reads is XBL-populated (identical on both boots),
    so a SoC-ID branch alone cannot explain it — is there a Linux-stage PAS-vs-PIL
    handoff difference (a scratch/context value the downstream stack writes before the SMC)
    that the ADSP consumes? If so, which one?
  4. A QXDM / ADSP diag F3 capture of the SLIMbus framer bring-up on a working downstream
    boot (the .dci DB is build-specific and only available on your side).

Any pointer to the trigger would unblock mainline audio on FP3 (and likely the whole
sdm6xx family). Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions