1*7815b281SSiddharth Vadapalli// SPDX-License-Identifier: GPL-2.0
2*7815b281SSiddharth Vadapalli/**
3*7815b281SSiddharth Vadapalli * DT Overlay for CPSW9G in RGMII mode using J7 GESI EXP BRD board with
4*7815b281SSiddharth Vadapalli * J721E board.
5*7815b281SSiddharth Vadapalli *
6*7815b281SSiddharth Vadapalli * GESI Board Product Link: https://www.ti.com/tool/J7EXPCXEVM
7*7815b281SSiddharth Vadapalli *
8*7815b281SSiddharth Vadapalli * Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com/
9*7815b281SSiddharth Vadapalli */
10*7815b281SSiddharth Vadapalli
11*7815b281SSiddharth Vadapalli/dts-v1/;
12*7815b281SSiddharth Vadapalli/plugin/;
13*7815b281SSiddharth Vadapalli
14*7815b281SSiddharth Vadapalli#include <dt-bindings/gpio/gpio.h>
15*7815b281SSiddharth Vadapalli#include <dt-bindings/net/ti-dp83867.h>
16*7815b281SSiddharth Vadapalli
17*7815b281SSiddharth Vadapalli#include "k3-pinctrl.h"
18*7815b281SSiddharth Vadapalli
19*7815b281SSiddharth Vadapalli&{/} {
20*7815b281SSiddharth Vadapalli	aliases {
21*7815b281SSiddharth Vadapalli		ethernet1 = "/bus@100000/ethernet@c000000/ethernet-ports/port@1";
22*7815b281SSiddharth Vadapalli		ethernet2 = "/bus@100000/ethernet@c000000/ethernet-ports/port@2";
23*7815b281SSiddharth Vadapalli		ethernet3 = "/bus@100000/ethernet@c000000/ethernet-ports/port@3";
24*7815b281SSiddharth Vadapalli		ethernet4 = "/bus@100000/ethernet@c000000/ethernet-ports/port@4";
25*7815b281SSiddharth Vadapalli	};
26*7815b281SSiddharth Vadapalli};
27*7815b281SSiddharth Vadapalli
28*7815b281SSiddharth Vadapalli&cpsw0 {
29*7815b281SSiddharth Vadapalli	status = "okay";
30*7815b281SSiddharth Vadapalli	pinctrl-names = "default";
31*7815b281SSiddharth Vadapalli	pinctrl-0 = <&rgmii1_default_pins
32*7815b281SSiddharth Vadapalli		     &rgmii2_default_pins
33*7815b281SSiddharth Vadapalli		     &rgmii3_default_pins
34*7815b281SSiddharth Vadapalli		     &rgmii4_default_pins>;
35*7815b281SSiddharth Vadapalli};
36*7815b281SSiddharth Vadapalli
37*7815b281SSiddharth Vadapalli&cpsw0_port1 {
38*7815b281SSiddharth Vadapalli	status = "okay";
39*7815b281SSiddharth Vadapalli	phy-handle = <&cpsw9g_phy12>;
40*7815b281SSiddharth Vadapalli	phy-mode = "rgmii-rxid";
41*7815b281SSiddharth Vadapalli	mac-address = [00 00 00 00 00 00];
42*7815b281SSiddharth Vadapalli	phys = <&cpsw0_phy_gmii_sel 1>;
43*7815b281SSiddharth Vadapalli};
44*7815b281SSiddharth Vadapalli
45*7815b281SSiddharth Vadapalli&cpsw0_port2 {
46*7815b281SSiddharth Vadapalli	status = "okay";
47*7815b281SSiddharth Vadapalli	phy-handle = <&cpsw9g_phy15>;
48*7815b281SSiddharth Vadapalli	phy-mode = "rgmii-rxid";
49*7815b281SSiddharth Vadapalli	mac-address = [00 00 00 00 00 00];
50*7815b281SSiddharth Vadapalli	phys = <&cpsw0_phy_gmii_sel 2>;
51*7815b281SSiddharth Vadapalli};
52*7815b281SSiddharth Vadapalli
53*7815b281SSiddharth Vadapalli&cpsw0_port3 {
54*7815b281SSiddharth Vadapalli	status = "okay";
55*7815b281SSiddharth Vadapalli	phy-handle = <&cpsw9g_phy0>;
56*7815b281SSiddharth Vadapalli	phy-mode = "rgmii-rxid";
57*7815b281SSiddharth Vadapalli	mac-address = [00 00 00 00 00 00];
58*7815b281SSiddharth Vadapalli	phys = <&cpsw0_phy_gmii_sel 3>;
59*7815b281SSiddharth Vadapalli};
60*7815b281SSiddharth Vadapalli
61*7815b281SSiddharth Vadapalli&cpsw0_port4 {
62*7815b281SSiddharth Vadapalli	status = "okay";
63*7815b281SSiddharth Vadapalli	phy-handle = <&cpsw9g_phy3>;
64*7815b281SSiddharth Vadapalli	phy-mode = "rgmii-rxid";
65*7815b281SSiddharth Vadapalli	mac-address = [00 00 00 00 00 00];
66*7815b281SSiddharth Vadapalli	phys = <&cpsw0_phy_gmii_sel 4>;
67*7815b281SSiddharth Vadapalli};
68*7815b281SSiddharth Vadapalli
69*7815b281SSiddharth Vadapalli&cpsw9g_mdio {
70*7815b281SSiddharth Vadapalli	status = "okay";
71*7815b281SSiddharth Vadapalli	pinctrl-names = "default";
72*7815b281SSiddharth Vadapalli	pinctrl-0 = <&mdio0_default_pins>;
73*7815b281SSiddharth Vadapalli	bus_freq = <1000000>;
74*7815b281SSiddharth Vadapalli	#address-cells = <1>;
75*7815b281SSiddharth Vadapalli	#size-cells = <0>;
76*7815b281SSiddharth Vadapalli
77*7815b281SSiddharth Vadapalli	cpsw9g_phy0: ethernet-phy@0 {
78*7815b281SSiddharth Vadapalli		reg = <0>;
79*7815b281SSiddharth Vadapalli		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
80*7815b281SSiddharth Vadapalli		ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
81*7815b281SSiddharth Vadapalli		ti,min-output-impedance;
82*7815b281SSiddharth Vadapalli	};
83*7815b281SSiddharth Vadapalli	cpsw9g_phy3: ethernet-phy@3 {
84*7815b281SSiddharth Vadapalli		reg = <3>;
85*7815b281SSiddharth Vadapalli		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
86*7815b281SSiddharth Vadapalli		ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
87*7815b281SSiddharth Vadapalli		ti,min-output-impedance;
88*7815b281SSiddharth Vadapalli	};
89*7815b281SSiddharth Vadapalli	cpsw9g_phy12: ethernet-phy@12 {
90*7815b281SSiddharth Vadapalli		reg = <12>;
91*7815b281SSiddharth Vadapalli		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
92*7815b281SSiddharth Vadapalli		ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
93*7815b281SSiddharth Vadapalli		ti,min-output-impedance;
94*7815b281SSiddharth Vadapalli	};
95*7815b281SSiddharth Vadapalli	cpsw9g_phy15: ethernet-phy@15 {
96*7815b281SSiddharth Vadapalli		reg = <15>;
97*7815b281SSiddharth Vadapalli		ti,rx-internal-delay = <DP83867_RGMIIDCTL_2_00_NS>;
98*7815b281SSiddharth Vadapalli		ti,fifo-depth = <DP83867_PHYCR_FIFO_DEPTH_4_B_NIB>;
99*7815b281SSiddharth Vadapalli		ti,min-output-impedance;
100*7815b281SSiddharth Vadapalli	};
101*7815b281SSiddharth Vadapalli};
102*7815b281SSiddharth Vadapalli
103*7815b281SSiddharth Vadapalli&exp1 {
104*7815b281SSiddharth Vadapalli	p15-hog {
105*7815b281SSiddharth Vadapalli		/* P15 - EXP_MUX2 */
106*7815b281SSiddharth Vadapalli		gpio-hog;
107*7815b281SSiddharth Vadapalli		gpios = <13 GPIO_ACTIVE_HIGH>;
108*7815b281SSiddharth Vadapalli		output-high;
109*7815b281SSiddharth Vadapalli		line-name = "EXP_MUX2";
110*7815b281SSiddharth Vadapalli	};
111*7815b281SSiddharth Vadapalli
112*7815b281SSiddharth Vadapalli	p16-hog {
113*7815b281SSiddharth Vadapalli		/* P16 - EXP_MUX3 */
114*7815b281SSiddharth Vadapalli		gpio-hog;
115*7815b281SSiddharth Vadapalli		gpios = <14 GPIO_ACTIVE_HIGH>;
116*7815b281SSiddharth Vadapalli		output-high;
117*7815b281SSiddharth Vadapalli		line-name = "EXP_MUX3";
118*7815b281SSiddharth Vadapalli	};
119*7815b281SSiddharth Vadapalli};
120*7815b281SSiddharth Vadapalli
121*7815b281SSiddharth Vadapalli&main_pmx0 {
122*7815b281SSiddharth Vadapalli	mdio0_default_pins: mdio0-default-pins {
123*7815b281SSiddharth Vadapalli		pinctrl-single,pins = <
124*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x1bc, PIN_OUTPUT, 0) /* (V24) MDIO0_MDC */
125*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x1b8, PIN_INPUT, 0) /* (V26) MDIO0_MDIO */
126*7815b281SSiddharth Vadapalli		>;
127*7815b281SSiddharth Vadapalli	};
128*7815b281SSiddharth Vadapalli
129*7815b281SSiddharth Vadapalli	rgmii1_default_pins: rgmii1-default-pins {
130*7815b281SSiddharth Vadapalli		pinctrl-single,pins = <
131*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x4, PIN_INPUT, 4) /* (AC23) PRG1_PRU0_GPO0.RGMII1_RD0 */
132*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x8, PIN_INPUT, 4) /* (AG22) PRG1_PRU0_GPO1.RGMII1_RD1 */
133*7815b281SSiddharth Vadapalli			J721E_IOPAD(0xc, PIN_INPUT, 4) /* (AF22) PRG1_PRU0_GPO2.RGMII1_RD2 */
134*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x10, PIN_INPUT, 4) /* (AJ23) PRG1_PRU0_GPO3.RGMII1_RD3 */
135*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x1c, PIN_INPUT, 4) /* (AD22) PRG1_PRU0_GPO6.RGMII1_RXC */
136*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x14, PIN_INPUT, 4) /* (AH23) PRG1_PRU0_GPO4.RGMII1_RX_CTL */
137*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x30, PIN_OUTPUT, 4) /* (AF24) PRG1_PRU0_GPO11.RGMII1_TD0 */
138*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x34, PIN_OUTPUT, 4) /* (AJ24) PRG1_PRU0_GPO12.RGMII1_TD1 */
139*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x38, PIN_OUTPUT, 4) /* (AG24) PRG1_PRU0_GPO13.RGMII1_TD2 */
140*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x3c, PIN_OUTPUT, 4) /* (AD24) PRG1_PRU0_GPO14.RGMII1_TD3 */
141*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x44, PIN_OUTPUT, 4) /* (AE24) PRG1_PRU0_GPO16.RGMII1_TXC */
142*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x40, PIN_OUTPUT, 4) /* (AC24) PRG1_PRU0_GPO15.RGMII1_TX_CTL */
143*7815b281SSiddharth Vadapalli		>;
144*7815b281SSiddharth Vadapalli	};
145*7815b281SSiddharth Vadapalli
146*7815b281SSiddharth Vadapalli	rgmii2_default_pins: rgmii2-default-pins {
147*7815b281SSiddharth Vadapalli		pinctrl-single,pins = <
148*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x58, PIN_INPUT, 4) /* (AE22) PRG1_PRU1_GPO0.RGMII2_RD0 */
149*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x5c, PIN_INPUT, 4) /* (AG23) PRG1_PRU1_GPO1.RGMII2_RD1 */
150*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x60, PIN_INPUT, 4) /* (AF23) PRG1_PRU1_GPO2.RGMII2_RD2 */
151*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x64, PIN_INPUT, 4) /* (AD23) PRG1_PRU1_GPO3.RGMII2_RD3 */
152*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x70, PIN_INPUT, 4) /* (AE23) PRG1_PRU1_GPO6.RGMII2_RXC */
153*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x68, PIN_INPUT, 4) /* (AH24) PRG1_PRU1_GPO4.RGMII2_RX_CTL */
154*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x84, PIN_OUTPUT, 4) /* (AJ25) PRG1_PRU1_GPO11.RGMII2_TD0 */
155*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x88, PIN_OUTPUT, 4) /* (AH25) PRG1_PRU1_GPO12.RGMII2_TD1 */
156*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x8c, PIN_OUTPUT, 4) /* (AG25) PRG1_PRU1_GPO13.RGMII2_TD2 */
157*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x90, PIN_OUTPUT, 4) /* (AH26) PRG1_PRU1_GPO14.RGMII2_TD3 */
158*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x98, PIN_OUTPUT, 4) /* (AJ26) PRG1_PRU1_GPO16.RGMII2_TXC */
159*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x94, PIN_OUTPUT, 4) /* (AJ27) PRG1_PRU1_GPO15.RGMII2_TX_CTL */
160*7815b281SSiddharth Vadapalli		>;
161*7815b281SSiddharth Vadapalli	};
162*7815b281SSiddharth Vadapalli
163*7815b281SSiddharth Vadapalli	rgmii3_default_pins: rgmii3-default-pins {
164*7815b281SSiddharth Vadapalli		pinctrl-single,pins = <
165*7815b281SSiddharth Vadapalli			J721E_IOPAD(0xb0, PIN_INPUT, 4) /* (AF28) PRG0_PRU0_GPO0.RGMII3_RD0 */
166*7815b281SSiddharth Vadapalli			J721E_IOPAD(0xb4, PIN_INPUT, 4) /* (AE28) PRG0_PRU0_GPO1.RGMII3_RD1 */
167*7815b281SSiddharth Vadapalli			J721E_IOPAD(0xb8, PIN_INPUT, 4) /* (AE27) PRG0_PRU0_GPO2.RGMII3_RD2 */
168*7815b281SSiddharth Vadapalli			J721E_IOPAD(0xbc, PIN_INPUT, 4) /* (AD26) PRG0_PRU0_GPO3.RGMII3_RD3 */
169*7815b281SSiddharth Vadapalli			J721E_IOPAD(0xc8, PIN_INPUT, 4) /* (AE26) PRG0_PRU0_GPO6.RGMII3_RXC */
170*7815b281SSiddharth Vadapalli			J721E_IOPAD(0xc0, PIN_INPUT, 4) /* (AD25) PRG0_PRU0_GPO4.RGMII3_RX_CTL */
171*7815b281SSiddharth Vadapalli			J721E_IOPAD(0xdc, PIN_OUTPUT, 4) /* (AJ28) PRG0_PRU0_GPO11.RGMII3_TD0 */
172*7815b281SSiddharth Vadapalli			J721E_IOPAD(0xe0, PIN_OUTPUT, 4) /* (AH27) PRG0_PRU0_GPO12.RGMII3_TD1 */
173*7815b281SSiddharth Vadapalli			J721E_IOPAD(0xe4, PIN_OUTPUT, 4) /* (AH29) PRG0_PRU0_GPO13.RGMII3_TD2 */
174*7815b281SSiddharth Vadapalli			J721E_IOPAD(0xe8, PIN_OUTPUT, 4) /* (AG28) PRG0_PRU0_GPO14.RGMII3_TD3 */
175*7815b281SSiddharth Vadapalli			J721E_IOPAD(0xf0, PIN_OUTPUT, 4) /* (AH28) PRG0_PRU0_GPO16.RGMII3_TXC */
176*7815b281SSiddharth Vadapalli			J721E_IOPAD(0xec, PIN_OUTPUT, 4) /* (AG27) PRG0_PRU0_GPO15.RGMII3_TX_CTL */
177*7815b281SSiddharth Vadapalli		>;
178*7815b281SSiddharth Vadapalli	};
179*7815b281SSiddharth Vadapalli
180*7815b281SSiddharth Vadapalli	rgmii4_default_pins: rgmii4-default-pins {
181*7815b281SSiddharth Vadapalli		pinctrl-single,pins = <
182*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x100, PIN_INPUT, 4) /* (AE29) PRG0_PRU1_GPO0.RGMII4_RD0 */
183*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x104, PIN_INPUT, 4) /* (AD28) PRG0_PRU1_GPO1.RGMII4_RD1 */
184*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x108, PIN_INPUT, 4) /* (AD27) PRG0_PRU1_GPO2.RGMII4_RD2 */
185*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x10c, PIN_INPUT, 4) /* (AC25) PRG0_PRU1_GPO3.RGMII4_RD3 */
186*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x118, PIN_INPUT, 4) /* (AC26) PRG0_PRU1_GPO6.RGMII4_RXC */
187*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x110, PIN_INPUT, 4) /* (AD29) PRG0_PRU1_GPO4.RGMII4_RX_CTL */
188*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x12c, PIN_OUTPUT, 4) /* (AG26) PRG0_PRU1_GPO11.RGMII4_TD0 */
189*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x130, PIN_OUTPUT, 4) /* (AF27) PRG0_PRU1_GPO12.RGMII4_TD1 */
190*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x134, PIN_OUTPUT, 4) /* (AF26) PRG0_PRU1_GPO13.RGMII4_TD2 */
191*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x138, PIN_OUTPUT, 4) /* (AE25) PRG0_PRU1_GPO14.RGMII4_TD3 */
192*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x140, PIN_OUTPUT, 4) /* (AG29) PRG0_PRU1_GPO16.RGMII4_TXC */
193*7815b281SSiddharth Vadapalli			J721E_IOPAD(0x13c, PIN_OUTPUT, 4) /* (AF29) PRG0_PRU1_GPO15.RGMII4_TX_CTL */
194*7815b281SSiddharth Vadapalli		>;
195*7815b281SSiddharth Vadapalli	};
196*7815b281SSiddharth Vadapalli};
197