From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] powerpc/mpc85xx:Disable Debug TLB entry for non-minimal SPL
Date: Mon, 1 Jul 2013 12:14:43 -0500 [thread overview]
Message-ID: <1372698883.8183.85@snotra> (raw)
In-Reply-To: <51D14437.6010105@freescale.com> (from prabhakar@freescale.com on Mon Jul 1 03:56:23 2013)
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
prev parent reply other threads:[~2013-07-01 17:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
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=1372698883.8183.85@snotra \
--to=scottwood@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox