Skip to contentSkip to conversation

Change kernel address in dataflash to match u-boot's size

PATCH Superseded Alexandre Belloni 6 participants 20 messages Jan 29, 2012 – Apr 21, 2012 Arm/Microchip (AT91) SoC support

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Change kernel address in dataflash to match u-boot's size

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
---
 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(-)
include/configs/at91sam9260ek.h +12 -6
index db52ee6..b537760 100644
@@ -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
include/configs/at91sam9261ek.h +12 -6
index 5140b26..fa461da 100644
@@ -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
include/configs/at91sam9263ek.h +7 -3
index 8399246..253bee4 100644
@@ -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
include/configs/at91sam9rlek.h +7 -3
index 79ea1f2..423f523 100644
@@ -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
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH v2 1/1 Change kernel address in dataflash to match u-boot's size

Le 29/01/2012 22:37, Alexandre Belloni a ?crit :

Quoted 10 lines

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.

Quoted 8 lines

Now, the layout is:

bootstrap  0x00000000
uboot      0x00004000
ubootenv   0x00084000
ubootenv2  0x00088000
kernel     0x0008C000

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

Amicalement,

Signature · 1 line
Albert.
#2 lore raw

PATCH v2 1/1 Change kernel address in dataflash to match u-boot's size

Hi again Alexandre,

Le 18/02/2012 16:13, Albert ARIBAUD a ?crit :

Quoted 18 lines

Le 29/01/2012 22:37, Alexandre Belloni a ?crit :

Quoted 17 lines

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

Quoted 4 lines
Quoted 1 line

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,

Signature · 1 line
Albert.
#3 lore raw

PATCH v2 1/1 Change kernel address in dataflash to match u-boot's size

Hi,

Quoted 3 lines · Albert ARIBAUD

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,

Signature · 1 line
Alexandre Belloni
#4 lore raw

PATCH v2 1/1 Change kernel address in dataflash to match u-boot's size

Hi Alexandre,

Le 20/02/2012 11:40, Alexandre Belloni a ?crit :

Quoted 7 lines

Hi,

Quoted 3 lines · Albert ARIBAUD

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

Quoted 5 lines

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.

Quoted 1 line

Regards,

Amicalement,

Signature · 1 line
Albert.
#5 lore raw

PATCH 1/1 AT91SAM9*: Change kernel address in dataflash to match u-boot's size

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
---
 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(-)
include/configs/at91sam9260ek.h +12 -6
index db52ee6..b537760 100644
@@ -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
include/configs/at91sam9261ek.h +12 -6
index 5140b26..fa461da 100644
@@ -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
include/configs/at91sam9263ek.h +7 -3
index 8399246..253bee4 100644
@@ -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
include/configs/at91sam9rlek.h +7 -3
index 79ea1f2..423f523 100644
@@ -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
Signature · 1 line
1.7.5.4
#6 lore raw

PATCH 1/1 AT91SAM9*: Change kernel address in dataflash to match u-boot's size

Hi Alexandre,

Le 20/02/2012 13:48, Alexandre Belloni a ?crit :

Quoted 11 lines

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:

Quoted 8 lines
bootstrap  0x00000000
uboot      0x00004000
ubootenv   0x00084000
ubootenv2  0x00088000
kernel     0x0008C000

---

As this follows a V2 patch, you should post as V3 and with patch history (diffs from V3 to V2 and from V2 to V1) inserted here.

Quoted 5 lines
  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(-)

Amicalement,

Signature · 1 line
Albert.
#7 lore raw

PATCH v3 1/1 AT91SAM9*: Change kernel address in dataflash to match u-boot's size

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

---
Changes for v2:
- changed the layout as per Marek's recommendation
Changes for v3:
- prefixed the patch title with AT91SAM9*:

 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(-)
include/configs/at91sam9260ek.h +12 -6
index db52ee6..b537760 100644
@@ -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
include/configs/at91sam9261ek.h +12 -6
index 5140b26..fa461da 100644
@@ -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
include/configs/at91sam9263ek.h +7 -3
index 8399246..253bee4 100644
@@ -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
include/configs/at91sam9rlek.h +7 -3
index 79ea1f2..423f523 100644
@@ -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
Signature · 1 line
1.7.5.4
#8 lore raw

PATCH v3 1/1 AT91SAM9*: Change kernel address in dataflash to match u-boot's size

Quoted 10 lines · Alexandre Belloni

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.

Quoted 7 lines

Now, the layout is:

bootstrap  0x00000000
uboot      0x00004000
ubootenv   0x00084000
ubootenv2  0x00088000
kernel     0x0008C000

NAK!

1. You need to be aware of the page size of dataflashes.
Each page is 1056 bytes, not 1024 bytes.
Your patch will make the U-Boot image start in the middle of a page.
2. Std AT91bootstrap loads U-Boot from 0x8400
so your patch breaks 99% of all SAM9 boards.

If you want to grow U-Boot, then

bootstrap  0x00000000		; 16 kB
ubootenv   0x00004200		; 16 kB	- Should be plenty
uboot      0x00008400		;
kernel     0x00063000		; Why waste space...
Quoted 161 lines

---
Changes for v2:
- changed the layout as per Marek's recommendation
Changes for v3:
- prefixed the patch title with AT91SAM9*:

  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(-)
include/configs/at91sam9260ek.h +12 -6
index db52ee6..b537760 100644
@@ -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
include/configs/at91sam9261ek.h +12 -6
index 5140b26..fa461da 100644
@@ -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
include/configs/at91sam9263ek.h +7 -3
index 8399246..253bee4 100644
@@ -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
include/configs/at91sam9rlek.h +7 -3
index 79ea1f2..423f523 100644
@@ -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
Signature · 4 lines
Best Regards
Ulf Samuelsson
ulf at emagii.com
+46 722 427437
#9 lore raw

PATCH v3 1/1 AT91SAM9*: Change kernel address in dataflash to match u-boot's size

Quoted 20 lines · Ulf Samuelsson
Quoted 10 lines · Alexandre Belloni

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.

Quoted 7 lines

Now, the layout is:

bootstrap  0x00000000
uboot      0x00004000
ubootenv   0x00084000
ubootenv2  0x00088000
kernel     0x0008C000
Quoted 5 lines

NAK!

1. You need to be aware of the page size of dataflashes. Each page is 1056 bytes, not 1024 bytes.
Your patch will make the U-Boot image start in the middle of a page.

Ok, I couldn't find a clear spec on that dataflash...

Quoted 3 lines

2. Std AT91bootstrap loads U-Boot from 0x8400
so your patch breaks 99% of all SAM9 boards.

Those boards are broken anyway ! As u-boot is bigger than the load size of at91bootstrap (0x33900 by default). So, not changing means that you are screwed after flashing a new u-boot.

Quoted 7 lines

If you want to grow U-Boot, then

bootstrap  0x00000000		; 16 kB
ubootenv   0x00004200		; 16 kB	- Should be plenty
uboot      0x00008400		;
kernel     0x00063000		; Why waste space...

What about the redundant env ? Why shouldn't we reorder u-boot and its env ?

Regards,

Signature · 1 line
Alexandre Belloni
#10 lore raw

PATCH v3 1/1 AT91SAM9*: Change kernel address in dataflash to match u-boot's size

28 feb 2012 kl. 23:57 skrev Alexandre Belloni <[email protected]>:

Quoted 21 lines · Ulf Samuelsson
Quoted 20 lines · Alexandre Belloni
Quoted 17 lines

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
Quoted 7 lines
Quoted 5 lines

NAK!

1. You need to be aware of the page size of dataflashes. Each page is 1056 bytes, not 1024 bytes.
Your patch will make the U-Boot image start in the middle of a page.

Ok, I couldn't find a clear spec on that dataflash...

maybe you should have tried to look at the Atmel homepage...

Quoted 6 lines
Quoted 4 lines

2. Std AT91bootstrap loads U-Boot from 0x8400
so your patch breaks 99% of all SAM9 boards.

Those boards are broken anyway !

No they are not.
The partitioning gives you some hint on where to store the kernel, but you can store the kernel at any suitable address. you lose some conveniance, but thats all.

Storing U-boot at any other address than 0x8400, means that AT91bootstrap
must be modified, and there is significant disadvantages in having two possible u-boot locations. if you have an at91bootstrap binary, will this use the old or new location?
I fail to see any benefit in moving, so that

Quoted 3 lines

As u-boot is bigger than the load size
of at91bootstrap (0x33900 by default). So, not changing means that you are screwed after flashing a new u-boot

IIRC, The latest bootstrap with Kconfig has configurable size. Changing size is OK, changing location is not.

Quoted 10 lines
Quoted 7 lines

If you want to grow U-Boot, then

bootstrap  0x00000000        ; 16 kB
ubootenv   0x00004200        ; 16 kB    - Should be plenty
uboot      0x00008400        ;
kernel     0x00063000        ; Why waste space...

What about the redundant env ? Why shouldn't we reorder u-boot and its env ?

Because it adds problems without any benefits.
When I looked the last time, the environment is only 8 pages, So you can fit a redundant environment anyway in 16 kB+}

Quoted 5 lines

Regards,

Signature · 1 line
Alexandre Belloni

Best Regards
Ulf Samuelsson
ulf at emagii.com

#11 lore raw

PATCH v3 1/1 AT91SAM9*: Change kernel address in dataflash to match u-boot's size

Quoted 19 lines · Ulf Samuelsson
Quoted 6 lines
Quoted 4 lines

2. Std AT91bootstrap loads U-Boot from 0x8400
so your patch breaks 99% of all SAM9 boards.

Those boards are broken anyway !

No they are not.
The partitioning gives you some hint on where to store the kernel, but you can store the kernel at any suitable address. you lose some conveniance, but thats all.

Storing U-boot at any other address than 0x8400, means that AT91bootstrap
must be modified, and there is significant disadvantages in having two possible u-boot locations. if you have an at91bootstrap binary, will this use the old or new location?
I fail to see any benefit in moving, so that

Quoted 8 lines
Quoted 3 lines

As u-boot is bigger than the load size
of at91bootstrap (0x33900 by default). So, not changing means that you are screwed after flashing a new u-boot

IIRC, The latest bootstrap with Kconfig has configurable size. Changing size is OK, changing location is not.

Doesn't that mean that you then have to recompile/reflash at91bootstrap and so that the boards are broken using the latest ut-boot ? I couldn't get my board working with the stock at91bootstrap because it cannot load u-boot.

It has to be fixed or I don't see the point in keeping those configs. If we don't want to change the location, and I can understand the reasons why, then was my first patch ok ?

http://lists.denx.de/pipermail/u-boot/2012-January/114485.html

I'd like to see that fixed so that I could integrate it properly in buildroot...

Quoted 17 lines
Quoted 4 lines
Quoted 4 lines

If you want to grow U-Boot, then

Quoted 8 lines
Quoted 5 lines
bootstrap  0x00000000        ; 16 kB
ubootenv   0x00004200        ; 16 kB    - Should be plenty
uboot      0x00008400        ;
kernel     0x00063000        ; Why waste space...

What about the redundant env ? Why shouldn't we reorder u-boot and its env ?

Because it adds problems without any benefits.
When I looked the last time, the environment is only 8 pages, So you can fit a redundant environment anyway in 16 kB+}

Signature · 1 line
Alexandre Belloni
#12 lore raw

PATCH v3 1/1 AT91SAM9*: Change kernel address in dataflash to match u-boot's size

Quoted 21 lines · Alexandre Belloni
Quoted 20 lines · Ulf Samuelsson
Quoted 5 lines

SIZE

Quoted 3 lines

2. Std AT91bootstrap loads U-Boot from 0x8400
so your patch breaks 99% of all SAM9 boards.

Those boards are broken anyway !

No they are not.
The partitioning gives you some hint on where to store the kernel, but you can store the kernel at any suitable address. you lose some conveniance, but thats all.

Storing U-boot at any other address than 0x8400, means that AT91bootstrap
must be modified, and there is significant disadvantages in having two possible u-boot locations. if you have an at91bootstrap binary, will this use the old or new location?
I fail to see any benefit in moving, so that

Quoted 3 lines

As u-boot is bigger than the load size
of at91bootstrap (0x33900 by default). So, not changing means that you are screwed after flashing a new u-boot

Quoted 9 lines
Quoted 4 lines

IIRC, The latest bootstrap with Kconfig has configurable size. Changing size is OK, changing location is not.

Doesn't that mean that you then have to recompile/reflash at91bootstrap and so that the boards are broken using the latest ut-boot ? I couldn't get my board working with the stock at91bootstrap because it cannot load u-boot.

The size of the image loaded by at91bootstrap
can be configured by the user using KConfig.

The load address cannot be changed in KConfig For this, you have to modify the source code - bad idea.

I think it would be good, if the u-boot image contained its own size somewhere.
(Maybe it does already) marked with some magic key, so that the size can be determined during run time.

I don't like the idea to move the environment as the default. There are people that try to fit the complete kernel + file system into a single 8 MB dataflash and you are using way too much space for U-Boot. If you want to have environment in the high memory, then this should be an option, and not enabled by default.

Also, you are putting the environment into the same block as the kernel.

From the datasheet:
"Each page within a sector must be updated/rewritten at least once within every
10,000 cumulative page erase/program operations in that sector."

So updating the environment, may corrupt the kernel.

With a large environment = 32 kB this will happen 4 times faster than with an 8 kB environement.
I.E: instead of within every 1250 "saveenv", it must happen within every 312 "saveenv" which is "danger close".

The environment should thus be as small as acceptable.-

To avoid the problem fully, you have to allocate a 256 KB sector for each environment,
which means that U-Boot will use 1 MB. Maybe a single 256 kB sector will do. This will cause a significant addition to programming time and is real wasteful
in terms of memory-

Better to localize the problem and put the 2 x 8 kB environment and U-Boot in the first sector
with U-Boot overlapping into the second sector.
This will allow people to choose exactly where the kernel starts.

The kernel should start at sector 3 (page 512) = 0x84000 to avoid problems, if you keep reprogramming u-boot.
Sector 0 = 8 kB, 1 = 248 kB, 2 = 256 kB (with 1 kB = 1056 bytes in this case)

People which wants to optimize memory can then still put the kernel at a lower location.

Did not study the size issue, fully, but I would not be surprised if you could, by removing features, still fit u-boot within sector 1, so moving "kernel" to
0x84000 should be an option, enabled in those configs, which do result in growing beyond 0x42000.

Quoted 25 lines

If we don't want to change the location, and I can understand the reasons why, then was my first patch ok ?

http://lists.denx.de/pipermail/u-boot/2012-January/114485.html

I'd like to see that fixed so that I could integrate it properly in buildroot...

Quoted 14 lines
Quoted 10 lines
Quoted 8 lines

If you want to grow U-Boot, then

bootstrap  0x00000000        ; 16 kB
ubootenv   0x00004200        ; 16 kB    - Should be plenty
uboot      0x00008400        ;
kernel     0x00063000        ; Why waste space...

What about the redundant env ? Why shouldn't we reorder u-boot and its env ?

Because it adds problems without any benefits.
When I looked the last time, the environment is only 8 pages, So you can fit a redundant environment anyway in 16 kB+}

Signature · 2 lines
Best Regards
Ulf Samuelsson
#13 lore raw

PATCH v4 1/1 AT91SAM9*: Change kernel address in dataflash to match u-boot's size

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
ubootenv   0x00004200
uboot      0x00008400
kernel     0x00084000

---
Changes for v2:
- changed the layout as per Marek's recommendation
Changes for v3:
- prefixed the patch title with AT91SAM9*:
Changes for v4:

	- changed the layout again as per Ulf Samuelsson's request:
	http://lists.denx.de/pipermail/u-boot/2012-February/118988.html
 include/configs/at91sam9260ek.h |    5 +++--
 include/configs/at91sam9261ek.h |    5 +++--
 include/configs/at91sam9263ek.h |    4 +++-
 include/configs/at91sam9rlek.h  |    3 ++-
 4 files changed, 11 insertions(+), 6 deletions(-)
include/configs/at91sam9260ek.h +3 -2
index db52ee6..49b3386 100644
@@ -188,7 +188,7 @@
 #define CONFIG_ENV_OFFSET		0x4200
 #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_BOOTCOMMAND	"cp.b 0xC0084000 0x22000000 0x210000; bootm"
 #define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
 				"root=/dev/mtdblock0 "			\
 				"mtdparts=atmel_nand:-(root) "		\
@@ -202,7 +202,7 @@
 #define CONFIG_ENV_OFFSET		0x4200
 #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_BOOTCOMMAND	"cp.b 0xD0084000 0x22000000 0x210000; bootm"
 #define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
 				"root=/dev/mtdblock0 "			\
 				"mtdparts=atmel_nand:-(root) "		\
@@ -231,6 +231,7 @@
 #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
 
 /*
  * Size of malloc() pool
include/configs/at91sam9261ek.h +3 -2
index 5140b26..967a4c4 100644
@@ -190,7 +190,7 @@
 #define CONFIG_ENV_OFFSET	0x4200
 #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_BOOTCOMMAND	"cp.b 0xC0084000 0x22000000 0x210000; bootm"
 #define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
 				"root=/dev/mtdblock0 "			\
 				"mtdparts=atmel_nand:-(root) "		\
@@ -204,7 +204,7 @@
 #define CONFIG_ENV_OFFSET	0x4200
 #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_BOOTCOMMAND	"cp.b 0xD0084000 0x22000000 0x210000; bootm"
 #define CONFIG_BOOTARGS		"console=ttyS0,115200 "			\
 				"root=/dev/mtdblock0 "			\
 				"mtdparts=atmel_nand:-(root) "		\
@@ -233,6 +233,7 @@
 #define CONFIG_SYS_PBSIZE		(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
 #define CONFIG_SYS_LONGHELP
 #define CONFIG_CMDLINE_EDITING
+#define CONFIG_AUTO_COMPLETE
 
 /*
  * Size of malloc() pool
include/configs/at91sam9263ek.h +3 -1
index 8399246..a6fe325 100644
@@ -317,7 +317,7 @@
 #define CONFIG_ENV_OFFSET		0x4200
 #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_BOOTCOMMAND	"cp.b 0xC0084000 0x22000000 0x210000; bootm"
 #define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
 				"root=/dev/mtdblock0 " \
 				"mtdparts=atmel_nand:-(root) "\
@@ -347,6 +347,8 @@
 #define CONFIG_AUTO_COMPLETE
 #define CONFIG_SYS_HUSH_PARSER
 #define CONFIG_SYS_PROMPT_HUSH_PS2	"> "
+#define CONFIG_AUTO_COMPLETE
+
 
 /*
  * Size of malloc() pool
include/configs/at91sam9rlek.h +2 -1
index 79ea1f2..6640b06 100644
@@ -156,7 +156,7 @@
 #define CONFIG_ENV_OFFSET		0x4200
 #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_BOOTCOMMAND	"cp.b 0xC0084000 0x22000000 0x210000; bootm"
 #define CONFIG_BOOTARGS		"console=ttyS0,115200 " \
 				"root=/dev/mtdblock0 " \
 				"mtdparts=atmel_nand:-(root) "\
@@ -183,6 +183,7 @@
 #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
 
 /*
  * Size of malloc() pool
Signature · 1 line
1.7.5.4
#14 lore raw

PATCH v4 1/1 AT91SAM9*: Change kernel address in dataflash to match u-boot's size

Dear Alexandre Belloni,

Quoted 7 lines · In message <[email protected]> you…

On at91sam platforms, u-boot grew larger than the allocated size in dataflash, the layout was:

bootstrap  0x00000000
ubootenv   0x00004200
uboot      0x00008400
kernel     0x00042000
Quoted 8 lines

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

Now, the layout is:

bootstrap  0x00000000
ubootenv   0x00004200
uboot      0x00008400
kernel     0x00084000

Where are these odd sizes like

Quoted 1 line

#define CONFIG_ENV_SIZE 0x4200

coming from? Has a size of 0x4200 any special maning on these systems?

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Intel told us the Pentium would have "RISK" features...
#15 lore raw

PATCH v4 1/1 AT91SAM9*: Change kernel address in dataflash to match u-boot's size

Dear Wolfgang,

Quoted 19 lines · Wolfgang Denk

Dear Alexandre Belloni,

Quoted 7 lines · In message <[email protected]> you…

On at91sam platforms, u-boot grew larger than the allocated size in dataflash, the layout was:

bootstrap  0x00000000
ubootenv   0x00004200
uboot      0x00008400
kernel     0x00042000
Quoted 8 lines

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

Now, the layout is:

bootstrap  0x00000000
ubootenv   0x00004200
uboot      0x00008400
kernel     0x00084000
Quoted 6 lines

Where are these odd sizes like

Quoted 1 line

#define CONFIG_ENV_SIZE 0x4200

coming from? Has a size of 0x4200 any special maning on these systems?

please read Ulfs mail:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/123862/focus=125897

I think it is OK to apply this patch.
All these atmel boards need some more attention (lack of maintainer). Reinhard started to migrate a lot of stuff but unfortunately this process is not completely finished. I will not say it is left undone but there is still a lot to do.
I think another point is that these Atmel devices became less important than before in U-Boot (I see not really much users here even though a lot of people use it):
a) a lot of users favor the at91bootstrap SPL to boot linux (no need
for u-boot)
b) they have well-hung cores

best regards

Andreas Bie?mann

PS: besides a) there was a user in irc around Christmas who count 'the SPL for atmel devices in U-Boot' a good idea. He said he wants to play with it ... I wonder if he does.

#16 lore raw

PATCH v4 1/1 AT91SAM9*: Change kernel address in dataflash to match u-boot's size

Dear Andreas,

Quoted 10 lines · In message <[email protected]> you wrote:
Quoted 7 lines

Where are these odd sizes like

Quoted 1 line

#define CONFIG_ENV_SIZE 0x4200

coming from? Has a size of 0x4200 any special maning on these systems?

please read Ulfs mail:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/123862/focus=125897

Thanks for the pointer.

Quoted 1 line

I think it is OK to apply this patch.

I did not intend to object against this patch; I just wonered about the odd numbers,

Quoted 5 lines

I think another point is that these Atmel devices became less important than before in U-Boot (I see not really much users here even though a lot of people use it):
a) a lot of users favor the at91bootstrap SPL to boot linux (no need
for u-boot)

This could probably be changed if they were converted to using U-Boot's SPL mechanism instead - but then, I also realize that there is only very low interest for them.

Quoted 1 line

b) they have well-hung cores

Indeed.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"If it ain't broke, don't fix it."                       - Bert Lantz
#17 lore raw

PATCH v4 1/1 AT91SAM9*: Change kernel address in dataflash to match u-boot's size

Quoted 8 lines · Wolfgang Denk

Dear Andreas,

Quoted 5 lines · In message<[email protected]> you wrote:
Quoted 5 lines

Where are these odd sizes like

Quoted 1 line
  #define CONFIG_ENV_SIZE		0x4200

coming from? Has a size of 0x4200 any special maning on these systems?

Quoted 13 lines
Quoted 2 lines

please read Ulfs mail:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/123862/focus=125897

Thanks for the pointer.

Quoted 1 line

I think it is OK to apply this patch.

I did not intend to object against this patch; I just wonered about the odd numbers,

Quoted 5 lines

I think another point is that these Atmel devices became less important than before in U-Boot (I see not really much users here even though a lot of people use it):
a) a lot of users favor the at91bootstrap SPL to boot linux (no need
for u-boot)

While AT91bootstrap supports booting linux, this is real minimal support. Everything is hard-wired so for development it really sucks. It is really only useful for production work.
I personally never used this capability.

This functionality is pretty new in AT91boostrap,
and the Atmel (non) presence in the mailing list is an older problem.

While I no longer work for Atmel, I have a feeling that the problem is as follows:

Users are using the Atmel version of U-Boot, not mainstream. If not using the Atmel version, then they maybe using a build system like OpenEmbedded where u-boot is built as a part of the build process and people have very little incentive in modifying that part

There is very little incentive at Atmel to upgrade because
1. Patches provided by Atmel are ignored.
2. Patches are applied to mainline which keeps breaking the AT91 support.
3. All possible fixes to boot problem are rejected (discussion with Haavard).
4. It is considered more important to have a "clean" implementation, than a working implementation.
(Choice of NOR Flash Driver)

Atmel does not want to continuously spend effort on unbreaking other peoples work.

Problems are not fixed in the mainline due to problem (1). Instead the problems are fixed in the buildsystem and it is not considered worthwhile to submit such fixes to the mailinglist.

The action by the project to "solve" the problem by removing the boards from
the MAKEALL scripts and also to remove BSPs is not encouraging.

There used to be a rule that patches should not break board support, but that rule seems to have gone down the drains.

The Atmel code is (IIRC) based on 0.3.4 so it is very old, so an update is really needed
but before U-Boot becomes "developer-friendly", I doubt that will happen. If the project wants to have Atmel "on-board", then fixing problem (1) is key.

Quoted 5 lines

This could probably be changed if they were converted to using U-Boot's SPL mechanism instead - but then, I also realize that there is only very low interest for them.

I think you are right. Atmel wants control over this part.

Quoted 1 line
Quoted 1 line

b) they have well-hung cores

Still plenty of ARM9 users out there, but a new core would be an obvious way forward for the 2012 model AT91 application processors. Don't see many reasons for updating the current SAM9Gx5 family.

"http://www.mscbp.hu/Documents/Atmel Q-Touch.pdf" seems to hint at a Cortex-A5, but this document is from 2010, so plans may have changed.

Quoted 6 lines

Indeed.

Best regards,

Wolfgang Denk

Signature · 3 lines
Best Regards
Ulf Samuelsson
ulf at emagii.com
#18 lore raw

PATCH v4 1/1 AT91SAM9*: Change kernel address in dataflash to match u-boot's size

Hi,

Quoted 36 lines · Ulf Samuelsson

While AT91bootstrap supports booting linux, this is real minimal support. Everything is hard-wired so for development it really sucks. It is really only useful for production work.
I personally never used this capability.

This functionality is pretty new in AT91boostrap,
and the Atmel (non) presence in the mailing list is an older problem.

While I no longer work for Atmel, I have a feeling that the problem is as follows:

Users are using the Atmel version of U-Boot, not mainstream. If not using the Atmel version, then they maybe using a build system like OpenEmbedded where u-boot is built as a part of the build process and people have very little incentive in modifying that part

There is very little incentive at Atmel to upgrade because
1. Patches provided by Atmel are ignored.
2. Patches are applied to mainline which keeps breaking the AT91 support.
3. All possible fixes to boot problem are rejected (discussion with Haavard).
4. It is considered more important to have a "clean" implementation, than a working implementation.
(Choice of NOR Flash Driver)

Atmel does not want to continuously spend effort on unbreaking other peoples work.

Problems are not fixed in the mainline due to problem (1). Instead the problems are fixed in the buildsystem and it is not considered worthwhile to submit such fixes to the mailinglist.

The action by the project to "solve" the problem by removing the boards from
the MAKEALL scripts and also to remove BSPs is not encouraging.

Quoted 9 lines

There used to be a rule that patches should not break board support, but that rule seems to have gone down the drains.

The Atmel code is (IIRC) based on 0.3.4 so it is very old, so an update is really needed
but before U-Boot becomes "developer-friendly", I doubt that will happen. If the project wants to have Atmel "on-board", then fixing problem
(1) is key.

Would it be possible to get a list of what is not working on mainline but is working in ATMEL's version ? or at least some pointers. It seems to be working well on my board. I'm really interested in getting mainline working well.

I know there is not much interest in the AT91 boards now but I would really like to see that issue fixed.

Regards,

Signature · 1 line
Alexandre Belloni
#19 lore raw

PATCH v2 1/1 Change kernel address in dataflash to match u-boot's size

In reply to Albert ARIBAUD
Quoted 3 lines · Albert ARIBAUD

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,

Signature · 1 line
Alexandre Belloni