[U-Boot] [RFC] RFC: convert MPC8536DS to use generic board

York Sun yorksun at freescale.com
Wed Apr 30 20:21:06 CEST 2014


On 04/29/2014 04:12 PM, Scott Wood wrote:
> 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().

For variant PPC part, gd is initialized in cpu_init_f or cpu_init_early_f. It
shouldn't be overwritten by "gd = &data;" in board_init_f.

gd is not cleared in board_init_f for the SoCs we care. But gd may be missed for
74xx and other old SoCs if not set 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.
> 

We can probably remove the memory boundary. I wouldn't know if any legacy
compiler will have any issue though.

York




More information about the U-Boot mailing list