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