* [PATCH v3 0/2] Support for Samsung Exynos 7870 DW-USB device in controller
@ 2026-01-08 12:33 Kaustabh Chakraborty
2026-01-08 12:33 ` [PATCH v3 1/2] usb: dwc3-generic: allow fallback of dr_mode property to "otg" Kaustabh Chakraborty
2026-01-08 12:33 ` [PATCH v3 2/2] usb: dwc3-generic: add support for exynos7870 Kaustabh Chakraborty
0 siblings, 2 replies; 7+ messages in thread
From: Kaustabh Chakraborty @ 2026-01-08 12:33 UTC (permalink / raw)
To: u-boot
Cc: Ilias Apalodimas, Marek Vasut, Tom Rini, Mattijs Korpershoek,
Kever Yang, Jonas Karlman, Patrice Chotard, Sam Protsenko,
Kaustabh Chakraborty, Marek Vasut
This patch series aims to add support for the Samsung Exynos 7870 DW-USB
controller. The support is added in the dwc3-generic driver.
This also has a patch which allows the driver to fall back to "otg"
dual-role mode when none is specified in devicetree.
Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
---
Changes in v3:
- change link in [v2 1/2] to upstream repository (Marek Vasut)
- use dev_info() instead of pr_info() (Marek Vasut)
- Link to v2: https://lore.kernel.org/r/20260103-usb-dwc3-exynos7870-v2-0-67441680d287@disroot.org
Changes in v2:
- clarify rationale behind [v1 1/2] (Marek Vasut)
- Link to v1: https://lore.kernel.org/r/20251017-usb-dwc3-exynos7870-v1-0-fe46e2ed1908@disroot.org
---
Kaustabh Chakraborty (2):
usb: dwc3-generic: allow fallback of dr_mode property to "otg"
usb: dwc3-generic: add support for exynos7870
drivers/usb/dwc3/dwc3-generic.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
---
base-commit: 5e7624979083e2bc163e18165452d8ead462b58c
change-id: 20251014-usb-dwc3-exynos7870-5d38b538a06e
Best regards,
--
Kaustabh Chakraborty <kauschluss@disroot.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v3 1/2] usb: dwc3-generic: allow fallback of dr_mode property to "otg"
2026-01-08 12:33 [PATCH v3 0/2] Support for Samsung Exynos 7870 DW-USB device in controller Kaustabh Chakraborty
@ 2026-01-08 12:33 ` Kaustabh Chakraborty
2026-01-16 12:33 ` Mattijs Korpershoek
2026-01-08 12:33 ` [PATCH v3 2/2] usb: dwc3-generic: add support for exynos7870 Kaustabh Chakraborty
1 sibling, 1 reply; 7+ messages in thread
From: Kaustabh Chakraborty @ 2026-01-08 12:33 UTC (permalink / raw)
To: u-boot
Cc: Ilias Apalodimas, Marek Vasut, Tom Rini, Mattijs Korpershoek,
Kever Yang, Jonas Karlman, Patrice Chotard, Sam Protsenko,
Kaustabh Chakraborty, Marek Vasut
Documentation [1] states that the default value of the dr_mode property
is "otg". It also isn't marked a mandatory node, so it may or may not be
set. So, accordingly if dr_mode is not mentioned in the devicetree node,
OTG mode must be assumed.
In this driver however, this case is not handled. If dr_mode is not
mentioned, USB_DR_MODE_UNKNOWN is set. The logic implemented raises an
error, instead of falling back to USB_DR_MODE_OTG. Correct this to
conform to the specification.
Link: https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git/tree/Bindings/usb/usb-drd.yaml?h=v6.18-dts [1]
Reviewed-by: Marek Vasut <marek.vasut@mailbox.org>
Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
---
drivers/usb/dwc3/dwc3-generic.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index c09014aec60..c15eda19e8f 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -10,6 +10,7 @@
#include <dm.h>
#include <reset.h>
#include <asm/gpio.h>
+#include <dm/device_compat.h>
#include <dm/lists.h>
#include <linux/delay.h>
#include <linux/usb/gadget.h>
@@ -173,8 +174,8 @@ static int dwc3_generic_of_to_plat(struct udevice *dev)
node = dev_ofnode(dev->parent);
plat->dr_mode = usb_get_dr_mode(node);
if (plat->dr_mode == USB_DR_MODE_UNKNOWN) {
- pr_err("Invalid usb mode setup\n");
- return -ENODEV;
+ dev_info(dev, "No USB mode specified. Using 'otg'\n");
+ plat->dr_mode = USB_DR_MODE_OTG;
}
}
@@ -516,6 +517,10 @@ static int dwc3_glue_bind_common(struct udevice *parent, ofnode node)
if (!dr_mode)
dr_mode = usb_get_dr_mode(node);
+ /* usb mode must fallback to peripheral if not known */
+ if (dr_mode == USB_DR_MODE_UNKNOWN)
+ dr_mode = USB_DR_MODE_OTG;
+
if (CONFIG_IS_ENABLED(DM_USB_GADGET) &&
(dr_mode == USB_DR_MODE_PERIPHERAL || dr_mode == USB_DR_MODE_OTG)) {
debug("%s: dr_mode: OTG or Peripheral\n", __func__);
--
2.52.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v3 2/2] usb: dwc3-generic: add support for exynos7870
2026-01-08 12:33 [PATCH v3 0/2] Support for Samsung Exynos 7870 DW-USB device in controller Kaustabh Chakraborty
2026-01-08 12:33 ` [PATCH v3 1/2] usb: dwc3-generic: allow fallback of dr_mode property to "otg" Kaustabh Chakraborty
@ 2026-01-08 12:33 ` Kaustabh Chakraborty
2026-01-16 12:33 ` Mattijs Korpershoek
1 sibling, 1 reply; 7+ messages in thread
From: Kaustabh Chakraborty @ 2026-01-08 12:33 UTC (permalink / raw)
To: u-boot
Cc: Ilias Apalodimas, Marek Vasut, Tom Rini, Mattijs Korpershoek,
Kever Yang, Jonas Karlman, Patrice Chotard, Sam Protsenko,
Kaustabh Chakraborty, Marek Vasut
Exynos7870's DWC3 glue layer is quite simple, consisting of a few
clocks, which is handled by this driver. Add the compatible string in
here.
Reviewed-by: Marek Vasut <marek.vasut@mailbox.org>
Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
---
drivers/usb/dwc3/dwc3-generic.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index c15eda19e8f..bb11613a587 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -711,6 +711,7 @@ static const struct udevice_id dwc3_glue_ids[] = {
{ .compatible = "fsl,imx8mp-dwc3", .data = (ulong)&imx8mp_ops },
{ .compatible = "fsl,imx8mq-dwc3" },
{ .compatible = "intel,tangier-dwc3" },
+ { .compatible = "samsung,exynos7870-dwusb3" },
{ .compatible = "samsung,exynos850-dwusb3" },
{ }
};
--
2.52.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v3 1/2] usb: dwc3-generic: allow fallback of dr_mode property to "otg"
2026-01-08 12:33 ` [PATCH v3 1/2] usb: dwc3-generic: allow fallback of dr_mode property to "otg" Kaustabh Chakraborty
@ 2026-01-16 12:33 ` Mattijs Korpershoek
2026-01-16 13:42 ` Kaustabh Chakraborty
0 siblings, 1 reply; 7+ messages in thread
From: Mattijs Korpershoek @ 2026-01-16 12:33 UTC (permalink / raw)
To: Kaustabh Chakraborty, u-boot
Cc: Ilias Apalodimas, Marek Vasut, Tom Rini, Mattijs Korpershoek,
Kever Yang, Jonas Karlman, Patrice Chotard, Sam Protsenko,
Kaustabh Chakraborty, Marek Vasut, Casey Connolly
Hi Kaustabh,
Thank you for the patch.
On Thu, Jan 08, 2026 at 18:03, Kaustabh Chakraborty <kauschluss@disroot.org> wrote:
> Documentation [1] states that the default value of the dr_mode property
> is "otg". It also isn't marked a mandatory node, so it may or may not be
> set. So, accordingly if dr_mode is not mentioned in the devicetree node,
> OTG mode must be assumed.
>
> In this driver however, this case is not handled. If dr_mode is not
> mentioned, USB_DR_MODE_UNKNOWN is set. The logic implemented raises an
> error, instead of falling back to USB_DR_MODE_OTG. Correct this to
> conform to the specification.
>
> Link: https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git/tree/Bindings/usb/usb-drd.yaml?h=v6.18-dts [1]
> Reviewed-by: Marek Vasut <marek.vasut@mailbox.org>
> Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Note: there is a similar patch submitted by Casey here:
https://lore.kernel.org/all/20260114-casey-usb-role-switch-v1-1-fb7a626466b9@linaro.org/
Can you have a look at that one please? You could review it or test it
to see if it works for you?
Thanks!
Mattijs
> ---
> drivers/usb/dwc3/dwc3-generic.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
> index c09014aec60..c15eda19e8f 100644
> --- a/drivers/usb/dwc3/dwc3-generic.c
> +++ b/drivers/usb/dwc3/dwc3-generic.c
> @@ -10,6 +10,7 @@
> #include <dm.h>
> #include <reset.h>
> #include <asm/gpio.h>
> +#include <dm/device_compat.h>
> #include <dm/lists.h>
> #include <linux/delay.h>
> #include <linux/usb/gadget.h>
> @@ -173,8 +174,8 @@ static int dwc3_generic_of_to_plat(struct udevice *dev)
> node = dev_ofnode(dev->parent);
> plat->dr_mode = usb_get_dr_mode(node);
> if (plat->dr_mode == USB_DR_MODE_UNKNOWN) {
> - pr_err("Invalid usb mode setup\n");
> - return -ENODEV;
> + dev_info(dev, "No USB mode specified. Using 'otg'\n");
> + plat->dr_mode = USB_DR_MODE_OTG;
> }
> }
>
> @@ -516,6 +517,10 @@ static int dwc3_glue_bind_common(struct udevice *parent, ofnode node)
> if (!dr_mode)
> dr_mode = usb_get_dr_mode(node);
>
> + /* usb mode must fallback to peripheral if not known */
> + if (dr_mode == USB_DR_MODE_UNKNOWN)
> + dr_mode = USB_DR_MODE_OTG;
> +
> if (CONFIG_IS_ENABLED(DM_USB_GADGET) &&
> (dr_mode == USB_DR_MODE_PERIPHERAL || dr_mode == USB_DR_MODE_OTG)) {
> debug("%s: dr_mode: OTG or Peripheral\n", __func__);
>
> --
> 2.52.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 2/2] usb: dwc3-generic: add support for exynos7870
2026-01-08 12:33 ` [PATCH v3 2/2] usb: dwc3-generic: add support for exynos7870 Kaustabh Chakraborty
@ 2026-01-16 12:33 ` Mattijs Korpershoek
0 siblings, 0 replies; 7+ messages in thread
From: Mattijs Korpershoek @ 2026-01-16 12:33 UTC (permalink / raw)
To: Kaustabh Chakraborty, u-boot
Cc: Ilias Apalodimas, Marek Vasut, Tom Rini, Mattijs Korpershoek,
Kever Yang, Jonas Karlman, Patrice Chotard, Sam Protsenko,
Kaustabh Chakraborty, Marek Vasut
Hi Kaustabh,
Thank you for the patch.
On Thu, Jan 08, 2026 at 18:03, Kaustabh Chakraborty <kauschluss@disroot.org> wrote:
> Exynos7870's DWC3 glue layer is quite simple, consisting of a few
> clocks, which is handled by this driver. Add the compatible string in
> here.
>
> Reviewed-by: Marek Vasut <marek.vasut@mailbox.org>
> Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> ---
> drivers/usb/dwc3/dwc3-generic.c | 1 +
> 1 file changed, 1 insertion(+)
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 1/2] usb: dwc3-generic: allow fallback of dr_mode property to "otg"
2026-01-16 12:33 ` Mattijs Korpershoek
@ 2026-01-16 13:42 ` Kaustabh Chakraborty
2026-01-16 15:16 ` Mattijs Korpershoek
0 siblings, 1 reply; 7+ messages in thread
From: Kaustabh Chakraborty @ 2026-01-16 13:42 UTC (permalink / raw)
To: Mattijs Korpershoek, Kaustabh Chakraborty, u-boot
Cc: Ilias Apalodimas, Marek Vasut, Tom Rini, Kever Yang,
Jonas Karlman, Patrice Chotard, Sam Protsenko, Marek Vasut,
Casey Connolly
On 2026-01-16 13:33 +01:00, Mattijs Korpershoek wrote:
> Hi Kaustabh,
>
> Thank you for the patch.
>
> On Thu, Jan 08, 2026 at 18:03, Kaustabh Chakraborty <kauschluss@disroot.org> wrote:
>
>> Documentation [1] states that the default value of the dr_mode property
>> is "otg". It also isn't marked a mandatory node, so it may or may not be
>> set. So, accordingly if dr_mode is not mentioned in the devicetree node,
>> OTG mode must be assumed.
>>
>> In this driver however, this case is not handled. If dr_mode is not
>> mentioned, USB_DR_MODE_UNKNOWN is set. The logic implemented raises an
>> error, instead of falling back to USB_DR_MODE_OTG. Correct this to
>> conform to the specification.
>>
>> Link: https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git/tree/Bindings/usb/usb-drd.yaml?h=v6.18-dts [1]
>> Reviewed-by: Marek Vasut <marek.vasut@mailbox.org>
>> Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
>
> Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Thanks for your insight, but isn't this patch applied? This has been
merged into u-boot/master already. But I don't see it in next.
Confusing.
>
> Note: there is a similar patch submitted by Casey here:
> https://lore.kernel.org/all/20260114-casey-usb-role-switch-v1-1-fb7a626466b9@linaro.org/
>
> Can you have a look at that one please? You could review it or test it
> to see if it works for you?
This patch addresses a single point of failure, unlike mine.
>
> Thanks!
> Mattijs
>
>> ---
>> drivers/usb/dwc3/dwc3-generic.c | 9 +++++++--
>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
>> index c09014aec60..c15eda19e8f 100644
>> --- a/drivers/usb/dwc3/dwc3-generic.c
>> +++ b/drivers/usb/dwc3/dwc3-generic.c
>> @@ -10,6 +10,7 @@
>> #include <dm.h>
>> #include <reset.h>
>> #include <asm/gpio.h>
>> +#include <dm/device_compat.h>
>> #include <dm/lists.h>
>> #include <linux/delay.h>
>> #include <linux/usb/gadget.h>
>> @@ -173,8 +174,8 @@ static int dwc3_generic_of_to_plat(struct udevice *dev)
>> node = dev_ofnode(dev->parent);
>> plat->dr_mode = usb_get_dr_mode(node);
>> if (plat->dr_mode == USB_DR_MODE_UNKNOWN) {
>> - pr_err("Invalid usb mode setup\n");
>> - return -ENODEV;
>> + dev_info(dev, "No USB mode specified. Using 'otg'\n");
>> + plat->dr_mode = USB_DR_MODE_OTG;
>> }
>> }
>>
>> @@ -516,6 +517,10 @@ static int dwc3_glue_bind_common(struct udevice *parent, ofnode node)
>> if (!dr_mode)
>> dr_mode = usb_get_dr_mode(node);
>>
>> + /* usb mode must fallback to peripheral if not known */
>> + if (dr_mode == USB_DR_MODE_UNKNOWN)
>> + dr_mode = USB_DR_MODE_OTG;
>> +
>> if (CONFIG_IS_ENABLED(DM_USB_GADGET) &&
>> (dr_mode == USB_DR_MODE_PERIPHERAL || dr_mode == USB_DR_MODE_OTG)) {
>> debug("%s: dr_mode: OTG or Peripheral\n", __func__);
>>
>> --
>> 2.52.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v3 1/2] usb: dwc3-generic: allow fallback of dr_mode property to "otg"
2026-01-16 13:42 ` Kaustabh Chakraborty
@ 2026-01-16 15:16 ` Mattijs Korpershoek
0 siblings, 0 replies; 7+ messages in thread
From: Mattijs Korpershoek @ 2026-01-16 15:16 UTC (permalink / raw)
To: Kaustabh Chakraborty, Mattijs Korpershoek, Kaustabh Chakraborty,
u-boot
Cc: Ilias Apalodimas, Marek Vasut, Tom Rini, Kever Yang,
Jonas Karlman, Patrice Chotard, Sam Protsenko, Marek Vasut,
Casey Connolly
On Fri, Jan 16, 2026 at 19:12, "Kaustabh Chakraborty" <kauschluss@disroot.org> wrote:
> On 2026-01-16 13:33 +01:00, Mattijs Korpershoek wrote:
>> Hi Kaustabh,
>>
>> Thank you for the patch.
>>
>> On Thu, Jan 08, 2026 at 18:03, Kaustabh Chakraborty <kauschluss@disroot.org> wrote:
>>
>>> Documentation [1] states that the default value of the dr_mode property
>>> is "otg". It also isn't marked a mandatory node, so it may or may not be
>>> set. So, accordingly if dr_mode is not mentioned in the devicetree node,
>>> OTG mode must be assumed.
>>>
>>> In this driver however, this case is not handled. If dr_mode is not
>>> mentioned, USB_DR_MODE_UNKNOWN is set. The logic implemented raises an
>>> error, instead of falling back to USB_DR_MODE_OTG. Correct this to
>>> conform to the specification.
>>>
>>> Link: https://git.kernel.org/pub/scm/linux/kernel/git/devicetree/devicetree-rebasing.git/tree/Bindings/usb/usb-drd.yaml?h=v6.18-dts [1]
>>> Reviewed-by: Marek Vasut <marek.vasut@mailbox.org>
>>> Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
>>
>> Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
>
> Thanks for your insight, but isn't this patch applied? This has been
> merged into u-boot/master already. But I don't see it in next.
> Confusing.
You are right. This patch was already applied. I usually check for an
email that states that the patch was applied but I forgot Marek usually
does not send those.
Sorry about that, I generated un-necessary noise.
It's normal that your patch has only be applied into u-boot/master.
Right now, we are in the U-Boot merge window. During this time, the next
branch is closed. All development and fixes go into master directly.
See:
https://docs.u-boot.org/en/latest/develop/release_cycle.html#current-status
https://docs.u-boot.org/en/latest/develop/process.html#management-summary
Hope that clears out the confusion.
>
>>
>> Note: there is a similar patch submitted by Casey here:
>> https://lore.kernel.org/all/20260114-casey-usb-role-switch-v1-1-fb7a626466b9@linaro.org/
>>
>> Can you have a look at that one please? You could review it or test it
>> to see if it works for you?
>
> This patch addresses a single point of failure, unlike mine.
>
>>
>> Thanks!
>> Mattijs
>>
>>> ---
>>> drivers/usb/dwc3/dwc3-generic.c | 9 +++++++--
>>> 1 file changed, 7 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
>>> index c09014aec60..c15eda19e8f 100644
>>> --- a/drivers/usb/dwc3/dwc3-generic.c
>>> +++ b/drivers/usb/dwc3/dwc3-generic.c
>>> @@ -10,6 +10,7 @@
>>> #include <dm.h>
>>> #include <reset.h>
>>> #include <asm/gpio.h>
>>> +#include <dm/device_compat.h>
>>> #include <dm/lists.h>
>>> #include <linux/delay.h>
>>> #include <linux/usb/gadget.h>
>>> @@ -173,8 +174,8 @@ static int dwc3_generic_of_to_plat(struct udevice *dev)
>>> node = dev_ofnode(dev->parent);
>>> plat->dr_mode = usb_get_dr_mode(node);
>>> if (plat->dr_mode == USB_DR_MODE_UNKNOWN) {
>>> - pr_err("Invalid usb mode setup\n");
>>> - return -ENODEV;
>>> + dev_info(dev, "No USB mode specified. Using 'otg'\n");
>>> + plat->dr_mode = USB_DR_MODE_OTG;
>>> }
>>> }
>>>
>>> @@ -516,6 +517,10 @@ static int dwc3_glue_bind_common(struct udevice *parent, ofnode node)
>>> if (!dr_mode)
>>> dr_mode = usb_get_dr_mode(node);
>>>
>>> + /* usb mode must fallback to peripheral if not known */
>>> + if (dr_mode == USB_DR_MODE_UNKNOWN)
>>> + dr_mode = USB_DR_MODE_OTG;
>>> +
>>> if (CONFIG_IS_ENABLED(DM_USB_GADGET) &&
>>> (dr_mode == USB_DR_MODE_PERIPHERAL || dr_mode == USB_DR_MODE_OTG)) {
>>> debug("%s: dr_mode: OTG or Peripheral\n", __func__);
>>>
>>> --
>>> 2.52.0
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-01-16 15:16 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-08 12:33 [PATCH v3 0/2] Support for Samsung Exynos 7870 DW-USB device in controller Kaustabh Chakraborty
2026-01-08 12:33 ` [PATCH v3 1/2] usb: dwc3-generic: allow fallback of dr_mode property to "otg" Kaustabh Chakraborty
2026-01-16 12:33 ` Mattijs Korpershoek
2026-01-16 13:42 ` Kaustabh Chakraborty
2026-01-16 15:16 ` Mattijs Korpershoek
2026-01-08 12:33 ` [PATCH v3 2/2] usb: dwc3-generic: add support for exynos7870 Kaustabh Chakraborty
2026-01-16 12:33 ` Mattijs Korpershoek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox