Patchwork [U-Boot] powerpc/mpc85xx:Disable Debug TLB entry for non-minimal SPL

login
register
mail settings
Submitter Prabhakar Kushwaha
Date June 25, 2013, 5:03 a.m.
Message ID <1372136636-12909-1-git-send-email-prabhakar@freescale.com>
Download mbox | patch
Permalink /patch/254019/
State Changes Requested
Delegated to: Andy Fleming
Headers show

Comments

Prabhakar Kushwaha - June 25, 2013, 5:03 a.m.
CONFIG_SPL_BUILD creates debug TLB entry, so disable it before init_tlbs.

CONFIG_SPL_INIT_MINIMAL never creates any debug TLB entry, so no need
of disable_tlb().

Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
---
 arch/powerpc/cpu/mpc85xx/cpu_init_early.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Scott Wood - June 25, 2013, 3:08 p.m.
On 06/25/2013 12:03:56 AM, Prabhakar Kushwaha wrote:
> CONFIG_SPL_BUILD creates debug TLB entry, so disable it before  
> init_tlbs.
> 
> CONFIG_SPL_INIT_MINIMAL never creates any debug TLB entry, so no need
> of disable_tlb().
> 
> Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
> ---
>  arch/powerpc/cpu/mpc85xx/cpu_init_early.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c  
> b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
> index 837c034..0cb2717 100644
> --- a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
> +++ b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
> @@ -180,7 +180,8 @@ void cpu_init_early_f(void)
> 
>  	invalidate_tlb(1);
> 
> -#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) &&  
> !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_NAND_SPL)
> +#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && \
> +		!defined(CONFIG_SPL_INIT_MINIMAL) &&  
> !defined(CONFIG_NAND_SPL)
>  	disable_tlb(CONFIG_SYS_PPC_E500_DEBUG_TLB);
>  #endif

This fails to clear the debug TLB in non-SPL_BUILD portion of a build  
that has CONFIG_SPL_INIT_MINIMAL set.

-Scott
Prabhakar Kushwaha - June 26, 2013, 4:09 a.m.
On 06/25/2013 08:38 PM, Scott Wood wrote:
> On 06/25/2013 12:03:56 AM, Prabhakar Kushwaha wrote:
>> CONFIG_SPL_BUILD creates debug TLB entry, so disable it before 
>> init_tlbs.
>>
>> CONFIG_SPL_INIT_MINIMAL never creates any debug TLB entry, so no need
>> of disable_tlb().
>>
>> Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
>> ---
>>  arch/powerpc/cpu/mpc85xx/cpu_init_early.c |    3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c 
>> b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
>> index 837c034..0cb2717 100644
>> --- a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
>> +++ b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
>> @@ -180,7 +180,8 @@ void cpu_init_early_f(void)
>>
>>      invalidate_tlb(1);
>>
>> -#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && 
>> !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_NAND_SPL)
>> +#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && \
>> +        !defined(CONFIG_SPL_INIT_MINIMAL) && !defined(CONFIG_NAND_SPL)
>>      disable_tlb(CONFIG_SYS_PPC_E500_DEBUG_TLB);
>>  #endif
>
> This fails to clear the debug TLB in non-SPL_BUILD portion of a build 
> that has CONFIG_SPL_INIT_MINIMAL setoh..
oh.. lots of cases :(

then it should be like this. slightly complex.
#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && !(defined(CONFIG_NAND_SPL) 
|| \
     (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_INIT_MINIMAL)))

or
#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && (CONFIG_SYS_RAMBOOT) || \
     (defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_INIT_MINIMAL)))


I tried below. it does not even build SPL framework .
  "To define CONFIG_SPL_INIT_MINIMAL under CONFIG_SPL_BUILD for all the 
boards"
     #ifdef CONFIG_SPL_BUILD
         #define CONFIG_SPL
         #define CONFIG_SPL_INIT_MINIMAL
         #define CONFIG_SPL_SERIAL_SUPPORT
         #define CONFIG_SPL_NAND_SUPPORT
         #define CONFIG_SPL_NAND_MINIMAL
         #define CONFIG_SPL_FLUSH_IMAGE
         #define CONFIG_SPL_TARGET        "u-boot-with-spl.bin"
     #endif

Please suggest.

Regards,
Prabhakar

Patch

diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
index 837c034..0cb2717 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
@@ -180,7 +180,8 @@  void cpu_init_early_f(void)
 
 	invalidate_tlb(1);
 
-#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_NAND_SPL)
+#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && \
+		!defined(CONFIG_SPL_INIT_MINIMAL) && !defined(CONFIG_NAND_SPL)
 	disable_tlb(CONFIG_SYS_PPC_E500_DEBUG_TLB);
 #endif