From patchwork Fri Feb 24 10:15:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 732070 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 3vV6vl3JrGz9s7x for ; Fri, 24 Feb 2017 21:36:03 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0BE66B3995; Fri, 24 Feb 2017 11:36:02 +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 OjqbFSCTHJYI; Fri, 24 Feb 2017 11:36:01 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1DC81B39B0; Fri, 24 Feb 2017 11:30:02 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7938AB3947 for ; Fri, 24 Feb 2017 11:18:16 +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 GqoJCv0DKwBB for ; Fri, 24 Feb 2017 11:18:13 +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-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by theia.denx.de (Postfix) with ESMTPS id 48131B38B5 for ; Fri, 24 Feb 2017 11:16:01 +0100 (CET) Received: by mail-pf0-f195.google.com with SMTP id o64so878083pfb.1 for ; Fri, 24 Feb 2017 02:16:01 -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=xKJqysmvrlbjaRzGPkS1U/OOY37+Wb4y/4P77eB3U0M=; b=bVpAOvjWBE19tYpc6NNFSvsTTrXXfnp8HWe6QsIO+2rWrhztX3zpxXswSchy3dnVY8 FwMpYvt9Fok9Xn3YDUHUjNZsMKXDoF4PYEz5ZsNRqj0gIYV3J3eVbVyqKFcU8QqJaat1 f2auBpJkQg7UUomtELTfAE9fPGILrBAgXwNRThRjSQmPIT4XDsWv8M6hbvZAv+dyVima xK10qYs7XztAUpOr5sXFTdSCdTAlpV4jJT6ypNv/qc6jdDC82BefHBlOz8m+k8eWlUmA MdibQaRWXumhqoe71Hei99hi1KDkpOjK5Th7s6+ajE3397/bA8Lbfx5EEw9HgoZf5eCR dOqg== X-Gm-Message-State: AMke39lJJDleUYRiFk2poTXqX0JbG7iIvE7o8DIK+HDzWVmad5T/jns25txSq2I39MkvaA== X-Received: by 10.84.130.34 with SMTP id 31mr2786513plc.111.1487931359277; Fri, 24 Feb 2017 02:15:59 -0800 (PST) Received: from localhost.localdomain ([106.220.148.189]) by smtp.gmail.com with ESMTPSA id u29sm14350288pfl.17.2017.02.24.02.15.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Feb 2017 02:15:57 -0800 (PST) From: Jagan Teki To: Stefano Babic Date: Fri, 24 Feb 2017 15:45:16 +0530 Message-Id: <1487931326-10199-6-git-send-email-jagan@openedev.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1487931326-10199-1-git-send-email-jagan@openedev.com> References: <1487931326-10199-1-git-send-email-jagan@openedev.com> Cc: u-boot@lists.denx.de, Matteo Lisi Subject: [U-Boot] [PATCH v4 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: Matteo Lisi Cc: Michael Trimarchi Reviewed by: Stefano Babic 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 20c8aa7..07dd501 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 = {