From: Josh Wu <josh.wu@atmel.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/3] ARM: at91: sama5: move the sd/mmc env config to at91-sama5_common.h
Date: Wed, 19 Aug 2015 16:10:57 +0800 [thread overview]
Message-ID: <55D43A11.6010206@atmel.com> (raw)
In-Reply-To: <55D43309.1050109@gmail.com>
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 */
>>
prev parent reply other threads:[~2015-08-19 8:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55D43A11.6010206@atmel.com \
--to=josh.wu@atmel.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.