Skip to content

Commit

Permalink
powerpc: Initialize TLB and LPID register on HV mode Power7
Browse files Browse the repository at this point in the history
In case entry from the bootloader isn't "clean"

Signed-off-by: Benjamin Herrenschmidt <[email protected]>
  • Loading branch information
ozbenh committed Apr 20, 2011
1 parent 895796a commit b144871
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions arch/powerpc/kernel/cpu_setup_power7.S
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ _GLOBAL(__setup_cpu_power7)
bl __init_hvmode_206
mtlr r11
beqlr
li r0,0
mtspr SPRN_LPID,r0
bl __init_LPCR
bl __init_TLB
mtlr r11
blr

Expand All @@ -34,7 +37,10 @@ _GLOBAL(__restore_cpu_power7)
mfmsr r3
rldicl. r0,r3,4,63
beqlr
li r0,0
mtspr SPRN_LPID,r0
bl __init_LPCR
bl __init_TLB
mtlr r11
blr

Expand Down Expand Up @@ -71,3 +77,15 @@ __init_LPCR:
mtspr SPRN_LPCR,r3
isync
blr

__init_TLB:
/* Clear the TLB */
li r6,128
mtctr r6
li r7,0xc00 /* IS field = 0b11 */
ptesync
2: tlbiel r7
addi r7,r7,0x1000
bdnz 2b
ptesync
1: blr

0 comments on commit b144871

Please sign in to comment.