* [PATCH 1/4] dm: core: Support multiple drivers with same compatibles
2025-11-26 20:31 [PATCH 0/4] dm: core: Support same compatible in host/gadget musb drivers Markus Schneider-Pargmann (TI.com)
@ 2025-11-26 20:31 ` Markus Schneider-Pargmann (TI.com)
2026-01-07 13:16 ` Mattijs Korpershoek
2025-11-26 20:31 ` [PATCH 2/4] test: dm: Add compatible multimatch test Markus Schneider-Pargmann (TI.com)
` (3 subsequent siblings)
4 siblings, 1 reply; 13+ messages in thread
From: Markus Schneider-Pargmann (TI.com) @ 2025-11-26 20:31 UTC (permalink / raw)
To: u-boot
Cc: Simon Glass, Tom Rini, Marek Vasut, Mattijs Korpershoek,
Andrew Goodbody, Kory Maincent, Svyatoslav Ryhel,
Christian Marangi, Dinesh Maniyam, Heiko Schocher,
Markus Schneider-Pargmann (TI.com)
Currently once a driver matched the compatible string of a device, other
drivers are ignored. If the first matching driver returns -ENODEV, no
other possibly matching drivers are iterated with that compatible of the
device. Instead the next compatible in the list of compatibles is
selected, assuming only one driver matches one compatible at a time.
To be able to use the bind function to return -ENODEV and continue
matching other drivers with the same compatible, move the for loop a bit
to continue the for loop after -ENODEV was returned.
This is required for ti-musb-host and ti-musb-peripheral which both
match on the same device but differ based on the dr_mode DT property.
Depending on this property, the driver is either UCLASS_USB or
UCLASS_USB_GADGET_GENERIc. By checking the DT property in the bind
function and returning -ENODEV the other driver can probe instead.
Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp@baylibre.com>
---
drivers/core/lists.c | 62 +++++++++++++++++++++++++++-------------------------
1 file changed, 32 insertions(+), 30 deletions(-)
diff --git a/drivers/core/lists.c b/drivers/core/lists.c
index c7be504b6fc69ec2870a6766eed35cb9eba46a97..144e31286b3bb53a90b4f8bb0d3fba6e25a47f9e 100644
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -237,8 +237,9 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp,
log_debug(" - attempt to match compatible string '%s'\n",
compat);
- id = NULL;
for (entry = driver; entry != driver + n_ents; entry++) {
+ id = NULL;
+
if (drv) {
if (drv != entry)
continue;
@@ -247,39 +248,40 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp,
}
ret = driver_check_compatible(entry->of_match, &id,
compat);
- if (!ret)
- break;
+ if (ret)
+ continue;
+ if (pre_reloc_only) {
+ if (!ofnode_pre_reloc(node) &&
+ !(entry->flags & DM_FLAG_PRE_RELOC)) {
+ log_debug("Skipping device pre-relocation\n");
+ return 0;
+ }
+ }
+
+ if (entry->of_match)
+ log_debug(" - found match at driver '%s' for '%s'\n",
+ entry->name, id->compatible);
+ ret = device_bind_with_driver_data(parent, entry, name,
+ id ? id->data : 0, node,
+ &dev);
+ if (ret == -ENODEV) {
+ log_debug("Driver '%s' refuses to bind\n", entry->name);
+ continue;
+ }
+ if (ret) {
+ dm_warn("Error binding driver '%s': %d\n", entry->name,
+ ret);
+ return log_msg_ret("bind", ret);
+ }
+
+ found = true;
+ if (devp)
+ *devp = dev;
+ break;
}
if (entry == driver + n_ents)
continue;
- if (pre_reloc_only) {
- if (!ofnode_pre_reloc(node) &&
- !(entry->flags & DM_FLAG_PRE_RELOC)) {
- log_debug("Skipping device pre-relocation\n");
- return 0;
- }
- }
-
- if (entry->of_match)
- log_debug(" - found match at driver '%s' for '%s'\n",
- entry->name, id->compatible);
- ret = device_bind_with_driver_data(parent, entry, name,
- id ? id->data : 0, node,
- &dev);
- if (ret == -ENODEV) {
- log_debug("Driver '%s' refuses to bind\n", entry->name);
- continue;
- }
- if (ret) {
- dm_warn("Error binding driver '%s': %d\n", entry->name,
- ret);
- return log_msg_ret("bind", ret);
- } else {
- found = true;
- if (devp)
- *devp = dev;
- }
break;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH 1/4] dm: core: Support multiple drivers with same compatibles
2025-11-26 20:31 ` [PATCH 1/4] dm: core: Support multiple drivers with same compatibles Markus Schneider-Pargmann (TI.com)
@ 2026-01-07 13:16 ` Mattijs Korpershoek
0 siblings, 0 replies; 13+ messages in thread
From: Mattijs Korpershoek @ 2026-01-07 13:16 UTC (permalink / raw)
To: Markus Schneider-Pargmann (TI.com), u-boot
Cc: Simon Glass, Tom Rini, Marek Vasut, Mattijs Korpershoek,
Andrew Goodbody, Kory Maincent, Svyatoslav Ryhel,
Christian Marangi, Dinesh Maniyam, Heiko Schocher,
Markus Schneider-Pargmann (TI.com)
Hi Markus,
Thank you for the patch.
On Wed, Nov 26, 2025 at 21:31, "Markus Schneider-Pargmann (TI.com)" <msp@baylibre.com> wrote:
> Currently once a driver matched the compatible string of a device, other
> drivers are ignored. If the first matching driver returns -ENODEV, no
> other possibly matching drivers are iterated with that compatible of the
> device. Instead the next compatible in the list of compatibles is
> selected, assuming only one driver matches one compatible at a time.
>
> To be able to use the bind function to return -ENODEV and continue
> matching other drivers with the same compatible, move the for loop a bit
> to continue the for loop after -ENODEV was returned.
>
> This is required for ti-musb-host and ti-musb-peripheral which both
> match on the same device but differ based on the dr_mode DT property.
> Depending on this property, the driver is either UCLASS_USB or
> UCLASS_USB_GADGET_GENERIc. By checking the DT property in the bind
> function and returning -ENODEV the other driver can probe instead.
>
> Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> ---
> drivers/core/lists.c | 62 +++++++++++++++++++++++++++-------------------------
> 1 file changed, 32 insertions(+), 30 deletions(-)
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 2/4] test: dm: Add compatible multimatch test
2025-11-26 20:31 [PATCH 0/4] dm: core: Support same compatible in host/gadget musb drivers Markus Schneider-Pargmann (TI.com)
2025-11-26 20:31 ` [PATCH 1/4] dm: core: Support multiple drivers with same compatibles Markus Schneider-Pargmann (TI.com)
@ 2025-11-26 20:31 ` Markus Schneider-Pargmann (TI.com)
2026-01-07 13:35 ` Mattijs Korpershoek
2025-11-26 20:31 ` [PATCH 3/4] usb: musb-new: Relative ctrl_mod address parsing Markus Schneider-Pargmann (TI.com)
` (2 subsequent siblings)
4 siblings, 1 reply; 13+ messages in thread
From: Markus Schneider-Pargmann (TI.com) @ 2025-11-26 20:31 UTC (permalink / raw)
To: u-boot
Cc: Simon Glass, Tom Rini, Marek Vasut, Mattijs Korpershoek,
Andrew Goodbody, Kory Maincent, Svyatoslav Ryhel,
Christian Marangi, Dinesh Maniyam, Heiko Schocher,
Markus Schneider-Pargmann (TI.com)
Add a test for binding of multiple drivers with the same compatible. If
one of the drivers returns -ENODEV the other one needs to be bound.
Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp@baylibre.com>
---
arch/sandbox/dts/test.dts | 4 ++++
test/dm/core.c | 15 +++++++++++++++
test/dm/test-driver.c | 25 +++++++++++++++++++++++++
3 files changed, 44 insertions(+)
diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index a2c739a2044c728a96b5f4acbf439a42d7e12fb5..9cc854ffe80e994e34010e299029a7f1756697e0 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -457,6 +457,10 @@
mux-control-names = "mux0";
};
+ multimatch-test {
+ compatible = "sandbox,multimatch-test";
+ };
+
phy_provider0: gen_phy@0 {
compatible = "sandbox,phy";
#phy-cells = <1>;
diff --git a/test/dm/core.c b/test/dm/core.c
index 53693f4f7ed7c7265218e4154ebf81a044a3a431..78ee14af228ab20a6639bb076260296adaea2c92 100644
--- a/test/dm/core.c
+++ b/test/dm/core.c
@@ -1410,3 +1410,18 @@ static int dm_test_try_first_device(struct unit_test_state *uts)
return 0;
}
DM_TEST(dm_test_try_first_device, 0);
+
+/* Test that all drivers are iterated when bind returns -ENODEV */
+static int dm_test_multimatch(struct unit_test_state *uts)
+{
+ struct udevice *dev;
+
+ ut_assertok(uclass_find_device_by_name(UCLASS_TEST, "multimatch-test",
+ &dev));
+ ut_assertnonnull(dev);
+ ut_asserteq_str("test_multimatch_second", dev->driver->name);
+ ut_asserteq(2, dm_testdrv_op_count[DM_TEST_OP_BIND]);
+
+ return 0;
+}
+DM_TEST(dm_test_multimatch, UTF_SCAN_FDT);
diff --git a/test/dm/test-driver.c b/test/dm/test-driver.c
index 759de3a5f77f4b64ea577a293586a737e4623f60..bf953d7814df6a0e6efd6c2a3960a925a3fbe5a7 100644
--- a/test/dm/test-driver.c
+++ b/test/dm/test-driver.c
@@ -197,3 +197,28 @@ U_BOOT_DRIVER(test_act_dma_vital_clk_drv) = {
.unbind = test_manual_unbind,
.flags = DM_FLAG_VITAL | DM_FLAG_ACTIVE_DMA,
};
+
+static int test_multimatch_first_bind(struct udevice *dev)
+{
+ dm_testdrv_op_count[DM_TEST_OP_BIND]++;
+ return -ENODEV;
+}
+
+static const struct udevice_id test_multimatch_ids[] = {
+ { .compatible = "sandbox,multimatch-test" },
+ { }
+};
+
+U_BOOT_DRIVER(test_multimatch_first) = {
+ .name = "test_multimatch_first",
+ .id = UCLASS_TEST,
+ .of_match = test_multimatch_ids,
+ .bind = test_multimatch_first_bind,
+};
+
+U_BOOT_DRIVER(test_multimatch_second) = {
+ .name = "test_multimatch_second",
+ .id = UCLASS_TEST,
+ .of_match = test_multimatch_ids,
+ .bind = test_manual_bind,
+};
--
2.51.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH 2/4] test: dm: Add compatible multimatch test
2025-11-26 20:31 ` [PATCH 2/4] test: dm: Add compatible multimatch test Markus Schneider-Pargmann (TI.com)
@ 2026-01-07 13:35 ` Mattijs Korpershoek
0 siblings, 0 replies; 13+ messages in thread
From: Mattijs Korpershoek @ 2026-01-07 13:35 UTC (permalink / raw)
To: Markus Schneider-Pargmann (TI.com), u-boot
Cc: Simon Glass, Tom Rini, Marek Vasut, Mattijs Korpershoek,
Andrew Goodbody, Kory Maincent, Svyatoslav Ryhel,
Christian Marangi, Dinesh Maniyam, Heiko Schocher,
Markus Schneider-Pargmann (TI.com)
Hi Markus,
Thank you for the patch.
On Wed, Nov 26, 2025 at 21:31, "Markus Schneider-Pargmann (TI.com)" <msp@baylibre.com> wrote:
> Add a test for binding of multiple drivers with the same compatible. If
> one of the drivers returns -ENODEV the other one needs to be bound.
>
> Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> ---
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 3/4] usb: musb-new: Relative ctrl_mod address parsing
2025-11-26 20:31 [PATCH 0/4] dm: core: Support same compatible in host/gadget musb drivers Markus Schneider-Pargmann (TI.com)
2025-11-26 20:31 ` [PATCH 1/4] dm: core: Support multiple drivers with same compatibles Markus Schneider-Pargmann (TI.com)
2025-11-26 20:31 ` [PATCH 2/4] test: dm: Add compatible multimatch test Markus Schneider-Pargmann (TI.com)
@ 2025-11-26 20:31 ` Markus Schneider-Pargmann (TI.com)
2026-01-07 13:44 ` Mattijs Korpershoek
2025-11-26 20:31 ` [PATCH 4/4] usb: musb-new: Add compatibles for ti,musb-am33xx Markus Schneider-Pargmann (TI.com)
2026-01-07 14:01 ` [PATCH 0/4] dm: core: Support same compatible in host/gadget musb drivers Mattijs Korpershoek
4 siblings, 1 reply; 13+ messages in thread
From: Markus Schneider-Pargmann (TI.com) @ 2025-11-26 20:31 UTC (permalink / raw)
To: u-boot
Cc: Simon Glass, Tom Rini, Marek Vasut, Mattijs Korpershoek,
Andrew Goodbody, Kory Maincent, Svyatoslav Ryhel,
Christian Marangi, Dinesh Maniyam, Heiko Schocher,
Markus Schneider-Pargmann (TI.com)
For the upstream DT the ctrl_mod node is using a relative register
address which is not translated by the current code.
Make address parsing understand relative addresses.
Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp@baylibre.com>
---
drivers/usb/musb-new/ti-musb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/musb-new/ti-musb.c b/drivers/usb/musb-new/ti-musb.c
index bcd31adba522fc55190fc43fd2dbd2dec93a2731..d3c3d3057c1df2a5cc62df3c57d8b071bb0f12b8 100644
--- a/drivers/usb/musb-new/ti-musb.c
+++ b/drivers/usb/musb-new/ti-musb.c
@@ -93,7 +93,7 @@ static int ti_musb_of_to_plat(struct udevice *dev)
phys = fdtdec_lookup_phandle(fdt, node, "phys");
ctrl_mod = fdtdec_lookup_phandle(fdt, phys, "ti,ctrl_mod");
- plat->ctrl_mod_base = (void *)fdtdec_get_addr(fdt, ctrl_mod, "reg");
+ plat->ctrl_mod_base = (void *)ofnode_get_addr(offset_to_ofnode(ctrl_mod));
usb_index = ti_musb_get_usb_index(node);
switch (usb_index) {
case 1:
--
2.51.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH 3/4] usb: musb-new: Relative ctrl_mod address parsing
2025-11-26 20:31 ` [PATCH 3/4] usb: musb-new: Relative ctrl_mod address parsing Markus Schneider-Pargmann (TI.com)
@ 2026-01-07 13:44 ` Mattijs Korpershoek
0 siblings, 0 replies; 13+ messages in thread
From: Mattijs Korpershoek @ 2026-01-07 13:44 UTC (permalink / raw)
To: Markus Schneider-Pargmann (TI.com), u-boot
Cc: Simon Glass, Tom Rini, Marek Vasut, Mattijs Korpershoek,
Andrew Goodbody, Kory Maincent, Svyatoslav Ryhel,
Christian Marangi, Dinesh Maniyam, Heiko Schocher,
Markus Schneider-Pargmann (TI.com)
Hi Markus,
Thank you for the patch.
On Wed, Nov 26, 2025 at 21:31, "Markus Schneider-Pargmann (TI.com)" <msp@baylibre.com> wrote:
> For the upstream DT the ctrl_mod node is using a relative register
> address which is not translated by the current code.
>
> Make address parsing understand relative addresses.
>
> Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH 4/4] usb: musb-new: Add compatibles for ti,musb-am33xx
2025-11-26 20:31 [PATCH 0/4] dm: core: Support same compatible in host/gadget musb drivers Markus Schneider-Pargmann (TI.com)
` (2 preceding siblings ...)
2025-11-26 20:31 ` [PATCH 3/4] usb: musb-new: Relative ctrl_mod address parsing Markus Schneider-Pargmann (TI.com)
@ 2025-11-26 20:31 ` Markus Schneider-Pargmann (TI.com)
2026-01-07 13:48 ` Mattijs Korpershoek
2026-01-07 14:01 ` [PATCH 0/4] dm: core: Support same compatible in host/gadget musb drivers Mattijs Korpershoek
4 siblings, 1 reply; 13+ messages in thread
From: Markus Schneider-Pargmann (TI.com) @ 2025-11-26 20:31 UTC (permalink / raw)
To: u-boot
Cc: Simon Glass, Tom Rini, Marek Vasut, Mattijs Korpershoek,
Andrew Goodbody, Kory Maincent, Svyatoslav Ryhel,
Christian Marangi, Dinesh Maniyam, Heiko Schocher,
Markus Schneider-Pargmann (TI.com)
The upstream devicetree am33xx.dtsi does not have a "ti,am33xx-usb"
compatible, it uses "ti,sysc-omap4" for the same node. The
implementation of ti-musb uses a wrapper driver that binds to
ti,am33xx-usb and creates new devices ti-musb-host and
ti-musb-peripheral depending on the dr_mode property.
To avoid this wrapper driver with the upstream devicetree, add
compatibles for "ti,musb-am33xx" to both ti-musb-host and
ti-musb-peripheral. Add a bind function that checks for the correct
dr_mode value and rejects binding if it is not the correct driver.
Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp@baylibre.com>
---
drivers/usb/musb-new/ti-musb.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/drivers/usb/musb-new/ti-musb.c b/drivers/usb/musb-new/ti-musb.c
index d3c3d3057c1df2a5cc62df3c57d8b071bb0f12b8..3ed6428d09883cf5af28b212c0d614b3d8ef9227 100644
--- a/drivers/usb/musb-new/ti-musb.c
+++ b/drivers/usb/musb-new/ti-musb.c
@@ -183,6 +183,16 @@ static int ti_musb_host_remove(struct udevice *dev)
}
#if CONFIG_IS_ENABLED(OF_CONTROL)
+static int ti_musb_host_bind(struct udevice *dev)
+{
+ enum usb_dr_mode dr_mode = usb_get_dr_mode(dev_ofnode(dev));
+
+ if (dr_mode != USB_DR_MODE_HOST && dr_mode != USB_DR_MODE_OTG)
+ return -ENODEV;
+
+ return 0;
+}
+
static int ti_musb_host_of_to_plat(struct udevice *dev)
{
struct ti_musb_plat *plat = dev_get_plat(dev);
@@ -200,12 +210,19 @@ static int ti_musb_host_of_to_plat(struct udevice *dev)
return 0;
}
+
+static const struct udevice_id ti_musb_host_ids[] = {
+ { .compatible = "ti,musb-am33xx" },
+ { }
+};
#endif
U_BOOT_DRIVER(ti_musb_host) = {
.name = "ti-musb-host",
.id = UCLASS_USB,
#if CONFIG_IS_ENABLED(OF_CONTROL)
+ .of_match = ti_musb_host_ids,
+ .bind = ti_musb_host_bind,
.of_to_plat = ti_musb_host_of_to_plat,
#endif
.probe = ti_musb_host_probe,
@@ -221,6 +238,16 @@ struct ti_musb_peripheral {
};
#if CONFIG_IS_ENABLED(OF_CONTROL)
+static int ti_musb_peripheral_bind(struct udevice *dev)
+{
+ enum usb_dr_mode dr_mode = usb_get_dr_mode(dev_ofnode(dev));
+
+ if (dr_mode != USB_DR_MODE_PERIPHERAL)
+ return -ENODEV;
+
+ return 0;
+}
+
static int ti_musb_peripheral_of_to_plat(struct udevice *dev)
{
struct ti_musb_plat *plat = dev_get_plat(dev);
@@ -237,6 +264,11 @@ static int ti_musb_peripheral_of_to_plat(struct udevice *dev)
return 0;
}
+
+static const struct udevice_id ti_musb_peripheral_ids[] = {
+ { .compatible = "ti,musb-am33xx" },
+ { }
+};
#endif
static int ti_musb_peripheral_probe(struct udevice *dev)
@@ -283,6 +315,8 @@ U_BOOT_DRIVER(ti_musb_peripheral) = {
.name = "ti-musb-peripheral",
.id = UCLASS_USB_GADGET_GENERIC,
#if CONFIG_IS_ENABLED(OF_CONTROL)
+ .of_match = ti_musb_peripheral_ids,
+ .bind = ti_musb_peripheral_bind,
.of_to_plat = ti_musb_peripheral_of_to_plat,
#endif
.ops = &ti_musb_gadget_ops,
--
2.51.0
^ permalink raw reply related [flat|nested] 13+ messages in thread* Re: [PATCH 4/4] usb: musb-new: Add compatibles for ti,musb-am33xx
2025-11-26 20:31 ` [PATCH 4/4] usb: musb-new: Add compatibles for ti,musb-am33xx Markus Schneider-Pargmann (TI.com)
@ 2026-01-07 13:48 ` Mattijs Korpershoek
0 siblings, 0 replies; 13+ messages in thread
From: Mattijs Korpershoek @ 2026-01-07 13:48 UTC (permalink / raw)
To: Markus Schneider-Pargmann (TI.com), u-boot
Cc: Simon Glass, Tom Rini, Marek Vasut, Mattijs Korpershoek,
Andrew Goodbody, Kory Maincent, Svyatoslav Ryhel,
Christian Marangi, Dinesh Maniyam, Heiko Schocher,
Markus Schneider-Pargmann (TI.com)
Hi Markus,
Thank you for the patch.
On Wed, Nov 26, 2025 at 21:31, "Markus Schneider-Pargmann (TI.com)" <msp@baylibre.com> wrote:
> The upstream devicetree am33xx.dtsi does not have a "ti,am33xx-usb"
> compatible, it uses "ti,sysc-omap4" for the same node. The
> implementation of ti-musb uses a wrapper driver that binds to
> ti,am33xx-usb and creates new devices ti-musb-host and
> ti-musb-peripheral depending on the dr_mode property.
>
> To avoid this wrapper driver with the upstream devicetree, add
> compatibles for "ti,musb-am33xx" to both ti-musb-host and
> ti-musb-peripheral. Add a bind function that checks for the correct
> dr_mode value and rejects binding if it is not the correct driver.
>
> Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> ---
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 0/4] dm: core: Support same compatible in host/gadget musb drivers
2025-11-26 20:31 [PATCH 0/4] dm: core: Support same compatible in host/gadget musb drivers Markus Schneider-Pargmann (TI.com)
` (3 preceding siblings ...)
2025-11-26 20:31 ` [PATCH 4/4] usb: musb-new: Add compatibles for ti,musb-am33xx Markus Schneider-Pargmann (TI.com)
@ 2026-01-07 14:01 ` Mattijs Korpershoek
2026-01-07 15:15 ` Mattijs Korpershoek
4 siblings, 1 reply; 13+ messages in thread
From: Mattijs Korpershoek @ 2026-01-07 14:01 UTC (permalink / raw)
To: u-boot, Markus Schneider-Pargmann (TI.com)
Cc: Simon Glass, Tom Rini, Marek Vasut, Andrew Goodbody,
Kory Maincent, Svyatoslav Ryhel, Christian Marangi,
Dinesh Maniyam, Heiko Schocher
Hi,
On Wed, 26 Nov 2025 21:31:06 +0100, Markus Schneider-Pargmann (TI.com) wrote:
> musb currently uses a wrapper driver that binds on the parent device of
> the actual musb devices to manage the differentiation between gadget and
> host modes. However in the upstream devicetree this parent devicetree
> node can not be used to match the wrapper driver.
>
> To be able to probe the musb devices in host/gadget mode directly, this
> series introduces support for returning -ENODEV in bind functions
> resulting in iterating the remaining drivers potentially binding to
> other drivers that match the compatible.
>
> [...]
Thanks, Applied to https://source.denx.de/u-boot/custodians/u-boot-dfu (u-boot-dfu)
[1/4] dm: core: Support multiple drivers with same compatibles
https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/292d809159b86ff3c07e4fea93927cd0d00d8b27
[2/4] test: dm: Add compatible multimatch test
https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/b1f483a350a7df6130eb4880ecce4cfabfe5b9a9
[3/4] usb: musb-new: Relative ctrl_mod address parsing
https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/dce67e20709bd89f4ec17135e242447b5e6570d4
[4/4] usb: musb-new: Add compatibles for ti,musb-am33xx
https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/b51b489ae7c47d8372a6b73a4c0c5fa71291c4fd
--
Mattijs
^ permalink raw reply [flat|nested] 13+ messages in thread* Re: [PATCH 0/4] dm: core: Support same compatible in host/gadget musb drivers
2026-01-07 14:01 ` [PATCH 0/4] dm: core: Support same compatible in host/gadget musb drivers Mattijs Korpershoek
@ 2026-01-07 15:15 ` Mattijs Korpershoek
2026-01-08 14:13 ` Mattijs Korpershoek
0 siblings, 1 reply; 13+ messages in thread
From: Mattijs Korpershoek @ 2026-01-07 15:15 UTC (permalink / raw)
To: Markus Schneider-Pargmann (TI.com)
Cc: u-boot, Simon Glass, Tom Rini, Marek Vasut, Andrew Goodbody,
Kory Maincent, Svyatoslav Ryhel, Christian Marangi,
Dinesh Maniyam, Heiko Schocher
Hi Markus,
On Wed, Jan 07, 2026 at 15:01, Mattijs Korpershoek <mkorpershoek@kernel.org> wrote:
> Hi,
>
> On Wed, 26 Nov 2025 21:31:06 +0100, Markus Schneider-Pargmann (TI.com) wrote:
>> musb currently uses a wrapper driver that binds on the parent device of
>> the actual musb devices to manage the differentiation between gadget and
>> host modes. However in the upstream devicetree this parent devicetree
>> node can not be used to match the wrapper driver.
>>
>> To be able to probe the musb devices in host/gadget mode directly, this
>> series introduces support for returning -ENODEV in bind functions
>> resulting in iterating the remaining drivers potentially binding to
>> other drivers that match the compatible.
>>
>> [...]
>
> Thanks, Applied to https://source.denx.de/u-boot/custodians/u-boot-dfu (u-boot-dfu)
It seems this series broke the CI when testing sandbox:
https://source.denx.de/u-boot/custodians/u-boot-dfu/-/jobs/1349214
Can you have a look please?
This can be reproduced locally using:
$ ./test/py/test.py --bd sandbox --build -k test_bind
[...]
FAILED test/py/tests/test_bind.py::test_bind_unbind_with_node - AssertionError: assert 'Unable to bind. err:0' == ''
FAILED test/py/tests/test_bind.py::test_bind_unbind_with_uclass - AssertionError: assert 2 == 1
>
> [1/4] dm: core: Support multiple drivers with same compatibles
> https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/292d809159b86ff3c07e4fea93927cd0d00d8b27
> [2/4] test: dm: Add compatible multimatch test
> https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/b1f483a350a7df6130eb4880ecce4cfabfe5b9a9
> [3/4] usb: musb-new: Relative ctrl_mod address parsing
> https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/dce67e20709bd89f4ec17135e242447b5e6570d4
> [4/4] usb: musb-new: Add compatibles for ti,musb-am33xx
> https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/b51b489ae7c47d8372a6b73a4c0c5fa71291c4fd
>
> --
> Mattijs
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 0/4] dm: core: Support same compatible in host/gadget musb drivers
2026-01-07 15:15 ` Mattijs Korpershoek
@ 2026-01-08 14:13 ` Mattijs Korpershoek
2026-01-08 19:25 ` Markus Schneider-Pargmann
0 siblings, 1 reply; 13+ messages in thread
From: Mattijs Korpershoek @ 2026-01-08 14:13 UTC (permalink / raw)
To: Mattijs Korpershoek, Markus Schneider-Pargmann (TI.com)
Cc: u-boot, Simon Glass, Tom Rini, Marek Vasut, Andrew Goodbody,
Kory Maincent, Svyatoslav Ryhel, Christian Marangi,
Dinesh Maniyam, Heiko Schocher
On Wed, Jan 07, 2026 at 16:15, Mattijs Korpershoek <mkorpershoek@kernel.org> wrote:
> Hi Markus,
>
> On Wed, Jan 07, 2026 at 15:01, Mattijs Korpershoek <mkorpershoek@kernel.org> wrote:
>
>> Hi,
>>
>> On Wed, 26 Nov 2025 21:31:06 +0100, Markus Schneider-Pargmann (TI.com) wrote:
>>> musb currently uses a wrapper driver that binds on the parent device of
>>> the actual musb devices to manage the differentiation between gadget and
>>> host modes. However in the upstream devicetree this parent devicetree
>>> node can not be used to match the wrapper driver.
>>>
>>> To be able to probe the musb devices in host/gadget mode directly, this
>>> series introduces support for returning -ENODEV in bind functions
>>> resulting in iterating the remaining drivers potentially binding to
>>> other drivers that match the compatible.
>>>
>>> [...]
>>
>> Thanks, Applied to https://source.denx.de/u-boot/custodians/u-boot-dfu (u-boot-dfu)
>
> It seems this series broke the CI when testing sandbox:
> https://source.denx.de/u-boot/custodians/u-boot-dfu/-/jobs/1349214
>
> Can you have a look please?
>
> This can be reproduced locally using:
>
> $ ./test/py/test.py --bd sandbox --build -k test_bind
> [...]
> FAILED test/py/tests/test_bind.py::test_bind_unbind_with_node - AssertionError: assert 'Unable to bind. err:0' == ''
> FAILED test/py/tests/test_bind.py::test_bind_unbind_with_uclass - AssertionError: assert 2 == 1
We have discussed this on IRC (privately) and Markus has posted a v2
that should address the CI failures here:
https://lore.kernel.org/all/20260108-topic-musb-probing-v2026-01-v2-0-2a47c6e0e73a@baylibre.com/
>
>>
>> [1/4] dm: core: Support multiple drivers with same compatibles
>> https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/292d809159b86ff3c07e4fea93927cd0d00d8b27
>> [2/4] test: dm: Add compatible multimatch test
>> https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/b1f483a350a7df6130eb4880ecce4cfabfe5b9a9
>> [3/4] usb: musb-new: Relative ctrl_mod address parsing
>> https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/dce67e20709bd89f4ec17135e242447b5e6570d4
>> [4/4] usb: musb-new: Add compatibles for ti,musb-am33xx
>> https://source.denx.de/u-boot/custodians/u-boot-dfu/-/commit/b51b489ae7c47d8372a6b73a4c0c5fa71291c4fd
>>
>> --
>> Mattijs
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH 0/4] dm: core: Support same compatible in host/gadget musb drivers
2026-01-08 14:13 ` Mattijs Korpershoek
@ 2026-01-08 19:25 ` Markus Schneider-Pargmann
0 siblings, 0 replies; 13+ messages in thread
From: Markus Schneider-Pargmann @ 2026-01-08 19:25 UTC (permalink / raw)
To: Mattijs Korpershoek, Markus Schneider-Pargmann (TI.com)
Cc: u-boot, Simon Glass, Tom Rini, Marek Vasut, Andrew Goodbody,
Kory Maincent, Svyatoslav Ryhel, Christian Marangi,
Dinesh Maniyam, Heiko Schocher
[-- Attachment #1: Type: text/plain, Size: 2030 bytes --]
Hi,
On Thu Jan 8, 2026 at 3:13 PM CET, Mattijs Korpershoek wrote:
> On Wed, Jan 07, 2026 at 16:15, Mattijs Korpershoek <mkorpershoek@kernel.org> wrote:
>
>> Hi Markus,
>>
>> On Wed, Jan 07, 2026 at 15:01, Mattijs Korpershoek <mkorpershoek@kernel.org> wrote:
>>
>>> Hi,
>>>
>>> On Wed, 26 Nov 2025 21:31:06 +0100, Markus Schneider-Pargmann (TI.com) wrote:
>>>> musb currently uses a wrapper driver that binds on the parent device of
>>>> the actual musb devices to manage the differentiation between gadget and
>>>> host modes. However in the upstream devicetree this parent devicetree
>>>> node can not be used to match the wrapper driver.
>>>>
>>>> To be able to probe the musb devices in host/gadget mode directly, this
>>>> series introduces support for returning -ENODEV in bind functions
>>>> resulting in iterating the remaining drivers potentially binding to
>>>> other drivers that match the compatible.
>>>>
>>>> [...]
>>>
>>> Thanks, Applied to https://source.denx.de/u-boot/custodians/u-boot-dfu (u-boot-dfu)
>>
>> It seems this series broke the CI when testing sandbox:
>> https://source.denx.de/u-boot/custodians/u-boot-dfu/-/jobs/1349214
>>
>> Can you have a look please?
>>
>> This can be reproduced locally using:
>>
>> $ ./test/py/test.py --bd sandbox --build -k test_bind
>> [...]
>> FAILED test/py/tests/test_bind.py::test_bind_unbind_with_node - AssertionError: assert 'Unable to bind. err:0' == ''
>> FAILED test/py/tests/test_bind.py::test_bind_unbind_with_uclass - AssertionError: assert 2 == 1
>
> We have discussed this on IRC (privately) and Markus has posted a v2
> that should address the CI failures here:
>
> https://lore.kernel.org/all/20260108-topic-musb-probing-v2026-01-v2-0-2a47c6e0e73a@baylibre.com/
Yes, thank you Mattijs, sorry for not posting here.
I missed the possible path of the drv argument being set and the driver
not having an of_match being set. I fixed that in v2 and also added a
few cleanups for the function.
Best
Markus
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 289 bytes --]
^ permalink raw reply [flat|nested] 13+ messages in thread