From patchwork Mon May 14 07:17:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ladislav Michl X-Patchwork-Id: 912723 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux-mips.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40ksVD4nhTz9ry1 for ; Mon, 14 May 2018 17:17:56 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 527E8C21F0F; Mon, 14 May 2018 07:17:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 38560C21EDE; Mon, 14 May 2018 07:17:48 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 21D1BC21EDE; Mon, 14 May 2018 07:17:47 +0000 (UTC) Received: from cvs.linux-mips.org (eddie.linux-mips.org [148.251.95.138]) by lists.denx.de (Postfix) with ESMTP id BE03AC21C2C for ; Mon, 14 May 2018 07:17:46 +0000 (UTC) Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23990393AbeENHRqbmBCc (ORCPT ); Mon, 14 May 2018 09:17:46 +0200 Date: Mon, 14 May 2018 09:17:45 +0200 From: Ladislav Michl To: Stefano Babic Message-ID: <20180514071745.GA26414@lenoch> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.5 (2018-04-13) Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH] twister: Let SPL load U-Boot from MMC X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" MMC is not initialized in SPL, so it cannot load u-boot.img preventing boot from MMC. Also driver specific functions are guarded with generic configuration options which leads to build failures when device driver is not enabled in config. Fix that by using driver specific defines. Signed-off-by: Ladislav Michl Acked-by: Stefano Babic --- Stefano, if want this patch to be splitted, just let me know. I didn't want to make it two fewliners... board/technexion/twister/twister.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/board/technexion/twister/twister.c b/board/technexion/twister/twister.c index 1166886e1d..0590e5f8af 100644 --- a/board/technexion/twister/twister.c +++ b/board/technexion/twister/twister.c @@ -18,10 +18,8 @@ #include #include #include -#ifdef CONFIG_USB_EHCI_HCD #include #include -#endif #include "twister.h" DECLARE_GLOBAL_DATA_PTR; @@ -45,7 +43,7 @@ static const u32 gpmc_XR16L2751[] = { XR16L2751_GPMC_CONFIG6, }; -#ifdef CONFIG_USB_EHCI_HCD +#ifdef CONFIG_USB_EHCI_OMAP static struct omap_usbhs_board_data usbhs_bdata = { .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, @@ -118,19 +116,20 @@ void set_muxconf_regs(void) int board_eth_init(bd_t *bis) { +#ifdef CONFIG_DRIVER_TI_EMAC davinci_emac_initialize(); - +#endif /* init cs for extern lan */ enable_gpmc_cs_config(gpmc_smc911, &gpmc_cfg->cs[5], CONFIG_SMC911X_BASE, GPMC_SIZE_16M); - if (smc911x_initialize(0, CONFIG_SMC911X_BASE) <= 0) - printf("\nError initializing SMC911x controlleri\n"); - +#ifdef CONFIG_SMC911X + return smc911x_initialize(0, CONFIG_SMC911X_BASE); +#else return 0; +#endif } -#if defined(CONFIG_MMC_OMAP_HS) && \ - !defined(CONFIG_SPL_BUILD) +#if defined(CONFIG_MMC_OMAP_HS) int board_mmc_init(bd_t *bis) { return omap_mmc_init(0, 0, 0, -1, -1);