On 20-03-27 10:50:28, Oliver Graute wrote: > On 27/03/20, Peter Chen wrote: > > On 20-03-26 18:01:09, Oliver Graute wrote: > > > Hello, > > > > > > What is the right way for using the new cdns3-imx glue usb driver on a > > > imx8qm soc with linux-next. I added this snippet in imx8qm.dtsi and > > > enabled the driver in the kernel configuration. > > > > > > > Hi Oliver, > > > > I just checked linux-next-0326, there is no imx8qm dtsi. > > I'am currently using this series on top of linux-next-0214. > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork.kernel.org%2Fpatch%2F11248331%2F&data=02%7C01%7Cpeter.chen%40nxp.com%7C1b6963823b924b76684908d7d2344976%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637208994318640157&sdata=HGG4r65ROTeY54uQArcWTZGT9%2BLrr0kndwmDegULtDw%3D&reserved=0 > > > > When I worked this driver, I use a internal version > > based on v5.4, the dts layout is different with internal tree. > > I looked also at: > > https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsource.codeaurora.org%2Fexternal%2Fimx%2Flinux-imx%2Ftree%2Farch%2Farm64%2Fboot%2Fdts%2Ffreescale%2Fimx8-ss-conn.dtsi%3Fh%3Dimx_5.4.3_2.0.0&data=02%7C01%7Cpeter.chen%40nxp.com%7C1b6963823b924b76684908d7d2344976%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C637208994318640157&sdata=yTiMWh5BpWdtA%2B8Vy06KeCvg2jPzlgPOmKaM3fmK%2F6w%3D&reserved=0 > > How do I adapt the usbotg3 for linux-next? I already ported some usb > related dependencies from imx8-ss-conn.dtsi. But the cdns3 core driver > is stucked at probe and currently I don't understand how the cdns3-imx glue > layer comes into play. > cdns3-imx is the parent device, the cdns3 core is the child device. The example dts like below: usb3_lpcg: clock-controller@5b280000 { compatible = "fsl,imx8qxp-lpcg"; reg = <0x5b280000 0x10000>; #clock-cells = <1>; bit-offset = <0 4 16 20 24 28>; clocks = <&clk IMX_SC_R_USB_2 IMX_SC_PM_CLK_PER>, <&clk IMX_SC_R_USB_2 IMX_SC_PM_CLK_MISC>, <&conn_ipg_clk>, <&conn_ipg_clk>, <&conn_ipg_clk>, <&clk IMX_SC_R_USB_2 IMX_SC_PM_CLK_MST_BUS>; clock-output-names = "usb3_app_clk", "usb3_lpm_clk", "usb3_ipg_clk", "usb3_core_pclk", "usb3_phy_clk", "usb3_aclk"; power-domains = <&pd IMX_SC_R_USB_2_PHY>; }; usbotg3: usb3@5b110000 { compatible = "fsl,imx8qm-usb3"; #address-cells = <1>; #size-cells = <1>; ranges; reg = <0x5B110000 0x10000>; clocks = <&usb3_lpcg 1>, <&usb3_lpcg 0>, <&usb3_lpcg 5>, <&usb3_lpcg 2>, <&usb3_lpcg 3>; clock-names = "usb3_lpm_clk", "usb3_bus_clk", "usb3_aclk", "usb3_ipg_clk", "usb3_core_pclk"; assigned-clocks = <&clk IMX_SC_R_USB_2 IMX_SC_PM_CLK_PER>, <&clk IMX_SC_R_USB_2 IMX_SC_PM_CLK_MISC>, <&clk IMX_SC_R_USB_2 IMX_SC_PM_CLK_MST_BUS>; assigned-clock-rates = <125000000>, <12000000>, <250000000>; power-domains = <&pd IMX_SC_R_USB_2>; status = "disabled"; usbotg3_cdns3: cdns3 { compatible = "cdns,usb3"; #address-cells = <1>; #size-cells = <1>; interrupt-parent = <&gic>; interrupts = <GIC_SPI 271 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 271 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 271 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "host", "peripheral", "otg"; reg = <0x5B130000 0x10000>, /* memory area for HOST registers */ <0x5B140000 0x10000>, /* memory area for DEVICE registers */ <0x5B120000 0x10000>; /* memory area for OTG/DRD registers */ reg-names = "xhci", "dev", "otg"; phys = <&usb3_phy>; phy-names = "cdns3,usb3-phy"; status = "disabled"; }; }; After kernel boots up, it neither at host mode nor device mode, you need to echo host or device to role-switch sys entry. -- Thanks, Peter Chen