]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
ARM: UniPhier: use boot_is_swapped() macro for readability
authorMasahiro Yamada <yamada.m@jp.panasonic.com>
Fri, 5 Dec 2014 15:03:19 +0000 (00:03 +0900)
committerMasahiro Yamada <yamada.m@jp.panasonic.com>
Sun, 7 Dec 2014 16:25:44 +0000 (01:25 +0900)
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
arch/arm/cpu/armv7/uniphier/ph1-pro4/sbc_init.c

index f113db54d1eaacd1f810feb76ca2152bb3ef5deb..3c82a1aca4c85369eb1f7712ca6b65337ecd82e0 100644 (file)
@@ -22,16 +22,7 @@ void sbc_init(void)
        writel(SBCTRL2_SAVEPIN_PERI_VALUE, SBCTRL12);
        writel(SBCTRL4_SAVEPIN_PERI_VALUE, SBCTRL14);
 
-       if (readl(SBBASE0) & 0x1) {
-               /*
-                * Boot Swap Off: boot from mask ROM
-                * 0x00000000-0x01ffffff: mask ROM
-                * 0x02000000-0x3effffff: memory bank (31MB)
-                * 0x03f00000-0x3fffffff: peripherals (1MB)
-                */
-               writel(0x0000be01, SBBASE0); /* dummy */
-               writel(0x0200be01, SBBASE1);
-       } else {
+       if (boot_is_swapped()) {
                /*
                 * Boot Swap On: boot from external NOR/SRAM
                 * 0x02000000-0x03ffffff is a mirror of 0x00000000-0x01ffffff.
@@ -40,6 +31,15 @@ void sbc_init(void)
                 * 0x01f00000-0x01ffffff, 0x03f00000-0x03ffffff: peripherals
                 */
                writel(0x0000bc01, SBBASE0);
+       } else {
+               /*
+                * Boot Swap Off: boot from mask ROM
+                * 0x00000000-0x01ffffff: mask ROM
+                * 0x02000000-0x3effffff: memory bank (31MB)
+                * 0x03f00000-0x3fffffff: peripherals (1MB)
+                */
+               writel(0x0000be01, SBBASE0); /* dummy */
+               writel(0x0200be01, SBBASE1);
        }
 #elif defined(CONFIG_DCC_MICRO_SUPPORT_CARD)
 #if !defined(CONFIG_SPL_BUILD)