* [PATCH v3 0/6] dm: core: Support same compatible in host/gadget musb drivers
@ 2026-01-14 8:33 Markus Schneider-Pargmann (TI.com)
2026-01-14 8:33 ` [PATCH v3 1/6] dm: core: lists_bind_fdt: Remove unused variable Markus Schneider-Pargmann (TI.com)
` (5 more replies)
0 siblings, 6 replies; 17+ messages in thread
From: Markus Schneider-Pargmann (TI.com) @ 2026-01-14 8:33 UTC (permalink / raw)
To: u-boot, Mattijs Korpershoek
Cc: Simon Glass, Tom Rini, Marek Vasut, Andrew Goodbody,
Kory Maincent, Svyatoslav Ryhel, Christian Marangi,
Dinesh Maniyam, Heiko Schocher,
Markus Schneider-Pargmann (TI.com), Simon Glass
Hi,
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.
It also changes the address parsing of musb-ctrl to be able to parse
relative addresses.
Best
Markus
Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp@baylibre.com>
---
Changes in v3:
- Add short paragraph about performance implications to the commit
message
- Add a new line in the test
- Link to v2: https://lore.kernel.org/r/20260108-topic-musb-probing-v2026-01-v2-0-2a47c6e0e73a@baylibre.com
Changes in v2:
- Added a few patches to remove nearly unused variables
- Changed the inner loop in lists_bind_fdt to support set drv and not
set entry->of_match.
- Cleanup the loop a bit more
- Link to v1: https://lore.kernel.org/r/20251126-topic-musb-probing-v2026-01-v1-0-ff8d8c487130@baylibre.com
---
Markus Schneider-Pargmann (TI.com) (6):
dm: core: lists_bind_fdt: Remove unused variable
dm: core: lists_bind_fdt: Replace found variable
dm: core: Support multiple drivers with same compatibles
test: dm: Add compatible multimatch test
usb: musb-new: Relative ctrl_mod address parsing
usb: musb-new: Add compatibles for ti,musb-am33xx
arch/sandbox/dts/test.dts | 4 +++
drivers/core/lists.c | 73 +++++++++++++++++++++---------------------
drivers/usb/musb-new/ti-musb.c | 36 ++++++++++++++++++++-
test/dm/core.c | 15 +++++++++
test/dm/test-driver.c | 26 +++++++++++++++
5 files changed, 116 insertions(+), 38 deletions(-)
---
base-commit: 127a42c7257a6ffbbd1575ed1cbaa8f5408a44b3
change-id: 20251125-topic-musb-probing-v2026-01-1343fff8176b
Best regards,
--
Markus Schneider-Pargmann (TI.com) <msp@baylibre.com>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v3 1/6] dm: core: lists_bind_fdt: Remove unused variable
2026-01-14 8:33 [PATCH v3 0/6] dm: core: Support same compatible in host/gadget musb drivers Markus Schneider-Pargmann (TI.com)
@ 2026-01-14 8:33 ` Markus Schneider-Pargmann (TI.com)
2026-01-16 8:22 ` Mattijs Korpershoek
2026-01-14 8:33 ` [PATCH v3 2/6] dm: core: lists_bind_fdt: Replace found variable Markus Schneider-Pargmann (TI.com)
` (4 subsequent siblings)
5 siblings, 1 reply; 17+ messages in thread
From: Markus Schneider-Pargmann (TI.com) @ 2026-01-14 8:33 UTC (permalink / raw)
To: u-boot, Mattijs Korpershoek
Cc: Simon Glass, Tom Rini, Marek Vasut, Andrew Goodbody,
Kory Maincent, Svyatoslav Ryhel, Christian Marangi,
Dinesh Maniyam, Heiko Schocher,
Markus Schneider-Pargmann (TI.com), Simon Glass
'result' is unused in this function, remove it.
Reviewed-by: Simon Glass <simon.glass@canonical.com>
Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp@baylibre.com>
---
drivers/core/lists.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/core/lists.c b/drivers/core/lists.c
index c7be504b6fc69ec2870a6766eed35cb9eba46a97..52ba6c7bfa007b660b854de62c97ad3c1761f1a5 100644
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -207,7 +207,6 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp,
bool found = false;
const char *name, *compat_list, *compat;
int compat_length, i;
- int result = 0;
int ret = 0;
if (devp)
@@ -283,9 +282,9 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp,
break;
}
- if (!found && !result && ret != -ENODEV)
+ if (!found && ret != -ENODEV)
log_debug("No match for node '%s'\n", name);
- return result;
+ return 0;
}
#endif
--
2.51.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v3 2/6] dm: core: lists_bind_fdt: Replace found variable
2026-01-14 8:33 [PATCH v3 0/6] dm: core: Support same compatible in host/gadget musb drivers Markus Schneider-Pargmann (TI.com)
2026-01-14 8:33 ` [PATCH v3 1/6] dm: core: lists_bind_fdt: Remove unused variable Markus Schneider-Pargmann (TI.com)
@ 2026-01-14 8:33 ` Markus Schneider-Pargmann (TI.com)
2026-01-16 8:23 ` Mattijs Korpershoek
2026-01-14 8:33 ` [PATCH v3 3/6] dm: core: Support multiple drivers with same compatibles Markus Schneider-Pargmann (TI.com)
` (3 subsequent siblings)
5 siblings, 1 reply; 17+ messages in thread
From: Markus Schneider-Pargmann (TI.com) @ 2026-01-14 8:33 UTC (permalink / raw)
To: u-boot, Mattijs Korpershoek
Cc: Simon Glass, Tom Rini, Marek Vasut, Andrew Goodbody,
Kory Maincent, Svyatoslav Ryhel, Christian Marangi,
Dinesh Maniyam, Heiko Schocher,
Markus Schneider-Pargmann (TI.com), Simon Glass
'found' is only used at the end of the function to print a debug
message. No need to maintain a variable if we can just return 0
immediately when a driver was bound successfully.
Reviewed-by: Simon Glass <simon.glass@canonical.com>
Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp@baylibre.com>
---
drivers/core/lists.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/core/lists.c b/drivers/core/lists.c
index 52ba6c7bfa007b660b854de62c97ad3c1761f1a5..9d1ca38212ee7f53b8894f964f096611c8ec20a5 100644
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -204,7 +204,6 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp,
const struct udevice_id *id;
struct driver *entry;
struct udevice *dev;
- bool found = false;
const char *name, *compat_list, *compat;
int compat_length, i;
int ret = 0;
@@ -275,14 +274,14 @@ int lists_bind_fdt(struct udevice *parent, ofnode node, struct udevice **devp,
ret);
return log_msg_ret("bind", ret);
} else {
- found = true;
if (devp)
*devp = dev;
+ return 0;
}
break;
}
- if (!found && ret != -ENODEV)
+ if (ret != -ENODEV)
log_debug("No match for node '%s'\n", name);
return 0;
--
2.51.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v3 3/6] dm: core: Support multiple drivers with same compatibles
2026-01-14 8:33 [PATCH v3 0/6] dm: core: Support same compatible in host/gadget musb drivers Markus Schneider-Pargmann (TI.com)
2026-01-14 8:33 ` [PATCH v3 1/6] dm: core: lists_bind_fdt: Remove unused variable Markus Schneider-Pargmann (TI.com)
2026-01-14 8:33 ` [PATCH v3 2/6] dm: core: lists_bind_fdt: Replace found variable Markus Schneider-Pargmann (TI.com)
@ 2026-01-14 8:33 ` Markus Schneider-Pargmann (TI.com)
2026-01-16 10:50 ` Mattijs Korpershoek
2026-01-14 8:33 ` [PATCH v3 4/6] test: dm: Add compatible multimatch test Markus Schneider-Pargmann (TI.com)
` (2 subsequent siblings)
5 siblings, 1 reply; 17+ messages in thread
From: Markus Schneider-Pargmann (TI.com) @ 2026-01-14 8:33 UTC (permalink / raw)
To: u-boot, Mattijs Korpershoek
Cc: Simon Glass, Tom Rini, Marek Vasut, Andrew Goodbody,
Kory Maincent, Svyatoslav Ryhel, Christian Marangi,
Dinesh Maniyam, Heiko Schocher,
Markus Schneider-Pargmann (TI.com), Simon Glass
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. The loop had to be
adjusted a bit to still support the 'drv' argument properly. Some
simplifications where done as well.
The modification will only add additional loop iterations if -ENODEV is
returned. Otherwise the exit and continue conditions for the loop stay
the same and do not cause any additional iterations and should not
impact performance.
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.
Reviewed-by: Simon Glass <simon.glass@canonical.com>
Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp@baylibre.com>
---
drivers/core/lists.c | 65 ++++++++++++++++++++++++++--------------------------
1 file changed, 33 insertions(+), 32 deletions(-)
diff --git a/drivers/core/lists.c b/drivers/core/lists.c
index 9d1ca38212ee7f53b8894f964f096611c8ec20a5..3d9f9bc93954efdd624dddb1833f3a855c3c28de 100644
--- a/drivers/core/lists.c
+++ b/drivers/core/lists.c
@@ -235,50 +235,51 @@ 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++) {
+ /* Search for drivers with matching drv or existing of_match */
if (drv) {
if (drv != entry)
continue;
- if (!entry->of_match)
- break;
+ } else if (!entry->of_match) {
+ continue;
}
- ret = driver_check_compatible(entry->of_match, &id,
- compat);
- if (!ret)
- 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;
+ id = NULL;
+ if (entry->of_match) {
+ ret = driver_check_compatible(entry->of_match, &id,
+ compat);
+ if (ret)
+ continue;
+ log_debug(" - found match at driver '%s' for '%s'\n",
+ entry->name, id->compatible);
+ }
+
+ if (pre_reloc_only) {
+ if (!ofnode_pre_reloc(node) &&
+ !(entry->flags & DM_FLAG_PRE_RELOC)) {
+ log_debug(" - Skipping device pre-relocation\n");
+ return 0;
+ }
+ }
+
+ ret = device_bind_with_driver_data(parent, entry, name,
+ id ? id->data : 0, node,
+ &dev);
+ if (!drv && 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);
}
- }
- 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 {
if (devp)
*devp = dev;
+
return 0;
}
- break;
}
if (ret != -ENODEV)
--
2.51.0
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH v3 4/6] test: dm: Add compatible multimatch test
2026-01-14 8:33 [PATCH v3 0/6] dm: core: Support same compatible in host/gadget musb drivers Markus Schneider-Pargmann (TI.com)
` (2 preceding siblings ...)
2026-01-14 8:33 ` [PATCH v3 3/6] dm: core: Support multiple drivers with same compatibles Markus Schneider-Pargmann (TI.com)
@ 2026-01-14 8:33 ` Markus Schneider-Pargmann (TI.com)
2026-01-16 8:35 ` Mattijs Korpershoek
2026-01-14 8:33 ` [PATCH v3 5/6] usb: musb-new: Relative ctrl_mod address parsing Markus Schneider-Pargmann (TI.com)
2026-01-14 8:33 ` [PATCH v3 6/6] usb: musb-new: Add compatibles for ti,musb-am33xx Markus Schneider-Pargmann (TI.com)
5 siblings, 1 reply; 17+ messages in thread
From: Markus Schneider-Pargmann (TI.com) @ 2026-01-14 8:33 UTC (permalink / raw)
To: u-boot, Mattijs Korpershoek
Cc: Simon Glass, Tom Rini, Marek Vasut, Andrew Goodbody,
Kory Maincent, Svyatoslav Ryhel, Christian Marangi,
Dinesh Maniyam, Heiko Schocher,
Markus Schneider-Pargmann (TI.com), Simon Glass
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.
Reviewed-by: Simon Glass <simon.glass@canonical.com>
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 | 26 ++++++++++++++++++++++++++
3 files changed, 45 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..d628a6d766fc24f221ffcec3a5dbc6cc060e07bd 100644
--- a/test/dm/test-driver.c
+++ b/test/dm/test-driver.c
@@ -197,3 +197,29 @@ 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] 17+ messages in thread
* [PATCH v3 5/6] usb: musb-new: Relative ctrl_mod address parsing
2026-01-14 8:33 [PATCH v3 0/6] dm: core: Support same compatible in host/gadget musb drivers Markus Schneider-Pargmann (TI.com)
` (3 preceding siblings ...)
2026-01-14 8:33 ` [PATCH v3 4/6] test: dm: Add compatible multimatch test Markus Schneider-Pargmann (TI.com)
@ 2026-01-14 8:33 ` Markus Schneider-Pargmann (TI.com)
2026-01-16 8:41 ` Mattijs Korpershoek
2026-01-14 8:33 ` [PATCH v3 6/6] usb: musb-new: Add compatibles for ti,musb-am33xx Markus Schneider-Pargmann (TI.com)
5 siblings, 1 reply; 17+ messages in thread
From: Markus Schneider-Pargmann (TI.com) @ 2026-01-14 8:33 UTC (permalink / raw)
To: u-boot, Mattijs Korpershoek
Cc: Simon Glass, Tom Rini, Marek Vasut, 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] 17+ messages in thread
* [PATCH v3 6/6] usb: musb-new: Add compatibles for ti,musb-am33xx
2026-01-14 8:33 [PATCH v3 0/6] dm: core: Support same compatible in host/gadget musb drivers Markus Schneider-Pargmann (TI.com)
` (4 preceding siblings ...)
2026-01-14 8:33 ` [PATCH v3 5/6] usb: musb-new: Relative ctrl_mod address parsing Markus Schneider-Pargmann (TI.com)
@ 2026-01-14 8:33 ` Markus Schneider-Pargmann (TI.com)
2026-01-16 8:44 ` Mattijs Korpershoek
5 siblings, 1 reply; 17+ messages in thread
From: Markus Schneider-Pargmann (TI.com) @ 2026-01-14 8:33 UTC (permalink / raw)
To: u-boot, Mattijs Korpershoek
Cc: Simon Glass, Tom Rini, Marek Vasut, 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] 17+ messages in thread
* Re: [PATCH v3 1/6] dm: core: lists_bind_fdt: Remove unused variable
2026-01-14 8:33 ` [PATCH v3 1/6] dm: core: lists_bind_fdt: Remove unused variable Markus Schneider-Pargmann (TI.com)
@ 2026-01-16 8:22 ` Mattijs Korpershoek
0 siblings, 0 replies; 17+ messages in thread
From: Mattijs Korpershoek @ 2026-01-16 8:22 UTC (permalink / raw)
To: Markus Schneider-Pargmann (TI.com), u-boot, Mattijs Korpershoek
Cc: Simon Glass, Tom Rini, Marek Vasut, Andrew Goodbody,
Kory Maincent, Svyatoslav Ryhel, Christian Marangi,
Dinesh Maniyam, Heiko Schocher,
Markus Schneider-Pargmann (TI.com), Simon Glass
Hi Markus,
Thank you for the patch.
On Wed, Jan 14, 2026 at 09:33, "Markus Schneider-Pargmann (TI.com)" <msp@baylibre.com> wrote:
> 'result' is unused in this function, remove it.
>
> Reviewed-by: Simon Glass <simon.glass@canonical.com>
> Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> ---
> drivers/core/lists.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 2/6] dm: core: lists_bind_fdt: Replace found variable
2026-01-14 8:33 ` [PATCH v3 2/6] dm: core: lists_bind_fdt: Replace found variable Markus Schneider-Pargmann (TI.com)
@ 2026-01-16 8:23 ` Mattijs Korpershoek
0 siblings, 0 replies; 17+ messages in thread
From: Mattijs Korpershoek @ 2026-01-16 8:23 UTC (permalink / raw)
To: Markus Schneider-Pargmann (TI.com), u-boot, Mattijs Korpershoek
Cc: Simon Glass, Tom Rini, Marek Vasut, Andrew Goodbody,
Kory Maincent, Svyatoslav Ryhel, Christian Marangi,
Dinesh Maniyam, Heiko Schocher,
Markus Schneider-Pargmann (TI.com), Simon Glass
Hi Markus,
Thank you for the patch.
On Wed, Jan 14, 2026 at 09:33, "Markus Schneider-Pargmann (TI.com)" <msp@baylibre.com> wrote:
> 'found' is only used at the end of the function to print a debug
> message. No need to maintain a variable if we can just return 0
> immediately when a driver was bound successfully.
>
> Reviewed-by: Simon Glass <simon.glass@canonical.com>
> Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> ---
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 4/6] test: dm: Add compatible multimatch test
2026-01-14 8:33 ` [PATCH v3 4/6] test: dm: Add compatible multimatch test Markus Schneider-Pargmann (TI.com)
@ 2026-01-16 8:35 ` Mattijs Korpershoek
0 siblings, 0 replies; 17+ messages in thread
From: Mattijs Korpershoek @ 2026-01-16 8:35 UTC (permalink / raw)
To: Markus Schneider-Pargmann (TI.com), u-boot, Mattijs Korpershoek
Cc: Simon Glass, Tom Rini, Marek Vasut, Andrew Goodbody,
Kory Maincent, Svyatoslav Ryhel, Christian Marangi,
Dinesh Maniyam, Heiko Schocher,
Markus Schneider-Pargmann (TI.com), Simon Glass
Hi Markus,
Thank you for the patch.
On Wed, Jan 14, 2026 at 09:33, "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.
>
> Reviewed-by: Simon Glass <simon.glass@canonical.com>
> Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> ---
> arch/sandbox/dts/test.dts | 4 ++++
> test/dm/core.c | 15 +++++++++++++++
> test/dm/test-driver.c | 26 ++++++++++++++++++++++++++
> 3 files changed, 45 insertions(+)
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 5/6] usb: musb-new: Relative ctrl_mod address parsing
2026-01-14 8:33 ` [PATCH v3 5/6] usb: musb-new: Relative ctrl_mod address parsing Markus Schneider-Pargmann (TI.com)
@ 2026-01-16 8:41 ` Mattijs Korpershoek
2026-01-16 10:14 ` Markus Schneider-Pargmann
0 siblings, 1 reply; 17+ messages in thread
From: Mattijs Korpershoek @ 2026-01-16 8:41 UTC (permalink / raw)
To: Markus Schneider-Pargmann (TI.com), u-boot, Mattijs Korpershoek
Cc: Simon Glass, Tom Rini, Marek Vasut, 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, Jan 14, 2026 at 09:33, "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>
I already reviewed this in v1 and the patch did not change in v3:
https://lore.kernel.org/all/87v7hdzge3.fsf@kernel.org/#t
Can you please explain why you have dropped my Reviewed-by?
Anyways, putting it back so that b4 picks it up.
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> ---
> drivers/usb/musb-new/ti-musb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 6/6] usb: musb-new: Add compatibles for ti,musb-am33xx
2026-01-14 8:33 ` [PATCH v3 6/6] usb: musb-new: Add compatibles for ti,musb-am33xx Markus Schneider-Pargmann (TI.com)
@ 2026-01-16 8:44 ` Mattijs Korpershoek
0 siblings, 0 replies; 17+ messages in thread
From: Mattijs Korpershoek @ 2026-01-16 8:44 UTC (permalink / raw)
To: Markus Schneider-Pargmann (TI.com), u-boot, Mattijs Korpershoek
Cc: Simon Glass, Tom Rini, Marek Vasut, 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, Jan 14, 2026 at 09:33, "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>
I already reviewed v1 and v3 did not change for this patch:
https://lore.kernel.org/all/87sechzg7d.fsf@kernel.org/
Any reason for dropping my Reviewed-by: tag?
Adding it back to make sure it gets picked up by b4:
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> ---
> drivers/usb/musb-new/ti-musb.c | 34 ++++++++++++++++++++++++++++++++++
> 1 file changed, 34 insertions(+)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 5/6] usb: musb-new: Relative ctrl_mod address parsing
2026-01-16 8:41 ` Mattijs Korpershoek
@ 2026-01-16 10:14 ` Markus Schneider-Pargmann
0 siblings, 0 replies; 17+ messages in thread
From: Markus Schneider-Pargmann @ 2026-01-16 10:14 UTC (permalink / raw)
To: Mattijs Korpershoek, Markus Schneider-Pargmann (TI.com), u-boot
Cc: Simon Glass, Tom Rini, Marek Vasut, Andrew Goodbody,
Kory Maincent, Svyatoslav Ryhel, Christian Marangi,
Dinesh Maniyam, Heiko Schocher
[-- Attachment #1: Type: text/plain, Size: 853 bytes --]
Hi Mattijs,
On Fri Jan 16, 2026 at 9:41 AM CET, Mattijs Korpershoek wrote:
> Hi Markus,
>
> Thank you for the patch.
>
> On Wed, Jan 14, 2026 at 09:33, "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>
>
> I already reviewed this in v1 and the patch did not change in v3:
> https://lore.kernel.org/all/87v7hdzge3.fsf@kernel.org/#t
>
> Can you please explain why you have dropped my Reviewed-by?
Sorry, it wasn't intentional, it seems I missed adding your Reviewed-by
on v2 and then it is missing on v3 as well.
Thanks for your review!
Best
Markus
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 289 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 3/6] dm: core: Support multiple drivers with same compatibles
2026-01-14 8:33 ` [PATCH v3 3/6] dm: core: Support multiple drivers with same compatibles Markus Schneider-Pargmann (TI.com)
@ 2026-01-16 10:50 ` Mattijs Korpershoek
2026-01-21 16:45 ` Maniyam, Dinesh
0 siblings, 1 reply; 17+ messages in thread
From: Mattijs Korpershoek @ 2026-01-16 10:50 UTC (permalink / raw)
To: Markus Schneider-Pargmann (TI.com), u-boot, Mattijs Korpershoek
Cc: Simon Glass, Tom Rini, Marek Vasut, Andrew Goodbody,
Kory Maincent, Svyatoslav Ryhel, Christian Marangi,
Dinesh Maniyam, Heiko Schocher,
Markus Schneider-Pargmann (TI.com), Simon Glass
Hi Markus,
Thank you for the patch.
On Wed, Jan 14, 2026 at 09:33, "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. The loop had to be
> adjusted a bit to still support the 'drv' argument properly. Some
> simplifications where done as well.
Nitpick: where -> were.
Please don't do any refactor/tweaks in this patch. drivers/core is
already difficult enough to review without formatting changes (to me at
least)
I see a couple below.
>
> The modification will only add additional loop iterations if -ENODEV is
> returned. Otherwise the exit and continue conditions for the loop stay
> the same and do not cause any additional iterations and should not
> impact performance.
>
> 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
Nitpick: UCLASS_USB_GADGET_GENERIC (not GENERIc)
> function and returning -ENODEV the other driver can probe instead.
>
> Reviewed-by: Simon Glass <simon.glass@canonical.com>
> Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp@baylibre.com>
> ---
> drivers/core/lists.c | 65 ++++++++++++++++++++++++++--------------------------
> 1 file changed, 33 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/core/lists.c b/drivers/core/lists.c
> index 9d1ca38212ee7f53b8894f964f096611c8ec20a5..3d9f9bc93954efdd624dddb1833f3a855c3c28de 100644
> --- a/drivers/core/lists.c
> +++ b/drivers/core/lists.c
> @@ -235,50 +235,51 @@ 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++) {
> + /* Search for drivers with matching drv or existing of_match */
> if (drv) {
> if (drv != entry)
> continue;
> - if (!entry->of_match)
> - break;
> + } else if (!entry->of_match) {
> + continue;
> }
> - ret = driver_check_compatible(entry->of_match, &id,
> - compat);
> - if (!ret)
> - 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;
> + id = NULL;
> + if (entry->of_match) {
> + ret = driver_check_compatible(entry->of_match, &id,
> + compat);
> + if (ret)
> + continue;
> + log_debug(" - found match at driver '%s' for '%s'\n",
> + entry->name, id->compatible);
> + }
> +
> + if (pre_reloc_only) {
> + if (!ofnode_pre_reloc(node) &&
> + !(entry->flags & DM_FLAG_PRE_RELOC)) {
> + log_debug(" - Skipping device pre-relocation\n");
This was changed from :
log_debug("Skipping device pre-relocation\n");
Please move log formatting to a separate, cosmetic patch. This way, this
patch stays purely functional, and simpler.
See: https://docs.u-boot.org/en/latest/develop/sending_patches.html#general-patch-submission-rules
> + return 0;
> + }
> + }
> +
> + ret = device_bind_with_driver_data(parent, entry, name,
> + id ? id->data : 0, node,
> + &dev);
> + if (!drv && ret == -ENODEV) {
> + log_debug(" - Driver '%s' refuses to bind\n", entry->name);
Same here. We added " -" to the log, making the diff overly
complicated.
Locally, discarded these message formatting changes and the diff was
much simpler.
Can we please re-submit by moving the formatting changes in a separate
patch?
Thanks
Mattijs
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 3/6] dm: core: Support multiple drivers with same compatibles
2026-01-16 10:50 ` Mattijs Korpershoek
@ 2026-01-21 16:45 ` Maniyam, Dinesh
2026-01-21 17:00 ` Markus Schneider-Pargmann
0 siblings, 1 reply; 17+ messages in thread
From: Maniyam, Dinesh @ 2026-01-21 16:45 UTC (permalink / raw)
To: Mattijs Korpershoek, Markus Schneider-Pargmann (TI.com), u-boot
Cc: Simon Glass, Tom Rini, Marek Vasut, Andrew Goodbody,
Kory Maincent, Svyatoslav Ryhel, Christian Marangi,
Heiko Schocher, Simon Glass
Hi Markus,
Thanks for the patch.
On 16/1/2026 6:50 pm, Mattijs Korpershoek wrote:
> [CAUTION: This email is from outside your organization. Unless you trust the sender, do not click on links or open attachments as it may be a fraudulent email attempting to steal your information and/or compromise your computer.]
>
> Hi Markus,
>
> Thank you for the patch.
>
> On Wed, Jan 14, 2026 at 09:33, "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. The loop had to be
>> adjusted a bit to still support the 'drv' argument properly. Some
>> simplifications where done as well.
> Nitpick: where -> were.
>
> Please don't do any refactor/tweaks in this patch. drivers/core is
> already difficult enough to review without formatting changes (to me at
> least)
>
> I see a couple below.
>
>> The modification will only add additional loop iterations if -ENODEV is
>> returned. Otherwise the exit and continue conditions for the loop stay
>> the same and do not cause any additional iterations and should not
>> impact performance.
>>
>> 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
> Nitpick: UCLASS_USB_GADGET_GENERIC (not GENERIc)
>
>> function and returning -ENODEV the other driver can probe instead.
>>
>> Reviewed-by: Simon Glass<simon.glass@canonical.com>
>> Signed-off-by: Markus Schneider-Pargmann (TI.com)<msp@baylibre.com>
>> ---
>> drivers/core/lists.c | 65 ++++++++++++++++++++++++++--------------------------
>> 1 file changed, 33 insertions(+), 32 deletions(-)
>>
>> diff --git a/drivers/core/lists.c b/drivers/core/lists.c
>> index 9d1ca38212ee7f53b8894f964f096611c8ec20a5..3d9f9bc93954efdd624dddb1833f3a855c3c28de 100644
>> --- a/drivers/core/lists.c
>> +++ b/drivers/core/lists.c
>> @@ -235,50 +235,51 @@ 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++) {
>> + /* Search for drivers with matching drv or existing of_match */
>> if (drv) {
>> if (drv != entry)
>> continue;
>> - if (!entry->of_match)
>> - break;
>> + } else if (!entry->of_match) {
>> + continue;
>> }
>> - ret = driver_check_compatible(entry->of_match, &id,
>> - compat);
>> - if (!ret)
>> - 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;
>> + id = NULL;
>> + if (entry->of_match) {
>> + ret = driver_check_compatible(entry->of_match, &id,
>> + compat);
>> + if (ret)
>> + continue;
>> + log_debug(" - found match at driver '%s' for '%s'\n",
>> + entry->name, id->compatible);
>> + }
>> +
>> + if (pre_reloc_only) {
>> + if (!ofnode_pre_reloc(node) &&
>> + !(entry->flags & DM_FLAG_PRE_RELOC)) {
>> + log_debug(" - Skipping device pre-relocation\n");
>
> This was changed from :
>
> log_debug("Skipping device pre-relocation\n");
>
> Please move log formatting to a separate, cosmetic patch. This way, this
> patch stays purely functional, and simpler.
>
> See:https://docs.u-boot.org/en/latest/develop/sending_patches.html#general-patch-submission-rules
>
>
>> + return 0;
>> + }
>> + }
>> +
>> + ret = device_bind_with_driver_data(parent, entry, name,
>> + id ? id->data : 0, node,
>> + &dev);
>> + if (!drv && ret == -ENODEV) {
>> + log_debug(" - Driver '%s' refuses to bind\n", entry->name);
> Same here. We added " -" to the log, making the diff overly
> complicated.
>
> Locally, discarded these message formatting changes and the diff was
> much simpler.
>
> Can we please re-submit by moving the formatting changes in a separate
> patch?
>
> Thanks
> Mattijs
>
> Previously, we were using glue/wrapper driver to support multiple drivers
> with same compatibility.
>
> For example:
>
> In this file,
> https://source.denx.de/u-boot/u-boot/-/blob/master/drivers/usb/dwc3/dwc3-generic.c
>
> look for|dwc3_glue_bind_common, why not use the similar implementation? |Why does/core DM /need to know about USB role selection?
>
> |lists_bind_fdt()| must remain simple and predictable
>
> Thanks
> Dinesh
>
>
>
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 3/6] dm: core: Support multiple drivers with same compatibles
2026-01-21 16:45 ` Maniyam, Dinesh
@ 2026-01-21 17:00 ` Markus Schneider-Pargmann
2026-01-23 11:24 ` Maniyam, Dinesh
0 siblings, 1 reply; 17+ messages in thread
From: Markus Schneider-Pargmann @ 2026-01-21 17:00 UTC (permalink / raw)
To: Maniyam, Dinesh, Mattijs Korpershoek,
Markus Schneider-Pargmann (TI.com), u-boot
Cc: Simon Glass, Tom Rini, Marek Vasut, Andrew Goodbody,
Kory Maincent, Svyatoslav Ryhel, Christian Marangi,
Heiko Schocher, Simon Glass
[-- Attachment #1: Type: text/plain, Size: 1139 bytes --]
Hi Dinesh,
On Wed Jan 21, 2026 at 5:45 PM CET, Dinesh Maniyam wrote:
[...]
>>
>> Previously, we were using glue/wrapper driver to support multiple drivers
>> with same compatibility.
>>
>> For example:
>>
>> In this file,
>> https://source.denx.de/u-boot/u-boot/-/blob/master/drivers/usb/dwc3/dwc3-generic.c
>>
>> look for|dwc3_glue_bind_common, why not use the similar implementation? |Why does/core DM /need to know about USB role selection?
>>
>> |lists_bind_fdt()| must remain simple and predictable
I can see dwc3 seems to use the parent devicetree node to bind the glue
driver, right?
Upstream am33xx.dtsi does not have a devicetree parent node that we
could bind to. The parent is of type ti,sysc which is not USB specific.
The uboot am33xx.dtsi did have a devicetree parent that was USB specific
and it was used before to bind the USB glue. But with OF_UPSTREAM I
can't use that anymore.
This is why I developed this patch, to be able let bind() return
-ENODEV. lists_bind_fdt() will remain predictable. Most drivers do not
return -ENODEV and will not be influenced by this change.
Best
Markus
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 289 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: [PATCH v3 3/6] dm: core: Support multiple drivers with same compatibles
2026-01-21 17:00 ` Markus Schneider-Pargmann
@ 2026-01-23 11:24 ` Maniyam, Dinesh
0 siblings, 0 replies; 17+ messages in thread
From: Maniyam, Dinesh @ 2026-01-23 11:24 UTC (permalink / raw)
To: Markus Schneider-Pargmann, Mattijs Korpershoek, u-boot
Cc: Simon Glass, Tom Rini, Marek Vasut, Andrew Goodbody,
Kory Maincent, Svyatoslav Ryhel, Christian Marangi,
Heiko Schocher, Simon Glass
Hi Markus,
On 22/1/2026 1:00 am, Markus Schneider-Pargmann wrote:
> Hi Dinesh,
>
> On Wed Jan 21, 2026 at 5:45 PM CET, Dinesh Maniyam wrote:
> [...]
>>> Previously, we were using glue/wrapper driver to support multiple drivers
>>> with same compatibility.
>>>
>>> For example:
>>>
>>> In this file,
>>> https://source.denx.de/u-boot/u-boot/-/blob/master/drivers/usb/dwc3/dwc3-generic.c
>>>
>>> look for|dwc3_glue_bind_common, why not use the similar implementation? |Why does/core DM /need to know about USB role selection?
>>>
>>> |lists_bind_fdt()| must remain simple and predictable
> I can see dwc3 seems to use the parent devicetree node to bind the glue
> driver, right?
>
> Upstream am33xx.dtsi does not have a devicetree parent node that we
> could bind to. The parent is of type ti,sysc which is not USB specific.
> The uboot am33xx.dtsi did have a devicetree parent that was USB specific
> and it was used before to bind the USB glue. But with OF_UPSTREAM I
> can't use that anymore.
>
> This is why I developed this patch, to be able let bind() return
> -ENODEV. lists_bind_fdt() will remain predictable. Most drivers do not
> return -ENODEV and will not be influenced by this change.
>
> Best
> Markus
>
> I see your point now: with |CONFIG_OF_UPSTREAM|, the Linux |am33xx.dtsi|
> no longer provides a USB-specific parent node for the dwc3 glue to
> bind against,
> since the parent is a generic |ti,sysc|.
> Given that, relying on the old U-Boot-specific hierarchy is no longer
> viable, and
> allowing |bind()| to return |-ENODEV| makes sense to keep the binding
> behavior predictable.
>
> I also agree with your observation that most drivers do not return
> |-ENODEV|,
> so the impact of this change should remain limited and well-contained.
>
> Happy to understand the intention behind this new approach — thanks
> for clarifying.
>
> Acked-by: Dinesh Maniyam <dinesh.maniyam@altera.com>
>
>
>
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2026-01-23 12:47 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-14 8:33 [PATCH v3 0/6] dm: core: Support same compatible in host/gadget musb drivers Markus Schneider-Pargmann (TI.com)
2026-01-14 8:33 ` [PATCH v3 1/6] dm: core: lists_bind_fdt: Remove unused variable Markus Schneider-Pargmann (TI.com)
2026-01-16 8:22 ` Mattijs Korpershoek
2026-01-14 8:33 ` [PATCH v3 2/6] dm: core: lists_bind_fdt: Replace found variable Markus Schneider-Pargmann (TI.com)
2026-01-16 8:23 ` Mattijs Korpershoek
2026-01-14 8:33 ` [PATCH v3 3/6] dm: core: Support multiple drivers with same compatibles Markus Schneider-Pargmann (TI.com)
2026-01-16 10:50 ` Mattijs Korpershoek
2026-01-21 16:45 ` Maniyam, Dinesh
2026-01-21 17:00 ` Markus Schneider-Pargmann
2026-01-23 11:24 ` Maniyam, Dinesh
2026-01-14 8:33 ` [PATCH v3 4/6] test: dm: Add compatible multimatch test Markus Schneider-Pargmann (TI.com)
2026-01-16 8:35 ` Mattijs Korpershoek
2026-01-14 8:33 ` [PATCH v3 5/6] usb: musb-new: Relative ctrl_mod address parsing Markus Schneider-Pargmann (TI.com)
2026-01-16 8:41 ` Mattijs Korpershoek
2026-01-16 10:14 ` Markus Schneider-Pargmann
2026-01-14 8:33 ` [PATCH v3 6/6] usb: musb-new: Add compatibles for ti,musb-am33xx Markus Schneider-Pargmann (TI.com)
2026-01-16 8:44 ` Mattijs Korpershoek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox