Message ID | 20181018122837.31582-18-agust@denx.de |
---|---|
State | Awaiting Upstream |
Delegated to: | Stefano Babic |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=denx.de Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42bT9j4P89z9s8T for <incoming@patchwork.ozlabs.org>; Thu, 18 Oct 2018 23:38:33 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 20AB0C21DB5; Thu, 18 Oct 2018 12:36:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 00022C21EBD; Thu, 18 Oct 2018 12:29:23 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 17EC8C21DFD; Thu, 18 Oct 2018 12:29:14 +0000 (UTC) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by lists.denx.de (Postfix) with ESMTPS id 16240C21E18 for <u-boot@lists.denx.de>; Thu, 18 Oct 2018 12:29:07 +0000 (UTC) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 42bSyp6V6Mz1qvCD; Thu, 18 Oct 2018 14:29:06 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 42bSyp6KzVz1qqkH; Thu, 18 Oct 2018 14:29:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 7N_lYtPybabT; Thu, 18 Oct 2018 14:29:06 +0200 (CEST) X-Auth-Info: Ci9tBmRXQmel1isdmooYEfebzabDXbQhycKw5j+OwXs= Received: from crub.agik.hopto.org (p508DEB69.dip0.t-ipconnect.de [80.141.235.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Thu, 18 Oct 2018 14:29:06 +0200 (CEST) From: Anatolij Gustschin <agust@denx.de> To: u-boot@lists.denx.de, peng.fan@nxp.com, sbabic@denx.de Date: Thu, 18 Oct 2018 14:28:20 +0200 Message-Id: <20181018122837.31582-18-agust@denx.de> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181018122837.31582-1-agust@denx.de> References: <20181018122837.31582-1-agust@denx.de> Subject: [U-Boot] [PATCH v6 17/34] imx8: implement mmc_get_env_dev X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <http://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> |
Series |
i.MX: Add i.MX8QXP support
|
expand
|
diff --git a/arch/arm/mach-imx/imx8/cpu.c b/arch/arm/mach-imx/imx8/cpu.c index 90b6ea4211..0cacaa895c 100644 --- a/arch/arm/mach-imx/imx8/cpu.c +++ b/arch/arm/mach-imx/imx8/cpu.c @@ -176,3 +176,35 @@ enum boot_device get_boot_device(void) return boot_dev; } + +#ifdef CONFIG_ENV_IS_IN_MMC +__weak int board_mmc_get_env_dev(int devno) +{ + return CONFIG_SYS_MMC_ENV_DEV; +} + +int mmc_get_env_dev(void) +{ + sc_rsrc_t dev_rsrc; + int devno; + + sc_misc_get_boot_dev(-1, &dev_rsrc); + + switch (dev_rsrc) { + case SC_R_SDHC_0: + devno = 0; + break; + case SC_R_SDHC_1: + devno = 1; + break; + case SC_R_SDHC_2: + devno = 2; + break; + default: + /* If not boot from sd/mmc, use default value */ + return CONFIG_SYS_MMC_ENV_DEV; + } + + return board_mmc_get_env_dev(devno); +} +#endif