[PATCH next] arm: mach-k3: use Kconfig options for ATF/OPTEE size

Tom Rini trini at konsulko.com
Tue Mar 10 15:22:32 CET 2026


On Tue, Mar 10, 2026 at 08:49:52AM -0500, Andrew Davis wrote:
> On 3/10/26 4:06 AM, Anshul Dalal wrote:
> > The reserved memory sizes for ATF and OPTEE were hard-coded for K3
> > devices, this patch replaces them with a Kconfig option allowing for
> > easier modifications.
> > 
> > Signed-off-by: Anshul Dalal <anshuld at ti.com>
> > ---
> >   arch/arm/dts/k3-binman.dtsi   |  4 ++--
> >   arch/arm/mach-k3/Kconfig      | 15 +++++++++++++++
> >   arch/arm/mach-k3/common_fdt.c |  5 +++--
> >   3 files changed, 20 insertions(+), 4 deletions(-)
> > 
> > diff --git a/arch/arm/dts/k3-binman.dtsi b/arch/arm/dts/k3-binman.dtsi
> > index 0fd93f9536a..ad127663d03 100644
> > --- a/arch/arm/dts/k3-binman.dtsi
> > +++ b/arch/arm/dts/k3-binman.dtsi
> > @@ -477,7 +477,7 @@
> >   						FWPERM_SECURE_PRIV_RWCD |
> >   						FWPERM_SECURE_USER_RWCD)>;
> >   		start_address = <0x0 CONFIG_K3_ATF_LOAD_ADDR>;
> > -		end_address = <0x0 (CONFIG_K3_ATF_LOAD_ADDR + 0x1ffff)>;
> > +		end_address = <0x0 (CONFIG_K3_ATF_LOAD_ADDR + CONFIG_K3_ATF_RESERVED_SIZE - 1)>;
> >   	};
> >   	firewall_armv8_optee_fg: template-8 {
> >   		control = <(FWCTRL_EN | FWCTRL_LOCK |
> > @@ -486,7 +486,7 @@
> >   						FWPERM_SECURE_PRIV_RWCD |
> >   						FWPERM_SECURE_USER_RWCD)>;
> >   		start_address = <0x0 CONFIG_K3_OPTEE_LOAD_ADDR>;
> > -		end_address = <0x0 (CONFIG_K3_OPTEE_LOAD_ADDR + 0x17fffff)>;
> > +		end_address = <0x0 (CONFIG_K3_OPTEE_LOAD_ADDR + CONFIG_K3_OPTEE_RESERVED_SIZE - 1)>;
> >   	};
> >   	ti_falcon_template: template-9 {
> > diff --git a/arch/arm/mach-k3/Kconfig b/arch/arm/mach-k3/Kconfig
> > index 1b8c0b1eb96..ba1130a7996 100644
> > --- a/arch/arm/mach-k3/Kconfig
> > +++ b/arch/arm/mach-k3/Kconfig
> > @@ -130,6 +130,14 @@ config K3_ATF_LOAD_ADDR
> >   	  The load address for the ATF image. This value is used to build the
> >   	  FIT image header that places ATF in memory where it will run.
> > +config K3_ATF_RESERVED_SIZE
> > +	hex "Reserved DDR size for ATF"
> > +	default 0x80000 if (SOC_K3_AM625 || SOC_K3_AM62A7 || SOC_K3_AM62P5 || SOC_K3_J722S)
> > +	default 0x20000
> > +	help
> > +	  The runtime DDR size reserved for ATF. This value is used to fixup the
> > +	  kernel device-tree's reserved-memory node for ATF.
> 
> This does more than just fixing up the DT. It also sets the size of the firewall
> in the boot certificate, which is much more important. If this is set smaller
> than the real size of ATF then some of it might remain un-firewalled.
> 
> Same below for OPTEE. Otherwise, LGTM,
> 
> Acked-by: Andrew Davis <afd at ti.com>

To be clear, I'll expect a v2 that at least updates the help text and
also updates anything relevant under doc/board/ as well. Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20260310/ffad8ca2/attachment.sig>


More information about the U-Boot mailing list