mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Iuliana Prodan <iuliana.prodan@nxp.com>
To: Laurentiu Mihalcea <laurentiumihalcea111@gmail.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Peter Ujfalusi <peter.ujfalusi@linux.intel.com>,
	Bard Liao <yung-chuan.liao@linux.intel.com>,
	Ranjani Sridharan <ranjani.sridharan@linux.intel.com>,
	Daniel Baluta <daniel.baluta@nxp.com>,
	Kai Vehmanen <kai.vehmanen@linux.intel.com>,
	Mark Brown <broonie@kernel.org>
Cc: linux-sound@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: SOF: imx9: use SCMI API for LM management
Date: Wed, 12 Nov 2025 19:37:48 +0200	[thread overview]
Message-ID: <6484e7a7-6094-49a3-8b86-ede29c630596@nxp.com> (raw)
In-Reply-To: <20251112144124.680-1-laurentiumihalcea111@gmail.com>

On 11/12/2025 4:41 PM, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> 
> 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>
> ---
>   sound/soc/sof/imx/imx9.c | 36 ++++++++----------------------------
>   1 file changed, 8 insertions(+), 28 deletions(-)
> 
> diff --git a/sound/soc/sof/imx/imx9.c b/sound/soc/sof/imx/imx9.c
> index 853155d5990a..e56e8a1c8022 100644
> --- a/sound/soc/sof/imx/imx9.c
> +++ b/sound/soc/sof/imx/imx9.c
> @@ -3,19 +3,11 @@
>    * Copyright 2025 NXP
>    */
>   
> -#include <linux/arm-smccc.h>
> +#include <linux/firmware/imx/sm.h>
>   
>   #include "imx-common.h"
>   
> -#define IMX_SIP_SRC 0xC2000005
> -#define IMX_SIP_SRC_M_RESET_ADDR_SET 0x03
> -
> -#define IMX95_CPU_VEC_FLAGS_BOOT BIT(29)
> -
> -#define IMX_SIP_LMM 0xC200000F
> -#define IMX_SIP_LMM_BOOT 0x0
> -#define IMX_SIP_LMM_SHUTDOWN 0x1
> -
> +#define IMX95_M7_CPU_ID 0x1
>   #define IMX95_M7_LM_ID 0x1
>   
>   static struct snd_soc_dai_driver imx95_dai[] = {
> @@ -38,7 +30,6 @@ static int imx95_ops_init(struct snd_sof_dev *sdev)
>   
>   static int imx95_chip_probe(struct snd_sof_dev *sdev)
>   {
> -	struct arm_smccc_res smc_res;
>   	struct platform_device *pdev;
>   	struct resource *res;
>   
> @@ -49,31 +40,20 @@ static int imx95_chip_probe(struct snd_sof_dev *sdev)
>   		return dev_err_probe(sdev->dev, -ENODEV,
>   				     "failed to fetch SRAM region\n");
>   
> -	/* set core boot reset address */
> -	arm_smccc_smc(IMX_SIP_SRC, IMX_SIP_SRC_M_RESET_ADDR_SET, res->start,
> -		      IMX95_CPU_VEC_FLAGS_BOOT, 0, 0, 0, 0, &smc_res);
> -
> -	return smc_res.a0;
> +	return scmi_imx_lmm_reset_vector_set(IMX95_M7_LM_ID, IMX95_M7_CPU_ID,
> +					     0, res->start);

Please add a dependency for SND_SOC_SOF_IMX9 on CONFIG_IMX_SCMI_LMM_DRV. 
Without this, the functions scmi_imx_lmm_reset_vector_set and 
scmi_imx_lmm_operation will return -EOPNOTSUPP.

Iulia

>   }
>   
>   static int imx95_core_kick(struct snd_sof_dev *sdev)
>   {
> -	struct arm_smccc_res smc_res;
> -
> -	arm_smccc_smc(IMX_SIP_LMM, IMX_SIP_LMM_BOOT,
> -		      IMX95_M7_LM_ID, 0, 0, 0, 0, 0, &smc_res);
> -
> -	return smc_res.a0;
> +	return scmi_imx_lmm_operation(IMX95_M7_LM_ID, SCMI_IMX_LMM_BOOT, 0);
>   }
>   
>   static int imx95_core_shutdown(struct snd_sof_dev *sdev)
>   {
> -	struct arm_smccc_res smc_res;
> -
> -	arm_smccc_smc(IMX_SIP_LMM, IMX_SIP_LMM_SHUTDOWN,
> -		      IMX95_M7_LM_ID, 0, 0, 0, 0, 0, &smc_res);
> -
> -	return smc_res.a0;
> +	return scmi_imx_lmm_operation(IMX95_M7_LM_ID,
> +				      SCMI_IMX_LMM_SHUTDOWN,
> +				      SCMI_IMX_LMM_OP_FORCEFUL);
>   }
>   
>   static const struct imx_chip_ops imx95_chip_ops = {


      reply	other threads:[~2025-11-12 17:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-12 14:41 Laurentiu Mihalcea
2025-11-12 17:37 ` Iuliana Prodan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6484e7a7-6094-49a3-8b86-ede29c630596@nxp.com \
    --to=iuliana.prodan@nxp.com \
    --cc=broonie@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=kai.vehmanen@linux.intel.com \
    --cc=laurentiumihalcea111@gmail.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=ranjani.sridharan@linux.intel.com \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®