* [U-Boot] [PATCH 1/3] ARM: at91: sama5: move the sd/mmc env config to at91-sama5_common.h
@ 2015-07-07 11:08 Josh Wu
2015-07-07 11:08 ` [U-Boot] [PATCH 2/3] ARM: at91: sama5: move the nandflash " Josh Wu
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Josh Wu @ 2015-07-07 11:08 UTC (permalink / raw)
To: u-boot
As almost all sama5 sd/mmc env configurations are same, so move them to
at91-sama5_common.h.
Also we define a KERNEL_DTB_FILE_NAME as dtb file name for different
board.
Signed-off-by: Josh Wu <josh.wu@atmel.com>
---
Hi,
Those patches depends on the patch: http://patchwork.ozlabs.org/patch/485339/
Best Regards,
Josh Wu
include/configs/at91-sama5_common.h | 17 +++++++++++++++++
include/configs/sama5d3_xplained.h | 12 +++---------
include/configs/sama5d3xek.h | 10 +---------
include/configs/sama5d4_xplained.h | 20 +++-----------------
include/configs/sama5d4ek.h | 18 +++---------------
5 files changed, 27 insertions(+), 50 deletions(-)
diff --git a/include/configs/at91-sama5_common.h b/include/configs/at91-sama5_common.h
index 9289964..99fa0b1 100644
--- a/include/configs/at91-sama5_common.h
+++ b/include/configs/at91-sama5_common.h
@@ -56,6 +56,23 @@
#define CONFIG_CMD_DHCP
#ifdef CONFIG_SYS_USE_MMC
+/* u-boot env in sd/mmc card */
+#define CONFIG_ENV_IS_IN_FAT
+#define CONFIG_FAT_WRITE
+#define FAT_ENV_INTERFACE "mmc"
+#define FAT_ENV_DEVICE_AND_PART "0"
+#define FAT_ENV_FILE "uboot.env"
+#define CONFIG_ENV_SIZE 0x4000
+
+#ifdef KERNEL_DTB_FILE_NAME
+#define CONFIG_BOOT_DTB_COMMAND "fatload mmc 0:1 0x21000000 " KERNEL_DTB_FILE_NAME "; "
+#else
+#define CONFIG_BOOT_DTB_COMMAND "fatload mmc 0:1 0x21000000 ${ek_name}.dtb; "
+#endif
+
+#define CONFIG_BOOTCOMMAND CONFIG_BOOT_DTB_COMMAND \
+ "fatload mmc 0:1 0x22000000 zImage; " \
+ "bootz 0x22000000 - 0x21000000"
#define CONFIG_BOOTARGS \
"console=ttyS0,115200 earlyprintk " \
"root=/dev/mmcblk0p2 rw rootwait"
diff --git a/include/configs/sama5d3_xplained.h b/include/configs/sama5d3_xplained.h
index c4141a0..e5de24b 100644
--- a/include/configs/sama5d3_xplained.h
+++ b/include/configs/sama5d3_xplained.h
@@ -13,6 +13,8 @@
/* No NOR flash, this definition should put before common header */
#define CONFIG_SYS_NO_FLASH
+#define KERNEL_DTB_FILE_NAME "at91-sama5d3_xplained.dtb"
+
#include "at91-sama5_common.h"
/* serial console */
@@ -124,15 +126,7 @@
"nand read 0x22000000 0x200000 0x600000;" \
"bootz 0x22000000 - 0x21000000"
#elif CONFIG_SYS_USE_MMC
-/* bootstrap + u-boot + env in sd card */
-#define CONFIG_ENV_IS_IN_FAT
-#define FAT_ENV_INTERFACE "mmc"
-#define FAT_ENV_FILE "uboot.env"
-#define FAT_ENV_DEVICE_AND_PART "0"
-#define CONFIG_ENV_SIZE 0x4000
-#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 at91-sama5d3_xplained.dtb; " \
- "fatload mmc 0:1 0x22000000 zImage; " \
- "bootz 0x22000000 - 0x21000000"
+/* override the bootcmd, bootargs and other configuration for sd/mmc env */
#else
#define CONFIG_ENV_IS_NOWHERE
#endif
diff --git a/include/configs/sama5d3xek.h b/include/configs/sama5d3xek.h
index 344ae9c..71441a4 100644
--- a/include/configs/sama5d3xek.h
+++ b/include/configs/sama5d3xek.h
@@ -176,15 +176,7 @@
"nand read 0x22000000 0x200000 0x600000;" \
"bootm 0x22000000 - 0x21000000"
#elif CONFIG_SYS_USE_MMC
-/* bootstrap + u-boot + env in sd card */
-#define CONFIG_ENV_IS_IN_FAT
-#define FAT_ENV_INTERFACE "mmc"
-#define FAT_ENV_FILE "uboot.env"
-#define FAT_ENV_DEVICE_AND_PART "0"
-#define CONFIG_ENV_SIZE 0x4000
-#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 ${ek_name}.dtb; " \
- "fatload mmc 0:1 0x22000000 zImage; " \
- "bootm 0x22000000 - 0x21000000"
+/* override the bootcmd, bootargs and other configuration for sd/mmc env */
#else
#define CONFIG_ENV_IS_NOWHERE
#endif
diff --git a/include/configs/sama5d4_xplained.h b/include/configs/sama5d4_xplained.h
index 5fb621e..a7d9e78 100644
--- a/include/configs/sama5d4_xplained.h
+++ b/include/configs/sama5d4_xplained.h
@@ -13,6 +13,8 @@
/* No NOR flash, this definition should put before common header */
#define CONFIG_SYS_NO_FLASH
+#define KERNEL_DTB_FILE_NAME "at91-sama5d4_xplained.dtb"
+
#include "at91-sama5_common.h"
/* serial console */
@@ -139,25 +141,9 @@
"nand read 0x22000000 0x200000 0x600000;" \
"bootz 0x22000000 - 0x21000000"
#elif CONFIG_SYS_USE_MMC
-/* bootstrap + u-boot + env in sd card */
-#define CONFIG_ENV_IS_IN_FAT
-#define CONFIG_FAT_WRITE
-#define FAT_ENV_INTERFACE "mmc"
-/*
- * We don't specify the part number, if device 0 has partition table, it means
- * the first partition; it no partition table, then take whole device as a
- * FAT file system.
- */
-#define FAT_ENV_DEVICE_AND_PART "0"
-#define FAT_ENV_FILE "uboot.env"
-#define CONFIG_ENV_SIZE 0x4000
-#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 at91-sama5d4_xplained.dtb; " \
- "fatload mmc 0:1 0x22000000 zImage; " \
- "bootz 0x22000000 - 0x21000000"
+/* override the bootcmd, bootargs and other configuration for sd/mmc env */
#endif
-
-
/* SPL */
#define CONFIG_SPL_FRAMEWORK
#define CONFIG_SPL_TEXT_BASE 0x200000
diff --git a/include/configs/sama5d4ek.h b/include/configs/sama5d4ek.h
index 546d7a3..8ecb6d3 100644
--- a/include/configs/sama5d4ek.h
+++ b/include/configs/sama5d4ek.h
@@ -13,6 +13,8 @@
/* No NOR flash, this definition should put before common header */
#define CONFIG_SYS_NO_FLASH
+#define KERNEL_DTB_FILE_NAME "sama5d4ek.dtb"
+
#include "at91-sama5_common.h"
/* serial console */
@@ -137,21 +139,7 @@
"nand read 0x22000000 0x200000 0x600000;" \
"bootz 0x22000000 - 0x21000000"
#elif CONFIG_SYS_USE_MMC
-/* bootstrap + u-boot + env in sd card */
-#define CONFIG_ENV_IS_IN_FAT
-#define CONFIG_FAT_WRITE
-#define FAT_ENV_INTERFACE "mmc"
-/*
- * We don't specify the part number, if device 0 has partition table, it means
- * the first partition; it no partition table, then take whole device as a
- * FAT file system.
- */
-#define FAT_ENV_DEVICE_AND_PART "0"
-#define FAT_ENV_FILE "uboot.env"
-#define CONFIG_ENV_SIZE 0x4000
-#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 sama5d4ek.dtb; " \
- "fatload mmc 0:1 0x22000000 zImage; " \
- "bootz 0x22000000 - 0x21000000"
+/* override the bootcmd, bootargs and other configuration for sd/mmc env */
#endif
/* SPL */
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 2/3] ARM: at91: sama5: move the nandflash env config to at91-sama5_common.h
2015-07-07 11:08 [U-Boot] [PATCH 1/3] ARM: at91: sama5: move the sd/mmc env config to at91-sama5_common.h Josh Wu
@ 2015-07-07 11:08 ` Josh Wu
2015-07-07 11:08 ` [U-Boot] [PATCH 3/3] ARM: at91: sama5: update the spi flash mapping Josh Wu
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Josh Wu @ 2015-07-07 11:08 UTC (permalink / raw)
To: u-boot
As all sama5 nandflash env configurations are same, so move them to
at91-sama5_common.h.
Signed-off-by: Josh Wu <josh.wu@atmel.com>
---
include/configs/at91-sama5_common.h | 12 ++++++++++++
include/configs/sama5d3_xplained.h | 9 +--------
include/configs/sama5d3xek.h | 9 +--------
include/configs/sama5d4_xplained.h | 9 +--------
include/configs/sama5d4ek.h | 9 +--------
5 files changed, 16 insertions(+), 32 deletions(-)
diff --git a/include/configs/at91-sama5_common.h b/include/configs/at91-sama5_common.h
index 99fa0b1..90227ad 100644
--- a/include/configs/at91-sama5_common.h
+++ b/include/configs/at91-sama5_common.h
@@ -83,6 +83,18 @@
"256K(env),256k(env_redundent),256k(spare)," \
"512k(dtb),6M(kernel)ro,-(rootfs) " \
"rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs"
+
+#ifdef CONFIG_SYS_USE_NANDFLASH
+/* u-boot env in nand flash */
+#define CONFIG_ENV_IS_IN_NAND
+#define CONFIG_ENV_OFFSET 0xc0000
+#define CONFIG_ENV_OFFSET_REDUND 0x100000
+#define CONFIG_ENV_SIZE 0x20000
+#define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \
+ "nand read 0x22000000 0x200000 0x600000;" \
+ "bootz 0x22000000 - 0x21000000"
+#endif
+
#endif
#define CONFIG_BAUDRATE 115200
diff --git a/include/configs/sama5d3_xplained.h b/include/configs/sama5d3_xplained.h
index e5de24b..b0e9295 100644
--- a/include/configs/sama5d3_xplained.h
+++ b/include/configs/sama5d3_xplained.h
@@ -117,14 +117,7 @@
#define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */
#if CONFIG_SYS_USE_NANDFLASH
-/* bootstrap + u-boot + env in nandflash */
-#define CONFIG_ENV_IS_IN_NAND
-#define CONFIG_ENV_OFFSET 0xc0000
-#define CONFIG_ENV_OFFSET_REDUND 0x100000
-#define CONFIG_ENV_SIZE 0x20000
-#define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \
- "nand read 0x22000000 0x200000 0x600000;" \
- "bootz 0x22000000 - 0x21000000"
+/* override the bootcmd, bootargs and other configuration for nandflash env */
#elif CONFIG_SYS_USE_MMC
/* override the bootcmd, bootargs and other configuration for sd/mmc env */
#else
diff --git a/include/configs/sama5d3xek.h b/include/configs/sama5d3xek.h
index 71441a4..6a19eb6 100644
--- a/include/configs/sama5d3xek.h
+++ b/include/configs/sama5d3xek.h
@@ -167,14 +167,7 @@
"sf read 0x22000000 0x42000 0x300000; " \
"bootm 0x22000000"
#elif CONFIG_SYS_USE_NANDFLASH
-/* bootstrap + u-boot + env in nandflash */
-#define CONFIG_ENV_IS_IN_NAND
-#define CONFIG_ENV_OFFSET 0xc0000
-#define CONFIG_ENV_OFFSET_REDUND 0x100000
-#define CONFIG_ENV_SIZE 0x20000
-#define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \
- "nand read 0x22000000 0x200000 0x600000;" \
- "bootm 0x22000000 - 0x21000000"
+/* override the bootcmd, bootargs and other configuration nandflash env */
#elif CONFIG_SYS_USE_MMC
/* override the bootcmd, bootargs and other configuration for sd/mmc env */
#else
diff --git a/include/configs/sama5d4_xplained.h b/include/configs/sama5d4_xplained.h
index a7d9e78..917d481 100644
--- a/include/configs/sama5d4_xplained.h
+++ b/include/configs/sama5d4_xplained.h
@@ -132,14 +132,7 @@
"sf read 0x22000000 0x100000 0x300000; " \
"bootz 0x22000000 - 0x21000000"
#elif CONFIG_SYS_USE_NANDFLASH
-/* bootstrap + u-boot + env in nandflash */
-#define CONFIG_ENV_IS_IN_NAND
-#define CONFIG_ENV_OFFSET 0xc0000
-#define CONFIG_ENV_OFFSET_REDUND 0x100000
-#define CONFIG_ENV_SIZE 0x20000
-#define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \
- "nand read 0x22000000 0x200000 0x600000;" \
- "bootz 0x22000000 - 0x21000000"
+/* override the bootcmd, bootargs and other configuration for nandflash env */
#elif CONFIG_SYS_USE_MMC
/* override the bootcmd, bootargs and other configuration for sd/mmc env */
#endif
diff --git a/include/configs/sama5d4ek.h b/include/configs/sama5d4ek.h
index 8ecb6d3..e21569b 100644
--- a/include/configs/sama5d4ek.h
+++ b/include/configs/sama5d4ek.h
@@ -130,14 +130,7 @@
"sf read 0x22000000 0x100000 0x300000; " \
"bootz 0x22000000 - 0x21000000"
#elif CONFIG_SYS_USE_NANDFLASH
-/* bootstrap + u-boot + env in nandflash */
-#define CONFIG_ENV_IS_IN_NAND
-#define CONFIG_ENV_OFFSET 0xc0000
-#define CONFIG_ENV_OFFSET_REDUND 0x100000
-#define CONFIG_ENV_SIZE 0x20000
-#define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \
- "nand read 0x22000000 0x200000 0x600000;" \
- "bootz 0x22000000 - 0x21000000"
+/* override the bootcmd, bootargs and other configuration for nandflash env*/
#elif CONFIG_SYS_USE_MMC
/* override the bootcmd, bootargs and other configuration for sd/mmc env */
#endif
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 3/3] ARM: at91: sama5: update the spi flash mapping
2015-07-07 11:08 [U-Boot] [PATCH 1/3] ARM: at91: sama5: move the sd/mmc env config to at91-sama5_common.h Josh Wu
2015-07-07 11:08 ` [U-Boot] [PATCH 2/3] ARM: at91: sama5: move the nandflash " Josh Wu
@ 2015-07-07 11:08 ` Josh Wu
2015-08-13 19:04 ` Jagan Teki
2015-08-19 2:21 ` [U-Boot] [PATCH 1/3] ARM: at91: sama5: move the sd/mmc env config to at91-sama5_common.h Josh Wu
2015-08-19 7:40 ` Andreas Bießmann
3 siblings, 1 reply; 7+ messages in thread
From: Josh Wu @ 2015-07-07 11:08 UTC (permalink / raw)
To: u-boot
Also move the spi flash configurations to the at91-sama5_common.h.
Current at91 zImage size is about 3.3M, the old mapping is not
suitable. So update the spi flash map as following:
0x0 ~ 0x004000: at91bootstrap(16k)
0x04000 ~ 0x008000: u-boot env(16k)
0x08000 ~ 0x060000: u-boot(352k)
0x60000 ~ 0x06c000: dtb (48k)
0x6c000 ~ 0x400000: kernel (3M+592k)
In AT91Bootstrap, the U-Boot in spi flash also update to 0x8000, refer
to following commit in AT91Bootstrap:
3e91e54 Kconfig: fix spi flash address
So also update SPL's u-boot load address to 0x8000 in spi flash.
Signed-off-by: Josh Wu <josh.wu@atmel.com>
---
include/configs/at91-sama5_common.h | 10 ++++++++++
include/configs/sama5d3xek.h | 11 ++---------
include/configs/sama5d4_xplained.h | 14 ++------------
include/configs/sama5d4ek.h | 14 ++------------
4 files changed, 16 insertions(+), 33 deletions(-)
diff --git a/include/configs/at91-sama5_common.h b/include/configs/at91-sama5_common.h
index 90227ad..89fa675 100644
--- a/include/configs/at91-sama5_common.h
+++ b/include/configs/at91-sama5_common.h
@@ -93,6 +93,16 @@
#define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \
"nand read 0x22000000 0x200000 0x600000;" \
"bootz 0x22000000 - 0x21000000"
+#elif CONFIG_SYS_USE_SERIALFLASH
+/* u-boot env in serial flash, by default is bus 0 and cs 0 */
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_ENV_OFFSET 0x4000
+#define CONFIG_ENV_SIZE 0x4000
+#define CONFIG_ENV_SECT_SIZE 0x1000
+#define CONFIG_BOOTCOMMAND "sf probe 0; " \
+ "sf read 0x21000000 0x60000 0xc000; " \
+ "sf read 0x22000000 0x6c000 0x394000; " \
+ "bootz 0x22000000 - 0x21000000"
#endif
#endif
diff --git a/include/configs/sama5d3xek.h b/include/configs/sama5d3xek.h
index 6a19eb6..d26ef7d 100644
--- a/include/configs/sama5d3xek.h
+++ b/include/configs/sama5d3xek.h
@@ -158,14 +158,7 @@
#define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */
#ifdef CONFIG_SYS_USE_SERIALFLASH
-/* bootstrap + u-boot + env + linux in serial flash */
-#define CONFIG_ENV_IS_IN_SPI_FLASH
-#define CONFIG_ENV_OFFSET 0x5000
-#define CONFIG_ENV_SIZE 0x3000
-#define CONFIG_ENV_SECT_SIZE 0x1000
-#define CONFIG_BOOTCOMMAND "sf probe 0; " \
- "sf read 0x22000000 0x42000 0x300000; " \
- "bootm 0x22000000"
+/* override the bootcmd, bootargs and other configuration for spi flash env*/
#elif CONFIG_SYS_USE_NANDFLASH
/* override the bootcmd, bootargs and other configuration nandflash env */
#elif CONFIG_SYS_USE_MMC
@@ -218,7 +211,7 @@
#define CONFIG_SPL_SPI_SUPPORT
#define CONFIG_SPL_SPI_FLASH_SUPPORT
#define CONFIG_SPL_SPI_LOAD
-#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x8400
+#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x8000
#endif
diff --git a/include/configs/sama5d4_xplained.h b/include/configs/sama5d4_xplained.h
index 917d481..592c99f 100644
--- a/include/configs/sama5d4_xplained.h
+++ b/include/configs/sama5d4_xplained.h
@@ -120,17 +120,7 @@
#endif
#ifdef CONFIG_SYS_USE_SERIALFLASH
-/* bootstrap + u-boot + env + linux in serial flash */
-#define CONFIG_ENV_IS_IN_SPI_FLASH
-#define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS
-#define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS
-#define CONFIG_ENV_OFFSET 0x10000
-#define CONFIG_ENV_SIZE 0x10000
-#define CONFIG_ENV_SECT_SIZE 0x1000
-#define CONFIG_BOOTCOMMAND "sf probe 0; " \
- "sf read 0x21000000 0xa0000 0x60000; " \
- "sf read 0x22000000 0x100000 0x300000; " \
- "bootz 0x22000000 - 0x21000000"
+/* override the bootcmd, bootargs and other configuration for spi flash env */
#elif CONFIG_SYS_USE_NANDFLASH
/* override the bootcmd, bootargs and other configuration for nandflash env */
#elif CONFIG_SYS_USE_MMC
@@ -183,7 +173,7 @@
#define CONFIG_SPL_SPI_SUPPORT
#define CONFIG_SPL_SPI_FLASH_SUPPORT
#define CONFIG_SPL_SPI_LOAD
-#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000
+#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x8000
#endif
#endif
diff --git a/include/configs/sama5d4ek.h b/include/configs/sama5d4ek.h
index e21569b..611e575 100644
--- a/include/configs/sama5d4ek.h
+++ b/include/configs/sama5d4ek.h
@@ -118,17 +118,7 @@
#define CONFIG_SYS_CONSOLE_IS_IN_ENV
#ifdef CONFIG_SYS_USE_SERIALFLASH
-/* bootstrap + u-boot + env + linux in serial flash */
-#define CONFIG_ENV_IS_IN_SPI_FLASH
-#define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS
-#define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS
-#define CONFIG_ENV_OFFSET 0x10000
-#define CONFIG_ENV_SIZE 0x10000
-#define CONFIG_ENV_SECT_SIZE 0x1000
-#define CONFIG_BOOTCOMMAND "sf probe 0; " \
- "sf read 0x21000000 0xa0000 0x60000; " \
- "sf read 0x22000000 0x100000 0x300000; " \
- "bootz 0x22000000 - 0x21000000"
+/* override the bootcmd, bootargs and other configuration for spi flash env*/
#elif CONFIG_SYS_USE_NANDFLASH
/* override the bootcmd, bootargs and other configuration for nandflash env*/
#elif CONFIG_SYS_USE_MMC
@@ -181,7 +171,7 @@
#define CONFIG_SPL_SPI_SUPPORT
#define CONFIG_SPL_SPI_FLASH_SUPPORT
#define CONFIG_SPL_SPI_LOAD
-#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000
+#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x8000
#endif
#endif
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 3/3] ARM: at91: sama5: update the spi flash mapping
2015-07-07 11:08 ` [U-Boot] [PATCH 3/3] ARM: at91: sama5: update the spi flash mapping Josh Wu
@ 2015-08-13 19:04 ` Jagan Teki
0 siblings, 0 replies; 7+ messages in thread
From: Jagan Teki @ 2015-08-13 19:04 UTC (permalink / raw)
To: u-boot
On 7 July 2015 at 16:38, Josh Wu <josh.wu@atmel.com> wrote:
> Also move the spi flash configurations to the at91-sama5_common.h.
>
> Current at91 zImage size is about 3.3M, the old mapping is not
> suitable. So update the spi flash map as following:
> 0x0 ~ 0x004000: at91bootstrap(16k)
> 0x04000 ~ 0x008000: u-boot env(16k)
> 0x08000 ~ 0x060000: u-boot(352k)
> 0x60000 ~ 0x06c000: dtb (48k)
> 0x6c000 ~ 0x400000: kernel (3M+592k)
>
> In AT91Bootstrap, the U-Boot in spi flash also update to 0x8000, refer
> to following commit in AT91Bootstrap:
> 3e91e54 Kconfig: fix spi flash address
>
> So also update SPL's u-boot load address to 0x8000 in spi flash.
>
> Signed-off-by: Josh Wu <josh.wu@atmel.com>
> ---
Reviewed-by: Jagan Teki <jteki@openedev.com>
>
> include/configs/at91-sama5_common.h | 10 ++++++++++
> include/configs/sama5d3xek.h | 11 ++---------
> include/configs/sama5d4_xplained.h | 14 ++------------
> include/configs/sama5d4ek.h | 14 ++------------
> 4 files changed, 16 insertions(+), 33 deletions(-)
>
> diff --git a/include/configs/at91-sama5_common.h b/include/configs/at91-sama5_common.h
> index 90227ad..89fa675 100644
> --- a/include/configs/at91-sama5_common.h
> +++ b/include/configs/at91-sama5_common.h
> @@ -93,6 +93,16 @@
> #define CONFIG_BOOTCOMMAND "nand read 0x21000000 0x180000 0x80000;" \
> "nand read 0x22000000 0x200000 0x600000;" \
> "bootz 0x22000000 - 0x21000000"
> +#elif CONFIG_SYS_USE_SERIALFLASH
> +/* u-boot env in serial flash, by default is bus 0 and cs 0 */
> +#define CONFIG_ENV_IS_IN_SPI_FLASH
> +#define CONFIG_ENV_OFFSET 0x4000
> +#define CONFIG_ENV_SIZE 0x4000
> +#define CONFIG_ENV_SECT_SIZE 0x1000
> +#define CONFIG_BOOTCOMMAND "sf probe 0; " \
> + "sf read 0x21000000 0x60000 0xc000; " \
> + "sf read 0x22000000 0x6c000 0x394000; " \
> + "bootz 0x22000000 - 0x21000000"
> #endif
>
> #endif
> diff --git a/include/configs/sama5d3xek.h b/include/configs/sama5d3xek.h
> index 6a19eb6..d26ef7d 100644
> --- a/include/configs/sama5d3xek.h
> +++ b/include/configs/sama5d3xek.h
> @@ -158,14 +158,7 @@
> #define CONFIG_SYS_LOAD_ADDR 0x22000000 /* load address */
>
> #ifdef CONFIG_SYS_USE_SERIALFLASH
> -/* bootstrap + u-boot + env + linux in serial flash */
> -#define CONFIG_ENV_IS_IN_SPI_FLASH
> -#define CONFIG_ENV_OFFSET 0x5000
> -#define CONFIG_ENV_SIZE 0x3000
> -#define CONFIG_ENV_SECT_SIZE 0x1000
> -#define CONFIG_BOOTCOMMAND "sf probe 0; " \
> - "sf read 0x22000000 0x42000 0x300000; " \
> - "bootm 0x22000000"
> +/* override the bootcmd, bootargs and other configuration for spi flash env*/
> #elif CONFIG_SYS_USE_NANDFLASH
> /* override the bootcmd, bootargs and other configuration nandflash env */
> #elif CONFIG_SYS_USE_MMC
> @@ -218,7 +211,7 @@
> #define CONFIG_SPL_SPI_SUPPORT
> #define CONFIG_SPL_SPI_FLASH_SUPPORT
> #define CONFIG_SPL_SPI_LOAD
> -#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x8400
> +#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x8000
>
> #endif
>
> diff --git a/include/configs/sama5d4_xplained.h b/include/configs/sama5d4_xplained.h
> index 917d481..592c99f 100644
> --- a/include/configs/sama5d4_xplained.h
> +++ b/include/configs/sama5d4_xplained.h
> @@ -120,17 +120,7 @@
> #endif
>
> #ifdef CONFIG_SYS_USE_SERIALFLASH
> -/* bootstrap + u-boot + env + linux in serial flash */
> -#define CONFIG_ENV_IS_IN_SPI_FLASH
> -#define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS
> -#define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS
> -#define CONFIG_ENV_OFFSET 0x10000
> -#define CONFIG_ENV_SIZE 0x10000
> -#define CONFIG_ENV_SECT_SIZE 0x1000
> -#define CONFIG_BOOTCOMMAND "sf probe 0; " \
> - "sf read 0x21000000 0xa0000 0x60000; " \
> - "sf read 0x22000000 0x100000 0x300000; " \
> - "bootz 0x22000000 - 0x21000000"
> +/* override the bootcmd, bootargs and other configuration for spi flash env */
> #elif CONFIG_SYS_USE_NANDFLASH
> /* override the bootcmd, bootargs and other configuration for nandflash env */
> #elif CONFIG_SYS_USE_MMC
> @@ -183,7 +173,7 @@
> #define CONFIG_SPL_SPI_SUPPORT
> #define CONFIG_SPL_SPI_FLASH_SUPPORT
> #define CONFIG_SPL_SPI_LOAD
> -#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000
> +#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x8000
>
> #endif
> #endif
> diff --git a/include/configs/sama5d4ek.h b/include/configs/sama5d4ek.h
> index e21569b..611e575 100644
> --- a/include/configs/sama5d4ek.h
> +++ b/include/configs/sama5d4ek.h
> @@ -118,17 +118,7 @@
> #define CONFIG_SYS_CONSOLE_IS_IN_ENV
>
> #ifdef CONFIG_SYS_USE_SERIALFLASH
> -/* bootstrap + u-boot + env + linux in serial flash */
> -#define CONFIG_ENV_IS_IN_SPI_FLASH
> -#define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS
> -#define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS
> -#define CONFIG_ENV_OFFSET 0x10000
> -#define CONFIG_ENV_SIZE 0x10000
> -#define CONFIG_ENV_SECT_SIZE 0x1000
> -#define CONFIG_BOOTCOMMAND "sf probe 0; " \
> - "sf read 0x21000000 0xa0000 0x60000; " \
> - "sf read 0x22000000 0x100000 0x300000; " \
> - "bootz 0x22000000 - 0x21000000"
> +/* override the bootcmd, bootargs and other configuration for spi flash env*/
> #elif CONFIG_SYS_USE_NANDFLASH
> /* override the bootcmd, bootargs and other configuration for nandflash env*/
> #elif CONFIG_SYS_USE_MMC
> @@ -181,7 +171,7 @@
> #define CONFIG_SPL_SPI_SUPPORT
> #define CONFIG_SPL_SPI_FLASH_SUPPORT
> #define CONFIG_SPL_SPI_LOAD
> -#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000
> +#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x8000
>
> #endif
> #endif
> --
> 1.9.1
>
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
--
Jagan | openedev.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 1/3] ARM: at91: sama5: move the sd/mmc env config to at91-sama5_common.h
2015-07-07 11:08 [U-Boot] [PATCH 1/3] ARM: at91: sama5: move the sd/mmc env config to at91-sama5_common.h Josh Wu
2015-07-07 11:08 ` [U-Boot] [PATCH 2/3] ARM: at91: sama5: move the nandflash " Josh Wu
2015-07-07 11:08 ` [U-Boot] [PATCH 3/3] ARM: at91: sama5: update the spi flash mapping Josh Wu
@ 2015-08-19 2:21 ` Josh Wu
2015-08-19 7:40 ` Andreas Bießmann
3 siblings, 0 replies; 7+ messages in thread
From: Josh Wu @ 2015-08-19 2:21 UTC (permalink / raw)
To: u-boot
Hi, Andreas
Any feedback for this patch serials.
Best Regards,
Josh Wu
On 7/7/2015 7:08 PM, Josh Wu wrote:
> As almost all sama5 sd/mmc env configurations are same, so move them to
> at91-sama5_common.h.
>
> Also we define a KERNEL_DTB_FILE_NAME as dtb file name for different
> board.
>
> Signed-off-by: Josh Wu <josh.wu@atmel.com>
> ---
> Hi,
>
> Those patches depends on the patch: http://patchwork.ozlabs.org/patch/485339/
>
> Best Regards,
> Josh Wu
>
> include/configs/at91-sama5_common.h | 17 +++++++++++++++++
> include/configs/sama5d3_xplained.h | 12 +++---------
> include/configs/sama5d3xek.h | 10 +---------
> include/configs/sama5d4_xplained.h | 20 +++-----------------
> include/configs/sama5d4ek.h | 18 +++---------------
> 5 files changed, 27 insertions(+), 50 deletions(-)
>
> diff --git a/include/configs/at91-sama5_common.h b/include/configs/at91-sama5_common.h
> index 9289964..99fa0b1 100644
> --- a/include/configs/at91-sama5_common.h
> +++ b/include/configs/at91-sama5_common.h
> @@ -56,6 +56,23 @@
> #define CONFIG_CMD_DHCP
>
> #ifdef CONFIG_SYS_USE_MMC
> +/* u-boot env in sd/mmc card */
> +#define CONFIG_ENV_IS_IN_FAT
> +#define CONFIG_FAT_WRITE
> +#define FAT_ENV_INTERFACE "mmc"
> +#define FAT_ENV_DEVICE_AND_PART "0"
> +#define FAT_ENV_FILE "uboot.env"
> +#define CONFIG_ENV_SIZE 0x4000
> +
> +#ifdef KERNEL_DTB_FILE_NAME
> +#define CONFIG_BOOT_DTB_COMMAND "fatload mmc 0:1 0x21000000 " KERNEL_DTB_FILE_NAME "; "
> +#else
> +#define CONFIG_BOOT_DTB_COMMAND "fatload mmc 0:1 0x21000000 ${ek_name}.dtb; "
> +#endif
> +
> +#define CONFIG_BOOTCOMMAND CONFIG_BOOT_DTB_COMMAND \
> + "fatload mmc 0:1 0x22000000 zImage; " \
> + "bootz 0x22000000 - 0x21000000"
> #define CONFIG_BOOTARGS \
> "console=ttyS0,115200 earlyprintk " \
> "root=/dev/mmcblk0p2 rw rootwait"
> diff --git a/include/configs/sama5d3_xplained.h b/include/configs/sama5d3_xplained.h
> index c4141a0..e5de24b 100644
> --- a/include/configs/sama5d3_xplained.h
> +++ b/include/configs/sama5d3_xplained.h
> @@ -13,6 +13,8 @@
> /* No NOR flash, this definition should put before common header */
> #define CONFIG_SYS_NO_FLASH
>
> +#define KERNEL_DTB_FILE_NAME "at91-sama5d3_xplained.dtb"
> +
> #include "at91-sama5_common.h"
>
> /* serial console */
> @@ -124,15 +126,7 @@
> "nand read 0x22000000 0x200000 0x600000;" \
> "bootz 0x22000000 - 0x21000000"
> #elif CONFIG_SYS_USE_MMC
> -/* bootstrap + u-boot + env in sd card */
> -#define CONFIG_ENV_IS_IN_FAT
> -#define FAT_ENV_INTERFACE "mmc"
> -#define FAT_ENV_FILE "uboot.env"
> -#define FAT_ENV_DEVICE_AND_PART "0"
> -#define CONFIG_ENV_SIZE 0x4000
> -#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 at91-sama5d3_xplained.dtb; " \
> - "fatload mmc 0:1 0x22000000 zImage; " \
> - "bootz 0x22000000 - 0x21000000"
> +/* override the bootcmd, bootargs and other configuration for sd/mmc env */
> #else
> #define CONFIG_ENV_IS_NOWHERE
> #endif
> diff --git a/include/configs/sama5d3xek.h b/include/configs/sama5d3xek.h
> index 344ae9c..71441a4 100644
> --- a/include/configs/sama5d3xek.h
> +++ b/include/configs/sama5d3xek.h
> @@ -176,15 +176,7 @@
> "nand read 0x22000000 0x200000 0x600000;" \
> "bootm 0x22000000 - 0x21000000"
> #elif CONFIG_SYS_USE_MMC
> -/* bootstrap + u-boot + env in sd card */
> -#define CONFIG_ENV_IS_IN_FAT
> -#define FAT_ENV_INTERFACE "mmc"
> -#define FAT_ENV_FILE "uboot.env"
> -#define FAT_ENV_DEVICE_AND_PART "0"
> -#define CONFIG_ENV_SIZE 0x4000
> -#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 ${ek_name}.dtb; " \
> - "fatload mmc 0:1 0x22000000 zImage; " \
> - "bootm 0x22000000 - 0x21000000"
> +/* override the bootcmd, bootargs and other configuration for sd/mmc env */
> #else
> #define CONFIG_ENV_IS_NOWHERE
> #endif
> diff --git a/include/configs/sama5d4_xplained.h b/include/configs/sama5d4_xplained.h
> index 5fb621e..a7d9e78 100644
> --- a/include/configs/sama5d4_xplained.h
> +++ b/include/configs/sama5d4_xplained.h
> @@ -13,6 +13,8 @@
> /* No NOR flash, this definition should put before common header */
> #define CONFIG_SYS_NO_FLASH
>
> +#define KERNEL_DTB_FILE_NAME "at91-sama5d4_xplained.dtb"
> +
> #include "at91-sama5_common.h"
>
> /* serial console */
> @@ -139,25 +141,9 @@
> "nand read 0x22000000 0x200000 0x600000;" \
> "bootz 0x22000000 - 0x21000000"
> #elif CONFIG_SYS_USE_MMC
> -/* bootstrap + u-boot + env in sd card */
> -#define CONFIG_ENV_IS_IN_FAT
> -#define CONFIG_FAT_WRITE
> -#define FAT_ENV_INTERFACE "mmc"
> -/*
> - * We don't specify the part number, if device 0 has partition table, it means
> - * the first partition; it no partition table, then take whole device as a
> - * FAT file system.
> - */
> -#define FAT_ENV_DEVICE_AND_PART "0"
> -#define FAT_ENV_FILE "uboot.env"
> -#define CONFIG_ENV_SIZE 0x4000
> -#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 at91-sama5d4_xplained.dtb; " \
> - "fatload mmc 0:1 0x22000000 zImage; " \
> - "bootz 0x22000000 - 0x21000000"
> +/* override the bootcmd, bootargs and other configuration for sd/mmc env */
> #endif
>
> -
> -
> /* SPL */
> #define CONFIG_SPL_FRAMEWORK
> #define CONFIG_SPL_TEXT_BASE 0x200000
> diff --git a/include/configs/sama5d4ek.h b/include/configs/sama5d4ek.h
> index 546d7a3..8ecb6d3 100644
> --- a/include/configs/sama5d4ek.h
> +++ b/include/configs/sama5d4ek.h
> @@ -13,6 +13,8 @@
> /* No NOR flash, this definition should put before common header */
> #define CONFIG_SYS_NO_FLASH
>
> +#define KERNEL_DTB_FILE_NAME "sama5d4ek.dtb"
> +
> #include "at91-sama5_common.h"
>
> /* serial console */
> @@ -137,21 +139,7 @@
> "nand read 0x22000000 0x200000 0x600000;" \
> "bootz 0x22000000 - 0x21000000"
> #elif CONFIG_SYS_USE_MMC
> -/* bootstrap + u-boot + env in sd card */
> -#define CONFIG_ENV_IS_IN_FAT
> -#define CONFIG_FAT_WRITE
> -#define FAT_ENV_INTERFACE "mmc"
> -/*
> - * We don't specify the part number, if device 0 has partition table, it means
> - * the first partition; it no partition table, then take whole device as a
> - * FAT file system.
> - */
> -#define FAT_ENV_DEVICE_AND_PART "0"
> -#define FAT_ENV_FILE "uboot.env"
> -#define CONFIG_ENV_SIZE 0x4000
> -#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 sama5d4ek.dtb; " \
> - "fatload mmc 0:1 0x22000000 zImage; " \
> - "bootz 0x22000000 - 0x21000000"
> +/* override the bootcmd, bootargs and other configuration for sd/mmc env */
> #endif
>
> /* SPL */
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 1/3] ARM: at91: sama5: move the sd/mmc env config to at91-sama5_common.h
2015-07-07 11:08 [U-Boot] [PATCH 1/3] ARM: at91: sama5: move the sd/mmc env config to at91-sama5_common.h Josh Wu
` (2 preceding siblings ...)
2015-08-19 2:21 ` [U-Boot] [PATCH 1/3] ARM: at91: sama5: move the sd/mmc env config to at91-sama5_common.h Josh Wu
@ 2015-08-19 7:40 ` Andreas Bießmann
2015-08-19 8:10 ` Josh Wu
3 siblings, 1 reply; 7+ messages in thread
From: Andreas Bießmann @ 2015-08-19 7:40 UTC (permalink / raw)
To: u-boot
Hi Josh,
On 07/07/2015 01:08 PM, Josh Wu wrote:
> As almost all sama5 sd/mmc env configurations are same, so move them to
> at91-sama5_common.h.
>
> Also we define a KERNEL_DTB_FILE_NAME as dtb file name for different
> board.
I don't like this new variable. At least we need some documentation in
README or even better Kconfig for it!
But I think we do not need it, let's see ...
>
> Signed-off-by: Josh Wu <josh.wu@atmel.com>
> ---
> Hi,
>
> Those patches depends on the patch: http://patchwork.ozlabs.org/patch/485339/
>
> Best Regards,
> Josh Wu
>
> include/configs/at91-sama5_common.h | 17 +++++++++++++++++
> include/configs/sama5d3_xplained.h | 12 +++---------
> include/configs/sama5d3xek.h | 10 +---------
> include/configs/sama5d4_xplained.h | 20 +++-----------------
> include/configs/sama5d4ek.h | 18 +++---------------
> 5 files changed, 27 insertions(+), 50 deletions(-)
>
> diff --git a/include/configs/at91-sama5_common.h b/include/configs/at91-sama5_common.h
> index 9289964..99fa0b1 100644
> --- a/include/configs/at91-sama5_common.h
> +++ b/include/configs/at91-sama5_common.h
> @@ -56,6 +56,23 @@
> #define CONFIG_CMD_DHCP
>
> #ifdef CONFIG_SYS_USE_MMC
> +/* u-boot env in sd/mmc card */
> +#define CONFIG_ENV_IS_IN_FAT
> +#define CONFIG_FAT_WRITE
> +#define FAT_ENV_INTERFACE "mmc"
> +#define FAT_ENV_DEVICE_AND_PART "0"
> +#define FAT_ENV_FILE "uboot.env"
> +#define CONFIG_ENV_SIZE 0x4000
> +
> +#ifdef KERNEL_DTB_FILE_NAME
> +#define CONFIG_BOOT_DTB_COMMAND "fatload mmc 0:1 0x21000000 " KERNEL_DTB_FILE_NAME "; "
> +#else
> +#define CONFIG_BOOT_DTB_COMMAND "fatload mmc 0:1 0x21000000 ${ek_name}.dtb; "
> +#endif
> +
> +#define CONFIG_BOOTCOMMAND CONFIG_BOOT_DTB_COMMAND \
> + "fatload mmc 0:1 0x22000000 zImage; " \
> + "bootz 0x22000000 - 0x21000000"
> #define CONFIG_BOOTARGS \
> "console=ttyS0,115200 earlyprintk " \
> "root=/dev/mmcblk0p2 rw rootwait"
> diff --git a/include/configs/sama5d3_xplained.h b/include/configs/sama5d3_xplained.h
> index c4141a0..e5de24b 100644
> --- a/include/configs/sama5d3_xplained.h
> +++ b/include/configs/sama5d3_xplained.h
> @@ -13,6 +13,8 @@
> /* No NOR flash, this definition should put before common header */
> #define CONFIG_SYS_NO_FLASH
>
> +#define KERNEL_DTB_FILE_NAME "at91-sama5d3_xplained.dtb"
This is "at91-" + $CONFIG_SYS_BOARD + ".dtb"
> +
> #include "at91-sama5_common.h"
>
> /* serial console */
> @@ -124,15 +126,7 @@
> "nand read 0x22000000 0x200000 0x600000;" \
> "bootz 0x22000000 - 0x21000000"
> #elif CONFIG_SYS_USE_MMC
> -/* bootstrap + u-boot + env in sd card */
> -#define CONFIG_ENV_IS_IN_FAT
> -#define FAT_ENV_INTERFACE "mmc"
> -#define FAT_ENV_FILE "uboot.env"
> -#define FAT_ENV_DEVICE_AND_PART "0"
> -#define CONFIG_ENV_SIZE 0x4000
> -#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 at91-sama5d3_xplained.dtb; " \
> - "fatload mmc 0:1 0x22000000 zImage; " \
> - "bootz 0x22000000 - 0x21000000"
> +/* override the bootcmd, bootargs and other configuration for sd/mmc env */
> #else
> #define CONFIG_ENV_IS_NOWHERE
> #endif
> diff --git a/include/configs/sama5d3xek.h b/include/configs/sama5d3xek.h
> index 344ae9c..71441a4 100644
> --- a/include/configs/sama5d3xek.h
> +++ b/include/configs/sama5d3xek.h
> @@ -176,15 +176,7 @@
> "nand read 0x22000000 0x200000 0x600000;" \
> "bootm 0x22000000 - 0x21000000"
> #elif CONFIG_SYS_USE_MMC
> -/* bootstrap + u-boot + env in sd card */
> -#define CONFIG_ENV_IS_IN_FAT
> -#define FAT_ENV_INTERFACE "mmc"
> -#define FAT_ENV_FILE "uboot.env"
> -#define FAT_ENV_DEVICE_AND_PART "0"
> -#define CONFIG_ENV_SIZE 0x4000
> -#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 ${ek_name}.dtb; " \
> - "fatload mmc 0:1 0x22000000 zImage; " \
> - "bootm 0x22000000 - 0x21000000"
> +/* override the bootcmd, bootargs and other configuration for sd/mmc env */
> #else
> #define CONFIG_ENV_IS_NOWHERE
> #endif
> diff --git a/include/configs/sama5d4_xplained.h b/include/configs/sama5d4_xplained.h
> index 5fb621e..a7d9e78 100644
> --- a/include/configs/sama5d4_xplained.h
> +++ b/include/configs/sama5d4_xplained.h
> @@ -13,6 +13,8 @@
> /* No NOR flash, this definition should put before common header */
> #define CONFIG_SYS_NO_FLASH
>
> +#define KERNEL_DTB_FILE_NAME "at91-sama5d4_xplained.dtb"
This is also "at91-" + $CONFIG_SYS_BOARD + ".dtb"
> +
> #include "at91-sama5_common.h"
>
> /* serial console */
> @@ -139,25 +141,9 @@
> "nand read 0x22000000 0x200000 0x600000;" \
> "bootz 0x22000000 - 0x21000000"
> #elif CONFIG_SYS_USE_MMC
> -/* bootstrap + u-boot + env in sd card */
> -#define CONFIG_ENV_IS_IN_FAT
> -#define CONFIG_FAT_WRITE
> -#define FAT_ENV_INTERFACE "mmc"
> -/*
> - * We don't specify the part number, if device 0 has partition table, it means
> - * the first partition; it no partition table, then take whole device as a
> - * FAT file system.
> - */
> -#define FAT_ENV_DEVICE_AND_PART "0"
> -#define FAT_ENV_FILE "uboot.env"
> -#define CONFIG_ENV_SIZE 0x4000
> -#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 at91-sama5d4_xplained.dtb; " \
> - "fatload mmc 0:1 0x22000000 zImage; " \
> - "bootz 0x22000000 - 0x21000000"
> +/* override the bootcmd, bootargs and other configuration for sd/mmc env */
> #endif
>
> -
> -
> /* SPL */
> #define CONFIG_SPL_FRAMEWORK
> #define CONFIG_SPL_TEXT_BASE 0x200000
> diff --git a/include/configs/sama5d4ek.h b/include/configs/sama5d4ek.h
> index 546d7a3..8ecb6d3 100644
> --- a/include/configs/sama5d4ek.h
> +++ b/include/configs/sama5d4ek.h
> @@ -13,6 +13,8 @@
> /* No NOR flash, this definition should put before common header */
> #define CONFIG_SYS_NO_FLASH
>
> +#define KERNEL_DTB_FILE_NAME "sama5d4ek.dtb"
Damn ... this lacks the presiding 'at91-'
So a solution could be to rename some board's with presiding 'at91-' and
just use the $board_name everywhere. Some board's may adopt the
$board_name at runtime.
What do you think about?
Andreas
> +
> #include "at91-sama5_common.h"
>
> /* serial console */
> @@ -137,21 +139,7 @@
> "nand read 0x22000000 0x200000 0x600000;" \
> "bootz 0x22000000 - 0x21000000"
> #elif CONFIG_SYS_USE_MMC
> -/* bootstrap + u-boot + env in sd card */
> -#define CONFIG_ENV_IS_IN_FAT
> -#define CONFIG_FAT_WRITE
> -#define FAT_ENV_INTERFACE "mmc"
> -/*
> - * We don't specify the part number, if device 0 has partition table, it means
> - * the first partition; it no partition table, then take whole device as a
> - * FAT file system.
> - */
> -#define FAT_ENV_DEVICE_AND_PART "0"
> -#define FAT_ENV_FILE "uboot.env"
> -#define CONFIG_ENV_SIZE 0x4000
> -#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 sama5d4ek.dtb; " \
> - "fatload mmc 0:1 0x22000000 zImage; " \
> - "bootz 0x22000000 - 0x21000000"
> +/* override the bootcmd, bootargs and other configuration for sd/mmc env */
> #endif
>
> /* SPL */
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH 1/3] ARM: at91: sama5: move the sd/mmc env config to at91-sama5_common.h
2015-08-19 7:40 ` Andreas Bießmann
@ 2015-08-19 8:10 ` Josh Wu
0 siblings, 0 replies; 7+ messages in thread
From: Josh Wu @ 2015-08-19 8:10 UTC (permalink / raw)
To: u-boot
Hi, Andreas
On 8/19/2015 3:40 PM, Andreas Bie?mann wrote:
> Hi Josh,
>
> On 07/07/2015 01:08 PM, Josh Wu wrote:
>> As almost all sama5 sd/mmc env configurations are same, so move them to
>> at91-sama5_common.h.
>>
>> Also we define a KERNEL_DTB_FILE_NAME as dtb file name for different
>> board.
> I don't like this new variable. At least we need some documentation in
> README or even better Kconfig for it!
> But I think we do not need it, let's see ...
>
>> Signed-off-by: Josh Wu <josh.wu@atmel.com>
>> ---
>> Hi,
>>
>> Those patches depends on the patch: http://patchwork.ozlabs.org/patch/485339/
>>
>> Best Regards,
>> Josh Wu
>>
>> include/configs/at91-sama5_common.h | 17 +++++++++++++++++
>> include/configs/sama5d3_xplained.h | 12 +++---------
>> include/configs/sama5d3xek.h | 10 +---------
>> include/configs/sama5d4_xplained.h | 20 +++-----------------
>> include/configs/sama5d4ek.h | 18 +++---------------
>> 5 files changed, 27 insertions(+), 50 deletions(-)
>>
>> diff --git a/include/configs/at91-sama5_common.h b/include/configs/at91-sama5_common.h
>> index 9289964..99fa0b1 100644
>> --- a/include/configs/at91-sama5_common.h
>> +++ b/include/configs/at91-sama5_common.h
>> @@ -56,6 +56,23 @@
>> #define CONFIG_CMD_DHCP
>>
>> #ifdef CONFIG_SYS_USE_MMC
>> +/* u-boot env in sd/mmc card */
>> +#define CONFIG_ENV_IS_IN_FAT
>> +#define CONFIG_FAT_WRITE
>> +#define FAT_ENV_INTERFACE "mmc"
>> +#define FAT_ENV_DEVICE_AND_PART "0"
>> +#define FAT_ENV_FILE "uboot.env"
>> +#define CONFIG_ENV_SIZE 0x4000
>> +
>> +#ifdef KERNEL_DTB_FILE_NAME
>> +#define CONFIG_BOOT_DTB_COMMAND "fatload mmc 0:1 0x21000000 " KERNEL_DTB_FILE_NAME "; "
>> +#else
>> +#define CONFIG_BOOT_DTB_COMMAND "fatload mmc 0:1 0x21000000 ${ek_name}.dtb; "
>> +#endif
>> +
>> +#define CONFIG_BOOTCOMMAND CONFIG_BOOT_DTB_COMMAND \
>> + "fatload mmc 0:1 0x22000000 zImage; " \
>> + "bootz 0x22000000 - 0x21000000"
>> #define CONFIG_BOOTARGS \
>> "console=ttyS0,115200 earlyprintk " \
>> "root=/dev/mmcblk0p2 rw rootwait"
>> diff --git a/include/configs/sama5d3_xplained.h b/include/configs/sama5d3_xplained.h
>> index c4141a0..e5de24b 100644
>> --- a/include/configs/sama5d3_xplained.h
>> +++ b/include/configs/sama5d3_xplained.h
>> @@ -13,6 +13,8 @@
>> /* No NOR flash, this definition should put before common header */
>> #define CONFIG_SYS_NO_FLASH
>>
>> +#define KERNEL_DTB_FILE_NAME "at91-sama5d3_xplained.dtb"
> This is "at91-" + $CONFIG_SYS_BOARD + ".dtb"
>
>> +
>> #include "at91-sama5_common.h"
>>
>> /* serial console */
>> @@ -124,15 +126,7 @@
>> "nand read 0x22000000 0x200000 0x600000;" \
>> "bootz 0x22000000 - 0x21000000"
>> #elif CONFIG_SYS_USE_MMC
>> -/* bootstrap + u-boot + env in sd card */
>> -#define CONFIG_ENV_IS_IN_FAT
>> -#define FAT_ENV_INTERFACE "mmc"
>> -#define FAT_ENV_FILE "uboot.env"
>> -#define FAT_ENV_DEVICE_AND_PART "0"
>> -#define CONFIG_ENV_SIZE 0x4000
>> -#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 at91-sama5d3_xplained.dtb; " \
>> - "fatload mmc 0:1 0x22000000 zImage; " \
>> - "bootz 0x22000000 - 0x21000000"
>> +/* override the bootcmd, bootargs and other configuration for sd/mmc env */
>> #else
>> #define CONFIG_ENV_IS_NOWHERE
>> #endif
>> diff --git a/include/configs/sama5d3xek.h b/include/configs/sama5d3xek.h
>> index 344ae9c..71441a4 100644
>> --- a/include/configs/sama5d3xek.h
>> +++ b/include/configs/sama5d3xek.h
>> @@ -176,15 +176,7 @@
>> "nand read 0x22000000 0x200000 0x600000;" \
>> "bootm 0x22000000 - 0x21000000"
>> #elif CONFIG_SYS_USE_MMC
>> -/* bootstrap + u-boot + env in sd card */
>> -#define CONFIG_ENV_IS_IN_FAT
>> -#define FAT_ENV_INTERFACE "mmc"
>> -#define FAT_ENV_FILE "uboot.env"
>> -#define FAT_ENV_DEVICE_AND_PART "0"
>> -#define CONFIG_ENV_SIZE 0x4000
>> -#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 ${ek_name}.dtb; " \
>> - "fatload mmc 0:1 0x22000000 zImage; " \
>> - "bootm 0x22000000 - 0x21000000"
>> +/* override the bootcmd, bootargs and other configuration for sd/mmc env */
>> #else
>> #define CONFIG_ENV_IS_NOWHERE
>> #endif
>> diff --git a/include/configs/sama5d4_xplained.h b/include/configs/sama5d4_xplained.h
>> index 5fb621e..a7d9e78 100644
>> --- a/include/configs/sama5d4_xplained.h
>> +++ b/include/configs/sama5d4_xplained.h
>> @@ -13,6 +13,8 @@
>> /* No NOR flash, this definition should put before common header */
>> #define CONFIG_SYS_NO_FLASH
>>
>> +#define KERNEL_DTB_FILE_NAME "at91-sama5d4_xplained.dtb"
> This is also "at91-" + $CONFIG_SYS_BOARD + ".dtb"
>
>> +
>> #include "at91-sama5_common.h"
>>
>> /* serial console */
>> @@ -139,25 +141,9 @@
>> "nand read 0x22000000 0x200000 0x600000;" \
>> "bootz 0x22000000 - 0x21000000"
>> #elif CONFIG_SYS_USE_MMC
>> -/* bootstrap + u-boot + env in sd card */
>> -#define CONFIG_ENV_IS_IN_FAT
>> -#define CONFIG_FAT_WRITE
>> -#define FAT_ENV_INTERFACE "mmc"
>> -/*
>> - * We don't specify the part number, if device 0 has partition table, it means
>> - * the first partition; it no partition table, then take whole device as a
>> - * FAT file system.
>> - */
>> -#define FAT_ENV_DEVICE_AND_PART "0"
>> -#define FAT_ENV_FILE "uboot.env"
>> -#define CONFIG_ENV_SIZE 0x4000
>> -#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 at91-sama5d4_xplained.dtb; " \
>> - "fatload mmc 0:1 0x22000000 zImage; " \
>> - "bootz 0x22000000 - 0x21000000"
>> +/* override the bootcmd, bootargs and other configuration for sd/mmc env */
>> #endif
>>
>> -
>> -
>> /* SPL */
>> #define CONFIG_SPL_FRAMEWORK
>> #define CONFIG_SPL_TEXT_BASE 0x200000
>> diff --git a/include/configs/sama5d4ek.h b/include/configs/sama5d4ek.h
>> index 546d7a3..8ecb6d3 100644
>> --- a/include/configs/sama5d4ek.h
>> +++ b/include/configs/sama5d4ek.h
>> @@ -13,6 +13,8 @@
>> /* No NOR flash, this definition should put before common header */
>> #define CONFIG_SYS_NO_FLASH
>>
>> +#define KERNEL_DTB_FILE_NAME "sama5d4ek.dtb"
> Damn ... this lacks the presiding 'at91-'
>
> So a solution could be to rename some board's with presiding 'at91-' and
> just use the $board_name everywhere. Some board's may adopt the
> $board_name at runtime.
> What do you think about?
I think use $board_name is a good idea. We can use $board_name to
combine the dtb name.
And also we can use the CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG to override
the $board_name if $board_name is not what we need exactly.
I will re-spin the v2 version patches soon. Thanks for the review.
Best Regards,
Josh Wu
>
> Andreas
>
>> +
>> #include "at91-sama5_common.h"
>>
>> /* serial console */
>> @@ -137,21 +139,7 @@
>> "nand read 0x22000000 0x200000 0x600000;" \
>> "bootz 0x22000000 - 0x21000000"
>> #elif CONFIG_SYS_USE_MMC
>> -/* bootstrap + u-boot + env in sd card */
>> -#define CONFIG_ENV_IS_IN_FAT
>> -#define CONFIG_FAT_WRITE
>> -#define FAT_ENV_INTERFACE "mmc"
>> -/*
>> - * We don't specify the part number, if device 0 has partition table, it means
>> - * the first partition; it no partition table, then take whole device as a
>> - * FAT file system.
>> - */
>> -#define FAT_ENV_DEVICE_AND_PART "0"
>> -#define FAT_ENV_FILE "uboot.env"
>> -#define CONFIG_ENV_SIZE 0x4000
>> -#define CONFIG_BOOTCOMMAND "fatload mmc 0:1 0x21000000 sama5d4ek.dtb; " \
>> - "fatload mmc 0:1 0x22000000 zImage; " \
>> - "bootz 0x22000000 - 0x21000000"
>> +/* override the bootcmd, bootargs and other configuration for sd/mmc env */
>> #endif
>>
>> /* SPL */
>>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-08-19 8:10 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-07 11:08 [U-Boot] [PATCH 1/3] ARM: at91: sama5: move the sd/mmc env config to at91-sama5_common.h Josh Wu
2015-07-07 11:08 ` [U-Boot] [PATCH 2/3] ARM: at91: sama5: move the nandflash " Josh Wu
2015-07-07 11:08 ` [U-Boot] [PATCH 3/3] ARM: at91: sama5: update the spi flash mapping Josh Wu
2015-08-13 19:04 ` Jagan Teki
2015-08-19 2:21 ` [U-Boot] [PATCH 1/3] ARM: at91: sama5: move the sd/mmc env config to at91-sama5_common.h Josh Wu
2015-08-19 7:40 ` Andreas Bießmann
2015-08-19 8:10 ` Josh Wu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox