From patchwork Thu Feb 2 14:56:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 723094 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 3vDjmg4yb6z9s7G for ; Fri, 3 Feb 2017 01:58:27 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 73204B38AC; Thu, 2 Feb 2017 15:57:34 +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 USuQ7FSQ8sXY; Thu, 2 Feb 2017 15:57:34 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E1B70B38C8; Thu, 2 Feb 2017 15:57:04 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BAED04BA16 for ; Thu, 2 Feb 2017 15:57:01 +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 8q4kwF2xj_rY for ; Thu, 2 Feb 2017 15:57:01 +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-wj0-f195.google.com (mail-wj0-f195.google.com [209.85.210.195]) by theia.denx.de (Postfix) with ESMTPS id 8D8F14BADD for ; Thu, 2 Feb 2017 15:56:36 +0100 (CET) Received: by mail-wj0-f195.google.com with SMTP id ip10so1275137wjb.1 for ; Thu, 02 Feb 2017 06:56:36 -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=Xj50Or/suMuySkWI5hA3DH9kW575KsfeQLjuq9a4tr0=; b=rqwdoFI2ph2ghbTTlex6dSrD40ua4I0b4VVNh4qMHmbZW3oTbLyV5DMQQdYPX8qXX6 VggevHolm5ht/OywziZu1C0Bf5oqvhKf7eKlACeBVaNdTvPmDUdbXt3MSoSq9v5SOPP3 49V7QET8neK/cqQfef7kS5m4UR9e/FL6YPVc3G/DM3UlHWxCtFJWnSFIMf+tNMZgU5oy 52hBmSCLwKutUmShIf+VvUOGXvijPjFWP+kVxzBuM6m2ov1I2MnrSjUhBJTIQzKLxZVh X8PSJsWXmIYwKjUZUGToGdHFXlGA38MAg56DnEof/XXZrIFOugcGaekguHy5pAt7i7jS YCdQ== X-Gm-Message-State: AIkVDXL9nXhSlGvnLcfh+KETIWd+zdPQ4GHcDeAuILFdISG/5dUE8IwzGF9lGg8MKI+edg== X-Received: by 10.223.128.202 with SMTP id 68mr8782420wrl.92.1486047396120; Thu, 02 Feb 2017 06:56:36 -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.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Feb 2017 06:56:35 -0800 (PST) From: Jagan Teki To: Stefano Babic Date: Thu, 2 Feb 2017 15:56:09 +0100 Message-Id: <1486047373-31676-12-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: Matteo Lisi , u-boot@lists.denx.de, Jagan Teki Subject: [U-Boot] [PATCH v3 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: Stefano Babic Cc: Matteo Lisi Cc: Michael Trimarchi 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 /*