Skip to contentSkip to conversation

arm: add runtime envs describing build configuration

PATCH Superseded Piotr Wilczek 5 participants 28 messages Jan 14, 2014 – Feb 7, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover 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(-)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/7 arm:exynos: add cpu revision

This patch enables to read cpu revision on Exynos CPU.

---
 arch/arm/include/asm/arch-exynos/cpu.h |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
arch/arm/include/asm/arch-exynos/cpu.h +6 -2
index 573f755..bccce63 100644
@@ -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 */
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH 2/7 arm:s5pc110: add cpu revision

In reply to Piotr Wilczek

This patch adds s5p_cpu_rev.

---
 arch/arm/include/asm/arch-s5pc1xx/cpu.h |    7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/include/asm/arch-s5pc1xx/cpu.h +7 -0
index 4fc5a0c..5ae5c87 100644
@@ -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);
 }
 
Signature · 1 line
1.7.9.5
#3 lore raw

PATCH 3/7 board:samsung:common: set envs with board unified information

In reply to Piotr Wilczek

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

---
 board/samsung/common/misc.c |   29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
board/samsung/common/misc.c +29 -0
index 3764d12..2d81df9 100644
@@ -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;
 }
Signature · 1 line
1.7.9.5
#4 lore raw

PATCH 3/7 board:samsung:common: set envs with board unified information

Quoted 3 lines · Piotr Wilczek

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)

Quoted 2 lines

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

Signature · 3 lines
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 at denx.de
#5 lore raw

PATCH 3/7 board:samsung:common: set envs with board unified information

Quoted 12 lines

-----Original Message-----
From: Gerhard Sittig [mailto:gsi at denx.de]
Sent: Wednesday, January 15, 2014 5:18 PM
To: Piotr Wilczek
Cc: u-boot at lists.denx.de; Kyungmin Park
Subject: Re: [U-Boot] [PATCH 3/7] board:samsung:common: set envs with board unified information

Quoted 1 line · Piotr Wilczek
Quoted 9 lines
Quoted 2 lines

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.

Quoted 5 lines
Quoted 2 lines

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.

Quoted 8 lines

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 at denx.de

Best regards,
Piotr Wilczek

#6 lore raw

PATCH 4/7 board:samsung:goni: add env variables describing platform

In reply to 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.

---
 board/samsung/goni/goni.c  |    5 +++++
 include/configs/s5p_goni.h |    4 ++++
 2 files changed, 9 insertions(+)
board/samsung/goni/goni.c +5 -0
index 366f648..fb0435e 100644
@@ -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 */
include/configs/s5p_goni.h +4 -0
index 0590d20..82a8a8c 100644
@@ -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=" \
Signature · 1 line
1.7.9.5
#7 lore raw

PATCH 5/7 board:samsung:universal: add env variables describing platform

In reply to 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.

---
 include/configs/s5pc210_universal.h |    5 +++++
 1 file changed, 5 insertions(+)
include/configs/s5pc210_universal.h +5 -0
index d9e4c56..5e5f8e0 100644
@@ -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;" \
Signature · 1 line
1.7.9.5
#8 lore raw

PATCH 5/7 board:samsung:universal: add env variables describing platform

Hello Piotr,

Quoted 18 lines · 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.

---
  include/configs/s5pc210_universal.h |    5 +++++
  1 file changed, 5 insertions(+)
include/configs/s5pc210_universal.h +0 -0
index d9e4c56..5e5f8e0 100644

include/configs/s5pc210_universal.h line 131

Quoted 8 lines
include/configs/s5pc210_universal.h +5 -0
@@ -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.

include/configs/s5pc210_universal.h line 134

Quoted 4 lines
include/configs/s5pc210_universal.h +0 -0
  #define CONFIG_EXTRA_ENV_SETTINGS					\
  	"updateb=" \
  		"onenand erase 0x0 0x100000;" \

Thank you,

Signature · 4 lines
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com
#9 lore raw

PATCH 5/7 board:samsung:universal: add env variables describing platform

Hi Przemyslaw,

Quoted 33 lines

-----Original Message-----
From: Przemyslaw Marczak [mailto:p.marczak at samsung.com]
Sent: Tuesday, January 14, 2014 9:48 AM
To: u-boot at 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,

Quoted 22 lines · 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.

---
  include/configs/s5pc210_universal.h |    5 +++++
  1 file changed, 5 insertions(+)
include/configs/s5pc210_universal.h +0 -0
index d9e4c56..5e5f8e0 100644
@@ -124,6 +124,11 @@
  #define CONFIG_SYS_CONSOLE_INFO_QUIET
  #define CONFIG_SYS_CONSOLE_IS_IN_ENV
 
Quoted 10 lines

include/configs/s5pc210_universal.h line 131

Quoted 5 lines
include/configs/s5pc210_universal.h +5 -0
+#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.

Quoted 11 lines

include/configs/s5pc210_universal.h line 134

Quoted 4 lines
include/configs/s5pc210_universal.h +0 -0
  #define CONFIG_EXTRA_ENV_SETTINGS					\
  	"updateb=" \
  		"onenand erase 0x0 0x100000;" \

Thank you,
--
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com

Best regards,
Piotr Wilczek

#10 lore raw

PATCH 5/7 board:samsung:universal: add env variables describing platform

Hello Piotr,

Quoted 45 lines · Piotr Wilczek

Hi Przemyslaw,

Quoted 33 lines

-----Original Message-----
From: Przemyslaw Marczak [mailto:p.marczak at samsung.com]
Sent: Tuesday, January 14, 2014 9:48 AM
To: u-boot at 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,

Quoted 22 lines · 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.

---
   include/configs/s5pc210_universal.h |    5 +++++
   1 file changed, 5 insertions(+)
include/configs/s5pc210_universal.h +0 -0
index d9e4c56..5e5f8e0 100644
@@ -124,6 +124,11 @@
   #define CONFIG_SYS_CONSOLE_INFO_QUIET
   #define CONFIG_SYS_CONSOLE_IS_IN_ENV
 
Quoted 10 lines

include/configs/s5pc210_universal.h line 131

Quoted 5 lines
include/configs/s5pc210_universal.h +5 -0
+#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.

Quoted 3 lines

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?

Quoted 12 lines
Quoted 11 lines

include/configs/s5pc210_universal.h line 134

Quoted 4 lines
include/configs/s5pc210_universal.h +0 -0
   #define CONFIG_EXTRA_ENV_SETTINGS					\
   	"updateb=" \
   		"onenand erase 0x0 0x100000;" \

Thank you,
--
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com

Quoted 6 lines

Best regards,
Piotr Wilczek

Thank you,

Signature · 4 lines
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com
#11 lore raw

PATCH 5/7 board:samsung:universal: add env variables describing platform

Hi Przemyslaw,

Quoted 57 lines

-----Original Message-----
From: Przemyslaw Marczak [mailto:p.marczak at samsung.com]
Sent: Tuesday, January 14, 2014 11:10 AM
To: u-boot at 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,

Quoted 42 lines · Piotr Wilczek

Hi Przemyslaw,

Quoted 40 lines

-----Original Message-----
From: Przemyslaw Marczak [mailto:p.marczak at samsung.com]
Sent: Tuesday, January 14, 2014 9:48 AM
To: u-boot at 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,

Quoted 19 lines · 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.

---
   include/configs/s5pc210_universal.h |    5 +++++
   1 file changed, 5 insertions(+)
include/configs/s5pc210_universal.h +0 -0
index d9e4c56..5e5f8e0 100644

include/configs/s5pc210_universal.h line 131

Quoted 8 lines
include/configs/s5pc210_universal.h +5 -0
@@ -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,

Quoted 3 lines
Quoted 3 lines

trats and trats2. My patchset defines CONFIG_MISC_INIT_R for these three boards, so you can remove it from configs.

Quoted 9 lines
Quoted 1 line

Is the samsung/common/misc.c file reserved only for misc_init_r

function?

Quoted 2 lines

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.

Quoted 1 line
Quoted 1 line
Quoted 1 line

include/configs/s5pc210_universal.h line 132

Quoted 1 line
include/configs/s5pc210_universal.h +0 -0
   #define CONFIG_EXTRA_ENV_SETTINGS

\

Quoted 24 lines
Quoted 11 lines
Quoted 10 lines

include/configs/s5pc210_universal.h line 134

Quoted 3 lines
include/configs/s5pc210_universal.h +0 -0
   	"updateb=" \
   		"onenand erase 0x0 0x100000;" \

Thank you,
--
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com

Quoted 6 lines

Best regards,
Piotr Wilczek

Thank you,
--
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com

#12 lore raw

PATCH 5/7 board:samsung:universal: add env variables describing platform

Hello Piotr,

Quoted 64 lines · Piotr Wilczek

Hi Przemyslaw,

Quoted 62 lines

-----Original Message-----
From: Przemyslaw Marczak [mailto:p.marczak at samsung.com]
Sent: Tuesday, January 14, 2014 11:10 AM
To: u-boot at 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,

Quoted 42 lines · Piotr Wilczek

Hi Przemyslaw,

Quoted 40 lines

-----Original Message-----
From: Przemyslaw Marczak [mailto:p.marczak at samsung.com]
Sent: Tuesday, January 14, 2014 9:48 AM
To: u-boot at 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,

Quoted 19 lines · 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.

---
    include/configs/s5pc210_universal.h |    5 +++++
    1 file changed, 5 insertions(+)
include/configs/s5pc210_universal.h +0 -0
index d9e4c56..5e5f8e0 100644

include/configs/s5pc210_universal.h line 131

Quoted 8 lines
include/configs/s5pc210_universal.h +5 -0
@@ -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,

Quoted 4 lines
Quoted 3 lines

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?

Quoted 2 lines

I think that CONFIG_MISC_INIT_R is misleading.

Quoted 6 lines
Quoted 4 lines

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

Quoted 4 lines

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.

Quoted 29 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line

include/configs/s5pc210_universal.h line 132

Quoted 1 line
include/configs/s5pc210_universal.h +0 -0
    #define CONFIG_EXTRA_ENV_SETTINGS

\

Quoted 24 lines
Quoted 11 lines
Quoted 10 lines

include/configs/s5pc210_universal.h line 134

Quoted 3 lines
include/configs/s5pc210_universal.h +0 -0
    	"updateb=" \
    		"onenand erase 0x0 0x100000;" \

Thank you,
--
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com

Quoted 6 lines

Best regards,
Piotr Wilczek

Thank you,
--
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com

Thanks,

Signature · 4 lines
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com
#13 lore raw

PATCH 6/7 board:samsung:trats: enable boot with appended and separated DTB

In reply to Piotr Wilczek

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.

---
 include/configs/trats.h |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
include/configs/trats.h +11 -3
index 0877142..71b1a4e 100644
@@ -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
Signature · 1 line
1.7.9.5
#14 lore raw

PATCH 7/7 board:samsung:trats2: enable boot with appended and separated DTB

In reply to Piotr Wilczek

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.

---
 include/configs/trats2.h |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
include/configs/trats2.h +10 -3
index 7dfbe98..9d1b461 100644
@@ -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 */
Signature · 1 line
1.7.9.5
#15 lore raw

v2 cover arm: add runtime envs describing build

In reply to Piotr Wilczek

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(-)
Signature · 1 line
1.7.9.5
#16 lore raw

PATCH v2 1/8 arm:exynos: add cpu revision

This patch enables to read cpu revision on Exynos CPU.

---
Changes for V2:
- none

 arch/arm/include/asm/arch-exynos/cpu.h |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
arch/arm/include/asm/arch-exynos/cpu.h +6 -2
index 573f755..bccce63 100644
@@ -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 */
Signature · 1 line
1.7.9.5
#17 lore raw

PATCH v2 1/8 arm:exynos: add cpu revision

Dear Piotr Wilczek,

Quoted 1 line · In message <[email protected]> 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":

arch/arm/include/asm/arch-exynos/cpu.h static inline void s5p_set_cpu_id(void) · line 209

Quoted 13 lines
arch/arm/include/asm/arch-exynos/cpu.h +2 -0
@@ -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 */

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

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"If that makes any sense to you, you have a big problem."
                                  -- C. Durance, Computer Science 234
#18 lore raw

PATCH v2 1/8 arm:exynos: add cpu revision

Dear Wolfgang Denk,

Quoted 18 lines · Wolfgang Denk

Dear Piotr Wilczek,

Quoted 1 line · In message <[email protected]> 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":

Quoted 9 lines
arch/arm/include/asm/arch-exynos/cpu.h +1 -0
@@ -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;
Quoted 8 lines

arch/arm/include/asm/arch-exynos/cpu.h static inline void s5p_set_cpu_id(void) · line 209

Quoted 4 lines
arch/arm/include/asm/arch-exynos/cpu.h +1 -0
+		s5p_cpu_rev = cpu_rev;
 		break;
 	case 0x520:
 		/* Exynos5250 */

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.

#19 lore raw

PATCH v2 2/8 arm:s5pc110: add cpu revision

In reply to Piotr Wilczek

This patch adds s5p_cpu_rev.

---
Changes for V2:
- none

 arch/arm/include/asm/arch-s5pc1xx/cpu.h |    7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/include/asm/arch-s5pc1xx/cpu.h +7 -0
index 4fc5a0c..5ae5c87 100644
@@ -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);
 }
 
Signature · 1 line
1.7.9.5
#20 lore raw

PATCH v2 3/8 board:samsung:common: set envs with board unified information

In reply to Piotr Wilczek

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.

---
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(-)
board/samsung/common/misc.c +24 -0
index 643f957..eb15739 100644
@@ -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)
 {
include/samsung/misc.h +8 -4
index 1a6d47f..ede6c15 100644
@@ -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 */
Signature · 1 line
1.7.9.5
#21 lore raw

PATCH v2 4/8 board:samsung:goni: add env variables describing platform

In reply to Piotr Wilczek

This patch adds variables describing platform (soc, board, vendor) to default environment.

---
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(+)
board/samsung/goni/goni.c +17 -0
index 366f648..61b9ece 100644
@@ -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
include/configs/s5p_goni.h +6 -0
index 4cdf937..991c43e 100644
@@ -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=" \
Signature · 1 line
1.7.9.5
#22 lore raw

PATCH v2 5/8 board:samsung:universal: add env variables describing platform

In reply to Piotr Wilczek

This patch adds variables describing platform (soc, board, vendor) to default environment.

---
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(+)
board/samsung/universal_c210/universal.c +3 -0
index 98b387f..5ce74b7 100644
@@ -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();
include/configs/s5pc210_universal.h +3 -0
index bfb044b..67921e9 100644
@@ -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;" \
Signature · 1 line
1.7.9.5
#23 lore raw

PATCH v2 5/8 board:samsung:universal: add env variables describing platform

Hello Piotr,

Quoted 34 lines · Piotr Wilczek

This patch adds variables describing platform (soc, board, vendor) to default environment.

---
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(+)
board/samsung/universal_c210/universal.c +3 -0
index 98b387f..5ce74b7 100644
@@ -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();
include/configs/s5pc210_universal.h +0 -0
index bfb044b..67921e9 100644

include/configs/s5pc210_universal.h line 132

Quoted 9 lines
include/configs/s5pc210_universal.h +3 -0
@@ -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;" \
Signature · 4 lines
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com
#24 lore raw

PATCH v2 6/8 board:samsung:trats: add env variables describing platform

In reply to Piotr Wilczek

This patch adds variables describing platform (soc, board, vendor) to default environment.

---
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(+)
board/samsung/trats/trats.c +3 -0
index c6664e7..b725505 100644
@@ -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();
include/configs/trats.h +3 -0
index 1de971c..18b4e2f 100644
@@ -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" \
Signature · 1 line
1.7.9.5
#25 lore raw

PATCH v2 7/8 board:samsung:trats2: add env variables describing platform

In reply to Piotr Wilczek

This patch adds variables describing platform (soc, board, vendor) to default environment.

---
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(+)
board/samsung/trats2/trats2.c +3 -0
index 62e7fd2..c17c24d 100644
@@ -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();
include/configs/trats2.h +3 -0
index c48e3f5..7daa445 100644
@@ -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"
Signature · 1 line
1.7.9.5
#26 lore raw

PATCH v2 8/8 board:samsung:trats/trats2: enable boot with appended and separated DTB

In reply to Piotr Wilczek

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.

---
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(-)
include/configs/trats.h +6 -3
index 18b4e2f..7bd1584 100644
@@ -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 */
include/configs/trats2.h +6 -3
index 7daa445..28270fe 100644
@@ -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
Signature · 1 line
1.7.9.5
#27 lore raw

v2 cover arm: add runtime envs describing build

In reply to Piotr Wilczek
Quoted 32 lines · Piotr Wilczek

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

Quoted 14 lines
 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.