From patchwork Sun Jan 15 05:59:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 91521 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp888869qgi; Sat, 14 Jan 2017 22:01:16 -0800 (PST) X-Received: by 10.28.154.70 with SMTP id c67mr8442839wme.90.1484460076633; Sat, 14 Jan 2017 22:01:16 -0800 (PST) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id t131si7982613wmf.99.2017.01.14.22.01.16; Sat, 14 Jan 2017 22:01:16 -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 28135A75D7; Sun, 15 Jan 2017 07:00:56 +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 phkFLiGSkWVq; Sun, 15 Jan 2017 07:00:56 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B56DCB388C; Sun, 15 Jan 2017 07:00:13 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C8154A75D5 for ; Sun, 15 Jan 2017 06:59:40 +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 flqyAjfJbCLE for ; Sun, 15 Jan 2017 06:59:40 +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 29A74A75D2 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 v0F5xD3f016694; Sun, 15 Jan 2017 14:59:18 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v0F5xD3f016694 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1484459958; bh=VlL4eIz/GGuOmN1lqPfioTtbFIP5/Xz9WGihtuf/708=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SqS9kz0MdcsVJGgglZFWI6IXNwCSZaWwW8kH0S7Mgw/Az3DVYsjDfl9AOFcmkCMuC ejxAlq4qKtuanmcV2coMWSKCXxptcWuQWzzgoV6Dyl2IcecfbzxKViVZ/OcYZ0SXm+ ysme+rJxBCysqLzF7dq4fpgIkpi1BDarqrthXbs56yzJmRbBG3/tNfrjV0gMEnT2Z+ oiMOpAzRGHgLbeBk3ELQpUPBrvS3iHU5o55lnpKhlAFzH6tZlY8y+C4uRJeNOIt7U6 Yz0Y5SdtJirYNiuHLfW49ehZYQAMu0zrBvs8uxjC98e0qGR1y+vOjhGrj218TCtBhe 7eaOSav30K9gA== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sun, 15 Jan 2017 14:59:02 +0900 Message-Id: <1484459950-8644-2-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 1/9] ARM: uniphier: remove unneeded argument of uniphier_ld20_pll_init() 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" At first, we thought the LD20 PLL setting would be board dependent, but this argument turned out unneeded after all. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/board_init.c | 8 +------- arch/arm/mach-uniphier/clk/pll-ld20.c | 4 +--- arch/arm/mach-uniphier/init.h | 2 +- 3 files changed, 3 insertions(+), 11 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/board_init.c b/arch/arm/mach-uniphier/board_init.c index 8c7864c..4cab7fe 100644 --- a/arch/arm/mach-uniphier/board_init.c +++ b/arch/arm/mach-uniphier/board_init.c @@ -58,14 +58,8 @@ static void uniphier_nand_pin_init(bool cs2) int board_init(void) { - const struct uniphier_board_data *bd; - led_puts("U0"); - bd = uniphier_get_board_param(); - if (!bd) - return -ENODEV; - switch (uniphier_get_soc_type()) { #if defined(CONFIG_ARCH_UNIPHIER_SLD3) case SOC_UNIPHIER_SLD3: @@ -147,7 +141,7 @@ int board_init(void) sg_set_pinsel(153, 14, 8, 4); /* XIRQ4 -> XIRQ4 */ sg_set_iectrl(153); led_puts("U1"); - uniphier_ld20_pll_init(bd); + uniphier_ld20_pll_init(); uniphier_ld20_clk_init(); cci500_init(2); break; diff --git a/arch/arm/mach-uniphier/clk/pll-ld20.c b/arch/arm/mach-uniphier/clk/pll-ld20.c index 8ad6883..121a369 100644 --- a/arch/arm/mach-uniphier/clk/pll-ld20.c +++ b/arch/arm/mach-uniphier/clk/pll-ld20.c @@ -11,7 +11,7 @@ #include "../sc64-regs.h" #include "pll.h" -int uniphier_ld20_pll_init(const struct uniphier_board_data *bd) +void uniphier_ld20_pll_init(void) { uniphier_ld20_sscpll_init(SC_CPLLCTRL, UNIPHIER_PLL_FREQ_DEFAULT, 0, 4); /* do nothing for SPLL */ @@ -36,6 +36,4 @@ int uniphier_ld20_pll_init(const struct uniphier_board_data *bd) uniphier_ld20_dspll_init(SC_VPLL8KCTRL); uniphier_ld20_dspll_init(SC_A2PLLCTRL); - - return 0; } diff --git a/arch/arm/mach-uniphier/init.h b/arch/arm/mach-uniphier/init.h index f3f9e54..af74dd8 100644 --- a/arch/arm/mach-uniphier/init.h +++ b/arch/arm/mach-uniphier/init.h @@ -105,7 +105,7 @@ void uniphier_sld3_pll_init(void); void uniphier_ld4_pll_init(void); void uniphier_pro4_pll_init(void); void uniphier_ld11_pll_init(void); -int uniphier_ld20_pll_init(const struct uniphier_board_data *bd); +void uniphier_ld20_pll_init(void); void uniphier_ld4_clk_init(void); void uniphier_pro4_clk_init(void); From patchwork Sun Jan 15 05:59:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 91522 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp888933qgi; Sat, 14 Jan 2017 22:01:28 -0800 (PST) X-Received: by 10.28.26.203 with SMTP id a194mr8549491wma.84.1484460088731; Sat, 14 Jan 2017 22:01:28 -0800 (PST) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id l1si17067269wra.261.2017.01.14.22.01.28; Sat, 14 Jan 2017 22:01:28 -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 19F9FB38B5; Sun, 15 Jan 2017 07:01:03 +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 xCNZNstCEtxy; Sun, 15 Jan 2017 07:01:03 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8943BB389F; Sun, 15 Jan 2017 07:00:20 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D845CA75D7 for ; Sun, 15 Jan 2017 06:59:40 +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 MIesVvwZ-o2p for ; Sun, 15 Jan 2017 06:59:40 +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 31A6DA75DC 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 v0F5xD3g016694; Sun, 15 Jan 2017 14:59:18 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v0F5xD3g016694 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1484459958; bh=t3FPgxg0vreMMQrPZsuC6Zr/aFeP7EcqpjxSv9voHkU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FiAEkPO9WqowVeYr1l6evUzXLvMJQuW5eRnq6QhkBqgD4q5Vz1eRjvxeMoXkxMHeo 23VRlNJ4GjClEpF6Ozuq6FzpB6CzzlksyJ19UjHKkMmGew7XSDwq3Vwyulfm9btZsV bkw5y3kuCQyk07nPfU6WMBuCGmlgDcfUz2FOfGSazXNz/9Jzxz7ak/TjmRpO1avYNi vFbCkKDLYkmxQPbTFoDUsUc5zTDP1O+i9OD5C/FLMUMtqlLXDWSIEoSbSMrRMqtKtg d90/S6bYnUBEc0odUIr9+vW7rVsaiaJ8pq0fuf82q7/JnGLwjvTxIbHzRvYko76Vr+ HoFMyWyekqn1g== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sun, 15 Jan 2017 14:59:03 +0900 Message-Id: <1484459950-8644-3-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 2/9] ARM: uniphier: split out UMC clock enable 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" The clock enable bits for UMC are more SoC-specific than for the other hardware blocks. Separate the UMC clocks and the other clocks for better code reuse across SoCs. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/clk/Makefile | 18 ++++++------- .../clk/{early-clk-ld11.c => clk-dram-ld11.c} | 8 +----- .../clk/{early-clk-ld20.c => clk-dram-ld20.c} | 8 +----- .../clk/{early-clk-pro5.c => clk-dram-pro5.c} | 9 ++----- .../clk/{early-clk-pxs2.c => clk-dram-pxs2.c} | 14 +--------- .../clk/{early-clk-ld4.c => clk-dram-sld3.c} | 9 ++----- arch/arm/mach-uniphier/clk/clk-early-ld11.c | 21 +++++++++++++++ arch/arm/mach-uniphier/clk/clk-early-sld3.c | 30 ++++++++++++++++++++++ arch/arm/mach-uniphier/init.h | 13 ++++++---- arch/arm/mach-uniphier/init/init-ld11.c | 3 ++- arch/arm/mach-uniphier/init/init-ld20.c | 3 ++- arch/arm/mach-uniphier/init/init-ld4.c | 3 ++- arch/arm/mach-uniphier/init/init-pro4.c | 3 ++- arch/arm/mach-uniphier/init/init-pro5.c | 3 ++- arch/arm/mach-uniphier/init/init-pxs2.c | 3 ++- arch/arm/mach-uniphier/init/init-sld3.c | 3 ++- arch/arm/mach-uniphier/init/init-sld8.c | 3 ++- 17 files changed, 91 insertions(+), 63 deletions(-) rename arch/arm/mach-uniphier/clk/{early-clk-ld11.c => clk-dram-ld11.c} (74%) rename arch/arm/mach-uniphier/clk/{early-clk-ld20.c => clk-dram-ld20.c} (78%) rename arch/arm/mach-uniphier/clk/{early-clk-pro5.c => clk-dram-pro5.c} (76%) rename arch/arm/mach-uniphier/clk/{early-clk-pxs2.c => clk-dram-pxs2.c} (70%) rename arch/arm/mach-uniphier/clk/{early-clk-ld4.c => clk-dram-sld3.c} (69%) create mode 100644 arch/arm/mach-uniphier/clk/clk-early-ld11.c create mode 100644 arch/arm/mach-uniphier/clk/clk-early-sld3.c -- 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/clk/Makefile b/arch/arm/mach-uniphier/clk/Makefile index 95f433e..765660f 100644 --- a/arch/arm/mach-uniphier/clk/Makefile +++ b/arch/arm/mach-uniphier/clk/Makefile @@ -4,15 +4,15 @@ ifdef CONFIG_SPL_BUILD -obj-$(CONFIG_ARCH_UNIPHIER_SLD3) += early-clk-ld4.o dpll-sld3.o -obj-$(CONFIG_ARCH_UNIPHIER_LD4) += early-clk-ld4.o dpll-ld4.o -obj-$(CONFIG_ARCH_UNIPHIER_PRO4) += early-clk-ld4.o dpll-pro4.o -obj-$(CONFIG_ARCH_UNIPHIER_SLD8) += early-clk-ld4.o dpll-sld8.o -obj-$(CONFIG_ARCH_UNIPHIER_PRO5) += early-clk-pro5.o -obj-$(CONFIG_ARCH_UNIPHIER_PXS2) += early-clk-pxs2.o -obj-$(CONFIG_ARCH_UNIPHIER_LD6B) += early-clk-pxs2.o -obj-$(CONFIG_ARCH_UNIPHIER_LD11) += early-clk-ld11.o dpll-ld11.o -obj-$(CONFIG_ARCH_UNIPHIER_LD20) += early-clk-ld20.o dpll-ld20.o +obj-$(CONFIG_ARCH_UNIPHIER_SLD3) += clk-early-sld3.o clk-dram-sld3.o dpll-sld3.o +obj-$(CONFIG_ARCH_UNIPHIER_LD4) += clk-early-sld3.o clk-dram-sld3.o dpll-ld4.o +obj-$(CONFIG_ARCH_UNIPHIER_PRO4) += clk-early-sld3.o clk-dram-sld3.o dpll-pro4.o +obj-$(CONFIG_ARCH_UNIPHIER_SLD8) += clk-early-sld3.o clk-dram-sld3.o dpll-sld8.o +obj-$(CONFIG_ARCH_UNIPHIER_PRO5) += clk-early-sld3.o clk-dram-pro5.o +obj-$(CONFIG_ARCH_UNIPHIER_PXS2) += clk-early-sld3.o clk-dram-pxs2.o +obj-$(CONFIG_ARCH_UNIPHIER_LD6B) += clk-early-sld3.o clk-dram-pxs2.o +obj-$(CONFIG_ARCH_UNIPHIER_LD11) += clk-early-ld11.o clk-dram-ld11.o dpll-ld11.o +obj-$(CONFIG_ARCH_UNIPHIER_LD20) += clk-early-ld11.o clk-dram-ld20.o dpll-ld20.o else diff --git a/arch/arm/mach-uniphier/clk/early-clk-ld11.c b/arch/arm/mach-uniphier/clk/clk-dram-ld11.c similarity index 74% rename from arch/arm/mach-uniphier/clk/early-clk-ld11.c rename to arch/arm/mach-uniphier/clk/clk-dram-ld11.c index c94d83c..95bd9e6 100644 --- a/arch/arm/mach-uniphier/clk/early-clk-ld11.c +++ b/arch/arm/mach-uniphier/clk/clk-dram-ld11.c @@ -10,7 +10,7 @@ #include "../init.h" #include "../sc64-regs.h" -int uniphier_ld11_early_clk_init(const struct uniphier_board_data *bd) +void uniphier_ld11_dram_clk_init(void) { u32 tmp; @@ -20,13 +20,7 @@ int uniphier_ld11_early_clk_init(const struct uniphier_board_data *bd) writel(tmp, SC_RSTCTRL7); /* provide clocks */ - tmp = readl(SC_CLKCTRL4); - tmp |= SC_CLKCTRL4_PERI; - writel(tmp, SC_CLKCTRL4); - tmp = readl(SC_CLKCTRL7); tmp |= SC_CLKCTRL7_UMC31 | SC_CLKCTRL7_UMC30; writel(tmp, SC_CLKCTRL7); - - return 0; } diff --git a/arch/arm/mach-uniphier/clk/early-clk-ld20.c b/arch/arm/mach-uniphier/clk/clk-dram-ld20.c similarity index 78% rename from arch/arm/mach-uniphier/clk/early-clk-ld20.c rename to arch/arm/mach-uniphier/clk/clk-dram-ld20.c index 5201a55..2b1bf32 100644 --- a/arch/arm/mach-uniphier/clk/early-clk-ld20.c +++ b/arch/arm/mach-uniphier/clk/clk-dram-ld20.c @@ -9,7 +9,7 @@ #include "../init.h" #include "../sc64-regs.h" -int uniphier_ld20_early_clk_init(const struct uniphier_board_data *bd) +void uniphier_ld20_dram_clk_init(void) { u32 tmp; @@ -21,14 +21,8 @@ int uniphier_ld20_early_clk_init(const struct uniphier_board_data *bd) writel(tmp, SC_RSTCTRL7); /* provide clocks */ - tmp = readl(SC_CLKCTRL4); - tmp |= SC_CLKCTRL4_PERI; - writel(tmp, SC_CLKCTRL4); - tmp = readl(SC_CLKCTRL7); tmp |= SC_CLKCTRL7_UMCSB | SC_CLKCTRL7_UMC32 | SC_CLKCTRL7_UMC31 | SC_CLKCTRL7_UMC30; writel(tmp, SC_CLKCTRL7); - - return 0; } diff --git a/arch/arm/mach-uniphier/clk/early-clk-pro5.c b/arch/arm/mach-uniphier/clk/clk-dram-pro5.c similarity index 76% rename from arch/arm/mach-uniphier/clk/early-clk-pro5.c rename to arch/arm/mach-uniphier/clk/clk-dram-pro5.c index c41a8ea..b8410d2 100644 --- a/arch/arm/mach-uniphier/clk/early-clk-pro5.c +++ b/arch/arm/mach-uniphier/clk/clk-dram-pro5.c @@ -9,7 +9,7 @@ #include "../init.h" #include "../sc-regs.h" -int uniphier_pro5_early_clk_init(const struct uniphier_board_data *bd) +void uniphier_pro5_dram_clk_init(void) { u32 tmp; @@ -24,17 +24,12 @@ int uniphier_pro5_early_clk_init(const struct uniphier_board_data *bd) SC_RSTCTRL4_NRST_UMCA1 | SC_RSTCTRL4_NRST_UMCA0 | SC_RSTCTRL4_NRST_UMC31 | SC_RSTCTRL4_NRST_UMC30; writel(tmp, SC_RSTCTRL4); - readl(SC_RSTCTRL); /* dummy read */ + readl(SC_RSTCTRL4); /* dummy read */ /* provide clocks */ - tmp = readl(SC_CLKCTRL); - tmp |= SC_CLKCTRL_CEN_SBC | SC_CLKCTRL_CEN_PERI; - writel(tmp, SC_CLKCTRL); tmp = readl(SC_CLKCTRL4); tmp |= SC_CLKCTRL4_CEN_UMCSB | SC_CLKCTRL4_CEN_UMC1 | SC_CLKCTRL4_CEN_UMC0; writel(tmp, SC_CLKCTRL4); readl(SC_CLKCTRL4); /* dummy read */ - - return 0; } diff --git a/arch/arm/mach-uniphier/clk/early-clk-pxs2.c b/arch/arm/mach-uniphier/clk/clk-dram-pxs2.c similarity index 70% rename from arch/arm/mach-uniphier/clk/early-clk-pxs2.c rename to arch/arm/mach-uniphier/clk/clk-dram-pxs2.c index 665ecd5..8d26971 100644 --- a/arch/arm/mach-uniphier/clk/early-clk-pxs2.c +++ b/arch/arm/mach-uniphier/clk/clk-dram-pxs2.c @@ -11,17 +11,11 @@ #include "../init.h" #include "../sc-regs.h" -int uniphier_pxs2_early_clk_init(const struct uniphier_board_data *bd) +void uniphier_pxs2_dram_clk_init(void) { u32 tmp; /* deassert reset */ - if (spl_boot_device() != BOOT_DEVICE_NAND) { - tmp = readl(SC_RSTCTRL); - tmp &= ~SC_RSTCTRL_NRST_NAND; - writel(tmp, SC_RSTCTRL); - }; - tmp = readl(SC_RSTCTRL4); tmp |= SC_RSTCTRL4_NRST_UMCSB | SC_RSTCTRL4_NRST_UMCA2 | SC_RSTCTRL4_NRST_UMCA1 | SC_RSTCTRL4_NRST_UMCA0 | @@ -31,15 +25,9 @@ int uniphier_pxs2_early_clk_init(const struct uniphier_board_data *bd) readl(SC_RSTCTRL4); /* dummy read */ /* provide clocks */ - tmp = readl(SC_CLKCTRL); - tmp |= SC_CLKCTRL_CEN_SBC | SC_CLKCTRL_CEN_PERI; - writel(tmp, SC_CLKCTRL); - tmp = readl(SC_CLKCTRL4); tmp |= SC_CLKCTRL4_CEN_UMCSB | SC_CLKCTRL4_CEN_UMC2 | SC_CLKCTRL4_CEN_UMC1 | SC_CLKCTRL4_CEN_UMC0; writel(tmp, SC_CLKCTRL4); readl(SC_CLKCTRL4); /* dummy read */ - - return 0; } diff --git a/arch/arm/mach-uniphier/clk/early-clk-ld4.c b/arch/arm/mach-uniphier/clk/clk-dram-sld3.c similarity index 69% rename from arch/arm/mach-uniphier/clk/early-clk-ld4.c rename to arch/arm/mach-uniphier/clk/clk-dram-sld3.c index b6e8b64..2781038 100644 --- a/arch/arm/mach-uniphier/clk/early-clk-ld4.c +++ b/arch/arm/mach-uniphier/clk/clk-dram-sld3.c @@ -11,24 +11,19 @@ #include "../init.h" #include "../sc-regs.h" -int uniphier_ld4_early_clk_init(const struct uniphier_board_data *bd) +void uniphier_sld3_dram_clk_init(void) { u32 tmp; /* deassert reset */ tmp = readl(SC_RSTCTRL); - tmp |= SC_RSTCTRL_NRST_UMC1 | SC_RSTCTRL_NRST_UMC0; - if (spl_boot_device() != BOOT_DEVICE_NAND) - tmp &= ~SC_RSTCTRL_NRST_NAND; writel(tmp, SC_RSTCTRL); readl(SC_RSTCTRL); /* dummy read */ /* provide clocks */ tmp = readl(SC_CLKCTRL); - tmp |= SC_CLKCTRL_CEN_UMC | SC_CLKCTRL_CEN_SBC | SC_CLKCTRL_CEN_PERI; + tmp |= SC_CLKCTRL_CEN_UMC; writel(tmp, SC_CLKCTRL); readl(SC_CLKCTRL); /* dummy read */ - - return 0; } diff --git a/arch/arm/mach-uniphier/clk/clk-early-ld11.c b/arch/arm/mach-uniphier/clk/clk-early-ld11.c new file mode 100644 index 0000000..783889f --- /dev/null +++ b/arch/arm/mach-uniphier/clk/clk-early-ld11.c @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2016 Socionext Inc. + * Author: Masahiro Yamada + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include + +#include "../init.h" +#include "../sc64-regs.h" + +void uniphier_ld11_early_clk_init(void) +{ + u32 tmp; + + /* provide clocks */ + tmp = readl(SC_CLKCTRL4); + tmp |= SC_CLKCTRL4_PERI; + writel(tmp, SC_CLKCTRL4); +} diff --git a/arch/arm/mach-uniphier/clk/clk-early-sld3.c b/arch/arm/mach-uniphier/clk/clk-early-sld3.c new file mode 100644 index 0000000..00aa7ee --- /dev/null +++ b/arch/arm/mach-uniphier/clk/clk-early-sld3.c @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2011-2015 Masahiro Yamada + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include +#include + +#include "../init.h" +#include "../sc-regs.h" + +void uniphier_sld3_early_clk_init(void) +{ + u32 tmp; + + /* deassert reset */ + if (spl_boot_device() != BOOT_DEVICE_NAND) { + tmp = readl(SC_RSTCTRL); + tmp &= ~SC_RSTCTRL_NRST_NAND; + writel(tmp, SC_RSTCTRL); + }; + + /* provide clocks */ + tmp = readl(SC_CLKCTRL); + tmp |= SC_CLKCTRL_CEN_SBC | SC_CLKCTRL_CEN_PERI; + writel(tmp, SC_CLKCTRL); + readl(SC_CLKCTRL); /* dummy read */ +} diff --git a/arch/arm/mach-uniphier/init.h b/arch/arm/mach-uniphier/init.h index af74dd8..327fa8b 100644 --- a/arch/arm/mach-uniphier/init.h +++ b/arch/arm/mach-uniphier/init.h @@ -88,11 +88,14 @@ int uniphier_sld8_dpll_init(const struct uniphier_board_data *bd); int uniphier_ld11_dpll_init(const struct uniphier_board_data *bd); int uniphier_ld20_dpll_init(const struct uniphier_board_data *bd); -int uniphier_ld4_early_clk_init(const struct uniphier_board_data *bd); -int uniphier_pro5_early_clk_init(const struct uniphier_board_data *bd); -int uniphier_pxs2_early_clk_init(const struct uniphier_board_data *bd); -int uniphier_ld11_early_clk_init(const struct uniphier_board_data *bd); -int uniphier_ld20_early_clk_init(const struct uniphier_board_data *bd); +void uniphier_sld3_early_clk_init(void); +void uniphier_ld11_early_clk_init(void); + +void uniphier_sld3_dram_clk_init(void); +void uniphier_pro5_dram_clk_init(void); +void uniphier_pxs2_dram_clk_init(void); +void uniphier_ld11_dram_clk_init(void); +void uniphier_ld20_dram_clk_init(void); int uniphier_ld4_umc_init(const struct uniphier_board_data *bd); int uniphier_pro4_umc_init(const struct uniphier_board_data *bd); diff --git a/arch/arm/mach-uniphier/init/init-ld11.c b/arch/arm/mach-uniphier/init/init-ld11.c index fdb2838..9d43a13 100644 --- a/arch/arm/mach-uniphier/init/init-ld11.c +++ b/arch/arm/mach-uniphier/init/init-ld11.c @@ -29,7 +29,8 @@ int uniphier_ld11_init(const struct uniphier_board_data *bd) led_puts("L1"); - uniphier_ld11_early_clk_init(bd); + uniphier_ld11_early_clk_init(); + uniphier_ld11_dram_clk_init(); led_puts("L2"); diff --git a/arch/arm/mach-uniphier/init/init-ld20.c b/arch/arm/mach-uniphier/init/init-ld20.c index 37b860a..6702430 100644 --- a/arch/arm/mach-uniphier/init/init-ld20.c +++ b/arch/arm/mach-uniphier/init/init-ld20.c @@ -30,7 +30,8 @@ int uniphier_ld20_init(const struct uniphier_board_data *bd) led_puts("L1"); - uniphier_ld20_early_clk_init(bd); + uniphier_ld11_early_clk_init(); + uniphier_ld20_dram_clk_init(); led_puts("L2"); diff --git a/arch/arm/mach-uniphier/init/init-ld4.c b/arch/arm/mach-uniphier/init/init-ld4.c index 2f4c60d..5f4880c 100644 --- a/arch/arm/mach-uniphier/init/init-ld4.c +++ b/arch/arm/mach-uniphier/init/init-ld4.c @@ -31,7 +31,8 @@ int uniphier_ld4_init(const struct uniphier_board_data *bd) led_puts("L1"); - uniphier_ld4_early_clk_init(bd); + uniphier_sld3_early_clk_init(); + uniphier_sld3_dram_clk_init(); led_puts("L2"); diff --git a/arch/arm/mach-uniphier/init/init-pro4.c b/arch/arm/mach-uniphier/init/init-pro4.c index 2825150..e57eb86 100644 --- a/arch/arm/mach-uniphier/init/init-pro4.c +++ b/arch/arm/mach-uniphier/init/init-pro4.c @@ -28,7 +28,8 @@ int uniphier_pro4_init(const struct uniphier_board_data *bd) led_puts("L1"); - uniphier_ld4_early_clk_init(bd); + uniphier_sld3_early_clk_init(); + uniphier_sld3_dram_clk_init(); led_puts("L2"); diff --git a/arch/arm/mach-uniphier/init/init-pro5.c b/arch/arm/mach-uniphier/init/init-pro5.c index c809ae7..ea53dcf 100644 --- a/arch/arm/mach-uniphier/init/init-pro5.c +++ b/arch/arm/mach-uniphier/init/init-pro5.c @@ -24,7 +24,8 @@ int uniphier_pro5_init(const struct uniphier_board_data *bd) led_puts("L1"); - uniphier_pro5_early_clk_init(bd); + uniphier_sld3_early_clk_init(); + uniphier_pro5_dram_clk_init(); led_puts("L2"); diff --git a/arch/arm/mach-uniphier/init/init-pxs2.c b/arch/arm/mach-uniphier/init/init-pxs2.c index 5e07db1..7cdf4bd 100644 --- a/arch/arm/mach-uniphier/init/init-pxs2.c +++ b/arch/arm/mach-uniphier/init/init-pxs2.c @@ -28,7 +28,8 @@ int uniphier_pxs2_init(const struct uniphier_board_data *bd) led_puts("L1"); - uniphier_pxs2_early_clk_init(bd); + uniphier_sld3_early_clk_init(); + uniphier_pxs2_dram_clk_init(); led_puts("L2"); diff --git a/arch/arm/mach-uniphier/init/init-sld3.c b/arch/arm/mach-uniphier/init/init-sld3.c index ee3245c..a2e9cc7 100644 --- a/arch/arm/mach-uniphier/init/init-sld3.c +++ b/arch/arm/mach-uniphier/init/init-sld3.c @@ -31,7 +31,8 @@ int uniphier_sld3_init(const struct uniphier_board_data *bd) led_puts("L1"); - uniphier_ld4_early_clk_init(bd); + uniphier_sld3_early_clk_init(); + uniphier_sld3_dram_clk_init(); led_puts("L2"); diff --git a/arch/arm/mach-uniphier/init/init-sld8.c b/arch/arm/mach-uniphier/init/init-sld8.c index 82d036b..07fccb1 100644 --- a/arch/arm/mach-uniphier/init/init-sld8.c +++ b/arch/arm/mach-uniphier/init/init-sld8.c @@ -31,7 +31,8 @@ int uniphier_sld8_init(const struct uniphier_board_data *bd) led_puts("L1"); - uniphier_ld4_early_clk_init(bd); + uniphier_sld3_early_clk_init(); + uniphier_sld3_dram_clk_init(); led_puts("L2"); From patchwork Sun Jan 15 05:59:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 91515 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp888503qgi; Sat, 14 Jan 2017 22:00:01 -0800 (PST) X-Received: by 10.28.109.218 with SMTP id b87mr7253124wmi.52.1484460001105; Sat, 14 Jan 2017 22:00:01 -0800 (PST) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id k22si17053698wrc.273.2017.01.14.22.00.00; Sat, 14 Jan 2017 22:00:01 -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 06B1BB3873; Sun, 15 Jan 2017 06:59:58 +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 gzRbm_GQ0rzO; Sun, 15 Jan 2017 06:59:57 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F2215B387D; Sun, 15 Jan 2017 06:59:54 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 05283B3865 for ; Sun, 15 Jan 2017 06:59:40 +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 glcb7LL5zpWn 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 23FD4A75C2 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 v0F5xD3h016694; Sun, 15 Jan 2017 14:59:18 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v0F5xD3h016694 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1484459959; bh=MboD5Zo539hnyB1pb8dkxyiwT2DFQPH/RwGeba+cFfY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HcuUyIh04Kuv7uqQ/HU2gYZ6V2sbUgkyJnL9WO3eWum8iUANwqO7QPetHUJ2jybaO wJnABvV33WYmnpewrQ0cZcT9FGuLYTCJ0hcdPAeJCsG3PzI9lTi2pdTCTUkU9xnZlU LA8IN+NKHNw30B8vBzzid6zTXCZcTemHCb45wlNjDq6IEBzFXzLg2hCzg4wUO7MMmS fo8kcYxL5gx5aC9beVKMC6qfaxROSflikzTlrLFna1jmBrYX0EYfpyf7WAOn4fyhn8 etK5Z7k/51sxq2EUYHkblR7/X6Q8QNhzgJvf6vnHUvGRUGhsXnKopsK9nEdSETXarA qc+D6K5h35wkQ== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sun, 15 Jan 2017 14:59:04 +0900 Message-Id: <1484459950-8644-4-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 3/9] ARM: uniphier: refactor MEMCONF 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" Currently, memconf-sld3.c and memconf-pxs2.c duplicate the code. There are 3 patterns in terms of MEMCONF init: - DRAM 2 channels: LD4, sLD8, Pro4, Pro5, LD11 - DRAM 3 channels: sLD3 - DRAM 3 channels (Ch2 is disable by MEMCONF[21]): Pxs2, LD20 All of them can be moved into a single file by a little more refactoring. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/Makefile | 3 +- arch/arm/mach-uniphier/init.h | 6 +- arch/arm/mach-uniphier/init/init-ld11.c | 2 +- arch/arm/mach-uniphier/init/init-ld20.c | 3 +- arch/arm/mach-uniphier/init/init-ld4.c | 2 +- arch/arm/mach-uniphier/init/init-pro4.c | 2 +- arch/arm/mach-uniphier/init/init-pro5.c | 2 +- arch/arm/mach-uniphier/init/init-pxs2.c | 3 +- arch/arm/mach-uniphier/init/init-sld3.c | 3 +- arch/arm/mach-uniphier/init/init-sld8.c | 2 +- arch/arm/mach-uniphier/memconf.c | 163 ++++++++++++++++++++++++++ arch/arm/mach-uniphier/memconf/Makefile | 9 -- arch/arm/mach-uniphier/memconf/memconf-pxs2.c | 68 ----------- arch/arm/mach-uniphier/memconf/memconf-sld3.c | 60 ---------- arch/arm/mach-uniphier/memconf/memconf.c | 107 ----------------- 15 files changed, 176 insertions(+), 259 deletions(-) create mode 100644 arch/arm/mach-uniphier/memconf.c delete mode 100644 arch/arm/mach-uniphier/memconf/Makefile delete mode 100644 arch/arm/mach-uniphier/memconf/memconf-pxs2.c delete mode 100644 arch/arm/mach-uniphier/memconf/memconf-sld3.c delete mode 100644 arch/arm/mach-uniphier/memconf/memconf.c -- 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/Makefile b/arch/arm/mach-uniphier/Makefile index ae78548..98b42a0 100644 --- a/arch/arm/mach-uniphier/Makefile +++ b/arch/arm/mach-uniphier/Makefile @@ -4,7 +4,8 @@ ifdef CONFIG_SPL_BUILD -obj-y += init/ bcu/ memconf/ +obj-y += memconf.o +obj-y += init/ bcu/ obj-$(CONFIG_MICRO_SUPPORT_CARD) += sbc/ else diff --git a/arch/arm/mach-uniphier/init.h b/arch/arm/mach-uniphier/init.h index 327fa8b..0708aa0 100644 --- a/arch/arm/mach-uniphier/init.h +++ b/arch/arm/mach-uniphier/init.h @@ -77,9 +77,9 @@ static inline int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd) int uniphier_sld3_bcu_init(const struct uniphier_board_data *bd); int uniphier_ld4_bcu_init(const struct uniphier_board_data *bd); -int memconf_init(const struct uniphier_board_data *bd); -int uniphier_sld3_memconf_init(const struct uniphier_board_data *bd); -int uniphier_pxs2_memconf_init(const struct uniphier_board_data *bd); +int uniphier_memconf_2ch_init(const struct uniphier_board_data *bd); +int uniphier_memconf_3ch_no_disbit_init(const struct uniphier_board_data *bd); +int uniphier_memconf_3ch_init(const struct uniphier_board_data *bd); int uniphier_sld3_dpll_init(const struct uniphier_board_data *bd); int uniphier_ld4_dpll_init(const struct uniphier_board_data *bd); diff --git a/arch/arm/mach-uniphier/init/init-ld11.c b/arch/arm/mach-uniphier/init/init-ld11.c index 9d43a13..93b2162 100644 --- a/arch/arm/mach-uniphier/init/init-ld11.c +++ b/arch/arm/mach-uniphier/init/init-ld11.c @@ -25,7 +25,7 @@ int uniphier_ld11_init(const struct uniphier_board_data *bd) led_puts("L0"); - memconf_init(bd); + uniphier_memconf_2ch_init(bd); led_puts("L1"); diff --git a/arch/arm/mach-uniphier/init/init-ld20.c b/arch/arm/mach-uniphier/init/init-ld20.c index 6702430..de39b9a 100644 --- a/arch/arm/mach-uniphier/init/init-ld20.c +++ b/arch/arm/mach-uniphier/init/init-ld20.c @@ -25,8 +25,7 @@ int uniphier_ld20_init(const struct uniphier_board_data *bd) led_puts("L0"); - memconf_init(bd); - uniphier_pxs2_memconf_init(bd); + uniphier_memconf_3ch_init(bd); led_puts("L1"); diff --git a/arch/arm/mach-uniphier/init/init-ld4.c b/arch/arm/mach-uniphier/init/init-ld4.c index 5f4880c..caf02a5 100644 --- a/arch/arm/mach-uniphier/init/init-ld4.c +++ b/arch/arm/mach-uniphier/init/init-ld4.c @@ -27,7 +27,7 @@ int uniphier_ld4_init(const struct uniphier_board_data *bd) led_puts("L0"); - memconf_init(bd); + uniphier_memconf_2ch_init(bd); led_puts("L1"); diff --git a/arch/arm/mach-uniphier/init/init-pro4.c b/arch/arm/mach-uniphier/init/init-pro4.c index e57eb86..32d09bb 100644 --- a/arch/arm/mach-uniphier/init/init-pro4.c +++ b/arch/arm/mach-uniphier/init/init-pro4.c @@ -24,7 +24,7 @@ int uniphier_pro4_init(const struct uniphier_board_data *bd) led_puts("L0"); - memconf_init(bd); + uniphier_memconf_2ch_init(bd); led_puts("L1"); diff --git a/arch/arm/mach-uniphier/init/init-pro5.c b/arch/arm/mach-uniphier/init/init-pro5.c index ea53dcf..3fc09a4 100644 --- a/arch/arm/mach-uniphier/init/init-pro5.c +++ b/arch/arm/mach-uniphier/init/init-pro5.c @@ -20,7 +20,7 @@ int uniphier_pro5_init(const struct uniphier_board_data *bd) led_puts("L0"); - memconf_init(bd); + uniphier_memconf_2ch_init(bd); led_puts("L1"); diff --git a/arch/arm/mach-uniphier/init/init-pxs2.c b/arch/arm/mach-uniphier/init/init-pxs2.c index 7cdf4bd..38e37e4 100644 --- a/arch/arm/mach-uniphier/init/init-pxs2.c +++ b/arch/arm/mach-uniphier/init/init-pxs2.c @@ -23,8 +23,7 @@ int uniphier_pxs2_init(const struct uniphier_board_data *bd) led_puts("L0"); - memconf_init(bd); - uniphier_pxs2_memconf_init(bd); + uniphier_memconf_3ch_init(bd); led_puts("L1"); diff --git a/arch/arm/mach-uniphier/init/init-sld3.c b/arch/arm/mach-uniphier/init/init-sld3.c index a2e9cc7..9dc51bf 100644 --- a/arch/arm/mach-uniphier/init/init-sld3.c +++ b/arch/arm/mach-uniphier/init/init-sld3.c @@ -26,8 +26,7 @@ int uniphier_sld3_init(const struct uniphier_board_data *bd) led_puts("L0"); - memconf_init(bd); - uniphier_sld3_memconf_init(bd); + uniphier_memconf_3ch_no_disbit_init(bd); led_puts("L1"); diff --git a/arch/arm/mach-uniphier/init/init-sld8.c b/arch/arm/mach-uniphier/init/init-sld8.c index 07fccb1..8e8d62b 100644 --- a/arch/arm/mach-uniphier/init/init-sld8.c +++ b/arch/arm/mach-uniphier/init/init-sld8.c @@ -27,7 +27,7 @@ int uniphier_sld8_init(const struct uniphier_board_data *bd) led_puts("L0"); - memconf_init(bd); + uniphier_memconf_2ch_init(bd); led_puts("L1"); diff --git a/arch/arm/mach-uniphier/memconf.c b/arch/arm/mach-uniphier/memconf.c new file mode 100644 index 0000000..205ccf1 --- /dev/null +++ b/arch/arm/mach-uniphier/memconf.c @@ -0,0 +1,163 @@ +/* + * Copyright (C) 2011-2015 Panasonic Corporation + * Copyright (C) 2016 Socionext Inc. + * Author: Masahiro Yamada + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include +#include +#include + +#include "sg-regs.h" +#include "init.h" + +static int __uniphier_memconf_init(const struct uniphier_board_data *bd, + int have_ch2, int have_ch2_disable_bit) +{ + u32 val = 0; + unsigned long size_per_word; + + /* set up ch0 */ + switch (bd->dram_ch[0].width) { + case 16: + val |= SG_MEMCONF_CH0_NUM_1; + size_per_word = bd->dram_ch[0].size; + break; + case 32: + val |= SG_MEMCONF_CH0_NUM_2; + size_per_word = bd->dram_ch[0].size >> 1; + break; + default: + pr_err("error: unsupported DRAM ch0 width\n"); + return -EINVAL; + } + + switch (size_per_word) { + case SZ_64M: + val |= SG_MEMCONF_CH0_SZ_64M; + break; + case SZ_128M: + val |= SG_MEMCONF_CH0_SZ_128M; + break; + case SZ_256M: + val |= SG_MEMCONF_CH0_SZ_256M; + break; + case SZ_512M: + val |= SG_MEMCONF_CH0_SZ_512M; + break; + case SZ_1G: + val |= SG_MEMCONF_CH0_SZ_1G; + break; + default: + pr_err("error: unsupported DRAM ch0 size\n"); + return -EINVAL; + } + + /* set up ch1 */ + switch (bd->dram_ch[1].width) { + case 16: + val |= SG_MEMCONF_CH1_NUM_1; + size_per_word = bd->dram_ch[1].size; + break; + case 32: + val |= SG_MEMCONF_CH1_NUM_2; + size_per_word = bd->dram_ch[1].size >> 1; + break; + default: + pr_err("error: unsupported DRAM ch1 width\n"); + return -EINVAL; + } + + switch (size_per_word) { + case SZ_64M: + val |= SG_MEMCONF_CH1_SZ_64M; + break; + case SZ_128M: + val |= SG_MEMCONF_CH1_SZ_128M; + break; + case SZ_256M: + val |= SG_MEMCONF_CH1_SZ_256M; + break; + case SZ_512M: + val |= SG_MEMCONF_CH1_SZ_512M; + break; + case SZ_1G: + val |= SG_MEMCONF_CH1_SZ_1G; + break; + default: + pr_err("error: unsupported DRAM ch1 size\n"); + return -EINVAL; + } + + /* is sparse mem? */ + if (bd->dram_ch[0].base + bd->dram_ch[0].size < bd->dram_ch[1].base) + val |= SG_MEMCONF_SPARSEMEM; + + if (!have_ch2) + goto out; + + if (!bd->dram_ch[2].size) { + if (have_ch2_disable_bit) + val |= SG_MEMCONF_CH2_DISABLE; + goto out; + } + + /* set up ch2 */ + switch (bd->dram_ch[2].width) { + case 16: + val |= SG_MEMCONF_CH2_NUM_1; + size_per_word = bd->dram_ch[2].size; + break; + case 32: + val |= SG_MEMCONF_CH2_NUM_2; + size_per_word = bd->dram_ch[2].size >> 1; + break; + default: + pr_err("error: unsupported DRAM ch2 width\n"); + return -EINVAL; + } + + switch (size_per_word) { + case SZ_64M: + val |= SG_MEMCONF_CH2_SZ_64M; + break; + case SZ_128M: + val |= SG_MEMCONF_CH2_SZ_128M; + break; + case SZ_256M: + val |= SG_MEMCONF_CH2_SZ_256M; + break; + case SZ_512M: + val |= SG_MEMCONF_CH2_SZ_512M; + break; + case SZ_1G: + val |= SG_MEMCONF_CH2_SZ_1G; + break; + default: + pr_err("error: unsupported DRAM ch2 size\n"); + return -EINVAL; + } + +out: + writel(val, SG_MEMCONF); + + return 0; +} + +int uniphier_memconf_2ch_init(const struct uniphier_board_data *bd) +{ + return __uniphier_memconf_init(bd, 0, 0); +} + +int uniphier_memconf_3ch_no_disbit_init(const struct uniphier_board_data *bd) +{ + return __uniphier_memconf_init(bd, 1, 0); +} + +int uniphier_memconf_3ch_init(const struct uniphier_board_data *bd) +{ + return __uniphier_memconf_init(bd, 1, 1); +} diff --git a/arch/arm/mach-uniphier/memconf/Makefile b/arch/arm/mach-uniphier/memconf/Makefile deleted file mode 100644 index 6ed1419..0000000 --- a/arch/arm/mach-uniphier/memconf/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# -# SPDX-License-Identifier: GPL-2.0+ -# - -obj-y += memconf.o -obj-$(CONFIG_ARCH_UNIPHIER_SLD3) += memconf-sld3.o -obj-$(CONFIG_ARCH_UNIPHIER_PXS2) += memconf-pxs2.o -obj-$(CONFIG_ARCH_UNIPHIER_LD6B) += memconf-pxs2.o -obj-$(CONFIG_ARCH_UNIPHIER_LD20) += memconf-pxs2.o diff --git a/arch/arm/mach-uniphier/memconf/memconf-pxs2.c b/arch/arm/mach-uniphier/memconf/memconf-pxs2.c deleted file mode 100644 index e98eb48..0000000 --- a/arch/arm/mach-uniphier/memconf/memconf-pxs2.c +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2015 Masahiro Yamada - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include -#include -#include - -#include "../init.h" -#include "../sg-regs.h" - -int uniphier_pxs2_memconf_init(const struct uniphier_board_data *bd) -{ - u32 tmp; - unsigned long size_per_word; - - tmp = readl(SG_MEMCONF); - - tmp &= ~(SG_MEMCONF_CH2_SZ_MASK | SG_MEMCONF_CH2_NUM_MASK); - - switch (bd->dram_ch[2].width) { - case 16: - tmp |= SG_MEMCONF_CH2_NUM_1; - size_per_word = bd->dram_ch[2].size; - break; - case 32: - tmp |= SG_MEMCONF_CH2_NUM_2; - size_per_word = bd->dram_ch[2].size >> 1; - break; - default: - pr_err("error: unsupported DRAM Ch2 width\n"); - return -EINVAL; - } - - /* Set DDR size */ - switch (size_per_word) { - case SZ_64M: - tmp |= SG_MEMCONF_CH2_SZ_64M; - break; - case SZ_128M: - tmp |= SG_MEMCONF_CH2_SZ_128M; - break; - case SZ_256M: - tmp |= SG_MEMCONF_CH2_SZ_256M; - break; - case SZ_512M: - tmp |= SG_MEMCONF_CH2_SZ_512M; - break; - case SZ_1G: - tmp |= SG_MEMCONF_CH2_SZ_1G; - break; - default: - pr_err("error: unsupported DRAM Ch2 size\n"); - return -EINVAL; - } - - if (size_per_word) - tmp &= ~SG_MEMCONF_CH2_DISABLE; - else - tmp |= SG_MEMCONF_CH2_DISABLE; - - writel(tmp, SG_MEMCONF); - - return 0; -} diff --git a/arch/arm/mach-uniphier/memconf/memconf-sld3.c b/arch/arm/mach-uniphier/memconf/memconf-sld3.c deleted file mode 100644 index 948f82c..0000000 --- a/arch/arm/mach-uniphier/memconf/memconf-sld3.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2015 Masahiro Yamada - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include -#include -#include - -#include "../init.h" -#include "../sg-regs.h" - -int uniphier_sld3_memconf_init(const struct uniphier_board_data *bd) -{ - u32 tmp; - unsigned long size_per_word; - - tmp = readl(SG_MEMCONF); - - tmp &= ~(SG_MEMCONF_CH2_SZ_MASK | SG_MEMCONF_CH2_NUM_MASK); - - switch (bd->dram_ch[2].width) { - case 16: - tmp |= SG_MEMCONF_CH2_NUM_1; - size_per_word = bd->dram_ch[2].size; - break; - case 32: - tmp |= SG_MEMCONF_CH2_NUM_2; - size_per_word = bd->dram_ch[2].size >> 1; - break; - default: - pr_err("error: unsupported DRAM Ch2 width\n"); - return -EINVAL; - } - - /* Set DDR size */ - switch (size_per_word) { - case SZ_64M: - tmp |= SG_MEMCONF_CH2_SZ_64M; - break; - case SZ_128M: - tmp |= SG_MEMCONF_CH2_SZ_128M; - break; - case SZ_256M: - tmp |= SG_MEMCONF_CH2_SZ_256M; - break; - case SZ_512M: - tmp |= SG_MEMCONF_CH2_SZ_512M; - break; - default: - pr_err("error: unsupported DRAM Ch2 size\n"); - return -EINVAL; - } - - writel(tmp, SG_MEMCONF); - - return 0; -} diff --git a/arch/arm/mach-uniphier/memconf/memconf.c b/arch/arm/mach-uniphier/memconf/memconf.c deleted file mode 100644 index e607ac9..0000000 --- a/arch/arm/mach-uniphier/memconf/memconf.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (C) 2011-2015 Panasonic Corporation - * Copyright (C) 2016 Socionext Inc. - * Author: Masahiro Yamada - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include -#include -#include - -#include "../init.h" -#include "../sg-regs.h" - -int memconf_init(const struct uniphier_board_data *bd) -{ - u32 tmp; - unsigned long size_per_word; - - tmp = readl(SG_MEMCONF); - - tmp &= ~(SG_MEMCONF_CH0_SZ_MASK | SG_MEMCONF_CH0_NUM_MASK); - - switch (bd->dram_ch[0].width) { - case 16: - tmp |= SG_MEMCONF_CH0_NUM_1; - size_per_word = bd->dram_ch[0].size; - break; - case 32: - tmp |= SG_MEMCONF_CH0_NUM_2; - size_per_word = bd->dram_ch[0].size >> 1; - break; - default: - pr_err("error: unsupported DRAM Ch0 width\n"); - return -EINVAL; - } - - /* Set DDR size */ - switch (size_per_word) { - case SZ_64M: - tmp |= SG_MEMCONF_CH0_SZ_64M; - break; - case SZ_128M: - tmp |= SG_MEMCONF_CH0_SZ_128M; - break; - case SZ_256M: - tmp |= SG_MEMCONF_CH0_SZ_256M; - break; - case SZ_512M: - tmp |= SG_MEMCONF_CH0_SZ_512M; - break; - case SZ_1G: - tmp |= SG_MEMCONF_CH0_SZ_1G; - break; - default: - pr_err("error: unsupported DRAM Ch0 size\n"); - return -EINVAL; - } - - tmp &= ~(SG_MEMCONF_CH1_SZ_MASK | SG_MEMCONF_CH1_NUM_MASK); - - switch (bd->dram_ch[1].width) { - case 16: - tmp |= SG_MEMCONF_CH1_NUM_1; - size_per_word = bd->dram_ch[1].size; - break; - case 32: - tmp |= SG_MEMCONF_CH1_NUM_2; - size_per_word = bd->dram_ch[1].size >> 1; - break; - default: - pr_err("error: unsupported DRAM Ch1 width\n"); - return -EINVAL; - } - - switch (size_per_word) { - case SZ_64M: - tmp |= SG_MEMCONF_CH1_SZ_64M; - break; - case SZ_128M: - tmp |= SG_MEMCONF_CH1_SZ_128M; - break; - case SZ_256M: - tmp |= SG_MEMCONF_CH1_SZ_256M; - break; - case SZ_512M: - tmp |= SG_MEMCONF_CH1_SZ_512M; - break; - case SZ_1G: - tmp |= SG_MEMCONF_CH1_SZ_1G; - break; - default: - pr_err("error: unsupported DRAM Ch1 size\n"); - return -EINVAL; - } - - if (bd->dram_ch[0].base + bd->dram_ch[0].size < bd->dram_ch[1].base) - tmp |= SG_MEMCONF_SPARSEMEM; - else - tmp &= ~SG_MEMCONF_SPARSEMEM; - - writel(tmp, SG_MEMCONF); - - return 0; -} From patchwork Sun Jan 15 05:59:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 91516 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp888573qgi; Sat, 14 Jan 2017 22:00:14 -0800 (PST) X-Received: by 10.223.167.3 with SMTP id c3mr21149798wrd.103.1484460014078; Sat, 14 Jan 2017 22:00:14 -0800 (PST) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id w91si4736843wrb.163.2017.01.14.22.00.13; Sat, 14 Jan 2017 22:00:14 -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 92774B3864; Sun, 15 Jan 2017 07:00:06 +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 vRPueEaz61QH; Sun, 15 Jan 2017 07:00:06 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8B3FFB387F; Sun, 15 Jan 2017 06:59:58 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5F37AA75E6 for ; Sun, 15 Jan 2017 06:59:40 +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 JKQ7ZOMVnyCc for ; Sun, 15 Jan 2017 06:59:40 +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 36778A75F3 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 v0F5xD3i016694; Sun, 15 Jan 2017 14:59:19 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v0F5xD3i016694 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1484459959; bh=1LqHcWDH4EoMqf6nJ883HHjmqVthJWcYtUiWM1TID2k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lxelzFWy66KlgITlvK6RfofJU7AfyvT9jGDDeJB7TynY9iofzsfSw/TU2XMIau2qY pI+NQ8dMeYg3n2Qz6HZyD1aGkGmxA3VqcbmmRF6/j87FLjRHaAqSLeQPlygXdkWxmG YEnMiOpYG9SihYf4ktl0kB2o5gCumTiJ2b8m7u788htzY/efyBW13hR2PMChl1boCm WLk74NjxNzLrgQyEttZPIz7ANNrBmsby8N9DEa9i5DsvIdX+nSdGJJswoQnpl1Y13t teODvLXorPo+VcdJt5DXQbXSg+V/uK/73l148IlbB0OTeeHnctE2eMFRDEpCgvhA8Y dS+NuWHAjPRmg== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sun, 15 Jan 2017 14:59:05 +0900 Message-Id: <1484459950-8644-5-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 4/9] ARM: uniphier: refactor SBC 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" Merge sbc-admulti.c and sbc-savepin.c into a single file to avoid code duplication. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/init.h | 27 ++++++----- arch/arm/mach-uniphier/init/init-ld11.c | 6 +-- arch/arm/mach-uniphier/init/init-ld20.c | 6 +-- arch/arm/mach-uniphier/init/init-ld4.c | 3 +- arch/arm/mach-uniphier/init/init-pro4.c | 2 +- arch/arm/mach-uniphier/init/init-pro5.c | 2 +- arch/arm/mach-uniphier/init/init-pxs2.c | 3 +- arch/arm/mach-uniphier/init/init-sld3.c | 2 +- arch/arm/mach-uniphier/init/init-sld8.c | 3 +- arch/arm/mach-uniphier/sbc/Makefile | 17 ++++--- arch/arm/mach-uniphier/sbc/sbc-admulti.c | 53 ---------------------- arch/arm/mach-uniphier/sbc/sbc-ld11.c | 25 ++++++++++ arch/arm/mach-uniphier/sbc/sbc-ld4.c | 6 +-- arch/arm/mach-uniphier/sbc/sbc-pxs2.c | 6 +-- .../arm/mach-uniphier/sbc/{sbc-savepin.c => sbc.c} | 36 ++++++++++++--- 15 files changed, 89 insertions(+), 108 deletions(-) delete mode 100644 arch/arm/mach-uniphier/sbc/sbc-admulti.c create mode 100644 arch/arm/mach-uniphier/sbc/sbc-ld11.c rename arch/arm/mach-uniphier/sbc/{sbc-savepin.c => sbc.c} (58%) -- 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.h b/arch/arm/mach-uniphier/init.h index 0708aa0..78c2eee 100644 --- a/arch/arm/mach-uniphier/init.h +++ b/arch/arm/mach-uniphier/init.h @@ -46,31 +46,30 @@ int uniphier_ld11_init(const struct uniphier_board_data *bd); int uniphier_ld20_init(const struct uniphier_board_data *bd); #if defined(CONFIG_MICRO_SUPPORT_CARD) -int uniphier_sbc_init_admulti(const struct uniphier_board_data *bd); -int uniphier_sbc_init_savepin(const struct uniphier_board_data *bd); -int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd); -int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd); +void uniphier_sbc_init_admulti(void); +void uniphier_sbc_init_savepin(void); +void uniphier_ld4_sbc_init(void); +void uniphier_pxs2_sbc_init(void); +void uniphier_ld11_sbc_init(void); #else -static inline int uniphier_sbc_init_admulti( - const struct uniphier_board_data *bd) +static inline void uniphier_sbc_init_admulti(void) { - return 0; } -static inline int uniphier_sbc_init_savepin( - const struct uniphier_board_data *bd) +static inline void uniphier_sbc_init_savepin(void) { - return 0; } -static inline int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd) +static inline void uniphier_ld4_sbc_init(void) { - return 0; } -static inline int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd) +static inline void uniphier_pxs2_sbc_init(void) +{ +} + +static inline void uniphier_ld11_sbc_init(void) { - return 0; } #endif diff --git a/arch/arm/mach-uniphier/init/init-ld11.c b/arch/arm/mach-uniphier/init/init-ld11.c index 93b2162..64fe000 100644 --- a/arch/arm/mach-uniphier/init/init-ld11.c +++ b/arch/arm/mach-uniphier/init/init-ld11.c @@ -13,11 +13,7 @@ int uniphier_ld11_init(const struct uniphier_board_data *bd) { - uniphier_sbc_init_savepin(bd); - uniphier_pxs2_sbc_init(bd); - /* pins for NAND and System Bus are multiplexed */ - if (spl_boot_device() != BOOT_DEVICE_NAND) - uniphier_pin_init("system_bus_grp"); + uniphier_ld11_sbc_init(); support_card_reset(); diff --git a/arch/arm/mach-uniphier/init/init-ld20.c b/arch/arm/mach-uniphier/init/init-ld20.c index de39b9a..ec4563b 100644 --- a/arch/arm/mach-uniphier/init/init-ld20.c +++ b/arch/arm/mach-uniphier/init/init-ld20.c @@ -13,11 +13,7 @@ int uniphier_ld20_init(const struct uniphier_board_data *bd) { - uniphier_sbc_init_savepin(bd); - uniphier_pxs2_sbc_init(bd); - /* pins for NAND and System Bus are multiplexed */ - if (spl_boot_device() != BOOT_DEVICE_NAND) - uniphier_pin_init("system_bus_grp"); + uniphier_ld11_sbc_init(); support_card_reset(); diff --git a/arch/arm/mach-uniphier/init/init-ld4.c b/arch/arm/mach-uniphier/init/init-ld4.c index caf02a5..a56fb7f 100644 --- a/arch/arm/mach-uniphier/init/init-ld4.c +++ b/arch/arm/mach-uniphier/init/init-ld4.c @@ -16,8 +16,7 @@ int uniphier_ld4_init(const struct uniphier_board_data *bd) { uniphier_ld4_bcu_init(bd); - uniphier_sbc_init_savepin(bd); - uniphier_ld4_sbc_init(bd); + uniphier_ld4_sbc_init(); support_card_reset(); diff --git a/arch/arm/mach-uniphier/init/init-pro4.c b/arch/arm/mach-uniphier/init/init-pro4.c index 32d09bb..8e2ebc7 100644 --- a/arch/arm/mach-uniphier/init/init-pro4.c +++ b/arch/arm/mach-uniphier/init/init-pro4.c @@ -14,7 +14,7 @@ int uniphier_pro4_init(const struct uniphier_board_data *bd) { - uniphier_sbc_init_savepin(bd); + uniphier_sbc_init_savepin(); support_card_reset(); diff --git a/arch/arm/mach-uniphier/init/init-pro5.c b/arch/arm/mach-uniphier/init/init-pro5.c index 3fc09a4..37c62ef 100644 --- a/arch/arm/mach-uniphier/init/init-pro5.c +++ b/arch/arm/mach-uniphier/init/init-pro5.c @@ -12,7 +12,7 @@ int uniphier_pro5_init(const struct uniphier_board_data *bd) { - uniphier_sbc_init_savepin(bd); + uniphier_sbc_init_savepin(); support_card_reset(); diff --git a/arch/arm/mach-uniphier/init/init-pxs2.c b/arch/arm/mach-uniphier/init/init-pxs2.c index 38e37e4..d080b9b 100644 --- a/arch/arm/mach-uniphier/init/init-pxs2.c +++ b/arch/arm/mach-uniphier/init/init-pxs2.c @@ -14,8 +14,7 @@ int uniphier_pxs2_init(const struct uniphier_board_data *bd) { int ret; - uniphier_sbc_init_savepin(bd); - uniphier_pxs2_sbc_init(bd); + uniphier_pxs2_sbc_init(); support_card_reset(); diff --git a/arch/arm/mach-uniphier/init/init-sld3.c b/arch/arm/mach-uniphier/init/init-sld3.c index 9dc51bf..0b8d6c5 100644 --- a/arch/arm/mach-uniphier/init/init-sld3.c +++ b/arch/arm/mach-uniphier/init/init-sld3.c @@ -16,7 +16,7 @@ int uniphier_sld3_init(const struct uniphier_board_data *bd) { uniphier_sld3_bcu_init(bd); - uniphier_sbc_init_admulti(bd); + uniphier_sbc_init_admulti(); support_card_reset(); diff --git a/arch/arm/mach-uniphier/init/init-sld8.c b/arch/arm/mach-uniphier/init/init-sld8.c index 8e8d62b..075ac27 100644 --- a/arch/arm/mach-uniphier/init/init-sld8.c +++ b/arch/arm/mach-uniphier/init/init-sld8.c @@ -16,8 +16,7 @@ int uniphier_sld8_init(const struct uniphier_board_data *bd) { uniphier_ld4_bcu_init(bd); - uniphier_sbc_init_savepin(bd); - uniphier_ld4_sbc_init(bd); + uniphier_ld4_sbc_init(); support_card_reset(); diff --git a/arch/arm/mach-uniphier/sbc/Makefile b/arch/arm/mach-uniphier/sbc/Makefile index ec3c22c..b85b1fe 100644 --- a/arch/arm/mach-uniphier/sbc/Makefile +++ b/arch/arm/mach-uniphier/sbc/Makefile @@ -2,12 +2,11 @@ # SPDX-License-Identifier: GPL-2.0+ # -obj-$(CONFIG_ARCH_UNIPHIER_SLD3) += sbc-admulti.o -obj-$(CONFIG_ARCH_UNIPHIER_LD4) += sbc-savepin.o sbc-ld4.o -obj-$(CONFIG_ARCH_UNIPHIER_PRO4) += sbc-savepin.o -obj-$(CONFIG_ARCH_UNIPHIER_SLD8) += sbc-savepin.o sbc-ld4.o -obj-$(CONFIG_ARCH_UNIPHIER_PRO5) += sbc-savepin.o -obj-$(CONFIG_ARCH_UNIPHIER_PXS2) += sbc-savepin.o sbc-pxs2.o -obj-$(CONFIG_ARCH_UNIPHIER_LD6B) += sbc-savepin.o sbc-pxs2.o -obj-$(CONFIG_ARCH_UNIPHIER_LD11) += sbc-savepin.o sbc-pxs2.o -obj-$(CONFIG_ARCH_UNIPHIER_LD20) += sbc-savepin.o sbc-pxs2.o +obj-y += sbc.o + +obj-$(CONFIG_ARCH_UNIPHIER_LD4) += sbc-ld4.o +obj-$(CONFIG_ARCH_UNIPHIER_SLD8) += sbc-ld4.o +obj-$(CONFIG_ARCH_UNIPHIER_PXS2) += sbc-pxs2.o +obj-$(CONFIG_ARCH_UNIPHIER_LD6B) += sbc-pxs2.o +obj-$(CONFIG_ARCH_UNIPHIER_LD11) += sbc-ld11.o +obj-$(CONFIG_ARCH_UNIPHIER_LD20) += sbc-ld11.o diff --git a/arch/arm/mach-uniphier/sbc/sbc-admulti.c b/arch/arm/mach-uniphier/sbc/sbc-admulti.c deleted file mode 100644 index 05108dd..0000000 --- a/arch/arm/mach-uniphier/sbc/sbc-admulti.c +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2011-2015 Masahiro Yamada - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include - -#include "../init.h" -#include "../sg-regs.h" -#include "sbc-regs.h" - -#define SBCTRL0_ADMULTIPLX_PERI_VALUE 0x33120000 -#define SBCTRL1_ADMULTIPLX_PERI_VALUE 0x03005500 -#define SBCTRL2_ADMULTIPLX_PERI_VALUE 0x14000020 - -#define SBCTRL0_ADMULTIPLX_MEM_VALUE 0x33120000 -#define SBCTRL1_ADMULTIPLX_MEM_VALUE 0x03005500 -#define SBCTRL2_ADMULTIPLX_MEM_VALUE 0x14000010 - -int uniphier_sbc_init_admulti(const struct uniphier_board_data *bd) -{ - /* - * Only CS1 is connected to support card. - * BKSZ[1:0] should be set to "01". - */ - writel(SBCTRL0_ADMULTIPLX_MEM_VALUE, SBCTRL10); - writel(SBCTRL1_ADMULTIPLX_MEM_VALUE, SBCTRL11); - writel(SBCTRL2_ADMULTIPLX_MEM_VALUE, SBCTRL12); - - if (boot_is_swapped()) { - /* - * Boot Swap On: boot from external NOR/SRAM - * 0x42000000-0x43ffffff is a mirror of 0x40000000-0x41ffffff. - * - * 0x40000000-0x41efffff, 0x42000000-0x43efffff: memory bank - * 0x41f00000-0x41ffffff, 0x43f00000-0x43ffffff: peripherals - */ - writel(0x0000bc01, SBBASE0); - } else { - /* - * Boot Swap Off: boot from mask ROM - * 0x40000000-0x41ffffff: mask ROM - * 0x42000000-0x43efffff: memory bank (31MB) - * 0x43f00000-0x43ffffff: peripherals (1MB) - */ - writel(0x0000be01, SBBASE0); /* dummy */ - writel(0x0200be01, SBBASE1); - } - - return 0; -} diff --git a/arch/arm/mach-uniphier/sbc/sbc-ld11.c b/arch/arm/mach-uniphier/sbc/sbc-ld11.c new file mode 100644 index 0000000..41adc94 --- /dev/null +++ b/arch/arm/mach-uniphier/sbc/sbc-ld11.c @@ -0,0 +1,25 @@ +/* + * Copyright (C) 2015-2016 Masahiro Yamada + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include +#include + +#include "../init.h" +#include "sbc-regs.h" + +void uniphier_ld11_sbc_init(void) +{ + uniphier_sbc_init_savepin(); + + /* necessary for ROM boot ?? */ + /* system bus output enable */ + writel(0x17, PC0CTRL); + + /* pins for NAND and System Bus are multiplexed */ + if (spl_boot_device() != BOOT_DEVICE_NAND) + uniphier_pin_init("system_bus_grp"); +} diff --git a/arch/arm/mach-uniphier/sbc/sbc-ld4.c b/arch/arm/mach-uniphier/sbc/sbc-ld4.c index 12bee79..7520e2a 100644 --- a/arch/arm/mach-uniphier/sbc/sbc-ld4.c +++ b/arch/arm/mach-uniphier/sbc/sbc-ld4.c @@ -9,14 +9,14 @@ #include "../init.h" #include "sbc-regs.h" -int uniphier_ld4_sbc_init(const struct uniphier_board_data *bd) +void uniphier_ld4_sbc_init(void) { u32 tmp; + uniphier_sbc_init_savepin(); + /* system bus output enable */ tmp = readl(PC0CTRL); tmp &= 0xfffffcff; writel(tmp, PC0CTRL); - - return 0; } diff --git a/arch/arm/mach-uniphier/sbc/sbc-pxs2.c b/arch/arm/mach-uniphier/sbc/sbc-pxs2.c index acbf4c5..677a974 100644 --- a/arch/arm/mach-uniphier/sbc/sbc-pxs2.c +++ b/arch/arm/mach-uniphier/sbc/sbc-pxs2.c @@ -9,11 +9,11 @@ #include "../init.h" #include "sbc-regs.h" -int uniphier_pxs2_sbc_init(const struct uniphier_board_data *bd) +void uniphier_pxs2_sbc_init(void) { + uniphier_sbc_init_savepin(); + /* necessary for ROM boot ?? */ /* system bus output enable */ writel(0x17, PC0CTRL); - - return 0; } diff --git a/arch/arm/mach-uniphier/sbc/sbc-savepin.c b/arch/arm/mach-uniphier/sbc/sbc.c similarity index 58% rename from arch/arm/mach-uniphier/sbc/sbc-savepin.c rename to arch/arm/mach-uniphier/sbc/sbc.c index 41e9796..b43d933 100644 --- a/arch/arm/mach-uniphier/sbc/sbc-savepin.c +++ b/arch/arm/mach-uniphier/sbc/sbc.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2016 Masahiro Yamada + * Copyright (C) 2011-2015 Masahiro Yamada * * SPDX-License-Identifier: GPL-2.0+ */ @@ -9,6 +9,14 @@ #include "../init.h" #include "sbc-regs.h" +#define SBCTRL0_ADMULTIPLX_PERI_VALUE 0x33120000 +#define SBCTRL1_ADMULTIPLX_PERI_VALUE 0x03005500 +#define SBCTRL2_ADMULTIPLX_PERI_VALUE 0x14000020 + +#define SBCTRL0_ADMULTIPLX_MEM_VALUE 0x33120000 +#define SBCTRL1_ADMULTIPLX_MEM_VALUE 0x03005500 +#define SBCTRL2_ADMULTIPLX_MEM_VALUE 0x14000010 + /* slower but LED works */ #define SBCTRL0_SAVEPIN_PERI_VALUE 0x55450000 #define SBCTRL1_SAVEPIN_PERI_VALUE 0x07168d00 @@ -22,16 +30,22 @@ #define SBCTRL2_SAVEPIN_MEM_VALUE 0x34000009 #define SBCTRL4_SAVEPIN_MEM_VALUE 0x02110210 -int uniphier_sbc_init_savepin(const struct uniphier_board_data *bd) +static void __uniphier_sbc_init(int savepin) { /* * Only CS1 is connected to support card. * BKSZ[1:0] should be set to "01". */ - writel(SBCTRL0_SAVEPIN_PERI_VALUE, SBCTRL10); - writel(SBCTRL1_SAVEPIN_PERI_VALUE, SBCTRL11); - writel(SBCTRL2_SAVEPIN_PERI_VALUE, SBCTRL12); - writel(SBCTRL4_SAVEPIN_PERI_VALUE, SBCTRL14); + if (savepin) { + writel(SBCTRL0_SAVEPIN_PERI_VALUE, SBCTRL10); + writel(SBCTRL1_SAVEPIN_PERI_VALUE, SBCTRL11); + writel(SBCTRL2_SAVEPIN_PERI_VALUE, SBCTRL12); + writel(SBCTRL4_SAVEPIN_PERI_VALUE, SBCTRL14); + } else { + writel(SBCTRL0_ADMULTIPLX_MEM_VALUE, SBCTRL10); + writel(SBCTRL1_ADMULTIPLX_MEM_VALUE, SBCTRL11); + writel(SBCTRL2_ADMULTIPLX_MEM_VALUE, SBCTRL12); + } if (boot_is_swapped()) { /* @@ -52,6 +66,14 @@ int uniphier_sbc_init_savepin(const struct uniphier_board_data *bd) writel(0x0000be01, SBBASE0); /* dummy */ writel(0x0200be01, SBBASE1); } +} - return 0; +void uniphier_sbc_init_admulti(void) +{ + __uniphier_sbc_init(0); +} + +void uniphier_sbc_init_savepin(void) +{ + __uniphier_sbc_init(1); } 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) { } From patchwork Sun Jan 15 05:59:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 91518 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp888673qgi; Sat, 14 Jan 2017 22:00:39 -0800 (PST) X-Received: by 10.223.168.87 with SMTP id l81mr17803036wrc.194.1484460039347; Sat, 14 Jan 2017 22:00:39 -0800 (PST) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id r1si17094519wrc.146.2017.01.14.22.00.39; Sat, 14 Jan 2017 22:00:39 -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 6D757B391B; Sun, 15 Jan 2017 07:00:23 +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 ib3IXHb1Rgbq; Sun, 15 Jan 2017 07:00:23 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 46C3BA762D; Sun, 15 Jan 2017 07:00:03 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 84B84A75CC for ; Sun, 15 Jan 2017 06:59:40 +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 vWUQ-MMOILGn for ; Sun, 15 Jan 2017 06:59:40 +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 2CA67A75D5 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 v0F5xD3k016694; Sun, 15 Jan 2017 14:59:20 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v0F5xD3k016694 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1484459960; bh=ATMP+4Kux17XSA7YtwyQeanIIhMMPfQT3iLRq2J1pe0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qv/lbeXpdmLL05UgfEsUbgurAb+dVMGQBRGlqtnQfPACGfPQmj9SJKmZvxjkYvQYf vm9BDB5BF2NfLz3HCJMkRv29q5aseAC56zt6F+O3TDZ14arbgjAZ2ypEVx8dwry0w4 GZ0Z1I5fBhNBtGaPTmyC7CbWk4Gpizg3Yi7WHmmI9mEw7vnUxkjfijvU7ecvomUWPd zipcof5ag4Mx/4pvwkKMY+jgdHn9qlptxVsZZ0l/U2FZ+6e2kpsweyYi8YB7FM0sr9 oPjaGU/wyzh5eoCvbEFLY9L5+BNSyOWrWMH+ltHR8pJ20UbYbz1Kg1Bq45rcjBalrz Lh6CaervSIZaw== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sun, 15 Jan 2017 14:59:07 +0900 Message-Id: <1484459950-8644-7-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 6/9] ARM: uniphier: make BCU init into void function 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" These functions never fail, so no need to return a value. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/bcu/bcu-ld4.c | 4 +--- arch/arm/mach-uniphier/bcu/bcu-sld3.c | 4 +--- arch/arm/mach-uniphier/init.h | 4 ++-- 3 files changed, 4 insertions(+), 8 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/bcu/bcu-ld4.c b/arch/arm/mach-uniphier/bcu/bcu-ld4.c index eeab802..ca70480 100644 --- a/arch/arm/mach-uniphier/bcu/bcu-ld4.c +++ b/arch/arm/mach-uniphier/bcu/bcu-ld4.c @@ -11,7 +11,7 @@ #define ch(x) ((x) >= 32 ? 0 : (x) < 0 ? 0x11111111 : 0x11111111 << (x)) -int uniphier_ld4_bcu_init(const struct uniphier_board_data *bd) +void uniphier_ld4_bcu_init(const struct uniphier_board_data *bd) { int shift; @@ -30,6 +30,4 @@ int uniphier_ld4_bcu_init(const struct uniphier_board_data *bd) shift -= 32; writel(ch(shift), BCIPPCCHR4); /* 0xc0000000-0xdfffffff */ - - return 0; } diff --git a/arch/arm/mach-uniphier/bcu/bcu-sld3.c b/arch/arm/mach-uniphier/bcu/bcu-sld3.c index 493e6d5..4e92076 100644 --- a/arch/arm/mach-uniphier/bcu/bcu-sld3.c +++ b/arch/arm/mach-uniphier/bcu/bcu-sld3.c @@ -11,7 +11,7 @@ #define ch(x) ((x) >= 32 ? 0 : (x) < 0 ? 0x11111111 : 0x11111111 << (x)) -int uniphier_sld3_bcu_init(const struct uniphier_board_data *bd) +void uniphier_sld3_bcu_init(const struct uniphier_board_data *bd) { int shift; @@ -34,6 +34,4 @@ int uniphier_sld3_bcu_init(const struct uniphier_board_data *bd) shift -= 32; writel(ch(shift), BCIPPCCHR4); /* 0xc0000000-0xdfffffff */ - - return 0; } diff --git a/arch/arm/mach-uniphier/init.h b/arch/arm/mach-uniphier/init.h index 78c2eee..18393e5 100644 --- a/arch/arm/mach-uniphier/init.h +++ b/arch/arm/mach-uniphier/init.h @@ -73,8 +73,8 @@ static inline void uniphier_ld11_sbc_init(void) } #endif -int uniphier_sld3_bcu_init(const struct uniphier_board_data *bd); -int uniphier_ld4_bcu_init(const struct uniphier_board_data *bd); +void uniphier_sld3_bcu_init(const struct uniphier_board_data *bd); +void uniphier_ld4_bcu_init(const struct uniphier_board_data *bd); int uniphier_memconf_2ch_init(const struct uniphier_board_data *bd); int uniphier_memconf_3ch_no_disbit_init(const struct uniphier_board_data *bd); From patchwork Sun Jan 15 05:59:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 91517 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp888618qgi; Sat, 14 Jan 2017 22:00:27 -0800 (PST) X-Received: by 10.223.136.206 with SMTP id g14mr17863293wrg.52.1484460027064; Sat, 14 Jan 2017 22:00:27 -0800 (PST) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id a19si7980352wmd.119.2017.01.14.22.00.26; Sat, 14 Jan 2017 22:00:27 -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 C27E5B38E4; Sun, 15 Jan 2017 07:00:13 +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 FvMm1Nwk1wjh; Sun, 15 Jan 2017 07:00:13 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 12B91A760B; Sun, 15 Jan 2017 07:00:01 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 41219A75C2 for ; Sun, 15 Jan 2017 06:59:40 +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 nXYkQsAtFZ66 for ; Sun, 15 Jan 2017 06:59:40 +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 272E8A75CC 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 v0F5xD3l016694; Sun, 15 Jan 2017 14:59:20 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v0F5xD3l016694 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1484459960; bh=bd893VKJzyn3TIS/OHAw2tyhO93jx/Vp3SLFCRDZg28=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y9OjdAKZOedmohG6qJ6p/2Fswx3Y+83raJkcxJWRECLxYDH2bNqRBsIYGW6190BmA qJukRE9DvdTSkjP8E09b9eGR1TumrA0FcYYmSmN/CbfCy4W5HSmwA1NVnVpGmeK+WV JASdcikvTqWwo+jVvBK9llIxFu8jqrCPUS2KzK/+svWfERXoALOHXrA8L+U41AJFIR qrH7P8aUiZk9n9G1tgK0rOw98SIJiS47e/KlVkGmGjkRbQoCBOj2+UnSn3MfZRkLRO GEDCO28n4HZdq/sVfcFNI5OiGzjbJgPOu3iowFvHj6besH/PPaCT00Ob2E2rexkjj/ RkOgpkKsJV5rQ== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sun, 15 Jan 2017 14:59:08 +0900 Message-Id: <1484459950-8644-8-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 7/9] ARM: uniphier: refactor board_init() 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" The code here is cluttered due to the switch statement. Introduce a table of callbacks to clean up the initialization code across SoCs. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/board_init.c | 219 +++++++++++++++++++++++------------- 1 file changed, 140 insertions(+), 79 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/board_init.c b/arch/arm/mach-uniphier/board_init.c index 4cab7fe..77f1fb0 100644 --- a/arch/arm/mach-uniphier/board_init.c +++ b/arch/arm/mach-uniphier/board_init.c @@ -48,116 +48,177 @@ static void uniphier_setup_xirq(void) writel(tmp, 0x55000090); } -static void uniphier_nand_pin_init(bool cs2) +#ifdef CONFIG_ARCH_UNIPHIER_LD11 +static void uniphier_ld11_misc_init(void) { -#ifdef CONFIG_NAND_DENALI - if (uniphier_pin_init(cs2 ? "nand2cs_grp" : "nand_grp")) - pr_err("failed to init NAND pins\n"); -#endif + sg_set_pinsel(149, 14, 8, 4); /* XIRQ0 -> XIRQ0 */ + sg_set_iectrl(149); + sg_set_pinsel(153, 14, 8, 4); /* XIRQ4 -> XIRQ4 */ + sg_set_iectrl(153); } +#endif -int board_init(void) +#ifdef CONFIG_ARCH_UNIPHIER_LD20 +static void uniphier_ld20_misc_init(void) { - led_puts("U0"); + sg_set_pinsel(149, 14, 8, 4); /* XIRQ0 -> XIRQ0 */ + sg_set_iectrl(149); + sg_set_pinsel(153, 14, 8, 4); /* XIRQ4 -> XIRQ4 */ + sg_set_iectrl(153); + + /* ES1 errata: increase VDD09 supply to suppress VBO noise */ + if (uniphier_get_soc_revision() == 1) { + writel(0x00000003, 0x6184e004); + writel(0x00000100, 0x6184e040); + writel(0x0000b500, 0x6184e024); + writel(0x00000001, 0x6184e000); + } + + cci500_init(2); +} +#endif + +struct uniphier_initdata { + enum uniphier_soc_id soc_id; + bool nand_2cs; + void (*pll_init)(void); + void (*clk_init)(void); + void (*misc_init)(void); +}; - switch (uniphier_get_soc_type()) { +struct uniphier_initdata uniphier_initdata[] = { #if defined(CONFIG_ARCH_UNIPHIER_SLD3) - case SOC_UNIPHIER_SLD3: - uniphier_nand_pin_init(true); - led_puts("U1"); - uniphier_sld3_pll_init(); - uniphier_ld4_clk_init(); - break; + { + .soc_id = SOC_UNIPHIER_SLD3, + .nand_2cs = true, + .pll_init = uniphier_sld3_pll_init, + .clk_init = uniphier_ld4_clk_init, + }, #endif #if defined(CONFIG_ARCH_UNIPHIER_LD4) - case SOC_UNIPHIER_LD4: - uniphier_nand_pin_init(true); - led_puts("U1"); - uniphier_ld4_pll_init(); - uniphier_ld4_clk_init(); - break; + { + .soc_id = SOC_UNIPHIER_LD4, + .nand_2cs = true, + .pll_init = uniphier_ld4_pll_init, + .clk_init = uniphier_ld4_clk_init, + }, #endif #if defined(CONFIG_ARCH_UNIPHIER_PRO4) - case SOC_UNIPHIER_PRO4: - uniphier_nand_pin_init(false); - led_puts("U1"); - uniphier_pro4_pll_init(); - uniphier_pro4_clk_init(); - break; + { + .soc_id = SOC_UNIPHIER_PRO4, + .nand_2cs = false, + .pll_init = uniphier_pro4_pll_init, + .clk_init = uniphier_pro4_clk_init, + }, #endif #if defined(CONFIG_ARCH_UNIPHIER_SLD8) - case SOC_UNIPHIER_SLD8: - uniphier_nand_pin_init(true); - led_puts("U1"); - uniphier_ld4_pll_init(); - uniphier_ld4_clk_init(); - break; + { + .soc_id = SOC_UNIPHIER_SLD8, + .nand_2cs = true, + .pll_init = uniphier_ld4_pll_init, + .clk_init = uniphier_ld4_clk_init, + }, #endif #if defined(CONFIG_ARCH_UNIPHIER_PRO5) - case SOC_UNIPHIER_PRO5: - uniphier_nand_pin_init(true); - led_puts("U1"); - uniphier_pro5_clk_init(); - break; + { + .soc_id = SOC_UNIPHIER_PRO5, + .nand_2cs = true, + .clk_init = uniphier_pro5_clk_init, + }, #endif #if defined(CONFIG_ARCH_UNIPHIER_PXS2) - case SOC_UNIPHIER_PXS2: - uniphier_nand_pin_init(true); - led_puts("U1"); - uniphier_pxs2_clk_init(); - break; + { + .soc_id = SOC_UNIPHIER_PXS2, + .nand_2cs = true, + .clk_init = uniphier_pxs2_clk_init, + }, #endif #if defined(CONFIG_ARCH_UNIPHIER_LD6B) - case SOC_UNIPHIER_LD6B: - uniphier_nand_pin_init(true); - led_puts("U1"); - uniphier_pxs2_clk_init(); - break; + { + .soc_id = SOC_UNIPHIER_LD6B, + .nand_2cs = true, + .clk_init = uniphier_pxs2_clk_init, + }, #endif #if defined(CONFIG_ARCH_UNIPHIER_LD11) - case SOC_UNIPHIER_LD11: - uniphier_nand_pin_init(false); - sg_set_pinsel(149, 14, 8, 4); /* XIRQ0 -> XIRQ0 */ - sg_set_iectrl(149); - sg_set_pinsel(153, 14, 8, 4); /* XIRQ4 -> XIRQ4 */ - sg_set_iectrl(153); - led_puts("U1"); - uniphier_ld11_pll_init(); - uniphier_ld11_clk_init(); - break; + { + .soc_id = SOC_UNIPHIER_LD11, + .nand_2cs = false, + .pll_init = uniphier_ld11_pll_init, + .clk_init = uniphier_ld11_clk_init, + .misc_init = uniphier_ld11_misc_init, + }, #endif #if defined(CONFIG_ARCH_UNIPHIER_LD20) - case SOC_UNIPHIER_LD20: - /* ES1 errata: increase VDD09 supply to suppress VBO noise */ - if (uniphier_get_soc_revision() == 1) { - writel(0x00000003, 0x6184e004); - writel(0x00000100, 0x6184e040); - writel(0x0000b500, 0x6184e024); - writel(0x00000001, 0x6184e000); - } - uniphier_nand_pin_init(false); - sg_set_pinsel(149, 14, 8, 4); /* XIRQ0 -> XIRQ0 */ - sg_set_iectrl(149); - sg_set_pinsel(153, 14, 8, 4); /* XIRQ4 -> XIRQ4 */ - sg_set_iectrl(153); - led_puts("U1"); - uniphier_ld20_pll_init(); - uniphier_ld20_clk_init(); - cci500_init(2); - break; + { + .soc_id = SOC_UNIPHIER_LD20, + .nand_2cs = false, + .pll_init = uniphier_ld20_pll_init, + .clk_init = uniphier_ld20_clk_init, + .misc_init = uniphier_ld20_misc_init, + }, #endif - default: - break; +}; + +static struct uniphier_initdata *uniphier_get_initdata( + enum uniphier_soc_id soc_id) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(uniphier_initdata); i++) { + if (uniphier_initdata[i].soc_id == soc_id) + return &uniphier_initdata[i]; } - uniphier_setup_xirq(); + return NULL; +} + +int board_init(void) +{ + struct uniphier_initdata *initdata; + enum uniphier_soc_id soc_id; + int ret; + + led_puts("U0"); + + soc_id = uniphier_get_soc_type(); + initdata = uniphier_get_initdata(soc_id); + if (!initdata) { + pr_err("unsupported board\n"); + return -EINVAL; + } + + if (IS_ENABLED(CONFIG_NAND_DENALI)) { + ret = uniphier_pin_init(initdata->nand_2cs ? + "nand2cs_grp" : "nand_grp"); + if (ret) + pr_err("failed to init NAND pins\n"); + } + + led_puts("U1"); + + if (initdata->pll_init) + initdata->pll_init(); led_puts("U2"); - support_card_late_init(); + initdata->clk_init(); led_puts("U3"); + if (initdata->misc_init) + initdata->misc_init(); + + led_puts("U4"); + + uniphier_setup_xirq(); + + led_puts("U5"); + + support_card_late_init(); + + led_puts("U6"); + #ifdef CONFIG_ARM64 uniphier_smp_kick_all_cpus(); #endif From patchwork Sun Jan 15 05:59:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 91519 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp888730qgi; Sat, 14 Jan 2017 22:00:51 -0800 (PST) X-Received: by 10.28.103.3 with SMTP id b3mr7356628wmc.24.1484460051755; Sat, 14 Jan 2017 22:00:51 -0800 (PST) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id p198si8016498wme.14.2017.01.14.22.00.51; Sat, 14 Jan 2017 22:00:51 -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 D3D37B3877; Sun, 15 Jan 2017 07:00:37 +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 npzB1OLy9X6k; Sun, 15 Jan 2017 07:00:37 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 25D22B38BF; Sun, 15 Jan 2017 07:00:06 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 10A7BA75D2 for ; Sun, 15 Jan 2017 06:59:41 +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 r7K7O729mvDe for ; Sun, 15 Jan 2017 06:59:40 +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 38E9CA75F9 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 v0F5xD3m016694; Sun, 15 Jan 2017 14:59:21 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v0F5xD3m016694 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1484459961; bh=LUxkRhD/VjukrwkkcVCBdPjN9YOQe3UAjxE2V0L84tE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y0KmLA3jdrit8h0RsSiKNGMxV4qsK6TdqzxVWax00JT9oIzY0btSDPOQWpXvd5k4k ++cXYrHI0j0sVTWaoMRPUjbz03hVIywUXUNTRubYU1jigaONclQC2Y0dTdyh7WaQ/+ fr8yKzD45vLiyXeprLNJS50RzNIZhzN1gtcoquLePoevec3ZRsqU8fh5otzspk8Jit /t7mAOKYqiXN7dmd78ld0PsLbQKmNFguRWIOSFYEEjO885pA+gNMVoCM5MRkshwiSO TjP4r4D2b+OSQQ9qdfQSu/LrA7VCr0DgmQ73Q+mMi0iEI7Npsp1TRhoBSjGh5mPQIP 6jHB+Gi03SFrQ== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sun, 15 Jan 2017 14:59:09 +0900 Message-Id: <1484459950-8644-9-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 8/9] ARM: uniphier: refactor spl_init_board() 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" Merge init-*.c into a single file using a table of callbacks because the initialization flow is almost common among SoCs. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/Makefile | 3 +- arch/arm/mach-uniphier/clk/Makefile | 6 +- arch/arm/mach-uniphier/clk/dpll-pro5.c | 6 + arch/arm/mach-uniphier/clk/dpll-pxs2.c | 6 + arch/arm/mach-uniphier/dram/Makefile | 2 + arch/arm/mach-uniphier/dram/umc-pro5.c | 12 ++ arch/arm/mach-uniphier/dram/umc-sld3.c | 6 + arch/arm/mach-uniphier/init.h | 4 + arch/arm/mach-uniphier/init/Makefile | 15 --- arch/arm/mach-uniphier/init/init-ld11.c | 58 --------- arch/arm/mach-uniphier/init/init-ld20.c | 56 --------- arch/arm/mach-uniphier/init/init-ld4.c | 57 --------- arch/arm/mach-uniphier/init/init-pro4.c | 55 --------- arch/arm/mach-uniphier/init/init-pro5.c | 41 ------- arch/arm/mach-uniphier/init/init-pxs2.c | 47 ------- arch/arm/mach-uniphier/init/init-sld3.c | 47 ------- arch/arm/mach-uniphier/init/init-sld8.c | 57 --------- arch/arm/mach-uniphier/init/init.c | 71 ----------- arch/arm/mach-uniphier/spl_board_init.c | 209 ++++++++++++++++++++++++++++++++ 19 files changed, 250 insertions(+), 508 deletions(-) create mode 100644 arch/arm/mach-uniphier/clk/dpll-pro5.c create mode 100644 arch/arm/mach-uniphier/clk/dpll-pxs2.c create mode 100644 arch/arm/mach-uniphier/dram/umc-pro5.c create mode 100644 arch/arm/mach-uniphier/dram/umc-sld3.c delete mode 100644 arch/arm/mach-uniphier/init/Makefile delete mode 100644 arch/arm/mach-uniphier/init/init-ld11.c delete mode 100644 arch/arm/mach-uniphier/init/init-ld20.c delete mode 100644 arch/arm/mach-uniphier/init/init-ld4.c delete mode 100644 arch/arm/mach-uniphier/init/init-pro4.c delete mode 100644 arch/arm/mach-uniphier/init/init-pro5.c delete mode 100644 arch/arm/mach-uniphier/init/init-pxs2.c delete mode 100644 arch/arm/mach-uniphier/init/init-sld3.c delete mode 100644 arch/arm/mach-uniphier/init/init-sld8.c delete mode 100644 arch/arm/mach-uniphier/init/init.c create mode 100644 arch/arm/mach-uniphier/spl_board_init.c -- 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/Makefile b/arch/arm/mach-uniphier/Makefile index 98b42a0..7f1abd0 100644 --- a/arch/arm/mach-uniphier/Makefile +++ b/arch/arm/mach-uniphier/Makefile @@ -4,8 +4,9 @@ ifdef CONFIG_SPL_BUILD +obj-y += spl_board_init.o obj-y += memconf.o -obj-y += init/ bcu/ +obj-y += bcu/ obj-$(CONFIG_MICRO_SUPPORT_CARD) += sbc/ else diff --git a/arch/arm/mach-uniphier/clk/Makefile b/arch/arm/mach-uniphier/clk/Makefile index 765660f..eff8383 100644 --- a/arch/arm/mach-uniphier/clk/Makefile +++ b/arch/arm/mach-uniphier/clk/Makefile @@ -8,9 +8,9 @@ obj-$(CONFIG_ARCH_UNIPHIER_SLD3) += clk-early-sld3.o clk-dram-sld3.o dpll-sld3.o obj-$(CONFIG_ARCH_UNIPHIER_LD4) += clk-early-sld3.o clk-dram-sld3.o dpll-ld4.o obj-$(CONFIG_ARCH_UNIPHIER_PRO4) += clk-early-sld3.o clk-dram-sld3.o dpll-pro4.o obj-$(CONFIG_ARCH_UNIPHIER_SLD8) += clk-early-sld3.o clk-dram-sld3.o dpll-sld8.o -obj-$(CONFIG_ARCH_UNIPHIER_PRO5) += clk-early-sld3.o clk-dram-pro5.o -obj-$(CONFIG_ARCH_UNIPHIER_PXS2) += clk-early-sld3.o clk-dram-pxs2.o -obj-$(CONFIG_ARCH_UNIPHIER_LD6B) += clk-early-sld3.o clk-dram-pxs2.o +obj-$(CONFIG_ARCH_UNIPHIER_PRO5) += clk-early-sld3.o clk-dram-pro5.o dpll-pro5.o +obj-$(CONFIG_ARCH_UNIPHIER_PXS2) += clk-early-sld3.o clk-dram-pxs2.o dpll-pxs2.o +obj-$(CONFIG_ARCH_UNIPHIER_LD6B) += clk-early-sld3.o clk-dram-pxs2.o dpll-pxs2.o obj-$(CONFIG_ARCH_UNIPHIER_LD11) += clk-early-ld11.o clk-dram-ld11.o dpll-ld11.o obj-$(CONFIG_ARCH_UNIPHIER_LD20) += clk-early-ld11.o clk-dram-ld20.o dpll-ld20.o diff --git a/arch/arm/mach-uniphier/clk/dpll-pro5.c b/arch/arm/mach-uniphier/clk/dpll-pro5.c new file mode 100644 index 0000000..d3a42c7 --- /dev/null +++ b/arch/arm/mach-uniphier/clk/dpll-pro5.c @@ -0,0 +1,6 @@ +#include "../init.h" + +int uniphier_pro5_dpll_init(const struct uniphier_board_data *bd) +{ + return 0; +} diff --git a/arch/arm/mach-uniphier/clk/dpll-pxs2.c b/arch/arm/mach-uniphier/clk/dpll-pxs2.c new file mode 100644 index 0000000..328ebf6 --- /dev/null +++ b/arch/arm/mach-uniphier/clk/dpll-pxs2.c @@ -0,0 +1,6 @@ +#include "../init.h" + +int uniphier_pxs2_dpll_init(const struct uniphier_board_data *bd) +{ + return 0; +} diff --git a/arch/arm/mach-uniphier/dram/Makefile b/arch/arm/mach-uniphier/dram/Makefile index 5b9d892..2ce6199 100644 --- a/arch/arm/mach-uniphier/dram/Makefile +++ b/arch/arm/mach-uniphier/dram/Makefile @@ -4,12 +4,14 @@ ifdef CONFIG_SPL_BUILD +obj-$(CONFIG_ARCH_UNIPHIER_SLD3) += umc-sld3.o obj-$(CONFIG_ARCH_UNIPHIER_LD4) += umc-ld4.o \ ddrphy-training.o ddrphy-ld4.o obj-$(CONFIG_ARCH_UNIPHIER_PRO4) += umc-pro4.o \ ddrphy-training.o ddrphy-ld4.o obj-$(CONFIG_ARCH_UNIPHIER_SLD8) += umc-sld8.o \ ddrphy-training.o ddrphy-ld4.o +obj-$(CONFIG_ARCH_UNIPHIER_PRO5) += umc-pro5.o obj-$(CONFIG_ARCH_UNIPHIER_PXS2) += umc-pxs2.o obj-$(CONFIG_ARCH_UNIPHIER_LD6B) += umc-pxs2.o obj-$(CONFIG_ARCH_UNIPHIER_LD11) += umc-ld11.o diff --git a/arch/arm/mach-uniphier/dram/umc-pro5.c b/arch/arm/mach-uniphier/dram/umc-pro5.c new file mode 100644 index 0000000..4f34d1f --- /dev/null +++ b/arch/arm/mach-uniphier/dram/umc-pro5.c @@ -0,0 +1,12 @@ +/* + * Copyright (C) 2016 Socionext Inc. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include "../init.h" + +int uniphier_pro5_umc_init(const struct uniphier_board_data *bd) +{ + return 0; +} diff --git a/arch/arm/mach-uniphier/dram/umc-sld3.c b/arch/arm/mach-uniphier/dram/umc-sld3.c new file mode 100644 index 0000000..99249eb --- /dev/null +++ b/arch/arm/mach-uniphier/dram/umc-sld3.c @@ -0,0 +1,6 @@ +#include "../init.h" + +int uniphier_sld3_umc_init(const struct uniphier_board_data *bd) +{ + return 0; +} diff --git a/arch/arm/mach-uniphier/init.h b/arch/arm/mach-uniphier/init.h index 18393e5..2f9dc39 100644 --- a/arch/arm/mach-uniphier/init.h +++ b/arch/arm/mach-uniphier/init.h @@ -84,6 +84,8 @@ int uniphier_sld3_dpll_init(const struct uniphier_board_data *bd); int uniphier_ld4_dpll_init(const struct uniphier_board_data *bd); int uniphier_pro4_dpll_init(const struct uniphier_board_data *bd); int uniphier_sld8_dpll_init(const struct uniphier_board_data *bd); +int uniphier_pro5_dpll_init(const struct uniphier_board_data *bd); +int uniphier_pxs2_dpll_init(const struct uniphier_board_data *bd); int uniphier_ld11_dpll_init(const struct uniphier_board_data *bd); int uniphier_ld20_dpll_init(const struct uniphier_board_data *bd); @@ -96,9 +98,11 @@ void uniphier_pxs2_dram_clk_init(void); void uniphier_ld11_dram_clk_init(void); void uniphier_ld20_dram_clk_init(void); +int uniphier_sld3_umc_init(const struct uniphier_board_data *bd); int uniphier_ld4_umc_init(const struct uniphier_board_data *bd); int uniphier_pro4_umc_init(const struct uniphier_board_data *bd); int uniphier_sld8_umc_init(const struct uniphier_board_data *bd); +int uniphier_pro5_umc_init(const struct uniphier_board_data *bd); int uniphier_pxs2_umc_init(const struct uniphier_board_data *bd); int uniphier_ld20_umc_init(const struct uniphier_board_data *bd); int uniphier_ld11_umc_init(const struct uniphier_board_data *bd); diff --git a/arch/arm/mach-uniphier/init/Makefile b/arch/arm/mach-uniphier/init/Makefile deleted file mode 100644 index dcaa445..0000000 --- a/arch/arm/mach-uniphier/init/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# -# SPDX-License-Identifier: GPL-2.0+ -# - -obj-y += init.o - -obj-$(CONFIG_ARCH_UNIPHIER_SLD3) += init-sld3.o -obj-$(CONFIG_ARCH_UNIPHIER_LD4) += init-ld4.o -obj-$(CONFIG_ARCH_UNIPHIER_PRO4) += init-pro4.o -obj-$(CONFIG_ARCH_UNIPHIER_SLD8) += init-sld8.o -obj-$(CONFIG_ARCH_UNIPHIER_PRO5) += init-pro5.o -obj-$(CONFIG_ARCH_UNIPHIER_PXS2) += init-pxs2.o -obj-$(CONFIG_ARCH_UNIPHIER_LD6B) += init-pxs2.o -obj-$(CONFIG_ARCH_UNIPHIER_LD11) += init-ld11.o -obj-$(CONFIG_ARCH_UNIPHIER_LD20) += init-ld20.o diff --git a/arch/arm/mach-uniphier/init/init-ld11.c b/arch/arm/mach-uniphier/init/init-ld11.c deleted file mode 100644 index e19dc5b..0000000 --- a/arch/arm/mach-uniphier/init/init-ld11.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2016 Socionext Inc. - * Author: Masahiro Yamada - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include - -#include "../init.h" -#include "../micro-support-card.h" - -int uniphier_ld11_init(const struct uniphier_board_data *bd) -{ - uniphier_ld11_sbc_init(); - - support_card_init(); - - led_puts("L0"); - - uniphier_memconf_2ch_init(bd); - - led_puts("L1"); - - uniphier_ld11_early_clk_init(); - uniphier_ld11_dram_clk_init(); - - led_puts("L2"); - -#ifdef CONFIG_SPL_SERIAL_SUPPORT - preloader_console_init(); -#endif - - led_puts("L3"); - - uniphier_ld11_dpll_init(bd); - - led_puts("L4"); - - { - int res; - - res = uniphier_ld11_umc_init(bd); - if (res < 0) { - while (1) - ; - } - } - - led_puts("L5"); - - dcache_disable(); - - led_puts("L6"); - - return 0; -} diff --git a/arch/arm/mach-uniphier/init/init-ld20.c b/arch/arm/mach-uniphier/init/init-ld20.c deleted file mode 100644 index e056d5d..0000000 --- a/arch/arm/mach-uniphier/init/init-ld20.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (C) 2016 Socionext Inc. - * Author: Masahiro Yamada - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include - -#include "../init.h" -#include "../micro-support-card.h" - -int uniphier_ld20_init(const struct uniphier_board_data *bd) -{ - uniphier_ld11_sbc_init(); - - support_card_init(); - - led_puts("L0"); - - uniphier_memconf_3ch_init(bd); - - led_puts("L1"); - - uniphier_ld11_early_clk_init(); - uniphier_ld20_dram_clk_init(); - - led_puts("L2"); - -#ifdef CONFIG_SPL_SERIAL_SUPPORT - preloader_console_init(); -#endif - - led_puts("L3"); - - uniphier_ld20_dpll_init(bd); - - led_puts("L4"); - - { - int res; - - res = uniphier_ld20_umc_init(bd); - if (res < 0) { - while (1) - ; - } - } - - led_puts("L5"); - - dcache_disable(); - - return 0; -} diff --git a/arch/arm/mach-uniphier/init/init-ld4.c b/arch/arm/mach-uniphier/init/init-ld4.c deleted file mode 100644 index a5b9493..0000000 --- a/arch/arm/mach-uniphier/init/init-ld4.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2013-2015 Panasonic Corporation - * Copyright (C) 2015-2016 Socionext Inc. - * Author: Masahiro Yamada - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include - -#include "../init.h" -#include "../micro-support-card.h" - -int uniphier_ld4_init(const struct uniphier_board_data *bd) -{ - uniphier_ld4_bcu_init(bd); - - uniphier_ld4_sbc_init(); - - support_card_init(); - - uniphier_ld4_dpll_init(bd); - - led_puts("L0"); - - uniphier_memconf_2ch_init(bd); - - led_puts("L1"); - - uniphier_sld3_early_clk_init(); - uniphier_sld3_dram_clk_init(); - - led_puts("L2"); - - led_puts("L3"); - -#ifdef CONFIG_SPL_SERIAL_SUPPORT - preloader_console_init(); -#endif - - led_puts("L4"); - - { - int res; - - res = uniphier_ld4_umc_init(bd); - if (res < 0) { - while (1) - ; - } - } - - led_puts("L5"); - - return 0; -} diff --git a/arch/arm/mach-uniphier/init/init-pro4.c b/arch/arm/mach-uniphier/init/init-pro4.c deleted file mode 100644 index c277071..0000000 --- a/arch/arm/mach-uniphier/init/init-pro4.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2013-2015 Panasonic Corporation - * Copyright (C) 2015-2016 Socionext Inc. - * Author: Masahiro Yamada - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include - -#include "../init.h" -#include "../micro-support-card.h" - -int uniphier_pro4_init(const struct uniphier_board_data *bd) -{ - uniphier_sbc_init_savepin(); - - support_card_init(); - - uniphier_pro4_dpll_init(bd); - - led_puts("L0"); - - uniphier_memconf_2ch_init(bd); - - led_puts("L1"); - - uniphier_sld3_early_clk_init(); - uniphier_sld3_dram_clk_init(); - - led_puts("L2"); - - led_puts("L3"); - -#ifdef CONFIG_SPL_SERIAL_SUPPORT - preloader_console_init(); -#endif - - led_puts("L4"); - - { - int res; - - res = uniphier_pro4_umc_init(bd); - if (res < 0) { - while (1) - ; - } - } - - led_puts("L5"); - - return 0; -} diff --git a/arch/arm/mach-uniphier/init/init-pro5.c b/arch/arm/mach-uniphier/init/init-pro5.c deleted file mode 100644 index 4e7041b..0000000 --- a/arch/arm/mach-uniphier/init/init-pro5.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2015 Masahiro Yamada - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include - -#include "../init.h" -#include "../micro-support-card.h" - -int uniphier_pro5_init(const struct uniphier_board_data *bd) -{ - uniphier_sbc_init_savepin(); - - support_card_init(); - - led_puts("L0"); - - uniphier_memconf_2ch_init(bd); - - led_puts("L1"); - - uniphier_sld3_early_clk_init(); - uniphier_pro5_dram_clk_init(); - - led_puts("L2"); - - led_puts("L3"); - -#ifdef CONFIG_SPL_SERIAL_SUPPORT - preloader_console_init(); -#endif - - led_puts("L4"); - - led_puts("L5"); - - return 0; -} diff --git a/arch/arm/mach-uniphier/init/init-pxs2.c b/arch/arm/mach-uniphier/init/init-pxs2.c deleted file mode 100644 index f7d5b48..0000000 --- a/arch/arm/mach-uniphier/init/init-pxs2.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2015 Masahiro Yamada - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include - -#include "../init.h" -#include "../micro-support-card.h" - -int uniphier_pxs2_init(const struct uniphier_board_data *bd) -{ - int ret; - - uniphier_pxs2_sbc_init(); - - support_card_init(); - - led_puts("L0"); - - uniphier_memconf_3ch_init(bd); - - led_puts("L1"); - - uniphier_sld3_early_clk_init(); - uniphier_pxs2_dram_clk_init(); - - led_puts("L2"); - - led_puts("L3"); - -#ifdef CONFIG_SPL_SERIAL_SUPPORT - preloader_console_init(); -#endif - - led_puts("L4"); - - ret = uniphier_pxs2_umc_init(bd); - if (ret) - return ret; - - led_puts("L5"); - - return 0; -} diff --git a/arch/arm/mach-uniphier/init/init-sld3.c b/arch/arm/mach-uniphier/init/init-sld3.c deleted file mode 100644 index 50d9eaf..0000000 --- a/arch/arm/mach-uniphier/init/init-sld3.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2013-2015 Panasonic Corporation - * Copyright (C) 2015-2016 Socionext Inc. - * Author: Masahiro Yamada - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include - -#include "../init.h" -#include "../micro-support-card.h" - -int uniphier_sld3_init(const struct uniphier_board_data *bd) -{ - uniphier_sld3_bcu_init(bd); - - uniphier_sbc_init_admulti(); - - support_card_init(); - - uniphier_sld3_dpll_init(bd); - - led_puts("L0"); - - uniphier_memconf_3ch_no_disbit_init(bd); - - led_puts("L1"); - - uniphier_sld3_early_clk_init(); - uniphier_sld3_dram_clk_init(); - - led_puts("L2"); - - led_puts("L3"); - -#ifdef CONFIG_SPL_SERIAL_SUPPORT - preloader_console_init(); -#endif - - led_puts("L4"); - - led_puts("L5"); - - return 0; -} diff --git a/arch/arm/mach-uniphier/init/init-sld8.c b/arch/arm/mach-uniphier/init/init-sld8.c deleted file mode 100644 index 8da2843..0000000 --- a/arch/arm/mach-uniphier/init/init-sld8.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2013-2015 Panasonic Corporation - * Copyright (C) 2015-2016 Socionext Inc. - * Author: Masahiro Yamada - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include - -#include "../init.h" -#include "../micro-support-card.h" - -int uniphier_sld8_init(const struct uniphier_board_data *bd) -{ - uniphier_ld4_bcu_init(bd); - - uniphier_ld4_sbc_init(); - - support_card_init(); - - uniphier_sld8_dpll_init(bd); - - led_puts("L0"); - - uniphier_memconf_2ch_init(bd); - - led_puts("L1"); - - uniphier_sld3_early_clk_init(); - uniphier_sld3_dram_clk_init(); - - led_puts("L2"); - - led_puts("L3"); - -#ifdef CONFIG_SPL_SERIAL_SUPPORT - preloader_console_init(); -#endif - - led_puts("L4"); - - { - int res; - - res = uniphier_sld8_umc_init(bd); - if (res < 0) { - while (1) - ; - } - } - - led_puts("L5"); - - return 0; -} diff --git a/arch/arm/mach-uniphier/init/init.c b/arch/arm/mach-uniphier/init/init.c deleted file mode 100644 index 77e5b99..0000000 --- a/arch/arm/mach-uniphier/init/init.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2015 Masahiro Yamada - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include -#include - -#include "../init.h" -#include "../soc-info.h" - -void spl_board_init(void) -{ - const struct uniphier_board_data *param; - -#ifdef CONFIG_DEBUG_UART - debug_uart_init(); -#endif - - param = uniphier_get_board_param(); - if (!param) - hang(); - - switch (uniphier_get_soc_type()) { -#if defined(CONFIG_ARCH_UNIPHIER_SLD3) - case SOC_UNIPHIER_SLD3: - uniphier_sld3_init(param); - break; -#endif -#if defined(CONFIG_ARCH_UNIPHIER_LD4) - case SOC_UNIPHIER_LD4: - uniphier_ld4_init(param); - break; -#endif -#if defined(CONFIG_ARCH_UNIPHIER_PRO4) - case SOC_UNIPHIER_PRO4: - uniphier_pro4_init(param); - break; -#endif -#if defined(CONFIG_ARCH_UNIPHIER_SLD8) - case SOC_UNIPHIER_SLD8: - uniphier_sld8_init(param); - break; -#endif -#if defined(CONFIG_ARCH_UNIPHIER_PRO5) - case SOC_UNIPHIER_PRO5: - uniphier_pro5_init(param); - break; -#endif -#if defined(CONFIG_ARCH_UNIPHIER_PXS2) || defined(CONFIG_ARCH_UNIPHIER_LD6B) - case SOC_UNIPHIER_PXS2: - case SOC_UNIPHIER_LD6B: - uniphier_pxs2_init(param); - break; -#endif -#if defined(CONFIG_ARCH_UNIPHIER_LD11) - case SOC_UNIPHIER_LD11: - uniphier_ld11_init(param); - break; -#endif -#if defined(CONFIG_ARCH_UNIPHIER_LD20) - case SOC_UNIPHIER_LD20: - uniphier_ld20_init(param); - break; -#endif - default: - break; - } -} diff --git a/arch/arm/mach-uniphier/spl_board_init.c b/arch/arm/mach-uniphier/spl_board_init.c new file mode 100644 index 0000000..d1e1ea7 --- /dev/null +++ b/arch/arm/mach-uniphier/spl_board_init.c @@ -0,0 +1,209 @@ +/* + * Copyright (C) 2015-2016 Socionext Inc. + * Author: Masahiro Yamada + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include +#include +#include + +#include "init.h" +#include "micro-support-card.h" +#include "soc-info.h" + +struct uniphier_spl_initdata { + enum uniphier_soc_id soc_id; + void (*bcu_init)(const struct uniphier_board_data *bd); + void (*early_clk_init)(void); + void (*sbc_init)(void); + int (*dpll_init)(const struct uniphier_board_data *bd); + int (*memconf_init)(const struct uniphier_board_data *bd); + void (*dram_clk_init)(void); + int (*umc_init)(const struct uniphier_board_data *bd); +}; + +static const struct uniphier_spl_initdata uniphier_spl_initdata[] = { +#if defined(CONFIG_ARCH_UNIPHIER_SLD3) + { + .soc_id = SOC_UNIPHIER_SLD3, + .bcu_init = uniphier_sld3_bcu_init, + .early_clk_init = uniphier_sld3_early_clk_init, + .sbc_init = uniphier_sbc_init_admulti, + .dpll_init = uniphier_sld3_dpll_init, + .memconf_init = uniphier_memconf_3ch_no_disbit_init, + .dram_clk_init = uniphier_sld3_dram_clk_init, + .umc_init = uniphier_sld3_umc_init, + }, +#endif +#if defined(CONFIG_ARCH_UNIPHIER_LD4) + { + .soc_id = SOC_UNIPHIER_LD4, + .bcu_init = uniphier_ld4_bcu_init, + .early_clk_init = uniphier_sld3_early_clk_init, + .sbc_init = uniphier_ld4_sbc_init, + .dpll_init = uniphier_ld4_dpll_init, + .memconf_init = uniphier_memconf_2ch_init, + .dram_clk_init = uniphier_sld3_dram_clk_init, + .umc_init = uniphier_ld4_umc_init, + }, +#endif +#if defined(CONFIG_ARCH_UNIPHIER_PRO4) + { + .soc_id = SOC_UNIPHIER_PRO4, + .early_clk_init = uniphier_sld3_early_clk_init, + .sbc_init = uniphier_sbc_init_savepin, + .dpll_init = uniphier_pro4_dpll_init, + .memconf_init = uniphier_memconf_2ch_init, + .dram_clk_init = uniphier_sld3_dram_clk_init, + .umc_init = uniphier_pro4_umc_init, + }, +#endif +#if defined(CONFIG_ARCH_UNIPHIER_SLD8) + { + .soc_id = SOC_UNIPHIER_SLD8, + .bcu_init = uniphier_ld4_bcu_init, + .early_clk_init = uniphier_sld3_early_clk_init, + .sbc_init = uniphier_ld4_sbc_init, + .dpll_init = uniphier_sld8_dpll_init, + .memconf_init = uniphier_memconf_2ch_init, + .dram_clk_init = uniphier_sld3_dram_clk_init, + .umc_init = uniphier_sld8_umc_init, + }, +#endif +#if defined(CONFIG_ARCH_UNIPHIER_PRO5) + { + .soc_id = SOC_UNIPHIER_PRO5, + .early_clk_init = uniphier_sld3_early_clk_init, + .sbc_init = uniphier_sbc_init_savepin, + .dpll_init = uniphier_pro5_dpll_init, + .memconf_init = uniphier_memconf_2ch_init, + .dram_clk_init = uniphier_pro5_dram_clk_init, + .umc_init = uniphier_pro5_umc_init, + }, +#endif +#if defined(CONFIG_ARCH_UNIPHIER_PXS2) + { + .soc_id = SOC_UNIPHIER_PXS2, + .early_clk_init = uniphier_sld3_early_clk_init, + .sbc_init = uniphier_pxs2_sbc_init, + .dpll_init = uniphier_pxs2_dpll_init, + .memconf_init = uniphier_memconf_3ch_init, + .dram_clk_init = uniphier_pxs2_dram_clk_init, + .umc_init = uniphier_pxs2_umc_init, + }, +#endif +#if defined(CONFIG_ARCH_UNIPHIER_LD6B) + { + .soc_id = SOC_UNIPHIER_LD6B, + .early_clk_init = uniphier_sld3_early_clk_init, + .sbc_init = uniphier_pxs2_sbc_init, + .dpll_init = uniphier_pxs2_dpll_init, + .memconf_init = uniphier_memconf_3ch_init, + .dram_clk_init = uniphier_pxs2_dram_clk_init, + .umc_init = uniphier_pxs2_umc_init, + }, +#endif +#if defined(CONFIG_ARCH_UNIPHIER_LD11) + { + .soc_id = SOC_UNIPHIER_LD11, + .early_clk_init = uniphier_ld11_early_clk_init, + .sbc_init = uniphier_ld11_sbc_init, + .dpll_init = uniphier_ld11_dpll_init, + .memconf_init = uniphier_memconf_2ch_init, + .dram_clk_init = uniphier_ld11_dram_clk_init, + .umc_init = uniphier_ld11_umc_init, + }, +#endif +#if defined(CONFIG_ARCH_UNIPHIER_LD20) + { + .soc_id = SOC_UNIPHIER_LD20, + .early_clk_init = uniphier_ld11_early_clk_init, + .sbc_init = uniphier_ld11_sbc_init, + .dpll_init = uniphier_ld20_dpll_init, + .memconf_init = uniphier_memconf_3ch_init, + .dram_clk_init = uniphier_ld20_dram_clk_init, + .umc_init = uniphier_ld20_umc_init, + }, +#endif +}; + +static const struct uniphier_spl_initdata *uniphier_get_spl_initdata( + enum uniphier_soc_id soc_id) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(uniphier_spl_initdata); i++) { + if (uniphier_spl_initdata[i].soc_id == soc_id) + return &uniphier_spl_initdata[i]; + } + + return NULL; +} + +void spl_board_init(void) +{ + const struct uniphier_board_data *bd; + const struct uniphier_spl_initdata *initdata; + enum uniphier_soc_id soc_id; + int ret; + +#ifdef CONFIG_DEBUG_UART + debug_uart_init(); +#endif + + bd = uniphier_get_board_param(); + if (!bd) + hang(); + + soc_id = uniphier_get_soc_type(); + initdata = uniphier_get_spl_initdata(soc_id); + if (!initdata) + hang(); + + if (initdata->bcu_init) + initdata->bcu_init(bd); + + initdata->sbc_init(); + + initdata->early_clk_init(); + + support_card_init(); + + led_puts("L0"); + +#ifdef CONFIG_SPL_SERIAL_SUPPORT + preloader_console_init(); +#endif + + led_puts("L1"); + + ret = initdata->dpll_init(bd); + if (ret) { + pr_err("failed to init DPLL\n"); + hang(); + } + + led_puts("L2"); + + ret = initdata->memconf_init(bd); + if (ret) { + pr_err("failed to init MEMCONF\n"); + hang(); + } + + led_puts("L3"); + + initdata->dram_clk_init(); + + led_puts("L4"); + + ret = initdata->umc_init(bd); + if (ret) { + pr_err("failed to init DRAM\n"); + hang(); + } + + led_puts("L5"); +} From patchwork Sun Jan 15 05:59:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 91523 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp888997qgi; Sat, 14 Jan 2017 22:01:40 -0800 (PST) X-Received: by 10.28.140.140 with SMTP id o134mr7309922wmd.87.1484460100475; Sat, 14 Jan 2017 22:01:40 -0800 (PST) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id 199si7972812wmm.166.2017.01.14.22.01.40; Sat, 14 Jan 2017 22:01:40 -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 AB413B38DC; Sun, 15 Jan 2017 07:01:09 +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 YBg8Oma3akYH; Sun, 15 Jan 2017 07:01:09 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 366BCA7629; Sun, 15 Jan 2017 07:00:25 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2A854B3864 for ; Sun, 15 Jan 2017 06:59:41 +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 dwxOA-ClLRgR for ; Sun, 15 Jan 2017 06:59:41 +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 28977B3867 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 v0F5xD3n016694; Sun, 15 Jan 2017 14:59:21 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com v0F5xD3n016694 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1484459961; bh=IjhtQzz+aU+qKLzqTjG8jwLbCxOXyS9lx5bExkDoF7Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ygcg+l0LD4G+Tjs9bENdI2/727AgZWqq1kOqfdk2Raq7QOUzfXb6ryOunJbb53UwK 1PN32X03MBHLX7YhPJqsVvECLbgwOVE0dEbxFgwR2rewiOuz0eL+C6a8vz9O0Ry1s7 rzjm7vCeERh+ts5/14Em4+VtPw8gCZO60UAMh6v2sqVGSdLGSqNkGAn6UM4NYsHfj2 Ld+H3Xk7QSw6ZMXevEAdEgLPrLrWVQms3NBVR4/VBCPFDKu47sc4dapxebENhRYsti jT6M7V5O+jEmPL5hT2a8v5gg+cJB558wJDJe6VMQOTIgY+jaLPEZ7XdCh+LTPvco5v VQ+kzqwGKALrA== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Sun, 15 Jan 2017 14:59:10 +0900 Message-Id: <1484459950-8644-10-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 9/9] ARM: uniphier: move SBC and Support Card init code to U-Boot proper 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" Initialize SBC and Support Card in U-Boot proper instead of SPL. We may run different firmware (ex. ARM Trusted Firmware) before U-Boot, and basic SoC initialization may be done there. In that case, SPL may not be used. The motivation for preparing SBC and Support Card in SPL was to use LED for early debugging, but this is not mandatory to boot SoCs. With this commit, LED will be unavailable in SPL, but we can use a debug serial instead. So, this change will not be a big deal. Signed-off-by: Masahiro Yamada --- arch/arm/mach-uniphier/Makefile | 6 +++--- arch/arm/mach-uniphier/board_init.c | 16 ++++++++++++++++ arch/arm/mach-uniphier/spl_board_init.c | 24 ------------------------ 3 files changed, 19 insertions(+), 27 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/Makefile b/arch/arm/mach-uniphier/Makefile index 7f1abd0..ab2c6dc 100644 --- a/arch/arm/mach-uniphier/Makefile +++ b/arch/arm/mach-uniphier/Makefile @@ -7,7 +7,6 @@ ifdef CONFIG_SPL_BUILD obj-y += spl_board_init.o obj-y += memconf.o obj-y += bcu/ -obj-$(CONFIG_MICRO_SUPPORT_CARD) += sbc/ else @@ -17,6 +16,9 @@ obj-y += board_init.o obj-$(CONFIG_BOARD_LATE_INIT) += board_late_init.o obj-y += reset.o +obj-$(CONFIG_MICRO_SUPPORT_CARD) += sbc/ micro-support-card.o +obj-y += pinctrl-glue.o + endif obj-y += boards.o @@ -24,9 +26,7 @@ obj-y += soc_info.o obj-y += boot-mode/ obj-y += clk/ obj-y += dram/ -obj-y += pinctrl-glue.o -obj-$(CONFIG_MICRO_SUPPORT_CARD) += micro-support-card.o obj-$(CONFIG_DEBUG_UART_UNIPHIER) += debug-uart/ obj-$(CONFIG_CPU_V7) += arm32/ diff --git a/arch/arm/mach-uniphier/board_init.c b/arch/arm/mach-uniphier/board_init.c index 77f1fb0..3bd4cdd 100644 --- a/arch/arm/mach-uniphier/board_init.c +++ b/arch/arm/mach-uniphier/board_init.c @@ -81,6 +81,7 @@ static void uniphier_ld20_misc_init(void) struct uniphier_initdata { enum uniphier_soc_id soc_id; bool nand_2cs; + void (*sbc_init)(void); void (*pll_init)(void); void (*clk_init)(void); void (*misc_init)(void); @@ -91,6 +92,7 @@ struct uniphier_initdata uniphier_initdata[] = { { .soc_id = SOC_UNIPHIER_SLD3, .nand_2cs = true, + .sbc_init = uniphier_sbc_init_admulti, .pll_init = uniphier_sld3_pll_init, .clk_init = uniphier_ld4_clk_init, }, @@ -99,6 +101,7 @@ struct uniphier_initdata uniphier_initdata[] = { { .soc_id = SOC_UNIPHIER_LD4, .nand_2cs = true, + .sbc_init = uniphier_ld4_sbc_init, .pll_init = uniphier_ld4_pll_init, .clk_init = uniphier_ld4_clk_init, }, @@ -107,6 +110,7 @@ struct uniphier_initdata uniphier_initdata[] = { { .soc_id = SOC_UNIPHIER_PRO4, .nand_2cs = false, + .sbc_init = uniphier_sbc_init_savepin, .pll_init = uniphier_pro4_pll_init, .clk_init = uniphier_pro4_clk_init, }, @@ -115,6 +119,7 @@ struct uniphier_initdata uniphier_initdata[] = { { .soc_id = SOC_UNIPHIER_SLD8, .nand_2cs = true, + .sbc_init = uniphier_ld4_sbc_init, .pll_init = uniphier_ld4_pll_init, .clk_init = uniphier_ld4_clk_init, }, @@ -123,6 +128,7 @@ struct uniphier_initdata uniphier_initdata[] = { { .soc_id = SOC_UNIPHIER_PRO5, .nand_2cs = true, + .sbc_init = uniphier_sbc_init_savepin, .clk_init = uniphier_pro5_clk_init, }, #endif @@ -130,6 +136,7 @@ struct uniphier_initdata uniphier_initdata[] = { { .soc_id = SOC_UNIPHIER_PXS2, .nand_2cs = true, + .sbc_init = uniphier_pxs2_sbc_init, .clk_init = uniphier_pxs2_clk_init, }, #endif @@ -137,6 +144,7 @@ struct uniphier_initdata uniphier_initdata[] = { { .soc_id = SOC_UNIPHIER_LD6B, .nand_2cs = true, + .sbc_init = uniphier_pxs2_sbc_init, .clk_init = uniphier_pxs2_clk_init, }, #endif @@ -144,6 +152,7 @@ struct uniphier_initdata uniphier_initdata[] = { { .soc_id = SOC_UNIPHIER_LD11, .nand_2cs = false, + .sbc_init = uniphier_ld11_sbc_init, .pll_init = uniphier_ld11_pll_init, .clk_init = uniphier_ld11_clk_init, .misc_init = uniphier_ld11_misc_init, @@ -153,6 +162,7 @@ struct uniphier_initdata uniphier_initdata[] = { { .soc_id = SOC_UNIPHIER_LD20, .nand_2cs = false, + .sbc_init = uniphier_ld11_sbc_init, .pll_init = uniphier_ld20_pll_init, .clk_init = uniphier_ld20_clk_init, .misc_init = uniphier_ld20_misc_init, @@ -188,6 +198,12 @@ int board_init(void) return -EINVAL; } + initdata->sbc_init(); + + support_card_init(); + + led_puts("U0"); + if (IS_ENABLED(CONFIG_NAND_DENALI)) { ret = uniphier_pin_init(initdata->nand_2cs ? "nand2cs_grp" : "nand_grp"); diff --git a/arch/arm/mach-uniphier/spl_board_init.c b/arch/arm/mach-uniphier/spl_board_init.c index d1e1ea7..f4e1cb9 100644 --- a/arch/arm/mach-uniphier/spl_board_init.c +++ b/arch/arm/mach-uniphier/spl_board_init.c @@ -17,7 +17,6 @@ struct uniphier_spl_initdata { enum uniphier_soc_id soc_id; void (*bcu_init)(const struct uniphier_board_data *bd); void (*early_clk_init)(void); - void (*sbc_init)(void); int (*dpll_init)(const struct uniphier_board_data *bd); int (*memconf_init)(const struct uniphier_board_data *bd); void (*dram_clk_init)(void); @@ -30,7 +29,6 @@ static const struct uniphier_spl_initdata uniphier_spl_initdata[] = { .soc_id = SOC_UNIPHIER_SLD3, .bcu_init = uniphier_sld3_bcu_init, .early_clk_init = uniphier_sld3_early_clk_init, - .sbc_init = uniphier_sbc_init_admulti, .dpll_init = uniphier_sld3_dpll_init, .memconf_init = uniphier_memconf_3ch_no_disbit_init, .dram_clk_init = uniphier_sld3_dram_clk_init, @@ -42,7 +40,6 @@ static const struct uniphier_spl_initdata uniphier_spl_initdata[] = { .soc_id = SOC_UNIPHIER_LD4, .bcu_init = uniphier_ld4_bcu_init, .early_clk_init = uniphier_sld3_early_clk_init, - .sbc_init = uniphier_ld4_sbc_init, .dpll_init = uniphier_ld4_dpll_init, .memconf_init = uniphier_memconf_2ch_init, .dram_clk_init = uniphier_sld3_dram_clk_init, @@ -53,7 +50,6 @@ static const struct uniphier_spl_initdata uniphier_spl_initdata[] = { { .soc_id = SOC_UNIPHIER_PRO4, .early_clk_init = uniphier_sld3_early_clk_init, - .sbc_init = uniphier_sbc_init_savepin, .dpll_init = uniphier_pro4_dpll_init, .memconf_init = uniphier_memconf_2ch_init, .dram_clk_init = uniphier_sld3_dram_clk_init, @@ -65,7 +61,6 @@ static const struct uniphier_spl_initdata uniphier_spl_initdata[] = { .soc_id = SOC_UNIPHIER_SLD8, .bcu_init = uniphier_ld4_bcu_init, .early_clk_init = uniphier_sld3_early_clk_init, - .sbc_init = uniphier_ld4_sbc_init, .dpll_init = uniphier_sld8_dpll_init, .memconf_init = uniphier_memconf_2ch_init, .dram_clk_init = uniphier_sld3_dram_clk_init, @@ -76,7 +71,6 @@ static const struct uniphier_spl_initdata uniphier_spl_initdata[] = { { .soc_id = SOC_UNIPHIER_PRO5, .early_clk_init = uniphier_sld3_early_clk_init, - .sbc_init = uniphier_sbc_init_savepin, .dpll_init = uniphier_pro5_dpll_init, .memconf_init = uniphier_memconf_2ch_init, .dram_clk_init = uniphier_pro5_dram_clk_init, @@ -87,7 +81,6 @@ static const struct uniphier_spl_initdata uniphier_spl_initdata[] = { { .soc_id = SOC_UNIPHIER_PXS2, .early_clk_init = uniphier_sld3_early_clk_init, - .sbc_init = uniphier_pxs2_sbc_init, .dpll_init = uniphier_pxs2_dpll_init, .memconf_init = uniphier_memconf_3ch_init, .dram_clk_init = uniphier_pxs2_dram_clk_init, @@ -98,7 +91,6 @@ static const struct uniphier_spl_initdata uniphier_spl_initdata[] = { { .soc_id = SOC_UNIPHIER_LD6B, .early_clk_init = uniphier_sld3_early_clk_init, - .sbc_init = uniphier_pxs2_sbc_init, .dpll_init = uniphier_pxs2_dpll_init, .memconf_init = uniphier_memconf_3ch_init, .dram_clk_init = uniphier_pxs2_dram_clk_init, @@ -109,7 +101,6 @@ static const struct uniphier_spl_initdata uniphier_spl_initdata[] = { { .soc_id = SOC_UNIPHIER_LD11, .early_clk_init = uniphier_ld11_early_clk_init, - .sbc_init = uniphier_ld11_sbc_init, .dpll_init = uniphier_ld11_dpll_init, .memconf_init = uniphier_memconf_2ch_init, .dram_clk_init = uniphier_ld11_dram_clk_init, @@ -120,7 +111,6 @@ static const struct uniphier_spl_initdata uniphier_spl_initdata[] = { { .soc_id = SOC_UNIPHIER_LD20, .early_clk_init = uniphier_ld11_early_clk_init, - .sbc_init = uniphier_ld11_sbc_init, .dpll_init = uniphier_ld20_dpll_init, .memconf_init = uniphier_memconf_3ch_init, .dram_clk_init = uniphier_ld20_dram_clk_init, @@ -165,45 +155,31 @@ void spl_board_init(void) if (initdata->bcu_init) initdata->bcu_init(bd); - initdata->sbc_init(); initdata->early_clk_init(); - support_card_init(); - - led_puts("L0"); #ifdef CONFIG_SPL_SERIAL_SUPPORT preloader_console_init(); #endif - led_puts("L1"); - ret = initdata->dpll_init(bd); if (ret) { pr_err("failed to init DPLL\n"); hang(); } - led_puts("L2"); - ret = initdata->memconf_init(bd); if (ret) { pr_err("failed to init MEMCONF\n"); hang(); } - led_puts("L3"); - initdata->dram_clk_init(); - led_puts("L4"); - ret = initdata->umc_init(bd); if (ret) { pr_err("failed to init DRAM\n"); hang(); } - - led_puts("L5"); }