Skip to contentSkip to conversation

mpc83xx: MPC8360ERDK: fix environment offset configuration bug

PATCH Superseded Anatolij Gustschin 2 participants 4 messages Apr 21, 2009 – Apr 23, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mpc83xx: MPC8360ERDK: fix environment offset configuration bug

The size of U-Boot binary for MPC8360ERDK increased (> 2 flash sectors now), so 'saveenv' will partially overwrite U-Boot in flash and will brick the board. This patch moves environment offset to fourth flash sector.

---
 include/configs/MPC8360ERDK.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/configs/MPC8360ERDK.h +1 -1
index f7ebdaa..1670809 100644
@@ -339,7 +339,7 @@
 
 #ifndef CONFIG_SYS_RAMBOOT
 #define CONFIG_ENV_IS_IN_FLASH	1
-#define CONFIG_ENV_ADDR		(CONFIG_SYS_MONITOR_BASE + 0x40000)
+#define CONFIG_ENV_ADDR		(CONFIG_SYS_MONITOR_BASE + 0x60000)
 #define CONFIG_ENV_SECT_SIZE	0x20000 /* 128K(one sector) for env */
 #define CONFIG_ENV_SIZE		0x20000
 #else /* CONFIG_SYS_RAMBOOT */
Signature · 1 line
1.5.3.3
#1 lore raw

PATCH 1/1 mpc83xx: MPC8360ERDK: fix environment offset configuration bug

include/configs/MPC8360ERDK.h line 342

Quoted 7 lines · On Tue, 21 Apr 2009 14:58:17 +0200 Anatolij Gustschin <[email protected]> wrote:

+++ b/include/configs/MPC8360ERDK.h

include/configs/MPC8360ERDK.h +1 -1
@@ -339,7 +339,7 @@
 
 #ifndef CONFIG_SYS_RAMBOOT
 #define CONFIG_ENV_IS_IN_FLASH	1
-#define CONFIG_ENV_ADDR		(CONFIG_SYS_MONITOR_BASE + 0x40000)
+#define CONFIG_ENV_ADDR		(CONFIG_SYS_MONITOR_BASE + 0x60000)

how about making it CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN, and incrementing the latter instead?

Kim

#2 lore raw

PATCH v2 1/1 mpc83xx: MPC8360ERDK: fix environment offset configuration bug

The size of U-Boot binary for MPC8360ERDK increased (> 2 flash sectors now), so 'saveenv' will partially overwrite U-Boot in flash and will brick the board. This patch moves environment offset to fourth flash sector and also fixes CONFIG_SYS_MONITOR_LEN.

---
Changes since first version:
do it correct by using CONFIG_SYS_MONITOR_LEN in offset calculation and also incrementing CONFIG_SYS_MONITOR_LEN as needed.

Kim, thanks for pointing this out!

 include/configs/MPC8360ERDK.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
include/configs/MPC8360ERDK.h +2 -2
index 11e75eb..deb92d2 100644
@@ -162,7 +162,7 @@
 #undef	CONFIG_SYS_RAMBOOT
 #endif
 
-#define CONFIG_SYS_MONITOR_LEN		(256 * 1024) /* Reserve 256 kB for Mon */
+#define CONFIG_SYS_MONITOR_LEN		(384 * 1024) /* Reserve 384 kB for Mon */
 #define CONFIG_SYS_MALLOC_LEN		(128 * 1024) /* Reserved for malloc */
 
 /*
@@ -354,7 +354,7 @@
 
 #ifndef CONFIG_SYS_RAMBOOT
 #define CONFIG_ENV_IS_IN_FLASH	1
-#define CONFIG_ENV_ADDR		(CONFIG_SYS_MONITOR_BASE + 0x40000)
+#define CONFIG_ENV_ADDR		(CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)
 #define CONFIG_ENV_SECT_SIZE	0x20000 /* 128K(one sector) for env */
 #define CONFIG_ENV_SIZE		0x20000
 #else /* CONFIG_SYS_RAMBOOT */
Signature · 1 line
1.5.3.3
Applied
#3 lore raw

PATCH v2 1/1 mpc83xx: MPC8360ERDK: fix environment offset configuration bug

Quoted 8 lines · On Thu, 23 Apr 2009 21:29:34 +0200 Anatolij Gustschin <[email protected]> wrote:

The size of U-Boot binary for MPC8360ERDK increased (> 2 flash sectors now), so 'saveenv' will partially overwrite U-Boot in flash and will brick the board. This patch moves environment offset to fourth flash sector and also fixes CONFIG_SYS_MONITOR_LEN.

---

applied, thanks.

Kim