From patchwork Sun Jan 15 05:59:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 91514 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp888476qgi; Sat, 14 Jan 2017 21:59:50 -0800 (PST) X-Received: by 10.28.168.73 with SMTP id r70mr7394563wme.57.1484459990374; Sat, 14 Jan 2017 21:59:50 -0800 (PST) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id a19si12600738wra.291.2017.01.14.21.59.49; Sat, 14 Jan 2017 21:59:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) client-ip=85.214.87.163; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 85.214.87.163 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E0349A75D7; Sun, 15 Jan 2017 06:59:47 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3oiDe_0e2lJr; Sun, 15 Jan 2017 06:59:47 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 61707A75CC; Sun, 15 Jan 2017 06:59:47 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F1B6CB3864 for ; Sun, 15 Jan 2017 06:59:39 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iUAfAjEKy9lC for ; Sun, 15 Jan 2017 06:59:39 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from conuserg-10.nifty.com (conuserg-10.nifty.com [210.131.2.77]) by theia.denx.de (Postfix) with ESMTPS id 34009A75E6 for ; Sun, 15 Jan 2017 06:59:36 +0100 (CET) Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-10.nifty.com with ESMTP id v0F5xD3j016694; Sun, 15 Jan 2017 14:59:19 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v0F5xD3j016694 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1484459960; bh=nZDp9X2O0iIi37TVkYgPFN8YhOoh/8vkQQVfh0j1jVg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XBBP027FLaiV5A0/UWHZjDMuAvd43VEjRXmoDnzmvhzPpJCMtrvosVF1xhL+u+fV8 iYPF5urMK9Gdv7qt1r2srd26kD5qCWEeCP4BbCCFRqJ2M+6wLYzz/6TvuR2JuLqwF+ KXwXDl58OGIJ8/l005pF64sctrcuVKh5JqAeld8gCFDvWxMVribk76Ij1zdHZuA64j fETSHJQSbUjrKI4OL+579A0chhqnU9M3B0ywmEAX6v2SMiF9IeW0In5eG7663QcKIx D0UoD1JjC5kaAiopPeAhSbGAL7qZQgSE4/9KuO924oqRJLEOZ2MlydG/IJBD+kOXta 5xh+TindwO18Q== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sun, 15 Jan 2017 14:59:06 +0900 Message-Id: <1484459950-8644-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484459950-8644-1-git-send-email-yamada.masahiro@socionext.com> References: <1484459950-8644-1-git-send-email-yamada.masahiro@socionext.com> Cc: Albert Aribaud Subject: [U-Boot] [PATCH 5/9] ARM: uniphier: refactor Support Card init code X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 --- arch/arm/mach-uniphier/init/init-ld11.c | 2 -- arch/arm/mach-uniphier/init/init-ld20.c | 2 -- arch/arm/mach-uniphier/init/init-ld4.c | 4 +--- arch/arm/mach-uniphier/init/init-pro4.c | 4 +--- arch/arm/mach-uniphier/init/init-pro5.c | 2 -- arch/arm/mach-uniphier/init/init-pxs2.c | 2 -- arch/arm/mach-uniphier/init/init-sld3.c | 4 +--- arch/arm/mach-uniphier/init/init-sld8.c | 4 +--- arch/arm/mach-uniphier/micro-support-card.c | 7 ++++--- arch/arm/mach-uniphier/micro-support-card.h | 5 ----- 10 files changed, 8 insertions(+), 28 deletions(-) -- 2.7.4 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/arch/arm/mach-uniphier/init/init-ld11.c b/arch/arm/mach-uniphier/init/init-ld11.c index 64fe000..e19dc5b 100644 --- a/arch/arm/mach-uniphier/init/init-ld11.c +++ b/arch/arm/mach-uniphier/init/init-ld11.c @@ -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"); diff --git a/arch/arm/mach-uniphier/init/init-ld20.c b/arch/arm/mach-uniphier/init/init-ld20.c index ec4563b..e056d5d 100644 --- a/arch/arm/mach-uniphier/init/init-ld20.c +++ b/arch/arm/mach-uniphier/init/init-ld20.c @@ -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"); diff --git a/arch/arm/mach-uniphier/init/init-ld4.c b/arch/arm/mach-uniphier/init/init-ld4.c index a56fb7f..a5b9493 100644 --- a/arch/arm/mach-uniphier/init/init-ld4.c +++ b/arch/arm/mach-uniphier/init/init-ld4.c @@ -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); diff --git a/arch/arm/mach-uniphier/init/init-pro4.c b/arch/arm/mach-uniphier/init/init-pro4.c index 8e2ebc7..c277071 100644 --- a/arch/arm/mach-uniphier/init/init-pro4.c +++ b/arch/arm/mach-uniphier/init/init-pro4.c @@ -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); diff --git a/arch/arm/mach-uniphier/init/init-pro5.c b/arch/arm/mach-uniphier/init/init-pro5.c index 37c62ef..4e7041b 100644 --- a/arch/arm/mach-uniphier/init/init-pro5.c +++ b/arch/arm/mach-uniphier/init/init-pro5.c @@ -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"); diff --git a/arch/arm/mach-uniphier/init/init-pxs2.c b/arch/arm/mach-uniphier/init/init-pxs2.c index d080b9b..f7d5b48 100644 --- a/arch/arm/mach-uniphier/init/init-pxs2.c +++ b/arch/arm/mach-uniphier/init/init-pxs2.c @@ -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"); diff --git a/arch/arm/mach-uniphier/init/init-sld3.c b/arch/arm/mach-uniphier/init/init-sld3.c index 0b8d6c5..50d9eaf 100644 --- a/arch/arm/mach-uniphier/init/init-sld3.c +++ b/arch/arm/mach-uniphier/init/init-sld3.c @@ -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); diff --git a/arch/arm/mach-uniphier/init/init-sld8.c b/arch/arm/mach-uniphier/init/init-sld8.c index 075ac27..8da2843 100644 --- a/arch/arm/mach-uniphier/init/init-sld8.c +++ b/arch/arm/mach-uniphier/init/init-sld8.c @@ -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); diff --git a/arch/arm/mach-uniphier/micro-support-card.c b/arch/arm/mach-uniphier/micro-support-card.c index e53bcdf..80c5d97 100644 --- a/arch/arm/mach-uniphier/micro-support-card.c +++ b/arch/arm/mach-uniphier/micro-support-card.c @@ -25,12 +25,12 @@ * 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 */ diff --git a/arch/arm/mach-uniphier/micro-support-card.h b/arch/arm/mach-uniphier/micro-support-card.h index 4dae603..90990ba 100644 --- a/arch/arm/mach-uniphier/micro-support-card.h +++ b/arch/arm/mach-uniphier/micro-support-card.h @@ -10,15 +10,10 @@ #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) { }