From: York Sun <yorksun@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [Patch v2 1/2] common/board_f: Preserve global data for mpc85xx and mpc86xx
Date: Wed, 30 Apr 2014 16:40:01 -0700 [thread overview]
Message-ID: <536189D1.1060701@freescale.com> (raw)
In-Reply-To: <1398898678.24575.226.camel@snotra.buserror.net>
On 04/30/2014 03:57 PM, Scott Wood wrote:
> On Wed, 2014-04-30 at 15:56 -0700, York Sun wrote:
>> On 04/30/2014 03:51 PM, Scott Wood wrote:
>>> On Wed, 2014-04-30 at 15:48 -0700, York Sun wrote:
>>>> On 04/30/2014 03:45 PM, Scott Wood wrote:
>>>>> On Wed, 2014-04-30 at 14:31 -0700, York Sun wrote:
>>>>>> For powerpc SoCs (including mpc85xx, mpc86xx), global data is used for
>>>>>> initializing LAWs, before calling function baord_inti_f(). This data
>>>>>> should not be cleared later.
>>>>>>
>>>>>> Signed-off-by: York Sun <yorksun@freescale.com>
>>>>>> ---
>>>>>> Change log
>>>>>> v2: Instead of adding back gd init for all PPC, preserve gd for mpc85xx and mpc86xx.
>>>>>>
>>>>>> Note, need other maintainers to fix 83xx, 5xxx, 512x as I don't have boards to verify.
>>>>>>
>>>>>> common/board_f.c | 6 +++++-
>>>>>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>>>>>
>>>>>> diff --git a/common/board_f.c b/common/board_f.c
>>>>>> index cbdf06f..eebb377 100644
>>>>>> --- a/common/board_f.c
>>>>>> +++ b/common/board_f.c
>>>>>> @@ -970,7 +970,11 @@ static init_fnc_t init_sequence_f[] = {
>>>>>>
>>>>>> void board_init_f(ulong boot_flags)
>>>>>> {
>>>>>> -#ifndef CONFIG_X86
>>>>>> + /*
>>>>>> + * For MPC85xx, global data is initialized in cpu_init_early_f() and
>>>>>> + * used for init_law(). gd should not be cleared in this function.
>>>>>> + */
>>>>>> +#if !defined(CONFIG_X86) && !defined(CONFIG_MPC85xx) && !defined(CONFIG_MPC86xx)
>>>>>> gd_t data;
>>>>>>
>>>>>> gd = &data;
>>>>>
>>>>> It would be better to introduce a CONFIG_SYS_EARLY_GD (or similar)
>>>>> rather than growing a list here.
>>>>
>>>> That's do-able.
>>>>
>>>>>
>>>>> Is there any reason why the set of targets for which zero_global_data()
>>>>> is skipped is different from the set of targets where the gd
>>>>> instantiation and assignment is skipped?
>>>>
>>>> I would think the list should be identical. But without proper testing, I am
>>>> reluctant to copy the list. As you have suggested, start from 85xx first.
>>>> Non-mpc85xx can be dealt with when they get converted.
>>>
>>> None of those other PPC targets currently use the generic board. They
>>> will be tested when they are converted.
>>>
>>
>> Are you suggesting to copy the list, instead of only putting those tested?
>
> I'm saying to use CONFIG_SYS_EARLY_GD for both things.
>
>> It may save other maintainer some effort of debugging. But I can't be
>> sure they will all work.
>
> What good reason could there be for wanting to skip clearing of a gd
> that was just allocated on the stack?
>
Relocating is OK. But clearing is not. At least the used LAWs variable is
needed. There may be other variables as well. All data in gd is copied to new
location.
York
next prev parent reply other threads:[~2014-04-30 23:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-30 21:31 [U-Boot] [Patch v2 1/2] common/board_f: Preserve global data for mpc85xx and mpc86xx York Sun
2014-04-30 21:31 ` [U-Boot] [Patch v2 2/2] common/board_f: Fix size variable York Sun
2014-04-30 22:45 ` [U-Boot] [Patch v2 1/2] common/board_f: Preserve global data for mpc85xx and mpc86xx Scott Wood
2014-04-30 22:48 ` York Sun
2014-04-30 22:51 ` Scott Wood
2014-04-30 22:56 ` York Sun
2014-04-30 22:57 ` Scott Wood
2014-04-30 23:40 ` York Sun [this message]
2014-04-30 23:44 ` Scott Wood
2014-04-30 23:48 ` York Sun
2014-04-30 23:52 ` Scott Wood
2014-05-01 0:01 ` York Sun
2014-05-01 0:02 ` Scott Wood
2014-05-01 0:05 ` York Sun
2014-05-01 0:11 ` Scott Wood
2014-05-01 0:17 ` York Sun
2014-05-01 0:19 ` Scott Wood
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=536189D1.1060701@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.