Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: SOF: imx9: use SCMI API for LM management

Linux supports NXP's LMM SCMI protocol so switch to using the appropriate
API. The SIPs were intended to act as placeholders until the support for
said protocol was upstreamed.

The underlying CPU protocol command from IMX_SIP_SRC_M_RESET_ADDR_SET is
replaced by a LMM protocol command with the same effect (i.e. setting the
boot address) since using the CPU protocol would require additional
permissions (which TF-A already had). Apart from this, the SIPs are
replaced by their equivalent Linux LMM commands.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Link: https://patch.msgid.link/20251114143503.2139-1-laurentiumihalcea111@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Laurentiu Mihalcea and committed by
Mark Brown
94000534 0140fc11

+9 -28
+1
sound/soc/sof/imx/Kconfig
··· 35 35 config SND_SOC_SOF_IMX9 36 36 tristate "SOF support for i.MX9" 37 37 depends on IMX_DSP 38 + depends on IMX_SCMI_LMM_DRV 38 39 select SND_SOC_SOF_IMX_COMMON 39 40 help 40 41 This adds support for Sound Open Firmware for NXP i.MX9 platforms.
+8 -28
sound/soc/sof/imx/imx9.c
··· 3 3 * Copyright 2025 NXP 4 4 */ 5 5 6 - #include <linux/arm-smccc.h> 6 + #include <linux/firmware/imx/sm.h> 7 7 8 8 #include "imx-common.h" 9 9 10 - #define IMX_SIP_SRC 0xC2000005 11 - #define IMX_SIP_SRC_M_RESET_ADDR_SET 0x03 12 - 13 - #define IMX95_CPU_VEC_FLAGS_BOOT BIT(29) 14 - 15 - #define IMX_SIP_LMM 0xC200000F 16 - #define IMX_SIP_LMM_BOOT 0x0 17 - #define IMX_SIP_LMM_SHUTDOWN 0x1 18 - 10 + #define IMX95_M7_CPU_ID 0x1 19 11 #define IMX95_M7_LM_ID 0x1 20 12 21 13 static struct snd_soc_dai_driver imx95_dai[] = { ··· 30 38 31 39 static int imx95_chip_probe(struct snd_sof_dev *sdev) 32 40 { 33 - struct arm_smccc_res smc_res; 34 41 struct platform_device *pdev; 35 42 struct resource *res; 36 43 ··· 40 49 return dev_err_probe(sdev->dev, -ENODEV, 41 50 "failed to fetch SRAM region\n"); 42 51 43 - /* set core boot reset address */ 44 - arm_smccc_smc(IMX_SIP_SRC, IMX_SIP_SRC_M_RESET_ADDR_SET, res->start, 45 - IMX95_CPU_VEC_FLAGS_BOOT, 0, 0, 0, 0, &smc_res); 46 - 47 - return smc_res.a0; 52 + return scmi_imx_lmm_reset_vector_set(IMX95_M7_LM_ID, IMX95_M7_CPU_ID, 53 + 0, res->start); 48 54 } 49 55 50 56 static int imx95_core_kick(struct snd_sof_dev *sdev) 51 57 { 52 - struct arm_smccc_res smc_res; 53 - 54 - arm_smccc_smc(IMX_SIP_LMM, IMX_SIP_LMM_BOOT, 55 - IMX95_M7_LM_ID, 0, 0, 0, 0, 0, &smc_res); 56 - 57 - return smc_res.a0; 58 + return scmi_imx_lmm_operation(IMX95_M7_LM_ID, SCMI_IMX_LMM_BOOT, 0); 58 59 } 59 60 60 61 static int imx95_core_shutdown(struct snd_sof_dev *sdev) 61 62 { 62 - struct arm_smccc_res smc_res; 63 - 64 - arm_smccc_smc(IMX_SIP_LMM, IMX_SIP_LMM_SHUTDOWN, 65 - IMX95_M7_LM_ID, 0, 0, 0, 0, 0, &smc_res); 66 - 67 - return smc_res.a0; 63 + return scmi_imx_lmm_operation(IMX95_M7_LM_ID, 64 + SCMI_IMX_LMM_SHUTDOWN, 65 + SCMI_IMX_LMM_OP_FORCEFUL); 68 66 } 69 67 70 68 static const struct imx_chip_ops imx95_chip_ops = {