From patchwork Thu Apr 23 11:07:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Seiler X-Patchwork-Id: 1275709 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=IXksqzxS; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 497F0n0cC7z9sSk for ; Thu, 23 Apr 2020 21:08:41 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6AE7381746; Thu, 23 Apr 2020 13:08:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1587640117; bh=gnSgW/zoGfXllhgRb7DOCQUkssMQDehnhR/TJWGM/lI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=IXksqzxSf6pfhuPQVyxNTtnZbQQg2DZ/XoD6AozcgJ0Wue/c3lk5zVFtFnSvn5vxk lOtLfXmuTcaemkSJl37R0mio9lt9aSmLhknvebVLeqCidE19MyXKab/oZmYMGJRZpX plkwI9Sx367R1RA/2XfkTcRSF5cpPWfu+1Qv4ZL1iZfe0PUrlh7qK5EeQcA8PS+6HA Qk5wC9OkXeyBOofy04784ek65hfs4tAc0vulenRXtZpanq8AgxlxKdBR5IJbezUO4T xunWFHX/RPLjYCEgj8mLezBIcb4iLJN3X5XIkkNxRhdZH+dbJty8X42xB4WGeZXpI/ uTDguMeSjQJTA== Received: by phobos.denx.de (Postfix, from userid 109) id B0A22813BF; Thu, 23 Apr 2020 13:08:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 393DF804F5 for ; Thu, 23 Apr 2020 13:08:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=hws@denx.de Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 497F0V0DcCz1qs4F; Thu, 23 Apr 2020 13:08:26 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 497F0T6fB9z1qqkv; Thu, 23 Apr 2020 13:08:25 +0200 (CEST) Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 3QmMCDb6TK5v; Thu, 23 Apr 2020 13:08:24 +0200 (CEST) X-Auth-Info: U2rEXD52a7yrH1l/wvhISQh/DH3FQ741Ir7ReHMvtnc= Received: from localhost.localdomain (p5484738E.dip0.t-ipconnect.de [84.132.115.142]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Thu, 23 Apr 2020 13:08:24 +0200 (CEST) From: Harald Seiler To: u-boot@lists.denx.de, Stefano Babic , Fabio Estevam , "NXP i.MX U-Boot Team" Cc: Harald Seiler , Lukasz Majewski , Anatolij Gustschin , Peng Fan , Marek Vasut Subject: [PATCH 1/5] imx: spl: return boot mode for asked MMC device in spl_mmc_boot_mode() Date: Thu, 23 Apr 2020 13:07:49 +0200 Message-Id: <20200423110753.51231-2-hws@denx.de> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200423110753.51231-1-hws@denx.de> References: <20200423110753.51231-1-hws@denx.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean From: Anatolij Gustschin Boards may extend or re-define the boot list in their board_boot_order() function by modifying spl_boot_list. E.g. a board might boot SPL from a slow SPI NOR flash and then load the U-Boot from an eMMC or SD-card. Or it might use additional MMC boot device in spl_boot_list for cases when the image in SPI NOR flash is not found, so it could fall back to eMMC, SD-card or another boot device. Getting the MMC boot mode in spl_mmc will fail when we are trying to boot from an MMC device in the spl_boot_list and the original board boot mode (as returned by spl_boot_device()) is not an MMC boot mode. Fix it by checking the asked MMC boot device from the spl_mmc_boot_mode() argument. Signed-off-by: Anatolij Gustschin --- arch/arm/mach-imx/spl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c index 49bb3b928da1..e5835150a06d 100644 --- a/arch/arm/mach-imx/spl.c +++ b/arch/arm/mach-imx/spl.c @@ -229,7 +229,7 @@ u32 spl_mmc_boot_mode(const u32 boot_device) #ifdef CONFIG_SPL_FORCE_MMC_BOOT switch (boot_device) { #else - switch (spl_boot_device()) { + switch (boot_device) { #endif /* for MMC return either RAW or FAT mode */ case BOOT_DEVICE_MMC1: