Skip to content

Commit 9dce3ce

Browse files
ozbenhpaulusmack
authored andcommitted
powerpc/44x: 44x TLB doesn't need "Guarded" set for all pages
After discussing with chip designers, it appears that it's not necessary to set G everywhere on 440 cores. The various core errata related to prefetch should be sorted out by firmware by disabling icache prefetching in CCR0. We add the workaround to the kernel however just in case oooold firmwares don't do it. This is valid for -all- 4xx core variants. Later ones hard wire the absence of prefetch but it doesn't harm to clear the bits in CCR0 (they should already be cleared anyway). We still leave G=1 on the linear mapping for now, we need to stop over-mapping RAM to be able to remove it. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Kumar Gala <galak@kernel.crashing.org> Acked-by: Josh Boyer <jwboyer@linux.vnet.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
1 parent 64b3d0e commit 9dce3ce

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎arch/powerpc/kernel/head_44x.S‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,17 @@ _ENTRY(_start);
6868
mr r27,r7
6969
li r24,0 /* CPU number */
7070

71+
/*
72+
* In case the firmware didn't do it, we apply some workarounds
73+
* that are good for all 440 core variants here
74+
*/
75+
mfspr r3,SPRN_CCR0
76+
rlwinm r3,r3,0,0,27 /* disable icache prefetch */
77+
isync
78+
mtspr SPRN_CCR0,r3
79+
isync
80+
sync
81+
7182
/*
7283
* Set up the initial MMU state
7384
*
@@ -570,7 +581,6 @@ finish_tlb_load:
570581
rlwimi r10,r12,29,30,30 /* DIRTY -> SW position */
571582
and r11,r12,r10 /* Mask PTE bits to keep */
572583
andi. r10,r12,_PAGE_USER /* User page ? */
573-
ori r11,r11,_PAGE_GUARDED /* 440 errata, needs G set */
574584
beq 1f /* nope, leave U bits empty */
575585
rlwimi r11,r11,3,26,28 /* yes, copy S bits to U */
576586
1: tlbwe r11,r13,PPC44x_TLB_ATTRIB /* Write ATTRIB */

0 commit comments

Comments
 (0)