mbox series

[v2,0/2] ARM: decompressor: support AUTO_ZRELADDR and appended DTB

Message ID 20240121203009.9257-1-ansuelsmth@gmail.com (mailing list archive)
Headers show
Series ARM: decompressor: support AUTO_ZRELADDR and appended DTB | expand

Message

Christian Marangi Jan. 21, 2024, 8:29 p.m. UTC
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(+)

Comments

Christian Marangi Feb. 21, 2024, 4:57 p.m. UTC | #1
On Sun, Jan 21, 2024 at 09:29:32PM +0100, Christian Marangi wrote:
> 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(+)
> 
>

Any news for this?
Linus Walleij Feb. 22, 2024, 12:07 p.m. UTC | #2
On Wed, Feb 21, 2024 at 5:57 PM Christian Marangi <ansuelsmth@gmail.com> wrote:

> Any news for this?

Can you please put the patches into Russell's patch tracker so he can
apply them?
https://www.arm.linux.org.uk/developer/patches/

If you run into any problems, ping me on IRC and I'll help out.

Yours,
Linus Walleij
Christian Marangi May 5, 2024, 4:22 p.m. UTC | #3
On Thu, Feb 22, 2024 at 01:07:56PM +0100, Linus Walleij wrote:
> On Wed, Feb 21, 2024 at 5:57 PM Christian Marangi <ansuelsmth@gmail.com> wrote:
> 
> > Any news for this?
> 
> Can you please put the patches into Russell's patch tracker so he can
> apply them?
> https://www.arm.linux.org.uk/developer/patches/
> 
> If you run into any problems, ping me on IRC and I'll help out.
>

God I totally missed this email where I had to put the 2 patch in the
tracking system. Just did now... my bad!