All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zachary Landau <kapheine@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] ./cpu/mpc8260/cpu_init.c: cpu_init_f() gd pointing to wrong location?
Date: Thu, 24 Mar 2005 20:36:41 -0500	[thread overview]
Message-ID: <a04f56da05032417364c12da39@mail.gmail.com> (raw)
In-Reply-To: <OF8B5EF4B2.9F0D3AFE-ON48256FC8.00273D3A@uk.marconicomms.com>

>       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@gmail.com>

  reply	other threads:[~2005-03-25  1:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-18  7:28 [U-Boot-Users] ./cpu/mpc8260/cpu_init.c: cpu_init_f() gd pointing to wrong location? KokHow Teh
2005-03-25  1:36 ` Zachary Landau [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-03-23  3:00 [U-Boot-Users] ./cpu/mpc8260/cpu_init.c: cpu_init_f(): " KokHow Teh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a04f56da05032417364c12da39@mail.gmail.com \
    --to=kapheine@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.