* flush_icache_range on AMCC 44x targets
@ 2013-04-30 12:17 Mike
2013-05-01 19:53 ` Josh Boyer
0 siblings, 1 reply; 2+ messages in thread
From: Mike @ 2013-04-30 12:17 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1525 bytes --]
Hi,
i was reading trough arch/powerpc/kernel/misc32.S looking at the icbi and
iccci instructions, from whats on print in
http://s.eeweb.com/members/kvks_kumar/answers/1356585717-PPC440_UM2013.pdf(page
272) iccci should be used once in the power-on / reset routine, and
as far as flush_icache_range goes presumably before icbi is called?
So should not flush_icache_range go
#ifdef CONFIG_44x
iccci 0, r0
#endif
icbi 0,r6
arch/powerpc/kernel/misc32.S:
/*
* Write any modified data cache blocks out to memory
* and invalidate the corresponding instruction cache blocks.
* This is a no-op on the 601.
*
* flush_icache_range(unsigned long start, unsigned long stop)
*/
_KPROBE(__flush_icache_range)
BEGIN_FTR_SECTION
blr /* for 601, do nothing */
END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
li r5,L1_CACHE_BYTES-1
andc r3,r3,r5
subf r4,r3,r4
add r4,r4,r5
srwi. r4,r4,L1_CACHE_SHIFT
beqlr
mtctr r4
mr r6,r3
1: dcbst 0,r3
addi r3,r3,L1_CACHE_BYTES
bdnz 1b
sync /* wait for dcbst's to get to ram */
#ifndef CONFIG_44x
mtctr r4
2: icbi 0,r6
addi r6,r6,L1_CACHE_BYTES
bdnz 2b
#else
/* Flash invalidate on 44x because we are passed kmapped addresses and
this doesn't work for userspace pages due to the virtually tagged
icache. Sigh. */
iccci 0, r0
#endif
sync /* additional sync needed on g4 */
isync
blr
Best regards
-Mike
[-- Attachment #2: Type: text/html, Size: 1935 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: flush_icache_range on AMCC 44x targets
2013-04-30 12:17 flush_icache_range on AMCC 44x targets Mike
@ 2013-05-01 19:53 ` Josh Boyer
0 siblings, 0 replies; 2+ messages in thread
From: Josh Boyer @ 2013-05-01 19:53 UTC (permalink / raw)
To: Mike; +Cc: linuxppc-dev
On Tue, Apr 30, 2013 at 02:17:59PM +0200, Mike wrote:
>Hi,
>
>i was reading trough arch/powerpc/kernel/misc32.S looking at the icbi and
>iccci instructions, from whats on print in
>http://s.eeweb.com/members/kvks_kumar/answers/1356585717-PPC440_UM2013.pdf(page
>272) iccci should be used once in the power-on / reset routine, and
>as far as flush_icache_range goes presumably before icbi is called?
I'm not understanding your question.
>So should not flush_icache_range go
>#ifdef CONFIG_44x
>iccci 0, r0
>#endif
>icbi 0,r6
The icbi isn't ever executed on 44x at all.
>arch/powerpc/kernel/misc32.S:
>/*
> * Write any modified data cache blocks out to memory
> * and invalidate the corresponding instruction cache blocks.
> * This is a no-op on the 601.
> *
> * flush_icache_range(unsigned long start, unsigned long stop)
> */
>_KPROBE(__flush_icache_range)
>BEGIN_FTR_SECTION
> blr /* for 601, do nothing */
>END_FTR_SECTION_IFSET(CPU_FTR_COHERENT_ICACHE)
> li r5,L1_CACHE_BYTES-1
> andc r3,r3,r5
> subf r4,r3,r4
> add r4,r4,r5
> srwi. r4,r4,L1_CACHE_SHIFT
> beqlr
> mtctr r4
> mr r6,r3
>1: dcbst 0,r3
> addi r3,r3,L1_CACHE_BYTES
> bdnz 1b
> sync /* wait for dcbst's to get to ram */
>#ifndef CONFIG_44x
This part above is "if not defined CONFIG_44X", which means execute
everything below here until you hit #else if you are running on a
processor that isn't 4xx.
> mtctr r4
>2: icbi 0,r6
> addi r6,r6,L1_CACHE_BYTES
> bdnz 2b
>#else
Otherwise, use iccci. Which is what you're sort of suggesting be done.
> /* Flash invalidate on 44x because we are passed kmapped addresses and
> this doesn't work for userspace pages due to the virtually tagged
> icache. Sigh. */
> iccci 0, r0
>#endif
So. I think the code is already doing what you think it should?
josh
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-05-01 19:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-30 12:17 flush_icache_range on AMCC 44x targets Mike
2013-05-01 19:53 ` Josh Boyer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox