2023-05-17 08:10:44

by Arnaud POULIQUEN

[permalink] [raw]
Subject: [PATCH v4 0/2] stm32mp15: update remoteproc to support SCMI Device tree

Update vs V3[1]:
---------------
- remove from the V4 the commits already merged by Mathieu Poirier in the
remoteproc next branch:
- dt-bindings: remoteproc: st,stm32-rproc: Rework reset declarations
- remoteproc: stm32: Allow hold boot management by the SCMI reset
controller
- rename patch " ARM: dts: stm32: Update reset declarations" to
"ARM: dts: stm32: Update Cortex-M4 reset declarations on stm32mp15"
- Fix DTS error reported by "make dtbs_check"

[1]https://lore.kernel.org/lkml/[email protected]/


Description:
-----------
This series updates the stm32_rproc driver and associated DT node to
support device tree configuration with and without SCMI server.
The impact is mainly on the MCU hold boot management.

Three configurations have to be supported:

1) Configuration without OP-TEE SCMI (legacy): Trusted context not activated
- The MCU reset is controlled through the Linux RCC reset driver.
- The MCU HOLD BOOT is controlled through The RCC sysconf.

2) Configuration with SCMI server: Trusted context activated
- The MCU reset is controlled through the SCMI reset service.
- The MCU HOLD BOOT is no more controlled through a SMC call service but
through the SCMI reset service.

3) Configuration with OP-TEE SMC call (deprecated): Trusted context activated
- The MCU reset is controlled through the Linux RCC reset driver.
- The MCU HOLD BOOT is controlled through The SMC call.

In consequence this series:
- adds the use of the SCMI reset service to manage the MCU hold boot,
- determines the configuration to use depending on the presence of the
"reset-names" property
if ( "reset-names" property contains "hold_boot")
then use reset_control services
else use regmap access based on "st,syscfg-holdboot" property.
- set the DT st,syscfg-tz property as deprecated


Arnaud Pouliquen (2):
ARM: dts: stm32: Update Cortex-M4 reset declarations on stm32mp15
ARM: dts: stm32: fix m4_rproc references to use SCMI

arch/arm/boot/dts/stm32mp151.dtsi | 2 +-
arch/arm/boot/dts/stm32mp157a-dk1-scmi.dts | 7 +++++--
arch/arm/boot/dts/stm32mp157c-dk2-scmi.dts | 7 +++++--
arch/arm/boot/dts/stm32mp157c-ed1-scmi.dts | 7 +++++--
arch/arm/boot/dts/stm32mp157c-ev1-scmi.dts | 7 +++++--
5 files changed, 21 insertions(+), 9 deletions(-)

--
2.25.1



2023-05-17 08:10:57

by Arnaud POULIQUEN

[permalink] [raw]
Subject: [PATCH v4 1/2] ARM: dts: stm32: Update Cortex-M4 reset declarations on stm32mp15

Since the introduction of the SCMI for the management
of the MCU hold boot in OP-TEE, management of the hold boot by SMC call
is deprecated.
- Clean the st,syscfg-tz which allows to determine if the trust
zone is enable.
- Add reset-names properties to be able to differentiate the MCU reset and
the MCU HOLD BOOT.

Signed-off-by: Arnaud Pouliquen <[email protected]>
---
Deltas vs previous revision:
- update commit subject to specify the SoC series

---
arch/arm/boot/dts/stm32mp151.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/stm32mp151.dtsi b/arch/arm/boot/dts/stm32mp151.dtsi
index 664825418c32..a98ae58e2c1c 100644
--- a/arch/arm/boot/dts/stm32mp151.dtsi
+++ b/arch/arm/boot/dts/stm32mp151.dtsi
@@ -1823,8 +1823,8 @@ m4_rproc: m4@10000000 {
<0x30000000 0x40000>,
<0x38000000 0x10000>;
resets = <&rcc MCU_R>;
+ reset-names = "mcu_rst";
st,syscfg-holdboot = <&rcc 0x10C 0x1>;
- st,syscfg-tz = <&rcc 0x000 0x1>;
st,syscfg-pdds = <&pwr_mcu 0x0 0x1>;
st,syscfg-rsc-tbl = <&tamp 0x144 0xFFFFFFFF>;
st,syscfg-m4-state = <&tamp 0x148 0xFFFFFFFF>;
--
2.25.1


2023-05-17 08:15:51

by Arnaud POULIQUEN

[permalink] [raw]
Subject: [PATCH v4 2/2] ARM: dts: stm32: fix m4_rproc references to use SCMI

Fixes stm32mp15*-scmi DTS files introduced in [1]:
This patch fixes the node which uses the MCU reset and adds the
missing HOLD_BOOT which is also handled by the SCMI reset service.

This change cannot be applied as a fix on commit [1], the management
of the hold boot impacts also the stm32_rproc driver.

[1] 'commit 5b7e58313a77 ("ARM: dts: stm32: Add SCMI version of STM32 boards (DK1/DK2/ED1/EV1)")'

Signed-off-by: Arnaud Pouliquen <[email protected]>
---
Deltas vs previous revision:
- add "/delete-property/ st,syscfg-holdboot;" to fix dtbs_check complain.

---
arch/arm/boot/dts/stm32mp157a-dk1-scmi.dts | 7 +++++--
arch/arm/boot/dts/stm32mp157c-dk2-scmi.dts | 7 +++++--
arch/arm/boot/dts/stm32mp157c-ed1-scmi.dts | 7 +++++--
arch/arm/boot/dts/stm32mp157c-ev1-scmi.dts | 7 +++++--
4 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/stm32mp157a-dk1-scmi.dts b/arch/arm/boot/dts/stm32mp157a-dk1-scmi.dts
index e539cc80bef8..afcd6285890c 100644
--- a/arch/arm/boot/dts/stm32mp157a-dk1-scmi.dts
+++ b/arch/arm/boot/dts/stm32mp157a-dk1-scmi.dts
@@ -55,8 +55,11 @@ &mdma1 {
resets = <&scmi_reset RST_SCMI_MDMA>;
};

-&mlahb {
- resets = <&scmi_reset RST_SCMI_MCU>;
+&m4_rproc {
+ /delete-property/ st,syscfg-holdboot;
+ resets = <&scmi_reset RST_SCMI_MCU>,
+ <&scmi_reset RST_SCMI_MCU_HOLD_BOOT>;
+ reset-names = "mcu_rst", "hold_boot";
};

&rcc {
diff --git a/arch/arm/boot/dts/stm32mp157c-dk2-scmi.dts b/arch/arm/boot/dts/stm32mp157c-dk2-scmi.dts
index 97e4f94b0a24..39358d902000 100644
--- a/arch/arm/boot/dts/stm32mp157c-dk2-scmi.dts
+++ b/arch/arm/boot/dts/stm32mp157c-dk2-scmi.dts
@@ -61,8 +61,11 @@ &mdma1 {
resets = <&scmi_reset RST_SCMI_MDMA>;
};

-&mlahb {
- resets = <&scmi_reset RST_SCMI_MCU>;
+&m4_rproc {
+ /delete-property/ st,syscfg-holdboot;
+ resets = <&scmi_reset RST_SCMI_MCU>,
+ <&scmi_reset RST_SCMI_MCU_HOLD_BOOT>;
+ reset-names = "mcu_rst", "hold_boot";
};

&rcc {
diff --git a/arch/arm/boot/dts/stm32mp157c-ed1-scmi.dts b/arch/arm/boot/dts/stm32mp157c-ed1-scmi.dts
index 9cf0a44d2f47..07ea765a4553 100644
--- a/arch/arm/boot/dts/stm32mp157c-ed1-scmi.dts
+++ b/arch/arm/boot/dts/stm32mp157c-ed1-scmi.dts
@@ -60,8 +60,11 @@ &mdma1 {
resets = <&scmi_reset RST_SCMI_MDMA>;
};

-&mlahb {
- resets = <&scmi_reset RST_SCMI_MCU>;
+&m4_rproc {
+ /delete-property/ st,syscfg-holdboot;
+ resets = <&scmi_reset RST_SCMI_MCU>,
+ <&scmi_reset RST_SCMI_MCU_HOLD_BOOT>;
+ reset-names = "mcu_rst", "hold_boot";
};

&rcc {
diff --git a/arch/arm/boot/dts/stm32mp157c-ev1-scmi.dts b/arch/arm/boot/dts/stm32mp157c-ev1-scmi.dts
index 3b9dd6f4ccc9..813086ec2489 100644
--- a/arch/arm/boot/dts/stm32mp157c-ev1-scmi.dts
+++ b/arch/arm/boot/dts/stm32mp157c-ev1-scmi.dts
@@ -66,8 +66,11 @@ &mdma1 {
resets = <&scmi_reset RST_SCMI_MDMA>;
};

-&mlahb {
- resets = <&scmi_reset RST_SCMI_MCU>;
+&m4_rproc {
+ /delete-property/ st,syscfg-holdboot;
+ resets = <&scmi_reset RST_SCMI_MCU>,
+ <&scmi_reset RST_SCMI_MCU_HOLD_BOOT>;
+ reset-names = "mcu_rst", "hold_boot";
};

&rcc {
--
2.25.1


2023-05-17 10:21:53

by Alexandre TORGUE

[permalink] [raw]
Subject: Re: [PATCH v4 0/2] stm32mp15: update remoteproc to support SCMI Device tree

Hi Arnaud

On 5/17/23 09:48, Arnaud Pouliquen wrote:
> Update vs V3[1]:
> ---------------
> - remove from the V4 the commits already merged by Mathieu Poirier in the
> remoteproc next branch:
> - dt-bindings: remoteproc: st,stm32-rproc: Rework reset declarations
> - remoteproc: stm32: Allow hold boot management by the SCMI reset
> controller
> - rename patch " ARM: dts: stm32: Update reset declarations" to
> "ARM: dts: stm32: Update Cortex-M4 reset declarations on stm32mp15"
> - Fix DTS error reported by "make dtbs_check"
>
> [1]https://lore.kernel.org/lkml/[email protected]/
>
>
> Description:
> -----------
> This series updates the stm32_rproc driver and associated DT node to
> support device tree configuration with and without SCMI server.
> The impact is mainly on the MCU hold boot management.
>
> Three configurations have to be supported:
>
> 1) Configuration without OP-TEE SCMI (legacy): Trusted context not activated
> - The MCU reset is controlled through the Linux RCC reset driver.
> - The MCU HOLD BOOT is controlled through The RCC sysconf.
>
> 2) Configuration with SCMI server: Trusted context activated
> - The MCU reset is controlled through the SCMI reset service.
> - The MCU HOLD BOOT is no more controlled through a SMC call service but
> through the SCMI reset service.
>
> 3) Configuration with OP-TEE SMC call (deprecated): Trusted context activated
> - The MCU reset is controlled through the Linux RCC reset driver.
> - The MCU HOLD BOOT is controlled through The SMC call.
>
> In consequence this series:
> - adds the use of the SCMI reset service to manage the MCU hold boot,
> - determines the configuration to use depending on the presence of the
> "reset-names" property
> if ( "reset-names" property contains "hold_boot")
> then use reset_control services
> else use regmap access based on "st,syscfg-holdboot" property.
> - set the DT st,syscfg-tz property as deprecated
>
>
> Arnaud Pouliquen (2):
> ARM: dts: stm32: Update Cortex-M4 reset declarations on stm32mp15
> ARM: dts: stm32: fix m4_rproc references to use SCMI
>
> arch/arm/boot/dts/stm32mp151.dtsi | 2 +-
> arch/arm/boot/dts/stm32mp157a-dk1-scmi.dts | 7 +++++--
> arch/arm/boot/dts/stm32mp157c-dk2-scmi.dts | 7 +++++--
> arch/arm/boot/dts/stm32mp157c-ed1-scmi.dts | 7 +++++--
> arch/arm/boot/dts/stm32mp157c-ev1-scmi.dts | 7 +++++--
> 5 files changed, 21 insertions(+), 9 deletions(-)
>

Series applied on stm32-next.

Regards
Alex