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"); }