Patchwork [U-Boot,v5] AT91SAM9*: Change kernel address in dataflash to match u-boot's size

login
register
mail settings
Submitter Alexandre Belloni
Date April 21, 2012, 9:24 p.m.
Message ID <1335043484-14136-1-git-send-email-alexandre.belloni@piout.net>
Download mbox | patch
Permalink /patch/154242/
State Changes Requested
Delegated to: Andreas Bießmann
Headers show

Comments

Alexandre Belloni - April 21, 2012, 9:24 p.m.
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

Signed-off-by: Alexandre Belloni <alexandre.belloni@piout.net>
---
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
Changes for v5:
  - also update partition list

 board/atmel/at91sam9260ek/partition.c |    2 +-
 board/atmel/at91sam9261ek/partition.c |    2 +-
 board/atmel/at91sam9263ek/partition.c |    2 +-
 board/atmel/at91sam9rlek/partition.c  |    2 +-
 include/configs/at91sam9260ek.h       |    5 +++--
 include/configs/at91sam9261ek.h       |    5 +++--
 include/configs/at91sam9263ek.h       |    4 +++-
 include/configs/at91sam9rlek.h        |    3 ++-
 8 files changed, 15 insertions(+), 10 deletions(-)
Andreas Bießmann - July 1, 2012, 10:34 a.m.
Dear Alexandre Belloni,

I would like to apply this to upcoming 2012.07. Unfortunately this patch
does not apply cleanly on current u-boot-atmel, please rebase and fix
some minor parts.

On 21.04.12 23:24, Alexandre Belloni wrote:
> 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
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@piout.net>
> ---
> 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
> Changes for v5:
>   - also update partition list
> 
>  board/atmel/at91sam9260ek/partition.c |    2 +-
>  board/atmel/at91sam9261ek/partition.c |    2 +-
>  board/atmel/at91sam9263ek/partition.c |    2 +-
>  board/atmel/at91sam9rlek/partition.c  |    2 +-
>  include/configs/at91sam9260ek.h       |    5 +++--
>  include/configs/at91sam9261ek.h       |    5 +++--
>  include/configs/at91sam9263ek.h       |    4 +++-
>  include/configs/at91sam9rlek.h        |    3 ++-
>  8 files changed, 15 insertions(+), 10 deletions(-)
> 

<ACK for partition stuff>

> diff --git a/include/configs/at91sam9260ek.h b/include/configs/at91sam9260ek.h
> index db52ee6..49b3386 100644
> --- a/include/configs/at91sam9260ek.h
> +++ b/include/configs/at91sam9260ek.h

<ACK for BOOTCMD stuff>

> @@ -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

please send another patch or write this change down in commit message,
separate patch preferred.

>  
>  /*
>   * Size of malloc() pool
> diff --git a/include/configs/at91sam9261ek.h b/include/configs/at91sam9261ek.h
> index 5140b26..967a4c4 100644
> --- a/include/configs/at91sam9261ek.h
> +++ b/include/configs/at91sam9261ek.h

<ACK for BOOTCMD stuff>

> @@ -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

Again, please separate patch here.

>  
>  /*
>   * Size of malloc() pool
> diff --git a/include/configs/at91sam9263ek.h b/include/configs/at91sam9263ek.h
> index 8399246..a6fe325 100644
> --- a/include/configs/at91sam9263ek.h
> +++ b/include/configs/at91sam9263ek.h
> @@ -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
> +
>  
NAK:
 a) unnecessary double blank line here
 b) CONFIG_AUTO_COMPLETE is defined some lines above
 c) does not apply cleanly, cause CONFIG_SYS_PROMPT_HUSH_PS2 was
    removed previously

>  /*
>   * Size of malloc() pool
> diff --git a/include/configs/at91sam9rlek.h b/include/configs/at91sam9rlek.h
> index 79ea1f2..6640b06 100644
> --- a/include/configs/at91sam9rlek.h
> +++ b/include/configs/at91sam9rlek.h
> @@ -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

separate patch please.

Best regards

Andreas Bießmann

Patch

diff --git a/board/atmel/at91sam9260ek/partition.c b/board/atmel/at91sam9260ek/partition.c
index 2629c67..842bb89 100644
--- a/board/atmel/at91sam9260ek/partition.c
+++ b/board/atmel/at91sam9260ek/partition.c
@@ -35,6 +35,6 @@  dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
 	{0x00000000, 0x000041FF, FLAG_PROTECT_SET,   0, "Bootstrap"},
 	{0x00004200, 0x000083FF, FLAG_PROTECT_CLEAR, 0, "Environment"},
 	{0x00008400, 0x00041FFF, FLAG_PROTECT_SET,   0, "U-Boot"},
-	{0x00042000, 0x00251FFF, FLAG_PROTECT_CLEAR, 0,	"Kernel"},
+	{0x00084000, 0x00251FFF, FLAG_PROTECT_CLEAR, 0,	"Kernel"},
 	{0x00252000, 0xFFFFFFFF, FLAG_PROTECT_CLEAR, 0,	"FS"},
 };
diff --git a/board/atmel/at91sam9261ek/partition.c b/board/atmel/at91sam9261ek/partition.c
index c739b11..96c4fcb 100644
--- a/board/atmel/at91sam9261ek/partition.c
+++ b/board/atmel/at91sam9261ek/partition.c
@@ -35,6 +35,6 @@  dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
 	{0x00000000, 0x000041FF, FLAG_PROTECT_SET,   0, "Bootstrap"},
 	{0x00004200, 0x000083FF, FLAG_PROTECT_CLEAR, 0, "Environment"},
 	{0x00008400, 0x00041FFF, FLAG_PROTECT_SET,   0, "U-Boot"},
-	{0x00042000, 0x00251FFF, FLAG_PROTECT_CLEAR, 0,	"Kernel"},
+	{0x00084000, 0x00251FFF, FLAG_PROTECT_CLEAR, 0,	"Kernel"},
 	{0x00252000, 0xFFFFFFFF, FLAG_PROTECT_CLEAR, 0,	"FS"},
 };
diff --git a/board/atmel/at91sam9263ek/partition.c b/board/atmel/at91sam9263ek/partition.c
index 7e1d46f..7f11fd0 100644
--- a/board/atmel/at91sam9263ek/partition.c
+++ b/board/atmel/at91sam9263ek/partition.c
@@ -34,6 +34,6 @@  dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
 	{0x00000000, 0x000041FF, FLAG_PROTECT_SET,   0, "Bootstrap"},
 	{0x00004200, 0x000083FF, FLAG_PROTECT_CLEAR, 0, "Environment"},
 	{0x00008400, 0x00041FFF, FLAG_PROTECT_SET,   0, "U-Boot"},
-	{0x00042000, 0x00251FFF, FLAG_PROTECT_CLEAR, 0,	"Kernel"},
+	{0x00084000, 0x00251FFF, FLAG_PROTECT_CLEAR, 0,	"Kernel"},
 	{0x00252000, 0xFFFFFFFF, FLAG_PROTECT_CLEAR, 0,	"FS"},
 };
diff --git a/board/atmel/at91sam9rlek/partition.c b/board/atmel/at91sam9rlek/partition.c
index 7e1d46f..7f11fd0 100644
--- a/board/atmel/at91sam9rlek/partition.c
+++ b/board/atmel/at91sam9rlek/partition.c
@@ -34,6 +34,6 @@  dataflash_protect_t area_list[NB_DATAFLASH_AREA] = {
 	{0x00000000, 0x000041FF, FLAG_PROTECT_SET,   0, "Bootstrap"},
 	{0x00004200, 0x000083FF, FLAG_PROTECT_CLEAR, 0, "Environment"},
 	{0x00008400, 0x00041FFF, FLAG_PROTECT_SET,   0, "U-Boot"},
-	{0x00042000, 0x00251FFF, FLAG_PROTECT_CLEAR, 0,	"Kernel"},
+	{0x00084000, 0x00251FFF, FLAG_PROTECT_CLEAR, 0,	"Kernel"},
 	{0x00252000, 0xFFFFFFFF, FLAG_PROTECT_CLEAR, 0,	"FS"},
 };
diff --git a/include/configs/at91sam9260ek.h b/include/configs/at91sam9260ek.h
index db52ee6..49b3386 100644
--- a/include/configs/at91sam9260ek.h
+++ b/include/configs/at91sam9260ek.h
@@ -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
diff --git a/include/configs/at91sam9261ek.h b/include/configs/at91sam9261ek.h
index 5140b26..967a4c4 100644
--- a/include/configs/at91sam9261ek.h
+++ b/include/configs/at91sam9261ek.h
@@ -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
diff --git a/include/configs/at91sam9263ek.h b/include/configs/at91sam9263ek.h
index 8399246..a6fe325 100644
--- a/include/configs/at91sam9263ek.h
+++ b/include/configs/at91sam9263ek.h
@@ -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
diff --git a/include/configs/at91sam9rlek.h b/include/configs/at91sam9rlek.h
index 79ea1f2..6640b06 100644
--- a/include/configs/at91sam9rlek.h
+++ b/include/configs/at91sam9rlek.h
@@ -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