diff options
Diffstat (limited to 'arch/arm/kernel/head.S')
-rw-r--r-- | arch/arm/kernel/head.S | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 1aca1775b28f..53b6901f70a6 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S | |||
@@ -28,10 +28,9 @@ | |||
28 | #define PROCINFO_INITFUNC 12 | 28 | #define PROCINFO_INITFUNC 12 |
29 | 29 | ||
30 | #define MACHINFO_TYPE 0 | 30 | #define MACHINFO_TYPE 0 |
31 | #define MACHINFO_PHYSRAM 4 | 31 | #define MACHINFO_PHYSIO 4 |
32 | #define MACHINFO_PHYSIO 8 | 32 | #define MACHINFO_PGOFFIO 8 |
33 | #define MACHINFO_PGOFFIO 12 | 33 | #define MACHINFO_NAME 12 |
34 | #define MACHINFO_NAME 16 | ||
35 | 34 | ||
36 | #define KERNEL_RAM_ADDR (PAGE_OFFSET + TEXT_OFFSET) | 35 | #define KERNEL_RAM_ADDR (PAGE_OFFSET + TEXT_OFFSET) |
37 | 36 | ||
@@ -82,6 +81,7 @@ | |||
82 | ENTRY(stext) | 81 | ENTRY(stext) |
83 | msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC @ ensure svc mode | 82 | msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC @ ensure svc mode |
84 | @ and irqs disabled | 83 | @ and irqs disabled |
84 | mrc p15, 0, r9, c0, c0 @ get processor id | ||
85 | bl __lookup_processor_type @ r5=procinfo r9=cpuid | 85 | bl __lookup_processor_type @ r5=procinfo r9=cpuid |
86 | movs r10, r5 @ invalid processor (r5=0)? | 86 | movs r10, r5 @ invalid processor (r5=0)? |
87 | beq __error_p @ yes, error 'p' | 87 | beq __error_p @ yes, error 'p' |
@@ -156,6 +156,7 @@ ENTRY(secondary_startup) | |||
156 | * as it has already been validated by the primary processor. | 156 | * as it has already been validated by the primary processor. |
157 | */ | 157 | */ |
158 | msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC | 158 | msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | MODE_SVC |
159 | mrc p15, 0, r9, c0, c0 @ get processor id | ||
159 | bl __lookup_processor_type | 160 | bl __lookup_processor_type |
160 | movs r10, r5 @ invalid processor? | 161 | movs r10, r5 @ invalid processor? |
161 | moveq r0, #'p' @ yes, error 'p' | 162 | moveq r0, #'p' @ yes, error 'p' |
@@ -450,19 +451,19 @@ __error: | |||
450 | * (and therefore, we are not in the correct address space). We have to | 451 | * (and therefore, we are not in the correct address space). We have to |
451 | * calculate the offset. | 452 | * calculate the offset. |
452 | * | 453 | * |
454 | * r9 = cpuid | ||
453 | * Returns: | 455 | * Returns: |
454 | * r3, r4, r6 corrupted | 456 | * r3, r4, r6 corrupted |
455 | * r5 = proc_info pointer in physical address space | 457 | * r5 = proc_info pointer in physical address space |
456 | * r9 = cpuid | 458 | * r9 = cpuid (preserved) |
457 | */ | 459 | */ |
458 | .type __lookup_processor_type, %function | 460 | .type __lookup_processor_type, %function |
459 | __lookup_processor_type: | 461 | __lookup_processor_type: |
460 | adr r3, 3f | 462 | adr r3, 3f |
461 | ldmda r3, {r5, r6, r9} | 463 | ldmda r3, {r5 - r7} |
462 | sub r3, r3, r9 @ get offset between virt&phys | 464 | sub r3, r3, r7 @ get offset between virt&phys |
463 | add r5, r5, r3 @ convert virt addresses to | 465 | add r5, r5, r3 @ convert virt addresses to |
464 | add r6, r6, r3 @ physical address space | 466 | add r6, r6, r3 @ physical address space |
465 | mrc p15, 0, r9, c0, c0 @ get processor id | ||
466 | 1: ldmia r5, {r3, r4} @ value, mask | 467 | 1: ldmia r5, {r3, r4} @ value, mask |
467 | and r4, r4, r9 @ mask wanted bits | 468 | and r4, r4, r9 @ mask wanted bits |
468 | teq r3, r4 | 469 | teq r3, r4 |
@@ -477,10 +478,11 @@ __lookup_processor_type: | |||
477 | * This provides a C-API version of the above function. | 478 | * This provides a C-API version of the above function. |
478 | */ | 479 | */ |
479 | ENTRY(lookup_processor_type) | 480 | ENTRY(lookup_processor_type) |
480 | stmfd sp!, {r4 - r6, r9, lr} | 481 | stmfd sp!, {r4 - r7, r9, lr} |
482 | mov r9, r0 | ||
481 | bl __lookup_processor_type | 483 | bl __lookup_processor_type |
482 | mov r0, r5 | 484 | mov r0, r5 |
483 | ldmfd sp!, {r4 - r6, r9, pc} | 485 | ldmfd sp!, {r4 - r7, r9, pc} |
484 | 486 | ||
485 | /* | 487 | /* |
486 | * Look in include/asm-arm/procinfo.h and arch/arm/kernel/arch.[ch] for | 488 | * Look in include/asm-arm/procinfo.h and arch/arm/kernel/arch.[ch] for |