The K1 describes its DWC3 controller as one flat device-tree node with
the controller registers, clocks, resets and PHYs. It has no separate
wrapper registers or controller subnode.

Use the existing flat-node callback through rk_ops so that the generic
wrapper binds its host or peripheral child to the same node.

The generic glue handles the K1 controller clocks, resets and USB 3 PHY,
while the child uses the existing generic DWC3 host/peripheral path.

The K3 uses the same flat-node layout, so match "spacemit,k3-dwc3"
as well.

Signed-off-by: Dave Klotz <[email protected]>
Reviewed-by: Marek Vasut <[email protected]>
---

Notes:
    Changes in v3:
    - Add Marek Vasut's Reviewed-by.
    - Also match "spacemit,k3-dwc3": the K3 uses the same flat-node
      layout (dts/upstream k3.dtsi), and 1/3 now matches its USB 2.0 PHY.
      Not tested on K3 hardware.

 drivers/usb/dwc3/dwc3-generic.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index 3f6e3d4085..2406f84461 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -753,6 +753,8 @@ 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 = "spacemit,k1-dwc3", .data = (ulong)&rk_ops },
+       { .compatible = "spacemit,k3-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 },

Reply via email to