From patchwork Wed Oct 28 09:23:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Kiryanov X-Patchwork-Id: 537273 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 4CEC5140DAE for ; Wed, 28 Oct 2015 20:24:49 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=compulab.co.il header.i=@compulab.co.il header.b=2RUeOFKZ; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 58F7B4B699; Wed, 28 Oct 2015 10:24:44 +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 EdX7ny3tJVOu; Wed, 28 Oct 2015 10:24:44 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 40DC94B668; Wed, 28 Oct 2015 10:23:58 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 835424B61D for ; Wed, 28 Oct 2015 10:23: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 7_r82OrqZKM1 for ; Wed, 28 Oct 2015 10:23: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 compulab.co.il (softlayer.compulab.co.il [50.23.254.55]) by theia.denx.de (Postfix) with ESMTPS id 154FC4B62C for ; Wed, 28 Oct 2015 10:23:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=compulab.co.il; s=default; h=References:In-Reply-To:Message-Id:Date:Subject :Cc:To:From; bh=kqtGL2TLwvZIBUipIxcxfxOTviLX1m61wp6+0y481V0=; b=2RUeOFKZkblfL 40XmYeh7eGLSo9iD4e/WJoGNYpb/2y2WTyLRdJ0ek6XRT73hASYWHaoX+dEdKRTpbCdrkMgmSpFSY aSdA3AVpPanZ1dOqMckF3blnrK3tKcSpmqYJAS4BaNdai4Z/MxD0NJ89q+C+dd1SwjJZ8oBUVGJk2 J9Eo=; Received: from [62.90.235.247] (port=34888 helo=zimbra-mta.compulab.co.il) by softlayer.compulab.co.il with esmtp (Exim 4.86) (envelope-from ) id 1ZrMxE-0006TI-St; Wed, 28 Oct 2015 11:23:37 +0200 Received: from localhost (localhost [127.0.0.1]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id 8357F486FFF; Wed, 28 Oct 2015 11:23:35 +0200 (IST) Received: from zimbra-mta.compulab.co.il ([127.0.0.1]) by localhost (zimbra-mta.compulab.co.il [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id vYUewjOJx-QB; Wed, 28 Oct 2015 11:23:35 +0200 (IST) Received: from localhost (localhost [127.0.0.1]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id 8853E48700D; Wed, 28 Oct 2015 11:23:34 +0200 (IST) X-Virus-Scanned: amavisd-new at zimbra-mta.compulab.co.il Received: from zimbra-mta.compulab.co.il ([127.0.0.1]) by localhost (zimbra-mta.compulab.co.il [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id f_VAaKTo1EVT; Wed, 28 Oct 2015 11:23:34 +0200 (IST) Received: from skynet.compulab.local (nikita-pc.compulab.local [192.168.11.211]) by zimbra-mta.compulab.co.il (Postfix) with ESMTP id 4EC7448700E; Wed, 28 Oct 2015 11:23:34 +0200 (IST) From: Nikita Kiryanov To: u-boot@lists.denx.de Date: Wed, 28 Oct 2015 11:23:28 +0200 Message-Id: <1446024210-16517-12-git-send-email-nikita@compulab.co.il> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1446024210-16517-1-git-send-email-nikita@compulab.co.il> References: <1446024210-16517-1-git-send-email-nikita@compulab.co.il> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - softlayer.compulab.co.il X-AntiAbuse: Original Domain - lists.denx.de X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - compulab.co.il X-Get-Message-Sender-Via: softlayer.compulab.co.il: acl_c_recent_authed_mail_ips_text_entry: nikita@compulab.co.il|compulab.co.il X-Authenticated-Sender: softlayer.compulab.co.il: nikita@compulab.co.il Cc: Tom Rini Subject: [U-Boot] [PATCH V2 11/13] spl: announce boot devices 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" Now that we support alternative boot devices, it can sometimes be unclear which boot devices was actually used. Provide a function to announce which boot devices are attempted during boot. Signed-off-by: Nikita Kiryanov Cc: Igor Grinberg Cc: Tom Rini Cc: Simon Glass --- Changes in V2: - No changes. common/spl/spl.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/common/spl/spl.c b/common/spl/spl.c index 7913c52..ee30290 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -178,6 +178,91 @@ int spl_init(void) return 0; } +#ifdef CONFIG_SPL_BOARD_LOAD_IMAGE +__weak void spl_board_announce_boot_device(void) { } +#endif + +#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT +static void announce_boot_device(u32 boot_device) +{ + puts("Trying to boot from "); + switch (boot_device) { +#ifdef CONFIG_SPL_RAM_DEVICE + case BOOT_DEVICE_RAM: + puts("RAM"); + break; +#endif +#ifdef CONFIG_SPL_MMC_SUPPORT + case BOOT_DEVICE_MMC1: + case BOOT_DEVICE_MMC2: + case BOOT_DEVICE_MMC2_2: + puts("MMC"); + break; +#endif +#ifdef CONFIG_SPL_NAND_SUPPORT + case BOOT_DEVICE_NAND: + puts("NAND"); + break; +#endif +#ifdef CONFIG_SPL_ONENAND_SUPPORT + case BOOT_DEVICE_ONENAND: + puts("OneNAND"); + break; +#endif +#ifdef CONFIG_SPL_NOR_SUPPORT + case BOOT_DEVICE_NOR: + puts("NOR"); + break; +#endif +#ifdef CONFIG_SPL_YMODEM_SUPPORT + case BOOT_DEVICE_UART: + puts("UART"); + break; +#endif +#ifdef CONFIG_SPL_SPI_SUPPORT + case BOOT_DEVICE_SPI: + puts("SPI"); + break; +#endif +#ifdef CONFIG_SPL_ETH_SUPPORT + case BOOT_DEVICE_CPGMAC: +#ifdef CONFIG_SPL_ETH_DEVICE + puts("eth device"); +#else + puts("net"); +#endif + break; +#endif +#ifdef CONFIG_SPL_USBETH_SUPPORT + case BOOT_DEVICE_USBETH: + puts("USB eth"); + break; +#endif +#ifdef CONFIG_SPL_USB_SUPPORT + case BOOT_DEVICE_USB: + puts("USB"); + break; +#endif +#ifdef CONFIG_SPL_SATA_SUPPORT + case BOOT_DEVICE_SATA: + puts("SATA"); + break; +#endif +#ifdef CONFIG_SPL_BOARD_LOAD_IMAGE + case BOOT_DEVICE_BOARD: + spl_board_announce_boot_device(); + break; +#endif + default: + printf("%d (unknown boot device)", boot_device); + } + + puts("\n"); +} +#else +static inline void announce_boot_device(u32 boot_device) { } +#endif + #ifndef BOOT_DEVICE_NONE #define BOOT_DEVICE_NONE 0xdeadbeef #endif @@ -292,6 +377,7 @@ void board_init_r(gd_t *dummy1, ulong dummy2) board_boot_order(spl_boot_list); for (i = 0; i < ARRAY_SIZE(spl_boot_list) && spl_boot_list[i] != BOOT_DEVICE_NONE; i++) { + announce_boot_device(spl_boot_list[i]); if (!spl_load_image(spl_boot_list[i])) break; }