linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ARM: decompressor: support AUTO_ZRELADDR and appended DTB
@ 2024-01-21 20:29 Christian Marangi
  2024-01-21 20:29 ` [PATCH v2 1/2] ARM: decompressor: support memory start validation for " Christian Marangi
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Christian Marangi @ 2024-01-21 20:29 UTC (permalink / raw)
  To: Russell King, Arnd Bergmann, Andrew Morton, Geert Uytterhoeven,
	Linus Walleij, Kirill A. Shutemov, Thomas Gleixner,
	Jonathan Corbet, Marc Zyngier, Christian Marangi,
	Mike Rapoport (IBM), Eric DeVolder, Nathan Chancellor, Kees Cook,
	Russell King (Oracle), linux-arm-kernel, linux-kernel,
	Bjorn Andersson, Konrad Dybcio, John Crispin

This series try to address a long lasting problem with legacy device
that require an appended DTB and the use of AUTO_ZRELADDR.

With these device AUTO_ZRELADDR is not possible if for some reason at
the start of the RAM it's needed to reserve some space. (example qcom SoC
that allocate reserved space for SMEM)

In the current implementation with appended DTB and AUTO_ZRELADDR,
the memory start is only derived from the PC register and it can't be
changed by declaring additional info in the DTS.

In a normal setup, we have an intentional undocumented chosen property
to handle this and the memory node to declare the start of the memory.

With this applied and ARM_ATAG_DTB_COMPAT_IGNORE_MEM enabled (more 
info in the related patch) ipq806x can boot right away with AUTO_ZRELADDR
enabled and a correct memory node defined in DTS.

It's needed to ignore MEM ATAGs as most of the time the values from the
bootloader are hardcoded and OEM didn't care to actually provide them
resulting in funny situation where a Netgear R7800 with 512Mb of RAM
have Uboot passing 1.7GB of RAM with ATAGS.

While MEM ATAG may be broken, other ATAG like serial number or bootargs
might still be useful for partition declaration (cmdlinepart) or other
info hence DTB_COMPAT is still needed in these case and can't be
disabled.

I'm open to any suggestion on how this can be improved and I would love
some additional testing on other legacy platform but I assume this will
permit many legacy device to be correctly supported without having to
hardcode address.

Changes v2:
- Add Review and Ack Tags
- Use IS_ENABLED instead of global variable

Christian Marangi (2):
  ARM: decompressor: support memory start validation for appended DTB
  ARM: decompressor: add option to ignore MEM ATAGs

 arch/arm/Kconfig                        | 12 ++++++++++++
 arch/arm/boot/compressed/atags_to_fdt.c |  4 ++++
 arch/arm/boot/compressed/head.S         | 22 ++++++++++++++++++++++
 3 files changed, 38 insertions(+)

-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-06-13 16:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-21 20:29 [PATCH v2 0/2] ARM: decompressor: support AUTO_ZRELADDR and appended DTB Christian Marangi
2024-01-21 20:29 ` [PATCH v2 1/2] ARM: decompressor: support memory start validation for " Christian Marangi
2024-06-13 16:42   ` Geert Uytterhoeven
2024-01-21 20:29 ` [PATCH v2 2/2] ARM: decompressor: add option to ignore MEM ATAGs Christian Marangi
2024-02-21 16:57 ` [PATCH v2 0/2] ARM: decompressor: support AUTO_ZRELADDR and appended DTB Christian Marangi
2024-02-22 12:07   ` Linus Walleij
2024-05-05 16:22     ` Christian Marangi
2024-06-13 11:24   ` Christian Marangi
2024-06-13 13:50     ` Linus Walleij
2024-06-13 15:59       ` Russell King (Oracle)
2024-06-13 13:42         ` Christian Marangi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).