]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ARM: 9037/1: uncompress: Add OF_DT_MAGIC macro
authorGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 4 Dec 2020 09:39:10 +0000 (10:39 +0100)
committerRussell King <rmk+kernel@armlinux.org.uk>
Mon, 21 Dec 2020 11:19:21 +0000 (11:19 +0000)
The DTB magic marker is stored as a 32-bit big-endian value, and thus
depends on the CPU's endianness.  Add a macro to define this value in
native endianness, to reduce #ifdef clutter and (future) duplication.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
arch/arm/boot/compressed/head.S

index 4fb699769e6a6a5b88544b8b82f57d0e2392d5d4..8d546cb1092133de629966a75bd827088d4c1e5a 100644 (file)
 
 #include "efi-header.S"
 
+#ifdef __ARMEB__
+#define OF_DT_MAGIC 0xd00dfeed
+#else
+#define OF_DT_MAGIC 0xedfe0dd0
+#endif
+
  AR_CLASS(     .arch   armv7-a )
  M_CLASS(      .arch   armv7-m )
 
@@ -335,11 +341,7 @@ restart:   adr     r0, LC1
  */
 
                ldr     lr, [r6, #0]
-#ifndef __ARMEB__
-               ldr     r1, =0xedfe0dd0         @ sig is 0xd00dfeed big endian
-#else
-               ldr     r1, =0xd00dfeed
-#endif
+               ldr     r1, =OF_DT_MAGIC
                cmp     lr, r1
                bne     dtb_check_done          @ not found