aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/setup.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-08-10 13:08:10 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-09-01 07:06:23 -0400
commit0ba8b9b273c45dd23f60ff700e265a0069b33758 (patch)
treecb6aef90464889a27215cf9b7204c11b12e7c628 /arch/arm/kernel/setup.c
parentb8e6c91c74e9f0279b7c51048779b3d62da60b88 (diff)
[ARM] cputype: separate definitions, use them
Add asm/cputype.h, moving functions and definitions from asm/system.h there. Convert all users of 'processor_id' to the more efficient read_cpuid_id() function. 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.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 2ca7038b67a7..fb04703f2a8c 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -26,6 +26,7 @@
26#include <linux/fs.h> 26#include <linux/fs.h>
27 27
28#include <asm/cpu.h> 28#include <asm/cpu.h>
29#include <asm/cputype.h>
29#include <asm/elf.h> 30#include <asm/elf.h>
30#include <asm/procinfo.h> 31#include <asm/procinfo.h>
31#include <asm/setup.h> 32#include <asm/setup.h>
@@ -280,9 +281,9 @@ static inline void dump_cache(const char *prefix, int cpu, unsigned int cache)
280 281
281static void __init dump_cpu_info(int cpu) 282static void __init dump_cpu_info(int cpu)
282{ 283{
283 unsigned int info = read_cpuid(CPUID_CACHETYPE); 284 unsigned int info = read_cpuid_cachetype();
284 285
285 if (info != processor_id) { 286 if (info != read_cpuid_id()) {
286 printk("CPU%u: D %s %s cache\n", cpu, cache_is_vivt() ? "VIVT" : "VIPT", 287 printk("CPU%u: D %s %s cache\n", cpu, cache_is_vivt() ? "VIVT" : "VIPT",
287 cache_types[CACHE_TYPE(info)]); 288 cache_types[CACHE_TYPE(info)]);
288 if (CACHE_S(info)) { 289 if (CACHE_S(info)) {
@@ -301,15 +302,15 @@ int cpu_architecture(void)
301{ 302{
302 int cpu_arch; 303 int cpu_arch;
303 304
304 if ((processor_id & 0x0008f000) == 0) { 305 if ((read_cpuid_id() & 0x0008f000) == 0) {
305 cpu_arch = CPU_ARCH_UNKNOWN; 306 cpu_arch = CPU_ARCH_UNKNOWN;
306 } else if ((processor_id & 0x0008f000) == 0x00007000) { 307 } else if ((read_cpuid_id() & 0x0008f000) == 0x00007000) {
307 cpu_arch = (processor_id & (1 << 23)) ? CPU_ARCH_ARMv4T : CPU_ARCH_ARMv3; 308 cpu_arch = (read_cpuid_id() & (1 << 23)) ? CPU_ARCH_ARMv4T : CPU_ARCH_ARMv3;
308 } else if ((processor_id & 0x00080000) == 0x00000000) { 309 } else if ((read_cpuid_id() & 0x00080000) == 0x00000000) {
309 cpu_arch = (processor_id >> 16) & 7; 310 cpu_arch = (read_cpuid_id() >> 16) & 7;
310 if (cpu_arch) 311 if (cpu_arch)
311 cpu_arch += CPU_ARCH_ARMv3; 312 cpu_arch += CPU_ARCH_ARMv3;
312 } else if ((processor_id & 0x000f0000) == 0x000f0000) { 313 } else if ((read_cpuid_id() & 0x000f0000) == 0x000f0000) {
313 unsigned int mmfr0; 314 unsigned int mmfr0;
314 315
315 /* Revised CPUID format. Read the Memory Model Feature 316 /* Revised CPUID format. Read the Memory Model Feature
@@ -346,10 +347,10 @@ static void __init setup_processor(void)
346 * types. The linker builds this table for us from the 347 * types. The linker builds this table for us from the
347 * entries in arch/arm/mm/proc-*.S 348 * entries in arch/arm/mm/proc-*.S
348 */ 349 */
349 list = lookup_processor_type(processor_id); 350 list = lookup_processor_type(read_cpuid_id());
350 if (!list) { 351 if (!list) {
351 printk("CPU configuration botched (ID %08x), unable " 352 printk("CPU configuration botched (ID %08x), unable "
352 "to continue.\n", processor_id); 353 "to continue.\n", read_cpuid_id());
353 while (1); 354 while (1);
354 } 355 }
355 356
@@ -369,7 +370,7 @@ static void __init setup_processor(void)
369#endif 370#endif
370 371
371 printk("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n", 372 printk("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n",
372 cpu_name, processor_id, (int)processor_id & 15, 373 cpu_name, read_cpuid_id(), read_cpuid_id() & 15,
373 proc_arch[cpu_architecture()], cr_alignment); 374 proc_arch[cpu_architecture()], cr_alignment);
374 375
375 sprintf(init_utsname()->machine, "%s%c", list->arch_name, ENDIANNESS); 376 sprintf(init_utsname()->machine, "%s%c", list->arch_name, ENDIANNESS);
@@ -922,7 +923,7 @@ static int c_show(struct seq_file *m, void *v)
922 int i; 923 int i;
923 924
924 seq_printf(m, "Processor\t: %s rev %d (%s)\n", 925 seq_printf(m, "Processor\t: %s rev %d (%s)\n",
925 cpu_name, (int)processor_id & 15, elf_platform); 926 cpu_name, read_cpuid_id() & 15, elf_platform);
926 927
927#if defined(CONFIG_SMP) 928#if defined(CONFIG_SMP)
928 for_each_online_cpu(i) { 929 for_each_online_cpu(i) {
@@ -949,30 +950,30 @@ static int c_show(struct seq_file *m, void *v)
949 if (elf_hwcap & (1 << i)) 950 if (elf_hwcap & (1 << i))
950 seq_printf(m, "%s ", hwcap_str[i]); 951 seq_printf(m, "%s ", hwcap_str[i]);
951 952
952 seq_printf(m, "\nCPU implementer\t: 0x%02x\n", processor_id >> 24); 953 seq_printf(m, "\nCPU implementer\t: 0x%02x\n", read_cpuid_id() >> 24);
953 seq_printf(m, "CPU architecture: %s\n", proc_arch[cpu_architecture()]); 954 seq_printf(m, "CPU architecture: %s\n", proc_arch[cpu_architecture()]);
954 955
955 if ((processor_id & 0x0008f000) == 0x00000000) { 956 if ((read_cpuid_id() & 0x0008f000) == 0x00000000) {
956 /* pre-ARM7 */ 957 /* pre-ARM7 */
957 seq_printf(m, "CPU part\t: %07x\n", processor_id >> 4); 958 seq_printf(m, "CPU part\t: %07x\n", read_cpuid_id() >> 4);
958 } else { 959 } else {
959 if ((processor_id & 0x0008f000) == 0x00007000) { 960 if ((read_cpuid_id() & 0x0008f000) == 0x00007000) {
960 /* ARM7 */ 961 /* ARM7 */
961 seq_printf(m, "CPU variant\t: 0x%02x\n", 962 seq_printf(m, "CPU variant\t: 0x%02x\n",
962 (processor_id >> 16) & 127); 963 (read_cpuid_id() >> 16) & 127);
963 } else { 964 } else {
964 /* post-ARM7 */ 965 /* post-ARM7 */
965 seq_printf(m, "CPU variant\t: 0x%x\n", 966 seq_printf(m, "CPU variant\t: 0x%x\n",
966 (processor_id >> 20) & 15); 967 (read_cpuid_id() >> 20) & 15);
967 } 968 }
968 seq_printf(m, "CPU part\t: 0x%03x\n", 969 seq_printf(m, "CPU part\t: 0x%03x\n",
969 (processor_id >> 4) & 0xfff); 970 (read_cpuid_id() >> 4) & 0xfff);
970 } 971 }
971 seq_printf(m, "CPU revision\t: %d\n", processor_id & 15); 972 seq_printf(m, "CPU revision\t: %d\n", read_cpuid_id() & 15);
972 973
973 { 974 {
974 unsigned int cache_info = read_cpuid(CPUID_CACHETYPE); 975 unsigned int cache_info = read_cpuid_cachetype();
975 if (cache_info != processor_id) { 976 if (cache_info != read_cpuid_id()) {
976 seq_printf(m, "Cache type\t: %s\n" 977 seq_printf(m, "Cache type\t: %s\n"
977 "Cache clean\t: %s\n" 978 "Cache clean\t: %s\n"
978 "Cache lockdown\t: %s\n" 979 "Cache lockdown\t: %s\n"