From patchwork Thu Feb 2 14:56:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 723087 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 3vDjl65hRPz9s7G for ; Fri, 3 Feb 2017 01:57:06 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2168F4B644; Thu, 2 Feb 2017 15:56:55 +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 OFXY-3_hjTQG; Thu, 2 Feb 2017 15:56:54 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5B4494B891; Thu, 2 Feb 2017 15:56:37 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 63B4C4B68A for ; Thu, 2 Feb 2017 15:56:30 +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 tsP8ZRfyhiTU for ; Thu, 2 Feb 2017 15:56:30 +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-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by theia.denx.de (Postfix) with ESMTPS id CC9FA4B63F for ; Thu, 2 Feb 2017 15:56:26 +0100 (CET) Received: by mail-wm0-f68.google.com with SMTP id c85so4604765wmi.1 for ; Thu, 02 Feb 2017 06:56:26 -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=4/QA75hViDZUaKZhU5wRwgxdrsRXdlF7x55AR8L+CK8=; b=gFcQtVSWBHZ2RXkkSnqwFgNwCoLaDUckUks2SRu6cPpUc67o2bMpXuy4Echf/EsLTz XXQ5hlpbINdaIL81i/h18xLbdGrBIkx399ZonpGC6BykymLFOXbc1amoDpuPlCRifcp2 MVrcUcKLifquoWT7rpvpuiLXCuxRm8DJFdIAaC2AANU1RzaKqVukGkbrNPxvSrCVgdVJ lDhExvFWjrT7tC0vY9UmUgpaPDKsiSPeM4Bq2fz6cJPFe0qNuPzBf0Np2jZ/NzFtks1R V1zSy/8Z75k+zRdu9CmMbGZjkbvBpc5CX+oRrTnNmrfoeAf712c8g/JkzwO0P7VNTTqb dZpg== X-Gm-Message-State: AIkVDXKol9CQKzH8DyMGsUnMkcfg5cEoL4/yCkMVtGjNTfB9nk/j4+MorU5IFLvQIczOyQ== X-Received: by 10.28.131.132 with SMTP id f126mr30491509wmd.61.1486047386536; Thu, 02 Feb 2017 06:56:26 -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 s26sm39984869wra.26.2017.02.02.06.56.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Feb 2017 06:56:25 -0800 (PST) From: Jagan Teki To: Stefano Babic Date: Thu, 2 Feb 2017 15:56:03 +0100 Message-Id: <1486047373-31676-6-git-send-email-jagan@openedev.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1486047373-31676-1-git-send-email-jagan@openedev.com> References: <1486047373-31676-1-git-send-email-jagan@openedev.com> Cc: u-boot@lists.denx.de, Matteo Lisi Subject: [U-Boot] [PATCH v3 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 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 = {