diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-02-28 23:46:09 -0500 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-04-19 21:03:24 -0400 |
commit | b144871cb5f2c268e94258ae8f1ec810db2e1120 (patch) | |
tree | c29295c70bccde6487992fe5c4c8bac87bd4e867 | |
parent | 895796a8ab548fe03b6fea410dcb1b86e1913708 (diff) |
powerpc: Initialize TLB and LPID register on HV mode Power7
In case entry from the bootloader isn't "clean"
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r-- | arch/powerpc/kernel/cpu_setup_power7.S | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/cpu_setup_power7.S b/arch/powerpc/kernel/cpu_setup_power7.S index 2390f6f7c478..4f9a93fcfe07 100644 --- a/arch/powerpc/kernel/cpu_setup_power7.S +++ b/arch/powerpc/kernel/cpu_setup_power7.S | |||
@@ -25,7 +25,10 @@ _GLOBAL(__setup_cpu_power7) | |||
25 | bl __init_hvmode_206 | 25 | bl __init_hvmode_206 |
26 | mtlr r11 | 26 | mtlr r11 |
27 | beqlr | 27 | beqlr |
28 | li r0,0 | ||
29 | mtspr SPRN_LPID,r0 | ||
28 | bl __init_LPCR | 30 | bl __init_LPCR |
31 | bl __init_TLB | ||
29 | mtlr r11 | 32 | mtlr r11 |
30 | blr | 33 | blr |
31 | 34 | ||
@@ -34,7 +37,10 @@ _GLOBAL(__restore_cpu_power7) | |||
34 | mfmsr r3 | 37 | mfmsr r3 |
35 | rldicl. r0,r3,4,63 | 38 | rldicl. r0,r3,4,63 |
36 | beqlr | 39 | beqlr |
40 | li r0,0 | ||
41 | mtspr SPRN_LPID,r0 | ||
37 | bl __init_LPCR | 42 | bl __init_LPCR |
43 | bl __init_TLB | ||
38 | mtlr r11 | 44 | mtlr r11 |
39 | blr | 45 | blr |
40 | 46 | ||
@@ -71,3 +77,15 @@ __init_LPCR: | |||
71 | mtspr SPRN_LPCR,r3 | 77 | mtspr SPRN_LPCR,r3 |
72 | isync | 78 | isync |
73 | blr | 79 | blr |
80 | |||
81 | __init_TLB: | ||
82 | /* Clear the TLB */ | ||
83 | li r6,128 | ||
84 | mtctr r6 | ||
85 | li r7,0xc00 /* IS field = 0b11 */ | ||
86 | ptesync | ||
87 | 2: tlbiel r7 | ||
88 | addi r7,r7,0x1000 | ||
89 | bdnz 2b | ||
90 | ptesync | ||
91 | 1: blr | ||