ARM: uniphier: refactor Support Card init code
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Sun, 15 Jan 2017 05:59:06 +0000 (14:59 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Tue, 17 Jan 2017 00:00:40 +0000 (09:00 +0900)
Splitting reset assertion (support_card_reset) and deassertion
(support_card_init) is not adding much value any more.  Handle
all the initialization of Support Card in support_card_init(),
then remove support_card_reset().

Also, detect_num_flash_banks() can have a static qualifier.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
arch/arm/mach-uniphier/init/init-ld11.c
arch/arm/mach-uniphier/init/init-ld20.c
arch/arm/mach-uniphier/init/init-ld4.c
arch/arm/mach-uniphier/init/init-pro4.c
arch/arm/mach-uniphier/init/init-pro5.c
arch/arm/mach-uniphier/init/init-pxs2.c
arch/arm/mach-uniphier/init/init-sld3.c
arch/arm/mach-uniphier/init/init-sld8.c
arch/arm/mach-uniphier/micro-support-card.c
arch/arm/mach-uniphier/micro-support-card.h

index 64fe000eba08e62876694ebe03c0dafcb9b19359..e19dc5b1a7060f977499e2335b70ef85c8eed095 100644 (file)
@@ -15,8 +15,6 @@ int uniphier_ld11_init(const struct uniphier_board_data *bd)
 {
        uniphier_ld11_sbc_init();
 
-       support_card_reset();
-
        support_card_init();
 
        led_puts("L0");
index ec4563b3a1864614c9eb5b9f800a8e39362f7a31..e056d5d0b9d4f252c8b60bb52d10a08685480c17 100644 (file)
@@ -15,8 +15,6 @@ int uniphier_ld20_init(const struct uniphier_board_data *bd)
 {
        uniphier_ld11_sbc_init();
 
-       support_card_reset();
-
        support_card_init();
 
        led_puts("L0");
index a56fb7fc192328c1ecbadb445421f8a30783d4b9..a5b9493546bccc833b304c8e254d24fdb5aedf21 100644 (file)
@@ -18,12 +18,10 @@ int uniphier_ld4_init(const struct uniphier_board_data *bd)
 
        uniphier_ld4_sbc_init();
 
-       support_card_reset();
+       support_card_init();
 
        uniphier_ld4_dpll_init(bd);
 
-       support_card_init();
-
        led_puts("L0");
 
        uniphier_memconf_2ch_init(bd);
index 8e2ebc73861f3164a73925023ee059eef51aa45c..c277071450e594b8adb71a5d6d169ac2c04d60ee 100644 (file)
@@ -16,12 +16,10 @@ int uniphier_pro4_init(const struct uniphier_board_data *bd)
 {
        uniphier_sbc_init_savepin();
 
-       support_card_reset();
+       support_card_init();
 
        uniphier_pro4_dpll_init(bd);
 
-       support_card_init();
-
        led_puts("L0");
 
        uniphier_memconf_2ch_init(bd);
index 37c62ef1b326c67a6d1aa1b20c047461d306e515..4e7041b19bdd1b5a196b274fb27f218d3845ec8d 100644 (file)
@@ -14,8 +14,6 @@ int uniphier_pro5_init(const struct uniphier_board_data *bd)
 {
        uniphier_sbc_init_savepin();
 
-       support_card_reset();
-
        support_card_init();
 
        led_puts("L0");
index d080b9bfbb13d4112e4c50d6106968cc18f8aa19..f7d5b4870c428ac6fd044c761aea0383343a1708 100644 (file)
@@ -16,8 +16,6 @@ int uniphier_pxs2_init(const struct uniphier_board_data *bd)
 
        uniphier_pxs2_sbc_init();
 
-       support_card_reset();
-
        support_card_init();
 
        led_puts("L0");
index 0b8d6c510ab3f6295509e2e79994b527d825641c..50d9eafd1137acdac89d418edc7b5f10e2592768 100644 (file)
@@ -18,12 +18,10 @@ int uniphier_sld3_init(const struct uniphier_board_data *bd)
 
        uniphier_sbc_init_admulti();
 
-       support_card_reset();
+       support_card_init();
 
        uniphier_sld3_dpll_init(bd);
 
-       support_card_init();
-
        led_puts("L0");
 
        uniphier_memconf_3ch_no_disbit_init(bd);
index 075ac2739f2f2b1e07329e4044f385d0cdd01475..8da28435788f1e4a764dc181d6689dab9a6216f9 100644 (file)
@@ -18,12 +18,10 @@ int uniphier_sld8_init(const struct uniphier_board_data *bd)
 
        uniphier_ld4_sbc_init();
 
-       support_card_reset();
+       support_card_init();
 
        uniphier_sld8_dpll_init(bd);
 
-       support_card_init();
-
        led_puts("L0");
 
        uniphier_memconf_2ch_init(bd);
index e53bcdf8e3c2024515dafd27f8a577cebbf4a8c8..80c5d9708240e8546458dfefe0c44a8204b41c3b 100644 (file)
  * bit[0]: LAN, I2C, LED
  * bit[1]: UART
  */
-void support_card_reset_deassert(void)
+static void support_card_reset_deassert(void)
 {
        writel(0x00010000, MICRO_SUPPORT_CARD_RESET);
 }
 
-void support_card_reset(void)
+static void support_card_reset(void)
 {
        writel(0x00020003, MICRO_SUPPORT_CARD_RESET);
 }
@@ -57,6 +57,7 @@ int checkboard(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)
@@ -157,7 +158,7 @@ static void detect_num_flash_banks(void)
        debug("number of flash banks: %d\n", cfi_flash_num_flash_banks);
 }
 #else /* CONFIG_SYS_NO_FLASH */
-void detect_num_flash_banks(void)
+static void detect_num_flash_banks(void)
 {
 };
 #endif /* CONFIG_SYS_NO_FLASH */
index 4dae60312f52730fde0a862fef948257e695079d..90990ba4044e1cdd6c137e41ab7310b20bcb3973 100644 (file)
 #define MICRO_SUPPORT_CARD_H
 
 #if defined(CONFIG_MICRO_SUPPORT_CARD)
-void support_card_reset(void);
 void support_card_init(void);
 void support_card_late_init(void);
 void led_puts(const char *s);
 #else
-static inline void support_card_reset(void)
-{
-}
-
 static inline void support_card_init(void)
 {
 }