xref: /freebsd/sys/contrib/device-tree/Bindings/net/cpsw.txt (revision b97ee269eae3cbaf35c18f51a459aea581c2a7dc)
1c66ec88fSEmmanuel VadotTI SoC Ethernet Switch Controller Device Tree Bindings
2c66ec88fSEmmanuel Vadot------------------------------------------------------
3c66ec88fSEmmanuel Vadot
4c66ec88fSEmmanuel VadotRequired properties:
5c66ec88fSEmmanuel Vadot- compatible		: Should be one of the below:-
6c66ec88fSEmmanuel Vadot			  "ti,cpsw" for backward compatible
7c66ec88fSEmmanuel Vadot			  "ti,am335x-cpsw" for AM335x controllers
8c66ec88fSEmmanuel Vadot			  "ti,am4372-cpsw" for AM437x controllers
9c66ec88fSEmmanuel Vadot			  "ti,dra7-cpsw" for DRA7x controllers
10c66ec88fSEmmanuel Vadot- reg			: physical base address and size of the cpsw
11c66ec88fSEmmanuel Vadot			  registers map
12c66ec88fSEmmanuel Vadot- interrupts		: property with a value describing the interrupt
13c66ec88fSEmmanuel Vadot			  number
14c66ec88fSEmmanuel Vadot- cpdma_channels 	: Specifies number of channels in CPDMA
15c66ec88fSEmmanuel Vadot- ale_entries		: Specifies No of entries ALE can hold
16c66ec88fSEmmanuel Vadot- bd_ram_size		: Specifies internal descriptor RAM size
17c66ec88fSEmmanuel Vadot- mac_control		: Specifies Default MAC control register content
18c66ec88fSEmmanuel Vadot			  for the specific platform
19c66ec88fSEmmanuel Vadot- slaves		: Specifies number for slaves
20c66ec88fSEmmanuel Vadot- active_slave		: Specifies the slave to use for time stamping,
21c66ec88fSEmmanuel Vadot			  ethtool and SIOCGMIIPHY
22c66ec88fSEmmanuel Vadot- cpsw-phy-sel		: Specifies the phandle to the CPSW phy mode selection
23*b97ee269SEmmanuel Vadot			  device. See also cpsw-phy-sel.txt for its binding.
24c66ec88fSEmmanuel Vadot			  Note that in legacy cases cpsw-phy-sel may be
25c66ec88fSEmmanuel Vadot			  a child device instead of a phandle
26c66ec88fSEmmanuel Vadot			  (DEPRECATED, use phys property instead).
27c66ec88fSEmmanuel Vadot
28c66ec88fSEmmanuel VadotOptional properties:
29c66ec88fSEmmanuel Vadot- ti,hwmods		: Must be "cpgmac0"
30c66ec88fSEmmanuel Vadot- dual_emac		: Specifies Switch to act as Dual EMAC
31c66ec88fSEmmanuel Vadot- syscon		: Phandle to the system control device node, which is
32c66ec88fSEmmanuel Vadot			  the control module device of the am33x
33c66ec88fSEmmanuel Vadot- mode-gpios		: Should be added if one/multiple gpio lines are
34c66ec88fSEmmanuel Vadot			  required to be driven so that cpsw data lines
35c66ec88fSEmmanuel Vadot			  can be connected to the phy via selective mux.
36c66ec88fSEmmanuel Vadot			  For example in dra72x-evm, pcf gpio has to be
37c66ec88fSEmmanuel Vadot			  driven low so that cpsw slave 0 and phy data
38c66ec88fSEmmanuel Vadot			  lines are connected via mux.
39c66ec88fSEmmanuel Vadot- cpts_clock_mult	: Numerator to convert input clock ticks into nanoseconds
40c66ec88fSEmmanuel Vadot- cpts_clock_shift	: Denominator to convert input clock ticks into nanoseconds
41c66ec88fSEmmanuel Vadot			  Mult and shift will be calculated basing on CPTS
42c66ec88fSEmmanuel Vadot			  rftclk frequency if both cpts_clock_shift and
43c66ec88fSEmmanuel Vadot			  cpts_clock_mult properties are not provided.
44c66ec88fSEmmanuel Vadot
45c66ec88fSEmmanuel VadotSlave Properties:
46c66ec88fSEmmanuel VadotRequired properties:
47c66ec88fSEmmanuel Vadot- phy-mode		: See ethernet.txt file in the same directory
48c66ec88fSEmmanuel Vadot- phys			: phandle on phy-gmii-sel PHY (see phy/ti-phy-gmii-sel.txt)
49c66ec88fSEmmanuel Vadot
50c66ec88fSEmmanuel VadotOptional properties:
51c66ec88fSEmmanuel Vadot- dual_emac_res_vlan	: Specifies VID to be used to segregate the ports
52c66ec88fSEmmanuel Vadot- phy_id		: Specifies slave phy id (deprecated, use phy-handle)
53c66ec88fSEmmanuel Vadot- phy-handle		: See ethernet.txt file in the same directory
54c66ec88fSEmmanuel Vadot
55c66ec88fSEmmanuel VadotThe MAC address will be determined using the optional properties
56c66ec88fSEmmanuel Vadotdefined in ethernet.txt.
57c66ec88fSEmmanuel Vadot
58c66ec88fSEmmanuel VadotSlave sub-nodes:
59c66ec88fSEmmanuel Vadot- fixed-link		: See fixed-link.txt file in the same directory
60c66ec88fSEmmanuel Vadot
61c66ec88fSEmmanuel VadotNote: Exactly one of phy_id, phy-handle, or fixed-link must be specified.
62c66ec88fSEmmanuel Vadot
63c66ec88fSEmmanuel VadotNote: "ti,hwmods" field is used to fetch the base address and irq
64c66ec88fSEmmanuel Vadotresources from TI, omap hwmod data base during device registration.
65c66ec88fSEmmanuel VadotFuture plan is to migrate hwmod data base contents into device tree
66c66ec88fSEmmanuel Vadotblob so that, all the required data will be used from device tree dts
67c66ec88fSEmmanuel Vadotfile.
68c66ec88fSEmmanuel Vadot
69c66ec88fSEmmanuel VadotExamples:
70c66ec88fSEmmanuel Vadot
71c66ec88fSEmmanuel Vadot	mac: ethernet@4a100000 {
72c66ec88fSEmmanuel Vadot		compatible = "ti,cpsw";
73c66ec88fSEmmanuel Vadot		reg = <0x4A100000 0x1000>;
74c66ec88fSEmmanuel Vadot		interrupts = <55 0x4>;
75c66ec88fSEmmanuel Vadot		interrupt-parent = <&intc>;
76c66ec88fSEmmanuel Vadot		cpdma_channels = <8>;
77c66ec88fSEmmanuel Vadot		ale_entries = <1024>;
78c66ec88fSEmmanuel Vadot		bd_ram_size = <0x2000>;
79c66ec88fSEmmanuel Vadot		rx_descs = <64>;
80c66ec88fSEmmanuel Vadot		mac_control = <0x20>;
81c66ec88fSEmmanuel Vadot		slaves = <2>;
82c66ec88fSEmmanuel Vadot		active_slave = <0>;
83c66ec88fSEmmanuel Vadot		cpts_clock_mult = <0x80000000>;
84c66ec88fSEmmanuel Vadot		cpts_clock_shift = <29>;
85c66ec88fSEmmanuel Vadot		syscon = <&cm>;
86c66ec88fSEmmanuel Vadot		cpsw-phy-sel = <&phy_sel>;
87c66ec88fSEmmanuel Vadot		cpsw_emac0: slave@0 {
88c66ec88fSEmmanuel Vadot			phy_id = <&davinci_mdio>, <0>;
89c66ec88fSEmmanuel Vadot			phy-mode = "rgmii-txid";
90c66ec88fSEmmanuel Vadot			/* Filled in by U-Boot */
91c66ec88fSEmmanuel Vadot			mac-address = [ 00 00 00 00 00 00 ];
92c66ec88fSEmmanuel Vadot			phys = <&phy_gmii_sel 1 0>;
93c66ec88fSEmmanuel Vadot		};
94c66ec88fSEmmanuel Vadot		cpsw_emac1: slave@1 {
95c66ec88fSEmmanuel Vadot			phy_id = <&davinci_mdio>, <1>;
96c66ec88fSEmmanuel Vadot			phy-mode = "rgmii-txid";
97c66ec88fSEmmanuel Vadot			/* Filled in by U-Boot */
98c66ec88fSEmmanuel Vadot			mac-address = [ 00 00 00 00 00 00 ];
99c66ec88fSEmmanuel Vadot			phys = <&phy_gmii_sel 2 0>;
100c66ec88fSEmmanuel Vadot		};
101c66ec88fSEmmanuel Vadot	};
102c66ec88fSEmmanuel Vadot
103c66ec88fSEmmanuel Vadot(or)
104c66ec88fSEmmanuel Vadot	mac: ethernet@4a100000 {
105c66ec88fSEmmanuel Vadot		compatible = "ti,cpsw";
106c66ec88fSEmmanuel Vadot		ti,hwmods = "cpgmac0";
107c66ec88fSEmmanuel Vadot		cpdma_channels = <8>;
108c66ec88fSEmmanuel Vadot		ale_entries = <1024>;
109c66ec88fSEmmanuel Vadot		bd_ram_size = <0x2000>;
110c66ec88fSEmmanuel Vadot		rx_descs = <64>;
111c66ec88fSEmmanuel Vadot		mac_control = <0x20>;
112c66ec88fSEmmanuel Vadot		slaves = <2>;
113c66ec88fSEmmanuel Vadot		active_slave = <0>;
114c66ec88fSEmmanuel Vadot		cpts_clock_mult = <0x80000000>;
115c66ec88fSEmmanuel Vadot		cpts_clock_shift = <29>;
116c66ec88fSEmmanuel Vadot		syscon = <&cm>;
117c66ec88fSEmmanuel Vadot		cpsw-phy-sel = <&phy_sel>;
118c66ec88fSEmmanuel Vadot		cpsw_emac0: slave@0 {
119c66ec88fSEmmanuel Vadot			phy_id = <&davinci_mdio>, <0>;
120c66ec88fSEmmanuel Vadot			phy-mode = "rgmii-txid";
121c66ec88fSEmmanuel Vadot			/* Filled in by U-Boot */
122c66ec88fSEmmanuel Vadot			mac-address = [ 00 00 00 00 00 00 ];
123c66ec88fSEmmanuel Vadot			phys = <&phy_gmii_sel 1 0>;
124c66ec88fSEmmanuel Vadot		};
125c66ec88fSEmmanuel Vadot		cpsw_emac1: slave@1 {
126c66ec88fSEmmanuel Vadot			phy_id = <&davinci_mdio>, <1>;
127c66ec88fSEmmanuel Vadot			phy-mode = "rgmii-txid";
128c66ec88fSEmmanuel Vadot			/* Filled in by U-Boot */
129c66ec88fSEmmanuel Vadot			mac-address = [ 00 00 00 00 00 00 ];
130c66ec88fSEmmanuel Vadot			phys = <&phy_gmii_sel 2 0>;
131c66ec88fSEmmanuel Vadot		};
132c66ec88fSEmmanuel Vadot	};
133