* [PATCH v2 0/7] usb: fix DWC3/gadget issues and enable USB on Toradex i.MX95 boards
@ 2026-09-14 7:42 Stefan Eichenberger
2026-09-14 7:42 ` [PATCH v2 1/7] usb: ci_udc: add driver model support Stefan Eichenberger
` (6 more replies)
0 siblings, 7 replies; 16+ messages in thread
From: Stefan Eichenberger @ 2026-09-14 7:42 UTC (permalink / raw)
To: francesco.dolcini, trini, ilias.apalodimas, sbabic, festevam,
uboot-imx, marek.vasut+usb, lukma, mkorpershoek, antoine.gouby,
alice.guo, stefan.eichenberger, sjg, emanuele.ghidoli,
franz.schnyder, pbrobinson, quentin.schulz, jbx6244, ye.li,
xu.yang_2, bmeng.cn, xypron.glpk, hayashi.kunihiko, sean.anderson
Cc: u-boot
This series fixes a few USB issues that show up on the Toradex i.MX95
based modules and finally enables USB support for them.
The i.MX95 has two USB controllers: a host-only DWC3 controller and a
ChipIdea OTG controller. Getting both of them to work together in
U-Boot requires a couple of fixes:
- Add support for the driver model to the ci_udc driver (patch 1). If
DM_USB_GADGET is not enabled, keep the legacy driver support enabled
so that boards relying on the legacy driver still work. The ci_udc
driver does not bind independently, but instead relies on the ehci-mx6
driver to bind it (patch 2). I'm not sure if this approach is correct,
but otherwise we would have two drivers binding to the same compatible
string, which does not work.
- The DWC3 reference clock lookup added by commit c6583354b7c1 ("usb:
dwc3: Look up reference clock DT phandle in both controller DT nodes")
resolves an index found in the child node's clock-names against the
clk_bulk of the parent glue node. On the Verdin iMX95 the two lists
have a different order, so the wrong clock is picked, which shows up
as intermittent enumeration failures behind a USB hub (patch 3).
- ehci_gadget picks the first USB device it finds, which on the i.MX95
is the host-only DWC3 controller instead of the ChipIdea OTG
controller, so "ums" never enters device mode. Skip host-only
controllers when looking for the gadget controller (patch 4).
The remaining patches enable CI_UDC on the Verdin iMX95 and turn on the
DWC3 host controller support for the Verdin iMX95 and the Toradex SMARC
iMX95.
Testing
-------
USB was tested on a Verdin iMX95, a Toradex SMARC iMX95 and an Apalis
iMX6 (as a regression test for the ehci_gadget change) with:
usb start
and with:
ums 0 mmc 0
All three boards were enumerating a USB stick and appeared as USB
devices on a PC connected to the USB device port.
Stefan Eichenberger (7):
usb: ci_udc: add driver model support
usb: ehci-mx6: bind the ChipIdea gadget driver
usb: dwc3-generic: fix ref clock lookup indexing wrong clk_bulk array
usb: skip host-only devices when picking the ehci gadget controller
configs: verdin-imx95: enable CI_UDC usb gadget driver
toradex: verdin-imx95: enable DWC3 USB controller support
toradex: smarc-imx95: enable DWC3 USB controller support
.../dts/imx95-toradex-smarc-dev-u-boot.dtsi | 8 -
.../arm/dts/imx95-verdin-wifi-dev-u-boot.dtsi | 8 -
configs/toradex-smarc-imx95_defconfig | 4 +
configs/verdin-imx95_defconfig | 3 +-
drivers/usb/dwc3/dwc3-generic.c | 47 ++++--
drivers/usb/gadget/Kconfig | 8 +-
drivers/usb/gadget/ci_udc.c | 152 +++++++++++++++++-
drivers/usb/host/ehci-mx6.c | 38 +++++
drivers/usb/host/usb-uclass.c | 23 ++-
9 files changed, 254 insertions(+), 37 deletions(-)
--
2.55.0
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v2 1/7] usb: ci_udc: add driver model support
2026-09-14 7:42 [PATCH v2 0/7] usb: fix DWC3/gadget issues and enable USB on Toradex i.MX95 boards Stefan Eichenberger
@ 2026-09-14 7:42 ` Stefan Eichenberger
2026-09-14 7:42 ` [PATCH v2 2/7] usb: ehci-mx6: bind the ChipIdea gadget driver Stefan Eichenberger
` (5 subsequent siblings)
6 siblings, 0 replies; 16+ messages in thread
From: Stefan Eichenberger @ 2026-09-14 7:42 UTC (permalink / raw)
To: francesco.dolcini, trini, ilias.apalodimas, sbabic, festevam,
uboot-imx, marek.vasut+usb, lukma, mkorpershoek, antoine.gouby,
alice.guo, stefan.eichenberger, sjg, emanuele.ghidoli,
franz.schnyder, pbrobinson, quentin.schulz, jbx6244, ye.li,
xu.yang_2, bmeng.cn, xypron.glpk, hayashi.kunihiko, sean.anderson
Cc: u-boot
From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
Register the ChipIdea gadget as a UCLASS_USB_GADGET_GENERIC driver so it
can be used on boards with DM_USB_GADGET enabled, which CI_UDC no longer
excludes. The driver enables the clocks and the PHY of its device tree
node and registers the gadget with usb_add_gadget_udc().
It has no of_match of its own. The controller node is shared with the
EHCI host driver, which owns it and binds this driver by name, so CI_UDC
depends on that driver once DM_USB_GADGET is enabled.
Boards without DM_USB_GADGET keep the existing behaviour.
Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
---
drivers/usb/gadget/Kconfig | 8 +-
drivers/usb/gadget/ci_udc.c | 152 +++++++++++++++++++++++++++++++++++-
2 files changed, 158 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index e42d5a43696..67826ee5150 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -153,12 +153,18 @@ config USB_GADGET_OS_DESCRIPTORS
config CI_UDC
bool "ChipIdea device controller"
- depends on !DM_USB_GADGET
+ depends on !DM_USB_GADGET || USB_EHCI_MX6 || USB_EHCI_MX7
select USB_GADGET_DUALSPEED
help
Say Y here to enable device controller functionality of the
ChipIdea driver.
+ With DM_USB_GADGET enabled this driver has no device tree match of
+ its own. The EHCI host driver owns the controller node and binds
+ this driver by name for the ports whose dr_mode is "peripheral" or
+ "otg", which is why it is required. Without DM_USB_GADGET the
+ controller is picked up through the EHCI host driver as before.
+
config USB_GADGET_VBUS_DRAW
int "Maximum VBUS Power usage (2-500 mA)"
range 2 500
diff --git a/drivers/usb/gadget/ci_udc.c b/drivers/usb/gadget/ci_udc.c
index 53796887dac..f63cb17b58f 100644
--- a/drivers/usb/gadget/ci_udc.c
+++ b/drivers/usb/gadget/ci_udc.c
@@ -7,14 +7,18 @@
* Murray.Jensen@cmst.csiro.au, 27-Jan-01.
*/
+#include <clk.h>
#include <command.h>
#include <config.h>
#include <cpu_func.h>
+#include <dm.h>
+#include <generic-phy.h>
#include <net.h>
#include <malloc.h>
#include <wait_bit.h>
#include <asm/byteorder.h>
#include <asm/cache.h>
+#include <dm/device_compat.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <asm/io.h>
@@ -23,6 +27,7 @@
#include <linux/usb/ch9.h>
#include <linux/usb/gadget.h>
#include <usb/ci_udc.h>
+#include <usb/ehci-ci.h>
#include "../host/ehci.h"
#include "ci_udc.h"
@@ -93,9 +98,18 @@ static int ci_ep_dequeue(struct usb_ep *ep, struct usb_request *req);
static struct usb_request *
ci_ep_alloc_request(struct usb_ep *ep, unsigned int gfp_flags);
static void ci_ep_free_request(struct usb_ep *ep, struct usb_request *_req);
+#if CONFIG_IS_ENABLED(DM_USB_GADGET)
+static int ci_udc_start(struct usb_gadget *gadget,
+ struct usb_gadget_driver *driver);
+static int ci_udc_stop(struct usb_gadget *gadget);
+#endif
static const struct usb_gadget_ops ci_udc_ops = {
.pullup = ci_pullup,
+#if CONFIG_IS_ENABLED(DM_USB_GADGET)
+ .udc_start = ci_udc_start,
+ .udc_stop = ci_udc_stop,
+#endif
};
static const struct usb_ep_ops ci_ep_ops = {
@@ -994,7 +1008,7 @@ void udc_irq(void)
}
}
-int dm_usb_gadget_handle_interrupts(struct udevice *dev)
+static int ci_udc_gadget_handle_interrupts(struct udevice *dev)
{
struct ci_udc *udc = (struct ci_udc *)controller.ctrl->hcor;
u32 value;
@@ -1139,6 +1153,12 @@ static int ci_udc_probe(void)
return 0;
}
+#if !CONFIG_IS_ENABLED(DM_USB_GADGET)
+int dm_usb_gadget_handle_interrupts(struct udevice *dev)
+{
+ return ci_udc_gadget_handle_interrupts(dev);
+}
+
int usb_gadget_register_driver(struct usb_gadget_driver *driver)
{
int ret;
@@ -1192,6 +1212,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
return 0;
}
+#endif /* !DM_USB_GADGET */
bool dfu_usb_get_reset(void)
{
@@ -1199,3 +1220,132 @@ bool dfu_usb_get_reset(void)
return !!(readl(&udc->usbsts) & STS_URI);
}
+
+#if CONFIG_IS_ENABLED(DM_USB_GADGET)
+struct ci_udc_priv {
+ /* Only hccr and hcor are used, the gadget does not drive EHCI. */
+ struct ehci_ctrl ctrl;
+ struct clk_bulk clks;
+ struct phy phy;
+};
+
+static int ci_udc_start(struct usb_gadget *gadget,
+ struct usb_gadget_driver *driver)
+{
+ if (!driver || !driver->bind || !driver->setup || !driver->disconnect)
+ return -EINVAL;
+
+ controller.driver = driver;
+
+ return 0;
+}
+
+static int ci_udc_stop(struct usb_gadget *gadget)
+{
+ controller.driver = NULL;
+
+ return 0;
+}
+
+static int ci_udc_clk_init(struct udevice *dev, struct clk_bulk *clks)
+{
+ int ret;
+
+ ret = clk_get_bulk(dev, clks);
+ if (ret == -ENOSYS || ret == -ENOENT)
+ return 0;
+ if (ret)
+ return ret;
+
+ ret = clk_enable_bulk(clks);
+ if (ret) {
+ clk_release_bulk(clks);
+ return ret;
+ }
+
+ return 0;
+}
+
+static int ci_udc_dm_probe(struct udevice *dev)
+{
+ struct ci_udc_priv *priv = dev_get_priv(dev);
+ struct usb_ehci *ehci;
+ int ret;
+
+ ehci = dev_read_addr_ptr(dev);
+ if (!ehci)
+ return -EINVAL;
+
+ ret = ci_udc_clk_init(dev, &priv->clks);
+ if (ret)
+ return ret;
+
+ ret = generic_setup_phy(dev, &priv->phy, 0, PHY_MODE_USB_DEVICE, 0);
+ if (ret)
+ goto err_clk;
+
+ /* Same register layout the EHCI host driver derives its regs from. */
+ priv->ctrl.hccr = (struct ehci_hccr *)&ehci->caplength;
+ priv->ctrl.hcor = (struct ehci_hcor *)((uintptr_t)priv->ctrl.hccr +
+ HC_LENGTH(ehci_readl(&priv->ctrl.hccr->cr_capbase)));
+ controller.ctrl = &priv->ctrl;
+
+ ret = ci_udc_probe();
+ if (ret) {
+ dev_err(dev, "udc probe failed, returned %d\n", ret);
+ goto err_phy;
+ }
+
+ ret = usb_add_gadget_udc((struct device *)dev, &controller.gadget);
+ if (ret)
+ goto err_udc;
+
+ return 0;
+
+err_udc:
+ ci_ep_free_request(&controller.ep[0].ep, &controller.ep0_req->req);
+ free(controller.items_mem);
+ free(controller.epts);
+err_phy:
+ generic_shutdown_phy(&priv->phy);
+err_clk:
+ clk_release_bulk(&priv->clks);
+ return ret;
+}
+
+static int ci_udc_dm_remove(struct udevice *dev)
+{
+ struct ci_udc_priv *priv = dev_get_priv(dev);
+
+ usb_del_gadget_udc(&controller.gadget);
+
+ ci_ep_free_request(&controller.ep[0].ep, &controller.ep0_req->req);
+ free(controller.items_mem);
+ free(controller.epts);
+ controller.ctrl = NULL;
+
+ generic_shutdown_phy(&priv->phy);
+ clk_release_bulk(&priv->clks);
+
+ return 0;
+}
+
+static const struct usb_gadget_generic_ops ci_udc_gadget_ops = {
+ .handle_interrupts = ci_udc_gadget_handle_interrupts,
+};
+
+/*
+ * No of_match: the ChipIdea controller shares its device tree node with the
+ * EHCI host driver, which owns the node and binds this driver by name for
+ * the ports that are usable in device mode.
+ */
+U_BOOT_DRIVER(ci_udc) = {
+ .name = "ci_udc",
+ .id = UCLASS_USB_GADGET_GENERIC,
+ .ops = &ci_udc_gadget_ops,
+ .probe = ci_udc_dm_probe,
+ .remove = ci_udc_dm_remove,
+ .priv_auto = sizeof(struct ci_udc_priv),
+ .flags = DM_FLAG_ALLOC_PRIV_DMA,
+};
+#endif /* DM_USB_GADGET */
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 2/7] usb: ehci-mx6: bind the ChipIdea gadget driver
2026-09-14 7:42 [PATCH v2 0/7] usb: fix DWC3/gadget issues and enable USB on Toradex i.MX95 boards Stefan Eichenberger
2026-09-14 7:42 ` [PATCH v2 1/7] usb: ci_udc: add driver model support Stefan Eichenberger
@ 2026-09-14 7:42 ` Stefan Eichenberger
2026-09-14 7:42 ` [PATCH v2 3/7] usb: dwc3-generic: fix ref clock lookup indexing wrong clk_bulk array Stefan Eichenberger
` (4 subsequent siblings)
6 siblings, 0 replies; 16+ messages in thread
From: Stefan Eichenberger @ 2026-09-14 7:42 UTC (permalink / raw)
To: francesco.dolcini, trini, ilias.apalodimas, sbabic, festevam,
uboot-imx, marek.vasut+usb, lukma, mkorpershoek, antoine.gouby,
alice.guo, stefan.eichenberger, sjg, emanuele.ghidoli,
franz.schnyder, pbrobinson, quentin.schulz, jbx6244, ye.li,
xu.yang_2, bmeng.cn, xypron.glpk, hayashi.kunihiko, sean.anderson
Cc: u-boot
From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
ci_udc has no device tree match of its own, so bind it here for the
ports it can serve. This driver already owns the controller node.
A peripheral-only port is of no use as a host, so hand the node over
completely and decline to bind. An OTG port serves both roles, so bind
ci_udc in addition and stay bound. Neither device is probed at bind
time, so "usb start" probes this one and puts the controller into host
mode, while "ums" and "fastboot" probe the gadget one and put it into
device mode.
Boards that do not enable both CI_UDC and DM_USB_GADGET are unaffected.
Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
---
drivers/usb/host/ehci-mx6.c | 38 +++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index 25907f22612..8b997e88946 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -20,6 +20,8 @@
#include <asm/mach-imx/sys_proto.h>
#include <dm.h>
#include <asm/mach-types.h>
+#include <dm/device_compat.h>
+#include <dm/lists.h>
#include <power/regulator.h>
#include <linux/usb/otg.h>
#include <linux/usb/phy.h>
@@ -553,6 +555,41 @@ static int ehci_usb_phy_mode(struct udevice *dev)
return 0;
}
+static int ehci_usb_bind(struct udevice *dev)
+{
+ ofnode node = dev_ofnode(dev);
+ enum usb_dr_mode dr_mode;
+ int ret;
+
+ /*
+ * The ChipIdea gadget driver has no device tree match of its own: it
+ * shares this node, so this driver owns it and decides which roles
+ * are wanted here.
+ */
+ if (!IS_ENABLED(CONFIG_CI_UDC) || !CONFIG_IS_ENABLED(DM_USB_GADGET))
+ return 0;
+
+ dr_mode = usb_get_dr_mode(node);
+ if (dr_mode != USB_DR_MODE_PERIPHERAL && dr_mode != USB_DR_MODE_OTG)
+ return 0;
+
+ ret = device_bind_driver_to_node(dev->parent, "ci_udc",
+ ofnode_get_name(node), node, NULL);
+ if (ret) {
+ dev_err(dev, "failed to bind ChipIdea gadget: %d\n", ret);
+ return ret;
+ }
+
+ /*
+ * An OTG port serves both roles, so stay bound as well. Neither
+ * device is probed here: "usb start" probes this one and puts the
+ * controller into host mode, "ums" and "fastboot" probe the gadget
+ * one and put it into device mode. A peripheral-only port is of no
+ * use as a host, so hand the node over completely.
+ */
+ return dr_mode == USB_DR_MODE_OTG ? 0 : -ENODEV;
+}
+
static int ehci_usb_of_to_plat(struct udevice *dev)
{
struct usb_plat *plat = dev_get_plat(dev);
@@ -774,6 +811,7 @@ U_BOOT_DRIVER(usb_mx6) = {
.name = "ehci_mx6",
.id = UCLASS_USB,
.of_match = mx6_usb_ids,
+ .bind = ehci_usb_bind,
.of_to_plat = ehci_usb_of_to_plat,
.probe = ehci_usb_probe,
.remove = ehci_usb_remove,
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 3/7] usb: dwc3-generic: fix ref clock lookup indexing wrong clk_bulk array
2026-09-14 7:42 [PATCH v2 0/7] usb: fix DWC3/gadget issues and enable USB on Toradex i.MX95 boards Stefan Eichenberger
2026-09-14 7:42 ` [PATCH v2 1/7] usb: ci_udc: add driver model support Stefan Eichenberger
2026-09-14 7:42 ` [PATCH v2 2/7] usb: ehci-mx6: bind the ChipIdea gadget driver Stefan Eichenberger
@ 2026-09-14 7:42 ` Stefan Eichenberger
2026-09-14 19:26 ` Marek Vasut
2026-09-14 7:42 ` [PATCH v2 4/7] usb: skip host-only devices when picking the ehci gadget controller Stefan Eichenberger
` (3 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Stefan Eichenberger @ 2026-09-14 7:42 UTC (permalink / raw)
To: francesco.dolcini, trini, ilias.apalodimas, sbabic, festevam,
uboot-imx, marek.vasut+usb, lukma, mkorpershoek, antoine.gouby,
alice.guo, stefan.eichenberger, sjg, emanuele.ghidoli,
franz.schnyder, pbrobinson, quentin.schulz, jbx6244, ye.li,
xu.yang_2, bmeng.cn, xypron.glpk, hayashi.kunihiko, sean.anderson
Cc: u-boot
From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
On Verdin iMX95, with a USB hub permanently attached to the DWC3 host
port the hub itself enumerates fine but a USB stick plugged into it
fails intermittently:
Verdin iMX95 # usb start
starting USB...
USB XHCI 1.10
Device not responding to set address.
USB device not accepting new address (error=80000000)
Bus usb@4c100000: 2 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Verdin iMX95 # usb reset
resetting USB...
USB XHCI 1.10
WARN endpoint is halted
WARN endpoint is halted
unable to get device descriptor (error=-22)
Commit c6583354b7c1 ("usb: dwc3: Look up reference clock DT phandle in
both controller DT nodes") added a fallback that searches the DWC3
child node's "clock-names" for "ref"/"ref_clk" when it isn't found on
the parent glue node, but always resolves the found index against
glue->clks, a clk_bulk populated only from the parent glue node's own
clock-names list. This is wrong since the child node's clock-names list
is not guaranteed to be in the same order as the parent's, and indeed on
Verdin iMX95 the child node has a different order than the parent node.
Fix it by looking the reference clock up by name with clk_get_by_name(),
walking the dwc3 device first and then its parent glue device, so the
clock is always resolved through the device that owns the node its name
was found in. Also enable the clock before use, the child node's clocks
are not part of the glue node's clk_bulk and are therefore not enabled
by dwc3_glue_clk_init(), and disable it again in dwc3_generic_remove()
to keep the enable balanced.
Fixes: c6583354b7c1 ("usb: dwc3: Look up reference clock DT phandle in both controller DT nodes")
Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
---
drivers/usb/dwc3/dwc3-generic.c | 47 ++++++++++++++++++++++-----------
1 file changed, 31 insertions(+), 16 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index 2356b3bc0aa..704dd242553 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -31,6 +31,7 @@ struct dwc3_generic_priv {
struct dwc3 dwc3;
struct phy_bulk phys;
struct gpio_desc *ulpi_reset;
+ struct clk ref_clk;
};
struct dwc3_generic_host_priv {
@@ -47,8 +48,8 @@ static int dwc3_generic_probe(struct udevice *dev,
struct dwc3_generic_plat *plat = dev_get_plat(dev);
struct dwc3 *dwc3 = &priv->dwc3;
struct dwc3_glue_data *glue = dev_get_plat(dev->parent);
- int __maybe_unused index;
- ofnode __maybe_unused node;
+ struct udevice * const __maybe_unused clk_devs[] = { dev, dev->parent };
+ int __maybe_unused i;
dwc3->dev = dev;
dwc3->maximum_speed = plat->maximum_speed;
@@ -63,22 +64,31 @@ static int dwc3_generic_probe(struct udevice *dev,
* - in top level generic node, with no subnode (i.MX8MQ)
* - in generic subnode, with other clock in top level node (i.MX8MP)
* - in both top level node and generic subnode (Rockchip)
- * Cover all the possibilities here by looking into both nodes, start
- * with the top level node as that seems to be used in majority of DTs
- * to reference the clock.
+ * Cover all the possibilities here by looking into both nodes, the
+ * generic node first and the top level glue node second. The clock
+ * must be looked up on the device that owns the node it is described
+ * in, the clock-names lists of the two nodes are unrelated (e.g. on
+ * i.MX95 the glue node has "hsio", "suspend" while the generic
+ * subnode has "bus_early", "ref", "suspend").
*/
- node = dev_ofnode(dev->parent);
- index = ofnode_stringlist_search(node, "clock-names", "ref");
- if (index < 0)
- index = ofnode_stringlist_search(node, "clock-names", "ref_clk");
- if (index < 0) {
- node = dev_ofnode(dev);
- index = ofnode_stringlist_search(node, "clock-names", "ref");
- if (index < 0)
- index = ofnode_stringlist_search(node, "clock-names", "ref_clk");
+ for (i = 0; i < ARRAY_SIZE(clk_devs); i++) {
+ struct clk clk;
+
+ rc = clk_get_by_name(clk_devs[i], "ref", &clk);
+ if (rc)
+ rc = clk_get_by_name(clk_devs[i], "ref_clk", &clk);
+ if (rc)
+ continue;
+
+ priv->ref_clk = clk;
+
+ rc = clk_enable(&priv->ref_clk);
+ if (rc && rc != -ENOSYS)
+ dev_warn(dev, "failed to enable ref clock: %d\n", rc);
+
+ dwc3->ref_clk = &priv->ref_clk;
+ break;
}
- if (index >= 0)
- dwc3->ref_clk = &glue->clks.clks[index];
#endif
/*
@@ -145,6 +155,11 @@ static int dwc3_generic_remove(struct udevice *dev,
dwc3_remove(dwc3);
dwc3_shutdown_phy(dev, &priv->phys);
+
+ /* Balance the clk_enable() from dwc3_generic_probe() */
+ if (dwc3->ref_clk)
+ clk_disable(dwc3->ref_clk);
+
unmap_physmem(dwc3->regs, MAP_NOCACHE);
return 0;
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 4/7] usb: skip host-only devices when picking the ehci gadget controller
2026-09-14 7:42 [PATCH v2 0/7] usb: fix DWC3/gadget issues and enable USB on Toradex i.MX95 boards Stefan Eichenberger
` (2 preceding siblings ...)
2026-09-14 7:42 ` [PATCH v2 3/7] usb: dwc3-generic: fix ref clock lookup indexing wrong clk_bulk array Stefan Eichenberger
@ 2026-09-14 7:42 ` Stefan Eichenberger
2026-09-14 19:31 ` Marek Vasut
2026-09-14 7:42 ` [PATCH v2 5/7] configs: verdin-imx95: enable CI_UDC usb gadget driver Stefan Eichenberger
` (2 subsequent siblings)
6 siblings, 1 reply; 16+ messages in thread
From: Stefan Eichenberger @ 2026-09-14 7:42 UTC (permalink / raw)
To: francesco.dolcini, trini, ilias.apalodimas, sbabic, festevam,
uboot-imx, marek.vasut+usb, lukma, mkorpershoek, antoine.gouby,
alice.guo, stefan.eichenberger, sjg, emanuele.ghidoli,
franz.schnyder, pbrobinson, quentin.schulz, jbx6244, ye.li,
xu.yang_2, bmeng.cn, xypron.glpk, hayashi.kunihiko, sean.anderson
Cc: u-boot
From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
The i.MX95 SoC has two USB controllers, a DWC3 controller and a ChipIdea
controller. However, U-Boot might select a controller that is marked as
host only in the device tree when attempting to set up a USB gadget,
leading to failures in gadget mode.
Iterate over usb devices and skipping any that are marked host-only when
selecting the controller for gadget mode. This ensures that a controller
that is marked as device or otg is used for USB gadget functionality.
Verified on Verdin iMX95 hardware: "ums 0 mmc 0" now correctly flips
the ChipIdea OTG controller into device mode and enumerates on the
host PC.
Fixes: 821ca608d816 ("usb: Use the first available device for ehci_gadget")
Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
---
drivers/usb/host/usb-uclass.c | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/host/usb-uclass.c b/drivers/usb/host/usb-uclass.c
index 1c74d6fd39a..b9e9ef7e86a 100644
--- a/drivers/usb/host/usb-uclass.c
+++ b/drivers/usb/host/usb-uclass.c
@@ -18,6 +18,7 @@
#include <dm/device-internal.h>
#include <dm/lists.h>
#include <dm/uclass-internal.h>
+#include <linux/usb/otg.h>
#include <time.h>
static bool asynch_allowed;
@@ -484,10 +485,23 @@ int usb_setup_ehci_gadget(struct ehci_ctrl **ctlrp)
struct udevice *dev;
int ret;
- /* Find the old device and remove it */
+ /*
+ * Find the first UCLASS_USB device that isn't host-only. SoCs can
+ * have more than one UCLASS_USB controller (e.g. i.MX95, where a
+ * host-only DWC3 port and the ChipIdea OTG port both register under
+ * UCLASS_USB); taking whichever device happens to be first could
+ * pick the host-only controller instead of the OTG-capable one this
+ * is actually meant to flip into device mode.
+ */
ret = uclass_find_first_device(UCLASS_USB, &dev);
if (ret)
return ret;
+ while (dev && usb_get_dr_mode(dev_ofnode(dev)) == USB_DR_MODE_HOST)
+ uclass_find_next_device(&dev);
+ if (!dev)
+ return -ENODEV;
+
+ /* Remove the old device */
ret = device_remove(dev, DM_REMOVE_NORMAL);
if (ret)
return ret;
@@ -507,10 +521,15 @@ int usb_remove_ehci_gadget(struct ehci_ctrl **ctlrp)
struct udevice *dev;
int ret;
- /* Find the old device and remove it */
+ /* Find the same non-host-only device usb_setup_ehci_gadget() used */
ret = uclass_find_first_device(UCLASS_USB, &dev);
if (ret)
return ret;
+ while (dev && usb_get_dr_mode(dev_ofnode(dev)) == USB_DR_MODE_HOST)
+ uclass_find_next_device(&dev);
+ if (!dev)
+ return -ENODEV;
+
ret = device_remove(dev, DM_REMOVE_NORMAL);
if (ret)
return ret;
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 5/7] configs: verdin-imx95: enable CI_UDC usb gadget driver
2026-09-14 7:42 [PATCH v2 0/7] usb: fix DWC3/gadget issues and enable USB on Toradex i.MX95 boards Stefan Eichenberger
` (3 preceding siblings ...)
2026-09-14 7:42 ` [PATCH v2 4/7] usb: skip host-only devices when picking the ehci gadget controller Stefan Eichenberger
@ 2026-09-14 7:42 ` Stefan Eichenberger
2026-09-14 7:42 ` [PATCH v2 6/7] toradex: verdin-imx95: enable DWC3 USB controller support Stefan Eichenberger
2026-09-14 7:42 ` [PATCH v2 7/7] toradex: smarc-imx95: " Stefan Eichenberger
6 siblings, 0 replies; 16+ messages in thread
From: Stefan Eichenberger @ 2026-09-14 7:42 UTC (permalink / raw)
To: francesco.dolcini, trini, ilias.apalodimas, sbabic, festevam,
uboot-imx, marek.vasut+usb, lukma, mkorpershoek, antoine.gouby,
alice.guo, stefan.eichenberger, sjg, emanuele.ghidoli,
franz.schnyder, pbrobinson, quentin.schulz, jbx6244, ye.li,
xu.yang_2, bmeng.cn, xypron.glpk, hayashi.kunihiko, sean.anderson
Cc: u-boot
From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
Enable CONFIG_CI_UDC, which now provides a driver model driver for the
"fsl,imx27-usb" node. The node is an OTG port, so the EHCI host driver
stays bound next to it and "usb start" keeps working.
Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
---
configs/verdin-imx95_defconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/configs/verdin-imx95_defconfig b/configs/verdin-imx95_defconfig
index daf41a8b830..77b22a2f8a5 100644
--- a/configs/verdin-imx95_defconfig
+++ b/configs/verdin-imx95_defconfig
@@ -179,6 +179,7 @@ CONFIG_USB_GADGET_MANUFACTURER="Toradex"
CONFIG_USB_GADGET_VENDOR_NUM=0x1b67
CONFIG_USB_GADGET_PRODUCT_NUM=0x4000
CONFIG_USB_GADGET_OS_DESCRIPTORS=y
+CONFIG_CI_UDC=y
CONFIG_SDP_LOADADDR=0x90400000
CONFIG_ULP_WATCHDOG=y
CONFIG_WDT=y
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 6/7] toradex: verdin-imx95: enable DWC3 USB controller support
2026-09-14 7:42 [PATCH v2 0/7] usb: fix DWC3/gadget issues and enable USB on Toradex i.MX95 boards Stefan Eichenberger
` (4 preceding siblings ...)
2026-09-14 7:42 ` [PATCH v2 5/7] configs: verdin-imx95: enable CI_UDC usb gadget driver Stefan Eichenberger
@ 2026-09-14 7:42 ` Stefan Eichenberger
2026-09-14 7:42 ` [PATCH v2 7/7] toradex: smarc-imx95: " Stefan Eichenberger
6 siblings, 0 replies; 16+ messages in thread
From: Stefan Eichenberger @ 2026-09-14 7:42 UTC (permalink / raw)
To: francesco.dolcini, trini, ilias.apalodimas, sbabic, festevam,
uboot-imx, marek.vasut+usb, lukma, mkorpershoek, antoine.gouby,
alice.guo, stefan.eichenberger, sjg, emanuele.ghidoli,
franz.schnyder, pbrobinson, quentin.schulz, jbx6244, ye.li,
xu.yang_2, bmeng.cn, xypron.glpk, hayashi.kunihiko, sean.anderson
Cc: u-boot
From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
Enable the DWC3 USB host controller on the Verdin iMX95. Enable the DWC3
driver support by enabling the wrapper driver CONFIG_USB_DWC3_GENERIC
and ensure the device tree nodes are kept enabled for U-Boot.
CONFIG_USB_DWC3_GADGET has to be enabled along with it. dwc3-generic.c
builds its peripheral driver whenever DM_USB_GADGET is set, and that
driver calls dwc3_gadget_uboot_handle_interrupt(), which is only built
with USB_DWC3_GADGET:
drivers/usb/dwc3/dwc3-generic.c:220: undefined reference to
`dwc3_gadget_uboot_handle_interrupt'
Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
---
arch/arm/dts/imx95-verdin-wifi-dev-u-boot.dtsi | 8 --------
configs/verdin-imx95_defconfig | 2 +-
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/arch/arm/dts/imx95-verdin-wifi-dev-u-boot.dtsi b/arch/arm/dts/imx95-verdin-wifi-dev-u-boot.dtsi
index 8ab70cf7399..ab6e1054a9f 100644
--- a/arch/arm/dts/imx95-verdin-wifi-dev-u-boot.dtsi
+++ b/arch/arm/dts/imx95-verdin-wifi-dev-u-boot.dtsi
@@ -90,14 +90,6 @@
/delete-property/power-domains;
};
-&usb3 {
- status = "disabled";
-};
-
-&usb3_dwc3 {
- status = "disabled";
-};
-
&usb_recov_ctrl {
bootph-pre-ram;
};
diff --git a/configs/verdin-imx95_defconfig b/configs/verdin-imx95_defconfig
index 77b22a2f8a5..e49af4a9861 100644
--- a/configs/verdin-imx95_defconfig
+++ b/configs/verdin-imx95_defconfig
@@ -172,7 +172,7 @@ CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_DWC3=y
CONFIG_USB_EHCI_HCD=y
CONFIG_USB_DWC3=y
-# CONFIG_USB_DWC3_GADGET is not set
+CONFIG_USB_DWC3_GENERIC=y
CONFIG_USB_HOST_ETHER=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_MANUFACTURER="Toradex"
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v2 7/7] toradex: smarc-imx95: enable DWC3 USB controller support
2026-09-14 7:42 [PATCH v2 0/7] usb: fix DWC3/gadget issues and enable USB on Toradex i.MX95 boards Stefan Eichenberger
` (5 preceding siblings ...)
2026-09-14 7:42 ` [PATCH v2 6/7] toradex: verdin-imx95: enable DWC3 USB controller support Stefan Eichenberger
@ 2026-09-14 7:42 ` Stefan Eichenberger
6 siblings, 0 replies; 16+ messages in thread
From: Stefan Eichenberger @ 2026-09-14 7:42 UTC (permalink / raw)
To: francesco.dolcini, trini, ilias.apalodimas, sbabic, festevam,
uboot-imx, marek.vasut+usb, lukma, mkorpershoek, antoine.gouby,
alice.guo, stefan.eichenberger, sjg, emanuele.ghidoli,
franz.schnyder, pbrobinson, quentin.schulz, jbx6244, ye.li,
xu.yang_2, bmeng.cn, xypron.glpk, hayashi.kunihiko, sean.anderson
Cc: u-boot
From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
The iMX95 USB controller is DWC3 based, but the DWC3 core/glue driver
was never enabled for this board, therefore enable CONFIG_USB_DWC3,
CONFIG_USB_XHCI_DWC3 and CONFIG_USB_DWC3_GENERIC to enable support for
USB in U-Boot for the Toradex SMARC iMX95.
Remove the dwc3 nodes from the U-Boot device tree to keep them enabled
now that the driver is there.
Also enable support for DM_USB_GADGET now that the ui_udc driver
supports the driver model.
Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
---
arch/arm/dts/imx95-toradex-smarc-dev-u-boot.dtsi | 8 --------
configs/toradex-smarc-imx95_defconfig | 4 ++++
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/arch/arm/dts/imx95-toradex-smarc-dev-u-boot.dtsi b/arch/arm/dts/imx95-toradex-smarc-dev-u-boot.dtsi
index e4eda61e5c4..d9fe4abe877 100644
--- a/arch/arm/dts/imx95-toradex-smarc-dev-u-boot.dtsi
+++ b/arch/arm/dts/imx95-toradex-smarc-dev-u-boot.dtsi
@@ -88,14 +88,6 @@
/delete-property/power-domains;
};
-&usb3 {
- status = "disabled";
-};
-
-&usb3_dwc3 {
- status = "disabled";
-};
-
&usdhc1 {
bootph-pre-ram;
};
diff --git a/configs/toradex-smarc-imx95_defconfig b/configs/toradex-smarc-imx95_defconfig
index 9abadb0ed1a..0da5fd8407d 100644
--- a/configs/toradex-smarc-imx95_defconfig
+++ b/configs/toradex-smarc-imx95_defconfig
@@ -165,8 +165,12 @@ CONFIG_FSL_LPUART=y
CONFIG_SPI=y
CONFIG_DM_THERMAL=y
CONFIG_USB=y
+CONFIG_DM_USB_GADGET=y
CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_DWC3=y
CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_DWC3_GENERIC=y
CONFIG_USB_HOST_ETHER=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_MANUFACTURER="Toradex"
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v2 3/7] usb: dwc3-generic: fix ref clock lookup indexing wrong clk_bulk array
2026-09-14 7:42 ` [PATCH v2 3/7] usb: dwc3-generic: fix ref clock lookup indexing wrong clk_bulk array Stefan Eichenberger
@ 2026-09-14 19:26 ` Marek Vasut
2026-09-15 7:44 ` Stefan Eichenberger
0 siblings, 1 reply; 16+ messages in thread
From: Marek Vasut @ 2026-09-14 19:26 UTC (permalink / raw)
To: Stefan Eichenberger, francesco.dolcini, trini, ilias.apalodimas,
sbabic, festevam, uboot-imx, marek.vasut+usb, lukma, mkorpershoek,
antoine.gouby, alice.guo, stefan.eichenberger, sjg,
emanuele.ghidoli, franz.schnyder, pbrobinson, quentin.schulz,
jbx6244, ye.li, xu.yang_2, bmeng.cn, xypron.glpk,
hayashi.kunihiko, sean.anderson
Cc: u-boot
On 9/14/26 9:42 AM, Stefan Eichenberger wrote:
> From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
>
> On Verdin iMX95, with a USB hub permanently attached to the DWC3 host
> port the hub itself enumerates fine but a USB stick plugged into it
> fails intermittently:
>
> Verdin iMX95 # usb start
> starting USB...
> USB XHCI 1.10
> Device not responding to set address.
>
> USB device not accepting new address (error=80000000)
> Bus usb@4c100000: 2 USB Device(s) found
> scanning usb for storage devices... 0 Storage Device(s) found
> Verdin iMX95 # usb reset
> resetting USB...
> USB XHCI 1.10
> WARN endpoint is halted
> WARN endpoint is halted
> unable to get device descriptor (error=-22)
>
> Commit c6583354b7c1 ("usb: dwc3: Look up reference clock DT phandle in
> both controller DT nodes") added a fallback that searches the DWC3
> child node's "clock-names" for "ref"/"ref_clk" when it isn't found on
> the parent glue node, but always resolves the found index against
> glue->clks, a clk_bulk populated only from the parent glue node's own
> clock-names list. This is wrong since the child node's clock-names list
> is not guaranteed to be in the same order as the parent's, and indeed on
> Verdin iMX95 the child node has a different order than the parent node.
>
> Fix it by looking the reference clock up by name with clk_get_by_name(),
> walking the dwc3 device first and then its parent glue device, so the
> clock is always resolved through the device that owns the node its name
> was found in. Also enable the clock before use, the child node's clocks
> are not part of the glue node's clk_bulk and are therefore not enabled
> by dwc3_glue_clk_init(), and disable it again in dwc3_generic_remove()
> to keep the enable balanced.
>
> Fixes: c6583354b7c1 ("usb: dwc3: Look up reference clock DT phandle in both controller DT nodes")
> Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> ---
> drivers/usb/dwc3/dwc3-generic.c | 47 ++++++++++++++++++++++-----------
> 1 file changed, 31 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
> index 2356b3bc0aa..704dd242553 100644
> --- a/drivers/usb/dwc3/dwc3-generic.c
> +++ b/drivers/usb/dwc3/dwc3-generic.c
> @@ -31,6 +31,7 @@ struct dwc3_generic_priv {
> struct dwc3 dwc3;
> struct phy_bulk phys;
> struct gpio_desc *ulpi_reset;
> + struct clk ref_clk;
> };
>
> struct dwc3_generic_host_priv {
> @@ -47,8 +48,8 @@ static int dwc3_generic_probe(struct udevice *dev,
> struct dwc3_generic_plat *plat = dev_get_plat(dev);
> struct dwc3 *dwc3 = &priv->dwc3;
> struct dwc3_glue_data *glue = dev_get_plat(dev->parent);
> - int __maybe_unused index;
> - ofnode __maybe_unused node;
> + struct udevice * const __maybe_unused clk_devs[] = { dev, dev->parent };
> + int __maybe_unused i;
>
> dwc3->dev = dev;
> dwc3->maximum_speed = plat->maximum_speed;
> @@ -63,22 +64,31 @@ static int dwc3_generic_probe(struct udevice *dev,
> * - in top level generic node, with no subnode (i.MX8MQ)
> * - in generic subnode, with other clock in top level node (i.MX8MP)
> * - in both top level node and generic subnode (Rockchip)
> - * Cover all the possibilities here by looking into both nodes, start
> - * with the top level node as that seems to be used in majority of DTs
> - * to reference the clock.
> + * Cover all the possibilities here by looking into both nodes, the
> + * generic node first and the top level glue node second. The clock
> + * must be looked up on the device that owns the node it is described
> + * in, the clock-names lists of the two nodes are unrelated (e.g. on
> + * i.MX95 the glue node has "hsio", "suspend" while the generic
> + * subnode has "bus_early", "ref", "suspend").
> */
> - node = dev_ofnode(dev->parent);
> - index = ofnode_stringlist_search(node, "clock-names", "ref");
> - if (index < 0)
> - index = ofnode_stringlist_search(node, "clock-names", "ref_clk");
> - if (index < 0) {
> - node = dev_ofnode(dev);
> - index = ofnode_stringlist_search(node, "clock-names", "ref");
> - if (index < 0)
> - index = ofnode_stringlist_search(node, "clock-names", "ref_clk");
> + for (i = 0; i < ARRAY_SIZE(clk_devs); i++) {
Do we need a loop for two device pointers, where we are basically sure
that there won't ever be any more device pointers in the list ? (I think
no, so please use four clk_get_by_name() calls and be done with it)
Also, please send this patch separately, so it can be picked as a bugfix
for 2026.10 .
Thank you.
> + struct clk clk;
> +
> + rc = clk_get_by_name(clk_devs[i], "ref", &clk);
> + if (rc)
> + rc = clk_get_by_name(clk_devs[i], "ref_clk", &clk);
> + if (rc)
> + continue;
[...]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 4/7] usb: skip host-only devices when picking the ehci gadget controller
2026-09-14 7:42 ` [PATCH v2 4/7] usb: skip host-only devices when picking the ehci gadget controller Stefan Eichenberger
@ 2026-09-14 19:31 ` Marek Vasut
2026-09-15 7:57 ` Stefan Eichenberger
0 siblings, 1 reply; 16+ messages in thread
From: Marek Vasut @ 2026-09-14 19:31 UTC (permalink / raw)
To: Stefan Eichenberger, francesco.dolcini, trini, ilias.apalodimas,
sbabic, festevam, uboot-imx, marek.vasut+usb, lukma, mkorpershoek,
antoine.gouby, alice.guo, stefan.eichenberger, sjg,
emanuele.ghidoli, franz.schnyder, pbrobinson, quentin.schulz,
jbx6244, ye.li, xu.yang_2, bmeng.cn, xypron.glpk,
hayashi.kunihiko, sean.anderson
Cc: u-boot
On 9/14/26 9:42 AM, Stefan Eichenberger wrote:
> From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
>
> The i.MX95 SoC has two USB controllers, a DWC3 controller and a ChipIdea
> controller. However, U-Boot might select a controller that is marked as
> host only in the device tree when attempting to set up a USB gadget,
> leading to failures in gadget mode.
>
> Iterate over usb devices and skipping any that are marked host-only when
> selecting the controller for gadget mode. This ensures that a controller
> that is marked as device or otg is used for USB gadget functionality.
>
> Verified on Verdin iMX95 hardware: "ums 0 mmc 0" now correctly flips
> the ChipIdea OTG controller into device mode and enumerates on the
> host PC.
What was the previous incorrect behavior ?
Does your board DT have /aliases { usb0 = &... } entry pointing to the
chipidea controller already ? The controller indexing should match the
aliases ordering.
[...]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 3/7] usb: dwc3-generic: fix ref clock lookup indexing wrong clk_bulk array
2026-09-14 19:26 ` Marek Vasut
@ 2026-09-15 7:44 ` Stefan Eichenberger
2026-09-15 14:22 ` Marek Vasut
0 siblings, 1 reply; 16+ messages in thread
From: Stefan Eichenberger @ 2026-09-15 7:44 UTC (permalink / raw)
To: Marek Vasut
Cc: francesco.dolcini, trini, ilias.apalodimas, sbabic, festevam,
uboot-imx, marek.vasut+usb, lukma, mkorpershoek, antoine.gouby,
alice.guo, stefan.eichenberger, sjg, emanuele.ghidoli,
franz.schnyder, pbrobinson, quentin.schulz, jbx6244, ye.li,
xu.yang_2, bmeng.cn, xypron.glpk, hayashi.kunihiko, sean.anderson,
u-boot
On Mon, Sep 14, 2026 at 09:26:12PM +0200, Marek Vasut wrote:
> On 9/14/26 9:42 AM, Stefan Eichenberger wrote:
> > From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> >
> > On Verdin iMX95, with a USB hub permanently attached to the DWC3 host
> > port the hub itself enumerates fine but a USB stick plugged into it
> > fails intermittently:
> >
> > Verdin iMX95 # usb start
> > starting USB...
> > USB XHCI 1.10
> > Device not responding to set address.
> >
> > USB device not accepting new address (error=80000000)
> > Bus usb@4c100000: 2 USB Device(s) found
> > scanning usb for storage devices... 0 Storage Device(s) found
> > Verdin iMX95 # usb reset
> > resetting USB...
> > USB XHCI 1.10
> > WARN endpoint is halted
> > WARN endpoint is halted
> > unable to get device descriptor (error=-22)
> >
> > Commit c6583354b7c1 ("usb: dwc3: Look up reference clock DT phandle in
> > both controller DT nodes") added a fallback that searches the DWC3
> > child node's "clock-names" for "ref"/"ref_clk" when it isn't found on
> > the parent glue node, but always resolves the found index against
> > glue->clks, a clk_bulk populated only from the parent glue node's own
> > clock-names list. This is wrong since the child node's clock-names list
> > is not guaranteed to be in the same order as the parent's, and indeed on
> > Verdin iMX95 the child node has a different order than the parent node.
> >
> > Fix it by looking the reference clock up by name with clk_get_by_name(),
> > walking the dwc3 device first and then its parent glue device, so the
> > clock is always resolved through the device that owns the node its name
> > was found in. Also enable the clock before use, the child node's clocks
> > are not part of the glue node's clk_bulk and are therefore not enabled
> > by dwc3_glue_clk_init(), and disable it again in dwc3_generic_remove()
> > to keep the enable balanced.
> >
> > Fixes: c6583354b7c1 ("usb: dwc3: Look up reference clock DT phandle in both controller DT nodes")
> > Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> > ---
> > drivers/usb/dwc3/dwc3-generic.c | 47 ++++++++++++++++++++++-----------
> > 1 file changed, 31 insertions(+), 16 deletions(-)
> >
> > diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
> > index 2356b3bc0aa..704dd242553 100644
> > --- a/drivers/usb/dwc3/dwc3-generic.c
> > +++ b/drivers/usb/dwc3/dwc3-generic.c
> > @@ -31,6 +31,7 @@ struct dwc3_generic_priv {
> > struct dwc3 dwc3;
> > struct phy_bulk phys;
> > struct gpio_desc *ulpi_reset;
> > + struct clk ref_clk;
> > };
> > struct dwc3_generic_host_priv {
> > @@ -47,8 +48,8 @@ static int dwc3_generic_probe(struct udevice *dev,
> > struct dwc3_generic_plat *plat = dev_get_plat(dev);
> > struct dwc3 *dwc3 = &priv->dwc3;
> > struct dwc3_glue_data *glue = dev_get_plat(dev->parent);
> > - int __maybe_unused index;
> > - ofnode __maybe_unused node;
> > + struct udevice * const __maybe_unused clk_devs[] = { dev, dev->parent };
> > + int __maybe_unused i;
> > dwc3->dev = dev;
> > dwc3->maximum_speed = plat->maximum_speed;
> > @@ -63,22 +64,31 @@ static int dwc3_generic_probe(struct udevice *dev,
> > * - in top level generic node, with no subnode (i.MX8MQ)
> > * - in generic subnode, with other clock in top level node (i.MX8MP)
> > * - in both top level node and generic subnode (Rockchip)
> > - * Cover all the possibilities here by looking into both nodes, start
> > - * with the top level node as that seems to be used in majority of DTs
> > - * to reference the clock.
> > + * Cover all the possibilities here by looking into both nodes, the
> > + * generic node first and the top level glue node second. The clock
> > + * must be looked up on the device that owns the node it is described
> > + * in, the clock-names lists of the two nodes are unrelated (e.g. on
> > + * i.MX95 the glue node has "hsio", "suspend" while the generic
> > + * subnode has "bus_early", "ref", "suspend").
> > */
> > - node = dev_ofnode(dev->parent);
> > - index = ofnode_stringlist_search(node, "clock-names", "ref");
> > - if (index < 0)
> > - index = ofnode_stringlist_search(node, "clock-names", "ref_clk");
> > - if (index < 0) {
> > - node = dev_ofnode(dev);
> > - index = ofnode_stringlist_search(node, "clock-names", "ref");
> > - if (index < 0)
> > - index = ofnode_stringlist_search(node, "clock-names", "ref_clk");
> > + for (i = 0; i < ARRAY_SIZE(clk_devs); i++) {
>
> Do we need a loop for two device pointers, where we are basically sure that
> there won't ever be any more device pointers in the list ? (I think no, so
> please use four clk_get_by_name() calls and be done with it)
>
> Also, please send this patch separately, so it can be picked as a bugfix for
> 2026.10 .
>
> Thank you.
My fault, I somehow missunderstood the last comment and thought I should
create a loop. I will change that and send it as a separate patch.
Thanks for the review.
Stefan
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 4/7] usb: skip host-only devices when picking the ehci gadget controller
2026-09-14 19:31 ` Marek Vasut
@ 2026-09-15 7:57 ` Stefan Eichenberger
2026-09-15 14:24 ` Marek Vasut
0 siblings, 1 reply; 16+ messages in thread
From: Stefan Eichenberger @ 2026-09-15 7:57 UTC (permalink / raw)
To: Marek Vasut
Cc: francesco.dolcini, trini, ilias.apalodimas, sbabic, festevam,
uboot-imx, marek.vasut+usb, lukma, mkorpershoek, antoine.gouby,
alice.guo, stefan.eichenberger, sjg, emanuele.ghidoli,
franz.schnyder, pbrobinson, quentin.schulz, jbx6244, ye.li,
xu.yang_2, bmeng.cn, xypron.glpk, hayashi.kunihiko, sean.anderson,
u-boot
On Mon, Sep 14, 2026 at 09:31:25PM +0200, Marek Vasut wrote:
> On 9/14/26 9:42 AM, Stefan Eichenberger wrote:
> > From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> >
> > The i.MX95 SoC has two USB controllers, a DWC3 controller and a ChipIdea
> > controller. However, U-Boot might select a controller that is marked as
> > host only in the device tree when attempting to set up a USB gadget,
> > leading to failures in gadget mode.
> >
> > Iterate over usb devices and skipping any that are marked host-only when
> > selecting the controller for gadget mode. This ensures that a controller
> > that is marked as device or otg is used for USB gadget functionality.
> >
> > Verified on Verdin iMX95 hardware: "ums 0 mmc 0" now correctly flips
> > the ChipIdea OTG controller into device mode and enumerates on the
> > host PC.
>
> What was the previous incorrect behavior ?
When I did a ums 0 mmc 0, the host only DWC3 controller was selected. It
is not host only by itself, but it is marked as host only for our board
in the device tree.
>
> Does your board DT have /aliases { usb0 = &... } entry pointing to the
> chipidea controller already ? The controller indexing should match the
> aliases ordering.
Yes we use aliases. Interstingly the dwc3 controller is usb1 and the
chipidea controller is usb0.
aliases {
...
usb0 = &usb2;
usb1 = &usb3;
...
};
&usb2 {
dr_mode = "otg";
...
};
&usb3 {
...
&usb3_dwc3 {
dr_mode = "host";
};
...
};
So it seems this ordering is not respected when selecting the controller
for gadget mode. I have to test that again. However, I still think host
only devices should never be selected for gadget mode which is what this
patch tries to address. Or should e.g. ums 1 mmc 0 just fail for host
only controllers? In this scenario I assume the ordering is correct so
ums 1 would select the dwc3 host only controller.
Regards,
Stefan
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 3/7] usb: dwc3-generic: fix ref clock lookup indexing wrong clk_bulk array
2026-09-15 7:44 ` Stefan Eichenberger
@ 2026-09-15 14:22 ` Marek Vasut
0 siblings, 0 replies; 16+ messages in thread
From: Marek Vasut @ 2026-09-15 14:22 UTC (permalink / raw)
To: Stefan Eichenberger
Cc: francesco.dolcini, trini, ilias.apalodimas, sbabic, festevam,
uboot-imx, marek.vasut+usb, lukma, mkorpershoek, antoine.gouby,
alice.guo, stefan.eichenberger, sjg, emanuele.ghidoli,
franz.schnyder, pbrobinson, quentin.schulz, jbx6244, ye.li,
xu.yang_2, bmeng.cn, xypron.glpk, hayashi.kunihiko, sean.anderson,
u-boot
On 9/15/26 9:44 AM, Stefan Eichenberger wrote:
> On Mon, Sep 14, 2026 at 09:26:12PM +0200, Marek Vasut wrote:
>> On 9/14/26 9:42 AM, Stefan Eichenberger wrote:
>>> From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
>>>
>>> On Verdin iMX95, with a USB hub permanently attached to the DWC3 host
>>> port the hub itself enumerates fine but a USB stick plugged into it
>>> fails intermittently:
>>>
>>> Verdin iMX95 # usb start
>>> starting USB...
>>> USB XHCI 1.10
>>> Device not responding to set address.
>>>
>>> USB device not accepting new address (error=80000000)
>>> Bus usb@4c100000: 2 USB Device(s) found
>>> scanning usb for storage devices... 0 Storage Device(s) found
>>> Verdin iMX95 # usb reset
>>> resetting USB...
>>> USB XHCI 1.10
>>> WARN endpoint is halted
>>> WARN endpoint is halted
>>> unable to get device descriptor (error=-22)
>>>
>>> Commit c6583354b7c1 ("usb: dwc3: Look up reference clock DT phandle in
>>> both controller DT nodes") added a fallback that searches the DWC3
>>> child node's "clock-names" for "ref"/"ref_clk" when it isn't found on
>>> the parent glue node, but always resolves the found index against
>>> glue->clks, a clk_bulk populated only from the parent glue node's own
>>> clock-names list. This is wrong since the child node's clock-names list
>>> is not guaranteed to be in the same order as the parent's, and indeed on
>>> Verdin iMX95 the child node has a different order than the parent node.
>>>
>>> Fix it by looking the reference clock up by name with clk_get_by_name(),
>>> walking the dwc3 device first and then its parent glue device, so the
>>> clock is always resolved through the device that owns the node its name
>>> was found in. Also enable the clock before use, the child node's clocks
>>> are not part of the glue node's clk_bulk and are therefore not enabled
>>> by dwc3_glue_clk_init(), and disable it again in dwc3_generic_remove()
>>> to keep the enable balanced.
>>>
>>> Fixes: c6583354b7c1 ("usb: dwc3: Look up reference clock DT phandle in both controller DT nodes")
>>> Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
>>> ---
>>> drivers/usb/dwc3/dwc3-generic.c | 47 ++++++++++++++++++++++-----------
>>> 1 file changed, 31 insertions(+), 16 deletions(-)
>>>
>>> diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
>>> index 2356b3bc0aa..704dd242553 100644
>>> --- a/drivers/usb/dwc3/dwc3-generic.c
>>> +++ b/drivers/usb/dwc3/dwc3-generic.c
>>> @@ -31,6 +31,7 @@ struct dwc3_generic_priv {
>>> struct dwc3 dwc3;
>>> struct phy_bulk phys;
>>> struct gpio_desc *ulpi_reset;
>>> + struct clk ref_clk;
>>> };
>>> struct dwc3_generic_host_priv {
>>> @@ -47,8 +48,8 @@ static int dwc3_generic_probe(struct udevice *dev,
>>> struct dwc3_generic_plat *plat = dev_get_plat(dev);
>>> struct dwc3 *dwc3 = &priv->dwc3;
>>> struct dwc3_glue_data *glue = dev_get_plat(dev->parent);
>>> - int __maybe_unused index;
>>> - ofnode __maybe_unused node;
>>> + struct udevice * const __maybe_unused clk_devs[] = { dev, dev->parent };
>>> + int __maybe_unused i;
>>> dwc3->dev = dev;
>>> dwc3->maximum_speed = plat->maximum_speed;
>>> @@ -63,22 +64,31 @@ static int dwc3_generic_probe(struct udevice *dev,
>>> * - in top level generic node, with no subnode (i.MX8MQ)
>>> * - in generic subnode, with other clock in top level node (i.MX8MP)
>>> * - in both top level node and generic subnode (Rockchip)
>>> - * Cover all the possibilities here by looking into both nodes, start
>>> - * with the top level node as that seems to be used in majority of DTs
>>> - * to reference the clock.
>>> + * Cover all the possibilities here by looking into both nodes, the
>>> + * generic node first and the top level glue node second. The clock
>>> + * must be looked up on the device that owns the node it is described
>>> + * in, the clock-names lists of the two nodes are unrelated (e.g. on
>>> + * i.MX95 the glue node has "hsio", "suspend" while the generic
>>> + * subnode has "bus_early", "ref", "suspend").
>>> */
>>> - node = dev_ofnode(dev->parent);
>>> - index = ofnode_stringlist_search(node, "clock-names", "ref");
>>> - if (index < 0)
>>> - index = ofnode_stringlist_search(node, "clock-names", "ref_clk");
>>> - if (index < 0) {
>>> - node = dev_ofnode(dev);
>>> - index = ofnode_stringlist_search(node, "clock-names", "ref");
>>> - if (index < 0)
>>> - index = ofnode_stringlist_search(node, "clock-names", "ref_clk");
>>> + for (i = 0; i < ARRAY_SIZE(clk_devs); i++) {
>>
>> Do we need a loop for two device pointers, where we are basically sure that
>> there won't ever be any more device pointers in the list ? (I think no, so
>> please use four clk_get_by_name() calls and be done with it)
>>
>> Also, please send this patch separately, so it can be picked as a bugfix for
>> 2026.10 .
>>
>> Thank you.
>
> My fault, I somehow missunderstood the last comment and thought I should
> create a loop. I will change that and send it as a separate patch.
I could have been overloaded too and didn't explain it clearly.
In any case, thank you.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 4/7] usb: skip host-only devices when picking the ehci gadget controller
2026-09-15 7:57 ` Stefan Eichenberger
@ 2026-09-15 14:24 ` Marek Vasut
2026-09-16 12:47 ` Stefan Eichenberger
0 siblings, 1 reply; 16+ messages in thread
From: Marek Vasut @ 2026-09-15 14:24 UTC (permalink / raw)
To: Stefan Eichenberger
Cc: francesco.dolcini, trini, ilias.apalodimas, sbabic, festevam,
uboot-imx, marek.vasut+usb, lukma, mkorpershoek, antoine.gouby,
alice.guo, stefan.eichenberger, sjg, emanuele.ghidoli,
franz.schnyder, pbrobinson, quentin.schulz, jbx6244, ye.li,
xu.yang_2, bmeng.cn, xypron.glpk, hayashi.kunihiko, sean.anderson,
u-boot
On 9/15/26 9:57 AM, Stefan Eichenberger wrote:
> On Mon, Sep 14, 2026 at 09:31:25PM +0200, Marek Vasut wrote:
>> On 9/14/26 9:42 AM, Stefan Eichenberger wrote:
>>> From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
>>>
>>> The i.MX95 SoC has two USB controllers, a DWC3 controller and a ChipIdea
>>> controller. However, U-Boot might select a controller that is marked as
>>> host only in the device tree when attempting to set up a USB gadget,
>>> leading to failures in gadget mode.
>>>
>>> Iterate over usb devices and skipping any that are marked host-only when
>>> selecting the controller for gadget mode. This ensures that a controller
>>> that is marked as device or otg is used for USB gadget functionality.
>>>
>>> Verified on Verdin iMX95 hardware: "ums 0 mmc 0" now correctly flips
>>> the ChipIdea OTG controller into device mode and enumerates on the
>>> host PC.
>>
>> What was the previous incorrect behavior ?
>
> When I did a ums 0 mmc 0, the host only DWC3 controller was selected. It
> is not host only by itself, but it is marked as host only for our board
> in the device tree.
>
>>
>> Does your board DT have /aliases { usb0 = &... } entry pointing to the
>> chipidea controller already ? The controller indexing should match the
>> aliases ordering.
>
> Yes we use aliases. Interstingly the dwc3 controller is usb1 and the
> chipidea controller is usb0.
>
> aliases {
> ...
> usb0 = &usb2;
> usb1 = &usb3;
> ...
> };
>
> &usb2 {
> dr_mode = "otg";
> ...
> };
>
> &usb3 {
> ...
> &usb3_dwc3 {
> dr_mode = "host";
> };
> ...
> };
>
> So it seems this ordering is not respected when selecting the controller
> for gadget mode. I have to test that again. However, I still think host
> only devices should never be selected for gadget mode which is what this
> patch tries to address. Or should e.g. ums 1 mmc 0 just fail for host
> only controllers?
Yes
> In this scenario I assume the ordering is correct so
> ums 1 would select the dwc3 host only controller.
The ordering should respect the aliases enumeration, so ums 0 ... is CI
HDRC and ums 1 is DWC3 . Can you check the U-Boot control DT /aliases
node to be sure the ordering there is as expected ?
=> fdt addr $fdtcontroladdr
=> fdt print /aliases
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 4/7] usb: skip host-only devices when picking the ehci gadget controller
2026-09-15 14:24 ` Marek Vasut
@ 2026-09-16 12:47 ` Stefan Eichenberger
2026-09-16 14:29 ` Marek Vasut
0 siblings, 1 reply; 16+ messages in thread
From: Stefan Eichenberger @ 2026-09-16 12:47 UTC (permalink / raw)
To: Marek Vasut
Cc: francesco.dolcini, trini, ilias.apalodimas, sbabic, festevam,
uboot-imx, marek.vasut+usb, lukma, mkorpershoek, antoine.gouby,
alice.guo, stefan.eichenberger, sjg, emanuele.ghidoli,
franz.schnyder, pbrobinson, quentin.schulz, jbx6244, ye.li,
xu.yang_2, bmeng.cn, xypron.glpk, hayashi.kunihiko, sean.anderson,
u-boot
On Tue, Sep 15, 2026 at 04:24:59PM +0200, Marek Vasut wrote:
> On 9/15/26 9:57 AM, Stefan Eichenberger wrote:
> > On Mon, Sep 14, 2026 at 09:31:25PM +0200, Marek Vasut wrote:
> > > On 9/14/26 9:42 AM, Stefan Eichenberger wrote:
> > > > From: Stefan Eichenberger <stefan.eichenberger@toradex.com>
> > > >
> > > > The i.MX95 SoC has two USB controllers, a DWC3 controller and a ChipIdea
> > > > controller. However, U-Boot might select a controller that is marked as
> > > > host only in the device tree when attempting to set up a USB gadget,
> > > > leading to failures in gadget mode.
> > > >
> > > > Iterate over usb devices and skipping any that are marked host-only when
> > > > selecting the controller for gadget mode. This ensures that a controller
> > > > that is marked as device or otg is used for USB gadget functionality.
> > > >
> > > > Verified on Verdin iMX95 hardware: "ums 0 mmc 0" now correctly flips
> > > > the ChipIdea OTG controller into device mode and enumerates on the
> > > > host PC.
> > >
> > > What was the previous incorrect behavior ?
> >
> > When I did a ums 0 mmc 0, the host only DWC3 controller was selected. It
> > is not host only by itself, but it is marked as host only for our board
> > in the device tree.
> >
> > >
> > > Does your board DT have /aliases { usb0 = &... } entry pointing to the
> > > chipidea controller already ? The controller indexing should match the
> > > aliases ordering.
> >
> > Yes we use aliases. Interstingly the dwc3 controller is usb1 and the
> > chipidea controller is usb0.
> >
> > aliases {
> > ...
> > usb0 = &usb2;
> > usb1 = &usb3;
> > ...
> > };
> >
> > &usb2 {
> > dr_mode = "otg";
> > ...
> > };
> >
> > &usb3 {
> > ...
> > &usb3_dwc3 {
> > dr_mode = "host";
> > };
> > ...
> > };
> >
> > So it seems this ordering is not respected when selecting the controller
> > for gadget mode. I have to test that again. However, I still think host
> > only devices should never be selected for gadget mode which is what this
> > patch tries to address. Or should e.g. ums 1 mmc 0 just fail for host
> > only controllers?
>
> Yes
>
> > In this scenario I assume the ordering is correct so
> > ums 1 would select the dwc3 host only controller.
> The ordering should respect the aliases enumeration, so ums 0 ... is CI HDRC
> and ums 1 is DWC3 . Can you check the U-Boot control DT /aliases node to be
> sure the ordering there is as expected ?
>
> => fdt addr $fdtcontroladdr
> => fdt print /aliases
aliases {
can0 = "/soc/bus@44000000/can@443a0000";
can1 = "/soc/bus@42000000/can@425b0000";
eeprom0 = "/soc/bus@44000000/i2c@44350000/eeprom@50";
ethernet0 = "/soc/system-controller@4cde0000/pcie@4ca00000/ethernet@0,0";
ethernet1 = "/soc/system-controller@4cde0000/pcie@4ca00000/ethernet@8,0";
i2c0 = "/soc/bus@44000000/i2c@44350000";
i2c1 = "/soc/bus@42000000/i2c@42540000";
i2c2 = "/soc/bus@42000000/i2c@42530000";
i2c3 = "/soc/bus@42000000/i3c@42520000";
i2c4 = "/soc/bus@42000000/i2c@426b0000";
mmc0 = "/soc/bus@42800000/mmc@42850000";
mmc1 = "/soc/bus@42800000/mmc@42860000";
mmc2 = "/soc/bus@42800000/mmc@428b0000";
rtc0 = "/soc/bus@44000000/i2c@44350000/rtc@32";
rtc1 = "/firmware/scmi/protocol@81";
serial0 = "/soc/bus@42000000/serial@42690000";
serial1 = "/soc/bus@42000000/serial@426a0000";
serial2 = "/soc/bus@44000000/serial@44380000";
serial3 = "/soc/bus@44000000/serial@44390000";
serial4 = "/soc/bus@42000000/serial@425a0000";
usb0 = "/soc/usb@4c200000";
usb1 = "/soc/usb@4c010010";
eeprom1 = "/soc/bus@42000000/i2c@42540000/eeprom@57";
};
I think I found what I missed. When I was originally testing it, the
CI_UDC driver was not a driver model driver, therefore the alias for
usb2 (alias usb0) did not work. Now with the driver model driver, it
indeed works:
Verdin iMX95 # ums 0 mmc 0
UMS: LUN 0, dev mmc 0, hwpart 0, sector 0x0, count 0x3b48000
\
Verdin iMX95 # ums 1 mmc 0
UMS: LUN 0, dev mmc 0, hwpart 0, sector 0x0, count 0x3b48000
No USB device found
Couldn't init USB controller.
So I can drop this patch with the next series, thanks a lot!
Regards,
Stefan
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v2 4/7] usb: skip host-only devices when picking the ehci gadget controller
2026-09-16 12:47 ` Stefan Eichenberger
@ 2026-09-16 14:29 ` Marek Vasut
0 siblings, 0 replies; 16+ messages in thread
From: Marek Vasut @ 2026-09-16 14:29 UTC (permalink / raw)
To: Stefan Eichenberger
Cc: francesco.dolcini, trini, ilias.apalodimas, sbabic, festevam,
uboot-imx, marek.vasut+usb, lukma, mkorpershoek, antoine.gouby,
alice.guo, stefan.eichenberger, sjg, emanuele.ghidoli,
franz.schnyder, pbrobinson, quentin.schulz, jbx6244, ye.li,
xu.yang_2, bmeng.cn, xypron.glpk, hayashi.kunihiko, sean.anderson,
u-boot
On 9/16/26 2:47 PM, Stefan Eichenberger wrote:
Hello Stefan,
[...]
>>> In this scenario I assume the ordering is correct so
>>> ums 1 would select the dwc3 host only controller.
>> The ordering should respect the aliases enumeration, so ums 0 ... is CI HDRC
>> and ums 1 is DWC3 . Can you check the U-Boot control DT /aliases node to be
>> sure the ordering there is as expected ?
>>
>> => fdt addr $fdtcontroladdr
>> => fdt print /aliases
>
> aliases {
> can0 = "/soc/bus@44000000/can@443a0000";
> can1 = "/soc/bus@42000000/can@425b0000";
> eeprom0 = "/soc/bus@44000000/i2c@44350000/eeprom@50";
> ethernet0 = "/soc/system-controller@4cde0000/pcie@4ca00000/ethernet@0,0";
> ethernet1 = "/soc/system-controller@4cde0000/pcie@4ca00000/ethernet@8,0";
> i2c0 = "/soc/bus@44000000/i2c@44350000";
> i2c1 = "/soc/bus@42000000/i2c@42540000";
> i2c2 = "/soc/bus@42000000/i2c@42530000";
> i2c3 = "/soc/bus@42000000/i3c@42520000";
> i2c4 = "/soc/bus@42000000/i2c@426b0000";
> mmc0 = "/soc/bus@42800000/mmc@42850000";
> mmc1 = "/soc/bus@42800000/mmc@42860000";
> mmc2 = "/soc/bus@42800000/mmc@428b0000";
> rtc0 = "/soc/bus@44000000/i2c@44350000/rtc@32";
> rtc1 = "/firmware/scmi/protocol@81";
> serial0 = "/soc/bus@42000000/serial@42690000";
> serial1 = "/soc/bus@42000000/serial@426a0000";
> serial2 = "/soc/bus@44000000/serial@44380000";
> serial3 = "/soc/bus@44000000/serial@44390000";
> serial4 = "/soc/bus@42000000/serial@425a0000";
> usb0 = "/soc/usb@4c200000";
> usb1 = "/soc/usb@4c010010";
> eeprom1 = "/soc/bus@42000000/i2c@42540000/eeprom@57";
> };
>
> I think I found what I missed. When I was originally testing it, the
> CI_UDC driver was not a driver model driver, therefore the alias for
> usb2 (alias usb0) did not work. Now with the driver model driver, it
> indeed works:
> Verdin iMX95 # ums 0 mmc 0
> UMS: LUN 0, dev mmc 0, hwpart 0, sector 0x0, count 0x3b48000
> \
>
> Verdin iMX95 # ums 1 mmc 0
> UMS: LUN 0, dev mmc 0, hwpart 0, sector 0x0, count 0x3b48000
> No USB device found
> Couldn't init USB controller.
>
> So I can drop this patch with the next series, thanks a lot!
That is nice, well done.
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2026-09-17 4:47 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-14 7:42 [PATCH v2 0/7] usb: fix DWC3/gadget issues and enable USB on Toradex i.MX95 boards Stefan Eichenberger
2026-09-14 7:42 ` [PATCH v2 1/7] usb: ci_udc: add driver model support Stefan Eichenberger
2026-09-14 7:42 ` [PATCH v2 2/7] usb: ehci-mx6: bind the ChipIdea gadget driver Stefan Eichenberger
2026-09-14 7:42 ` [PATCH v2 3/7] usb: dwc3-generic: fix ref clock lookup indexing wrong clk_bulk array Stefan Eichenberger
2026-09-14 19:26 ` Marek Vasut
2026-09-15 7:44 ` Stefan Eichenberger
2026-09-15 14:22 ` Marek Vasut
2026-09-14 7:42 ` [PATCH v2 4/7] usb: skip host-only devices when picking the ehci gadget controller Stefan Eichenberger
2026-09-14 19:31 ` Marek Vasut
2026-09-15 7:57 ` Stefan Eichenberger
2026-09-15 14:24 ` Marek Vasut
2026-09-16 12:47 ` Stefan Eichenberger
2026-09-16 14:29 ` Marek Vasut
2026-09-14 7:42 ` [PATCH v2 5/7] configs: verdin-imx95: enable CI_UDC usb gadget driver Stefan Eichenberger
2026-09-14 7:42 ` [PATCH v2 6/7] toradex: verdin-imx95: enable DWC3 USB controller support Stefan Eichenberger
2026-09-14 7:42 ` [PATCH v2 7/7] toradex: smarc-imx95: " Stefan Eichenberger
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.