RE: [PATCH 1/2] km: adapt defines and variables for new memory layout

2020-10-08 Thread Holger Brunck
Hi Heiko,

> > Due to increasing kernel image sizes we get problems when
> > decompressing the kernel image. To fix this we need to change the
> > addresses where we load and where we extract the kernel. Also we need
> > to adapt the address where to load the CRAMFS image and where to load
> the DTB file.
> > While a it also harmonize all boards for PPC and ARM to have the same
> > values.
> >
> > Signed-off-by: Holger Brunck 
> > CC: Valentin Longchamp 
> > CC: Heiko Schocher 
> > CC: Tom Rini 
> > ---
> >   board/keymile/Kconfig   | 12 +++-
> >   include/configs/km/keymile-common.h |  1 +
> >   include/configs/km/km-powerpc.h |  4 
> >   include/configs/km/km_arm.h |  3 +++
> >   4 files changed, 11 insertions(+), 9 deletions(-)
> >
> > diff --git a/board/keymile/Kconfig b/board/keymile/Kconfig index
> > e20c017436..e5906906f3 100644
> > --- a/board/keymile/Kconfig
> > +++ b/board/keymile/Kconfig
> > @@ -37,26 +37,20 @@ config KM_RESERVED_PRAM
> >
> >   config KM_CRAMFS_ADDR
> >   hex "CRAMFS Address"
> > - default 0x240 if ARCH_KIRKWOOD
> > - default 0xC0 if MPC83xx
> > - default 0x200 if MPC85xx
> > + default 0x300
> >   depends on !ARCH_SOCFPGA
> >   help
> > Start address of the CRAMFS containing the Linux kernel.
> >
> >   config KM_KERNEL_ADDR
> >   hex "Kernel Load Address"
> > - default 0x200 if ARCH_KIRKWOOD
> > - default 0x40 if MPC83xx
> > - default 0x100 if MPC85xx || ARCH_SOCFPGA
> > + default 0x200
> >   help
> > Address where to load Linux kernel in RAM.
> >
> >   config KM_FDT_ADDR
> >   hex "FDT Load Address"
> > - default 0x23E if ARCH_KIRKWOOD || ARCH_SOCFPGA
> > - default 0xB8 if MPC83xx
> > - default 0x1F8 if MPC85xx
> > + default 0x2FC
> >   help
> > Address where to load flattened device tree in RAM.
> >
> > diff --git a/include/configs/km/keymile-common.h
> > b/include/configs/km/keymile-common.h
> > index e9e3981060..6a8c41529f 100644
> > --- a/include/configs/km/keymile-common.h
> > +++ b/include/configs/km/keymile-common.h
> > @@ -160,6 +160,7 @@
> >   "pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0"\
> >   "testbootcmd=setenv boot_bank ${test_bank}; "   \
> >   "run ${subbootcmds}; reset\0"   \
> > + "env_version=1\0"   \
> >   ""
> 
> What is this? This change is not related with commit text ... or?
>

We need a variable so that the userspace knows that we have the new
values or not. We need to be compatible to older u-boot and in this case
we change in linux the u-boot variables. I will add a comment to the
commit message.
 
> >   #ifndef CONFIG_KM_DEF_ENV
> > diff --git a/include/configs/km/km-powerpc.h
> > b/include/configs/km/km-powerpc.h index fde8487178..267b124165
> 100644
> > --- a/include/configs/km/km-powerpc.h
> > +++ b/include/configs/km/km-powerpc.h
> > @@ -21,6 +21,9 @@
> >   /* Reserve 4 MB for malloc */
> >   #define CONFIG_SYS_MALLOC_LEN   (4 * 1024 * 1024)
> >
> > +/* Increase max size of compressed kernel */
> > +#define CONFIG_SYS_BOOTM_LEN (32 << 20)
> > +
> >
> /**
> 
> >* (PRAM usage)
> >* ... ---
> > @@ -53,6 +56,7 @@
> >   "protect on " __stringify(BOOTFLASH_START) "  +${filesize}\0"\
> >   "set_fdthigh=true\0"\
> >   "checkfdt=true\0"   \
> > + "bootm_mapsize=0x200\0" \
> >   ""
> 
> Couldn;t you use __stringify(CONFIG_SYS_BOOTM_LEN) ?
> 

good point, I'll change that.

Best regards
Holger



Re: [PATCH 1/2] km: adapt defines and variables for new memory layout

2020-10-07 Thread Heiko Schocher

Hello Holger,

Am 07.10.2020 um 17:06 schrieb Holger Brunck:

Due to increasing kernel image sizes we get problems when decompressing
the kernel image. To fix this we need to change the addresses where we
load and where we extract the kernel. Also we need to adapt the address
where to load the CRAMFS image and where to load the DTB file.
While a it also harmonize all boards for PPC and ARM to have the
same values.

Signed-off-by: Holger Brunck 
CC: Valentin Longchamp 
CC: Heiko Schocher 
CC: Tom Rini 
---
  board/keymile/Kconfig   | 12 +++-
  include/configs/km/keymile-common.h |  1 +
  include/configs/km/km-powerpc.h |  4 
  include/configs/km/km_arm.h |  3 +++
  4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/board/keymile/Kconfig b/board/keymile/Kconfig
index e20c017436..e5906906f3 100644
--- a/board/keymile/Kconfig
+++ b/board/keymile/Kconfig
@@ -37,26 +37,20 @@ config KM_RESERVED_PRAM
  
  config KM_CRAMFS_ADDR

hex "CRAMFS Address"
-   default 0x240 if ARCH_KIRKWOOD
-   default 0xC0 if MPC83xx
-   default 0x200 if MPC85xx
+   default 0x300
depends on !ARCH_SOCFPGA
help
  Start address of the CRAMFS containing the Linux kernel.
  
  config KM_KERNEL_ADDR

hex "Kernel Load Address"
-   default 0x200 if ARCH_KIRKWOOD
-   default 0x40 if MPC83xx
-   default 0x100 if MPC85xx || ARCH_SOCFPGA
+   default 0x200
help
  Address where to load Linux kernel in RAM.
  
  config KM_FDT_ADDR

hex "FDT Load Address"
-   default 0x23E if ARCH_KIRKWOOD || ARCH_SOCFPGA
-   default 0xB8 if MPC83xx
-   default 0x1F8 if MPC85xx
+   default 0x2FC
help
  Address where to load flattened device tree in RAM.
  
diff --git a/include/configs/km/keymile-common.h b/include/configs/km/keymile-common.h

index e9e3981060..6a8c41529f 100644
--- a/include/configs/km/keymile-common.h
+++ b/include/configs/km/keymile-common.h
@@ -160,6 +160,7 @@
"pnvramsize=" __stringify(CONFIG_KM_PNVRAM) "\0"\
"testbootcmd=setenv boot_bank ${test_bank}; " \
"run ${subbootcmds}; reset\0" \
+   "env_version=1\0" \
""


What is this? This change is not related with commit text ... or?


  #ifndef CONFIG_KM_DEF_ENV
diff --git a/include/configs/km/km-powerpc.h b/include/configs/km/km-powerpc.h
index fde8487178..267b124165 100644
--- a/include/configs/km/km-powerpc.h
+++ b/include/configs/km/km-powerpc.h
@@ -21,6 +21,9 @@
  /* Reserve 4 MB for malloc */
  #define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
  
+/* Increase max size of compressed kernel */

+#define CONFIG_SYS_BOOTM_LEN   (32 << 20)
+
  
/**
   * (PRAM usage)
   * ... ---
@@ -53,6 +56,7 @@
"protect on " __stringify(BOOTFLASH_START) "  +${filesize}\0"\
"set_fdthigh=true\0"  \
"checkfdt=true\0" \
+   "bootm_mapsize=0x200\0"   \
""


Couldn;t you use __stringify(CONFIG_SYS_BOOTM_LEN) ?

  
  #endif /* __CONFIG_KEYMILE_POWERPC_H */

diff --git a/include/configs/km/km_arm.h b/include/configs/km/km_arm.h
index 79edfa728a..98e0ce1c24 100644
--- a/include/configs/km/km_arm.h
+++ b/include/configs/km/km_arm.h
@@ -35,6 +35,9 @@
  /* Reserve 4 MB for malloc */
  #define CONFIG_SYS_MALLOC_LEN (4 * 1024 * 1024)
  
+/* Increase max size of compressed kernel */

+#define CONFIG_SYS_BOOTM_LEN   (32 << 20)
+
  #include "asm/arch/config.h"
  
  #define CONFIG_SYS_LOAD_ADDR	0x0080	/* default load adr- 8M */




bye,
Heiko
--
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: h...@denx.de