From patchwork Mon Jan 31 16:58:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 1586893 X-Patchwork-Delegate: sbabic@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.a=rsa-sha256 header.s=google header.b=oFVujfar; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JnZHB6ZHmz9s5B for ; Tue, 1 Feb 2022 04:07:02 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CD5F8837EC; Mon, 31 Jan 2022 18:06:26 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amarulasolutions.com header.i=@amarulasolutions.com header.b="oFVujfar"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1D91C83076; Mon, 31 Jan 2022 17:59:16 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2A2EF8368E for ; Mon, 31 Jan 2022 17:59:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=amarulasolutions.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tommaso.merciai@amarulasolutions.com Received: by mail-ej1-x635.google.com with SMTP id k25so44691626ejp.5 for ; Mon, 31 Jan 2022 08:59:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a5+097pOWeKm7tGI5lm09/yTwsl5DwPrjp/TyYBQ4ww=; b=oFVujfarbYT9tQz91DAQrkvO9+3BWi8ozLg9SgkBBaG/XMv8fWVR4Xtcim6C7lvwNi s6utCE1TYdEFJDn9IWDJh8RWTkq+4eaqRL0RpZfxRjuot8mpB1flDzeRM8NsbKqW1Nnc ADFjElMiRWNaYcEUlDRnE6NXZFe3iFheqSzYY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a5+097pOWeKm7tGI5lm09/yTwsl5DwPrjp/TyYBQ4ww=; b=oWgbLKKKBq6Nu7R+fGScqvbkc1Y1GzfIagWnh3DimCHNgZh6Wu4WLgtOpkRHD1Q6fN lF83LOQn69J3eWx0z3ScfxpFcRhKQ5PabRI8gSY60NWntGNplPwDeQ2Mgh79UsnqD161 GPo3Jo6o3LzYdN8G43MMZ9JGVlB1kfl0QgsbA7rNgWGiRUcuDuAvyIcSrUuhk3lXS4iC /fAsr3XQ4Z8vQFkNF++zhWmrQ5suqd6JX2WGa6Sgeuy5lYPSCavaHPt/vP1D+WyUx5Jx PiAp/iWclEWAG6I+/USgq/wRMg65mdFIEdsJ1yNHvZ9yHQRn02seUYkEmjdmRooE4m+z IiFw== X-Gm-Message-State: AOAM533YzB0hSKs6d5KYWEuCegU4qx0YZA/Bo6Esw0oQjbKqARqrk+9T KHsMOnoa503I2IziqssdU/KkpQ== X-Google-Smtp-Source: ABdhPJwiB3/e53sEf60GE66QuvCHHQKh9mnA0ueGWt1AsMp8zu+4RMHm55scDtZHueaaBcvBgv1EOA== X-Received: by 2002:a17:906:478c:: with SMTP id cw12mr17463348ejc.214.1643648350764; Mon, 31 Jan 2022 08:59:10 -0800 (PST) Received: from tom-ThinkPad-T14s-Gen-2i.station (net-188-217-50-123.cust.vodafonedsl.it. [188.217.50.123]) by smtp.gmail.com with ESMTPSA id jl17sm13949507ejc.16.2022.01.31.08.59.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 08:59:10 -0800 (PST) From: Tommaso Merciai To: Cc: michael@amarulasolutions.com, aford173@gmail.com, tommaso.merciai@amarulasolutions.com, Stefano Babic , Fabio Estevam , "NXP i.MX U-Boot Team" , Teresa Remmet , Peng Fan , Ye Li , Simon Glass , Marek Vasut , Frieder Schrempf , Harald Seiler , =?utf-8?q?Marek_Beh=C3=BAn?= , u-boot@lists.denx.de Subject: [PATCH v4 4/4] phytec: phycore_imx8mp: override env_get_location Date: Mon, 31 Jan 2022 17:58:58 +0100 Message-Id: <20220131165859.261923-5-tommaso.merciai@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220131165859.261923-1-tommaso.merciai@amarulasolutions.com> References: <20220131165859.261923-1-tommaso.merciai@amarulasolutions.com> MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 31 Jan 2022 18:06:21 +0100 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Override env_get_location function at board level, previously dropped down from arch/arm/mach-imx/imx8m/soc.c References: - commit 98af80d3c969e69a1b8ce98bb20e5ad844022da2 Signed-off-by: Tommaso Merciai --- board/phytec/phycore_imx8mp/phycore-imx8mp.c | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/board/phytec/phycore_imx8mp/phycore-imx8mp.c b/board/phytec/phycore_imx8mp/phycore-imx8mp.c index a8f0821437..05926eefa3 100644 --- a/board/phytec/phycore_imx8mp/phycore-imx8mp.c +++ b/board/phytec/phycore_imx8mp/phycore-imx8mp.c @@ -11,9 +11,42 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; +enum env_location env_get_location(enum env_operation op, int prio) +{ + enum boot_device dev = get_boot_device(); + enum env_location env_loc = ENVL_UNKNOWN; + + if (prio) + return env_loc; + + if (IS_ENABLED(CONFIG_ENV_IS_IN_SPI_FLASH) && dev == QSPI_BOOT) { + env_loc = ENVL_SPI_FLASH; + } else if (IS_ENABLED(CONFIG_ENV_IS_IN_NAND) && dev == NAND_BOOT) { + env_loc = ENVL_NAND; + } else if (IS_ENABLED(CONFIG_ENV_IS_IN_MMC)) { + switch (dev) { + case SD1_BOOT: + case SD2_BOOT: + case SD3_BOOT: + case MMC1_BOOT: + case MMC2_BOOT: + case MMC3_BOOT: + env_loc = ENVL_MMC; + break; + default: + break; + } + } else if (IS_ENABLED(CONFIG_ENV_IS_NOWHERE)) { + env_loc = ENVL_MMC; + } + + return env_loc; +} + static int setup_fec(void) { struct iomuxc_gpr_base_regs *gpr =