diff options
Diffstat (limited to 'arch/powerpc/kernel/cpu_setup_fsl_booke.S')
-rw-r--r-- | arch/powerpc/kernel/cpu_setup_fsl_booke.S | 74 |
1 files changed, 65 insertions, 9 deletions
diff --git a/arch/powerpc/kernel/cpu_setup_fsl_booke.S b/arch/powerpc/kernel/cpu_setup_fsl_booke.S index 69fdd2322a6..dcd881937f7 100644 --- a/arch/powerpc/kernel/cpu_setup_fsl_booke.S +++ b/arch/powerpc/kernel/cpu_setup_fsl_booke.S | |||
@@ -16,6 +16,8 @@ | |||
16 | #include <asm/processor.h> | 16 | #include <asm/processor.h> |
17 | #include <asm/cputable.h> | 17 | #include <asm/cputable.h> |
18 | #include <asm/ppc_asm.h> | 18 | #include <asm/ppc_asm.h> |
19 | #include <asm/mmu-book3e.h> | ||
20 | #include <asm/asm-offsets.h> | ||
19 | 21 | ||
20 | _GLOBAL(__e500_icache_setup) | 22 | _GLOBAL(__e500_icache_setup) |
21 | mfspr r0, SPRN_L1CSR1 | 23 | mfspr r0, SPRN_L1CSR1 |
@@ -73,27 +75,81 @@ _GLOBAL(__setup_cpu_e500v2) | |||
73 | mtlr r4 | 75 | mtlr r4 |
74 | blr | 76 | blr |
75 | _GLOBAL(__setup_cpu_e500mc) | 77 | _GLOBAL(__setup_cpu_e500mc) |
76 | mr r5, r4 | 78 | _GLOBAL(__setup_cpu_e5500) |
77 | mflr r4 | 79 | mflr r5 |
78 | bl __e500_icache_setup | 80 | bl __e500_icache_setup |
79 | bl __e500_dcache_setup | 81 | bl __e500_dcache_setup |
80 | bl __setup_e500mc_ivors | 82 | bl __setup_e500mc_ivors |
81 | mtlr r4 | 83 | /* |
84 | * We only want to touch IVOR38-41 if we're running on hardware | ||
85 | * that supports category E.HV. The architectural way to determine | ||
86 | * this is MMUCFG[LPIDSIZE]. | ||
87 | */ | ||
88 | mfspr r3, SPRN_MMUCFG | ||
89 | rlwinm. r3, r3, 0, MMUCFG_LPIDSIZE | ||
90 | beq 1f | ||
91 | bl __setup_ehv_ivors | ||
92 | b 2f | ||
93 | 1: | ||
94 | lwz r3, CPU_SPEC_FEATURES(r4) | ||
95 | /* We need this check as cpu_setup is also called for | ||
96 | * the secondary cores. So, if we have already cleared | ||
97 | * the feature on the primary core, avoid doing it on the | ||
98 | * secondary core. | ||
99 | */ | ||
100 | andis. r6, r3, CPU_FTR_EMB_HV@h | ||
101 | beq 2f | ||
102 | rlwinm r3, r3, 0, ~CPU_FTR_EMB_HV | ||
103 | stw r3, CPU_SPEC_FEATURES(r4) | ||
104 | 2: | ||
105 | mtlr r5 | ||
82 | blr | 106 | blr |
83 | #endif | 107 | #endif |
84 | /* Right now, restore and setup are the same thing */ | 108 | |
109 | #ifdef CONFIG_PPC_BOOK3E_64 | ||
85 | _GLOBAL(__restore_cpu_e5500) | 110 | _GLOBAL(__restore_cpu_e5500) |
86 | _GLOBAL(__setup_cpu_e5500) | ||
87 | mflr r4 | 111 | mflr r4 |
88 | bl __e500_icache_setup | 112 | bl __e500_icache_setup |
89 | bl __e500_dcache_setup | 113 | bl __e500_dcache_setup |
90 | #ifdef CONFIG_PPC_BOOK3E_64 | ||
91 | bl .__setup_base_ivors | 114 | bl .__setup_base_ivors |
92 | bl .setup_perfmon_ivor | 115 | bl .setup_perfmon_ivor |
93 | bl .setup_doorbell_ivors | 116 | bl .setup_doorbell_ivors |
117 | /* | ||
118 | * We only want to touch IVOR38-41 if we're running on hardware | ||
119 | * that supports category E.HV. The architectural way to determine | ||
120 | * this is MMUCFG[LPIDSIZE]. | ||
121 | */ | ||
122 | mfspr r10,SPRN_MMUCFG | ||
123 | rlwinm. r10,r10,0,MMUCFG_LPIDSIZE | ||
124 | beq 1f | ||
94 | bl .setup_ehv_ivors | 125 | bl .setup_ehv_ivors |
95 | #else | 126 | 1: |
96 | bl __setup_e500mc_ivors | ||
97 | #endif | ||
98 | mtlr r4 | 127 | mtlr r4 |
99 | blr | 128 | blr |
129 | |||
130 | _GLOBAL(__setup_cpu_e5500) | ||
131 | mflr r5 | ||
132 | bl __e500_icache_setup | ||
133 | bl __e500_dcache_setup | ||
134 | bl .__setup_base_ivors | ||
135 | bl .setup_perfmon_ivor | ||
136 | bl .setup_doorbell_ivors | ||
137 | /* | ||
138 | * We only want to touch IVOR38-41 if we're running on hardware | ||
139 | * that supports category E.HV. The architectural way to determine | ||
140 | * this is MMUCFG[LPIDSIZE]. | ||
141 | */ | ||
142 | mfspr r10,SPRN_MMUCFG | ||
143 | rlwinm. r10,r10,0,MMUCFG_LPIDSIZE | ||
144 | beq 1f | ||
145 | bl .setup_ehv_ivors | ||
146 | b 2f | ||
147 | 1: | ||
148 | ld r10,CPU_SPEC_FEATURES(r4) | ||
149 | LOAD_REG_IMMEDIATE(r9,CPU_FTR_EMB_HV) | ||
150 | andc r10,r10,r9 | ||
151 | std r10,CPU_SPEC_FEATURES(r4) | ||
152 | 2: | ||
153 | mtlr r5 | ||
154 | blr | ||
155 | #endif | ||