[PATCH] arm: dts: imx8m: add OPTEE_LOAD_ADDRESS config and tee.bin
Tim Harvey
tharvey at gateworks.com
Wed Jul 12 23:14:07 CEST 2023
On Wed, Jul 12, 2023 at 3:37 AM Stefano Babic <sbabic at denx.de> wrote:
>
> Hi Tim,
>
> On 22.06.23 19:30, Tim Harvey wrote:
> > Add a Kconfig for OPTEE_LOAD_ADDRESS which adds tee.bin to the
> > imx8m{m,n,p} FIT image.
> >
> > Prior to using binman for image creation the presense of tee.bin in the
> > directory would cause mkimage_fit_atf.sh to add the tee.bin node
> > to the FIT image. Once boards moved away from using
> > CONFIG_SPL_FIT_GENERATOR this was lost. This patch restores that
> > functionality. A Kconfig option is added due to binman not being
> > able to utilize env variables.
> >
>
> I tried to apply this, and the other ones
>
> https://patchwork.ozlabs.org/user/todo/uboot/?series=360558
> https://patchwork.ozlabs.org/user/todo/uboot/?series=360911
> https://patchwork.ozlabs.org/user/todo/uboot/?series=361339
>
> However, with CONFIG_OPTEE_LOAD_ADDRESS CI stucks because it is not
> configured for the "tools-only" target
> make tools-only_config tools-only
>
> Adding a dummy OPTEE_LOAD_ADDRESS to configs/tools-only_defconfig, issue
> is solved, but I bother why this is needed. Anyway, CI is not successful
> and build stops nby next check (run binman / pylint).
>
> Could you take a look ?
>
Hi Stefano,
'arm: dts: imx8m: add OPTEE_LOAD_ADDRESS config and tee.bin' should
not be required for the other patches to apply cleanly.
I guess config/tools-only_defconfig needs a '# OPTEE_LOAD_ADDRESS is
not set' because it enables SANDBOX. I don't know of a way around
adding that.
Simon, is there a way to use env in place of what I'm doing with 'arm:
dts: imx8m: add OPTEE_LOAD_ADDRESS config and tee.bin' [1] for binman?
I really hate having to add yet another obscure address config.
Best regards,
Tim
[1] https://patchwork.ozlabs.org/project/uboot/patch/20230622173006.3921891-1-tharvey@gateworks.com/
>
> > Signed-off-by: Tim Harvey <tharvey at gateworks.com>
> > ---
> > arch/arm/dts/imx8mm-u-boot.dtsi | 19 +++++++++++++++++++
> > arch/arm/dts/imx8mn-u-boot.dtsi | 19 +++++++++++++++++++
> > arch/arm/dts/imx8mp-u-boot.dtsi | 19 +++++++++++++++++++
> > drivers/tee/optee/Kconfig | 7 +++++++
> > 4 files changed, 64 insertions(+)
> >
> > diff --git a/arch/arm/dts/imx8mm-u-boot.dtsi b/arch/arm/dts/imx8mm-u-boot.dtsi
> > index a843bb851eaf..61f907a4743b 100644
> > --- a/arch/arm/dts/imx8mm-u-boot.dtsi
> > +++ b/arch/arm/dts/imx8mm-u-boot.dtsi
> > @@ -124,6 +124,21 @@
> > type = "atf-bl31";
> > };
> > };
> > +
> > +#ifdef CONFIG_OPTEE_LOAD_ADDRESS
> > + tee {
> > + description = "TEE firmware";
> > + type = "firmware";
> > + arch = "arm64";
> > + compression = "none";
> > + load = <CONFIG_OPTEE_LOAD_ADDRESS>;
> > + entry = <CONFIG_OPTEE_LOAD_ADDRESS>;
> > +
> > + tee_blob: blob-ext {
> > + filename = "tee.bin";
> > + };
> > + };
> > +#endif
> > #endif
> >
> > binman_fip: fip {
> > @@ -154,7 +169,11 @@
> > fdt = "fdt-SEQ";
> > firmware = "uboot";
> > #ifndef CONFIG_ARMV8_PSCI
> > +#ifdef CONFIG_OPTEE_LOAD_ADDRESS
> > + loadables = "atf", "tee";
> > +#else
> > loadables = "atf";
> > +#endif
> > #endif
> > };
> > };
> > diff --git a/arch/arm/dts/imx8mn-u-boot.dtsi b/arch/arm/dts/imx8mn-u-boot.dtsi
> > index 86c9a6cd67f0..15cec4ffab44 100644
> > --- a/arch/arm/dts/imx8mn-u-boot.dtsi
> > +++ b/arch/arm/dts/imx8mn-u-boot.dtsi
> > @@ -181,6 +181,21 @@
> > type = "atf-bl31";
> > };
> > };
> > +
> > +#ifdef CONFIG_OPTEE_LOAD_ADDRESS
> > + tee {
> > + description = "TEE firmware";
> > + type = "firmware";
> > + arch = "arm64";
> > + compression = "none";
> > + load = <CONFIG_OPTEE_LOAD_ADDRESS>;
> > + entry = <CONFIG_OPTEE_LOAD_ADDRESS>;
> > +
> > + tee_blob: blob-ext {
> > + filename = "tee.bin";
> > + };
> > + };
> > +#endif
> > #endif
> >
> > binman_fip: fip {
> > @@ -211,7 +226,11 @@
> > fdt = "fdt-SEQ";
> > firmware = "uboot";
> > #ifndef CONFIG_ARMV8_PSCI
> > +#ifdef CONFIG_OPTEE_LOAD_ADDRESS
> > + loadables = "atf", "tee";
> > +#else
> > loadables = "atf";
> > +#endif
> > #endif
> > };
> > };
> > diff --git a/arch/arm/dts/imx8mp-u-boot.dtsi b/arch/arm/dts/imx8mp-u-boot.dtsi
> > index 8c9d6412ccb5..b46fc7eeed0d 100644
> > --- a/arch/arm/dts/imx8mp-u-boot.dtsi
> > +++ b/arch/arm/dts/imx8mp-u-boot.dtsi
> > @@ -145,6 +145,21 @@
> > type = "atf-bl31";
> > };
> > };
> > +
> > +#ifdef CONFIG_OPTEE_LOAD_ADDRESS
> > + tee {
> > + description = "TEE firmware";
> > + type = "firmware";
> > + arch = "arm64";
> > + compression = "none";
> > + load = <CONFIG_OPTEE_LOAD_ADDRESS>;
> > + entry = <CONFIG_OPTEE_LOAD_ADDRESS>;
> > +
> > + tee_blob: blob-ext {
> > + filename = "tee.bin";
> > + };
> > + };
> > +#endif
> > #endif
> >
> > @fdt-SEQ {
> > @@ -166,7 +181,11 @@
> > fdt = "fdt-SEQ";
> > firmware = "uboot";
> > #ifndef CONFIG_ARMV8_PSCI
> > +#ifdef CONFIG_OPTEE_LOAD_ADDRESS
> > + loadables = "atf", "tee";
> > +#else
> > loadables = "atf";
> > +#endif
> > #endif
> > };
> > };
> > diff --git a/drivers/tee/optee/Kconfig b/drivers/tee/optee/Kconfig
> > index 9dc65b0501e2..09a8bbd2fafd 100644
> > --- a/drivers/tee/optee/Kconfig
> > +++ b/drivers/tee/optee/Kconfig
> > @@ -14,6 +14,13 @@ if OPTEE || SANDBOX
> >
> > menu "OP-TEE options"
> >
> > +config OPTEE_LOAD_ADDRESS
> > + hex "Load address of OPTEE"
> > + help
> > + Defines the load and entry address used by U-Boot FIT images
> > + for tee.bin. This address must match the link address that
> > + tee.bin was built with.
> > +
> > config OPTEE_TA_AVB
> > bool "Support AVB TA"
> > default y
>
> --
> =====================================================================
> DENX Software Engineering GmbH, Managing Director: Erika Unter
> HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany
> Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
> =====================================================================
>
More information about the U-Boot
mailing list