2020-10-23 08:19:19

by Prabhakar Mahadev Lad

[permalink] [raw]
Subject: [PATCH 1/2] arm64: dts: renesas: hihope-common: Add optee node

Add optee device tree node to HiHope RZ/G2{HMN} boards.

Signed-off-by: Lad Prabhakar <[email protected]>
Reviewed-by: Biju Das <[email protected]>
---
arch/arm64/boot/dts/renesas/hihope-common.dtsi | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/hihope-common.dtsi b/arch/arm64/boot/dts/renesas/hihope-common.dtsi
index 78096473d41d..32202e5263f6 100644
--- a/arch/arm64/boot/dts/renesas/hihope-common.dtsi
+++ b/arch/arm64/boot/dts/renesas/hihope-common.dtsi
@@ -110,6 +110,13 @@
#clock-cells = <0>;
clock-frequency = <25000000>;
};
+
+ firmware {
+ optee {
+ compatible = "linaro,optee-tz";
+ method = "smc";
+ };
+ };
};

&audio_clk_a {
--
2.17.1


2020-10-23 10:05:55

by Lad, Prabhakar

[permalink] [raw]
Subject: Re: [PATCH 1/2] arm64: dts: renesas: hihope-common: Add optee node

Hi Geert,

Thank you for the review.

On Fri, Oct 23, 2020 at 10:50 AM Geert Uytterhoeven
<[email protected]> wrote:
>
> Hi Prabhakar,
>
> On Fri, Oct 23, 2020 at 9:56 AM Lad Prabhakar
> <[email protected]> wrote:
> > Add optee device tree node to HiHope RZ/G2{HMN} boards.
> >
> > Signed-off-by: Lad Prabhakar <[email protected]>
> > Reviewed-by: Biju Das <[email protected]>
>
> Thanks for your patch!
>
> > --- a/arch/arm64/boot/dts/renesas/hihope-common.dtsi
> > +++ b/arch/arm64/boot/dts/renesas/hihope-common.dtsi
> > @@ -110,6 +110,13 @@
> > #clock-cells = <0>;
> > clock-frequency = <25000000>;
> > };
> > +
> > + firmware {
> > + optee {
> > + compatible = "linaro,optee-tz";
> > + method = "smc";
> > + };
> > + };
> > };
>
> Should this be added to the SoC-specific .dtsi instead?
It's a bit tricky, the reason I put in board files is due to current
boards having optee do the same. Let me know if you want me to move
the nodes to SoC dtsi

> How can we test this?
This needs a special TFA (by special I mean optee enabled
(SPD="opteed")) and In Linux we need the below configs enabled:

CONFIG_TEE=y
CONFIG_OPTEE=y
CONFIG_OPTEE_SHM_NUM_PRIV_PAGES=1

Once Linux is booted up this exposes a optee device which can be used
for communication. I have used optee_test [1] test-suite (xtest) to
make sure all the tests pass (I have attached results for RZ/G2H for
reference).

[1] https://optee.readthedocs.io/en/latest/building/gits/optee_test.html

Cheers,
Prabhakar
>
> Gr{oetje,eeting}s,
>
> Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
> -- Linus Torvalds


Attachments:
rzg2h.txt (162.01 kB)

2020-10-23 15:09:23

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 1/2] arm64: dts: renesas: hihope-common: Add optee node

Hi Prabhakar,

On Fri, Oct 23, 2020 at 9:56 AM Lad Prabhakar
<[email protected]> wrote:
> Add optee device tree node to HiHope RZ/G2{HMN} boards.
>
> Signed-off-by: Lad Prabhakar <[email protected]>
> Reviewed-by: Biju Das <[email protected]>

Thanks for your patch!

> --- a/arch/arm64/boot/dts/renesas/hihope-common.dtsi
> +++ b/arch/arm64/boot/dts/renesas/hihope-common.dtsi
> @@ -110,6 +110,13 @@
> #clock-cells = <0>;
> clock-frequency = <25000000>;
> };
> +
> + firmware {
> + optee {
> + compatible = "linaro,optee-tz";
> + method = "smc";
> + };
> + };
> };

Should this be added to the SoC-specific .dtsi instead?
How can we test this?

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2020-10-23 15:48:01

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 1/2] arm64: dts: renesas: hihope-common: Add optee node

Hi Prabhakar,

CC Marek

On Fri, Oct 23, 2020 at 12:03 PM Lad, Prabhakar
<[email protected]> wrote:
> On Fri, Oct 23, 2020 at 10:50 AM Geert Uytterhoeven
> <[email protected]> wrote:
> > On Fri, Oct 23, 2020 at 9:56 AM Lad Prabhakar
> > <[email protected]> wrote:
> > > Add optee device tree node to HiHope RZ/G2{HMN} boards.
> > >
> > > Signed-off-by: Lad Prabhakar <[email protected]>
> > > Reviewed-by: Biju Das <[email protected]>
> >
> > Thanks for your patch!
> >
> > > --- a/arch/arm64/boot/dts/renesas/hihope-common.dtsi
> > > +++ b/arch/arm64/boot/dts/renesas/hihope-common.dtsi
> > > @@ -110,6 +110,13 @@
> > > #clock-cells = <0>;
> > > clock-frequency = <25000000>;
> > > };
> > > +
> > > + firmware {
> > > + optee {
> > > + compatible = "linaro,optee-tz";
> > > + method = "smc";
> > > + };
> > > + };
> > > };
> >
> > Should this be added to the SoC-specific .dtsi instead?
> It's a bit tricky, the reason I put in board files is due to current
> boards having optee do the same. Let me know if you want me to move
> the nodes to SoC dtsi

At least the Layerscape and K3 SoCs do have the optee node in the
SoC-specific .dtsi...

Given it needs a special TFA, it's probably safest to pass this through
the firmware stack, cfr. the memory nodes?

> > How can we test this?
> This needs a special TFA (by special I mean optee enabled
> (SPD="opteed")) and In Linux we need the below configs enabled:
>
> CONFIG_TEE=y
> CONFIG_OPTEE=y
> CONFIG_OPTEE_SHM_NUM_PRIV_PAGES=1
>
> Once Linux is booted up this exposes a optee device which can be used
> for communication. I have used optee_test [1] test-suite (xtest) to
> make sure all the tests pass (I have attached results for RZ/G2H for
> reference).
>
> [1] https://optee.readthedocs.io/en/latest/building/gits/optee_test.html

Thanks, that is very valuable information!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds