diff mbox series

[U-Boot,1/2] riscv: set CONFIG_SYS_BOOTM_LEN to SZ_64M

Message ID 20190409104247.5721-2-david.abdurachmanov@gmail.com
State Accepted
Commit ac12c61909273be0806afae42963f426925ad111
Delegated to: Andes
Headers show
Series riscv: set preboot and increase kernel size | expand

Commit Message

David Abdurachmanov April 9, 2019, 10:42 a.m. UTC
After updating Fedora/RISCV kernel to 5.1-rc3+ the size increased above
the current threshold. Looking into HiKey, Dragonboards, etc. seems that
SZ_64M is a popular option.

This sucessfully boots Fedora/RISCV with 5.1-rc3+ kernel on QEMU 4.0 (master)
with OpenSBI -> U-Boot (S-mode) [extlinux] -> Kernel setup.

Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
---
 include/configs/qemu-riscv.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Tom Rini April 9, 2019, 1:15 p.m. UTC | #1
On Tue, Apr 09, 2019 at 12:42:46PM +0200, David Abdurachmanov wrote:
> After updating Fedora/RISCV kernel to 5.1-rc3+ the size increased above
> the current threshold. Looking into HiKey, Dragonboards, etc. seems that
> SZ_64M is a popular option.
> 
> This sucessfully boots Fedora/RISCV with 5.1-rc3+ kernel on QEMU 4.0 (master)
> with OpenSBI -> U-Boot (S-mode) [extlinux] -> Kernel setup.
> 
> Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
> ---
>  include/configs/qemu-riscv.h | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/include/configs/qemu-riscv.h b/include/configs/qemu-riscv.h
> index 2588c5a0b2..22a5cd7365 100644
> --- a/include/configs/qemu-riscv.h
> +++ b/include/configs/qemu-riscv.h
> @@ -15,7 +15,7 @@
>  
>  #define CONFIG_SYS_MALLOC_LEN		SZ_8M
>  
> -#define CONFIG_SYS_BOOTM_LEN		SZ_16M
> +#define CONFIG_SYS_BOOTM_LEN		SZ_64M
>  
>  #define CONFIG_STANDALONE_LOAD_ADDR	0x80200000
>  
> @@ -41,11 +41,11 @@
>  #define CONFIG_EXTRA_ENV_SETTINGS \
>  	"fdt_high=0xffffffffffffffff\0" \
>  	"initrd_high=0xffffffffffffffff\0" \
> -	"kernel_addr_r=0x81000000\0" \
> -	"fdt_addr_r=0x82000000\0" \
> -	"scriptaddr=0x82100000\0" \
> -	"pxefile_addr_r=0x82200000\0" \
> -	"ramdisk_addr_r=0x82300000\0" \
> +	"kernel_addr_r=0x84000000\0" \
> +	"fdt_addr_r=0x88000000\0" \
> +	"scriptaddr=0x88100000\0" \
> +	"pxefile_addr_r=0x88200000\0" \
> +	"ramdisk_addr_r=0x88300000\0" \

As a follow-up, I really dislike fdt_high/initrd_high being set such
that we disable relocation, that just leads to down the line
"kernel/initrd grew, was overwritten".  We should be using bootm_size to
define the area in memory that everything can reside in, so that U-Boot
can be smart about relocations.
Anup Patel April 10, 2019, 5:55 a.m. UTC | #2
> -----Original Message-----
> From: David Abdurachmanov <david.abdurachmanov@gmail.com>
> Sent: Tuesday, April 9, 2019 4:13 PM
> To: rick@andestech.com; Atish Patra <Atish.Patra@wdc.com>; Anup Patel
> <Anup.Patel@wdc.com>; lukas.auer@aisec.fraunhofer.de; u-
> boot@lists.denx.de
> Cc: David Abdurachmanov <david.abdurachmanov@gmail.com>
> Subject: [PATCH 1/2] riscv: set CONFIG_SYS_BOOTM_LEN to SZ_64M
> 
> After updating Fedora/RISCV kernel to 5.1-rc3+ the size increased above the
> current threshold. Looking into HiKey, Dragonboards, etc. seems that
> SZ_64M is a popular option.
> 
> This sucessfully boots Fedora/RISCV with 5.1-rc3+ kernel on QEMU 4.0
> (master) with OpenSBI -> U-Boot (S-mode) [extlinux] -> Kernel setup.
> 
> Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
> ---
>  include/configs/qemu-riscv.h | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/include/configs/qemu-riscv.h b/include/configs/qemu-riscv.h
> index 2588c5a0b2..22a5cd7365 100644
> --- a/include/configs/qemu-riscv.h
> +++ b/include/configs/qemu-riscv.h
> @@ -15,7 +15,7 @@
> 
>  #define CONFIG_SYS_MALLOC_LEN		SZ_8M
> 
> -#define CONFIG_SYS_BOOTM_LEN		SZ_16M
> +#define CONFIG_SYS_BOOTM_LEN		SZ_64M
> 
>  #define CONFIG_STANDALONE_LOAD_ADDR	0x80200000
> 
> @@ -41,11 +41,11 @@
>  #define CONFIG_EXTRA_ENV_SETTINGS \
>  	"fdt_high=0xffffffffffffffff\0" \
>  	"initrd_high=0xffffffffffffffff\0" \
> -	"kernel_addr_r=0x81000000\0" \
> -	"fdt_addr_r=0x82000000\0" \
> -	"scriptaddr=0x82100000\0" \
> -	"pxefile_addr_r=0x82200000\0" \
> -	"ramdisk_addr_r=0x82300000\0" \
> +	"kernel_addr_r=0x84000000\0" \
> +	"fdt_addr_r=0x88000000\0" \
> +	"scriptaddr=0x88100000\0" \
> +	"pxefile_addr_r=0x88200000\0" \
> +	"ramdisk_addr_r=0x88300000\0" \
>  	BOOTENV
> 
>  #endif /* __CONFIG_H */
> --
> 2.20.1

Looks good to me.

Reviewed-by: Anup Patel <anup.patel@wdc.com>

Regards,
Anup
Lukas Auer April 11, 2019, 12:40 p.m. UTC | #3
+ Bin
[Please use get_maintainer or patman to include all maintainers on CC]

On Tue, 2019-04-09 at 12:42 +0200, David Abdurachmanov wrote:
> After updating Fedora/RISCV kernel to 5.1-rc3+ the size increased above
> the current threshold. Looking into HiKey, Dragonboards, etc. seems that
> SZ_64M is a popular option.
> 
> This sucessfully boots Fedora/RISCV with 5.1-rc3+ kernel on QEMU 4.0 (master)
> with OpenSBI -> U-Boot (S-mode) [extlinux] -> Kernel setup.
> 
> Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
> ---
>  include/configs/qemu-riscv.h | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/include/configs/qemu-riscv.h b/include/configs/qemu-riscv.h
> index 2588c5a0b2..22a5cd7365 100644
> --- a/include/configs/qemu-riscv.h
> +++ b/include/configs/qemu-riscv.h
> @@ -15,7 +15,7 @@
>  
>  #define CONFIG_SYS_MALLOC_LEN		SZ_8M
>  
> -#define CONFIG_SYS_BOOTM_LEN		SZ_16M
> +#define CONFIG_SYS_BOOTM_LEN		SZ_64M
>  
>  #define CONFIG_STANDALONE_LOAD_ADDR	0x80200000
>  
> @@ -41,11 +41,11 @@
>  #define CONFIG_EXTRA_ENV_SETTINGS \
>  	"fdt_high=0xffffffffffffffff\0" \
>  	"initrd_high=0xffffffffffffffff\0" \
> -	"kernel_addr_r=0x81000000\0" \
> -	"fdt_addr_r=0x82000000\0" \
> -	"scriptaddr=0x82100000\0" \
> -	"pxefile_addr_r=0x82200000\0" \
> -	"ramdisk_addr_r=0x82300000\0" \
> +	"kernel_addr_r=0x84000000\0" \

Why are you also moving kernel_addr_r?

Thanks,
Lukas

> +	"fdt_addr_r=0x88000000\0" \
> +	"scriptaddr=0x88100000\0" \
> +	"pxefile_addr_r=0x88200000\0" \
> +	"ramdisk_addr_r=0x88300000\0" \
>  	BOOTENV
>  
>  #endif /* __CONFIG_H */
David Abdurachmanov April 11, 2019, 1:05 p.m. UTC | #4
On Thu, Apr 11, 2019 at 2:40 PM Auer, Lukas
<lukas.auer@aisec.fraunhofer.de> wrote:
>
> + Bin
> [Please use get_maintainer or patman to include all maintainers on CC]

Thanks.

Hm.. get_maintainer and patman are not mentioned on wiki page:
"Patches and Feature Requests". It only mentions to CC people from:
http://www.denx.de/wiki/U-Boot/Custodians

>
> On Tue, 2019-04-09 at 12:42 +0200, David Abdurachmanov wrote:
> > After updating Fedora/RISCV kernel to 5.1-rc3+ the size increased above
> > the current threshold. Looking into HiKey, Dragonboards, etc. seems that
> > SZ_64M is a popular option.
> >
> > This sucessfully boots Fedora/RISCV with 5.1-rc3+ kernel on QEMU 4.0 (master)
> > with OpenSBI -> U-Boot (S-mode) [extlinux] -> Kernel setup.
> >
> > Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
> > ---
> >  include/configs/qemu-riscv.h | 12 ++++++------
> >  1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/include/configs/qemu-riscv.h b/include/configs/qemu-riscv.h
> > index 2588c5a0b2..22a5cd7365 100644
> > --- a/include/configs/qemu-riscv.h
> > +++ b/include/configs/qemu-riscv.h
> > @@ -15,7 +15,7 @@
> >
> >  #define CONFIG_SYS_MALLOC_LEN                SZ_8M
> >
> > -#define CONFIG_SYS_BOOTM_LEN         SZ_16M
> > +#define CONFIG_SYS_BOOTM_LEN         SZ_64M
> >
> >  #define CONFIG_STANDALONE_LOAD_ADDR  0x80200000
> >
> > @@ -41,11 +41,11 @@
> >  #define CONFIG_EXTRA_ENV_SETTINGS \
> >       "fdt_high=0xffffffffffffffff\0" \
> >       "initrd_high=0xffffffffffffffff\0" \
> > -     "kernel_addr_r=0x81000000\0" \
> > -     "fdt_addr_r=0x82000000\0" \
> > -     "scriptaddr=0x82100000\0" \
> > -     "pxefile_addr_r=0x82200000\0" \
> > -     "ramdisk_addr_r=0x82300000\0" \
> > +     "kernel_addr_r=0x84000000\0" \
>
> Why are you also moving kernel_addr_r?

I think there two 16MB windows here for kernel:
- 0x80000000 - 0x81000000 (kernel_addr_r),  and kernel is loaded at 0x80200000
- 0x81000000 (kernel_addr_r) - 0x82000000 (fdt_addr_r)

From U-Boot documentation:

[..]
236 kernel_addr_r:
237
238   Mandatory. The location in RAM where the kernel will be loaded
to when
239   processing the kernel option in the extlinux.conf.
[..]

Thus I moved it to ensure that both windows are 64MB.

>
> Thanks,
> Lukas
>
> > +     "fdt_addr_r=0x88000000\0" \
> > +     "scriptaddr=0x88100000\0" \
> > +     "pxefile_addr_r=0x88200000\0" \
> > +     "ramdisk_addr_r=0x88300000\0" \
> >       BOOTENV
> >
> >  #endif /* __CONFIG_H */
Lukas Auer April 11, 2019, 4:31 p.m. UTC | #5
On Thu, 2019-04-11 at 15:05 +0200, David Abdurachmanov wrote:
> On Thu, Apr 11, 2019 at 2:40 PM Auer, Lukas
> <lukas.auer@aisec.fraunhofer.de> wrote:
> > + Bin
> > [Please use get_maintainer or patman to include all maintainers on CC]
> 
> Thanks.
> 
> Hm.. get_maintainer and patman are not mentioned on wiki page:
> "Patches and Feature Requests". It only mentions to CC people from:
> http://www.denx.de/wiki/U-Boot/Custodians
> 

Hm, you are right, it's not really stated explicitly.

> > On Tue, 2019-04-09 at 12:42 +0200, David Abdurachmanov wrote:
> > > After updating Fedora/RISCV kernel to 5.1-rc3+ the size increased above
> > > the current threshold. Looking into HiKey, Dragonboards, etc. seems that
> > > SZ_64M is a popular option.
> > > 
> > > This sucessfully boots Fedora/RISCV with 5.1-rc3+ kernel on QEMU 4.0 (master)
> > > with OpenSBI -> U-Boot (S-mode) [extlinux] -> Kernel setup.
> > > 
> > > Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
> > > ---
> > >  include/configs/qemu-riscv.h | 12 ++++++------
> > >  1 file changed, 6 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/include/configs/qemu-riscv.h b/include/configs/qemu-riscv.h
> > > index 2588c5a0b2..22a5cd7365 100644
> > > --- a/include/configs/qemu-riscv.h
> > > +++ b/include/configs/qemu-riscv.h
> > > @@ -15,7 +15,7 @@
> > > 
> > >  #define CONFIG_SYS_MALLOC_LEN                SZ_8M
> > > 
> > > -#define CONFIG_SYS_BOOTM_LEN         SZ_16M
> > > +#define CONFIG_SYS_BOOTM_LEN         SZ_64M
> > > 
> > >  #define CONFIG_STANDALONE_LOAD_ADDR  0x80200000
> > > 
> > > @@ -41,11 +41,11 @@
> > >  #define CONFIG_EXTRA_ENV_SETTINGS \
> > >       "fdt_high=0xffffffffffffffff\0" \
> > >       "initrd_high=0xffffffffffffffff\0" \
> > > -     "kernel_addr_r=0x81000000\0" \
> > > -     "fdt_addr_r=0x82000000\0" \
> > > -     "scriptaddr=0x82100000\0" \
> > > -     "pxefile_addr_r=0x82200000\0" \
> > > -     "ramdisk_addr_r=0x82300000\0" \
> > > +     "kernel_addr_r=0x84000000\0" \
> > 
> > Why are you also moving kernel_addr_r?
> 
> I think there two 16MB windows here for kernel:
> - 0x80000000 - 0x81000000 (kernel_addr_r),  and kernel is loaded at 0x80200000
> - 0x81000000 (kernel_addr_r) - 0x82000000 (fdt_addr_r)
> 
> From U-Boot documentation:
> 
> [..]
> 236 kernel_addr_r:
> 237
> 238   Mandatory. The location in RAM where the kernel will be loaded
> to when
> 239   processing the kernel option in the extlinux.conf.
> [..]
> 
> Thus I moved it to ensure that both windows are 64MB.
> 

Ok you are right, that makes sense.

Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de>
Bin Meng May 8, 2019, 2:12 p.m. UTC | #6
On Tue, Apr 9, 2019 at 8:30 PM David Abdurachmanov
<david.abdurachmanov@gmail.com> wrote:
>
> After updating Fedora/RISCV kernel to 5.1-rc3+ the size increased above
> the current threshold. Looking into HiKey, Dragonboards, etc. seems that
> SZ_64M is a popular option.
>
> This sucessfully boots Fedora/RISCV with 5.1-rc3+ kernel on QEMU 4.0 (master)
> with OpenSBI -> U-Boot (S-mode) [extlinux] -> Kernel setup.
>
> Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
> ---
>  include/configs/qemu-riscv.h | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Rick Chen May 9, 2019, 3:14 a.m. UTC | #7
> Subject: Re: [U-Boot] [PATCH 1/2] riscv: set CONFIG_SYS_BOOTM_LEN to
> SZ_64M
>
> On Tue, Apr 9, 2019 at 8:30 PM David Abdurachmanov
> <david.abdurachmanov@gmail.com> wrote:
> >
> > After updating Fedora/RISCV kernel to 5.1-rc3+ the size increased
> > above the current threshold. Looking into HiKey, Dragonboards, etc.
> > seems that SZ_64M is a popular option.
> >
> > This sucessfully boots Fedora/RISCV with 5.1-rc3+ kernel on QEMU 4.0
> > (master) with OpenSBI -> U-Boot (S-mode) [extlinux] -> Kernel setup.
> >
> > Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
> > ---
> >  include/configs/qemu-riscv.h | 12 ++++++------
> >  1 file changed, 6 insertions(+), 6 deletions(-)
> >
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Applied to u-boot-riscv/master, thanks!
diff mbox series

Patch

diff --git a/include/configs/qemu-riscv.h b/include/configs/qemu-riscv.h
index 2588c5a0b2..22a5cd7365 100644
--- a/include/configs/qemu-riscv.h
+++ b/include/configs/qemu-riscv.h
@@ -15,7 +15,7 @@ 
 
 #define CONFIG_SYS_MALLOC_LEN		SZ_8M
 
-#define CONFIG_SYS_BOOTM_LEN		SZ_16M
+#define CONFIG_SYS_BOOTM_LEN		SZ_64M
 
 #define CONFIG_STANDALONE_LOAD_ADDR	0x80200000
 
@@ -41,11 +41,11 @@ 
 #define CONFIG_EXTRA_ENV_SETTINGS \
 	"fdt_high=0xffffffffffffffff\0" \
 	"initrd_high=0xffffffffffffffff\0" \
-	"kernel_addr_r=0x81000000\0" \
-	"fdt_addr_r=0x82000000\0" \
-	"scriptaddr=0x82100000\0" \
-	"pxefile_addr_r=0x82200000\0" \
-	"ramdisk_addr_r=0x82300000\0" \
+	"kernel_addr_r=0x84000000\0" \
+	"fdt_addr_r=0x88000000\0" \
+	"scriptaddr=0x88100000\0" \
+	"pxefile_addr_r=0x88200000\0" \
+	"ramdisk_addr_r=0x88300000\0" \
 	BOOTENV
 
 #endif /* __CONFIG_H */