From mboxrd@z Thu Jan 1 00:00:00 1970 From: York Sun Date: Thu, 1 May 2014 14:16:39 -0700 Subject: [U-Boot] [Patch v3 1/2] common/board_f: Preserve early global data In-Reply-To: References: <1398906061-7119-1-git-send-email-yorksun@freescale.com> Message-ID: <5362B9B7.3040703@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 05/01/2014 08:54 AM, Simon Glass wrote: > Hi York, > > On 30 April 2014 18:01, York Sun wrote: >> Some platforms (including mpc85xx, mpc86xx) use global data before calling >> function baord_inti_f(). This data should not be cleared later. Any arch >> which needs to preserve global data should define CONFIG_SYS_EARLY_GD. >> >> Signed-off-by: York Sun >> CC: Scott Wood >> CC: Simon Glass >> --- >> Change log >> >> 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 | 3 +++ >> arch/powerpc/include/asm/config.h | 2 ++ >> arch/x86/include/asm/config.h | 1 + >> common/board_f.c | 10 +++++----- >> 4 files changed, 11 insertions(+), 5 deletions(-) >> >> diff --git a/README b/README >> index 12758dc..1a51b11 100644 >> --- a/README >> +++ b/README >> @@ -440,6 +440,9 @@ The following options need to be configured: >> supported, core will start to execute uboot when wakes up. >> >> - Generic CPU options: >> + CONFIG_SYS_EARLY_GD >> + Defines global data is used before board_init_f(). >> + > > This looks like a good solution, but I believe that 'early' is in fact > where we are headed. So perhaps you should create an inverted option > and define it for archs that don't support it? I don't disagree for the long term. But since we just start to convert to generic board, fewer archs need this than those don't. I suggest we try this and when most archs convert to generic board, we can invert it if needed. > > For what you have, I think CONFIG_SYS_EARLY_GLOBAL_DATA might be more > descriptive. Also I think you should describe the purpose more > precisely here - it's not just the use that you need to discuss. > > - The CPU init code must set it up and zero it > - Then board_init_f() doesn't zero it > Will add these. York