From patchwork Fri Feb 24 10:15:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 732058 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 3vV6pK10J1z9s7x for ; Fri, 24 Feb 2017 21:31:21 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D88A8B397F; Fri, 24 Feb 2017 11:31:18 +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 e9mj4-PHohoA; Fri, 24 Feb 2017 11:31:18 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 63EA3B397E; Fri, 24 Feb 2017 11:24:15 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 83B9DB38E2 for ; Fri, 24 Feb 2017 11:18:29 +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 U8rn_UERC1a3 for ; Fri, 24 Feb 2017 11:18:29 +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 0A0D2B3904 for ; Fri, 24 Feb 2017 11:16:25 +0100 (CET) Received: by mail-pf0-f195.google.com with SMTP id c193so876538pfb.3 for ; Fri, 24 Feb 2017 02:16:25 -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=CbJ90GzTVN8Vj1nqWu6d4cQwiNAi1achLMtpQd4CKB4=; b=VShivUV8LOLkFTRMYTygBzYZQNt25QjEDHhJdRUTLUgkqAPDt7aa8c1QRD8R2YXOba Yum5+isRgDjILzTpiye1JGRrjpNqOiQvETUxKGlFfbZE/hq0EA4h9bkesxj8kvR/WM+s QQyNC/ZzoaBGN//eDmEPLUnAkxpZcHVNA+ZIAtRZhYmYPUK9fx7v3yfnMCbQCKISRjiH uuB2tmrRYBy8dgESKUiAHZc6TD14R4aOhYU/tYe1BkCxRqRaa769OjaI21EGtH1CN/7i a4++jH0WRz+PbFb/HzjDQfTWkZ+sxUyzvQ9RoQAA5uKdtIDdxpMZmsELNJFao40HaFBi KsTw== X-Gm-Message-State: AMke39lk3Ik+rXx9YSvaja0FzQ+ex5QaDOpGzm8gMF8Ws19/72Xcx3uPPBI8KwFDtaTP6g== X-Received: by 10.99.56.27 with SMTP id f27mr2457580pga.167.1487931384222; Fri, 24 Feb 2017 02:16:24 -0800 (PST) Received: from localhost.localdomain ([106.220.148.189]) by smtp.gmail.com with ESMTPSA id u29sm14350288pfl.17.2017.02.24.02.16.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Feb 2017 02:16:23 -0800 (PST) From: Jagan Teki To: Stefano Babic Date: Fri, 24 Feb 2017 15:45:22 +0530 Message-Id: <1487931326-10199-12-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, Jagan Teki , Matteo Lisi Subject: [U-Boot] [PATCH v4 11/15] imx6: icorem6_rqs: 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" 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/icorem6_rqs/icorem6_rqs.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/board/engicam/icorem6_rqs/icorem6_rqs.c b/board/engicam/icorem6_rqs/icorem6_rqs.c index 2769177..e3c520f 100644 --- a/board/engicam/icorem6_rqs/icorem6_rqs.c +++ b/board/engicam/icorem6_rqs/icorem6_rqs.c @@ -125,6 +125,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 /*