Skip to content

Commit

Permalink
dts: ti: k3-am62l: Enable USB0 and 1
Browse files Browse the repository at this point in the history
Add the USB 0 and 1 nodes so that we can use USB from linux.

Signed-off-by: Dhruva Gole <d-gole@ti.com>
  • Loading branch information
DhruvaG2000 committed Oct 23, 2024
1 parent c777ce9 commit 8fbdbe5
Show file tree
Hide file tree
Showing 3 changed files with 140 additions and 0 deletions.
65 changes: 65 additions & 0 deletions arch/arm64/boot/dts/ti/k3-am62l-main.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@
status = "disabled";
};

main_i2c2: i2c@20020000 {
compatible = "ti,am64-i2c", "ti,omap4-i2c";
reg = <0x00 0x20020000 0x00 0x100>;
interrupts = <GIC_SPI 66 IRQ_TYPE_LEVEL_HIGH>;
#address-cells = <1>;
#size-cells = <0>;
power-domains = <&scmi_pds 55>;
clocks = <&scmi_clk 254>;
clock-names = "fck";
status = "disabled";
};

main_gpio0: gpio@600000 {
compatible = "ti,am64-gpio", "ti,keystone-gpio";
reg = <0x00 0x00600000 0x00 0x100>;
Expand Down Expand Up @@ -282,4 +294,57 @@
bosch,mram-cfg = <0x0 128 64 64 64 64 32 32>;
status = "disabled";
};

usbss0: dwc3-usb@f900000 {
compatible = "ti,am62-usb";
reg = <0x00 0x0f900000 0x00 0x800>,
<0x00 0x0f908000 0x00 0x400>;
clocks = <&scmi_clk 329>;
clock-names = "ref";
ti,syscon-phy-pll-refclk = <&usb0_phy_ctrl 0x0>;
#address-cells = <2>;
#size-cells = <2>;
power-domains = <&scmi_pds 95>;
ranges;
status = "disabled";

usb0: usb@31000000 {
compatible = "snps,dwc3";
reg = <0x00 0x31000000 0x00 0x50000>;
interrupts = <GIC_SPI 215 IRQ_TYPE_LEVEL_HIGH>, /* irq.0 */
<GIC_SPI 215 IRQ_TYPE_LEVEL_HIGH>; /* irq.0 */
interrupt-names = "host", "peripheral";
maximum-speed = "high-speed";
dr_mode = "otg";
snps,usb2-gadget-lpm-disable;
snps,usb2-lpm-disable;
};
};

usbss1: dwc3-usb@f910000 {
compatible = "ti,am62-usb";
reg = <0x00 0x0f910000 0x00 0x800>,
<0x00 0x0f918000 0x00 0x400>;
clocks = <&scmi_clk 336>;
clock-names = "ref";
ti,syscon-phy-pll-refclk = <&usb1_phy_ctrl 0x0>;
#address-cells = <2>;
#size-cells = <2>;
power-domains = <&scmi_pds 96>;
ranges;
status = "disabled";

usb1: usb@31100000 {
compatible = "snps,dwc3";
reg = <0x00 0x31100000 0x00 0x50000>;
interrupts = <GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>, /* irq.0 */
<GIC_SPI 225 IRQ_TYPE_LEVEL_HIGH>; /* irq.0 */
interrupt-names = "host", "peripheral";
maximum-speed = "high-speed";
dr_mode = "otg";
snps,usb2-gadget-lpm-disable;
snps,usb2-lpm-disable;
};
};

};
10 changes: 10 additions & 0 deletions arch/arm64/boot/dts/ti/k3-am62l-wakeup.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@
compatible = "ti,am654-chipid";
reg = <0x14 0x4>;
};

usb0_phy_ctrl: syscon@4000 {
compatible = "ti,am62-usb-phy-ctrl", "syscon";
reg = <0x4000 0x4>;
};

usb1_phy_ctrl: syscon@4004 {
compatible = "ti,am62-usb-phy-ctrl", "syscon";
reg = <0x4004 0x4>;
};
};

pinmux: pinctrl@4084000 {
Expand Down
65 changes: 65 additions & 0 deletions arch/arm64/boot/dts/ti/k3-am62l3-evm.dts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
serial2 = &main_uart0;
mmc0 = &sdhci0;
mmc1 = &sdhci1;
usb0 = &usb0;
usb1 = &usb1;
};

chosen {
Expand Down Expand Up @@ -200,6 +202,16 @@
usr_led_pins_default: usr-led-pins-default {
pinctrl-single,pins = <
AM62PX_IOPAD(0x0238, PIN_OUTPUT, 7) /* (D24) MMC1_SDWP.GPIO0_123 */

main_i2c2_pins_default: main-i2c2-default-pins {
pinctrl-single,pins = <
AM62PX_IOPAD(0x01dc, PIN_INPUT_PULLUP, 0) /* (B8) I2C2_SCL */
AM62PX_IOPAD(0x01e0, PIN_INPUT_PULLUP, 0) /* (D8) I2C2_SDA */
>;
};
main_usb1_pins_default: main-usb1-default-pins {
pinctrl-single,pins = <
AM62PX_IOPAD(0x0248, PIN_OUTPUT, 0) /* (A5) USB1_DRVVBUS */
>;
};
};
Expand Down Expand Up @@ -433,3 +445,56 @@
pinctrl-0 = <&main_mcan2_pins_default>;
status = "okay";
};

&main_i2c2 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&main_i2c2_pins_default>;
clock-frequency = <400000>;

typec_pd0: tps6598x@3f {
compatible = "ti,tps6598x";
reg = <0x3f>;

connector {
compatible = "usb-c-connector";
label = "USB-C";
self-powered;
data-role = "dual";
power-role = "sink";
port {
usb_con_hs: endpoint {
remote-endpoint = <&usb0_hs_ep>;
};
};
};
};

};

&usbss0 {
status = "okay";
ti,vbus-divider;
};

&usb0 {
bootph-all;
usb-role-switch;

port {
usb0_hs_ep: endpoint {
remote-endpoint = <&usb_con_hs>;
};
};
};

&usbss1 {
status = "okay";
ti,vbus-divider;
};

&usb1 {
dr_mode = "host";
pinctrl-names = "default";
pinctrl-0 = <&main_usb1_pins_default>;
};

0 comments on commit 8fbdbe5

Please sign in to comment.