Merge branch 'master' of git://www.denx.de/git/u-boot-imx
[oweals/u-boot.git] / arch / arm / mach-uniphier / micro-support-card.c
index 4c34748c25cb89b970b7e49b8433e7bcec5ab707..e53bcdf8e3c2024515dafd27f8a577cebbf4a8c8 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+
  */
@@ -7,7 +9,8 @@
 #include <common.h>
 #include <linux/ctype.h>
 #include <linux/io.h>
-#include <mach/micro-support-card.h>
+
+#include "micro-support-card.h"
 
 #define MICRO_SUPPORT_CARD_BASE                0x43f00000
 #define SMC911X_BASE                   ((MICRO_SUPPORT_CARD_BASE) + 0x00000)
  */
 void support_card_reset_deassert(void)
 {
-       writel(0, MICRO_SUPPORT_CARD_RESET);
+       writel(0x00010000, MICRO_SUPPORT_CARD_RESET);
 }
 
 void support_card_reset(void)
 {
-       writel(3, MICRO_SUPPORT_CARD_RESET);
+       writel(0x00020003, MICRO_SUPPORT_CARD_RESET);
 }
 
 static int support_card_show_revision(void)
@@ -37,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();
@@ -52,9 +60,8 @@ void support_card_init(void)
        /*
         * 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();
 }
 
@@ -70,7 +77,6 @@ int board_eth_init(bd_t *bis)
 #if !defined(CONFIG_SYS_NO_FLASH)
 
 #include <mtd/cfi_flash.h>
-#include <mach/sbc-regs.h>
 
 struct memory_bank {
        phys_addr_t base;
@@ -142,7 +148,8 @@ 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++;
                }
        }