aboutsummaryrefslogtreecommitdiffstats
blob: 44518ab69003759a91861be1efdb6d043a57c396 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
TI AM654 SoC Gigabit Ethernet Switch (CPSW) subsystem Device Tree Bindings
------------------------------------------------------

The TI am654 SoC Gigabit Ethernet Switch subsystem (CPSW NUSS) has two ports and
provides Ethernet packet communication for the device and can be configured
as an Ethernet switch. CPSW NUSS features: the Reduced Gigabit Media Independent
Interface (RGMII), Reduced Media Independent Interface (RMII), and the
Management Data Input/Output (MDIO) interface for physical layer device
(PHY) management.

The TI am654 SoC has integrated two-port Gigabit Ethernet Switch subsystem
into device MCU domain named MCU_CPSW0. One Ethernet port (port 1) with
selectable RGMII and RMII interfaces and an internal Communications
Port Programming Interface (CPPI) port (Host port 0).

Host Port 0 CPPI Packet Streaming Interface interface supports 8 TX channels
and on RX channels operating by TI am654 NAVSS Unified DMA Peripheral Root
Complex (UDMA-P) controller.

Required properties:
- compatible	: Should be "ti,am654-cpsw-nuss" or
		  "ti,j721e-cpsw-nuss"
- reg		: physical base address and size of the CPSW NUSS registers map
- reg-names	: should be "cpsw_nuss"

- clocks	: CPSW NUSS functional clock
- clock-names	: should be "fck"
		See Documentation/devicetree/bindings/clock/ti,sci-clk.txt
- power-domains : CPSW NUSS power domain
		See Documentation/devicetree/bindings/soc/ti/sci-pm-domain.txt

- interrupt-parent : The parent interrupt controller - should point on TI
		System Control Interface (TI-SCI) IRQCHIP phandle
		See Documentation/devicetree/bindings/interrupt-controller/ti,sci-irq.txt

- dma-coherent	: indicates that CPSW NUSS operates with coherent memory.
- dmas		: list of UDMA-P controller channels specifiers
- dma-names	: should be "tx0", "tx1", "tx2", "tx3", "tx4", "tx5", "tx6",
		"tx7", "rx";
- ti,psil-base : CPSW NUSS PSI-L endpoint thread ID base of the UDMA-P channels
		Within the PSI-L endpoint node thread configuration subnodes
		must present with ti,psil-configX naming convention,
		where X is the thread ID offset.
		See Documentation/devicetree/bindings/dma/ti/k3-udma.txt

Optional properties:
- ti,rx-flow-id-base : specifies fixed UDMA-P RX flow id offset to be used
		by RX CPPI DMA channel. It will be selected dynamically
		if not specified.

- syscon	: Phandle to the system control device node, which is
		the control module device of the am33x

Required Sub-nodes:
- ti,psil-config0..ti,psil-config7 : PSI-L endpoint node threads configuration
		subnodes

	Required properties:
	- linux,udma-mode : should be UDMA_PKT_MODE
	- statictr-type : should be PSIL_STATIC_TR_NONE
	- ti,needs-epib : CPSW NUSS provides/accepts EPIB with each packet
	- ti,psd-size	: CPSW NUSS provides/accepts 16 bytes of PS data with
			each packet

- ports	: contains CPSW NUSS ports descriptions
	Required properties - all ports:
	- reg : CPSW NUSS port number. Should be 0,1 for TI am654 SoC
		0 - Host port 0
		1.. - external Ethernet ports

	Optional properties - all ports:
	- ti,label : Describes the label associated with this port

	Required properties for - external Ethernet ports:
	- phy-mode : operation mode of the PHY interface [1]
	- phy-handle : phandle, specifies a reference to a node representing
		a PHY device [1]

	Optional properties for - external Ethernet ports:
	- ti,mac-only: port operates in MAC only mode
	- mac-address : array of 6 bytes, specifies the MAC address. Always
		accounted first if present [1]
	- ti,syscon-efuse: tuple of two cells. First is phandle on syscon System
		Control Module (SCM) node. Second is offset inside SCM points on
		efuse registers containing Ethernet MAC address.
		Accounted second if "mac-address" doesn't present.

- mdio : CPSW NUSS MDIO bus description
	- bus_freq : MDIO Bus frequency
	See Documentation/devicetree/bindings/net/mdio.txt

- cpsw-phy-sel: CPSW NUSS PHY mode Selection device description
	Documentation/devicetree/bindings/net/cpsw-phy-sel.txt

- cpts : The Common Platform Time Sync (CPTS) module description
	Documentation/devicetree/bindings/net/ti,am654-cpts.txt

[1] See Documentation/devicetree/bindings/net/ethernet.txt

Examples:

mcu_cpsw: cpsw_nuss@046000000 {
	compatible = "ti,am654-cpsw-nuss";
	#address-cells = <2>;
	#size-cells = <2>;
	reg = <0x0 0x46000000 0x0 0x200000>;
	reg-names = "cpsw_nuss";
	ranges;
	dma-coherent;
	clocks = <&k3_clks 5 10>;
	clock-names = "fck";
	power-domains = <&k3_pds 5>;
	ti,psil-base = <0x7000>;

	interrupt-parent = <&k3_irq>;

	dmas = <&mcu_udmap &mcu_cpsw 0 UDMA_DIR_TX>,
	       <&mcu_udmap &mcu_cpsw 1 UDMA_DIR_TX>,
	       <&mcu_udmap &mcu_cpsw 2 UDMA_DIR_TX>,
	       <&mcu_udmap &mcu_cpsw 3 UDMA_DIR_TX>,
	       <&mcu_udmap &mcu_cpsw 4 UDMA_DIR_TX>,
	       <&mcu_udmap &mcu_cpsw 5 UDMA_DIR_TX>,
	       <&mcu_udmap &mcu_cpsw 6 UDMA_DIR_TX>,
	       <&mcu_udmap &mcu_cpsw 7 UDMA_DIR_TX>,
	       <&mcu_udmap &mcu_cpsw 0 UDMA_DIR_RX>;
	dma-names = "tx0", "tx1", "tx2", "tx3",
		    "tx4", "tx5", "tx6", "tx7",
		    "rx";

	ports {
		#address-cells = <1>;
		#size-cells = <0>;

		host: host@0 {
			reg = <0>;
			ti,label = "host";
		};

		cpsw_port1: port@1 {
			reg = <1>;
			ti,mac-only;
			ti,label = "port1";
			ti,syscon-efuse = <&mcu_conf 0x200>;
		};
	};

	davinci_mdio: mdio {
		#address-cells = <1>;
		#size-cells = <0>;
		bus_freq = <1000000>;
	};

	phy_sel: cpsw-phy-sel@40f04040 {
		compatible = "ti,am654-cpsw-phy-sel";
		reg= <0x0 0x40f04040 0x0 0x4>;
		reg-names = "gmii-sel";
	};

	ti,psil-config0 {
		linux,udma-mode = <UDMA_PKT_MODE>;
		statictr-type = <PSIL_STATIC_TR_NONE>;
		ti,needs-epib;
		ti,psd-size = <16>;
	};

	ti,psil-config1 {
		linux,udma-mode = <UDMA_PKT_MODE>;
		statictr-type = <PSIL_STATIC_TR_NONE>;
		ti,needs-epib;
		ti,psd-size = <16>;
	};

	ti,psil-config2 {
		linux,udma-mode = <UDMA_PKT_MODE>;
		statictr-type = <PSIL_STATIC_TR_NONE>;
		ti,needs-epib;
		ti,psd-size = <16>;
	};

	ti,psil-config3 {
		linux,udma-mode = <UDMA_PKT_MODE>;
		statictr-type = <PSIL_STATIC_TR_NONE>;
		ti,needs-epib;
		ti,psd-size = <16>;
	};

	ti,psil-config4 {
		linux,udma-mode = <UDMA_PKT_MODE>;
		statictr-type = <PSIL_STATIC_TR_NONE>;
		ti,needs-epib;
		ti,psd-size = <16>;
	};

	ti,psil-config5 {
		linux,udma-mode = <UDMA_PKT_MODE>;
		statictr-type = <PSIL_STATIC_TR_NONE>;
		ti,needs-epib;
		ti,psd-size = <16>;
	};

	ti,psil-config6 {
		linux,udma-mode = <UDMA_PKT_MODE>;
		statictr-type = <PSIL_STATIC_TR_NONE>;
		ti,needs-epib;
		ti,psd-size = <16>;
	};

	ti,psil-config7 {
		linux,udma-mode = <UDMA_PKT_MODE>;
		statictr-type = <PSIL_STATIC_TR_NONE>;
		ti,needs-epib;
		ti,psd-size = <16>;
	};
};