From patchwork Sat Dec 25 20:25:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 1573194 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 (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=qrUJ6Hpf; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4JLwSh58Y4z9sCD for ; Sun, 26 Dec 2021 07:26:44 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D132B83762; Sat, 25 Dec 2021 21:26:40 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qrUJ6Hpf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 319BB837D5; Sat, 25 Dec 2021 21:26:26 +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,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (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 AFD4883762 for ; Sat, 25 Dec 2021 21:26:21 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tomm.merciai@gmail.com Received: by mail-ed1-x536.google.com with SMTP id j21so45653781edt.9 for ; Sat, 25 Dec 2021 12:26:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=21obTlcrdVw6U8dG0LmoHtHJ6b76j5q0iOTErnICiWE=; b=qrUJ6HpfrRhlgSnlv05xnEp3g8lHf+Fd1nfnfVpCHOxfT629e13FRo11Fvua3v0Mp7 ZpJEWqrPbfhOfTl1PlnsHdTiboSlS+4F9Bi0X/dukNtyTlCyQxTpOF9M0cnPD7o6BLPa XuVwro7iQPhTH1c0jVItjdBrAIPaQvO/w5pWal7ZSnjJlRmXqr+/Vt9Jb9HPeC48Wt66 btxZDE6nh2PkowE+chA/Ubg+LgB/XykNF+ebuLD5u5gMTJbAEhckSPEeTKQiUIBZfEVg 2jt/xml7P6hGtHWyj1L4hx0W1072aOdrDlTN66Dg1iQ1zWBiGgusNg56Au6i+6oXH4Pk l0iw== 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=21obTlcrdVw6U8dG0LmoHtHJ6b76j5q0iOTErnICiWE=; b=NI8ImchluNiir4OPZsCHesZHCczNw3hoU0Ze4wn9NPehAIpcASC0iwWPeYisX+fMmz lG9G7mMN66kGjoAzHJNWLMJ6r/DoTWJZLN83/PjYpMis6mckJ5BR/cEdIoDYOYRxWX9+ 6aeL771G5JUFQNxhXbu5n/mnvnynoiWkbCIQnTiy9Q5pKa2SP15myDhJZyGaTR6zou8M 4CgSGy5XBliTRi+JF3tnTGPAdAki5GGXrjREHhBmYyrnhyjPUwJEW92zODN5Vq+E7ZRR 5U2TB1kazNEb9KeMiB5CuNHopfc57QOqUVzCl9/EFvgRfM6Fu6t7meOBH1qQuo0q1CrU fspw== X-Gm-Message-State: AOAM530cBLXJnI5H2aFIgnNVVKXt6UYuOWMZDvFtH1p3q0TQ1epRSRz7 qFC0DVnB9y71vdpUWnxI7LlT8iPykgk= X-Google-Smtp-Source: ABdhPJw6pcOocvgUOLHUlvtSaTNjaLJQjWcfVCAxeScwpocanbZMFY9oH6FOWYS4ImiA8HpHE67+Jg== X-Received: by 2002:aa7:cb14:: with SMTP id s20mr2589045edt.245.1640463981326; Sat, 25 Dec 2021 12:26:21 -0800 (PST) Received: from tom-desktop.station (net-93-71-218-227.cust.vodafonedsl.it. [93.71.218.227]) by smtp.gmail.com with ESMTPSA id go10sm3684925ejc.100.2021.12.25.12.26.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Dec 2021 12:26:20 -0800 (PST) From: Tommaso Merciai To: Cc: tomm.merciai@gmail.com, michael@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 , u-boot@lists.denx.de Subject: [RFC PATCH v3 1/5] imx8m: drop env_get_location for imx8mn and imx8mp Date: Sat, 25 Dec 2021 21:25:50 +0100 Message-Id: <20211225202554.47853-2-tomm.merciai@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211225202554.47853-1-tomm.merciai@gmail.com> References: <20211225202554.47853-1-tomm.merciai@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.2 at phobos.denx.de X-Virus-Status: Clean This function defined for two architecture is not really generic and can generate problem when people add a new board. Signed-off-by: Tommaso Merciai --- arch/arm/mach-imx/imx8m/soc.c | 39 ----------------------------------- 1 file changed, 39 deletions(-) diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 863508776d..f0030a557a 100644 --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -1313,45 +1313,6 @@ void do_error(struct pt_regs *pt_regs, unsigned int esr) #endif #if defined(CONFIG_IMX8MN) || defined(CONFIG_IMX8MP) -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; - - switch (dev) { -#ifdef CONFIG_ENV_IS_IN_SPI_FLASH - case QSPI_BOOT: - env_loc = ENVL_SPI_FLASH; - break; -#endif -#ifdef CONFIG_ENV_IS_IN_NAND - case NAND_BOOT: - env_loc = ENVL_NAND; - break; -#endif -#ifdef CONFIG_ENV_IS_IN_MMC - case SD1_BOOT: - case SD2_BOOT: - case SD3_BOOT: - case MMC1_BOOT: - case MMC2_BOOT: - case MMC3_BOOT: - env_loc = ENVL_MMC; - break; -#endif - default: -#if defined(CONFIG_ENV_IS_NOWHERE) - env_loc = ENVL_NOWHERE; -#endif - break; - } - - return env_loc; -} - #ifndef ENV_IS_EMBEDDED long long env_get_offset(long long defautl_offset) { From patchwork Sat Dec 25 20:25:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 1573195 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 (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=BqS5hb3h; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4JLwSs4lLkz9sCD for ; Sun, 26 Dec 2021 07:26:53 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3E710837DC; Sat, 25 Dec 2021 21:26:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BqS5hb3h"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 62A09837DC; Sat, 25 Dec 2021 21:26:28 +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,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) (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 EA27F831E9 for ; Sat, 25 Dec 2021 21:26:23 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tomm.merciai@gmail.com Received: by mail-ed1-x536.google.com with SMTP id q14so37999348edi.3 for ; Sat, 25 Dec 2021 12:26:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OEDCwMHPiiJ6jE/ghfRlc2ILU5zKUfM9+aq5zlU0klM=; b=BqS5hb3hF8nrSEEEwGY8pitFuZl6bj34MwgVM4GvTeDun3RwQMlpzU8o2U6TGgky3k FC+a+ZD8oz61KzPot8DCFqEDHJ5OgXL4qFdSGDYOo+mUZ2k9yVBmpMJ5kNhHVA2qZzMu 82JCdIr/+b7l9yOR8mRVFlOi3hvbsjbLlvZk9Id8eMu3GpYwKi50RV3yRcGVRCjZ7+2+ cjz2pLdLxqD02puIAqFvZOdZ+eMqEUHqbJ72RU40dXeTStt6DXGcfOTG+qfnXE2SzMZg WI6va7iybTOG4+K6713eB97of4EhiXXKFL8f6GdTz9TqwYCvXxzouDKNFVixTIC420Tj x2QA== 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=OEDCwMHPiiJ6jE/ghfRlc2ILU5zKUfM9+aq5zlU0klM=; b=y/upxX2+CXu2jzgDDV9RLLgjCG9BrzEOShyGlJ0S9GzQJhPcwH5ZMqPafAn8bmZonR wD9klmNTcrvrG+fYOUJ7rmHAISy1AuEl3+pwFGDB/kaAnSApl89O4Y1/kBJP0SjcllFV sj6Hd5G0OuTULYhA5s5fRqu6trHyC7P7njAb/mTI4Vw5gFgHMkOVLEYhuj7fgAnfyI1T 0qm+eW0qfXQdB0XDaW5KK8PGxPoN0R2tmkAGtrTkdAzll9cmrIo/vDmcSUFxXZ1FivKx Tnlr3gA92Ae5jlv3m6BbJ0dH9NjLq6UoeROP/TAdWdee1F/USJu8bacLi3OmTap8CDCS wLqg== X-Gm-Message-State: AOAM530bXoVTl5rw3XRHtSvFwzhejhAuUhz4Yv8k8E3etX2v4CB+PA5Y E0z0Ww1sW/48pGN9QDGBn2TC7ZAeYzk= X-Google-Smtp-Source: ABdhPJz9+/xg33PmNPZUunHWnvMmT/OyVHJs06SKkfMXA09cxm/i4aG5yNNZ9a4hH7IxJkURPgJ2xw== X-Received: by 2002:aa7:c744:: with SMTP id c4mr10303310eds.85.1640463983650; Sat, 25 Dec 2021 12:26:23 -0800 (PST) Received: from tom-desktop.station (net-93-71-218-227.cust.vodafonedsl.it. [93.71.218.227]) by smtp.gmail.com with ESMTPSA id go10sm3684925ejc.100.2021.12.25.12.26.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Dec 2021 12:26:23 -0800 (PST) From: Tommaso Merciai To: Cc: tomm.merciai@gmail.com, michael@amarulasolutions.com, Peng Fan , Stefano Babic , Fabio Estevam , "NXP i.MX U-Boot Team" , Teresa Remmet , u-boot@lists.denx.de Subject: [RFC PATCH v3 2/5] imx: imx8mn_evk: override env_get_location Date: Sat, 25 Dec 2021 21:25:51 +0100 Message-Id: <20211225202554.47853-3-tomm.merciai@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211225202554.47853-1-tomm.merciai@gmail.com> References: <20211225202554.47853-1-tomm.merciai@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.2 at phobos.denx.de X-Virus-Status: Clean Override env_get_location function at board level, previously dropped down from soc.c References: - commit 37d3e3bb95d7532e2503f115dd6c6762fd3b0262 Signed-off-by: Tommaso Merciai --- Changes since v1: - Fix code indentation using checkpatch as suggested by MBehĂșn board/freescale/imx8mn_evk/imx8mn_evk.c | 35 +++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/board/freescale/imx8mn_evk/imx8mn_evk.c b/board/freescale/imx8mn_evk/imx8mn_evk.c index 9a0a0488bf..ec1ab202a6 100644 --- a/board/freescale/imx8mn_evk/imx8mn_evk.c +++ b/board/freescale/imx8mn_evk/imx8mn_evk.c @@ -5,11 +5,46 @@ #include #include +#include #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; +} + int board_init(void) { return 0; From patchwork Sat Dec 25 20:25:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 1573197 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 (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=PrYSvbTO; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4JLwTD2d03z9sCD for ; Sun, 26 Dec 2021 07:27:12 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B62D5837F6; Sat, 25 Dec 2021 21:26:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PrYSvbTO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7ED0383731; Sat, 25 Dec 2021 21:26:34 +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,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) (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 EC368837D8 for ; Sat, 25 Dec 2021 21:26:25 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tomm.merciai@gmail.com Received: by mail-ed1-x530.google.com with SMTP id l5so10989520edj.13 for ; Sat, 25 Dec 2021 12:26:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KPopgeAiOT/3Op5LgswFqse4mi8j2il88IU7FZoVZ4k=; b=PrYSvbTO8/ZU6rpMB1bFBm1h2RZLVT2J8I1IgxypOIJA8czjMe+eSPWwj0ZuC8yi15 i+JDRzAtekXjTmKUMG1OXB6bPEvoK/SvXDZs7R9IhuUXW1IAUX0HB/BhGpEzqwz2HdA0 7/bzIj9ZGGS4/+lVDl3P2dh7BaQ2YjJHxIuoATHpphlcEw5z7q/3mbOxHf5yiazPnV9z DAiQqyM3/ATZEDu2dmjkLv+JZupRxnyQdZx4+vYWu3xXwIXlVBkvpPRepeupBgEkkin5 /iQw0WBPFxoQtet6FDX5Hh93kyncWFR6xEb5iVHyGCClERKIoJ0Ksxl27CJTHVAQx8K4 UVvQ== 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=KPopgeAiOT/3Op5LgswFqse4mi8j2il88IU7FZoVZ4k=; b=vNmaE4eLo4OBkMvifQigvPPvOTdyP22HjcC2h4Ny6uNq7uoem/v2ACMH2iON3w8kuN OA1c0Vh+aCHVH9fn7ROKDTqubkpFnOHHmBQbbvihKMi8I9v2PmyB9ShnJURfI2w9JZbu aktiwr6Ysqe20uMU4J+M1JX0uHiX+TFEjoaqYF+pt8BM+GBpzhNxeCOfFoJbHlggc3LC /MKfluZ8KkgGmYVGze+/dvY2Dllet5ciQ2Y7O75s+nQo4DQ8FxnMXjBt7aa94n+m2E/B STBUm0W8KYkYjC2DVIWidk6BNED4mczCcJT4e+QQuglCP9w8nscqmR/cqxw0k15XTkqE 1Wsg== X-Gm-Message-State: AOAM532C4i6JmY4MjTkggw+QXAyaldG5F/m1JYLOoRWtwkxYbFltQGiO HLrNo/FsPeaNSI4ezSLP4fyyyfkUF2s= X-Google-Smtp-Source: ABdhPJyuwxkCaJXMED30qCnEdXfEgMfsa508uJ4Ei3wcq2U1Ntxj6gnbYnlYLlBFyKF+V+gEvnI2aw== X-Received: by 2002:a50:fc91:: with SMTP id f17mr10509774edq.252.1640463985523; Sat, 25 Dec 2021 12:26:25 -0800 (PST) Received: from tom-desktop.station (net-93-71-218-227.cust.vodafonedsl.it. [93.71.218.227]) by smtp.gmail.com with ESMTPSA id go10sm3684925ejc.100.2021.12.25.12.26.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Dec 2021 12:26:25 -0800 (PST) From: Tommaso Merciai To: Cc: tomm.merciai@gmail.com, michael@amarulasolutions.com, Peng Fan , Stefano Babic , Fabio Estevam , "NXP i.MX U-Boot Team" , Teresa Remmet , u-boot@lists.denx.de Subject: [RFC PATCH v3 3/5] imx: imx8mp_evk: override env_get_location Date: Sat, 25 Dec 2021 21:25:52 +0100 Message-Id: <20211225202554.47853-4-tomm.merciai@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211225202554.47853-1-tomm.merciai@gmail.com> References: <20211225202554.47853-1-tomm.merciai@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.2 at phobos.denx.de X-Virus-Status: Clean Override env_get_location function at board level, previously dropped down from soc.c References: - commit 37d3e3bb95d7532e2503f115dd6c6762fd3b0262 Signed-off-by: Tommaso Merciai --- Changes since v1: - Fix code indentation using checkpatch as suggested by MBehĂșn board/freescale/imx8mp_evk/imx8mp_evk.c | 34 +++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/board/freescale/imx8mp_evk/imx8mp_evk.c b/board/freescale/imx8mp_evk/imx8mp_evk.c index 62096c24fb..8548f606d2 100644 --- a/board/freescale/imx8mp_evk/imx8mp_evk.c +++ b/board/freescale/imx8mp_evk/imx8mp_evk.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -17,6 +18,7 @@ #include #include #include +#include DECLARE_GLOBAL_DATA_PTR; @@ -32,6 +34,38 @@ static iomux_v3_cfg_t const wdog_pads[] = { MX8MP_PAD_GPIO1_IO02__WDOG1_WDOG_B | MUX_PAD_CTRL(WDOG_PAD_CTRL), }; +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; +} + int board_early_init_f(void) { struct wdog_regs *wdog = (struct wdog_regs *)WDOG1_BASE_ADDR; From patchwork Sat Dec 25 20:25:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 1573196 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 (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=c3eF0h1e; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4JLwT30yJhz9sCD for ; Sun, 26 Dec 2021 07:27:03 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 550BF837EE; Sat, 25 Dec 2021 21:26:50 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="c3eF0h1e"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8B05483762; Sat, 25 Dec 2021 21:26:35 +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,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) (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 75FF0831E9 for ; Sat, 25 Dec 2021 21:26:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tomm.merciai@gmail.com Received: by mail-ed1-x52a.google.com with SMTP id f5so45676662edq.6 for ; Sat, 25 Dec 2021 12:26:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5N95ZJD38vy4ISBTlY8wOAgYYY4/zQcoFqO7OVEMHK8=; b=c3eF0h1ekMTLgcK5N2UUBzeFs4xKV0tmuTZrbXi60gQCdm4VBrHeWcPybs1PFXo8Kt Ni1LPH8NToUndOqYKp5ycPelS8PF/edVJy6X7MV8TJjYxWVTVgzTwenBmd81uPGC5Hp9 19Rd8i0AI8yCbmN8SGZoHV5yUmiI5gEy7MFNO6QHrVANjA0mV6xuk1ljF/V/g3F9Gzuu Rr54Gw7P0qX0KiwaqmeHbyt5HQ0q6l0X42Qa8l6y6kVW7jiztYIOExm8W431rMw8yi1E Z5b7Ho7eQl0OdhMPSmm3yP63U1ln+KNjwJRn5G+xMRRW5sKIYP4Kx+v7wWhieIrSVm42 GVqg== 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=5N95ZJD38vy4ISBTlY8wOAgYYY4/zQcoFqO7OVEMHK8=; b=6dzt/nxggZnGSEEThTxLTZLZWM5rwUg5Sf53MW7H0GWqe8QEXIJHuS8sv7RHuyaLRV +CCDdxJoQ3w5hGMwXf2JNT+2hABszbRcyuLy4d789cvhAX26Q1mwGmn1cFTYyDjEVk9E 7XhzOS9KzHmWkeADvkk3wpI2dgfI69JjzN6vafPZj/Z6kcmrh4+Y4V6F3RuuQ3eV8+K6 5fxIj4C4M/GsKE2NPjxOTSELNGzJYRKtyZWcH+DcJLMRiXLHwabFpqGFD+iZxIaR8O02 L0md3ign20bdqSYVUIjwdk63zORZgUU8LhF6izxtJOzwpFrWTYwJ2oC6fhCiuOc0qYhL 00Aw== X-Gm-Message-State: AOAM5321l/eZtgQl2mUbulMCB59KjfToZphGagN3ki+yxSKG+biBpbOC /ifMav/cNIuTlDscMhvOnyA= X-Google-Smtp-Source: ABdhPJw2qJFfM2d82k+9HiTJ2YWz9QCvC8yrxpn3Eos/VNjVQMtcew4gjxTc9wxgRfXcANRwrXcn8g== X-Received: by 2002:a17:907:1689:: with SMTP id hc9mr9010936ejc.228.1640463988128; Sat, 25 Dec 2021 12:26:28 -0800 (PST) Received: from tom-desktop.station (net-93-71-218-227.cust.vodafonedsl.it. [93.71.218.227]) by smtp.gmail.com with ESMTPSA id go10sm3684925ejc.100.2021.12.25.12.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Dec 2021 12:26:27 -0800 (PST) From: Tommaso Merciai To: Cc: tomm.merciai@gmail.com, michael@amarulasolutions.com, Adam Ford , Teresa Remmet , u-boot@lists.denx.de Subject: [RFC PATCH v3 4/5] beacon: imx8mn: override env_get_location in imx8mn_beacon.c Date: Sat, 25 Dec 2021 21:25:53 +0100 Message-Id: <20211225202554.47853-5-tomm.merciai@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211225202554.47853-1-tomm.merciai@gmail.com> References: <20211225202554.47853-1-tomm.merciai@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.2 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 37d3e3bb95d7532e2503f115dd6c6762fd3b0262 Signed-off-by: Tommaso Merciai --- board/beacon/imx8mn/imx8mn_beacon.c | 35 ++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/board/beacon/imx8mn/imx8mn_beacon.c b/board/beacon/imx8mn/imx8mn_beacon.c index 7fe252b262..05ab5613ee 100644 --- a/board/beacon/imx8mn/imx8mn_beacon.c +++ b/board/beacon/imx8mn/imx8mn_beacon.c @@ -6,14 +6,47 @@ #include #include #include - +#include #include #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; +} + #if IS_ENABLED(CONFIG_FEC_MXC) static int setup_fec(void) { From patchwork Sat Dec 25 20:25:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 1573198 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 (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=oXUBavVm; 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) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JLwTZ0ZqWz9sCD for ; Sun, 26 Dec 2021 07:27:29 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EF4E183800; Sat, 25 Dec 2021 21:26:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="oXUBavVm"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 93FB0831E9; Sat, 25 Dec 2021 21:26:37 +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,FREEMAIL_FROM,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) (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 4851F837E2 for ; Sat, 25 Dec 2021 21:26:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tomm.merciai@gmail.com Received: by mail-ed1-x52e.google.com with SMTP id q14so37999927edi.3 for ; Sat, 25 Dec 2021 12:26:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RGyCr1iEYc6QhEIiHm8IKI4T1u7g2v/Peut8jCxXhn0=; b=oXUBavVm+XDs+N3Uoh47QjakJad5R4IqWDVZPBy9hhBnNXpbEBewXcPprjN1TP98Tx 2lV9RERkliJhKBWv1xcqzyoj11Z3r+euouTxNFj1o+qU+rYDvBOuftuFPabYvDJKDxOs 80BtUcdTv/t2b9TY4USSsLu9xWY7mzE7fY95wn52bfiKWw4yqwhFCsRciD2m5ZDweROy PJYOTJpO4i/Rd/gYBdtUO9Jg8MDvHZ/8Sss6t26qvzIyUCgVxvIUtXnZHl0xKldLhqw2 xmgQqQEemvdoeRPYKY56uDIn7MNIxVvFi9IpC5klszS2c7AUUbWczCPKyu1wfE5GY4o4 envQ== 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=RGyCr1iEYc6QhEIiHm8IKI4T1u7g2v/Peut8jCxXhn0=; b=GkLs83xCaZoBdZkFkleEHMcA5C3ZonJllIoY50bCVRBE2dzXo4n+FBPmMBgQx9ruLv wdt64xopKmJf+GridQw8p8uCN5069TAuMEdFRv67r8kbQvkUcYXt5NILWqbOIqijETor mWQB8rs7fXK0RjEYnRFyjiK9x0fvIqFYeIgxAgrJQgiK1WkPMKEbCm7em7lwuucvVIAi F9+rir1I5FrWqMP7btP6j4npI88r2yDCn5uPTQ4U+L+bDK6T3KBuGHuGQTdd2poJFBjf rhVNEbia0Jb2YyaZC0cKj9R9bgU+GgejroixwUk8ARa8S6ZjG0z+mNYVW02b3nEFEmgm irHA== X-Gm-Message-State: AOAM530BtWmGTZzeE7+RevWzLqLIXUtgkWAnZQScaXKnEUskGXGMEt5a ziPHyp5Uad4xPZbiHYmtZaA= X-Google-Smtp-Source: ABdhPJwroEnCWfomElkalrY989+XO+f5C2GjYOnPLHcqulRLzA+w63tZCToDPk7VV87N9SpJUhZFqg== X-Received: by 2002:a17:907:94c2:: with SMTP id dn2mr9210497ejc.325.1640463989955; Sat, 25 Dec 2021 12:26:29 -0800 (PST) Received: from tom-desktop.station (net-93-71-218-227.cust.vodafonedsl.it. [93.71.218.227]) by smtp.gmail.com with ESMTPSA id go10sm3684925ejc.100.2021.12.25.12.26.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Dec 2021 12:26:29 -0800 (PST) From: Tommaso Merciai To: Cc: tomm.merciai@gmail.com, michael@amarulasolutions.com, Teresa Remmet , u-boot@lists.denx.de Subject: [RFC PATCH v3 5/5] phytec: phycore_imx8mp: override env_get_location in phycore-imx8mp.c Date: Sat, 25 Dec 2021 21:25:54 +0100 Message-Id: <20211225202554.47853-6-tomm.merciai@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211225202554.47853-1-tomm.merciai@gmail.com> References: <20211225202554.47853-1-tomm.merciai@gmail.com> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.2 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 37d3e3bb95d7532e2503f115dd6c6762fd3b0262 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 =