summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Dooks <ben.dooks@codethink.co.uk>2013-02-01 09:58:18 +0000
committerBen Dooks <ben.dooks@codethink.co.uk>2013-07-01 11:42:08 +0100
commit271d818cf8ebdf3677d8bc32a0baee557c973d2c (patch)
treecc59aeb5b5bf7152048d3647e59a230165caee73
parentadc9aa061a5197781675af05a90344b268f8e4cd (diff)
downloadlinux-271d818cf8ebdf3677d8bc32a0baee557c973d2c.tar.gz
ARM: fixup head for atag verification
If we booted LE but running BE8, ensure we read ATAGs data from head code in the correct mode. Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
-rw-r--r--arch/arm/kernel/head-common.S8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/kernel/head-common.S b/arch/arm/kernel/head-common.S
index 5b391a689b47..ae73ffed0af0 100644
--- a/arch/arm/kernel/head-common.S
+++ b/arch/arm/kernel/head-common.S
@@ -21,6 +21,12 @@
#define OF_DT_MAGIC 0xedfe0dd0 /* 0xd00dfeed in big-endian */
#endif
+#ifdef CONFIG_CPU_BE8_BOOT_LE
+#define BE8_LE(x...) x
+#else
+#define BE8_LE(x...)
+#endif
+
/*
* Exception handling. Something went wrong and we can't proceed. We
* ought to tell the user, but since we don't have any guarantee that
@@ -53,10 +59,12 @@ __vet_atags:
cmp r5, r6
beq 2f
#endif
+BE8_LE( rev r5, r5 )
cmp r5, #ATAG_CORE_SIZE @ is first tag ATAG_CORE?
cmpne r5, #ATAG_CORE_SIZE_EMPTY
bne 1f
ldr r5, [r2, #4]
+BE8_LE( rev r5, r5 )
ldr r6, =ATAG_CORE
cmp r5, r6
bne 1f