[PATCH 2/3] usb: dwc3-generic: support Qualcomm flattened DT

Casey Connolly casey.connolly at linaro.org
Fri Jan 16 18:54:03 CET 2026


Hi Mattijs,

On 1/15/26 10:21, Mattijs Korpershoek wrote:
> Hi Casey,
> 
> Thank you for the patch.
> 
> On Wed, Jan 14, 2026 at 15:13, Casey Connolly <casey.connolly at linaro.org> wrote:
> 
>> Qualcomm devicetrees are moving away from having a glue node with dwc3
>> as a subnode and now may just have a single flattened node.
> 
> In the commit message, could you provide a link to an example dt who has
> this single flattened node?

Sorry I just saw this after posting v2... You can grep for the new 
compatible string in upstream DT, sc7280, sm8650 and a few other 
platforms are already switched over, eventually all the used/maintained 
platforms will get switched over I suspect.

> 
>>
>> Rockchip already have a glue_get_ctrl_dev op which returns the node for
>> the glue device itself, commonise this and reuse it for the new Qualcomm
>> node.
>>
>> Signed-off-by: Casey Connolly <casey.connolly at linaro.org>
>> ---
>>   drivers/usb/dwc3/dwc3-generic.c | 21 +++++++++++++++------
>>   1 file changed, 15 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
>> index 02c02b1d80e4..7044696ced0c 100644
>> --- a/drivers/usb/dwc3/dwc3-generic.c
>> +++ b/drivers/usb/dwc3/dwc3-generic.c
>> @@ -6,8 +6,10 @@
>>    *
>>    * Based on dwc3-omap.c.
>>    */
>>   
>> +#define LOG_DEBUG
>> +
> 
> Debug leftover? Please drop for v2.
> 
>>   #include <dm.h>
>>   #include <reset.h>
>>   #include <asm/gpio.h>
>>   #include <dm/device_compat.h>
>> @@ -488,23 +490,29 @@ static void dwc3_qcom_glue_configure(struct udevice *dev, int index,
>>   	if (mode != USB_DR_MODE_HOST)
>>   		dwc3_qcom_vbus_override_enable(qscratch_base, true);
>>   }
>>   
>> -struct dwc3_glue_ops qcom_ops = {
>> -	.glue_configure = dwc3_qcom_glue_configure,
>> -};
>> -
>> -static int dwc3_rk_glue_get_ctrl_dev(struct udevice *dev, ofnode *node)
>> +/* In cases where there is no dwc3 node and it's flattened into the glue node */
>> +static int dwc3_flat_dt_get_ctrl_dev(struct udevice *dev, ofnode *node)
>>   {
>>   	*node = dev_ofnode(dev);
>>   	if (!ofnode_valid(*node))
>>   		return -EINVAL;
>>   
>>   	return 0;
>>   }
>>   
>> +struct dwc3_glue_ops qcom_ops = {
>> +	.glue_configure = dwc3_qcom_glue_configure,
>> +};
>> +
>> +struct dwc3_glue_ops qcom_flat_dt_ops = {
>> +	.glue_configure = dwc3_qcom_glue_configure,
>> +	.glue_get_ctrl_dev = dwc3_flat_dt_get_ctrl_dev,
>> +};
>> +
>>   struct dwc3_glue_ops rk_ops = {
>> -	.glue_get_ctrl_dev = dwc3_rk_glue_get_ctrl_dev,
>> +	.glue_get_ctrl_dev = dwc3_flat_dt_get_ctrl_dev,
>>   };
>>   
>>   static int dwc3_glue_bind_common(struct udevice *parent, ofnode node)
>>   {
>> @@ -711,8 +719,9 @@ static const struct udevice_id dwc3_glue_ids[] = {
>>   	{ .compatible = "rockchip,rk3568-dwc3", .data = (ulong)&rk_ops },
>>   	{ .compatible = "rockchip,rk3576-dwc3", .data = (ulong)&rk_ops },
>>   	{ .compatible = "rockchip,rk3588-dwc3", .data = (ulong)&rk_ops },
>>   	{ .compatible = "qcom,dwc3", .data = (ulong)&qcom_ops },
>> +	{ .compatible = "qcom,snps-dwc3", .data = (ulong)&qcom_flat_dt_ops },
>>   	{ .compatible = "fsl,imx8mp-dwc3", .data = (ulong)&imx8mp_ops },
>>   	{ .compatible = "fsl,imx8mq-dwc3" },
>>   	{ .compatible = "intel,tangier-dwc3" },
>>   	{ .compatible = "samsung,exynos7870-dwusb3" },
>>
>> -- 
>> 2.51.0



More information about the U-Boot mailing list