[U-Boot] [PATCH 0/7] arm: add runtime envs describing build configuration

This patchset adds runtime variables for Samsung boards that describe build configuration (arch, soc, board, vendor).
Additionally, more envs describing platform (soc and board revision) are added to Samsung common code.
For boards Trats and Trats2, based on the added envs, 'fdtaddr' env is set and dual kernel boot is enabled: - with separated DTB if the DTB file is loaded successfully; - with DTB apppended to uImage if DTB file is not found; This is neccesssary for backward compatibilty.
Piotr Wilczek (7): arm:exynos: add cpu revision arm:s5pc110: add cpu revision board:samsung:common: set envs with board unified information board:samsung:goni: add env variables describing platform board:samsung:universal: add env variables describing platform board:samsung:trats: enable boot with appended and separated DTB board:samsung:trats2: enable boot with appended and separated DTB
arch/arm/include/asm/arch-exynos/cpu.h | 8 ++++++-- arch/arm/include/asm/arch-s5pc1xx/cpu.h | 7 +++++++ board/samsung/common/misc.c | 29 +++++++++++++++++++++++++++++ board/samsung/goni/goni.c | 5 +++++ include/configs/s5p_goni.h | 4 ++++ include/configs/s5pc210_universal.h | 5 +++++ include/configs/trats.h | 14 +++++++++++--- include/configs/trats2.h | 13 ++++++++++--- 8 files changed, 77 insertions(+), 8 deletions(-)

This patch enables to read cpu revision on Exynos CPU.
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com --- arch/arm/include/asm/arch-exynos/cpu.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm/include/asm/arch-exynos/cpu.h b/arch/arm/include/asm/arch-exynos/cpu.h index 573f755..bccce63 100644 --- a/arch/arm/include/asm/arch-exynos/cpu.h +++ b/arch/arm/include/asm/arch-exynos/cpu.h @@ -185,9 +185,11 @@ static inline int s5p_get_cpu_rev(void)
static inline void s5p_set_cpu_id(void) { - unsigned int pro_id = (readl(EXYNOS4_PRO_ID) & 0x00FFF000) >> 12; + unsigned int pro_id = readl(EXYNOS4_PRO_ID); + unsigned int cpu_id = (pro_id & 0x00FFF000) >> 12; + unsigned int cpu_rev = pro_id & 0x000000FF;
- switch (pro_id) { + switch (cpu_id) { case 0x200: /* Exynos4210 EVT0 */ s5p_cpu_id = 0x4210; @@ -196,10 +198,12 @@ static inline void s5p_set_cpu_id(void) case 0x210: /* Exynos4210 EVT1 */ s5p_cpu_id = 0x4210; + s5p_cpu_rev = cpu_rev; break; case 0x412: /* Exynos4412 */ s5p_cpu_id = 0x4412; + s5p_cpu_rev = cpu_rev; break; case 0x520: /* Exynos5250 */

This patch adds s5p_cpu_rev.
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com --- arch/arm/include/asm/arch-s5pc1xx/cpu.h | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/arch/arm/include/asm/arch-s5pc1xx/cpu.h b/arch/arm/include/asm/arch-s5pc1xx/cpu.h index 4fc5a0c..5ae5c87 100644 --- a/arch/arm/include/asm/arch-s5pc1xx/cpu.h +++ b/arch/arm/include/asm/arch-s5pc1xx/cpu.h @@ -51,10 +51,17 @@ #include <asm/io.h> /* CPU detection macros */ extern unsigned int s5p_cpu_id; +extern unsigned int s5p_cpu_rev; + +static inline int s5p_get_cpu_rev(void) +{ + return s5p_cpu_rev; +}
static inline void s5p_set_cpu_id(void) { s5p_cpu_id = readl(S5PC100_PRO_ID); + s5p_cpu_rev = s5p_cpu_id & 0x000000FF; s5p_cpu_id = 0xC000 | ((s5p_cpu_id & 0x00FFF000) >> 12); }

This patch enables to set envs that describe board information. The following envs are set (but not saved): soc_id, soc_rev, board_rev.
Based on this information, 'fdtaddr' env is set (not saved) as: fdtaddr=${soc_family}${soc_id}-${board}.dtb
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com --- board/samsung/common/misc.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c index 3764d12..2d81df9 100644 --- a/board/samsung/common/misc.c +++ b/board/samsung/common/misc.c @@ -7,8 +7,37 @@
#include <common.h>
+extern u32 get_board_rev(void); + +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG +void set_board_info(void) +{ + char info[64]; + + snprintf(info, ARRAY_SIZE(info), "%d.%d", s5p_cpu_rev & 0x0f, + (s5p_cpu_rev & 0xf0) >> 0x04); + setenv("soc_rev", info); + + snprintf(info, ARRAY_SIZE(info), "%x", s5p_cpu_id); + setenv("soc_id", info); + + snprintf(info, ARRAY_SIZE(info), "%x", get_board_rev()); + setenv("board_rev", info); + +#ifdef CONFIG_OF_LIBFDT + snprintf(info, ARRAY_SIZE(info), "%s%x-%s.dtb", + CONFIG_SYS_SOC, s5p_cpu_id, CONFIG_SYS_BOARD); + setenv("fdtfile", info); +#endif +} +#endif + /* Common for Samsung boards */ int misc_init_r(void) { +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + set_board_info(); +#endif + return 0; }

On Tue, Jan 14, 2014 at 08:59 +0100, Piotr Wilczek wrote:
This patch enables to set envs that describe board information. The following envs are set (but not saved): soc_id, soc_rev, board_rev.
I don't see the "not saved" part in the patch. How exactly does a "saveenv" not save those programmatically generated variables? (Altera SoCFPGA suffers from the same issue, we may not want to repeat this in mainline U-Boot)
Based on this information, 'fdtaddr' env is set (not saved) as: fdtaddr=${soc_family}${soc_id}-${board}.dtb
An address variable resolves to a DTB filename? That would be unexpected. Or is it a typo in the commit message?
virtually yours Gerhard Sittig

-----Original Message----- From: Gerhard Sittig [mailto:gsi@denx.de] Sent: Wednesday, January 15, 2014 5:18 PM To: Piotr Wilczek Cc: u-boot@lists.denx.de; Kyungmin Park Subject: Re: [U-Boot] [PATCH 3/7] board:samsung:common: set envs with board unified information
On Tue, Jan 14, 2014 at 08:59 +0100, Piotr Wilczek wrote:
This patch enables to set envs that describe board information. The following envs are set (but not saved): soc_id, soc_rev,
board_rev.
I don't see the "not saved" part in the patch. How exactly does a "saveenv" not save those programmatically generated variables? (Altera SoCFPGA suffers from the same issue, we may not want to repeat this in mainline U-Boot)
It means only that I don't save the generated variables to persistent storage. I will modify the commit message to be more specific.
Based on this information, 'fdtaddr' env is set (not saved) as: fdtaddr=${soc_family}${soc_id}-${board}.dtb
An address variable resolves to a DTB filename? That would be unexpected. Or is it a typo in the commit message?
It's a typo, I will fix the commit message.
virtually yours Gerhard Sittig -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr. 5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office@denx.de
Best regards, Piotr Wilczek

This patch adds variables describing platform (soc, board, vendor) to default environment.
Samsung's common misc imitialisation is enabled to provide additional board information in envs.
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Cc: Mateusz Zalega m.zalega@samsung.com --- board/samsung/goni/goni.c | 5 +++++ include/configs/s5p_goni.h | 4 ++++ 2 files changed, 9 insertions(+)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index 366f648..fb0435e 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -17,6 +17,11 @@ DECLARE_GLOBAL_DATA_PTR;
static struct s5pc110_gpio *s5pc110_gpio;
+u32 get_board_rev(void) +{ + return 0; +} + int board_init(void) { /* Set Initial global variables */ diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index 0590d20..82a8a8c 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -113,8 +113,12 @@
#define CONFIG_UBIFS_OPTION "rootflags=bulk_read,no_chk_data_crc"
+#define CONFIG_MISC_INIT_R + #define CONFIG_ENV_OVERWRITE #define CONFIG_SYS_CONSOLE_IS_IN_ENV +#define CONFIG_ENV_VARS_UBOOT_CONFIG +#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG #define CONFIG_EXTRA_ENV_SETTINGS \ CONFIG_UPDATEB \ "updatek=" \

This patch adds variables describing platform (soc, board, vendor) to default environment.
Samsung's common misc imitialisation is enabled to provide additional board information in envs.
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Cc: Przemyslaw Marczak p.marczak@samsung.com --- include/configs/s5pc210_universal.h | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/include/configs/s5pc210_universal.h b/include/configs/s5pc210_universal.h index d9e4c56..5e5f8e0 100644 --- a/include/configs/s5pc210_universal.h +++ b/include/configs/s5pc210_universal.h @@ -124,6 +124,11 @@ #define CONFIG_SYS_CONSOLE_INFO_QUIET #define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_ENV_VARS_UBOOT_CONFIG +#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + +#define CONFIG_MISC_INIT_R + #define CONFIG_EXTRA_ENV_SETTINGS \ "updateb=" \ "onenand erase 0x0 0x100000;" \

Hello Piotr,
On 01/14/2014 08:59 AM, Piotr Wilczek wrote:
This patch adds variables describing platform (soc, board, vendor) to default environment.
Samsung's common misc imitialisation is enabled to provide additional board information in envs.
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Cc: Przemyslaw Marczak p.marczak@samsung.com
include/configs/s5pc210_universal.h | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/include/configs/s5pc210_universal.h b/include/configs/s5pc210_universal.h index d9e4c56..5e5f8e0 100644 --- a/include/configs/s5pc210_universal.h +++ b/include/configs/s5pc210_universal.h @@ -124,6 +124,11 @@ #define CONFIG_SYS_CONSOLE_INFO_QUIET #define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_ENV_VARS_UBOOT_CONFIG +#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+#define CONFIG_MISC_INIT_R
You depends on my patch set and here we have a conflict in universal, trats and trats2. My patchset defines CONFIG_MISC_INIT_R for these three boards, so you can remove it from configs.
#define CONFIG_EXTRA_ENV_SETTINGS \ "updateb=" \ "onenand erase 0x0 0x100000;" \
Thank you,

Hi Przemyslaw,
-----Original Message----- From: Przemyslaw Marczak [mailto:p.marczak@samsung.com] Sent: Tuesday, January 14, 2014 9:48 AM To: u-boot@lists.denx.de Cc: Piotr Wilczek; Minkyu Kang; Kyungmin Park; Lukasz Majewski Subject: Re: [PATCH 5/7] board:samsung:universal: add env variables describing platform
Hello Piotr,
On 01/14/2014 08:59 AM, Piotr Wilczek wrote:
This patch adds variables describing platform (soc, board, vendor) to default environment.
Samsung's common misc imitialisation is enabled to provide additional board information in envs.
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Cc: Przemyslaw Marczak p.marczak@samsung.com
include/configs/s5pc210_universal.h | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/include/configs/s5pc210_universal.h b/include/configs/s5pc210_universal.h index d9e4c56..5e5f8e0 100644 --- a/include/configs/s5pc210_universal.h +++ b/include/configs/s5pc210_universal.h @@ -124,6 +124,11 @@ #define CONFIG_SYS_CONSOLE_INFO_QUIET #define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_ENV_VARS_UBOOT_CONFIG +#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+#define CONFIG_MISC_INIT_R
You depends on my patch set and here we have a conflict in universal, trats and trats2. My patchset defines CONFIG_MISC_INIT_R for these three boards, so you can remove it from configs.
Is the samsung/common/misc.c file reserved only for misc_init_r function? I think that CONFIG_MISC_INIT_R is misleading.
#define CONFIG_EXTRA_ENV_SETTINGS \ "updateb=" \ "onenand erase 0x0 0x100000;" \
Thank you,
Przemyslaw Marczak Samsung R&D Institute Poland Samsung Electronics p.marczak@samsung.com
Best regards, Piotr Wilczek

Hello Piotr,
On 01/14/2014 10:37 AM, Piotr Wilczek wrote:
Hi Przemyslaw,
-----Original Message----- From: Przemyslaw Marczak [mailto:p.marczak@samsung.com] Sent: Tuesday, January 14, 2014 9:48 AM To: u-boot@lists.denx.de Cc: Piotr Wilczek; Minkyu Kang; Kyungmin Park; Lukasz Majewski Subject: Re: [PATCH 5/7] board:samsung:universal: add env variables describing platform
Hello Piotr,
On 01/14/2014 08:59 AM, Piotr Wilczek wrote:
This patch adds variables describing platform (soc, board, vendor) to default environment.
Samsung's common misc imitialisation is enabled to provide additional board information in envs.
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Cc: Przemyslaw Marczak p.marczak@samsung.com
include/configs/s5pc210_universal.h | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/include/configs/s5pc210_universal.h b/include/configs/s5pc210_universal.h index d9e4c56..5e5f8e0 100644 --- a/include/configs/s5pc210_universal.h +++ b/include/configs/s5pc210_universal.h @@ -124,6 +124,11 @@ #define CONFIG_SYS_CONSOLE_INFO_QUIET #define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_ENV_VARS_UBOOT_CONFIG +#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+#define CONFIG_MISC_INIT_R
You depends on my patch set and here we have a conflict in universal, trats and trats2. My patchset defines CONFIG_MISC_INIT_R for these three boards, so you can remove it from configs.
Is the samsung/common/misc.c file reserved only for misc_init_r function? I think that CONFIG_MISC_INIT_R is misleading.
No, it isn't reserved. Misc_init_r function is for various things and is called from board_init_r. In this function we can put any common code for our vendor boards. So why do you think it is bad?
#define CONFIG_EXTRA_ENV_SETTINGS \ "updateb=" \ "onenand erase 0x0 0x100000;" \
Thank you,
Przemyslaw Marczak Samsung R&D Institute Poland Samsung Electronics p.marczak@samsung.com
Best regards, Piotr Wilczek
Thank you,

Hi Przemyslaw,
-----Original Message----- From: Przemyslaw Marczak [mailto:p.marczak@samsung.com] Sent: Tuesday, January 14, 2014 11:10 AM To: u-boot@lists.denx.de Cc: Piotr Wilczek; 'Minkyu Kang'; 'Kyungmin Park'; Lukasz Majewski Subject: Re: [PATCH 5/7] board:samsung:universal: add env variables describing platform
Hello Piotr,
On 01/14/2014 10:37 AM, Piotr Wilczek wrote:
Hi Przemyslaw,
-----Original Message----- From: Przemyslaw Marczak [mailto:p.marczak@samsung.com] Sent: Tuesday, January 14, 2014 9:48 AM To: u-boot@lists.denx.de Cc: Piotr Wilczek; Minkyu Kang; Kyungmin Park; Lukasz Majewski Subject: Re: [PATCH 5/7] board:samsung:universal: add env variables describing platform
Hello Piotr,
On 01/14/2014 08:59 AM, Piotr Wilczek wrote:
This patch adds variables describing platform (soc, board, vendor) to default environment.
Samsung's common misc imitialisation is enabled to provide additional board information in envs.
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Cc: Przemyslaw Marczak p.marczak@samsung.com
include/configs/s5pc210_universal.h | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/include/configs/s5pc210_universal.h b/include/configs/s5pc210_universal.h index d9e4c56..5e5f8e0 100644 --- a/include/configs/s5pc210_universal.h +++ b/include/configs/s5pc210_universal.h @@ -124,6 +124,11 @@ #define CONFIG_SYS_CONSOLE_INFO_QUIET #define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_ENV_VARS_UBOOT_CONFIG #define +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+#define CONFIG_MISC_INIT_R
You depends on my patch set and here we have a conflict in
universal,
trats and trats2. My patchset defines CONFIG_MISC_INIT_R for these three boards, so you can remove it from configs.
Is the samsung/common/misc.c file reserved only for misc_init_r
function?
I think that CONFIG_MISC_INIT_R is misleading.
No, it isn't reserved. Misc_init_r function is for various things and is called from board_init_r. In this function we can put any common code for our vendor boards. So why do you think it is bad?
So the misc.c file is reserved for misc_init_r only. The file is only for CONFIG_MISC_INIT_R. I thought that in misc.c we can put some common code not necessarily called form misc_init_r but say from borad_late_init. But ok. To add some common code for board_late_init I need to add another file.
#define CONFIG_EXTRA_ENV_SETTINGS
\
"updateb=" \ "onenand erase 0x0 0x100000;" \
Thank you,
Przemyslaw Marczak Samsung R&D Institute Poland Samsung Electronics p.marczak@samsung.com
Best regards, Piotr Wilczek
Thank you,
Przemyslaw Marczak Samsung R&D Institute Poland Samsung Electronics p.marczak@samsung.com

Hello Piotr,
On 01/14/2014 01:33 PM, Piotr Wilczek wrote:
Hi Przemyslaw,
-----Original Message----- From: Przemyslaw Marczak [mailto:p.marczak@samsung.com] Sent: Tuesday, January 14, 2014 11:10 AM To: u-boot@lists.denx.de Cc: Piotr Wilczek; 'Minkyu Kang'; 'Kyungmin Park'; Lukasz Majewski Subject: Re: [PATCH 5/7] board:samsung:universal: add env variables describing platform
Hello Piotr,
On 01/14/2014 10:37 AM, Piotr Wilczek wrote:
Hi Przemyslaw,
-----Original Message----- From: Przemyslaw Marczak [mailto:p.marczak@samsung.com] Sent: Tuesday, January 14, 2014 9:48 AM To: u-boot@lists.denx.de Cc: Piotr Wilczek; Minkyu Kang; Kyungmin Park; Lukasz Majewski Subject: Re: [PATCH 5/7] board:samsung:universal: add env variables describing platform
Hello Piotr,
On 01/14/2014 08:59 AM, Piotr Wilczek wrote:
This patch adds variables describing platform (soc, board, vendor) to default environment.
Samsung's common misc imitialisation is enabled to provide additional board information in envs.
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Cc: Przemyslaw Marczak p.marczak@samsung.com
include/configs/s5pc210_universal.h | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/include/configs/s5pc210_universal.h b/include/configs/s5pc210_universal.h index d9e4c56..5e5f8e0 100644 --- a/include/configs/s5pc210_universal.h +++ b/include/configs/s5pc210_universal.h @@ -124,6 +124,11 @@ #define CONFIG_SYS_CONSOLE_INFO_QUIET #define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_ENV_VARS_UBOOT_CONFIG #define +CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
+#define CONFIG_MISC_INIT_R
You depends on my patch set and here we have a conflict in
universal,
trats and trats2. My patchset defines CONFIG_MISC_INIT_R for these three boards, so you can remove it from configs.
Is the samsung/common/misc.c file reserved only for misc_init_r
function?
I think that CONFIG_MISC_INIT_R is misleading.
No, it isn't reserved. Misc_init_r function is for various things and is called from board_init_r. In this function we can put any common code for our vendor boards. So why do you think it is bad?
So the misc.c file is reserved for misc_init_r only. The file is only for CONFIG_MISC_INIT_R.
In this meaning - YES, will compile only for CONFIG_MISC....
I thought that in misc.c we can put some common code not necessarily called form misc_init_r but say from borad_late_init. But ok. To add some common code for board_late_init I need to add another file.
That was in my first patch set. So maybe I remove the CONFIG_MISC_INIT_R dependency from Makefile.
#define CONFIG_EXTRA_ENV_SETTINGS
\
"updateb=" \ "onenand erase 0x0 0x100000;" \
Thank you,
Przemyslaw Marczak Samsung R&D Institute Poland Samsung Electronics p.marczak@samsung.com
Best regards, Piotr Wilczek
Thank you,
Przemyslaw Marczak Samsung R&D Institute Poland Samsung Electronics p.marczak@samsung.com
Thanks,

This patch adds variables describing platform (soc, board, vendor) to default environment and Samsung's common misc initialisation to provide additional board information in envs.
This patch modifies envs to enable dual kernel boot - with separated DTB if the DTB file is loaded successfully; - with DTB apppended to uImage if DTB file is not found; This is neccesssary for backward compatibilty.
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Cc: Lukasz Majewski l.majewski@samsung.com --- include/configs/trats.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/include/configs/trats.h b/include/configs/trats.h index 0877142..71b1a4e 100644 --- a/include/configs/trats.h +++ b/include/configs/trats.h @@ -148,9 +148,16 @@ #define CONFIG_SYS_CONSOLE_INFO_QUIET #define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_ENV_VARS_UBOOT_CONFIG +#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + #define CONFIG_EXTRA_ENV_SETTINGS \ "bootk=" \ - "run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0" \ + "run loaduimage;" \ + "if run loaddtb; then " \ + "bootm 0x40007FC0 - ${fdtaddr};" \ + "fi;" \ + "bootm 0x40007FC0;\0" \ "updatemmc=" \ "mmc boot 0 1 1 1; mmc write 0 0x42008000 0 0x200;" \ "mmc boot 0 1 1 0\0" \ @@ -173,7 +180,7 @@ "mmcboot=" \ "setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \ "${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo}; " \ - "run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0" \ + "run loaddtb; run bootk\0" \ "bootchart=setenv opts init=/sbin/bootchartd; run bootcmd\0" \ "boottrace=setenv opts initcall_debug; run bootcmd\0" \ "mmcoops=mmc read 0 0x40000000 0x40 8; md 0x40000000 0x400\0" \ @@ -212,7 +219,6 @@ "setenv spl_imgaddr;" \ "setenv spl_addr_tmp;\0" \ "fdtaddr=40800000\0" \ - "fdtfile=exynos4210-trats.dtb\0"
/* Miscellaneous configurable options */ @@ -254,6 +260,8 @@ #define CONFIG_DOS_PARTITION #define CONFIG_EFI_PARTITION
+#define CONFIG_MISC_INIT_R + /* EXT4 */ #define CONFIG_CMD_EXT4 #define CONFIG_CMD_EXT4_WRITE

This patch adds variables describing platform (soc, board, vendor) to default environment and Samsung's common misc initialisation to provide additional board information in envs.
This patch modifies envs to enable dual kernel boot - with separated DTB if the DTB file is loaded successfully; - with DTB apppended to uImage if DTB file is not found; This is neccesssary for backward compatibilty.
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com --- include/configs/trats2.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/include/configs/trats2.h b/include/configs/trats2.h index 7dfbe98..9d1b461 100644 --- a/include/configs/trats2.h +++ b/include/configs/trats2.h @@ -150,6 +150,9 @@ #define CONFIG_SYS_CONSOLE_INFO_QUIET #define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_ENV_VARS_UBOOT_CONFIG +#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + /* Tizen - partitions definitions */ #define PARTS_CSA "csa" #define PARTS_BOOT "boot" @@ -177,7 +180,11 @@
#define CONFIG_EXTRA_ENV_SETTINGS \ "bootk=" \ - "run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0" \ + "run loaduimage;" \ + "if run loaddtb; then " \ + "bootm 0x40007FC0 - ${fdtaddr};" \ + "fi;" \ + "bootm 0x40007FC0;\0" \ "updatemmc=" \ "mmc boot 0 1 1 1; mmc write 0x42008000 0 0x200;" \ "mmc boot 0 1 1 0\0" \ @@ -191,7 +198,7 @@ "mmcboot=" \ "setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \ "${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo}; " \ - "run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0" \ + "run bootk\0" \ "bootchart=set opts init=/sbin/bootchartd; run bootcmd\0" \ "boottrace=setenv opts initcall_debug; run bootcmd\0" \ "verify=n\0" \ @@ -232,7 +239,6 @@ "setenv spl_imgaddr;" \ "setenv spl_addr_tmp;\0" \ "fdtaddr=40800000\0" \ - "fdtfile=exynos4412-trats2.dtb\0"
/* * Miscellaneous configurable options @@ -272,6 +278,7 @@ #define CONFIG_EFI_PARTITION #define CONFIG_PARTITION_UUIDS
+#define CONFIG_MISC_INIT_R #define CONFIG_BOARD_EARLY_INIT_F
/* I2C */

This patchset adds runtime variables for Samsung boards that describe build configuration (arch, soc, board, vendor).
Additionally, more envs describing platform (soc and board revision) are added to Samsung common code.
For boards Trats and Trats2, based on the added envs, 'fdtfile' env is set and dual kernel boot is enabled: - with separated DTB if the DTB file is loaded successfully; - with DTB apppended to uImage if DTB file is not found; This is neccesssary for backward compatibilty.
THis patchset depends on the patchset: [PATCH v6 00/11] Introduce Samsung misc file and LCD menu. http://patchwork.ozlabs.org/patch/313186/ ... http://patchwork.ozlabs.org/patch/313192/
Changes for V2: - rebased against current u-boot0samsung branch
Piotr Wilczek (8): arm:exynos: add cpu revision arm:s5pc110: add cpu revision board:samsung:common: set envs with board unified information board:samsung:goni: add env variables describing platform board:samsung:universal: add env variables describing platform board:samsung:trats: add env variables describing platform board:samsung:trats2: add env variables describing platform board:samsung:trats/trats2: enable boot with appended and separated DTB
arch/arm/include/asm/arch-exynos/cpu.h | 8 ++++++-- arch/arm/include/asm/arch-s5pc1xx/cpu.h | 7 +++++++ board/samsung/common/misc.c | 24 ++++++++++++++++++++++++ board/samsung/goni/goni.c | 17 +++++++++++++++++ board/samsung/trats/trats.c | 3 +++ board/samsung/trats2/trats2.c | 3 +++ board/samsung/universal_c210/universal.c | 3 +++ include/configs/s5p_goni.h | 6 ++++++ include/configs/s5pc210_universal.h | 3 +++ include/configs/trats.h | 12 +++++++++--- include/configs/trats2.h | 12 +++++++++--- include/samsung/misc.h | 12 ++++++++---- 12 files changed, 98 insertions(+), 12 deletions(-)

This patch enables to read cpu revision on Exynos CPU.
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com --- Changes for V2: - none
arch/arm/include/asm/arch-exynos/cpu.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/arm/include/asm/arch-exynos/cpu.h b/arch/arm/include/asm/arch-exynos/cpu.h index 573f755..bccce63 100644 --- a/arch/arm/include/asm/arch-exynos/cpu.h +++ b/arch/arm/include/asm/arch-exynos/cpu.h @@ -185,9 +185,11 @@ static inline int s5p_get_cpu_rev(void)
static inline void s5p_set_cpu_id(void) { - unsigned int pro_id = (readl(EXYNOS4_PRO_ID) & 0x00FFF000) >> 12; + unsigned int pro_id = readl(EXYNOS4_PRO_ID); + unsigned int cpu_id = (pro_id & 0x00FFF000) >> 12; + unsigned int cpu_rev = pro_id & 0x000000FF;
- switch (pro_id) { + switch (cpu_id) { case 0x200: /* Exynos4210 EVT0 */ s5p_cpu_id = 0x4210; @@ -196,10 +198,12 @@ static inline void s5p_set_cpu_id(void) case 0x210: /* Exynos4210 EVT1 */ s5p_cpu_id = 0x4210; + s5p_cpu_rev = cpu_rev; break; case 0x412: /* Exynos4412 */ s5p_cpu_id = 0x4412; + s5p_cpu_rev = cpu_rev; break; case 0x520: /* Exynos5250 */

Dear Piotr Wilczek,
In message 1390402477-24340-2-git-send-email-p.wilczek@samsung.com you wrote:
This patch enables to read cpu revision on Exynos CPU.
Sorry, you really need to refactor your patches.
In this commit you add references to "s5p_cpu_id":
@@ -196,10 +198,12 @@ static inline void s5p_set_cpu_id(void) case 0x210: /* Exynos4210 EVT1 */ s5p_cpu_id = 0x4210;
break; case 0x412: /* Exynos4412 */ s5p_cpu_id = 0x4412;s5p_cpu_rev = cpu_rev;
break; case 0x520: /* Exynos5250 */s5p_cpu_rev = cpu_rev;
But this variable does not exist anywhere. It is only added in the next patch. Adding this patch causes build breakage, i. e. your patch series is not bisectable.
Please fix!
Best regards,
Wolfgang Denk

Dear Wolfgang Denk,
On 23/01/14 19:28, Wolfgang Denk wrote:
Dear Piotr Wilczek,
In message 1390402477-24340-2-git-send-email-p.wilczek@samsung.com you wrote:
This patch enables to read cpu revision on Exynos CPU.
Sorry, you really need to refactor your patches.
In this commit you add references to "s5p_cpu_id":
@@ -196,10 +198,12 @@ static inline void s5p_set_cpu_id(void) case 0x210: /* Exynos4210 EVT1 */ s5p_cpu_id = 0x4210;
break; case 0x412: /* Exynos4412 */ s5p_cpu_id = 0x4412;s5p_cpu_rev = cpu_rev;
break; case 0x520: /* Exynos5250 */s5p_cpu_rev = cpu_rev;
But this variable does not exist anywhere. It is only added in the next patch. Adding this patch causes build breakage, i. e. your patch series is not bisectable.
s5p_cpu_id and s5p_cpu_rev exist on "arch/arm/cpu/armv7/s5p-common/cpu_info.c". This patch looks fine to me.
Thanks, Minkyu Kang.

This patch adds s5p_cpu_rev.
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com --- Changes for V2: - none
arch/arm/include/asm/arch-s5pc1xx/cpu.h | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/arch/arm/include/asm/arch-s5pc1xx/cpu.h b/arch/arm/include/asm/arch-s5pc1xx/cpu.h index 4fc5a0c..5ae5c87 100644 --- a/arch/arm/include/asm/arch-s5pc1xx/cpu.h +++ b/arch/arm/include/asm/arch-s5pc1xx/cpu.h @@ -51,10 +51,17 @@ #include <asm/io.h> /* CPU detection macros */ extern unsigned int s5p_cpu_id; +extern unsigned int s5p_cpu_rev; + +static inline int s5p_get_cpu_rev(void) +{ + return s5p_cpu_rev; +}
static inline void s5p_set_cpu_id(void) { s5p_cpu_id = readl(S5PC100_PRO_ID); + s5p_cpu_rev = s5p_cpu_id & 0x000000FF; s5p_cpu_id = 0xC000 | ((s5p_cpu_id & 0x00FFF000) >> 12); }

This patch sets envs that describe board information. The following envs are set: soc_id, soc_rev, board_rev. Based on this information, if CONFIG_OF_LIBFDT is enabled, the 'fdtfile' env is set as: fdtfile=${soc_family}${soc_id}-${board}.dtb
The generated envs are intenionally not saved to persistent storage.
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com --- Changes for V2: - rebased on patchset [PATCH v6 00/11] Introduce Samsung misc file and LCD menu
board/samsung/common/misc.c | 24 ++++++++++++++++++++++++ include/samsung/misc.h | 12 ++++++++---- 2 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/board/samsung/common/misc.c b/board/samsung/common/misc.c index 643f957..eb15739 100644 --- a/board/samsung/common/misc.c +++ b/board/samsung/common/misc.c @@ -21,6 +21,30 @@
DECLARE_GLOBAL_DATA_PTR;
+#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG +void set_board_info(void) +{ + char info[64]; + + snprintf(info, ARRAY_SIZE(info), "%d.%d", s5p_cpu_rev & 0x0f, + (s5p_cpu_rev & 0xf0) >> 0x04); + setenv("soc_rev", info); + + snprintf(info, ARRAY_SIZE(info), "%x", s5p_cpu_id); + setenv("soc_id", info); + +#ifdef CONFIG_REVISION_TAG + snprintf(info, ARRAY_SIZE(info), "%x", get_board_rev()); + setenv("board_rev", info); +#endif +#ifdef CONFIG_OF_LIBFDT + snprintf(info, ARRAY_SIZE(info), "%s%x-%s.dtb", + CONFIG_SYS_SOC, s5p_cpu_id, CONFIG_SYS_BOARD); + setenv("fdtfile", info); +#endif +} +#endif /* CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG */ + #ifdef CONFIG_LCD_MENU static int power_key_pressed(u32 reg) { diff --git a/include/samsung/misc.h b/include/samsung/misc.h index 1a6d47f..ede6c15 100644 --- a/include/samsung/misc.h +++ b/include/samsung/misc.h @@ -1,6 +1,14 @@ #ifndef __SAMSUNG_MISC_COMMON_H__ #define __SAMSUNG_MISC_COMMON_H__
+#ifdef CONFIG_REVISION_TAG +u32 get_board_rev(void); +#endif + +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG +void set_board_info(void); +#endif + #ifdef CONFIG_LCD_MENU enum { BOOT_MODE_INFO, @@ -10,10 +18,6 @@ enum { BOOT_MODE_EXIT, };
-#ifdef CONFIG_REVISION_TAG -u32 get_board_rev(void); -#endif - void keys_init(void); void check_boot_mode(void); #endif /* CONFIG_LCD_MENU */

This patch adds variables describing platform (soc, board, vendor) to default environment.
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Cc: Mateusz Zalega m.zalega@samsung.com --- Changes for V2: - rebased on patchset [PATCH v6 00/11] Introduce Samsung misc file and LCD menu
board/samsung/goni/goni.c | 17 +++++++++++++++++ include/configs/s5p_goni.h | 6 ++++++ 2 files changed, 23 insertions(+)
diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c index 366f648..61b9ece 100644 --- a/board/samsung/goni/goni.c +++ b/board/samsung/goni/goni.c @@ -13,10 +13,17 @@ #include <usb/s3c_udc.h> #include <asm/arch/cpu.h> #include <power/max8998_pmic.h> +#include <samsung/misc.h> + DECLARE_GLOBAL_DATA_PTR;
static struct s5pc110_gpio *s5pc110_gpio;
+u32 get_board_rev(void) +{ + return 0; +} + int board_init(void) { /* Set Initial global variables */ @@ -173,3 +180,13 @@ struct s3c_plat_otg_data s5pc110_otg_data = { .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL, }; #endif + +#ifdef CONFIG_MISC_INIT_R +int misc_init_r(void) +{ +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + set_board_info(); +#endif + return 0; +} +#endif diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h index 4cdf937..991c43e 100644 --- a/include/configs/s5p_goni.h +++ b/include/configs/s5p_goni.h @@ -34,6 +34,7 @@
#define CONFIG_SETUP_MEMORY_TAGS #define CONFIG_CMDLINE_TAG +#define CONFIG_REVISION_TAG #define CONFIG_INITRD_TAG #define CONFIG_CMDLINE_EDITING
@@ -113,8 +114,13 @@
#define CONFIG_UBIFS_OPTION "rootflags=bulk_read,no_chk_data_crc"
+#define CONFIG_MISC_COMMON +#define CONFIG_MISC_INIT_R + #define CONFIG_ENV_OVERWRITE #define CONFIG_SYS_CONSOLE_IS_IN_ENV +#define CONFIG_ENV_VARS_UBOOT_CONFIG +#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG #define CONFIG_EXTRA_ENV_SETTINGS \ CONFIG_UPDATEB \ "updatek=" \

This patch adds variables describing platform (soc, board, vendor) to default environment.
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Cc: Przemyslaw Marczak p.marczak@samsung.com --- Changes for V2: - rebased on patchset [PATCH v6 00/11] Introduce Samsung misc file and LCD menu
board/samsung/universal_c210/universal.c | 3 +++ include/configs/s5pc210_universal.h | 3 +++ 2 files changed, 6 insertions(+)
diff --git a/board/samsung/universal_c210/universal.c b/board/samsung/universal_c210/universal.c index 98b387f..5ce74b7 100644 --- a/board/samsung/universal_c210/universal.c +++ b/board/samsung/universal_c210/universal.c @@ -516,6 +516,9 @@ int board_init(void) #ifdef CONFIG_MISC_INIT_R int misc_init_r(void) { +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + set_board_info(); +#endif #ifdef CONFIG_LCD_MENU keys_init(); check_boot_mode(); diff --git a/include/configs/s5pc210_universal.h b/include/configs/s5pc210_universal.h index bfb044b..67921e9 100644 --- a/include/configs/s5pc210_universal.h +++ b/include/configs/s5pc210_universal.h @@ -124,6 +124,9 @@ #define CONFIG_SYS_CONSOLE_INFO_QUIET #define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_ENV_VARS_UBOOT_CONFIG +#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + #define CONFIG_EXTRA_ENV_SETTINGS \ "updateb=" \ "onenand erase 0x0 0x100000;" \

Hello Piotr,
On 01/22/2014 03:54 PM, Piotr Wilczek wrote:
This patch adds variables describing platform (soc, board, vendor) to default environment.
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Cc: Przemyslaw Marczak p.marczak@samsung.com
Changes for V2:
- rebased on patchset [PATCH v6 00/11] Introduce Samsung misc file and LCD menu
board/samsung/universal_c210/universal.c | 3 +++ include/configs/s5pc210_universal.h | 3 +++ 2 files changed, 6 insertions(+)
diff --git a/board/samsung/universal_c210/universal.c b/board/samsung/universal_c210/universal.c index 98b387f..5ce74b7 100644 --- a/board/samsung/universal_c210/universal.c +++ b/board/samsung/universal_c210/universal.c @@ -516,6 +516,9 @@ int board_init(void) #ifdef CONFIG_MISC_INIT_R int misc_init_r(void) { +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
- set_board_info();
+#endif #ifdef CONFIG_LCD_MENU keys_init(); check_boot_mode(); diff --git a/include/configs/s5pc210_universal.h b/include/configs/s5pc210_universal.h index bfb044b..67921e9 100644 --- a/include/configs/s5pc210_universal.h +++ b/include/configs/s5pc210_universal.h @@ -124,6 +124,9 @@ #define CONFIG_SYS_CONSOLE_INFO_QUIET #define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_ENV_VARS_UBOOT_CONFIG +#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
- #define CONFIG_EXTRA_ENV_SETTINGS \ "updateb=" \ "onenand erase 0x0 0x100000;" \
Acked-by: Przemyslaw Marczak p.marczak@samsung.com

This patch adds variables describing platform (soc, board, vendor) to default environment.
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Cc: Lukasz Majewski l.majewski@samsung.com --- Changes for V2: - rebased on patchset [PATCH v6 00/11] Introduce Samsung misc file and LCD menu
board/samsung/trats/trats.c | 3 +++ include/configs/trats.h | 3 +++ 2 files changed, 6 insertions(+)
diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c index c6664e7..b725505 100644 --- a/board/samsung/trats/trats.c +++ b/board/samsung/trats/trats.c @@ -791,6 +791,9 @@ void init_panel_info(vidinfo_t *vid) #ifdef CONFIG_MISC_INIT_R int misc_init_r(void) { +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + set_board_info(); +#endif #ifdef CONFIG_LCD_MENU keys_init(); check_boot_mode(); diff --git a/include/configs/trats.h b/include/configs/trats.h index 1de971c..18b4e2f 100644 --- a/include/configs/trats.h +++ b/include/configs/trats.h @@ -149,6 +149,9 @@ #define CONFIG_SYS_CONSOLE_INFO_QUIET #define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_ENV_VARS_UBOOT_CONFIG +#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + #define CONFIG_EXTRA_ENV_SETTINGS \ "bootk=" \ "run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0" \

This patch adds variables describing platform (soc, board, vendor) to default environment.
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com --- Changes for V2: - rebased on patchset [PATCH v6 00/11] Introduce Samsung misc file and LCD menu
board/samsung/trats2/trats2.c | 3 +++ include/configs/trats2.h | 3 +++ 2 files changed, 6 insertions(+)
diff --git a/board/samsung/trats2/trats2.c b/board/samsung/trats2/trats2.c index 62e7fd2..c17c24d 100644 --- a/board/samsung/trats2/trats2.c +++ b/board/samsung/trats2/trats2.c @@ -616,6 +616,9 @@ void init_panel_info(vidinfo_t *vid) #ifdef CONFIG_MISC_INIT_R int misc_init_r(void) { +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + set_board_info(); +#endif #ifdef CONFIG_LCD_MENU keys_init(); check_boot_mode(); diff --git a/include/configs/trats2.h b/include/configs/trats2.h index c48e3f5..7daa445 100644 --- a/include/configs/trats2.h +++ b/include/configs/trats2.h @@ -150,6 +150,9 @@ #define CONFIG_SYS_CONSOLE_INFO_QUIET #define CONFIG_SYS_CONSOLE_IS_IN_ENV
+#define CONFIG_ENV_VARS_UBOOT_CONFIG +#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + /* Tizen - partitions definitions */ #define PARTS_CSA "csa" #define PARTS_BOOT "boot"

This patch modifies envs to enable dual kernel boot - with separated DTB if the DTB file is loaded successfully; - with DTB apppended to uImage if DTB file is not found; This is neccesssary for backward compatibilty.
Signed-off-by: Piotr Wilczek p.wilczek@samsung.com Signed-off-by: Kyungmin Park kyungmin.park@samsung.com Cc: Lukasz Majewski l.majewski@samsung.com --- Changes for V2: - squashed separated patches for Trats and Trats2 inito one
include/configs/trats.h | 9 ++++++--- include/configs/trats2.h | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/include/configs/trats.h b/include/configs/trats.h index 18b4e2f..7bd1584 100644 --- a/include/configs/trats.h +++ b/include/configs/trats.h @@ -154,7 +154,11 @@
#define CONFIG_EXTRA_ENV_SETTINGS \ "bootk=" \ - "run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0" \ + "run loaduimage;" \ + "if run loaddtb; then " \ + "bootm 0x40007FC0 - ${fdtaddr};" \ + "fi;" \ + "bootm 0x40007FC0;\0" \ "updatemmc=" \ "mmc boot 0 1 1 1; mmc write 0 0x42008000 0 0x200;" \ "mmc boot 0 1 1 0\0" \ @@ -177,7 +181,7 @@ "mmcboot=" \ "setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \ "${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo}; " \ - "run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0" \ + "run bootk\0" \ "bootchart=setenv opts init=/sbin/bootchartd; run bootcmd\0" \ "boottrace=setenv opts initcall_debug; run bootcmd\0" \ "mmcoops=mmc read 0 0x40000000 0x40 8; md 0x40000000 0x400\0" \ @@ -216,7 +220,6 @@ "setenv spl_imgaddr;" \ "setenv spl_addr_tmp;\0" \ "fdtaddr=40800000\0" \ - "fdtfile=exynos4210-trats.dtb\0"
/* Miscellaneous configurable options */ diff --git a/include/configs/trats2.h b/include/configs/trats2.h index 7daa445..28270fe 100644 --- a/include/configs/trats2.h +++ b/include/configs/trats2.h @@ -180,7 +180,11 @@
#define CONFIG_EXTRA_ENV_SETTINGS \ "bootk=" \ - "run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0" \ + "run loaduimage;" \ + "if run loaddtb; then " \ + "bootm 0x40007FC0 - ${fdtaddr};" \ + "fi;" \ + "bootm 0x40007FC0;\0" \ "updatemmc=" \ "mmc boot 0 1 1 1; mmc write 0x42008000 0 0x200;" \ "mmc boot 0 1 1 0\0" \ @@ -194,7 +198,7 @@ "mmcboot=" \ "setenv bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \ "${lpj} rootwait ${console} ${meminfo} ${opts} ${lcdinfo}; " \ - "run loaddtb; run loaduimage; bootm 0x40007FC0 - ${fdtaddr}\0" \ + "run bootk\0" \ "bootchart=set opts init=/sbin/bootchartd; run bootcmd\0" \ "boottrace=setenv opts initcall_debug; run bootcmd\0" \ "verify=n\0" \ @@ -235,7 +239,6 @@ "setenv spl_imgaddr;" \ "setenv spl_addr_tmp;\0" \ "fdtaddr=40800000\0" \ - "fdtfile=exynos4412-trats2.dtb\0"
/* * Miscellaneous configurable options

On 22/01/14 23:54, Piotr Wilczek wrote:
This patchset adds runtime variables for Samsung boards that describe build configuration (arch, soc, board, vendor).
Additionally, more envs describing platform (soc and board revision) are added to Samsung common code.
For boards Trats and Trats2, based on the added envs, 'fdtfile' env is set and dual kernel boot is enabled:
- with separated DTB if the DTB file is loaded successfully;
- with DTB apppended to uImage if DTB file is not found;
This is neccesssary for backward compatibilty.
THis patchset depends on the patchset: [PATCH v6 00/11] Introduce Samsung misc file and LCD menu. http://patchwork.ozlabs.org/patch/313186/ ... http://patchwork.ozlabs.org/patch/313192/
Changes for V2:
- rebased against current u-boot0samsung branch
Piotr Wilczek (8): arm:exynos: add cpu revision arm:s5pc110: add cpu revision board:samsung:common: set envs with board unified information board:samsung:goni: add env variables describing platform board:samsung:universal: add env variables describing platform board:samsung:trats: add env variables describing platform board:samsung:trats2: add env variables describing platform board:samsung:trats/trats2: enable boot with appended and separated DTB
arch/arm/include/asm/arch-exynos/cpu.h | 8 ++++++-- arch/arm/include/asm/arch-s5pc1xx/cpu.h | 7 +++++++ board/samsung/common/misc.c | 24 ++++++++++++++++++++++++ board/samsung/goni/goni.c | 17 +++++++++++++++++ board/samsung/trats/trats.c | 3 +++ board/samsung/trats2/trats2.c | 3 +++ board/samsung/universal_c210/universal.c | 3 +++ include/configs/s5p_goni.h | 6 ++++++ include/configs/s5pc210_universal.h | 3 +++ include/configs/trats.h | 12 +++++++++--- include/configs/trats2.h | 12 +++++++++--- include/samsung/misc.h | 12 ++++++++---- 12 files changed, 98 insertions(+), 12 deletions(-)
applied to u-boot-samsung.
Thanks, Minkyu Kang.
participants (5)
-
Gerhard Sittig
-
Minkyu Kang
-
Piotr Wilczek
-
Przemyslaw Marczak
-
Wolfgang Denk