aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/setup.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2010-07-05 09:53:10 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-07-09 09:41:35 -0400
commitf159f4ed55bb0fa5470800641e03a13a7e0eae6e (patch)
treec2ed54b103c2a1c58fa4b50740fec462ccfeec74 /arch/arm/kernel/setup.c
parentc1b2d9704c77ddaec46d5d681e1360ac40268743 (diff)
ARM: 6207/1: Replace CONFIG_HAS_TLS_REG with HWCAP_TLS and check for it on V6
The TLS register is only available on ARM1136 r1p0 and later. Set HWCAP_TLS flags if hardware TLS is available and test for it if CONFIG_CPU_32v6K is not set for V6. Note that we set the TLS instruction in __kuser_get_tls dynamically as suggested by Jamie Lokier <jamie@shareable.org>. Also the __switch_to code is optimized out in most cases as suggested by Nicolas Pitre <nico@fluxnic.net>. Reviewed-by: Nicolas Pitre <nicolas.pitre@linaro.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/setup.c')
-rw-r--r--arch/arm/kernel/setup.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 7ae65dc594a4..648c3c1e16c4 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -269,6 +269,21 @@ static void __init cacheid_init(void)
269extern struct proc_info_list *lookup_processor_type(unsigned int); 269extern struct proc_info_list *lookup_processor_type(unsigned int);
270extern struct machine_desc *lookup_machine_type(unsigned int); 270extern struct machine_desc *lookup_machine_type(unsigned int);
271 271
272static void __init feat_v6_fixup(void)
273{
274 int id = read_cpuid_id();
275
276 if ((id & 0xff0f0000) != 0x41070000)
277 return;
278
279 /*
280 * HWCAP_TLS is available only on 1136 r1p0 and later,
281 * see also kuser_get_tls_init.
282 */
283 if ((((id >> 4) & 0xfff) == 0xb36) && (((id >> 20) & 3) == 0))
284 elf_hwcap &= ~HWCAP_TLS;
285}
286
272static void __init setup_processor(void) 287static void __init setup_processor(void)
273{ 288{
274 struct proc_info_list *list; 289 struct proc_info_list *list;
@@ -311,6 +326,8 @@ static void __init setup_processor(void)
311 elf_hwcap &= ~HWCAP_THUMB; 326 elf_hwcap &= ~HWCAP_THUMB;
312#endif 327#endif
313 328
329 feat_v6_fixup();
330
314 cacheid_init(); 331 cacheid_init();
315 cpu_proc_init(); 332 cpu_proc_init();
316} 333}