summaryrefslogtreecommitdiff
path: root/Documentation/devicetree/bindings/net/cpsw.txt
blob: ef655f386b2eb20adf194e7e160b45875686ba83 (plain)
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
TI SoC Ethernet Switch Controller Device Tree Bindings
------------------------------------------------------

Required properties:
- compatible		: Should be one of the below:-
			  "ti,cpsw" for backward compatible
			  "ti,am335x-cpsw" for AM335x controllers
			  "ti,am4372-cpsw" for AM437x controllers
			  "ti,dra7-cpsw" for DRA7x controllers
- reg			: physical base address and size of the cpsw
			  registers map
- interrupts		: property with a value describing the interrupt
			  number
- cpdma_channels 	: Specifies number of channels in CPDMA
- ale_entries		: Specifies No of entries ALE can hold
- bd_ram_size		: Specifies internal descriptor RAM size
- mac_control		: Specifies Default MAC control register content
			  for the specific platform
- slaves		: Specifies number for slaves
- active_slave		: Specifies the slave to use for time stamping,
			  ethtool and SIOCGMIIPHY
- cpsw-phy-sel		: Specifies the phandle to the CPSW phy mode selection
			  device. See also cpsw-phy-sel.txt for its binding.
			  Note that in legacy cases cpsw-phy-sel may be
			  a child device instead of a phandle
			  (DEPRECATED, use phys property instead).

Optional properties:
- ti,hwmods		: Must be "cpgmac0"
- dual_emac		: Specifies Switch to act as Dual EMAC
- syscon		: Phandle to the system control device node, which is
			  the control module device of the am33x
- mode-gpios		: Should be added if one/multiple gpio lines are
			  required to be driven so that cpsw data lines
			  can be connected to the phy via selective mux.
			  For example in dra72x-evm, pcf gpio has to be
			  driven low so that cpsw slave 0 and phy data
			  lines are connected via mux.
- cpts_clock_mult	: Numerator to convert input clock ticks into nanoseconds
- cpts_clock_shift	: Denominator to convert input clock ticks into nanoseconds
			  Mult and shift will be calculated basing on CPTS
			  rftclk frequency if both cpts_clock_shift and
			  cpts_clock_mult properties are not provided.

Slave Properties:
Required properties:
- phy-mode		: See ethernet.txt file in the same directory
- phys			: phandle on phy-gmii-sel PHY (see phy/ti-phy-gmii-sel.txt)

Optional properties:
- dual_emac_res_vlan	: Specifies VID to be used to segregate the ports
- phy_id		: Specifies slave phy id (deprecated, use phy-handle)
- phy-handle		: See ethernet.txt file in the same directory

The MAC address will be determined using the optional properties
defined in ethernet.txt.

Slave sub-nodes:
- fixed-link		: See fixed-link.txt file in the same directory

Note: Exactly one of phy_id, phy-handle, or fixed-link must be specified.

Note: "ti,hwmods" field is used to fetch the base address and irq
resources from TI, omap hwmod data base during device registration.
Future plan is to migrate hwmod data base contents into device tree
blob so that, all the required data will be used from device tree dts
file.

Examples:

	mac: ethernet@4a100000 {
		compatible = "ti,cpsw";
		reg = <0x4A100000 0x1000>;
		interrupts = <55 0x4>;
		interrupt-parent = <&intc>;
		cpdma_channels = <8>;
		ale_entries = <1024>;
		bd_ram_size = <0x2000>;
		rx_descs = <64>;
		mac_control = <0x20>;
		slaves = <2>;
		active_slave = <0>;
		cpts_clock_mult = <0x80000000>;
		cpts_clock_shift = <29>;
		syscon = <&cm>;
		cpsw-phy-sel = <&phy_sel>;
		cpsw_emac0: slave@0 {
			phy_id = <&davinci_mdio>, <0>;
			phy-mode = "rgmii-txid";
			/* Filled in by U-Boot */
			mac-address = [ 00 00 00 00 00 00 ];
			phys = <&phy_gmii_sel 1 0>;
		};
		cpsw_emac1: slave@1 {
			phy_id = <&davinci_mdio>, <1>;
			phy-mode = "rgmii-txid";
			/* Filled in by U-Boot */
			mac-address = [ 00 00 00 00 00 00 ];
			phys = <&phy_gmii_sel 2 0>;
		};
	};

(or)
	mac: ethernet@4a100000 {
		compatible = "ti,cpsw";
		ti,hwmods = "cpgmac0";
		cpdma_channels = <8>;
		ale_entries = <1024>;
		bd_ram_size = <0x2000>;
		rx_descs = <64>;
		mac_control = <0x20>;
		slaves = <2>;
		active_slave = <0>;
		cpts_clock_mult = <0x80000000>;
		cpts_clock_shift = <29>;
		syscon = <&cm>;
		cpsw-phy-sel = <&phy_sel>;
		cpsw_emac0: slave@0 {
			phy_id = <&davinci_mdio>, <0>;
			phy-mode = "rgmii-txid";
			/* Filled in by U-Boot */
			mac-address = [ 00 00 00 00 00 00 ];
			phys = <&phy_gmii_sel 1 0>;
		};
		cpsw_emac1: slave@1 {
			phy_id = <&davinci_mdio>, <1>;
			phy-mode = "rgmii-txid";
			/* Filled in by U-Boot */
			mac-address = [ 00 00 00 00 00 00 ];
			phys = <&phy_gmii_sel 2 0>;
		};
	};