From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH 2/2] ARM: rockchip: initialize PBL malloc
Date: Mon, 18 May 2026 18:20:21 +0200 [thread overview]
Message-ID: <da2a16d6-324c-4649-aa55-ef3afc6678db@pengutronix.de> (raw)
In-Reply-To: <20260518153212.184983-2-s.hauer@pengutronix.de>
Hello,
On 5/18/26 5:32 PM, Sascha Hauer wrote:
> Rockchip uses compressed firmware binaries. Depending on the compression
> algorithm we might use early malloc space for decompressing. Initialize
> the PBL malloc space to the memory end to make pbl_malloc() work. This
> memory area will be overwritten later in barebox_pbl_start(), but it's
> ok as the memory is only needed during decompression of the firmware
> files.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Tested-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> arch/arm/mach-rockchip/atf.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/arm/mach-rockchip/atf.c b/arch/arm/mach-rockchip/atf.c
> index 3e2e18ac29..03e03c9122 100644
> --- a/arch/arm/mach-rockchip/atf.c
> +++ b/arch/arm/mach-rockchip/atf.c
> @@ -173,6 +173,7 @@ static void rockchip_atf_load_bl31(void *fdt)
> unsigned long bl31_ep;
>
> mmu_early_enable(membase[0], memsize[0]);
> + pbl_malloc_init(membase[0] + memsize[0] - SZ_128K, SZ_128K);
It would be cool if we could use the same malloc area that would be used
in barebox_pbl_start(), but I guess that's not possible, because it's
unfortunately based on the barebox proper load address, which is now
known here. Let's hope this won't clash with any future use..
Thanks,
Ahmad
>
> bl31_ep = load_elf64_image_phdr(&bl31);
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://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-05-18 16:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-18 15:32 [PATCH 1/2] pbl: cleanup early malloc Sascha Hauer
2026-05-18 15:32 ` [PATCH 2/2] ARM: rockchip: initialize PBL malloc Sascha Hauer
2026-05-18 16:20 ` Ahmad Fatoum [this message]
2026-05-18 18:24 ` Sascha Hauer
2026-05-18 16:14 ` [PATCH 1/2] pbl: cleanup early malloc Ahmad Fatoum
2026-05-18 18:15 ` 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=da2a16d6-324c-4649-aa55-ef3afc6678db@pengutronix.de \
--to=a.fatoum@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