mpc83xx: fix the broken on the mpc83xx boards
cover mpc83xx: fix the broken on the mpc83xx boards
Hi,
Robert P. J. Day reported that the latest u-boot can't work on mpc8315erdb board. There are two bugs in the config of this board. This patch series tries to fix these two issue for all the mpc83xx boards. Only run test on mpc8315erdb board. Just build test for other boards.
Kevin Hao (2):
mpc83xx: fix the corruption of u-boot when saveenv
mpc83xx: make it bootable with the latest kernel
include/configs/MPC8308RDB.h | 3 ++- include/configs/MPC8313ERDB.h | 5 +++-- include/configs/MPC8315ERDB.h | 5 +++-- include/configs/MPC8323ERDB.h | 3 ++- include/configs/MPC832XEMDS.h | 3 ++- include/configs/MPC8349EMDS.h | 3 ++- include/configs/MPC8349ITX.h | 3 ++- include/configs/MPC837XEMDS.h | 3 ++- include/configs/MPC837XERDB.h | 3 ++- 9 files changed, 20 insertions(+), 11 deletions(-)
Signature · 1 line
2.8.1
PATCH 1/2 mpc83xx: fix the corruption of u-boot when saveenv
Robert P. J. Day has pointed that the value of SYS_MONITOR_LEN in MPC8315ERDB.h is smaller than the u-boot.bin. This will cause the overlap between the code of u-boot and the environment variable. So when executing saveenv, it will corrupt the code of u-boot and causes the board not boot. Fix this for all the mpc83xx boards by reserving a 512K area.
--- include/configs/MPC8308RDB.h | 2 +- include/configs/MPC8313ERDB.h | 2 +- include/configs/MPC8315ERDB.h | 2 +- include/configs/MPC8323ERDB.h | 2 +- include/configs/MPC832XEMDS.h | 2 +- include/configs/MPC8349EMDS.h | 2 +- include/configs/MPC8349ITX.h | 2 +- include/configs/MPC837XEMDS.h | 2 +- include/configs/MPC837XERDB.h | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-)
include/configs/MPC8308RDB.h +1 -1
@@ -203,7 +203,7 @@*/ #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_TEXT_BASE/* start of monitor */ -#define CONFIG_SYS_MONITOR_LEN (384 * 1024)/* Reserve 384 kB for Mon */ +#define CONFIG_SYS_MONITOR_LEN (512 * 1024)/* Reserve 512 kB for Mon */ #define CONFIG_SYS_MALLOC_LEN (512 * 1024)/* Reserved for malloc */ /*
include/configs/MPC8313ERDB.h +1 -1
@@ -241,7 +241,7 @@#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET/* CONFIG_SYS_MONITOR_LEN must be a multiple of CONFIG_ENV_SECT_SIZE */ -#define CONFIG_SYS_MONITOR_LEN (384 * 1024)/* Reserve 384 kB for Mon */ +#define CONFIG_SYS_MONITOR_LEN (512 * 1024)/* Reserve 512 kB for Mon */ #define CONFIG_SYS_MALLOC_LEN (512 * 1024)/* Reserved for malloc */ /*
include/configs/MPC8315ERDB.h +1 -1
@@ -169,7 +169,7 @@/* * The reserved memory */ -#define CONFIG_SYS_MONITOR_LEN (384 * 1024)/* Reserve 384 kB for Mon */ +#define CONFIG_SYS_MONITOR_LEN (512 * 1024)/* Reserve 512 kB for Mon */ #define CONFIG_SYS_MALLOC_LEN (512 * 1024)/* Reserved for malloc */ /*
include/configs/MPC8323ERDB.h +1 -1
@@ -156,7 +156,7 @@#endif /* CONFIG_SYS_MONITOR_LEN must be a multiple of CONFIG_ENV_SECT_SIZE */ -#define CONFIG_SYS_MONITOR_LEN (384 * 1024)/* Reserve 384 kB for Mon */ +#define CONFIG_SYS_MONITOR_LEN (512 * 1024)/* Reserve 512 kB for Mon */ #define CONFIG_SYS_MALLOC_LEN (256 * 1024)/* Reserved for malloc */ /*
include/configs/MPC832XEMDS.h +1 -1
@@ -168,7 +168,7 @@#endif /* CONFIG_SYS_MONITOR_LEN must be a multiple of CONFIG_ENV_SECT_SIZE */ -#define CONFIG_SYS_MONITOR_LEN (384 * 1024)/* Reserve 384 kB for Mon */ +#define CONFIG_SYS_MONITOR_LEN (512 * 1024)/* Reserve 512 kB for Mon */ #define CONFIG_SYS_MALLOC_LEN (256 * 1024)/* Reserved for malloc */ /*
include/configs/MPC8349EMDS.h +1 -1
@@ -225,7 +225,7 @@ (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET -#define CONFIG_SYS_MONITOR_LEN (384 * 1024)/* Reserve 384 kB for Mon */ +#define CONFIG_SYS_MONITOR_LEN (512 * 1024)/* Reserve 512 kB for Mon */ #define CONFIG_SYS_MALLOC_LEN (256 * 1024)/* Reserved for malloc */ /*
include/configs/MPC8349ITX.h +1 -1
@@ -330,7 +330,7 @@ boards, we say we have two, but don't display a message if we find only one. */#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_GBL_DATA_OFFSET/* CONFIG_SYS_MONITOR_LEN must be a multiple of CONFIG_ENV_SECT_SIZE */ -#define CONFIG_SYS_MONITOR_LEN (384 * 1024)/* Reserve 384 kB for Mon */ +#define CONFIG_SYS_MONITOR_LEN (512 * 1024)/* Reserve 512 kB for Mon */ #define CONFIG_SYS_MALLOC_LEN (256 * 1024)/* Reserved for malloc */ /*
include/configs/MPC837XEMDS.h +1 -1
@@ -200,7 +200,7 @@#endif /* CONFIG_SYS_MONITOR_LEN must be a multiple of CONFIG_ENV_SECT_SIZE */ -#define CONFIG_SYS_MONITOR_LEN (384 * 1024)/* Reserve 384 kB for Mon */ +#define CONFIG_SYS_MONITOR_LEN (512 * 1024)/* Reserve 512 kB for Mon */ #define CONFIG_SYS_MALLOC_LEN (512 * 1024)/* Reserved for malloc */ /*
include/configs/MPC837XERDB.h +1 -1
@@ -225,7 +225,7 @@#undef CONFIG_SYS_RAMBOOT#endif -#define CONFIG_SYS_MONITOR_LEN (384 * 1024)/* Reserve 384 kB for Mon */ +#define CONFIG_SYS_MONITOR_LEN (512 * 1024)/* Reserve 512 kB for Mon */ #define CONFIG_SYS_MALLOC_LEN (512 * 1024)/* Reserved for malloc */ /*
Signature · 1 line
2.8.1
PATCH 1/2 mpc83xx: fix the corruption of u-boot when saveenv
Quoted 9 lines · Kevin Hao
Robert P. J. Day has pointed that the value of
SYS_MONITOR_LENinMPC8315ERDB.his smaller than the u-boot.bin. This will cause the overlap between the code of u-boot and the environment variable. So when executing saveenv, it will corrupt the code of u-boot and causes the board not boot. Fix this for all the mpc83xx boards by reserving a 512K area.Reported-by Robert P. J. Day <[email protected]>Signed-off-by Kevin Hao <[email protected]>
Quoted 12 lines
--- include/configs/MPC8308RDB.h | 2 +- include/configs/MPC8313ERDB.h | 2 +- include/configs/MPC8315ERDB.h | 2 +- include/configs/MPC8323ERDB.h | 2 +- include/configs/MPC832XEMDS.h | 2 +- include/configs/MPC8349EMDS.h | 2 +- include/configs/MPC8349ITX.h | 2 +- include/configs/MPC837XEMDS.h | 2 +- include/configs/MPC837XERDB.h | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-)
I don't have any mpc83xx board to test the change. But it looks OK.
Sinan, do you have any comment for this and next patch in this set?
York
PATCH 1/2 mpc83xx: fix the corruption of u-boot when saveenv
Hi York
Quoted 23 lines · york sun
Quoted 9 lines · Kevin Hao
Robert P. J. Day has pointed that the value of
SYS_MONITOR_LENinMPC8315ERDB.his smaller than the u-boot.bin. This will cause the overlap between the code of u-boot and the environment variable. So when executing saveenv, it will corrupt the code of u-boot and causes the board not boot. Fix this for all the mpc83xx boards by reserving a 512K area.Reported-by Robert P. J. Day <[email protected]>Signed-off-by Kevin Hao <[email protected]>Quoted 12 lines
--- include/configs/MPC8308RDB.h | 2 +- include/configs/MPC8313ERDB.h | 2 +- include/configs/MPC8315ERDB.h | 2 +- include/configs/MPC8323ERDB.h | 2 +- include/configs/MPC832XEMDS.h | 2 +- include/configs/MPC8349EMDS.h | 2 +- include/configs/MPC8349ITX.h | 2 +- include/configs/MPC837XEMDS.h | 2 +- include/configs/MPC837XERDB.h | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-)
Quoted 3 lines
I don't have any mpc83xx board to test the change. But it looks OK.
Sinan, do you have any comment for this and next patch in this set?
I am travelling now but I could test several MPC83xx boards sometimes
next week if you prefer to wait for test. Otherwise the patch looks fine.
Regards
Sinan Akman
PATCH 2/2 mpc83xx: make it bootable with the latest kernel
In reply to Kevin HaoDue to the blow up of the latest kernel size, the default gnuzip size (8M) seems too small. The yocto kernel size I built for mpc8315erdb board is 5294393, and it can't be boot by using the latest u-boot. So expand gnuzip buffer for all the mpc83xx boards to fix this issue.
Robert P. J. Day also pointed that the kernel partition on the NAND flash is also too small, fix it at the same time.
--- include/configs/MPC8308RDB.h | 1 + include/configs/MPC8313ERDB.h | 3 ++- include/configs/MPC8315ERDB.h | 3 ++- include/configs/MPC8323ERDB.h | 1 + include/configs/MPC832XEMDS.h | 1 + include/configs/MPC8349EMDS.h | 1 + include/configs/MPC8349ITX.h | 1 + include/configs/MPC837XEMDS.h | 1 + include/configs/MPC837XERDB.h | 1 + 9 files changed, 11 insertions(+), 2 deletions(-)
include/configs/MPC8308RDB.h +1 -0
@@ -452,6 +452,7 @@* the maximum mapped by the Linux kernel during initialization. */ #define CONFIG_SYS_BOOTMAPSZ (256 << 20)/* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTM_LEN (64 << 20)/* Increase max gunzip size */ /* * Core HID Setup
include/configs/MPC8313ERDB.h +2 -1
@@ -268,7 +268,7 @@#define CONFIG_CMD_MTDPARTS #define MTDIDS_DEFAULT "nand0=e2800000.flash"#define MTDPARTS_DEFAULT \ - "mtdparts=e2800000.flash:512k(uboot),128k(env),3m at 1m(kernel),-(fs)" + "mtdparts=e2800000.flash:512k(uboot),128k(env),6m at 1m(kernel),-(fs)"#define CONFIG_SYS_MAX_NAND_DEVICE 1#define CONFIG_CMD_NAND 1
@@ -502,6 +502,7 @@*/ /* Initial Memory map for Linux*/ #define CONFIG_SYS_BOOTMAPSZ (256 << 20) +#define CONFIG_SYS_BOOTM_LEN (64 << 20)/* Increase max gunzip size */ #define CONFIG_SYS_RCWH_PCIHOST 0x80000000/* PCIHOST */
include/configs/MPC8315ERDB.h +2 -1
@@ -241,7 +241,7 @@#define CONFIG_CMD_MTDPARTS #define MTDIDS_DEFAULT "nand0=e0600000.flash"#define MTDPARTS_DEFAULT \ - "mtdparts=e0600000.flash:512k(uboot),128k(env),3m at 1m(kernel),-(fs)" + "mtdparts=e0600000.flash:512k(uboot),128k(env),6m@1m(kernel),-(fs)"#define CONFIG_SYS_MAX_NAND_DEVICE 1#define CONFIG_CMD_NAND 1
@@ -489,6 +489,7 @@* the maximum mapped by the Linux kernel during initialization. */ #define CONFIG_SYS_BOOTMAPSZ (256 << 20)/* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTM_LEN (64 << 20)/* Increase max gunzip size */ /* * Core HID Setup
include/configs/MPC8323ERDB.h +1 -0
@@ -359,6 +359,7 @@*/ /* Initial Memory map for Linux */ #define CONFIG_SYS_BOOTMAPSZ (256 << 20) +#define CONFIG_SYS_BOOTM_LEN (64 << 20)/* Increase max gunzip size */ /* * Core HID Setup
include/configs/MPC832XEMDS.h +1 -0
@@ -441,6 +441,7 @@*/ /* Initial Memory map for Linux */ #define CONFIG_SYS_BOOTMAPSZ (256 << 20) +#define CONFIG_SYS_BOOTM_LEN (64 << 20)/* Increase max gunzip size */ /* * Core HID Setup
include/configs/MPC8349EMDS.h +1 -0
@@ -508,6 +508,7 @@*/ /* Initial Memory map for Linux*/ #define CONFIG_SYS_BOOTMAPSZ (256 << 20) +#define CONFIG_SYS_BOOTM_LEN (64 << 20)/* Increase max gunzip size */ #define CONFIG_SYS_RCWH_PCIHOST 0x80000000/* PCIHOST */
include/configs/MPC8349ITX.h +1 -0
@@ -544,6 +544,7 @@ boards, we say we have two, but don't display a message if we find only one. */*/ /* Initial Memory map for Linux*/ #define CONFIG_SYS_BOOTMAPSZ (256 << 20) +#define CONFIG_SYS_BOOTM_LEN (64 << 20)/* Increase max gunzip size */ #define CONFIG_SYS_HRCW_LOW (\ HRCWL_LCL_BUS_TO_SCB_CLK_1X1 |\
include/configs/MPC837XEMDS.h +1 -0
@@ -522,6 +522,7 @@ extern int board_pci_host_broken(void);* the maximum mapped by the Linux kernel during initialization. */ #define CONFIG_SYS_BOOTMAPSZ (256 << 20)/* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTM_LEN (64 << 20)/* Increase max gunzip size */ /* * Core HID Setup
include/configs/MPC837XERDB.h +1 -0
@@ -533,6 +533,7 @@* the maximum mapped by the Linux kernel during initialization. */ #define CONFIG_SYS_BOOTMAPSZ (256 << 20)/* Initial Memory map for Linux */ +#define CONFIG_SYS_BOOTM_LEN (64 << 20)/* Increase max gunzip size */ /* * Core HID Setup
Signature · 1 line
2.8.1