From: Scott Wood Date: Wed, 30 Apr 2014 17:45:10 -0500 Subject: [U-Boot] [Patch v2 1/2] common/board_f: Preserve global data for mpc85xx and mpc86xx In-Reply-To: <1398893511-22085-1-git-send-email-yorksun@freescale.com> References: <1398893511-22085-1-git-send-email-yorksun@freescale.com> Message-ID: <1398897910.24575.221.camel@snotra.buserror.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, 2014-04-30 at 14:31 -0700, York Sun wrote: > For powerpc SoCs (including mpc85xx, mpc86xx), global data is used for > initializing LAWs, before calling function baord_inti_f(). This data > should not be cleared later. > > Signed-off-by: York Sun > --- > Change log > v2: Instead of adding back gd init for all PPC, preserve gd for mpc85xx and mpc86xx. > > Note, need other maintainers to fix 83xx, 5xxx, 512x as I don't have boards to verify. > > common/board_f.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/common/board_f.c b/common/board_f.c > index cbdf06f..eebb377 100644 > --- a/common/board_f.c > +++ b/common/board_f.c > @@ -970,7 +970,11 @@ static init_fnc_t init_sequence_f[] = { > > void board_init_f(ulong boot_flags) > { > -#ifndef CONFIG_X86 > + /* > + * For MPC85xx, global data is initialized in cpu_init_early_f() and > + * used for init_law(). gd should not be cleared in this function. > + */ > +#if !defined(CONFIG_X86) && !defined(CONFIG_MPC85xx) && !defined(CONFIG_MPC86xx) > gd_t data; > > gd = &data; It would be better to introduce a CONFIG_SYS_EARLY_GD (or similar) rather than growing a list here. Is there any reason why the set of targets for which zero_global_data() is skipped is different from the set of targets where the gd instantiation and assignment is skipped? -Scott