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 so that the generic wrapper binds
its host or peripheral child to the same node. Rename the Rockchip
flat-node ops to reflect that the callback is shared; keep the existing
Rockchip matches on the same callback.

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

Signed-off-by: Dave Klotz <[email protected]>
---
 drivers/usb/dwc3/dwc3-generic.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index 2356b3bc0a..489bc8347a 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -515,7 +515,7 @@ static const struct dwc3_glue_ops qcom_flat_dt_ops = {
        .glue_get_ctrl_dev = dwc3_flat_dt_get_ctrl_dev,
 };
 
-static const struct dwc3_glue_ops rk_ops = {
+static const struct dwc3_glue_ops flat_dt_ops = {
        .glue_get_ctrl_dev = dwc3_flat_dt_get_ctrl_dev,
 };
 
@@ -718,12 +718,13 @@ static const struct udevice_id dwc3_glue_ids[] = {
        { .compatible = "ti,dwc3", .data = (ulong)&ti_ops },
        { .compatible = "ti,am437x-dwc3", .data = (ulong)&ti_ops },
        { .compatible = "ti,am654-dwc3" },
-       { .compatible = "rockchip,rk3328-dwc3", .data = (ulong)&rk_ops },
+       { .compatible = "rockchip,rk3328-dwc3", .data = (ulong)&flat_dt_ops },
        { .compatible = "rockchip,rk3399-dwc3" },
-       { .compatible = "rockchip,rk3528-dwc3", .data = (ulong)&rk_ops },
-       { .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 = "rockchip,rk3528-dwc3", .data = (ulong)&flat_dt_ops },
+       { .compatible = "rockchip,rk3568-dwc3", .data = (ulong)&flat_dt_ops },
+       { .compatible = "rockchip,rk3576-dwc3", .data = (ulong)&flat_dt_ops },
+       { .compatible = "rockchip,rk3588-dwc3", .data = (ulong)&flat_dt_ops },
+       { .compatible = "spacemit,k1-dwc3", .data = (ulong)&flat_dt_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