diff mbox

[U-Boot] ARM: arm720t: Add missing CONFIG_SKIP_LOWLEVEL_INIT guard for cpu_init_crit

Message ID 1368587097.8322.2.camel@phoenix
State Superseded
Delegated to: Tom Warren
Headers show

Commit Message

Axel Lin May 15, 2013, 3:04 a.m. UTC
cpu_init_crit() can be skipped, but the code is still enabled requiring a
platform to supply lowlevel_init().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 arch/arm/cpu/arm720t/start.S | 2 ++
 1 file changed, 2 insertions(+)

Comments

Albert ARIBAUD May 15, 2013, 1:10 p.m. UTC | #1
Hi Marek,

On Wed, 15 May 2013 05:36:14 +0200, Marek Vasut <marex@denx.de> wrote:

> Dear Axel Lin,
> 
> > cpu_init_crit() can be skipped, but the code is still enabled requiring a
> > platform to supply lowlevel_init().
> > 
> > Signed-off-by: Axel Lin <axel.lin@ingics.com>
> 
> Nice CC list, it'd be the best if you CCed the ARM maintainer too though ;-)

Thanks Marek. :)

> > ---
> >  arch/arm/cpu/arm720t/start.S | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
> > index 9facc7e..9f0e3f9 100644
> > --- a/arch/arm/cpu/arm720t/start.S
> > +++ b/arch/arm/cpu/arm720t/start.S
> > @@ -244,6 +244,7 @@ c_runtime_cpu_setup:
> >   *************************************************************************
> >   */
> > 
> > +#ifndef CONFIG_SKIP_LOWLEVEL_INIT
> >  cpu_init_crit:
> > 
> >  #if !defined(CONFIG_TEGRA)
> > @@ -258,6 +259,7 @@ cpu_init_crit:
> >  #endif
> > 
> >  	mov	pc, lr
> > +#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
> > 
> > 
> >  #ifndef CONFIG_SPL_BUILD

I am tempted to ask: what actual issue does this guarding aim at
solving? Just in case, beware that AFAIR Wolfgang does not consider
'because debugging' a valid answer.

> Best regards,
> Marek Vasut

Amicalement,
Stephen Warren May 15, 2013, 2:32 p.m. UTC | #2
On 05/14/2013 09:04 PM, Axel Lin wrote:
> cpu_init_crit() can be skipped, but the code is still enabled requiring a
> platform to supply lowlevel_init().

> diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S

> +#ifndef CONFIG_SKIP_LOWLEVEL_INIT
>  cpu_init_crit:
>  
>  #if !defined(CONFIG_TEGRA)
> @@ -258,6 +259,7 @@ cpu_init_crit:
>  #endif
>  
>  	mov	pc, lr
> +#endif /* CONFIG_SKIP_LOWLEVEL_INIT */

If you're going to make changes here, you should probably ensure that
Tegra is setting CONFIG_SKIP_LOWLEVEL_INIT, and then remove the
Tegra-specific ifdef from the body of that function. That's assuming
that setting CONFIG_SKIP_LOWLEVEL_INIT doesn't have any other side-effects.
Axel Lin May 16, 2013, 12:40 a.m. UTC | #3
2013/5/15 Albert ARIBAUD <albert.u.boot@aribaud.net>:
> Hi Marek,
>
> On Wed, 15 May 2013 05:36:14 +0200, Marek Vasut <marex@denx.de> wrote:
>
>> Dear Axel Lin,
>>
>> > cpu_init_crit() can be skipped, but the code is still enabled requiring a
>> > platform to supply lowlevel_init().
>> >
>> > Signed-off-by: Axel Lin <axel.lin@ingics.com>
>>
>> Nice CC list, it'd be the best if you CCed the ARM maintainer too though ;-)
>
> Thanks Marek. :)
>
>> > ---
>> >  arch/arm/cpu/arm720t/start.S | 2 ++
>> >  1 file changed, 2 insertions(+)
>> >
>> > diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
>> > index 9facc7e..9f0e3f9 100644
>> > --- a/arch/arm/cpu/arm720t/start.S
>> > +++ b/arch/arm/cpu/arm720t/start.S
>> > @@ -244,6 +244,7 @@ c_runtime_cpu_setup:
>> >   *************************************************************************
>> >   */
>> >
>> > +#ifndef CONFIG_SKIP_LOWLEVEL_INIT
>> >  cpu_init_crit:
>> >
>> >  #if !defined(CONFIG_TEGRA)
>> > @@ -258,6 +259,7 @@ cpu_init_crit:
>> >  #endif
>> >
>> >     mov     pc, lr
>> > +#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
>> >
>> >
>> >  #ifndef CONFIG_SPL_BUILD
>
> I am tempted to ask: what actual issue does this guarding aim at
> solving? Just in case, beware that AFAIR Wolfgang does not consider
> 'because debugging' a valid answer.

This fixes below build error if a platform has set CONFIG_SKIP_LOWLEVEL_INIT
but does not implement lowlevel_init.

arch/arm/cpu/arm720t/start.o: In function `cpu_init_crit':
arch/arm/cpu/arm720t/start.S:256: undefined reference to `lowlevel_init'

I have no idea if current supported boards in u-boot has this issue or not.
I hit this build error because I'm porting u-boot to a SoC that is not supported
by u-boot at this moment.

Regards,
Axel
Axel Lin May 16, 2013, 1 a.m. UTC | #4
2013/5/15 Stephen Warren <swarren@wwwdotorg.org>:
> On 05/14/2013 09:04 PM, Axel Lin wrote:
>> cpu_init_crit() can be skipped, but the code is still enabled requiring a
>> platform to supply lowlevel_init().
>
>> diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
>
>> +#ifndef CONFIG_SKIP_LOWLEVEL_INIT
>>  cpu_init_crit:
>>
>>  #if !defined(CONFIG_TEGRA)
>> @@ -258,6 +259,7 @@ cpu_init_crit:
>>  #endif
>>
>>       mov     pc, lr
>> +#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
>
> If you're going to make changes here, you should probably ensure that
> Tegra is setting CONFIG_SKIP_LOWLEVEL_INIT, and then remove the
> Tegra-specific ifdef from the body of that function. That's assuming
> that setting CONFIG_SKIP_LOWLEVEL_INIT doesn't have any other side-effects.

Tegra exists in both arm720t and armv7:

./arch/arm/cpu/arm720t/tegra-common
./arch/arm/cpu/arm720t/tegra30
./arch/arm/cpu/arm720t/tegra20
./arch/arm/cpu/arm720t/tegra114

./arch/arm/cpu/armv7/tegra-common
./arch/arm/cpu/armv7/tegra30
./arch/arm/cpu/armv7/tegra20
./arch/arm/cpu/armv7/tegra114

I'm wondering if we set CONFIG_SKIP_LOWLEVEL_INIT for tegra will also
impact the code path in arch/arm/cpu/armv7/start.S ?

Regards,
Axel
Stephen Warren May 16, 2013, 4:28 a.m. UTC | #5
On 05/15/2013 07:00 PM, Axel Lin wrote:
> 2013/5/15 Stephen Warren <swarren@wwwdotorg.org>:
>> On 05/14/2013 09:04 PM, Axel Lin wrote:
>>> cpu_init_crit() can be skipped, but the code is still enabled requiring a
>>> platform to supply lowlevel_init().
>>
>>> diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
>>
>>> +#ifndef CONFIG_SKIP_LOWLEVEL_INIT
>>>  cpu_init_crit:
>>>
>>>  #if !defined(CONFIG_TEGRA)
>>> @@ -258,6 +259,7 @@ cpu_init_crit:
>>>  #endif
>>>
>>>       mov     pc, lr
>>> +#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
>>
>> If you're going to make changes here, you should probably ensure that
>> Tegra is setting CONFIG_SKIP_LOWLEVEL_INIT, and then remove the
>> Tegra-specific ifdef from the body of that function. That's assuming
>> that setting CONFIG_SKIP_LOWLEVEL_INIT doesn't have any other side-effects.
> 
> Tegra exists in both arm720t and armv7:
> 
> ./arch/arm/cpu/arm720t/tegra-common
> ./arch/arm/cpu/arm720t/tegra30
> ./arch/arm/cpu/arm720t/tegra20
> ./arch/arm/cpu/arm720t/tegra114
> 
> ./arch/arm/cpu/armv7/tegra-common
> ./arch/arm/cpu/armv7/tegra30
> ./arch/arm/cpu/armv7/tegra20
> ./arch/arm/cpu/armv7/tegra114
> 
> I'm wondering if we set CONFIG_SKIP_LOWLEVEL_INIT for tegra will also
> impact the code path in arch/arm/cpu/armv7/start.S ?

Yes, you certainly only want to set CONFIG_SKIP_LOWLEVEL_INIT for the
SPL build. There's a whole section of
include/configs/tegra-common-post.h which is ifdef CONFIG_SPL_BUILD, so
it might make sense to #define CONFIG_SKIP_LOWLEVEL_INIT there.
Albert ARIBAUD May 18, 2013, 6:57 p.m. UTC | #6
Hi Tom,

On Fri, 17 May 2013 15:11:26 -0700, Tom Warren <TWarren@nvidia.com>
wrote:

> Axel (& Albert)
> 
> > -----Original Message-----
> > From: Stephen Warren [mailto:swarren@wwwdotorg.org]
> > Sent: Wednesday, May 15, 2013 9:29 PM
> > To: Axel Lin
> > Cc: Wolfgang Denk; Heiko Schocher; Tom Warren; u-boot@lists.denx.de
> > Subject: Re: [U-Boot] [PATCH] ARM: arm720t: Add missing
> > CONFIG_SKIP_LOWLEVEL_INIT guard for cpu_init_crit
> > 
> > On 05/15/2013 07:00 PM, Axel Lin wrote:
> > > 2013/5/15 Stephen Warren <swarren@wwwdotorg.org>:
> > >> On 05/14/2013 09:04 PM, Axel Lin wrote:
> > >>> cpu_init_crit() can be skipped, but the code is still enabled
> > >>> requiring a platform to supply lowlevel_init().
> > >>
> > >>> diff --git a/arch/arm/cpu/arm720t/start.S
> > >>> b/arch/arm/cpu/arm720t/start.S
> > >>
> > >>> +#ifndef CONFIG_SKIP_LOWLEVEL_INIT
> > >>>  cpu_init_crit:
> > >>>
> > >>>  #if !defined(CONFIG_TEGRA)
> > >>> @@ -258,6 +259,7 @@ cpu_init_crit:
> > >>>  #endif
> > >>>
> > >>>       mov     pc, lr
> > >>> +#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
> > >>
> > >> If you're going to make changes here, you should probably ensure that
> > >> Tegra is setting CONFIG_SKIP_LOWLEVEL_INIT, and then remove the
> > >> Tegra-specific ifdef from the body of that function. That's assuming
> > >> that setting CONFIG_SKIP_LOWLEVEL_INIT doesn't have any other side-
> > effects.
> > >
> > > Tegra exists in both arm720t and armv7:
> > >
> > > ./arch/arm/cpu/arm720t/tegra-common
> > > ./arch/arm/cpu/arm720t/tegra30
> > > ./arch/arm/cpu/arm720t/tegra20
> > > ./arch/arm/cpu/arm720t/tegra114
> > >
> > > ./arch/arm/cpu/armv7/tegra-common
> > > ./arch/arm/cpu/armv7/tegra30
> > > ./arch/arm/cpu/armv7/tegra20
> > > ./arch/arm/cpu/armv7/tegra114
> > >
> > > I'm wondering if we set CONFIG_SKIP_LOWLEVEL_INIT for tegra will also
> > > impact the code path in arch/arm/cpu/armv7/start.S ?
> > 
> > Yes, you certainly only want to set CONFIG_SKIP_LOWLEVEL_INIT for the SPL
> > build. There's a whole section of include/configs/tegra-common-post.h
> > which is ifdef CONFIG_SPL_BUILD, so it might make sense to #define
> > CONFIG_SKIP_LOWLEVEL_INIT there.
> I've applied your two patches (this one and the RFT for Tegra) to u-boot-tegra/next and I'm running a MAKEALL right now, then I'll do a test on Cardhu and Dalmore.
> 
> Both of these are assigned to me in PatchWork - Albert - do you want me to take them both in via the Tegra tree, or do you want to take the ARM patch and I'll take the Tegra patch? Let me know.

Please take both in Tegra tree.

> Axel - I'll let you know how testing goes, and then you can resubmit the RFT patch as a real patch against Tegra.
> 
> Thanks,
> 
> Tom
> --
> nvpublic

Amicalement,
diff mbox

Patch

diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
index 9facc7e..9f0e3f9 100644
--- a/arch/arm/cpu/arm720t/start.S
+++ b/arch/arm/cpu/arm720t/start.S
@@ -244,6 +244,7 @@  c_runtime_cpu_setup:
  *************************************************************************
  */
 
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
 cpu_init_crit:
 
 #if !defined(CONFIG_TEGRA)
@@ -258,6 +259,7 @@  cpu_init_crit:
 #endif
 
 	mov	pc, lr
+#endif /* CONFIG_SKIP_LOWLEVEL_INIT */
 
 
 #ifndef CONFIG_SPL_BUILD