public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Prabhakar Kushwaha <prabhakar@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 03/22] powerpc/mpc85xx: move debug tlb entry after TLB is in known state
Date: Wed, 31 Oct 2012 11:47:31 +0530	[thread overview]
Message-ID: <5090C27B.6040904@freescale.com> (raw)
In-Reply-To: <1351631237.2530.7@snotra>

On 10/31/2012 02:37 AM, Scott Wood wrote:
> On 10/30/2012 04:26:16 AM, Prabhakar Kushwaha wrote:
>> On 10/30/2012 07:34 AM, Scott Wood wrote:
>>> Previously, in many if not all configs we were creating overlapping 
>>> TLB entries
>>> which is illegal.  This caused a crash during boot when moving 
>>> p2020rdb NAND SPL
>>> into L2 SRAM.
>>>
>>> Signed-off-by: Scott Wood <scottwood@freescale.com>
>>> Cc: Prabhakar Kushwaha <prabhakar@freescale.com>
>>> Cc: Andy Fleming <afleming@freescale.com>
>>> -- 
>>> Prabhakar, please test that debug still works.
>>>
>>
>> During RAMBOOT, both "temporary debug TLB entry" and "execution TLB 
>> entry" is same. So moving "temporary debug TLB  entry" creation after 
>> "execution TLB entry resizing" will make sure of debugging during 
>> NAND ramboot, SPI and SD boot.
>>
>> But for NOR  & NAND SPL there is a problem because boot-up TLB as 
>> 0xfffff000 and temporary debug TLB as 0xEFF80000. So we require to 
>> create temporary TLB entry to support early debugging.
>>
>> I will suggest to split the CONFIG_SYS_PPC_E500_DEBUG_TLB define into 
>> 2 parts.
>>  1)  For NOR , NAND spl debugging
>>  2)  For RAMBoot:  After resizing of execution TLB
>
> I'd rather not see this split this up.  This file is too much of a 
> complicated ifdef mess already.
>
> The window during which you won't be able to use breakpoints is not 
> that large.
> There are other debugging techniques that can be used. 

Can you please share the other techniques. It will help us in future.

> Meanwhile, I wasted time debugging the problems that this extra TLB 
> entry caused -- and every time I try to reason about what's going on 
> in this file, I now have one more thing to consider (which is really 
> several more things due to all the different scenarios).  Not exactly 
> the desired outcome of something meant to help debugging.
>

Debugger is present to help in these scenario for faster and effective 
debugging.
My effort is to make as much as possible u-boot code to be debbug-able.

 From now on, we have to take care of extra temporary debug TLB entry. 
But this should not mean, no new TLB entries can be created depending 
upon requirement.  This TLB entry is required for debugging in AS1 
execution space.

if everything is perfect, debugging is even not required. but if 
something broken in AS1, debugger is best/shortest way to debug.

> Also, we should not be creating this entry at any time during the SPL.

I believe it should not be required as NAND SPL never required.  But 
still need to check once this framework is pushed for mpx85xx platforms

>
>> I made following changes in the patch and tested across P1010RDB for 
>> NOR, NAND-SPL, NAND Ramboot and SPI boot debugging.
>>
>> Please note I used only this patch after replacing MINIMAL_SPL with 
>> CONFIG_NAND_SPL.
>>
>> diff --git a/arch/powerpc/cpu/mpc85xx/start.S 
>> b/arch/powerpc/cpu/mpc85xx/start.S
>> index ac17f9d..c00db4a 100644
>> --- a/arch/powerpc/cpu/mpc85xx/start.S
>> +++ b/arch/powerpc/cpu/mpc85xx/start.S
>> @@ -282,7 +282,7 @@ l2_disabled:
>>         isync
>>         .endm
>>
>> -#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && !defined(CONFIG_NAND_SPL)
>> +#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && !defined(MINIMAL_SPL)
>>  /*
>>   * TLB entry for debuggging in AS1
>>   * Create temporary TLB entry in AS0 to handle debug exception
>> @@ -309,16 +309,6 @@ l2_disabled:
>>                 CONFIG_SYS_MONITOR_BASE, MAS2_I|MAS2_G, \
>>                 CONFIG_SYS_PBI_FLASH_WINDOW, MAS3_SX|MAS3_SW|MAS3_SR, \
>>                 0, r6
>> -#else
>> -/*
>> - * TLB entry is created for IVPR + IVOR15 to map on valid OP code 
>> address
>> - * because "nexti" will resize TLB to 4K
>> - */
>> -       create_tlb1_entry CONFIG_SYS_PPC_E500_DEBUG_TLB, \
>> -               0, BOOKE_PAGESZ_256K, \
>> -               CONFIG_SYS_MONITOR_BASE, MAS2_I, \
>> -               CONFIG_SYS_MONITOR_BASE, MAS3_SX|MAS3_SW|MAS3_SR, \
>> -               0, r6
>>  #endif
>>  #endif
>>
>> @@ -520,6 +510,24 @@ nexti:     mflr    r1              /* R1 = our 
>> PC */
>>         msync
>>         tlbwe
>>
>> +#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && !defined(MINIMAL_SPL)\
>> +   && defined(CONFIG_SYS_RAMBOOT)
>
> Get rid of that CONFIG_SYS_RAMBOOT.  We don't set it anymore for SPL 
> as of this patchset.  And the SPL payload is precisely when I saw 
> problems with this!
>

I paste this just for reference. It should be updated in v2 version of 
this SPL patch series.

>> +/*
>> + * TLB entry for debuggging in AS1
>> + * Create temporary TLB entry in AS0 to handle debug exception
>> + * As on debug exception MSR is cleared i.e. Address space is changed
>> + * to 0. A TLB entry (in AS0) is required to handle debug exception 
>> generated
>> + * in AS1.
>> + * TLB entry is created for IVPR + IVOR15 to map on valid OP code 
>> address
>> + * because "nexti" has resized  execution TLB entry to 4K
>> + */
>> +       create_tlb1_entry CONFIG_SYS_PPC_E500_DEBUG_TLB, \
>> +               0, BOOKE_PAGESZ_256K, \
>> +               CONFIG_SYS_MONITOR_BASE & 0xfffc0000, MAS2_I, \
>> +               CONFIG_SYS_MONITOR_BASE & 0xfffc0000, 
>> MAS3_SX|MAS3_SW|MAS3_SR, \
>> +               0, r6
>> +#endif
>> +
>>  /*
>>   * Clear out any other TLB entries that may exist, to avoid conflicts.
>>   * Our TLB entry is in r14.
>
> You *cannot* put this entry into the TLB until we've cleared out the 
> unknown previous contents of the TLB.
>

OK. We can put it just after clearing TLB entries.


Regards,
Prabhakar

  reply	other threads:[~2012-10-31  6:17 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-22  0:01 [U-Boot] [RFC PATCH 00/17] Convert p1_p2_rdb_pc to new spl Scott Wood
2012-09-22  0:01 ` [U-Boot] [RFC PATCH 01/17] Add u-boot-pad.bin target to the Makefile Scott Wood
2012-09-22  0:01 ` [U-Boot] [RFC PATCH 02/17] spl: rename u-boot-pad.bin to u-boot-with-spl.bin Scott Wood
2012-09-22  0:01 ` [U-Boot] [RFC PATCH 03/17] powerpc: remove .fixup test Scott Wood
2012-09-24 15:30   ` Peter Tyser
2012-09-24 18:47     ` Scott Wood
2012-09-24 23:38       ` Tom Rini
2012-09-22  0:01 ` [U-Boot] [RFC PATCH 04/17] powerpc/mpc85xx: fix TLB alignment Scott Wood
2012-09-22  0:01 ` [U-Boot] [RFC PATCH 05/17] powerpc/mpc8xxx: move LAW code into arch/powerpc/cpu/mpc8xxx Scott Wood
2012-09-22  0:01 ` [U-Boot] [RFC PATCH 06/17] spl/mpc85xx: move udelay to cpu code Scott Wood
2012-09-22  0:01 ` [U-Boot] [RFC PATCH 07/17] spl: include resetvec and lib8xxx Scott Wood
2012-09-22  0:01 ` [U-Boot] [RFC PATCH 08/17] spl/powerpc: introduce CONFIG_SPL_INIT_MINIMAL Scott Wood
2012-09-24 23:48   ` Tom Rini
2012-09-24 23:52     ` Scott Wood
2012-09-25  0:03       ` Tom Rini
2012-09-25  0:17         ` Scott Wood
2012-09-22  0:01 ` [U-Boot] [RFC PATCH 09/17] spl/85xx: new SPL support Scott Wood
2012-09-24 23:51   ` Tom Rini
2012-09-24 23:54     ` Scott Wood
2012-09-25  0:04       ` Tom Rini
2012-09-25  0:08         ` Scott Wood
2012-09-25  0:13           ` Tom Rini
2012-09-22  0:01 ` [U-Boot] [RFC PATCH 10/17] powerpc/p1_p2_rdb_pc: " Scott Wood
2012-09-22  0:01 ` [U-Boot] [RFC PATCH 11/17] spl/nand: introduce CONFIG_SPL_NAND_MINIMAL Scott Wood
2012-09-24 23:55   ` Tom Rini
2012-09-25  0:02     ` Scott Wood
2012-09-25  0:13       ` Tom Rini
2012-09-22  0:01 ` [U-Boot] [RFC PATCH 12/17] spl/nand: config symbol documentation Scott Wood
2012-09-22  0:01 ` [U-Boot] [RFC PATCH 13/17] spl/nand: Add minimal-spl driver for Freescale eLBC NAND Scott Wood
2012-09-22  0:01 ` [U-Boot] [RFC PATCH 14/17] spl: introduce CONFIG_SPL_TARGET Scott Wood
2012-09-22  0:12   ` Tom Rini
2012-09-24 18:54     ` Scott Wood
2012-09-24 19:03       ` Tom Rini
2012-09-24 20:05         ` Scott Wood
2012-09-22  0:01 ` [U-Boot] [RFC PATCH 15/17] p1_p2_rdb_pc: convert from nand_spl to new spl Scott Wood
2012-09-22  0:01 ` [U-Boot] [RFC PATCH 16/17] powerpc/mpc85xx/p2020rdb-pc: fix SPL DDR config Scott Wood
2012-09-22  0:01 ` [U-Boot] [RFC PATCH 17/17] ns16550: wait for TENT before initializing Scott Wood
2012-10-01 14:27   ` [U-Boot] [u-boot-release] " Timur Tabi
2012-09-22  0:13 ` [U-Boot] [RFC PATCH 00/17] Convert p1_p2_rdb_pc to new spl Tom Rini
2012-09-24 18:50   ` Scott Wood
2012-09-24 19:06     ` Tom Rini
2012-09-24 19:15       ` Scott Wood
2012-10-30  2:04 ` [U-Boot] [PATCH v2 00/22] " Scott Wood
2012-10-30  2:04   ` [U-Boot] [PATCH v2 01/22] serial/ns16550: don't build serial_ns16550 with MIN_FUNCTIONS Scott Wood
2012-10-30  2:04   ` [U-Boot] [PATCH v2 02/22] serial/ns16550: wait for TEMT before initializing Scott Wood
2012-10-30  2:04   ` [U-Boot] [PATCH v2 03/22] powerpc/mpc85xx: move debug tlb entry after TLB is in known state Scott Wood
2012-10-30  9:26     ` Prabhakar Kushwaha
2012-10-30 21:07       ` Scott Wood
2012-10-31  6:17         ` Prabhakar Kushwaha [this message]
2012-10-31 22:08           ` Scott Wood
2012-10-31 22:44             ` McClintock Matthew-B29882
     [not found]             ` <CAEsOVNeZAyH1nxfgnjPYUG4=7yxjF9rjsRWrpa=WYW8edfiM3Q@mail.gmail.com>
2012-10-31 22:45               ` McClintock Matthew-B29882
2012-10-31 22:51                 ` Scott Wood
2012-11-16  2:12     ` Scott Wood
2012-11-26 20:53     ` Andy Fleming
2012-10-30  2:04   ` [U-Boot] [PATCH v2 04/22] powerpc/mpc85xx: add comma before "already enabled" Scott Wood
2012-10-30  2:04   ` [U-Boot] [PATCH v2 05/22] Add u-boot-pad.bin target to the Makefile Scott Wood
2012-10-30  2:04   ` [U-Boot] [PATCH v2 06/22] spl: rename u-boot-pad.bin to u-boot-with-spl.bin Scott Wood
2012-10-30  2:04   ` [U-Boot] [PATCH v2 07/22] spl: introduce CONFIG_SPL_TARGET Scott Wood
2012-10-30  2:04   ` [U-Boot] [PATCH v2 08/22] powerpc: change .fixup test to a GCC version test Scott Wood
2012-10-30  2:04   ` [U-Boot] [PATCH v2 09/22] powerpc/mpc85xx: fix TLB alignment Scott Wood
2012-10-30  2:04   ` [U-Boot] [PATCH v2 10/22] powerpc/mpc8xxx: move LAW code into arch/powerpc/cpu/mpc8xxx Scott Wood
2012-10-30  2:04   ` [U-Boot] [PATCH v2 11/22] spl/mpc85xx: move udelay to cpu code Scott Wood
2012-10-30  2:05   ` [U-Boot] [PATCH v2 12/22] spl: include resetvec and lib8xxx Scott Wood
2012-10-30  2:05   ` [U-Boot] [PATCH v2 13/22] spl/mpc85xx: rename cpu_init_nand.c to spl_minimal.c Scott Wood
2012-10-30  2:05   ` [U-Boot] [PATCH v2 14/22] powerpc/mpc85xx: consistently use COBJS-y Scott Wood
2012-10-30  2:05   ` [U-Boot] [PATCH v2 15/22] spl/powerpc: introduce CONFIG_SPL_INIT_MINIMAL Scott Wood
2012-10-30  2:05   ` [U-Boot] [PATCH v2 16/22] spl/85xx: new SPL support Scott Wood
2012-10-30  2:05   ` [U-Boot] [PATCH v2 17/22] powerpc/mpc85xx/p1_p2_rdb_pc: " Scott Wood
2012-10-30  2:05   ` [U-Boot] [PATCH v2 18/22] spl/nand: introduce CONFIG_SPL_NAND_DRIVERS, _BASE, and _ECC Scott Wood
2012-10-30  2:05   ` [U-Boot] [PATCH v2 19/22] spl/nand: config symbol documentation Scott Wood
2012-10-30  2:05   ` [U-Boot] [PATCH v2 20/22] powerpc/mpc85xx/p1_p2_rdb_pc: convert from nand_spl to new spl Scott Wood
2012-10-30  2:05   ` [U-Boot] [PATCH v2 21/22] powerpc/mpc85xx/p1_p2_rdb_pc: clean up memory map Scott Wood
2012-10-30  2:05   ` [U-Boot] [PATCH v2 22/22] powerpc/mpc85xx/p2020rdb-pca: Use L2 SRAM for SPL boot Scott Wood
2012-10-30  3:17     ` Tabi Timur-B04825
2012-10-30 23:37       ` Scott Wood
2012-11-13 22:41     ` [U-Boot] [PATCH v3] " Scott Wood
2012-10-30 17:04   ` [U-Boot] [PATCH v2 00/22] Convert p1_p2_rdb_pc to new spl Tom Rini
2012-10-30 20:17     ` Scott Wood
2012-10-30 21:12       ` Tom Rini
2012-11-13 22:42         ` Scott Wood

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=5090C27B.6040904@freescale.com \
    --to=prabhakar@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