Skip to contentSkip to conversation

e300: increase CONFIG_SYS_BOOTMAPSZ to allow booting large kernels

PATCH New Ira W. Snyder 3 participants 4 messages Sep 10, 2010 – Sep 22, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

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(-)
include/configs/MPC8308RDB.h +2 -2
index 6cd5da7..ccbe034 100644
@@ -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
include/configs/MPC8313ERDB.h +2 -2
index 524afa5..df330e3 100644
@@ -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  */
 
include/configs/MPC8315ERDB.h +2 -2
index f1b110b..edc4799 100644
@@ -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
include/configs/MPC8323ERDB.h +2 -2
index 9a296a1..2b5c76f 100644
@@ -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
include/configs/MPC832XEMDS.h +2 -2
index 68ff191..d8b5a74 100644
@@ -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
include/configs/MPC8349EMDS.h +2 -2
index 73dbea4..69fb115 100644
@@ -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  */
 
include/configs/MPC8349ITX.h +2 -2
index 9be571f..cd5a77a 100644
@@ -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 |\
include/configs/MPC8360EMDS.h +2 -2
index c58e003..26bd0ec 100644
@@ -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
include/configs/MPC8360ERDK.h +2 -2
index 9fa577d..f205606 100644
@@ -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
include/configs/MPC837XEMDS.h +2 -2
index 9092755..a2e2369 100644
@@ -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
include/configs/MPC837XERDB.h +2 -2
index 79dadc4..7fa3284 100644
@@ -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
include/configs/MVBLM7.h +2 -2
index c28eb64..c0e015a 100644
@@ -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
include/configs/SIMPC8313.h +2 -2
index 70b7489..9c8c318 100644
@@ -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 */
 
include/configs/TQM834x.h +2 -2
index c1e0e64..49e1eb1 100644
@@ -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 |\
include/configs/aria.h +2 -2
index c5f9cc1..5703506 100644
@@ -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
include/configs/kmeter1.h +2 -2
index f7d36b1..519245a 100644
@@ -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
include/configs/mecp5123.h +2 -2
index 92c4f5f..9d8e716 100644
@@ -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
include/configs/mpc5121ads.h +2 -2
index 5281042..8d4f997 100644
@@ -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
include/configs/pdm360ng.h +2 -2
index 718abdf..f073fcd 100644
@@ -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
include/configs/sbc8349.h +2 -2
index deaddde..691e825 100644
@@ -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  */
 
include/configs/ve8313.h +2 -2
index 56d24f9..45976db 100644
@@ -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 (\
include/configs/vme8349.h +2 -2
index f493e75..f6ccc0f 100644
@@ -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  */
 
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 e300: increase CONFIG_SYS_BOOTMAPSZ to allow booting large kernels

Quoted 20 lines · Ira W. Snyder

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.

---

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.

Quoted 6 lines

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

#2 lore raw

PATCH 1/1 e300: increase CONFIG_SYS_BOOTMAPSZ to allow booting large kernels

In reply to Ira W. Snyder
Quoted 44 lines · On Fri, 10 Sep 2010 15:42:32 -0700 "Ira W. Snyder" <[email protected]> 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.

---

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 ++--
Quoted 8 lines
 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

#3 lore raw

PATCH 1/1 e300: increase CONFIG_SYS_BOOTMAPSZ to allow booting large kernels

Dear Kim Phillips,

Quoted 2 lines · In message <[email protected]> you wrote:

applied to u-boot-mpc83xx/next. Wolfgang, hope you don't mind.

Thanks, that's fine with me.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"No matter where you go, there you are..."          - Buckaroo Banzai