From nobody Tue Jun 16 20:37:09 2026 Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88F77337BAC; Wed, 29 Apr 2026 03:08:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=92.121.34.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777432099; cv=none; b=nCc+wEup3e9Hm2MsAxivMs1S+YcaSE9t/6tkI4C7V2muNJ88GMQc9HE5jIdlOdH8CwQ075kzmm4/ExrgxBt/N090pN8b2u0GVfXJbItOqLP80d6OKnF2Vou7t7a5J/BF1ZVyAJ5hv2ujzBbT3+Y5PaUTz7RAmL5GR56xa38DMKI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777432099; c=relaxed/simple; bh=jyNlr5Eqqnlnz9lPryB7rWBX44L7XcjPFgCNW2QI+/A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=qS82kmt3QsZaKD9PY/41KHrokX5cBPfiizJAX1tR7c7V5j7UIXj4SCSUPrbG4iW46fGqJeDDztHnbQBxWM00f/aWWpij86Iidt59rOOsHcnw0BgTbD8yL9oBbKarnX/buFrL/8J7mCm+tv/VEUjaKoTFETxVJFV/MWYJjPCTnaw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; arc=none smtp.client-ip=92.121.34.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 1D14A2044AE; Wed, 29 Apr 2026 05:08:16 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D83AF2044B9; Wed, 29 Apr 2026 05:08:15 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 9AD571800083; Wed, 29 Apr 2026 11:08:13 +0800 (+08) From: Jiafei Pan To: andersson@kernel.org, mathieu.poirier@linaro.org, peng.fan@nxp.com, Frank.Li@nxp.com, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Zhiqiang.Hou@nxp.com, mingkai.hu@nxp.com, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, Jiafei Pan Subject: [PATCH v2 1/5] dt-bindings: remoteproc: add imx-rproc-psci binding Date: Wed, 29 Apr 2026 11:10:43 +0800 Message-Id: <20260429031047.30893-2-Jiafei.Pan@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20260429031047.30893-1-Jiafei.Pan@nxp.com> References: <20260429031047.30893-1-Jiafei.Pan@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add compatible string "fsl,imx-rproc-psci" for i.MX Cortex-A Core's remoteproc support. Signed-off-by: Jiafei Pan --- .../remoteproc/fsl,imx-rproc-psci.yaml | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Documentation/devicetree/bindings/remoteproc/fsl,imx-rp= roc-psci.yaml diff --git a/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc-psc= i.yaml b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc-psci.ya= ml new file mode 100644 index 000000000000..cdab9566e588 --- /dev/null +++ b/Documentation/devicetree/bindings/remoteproc/fsl,imx-rproc-psci.yaml @@ -0,0 +1,64 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/remoteproc/fsl,imx-rproc-psci.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP i.MX Cortex-A Core Remote Processor via PSCI + +maintainers: + - Jiafei Pan + +description: + This binding provides support for managing Cortex-A cores as remote + processors on i.MX platforms using the PSCI (Power State Coordination + Interface) for CPU power management operations. This allows single + Cortex-A core or multiple Cortex-A cores to be controlled by Linux as + a remote processor, enabling them to run RTOS or bare-metal applications. + +properties: + compatible: + const: fsl,imx-rproc-psci + + fsl,cpus-bits: + $ref: /schemas/types.yaml#/definitions/uint32 + description: + Bitmask indicating which CPU cores are assigned to this remote + processor instance. Each bit represents a CPU core, where bit N + corresponds to CPU N. For example, 0x2 (0b10) assigns CPU core 1, + while 0x6 (0b110) assigns CPU cores 1 and 2. + + memory-region: + maxItems: 1 + description: + Phandle to a reserved memory region to be used for the remote + processor's code and data. + +required: + - compatible + - fsl,cpus-bits + - memory-region + +additionalProperties: false + +examples: + - | + / { + reserved-memory { + #address-cells =3D <2>; + #size-cells =3D <2>; + ranges; + + rtos_ca55_reserved: rtos-ca55@d0000000 { + reg =3D <0 0xd0000000 0 0x10000000>; + no-map; + }; + }; + + remoteproc-ca55-1 { + compatible =3D "fsl,imx-rproc-psci"; + /* bitmask: 0b10, assign A55 Core 1 */ + fsl,cpus-bits =3D <0x2>; + memory-region =3D <&rtos_ca55_reserved>; + }; + }; --=20 2.43.0 From nobody Tue Jun 16 20:37:09 2026 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7988135C185; Wed, 29 Apr 2026 03:08:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=92.121.34.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777432103; cv=none; b=nOe7PhoFMYc2FkbmKcd3/nT0sNQ95YbDxuFUAV+u2uWlAvMNMg+7zpLQk8617nS/mMsnhoUSkrNgGsGd2VZLhb853c08OWg8sPa5K3gjp1hRdPHh8iqsw4RAzRf/msFEv6QiKSbkAQU3KRfbWE8eFsNtwAkWx98ptfYbIwivMkk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777432103; c=relaxed/simple; bh=4mp2ezuOxgaNTicIuF1O96Jr0R2GoLm0gTPpNMZZ6sI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=jUgAMcwtyxLSy+03rCPMU+Q87eA6OCLFzu0bFNw/tlC4Jic+TBzXnthlbs9Q0bpwvn3Nvtt1W/w6TRDUCJdXtXVpMwOlqdU3E52xJYuy4MbRYddRfDJcn+UR1pQeC4EvmR1w0Dc+NTPC6rThFPhhWqia8lH9uf5ptxPfyLck9U4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; arc=none smtp.client-ip=92.121.34.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id E33981A19E5; Wed, 29 Apr 2026 05:08:18 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id ABFBB1A19DD; Wed, 29 Apr 2026 05:08:18 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 66C471800083; Wed, 29 Apr 2026 11:08:16 +0800 (+08) From: Jiafei Pan To: andersson@kernel.org, mathieu.poirier@linaro.org, peng.fan@nxp.com, Frank.Li@nxp.com, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Zhiqiang.Hou@nxp.com, mingkai.hu@nxp.com, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, Jiafei Pan Subject: [PATCH v2 2/5] drivers: remoteproc: imx: add support for Cortex-A Core Date: Wed, 29 Apr 2026 11:10:44 +0800 Message-Id: <20260429031047.30893-3-Jiafei.Pan@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20260429031047.30893-1-Jiafei.Pan@nxp.com> References: <20260429031047.30893-1-Jiafei.Pan@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add Cortex-A Core remoteproc support, it use PSCI and SIP SMC call to manage Cortex-A Core to be on or off. Signed-off-by: Jiafei Pan --- drivers/remoteproc/imx_rproc.c | 134 +++++++++++++++++++++++++++++++++ drivers/remoteproc/imx_rproc.h | 2 + 2 files changed, 136 insertions(+) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 0dd80e688b0e..8a3de27c96b7 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -20,12 +21,17 @@ #include #include #include +#include #include #include #include #include #include =20 +#include + +#include + #include "imx_rproc.h" #include "remoteproc_internal.h" =20 @@ -72,6 +78,8 @@ #define IMX_SIP_RPROC_STARTED 0x01 #define IMX_SIP_RPROC_STOP 0x02 =20 +#define IMX_SIP_CPU_OFF 0xC2000012 + #define IMX_SC_IRQ_GROUP_REBOOTED 5 =20 /** @@ -131,6 +139,9 @@ struct imx_rproc { * BIT 0: IMX_RPROC_FLAGS_SM_LMM_CTRL(RPROC LM is under Linux control ) */ u32 flags; + /* used by Cortex-A Core remoteproc to manage all CPU Cores */ + cpumask_t cpus; + cpumask_t offlined_cpus; }; =20 static const struct imx_rproc_att imx_rproc_att_imx95_m7[] =3D { @@ -381,6 +392,45 @@ static int imx_rproc_sm_lmm_start(struct rproc *rproc) return 0; } =20 +static int imx_rproc_psci_start(struct rproc *rproc) +{ + struct imx_rproc *priv =3D rproc->priv; + struct device *dev =3D priv->dev; + unsigned int cpu; + int ret; + + if (cpumask_empty(&priv->cpus)) { + dev_err(dev, "No CPU Core assigned!\n"); + return -ENODEV; + } + + for_each_cpu(cpu, &priv->cpus) { + if (cpu_online(cpu)) { + ret =3D remove_cpu(cpu); + if (ret) + goto err; + cpumask_set_cpu(cpu, &priv->offlined_cpus); + } + } + + cpu =3D cpumask_first(&priv->cpus); + ret =3D psci_ops.cpu_on(cpu_logical_map(cpu), rproc->bootaddr); + if (ret) { + dev_err(dev, "Boot failed on CPU Core %d\n", cpu); + goto err; + } + + return 0; + +err: + for_each_cpu(cpu, &priv->cpus) { + if (!cpu_online(cpu) && add_cpu(cpu) =3D=3D 0) + cpumask_clear_cpu(cpu, &priv->offlined_cpus); + } + + return ret; +} + static int imx_rproc_start(struct rproc *rproc) { struct imx_rproc *priv =3D rproc->priv; @@ -456,6 +506,50 @@ static int imx_rproc_sm_lmm_stop(struct rproc *rproc) return scmi_imx_lmm_operation(dcfg->lmid, SCMI_IMX_LMM_SHUTDOWN, 0); } =20 +static int imx_rproc_psci_stop(struct rproc *rproc) +{ + struct imx_rproc *priv =3D rproc->priv; + struct device *dev =3D priv->dev; + struct arm_smccc_res res; + unsigned int cpu; + unsigned long start, end; + int err; + + for_each_cpu(cpu, &priv->cpus) { + /* Check CPU status */ + err =3D psci_ops.affinity_info(cpu_logical_map(cpu), 0); + if (err =3D=3D PSCI_0_2_AFFINITY_LEVEL_OFF) + continue; + + /* Bring CPU to be off */ + arm_smccc_smc(IMX_SIP_CPU_OFF, cpu, 0, + 0, 0, 0, 0, 0, &res); + start =3D jiffies; + end =3D start + msecs_to_jiffies(100); + do { + err =3D psci_ops.affinity_info(cpu_logical_map(cpu), 0); + if (err =3D=3D PSCI_0_2_AFFINITY_LEVEL_OFF) { + pr_info("CPU%d is killed (polled %d ms)\n", cpu, + jiffies_to_msecs(jiffies - start)); + break; + } + + usleep_range(100, 1000); + } while (time_before(jiffies, end)); + } + + /* Return back freed CPU Core to Linux kernel */ + for_each_cpu(cpu, &priv->cpus) { + if (cpumask_test_cpu(cpu, &priv->offlined_cpus)) { + if (add_cpu(cpu) !=3D 0) + dev_err(dev, "Failed to bring CPU %d back to be online", cpu); + cpumask_clear_cpu(cpu, &priv->offlined_cpus); + } + } + + return 0; +} + static int imx_rproc_stop(struct rproc *rproc) { struct imx_rproc *priv =3D rproc->priv; @@ -480,6 +574,12 @@ static int imx_rproc_da_to_sys(struct imx_rproc *priv,= u64 da, const struct imx_rproc_dcfg *dcfg =3D priv->dcfg; int i; =20 + /* No need to translate for Cortex-A Core */ + if (dcfg->flags & IMX_RPROC_NO_ADDR_TRANS) { + *sys =3D da; + return 0; + } + /* parse address translation table */ for (i =3D 0; i < dcfg->att_size; i++) { const struct imx_rproc_att *att =3D &dcfg->att[i]; @@ -1184,6 +1284,13 @@ static int imx_rproc_sm_detect_mode(struct rproc *rp= roc) return imx_rproc_sm_lmm_check(rproc, started); } =20 +static int imx_rproc_psci_detect_mode(struct rproc *rproc) +{ + rproc->state =3D RPROC_OFFLINE; + + return 0; +} + static int imx_rproc_detect_mode(struct imx_rproc *priv) { /* @@ -1228,6 +1335,8 @@ static int imx_rproc_probe(struct platform_device *pd= ev) struct imx_rproc *priv; struct rproc *rproc; const struct imx_rproc_dcfg *dcfg; + unsigned int cpus; + unsigned long cpus_bits; int ret; =20 /* set some other name then imx */ @@ -1274,6 +1383,17 @@ static int imx_rproc_probe(struct platform_device *p= dev) if (ret) return dev_err_probe(dev, ret, "failed on imx_rproc_addr_init\n"); =20 + ret =3D of_property_read_u32(dev->of_node, "fsl,cpus-bits", &cpus); + if (ret) { + cpumask_clear(&priv->cpus); + } else { + cpus_bits =3D cpus; + bitmap_copy(cpumask_bits(&priv->cpus), &cpus_bits, + min((unsigned int)nr_cpumask_bits, + (unsigned int)sizeof(unsigned long))); + rproc->auto_boot =3D false; + } + ret =3D imx_rproc_detect_mode(priv); if (ret) return dev_err_probe(dev, ret, "failed on detect mode\n"); @@ -1372,6 +1492,12 @@ static const struct imx_rproc_plat_ops imx_rproc_ops= _sm_cpu =3D { .stop =3D imx_rproc_sm_cpu_stop, }; =20 +static const struct imx_rproc_plat_ops imx_rproc_ops_psci =3D { + .start =3D imx_rproc_psci_start, + .stop =3D imx_rproc_psci_stop, + .detect_mode =3D imx_rproc_psci_detect_mode, +}; + static const struct imx_rproc_dcfg imx_rproc_cfg_imx8mn_mmio =3D { .src_reg =3D IMX7D_SRC_SCR, .src_mask =3D IMX7D_M4_RST_MASK, @@ -1464,6 +1590,13 @@ static const struct imx_rproc_dcfg imx_rproc_cfg_imx= 95_m7 =3D { .lmid =3D 1, /* Use 1 as Logical Machine ID where M7 resides */ }; =20 +static const struct imx_rproc_dcfg imx_rproc_cfg_psci =3D { + .att =3D NULL, + .att_size =3D 0, + .ops =3D &imx_rproc_ops_psci, + .flags =3D IMX_RPROC_NO_ADDR_TRANS, +}; + static const struct of_device_id imx_rproc_of_match[] =3D { { .compatible =3D "fsl,imx7ulp-cm4", .data =3D &imx_rproc_cfg_imx7ulp }, { .compatible =3D "fsl,imx7d-cm4", .data =3D &imx_rproc_cfg_imx7d }, @@ -1479,6 +1612,7 @@ static const struct of_device_id imx_rproc_of_match[]= =3D { { .compatible =3D "fsl,imx8ulp-cm33", .data =3D &imx_rproc_cfg_imx8ulp }, { .compatible =3D "fsl,imx93-cm33", .data =3D &imx_rproc_cfg_imx93 }, { .compatible =3D "fsl,imx95-cm7", .data =3D &imx_rproc_cfg_imx95_m7 }, + { .compatible =3D "fsl,imx-rproc-psci", .data =3D &imx_rproc_cfg_psci }, {}, }; MODULE_DEVICE_TABLE(of, imx_rproc_of_match); diff --git a/drivers/remoteproc/imx_rproc.h b/drivers/remoteproc/imx_rproc.h index d37e6f90548c..be6709971042 100644 --- a/drivers/remoteproc/imx_rproc.h +++ b/drivers/remoteproc/imx_rproc.h @@ -18,6 +18,8 @@ struct imx_rproc_att { /* dcfg flags */ #define IMX_RPROC_NEED_SYSTEM_OFF BIT(0) #define IMX_RPROC_NEED_CLKS BIT(1) +/* No need address translation */ +#define IMX_RPROC_NO_ADDR_TRANS BIT(2) =20 struct imx_rproc_plat_ops { int (*start)(struct rproc *rproc); --=20 2.43.0 From nobody Tue Jun 16 20:37:09 2026 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79143337BAC; Wed, 29 Apr 2026 03:08:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=92.121.34.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777432103; cv=none; b=kPhTJFmmSlNI5XkZ3jFfGnCx2S+oqK6Pivg1ISfkgrVQIfDGBUeMG7nX1y0RVmj731ZAp3ZQAGGQdR7x7E/eMlGsXXpNV9RlKEIQHCkLaKDtT7f+9Ym/nRayLP6WxTI/K8Wc1hCkeONDDy7AaXxjMvwF+yQsA076IZU+/Lfx2tY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777432103; c=relaxed/simple; bh=pm8owCSvi5laK7dQAogzpytS3J+UVBzTzFwDIhOLVBM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=AmKzDwoiG2fSpxOw01TJ4xm1fkvJIQsJhZWn5o+4aHrTfpSs3OFA8rnMWEPiFQdCMIWL3sN9gN7/TQz5TYUE1H4NZdZDwgPl7+rtai+36hBXlRkAGnZ+I9WRLl4e5BhkPvvZARSxmc7H+Z7+beAQ8Jmn4MqHi8ajQbQWJfQeY40= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; arc=none smtp.client-ip=92.121.34.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 0E0BD1A1EE6; Wed, 29 Apr 2026 05:08:21 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id CA9C11A391E; Wed, 29 Apr 2026 05:08:20 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 059A0180026F; Wed, 29 Apr 2026 11:08:18 +0800 (+08) From: Jiafei Pan To: andersson@kernel.org, mathieu.poirier@linaro.org, peng.fan@nxp.com, Frank.Li@nxp.com, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Zhiqiang.Hou@nxp.com, mingkai.hu@nxp.com, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 3/5] drivers: remoteproc: imx: add autoboot support for A-core remoteproc Date: Wed, 29 Apr 2026 11:10:45 +0800 Message-Id: <20260429031047.30893-4-Jiafei.Pan@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20260429031047.30893-1-Jiafei.Pan@nxp.com> References: <20260429031047.30893-1-Jiafei.Pan@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Hou Zhiqiang Add autoboot support for Cortex-A Core remoteproc. Signed-off-by: Hou Zhiqiang --- drivers/remoteproc/imx_rproc.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index 8a3de27c96b7..e8d239bef5c9 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -1286,7 +1286,24 @@ static int imx_rproc_sm_detect_mode(struct rproc *rp= roc) =20 static int imx_rproc_psci_detect_mode(struct rproc *rproc) { - rproc->state =3D RPROC_OFFLINE; + struct imx_rproc *priv =3D rproc->priv; + unsigned int cpu; + int cpu_aff; + + rproc->state =3D RPROC_DETACHED; + for_each_cpu(cpu, &priv->cpus) { + cpu_aff =3D psci_ops.affinity_info(cpu_logical_map(cpu), 0); + if (cpu_aff =3D=3D PSCI_0_2_AFFINITY_LEVEL_OFF) { + rproc->state =3D RPROC_OFFLINE; + break; + } + + /* in psci on state but running Linux */ + if (cpu_online(cpu)) { + rproc->state =3D RPROC_OFFLINE; + break; + } + } =20 return 0; } @@ -1391,7 +1408,6 @@ static int imx_rproc_probe(struct platform_device *pd= ev) bitmap_copy(cpumask_bits(&priv->cpus), &cpus_bits, min((unsigned int)nr_cpumask_bits, (unsigned int)sizeof(unsigned long))); - rproc->auto_boot =3D false; } =20 ret =3D imx_rproc_detect_mode(priv); --=20 2.43.0 From nobody Tue Jun 16 20:37:09 2026 Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 088A5340A6B; Wed, 29 Apr 2026 03:08:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=92.121.34.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777432110; cv=none; b=Se+4UU3KuFJ2gdeKjWyuK4DN5dU7JSgnwX9VQfMBsrEcjN8yHLZZ1EMFyeCeyugtUs5575buycUJ4C8QFex4Tks7Z4iVDzO6l5+wVwu+zWWOpb+jUJUK7BKP3NJw3Z9AGLFRekjmJfJkQwid4QgIkw/dFOHO1PXAaTPBv1Y6ooE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777432110; c=relaxed/simple; bh=djqJt+vqzs5d1JAPEVi2B4EbcoLUWfnMy05XmKe/1SE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=V40DNSI6+KIL4vniHjgPIADoAwEEjAFscMACQNyMEB79TmjEd5GS++nvTRS2mrsL4UxQKSno+yXx6uNG/8ZwHmALjo8rh+9ctFDYyg1SpceNBQ35mvd7Lb/tUSGxZa7Swr8Fk44aRUh/dCuupV22IeiKkWNy1gulnDMo97g6ogg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; arc=none smtp.client-ip=92.121.34.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 93DC81A1F61; Wed, 29 Apr 2026 05:08:23 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 5CDC71A19DD; Wed, 29 Apr 2026 05:08:23 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 73737180026F; Wed, 29 Apr 2026 11:08:21 +0800 (+08) From: Jiafei Pan To: andersson@kernel.org, mathieu.poirier@linaro.org, peng.fan@nxp.com, Frank.Li@nxp.com, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Zhiqiang.Hou@nxp.com, mingkai.hu@nxp.com, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, Jiafei Pan Subject: [PATCH v2 4/5] arm64: dts: imx93: Cortex-A Core remoteproc device node Date: Wed, 29 Apr 2026 11:10:46 +0800 Message-Id: <20260429031047.30893-5-Jiafei.Pan@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20260429031047.30893-1-Jiafei.Pan@nxp.com> References: <20260429031047.30893-1-Jiafei.Pan@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Create device tree for i.MX93 14x14 evk and 11x11 evk, add Cortex-A Core remoteproc device nodes in these device tree. Signed-off-by: Jiafei Pan Signed-off-by: Hou Zhiqiang --- arch/arm64/boot/dts/freescale/Makefile | 2 + .../imx93-11x11-evk-multicore-rtos.dts | 39 +++++++++++++++++++ .../imx93-14x14-evk-multicore-rtos.dts | 39 +++++++++++++++++++ .../boot/dts/freescale/imx93-rproc-ca55.dtsi | 14 +++++++ 4 files changed, 94 insertions(+) create mode 100644 arch/arm64/boot/dts/freescale/imx93-11x11-evk-multicore= -rtos.dts create mode 100644 arch/arm64/boot/dts/freescale/imx93-14x14-evk-multicore= -rtos.dts create mode 100644 arch/arm64/boot/dts/freescale/imx93-rproc-ca55.dtsi diff --git a/arch/arm64/boot/dts/freescale/Makefile b/arch/arm64/boot/dts/f= reescale/Makefile index 711e36cc2c99..f067e5c44dae 100644 --- a/arch/arm64/boot/dts/freescale/Makefile +++ b/arch/arm64/boot/dts/freescale/Makefile @@ -460,12 +460,14 @@ dtb-$(CONFIG_ARCH_MXC) +=3D imx93-9x9-qsb-i3c.dtb dtb-$(CONFIG_ARCH_MXC) +=3D imx93-9x9-qsb-ontat-kd50g21-40nt-a1.dtb =20 dtb-$(CONFIG_ARCH_MXC) +=3D imx93-11x11-evk.dtb +dtb-$(CONFIG_ARCH_MXC) +=3D imx93-11x11-evk-multicore-rtos.dtb dtb-$(CONFIG_ARCH_MXC) +=3D imx93-11x11-frdm.dtb =20 imx93-11x11-frdm-pixpaper-dtbs +=3D imx93-11x11-frdm.dtb imx93-11x11-frdm-= pixpaper.dtbo dtb-$(CONFIG_ARCH_MXC) +=3D imx93-11x11-frdm-pixpaper.dtb =20 dtb-$(CONFIG_ARCH_MXC) +=3D imx93-14x14-evk.dtb +dtb-$(CONFIG_ARCH_MXC) +=3D imx93-14x14-evk-multicore-rtos.dtb dtb-$(CONFIG_ARCH_MXC) +=3D imx93-kontron-bl-osm-s.dtb dtb-$(CONFIG_ARCH_MXC) +=3D imx93-phyboard-nash.dtb dtb-$(CONFIG_ARCH_MXC) +=3D imx93-phyboard-segin.dtb diff --git a/arch/arm64/boot/dts/freescale/imx93-11x11-evk-multicore-rtos.d= ts b/arch/arm64/boot/dts/freescale/imx93-11x11-evk-multicore-rtos.dts new file mode 100644 index 000000000000..9fb2b94b83b4 --- /dev/null +++ b/arch/arm64/boot/dts/freescale/imx93-11x11-evk-multicore-rtos.dts @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright 2023-2026 NXP + */ + +/dts-v1/; +#include "imx93-11x11-evk.dts" +#include "imx93-rproc-ca55.dtsi" + +/ { + reserved-memory { + #address-cells =3D <2>; + #size-cells =3D <2>; + ranges; + + /* + * Reserve up to 16MB for one possible RTOS instances running on + * one Cortex-A Cores when booting Linux on at least one Cortex-A Core. + */ + rtos_ca55_reserved: rtos-ca55@d0000000 { + no-map; + reg =3D <0 0xd0000000 0x0 0x1000000>; + }; + + /* Reserve 16MB for FreeRTOS on M33 */ + m33_reserved: m33@a5000000 { + no-map; + reg =3D <0 0xa5000000 0 0x1000000>; + }; + }; +}; + +&lpuart2 { + status =3D "disabled"; +}; + +&clk { + init-on-array =3D ; +}; diff --git a/arch/arm64/boot/dts/freescale/imx93-14x14-evk-multicore-rtos.d= ts b/arch/arm64/boot/dts/freescale/imx93-14x14-evk-multicore-rtos.dts new file mode 100644 index 000000000000..b2481bf19b4a --- /dev/null +++ b/arch/arm64/boot/dts/freescale/imx93-14x14-evk-multicore-rtos.dts @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright 2024-2026 NXP + */ + +/dts-v1/; +#include "imx93-14x14-evk.dts" +#include "imx93-rproc-ca55.dtsi" + +/ { + reserved-memory { + #address-cells =3D <2>; + #size-cells =3D <2>; + ranges; + + /* + * Reserve up to 16MB for one possible RTOS instances running on + * one Cortex-A Cores when booting Linux on at least one Cortex-A Core. + */ + rtos_ca55_reserved: rtos-ca55@d0000000 { + no-map; + reg =3D <0 0xd0000000 0x0 0x1000000>; + }; + + /* Reserve 16MB for FreeRTOS on M33 */ + m33_reserved: m33@a5000000 { + no-map; + reg =3D <0 0xa5000000 0 0x1000000>; + }; + }; +}; + +&lpuart2 { + status =3D "disabled"; +}; + +&clk { + init-on-array =3D ; +}; diff --git a/arch/arm64/boot/dts/freescale/imx93-rproc-ca55.dtsi b/arch/arm= 64/boot/dts/freescale/imx93-rproc-ca55.dtsi new file mode 100644 index 000000000000..9d9a60404d2b --- /dev/null +++ b/arch/arm64/boot/dts/freescale/imx93-rproc-ca55.dtsi @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* + * Copyright 2024-2026 NXP + */ + +/ { + ca55_1: remoteproc-ca55-1 { + compatible =3D "fsl,imx-rproc-psci"; + /* bitmask:0b10, assign A55 Core 1 */ + fsl,cpus-bits =3D <0x2>; + memory-region =3D <&rtos_ca55_reserved>; + }; +}; + --=20 2.43.0 From nobody Tue Jun 16 20:37:09 2026 Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 64188344DAE; Wed, 29 Apr 2026 03:08:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=92.121.34.21 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777432109; cv=none; b=iI/Lm2EthqFUExJLQBmgGuzcp3fN2JCVX6B5gfg9miBD17o9E2NCqf5PStvolB8CUlGKjcfaGC5++SsISHM7ZiqtyAyvP6ZkJhQu9lQl6MULxre22gZzoxEZjntiGaBidLaSRG3b5MednigFcF9RVoRHw6ChSqmdv/Bzq6Sf950= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777432109; c=relaxed/simple; bh=lQoUiY+lt3bjHsPzg5VqObWgbpGt7W1tAnizhzeKrxQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=nwma29gwtlmyneAkZegAkylvguEBLHjPbKG7BiGpKtThXKUlTnQ9n5c0fixeoHHZvWFV5oXjckR9soxPdLNHQio6cpP5xj6Ca18RwzyiCXe4A1PiIEp2bWa1AV9Fv0wAz9tz34wwg5Od/L+ucXSsUogFsZIxqVulwenCOjT65RQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; arc=none smtp.client-ip=92.121.34.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id DF53A201A26; Wed, 29 Apr 2026 05:08:26 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id A721E201A1E; Wed, 29 Apr 2026 05:08:26 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 618B01800083; Wed, 29 Apr 2026 11:08:24 +0800 (+08) From: Jiafei Pan To: andersson@kernel.org, mathieu.poirier@linaro.org, peng.fan@nxp.com, Frank.Li@nxp.com, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Zhiqiang.Hou@nxp.com, mingkai.hu@nxp.com, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, Jiafei Pan Subject: [PATCH v2 5/5] remoteproc: imx: use device node name as processor name Date: Wed, 29 Apr 2026 11:10:47 +0800 Message-Id: <20260429031047.30893-6-Jiafei.Pan@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20260429031047.30893-1-Jiafei.Pan@nxp.com> References: <20260429031047.30893-1-Jiafei.Pan@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" As currently there are maybe multiple remote processors, so change from using fixed name to using device node name as remote processor name in order to make them can be distinguished by through of name in sys filesystem. Signed-off-by: Jiafei Pan --- drivers/remoteproc/imx_rproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c index e8d239bef5c9..17026e390e88 100644 --- a/drivers/remoteproc/imx_rproc.c +++ b/drivers/remoteproc/imx_rproc.c @@ -1357,7 +1357,7 @@ static int imx_rproc_probe(struct platform_device *pd= ev) int ret; =20 /* set some other name then imx */ - rproc =3D devm_rproc_alloc(dev, "imx-rproc", &imx_rproc_ops, + rproc =3D devm_rproc_alloc(dev, np->name, &imx_rproc_ops, NULL, sizeof(*priv)); if (!rproc) return -ENOMEM; --=20 2.43.0