diff options
Diffstat (limited to 'arch/powerpc/lib/feature-fixups.c')
-rw-r--r-- | arch/powerpc/lib/feature-fixups.c | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/arch/powerpc/lib/feature-fixups.c b/arch/powerpc/lib/feature-fixups.c index 7ce3870d7ddd..defb2998b818 100644 --- a/arch/powerpc/lib/feature-fixups.c +++ b/arch/powerpc/lib/feature-fixups.c | |||
@@ -20,7 +20,8 @@ | |||
20 | #include <asm/code-patching.h> | 20 | #include <asm/code-patching.h> |
21 | #include <asm/page.h> | 21 | #include <asm/page.h> |
22 | #include <asm/sections.h> | 22 | #include <asm/sections.h> |
23 | 23 | #include <asm/setup.h> | |
24 | #include <asm/firmware.h> | ||
24 | 25 | ||
25 | struct fixup_entry { | 26 | struct fixup_entry { |
26 | unsigned long mask; | 27 | unsigned long mask; |
@@ -130,7 +131,7 @@ void do_lwsync_fixups(unsigned long value, void *fixup_start, void *fixup_end) | |||
130 | } | 131 | } |
131 | } | 132 | } |
132 | 133 | ||
133 | void do_final_fixups(void) | 134 | static void do_final_fixups(void) |
134 | { | 135 | { |
135 | #if defined(CONFIG_PPC64) && defined(CONFIG_RELOCATABLE) | 136 | #if defined(CONFIG_PPC64) && defined(CONFIG_RELOCATABLE) |
136 | int *src, *dest; | 137 | int *src, *dest; |
@@ -151,6 +152,33 @@ void do_final_fixups(void) | |||
151 | #endif | 152 | #endif |
152 | } | 153 | } |
153 | 154 | ||
155 | void apply_feature_fixups(void) | ||
156 | { | ||
157 | struct cpu_spec *spec = *PTRRELOC(&cur_cpu_spec); | ||
158 | |||
159 | /* | ||
160 | * Apply the CPU-specific and firmware specific fixups to kernel text | ||
161 | * (nop out sections not relevant to this CPU or this firmware). | ||
162 | */ | ||
163 | do_feature_fixups(spec->cpu_features, | ||
164 | PTRRELOC(&__start___ftr_fixup), | ||
165 | PTRRELOC(&__stop___ftr_fixup)); | ||
166 | |||
167 | do_feature_fixups(spec->mmu_features, | ||
168 | PTRRELOC(&__start___mmu_ftr_fixup), | ||
169 | PTRRELOC(&__stop___mmu_ftr_fixup)); | ||
170 | |||
171 | do_lwsync_fixups(spec->cpu_features, | ||
172 | PTRRELOC(&__start___lwsync_fixup), | ||
173 | PTRRELOC(&__stop___lwsync_fixup)); | ||
174 | |||
175 | #ifdef CONFIG_PPC64 | ||
176 | do_feature_fixups(powerpc_firmware_features, | ||
177 | &__start___fw_ftr_fixup, &__stop___fw_ftr_fixup); | ||
178 | #endif | ||
179 | do_final_fixups(); | ||
180 | } | ||
181 | |||
154 | #ifdef CONFIG_FTR_FIXUP_SELFTEST | 182 | #ifdef CONFIG_FTR_FIXUP_SELFTEST |
155 | 183 | ||
156 | #define check(x) \ | 184 | #define check(x) \ |