xref: /linux/Documentation/devicetree/bindings/net/cpsw.txt (revision 0eea505058740aa45486145296ef4fefbd8cab85)
1TI SoC Ethernet Switch Controller Device Tree Bindings
2------------------------------------------------------
3
4Required properties:
5- compatible		: Should be one of the below:-
6			  "ti,cpsw" for backward compatible
7			  "ti,am335x-cpsw" for AM335x controllers
8			  "ti,am4372-cpsw" for AM437x controllers
9			  "ti,dra7-cpsw" for DRA7x controllers
10- reg			: physical base address and size of the cpsw
11			  registers map
12- interrupts		: property with a value describing the interrupt
13			  number
14- interrupt-parent	: The parent interrupt controller
15- cpdma_channels 	: Specifies number of channels in CPDMA
16- ale_entries		: Specifies No of entries ALE can hold
17- bd_ram_size		: Specifies internal descriptor RAM size
18- rx_descs		: Specifies number of Rx descriptors
19- mac_control		: Specifies Default MAC control register content
20			  for the specific platform
21- slaves		: Specifies number for slaves
22- active_slave		: Specifies the slave to use for time stamping,
23			  ethtool and SIOCGMIIPHY
24- cpts_clock_mult	: Numerator to convert input clock ticks into nanoseconds
25- cpts_clock_shift	: Denominator to convert input clock ticks into nanoseconds
26
27Optional properties:
28- ti,hwmods		: Must be "cpgmac0"
29- no_bd_ram		: Must be 0 or 1
30- dual_emac		: Specifies Switch to act as Dual EMAC
31- syscon		: Phandle to the system control device node, which is
32			  the control module device of the am33x
33- mode-gpios		: Should be added if one/multiple gpio lines are
34			  required to be driven so that cpsw data lines
35			  can be connected to the phy via selective mux.
36			  For example in dra72x-evm, pcf gpio has to be
37			  driven low so that cpsw slave 0 and phy data
38			  lines are connected via mux.
39
40
41Slave Properties:
42Required properties:
43- phy_id		: Specifies slave phy id
44- phy-mode		: See ethernet.txt file in the same directory
45
46Optional properties:
47- dual_emac_res_vlan	: Specifies VID to be used to segregate the ports
48- mac-address		: See ethernet.txt file in the same directory
49- phy-handle		: See ethernet.txt file in the same directory
50
51Slave sub-nodes:
52- fixed-link		: See fixed-link.txt file in the same directory
53			  Either the properties phy_id and phy-mode,
54			  or the sub-node fixed-link can be specified
55
56Note: "ti,hwmods" field is used to fetch the base address and irq
57resources from TI, omap hwmod data base during device registration.
58Future plan is to migrate hwmod data base contents into device tree
59blob so that, all the required data will be used from device tree dts
60file.
61
62Examples:
63
64	mac: ethernet@4A100000 {
65		compatible = "ti,cpsw";
66		reg = <0x4A100000 0x1000>;
67		interrupts = <55 0x4>;
68		interrupt-parent = <&intc>;
69		cpdma_channels = <8>;
70		ale_entries = <1024>;
71		bd_ram_size = <0x2000>;
72		no_bd_ram = <0>;
73		rx_descs = <64>;
74		mac_control = <0x20>;
75		slaves = <2>;
76		active_slave = <0>;
77		cpts_clock_mult = <0x80000000>;
78		cpts_clock_shift = <29>;
79		syscon = <&cm>;
80		cpsw_emac0: slave@0 {
81			phy_id = <&davinci_mdio>, <0>;
82			phy-mode = "rgmii-txid";
83			/* Filled in by U-Boot */
84			mac-address = [ 00 00 00 00 00 00 ];
85		};
86		cpsw_emac1: slave@1 {
87			phy_id = <&davinci_mdio>, <1>;
88			phy-mode = "rgmii-txid";
89			/* Filled in by U-Boot */
90			mac-address = [ 00 00 00 00 00 00 ];
91		};
92	};
93
94(or)
95	mac: ethernet@4A100000 {
96		compatible = "ti,cpsw";
97		ti,hwmods = "cpgmac0";
98		cpdma_channels = <8>;
99		ale_entries = <1024>;
100		bd_ram_size = <0x2000>;
101		no_bd_ram = <0>;
102		rx_descs = <64>;
103		mac_control = <0x20>;
104		slaves = <2>;
105		active_slave = <0>;
106		cpts_clock_mult = <0x80000000>;
107		cpts_clock_shift = <29>;
108		syscon = <&cm>;
109		cpsw_emac0: slave@0 {
110			phy_id = <&davinci_mdio>, <0>;
111			phy-mode = "rgmii-txid";
112			/* Filled in by U-Boot */
113			mac-address = [ 00 00 00 00 00 00 ];
114		};
115		cpsw_emac1: slave@1 {
116			phy_id = <&davinci_mdio>, <1>;
117			phy-mode = "rgmii-txid";
118			/* Filled in by U-Boot */
119			mac-address = [ 00 00 00 00 00 00 ];
120		};
121	};
122