From: Albert ARIBAUD <albert.aribaud@free.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] ELF_RELOC causes strange I-cache issues
Date: Thu, 21 Oct 2010 12:56:43 +0200 [thread overview]
Message-ID: <4CC01C6B.9090904@free.fr> (raw)
In-Reply-To: <4CC00D3D.2090700@denx.de>
Le 21/10/2010 11:51, Heiko Schocher a ?crit :
> Hello Albert,
>
> Albert Aribaud wrote:
>> Wolfgang (and others who can/want),
>>
>> Please test this patch; it should add a complete barrier to make
>> sure that all fixups are written to RAM before jumping there, and
>> that no remnants subsist of the old unfixed code in the instruction
>> paths. However, I cannot even do basic testing on it as I have
>> no 1136 board, so I cannot rule out even basic mistakes.
>>
>> When this works I'll do a proper [PATCH].
>>
>> Amicalement,
>> Albert.
>>
>> diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
>> index 8b63192..f49f1de 100644
>> --- a/arch/arm/cpu/arm1136/start.S
>> +++ b/arch/arm/cpu/arm1136/start.S
>> @@ -257,6 +257,11 @@ fixloop:
>> add r2, r2, #4
>> cmp r2, r3
>> bne fixloop
>> + /* fixups done, cleanup caches if used and prefetch buffer */
>> + mov r3, #0
>> + mcr p15, 0, r3, c7, c10, 4 /* data synchronization barrier */
>> + mcr p15, 0, r3, c7, c5, 0 /* invalidate instruction cache */
>> + mcr p15, 0, r3, c7, c5, 4 /* flush prefetch buffer */
>> #endif
>> #endif /* #ifndef CONFIG_SKIP_RELOCATE_UBOOT */
>
> Actually I tried an identically patch, but didn;t help :-(
>
> But as reading in the arm manual such a memory barrier should
> not be bad here ...
>
> BTW:
>
> I had a fix for this problem, but I completly not understand
> what it has to do with relocation (if it really is a problem
> introduced through relocation ...), nor why a flush_cache
> helps here, because dcache is off and only icache is on ...
Still, this is a clue.
> + flush_cache(0, 0);
This amounts to calling arm1136_flush_cache.
Wolfgang/other testers, can you do the following three tests?
1. Replace the three mcr instructions I added in my patch with this single
mcr p15, 0, r1, c7, c5, 0 /* invalidate I-cache */
2. Replace the three mcr instructions I added in my patch with this single
mcr p15, 0, r1, c7, c14, 0 /* invalidate D cache */
3. Replace the three mcr instructions I added in my patch with these two
mcr p15, 0, r0, c7, c7, 0 /* Invalidate I+D+BTB caches */
mcr p15, 0, r0, c8, c7, 0 /* Invalidate Unified TLB */
> Maybe Icache flush dosen;t work because the "ARM1136 Errata 411920
> Invalidate Instruction Cache operation can fail" interferes here?
My ARM account seems to not allow me to get these errata from them. I've
just asked for extended access, but meanwhile, is a summary of this
errata freely available?
Amicalement,
--
Albert.
next prev parent reply other threads:[~2010-10-21 10:56 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-20 18:49 [U-Boot] ELF_RELOC causes strange I-cache issues Wolfgang Denk
2010-10-20 20:12 ` Albert ARIBAUD
2010-10-20 20:54 ` Wolfgang Denk
2010-10-20 22:20 ` Joakim Tjernlund
2010-10-21 9:18 ` Albert Aribaud
2010-10-21 9:51 ` Heiko Schocher
2010-10-21 10:11 ` Reinhard Meyer
2010-10-21 10:34 ` Albert ARIBAUD
2010-10-21 10:49 ` Reinhard Meyer
2010-10-21 10:50 ` Heiko Schocher
2010-10-21 11:03 ` Stefan Roese
2010-10-21 10:54 ` Wolfgang Denk
2010-10-21 10:56 ` Albert ARIBAUD [this message]
2010-10-21 11:36 ` Wolfgang Denk
2010-10-21 11:45 ` Wolfgang Denk
2010-10-21 11:52 ` Stefano Babic
2010-10-21 11:53 ` Wolfgang Denk
2010-10-21 12:00 ` Wolfgang Denk
2010-10-21 12:53 ` Albert ARIBAUD
2010-10-21 11:28 ` Joakim Tjernlund
2010-10-21 10:05 ` Wolfgang Denk
2010-10-22 12:23 ` [U-Boot] [PATCH] ehci-hcd.c: fix hanging under higher load Wolfgang Denk
2010-10-22 19:51 ` Remy Bohmer
2010-10-22 12:26 ` [U-Boot] ELF_RELOC causes strange I-cache issues Wolfgang Denk
2010-10-22 13:19 ` Albert ARIBAUD
2010-10-22 13:28 ` Wolfgang Denk
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=4CC01C6B.9090904@free.fr \
--to=albert.aribaud@free.fr \
--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