From: York Sun <yorksun@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] common/board_f: Add back gd init
Date: Wed, 30 Apr 2014 13:38:49 -0700 [thread overview]
Message-ID: <53615F59.2090806@freescale.com> (raw)
In-Reply-To: <1398882255.24575.206.camel@snotra.buserror.net>
On 04/30/2014 11:24 AM, Scott Wood wrote:
>> Before this change, we have
>>
>> #ifndef CONFIG_X86
>> gd_t data;
>>
>> gd = &data;
>> #endif
>>
>> This is overriding the gd.
>
> Yes, as I said, "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."
>
>> For PPC, gd is set in different places. Eg, cpu_init_early_f() for mpc85xx,
>> cpu_init_f() for for mpc512x, mpc5xxx, mpc8260, mpc83xx, mpc86xx. They are all
>> in different files. Since we have been using this assignment in
>> arch/powerpc/lib/board.c for all PPC, it should be safe and clear to have
>> correct assignment here.
>
> The generic board is an opportunity to clean up cruft. Non-mpc85xx can
> be dealt with when they get converted.
>
> What 85xx currently does seems bad -- it initializes the gd, clears it,
> may or may not use it, then clears it again. Figure out if the 85xx
> code is using gd before board_init_f(). If it is, skip the clear in
> board_init_f(), or at least clearly document what the pre-board_init_f()
> usage is and that none of those values will last (but if that's the
> case, why not use the stack for such temporary values?). If it's not
> used, then get rid of the early gd setting and use gd on the stack like
> the other arches do.
>
I took a deeper look at 85xx code. We use gd before board_init_f. I can move
some of them to use return value, but for "law" operations in
arch/powerpc/cpu/mpc8xxx/law.c, we need "gd".
York
prev parent reply other threads:[~2014-04-30 20:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-28 22:51 [U-Boot] [PATCH 1/2] common/board_f: Add back gd init York Sun
2014-04-28 22:51 ` [U-Boot] [PATCH 2/2] common/board_f: Fix size variable York Sun
2014-04-30 17:33 ` [U-Boot] [PATCH 1/2] common/board_f: Add back gd init York Sun
2014-04-30 17:57 ` Scott Wood
2014-04-30 18:14 ` York Sun
2014-04-30 18:24 ` Scott Wood
2014-04-30 18:30 ` York Sun
2014-04-30 20:38 ` York Sun [this message]
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=53615F59.2090806@freescale.com \
--to=yorksun@freescale.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.