aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/head-common.S
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-05-24 19:08:17 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-05-24 19:08:17 -0400
commit03eb14199e8a2ff2bc170b283305990151b0d619 (patch)
treec16c123a850e8033b2daa71ad9ae241906542dd8 /arch/arm/kernel/head-common.S
parentd762f4383100c2a87b1a3f2d678cd3b5425655b4 (diff)
parentede338f4ce2fb5ee99d18751df32fbd3b10df268 (diff)
Merge branch 'devicetree/arm-next' of git://git.secretlab.ca/git/linux-2.6 into devel-stable
Diffstat (limited to 'arch/arm/kernel/head-common.S')
-rw-r--r--arch/arm/kernel/head-common.S24
1 files changed, 18 insertions, 6 deletions
diff --git a/arch/arm/kernel/head-common.S b/arch/arm/kernel/head-common.S
index c84b57d27d07..854bd22380d3 100644
--- a/arch/arm/kernel/head-common.S
+++ b/arch/arm/kernel/head-common.S
@@ -15,6 +15,12 @@
15#define ATAG_CORE_SIZE ((2*4 + 3*4) >> 2) 15#define ATAG_CORE_SIZE ((2*4 + 3*4) >> 2)
16#define ATAG_CORE_SIZE_EMPTY ((2*4) >> 2) 16#define ATAG_CORE_SIZE_EMPTY ((2*4) >> 2)
17 17
18#ifdef CONFIG_CPU_BIG_ENDIAN
19#define OF_DT_MAGIC 0xd00dfeed
20#else
21#define OF_DT_MAGIC 0xedfe0dd0 /* 0xd00dfeed in big-endian */
22#endif
23
18/* 24/*
19 * Exception handling. Something went wrong and we can't proceed. We 25 * Exception handling. Something went wrong and we can't proceed. We
20 * ought to tell the user, but since we don't have any guarantee that 26 * ought to tell the user, but since we don't have any guarantee that
@@ -28,20 +34,26 @@
28 34
29/* Determine validity of the r2 atags pointer. The heuristic requires 35/* Determine validity of the r2 atags pointer. The heuristic requires
30 * that the pointer be aligned, in the first 16k of physical RAM and 36 * that the pointer be aligned, in the first 16k of physical RAM and
31 * that the ATAG_CORE marker is first and present. Future revisions 37 * that the ATAG_CORE marker is first and present. If CONFIG_OF_FLATTREE
38 * is selected, then it will also accept a dtb pointer. Future revisions
32 * of this function may be more lenient with the physical address and 39 * of this function may be more lenient with the physical address and
33 * may also be able to move the ATAGS block if necessary. 40 * may also be able to move the ATAGS block if necessary.
34 * 41 *
35 * Returns: 42 * Returns:
36 * r2 either valid atags pointer, or zero 43 * r2 either valid atags pointer, valid dtb pointer, or zero
37 * r5, r6 corrupted 44 * r5, r6 corrupted
38 */ 45 */
39__vet_atags: 46__vet_atags:
40 tst r2, #0x3 @ aligned? 47 tst r2, #0x3 @ aligned?
41 bne 1f 48 bne 1f
42 49
43 ldr r5, [r2, #0] @ is first tag ATAG_CORE? 50 ldr r5, [r2, #0]
44 cmp r5, #ATAG_CORE_SIZE 51#ifdef CONFIG_OF_FLATTREE
52 ldr r6, =OF_DT_MAGIC @ is it a DTB?
53 cmp r5, r6
54 beq 2f
55#endif
56 cmp r5, #ATAG_CORE_SIZE @ is first tag ATAG_CORE?
45 cmpne r5, #ATAG_CORE_SIZE_EMPTY 57 cmpne r5, #ATAG_CORE_SIZE_EMPTY
46 bne 1f 58 bne 1f
47 ldr r5, [r2, #4] 59 ldr r5, [r2, #4]
@@ -49,7 +61,7 @@ __vet_atags:
49 cmp r5, r6 61 cmp r5, r6
50 bne 1f 62 bne 1f
51 63
52 mov pc, lr @ atag pointer is ok 642: mov pc, lr @ atag/dtb pointer is ok
53 65
541: mov r2, #0 661: mov r2, #0
55 mov pc, lr 67 mov pc, lr
@@ -61,7 +73,7 @@ ENDPROC(__vet_atags)
61 * 73 *
62 * r0 = cp#15 control register 74 * r0 = cp#15 control register
63 * r1 = machine ID 75 * r1 = machine ID
64 * r2 = atags pointer 76 * r2 = atags/dtb pointer
65 * r9 = processor ID 77 * r9 = processor ID
66 */ 78 */
67 __INIT 79 __INIT