* [PATCH v2 1/2] imx8mn_ddr4_evk: Add USB Mass Storage support
@ 2022-04-21 17:24 Fabio Estevam
2022-04-21 17:24 ` [PATCH v2 2/2] imx8mn/8mp: Allow booting via USB Fabio Estevam
0 siblings, 1 reply; 3+ messages in thread
From: Fabio Estevam @ 2022-04-21 17:24 UTC (permalink / raw)
To: sbabic; +Cc: peng.fan, u-boot, aford173, michael, marex, Fabio Estevam
From: Fabio Estevam <festevam@denx.de>
Add USB Mass Storage support, which is a convenient way to flash
the eMMC card, for example.
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
Changes since v1:
- None
configs/imx8mn_ddr4_evk_defconfig | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/configs/imx8mn_ddr4_evk_defconfig b/configs/imx8mn_ddr4_evk_defconfig
index 917cdb5aa9d9..065f7392b706 100644
--- a/configs/imx8mn_ddr4_evk_defconfig
+++ b/configs/imx8mn_ddr4_evk_defconfig
@@ -42,6 +42,8 @@ CONFIG_CMD_FUSE=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_I2C=y
CONFIG_CMD_MMC=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_USB_MASS_STORAGE=y
CONFIG_CMD_CACHE=y
CONFIG_CMD_REGULATOR=y
CONFIG_CMD_EXT4_WRITE=y
@@ -82,4 +84,14 @@ CONFIG_SPL_SYSRESET=y
CONFIG_SYSRESET_PSCI=y
CONFIG_SYSRESET_WATCHDOG=y
CONFIG_DM_THERMAL=y
+CONFIG_USB=y
+# CONFIG_SPL_DM_USB is not set
+CONFIG_USB_EHCI_HCD=y
+CONFIG_MXC_USB_OTG_HACTIVE=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_MANUFACTURER="FSL"
+CONFIG_USB_GADGET_VENDOR_NUM=0x0525
+CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5
+CONFIG_CI_UDC=y
+CONFIG_USB_GADGET_DOWNLOAD=y
CONFIG_IMX_WATCHDOG=y
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2 2/2] imx8mn/8mp: Allow booting via USB
2022-04-21 17:24 [PATCH v2 1/2] imx8mn_ddr4_evk: Add USB Mass Storage support Fabio Estevam
@ 2022-04-21 17:24 ` Fabio Estevam
2022-04-21 17:26 ` Marek Vasut
0 siblings, 1 reply; 3+ messages in thread
From: Fabio Estevam @ 2022-04-21 17:24 UTC (permalink / raw)
To: sbabic; +Cc: peng.fan, u-boot, aford173, michael, marex, Fabio Estevam
From: Fabio Estevam <festevam@denx.de>
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 <michael@amarulasolutions.com>
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2 2/2] imx8mn/8mp: Allow booting via USB
2022-04-21 17:24 ` [PATCH v2 2/2] imx8mn/8mp: Allow booting via USB Fabio Estevam
@ 2022-04-21 17:26 ` Marek Vasut
0 siblings, 0 replies; 3+ messages in thread
From: Marek Vasut @ 2022-04-21 17:26 UTC (permalink / raw)
To: Fabio Estevam, sbabic; +Cc: peng.fan, u-boot, aford173, michael, Fabio Estevam
On 4/21/22 19:24, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
>
> 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 <michael@amarulasolutions.com>
> Signed-off-by: Fabio Estevam <festevam@denx.de>
> ---
> 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;
Shouldn't this last entry also be
if (IS_ENABLED(CONFIG_ENV_IS_NOWHERE))
return ENVL_NOWHERE;
?
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-04-21 17:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-21 17:24 [PATCH v2 1/2] imx8mn_ddr4_evk: Add USB Mass Storage support Fabio Estevam
2022-04-21 17:24 ` [PATCH v2 2/2] imx8mn/8mp: Allow booting via USB Fabio Estevam
2022-04-21 17:26 ` Marek Vasut
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.