Device Tree
A DTS/DTSI file is used to store all the device tree configuration.
The device tree of USB is stored in the following path:
linux-5.15/arch/riscv/boot/dts/starfive/
The following is an example of the USB configuration in the file
jh7110-common.dtsi.
&usbdrd30 { pinctrl-names = "default"; pinctrl-0 = <&usb_pins>; dr_mode = "host"; /*host or peripheral*/ status = "disabled"; };
The following is an example of the USB configuration in the file
jh7110.dtsi.
usbdrd30: usbdrd{ compatible = "starfive,jh7110-cdns3"; reg = <0x0 0x10210000 0x0 0x1000>, <0x0 0x10200000 0x0 0x1000>; clocks = <&clkgen JH7110_USB_125M>, <&clkgen JH7110_USB0_CLK_APP_125>, <&clkgen JH7110_USB0_CLK_LPM>, <&clkgen JH7110_USB0_CLK_STB>, <&clkgen JH7110_USB0_CLK_USB_APB>, <&clkgen JH7110_USB0_CLK_AXI>, <&clkgen JH7110_USB0_CLK_UTMI_APB>, <&clkgen JH7110_PCIE0_CLK_APB>; clock-names = "125m","app","lpm","stb","apb","axi","utmi", "phy"; resets = <&rstgen RSTN_U0_CDN_USB_PWRUP>, <&rstgen RSTN_U0_CDN_USB_APB>, <&rstgen RSTN_U0_CDN_USB_AXI>, <&rstgen RSTN_U0_CDN_USB_UTMI_APB>, <&rstgen RSTN_U0_PLDA_PCIE_APB>; reset-names = "pwrup","apb","axi","utmi", "phy"; starfive,stg-syscon = <&stg_syscon 0x4 0xc4 0x148 0x1f4>; starfive,sys-syscon = <&sys_syscon 0x18>; status = "disabled"; #address-cells = <2>; #size-cells = <2>; #interrupt-cells = <1>; ranges; usbdrd_cdns3: usb@10100000 { compatible = "cdns,usb3"; reg = <0x0 0x10100000 0x0 0x10000>, <0x0 0x10110000 0x0 0x10000>, <0x0 0x10120000 0x0 0x10000>; reg-names = "otg", "xhci", "dev"; interrupts = <100>, <108>, <110>; interrupt-names = "host", "peripheral", "otg"; phy-names = "cdns3,usb3-phy", "cnds3,usb2-phy"; maximum-speed = "super-speed"; }; };
The following list provides an example of the parameters contained in the code block
above.
- reg: The basic address and the max offset of the module.
- clocks: The clocks used by the module. Usually, this parameter is filled with the system clock source or the clock of the module.
- resets: The reset items used by the module.
- starfive,stg-syscon: The register values for the StarFive STG SYSCON control registers.
- starfive,sys-syscon: The register values for the StarFive SYS SYSCON control registers.
- status: The status of the module.
- okay: The module is enabled.
- disabled: The module is disabled.
- other: Other parameters for USB registration and association.