[U-Boot,v3b,15/15] board: MCR3000: Use smaller flash sector for environment
diff mbox series

Message ID 95159e6c8bbb232e98f6332fd839531b05cd420b-1.1520334961.git.christophe.leroy@c-s.fr
State Deferred
Delegated to: Tom Rini
Headers show
Series
  • Untitled series #32166
Related show

Commit Message

Christophe Leroy March 6, 2018, 12:33 p.m. UTC
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 320 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.

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

Comments

Christophe Leroy March 6, 2018, 12:37 p.m. UTC | #1
Le 06/03/2018 à 13:33, Christophe Leroy a écrit :
> 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 320 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.
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

Note that it superceeds https://patchwork.ozlabs.org/patch/882041/

Sorry for the mistake :(

Christophe

> ---
>   board/cssi/MCR3000/u-boot.lds | 6 +++---
>   include/configs/MCR3000.h     | 8 ++++----
>   2 files changed, 7 insertions(+), 7 deletions(-)
> 
> 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 ada009e5da4..2b49f97e091 100644
> --- a/include/configs/MCR3000.h
> +++ b/include/configs/MCR3000.h
> @@ -24,7 +24,7 @@
>   		"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:"	\
>   		"mcr3k:eth0:off;"					\
>   		"${ofl_args}; "						\
> -		"bootm 0x04070000 - 0x04060000\0"			\
> +		"bootm 0x04060000 - 0x04050000\0"			\
>   	"tftpboot=setenv bootargs "					\
>   		"${console_args} "					\
>   		"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:"	\
> @@ -45,7 +45,7 @@
>   		"${console_args} "					\
>   		"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:"	\
>   		"mcr3k:eth0:off;"					\
> -		"bootm 0x04070000 - 0x04060000\0"			\
> +		"bootm 0x04060000 - 0x04050000\0"			\
>   	"dhcpboot=dhcp ${loadaddr} ${filename};"			\
>   		"tftp 0xf00000 mcr3000.dtb;"				\
>   		"setenv bootargs "					\
> @@ -102,8 +102,8 @@
>   /* 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 */
>

Patch
diff mbox series

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 ada009e5da4..2b49f97e091 100644
--- a/include/configs/MCR3000.h
+++ b/include/configs/MCR3000.h
@@ -24,7 +24,7 @@ 
 		"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:"	\
 		"mcr3k:eth0:off;"					\
 		"${ofl_args}; "						\
-		"bootm 0x04070000 - 0x04060000\0"			\
+		"bootm 0x04060000 - 0x04050000\0"			\
 	"tftpboot=setenv bootargs "					\
 		"${console_args} "					\
 		"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:"	\
@@ -45,7 +45,7 @@ 
 		"${console_args} "					\
 		"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:"	\
 		"mcr3k:eth0:off;"					\
-		"bootm 0x04070000 - 0x04060000\0"			\
+		"bootm 0x04060000 - 0x04050000\0"			\
 	"dhcpboot=dhcp ${loadaddr} ${filename};"			\
 		"tftp 0xf00000 mcr3000.dtb;"				\
 		"setenv bootargs "					\
@@ -102,8 +102,8 @@ 
 /* 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 */