2022-04-22 20:12:17

by Alexandre TORGUE

[permalink] [raw]
Subject: [PATCH 6/8] ARM: dts: stm32: enable optee firmware and SCMI support on STM32MP15

Enable optee and SCMI clocks/reset protocols support.

Signed-off-by: Alexandre Torgue <[email protected]>

diff --git a/arch/arm/boot/dts/stm32mp151.dtsi b/arch/arm/boot/dts/stm32mp151.dtsi
index 7fdc324b3cf9..1b2fd3426a81 100644
--- a/arch/arm/boot/dts/stm32mp151.dtsi
+++ b/arch/arm/boot/dts/stm32mp151.dtsi
@@ -115,6 +115,33 @@
status = "disabled";
};

+ firmware {
+ optee: optee {
+ compatible = "linaro,optee-tz";
+ method = "smc";
+ status = "disabled";
+ };
+
+ scmi: scmi {
+ compatible = "linaro,scmi-optee";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ linaro,optee-channel-id = <0>;
+ shmem = <&scmi_shm>;
+ status = "disabled";
+
+ scmi_clk: protocol@14 {
+ reg = <0x14>;
+ #clock-cells = <1>;
+ };
+
+ scmi_reset: protocol@16 {
+ reg = <0x16>;
+ #reset-cells = <1>;
+ };
+ };
+ };
+
soc {
compatible = "simple-bus";
#address-cells = <1>;
@@ -122,6 +149,20 @@
interrupt-parent = <&intc>;
ranges;

+ scmi_sram: sram@2ffff000 {
+ compatible = "mmio-sram";
+ reg = <0x2ffff000 0x1000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges = <0 0x2ffff000 0x1000>;
+
+ scmi_shm: scmi-sram@0 {
+ compatible = "arm,scmi-shmem";
+ reg = <0 0x80>;
+ status = "disabled";
+ };
+ };
+
timers2: timer@40000000 {
#address-cells = <1>;
#size-cells = <0>;
--
2.17.1


2022-04-22 21:14:37

by Marek Vasut

[permalink] [raw]
Subject: Re: [PATCH 6/8] ARM: dts: stm32: enable optee firmware and SCMI support on STM32MP15

On 4/22/22 17:09, Alexandre Torgue wrote:
> Enable optee and SCMI clocks/reset protocols support.
>
> Signed-off-by: Alexandre Torgue <[email protected]>
>
> diff --git a/arch/arm/boot/dts/stm32mp151.dtsi b/arch/arm/boot/dts/stm32mp151.dtsi
> index 7fdc324b3cf9..1b2fd3426a81 100644
> --- a/arch/arm/boot/dts/stm32mp151.dtsi
> +++ b/arch/arm/boot/dts/stm32mp151.dtsi
> @@ -115,6 +115,33 @@
> status = "disabled";
> };
>
> + firmware {
> + optee: optee {
> + compatible = "linaro,optee-tz";
> + method = "smc";
> + status = "disabled";
> + };

Doesn't this TEE node get automatically generated and patched into DT by
the TEE ? I think OpTee-OS does that.

2022-04-25 16:15:56

by Marek Vasut

[permalink] [raw]
Subject: Re: [PATCH 6/8] ARM: dts: stm32: enable optee firmware and SCMI support on STM32MP15

On 4/25/22 12:19, Etienne CARRIERE wrote:
> Hello Marek,

Hi,

>> From: Marek Vasut <[email protected]>
>>
>>> On 4/22/22 17:09, Alexandre Torgue wrote:
>>> Enable optee and SCMI clocks/reset protocols support.
>>>
>>> Signed-off-by: Alexandre Torgue <[email protected]>
>>>
>>> diff --git a/arch/arm/boot/dts/stm32mp151.dtsi
>>> b/arch/arm/boot/dts/stm32mp151.dtsi
>>> index 7fdc324b3cf9..1b2fd3426a81 100644
>>> --- a/arch/arm/boot/dts/stm32mp151.dtsi
>>> +++ b/arch/arm/boot/dts/stm32mp151.dtsi
>>> @@ -115,6 +115,33 @@
>>>                 status = "disabled";
>>>         };
>>>
>>> +     firmware {
>>> +             optee: optee {
>>> +                     compatible = "linaro,optee-tz";
>>> +                     method = "smc";
>>> +                     status = "disabled";
>>> +             };
>>
>> Doesn't this TEE node get automatically generated and patched into DT by
>> the TEE ? I think OpTee-OS does that.
>
> OP-TEE OS does that if it gets passed the DT from early boot stage which is not always the case.

Shouldn't that be something to fix ?

I think R-Car3 does that already.

2022-04-25 16:58:10

by Rouven Czerwinski

[permalink] [raw]
Subject: Re: [PATCH 6/8] ARM: dts: stm32: enable optee firmware and SCMI support on STM32MP15

Hi,

On Mon, 2022-04-25 at 12:25 +0200, Marek Vasut wrote:
> On 4/25/22 12:19, Etienne CARRIERE wrote:
> > Hello Marek,
>
> Hi,
>
> > > From: Marek Vasut <[email protected]>
> > >
> > > > On 4/22/22 17:09, Alexandre Torgue wrote:
> > > > Enable optee and SCMI clocks/reset protocols support.
> > > >
> > > > Signed-off-by: Alexandre Torgue <[email protected]>
> > > >
> > > > diff --git a/arch/arm/boot/dts/stm32mp151.dtsi
> > > > b/arch/arm/boot/dts/stm32mp151.dtsi
> > > > index 7fdc324b3cf9..1b2fd3426a81 100644
> > > > --- a/arch/arm/boot/dts/stm32mp151.dtsi
> > > > +++ b/arch/arm/boot/dts/stm32mp151.dtsi
> > > > @@ -115,6 +115,33 @@
> > > >                 status = "disabled";
> > > >         };
> > > >
> > > > +     firmware {
> > > > +             optee: optee {
> > > > +                     compatible = "linaro,optee-tz";
> > > > +                     method = "smc";
> > > > +                     status = "disabled";
> > > > +             };
> > >
> > > Doesn't this TEE node get automatically generated and patched into DT by
> > > the TEE ? I think OpTee-OS does that.
> >
> > OP-TEE OS does that if it gets passed the DT from early boot stage which is not always the case.
>
> Shouldn't that be something to fix ?
>
> I think R-Car3 does that already.

FWIW it's also possible for OP-TEE to generate a device tree overlay
which can be applied by later boot stages.

Drawback is that you either need an additional parameter to pass
between boot stages (address of the DT overlay) or it needs to be
hardcoded. Hardcoding has it's own bag of drawbacks, but it's what we
do for some i.MX6 platforms within barebox. However there is no TF-A
there, so only OP-TEE and Barebox need to agree on the fixed location
beforehand.

Best regards,
Rouven Czerwinski

--
Pengutronix e.K. | Rouven Czerwinski |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |

2022-04-26 05:46:31

by Etienne CARRIERE

[permalink] [raw]
Subject: Re: [PATCH 6/8] ARM: dts: stm32: enable optee firmware and SCMI support on STM32MP15

Hello Marek,

> From: Marek Vasut <[email protected]>
>
> > On 4/22/22 17:09, Alexandre Torgue wrote:
> > Enable optee and SCMI clocks/reset protocols support.
> >
> > Signed-off-by: Alexandre Torgue <[email protected]>
> >
> > diff --git a/arch/arm/boot/dts/stm32mp151.dtsi
> > b/arch/arm/boot/dts/stm32mp151.dtsi
> > index 7fdc324b3cf9..1b2fd3426a81 100644
> > --- a/arch/arm/boot/dts/stm32mp151.dtsi
> > +++ b/arch/arm/boot/dts/stm32mp151.dtsi
> > @@ -115,6 +115,33 @@
> >??????????????? status = "disabled";
> >??????? };
> >??
> > +???? firmware {
> > +???????????? optee: optee {
> > +???????????????????? compatible = "linaro,optee-tz";
> > +???????????????????? method = "smc";
> > +???????????????????? status = "disabled";
> > +???????????? };
>
> Doesn't this TEE node get automatically generated and patched into DT by
> the TEE ? I think OpTee-OS does that.

OP-TEE OS does that if it gets passed the DT from early boot stage which is not always the case.

Etienne