All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] powerpc/mpc85xx:Disable Debug TLB entry for non-minimal SPL
@ 2013-06-25  5:03 Prabhakar Kushwaha
  2013-06-25 15:08 ` Scott Wood
  0 siblings, 1 reply; 8+ messages in thread
From: Prabhakar Kushwaha @ 2013-06-25  5:03 UTC (permalink / raw)
  To: u-boot

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
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH] powerpc/mpc85xx:Disable Debug TLB entry for non-minimal SPL
  2013-06-25  5:03 [U-Boot] [PATCH] powerpc/mpc85xx:Disable Debug TLB entry for non-minimal SPL Prabhakar Kushwaha
@ 2013-06-25 15:08 ` Scott Wood
  2013-06-26  4:09   ` Prabhakar Kushwaha
  0 siblings, 1 reply; 8+ messages in thread
From: Scott Wood @ 2013-06-25 15:08 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH] powerpc/mpc85xx:Disable Debug TLB entry for non-minimal SPL
  2013-06-25 15:08 ` Scott Wood
@ 2013-06-26  4:09   ` Prabhakar Kushwaha
  2013-06-26 19:06     ` Scott Wood
  0 siblings, 1 reply; 8+ messages in thread
From: Prabhakar Kushwaha @ 2013-06-26  4:09 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH] powerpc/mpc85xx:Disable Debug TLB entry for non-minimal SPL
  2013-06-26  4:09   ` Prabhakar Kushwaha
@ 2013-06-26 19:06     ` Scott Wood
  2013-06-28  9:05       ` Prabhakar Kushwaha
  0 siblings, 1 reply; 8+ messages in thread
From: Scott Wood @ 2013-06-26 19:06 UTC (permalink / raw)
  To: u-boot

On 06/25/2013 11:09:04 PM, Prabhakar Kushwaha wrote:
> 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)))

The former:

http://lists.denx.de/pipermail/u-boot/2013-June/157201.html

Ignore the line wrapping.

The latter will only clear the debug TLB when CONFIG_SYS_RAMBOOT is set  
or in a non-minimal SPL (i.e. not in an ordinary NOR boot), which I  
don't think is what you meant.  Check your parentheses. :-)

If you meant to exclude CONFIG_SYS_RAMBOOT, why?

-Scott

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH] powerpc/mpc85xx:Disable Debug TLB entry for non-minimal SPL
  2013-06-26 19:06     ` Scott Wood
@ 2013-06-28  9:05       ` Prabhakar Kushwaha
  2013-06-28 16:19         ` Scott Wood
  0 siblings, 1 reply; 8+ messages in thread
From: Prabhakar Kushwaha @ 2013-06-28  9:05 UTC (permalink / raw)
  To: u-boot

On 06/27/2013 12:36 AM, Scott Wood wrote:
> On 06/25/2013 11:09:04 PM, Prabhakar Kushwaha wrote:
>> 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)))
>
> The former:
>
> http://lists.denx.de/pipermail/u-boot/2013-June/157201.html
>
The defines mentioned at this link and earlier written by me will not 
work as they are not taking care of SD boot and NOR boot scenario.

Below define will take care of all possible combination
  - NOR , SD, SPI boot
  - NAND_SPL
  - SPL with SPL_INIT_MINIMAL
  - SPL without SPL_INIT_MINIMAL

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

Took lot of time to figure out :)

Regards,
Prabhakar

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH] powerpc/mpc85xx:Disable Debug TLB entry for non-minimal SPL
  2013-06-28  9:05       ` Prabhakar Kushwaha
@ 2013-06-28 16:19         ` Scott Wood
  2013-07-01  8:56           ` Prabhakar Kushwaha
  0 siblings, 1 reply; 8+ messages in thread
From: Scott Wood @ 2013-06-28 16:19 UTC (permalink / raw)
  To: u-boot

On 06/28/2013 04:05:43 AM, Prabhakar Kushwaha wrote:
> On 06/27/2013 12:36 AM, Scott Wood wrote:
>> On 06/25/2013 11:09:04 PM, Prabhakar Kushwaha wrote:
>>> 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)))
>> 
>> The former:
>> 
>> http://lists.denx.de/pipermail/u-boot/2013-June/157201.html
>> 
> The defines mentioned at this link and earlier written by me will not  
> work as they are not taking care of SD boot and NOR boot scenario.

How so?

> Below define will take care of all possible combination
>  - NOR , SD, SPI boot
>  - NAND_SPL
>  - SPL with SPL_INIT_MINIMAL
>  - SPL without SPL_INIT_MINIMAL
> 
> #if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) &&  
> !defined(CONFIG_NAND_SPL) && \
>     (!defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SPL_INIT_MINIMAL))
> 
> Took lot of time to figure out :)

That's equivalent to what I suggested in the above link.  You just  
replaced !(x && y) with (!x || !y).

Or relative to your original suggestion above, you replaced !(x || (y  
&& z)) with !x && (!y || !z).

They're all logically equivalent[1].  The question is just which one is  
most readable/intuitive.

-Scott

[1] http://en.wikipedia.org/wiki/De_Morgan%27s_laws

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH] powerpc/mpc85xx:Disable Debug TLB entry for non-minimal SPL
  2013-06-28 16:19         ` Scott Wood
@ 2013-07-01  8:56           ` Prabhakar Kushwaha
  2013-07-01 17:14             ` Scott Wood
  0 siblings, 1 reply; 8+ messages in thread
From: Prabhakar Kushwaha @ 2013-07-01  8:56 UTC (permalink / raw)
  To: u-boot

On 06/28/2013 09:49 PM, Scott Wood wrote:
> On 06/28/2013 04:05:43 AM, Prabhakar Kushwaha wrote:
>> On 06/27/2013 12:36 AM, Scott Wood wrote:
>>> On 06/25/2013 11:09:04 PM, Prabhakar Kushwaha wrote:
>>>> 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)))
>>>
>>> The former:
>>>
>>> http://lists.denx.de/pipermail/u-boot/2013-June/157201.html
>>>
>> The defines mentioned at this link and earlier written by me will not 
>> work as they are not taking care of SD boot and NOR boot scenario.
>
> How so?
>
>> Below define will take care of all possible combination
>>  - NOR , SD, SPI boot
>>  - NAND_SPL
>>  - SPL with SPL_INIT_MINIMAL
>>  - SPL without SPL_INIT_MINIMAL
>>
>> #if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && 
>> !defined(CONFIG_NAND_SPL) && \
>>     (!defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SPL_INIT_MINIMAL))
>>
>> Took lot of time to figure out :)
>
> That's equivalent to what I suggested in the above link.  You just 
> replaced !(x && y) with (!x || !y).
>
> Or relative to your original suggestion above, you replaced !(x || (y 
> && z)) with !x && (!y || !z).
>
> They're all logically equivalent[1].  The question is just which one 
> is most readable/intuitiv


We have below mentioned issues with defines :-

A)  Earlier suggested by me
#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && !(defined(CONFIG_NAND_SPL) 
|| \
     (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_INIT_MINIMAL)))

This will cause compile failure in SPL build.
in SPL build, CONFIG_NAND_SPL is not defined hence "1" making 
disable_tlb() present. As SPL + SPL_INIT_MINIMAL does not have TLB 
related functions means compilation error.

B)  Define suggested at this link has 
"http://lists.denx.de/pipermail/u-boot/2013-June/157201.html "
#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && \
     !(defined(CONFIG_SPL_INIT_MINIMAL) && defined(CONFIG_SPL_BUILD)) && \
     !defined(CONFIG_NAND_SPL)

here, during SD & NOR boot,  CONFIG_SPL_BUILD is not defined. hece 
complete define = 0.  this make disable_tlb not compile which is wrong.


Only below define solve all the use cases.
#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && !defined(CONFIG_NAND_SPL) 
&& \
     (!defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SPL_INIT_MINIMAL))

Please suggest.

Regards,
Prabhakar

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [U-Boot] [PATCH] powerpc/mpc85xx:Disable Debug TLB entry for non-minimal SPL
  2013-07-01  8:56           ` Prabhakar Kushwaha
@ 2013-07-01 17:14             ` Scott Wood
  0 siblings, 0 replies; 8+ messages in thread
From: Scott Wood @ 2013-07-01 17:14 UTC (permalink / raw)
  To: u-boot

On 07/01/2013 03:56:23 AM, Prabhakar Kushwaha wrote:
> On 06/28/2013 09:49 PM, Scott Wood wrote:
>> On 06/28/2013 04:05:43 AM, Prabhakar Kushwaha wrote:
>>> On 06/27/2013 12:36 AM, Scott Wood wrote:
>>>> On 06/25/2013 11:09:04 PM, Prabhakar Kushwaha wrote:
>>>>> 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)))
>>>> 
>>>> The former:
>>>> 
>>>> http://lists.denx.de/pipermail/u-boot/2013-June/157201.html
>>>> 
>>> The defines mentioned at this link and earlier written by me will  
>>> not work as they are not taking care of SD boot and NOR boot  
>>> scenario.
>> 
>> How so?
>> 
>>> Below define will take care of all possible combination
>>>  - NOR , SD, SPI boot
>>>  - NAND_SPL
>>>  - SPL with SPL_INIT_MINIMAL
>>>  - SPL without SPL_INIT_MINIMAL
>>> 
>>> #if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) &&  
>>> !defined(CONFIG_NAND_SPL) && \
>>>     (!defined(CONFIG_SPL_BUILD) ||  
>>> !defined(CONFIG_SPL_INIT_MINIMAL))
>>> 
>>> Took lot of time to figure out :)
>> 
>> That's equivalent to what I suggested in the above link.  You just  
>> replaced !(x && y) with (!x || !y).
>> 
>> Or relative to your original suggestion above, you replaced !(x ||  
>> (y && z)) with !x && (!y || !z).
>> 
>> They're all logically equivalent[1].  The question is just which one  
>> is most readable/intuitiv
> 
> 
> We have below mentioned issues with defines :-
> 
> A)  Earlier suggested by me
> #if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) &&  
> !(defined(CONFIG_NAND_SPL) || \
>     (defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_INIT_MINIMAL)))
> 
> This will cause compile failure in SPL build.
> in SPL build, CONFIG_NAND_SPL is not defined hence "1" making  
> disable_tlb() present. As SPL + SPL_INIT_MINIMAL does not have TLB  
> related functions means compilation error.

In that case CONFIG_SPL_BUILD and CONFIG_SPL_INIT_MINIMAL will be  
defined, which means (defined(CONFIG_NAND_SPL) ||  
(defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_INIT_MINIMAL))) will  
be true, which means the negation will be false, which means the  
toplevel conjunction will be false, and disable_tlb() will not be  
called.

Again, unless I'm misreading something, this is 100% logically  
equivalent to your final suggestion.  I tried copy-and-pasting the  
above and had no problem building P2020RDB-PC_NAND.

> B)  Define suggested at this link has  
> "http://lists.denx.de/pipermail/u-boot/2013-June/157201.html "
> #if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && \
>     !(defined(CONFIG_SPL_INIT_MINIMAL) && defined(CONFIG_SPL_BUILD))  
> && \
>     !defined(CONFIG_NAND_SPL)
> 
> here, during SD & NOR boot,  CONFIG_SPL_BUILD is not defined. hece  
> complete define = 0.  this make disable_tlb not compile which is  
> wrong.

If CONFIG_SPL_BUILD is not defined, then !(anything &&  
defined(CONFIG_SPL_BUILD)) will be true.  Since the other terms of the  
toplevel conjunction will also be true, disable_tlb will be compiled.

-Scott

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-07-01 17:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-25  5:03 [U-Boot] [PATCH] powerpc/mpc85xx:Disable Debug TLB entry for non-minimal SPL Prabhakar Kushwaha
2013-06-25 15:08 ` Scott Wood
2013-06-26  4:09   ` Prabhakar Kushwaha
2013-06-26 19:06     ` Scott Wood
2013-06-28  9:05       ` Prabhakar Kushwaha
2013-06-28 16:19         ` Scott Wood
2013-07-01  8:56           ` Prabhakar Kushwaha
2013-07-01 17:14             ` Scott Wood

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.