[U-Boot] [PATCH v1] e300: increase CONFIG_SYS_BOOTMAPSZ to allow booting large kernels

Newer Linux kernels can overrun the initial memory window used for booting with their BSS area. When this happens, they overwrite the FDT and silently fail to boot.
On e300 CPUs, the Linux kernel uses an initial BAT covering the first 256MB of RAM. See arch/powerpc/kernel/head_32.S for details. Increase the value of CONFIG_SYS_BOOTMAPSZ to accommodate the maximum value allowed by Linux. This will allow very large kernels to boot.
Signed-off-by: Ira W. Snyder iws@ovro.caltech.edu ---
Wolfgang,
I did both mpc83xx and mpc51xx (CONFIG_E300) at the same time. There were fewer boards than I expected. A quick read through head_fsl_booke.S shows that CONFIG_E500 could be increased to 64MB. I'll leave that to that arch's maintainer. They have already increased theirs to 16MB, after finding this problem.
This patch doesn't attempt to add support for actually loading a kernel larger than 8MB uncompressed (code + data, but not bss). That would mean adding #define CONFIG_SYS_BOOTM_LEN SOME_VALUE_GREATER_THAN_8MB.
This boots up fine on my MPC8349EMDS.
Thanks, Ira
include/configs/MPC8308RDB.h | 4 ++-- include/configs/MPC8313ERDB.h | 4 ++-- include/configs/MPC8315ERDB.h | 4 ++-- include/configs/MPC8323ERDB.h | 4 ++-- include/configs/MPC832XEMDS.h | 4 ++-- include/configs/MPC8349EMDS.h | 4 ++-- include/configs/MPC8349ITX.h | 4 ++-- include/configs/MPC8360EMDS.h | 4 ++-- include/configs/MPC8360ERDK.h | 4 ++-- include/configs/MPC837XEMDS.h | 4 ++-- include/configs/MPC837XERDB.h | 4 ++-- include/configs/MVBLM7.h | 4 ++-- include/configs/SIMPC8313.h | 4 ++-- include/configs/TQM834x.h | 4 ++-- include/configs/aria.h | 4 ++-- include/configs/kmeter1.h | 4 ++-- include/configs/mecp5123.h | 4 ++-- include/configs/mpc5121ads.h | 4 ++-- include/configs/pdm360ng.h | 4 ++-- include/configs/sbc8349.h | 4 ++-- include/configs/ve8313.h | 4 ++-- include/configs/vme8349.h | 4 ++-- 22 files changed, 44 insertions(+), 44 deletions(-)
diff --git a/include/configs/MPC8308RDB.h b/include/configs/MPC8308RDB.h index 6cd5da7..ccbe034 100644 --- a/include/configs/MPC8308RDB.h +++ b/include/configs/MPC8308RDB.h @@ -439,10 +439,10 @@
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Initial Memory map for Linux */
/* * Core HID Setup diff --git a/include/configs/MPC8313ERDB.h b/include/configs/MPC8313ERDB.h index 524afa5..df330e3 100644 --- a/include/configs/MPC8313ERDB.h +++ b/include/configs/MPC8313ERDB.h @@ -453,10 +453,10 @@
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux*/ +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Initial Memory map for Linux*/
#define CONFIG_SYS_RCWH_PCIHOST 0x80000000 /* PCIHOST */
diff --git a/include/configs/MPC8315ERDB.h b/include/configs/MPC8315ERDB.h index f1b110b..edc4799 100644 --- a/include/configs/MPC8315ERDB.h +++ b/include/configs/MPC8315ERDB.h @@ -529,10 +529,10 @@
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Initial Memory map for Linux */
/* * Core HID Setup diff --git a/include/configs/MPC8323ERDB.h b/include/configs/MPC8323ERDB.h index 9a296a1..2b5c76f 100644 --- a/include/configs/MPC8323ERDB.h +++ b/include/configs/MPC8323ERDB.h @@ -430,10 +430,10 @@
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Initial Memory map for Linux */
/* * Core HID Setup diff --git a/include/configs/MPC832XEMDS.h b/include/configs/MPC832XEMDS.h index 68ff191..d8b5a74 100644 --- a/include/configs/MPC832XEMDS.h +++ b/include/configs/MPC832XEMDS.h @@ -447,10 +447,10 @@
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Initial Memory map for Linux */
/* * Core HID Setup diff --git a/include/configs/MPC8349EMDS.h b/include/configs/MPC8349EMDS.h index 73dbea4..69fb115 100644 --- a/include/configs/MPC8349EMDS.h +++ b/include/configs/MPC8349EMDS.h @@ -496,10 +496,10 @@
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux*/ +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Initial Memory map for Linux*/
#define CONFIG_SYS_RCWH_PCIHOST 0x80000000 /* PCIHOST */
diff --git a/include/configs/MPC8349ITX.h b/include/configs/MPC8349ITX.h index 9be571f..cd5a77a 100644 --- a/include/configs/MPC8349ITX.h +++ b/include/configs/MPC8349ITX.h @@ -539,10 +539,10 @@ boards, we say we have two, but don't display a message if we find only one. */
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux*/ +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Initial Memory map for Linux*/
#define CONFIG_SYS_HRCW_LOW (\ HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\ diff --git a/include/configs/MPC8360EMDS.h b/include/configs/MPC8360EMDS.h index c58e003..26bd0ec 100644 --- a/include/configs/MPC8360EMDS.h +++ b/include/configs/MPC8360EMDS.h @@ -487,10 +487,10 @@
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Initial Memory map for Linux */
/* * Core HID Setup diff --git a/include/configs/MPC8360ERDK.h b/include/configs/MPC8360ERDK.h index 9fa577d..f205606 100644 --- a/include/configs/MPC8360ERDK.h +++ b/include/configs/MPC8360ERDK.h @@ -404,10 +404,10 @@
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Initial Memory map for Linux */
/* * Core HID Setup diff --git a/include/configs/MPC837XEMDS.h b/include/configs/MPC837XEMDS.h index 9092755..a2e2369 100644 --- a/include/configs/MPC837XEMDS.h +++ b/include/configs/MPC837XEMDS.h @@ -537,10 +537,10 @@ extern int board_pci_host_broken(void);
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Initial Memory map for Linux */
/* * Core HID Setup diff --git a/include/configs/MPC837XERDB.h b/include/configs/MPC837XERDB.h index 79dadc4..7fa3284 100644 --- a/include/configs/MPC837XERDB.h +++ b/include/configs/MPC837XERDB.h @@ -545,10 +545,10 @@
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Initial Memory map for Linux */
/* * Core HID Setup diff --git a/include/configs/MVBLM7.h b/include/configs/MVBLM7.h index c28eb64..c0e015a 100644 --- a/include/configs/MVBLM7.h +++ b/include/configs/MVBLM7.h @@ -300,10 +300,10 @@
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux*/ +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Initial Memory map for Linux*/
#define CONFIG_SYS_HRCW_LOW 0x0 #define CONFIG_SYS_HRCW_HIGH 0x0 diff --git a/include/configs/SIMPC8313.h b/include/configs/SIMPC8313.h index 70b7489..9c8c318 100644 --- a/include/configs/SIMPC8313.h +++ b/include/configs/SIMPC8313.h @@ -373,10 +373,10 @@
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux*/ +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Initial Memory map for Linux*/
#define CONFIG_SYS_RCWH_PCIHOST 0x80000000 /* PCIHOST */
diff --git a/include/configs/TQM834x.h b/include/configs/TQM834x.h index c1e0e64..49e1eb1 100644 --- a/include/configs/TQM834x.h +++ b/include/configs/TQM834x.h @@ -359,10 +359,10 @@ extern int tqm834x_num_flash_banks;
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux*/ +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Initial Memory map for Linux*/
#define CONFIG_SYS_HRCW_LOW (\ HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\ diff --git a/include/configs/aria.h b/include/configs/aria.h index c5f9cc1..5703506 100644 --- a/include/configs/aria.h +++ b/include/configs/aria.h @@ -507,10 +507,10 @@
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) +#define CONFIG_SYS_BOOTMAPSZ (256 << 20)
/* Cache Configuration */ #define CONFIG_SYS_DCACHE_SIZE 32768 diff --git a/include/configs/kmeter1.h b/include/configs/kmeter1.h index f7d36b1..519245a 100644 --- a/include/configs/kmeter1.h +++ b/include/configs/kmeter1.h @@ -358,10 +358,10 @@
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Initial Memory map for Linux */
/* * Core HID Setup diff --git a/include/configs/mecp5123.h b/include/configs/mecp5123.h index 92c4f5f..9d8e716 100644 --- a/include/configs/mecp5123.h +++ b/include/configs/mecp5123.h @@ -344,10 +344,10 @@
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Linux initial memory map */ +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Linux initial memory map */
/* Cache Configuration */ #define CONFIG_SYS_DCACHE_SIZE 32768 diff --git a/include/configs/mpc5121ads.h b/include/configs/mpc5121ads.h index 5281042..8d4f997 100644 --- a/include/configs/mpc5121ads.h +++ b/include/configs/mpc5121ads.h @@ -477,10 +477,10 @@
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux*/ +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Initial Memory map for Linux*/
/* Cache Configuration */ #define CONFIG_SYS_DCACHE_SIZE 32768 diff --git a/include/configs/pdm360ng.h b/include/configs/pdm360ng.h index 718abdf..f073fcd 100644 --- a/include/configs/pdm360ng.h +++ b/include/configs/pdm360ng.h @@ -412,11 +412,11 @@
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ /* Initial Memory map for Linux */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) +#define CONFIG_SYS_BOOTMAPSZ (256 << 20)
/* Cache Configuration */ #define CONFIG_SYS_DCACHE_SIZE 32768 diff --git a/include/configs/sbc8349.h b/include/configs/sbc8349.h index deaddde..691e825 100644 --- a/include/configs/sbc8349.h +++ b/include/configs/sbc8349.h @@ -465,10 +465,10 @@
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux*/ +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Initial Memory map for Linux*/
#define CONFIG_SYS_RCWH_PCIHOST 0x80000000 /* PCIHOST */
diff --git a/include/configs/ve8313.h b/include/configs/ve8313.h index 56d24f9..45976db 100644 --- a/include/configs/ve8313.h +++ b/include/configs/ve8313.h @@ -366,10 +366,10 @@
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Initial Memory map for Linux*/ +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Initial Memory map for Linux*/
/* 0x64050000 */ #define CONFIG_SYS_HRCW_LOW (\ diff --git a/include/configs/vme8349.h b/include/configs/vme8349.h index f493e75..f6ccc0f 100644 --- a/include/configs/vme8349.h +++ b/include/configs/vme8349.h @@ -402,10 +402,10 @@
/* * For booting Linux, the board info and command line data - * have to be in the first 8 MB of memory, since this is + * have to be in the first 256 MB of memory, since this is * the maximum mapped by the Linux kernel during initialization. */ -#define CONFIG_SYS_BOOTMAPSZ (8 << 20) /* Init Memory map for Linux*/ +#define CONFIG_SYS_BOOTMAPSZ (256 << 20) /* Init Memory map for Linux*/
#define CONFIG_SYS_RCWH_PCIHOST 0x80000000 /* PCIHOST */

On Fri, Sep 10, 2010 at 03:42:32PM -0700, Ira W. Snyder wrote:
Newer Linux kernels can overrun the initial memory window used for booting with their BSS area. When this happens, they overwrite the FDT and silently fail to boot.
On e300 CPUs, the Linux kernel uses an initial BAT covering the first 256MB of RAM. See arch/powerpc/kernel/head_32.S for details. Increase the value of CONFIG_SYS_BOOTMAPSZ to accommodate the maximum value allowed by Linux. This will allow very large kernels to boot.
Signed-off-by: Ira W. Snyder iws@ovro.caltech.edu
Wolfgang,
I did both mpc83xx and mpc51xx (CONFIG_E300) at the same time. There were fewer boards than I expected. A quick read through head_fsl_booke.S shows that CONFIG_E500 could be increased to 64MB. I'll leave that to that arch's maintainer. They have already increased theirs to 16MB, after finding this problem.
This patch doesn't attempt to add support for actually loading a kernel larger than 8MB uncompressed (code + data, but not bss). That would mean adding #define CONFIG_SYS_BOOTM_LEN SOME_VALUE_GREATER_THAN_8MB.
This boots up fine on my MPC8349EMDS.
Sorry about forgetting to CC maintainers before. I've added the 83xx and 5xxx maintainers, Kim and Wolfgang respectively. Is there anything I should do to help this patch into mainline. I haven't heard anything for about a week.
Thanks, Ira

On Fri, 10 Sep 2010 15:42:32 -0700 "Ira W. Snyder" iws@ovro.caltech.edu wrote:
Newer Linux kernels can overrun the initial memory window used for booting with their BSS area. When this happens, they overwrite the FDT and silently fail to boot.
On e300 CPUs, the Linux kernel uses an initial BAT covering the first 256MB of RAM. See arch/powerpc/kernel/head_32.S for details. Increase the value of CONFIG_SYS_BOOTMAPSZ to accommodate the maximum value allowed by Linux. This will allow very large kernels to boot.
Signed-off-by: Ira W. Snyder iws@ovro.caltech.edu
Wolfgang,
I did both mpc83xx and mpc51xx (CONFIG_E300) at the same time. There were fewer boards than I expected. A quick read through head_fsl_booke.S shows that CONFIG_E500 could be increased to 64MB. I'll leave that to that arch's maintainer. They have already increased theirs to 16MB, after finding this problem.
This patch doesn't attempt to add support for actually loading a kernel larger than 8MB uncompressed (code + data, but not bss). That would mean adding #define CONFIG_SYS_BOOTM_LEN SOME_VALUE_GREATER_THAN_8MB.
This boots up fine on my MPC8349EMDS.
Thanks, Ira
include/configs/MPC8308RDB.h | 4 ++-- include/configs/MPC8313ERDB.h | 4 ++-- include/configs/MPC8315ERDB.h | 4 ++-- include/configs/MPC8323ERDB.h | 4 ++-- include/configs/MPC832XEMDS.h | 4 ++-- include/configs/MPC8349EMDS.h | 4 ++-- include/configs/MPC8349ITX.h | 4 ++-- include/configs/MPC8360EMDS.h | 4 ++-- include/configs/MPC8360ERDK.h | 4 ++-- include/configs/MPC837XEMDS.h | 4 ++-- include/configs/MPC837XERDB.h | 4 ++-- include/configs/MVBLM7.h | 4 ++-- include/configs/SIMPC8313.h | 4 ++-- include/configs/TQM834x.h | 4 ++-- include/configs/aria.h | 4 ++-- include/configs/kmeter1.h | 4 ++-- include/configs/mecp5123.h | 4 ++-- include/configs/mpc5121ads.h | 4 ++-- include/configs/pdm360ng.h | 4 ++-- include/configs/sbc8349.h | 4 ++-- include/configs/ve8313.h | 4 ++-- include/configs/vme8349.h | 4 ++-- 22 files changed, 44 insertions(+), 44 deletions(-)
applied to u-boot-mpc83xx/next. Wolfgang, hope you don't mind.
Thanks,
Kim

Dear Kim Phillips,
In message 20100922155855.7146f5df.kim.phillips@freescale.com you wrote:
applied to u-boot-mpc83xx/next. Wolfgang, hope you don't mind.
Thanks, that's fine with me.
Best regards,
Wolfgang Denk
participants (3)
-
Ira W. Snyder
-
Kim Phillips
-
Wolfgang Denk