* [PATCH v14 0/8] Introduction of a remoteproc tee to load signed firmware
@ 2024-11-26 9:10 Arnaud Pouliquen
2024-11-26 9:10 ` [PATCH v14 4/8] remoteproc: Rename load() operation to load_segments() in rproc_ops struct Arnaud Pouliquen
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Arnaud Pouliquen @ 2024-11-26 9:10 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Neil Armstrong,
Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Matthias Brugger, AngeloGioacchino Del Regno, Patrice Chotard,
Fabien Dessenne, Arnaud Pouliquen
Cc: linux-remoteproc, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel, imx, linux-amlogic, linux-mediatek, linux-arm-msm
Main updates from version V13[1]:
- Introduce new rproc_ops operation: load_fw() and release_fw(),
- Rename load() operation to load_segments() in rproc_ops structure and
drivers.
More details are available in each patch commit message.
[1] https://lore.kernel.org/linux-arm-kernel/20241104133515.256497-1-arnaud.pouliquen@foss.st.com/T/
Tested-on: commit 42f7652d3eb5 ("Linux 6.12-rc4")
Description of the feature:
--------------------------
This series proposes the implementation of a remoteproc tee driver to
communicate with a TEE trusted application responsible for authenticating
and loading the remoteproc firmware image in an Arm secure context.
1) Principle:
The remoteproc tee driver provides services to communicate with the OP-TEE
trusted application running on the Trusted Execution Context (TEE).
The trusted application in TEE manages the remote processor lifecycle:
- authenticating and loading firmware images,
- isolating and securing the remote processor memories,
- supporting multi-firmware (e.g., TF-M + Zephyr on a Cortex-M33),
- managing the start and stop of the firmware by the TEE.
2) Format of the signed image:
Refer to:
https://github.com/OP-TEE/optee_os/blob/master/ta/remoteproc/src/remoteproc_core.c#L18-L57
3) OP-TEE trusted application API:
Refer to:
https://github.com/OP-TEE/optee_os/blob/master/ta/remoteproc/include/ta_remoteproc.h
4) OP-TEE signature script
Refer to:
https://github.com/OP-TEE/optee_os/blob/master/scripts/sign_rproc_fw.py
Example of usage:
sign_rproc_fw.py --in <fw1.elf> --in <fw2.elf> --out <signed_fw.sign> --key ${OP-TEE_PATH}/keys/default.pem
5) Impact on User space Application
No sysfs impact. The user only needs to provide the signed firmware image
instead of the ELF image.
For more information about the implementation, a presentation is available here
(note that the format of the signed image has evolved between the presentation
and the integration in OP-TEE).
https://resources.linaro.org/en/resource/6c5bGvZwUAjX56fvxthxds
Arnaud Pouliquen (8):
remoteproc: core: Introduce rproc_pa_to_va helper
remoteproc: Add TEE support
remoteproc: Introduce load_fw and release_fw optional operation
remoteproc: Rename load() operation to load_segments() in rproc_ops
struct
remoteproc: Make load_segments and load_fw ops exclusive and optional
dt-bindings: remoteproc: Add compatibility for TEE support
remoteproc: stm32: Create sub-functions to request shutdown and
release
remoteproc: stm32: Add support of an OP-TEE TA to load the firmware
.../bindings/remoteproc/st,stm32-rproc.yaml | 58 +-
drivers/remoteproc/Kconfig | 10 +
drivers/remoteproc/Makefile | 1 +
drivers/remoteproc/imx_dsp_rproc.c | 2 +-
drivers/remoteproc/imx_rproc.c | 2 +-
drivers/remoteproc/meson_mx_ao_arc.c | 2 +-
drivers/remoteproc/mtk_scp.c | 2 +-
drivers/remoteproc/qcom_q6v5_adsp.c | 2 +-
drivers/remoteproc/qcom_q6v5_mss.c | 2 +-
drivers/remoteproc/qcom_q6v5_pas.c | 4 +-
drivers/remoteproc/qcom_q6v5_wcss.c | 4 +-
drivers/remoteproc/qcom_wcnss.c | 2 +-
drivers/remoteproc/rcar_rproc.c | 2 +-
drivers/remoteproc/remoteproc_core.c | 68 ++-
drivers/remoteproc/remoteproc_internal.h | 20 +-
drivers/remoteproc/remoteproc_tee.c | 508 ++++++++++++++++++
drivers/remoteproc/st_remoteproc.c | 2 +-
drivers/remoteproc/st_slim_rproc.c | 2 +-
drivers/remoteproc/stm32_rproc.c | 141 +++--
drivers/remoteproc/xlnx_r5_remoteproc.c | 2 +-
include/linux/remoteproc.h | 20 +-
include/linux/remoteproc_tee.h | 105 ++++
22 files changed, 893 insertions(+), 68 deletions(-)
create mode 100644 drivers/remoteproc/remoteproc_tee.c
create mode 100644 include/linux/remoteproc_tee.h
base-commit: adc218676eef25575469234709c2d87185ca223a
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v14 4/8] remoteproc: Rename load() operation to load_segments() in rproc_ops struct
2024-11-26 9:10 [PATCH v14 0/8] Introduction of a remoteproc tee to load signed firmware Arnaud Pouliquen
@ 2024-11-26 9:10 ` Arnaud Pouliquen
2024-11-28 5:58 ` kernel test robot
2024-11-26 9:10 ` [PATCH v14 6/8] dt-bindings: remoteproc: Add compatibility for TEE support Arnaud Pouliquen
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Arnaud Pouliquen @ 2024-11-26 9:10 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier, Shawn Guo, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Neil Armstrong,
Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Matthias Brugger, AngeloGioacchino Del Regno, Patrice Chotard,
Maxime Coquelin, Alexandre Torgue
Cc: Arnaud Pouliquen, linux-remoteproc, imx, linux-arm-kernel,
linux-kernel, linux-amlogic, linux-mediatek, linux-arm-msm,
linux-stm32
With the introduction of the load_fw() operation in the rproc_ops
structure, we need to clarify the difference in the use of the load()
and load_fw() ops.
The legacy load() is dedicated to loading the ELF segments into memory.
Rename this to a more explicit name: load_segments().
Suggested-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
---
drivers/remoteproc/imx_dsp_rproc.c | 2 +-
drivers/remoteproc/imx_rproc.c | 2 +-
drivers/remoteproc/meson_mx_ao_arc.c | 2 +-
drivers/remoteproc/mtk_scp.c | 2 +-
drivers/remoteproc/qcom_q6v5_adsp.c | 2 +-
drivers/remoteproc/qcom_q6v5_mss.c | 2 +-
drivers/remoteproc/qcom_q6v5_pas.c | 4 ++--
drivers/remoteproc/qcom_q6v5_wcss.c | 4 ++--
drivers/remoteproc/qcom_wcnss.c | 2 +-
drivers/remoteproc/rcar_rproc.c | 2 +-
drivers/remoteproc/remoteproc_core.c | 4 ++--
drivers/remoteproc/remoteproc_internal.h | 4 ++--
drivers/remoteproc/st_remoteproc.c | 2 +-
drivers/remoteproc/st_slim_rproc.c | 2 +-
drivers/remoteproc/stm32_rproc.c | 2 +-
drivers/remoteproc/xlnx_r5_remoteproc.c | 2 +-
include/linux/remoteproc.h | 4 ++--
17 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/drivers/remoteproc/imx_dsp_rproc.c b/drivers/remoteproc/imx_dsp_rproc.c
index 376187ad5754..a4a85fbce907 100644
--- a/drivers/remoteproc/imx_dsp_rproc.c
+++ b/drivers/remoteproc/imx_dsp_rproc.c
@@ -934,7 +934,7 @@ static const struct rproc_ops imx_dsp_rproc_ops = {
.start = imx_dsp_rproc_start,
.stop = imx_dsp_rproc_stop,
.kick = imx_dsp_rproc_kick,
- .load = imx_dsp_rproc_elf_load_segments,
+ .load_segments = imx_dsp_rproc_elf_load_segments,
.parse_fw = imx_dsp_rproc_parse_fw,
.find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table,
.sanity_check = rproc_elf_sanity_check,
diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index 800015ff7ff9..f45b3207f7e9 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -681,7 +681,7 @@ static const struct rproc_ops imx_rproc_ops = {
.stop = imx_rproc_stop,
.kick = imx_rproc_kick,
.da_to_va = imx_rproc_da_to_va,
- .load = rproc_elf_load_segments,
+ .load_segments = rproc_elf_load_segments,
.parse_fw = imx_rproc_parse_fw,
.find_loaded_rsc_table = imx_rproc_elf_find_loaded_rsc_table,
.get_loaded_rsc_table = imx_rproc_get_loaded_rsc_table,
diff --git a/drivers/remoteproc/meson_mx_ao_arc.c b/drivers/remoteproc/meson_mx_ao_arc.c
index f6744b538323..a1c8c0929ce3 100644
--- a/drivers/remoteproc/meson_mx_ao_arc.c
+++ b/drivers/remoteproc/meson_mx_ao_arc.c
@@ -137,7 +137,7 @@ static struct rproc_ops meson_mx_ao_arc_rproc_ops = {
.stop = meson_mx_ao_arc_rproc_stop,
.da_to_va = meson_mx_ao_arc_rproc_da_to_va,
.get_boot_addr = rproc_elf_get_boot_addr,
- .load = rproc_elf_load_segments,
+ .load_segments = rproc_elf_load_segments,
.sanity_check = rproc_elf_sanity_check,
};
diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
index e744c07507ee..4e9a8bf3bc6e 100644
--- a/drivers/remoteproc/mtk_scp.c
+++ b/drivers/remoteproc/mtk_scp.c
@@ -924,7 +924,7 @@ static int scp_stop(struct rproc *rproc)
static const struct rproc_ops scp_ops = {
.start = scp_start,
.stop = scp_stop,
- .load = scp_load,
+ .load_segments = scp_load,
.da_to_va = scp_da_to_va,
.parse_fw = scp_parse_fw,
.sanity_check = rproc_elf_sanity_check,
diff --git a/drivers/remoteproc/qcom_q6v5_adsp.c b/drivers/remoteproc/qcom_q6v5_adsp.c
index 572dcb0f055b..aa9896930bcf 100644
--- a/drivers/remoteproc/qcom_q6v5_adsp.c
+++ b/drivers/remoteproc/qcom_q6v5_adsp.c
@@ -527,7 +527,7 @@ static const struct rproc_ops adsp_ops = {
.stop = adsp_stop,
.da_to_va = adsp_da_to_va,
.parse_fw = adsp_parse_firmware,
- .load = adsp_load,
+ .load_segments = adsp_load,
.panic = adsp_panic,
};
diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index 2a42215ce8e0..a8beac1deabe 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -1687,7 +1687,7 @@ static const struct rproc_ops q6v5_ops = {
.start = q6v5_start,
.stop = q6v5_stop,
.parse_fw = qcom_q6v5_register_dump_segments,
- .load = q6v5_load,
+ .load_segments = q6v5_load,
.panic = q6v5_panic,
};
diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
index ef82835e98a4..9b269ce390c1 100644
--- a/drivers/remoteproc/qcom_q6v5_pas.c
+++ b/drivers/remoteproc/qcom_q6v5_pas.c
@@ -436,7 +436,7 @@ static const struct rproc_ops adsp_ops = {
.stop = adsp_stop,
.da_to_va = adsp_da_to_va,
.parse_fw = qcom_register_dump_segments,
- .load = adsp_load,
+ .load_segments = adsp_load,
.panic = adsp_panic,
};
@@ -446,7 +446,7 @@ static const struct rproc_ops adsp_minidump_ops = {
.stop = adsp_stop,
.da_to_va = adsp_da_to_va,
.parse_fw = qcom_register_dump_segments,
- .load = adsp_load,
+ .load_segments = adsp_load,
.panic = adsp_panic,
.coredump = adsp_minidump,
};
diff --git a/drivers/remoteproc/qcom_q6v5_wcss.c b/drivers/remoteproc/qcom_q6v5_wcss.c
index e913dabae992..44b5736dc8b9 100644
--- a/drivers/remoteproc/qcom_q6v5_wcss.c
+++ b/drivers/remoteproc/qcom_q6v5_wcss.c
@@ -771,7 +771,7 @@ static const struct rproc_ops q6v5_wcss_ipq8074_ops = {
.start = q6v5_wcss_start,
.stop = q6v5_wcss_stop,
.da_to_va = q6v5_wcss_da_to_va,
- .load = q6v5_wcss_load,
+ .load_segments = q6v5_wcss_load,
.get_boot_addr = rproc_elf_get_boot_addr,
};
@@ -779,7 +779,7 @@ static const struct rproc_ops q6v5_wcss_qcs404_ops = {
.start = q6v5_qcs404_wcss_start,
.stop = q6v5_wcss_stop,
.da_to_va = q6v5_wcss_da_to_va,
- .load = q6v5_wcss_load,
+ .load_segments = q6v5_wcss_load,
.get_boot_addr = rproc_elf_get_boot_addr,
.parse_fw = qcom_register_dump_segments,
};
diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c
index a7bb9da27029..42102bc4c458 100644
--- a/drivers/remoteproc/qcom_wcnss.c
+++ b/drivers/remoteproc/qcom_wcnss.c
@@ -335,7 +335,7 @@ static const struct rproc_ops wcnss_ops = {
.stop = wcnss_stop,
.da_to_va = wcnss_da_to_va,
.parse_fw = qcom_register_dump_segments,
- .load = wcnss_load,
+ .load_segments = wcnss_load,
};
static irqreturn_t wcnss_wdog_interrupt(int irq, void *dev)
diff --git a/drivers/remoteproc/rcar_rproc.c b/drivers/remoteproc/rcar_rproc.c
index cc17e8421f65..e36778fec072 100644
--- a/drivers/remoteproc/rcar_rproc.c
+++ b/drivers/remoteproc/rcar_rproc.c
@@ -142,7 +142,7 @@ static struct rproc_ops rcar_rproc_ops = {
.prepare = rcar_rproc_prepare,
.start = rcar_rproc_start,
.stop = rcar_rproc_stop,
- .load = rproc_elf_load_segments,
+ .load_segments = rproc_elf_load_segments,
.parse_fw = rcar_rproc_parse_fw,
.find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table,
.sanity_check = rproc_elf_sanity_check,
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 8df4b2c59bb6..e4ad024efcda 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -2485,11 +2485,11 @@ static int rproc_alloc_ops(struct rproc *rproc, const struct rproc_ops *ops)
if (!rproc->ops->coredump)
rproc->ops->coredump = rproc_coredump;
- if (rproc->ops->load || rproc->ops->load_fw)
+ if (rproc->ops->load_segments || rproc->ops->load_fw)
return 0;
/* Default to ELF loader if no load function is specified */
- rproc->ops->load = rproc_elf_load_segments;
+ rproc->ops->load_segments = rproc_elf_load_segments;
rproc->ops->parse_fw = rproc_elf_load_rsc_table;
rproc->ops->find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table;
rproc->ops->sanity_check = rproc_elf_sanity_check;
diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h
index 2104ca449178..b898494600cf 100644
--- a/drivers/remoteproc/remoteproc_internal.h
+++ b/drivers/remoteproc/remoteproc_internal.h
@@ -167,8 +167,8 @@ u64 rproc_get_boot_addr(struct rproc *rproc, const struct firmware *fw)
static inline
int rproc_load_segments(struct rproc *rproc, const struct firmware *fw)
{
- if (rproc->ops->load)
- return rproc->ops->load(rproc, fw);
+ if (rproc->ops->load_segments)
+ return rproc->ops->load_segments(rproc, fw);
return -EINVAL;
}
diff --git a/drivers/remoteproc/st_remoteproc.c b/drivers/remoteproc/st_remoteproc.c
index 1340be9d0110..8d6b75e91531 100644
--- a/drivers/remoteproc/st_remoteproc.c
+++ b/drivers/remoteproc/st_remoteproc.c
@@ -233,7 +233,7 @@ static const struct rproc_ops st_rproc_ops = {
.start = st_rproc_start,
.stop = st_rproc_stop,
.parse_fw = st_rproc_parse_fw,
- .load = rproc_elf_load_segments,
+ .load_segments = rproc_elf_load_segments,
.find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table,
.sanity_check = rproc_elf_sanity_check,
.get_boot_addr = rproc_elf_get_boot_addr,
diff --git a/drivers/remoteproc/st_slim_rproc.c b/drivers/remoteproc/st_slim_rproc.c
index 5412beb0a692..0f91d8f1e7c7 100644
--- a/drivers/remoteproc/st_slim_rproc.c
+++ b/drivers/remoteproc/st_slim_rproc.c
@@ -201,7 +201,7 @@ static const struct rproc_ops slim_rproc_ops = {
.stop = slim_rproc_stop,
.da_to_va = slim_rproc_da_to_va,
.get_boot_addr = rproc_elf_get_boot_addr,
- .load = rproc_elf_load_segments,
+ .load_segments = rproc_elf_load_segments,
.sanity_check = rproc_elf_sanity_check,
};
diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c
index 8c7f7950b80e..7e8ffd9fcc57 100644
--- a/drivers/remoteproc/stm32_rproc.c
+++ b/drivers/remoteproc/stm32_rproc.c
@@ -667,7 +667,7 @@ static const struct rproc_ops st_rproc_ops = {
.attach = stm32_rproc_attach,
.detach = stm32_rproc_detach,
.kick = stm32_rproc_kick,
- .load = rproc_elf_load_segments,
+ .load_segments = rproc_elf_load_segments,
.parse_fw = stm32_rproc_parse_fw,
.find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table,
.get_loaded_rsc_table = stm32_rproc_get_loaded_rsc_table,
diff --git a/drivers/remoteproc/xlnx_r5_remoteproc.c b/drivers/remoteproc/xlnx_r5_remoteproc.c
index 5aeedeaf3c41..59cfba0a02e7 100644
--- a/drivers/remoteproc/xlnx_r5_remoteproc.c
+++ b/drivers/remoteproc/xlnx_r5_remoteproc.c
@@ -864,7 +864,7 @@ static const struct rproc_ops zynqmp_r5_rproc_ops = {
.unprepare = zynqmp_r5_rproc_unprepare,
.start = zynqmp_r5_rproc_start,
.stop = zynqmp_r5_rproc_stop,
- .load = rproc_elf_load_segments,
+ .load_segments = rproc_elf_load_segments,
.parse_fw = zynqmp_r5_parse_fw,
.find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table,
.sanity_check = rproc_elf_sanity_check,
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
index ba6fd560f7ba..55c20424a99f 100644
--- a/include/linux/remoteproc.h
+++ b/include/linux/remoteproc.h
@@ -374,7 +374,7 @@ enum rsc_handling_status {
* @find_loaded_rsc_table: find the loaded resource table from firmware image
* @get_loaded_rsc_table: get resource table installed in memory
* by external entity
- * @load: load firmware to memory, where the remote processor
+ * @load_segments: load firmware ELF segment to memory, where the remote processor
* expects to find it
* @sanity_check: sanity check the fw image
* @get_boot_addr: get boot address to entry point specified in firmware
@@ -402,7 +402,7 @@ struct rproc_ops {
struct rproc *rproc, const struct firmware *fw);
struct resource_table *(*get_loaded_rsc_table)(
struct rproc *rproc, size_t *size);
- int (*load)(struct rproc *rproc, const struct firmware *fw);
+ int (*load_segments)(struct rproc *rproc, const struct firmware *fw);
int (*sanity_check)(struct rproc *rproc, const struct firmware *fw);
u64 (*get_boot_addr)(struct rproc *rproc, const struct firmware *fw);
unsigned long (*panic)(struct rproc *rproc);
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v14 6/8] dt-bindings: remoteproc: Add compatibility for TEE support
2024-11-26 9:10 [PATCH v14 0/8] Introduction of a remoteproc tee to load signed firmware Arnaud Pouliquen
2024-11-26 9:10 ` [PATCH v14 4/8] remoteproc: Rename load() operation to load_segments() in rproc_ops struct Arnaud Pouliquen
@ 2024-11-26 9:10 ` Arnaud Pouliquen
2024-11-26 9:10 ` [PATCH v14 7/8] remoteproc: stm32: Create sub-functions to request shutdown and release Arnaud Pouliquen
2024-11-26 9:10 ` [PATCH v14 8/8] remoteproc: stm32: Add support of an OP-TEE TA to load the firmware Arnaud Pouliquen
3 siblings, 0 replies; 6+ messages in thread
From: Arnaud Pouliquen @ 2024-11-26 9:10 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Maxime Coquelin,
Alexandre Torgue, Fabien Dessenne, Arnaud Pouliquen
Cc: linux-remoteproc, devicetree, linux-stm32, linux-arm-kernel,
linux-kernel
The "st,stm32mp1-m4-tee" compatible is utilized in a system configuration
where the Cortex-M4 firmware is loaded by the Trusted Execution Environment
(TEE).
For instance, this compatible is used in both the Linux and OP-TEE device
trees:
- In OP-TEE, a node is defined in the device tree with the
"st,stm32mp1-m4-tee" compatible to support signed remoteproc firmware.
Based on DT properties, the OP-TEE remoteproc framework is initiated to
expose a trusted application service to authenticate and load the remote
processor firmware provided by the Linux remoteproc framework, as well
as to start and stop the remote processor.
- In Linux, when the compatibility is set, the Cortex-M resets should not
be declared in the device tree. In such a configuration, the reset is
managed by the OP-TEE remoteproc driver and is no longer accessible from
the Linux kernel.
Associated with this new compatible, add the "st,proc-id" property to
identify the remote processor. This ID is used to define a unique ID,
common between Linux, U-Boot, and OP-TEE, to identify a coprocessor.
This ID will be used in requests to the OP-TEE remoteproc Trusted
Application to specify the remote processor.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
---
.../bindings/remoteproc/st,stm32-rproc.yaml | 58 ++++++++++++++++---
1 file changed, 50 insertions(+), 8 deletions(-)
diff --git a/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml
index 370af61d8f28..409123cd4667 100644
--- a/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml
+++ b/Documentation/devicetree/bindings/remoteproc/st,stm32-rproc.yaml
@@ -16,7 +16,12 @@ maintainers:
properties:
compatible:
- const: st,stm32mp1-m4
+ enum:
+ - st,stm32mp1-m4
+ - st,stm32mp1-m4-tee
+ description:
+ Use "st,stm32mp1-m4" for the Cortex-M4 coprocessor management by non-secure context
+ Use "st,stm32mp1-m4-tee" for the Cortex-M4 coprocessor management by secure context
reg:
description:
@@ -43,6 +48,10 @@ properties:
- description: The offset of the hold boot setting register
- description: The field mask of the hold boot
+ st,proc-id:
+ description: remote processor identifier
+ $ref: /schemas/types.yaml#/definitions/uint32
+
st,syscfg-tz:
deprecated: true
description:
@@ -142,21 +151,43 @@ properties:
required:
- compatible
- reg
- - resets
allOf:
- if:
properties:
- reset-names:
- not:
- contains:
- const: hold_boot
+ compatible:
+ contains:
+ const: st,stm32mp1-m4
then:
+ if:
+ properties:
+ reset-names:
+ not:
+ contains:
+ const: hold_boot
+ then:
+ required:
+ - st,syscfg-holdboot
+ else:
+ properties:
+ st,syscfg-holdboot: false
+ required:
+ - reset-names
required:
- - st,syscfg-holdboot
- else:
+ - resets
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: st,stm32mp1-m4-tee
+ then:
properties:
st,syscfg-holdboot: false
+ reset-names: false
+ resets: false
+ required:
+ - st,proc-id
additionalProperties: false
@@ -188,5 +219,16 @@ examples:
st,syscfg-rsc-tbl = <&tamp 0x144 0xFFFFFFFF>;
st,syscfg-m4-state = <&tamp 0x148 0xFFFFFFFF>;
};
+ - |
+ #include <dt-bindings/reset/stm32mp1-resets.h>
+ m4@10000000 {
+ compatible = "st,stm32mp1-m4-tee";
+ reg = <0x10000000 0x40000>,
+ <0x30000000 0x40000>,
+ <0x38000000 0x10000>;
+ st,proc-id = <0>;
+ st,syscfg-rsc-tbl = <&tamp 0x144 0xFFFFFFFF>;
+ st,syscfg-m4-state = <&tamp 0x148 0xFFFFFFFF>;
+ };
...
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v14 7/8] remoteproc: stm32: Create sub-functions to request shutdown and release
2024-11-26 9:10 [PATCH v14 0/8] Introduction of a remoteproc tee to load signed firmware Arnaud Pouliquen
2024-11-26 9:10 ` [PATCH v14 4/8] remoteproc: Rename load() operation to load_segments() in rproc_ops struct Arnaud Pouliquen
2024-11-26 9:10 ` [PATCH v14 6/8] dt-bindings: remoteproc: Add compatibility for TEE support Arnaud Pouliquen
@ 2024-11-26 9:10 ` Arnaud Pouliquen
2024-11-26 9:10 ` [PATCH v14 8/8] remoteproc: stm32: Add support of an OP-TEE TA to load the firmware Arnaud Pouliquen
3 siblings, 0 replies; 6+ messages in thread
From: Arnaud Pouliquen @ 2024-11-26 9:10 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier, Maxime Coquelin,
Alexandre Torgue
Cc: Arnaud Pouliquen, linux-remoteproc, linux-stm32, linux-arm-kernel,
linux-kernel
To prepare for the support of TEE remoteproc, create sub-functions
that can be used in both cases, with and without remoteproc TEE support.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
---
drivers/remoteproc/stm32_rproc.c | 82 +++++++++++++++++++-------------
1 file changed, 49 insertions(+), 33 deletions(-)
diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c
index 7e8ffd9fcc57..1586978c5757 100644
--- a/drivers/remoteproc/stm32_rproc.c
+++ b/drivers/remoteproc/stm32_rproc.c
@@ -209,6 +209,52 @@ static int stm32_rproc_mbox_idx(struct rproc *rproc, const unsigned char *name)
return -EINVAL;
}
+static void stm32_rproc_request_shutdown(struct rproc *rproc)
+{
+ struct stm32_rproc *ddata = rproc->priv;
+ int err, idx;
+
+ /* Request shutdown of the remote processor */
+ if (rproc->state != RPROC_OFFLINE && rproc->state != RPROC_CRASHED) {
+ idx = stm32_rproc_mbox_idx(rproc, STM32_MBX_SHUTDOWN);
+ if (idx >= 0 && ddata->mb[idx].chan) {
+ err = mbox_send_message(ddata->mb[idx].chan, "detach");
+ if (err < 0)
+ dev_warn(&rproc->dev, "warning: remote FW shutdown without ack\n");
+ }
+ }
+}
+
+static int stm32_rproc_release(struct rproc *rproc)
+{
+ struct stm32_rproc *ddata = rproc->priv;
+ unsigned int err = 0;
+
+ /* To allow platform Standby power mode, set remote proc Deep Sleep */
+ if (ddata->pdds.map) {
+ err = regmap_update_bits(ddata->pdds.map, ddata->pdds.reg,
+ ddata->pdds.mask, 1);
+ if (err) {
+ dev_err(&rproc->dev, "failed to set pdds\n");
+ return err;
+ }
+ }
+
+ /* Update coprocessor state to OFF if available */
+ if (ddata->m4_state.map) {
+ err = regmap_update_bits(ddata->m4_state.map,
+ ddata->m4_state.reg,
+ ddata->m4_state.mask,
+ M4_STATE_OFF);
+ if (err) {
+ dev_err(&rproc->dev, "failed to set copro state\n");
+ return err;
+ }
+ }
+
+ return 0;
+}
+
static int stm32_rproc_prepare(struct rproc *rproc)
{
struct device *dev = rproc->dev.parent;
@@ -519,17 +565,9 @@ static int stm32_rproc_detach(struct rproc *rproc)
static int stm32_rproc_stop(struct rproc *rproc)
{
struct stm32_rproc *ddata = rproc->priv;
- int err, idx;
+ int err;
- /* request shutdown of the remote processor */
- if (rproc->state != RPROC_OFFLINE && rproc->state != RPROC_CRASHED) {
- idx = stm32_rproc_mbox_idx(rproc, STM32_MBX_SHUTDOWN);
- if (idx >= 0 && ddata->mb[idx].chan) {
- err = mbox_send_message(ddata->mb[idx].chan, "detach");
- if (err < 0)
- dev_warn(&rproc->dev, "warning: remote FW shutdown without ack\n");
- }
- }
+ stm32_rproc_request_shutdown(rproc);
err = stm32_rproc_set_hold_boot(rproc, true);
if (err)
@@ -541,29 +579,7 @@ static int stm32_rproc_stop(struct rproc *rproc)
return err;
}
- /* to allow platform Standby power mode, set remote proc Deep Sleep */
- if (ddata->pdds.map) {
- err = regmap_update_bits(ddata->pdds.map, ddata->pdds.reg,
- ddata->pdds.mask, 1);
- if (err) {
- dev_err(&rproc->dev, "failed to set pdds\n");
- return err;
- }
- }
-
- /* update coprocessor state to OFF if available */
- if (ddata->m4_state.map) {
- err = regmap_update_bits(ddata->m4_state.map,
- ddata->m4_state.reg,
- ddata->m4_state.mask,
- M4_STATE_OFF);
- if (err) {
- dev_err(&rproc->dev, "failed to set copro state\n");
- return err;
- }
- }
-
- return 0;
+ return stm32_rproc_release(rproc);
}
static void stm32_rproc_kick(struct rproc *rproc, int vqid)
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v14 8/8] remoteproc: stm32: Add support of an OP-TEE TA to load the firmware
2024-11-26 9:10 [PATCH v14 0/8] Introduction of a remoteproc tee to load signed firmware Arnaud Pouliquen
` (2 preceding siblings ...)
2024-11-26 9:10 ` [PATCH v14 7/8] remoteproc: stm32: Create sub-functions to request shutdown and release Arnaud Pouliquen
@ 2024-11-26 9:10 ` Arnaud Pouliquen
3 siblings, 0 replies; 6+ messages in thread
From: Arnaud Pouliquen @ 2024-11-26 9:10 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier, Maxime Coquelin,
Alexandre Torgue
Cc: Arnaud Pouliquen, linux-remoteproc, linux-stm32, linux-arm-kernel,
linux-kernel
The new TEE remoteproc driver is used to manage remote firmware in a
secure, trusted context. The 'st,stm32mp1-m4-tee' compatibility is
introduced to delegate the loading of the firmware to the trusted
execution context. In such cases, the firmware should be signed and
adhere to the image format defined by the TEE.
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
---
updates vs previous version
- register load_fw() ops instead of load() to call rproc_tee_load_fw()
---
drivers/remoteproc/stm32_rproc.c | 57 ++++++++++++++++++++++++++++++--
1 file changed, 54 insertions(+), 3 deletions(-)
diff --git a/drivers/remoteproc/stm32_rproc.c b/drivers/remoteproc/stm32_rproc.c
index 1586978c5757..c155822324d8 100644
--- a/drivers/remoteproc/stm32_rproc.c
+++ b/drivers/remoteproc/stm32_rproc.c
@@ -18,6 +18,7 @@
#include <linux/pm_wakeirq.h>
#include <linux/regmap.h>
#include <linux/remoteproc.h>
+#include <linux/remoteproc_tee.h>
#include <linux/reset.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
@@ -255,6 +256,19 @@ static int stm32_rproc_release(struct rproc *rproc)
return 0;
}
+static int stm32_rproc_tee_stop(struct rproc *rproc)
+{
+ int err;
+
+ stm32_rproc_request_shutdown(rproc);
+
+ err = rproc_tee_stop(rproc);
+ if (err)
+ return err;
+
+ return stm32_rproc_release(rproc);
+}
+
static int stm32_rproc_prepare(struct rproc *rproc)
{
struct device *dev = rproc->dev.parent;
@@ -691,8 +705,20 @@ static const struct rproc_ops st_rproc_ops = {
.get_boot_addr = rproc_elf_get_boot_addr,
};
+static const struct rproc_ops st_rproc_tee_ops = {
+ .prepare = stm32_rproc_prepare,
+ .start = rproc_tee_start,
+ .stop = stm32_rproc_tee_stop,
+ .kick = stm32_rproc_kick,
+ .load_fw = rproc_tee_load_fw,
+ .parse_fw = rproc_tee_parse_fw,
+ .find_loaded_rsc_table = rproc_tee_find_loaded_rsc_table,
+ .release_fw = rproc_tee_release_fw,
+};
+
static const struct of_device_id stm32_rproc_match[] = {
{ .compatible = "st,stm32mp1-m4" },
+ { .compatible = "st,stm32mp1-m4-tee" },
{},
};
MODULE_DEVICE_TABLE(of, stm32_rproc_match);
@@ -853,15 +879,36 @@ static int stm32_rproc_probe(struct platform_device *pdev)
struct device_node *np = dev->of_node;
struct rproc *rproc;
unsigned int state;
+ u32 proc_id;
int ret;
ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
if (ret)
return ret;
- rproc = devm_rproc_alloc(dev, np->name, &st_rproc_ops, NULL, sizeof(*ddata));
- if (!rproc)
- return -ENOMEM;
+ if (of_device_is_compatible(np, "st,stm32mp1-m4-tee")) {
+ /*
+ * Delegate the firmware management to the secure context.
+ * The firmware loaded has to be signed.
+ */
+ ret = of_property_read_u32(np, "st,proc-id", &proc_id);
+ if (ret) {
+ dev_err(dev, "failed to read st,rproc-id property\n");
+ return ret;
+ }
+
+ rproc = devm_rproc_alloc(dev, np->name, &st_rproc_tee_ops, NULL, sizeof(*ddata));
+ if (!rproc)
+ return -ENOMEM;
+
+ ret = rproc_tee_register(dev, rproc, proc_id);
+ if (ret)
+ return dev_err_probe(dev, ret, "signed firmware not supported by TEE\n");
+ } else {
+ rproc = devm_rproc_alloc(dev, np->name, &st_rproc_ops, NULL, sizeof(*ddata));
+ if (!rproc)
+ return -ENOMEM;
+ }
ddata = rproc->priv;
@@ -913,6 +960,8 @@ static int stm32_rproc_probe(struct platform_device *pdev)
dev_pm_clear_wake_irq(dev);
device_init_wakeup(dev, false);
}
+ rproc_tee_unregister(rproc);
+
return ret;
}
@@ -933,6 +982,8 @@ static void stm32_rproc_remove(struct platform_device *pdev)
dev_pm_clear_wake_irq(dev);
device_init_wakeup(dev, false);
}
+
+ rproc_tee_unregister(rproc);
}
static int stm32_rproc_suspend(struct device *dev)
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v14 4/8] remoteproc: Rename load() operation to load_segments() in rproc_ops struct
2024-11-26 9:10 ` [PATCH v14 4/8] remoteproc: Rename load() operation to load_segments() in rproc_ops struct Arnaud Pouliquen
@ 2024-11-28 5:58 ` kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2024-11-28 5:58 UTC (permalink / raw)
To: Arnaud Pouliquen, Bjorn Andersson, Mathieu Poirier, Shawn Guo,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
Matthias Brugger, AngeloGioacchino Del Regno, Patrice Chotard,
Maxime Coquelin, Alexandre Torgue
Cc: llvm, oe-kbuild-all, Arnaud Pouliquen, linux-remoteproc, imx,
linux-arm-kernel, linux-kernel, linux-amlogic, linux-mediatek,
linux-arm-msm, linux-stm32
Hi Arnaud,
kernel test robot noticed the following build errors:
[auto build test ERROR on adc218676eef25575469234709c2d87185ca223a]
url: https://github.com/intel-lab-lkp/linux/commits/Arnaud-Pouliquen/remoteproc-core-Introduce-rproc_pa_to_va-helper/20241128-094434
base: adc218676eef25575469234709c2d87185ca223a
patch link: https://lore.kernel.org/r/20241126091042.918144-5-arnaud.pouliquen%40foss.st.com
patch subject: [PATCH v14 4/8] remoteproc: Rename load() operation to load_segments() in rproc_ops struct
config: i386-buildonly-randconfig-002-20241128 (https://download.01.org/0day-ci/archive/20241128/202411281332.Ra70nJAW-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241128/202411281332.Ra70nJAW-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411281332.Ra70nJAW-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from drivers/remoteproc/pru_rproc.c:24:
In file included from include/linux/remoteproc.h:40:
In file included from include/linux/virtio.h:7:
In file included from include/linux/scatterlist.h:8:
In file included from include/linux/mm.h:2213:
include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
518 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
>> drivers/remoteproc/pru_rproc.c:1018:14: error: no member named 'load' in 'struct rproc_ops'
1018 | rproc->ops->load = pru_rproc_load_elf_segments;
| ~~~~~~~~~~ ^
1 warning and 1 error generated.
vim +1018 drivers/remoteproc/pru_rproc.c
d4ce2de7e4af8b Suman Anna 2020-12-08 987
d4ce2de7e4af8b Suman Anna 2020-12-08 988 static int pru_rproc_probe(struct platform_device *pdev)
d4ce2de7e4af8b Suman Anna 2020-12-08 989 {
d4ce2de7e4af8b Suman Anna 2020-12-08 990 struct device *dev = &pdev->dev;
d4ce2de7e4af8b Suman Anna 2020-12-08 991 struct device_node *np = dev->of_node;
d4ce2de7e4af8b Suman Anna 2020-12-08 992 struct platform_device *ppdev = to_platform_device(dev->parent);
d4ce2de7e4af8b Suman Anna 2020-12-08 993 struct pru_rproc *pru;
d4ce2de7e4af8b Suman Anna 2020-12-08 994 const char *fw_name;
d4ce2de7e4af8b Suman Anna 2020-12-08 995 struct rproc *rproc = NULL;
d4ce2de7e4af8b Suman Anna 2020-12-08 996 struct resource *res;
d4ce2de7e4af8b Suman Anna 2020-12-08 997 int i, ret;
1d39f4d199214f Suman Anna 2020-12-08 998 const struct pru_private_data *data;
d4ce2de7e4af8b Suman Anna 2020-12-08 999 const char *mem_names[PRU_IOMEM_MAX] = { "iram", "control", "debug" };
d4ce2de7e4af8b Suman Anna 2020-12-08 1000
1d39f4d199214f Suman Anna 2020-12-08 1001 data = of_device_get_match_data(&pdev->dev);
1d39f4d199214f Suman Anna 2020-12-08 1002 if (!data)
1d39f4d199214f Suman Anna 2020-12-08 1003 return -ENODEV;
1d39f4d199214f Suman Anna 2020-12-08 1004
d4ce2de7e4af8b Suman Anna 2020-12-08 1005 ret = of_property_read_string(np, "firmware-name", &fw_name);
d4ce2de7e4af8b Suman Anna 2020-12-08 1006 if (ret) {
d4ce2de7e4af8b Suman Anna 2020-12-08 1007 dev_err(dev, "unable to retrieve firmware-name %d\n", ret);
d4ce2de7e4af8b Suman Anna 2020-12-08 1008 return ret;
d4ce2de7e4af8b Suman Anna 2020-12-08 1009 }
d4ce2de7e4af8b Suman Anna 2020-12-08 1010
d4ce2de7e4af8b Suman Anna 2020-12-08 1011 rproc = devm_rproc_alloc(dev, pdev->name, &pru_rproc_ops, fw_name,
d4ce2de7e4af8b Suman Anna 2020-12-08 1012 sizeof(*pru));
d4ce2de7e4af8b Suman Anna 2020-12-08 1013 if (!rproc) {
d4ce2de7e4af8b Suman Anna 2020-12-08 1014 dev_err(dev, "rproc_alloc failed\n");
d4ce2de7e4af8b Suman Anna 2020-12-08 1015 return -ENOMEM;
d4ce2de7e4af8b Suman Anna 2020-12-08 1016 }
d4ce2de7e4af8b Suman Anna 2020-12-08 1017 /* use a custom load function to deal with PRU-specific quirks */
d4ce2de7e4af8b Suman Anna 2020-12-08 @1018 rproc->ops->load = pru_rproc_load_elf_segments;
d4ce2de7e4af8b Suman Anna 2020-12-08 1019
d4ce2de7e4af8b Suman Anna 2020-12-08 1020 /* use a custom parse function to deal with PRU-specific resources */
d4ce2de7e4af8b Suman Anna 2020-12-08 1021 rproc->ops->parse_fw = pru_rproc_parse_fw;
d4ce2de7e4af8b Suman Anna 2020-12-08 1022
d4ce2de7e4af8b Suman Anna 2020-12-08 1023 /* error recovery is not supported for PRUs */
d4ce2de7e4af8b Suman Anna 2020-12-08 1024 rproc->recovery_disabled = true;
d4ce2de7e4af8b Suman Anna 2020-12-08 1025
d4ce2de7e4af8b Suman Anna 2020-12-08 1026 /*
d4ce2de7e4af8b Suman Anna 2020-12-08 1027 * rproc_add will auto-boot the processor normally, but this is not
d4ce2de7e4af8b Suman Anna 2020-12-08 1028 * desired with PRU client driven boot-flow methodology. A PRU
d4ce2de7e4af8b Suman Anna 2020-12-08 1029 * application/client driver will boot the corresponding PRU
d4ce2de7e4af8b Suman Anna 2020-12-08 1030 * remote-processor as part of its state machine either through the
d4ce2de7e4af8b Suman Anna 2020-12-08 1031 * remoteproc sysfs interface or through the equivalent kernel API.
d4ce2de7e4af8b Suman Anna 2020-12-08 1032 */
d4ce2de7e4af8b Suman Anna 2020-12-08 1033 rproc->auto_boot = false;
d4ce2de7e4af8b Suman Anna 2020-12-08 1034
d4ce2de7e4af8b Suman Anna 2020-12-08 1035 pru = rproc->priv;
d4ce2de7e4af8b Suman Anna 2020-12-08 1036 pru->dev = dev;
1d39f4d199214f Suman Anna 2020-12-08 1037 pru->data = data;
d4ce2de7e4af8b Suman Anna 2020-12-08 1038 pru->pruss = platform_get_drvdata(ppdev);
d4ce2de7e4af8b Suman Anna 2020-12-08 1039 pru->rproc = rproc;
d4ce2de7e4af8b Suman Anna 2020-12-08 1040 pru->fw_name = fw_name;
919e8942548aa8 MD Danish Anwar 2023-01-06 1041 pru->client_np = NULL;
102853400321ba Roger Quadros 2023-01-06 1042 spin_lock_init(&pru->rmw_lock);
919e8942548aa8 MD Danish Anwar 2023-01-06 1043 mutex_init(&pru->lock);
d4ce2de7e4af8b Suman Anna 2020-12-08 1044
d4ce2de7e4af8b Suman Anna 2020-12-08 1045 for (i = 0; i < ARRAY_SIZE(mem_names); i++) {
d4ce2de7e4af8b Suman Anna 2020-12-08 1046 res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
d4ce2de7e4af8b Suman Anna 2020-12-08 1047 mem_names[i]);
d4ce2de7e4af8b Suman Anna 2020-12-08 1048 pru->mem_regions[i].va = devm_ioremap_resource(dev, res);
d4ce2de7e4af8b Suman Anna 2020-12-08 1049 if (IS_ERR(pru->mem_regions[i].va)) {
d4ce2de7e4af8b Suman Anna 2020-12-08 1050 dev_err(dev, "failed to parse and map memory resource %d %s\n",
d4ce2de7e4af8b Suman Anna 2020-12-08 1051 i, mem_names[i]);
d4ce2de7e4af8b Suman Anna 2020-12-08 1052 ret = PTR_ERR(pru->mem_regions[i].va);
d4ce2de7e4af8b Suman Anna 2020-12-08 1053 return ret;
d4ce2de7e4af8b Suman Anna 2020-12-08 1054 }
d4ce2de7e4af8b Suman Anna 2020-12-08 1055 pru->mem_regions[i].pa = res->start;
d4ce2de7e4af8b Suman Anna 2020-12-08 1056 pru->mem_regions[i].size = resource_size(res);
d4ce2de7e4af8b Suman Anna 2020-12-08 1057
d4ce2de7e4af8b Suman Anna 2020-12-08 1058 dev_dbg(dev, "memory %8s: pa %pa size 0x%zx va %pK\n",
d4ce2de7e4af8b Suman Anna 2020-12-08 1059 mem_names[i], &pru->mem_regions[i].pa,
d4ce2de7e4af8b Suman Anna 2020-12-08 1060 pru->mem_regions[i].size, pru->mem_regions[i].va);
d4ce2de7e4af8b Suman Anna 2020-12-08 1061 }
d4ce2de7e4af8b Suman Anna 2020-12-08 1062
d4ce2de7e4af8b Suman Anna 2020-12-08 1063 ret = pru_rproc_set_id(pru);
d4ce2de7e4af8b Suman Anna 2020-12-08 1064 if (ret < 0)
d4ce2de7e4af8b Suman Anna 2020-12-08 1065 return ret;
d4ce2de7e4af8b Suman Anna 2020-12-08 1066
d4ce2de7e4af8b Suman Anna 2020-12-08 1067 platform_set_drvdata(pdev, rproc);
d4ce2de7e4af8b Suman Anna 2020-12-08 1068
d4ce2de7e4af8b Suman Anna 2020-12-08 1069 ret = devm_rproc_add(dev, pru->rproc);
d4ce2de7e4af8b Suman Anna 2020-12-08 1070 if (ret) {
d4ce2de7e4af8b Suman Anna 2020-12-08 1071 dev_err(dev, "rproc_add failed: %d\n", ret);
d4ce2de7e4af8b Suman Anna 2020-12-08 1072 return ret;
d4ce2de7e4af8b Suman Anna 2020-12-08 1073 }
d4ce2de7e4af8b Suman Anna 2020-12-08 1074
20ad1de0f14fbd Suman Anna 2020-12-08 1075 pru_rproc_create_debug_entries(rproc);
20ad1de0f14fbd Suman Anna 2020-12-08 1076
d4ce2de7e4af8b Suman Anna 2020-12-08 1077 dev_dbg(dev, "PRU rproc node %pOF probed successfully\n", np);
d4ce2de7e4af8b Suman Anna 2020-12-08 1078
d4ce2de7e4af8b Suman Anna 2020-12-08 1079 return 0;
d4ce2de7e4af8b Suman Anna 2020-12-08 1080 }
d4ce2de7e4af8b Suman Anna 2020-12-08 1081
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-11-28 6:00 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-26 9:10 [PATCH v14 0/8] Introduction of a remoteproc tee to load signed firmware Arnaud Pouliquen
2024-11-26 9:10 ` [PATCH v14 4/8] remoteproc: Rename load() operation to load_segments() in rproc_ops struct Arnaud Pouliquen
2024-11-28 5:58 ` kernel test robot
2024-11-26 9:10 ` [PATCH v14 6/8] dt-bindings: remoteproc: Add compatibility for TEE support Arnaud Pouliquen
2024-11-26 9:10 ` [PATCH v14 7/8] remoteproc: stm32: Create sub-functions to request shutdown and release Arnaud Pouliquen
2024-11-26 9:10 ` [PATCH v14 8/8] remoteproc: stm32: Add support of an OP-TEE TA to load the firmware Arnaud Pouliquen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).