From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0D022C433F5 for ; Thu, 21 Apr 2022 16:47:14 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C21EE83E7A; Thu, 21 Apr 2022 18:47:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1650559632; bh=nfb93cJaDKVsU1ryvfKht12RzTp8Jf045tZmeUNNmMM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=CUamKJgW2lEMLWtI31paCqqxKiU/XgHfNPatk9tWoPB/hPxuEZbS+qRsSs/ooTG9m P34T2b1px8mCQpu7+J4q2A639k2ipa9frgmUFPQyK8cc+h1VXboh0U0UmAqb00+WAK u1GjnjEdG66HMAltz4d6SVR+GKRyL1RaQWESDp1e2gpl+21k9R9akTFnGOSt8ERD+n hiCejTtHRNZYIEZIgJkCogOtIZ9ReUf/nNK53s03J6xJn8arWu6idY4WazKywsuydP 2EZwaPnqoi11PJKUW7FMVnhNocsSc01y+jvwIIxmeUb1VrAKOl1TKkUn8IXlgr0Epj iNxA1O/mh39Ew== Received: from mail.denx.de (unknown [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: festevam@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id F129A8394D; Thu, 21 Apr 2022 18:47:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1650559630; bh=nfb93cJaDKVsU1ryvfKht12RzTp8Jf045tZmeUNNmMM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ooSbjC/rB36wors+S5C6YC5h4M2jZIubDMsQVc2f9ggb33I0Jao3+pZqoybvR+dSM QAC99UoQ+MsOwKFJ2BDzoxQCADETpn6+qeZ7vTY1R77Ni9v5AWbLPwUKWkxkrUUPyC UIr8MYQA2UyW8XfSRxns1JLEnx1HlrhCgenbY0sMY1oG5wttb9pK6q1cUr3haJ7Ha8 8UDi5J9/Ck4ekUYGpFUFuYfPJa5Qeh2RyEPLLd7Gq0lPrQpskjB6hX+zKwm9hTbXi3 da5xBABG2uJVPkt4hOdDYyqHun9P7sF1sSYg7SbFFElv3YyYOqCT+KpfRXoA1fULxN lcBRzP3zWXP7Q== MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 21 Apr 2022 13:47:09 -0300 From: Fabio Estevam To: Michael Nazzareno Trimarchi Cc: Fabio Estevam , Marek Vasut , Stefano Babic , Peng Fan , U-Boot-Denx , Adam Ford Subject: Re: [PATCH 2/2] imx8mn/8mp: Select ENV_IS_NOWHERE In-Reply-To: References: <20220420210757.1184891-1-festevam@gmail.com> <20220420210757.1184891-2-festevam@gmail.com> Message-ID: X-Sender: festevam@denx.de User-Agent: Roundcube Webmail/1.3.6 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 Hi Michael, On 21/04/2022 13:34, Michael Nazzareno Trimarchi wrote: > That function should drop. There is not other architecture that does > it. What about: I implemented your suggestion like this: --- a/arch/arm/mach-imx/imx8m/soc.c +++ b/arch/arm/mach-imx/imx8m/soc.c @@ -1536,6 +1536,14 @@ enum env_location arch_env_get_location(enum env_operation op, int prio) return ENVL_UNKNOWN; switch (dev) { + case USB_BOOT: + if (IS_ENABLED(CONFIG_ENV_IS_IN_SPI_FLASH)) + return ENVL_SPI_FLASH; + if (IS_ENABLED(CONFIG_ENV_IS_IN_NAND)) + return ENVL_NAND; + if (IS_ENABLED(CONFIG_ENV_IS_IN_MMC)) + return ENVL_MMC; + return ENVL_NOWHERE; case QSPI_BOOT: case SPI_NOR_BOOT: if (IS_ENABLED(CONFIG_ENV_IS_IN_SPI_FLASH)) This still allows me to save the env into the eMMC when U-Boot is loaded from USB. > register_enviroment_hook() > deregister_enviroment_hook() > > This can replace the one default with board/arch etc Marek submitted these patches: https://source.denx.de/u-boot/u-boot/-/commit/de70e8879bb253f4d2a9ba9149cd41cb38b94ed8 https://source.denx.de/u-boot/u-boot/-/commit/e4dc2d0620851d6e0e784d4ef0a50f26e1e73857 Is this the mechanism that you are looking for?