Skip to content

QCOM adsp sound enablement

99degree edited this page May 24, 2024 · 2 revisions

Generally speaking, qcom adsp subsys is not as complicate as it is in porting point of view.

Below are some needed items to make it work

  • pd-mapper
  • adsp.mbn
  • device tree
  • sound driver
  • codec driver

pd-mapper is a software that is critical. Either as in software or kernel module. https://github.com/linux-msm/pd-mapper

Recently is implemented as kernel module by Linaro. Soon available upstream. https://patchwork.kernel.org/project/linux-arm-msm/list/?series=852589

adsp.mbn file is special for its digital signiture by vendor (Xiaomi). It can't mix-use. Usually vendor come with adsp.mdt and adsp.bXX files. Best practice is to use pil-squasher to combine it as adsp.mbn and here is the tool. https://github.com/linux-msm/pil-squasher

device tree for adsp is somewhat funny. usually vendor support or third party upstream into soc base dtsi. Do copy from a similar soc if needed. Then specify the adsp.mbn loading path by firmware-name = "qcom/.../adsp.mbn"; and set status = "okay";

sound driver is a kind of funny stuff. Sometimes can reuse some other platform driver such as of writing, sm7125 soc can use sm8250 driver.

codec driver is another kind of issue, sometimes can use the existing one from kernel or port from vendor kernel. Either way.

Here are some important thing to catch. there are many channels from adsp remote cpu to codec chip. Depends on setting, it is pri/sec/ter/quin channel. For example, Galaxy A52 use quin channel, miatoll and poco x3 use tert channel too.

According to vendor (Los20 kernel) cust-atoll-audio-overlay.dtsi indicates miatoll use tert channel:

  cdc_tert_mi2s_gpios: msm_cdc_pinctrl_pri {
          compatible = "qcom,msm-cdc-pinctrl";
          pinctrl-names = "aud_active", "aud_sleep";
           pinctrl-0 = <&tert_i2s_sck_active &tert_i2s_ws_active
                 &tert_i2s_data0_active &tert_i2s_data1_active>;

Ok that is it.

[    2.538613] [drm:dpu_kms_hw_init:1064] dpu hardware revision:0x60020000
[    2.561351] [drm] Initialized msm 1.12.0 20130625 for ae01000.display-controller on minor 1
[    2.563816] msm_dpu ae01000.display-controller: [drm:adreno_request_fw] loaded qcom/a630_sqe.fw from new location
[    2.564309] msm_dpu ae01000.display-controller: [drm:adreno_request_fw] loaded qcom/a630_gmu.bin from new location
[    2.676577] remoteproc remoteproc0: remote processor 62400000.remoteproc is now up
[    2.722419] qcom,fastrpc 62400000.remoteproc:glink-edge.fastrpcglink-apps-dsp.-1.-1: no reserved DMA memory for FASTRPC
[    2.743500] qcom,fastrpc-cb 62400000.remoteproc:glink-edge:fastrpc:compute-cb@3: Adding to iommu group 9
[    2.763182] qcom,fastrpc-cb 62400000.remoteproc:glink-edge:fastrpc:compute-cb@4: Adding to iommu group 10
[    2.778491] qcom,fastrpc-cb 62400000.remoteproc:glink-edge:fastrpc:compute-cb@5: Adding to iommu group 11
[    2.812470] qcom,apr 62400000.remoteproc:glink-edge.apr_audio_svc.-1.-1: Adding APR/GPR dev: aprsvc:service:4:3
[    2.816335] qcom,apr 62400000.remoteproc:glink-edge.apr_audio_svc.-1.-1: Adding APR/GPR dev: aprsvc:service:4:4
[    2.905720] fb0: Framebuffer is not in virtual address space.
[    2.982833] qcom,apr 62400000.remoteproc:glink-edge.apr_audio_svc.-1.-1: Adding APR/GPR dev: aprsvc:service:4:7
[    3.000339] q6asm-dai 62400000.remoteproc:glink-edge:apr:service@7:dais: Adding to iommu group 12
[    3.001655] Console: switching to colour frame buffer device 135x150
[    3.010399] qcom,apr 62400000.remoteproc:glink-edge.apr_audio_svc.-1.-1: Adding APR/GPR dev: aprsvc:service:4:8
[    3.094682] msm_dpu ae01000.display-controller: [drm] fb0: msmdrmfb frame buffer device
[    3.099862] dwc3 a600000.usb: Adding to iommu group 13
[    3.206689] input: POCO X3 Headset Jack as /devices/platform/soc/soc:sound/sound/card0/input2
[    3.213710] input: gpio-keys as /devices/platform/gpio-keys/input/input3
[    3.217102] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    3.223656] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    3.224964] Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'
[    3.225657] clk: Not disabling unused clocks
[    3.225749] PM: genpd: Not disabling unused power domains
[    3.225866] ALSA device list:
[    3.225930] #0: POCO X3