diff mbox

[U-Boot,v2] Change kernel address in dataflash to match u-boot's size

Message ID 1327873072-11844-1-git-send-email-alexandre.belloni@piout.net
State Superseded
Headers show

Commit Message

Alexandre Belloni Jan. 29, 2012, 9:37 p.m. UTC
On at91sam platforms, u-boot grew larger than the allocated size in
dataflash, the layout was:
bootstrap  0x00000000
ubootenv   0x00004200
uboot      0x00008400
kernel     0x00042000

u-boot with the defconfig doesn't seem to fit in 0x42000 - 0x8400 =
0x39C00 bytes anymore.

Now, the layout is:
bootstrap  0x00000000
uboot      0x00004000
ubootenv   0x00084000
ubootenv2  0x00088000
kernel     0x0008C000

Signed-off-by: Alexandre Belloni <alexandre.belloni@piout.net>
---
 include/configs/at91sam9260ek.h |   18 ++++++++++++------
 include/configs/at91sam9261ek.h |   18 ++++++++++++------
 include/configs/at91sam9263ek.h |   10 +++++++---
 include/configs/at91sam9rlek.h  |   10 +++++++---
 4 files changed, 38 insertions(+), 18 deletions(-)

Comments

Albert ARIBAUD Feb. 18, 2012, 3:13 p.m. UTC | #1
Le 29/01/2012 22:37, Alexandre Belloni a écrit :
> On at91sam platforms, u-boot grew larger than the allocated size in
> dataflash, the layout was:
> bootstrap  0x00000000
> ubootenv   0x00004200
> uboot      0x00008400
> kernel     0x00042000
>
> u-boot with the defconfig doesn't seem to fit in 0x42000 - 0x8400 =
> 0x39C00 bytes anymore.
>
> Now, the layout is:
> bootstrap  0x00000000
> uboot      0x00004000
> ubootenv   0x00084000
> ubootenv2  0x00088000
> kernel     0x0008C000
>
> Signed-off-by: Alexandre Belloni<alexandre.belloni@piout.net>

Please prefix patch title/summary with "at91:" or better yet, with the 
involved boards' names.

Amicalement,
Albert ARIBAUD Feb. 18, 2012, 4:21 p.m. UTC | #2
Hi again Alexandre,

Le 18/02/2012 16:13, Albert ARIBAUD a écrit :
> Le 29/01/2012 22:37, Alexandre Belloni a écrit :
>> On at91sam platforms, u-boot grew larger than the allocated size in
>> dataflash, the layout was:
>> bootstrap 0x00000000
>> ubootenv 0x00004200
>> uboot 0x00008400
>> kernel 0x00042000
>>
>> u-boot with the defconfig doesn't seem to fit in 0x42000 - 0x8400 =
>> 0x39C00 bytes anymore.
>>
>> Now, the layout is:
>> bootstrap 0x00000000
>> uboot 0x00004000
>> ubootenv 0x00084000
>> ubootenv2 0x00088000
>> kernel 0x0008C000
>>
>> Signed-off-by: Alexandre Belloni<alexandre.belloni@piout.net>
>
> Please prefix patch title/summary with "at91:" or better yet, with the
> involved boards' names.

Also, doesn't this overallocate for U-Boot and seriously reduce the 
space available for Linux in Flash?

Amicalement,
Alexandre Belloni Feb. 20, 2012, 10:40 a.m. UTC | #3
Hi,

On Sat, Feb 18, 2012 at 05:21:46PM +0100, Albert ARIBAUD wrote :
> Also, doesn't this overallocate for U-Boot and seriously reduce the
> space available for Linux in Flash?
> 

I did so on Marek's recommendation. Right now, u-boot's size for
AT91SAM9261EK is 235kB. I guess we can allocate a bit less.

My board has 8MB of dataflash, I couldn't find what size is available on
other evaluation kits...

Regards,
Albert ARIBAUD Feb. 20, 2012, 10:46 a.m. UTC | #4
Hi Alexandre,

Le 20/02/2012 11:40, Alexandre Belloni a écrit :
> Hi,
>
> On Sat, Feb 18, 2012 at 05:21:46PM +0100, Albert ARIBAUD wrote :
>> Also, doesn't this overallocate for U-Boot and seriously reduce the
>> space available for Linux in Flash?
>>
>
> I did so on Marek's recommendation. Right now, u-boot's size for
> AT91SAM9261EK is 235kB. I guess we can allocate a bit less.
>
> My board has 8MB of dataflash, I couldn't find what size is available on
> other evaluation kits...

Hmm... With 8MByte FLASH the proposed mapping leaves 7+ MB for the 
flashed kernel, which should be enough :) so that's ok.

> Regards,

Amicalement,
Alexandre Belloni Feb. 20, 2012, 12:51 p.m. UTC | #5
On Mon, Feb 20, 2012 at 11:46:58AM +0100, Albert ARIBAUD wrote :
> Hmm... With 8MByte FLASH the proposed mapping leaves 7+ MB for the
> flashed kernel, which should be enough :) so that's ok.
> 

Ok then, I just prefixed the patch title with AT91SAM9*:

Regards,
diff mbox

Patch

diff --git a/include/configs/at91sam9260ek.h b/include/configs/at91sam9260ek.h
index db52ee6..b537760 100644
--- a/include/configs/at91sam9260ek.h
+++ b/include/configs/at91sam9260ek.h
@@ -185,10 +185,12 @@ 
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */
 #define CONFIG_ENV_IS_IN_DATAFLASH	1
 #define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 0x8400)
-#define CONFIG_ENV_OFFSET		0x4200
+#define CONFIG_ENV_OFFSET		0x84000
 #define CONFIG_ENV_ADDR		(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + CONFIG_ENV_OFFSET)
-#define CONFIG_ENV_SIZE		0x4200
-#define CONFIG_BOOTCOMMAND	"cp.b 0xC0042000 0x22000000 0x210000; bootm"
+#define CONFIG_ENV_SIZE		0x4000
+#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR+CONFIG_ENV_SIZE)
+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+#define CONFIG_BOOTCOMMAND	"cp.b 0xC008C000 0x22000000 0x210000; bootm"
 #define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
 				"root=/dev/mtdblock0 "			\
 				"mtdparts=atmel_nand:-(root) "		\
@@ -199,10 +201,12 @@ 
 /* bootstrap + u-boot + env + linux in dataflash on CS1 */
 #define CONFIG_ENV_IS_IN_DATAFLASH	1
 #define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + 0x8400)
-#define CONFIG_ENV_OFFSET		0x4200
+#define CONFIG_ENV_OFFSET		0x84000
 #define CONFIG_ENV_ADDR		(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + CONFIG_ENV_OFFSET)
-#define CONFIG_ENV_SIZE		0x4200
-#define CONFIG_BOOTCOMMAND	"cp.b 0xD0042000 0x22000000 0x210000; bootm"
+#define CONFIG_ENV_SIZE		0x4000
+#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR+CONFIG_ENV_SIZE)
+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+#define CONFIG_BOOTCOMMAND	"cp.b 0xD008C000 0x22000000 0x210000; bootm"
 #define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
 				"root=/dev/mtdblock0 "			\
 				"mtdparts=atmel_nand:-(root) "		\
@@ -231,6 +235,8 @@ 
 #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_LONGHELP		1
 #define CONFIG_CMDLINE_EDITING	1
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
 
 /*
  * Size of malloc() pool
diff --git a/include/configs/at91sam9261ek.h b/include/configs/at91sam9261ek.h
index 5140b26..fa461da 100644
--- a/include/configs/at91sam9261ek.h
+++ b/include/configs/at91sam9261ek.h
@@ -187,10 +187,12 @@ 
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */
 #define CONFIG_ENV_IS_IN_DATAFLASH
 #define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 0x8400)
-#define CONFIG_ENV_OFFSET	0x4200
+#define CONFIG_ENV_OFFSET	0x84000
 #define CONFIG_ENV_ADDR		(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + CONFIG_ENV_OFFSET)
-#define CONFIG_ENV_SIZE		0x4200
-#define CONFIG_BOOTCOMMAND	"cp.b 0xC0042000 0x22000000 0x210000; bootm"
+#define CONFIG_ENV_SIZE		0x4000
+#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR+CONFIG_ENV_SIZE)
+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+#define CONFIG_BOOTCOMMAND	"cp.b 0xC008C000 0x22000000 0x210000; bootm"
 #define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
 				"root=/dev/mtdblock0 "			\
 				"mtdparts=atmel_nand:-(root) "		\
@@ -201,10 +203,12 @@ 
 /* bootstrap + u-boot + env + linux in dataflash on CS3 */
 #define CONFIG_ENV_IS_IN_DATAFLASH
 #define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS3 + 0x8400)
-#define CONFIG_ENV_OFFSET	0x4200
+#define CONFIG_ENV_OFFSET	0x84000
 #define CONFIG_ENV_ADDR		(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS3 + CONFIG_ENV_OFFSET)
-#define CONFIG_ENV_SIZE		0x4200
-#define CONFIG_BOOTCOMMAND	"cp.b 0xD0042000 0x22000000 0x210000; bootm"
+#define CONFIG_ENV_SIZE		0x4000
+#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR+CONFIG_ENV_SIZE)
+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+#define CONFIG_BOOTCOMMAND	"cp.b 0xD008C000 0x22000000 0x210000; bootm"
 #define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
 				"root=/dev/mtdblock0 "			\
 				"mtdparts=atmel_nand:-(root) "		\
@@ -233,6 +237,8 @@ 
 #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_LONGHELP
 #define CONFIG_CMDLINE_EDITING
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
 
 /*
  * Size of malloc() pool
diff --git a/include/configs/at91sam9263ek.h b/include/configs/at91sam9263ek.h
index 8399246..253bee4 100644
--- a/include/configs/at91sam9263ek.h
+++ b/include/configs/at91sam9263ek.h
@@ -314,10 +314,12 @@ 
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */
 #define CONFIG_ENV_IS_IN_DATAFLASH	1
 #define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 0x8400)
-#define CONFIG_ENV_OFFSET		0x4200
+#define CONFIG_ENV_OFFSET		0x84000
 #define CONFIG_ENV_ADDR		(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + CONFIG_ENV_OFFSET)
-#define CONFIG_ENV_SIZE		0x4200
-#define CONFIG_BOOTCOMMAND	"cp.b 0xC0042000 0x22000000 0x210000; bootm"
+#define CONFIG_ENV_SIZE		0x4000
+#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR+CONFIG_ENV_SIZE)
+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+#define CONFIG_BOOTCOMMAND	"cp.b 0xC008C000 0x22000000 0x210000; bootm"
 #define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
 				"root=/dev/mtdblock0 " \
 				"mtdparts=atmel_nand:-(root) "\
@@ -347,6 +349,8 @@ 
 #define CONFIG_AUTO_COMPLETE
 #define CONFIG_SYS_HUSH_PARSER
 #define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
 
 /*
  * Size of malloc() pool
diff --git a/include/configs/at91sam9rlek.h b/include/configs/at91sam9rlek.h
index 79ea1f2..423f523 100644
--- a/include/configs/at91sam9rlek.h
+++ b/include/configs/at91sam9rlek.h
@@ -153,10 +153,12 @@ 
 /* bootstrap + u-boot + env + linux in dataflash on CS0 */
 #define CONFIG_ENV_IS_IN_DATAFLASH	1
 #define CONFIG_SYS_MONITOR_BASE	(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 0x8400)
-#define CONFIG_ENV_OFFSET		0x4200
+#define CONFIG_ENV_OFFSET		0x84000
 #define CONFIG_ENV_ADDR		(CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + CONFIG_ENV_OFFSET)
-#define CONFIG_ENV_SIZE		0x4200
-#define CONFIG_BOOTCOMMAND	"cp.b 0xC0042000 0x22000000 0x210000; bootm"
+#define CONFIG_ENV_SIZE		0x4000
+#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR+CONFIG_ENV_SIZE)
+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+#define CONFIG_BOOTCOMMAND	"cp.b 0xC008C000 0x22000000 0x210000; bootm"
 #define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
 				"root=/dev/mtdblock0 " \
 				"mtdparts=atmel_nand:-(root) "\
@@ -183,6 +185,8 @@ 
 #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_LONGHELP		1
 #define CONFIG_CMDLINE_EDITING		1
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT
 
 /*
  * Size of malloc() pool