]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - arch/arm/mach-uniphier/micro-support-card.c
flash: complete CONFIG_SYS_NO_FLASH move with renaming
[people/ms/u-boot.git] / arch / arm / mach-uniphier / micro-support-card.c
index f777ac1ffe41fa4e2e74b42c44b708d6f99f36e8..2b231ac1870368f171bff81f6e5121a4123a63e2 100644 (file)
@@ -1,5 +1,7 @@
 /*
- * Copyright (C) 2012-2015 Masahiro Yamada <yamada.masahiro@socionext.com>
+ * Copyright (C) 2012-2015 Panasonic Corporation
+ * Copyright (C) 2015-2016 Socionext Inc.
+ *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  *
  * SPDX-License-Identifier:    GPL-2.0+
  */
  * bit[0]: LAN, I2C, LED
  * bit[1]: UART
  */
-void support_card_reset_deassert(void)
+static void support_card_reset_deassert(void)
 {
-       writel(0, MICRO_SUPPORT_CARD_RESET);
+       writel(0x00010000, MICRO_SUPPORT_CARD_RESET);
 }
 
-void support_card_reset(void)
+static void support_card_reset(void)
 {
-       writel(3, MICRO_SUPPORT_CARD_RESET);
+       writel(0x00020003, MICRO_SUPPORT_CARD_RESET);
 }
 
 static int support_card_show_revision(void)
@@ -38,11 +40,16 @@ static int support_card_show_revision(void)
        u32 revision;
 
        revision = readl(MICRO_SUPPORT_CARD_REVISION);
-       printf("(CPLD version %d.%d)\n", revision >> 4, revision & 0xf);
+       revision &= 0xff;
+
+       /* revision 3.6.x card changed the revision format */
+       printf("(CPLD version %s%d.%d)\n", revision >> 4 == 6 ? "3." : "",
+              revision >> 4, revision & 0xf);
+
        return 0;
 }
 
-int check_support_card(void)
+int checkboard(void)
 {
        printf("SC:    Micro Support Card ");
        return support_card_show_revision();
@@ -50,12 +57,12 @@ int check_support_card(void)
 
 void support_card_init(void)
 {
+       support_card_reset();
        /*
         * After power on, we need to keep the LAN controller in reset state
         * for a while. (200 usec)
-        * Fortunately, enough wait time is already inserted in pll_init()
-        * function. So we do not have to wait here.
         */
+       udelay(200);
        support_card_reset_deassert();
 }
 
@@ -68,7 +75,7 @@ int board_eth_init(bd_t *bis)
 }
 #endif
 
-#if !defined(CONFIG_SYS_NO_FLASH)
+#if defined(CONFIG_MTD_NOR_FLASH)
 
 #include <mtd/cfi_flash.h>
 
@@ -142,18 +149,19 @@ static void detect_num_flash_banks(void)
                                                                memory_bank;
 
                        debug("flash bank found: base = 0x%lx, size = 0x%lx\n",
-                             memory_bank->base, memory_bank->size);
+                             (unsigned long)memory_bank->base,
+                             (unsigned long)memory_bank->size);
                        cfi_flash_num_flash_banks++;
                }
        }
 
        debug("number of flash banks: %d\n", cfi_flash_num_flash_banks);
 }
-#else /* CONFIG_SYS_NO_FLASH */
-void detect_num_flash_banks(void)
+#else /* CONFIG_MTD_NOR_FLASH */
+static void detect_num_flash_banks(void)
 {
 };
-#endif /* CONFIG_SYS_NO_FLASH */
+#endif /* CONFIG_MTD_NOR_FLASH */
 
 void support_card_late_init(void)
 {