diff mbox series

[U-Boot,v4,13/16] board: MCR3000: Use smaller flash sector for environment

Message ID 3e5affc1d501df8ece5bdb8c373b637dcf246b99.1521215903.git.christophe.leroy@c-s.fr
State Accepted
Commit 0fb62205652a1327eb79ea1c84649493e7f628fa
Delegated to: Tom Rini
Headers show
Series Powerpc: mpc8xx: cleanup before migration to DM model | expand

Commit Message

Christophe Leroy March 16, 2018, 4:20 p.m. UTC
Latest versions of u-boot have increased in size and require more
than the 256kb allocated to it.

The MCR3000 board is equipped with an AM29LV160DB boot flash which
is organised as follows:
- One 16kb block
- Two 8kb block
- One 32kb block
- Thirty one 64kb blocks

At the time being, u-boot is a single piece occupying the 256 first
kbytes, then the environment is stored in the following 64kb block

The environment being quite tiny, we save one 64kb block by embedding
the environment in the first 8kb block, hence allowing to increase
the monitor size to 320kb.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
---
 board/cssi/MCR3000/u-boot.lds | 6 +++---
 include/configs/MCR3000.h     | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

Comments

Tom Rini April 6, 2018, 9:03 p.m. UTC | #1
On Fri, Mar 16, 2018 at 05:20:55PM +0100, Christophe Leroy wrote:

> Latest versions of u-boot have increased in size and require more
> than the 256kb allocated to it.
> 
> The MCR3000 board is equipped with an AM29LV160DB boot flash which
> is organised as follows:
> - One 16kb block
> - Two 8kb block
> - One 32kb block
> - Thirty one 64kb blocks
> 
> At the time being, u-boot is a single piece occupying the 256 first
> kbytes, then the environment is stored in the following 64kb block
> 
> The environment being quite tiny, we save one 64kb block by embedding
> the environment in the first 8kb block, hence allowing to increase
> the monitor size to 320kb.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/board/cssi/MCR3000/u-boot.lds b/board/cssi/MCR3000/u-boot.lds
index cd042ca0ce4..990cca4ebb6 100644
--- a/board/cssi/MCR3000/u-boot.lds
+++ b/board/cssi/MCR3000/u-boot.lds
@@ -18,14 +18,14 @@  SECTIONS
 	.text          :
 	{
 		arch/powerpc/cpu/mpc8xx/start.o	(.text)
-		arch/powerpc/cpu/mpc8xx/start.o	(.text*)
 		arch/powerpc/cpu/mpc8xx/traps.o	(.text*)
-		arch/powerpc/cpu/mpc8xx/built-in.o	(.text*)
 		arch/powerpc/lib/built-in.o		(.text*)
 		board/cssi/MCR3000/built-in.o	(.text*)
-		disk/built-in.o			(.text*)
 		drivers/net/built-in.o		(.text*)
 
+		. = DEFINED(env_offset) ? env_offset : .;
+		env/embedded.o			(.text.environment)
+
 		*(.text)
 	}
 	_etext = .;
diff --git a/include/configs/MCR3000.h b/include/configs/MCR3000.h
index 7e9fe3800da..cb28d6522ab 100644
--- a/include/configs/MCR3000.h
+++ b/include/configs/MCR3000.h
@@ -93,15 +93,15 @@ 
  * the maximum mapped by the Linux kernel during initialization.
  */
 #define	CONFIG_SYS_BOOTMAPSZ		(8 << 20)
-#define	CONFIG_SYS_MONITOR_LEN		(256 << 10)
+#define	CONFIG_SYS_MONITOR_LEN		(320 << 10)
 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_MALLOC_LEN		(4096 << 10)
 
 /* Environment Configuration */
 
 /* environment is in FLASH */
-#define CONFIG_ENV_SECT_SIZE	(64 * 1024)
-#define CONFIG_ENV_OFFSET	CONFIG_SYS_MONITOR_LEN
+#define CONFIG_ENV_SECT_SIZE	0x2000
+#define CONFIG_ENV_OFFSET	0x4000
 #define CONFIG_ENV_OVERWRITE	1
 
 /* Ethernet configuration part */