* [U-Boot] [Patch v4 1/2] common/board_f: Initialized global data for generic board
@ 2014-05-01 23:00 York Sun
2014-05-01 23:00 ` [U-Boot] [Patch v4 2/2] common/board_f: Fix size variable York Sun
2014-05-02 2:45 ` [U-Boot] [Patch v4 1/2] common/board_f: Initialized global data for generic board Simon Glass
0 siblings, 2 replies; 5+ messages in thread
From: York Sun @ 2014-05-01 23:00 UTC (permalink / raw)
To: u-boot
Some platforms (tested on mpc85xx, mpc86xx) use global data before calling
function baord_inti_f(). The data should not be cleared later. Any arch
which uses global data in generic board board_init_f() should define
CONFIG_SYS_GENERIC_GLOBAL_DATA.
Signed-off-by: York Sun <yorksun@freescale.com>
CC: Scott Wood <scottwood@freescale.com>
CC: Simon Glass <sjg@chromium.org>
CC: Albert ARIBAUD <albert.u.boot@aribaud.net>
---
Change log
v4: Replace with CONFIG_SYS_GENERIC_GLOBAL_DATA, a positive logic
v3: Introduce CONFIG_SYS_EARLY_GD instead of using a list
v2: Instead of adding back gd init for all PPC, preserve gd for mpc85xx and mpc86xx.
README | 6 ++++++
arch/arc/include/asm/config.h | 2 ++
arch/arm/include/asm/config.h | 2 ++
arch/mips/include/asm/config.h | 2 ++
common/board_f.c | 12 +++++++-----
5 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/README b/README
index 12758dc..c66f988 100644
--- a/README
+++ b/README
@@ -440,6 +440,12 @@ The following options need to be configured:
supported, core will start to execute uboot when wakes up.
- Generic CPU options:
+ CONFIG_SYS_GENERIC_GLOBAL_DATA
+ Defines global data is initialized in generic board board_init_f().
+ If this macro is defined, global data is created and cleared in
+ generic board board_init_f(). Without this macro, architecture/board
+ should initialize global data before calling board_init_f().
+
CONFIG_SYS_BIG_ENDIAN, CONFIG_SYS_LITTLE_ENDIAN
Defines the endianess of the CPU. Implementation of those
diff --git a/arch/arc/include/asm/config.h b/arch/arc/include/asm/config.h
index 5761def..3d331cc 100644
--- a/arch/arc/include/asm/config.h
+++ b/arch/arc/include/asm/config.h
@@ -7,6 +7,8 @@
#ifndef __ASM_ARC_CONFIG_H_
#define __ASM_ARC_CONFIG_H_
+#define CONFIG_SYS_GENERIC_GLOBAL_DATA
+
#define CONFIG_LMB
#endif /*__ASM_ARC_CONFIG_H_ */
diff --git a/arch/arm/include/asm/config.h b/arch/arm/include/asm/config.h
index abf79e5..2a20a77 100644
--- a/arch/arm/include/asm/config.h
+++ b/arch/arm/include/asm/config.h
@@ -7,6 +7,8 @@
#ifndef _ASM_CONFIG_H_
#define _ASM_CONFIG_H_
+#define CONFIG_SYS_GENERIC_GLOBAL_DATA
+
#define CONFIG_LMB
#define CONFIG_SYS_BOOT_RAMDISK_HIGH
diff --git a/arch/mips/include/asm/config.h b/arch/mips/include/asm/config.h
index 3a891ba..1c8a42b 100644
--- a/arch/mips/include/asm/config.h
+++ b/arch/mips/include/asm/config.h
@@ -7,6 +7,8 @@
#ifndef _ASM_CONFIG_H_
#define _ASM_CONFIG_H_
+#define CONFIG_SYS_GENERIC_GLOBAL_DATA
+
#define CONFIG_LMB
#define CONFIG_SYS_BOOT_RAMDISK_HIGH
diff --git a/common/board_f.c b/common/board_f.c
index cbdf06f..7601a98 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -970,20 +970,22 @@ static init_fnc_t init_sequence_f[] = {
void board_init_f(ulong boot_flags)
{
-#ifndef CONFIG_X86
+#ifdef CONFIG_SYS_GENERIC_GLOBAL_DATA
+ /*
+ * For some archtectures, global data is initialized and used before
+ * calling this function. The data should be preserved. For others,
+ * CONFIG_SYS_GENERIC_GLOBAL_DATA should be defined and use the stack
+ * here to host global data until relocation.
+ */
gd_t data;
gd = &data;
-#endif
/*
* Clear global data before it is accessed at debug print
* in initcall_run_list. Otherwise the debug print probably
* get the wrong vaule of gd->have_console.
*/
-#if !defined(CONFIG_CPM2) && !defined(CONFIG_MPC512X) && \
- !defined(CONFIG_MPC83xx) && !defined(CONFIG_MPC85xx) && \
- !defined(CONFIG_MPC86xx) && !defined(CONFIG_X86)
zero_global_data();
#endif
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread* [U-Boot] [Patch v4 2/2] common/board_f: Fix size variable
2014-05-01 23:00 [U-Boot] [Patch v4 1/2] common/board_f: Initialized global data for generic board York Sun
@ 2014-05-01 23:00 ` York Sun
2014-05-02 2:45 ` [U-Boot] [Patch v4 1/2] common/board_f: Initialized global data for generic board Simon Glass
1 sibling, 0 replies; 5+ messages in thread
From: York Sun @ 2014-05-01 23:00 UTC (permalink / raw)
To: u-boot
DRAM size should use 64-bit variable when the size could be more than 4GB.
Caught and verified on P4080DS with 4GB DDR.
Signed-off-by: York Sun <yorksun@freescale.com>
---
Change log
v4: no change since v1
common/board_f.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/board_f.c b/common/board_f.c
index 7601a98..c268cf9 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -194,7 +194,7 @@ static int init_func_ram(void)
static int show_dram_config(void)
{
- ulong size;
+ unsigned long long size;
#ifdef CONFIG_NR_DRAM_BANKS
int i;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread* [U-Boot] [Patch v4 1/2] common/board_f: Initialized global data for generic board
2014-05-01 23:00 [U-Boot] [Patch v4 1/2] common/board_f: Initialized global data for generic board York Sun
2014-05-01 23:00 ` [U-Boot] [Patch v4 2/2] common/board_f: Fix size variable York Sun
@ 2014-05-02 2:45 ` Simon Glass
2014-05-03 0:14 ` York Sun
1 sibling, 1 reply; 5+ messages in thread
From: Simon Glass @ 2014-05-02 2:45 UTC (permalink / raw)
To: u-boot
On 1 May 2014 16:00, York Sun <yorksun@freescale.com> wrote:
> Some platforms (tested on mpc85xx, mpc86xx) use global data before calling
> function baord_inti_f(). The data should not be cleared later. Any arch
> which uses global data in generic board board_init_f() should define
> CONFIG_SYS_GENERIC_GLOBAL_DATA.
>
> Signed-off-by: York Sun <yorksun@freescale.com>
> CC: Scott Wood <scottwood@freescale.com>
> CC: Simon Glass <sjg@chromium.org>
> CC: Albert ARIBAUD <albert.u.boot@aribaud.net>
> ---
> Change log
>
> v4: Replace with CONFIG_SYS_GENERIC_GLOBAL_DATA, a positive logic
> v3: Introduce CONFIG_SYS_EARLY_GD instead of using a list
> v2: Instead of adding back gd init for all PPC, preserve gd for mpc85xx and mpc86xx.
>
> README | 6 ++++++
> arch/arc/include/asm/config.h | 2 ++
> arch/arm/include/asm/config.h | 2 ++
> arch/mips/include/asm/config.h | 2 ++
I think you will need sandbox also. Otherwise looks good.
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [Patch v4 1/2] common/board_f: Initialized global data for generic board
2014-05-02 2:45 ` [U-Boot] [Patch v4 1/2] common/board_f: Initialized global data for generic board Simon Glass
@ 2014-05-03 0:14 ` York Sun
2014-05-03 0:17 ` Scott Wood
0 siblings, 1 reply; 5+ messages in thread
From: York Sun @ 2014-05-03 0:14 UTC (permalink / raw)
To: u-boot
On 05/01/2014 07:45 PM, Simon Glass wrote:
> On 1 May 2014 16:00, York Sun <yorksun@freescale.com> wrote:
>> Some platforms (tested on mpc85xx, mpc86xx) use global data before calling
>> function baord_inti_f(). The data should not be cleared later. Any arch
>> which uses global data in generic board board_init_f() should define
>> CONFIG_SYS_GENERIC_GLOBAL_DATA.
>>
>> Signed-off-by: York Sun <yorksun@freescale.com>
>> CC: Scott Wood <scottwood@freescale.com>
>> CC: Simon Glass <sjg@chromium.org>
>> CC: Albert ARIBAUD <albert.u.boot@aribaud.net>
>> ---
>> Change log
>>
>> v4: Replace with CONFIG_SYS_GENERIC_GLOBAL_DATA, a positive logic
>> v3: Introduce CONFIG_SYS_EARLY_GD instead of using a list
>> v2: Instead of adding back gd init for all PPC, preserve gd for mpc85xx and mpc86xx.
>>
>> README | 6 ++++++
>> arch/arc/include/asm/config.h | 2 ++
>> arch/arm/include/asm/config.h | 2 ++
>> arch/mips/include/asm/config.h | 2 ++
>
> I think you will need sandbox also. Otherwise looks good.
>
> Reviewed-by: Simon Glass <sjg@chromium.org>
>
Simon,
Sandbox doesn't have CONFIG_SYS_GENERIC_BOARD defined yet. Did you convert it
recently?
York
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [Patch v4 1/2] common/board_f: Initialized global data for generic board
2014-05-03 0:14 ` York Sun
@ 2014-05-03 0:17 ` Scott Wood
0 siblings, 0 replies; 5+ messages in thread
From: Scott Wood @ 2014-05-03 0:17 UTC (permalink / raw)
To: u-boot
On Fri, 2014-05-02 at 17:14 -0700, York Sun wrote:
> On 05/01/2014 07:45 PM, Simon Glass wrote:
> > On 1 May 2014 16:00, York Sun <yorksun@freescale.com> wrote:
> >> Some platforms (tested on mpc85xx, mpc86xx) use global data before calling
> >> function baord_inti_f(). The data should not be cleared later. Any arch
> >> which uses global data in generic board board_init_f() should define
> >> CONFIG_SYS_GENERIC_GLOBAL_DATA.
> >>
> >> Signed-off-by: York Sun <yorksun@freescale.com>
> >> CC: Scott Wood <scottwood@freescale.com>
> >> CC: Simon Glass <sjg@chromium.org>
> >> CC: Albert ARIBAUD <albert.u.boot@aribaud.net>
> >> ---
> >> Change log
> >>
> >> v4: Replace with CONFIG_SYS_GENERIC_GLOBAL_DATA, a positive logic
> >> v3: Introduce CONFIG_SYS_EARLY_GD instead of using a list
> >> v2: Instead of adding back gd init for all PPC, preserve gd for mpc85xx and mpc86xx.
> >>
> >> README | 6 ++++++
> >> arch/arc/include/asm/config.h | 2 ++
> >> arch/arm/include/asm/config.h | 2 ++
> >> arch/mips/include/asm/config.h | 2 ++
> >
> > I think you will need sandbox also. Otherwise looks good.
> >
> > Reviewed-by: Simon Glass <sjg@chromium.org>
> >
>
> Simon,
>
> Sandbox doesn't have CONFIG_SYS_GENERIC_BOARD defined yet. Did you convert it
> recently?
Look in arch/sandbox/config.mk. Likewise with
arch/x86/include/asm/config.h.
-Scott
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-05-03 0:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-01 23:00 [U-Boot] [Patch v4 1/2] common/board_f: Initialized global data for generic board York Sun
2014-05-01 23:00 ` [U-Boot] [Patch v4 2/2] common/board_f: Fix size variable York Sun
2014-05-02 2:45 ` [U-Boot] [Patch v4 1/2] common/board_f: Initialized global data for generic board Simon Glass
2014-05-03 0:14 ` York Sun
2014-05-03 0:17 ` Scott Wood
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.