diff mbox series

msc_sm2s_imx8mp: Adjust the initrd_addr location

Message ID 20240703175727.446205-1-festevam@gmail.com
State Changes Requested
Delegated to: Tom Rini
Headers show
Series msc_sm2s_imx8mp: Adjust the initrd_addr location | expand

Commit Message

Fabio Estevam July 3, 2024, 5:57 p.m. UTC
From: Fabio Estevam <festevam@denx.de>

Booting an initramfs with the current address may lead to initramfs
corruption and boot failure.

Move it 0x48000000 which avoids initramfs overlap and allows a
successful initramfs boot.

Signed-off-by: Fabio Estevam <festevam@denx.de>
---
 include/configs/msc_sm2s_imx8mp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Tom Rini July 3, 2024, 6:03 p.m. UTC | #1
On Wed, Jul 03, 2024 at 02:57:27PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> Booting an initramfs with the current address may lead to initramfs
> corruption and boot failure.
> 
> Move it 0x48000000 which avoids initramfs overlap and allows a
> successful initramfs boot.
> 
> Signed-off-by: Fabio Estevam <festevam@denx.de>
> ---
>  include/configs/msc_sm2s_imx8mp.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/configs/msc_sm2s_imx8mp.h b/include/configs/msc_sm2s_imx8mp.h
> index 3c7d96cb3c0a..2a52455ace34 100644
> --- a/include/configs/msc_sm2s_imx8mp.h
> +++ b/include/configs/msc_sm2s_imx8mp.h
> @@ -39,7 +39,7 @@
>  	"fdt_addr_r=0x43000000\0"			\
>  	"boot_fdt=try\0" \
>  	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
> -	"initrd_addr=0x43800000\0"		\
> +	"initrd_addr=0x48000000\0"		\
>  	"bootm_size=0x10000000\0" \
>  	"mmcpart=1\0" \
>  	"mmcroot=/dev/mmcblk1p2 rootwait rw\0" \

Shouldn't fdt_addr_r change too? This is making me suspect the whole map
is too small for safety, how much memory does the platform have at
minimum?
Fabio Estevam July 3, 2024, 6:07 p.m. UTC | #2
Hi Tom,

On Wed, Jul 3, 2024 at 3:03 PM Tom Rini <trini@konsulko.com> wrote:

> Shouldn't fdt_addr_r change too? This is making me suspect the whole map
> is too small for safety, how much memory does the platform have at
> minimum?

It has 2GB of RAM.

Changing only initrd_addr and keeping fdt_addr_r unchanged allows a
successful initramfs boot.
Tom Rini July 3, 2024, 6:22 p.m. UTC | #3
On Wed, Jul 03, 2024 at 03:07:47PM -0300, Fabio Estevam wrote:
> Hi Tom,
> 
> On Wed, Jul 3, 2024 at 3:03 PM Tom Rini <trini@konsulko.com> wrote:
> 
> > Shouldn't fdt_addr_r change too? This is making me suspect the whole map
> > is too small for safety, how much memory does the platform have at
> > minimum?
> 
> It has 2GB of RAM.
> 
> Changing only initrd_addr and keeping fdt_addr_r unchanged allows a
> successful initramfs boot.

How is the fdt at 0x43000000 not being clobbered if the initramfs at
0x43800000 is? Is it because it's just enough of a bad spot that we
relocate the fdt out of the way? With the kernel at 0x40480000
everything else is too low. kernel address + 128MiB for fdt address, then
+512KiB (or a bit more, for nicer numbers) for initrd.
Fabio Estevam July 4, 2024, 12:25 p.m. UTC | #4
Hi Tom,

On Wed, Jul 3, 2024 at 3:22 PM Tom Rini <trini@konsulko.com> wrote:

> How is the fdt at 0x43000000 not being clobbered if the initramfs at
> 0x43800000 is? Is it because it's just enough of a bad spot that we
> relocate the fdt out of the way? With the kernel at 0x40480000
> everything else is too low. kernel address + 128MiB for fdt address, then
> +512KiB (or a bit more, for nicer numbers) for initrd.

Thanks for the suggestion, it works.

I sent a v2 with that proposal.

Thanks
diff mbox series

Patch

diff --git a/include/configs/msc_sm2s_imx8mp.h b/include/configs/msc_sm2s_imx8mp.h
index 3c7d96cb3c0a..2a52455ace34 100644
--- a/include/configs/msc_sm2s_imx8mp.h
+++ b/include/configs/msc_sm2s_imx8mp.h
@@ -39,7 +39,7 @@ 
 	"fdt_addr_r=0x43000000\0"			\
 	"boot_fdt=try\0" \
 	"fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \
-	"initrd_addr=0x43800000\0"		\
+	"initrd_addr=0x48000000\0"		\
 	"bootm_size=0x10000000\0" \
 	"mmcpart=1\0" \
 	"mmcroot=/dev/mmcblk1p2 rootwait rw\0" \