From: Michael Tretter <mtr@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH] ARM: rockchip: tfa: pass NULL fdt when there is none
Date: Tue, 9 Jun 2026 14:51:51 +0200 [thread overview]
Message-ID: <aigMZ3KQ-8H3p3wJ@pengutronix.de> (raw)
In-Reply-To: <20260609124050.254522-1-s.hauer@pengutronix.de>
On Tue, 09 Jun 2026 14:40:49 +0200, Sascha Hauer wrote:
> We pass an address to the TF-A even when there is none. The FDT could be
> absent when either CONFIG_ARCH_ROCKCHIP_ATF_PASS_FDT is disabled or
> copying it to the scratch area fails. Instead of passing an invalid FDT
> in this case, explicitly pass a NULL pointer.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Michael Tretter <m.tretter@pengutronix.de>
> ---
> arch/arm/mach-rockchip/atf.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-rockchip/atf.c b/arch/arm/mach-rockchip/atf.c
> index 74b8cdc2f4..0b4566f8ae 100644
> --- a/arch/arm/mach-rockchip/atf.c
> +++ b/arch/arm/mach-rockchip/atf.c
> @@ -271,6 +271,8 @@ void __noreturn rk3588_barebox_entry(void *fdt)
> rk_scratch = (void *)arm_mem_scratch(memend);
>
> if (current_el() == 3) {
> + void *fdt_bl31 = NULL;
> +
> rk3588_lowlevel_init();
> rockchip_store_bootrom_iram(IOMEM(RK3588_IRAM_BASE));
> ROCKCHIP_GET_ADDRESSES(RK3588, rk3588_bl31_bin, rk3588_bl32_bin);
> @@ -281,9 +283,11 @@ void __noreturn rk3588_barebox_entry(void *fdt)
> ret = rockchip_create_optee_fdt(rk_scratch->fdt, sizeof(rk_scratch->fdt));
> if (ret)
> pr_warn("Failed to create OP-TEE Device tree\n");
> + else
> + fdt_bl31 = rk_scratch->fdt;
> }
>
> - rockchip_atf_load_bl31(rk_scratch->fdt);
> + rockchip_atf_load_bl31(fdt_bl31);
> /* not reached when CONFIG_ARCH_ROCKCHIP_ATF */
> }
>
> --
> 2.47.3
>
>
--
Pengutronix e.K. | Michael Tretter |
Steuerwalder Str. 21 | https://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2026-06-09 12:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-09 12:40 Sascha Hauer
2026-06-09 12:51 ` Michael Tretter [this message]
2026-06-11 10:10 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aigMZ3KQ-8H3p3wJ@pengutronix.de \
--to=mtr@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=s.hauer@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox