From patchwork Fri Jan 27 14:12:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 720715 X-Patchwork-Delegate: sbabic@denx.de 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 3v914Y376Dz9tB1 for ; Sat, 28 Jan 2017 01:14:21 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DCB8BB38AA; Fri, 27 Jan 2017 15:13:49 +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 rUJgG7WKoGX5; Fri, 27 Jan 2017 15:13:49 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E2632B38A5; Fri, 27 Jan 2017 15:13:30 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B3668B3874 for ; Fri, 27 Jan 2017 15:13:06 +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 PPFtV202I6gd for ; Fri, 27 Jan 2017 15:13:06 +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 mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by theia.denx.de (Postfix) with ESMTPS id 25C124AAA7 for ; Fri, 27 Jan 2017 15:12:58 +0100 (CET) Received: by mail-wm0-f66.google.com with SMTP id c85so58387135wmi.1 for ; Fri, 27 Jan 2017 06:12:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=11FYkgArhwX9GxHJZqyCQl8dMbwT3E34x6kD/p3iAQU=; b=YYZGzSKo5K8X+bLG7I6atcOzpPRzVD7yAl4/6LAI9Xly9YeNI3uuB1eORX0QZwCnyG vEwDtjBWaLANDBs4KUcFSyfOeGHJHayyn9g2rCzNQGqEe4Pr1NrEu0DIbIdkQFTrQHf1 k97cCtLOF7yLFAcvzbBlmXnkcoRtTD8Fqw15LES9WNXBn7OXgsUX7Z6VphTfGHJ+pTDW TKHf8LkYaB2kaoGV0B27T/G0uxm+Ie96DCKL56UBNhFAKZeUr+3588qTUTxiaUoW9sdT lv1XaY8DcSz2AJPlIJTn2OhdM71gGLhgVGgW8LAmZ9qCG3JofhLP2Kx4SxCUOrmtyfYh AMVQ== X-Gm-Message-State: AIkVDXKBf4Ag7tw4Ij6624FbCojRNPqLz/0bNobkQDntzONjd/3b3uGnyMp5j3w9ymAggg== X-Received: by 10.223.156.9 with SMTP id f9mr8548431wrc.157.1485526378187; Fri, 27 Jan 2017 06:12:58 -0800 (PST) Received: from jagan-XPS-13-9350.homenet.telecomitalia.it (host211-95-static.0-79-b.business.telecomitalia.it. [79.0.95.211]) by smtp.gmail.com with ESMTPSA id m84sm4094930wmf.10.2017.01.27.06.12.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Jan 2017 06:12:57 -0800 (PST) From: Jagan Teki To: Stefano Babic Date: Fri, 27 Jan 2017 15:12:33 +0100 Message-Id: <1485526363-3834-6-git-send-email-jagan@openedev.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1485526363-3834-1-git-send-email-jagan@openedev.com> References: <1485526363-3834-1-git-send-email-jagan@openedev.com> Cc: u-boot@lists.denx.de, Matteo Lisi Subject: [U-Boot] [PATCH v2 05/15] imx6: isiotmx6ul: Update SPL board boot order for eMMC 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" From: Jagan Teki SPL mmc device index is get based on the boot device, like - BOOT_DEVICE_MMC1 for mmc device 0 - BOOT_DEVICE_MMC2 for mmc device 1 Currently BOOT_DEVICE_MMC1 is setting both SD/eSD and MMC/eMMC boot devices in i.MX, So u-boot is loading from mmc device 0 even "if the board booting from SD/eSD or MMC/eMMC" So, this patch set BOOT_DEVICE_MMC2 for MMC/eMMC so for MMC/eMMC the u-boot is loading from mmc device 1 and the board file need to take care if the board have different mmc device order intialization. Cc: Stefano Babic Cc: Matteo Lisi Cc: Michael Trimarchi Signed-off-by: Jagan Teki --- board/engicam/isiotmx6ul/isiotmx6ul.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/board/engicam/isiotmx6ul/isiotmx6ul.c b/board/engicam/isiotmx6ul/isiotmx6ul.c index ae3465f..6b84f02 100644 --- a/board/engicam/isiotmx6ul/isiotmx6ul.c +++ b/board/engicam/isiotmx6ul/isiotmx6ul.c @@ -205,6 +205,32 @@ int board_mmc_init(bd_t *bis) return 0; } + +#ifdef CONFIG_ENV_IS_IN_MMC +void board_boot_order(u32 *spl_boot_list) +{ + u32 bmode = imx6_src_get_boot_mode(); + u8 boot_dev = BOOT_DEVICE_MMC1; + + switch ((bmode & IMX6_BMODE_MASK) >> IMX6_BMODE_SHIFT) { + case IMX6_BMODE_SD: + case IMX6_BMODE_ESD: + /* SD/eSD - BOOT_DEVICE_MMC1 */ + break; + case IMX6_BMODE_MMC: + case IMX6_BMODE_EMMC: + /* MMC/eMMC */ + boot_dev = BOOT_DEVICE_MMC2; + break; + default: + /* Default - BOOT_DEVICE_MMC1 */ + printf("Wrong board boot order\n"); + break; + } + + spl_boot_list[0] = boot_dev; +} +#endif #endif /* CONFIG_FSL_ESDHC */ static struct mx6ul_iomux_grp_regs mx6_grp_ioregs = {