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 494A8C433F5 for ; Thu, 21 Apr 2022 17:24:45 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id C032383F02; Thu, 21 Apr 2022 19:24:36 +0200 (CEST) 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="WIOXmSte"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4C0D183F17; Thu, 21 Apr 2022 19:24:34 +0200 (CEST) Received: from mail-oi1-x22d.google.com (mail-oi1-x22d.google.com [IPv6:2607:f8b0:4864:20::22d]) (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 85F0883EF0 for ; Thu, 21 Apr 2022 19:24:31 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=festevam@gmail.com Received: by mail-oi1-x22d.google.com with SMTP id z2so6325853oic.6 for ; Thu, 21 Apr 2022 10:24:31 -0700 (PDT) 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=Xxl957uKpEXBj2hmxOdNUWzonX3Foo7s1nubwQDs+Xk=; b=WIOXmSte6w7nDZAI5lMX01/5DqRQ/CKrK9p+RBRsgnD5dUFI9IVuO9KV/AK2VECxf6 33Dm3RTBsf+gXG9L5aMfy5m0SOwwKPSFsgAMOsPcNhXNcKyQKcW2YXQIQcTJ9Ns0e7F4 xL2SqkXDwgA5jNGQPJz5aZYtbW2/v8e3MPj7Upswnjd/FdtdwZpW6byO1+8/lLtHas96 g7eLIl76IIdTgDKWZqVLOmYJeGgX+3kCFeddkgkqu741IWS/8eNpy9o1A9LD6BjyPL2C Etop7d+RE+t0XwifWFlk5rRnNUmP6Ar9XnDFIQqjy1adAE/4gyeP0wuwf0oz8ULzAeJI o3ww== 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=Xxl957uKpEXBj2hmxOdNUWzonX3Foo7s1nubwQDs+Xk=; b=eS9QVu8kSJ9CmUmIGGaWTwIcoR3s7VJCGxgZAKMS/65L74KFY19Fe3Glr3p/P4ZV47 V0AoU5YCRgqaPfRz7hSq2g0Z7HPEWDv/ZSRABXI4cbMbbvc5dCDVNjp9lOwWAcMQ2E3w jtZcJx5ykF64p06CW4MIdtUcubd+vdQzX1xZ2x7W57WyaCYBaBoqzDjcb4XU7yB2x91v 5OIrRrjiuVewwqwWmQVVR0Wq0XcO6TI3PEd8L6rtcz1vTSnAkRrKZBuTpjyHnCyUmU/O vVPg2hVmo7FpTkzjJMj+Be6jqPRcjIN3KNzULuiXmvNll/E69dN5RIAOf3sF9PtVQXiK xvpQ== X-Gm-Message-State: AOAM5336RUlvnRgqWyP7gNtQZrL504DyfI2Uow5Cqjegq4n2AR6d81FW kxDzwg4EK03oB1oYUtiv5H9Lne5/6O0= X-Google-Smtp-Source: ABdhPJxFqSTfD7aw+k55gujZg7DHif5ctFVoKmDSQkKVWOhTeem4x6MZwFpAxbCxVXWPozr/xlmlOg== X-Received: by 2002:a05:6808:1584:b0:322:6c50:9feb with SMTP id t4-20020a056808158400b003226c509febmr4757526oiw.33.1650561870281; Thu, 21 Apr 2022 10:24:30 -0700 (PDT) Received: from localhost.localdomain ([2804:14c:485:4b69:c003:f945:ad3e:e82]) by smtp.gmail.com with ESMTPSA id b16-20020a056870471000b000e5caa2b264sm1263249oaq.20.2022.04.21.10.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 10:24:29 -0700 (PDT) From: Fabio Estevam To: sbabic@denx.de Cc: peng.fan@nxp.com, u-boot@lists.denx.de, aford173@gmail.com, michael@amarulasolutions.com, marex@denx.de, Fabio Estevam Subject: [PATCH v2 2/2] imx8mn/8mp: Allow booting via USB Date: Thu, 21 Apr 2022 14:24:11 -0300 Message-Id: <20220421172411.1319053-2-festevam@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220421172411.1319053-1-festevam@gmail.com> References: <20220421172411.1319053-1-festevam@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 From: Fabio Estevam When trying to boot via USB on i.MX8MN it is necessary to specify the U-Boot environment location, otherwise the boot process simply hangs. Specify the environment location when booting from USB. Tested on a imx8mn-evk. Suggested-by: Michael Nazzareno Trimarchi Signed-off-by: Fabio Estevam --- Changes since v1: - Handle the env selection for the USB_BOOT case (Michael). arch/arm/mach-imx/imx8m/soc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c index 7059d87e336b..34f8475bca46 100644 --- 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)) -- 2.25.1