From patchwork Tue Mar 8 11:37:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 63672 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1972616lbc; Tue, 8 Mar 2016 03:37:12 -0800 (PST) X-Received: by 10.194.61.169 with SMTP id q9mr28152402wjr.77.1457437032132; Tue, 08 Mar 2016 03:37:12 -0800 (PST) Return-Path: Received: from theia.denx.de (theia.denx.de. [85.214.87.163]) by mx.google.com with ESMTP id p1si3219209wjx.81.2016.03.08.03.37.11; Tue, 08 Mar 2016 03:37:12 -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; 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 F1495A76DA; Tue, 8 Mar 2016 12:37:10 +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 IAWH8U8trLRv; Tue, 8 Mar 2016 12:37:10 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7A6BAA767D; Tue, 8 Mar 2016 12:37:10 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 23084A767D for ; Tue, 8 Mar 2016 12:37:08 +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 7pD2PNrR4NAr for ; Tue, 8 Mar 2016 12:37:08 +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 conuserg009-v.nifty.com (conuserg009.nifty.com [202.248.44.35]) by theia.denx.de (Postfix) with ESMTPS id 674C4A7514 for ; Tue, 8 Mar 2016 12:37:00 +0100 (CET) Received: from beagle.diag.org (p14090-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.90]) (authenticated) by conuserg009-v.nifty.com with ESMTP id u28BaSli017127; Tue, 8 Mar 2016 20:36:28 +0900 X-Nifty-SrcIP: [153.142.97.90] From: Masahiro Yamada To: u-boot@lists.denx.de Date: Tue, 8 Mar 2016 20:37:16 +0900 Message-Id: <1457437036-22938-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 Cc: Scott Wood , York Sun Subject: [U-Boot] [PATCH] spl: add a new stub spl_early_board_init() for early SoC-specific setup 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" We are generally supposed to implement SoC/board-specific SPL init code in spl_board_init(), but it is called after spl_init() where the FDT is setup and devices are bound. This new stub spl_early_board_init() would be useful to put something really SoC-specific, for example, debug_uart_init(). In fact, I was hit by some problems on FDT setup when I was tackling on a completely new platform. I wished I could use the debug UART earlier in situations like that. Signed-off-by: Masahiro Yamada --- common/spl/spl.c | 6 ++++++ include/spl.h | 1 + 2 files changed, 7 insertions(+) -- 1.9.1 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot diff --git a/common/spl/spl.c b/common/spl/spl.c index e5167bf..df85b09 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -150,6 +150,10 @@ static int spl_ram_load_image(void) } #endif +void __weak spl_early_board_init(void) +{ +} + int spl_init(void) { int ret; @@ -344,6 +348,8 @@ void board_init_r(gd_t *dummy1, ulong dummy2) { int i; + spl_early_board_init(); + debug(">>spl:board_init_r()\n"); #if defined(CONFIG_SYS_SPL_MALLOC_START) diff --git a/include/spl.h b/include/spl.h index 92cdc04..e3c1873 100644 --- a/include/spl.h +++ b/include/spl.h @@ -93,6 +93,7 @@ int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition); */ int spl_init(void); +void spl_early_board_init(void); #ifdef CONFIG_SPL_BOARD_INIT void spl_board_init(void); #endif