From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zachary Landau Date: Thu, 24 Mar 2005 20:36:41 -0500 Subject: [U-Boot-Users] ./cpu/mpc8260/cpu_init.c: cpu_init_f() gd pointing to wrong location? In-Reply-To: References: Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > 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