From: Scott Wood Date: Tue, 29 Apr 2014 18:12:58 -0500 Subject: [U-Boot] [RFC] RFC: convert MPC8536DS to use generic board In-Reply-To: <535BE09F.80005@freescale.com> References: <1398474623-4709-1-git-send-email-yorksun@freescale.com> <20140426092205.4A4C43801AC@gemini.denx.de> <535BE09F.80005@freescale.com> Message-ID: <1398813178.24575.111.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 Sat, 2014-04-26 at 09:36 -0700, York Sun wrote: > On 04/26/2014 02:22 AM, Wolfgang Denk wrote: > >> +#ifdef CONFIG_PPC > >> + gd = (gd_t *) (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_GBL_DATA_OFFSET); > >> + __asm__ __volatile__("":::"memory"); > >> +#endif > > > > Again, this is a global change. Why is this now needed? > > > > It has been this way for powerpc. Do we have an alternative? gd is already initialized at the beginning of board_init_f(). If PPC needs gd before board_init_f(), then add PPC (or some other relevant symbol if it's not all PPC) to the #ifndef X86. In any case, there should be no need to add yet another initialization of gd. cpu_init_early_f() already initialized and cleared it. Also, if gd really is needed before board_init_f(), then we probably need to skip clearing gd in board_init_f(). As for the memory clobber, if nobody can come up with a reason for its existence, then just let it go away. At the very least, don't copy the barrier without also copying the comment that went with it -- but I'm really not seeing what it's trying to order. gd is a register, not memory. Maybe some versions of GCC had a bug that the clobber worked around -- does it apply to any recent GCC? In any case, for mpc85xx, gd was previously initalized as discussed above. -Scott