diff mbox

[U-Boot,1/2] RFC: arm: add call to cleanup things before jumping into kernel

Message ID 1380791060-2578-1-git-send-email-ajaykumar.rs@samsung.com
State Rejected
Headers show

Commit Message

Ajay Kumar Oct. 3, 2013, 9:04 a.m. UTC
Add infrasturcture to cleanup any of those architecture related settings
done for u-boot, if they can cause problem during kernel boot.

Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
---
 arch/arm/cpu/armv7/cpu.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Albert ARIBAUD Oct. 3, 2013, 8:58 a.m. UTC | #1
Hi Ajay,

On Thu, 03 Oct 2013 14:34:19 +0530, Ajay Kumar
<ajaykumar.rs@samsung.com> wrote:

> Add infrasturcture to cleanup any of those architecture related settings
> done for u-boot, if they can cause problem during kernel boot.
> 
> Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
> ---

Regardless to ma question re fixing the issue in U-Boot or Linux: does
something prevent using the already existing cleanup_before_linux()
function, and if not, what made you choose to create another one
instead?

Amicalement,
Ajay kumar Oct. 3, 2013, 9:19 a.m. UTC | #2
Hi Albert,


On Thu, Oct 3, 2013 at 2:28 PM, Albert ARIBAUD <albert.u.boot@aribaud.net>wrote:

> Hi Ajay,
>
> On Thu, 03 Oct 2013 14:34:19 +0530, Ajay Kumar
> <ajaykumar.rs@samsung.com> wrote:
>
> > Add infrasturcture to cleanup any of those architecture related settings
> > done for u-boot, if they can cause problem during kernel boot.
> >
> > Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
> > ---
>
> Regardless to ma question re fixing the issue in U-Boot or Linux: does
> something prevent using the already existing cleanup_before_linux()
> function, and if not, what made you choose to create another one
> instead?
>
> cleanup_before_linux() generally cleans up things specific to the
processor.
I thought of introducing a cleanup function which would allow us to cleanup
things which are SOC specific(all SOC under armv7 as per the patch).
And, used the same function to cleanup some exynos specific stuff before
booting linux.
May be, I should have used a different name instead of
arch_cleanup_before_linux?

> Amicalement,
> --
> Albert.
> _______________________________________________
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
Simon Glass Oct. 3, 2013, 2:23 p.m. UTC | #3
Hi Albert,

On Thu, Oct 3, 2013 at 2:58 AM, Albert ARIBAUD
<albert.u.boot@aribaud.net> wrote:
> Hi Ajay,
>
> On Thu, 03 Oct 2013 14:34:19 +0530, Ajay Kumar
> <ajaykumar.rs@samsung.com> wrote:
>
>> Add infrasturcture to cleanup any of those architecture related settings
>> done for u-boot, if they can cause problem during kernel boot.
>>
>> Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
>> ---
>
> Regardless to ma question re fixing the issue in U-Boot or Linux: does
> something prevent using the already existing cleanup_before_linux()
> function, and if not, what made you choose to create another one
> instead?

That function is in generic ARM code - I think the intent here is to
add something SoC-specific. Perhaps it should be board-specific?

Regards,
Simon
Albert ARIBAUD Oct. 3, 2013, 3:44 p.m. UTC | #4
Hi Ajay,

On Thu, 3 Oct 2013 14:49:49 +0530, Ajay kumar <ajaynumb@gmail.com>
wrote:

> Hi Albert,
> 
> 
> On Thu, Oct 3, 2013 at 2:28 PM, Albert ARIBAUD <albert.u.boot@aribaud.net>wrote:
> 
> > Hi Ajay,
> >
> > On Thu, 03 Oct 2013 14:34:19 +0530, Ajay Kumar
> > <ajaykumar.rs@samsung.com> wrote:
> >
> > > Add infrasturcture to cleanup any of those architecture related settings
> > > done for u-boot, if they can cause problem during kernel boot.
> > >
> > > Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
> > > ---
> >
> > Regardless to ma question re fixing the issue in U-Boot or Linux: does
> > something prevent using the already existing cleanup_before_linux()
> > function, and if not, what made you choose to create another one
> > instead?
> >

(fixed quote glitch here that put the start of your reply inside mine.)

> cleanup_before_linux() generally cleans up things specific to the
> processor.
> I thought of introducing a cleanup function which would allow us to cleanup
> things which are SOC specific(all SOC under armv7 as per the patch).
> And, used the same function to cleanup some exynos specific stuff before
> booting linux.
> May be, I should have used a different name instead of
> arch_cleanup_before_linux?

Well, if it is *SoC* specific, then it is not *arch* specific, so yes,
the name should be changed. Now, we don't really have a concept of
'SoC-specific' in U-Boot, so board-specific, as suggested by Simon, is
the 'next not-too-worst thing'.

Still, don't rush to provide a new patch. According to Simon, the Linux
panic was solved and might just not have hit mainline yet; if that is
confirmed, then renaming arch_cleanup_before_linux() becomes moot.

Amicalement,
Ajay kumar Oct. 4, 2013, 5:56 a.m. UTC | #5
On Thu, Oct 3, 2013 at 9:14 PM, Albert ARIBAUD <albert.u.boot@aribaud.net>wrote:

> Hi Ajay,
>
> On Thu, 3 Oct 2013 14:49:49 +0530, Ajay kumar <ajaynumb@gmail.com>
> wrote:
>
> > Hi Albert,
> >
> >
> > On Thu, Oct 3, 2013 at 2:28 PM, Albert ARIBAUD <
> albert.u.boot@aribaud.net>wrote:
> >
> > > Hi Ajay,
> > >
> > > On Thu, 03 Oct 2013 14:34:19 +0530, Ajay Kumar
> > > <ajaykumar.rs@samsung.com> wrote:
> > >
> > > > Add infrasturcture to cleanup any of those architecture related
> settings
> > > > done for u-boot, if they can cause problem during kernel boot.
> > > >
> > > > Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
> > > > ---
> > >
> > > Regardless to ma question re fixing the issue in U-Boot or Linux: does
> > > something prevent using the already existing cleanup_before_linux()
> > > function, and if not, what made you choose to create another one
> > > instead?
> > >
>
> (fixed quote glitch here that put the start of your reply inside mine.)
>
> > cleanup_before_linux() generally cleans up things specific to the
> > processor.
> > I thought of introducing a cleanup function which would allow us to
> cleanup
> > things which are SOC specific(all SOC under armv7 as per the patch).
> > And, used the same function to cleanup some exynos specific stuff before
> > booting linux.
> > May be, I should have used a different name instead of
> > arch_cleanup_before_linux?
>
> Well, if it is *SoC* specific, then it is not *arch* specific, so yes,
> the name should be changed. Now, we don't really have a concept of
> 'SoC-specific' in U-Boot, so board-specific, as suggested by Simon, is
> the 'next not-too-worst thing'.
>
> Still, don't rush to provide a new patch. According to Simon, the Linux
> panic was solved and might just not have hit mainline yet; if that is
> confirmed, then renaming arch_cleanup_before_linux() becomes moot.
>
> Ok. I found the kernel patch:
http://permalink.gmane.org/gmane.comp.video.dri.devel/78840
So, this patch is not needed.

Thanks and Regards,
Ajay Kumar
diff mbox

Patch

diff --git a/arch/arm/cpu/armv7/cpu.c b/arch/arm/cpu/armv7/cpu.c
index 01cdb7e..edf4604 100644
--- a/arch/arm/cpu/armv7/cpu.c
+++ b/arch/arm/cpu/armv7/cpu.c
@@ -23,6 +23,7 @@ 
 #include <linux/compiler.h>
 
 void __weak cpu_cache_initialization(void){}
+void __weak arch_cleanup_before_linux(void){}
 
 int cleanup_before_linux(void)
 {
@@ -35,6 +36,11 @@  int cleanup_before_linux(void)
 #ifndef CONFIG_SPL_BUILD
 	disable_interrupts();
 #endif
+	/*
+	 * Cleanup any of those architecture related settings done for u-boot,
+	 * if they can cause problem during kernel boot.
+	 */
+	arch_cleanup_before_linux();
 
 	/*
 	 * Turn off I-cache and invalidate it