[U-Boot-Users] ./cpu/mpc8260/cpu_init.c: cpu_init_f() gd pointing to wrong location?

Zachary Landau kapheine at gmail.com
Fri Mar 25 02:36:41 CET 2005


>       I am using ppc-2004-11-10.iso and I am referring to cpu/mpc8260 arch.
> The MPC8260ADS.h defines the temporary ram and the global data structure
> locations as follows:
> 
> #define CFG_INIT_RAM_ADDR       CFG_IMMR
> #define CFG_INIT_RAM_END        0x2000  /* End of used area in DPRAM    */
> #define CFG_GBL_DATA_SIZE       128     /* size in bytes reserved for initial data */
> #define CFG_GBL_DATA_OFFSET     (CFG_INIT_RAM_END - CFG_GBL_DATA_SIZE)
> #define CFG_INIT_SP_OFFSET      CFG_GBL_DATA_OFFSET
> 
>       does cpu_init_f() in cpu_init.c calculate the address of gd pointer wrongly?
> 
>         /* Pointer is writable since we allocated a register for it */
>         gd = (gd_t *) (CFG_INIT_RAM_ADDR + CFG_GBL_DATA_OFFSET);
> 
>       Shouldn't it be:
> 
>         /* Pointer is writable since we allocated a register for it */
>         gd = (gd_t *) (CFG_GBL_DATA_OFFSET);

I don't know if you are still looking for an answer to this but:

I believe CFG_INIT_RAM_END specificies the length of the RAM, not the
absolute location.  So (CFG_INIT_RAM_ADDR +
(CFG_INIT_RAM_END-CFG_GBL_DATA_OFFSET) should put the global data at
the end of ram, where it is supposed to be.


-- 
Zachary P. Landau <kapheine at gmail.com>




More information about the U-Boot mailing list