* [PATCH 0/6] imx95: support USB SDP on USB3 interface
@ 2025-07-19 22:13 Alice Guo (OSS)
2025-07-19 22:13 ` [PATCH 1/6] Update VID/PID Alice Guo (OSS)
` (5 more replies)
0 siblings, 6 replies; 16+ messages in thread
From: Alice Guo (OSS) @ 2025-07-19 22:13 UTC (permalink / raw)
To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team, Tom Rini,
Peng Fan, Troy Kisky, Adrian Alonso, Lukasz Majewski,
Mattijs Korpershoek, Marek Vasut, Tim Harvey, Alice Guo
Cc: u-boot, Ye Li, Frank Li, Jacky Bai
Signed-off-by: Alice Guo <alice.guo@nxp.com>
---
Alice Guo (2):
usb: dwc3: gadget: Add delay after software writes DCTL in dwc3_gadget_run_stop()
imx95: Add support for booting from USB SDP on USB3
Frank Li (1):
Add serial# for SPL SDP download
Ye Li (3):
Update VID/PID
usb: f_sdp: Update SDP driver to support PQC container
imx95: Remove ROM info USB instance workaround for B0
arch/arm/dts/imx95-19x19-evk-u-boot.dtsi | 8 ++++++++
arch/arm/mach-imx/imx9/scmi/soc.c | 2 --
arch/arm/mach-imx/spl.c | 12 +++++++++++-
configs/imx8m_data_modul.config | 4 ++--
configs/imx8mm_evk_defconfig | 4 ++--
configs/imx8mn_ddr4_evk_defconfig | 4 ++--
configs/imx8mp_evk_defconfig | 4 ++--
configs/imx95_19x19_evk_defconfig | 13 ++++++++++++-
configs/mx6qsabrelite_defconfig | 4 ++--
configs/mx6sabreauto_defconfig | 4 ++--
configs/mx6sabresd_defconfig | 4 ++--
configs/mx6ul_14x14_evk_defconfig | 4 ++--
configs/mx7dsabresd_defconfig | 4 ++--
drivers/usb/dwc3/gadget.c | 1 +
drivers/usb/gadget/f_sdp.c | 2 +-
15 files changed, 51 insertions(+), 23 deletions(-)
---
base-commit: 182cb30084516c3085d2ca5dde3f105f7625d774
change-id: 20250720-imx95-c51f08620358
Best regards,
--
Alice Guo <alice.guo@oss.nxp.com>
^ permalink raw reply [flat|nested] 16+ messages in thread* [PATCH 1/6] Update VID/PID 2025-07-19 22:13 [PATCH 0/6] imx95: support USB SDP on USB3 interface Alice Guo (OSS) @ 2025-07-19 22:13 ` Alice Guo (OSS) 2025-07-31 19:08 ` Tim Harvey 2025-07-19 22:13 ` [PATCH 2/6] Add serial# for SPL SDP download Alice Guo (OSS) ` (4 subsequent siblings) 5 siblings, 1 reply; 16+ messages in thread From: Alice Guo (OSS) @ 2025-07-19 22:13 UTC (permalink / raw) To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team, Tom Rini, Peng Fan, Troy Kisky, Adrian Alonso, Lukasz Majewski, Mattijs Korpershoek, Marek Vasut, Tim Harvey, Alice Guo Cc: u-boot, Ye Li, Frank Li From: Ye Li <ye.li@nxp.com> VID 0x525 and PID 0xa4a5 already registered as PLX Technology, Inc. Linux-USB File-backed Storage Gadget But fastboot device is not mass storage devices windowns 10 latest update already cached above vid/pid Change to use Freescale VID 0x1fc9 PID 0x151, for SPL SDP HID download PID 0x152, for Fastboot PID 0x153, for Kernel fastboot Need update uuu above 1.4.182 Signed-off-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Alice Guo <alice.guo@nxp.com> Reviewed-by: Ye Li <ye.li@nxp.com> --- arch/arm/mach-imx/spl.c | 2 +- configs/imx8m_data_modul.config | 4 ++-- configs/imx8mm_evk_defconfig | 4 ++-- configs/imx8mn_ddr4_evk_defconfig | 4 ++-- configs/imx8mp_evk_defconfig | 4 ++-- configs/mx6qsabrelite_defconfig | 4 ++-- configs/mx6sabreauto_defconfig | 4 ++-- configs/mx6sabresd_defconfig | 4 ++-- configs/mx6ul_14x14_evk_defconfig | 4 ++-- configs/mx7dsabresd_defconfig | 4 ++-- 10 files changed, 19 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c index 518d9cb1262..4a86d8698b4 100644 --- a/arch/arm/mach-imx/spl.c +++ b/arch/arm/mach-imx/spl.c @@ -184,7 +184,7 @@ u32 spl_boot_device(void) #ifdef CONFIG_SPL_USB_GADGET int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name) { - put_unaligned(CONFIG_USB_GADGET_PRODUCT_NUM + 0xfff, &dev->idProduct); + put_unaligned(0x0151, &dev->idProduct); return 0; } diff --git a/configs/imx8m_data_modul.config b/configs/imx8m_data_modul.config index 4634a0972f0..d56208b6a14 100644 --- a/configs/imx8m_data_modul.config +++ b/configs/imx8m_data_modul.config @@ -213,8 +213,8 @@ CONFIG_USB_FUNCTION_ACM=y CONFIG_USB_FUNCTION_FASTBOOT=y CONFIG_USB_GADGET=y CONFIG_USB_GADGET_MANUFACTURER="Data Modul" -CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 -CONFIG_USB_GADGET_VENDOR_NUM=0x0525 +CONFIG_USB_GADGET_PRODUCT_NUM=0x1fc9 +CONFIG_USB_GADGET_VENDOR_NUM=0x0152 CONFIG_USB_HUB_USB251XB=y CONFIG_USB_STORAGE=y CONFIG_USE_BOOTARGS=y diff --git a/configs/imx8mm_evk_defconfig b/configs/imx8mm_evk_defconfig index c15372edc9c..0ca7eb88436 100644 --- a/configs/imx8mm_evk_defconfig +++ b/configs/imx8mm_evk_defconfig @@ -129,8 +129,8 @@ CONFIG_MXC_USB_OTG_HACTIVE=y CONFIG_USB_GADGET=y CONFIG_SPL_USB_GADGET=y CONFIG_USB_GADGET_MANUFACTURER="FSL" -CONFIG_USB_GADGET_VENDOR_NUM=0x0525 -CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 +CONFIG_USB_GADGET_VENDOR_NUM=0x1fc9 +CONFIG_USB_GADGET_PRODUCT_NUM=0x0152 CONFIG_CI_UDC=y CONFIG_SDP_LOADADDR=0x40400000 CONFIG_USB_GADGET_DOWNLOAD=y diff --git a/configs/imx8mn_ddr4_evk_defconfig b/configs/imx8mn_ddr4_evk_defconfig index a80ceab56f5..e524beb7af7 100644 --- a/configs/imx8mn_ddr4_evk_defconfig +++ b/configs/imx8mn_ddr4_evk_defconfig @@ -103,8 +103,8 @@ 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_USB_GADGET_VENDOR_NUM=0x1fc9 +CONFIG_USB_GADGET_PRODUCT_NUM=0x0152 CONFIG_CI_UDC=y CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_IMX_WATCHDOG=y diff --git a/configs/imx8mp_evk_defconfig b/configs/imx8mp_evk_defconfig index 0ad1acb94b6..8c04e12fa18 100644 --- a/configs/imx8mp_evk_defconfig +++ b/configs/imx8mp_evk_defconfig @@ -150,7 +150,7 @@ CONFIG_USB_DWC3=y CONFIG_USB_DWC3_GENERIC=y CONFIG_USB_GADGET=y CONFIG_USB_GADGET_MANUFACTURER="FSL" -CONFIG_USB_GADGET_VENDOR_NUM=0x0525 -CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 +CONFIG_USB_GADGET_VENDOR_NUM=0x1fc9 +CONFIG_USB_GADGET_PRODUCT_NUM=0x0152 CONFIG_IMX_WATCHDOG=y CONFIG_SHA384=y diff --git a/configs/mx6qsabrelite_defconfig b/configs/mx6qsabrelite_defconfig index da07b38b4bc..3d5ff03aab7 100644 --- a/configs/mx6qsabrelite_defconfig +++ b/configs/mx6qsabrelite_defconfig @@ -76,8 +76,8 @@ CONFIG_USB_KEYBOARD=y CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP=y CONFIG_USB_GADGET=y CONFIG_USB_GADGET_MANUFACTURER="Boundary" -CONFIG_USB_GADGET_VENDOR_NUM=0x0525 -CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 +CONFIG_USB_GADGET_VENDOR_NUM=0x1fc9 +CONFIG_USB_GADGET_PRODUCT_NUM=0x0152 CONFIG_CI_UDC=y CONFIG_USB_ETHER=y CONFIG_USB_ETH_CDC=y diff --git a/configs/mx6sabreauto_defconfig b/configs/mx6sabreauto_defconfig index 66ae436b538..26045986e49 100644 --- a/configs/mx6sabreauto_defconfig +++ b/configs/mx6sabreauto_defconfig @@ -103,8 +103,8 @@ CONFIG_USB_ETHER_ASIX=y CONFIG_USB_GADGET=y CONFIG_SPL_USB_GADGET=y CONFIG_USB_GADGET_MANUFACTURER="FSL" -CONFIG_USB_GADGET_VENDOR_NUM=0x0525 -CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 +CONFIG_USB_GADGET_VENDOR_NUM=0x1fc9 +CONFIG_USB_GADGET_PRODUCT_NUM=0x0152 CONFIG_CI_UDC=y CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_SPL_USB_SDP_SUPPORT=y diff --git a/configs/mx6sabresd_defconfig b/configs/mx6sabresd_defconfig index 75a655a0e0d..6a1ffb58c88 100644 --- a/configs/mx6sabresd_defconfig +++ b/configs/mx6sabresd_defconfig @@ -117,8 +117,8 @@ CONFIG_USB_ETHER_ASIX=y CONFIG_USB_GADGET=y CONFIG_SPL_USB_GADGET=y CONFIG_USB_GADGET_MANUFACTURER="FSL" -CONFIG_USB_GADGET_VENDOR_NUM=0x0525 -CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 +CONFIG_USB_GADGET_VENDOR_NUM=0x1fc9 +CONFIG_USB_GADGET_PRODUCT_NUM=0x0152 CONFIG_CI_UDC=y CONFIG_SPL_USB_SDP_SUPPORT=y CONFIG_VIDEO=y diff --git a/configs/mx6ul_14x14_evk_defconfig b/configs/mx6ul_14x14_evk_defconfig index 0e35e5e6af5..a07fd510bf7 100644 --- a/configs/mx6ul_14x14_evk_defconfig +++ b/configs/mx6ul_14x14_evk_defconfig @@ -98,8 +98,8 @@ CONFIG_USB_STORAGE=y CONFIG_USB_GADGET=y CONFIG_SPL_USB_GADGET=y CONFIG_USB_GADGET_MANUFACTURER="FSL" -CONFIG_USB_GADGET_VENDOR_NUM=0x0525 -CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 +CONFIG_USB_GADGET_VENDOR_NUM=0x1fc9 +CONFIG_USB_GADGET_PRODUCT_NUM=0x0152 CONFIG_CI_UDC=y CONFIG_SPL_USB_SDP_SUPPORT=y CONFIG_VIDEO=y diff --git a/configs/mx7dsabresd_defconfig b/configs/mx7dsabresd_defconfig index a5a562af0c0..c3a7bd62dc5 100644 --- a/configs/mx7dsabresd_defconfig +++ b/configs/mx7dsabresd_defconfig @@ -83,8 +83,8 @@ CONFIG_USB_HOST_ETHER=y CONFIG_USB_ETHER_ASIX=y CONFIG_USB_GADGET=y CONFIG_USB_GADGET_MANUFACTURER="FSL" -CONFIG_USB_GADGET_VENDOR_NUM=0x0525 -CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 +CONFIG_USB_GADGET_VENDOR_NUM=0x1fc9 +CONFIG_USB_GADGET_PRODUCT_NUM=0x0152 CONFIG_CI_UDC=y CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_IMX_WATCHDOG=y -- 2.43.0 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 1/6] Update VID/PID 2025-07-19 22:13 ` [PATCH 1/6] Update VID/PID Alice Guo (OSS) @ 2025-07-31 19:08 ` Tim Harvey 0 siblings, 0 replies; 16+ messages in thread From: Tim Harvey @ 2025-07-31 19:08 UTC (permalink / raw) To: Ye Li Cc: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team, Tom Rini, Peng Fan, Troy Kisky, Adrian Alonso, Lukasz Majewski, Mattijs Korpershoek, Marek Vasut, Alice Guo, u-boot, Frank Li, Alice Guo (OSS) On Tue, Jul 29, 2025 at 4:19 AM Alice Guo (OSS) <alice.guo@oss.nxp.com> wrote: > > From: Ye Li <ye.li@nxp.com> > Hi Ye, I think a better commit subject would be 'imx: Update SDP VID/PID' or something more descriptive than what you have. > VID 0x525 and PID 0xa4a5 already registered as > PLX Technology, Inc. > Linux-USB File-backed Storage Gadget > > But fastboot device is not mass storage devices > windowns 10 latest update already cached above vid/pid s/windowns/Windows/ > > Change to use Freescale VID 0x1fc9 > > PID 0x151, for SPL SDP HID download > PID 0x152, for Fastboot > PID 0x153, for Kernel fastboot > Please expand a bit on why you need to change these exactly. It took me a while to figure out how the VID/PID's affect uuu and what you are trying to do here: The uuu tool maps VID/PID/BCD values to protocols (see 'uuu -v' for a list) and supports built-in scripts mapping protocols to various functions (see 'uuu -bshow'). Before these changes for these defconfigs: - SPL SDP enumerates as 0x0525:0xb4a4:0x500 which uuu maps to the SDPV protocol (the 0xb4a4 comes from adding 0xfff to the PID which was indeed strange) - U-Boot SDP command enumerates as 0x0525:0xa4a5 which uuu maps to the FB (fastboot) protocol After your changes for these defconfigs: - SPL SDP enumerates as 0x1FC9:0x0151:0x0500 which uuu also maps to the SDPV protocol. - U-Boot SDP command enumerates as 0x1FC9:0x0152 which uuu maps to the FB (fastboot) protocol So with respect to using uuu on these devices the protocols and thus functions have not changed and what you were really trying to do is properly use NXP ID's instead of squatting on the PLX ID's for historic reasons. Is there any other side effect of changing VID/PID here when not using uuu? I'm not very familiar with Windows drivers... Perhaps there was a Windows driver binding to the old VID/PID getting in the way of using uuu on Windows? I'm not clear what other OS's like could be used here. > Need update uuu above 1.4.182 > > Signed-off-by: Frank Li <Frank.Li@nxp.com> > Signed-off-by: Alice Guo <alice.guo@nxp.com> > Reviewed-by: Ye Li <ye.li@nxp.com> > --- > arch/arm/mach-imx/spl.c | 2 +- > configs/imx8m_data_modul.config | 4 ++-- > configs/imx8mm_evk_defconfig | 4 ++-- > configs/imx8mn_ddr4_evk_defconfig | 4 ++-- > configs/imx8mp_evk_defconfig | 4 ++-- > configs/mx6qsabrelite_defconfig | 4 ++-- > configs/mx6sabreauto_defconfig | 4 ++-- > configs/mx6sabresd_defconfig | 4 ++-- > configs/mx6ul_14x14_evk_defconfig | 4 ++-- > configs/mx7dsabresd_defconfig | 4 ++-- > 10 files changed, 19 insertions(+), 19 deletions(-) Why are you suggesting changing specifically these defconfigs and not all imx defconfigs? It seems you cherry-picked a handful but they don't all look like NXP maintained boards to me. > > diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c > index 518d9cb1262..4a86d8698b4 100644 > --- a/arch/arm/mach-imx/spl.c > +++ b/arch/arm/mach-imx/spl.c > @@ -184,7 +184,7 @@ u32 spl_boot_device(void) > #ifdef CONFIG_SPL_USB_GADGET > int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name) > { > - put_unaligned(CONFIG_USB_GADGET_PRODUCT_NUM + 0xfff, &dev->idProduct); > + put_unaligned(0x0151, &dev->idProduct); A comment here indicating that 0x1fc9:0x151 is mapped by uuu to the SDPV protocol would be handy. The magic 0xa4a5+0xfff=0xb4a4 which maps to SDPV was very strange and confusing for sure. Should the VID be hard coded to 0x1fc9 as well? I think these should be #defines in this file. But, because you are only changing a handful of IMX defconfigs you are completely breaking SDP for all other imx defconfigs with the above change so: NAK Note that I would agree with not using the PLX ID's in general. Also note that this patch isn't necessary for Alice's series and can be dropped from that series. Best Regards, Tim ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 2/6] Add serial# for SPL SDP download 2025-07-19 22:13 [PATCH 0/6] imx95: support USB SDP on USB3 interface Alice Guo (OSS) 2025-07-19 22:13 ` [PATCH 1/6] Update VID/PID Alice Guo (OSS) @ 2025-07-19 22:13 ` Alice Guo (OSS) 2025-07-19 22:13 ` [PATCH 3/6] usb: f_sdp: Update SDP driver to support PQC container Alice Guo (OSS) ` (3 subsequent siblings) 5 siblings, 0 replies; 16+ messages in thread From: Alice Guo (OSS) @ 2025-07-19 22:13 UTC (permalink / raw) To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team, Tom Rini, Peng Fan, Troy Kisky, Adrian Alonso, Lukasz Majewski, Mattijs Korpershoek, Marek Vasut, Tim Harvey, Alice Guo Cc: u-boot, Frank Li, Ye Li From: Frank Li <Frank.Li@nxp.com> After update this, uuu(>1.6) can use below command to filter out devices when multi boards connected. uuu -ms <serial#> ... [sudo] uuu -lsusb can list known devices with serial# informaiton. Signed-off-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Alice Guo <alice.guo@nxp.com> Reviewed-by: Ye Li <ye.li@nxp.com> --- arch/arm/mach-imx/spl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c index 4a86d8698b4..24a8cf167d1 100644 --- a/arch/arm/mach-imx/spl.c +++ b/arch/arm/mach-imx/spl.c @@ -21,6 +21,8 @@ #include <g_dnl.h> #include <linux/libfdt.h> #include <memalign.h> +#include <asm/setup.h> +#include <asm/bootm.h> DECLARE_GLOBAL_DATA_PTR; @@ -184,6 +186,14 @@ u32 spl_boot_device(void) #ifdef CONFIG_SPL_USB_GADGET int g_dnl_bind_fixup(struct usb_device_descriptor *dev, const char *name) { +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + struct tag_serialnr serialnr; + char serial_string[0x21] = {0}; + + get_board_serial(&serialnr); + snprintf(serial_string, sizeof(serial_string), "%08x%08x", serialnr.high, serialnr.low); + g_dnl_set_serialnumber(serial_string); +#endif put_unaligned(0x0151, &dev->idProduct); return 0; -- 2.43.0 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 3/6] usb: f_sdp: Update SDP driver to support PQC container 2025-07-19 22:13 [PATCH 0/6] imx95: support USB SDP on USB3 interface Alice Guo (OSS) 2025-07-19 22:13 ` [PATCH 1/6] Update VID/PID Alice Guo (OSS) 2025-07-19 22:13 ` [PATCH 2/6] Add serial# for SPL SDP download Alice Guo (OSS) @ 2025-07-19 22:13 ` Alice Guo (OSS) 2025-07-19 22:13 ` [PATCH 4/6] imx95: Remove ROM info USB instance workaround for B0 Alice Guo (OSS) ` (2 subsequent siblings) 5 siblings, 0 replies; 16+ messages in thread From: Alice Guo (OSS) @ 2025-07-19 22:13 UTC (permalink / raw) To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team, Tom Rini, Peng Fan, Troy Kisky, Adrian Alonso, Lukasz Majewski, Mattijs Korpershoek, Marek Vasut, Tim Harvey, Alice Guo Cc: u-boot, Ye Li, Jacky Bai From: Ye Li <ye.li@nxp.com> Since PQC container has changed version to 0x2 in container header, update the header's check. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Alice Guo <alice.guo@nxp.com> Acked-by: Peng Fan <peng.fan@nxp.com> Reviewed-by: Jacky Bai <ping.bai@nxp.com> --- drivers/usb/gadget/f_sdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c index 647001d8dd0..f72e27028b7 100644 --- a/drivers/usb/gadget/f_sdp.c +++ b/drivers/usb/gadget/f_sdp.c @@ -765,7 +765,7 @@ static ulong search_container_header(ulong p, int size) for (i = 0; i < size; i += 4) { hdr = (u8 *)(p + i); - if (*(hdr + 3) == 0x87 && *hdr == 0) + if (*(hdr + 3) == 0x87 && (*hdr == 0 || *hdr == 2)) if (*(hdr + 1) != 0 || *(hdr + 2) != 0) return p + i; } -- 2.43.0 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH 4/6] imx95: Remove ROM info USB instance workaround for B0 2025-07-19 22:13 [PATCH 0/6] imx95: support USB SDP on USB3 interface Alice Guo (OSS) ` (2 preceding siblings ...) 2025-07-19 22:13 ` [PATCH 3/6] usb: f_sdp: Update SDP driver to support PQC container Alice Guo (OSS) @ 2025-07-19 22:13 ` Alice Guo (OSS) 2025-07-29 16:16 ` Tim Harvey 2025-07-19 22:13 ` [PATCH 5/6] usb: dwc3: gadget: Add delay after software writes DCTL in dwc3_gadget_run_stop() Alice Guo (OSS) 2025-07-19 22:13 ` [PATCH 6/6] imx95: Add support for booting from USB SDP on USB3 Alice Guo (OSS) 5 siblings, 1 reply; 16+ messages in thread From: Alice Guo (OSS) @ 2025-07-19 22:13 UTC (permalink / raw) To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team, Tom Rini, Peng Fan, Troy Kisky, Adrian Alonso, Lukasz Majewski, Mattijs Korpershoek, Marek Vasut, Tim Harvey, Alice Guo Cc: u-boot, Ye Li From: Ye Li <ye.li@nxp.com> There was a bug in ROM on A0 for USB instance: USB1 is 3, USB2 is 4. So u-boot had a workaround to match with it. Since the issue is fixed on B0, so need a additional change. Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Alice Guo <alice.guo@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> --- arch/arm/mach-imx/imx9/scmi/soc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm/mach-imx/imx9/scmi/soc.c b/arch/arm/mach-imx/imx9/scmi/soc.c index 13f13ca7d10..b21b18110b1 100644 --- a/arch/arm/mach-imx/imx9/scmi/soc.c +++ b/arch/arm/mach-imx/imx9/scmi/soc.c @@ -719,8 +719,6 @@ enum boot_device get_boot_device(void) break; case BT_DEV_TYPE_USB: boot_dev = boot_instance + USB_BOOT; - if (IS_ENABLED(CONFIG_IMX95)) - boot_dev -= 3; //iMX95 usb instance start at 3 break; default: break; -- 2.43.0 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 4/6] imx95: Remove ROM info USB instance workaround for B0 2025-07-19 22:13 ` [PATCH 4/6] imx95: Remove ROM info USB instance workaround for B0 Alice Guo (OSS) @ 2025-07-29 16:16 ` Tim Harvey 0 siblings, 0 replies; 16+ messages in thread From: Tim Harvey @ 2025-07-29 16:16 UTC (permalink / raw) To: Alice Guo (OSS) Cc: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team, Tom Rini, Peng Fan, Troy Kisky, Adrian Alonso, Lukasz Majewski, Mattijs Korpershoek, Marek Vasut, Alice Guo, u-boot, Ye Li On Tue, Jul 29, 2025 at 4:20 AM Alice Guo (OSS) <alice.guo@oss.nxp.com> wrote: > > From: Ye Li <ye.li@nxp.com> > > There was a bug in ROM on A0 for USB instance: USB1 is 3, USB2 is 4. > So u-boot had a workaround to match with it. > Since the issue is fixed on B0, so need a additional change. > > Signed-off-by: Ye Li <ye.li@nxp.com> > Signed-off-by: Alice Guo <alice.guo@nxp.com> > Reviewed-by: Peng Fan <peng.fan@nxp.com> > --- > arch/arm/mach-imx/imx9/scmi/soc.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/arch/arm/mach-imx/imx9/scmi/soc.c b/arch/arm/mach-imx/imx9/scmi/soc.c > index 13f13ca7d10..b21b18110b1 100644 > --- a/arch/arm/mach-imx/imx9/scmi/soc.c > +++ b/arch/arm/mach-imx/imx9/scmi/soc.c > @@ -719,8 +719,6 @@ enum boot_device get_boot_device(void) > break; > case BT_DEV_TYPE_USB: > boot_dev = boot_instance + USB_BOOT; > - if (IS_ENABLED(CONFIG_IMX95)) > - boot_dev -= 3; //iMX95 usb instance start at 3 > break; > default: > break; > > -- > 2.43.0 > Hi Alice, NAK. Please do not drop support for A0 (or send B0 EVK's to every user who has an A0 EVK) or you will not be able to get any testing from anyone in the community. Best Regards, Tim ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 5/6] usb: dwc3: gadget: Add delay after software writes DCTL in dwc3_gadget_run_stop() 2025-07-19 22:13 [PATCH 0/6] imx95: support USB SDP on USB3 interface Alice Guo (OSS) ` (3 preceding siblings ...) 2025-07-19 22:13 ` [PATCH 4/6] imx95: Remove ROM info USB instance workaround for B0 Alice Guo (OSS) @ 2025-07-19 22:13 ` Alice Guo (OSS) 2025-09-29 8:46 ` Mattijs Korpershoek 2025-07-19 22:13 ` [PATCH 6/6] imx95: Add support for booting from USB SDP on USB3 Alice Guo (OSS) 5 siblings, 1 reply; 16+ messages in thread From: Alice Guo (OSS) @ 2025-07-19 22:13 UTC (permalink / raw) To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team, Tom Rini, Peng Fan, Troy Kisky, Adrian Alonso, Lukasz Majewski, Mattijs Korpershoek, Marek Vasut, Tim Harvey, Alice Guo Cc: u-boot From: Alice Guo <alice.guo@nxp.com> When using NXP UUU to download flash.bin to i.MX95 19x19 evk board, it will get stuck in a loop at sdp_init() without this change. Signed-off-by: Alice Guo <alice.guo@nxp.com> --- drivers/usb/dwc3/gadget.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 2b01113d54c..6b2b25c7aa5 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1423,6 +1423,7 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend) } dwc3_writel(dwc->regs, DWC3_DCTL, reg); + mdelay(2); do { reg = dwc3_readl(dwc->regs, DWC3_DSTS); -- 2.43.0 ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH 5/6] usb: dwc3: gadget: Add delay after software writes DCTL in dwc3_gadget_run_stop() 2025-07-19 22:13 ` [PATCH 5/6] usb: dwc3: gadget: Add delay after software writes DCTL in dwc3_gadget_run_stop() Alice Guo (OSS) @ 2025-09-29 8:46 ` Mattijs Korpershoek 2025-10-09 10:16 ` 回复: [EXT] " Alice Guo ` (4 more replies) 0 siblings, 5 replies; 16+ messages in thread From: Mattijs Korpershoek @ 2025-09-29 8:46 UTC (permalink / raw) To: Alice Guo (OSS), Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team, Tom Rini, Peng Fan, Troy Kisky, Adrian Alonso, Lukasz Majewski, Mattijs Korpershoek, Marek Vasut, Tim Harvey, Alice Guo Cc: u-boot Hi Alice, Thank you for the patch. On Sun, Jul 20, 2025 at 06:13, "Alice Guo (OSS)" <alice.guo@oss.nxp.com> wrote: > From: Alice Guo <alice.guo@nxp.com> > > When using NXP UUU to download flash.bin to i.MX95 19x19 evk board, it > will get stuck in a loop at sdp_init() without this change. > > Signed-off-by: Alice Guo <alice.guo@nxp.com> I see that a similar change exist in the Linux kernel: https://lore.kernel.org/all/20220901193625.8727-4-quic_wcheng@quicinc.com/ Please mention this change in the commit message for v2. See the following example: https://lore.kernel.org/all/20250110-dwc2-dev-v4-7-987f4fd6f8b2@pigmoral.tech/ > --- > drivers/usb/dwc3/gadget.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > index 2b01113d54c..6b2b25c7aa5 100644 > --- a/drivers/usb/dwc3/gadget.c > +++ b/drivers/usb/dwc3/gadget.c > @@ -1423,6 +1423,7 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, int is_on, int suspend) > } > > dwc3_writel(dwc->regs, DWC3_DCTL, reg); > + mdelay(2); Can you elaborate on why 1ms is not enough? > > do { > reg = dwc3_readl(dwc->regs, DWC3_DSTS); > > -- > 2.43.0 ^ permalink raw reply [flat|nested] 16+ messages in thread
* 回复: [EXT] Re: [PATCH 5/6] usb: dwc3: gadget: Add delay after software writes DCTL in dwc3_gadget_run_stop() 2025-09-29 8:46 ` Mattijs Korpershoek @ 2025-10-09 10:16 ` Alice Guo 2025-10-09 10:20 ` Alice Guo ` (3 subsequent siblings) 4 siblings, 0 replies; 16+ messages in thread From: Alice Guo @ 2025-10-09 10:16 UTC (permalink / raw) To: Mattijs Korpershoek, Alice Guo (OSS), Stefano Babic, Fabio Estevam, dl-uboot-imx, Tom Rini, Peng Fan, Troy Kisky, Adrian Alonso, Lukasz Majewski, Marek Vasut, tharvey@gateworks.com Cc: u-boot@lists.denx.de > -----邮件原件----- > 发件人: Mattijs Korpershoek <mkorpershoek@kernel.org> > 发送时间: 2025年9月29日 16:47 > 收件人: Alice Guo (OSS) <alice.guo@oss.nxp.com>; Stefano Babic > <sbabic@nabladev.com>; Fabio Estevam <festevam@gmail.com>; dl-uboot-imx > <uboot-imx@nxp.com>; Tom Rini <trini@konsulko.com>; Peng Fan > <peng.fan@nxp.com>; Troy Kisky <troy.kisky@boundarydevices.com>; Adrian > Alonso <adrian.alonso@nxp.com>; Lukasz Majewski <lukma@denx.de>; Mattijs > Korpershoek <mkorpershoek@kernel.org>; Marek Vasut <marex@denx.de>; > tharvey@gateworks.com; Alice Guo <alice.guo@nxp.com> > 抄送: u-boot@lists.denx.de > 主题: [EXT] Re: [PATCH 5/6] usb: dwc3: gadget: Add delay after software writes > DCTL in dwc3_gadget_run_stop() > > [Some people who received this message don't often get email from > mkorpershoek@kernel.org. Learn why this is important at > https://aka.ms/LearnAboutSenderIdentification ] > > Caution: This is an external email. Please take care when clicking links or > opening attachments. When in doubt, report the message using the 'Report this > email' button > > > Hi Alice, > > Thank you for the patch. > > On Sun, Jul 20, 2025 at 06:13, "Alice Guo (OSS)" <alice.guo@oss.nxp.com> > wrote: > > > From: Alice Guo <alice.guo@nxp.com> > > > > When using NXP UUU to download flash.bin to i.MX95 19x19 evk board, it > > will get stuck in a loop at sdp_init() without this change. > > > > Signed-off-by: Alice Guo <alice.guo@nxp.com> > > I see that a similar change exist in the Linux kernel: > https://lore.kern/ > el.org%2Fall%2F20220901193625.8727-4-quic_wcheng%40quicinc.com%2F&da > ta=05%7C02%7Calice.guo%40nxp.com%7Cde74c5250f024fa4c9ec08ddff34c0a > d%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C6389473242115893 > 33%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAu > MDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C > %7C&sdata=8Ao4tOmcMSKHtoniiVTwP40Jwg54lz342KP0JHUKwA8%3D&reserv > ed=0 > > Please mention this change in the commit message for v2. > See the following example: > https://lore.kern/ > el.org%2Fall%2F20250110-dwc2-dev-v4-7-987f4fd6f8b2%40pigmoral.tech%2F& > data=05%7C02%7Calice.guo%40nxp.com%7Cde74c5250f024fa4c9ec08ddff34c > 0ad%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63894732421162 > 6416%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjA > uMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7 > C%7C&sdata=MtXqSueNAZ6GfiOxdnt%2BH6IUWabL3JDe01m8IKJpMy0%3D&r > eserved=0 > > > --- > > drivers/usb/dwc3/gadget.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > > index 2b01113d54c..6b2b25c7aa5 100644 > > --- a/drivers/usb/dwc3/gadget.c > > +++ b/drivers/usb/dwc3/gadget.c > > @@ -1423,6 +1423,7 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, > int is_on, int suspend) > > } > > > > dwc3_writel(dwc->regs, DWC3_DCTL, reg); > > + mdelay(2); > > Can you elaborate on why 1ms is not enough? Hi Mattijs, This patch I submitted was indeed inspired by the change you mentioned in the Linux kernel. The mdelay(2) value was determined empirically during testing on our development board. However, after a deeper understanding of the driver, I believe the real root cause is that the USB3 PHY was not properly initialized. When DWC3 is configured to DWC3_DSTS_SUPERSPEED in dwc3_gadget_start(), enumeration fails because the PHY is not ready and cannot complete the electrical and protocol-level handshake required by USB 3.0. The delay acts as a workaround to compensate for the missing hardware initialization or timing issues. Once the PHY driver (phy-imx8mq-usb.c) is added and properly initializes the USB3 PHY, the delay is no longer needed. The updated changes are included in the patchset titled "Enable USB and ENETC on i.MX943 EVK", specifically in patch 6 and patch 7: https://patchwork.ozlabs.org/project/uboot/patch/20250923-usbnetc-v1-6-507cddbe7214@oss.nxp.com/ https://patchwork.ozlabs.org/project/uboot/patch/20250923-usbnetc-v1-7-507cddbe7214@oss.nxp.com/ Thanks for the feedback! Best regards, Alice Guo ^ permalink raw reply [flat|nested] 16+ messages in thread
* 回复: [EXT] Re: [PATCH 5/6] usb: dwc3: gadget: Add delay after software writes DCTL in dwc3_gadget_run_stop() 2025-09-29 8:46 ` Mattijs Korpershoek 2025-10-09 10:16 ` 回复: [EXT] " Alice Guo @ 2025-10-09 10:20 ` Alice Guo 2025-10-09 10:22 ` Alice Guo ` (2 subsequent siblings) 4 siblings, 0 replies; 16+ messages in thread From: Alice Guo @ 2025-10-09 10:20 UTC (permalink / raw) To: Mattijs Korpershoek, Alice Guo (OSS), Stefano Babic, Fabio Estevam, dl-uboot-imx, Tom Rini, Peng Fan, Troy Kisky, Adrian Alonso, Lukasz Majewski, Marek Vasut, tharvey@gateworks.com Cc: u-boot@lists.denx.de > -----邮件原件----- > 发件人: Mattijs Korpershoek <mkorpershoek@kernel.org> > 发送时间: 2025年9月29日 16:47 > 收件人: Alice Guo (OSS) <alice.guo@oss.nxp.com>; Stefano Babic > <sbabic@nabladev.com>; Fabio Estevam <festevam@gmail.com>; dl-uboot-imx > <uboot-imx@nxp.com>; Tom Rini <trini@konsulko.com>; Peng Fan > <peng.fan@nxp.com>; Troy Kisky <troy.kisky@boundarydevices.com>; Adrian > Alonso <adrian.alonso@nxp.com>; Lukasz Majewski <lukma@denx.de>; Mattijs > Korpershoek <mkorpershoek@kernel.org>; Marek Vasut <marex@denx.de>; > tharvey@gateworks.com; Alice Guo <alice.guo@nxp.com> > 抄送: u-boot@lists.denx.de > 主题: [EXT] Re: [PATCH 5/6] usb: dwc3: gadget: Add delay after software writes > DCTL in dwc3_gadget_run_stop() > > [Some people who received this message don't often get email from > mkorpershoek@kernel.org. Learn why this is important at > https://aka.ms/LearnAboutSenderIdentification ] > > Caution: This is an external email. Please take care when clicking links or > opening attachments. When in doubt, report the message using the 'Report this > email' button > > > Hi Alice, > > Thank you for the patch. > > On Sun, Jul 20, 2025 at 06:13, "Alice Guo (OSS)" <alice.guo@oss.nxp.com> > wrote: > > > From: Alice Guo <alice.guo@nxp.com> > > > > When using NXP UUU to download flash.bin to i.MX95 19x19 evk board, it > > will get stuck in a loop at sdp_init() without this change. > > > > Signed-off-by: Alice Guo <alice.guo@nxp.com> > > I see that a similar change exist in the Linux kernel: > https://lore.kern/ > el.org%2Fall%2F20220901193625.8727-4-quic_wcheng%40quicinc.com%2F&da > ta=05%7C02%7Calice.guo%40nxp.com%7Cde74c5250f024fa4c9ec08ddff34c0a > d%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C6389473242115893 > 33%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAu > MDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C > %7C&sdata=8Ao4tOmcMSKHtoniiVTwP40Jwg54lz342KP0JHUKwA8%3D&reserv > ed=0 > > Please mention this change in the commit message for v2. > See the following example: > https://lore.kern/ > el.org%2Fall%2F20250110-dwc2-dev-v4-7-987f4fd6f8b2%40pigmoral.tech%2F& > data=05%7C02%7Calice.guo%40nxp.com%7Cde74c5250f024fa4c9ec08ddff34c > 0ad%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63894732421162 > 6416%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjA > uMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7 > C%7C&sdata=MtXqSueNAZ6GfiOxdnt%2BH6IUWabL3JDe01m8IKJpMy0%3D&r > eserved=0 > > > --- > > drivers/usb/dwc3/gadget.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > > index 2b01113d54c..6b2b25c7aa5 100644 > > --- a/drivers/usb/dwc3/gadget.c > > +++ b/drivers/usb/dwc3/gadget.c > > @@ -1423,6 +1423,7 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, > int is_on, int suspend) > > } > > > > dwc3_writel(dwc->regs, DWC3_DCTL, reg); > > + mdelay(2); > > Can you elaborate on why 1ms is not enough? > Hi Mattijs, This patch I submitted was indeed inspired by the change you mentioned in the Linux kernel. The mdelay(2) value was determined empirically during testing on our development board. However, after a deeper understanding of the driver, I believe the real root cause is that the USB3 PHY was not properly initialized. When DWC3 is configured to DWC3_DSTS_SUPERSPEED in dwc3_gadget_start(), enumeration fails because the PHY is not ready and cannot complete the electrical and protocol-level handshake required by USB 3.0. The delay acts as a workaround to compensate for the missing hardware initialization or timing issues. Once the PHY driver (phy-imx8mq-usb.c) is added and properly initializes the USB3 PHY, the delay is no longer needed. The updated changes are included in the patchset titled "Enable USB and ENETC on i.MX943 EVK", specifically in patch 6 and patch 7: https://patchwork.ozlabs.org/project/uboot/patch/20250923-usbnetc-v1-6-507cddbe7214@oss.nxp.com/ https://patchwork.ozlabs.org/project/uboot/patch/20250923-usbnetc-v1-7-507cddbe7214@oss.nxp.com/ Thanks for the feedback! Best regards, Alice Guo ^ permalink raw reply [flat|nested] 16+ messages in thread
* 回复: [EXT] Re: [PATCH 5/6] usb: dwc3: gadget: Add delay after software writes DCTL in dwc3_gadget_run_stop() 2025-09-29 8:46 ` Mattijs Korpershoek 2025-10-09 10:16 ` 回复: [EXT] " Alice Guo 2025-10-09 10:20 ` Alice Guo @ 2025-10-09 10:22 ` Alice Guo 2025-10-09 10:23 ` Alice Guo 2025-10-09 10:34 ` 回复: " Alice Guo (OSS) 4 siblings, 0 replies; 16+ messages in thread From: Alice Guo @ 2025-10-09 10:22 UTC (permalink / raw) To: Mattijs Korpershoek, Alice Guo (OSS), Stefano Babic, Fabio Estevam, dl-uboot-imx, Tom Rini, Peng Fan, Troy Kisky, Adrian Alonso, Lukasz Majewski, Marek Vasut, tharvey@gateworks.com Cc: u-boot@lists.denx.de > -----邮件原件----- > 发件人: Mattijs Korpershoek <mkorpershoek@kernel.org> > 发送时间: 2025年9月29日 16:47 > 收件人: Alice Guo (OSS) <alice.guo@oss.nxp.com>; Stefano Babic > <sbabic@nabladev.com>; Fabio Estevam <festevam@gmail.com>; dl-uboot-imx > <uboot-imx@nxp.com>; Tom Rini <trini@konsulko.com>; Peng Fan > <peng.fan@nxp.com>; Troy Kisky <troy.kisky@boundarydevices.com>; Adrian > Alonso <adrian.alonso@nxp.com>; Lukasz Majewski <lukma@denx.de>; Mattijs > Korpershoek <mkorpershoek@kernel.org>; Marek Vasut <marex@denx.de>; > tharvey@gateworks.com; Alice Guo <alice.guo@nxp.com> > 抄送: u-boot@lists.denx.de > 主题: [EXT] Re: [PATCH 5/6] usb: dwc3: gadget: Add delay after software writes > DCTL in dwc3_gadget_run_stop() > > [Some people who received this message don't often get email from > mkorpershoek@kernel.org. Learn why this is important at > https://aka.ms/LearnAboutSenderIdentification ] > > Caution: This is an external email. Please take care when clicking links or > opening attachments. When in doubt, report the message using the 'Report this > email' button > > > Hi Alice, > > Thank you for the patch. > > On Sun, Jul 20, 2025 at 06:13, "Alice Guo (OSS)" <alice.guo@oss.nxp.com> > wrote: > > > From: Alice Guo <alice.guo@nxp.com> > > > > When using NXP UUU to download flash.bin to i.MX95 19x19 evk board, it > > will get stuck in a loop at sdp_init() without this change. > > > > Signed-off-by: Alice Guo <alice.guo@nxp.com> > > I see that a similar change exist in the Linux kernel: > https://lore.kern/ > el.org%2Fall%2F20220901193625.8727-4-quic_wcheng%40quicinc.com%2F&da > ta=05%7C02%7Calice.guo%40nxp.com%7Cde74c5250f024fa4c9ec08ddff34c0a > d%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C6389473242115893 > 33%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAu > MDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C > %7C&sdata=8Ao4tOmcMSKHtoniiVTwP40Jwg54lz342KP0JHUKwA8%3D&reserv > ed=0 > > Please mention this change in the commit message for v2. > See the following example: > https://lore.kern/ > el.org%2Fall%2F20250110-dwc2-dev-v4-7-987f4fd6f8b2%40pigmoral.tech%2F& > data=05%7C02%7Calice.guo%40nxp.com%7Cde74c5250f024fa4c9ec08ddff34c > 0ad%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63894732421162 > 6416%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjA > uMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7 > C%7C&sdata=MtXqSueNAZ6GfiOxdnt%2BH6IUWabL3JDe01m8IKJpMy0%3D&r > eserved=0 > > > --- > > drivers/usb/dwc3/gadget.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > > index 2b01113d54c..6b2b25c7aa5 100644 > > --- a/drivers/usb/dwc3/gadget.c > > +++ b/drivers/usb/dwc3/gadget.c > > @@ -1423,6 +1423,7 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, > int is_on, int suspend) > > } > > > > dwc3_writel(dwc->regs, DWC3_DCTL, reg); > > + mdelay(2); > > Can you elaborate on why 1ms is not enough? > Hi Mattijs, This patch I submitted was indeed inspired by the change you mentioned in the Linux kernel. The mdelay(2) value was determined empirically during testing on our development board. However, after a deeper understanding of the driver, I believe the real root cause is that the USB3 PHY was not properly initialized. When DWC3 is configured to DWC3_DSTS_SUPERSPEED in dwc3_gadget_start(), enumeration fails because the PHY is not ready and cannot complete the electrical and protocol-level handshake required by USB 3.0. The delay acts as a workaround to compensate for the missing hardware initialization or timing issues. Once the PHY driver (phy-imx8mq-usb.c) is added and properly initializes the USB3 PHY, the delay is no longer needed. The updated changes are included in the patch set titled "Enable USB and ENETC on i.MX943 EVK", specifically in patch 6 and patch 7. Thanks for the feedback! Best regards, Alice Guo ^ permalink raw reply [flat|nested] 16+ messages in thread
* 回复: [EXT] Re: [PATCH 5/6] usb: dwc3: gadget: Add delay after software writes DCTL in dwc3_gadget_run_stop() 2025-09-29 8:46 ` Mattijs Korpershoek ` (2 preceding siblings ...) 2025-10-09 10:22 ` Alice Guo @ 2025-10-09 10:23 ` Alice Guo 2025-10-09 10:34 ` 回复: " Alice Guo (OSS) 4 siblings, 0 replies; 16+ messages in thread From: Alice Guo @ 2025-10-09 10:23 UTC (permalink / raw) To: Mattijs Korpershoek, Alice Guo (OSS), Stefano Babic, Fabio Estevam, dl-uboot-imx, Tom Rini, Peng Fan, Adrian Alonso, Lukasz Majewski, Marek Vasut, tharvey@gateworks.com Cc: u-boot@lists.denx.de > -----邮件原件----- > 发件人: Mattijs Korpershoek <mkorpershoek@kernel.org> > 发送时间: 2025年9月29日 16:47 > 收件人: Alice Guo (OSS) <alice.guo@oss.nxp.com>; Stefano Babic > <sbabic@nabladev.com>; Fabio Estevam <festevam@gmail.com>; dl-uboot-imx > <uboot-imx@nxp.com>; Tom Rini <trini@konsulko.com>; Peng Fan > <peng.fan@nxp.com>; Troy Kisky <troy.kisky@boundarydevices.com>; Adrian > Alonso <adrian.alonso@nxp.com>; Lukasz Majewski <lukma@denx.de>; Mattijs > Korpershoek <mkorpershoek@kernel.org>; Marek Vasut <marex@denx.de>; > tharvey@gateworks.com; Alice Guo <alice.guo@nxp.com> > 抄送: u-boot@lists.denx.de > 主题: [EXT] Re: [PATCH 5/6] usb: dwc3: gadget: Add delay after software writes > DCTL in dwc3_gadget_run_stop() > > [Some people who received this message don't often get email from > mkorpershoek@kernel.org. Learn why this is important at > https://aka.ms/LearnAboutSenderIdentification ] > > Caution: This is an external email. Please take care when clicking links or > opening attachments. When in doubt, report the message using the 'Report this > email' button > > > Hi Alice, > > Thank you for the patch. > > On Sun, Jul 20, 2025 at 06:13, "Alice Guo (OSS)" <alice.guo@oss.nxp.com> > wrote: > > > From: Alice Guo <alice.guo@nxp.com> > > > > When using NXP UUU to download flash.bin to i.MX95 19x19 evk board, it > > will get stuck in a loop at sdp_init() without this change. > > > > Signed-off-by: Alice Guo <alice.guo@nxp.com> > > I see that a similar change exist in the Linux kernel: > https://lore.kern/ > el.org%2Fall%2F20220901193625.8727-4-quic_wcheng%40quicinc.com%2F&da > ta=05%7C02%7Calice.guo%40nxp.com%7Cde74c5250f024fa4c9ec08ddff34c0a > d%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C6389473242115893 > 33%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAu > MDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C > %7C&sdata=8Ao4tOmcMSKHtoniiVTwP40Jwg54lz342KP0JHUKwA8%3D&reserv > ed=0 > > Please mention this change in the commit message for v2. > See the following example: > https://lore.kern/ > el.org%2Fall%2F20250110-dwc2-dev-v4-7-987f4fd6f8b2%40pigmoral.tech%2F& > data=05%7C02%7Calice.guo%40nxp.com%7Cde74c5250f024fa4c9ec08ddff34c > 0ad%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C63894732421162 > 6416%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjA > uMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7 > C%7C&sdata=MtXqSueNAZ6GfiOxdnt%2BH6IUWabL3JDe01m8IKJpMy0%3D&r > eserved=0 > > > --- > > drivers/usb/dwc3/gadget.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > > index 2b01113d54c..6b2b25c7aa5 100644 > > --- a/drivers/usb/dwc3/gadget.c > > +++ b/drivers/usb/dwc3/gadget.c > > @@ -1423,6 +1423,7 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, > int is_on, int suspend) > > } > > > > dwc3_writel(dwc->regs, DWC3_DCTL, reg); > > + mdelay(2); > > Can you elaborate on why 1ms is not enough? > Hi Mattijs, This patch I submitted was indeed inspired by the change you mentioned in the Linux kernel. The mdelay(2) value was determined empirically during testing on our development board. However, after a deeper understanding of the driver, I believe the real root cause is that the USB3 PHY was not properly initialized. When DWC3 is configured to DWC3_DSTS_SUPERSPEED in dwc3_gadget_start(), enumeration fails because the PHY is not ready and cannot complete the electrical and protocol-level handshake required by USB 3.0. The delay acts as a workaround to compensate for the missing hardware initialization or timing issues. Once the PHY driver (phy-imx8mq-usb.c) is added and properly initializes the USB3 PHY, the delay is no longer needed. The updated changes are included in the patchset titled "Enable USB and ENETC on i.MX943 EVK", specifically in patch 6 and patch 7: https://patchwork.ozlabs.org/project/uboot/patch/20250923-usbnetc-v1-6-507cddbe7214@oss.nxp.com/ https://patchwork.ozlabs.org/project/uboot/patch/20250923-usbnetc-v1-7-507cddbe7214@oss.nxp.com/ Thanks for the feedback! Best regards, Alice Guo ^ permalink raw reply [flat|nested] 16+ messages in thread
* 回复: [PATCH 5/6] usb: dwc3: gadget: Add delay after software writes DCTL in dwc3_gadget_run_stop() 2025-09-29 8:46 ` Mattijs Korpershoek ` (3 preceding siblings ...) 2025-10-09 10:23 ` Alice Guo @ 2025-10-09 10:34 ` Alice Guo (OSS) 2025-10-09 12:38 ` Mattijs Korpershoek 4 siblings, 1 reply; 16+ messages in thread From: Alice Guo (OSS) @ 2025-10-09 10:34 UTC (permalink / raw) To: Mattijs Korpershoek, Alice Guo (OSS), Stefano Babic, Fabio Estevam, dl-uboot-imx, Tom Rini, Peng Fan, Troy Kisky, Adrian Alonso, Lukasz Majewski, Marek Vasut, tharvey@gateworks.com, Alice Guo Cc: u-boot@lists.denx.de > -----邮件原件----- > 发件人: Mattijs Korpershoek <mkorpershoek@kernel.org> > 发送时间: 2025年9月29日 16:47 > 收件人: Alice Guo (OSS) <alice.guo@oss.nxp.com>; Stefano Babic > <sbabic@nabladev.com>; Fabio Estevam <festevam@gmail.com>; dl-uboot-imx > <uboot-imx@nxp.com>; Tom Rini <trini@konsulko.com>; Peng Fan > <peng.fan@nxp.com>; Troy Kisky <troy.kisky@boundarydevices.com>; Adrian > Alonso <adrian.alonso@nxp.com>; Lukasz Majewski <lukma@denx.de>; Mattijs > Korpershoek <mkorpershoek@kernel.org>; Marek Vasut <marex@denx.de>; > tharvey@gateworks.com; Alice Guo <alice.guo@nxp.com> > 抄送: u-boot@lists.denx.de > 主题: Re: [PATCH 5/6] usb: dwc3: gadget: Add delay after software writes DCTL > in dwc3_gadget_run_stop() > > Hi Alice, > > Thank you for the patch. > > On Sun, Jul 20, 2025 at 06:13, "Alice Guo (OSS)" <alice.guo@oss.nxp.com> > wrote: > > > From: Alice Guo <alice.guo@nxp.com> > > > > When using NXP UUU to download flash.bin to i.MX95 19x19 evk board, it > > will get stuck in a loop at sdp_init() without this change. > > > > Signed-off-by: Alice Guo <alice.guo@nxp.com> > > I see that a similar change exist in the Linux kernel: > https://lore.kernel.org/all/20220901193625.8727-4-quic_wcheng@quicinc.com > / > > Please mention this change in the commit message for v2. > See the following example: > https://lore.kernel.org/all/20250110-dwc2-dev-v4-7-987f4fd6f8b2@pigmoral.te > ch/ > > > --- > > drivers/usb/dwc3/gadget.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c > > index 2b01113d54c..6b2b25c7aa5 100644 > > --- a/drivers/usb/dwc3/gadget.c > > +++ b/drivers/usb/dwc3/gadget.c > > @@ -1423,6 +1423,7 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, > int is_on, int suspend) > > } > > > > dwc3_writel(dwc->regs, DWC3_DCTL, reg); > > + mdelay(2); > > Can you elaborate on why 1ms is not enough? > Apologies for the confusion that I previously replay this email from the wrong email address. Hi Mattijs, Apologies for the confusion that I previously replay this email from the wrong email address. This patch I submitted was indeed inspired by the change you mentioned in the Linux kernel. The mdelay(2) value was determined empirically during testing on our development board. However, after a deeper understanding of the driver, I believe the real root cause is that the USB3 PHY was not properly initialized. When DWC3 is configured to DWC3_DSTS_SUPERSPEED in dwc3_gadget_start(), enumeration fails because the PHY is not ready and cannot complete the electrical and protocol-level handshake required by USB 3.0. The delay acts as a workaround to compensate for the missing hardware initialization or timing issues. Once the PHY driver (phy-imx8mq-usb.c) is added and properly initializes the USB3 PHY, the delay is no longer needed. The updated changes are included in the patch set titled "Enable USB and ENETC on i.MX943 EVK", specifically in patch 6 and patch 7: https://patchwork.ozlabs.org/project/uboot/patch/20250923-usbnetc-v1-6-507cddbe7214@oss.nxp.com/ https://patchwork.ozlabs.org/project/uboot/patch/20250923-usbnetc-v1-7-507cddbe7214@oss.nxp.com/ Thanks for the feedback! Best regards, Alice Guo ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: 回复: [PATCH 5/6] usb: dwc3: gadget: Add delay after software writes DCTL in dwc3_gadget_run_stop() 2025-10-09 10:34 ` 回复: " Alice Guo (OSS) @ 2025-10-09 12:38 ` Mattijs Korpershoek 0 siblings, 0 replies; 16+ messages in thread From: Mattijs Korpershoek @ 2025-10-09 12:38 UTC (permalink / raw) To: Alice Guo (OSS), Mattijs Korpershoek, Alice Guo (OSS), Stefano Babic, Fabio Estevam, dl-uboot-imx, Tom Rini, Peng Fan, Troy Kisky, Adrian Alonso, Lukasz Majewski, Marek Vasut, tharvey@gateworks.com, Alice Guo Cc: u-boot@lists.denx.de Hi Alice, On Thu, Oct 09, 2025 at 10:34, "Alice Guo (OSS)" <alice.guo@oss.nxp.com> wrote: >> -----邮件原件----- >> 发件人: Mattijs Korpershoek <mkorpershoek@kernel.org> >> 发送时间: 2025年9月29日 16:47 >> 收件人: Alice Guo (OSS) <alice.guo@oss.nxp.com>; Stefano Babic >> <sbabic@nabladev.com>; Fabio Estevam <festevam@gmail.com>; dl-uboot-imx >> <uboot-imx@nxp.com>; Tom Rini <trini@konsulko.com>; Peng Fan >> <peng.fan@nxp.com>; Troy Kisky <troy.kisky@boundarydevices.com>; Adrian >> Alonso <adrian.alonso@nxp.com>; Lukasz Majewski <lukma@denx.de>; Mattijs >> Korpershoek <mkorpershoek@kernel.org>; Marek Vasut <marex@denx.de>; >> tharvey@gateworks.com; Alice Guo <alice.guo@nxp.com> >> 抄送: u-boot@lists.denx.de >> 主题: Re: [PATCH 5/6] usb: dwc3: gadget: Add delay after software writes DCTL >> in dwc3_gadget_run_stop() >> >> Hi Alice, >> >> Thank you for the patch. >> >> On Sun, Jul 20, 2025 at 06:13, "Alice Guo (OSS)" <alice.guo@oss.nxp.com> >> wrote: >> >> > From: Alice Guo <alice.guo@nxp.com> >> > >> > When using NXP UUU to download flash.bin to i.MX95 19x19 evk board, it >> > will get stuck in a loop at sdp_init() without this change. >> > >> > Signed-off-by: Alice Guo <alice.guo@nxp.com> >> >> I see that a similar change exist in the Linux kernel: >> https://lore.kernel.org/all/20220901193625.8727-4-quic_wcheng@quicinc.com >> / >> >> Please mention this change in the commit message for v2. >> See the following example: >> https://lore.kernel.org/all/20250110-dwc2-dev-v4-7-987f4fd6f8b2@pigmoral.te >> ch/ >> >> > --- >> > drivers/usb/dwc3/gadget.c | 1 + >> > 1 file changed, 1 insertion(+) >> > >> > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c >> > index 2b01113d54c..6b2b25c7aa5 100644 >> > --- a/drivers/usb/dwc3/gadget.c >> > +++ b/drivers/usb/dwc3/gadget.c >> > @@ -1423,6 +1423,7 @@ static int dwc3_gadget_run_stop(struct dwc3 *dwc, >> int is_on, int suspend) >> > } >> > >> > dwc3_writel(dwc->regs, DWC3_DCTL, reg); >> > + mdelay(2); >> >> Can you elaborate on why 1ms is not enough? >> > > Apologies for the confusion that I previously replay this email from the wrong email address. > > Hi Mattijs, > > Apologies for the confusion that I previously replay this email from the wrong email address. No worries. > > This patch I submitted was indeed inspired by the change you mentioned in the Linux kernel. The mdelay(2) value was determined empirically during testing on our development board. > > However, after a deeper understanding of the driver, I believe the real root cause is that the USB3 PHY was not properly initialized. When DWC3 is configured to DWC3_DSTS_SUPERSPEED in dwc3_gadget_start(), enumeration fails because the PHY is not ready and cannot complete the electrical and protocol-level handshake required by USB 3.0. The delay acts as a workaround to compensate for the missing hardware initialization or timing issues. Once the PHY driver (phy-imx8mq-usb.c) is added and properly initializes the USB3 PHY, the delay is no longer needed. > > The updated changes are included in the patch set titled "Enable USB and ENETC on i.MX943 EVK", specifically in patch 6 and patch 7: > https://patchwork.ozlabs.org/project/uboot/patch/20250923-usbnetc-v1-6-507cddbe7214@oss.nxp.com/ > https://patchwork.ozlabs.org/project/uboot/patch/20250923-usbnetc-v1-7-507cddbe7214@oss.nxp.com/ > > Thanks for the feedback! I see, thanks for taking the time answer me. And glad you could solve this properly by enabling the PHY driver. > > Best regards, > Alice Guo ^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 6/6] imx95: Add support for booting from USB SDP on USB3 2025-07-19 22:13 [PATCH 0/6] imx95: support USB SDP on USB3 interface Alice Guo (OSS) ` (4 preceding siblings ...) 2025-07-19 22:13 ` [PATCH 5/6] usb: dwc3: gadget: Add delay after software writes DCTL in dwc3_gadget_run_stop() Alice Guo (OSS) @ 2025-07-19 22:13 ` Alice Guo (OSS) 5 siblings, 0 replies; 16+ messages in thread From: Alice Guo (OSS) @ 2025-07-19 22:13 UTC (permalink / raw) To: Stefano Babic, Fabio Estevam, NXP i.MX U-Boot Team, Tom Rini, Peng Fan, Troy Kisky, Adrian Alonso, Lukasz Majewski, Mattijs Korpershoek, Marek Vasut, Tim Harvey, Alice Guo Cc: u-boot From: Alice Guo <alice.guo@nxp.com> USB3 nodes have been added to dts files in dts/upstream now. This patch is used to enable USB Gadget in SPL to make i.MX95 19x19 evk board can use SDP on USB3 interface. Signed-off-by: Alice Guo <alice.guo@nxp.com> --- arch/arm/dts/imx95-19x19-evk-u-boot.dtsi | 8 ++++++++ configs/imx95_19x19_evk_defconfig | 13 ++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/arch/arm/dts/imx95-19x19-evk-u-boot.dtsi b/arch/arm/dts/imx95-19x19-evk-u-boot.dtsi index 2d1f02baa5f..f60ca4b9346 100644 --- a/arch/arm/dts/imx95-19x19-evk-u-boot.dtsi +++ b/arch/arm/dts/imx95-19x19-evk-u-boot.dtsi @@ -13,6 +13,14 @@ bootph-pre-ram; }; +&usb3 { + bootph-pre-ram; +}; + +&usb3_dwc3 { + bootph-pre-ram; +}; + &usdhc1 { bootph-pre-ram; }; diff --git a/configs/imx95_19x19_evk_defconfig b/configs/imx95_19x19_evk_defconfig index 73818a82627..306611a9169 100644 --- a/configs/imx95_19x19_evk_defconfig +++ b/configs/imx95_19x19_evk_defconfig @@ -42,7 +42,7 @@ CONFIG_BOARD_EARLY_INIT_F=y # CONFIG_BOARD_INIT is not set CONFIG_BOARD_LATE_INIT=y CONFIG_PCI_INIT_R=y -CONFIG_SPL_MAX_SIZE=0x20000 +CONFIG_SPL_MAX_SIZE=0x30000 CONFIG_SPL_BOARD_INIT=y CONFIG_SPL_LOAD_IMX_CONTAINER=y CONFIG_IMX_CONTAINER_CFG="arch/arm/mach-imx/imx9/scmi/container.cfg" @@ -147,6 +147,17 @@ CONFIG_FSL_LPUART=y CONFIG_SPI=y CONFIG_DM_SPI=y CONFIG_NXP_FSPI=y +CONFIG_USB=y +CONFIG_SPL_DM_USB_GADGET=y +CONFIG_USB_DWC3=y +CONFIG_SPL_USB_DWC3_GENERIC=y +CONFIG_USB_GADGET=y +CONFIG_SPL_USB_GADGET=y +CONFIG_USB_GADGET_MANUFACTURER="FSL" +CONFIG_USB_GADGET_VENDOR_NUM=0x1fc9 +CONFIG_USB_GADGET_PRODUCT_NUM=0x0152 +CONFIG_SDP_LOADADDR=0x90400000 +CONFIG_SPL_USB_SDP_SUPPORT=y CONFIG_ULP_WATCHDOG=y CONFIG_LZO=y CONFIG_BZIP2=y -- 2.43.0 ^ permalink raw reply related [flat|nested] 16+ messages in thread
end of thread, other threads:[~2025-10-09 12:59 UTC | newest] Thread overview: 16+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2025-07-19 22:13 [PATCH 0/6] imx95: support USB SDP on USB3 interface Alice Guo (OSS) 2025-07-19 22:13 ` [PATCH 1/6] Update VID/PID Alice Guo (OSS) 2025-07-31 19:08 ` Tim Harvey 2025-07-19 22:13 ` [PATCH 2/6] Add serial# for SPL SDP download Alice Guo (OSS) 2025-07-19 22:13 ` [PATCH 3/6] usb: f_sdp: Update SDP driver to support PQC container Alice Guo (OSS) 2025-07-19 22:13 ` [PATCH 4/6] imx95: Remove ROM info USB instance workaround for B0 Alice Guo (OSS) 2025-07-29 16:16 ` Tim Harvey 2025-07-19 22:13 ` [PATCH 5/6] usb: dwc3: gadget: Add delay after software writes DCTL in dwc3_gadget_run_stop() Alice Guo (OSS) 2025-09-29 8:46 ` Mattijs Korpershoek 2025-10-09 10:16 ` 回复: [EXT] " Alice Guo 2025-10-09 10:20 ` Alice Guo 2025-10-09 10:22 ` Alice Guo 2025-10-09 10:23 ` Alice Guo 2025-10-09 10:34 ` 回复: " Alice Guo (OSS) 2025-10-09 12:38 ` Mattijs Korpershoek 2025-07-19 22:13 ` [PATCH 6/6] imx95: Add support for booting from USB SDP on USB3 Alice Guo (OSS)
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.