aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2006-02-24 16:04:56 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-03-21 17:03:22 -0500
commit0f44ba1d1e67201c0c58af26eb441fa7014c89ec (patch)
treea6162e21b5ec6d96240b16e18d0e5f89c756c9a1 /arch/arm/kernel
parentfb1c7762b9b1f3c53daf0e700e977d77a29bcf04 (diff)
[ARM] Move read of processor ID out of lookup_processor_type()
Read the processor ID at boot, and save it in "processor_id" as we did before. Later, when we re-parse the CPU type in the setup.c code, re-use the value stored in "processor_id". This allows a cleaner work-around for noMMU devices without CP#15. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/head.S15
-rw-r--r--arch/arm/kernel/setup.c4
2 files changed, 11 insertions, 8 deletions
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 1aca1775b28f..571d6d584919 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -82,6 +82,7 @@
82ENTRY(stext) 82ENTRY(stext)
83 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC @ ensure svc mode 83 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC @ ensure svc mode
84 @ and irqs disabled 84 @ and irqs disabled
85 mrc p15, 0, r9, c0, c0 @ get processor id
85 bl __lookup_processor_type @ r5=procinfo r9=cpuid 86 bl __lookup_processor_type @ r5=procinfo r9=cpuid
86 movs r10, r5 @ invalid processor (r5=0)? 87 movs r10, r5 @ invalid processor (r5=0)?
87 beq __error_p @ yes, error 'p' 88 beq __error_p @ yes, error 'p'
@@ -156,6 +157,7 @@ ENTRY(secondary_startup)
156 * as it has already been validated by the primary processor. 157 * as it has already been validated by the primary processor.
157 */ 158 */
158 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC 159 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC
160 mrc p15, 0, r9, c0, c0 @ get processor id
159 bl __lookup_processor_type 161 bl __lookup_processor_type
160 movs r10, r5 @ invalid processor? 162 movs r10, r5 @ invalid processor?
161 moveq r0, #'p' @ yes, error 'p' 163 moveq r0, #'p' @ yes, error 'p'
@@ -450,19 +452,19 @@ __error:
450 * (and therefore, we are not in the correct address space). We have to 452 * (and therefore, we are not in the correct address space). We have to
451 * calculate the offset. 453 * calculate the offset.
452 * 454 *
455 * r9 = cpuid
453 * Returns: 456 * Returns:
454 * r3, r4, r6 corrupted 457 * r3, r4, r6 corrupted
455 * r5 = proc_info pointer in physical address space 458 * r5 = proc_info pointer in physical address space
456 * r9 = cpuid 459 * r9 = cpuid (preserved)
457 */ 460 */
458 .type __lookup_processor_type, %function 461 .type __lookup_processor_type, %function
459__lookup_processor_type: 462__lookup_processor_type:
460 adr r3, 3f 463 adr r3, 3f
461 ldmda r3, {r5, r6, r9} 464 ldmda r3, {r5 - r7}
462 sub r3, r3, r9 @ get offset between virt&phys 465 sub r3, r3, r7 @ get offset between virt&phys
463 add r5, r5, r3 @ convert virt addresses to 466 add r5, r5, r3 @ convert virt addresses to
464 add r6, r6, r3 @ physical address space 467 add r6, r6, r3 @ physical address space
465 mrc p15, 0, r9, c0, c0 @ get processor id
4661: ldmia r5, {r3, r4} @ value, mask 4681: ldmia r5, {r3, r4} @ value, mask
467 and r4, r4, r9 @ mask wanted bits 469 and r4, r4, r9 @ mask wanted bits
468 teq r3, r4 470 teq r3, r4
@@ -477,10 +479,11 @@ __lookup_processor_type:
477 * This provides a C-API version of the above function. 479 * This provides a C-API version of the above function.
478 */ 480 */
479ENTRY(lookup_processor_type) 481ENTRY(lookup_processor_type)
480 stmfd sp!, {r4 - r6, r9, lr} 482 stmfd sp!, {r4 - r7, r9, lr}
483 mov r9, r0
481 bl __lookup_processor_type 484 bl __lookup_processor_type
482 mov r0, r5 485 mov r0, r5
483 ldmfd sp!, {r4 - r6, r9, pc} 486 ldmfd sp!, {r4 - r7, r9, pc}
484 487
485/* 488/*
486 * Look in include/asm-arm/procinfo.h and arch/arm/kernel/arch.[ch] for 489 * Look in include/asm-arm/procinfo.h and arch/arm/kernel/arch.[ch] for
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 08974cbe9824..b7cd280bfd63 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -278,7 +278,7 @@ int cpu_architecture(void)
278 * These functions re-use the assembly code in head.S, which 278 * These functions re-use the assembly code in head.S, which
279 * already provide the required functionality. 279 * already provide the required functionality.
280 */ 280 */
281extern struct proc_info_list *lookup_processor_type(void); 281extern struct proc_info_list *lookup_processor_type(unsigned int);
282extern struct machine_desc *lookup_machine_type(unsigned int); 282extern struct machine_desc *lookup_machine_type(unsigned int);
283 283
284static void __init setup_processor(void) 284static void __init setup_processor(void)
@@ -290,7 +290,7 @@ static void __init setup_processor(void)
290 * types. The linker builds this table for us from the 290 * types. The linker builds this table for us from the
291 * entries in arch/arm/mm/proc-*.S 291 * entries in arch/arm/mm/proc-*.S
292 */ 292 */
293 list = lookup_processor_type(); 293 list = lookup_processor_type(processor_id);
294 if (!list) { 294 if (!list) {
295 printk("CPU configuration botched (ID %08x), unable " 295 printk("CPU configuration botched (ID %08x), unable "
296 "to continue.\n", processor_id); 296 "to continue.\n", processor_id);