18c2ecf20Sopenharmony_ci* Synopsys DWC Ethernet QoS IP version 4.10 driver (GMAC)
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciThis binding is deprecated, but it continues to be supported, but new
48c2ecf20Sopenharmony_cifeatures should be preferably added to the stmmac binding document.
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ciThis binding supports the Synopsys Designware Ethernet QoS (Quality Of Service)
78c2ecf20Sopenharmony_ciIP block. The IP supports multiple options for bus type, clocking and reset
88c2ecf20Sopenharmony_cistructure, and feature list. Consequently, a number of properties and list
98c2ecf20Sopenharmony_cientries in properties are marked as optional, or only required in specific HW
108c2ecf20Sopenharmony_ciconfigurations.
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ciRequired properties:
138c2ecf20Sopenharmony_ci- compatible: One of:
148c2ecf20Sopenharmony_ci  - "axis,artpec6-eqos", "snps,dwc-qos-ethernet-4.10"
158c2ecf20Sopenharmony_ci    Represents the IP core when integrated into the Axis ARTPEC-6 SoC.
168c2ecf20Sopenharmony_ci  - "nvidia,tegra186-eqos", "snps,dwc-qos-ethernet-4.10"
178c2ecf20Sopenharmony_ci    Represents the IP core when integrated into the NVIDIA Tegra186 SoC.
188c2ecf20Sopenharmony_ci  - "snps,dwc-qos-ethernet-4.10"
198c2ecf20Sopenharmony_ci    This combination is deprecated. It should be treated as equivalent to
208c2ecf20Sopenharmony_ci    "axis,artpec6-eqos", "snps,dwc-qos-ethernet-4.10". It is supported to be
218c2ecf20Sopenharmony_ci    compatible with earlier revisions of this binding.
228c2ecf20Sopenharmony_ci- reg: Address and length of the register set for the device
238c2ecf20Sopenharmony_ci- clocks: Phandle and clock specifiers for each entry in clock-names, in the
248c2ecf20Sopenharmony_ci  same order. See ../clock/clock-bindings.txt.
258c2ecf20Sopenharmony_ci- clock-names: May contain any/all of the following depending on the IP
268c2ecf20Sopenharmony_ci  configuration, in any order:
278c2ecf20Sopenharmony_ci  - "tx"
288c2ecf20Sopenharmony_ci    The EQOS transmit path clock. The HW signal name is clk_tx_i.
298c2ecf20Sopenharmony_ci    In some configurations (e.g. GMII/RGMII), this clock also drives the PHY TX
308c2ecf20Sopenharmony_ci    path. In other configurations, other clocks (such as tx_125, rmii) may
318c2ecf20Sopenharmony_ci    drive the PHY TX path.
328c2ecf20Sopenharmony_ci  - "rx"
338c2ecf20Sopenharmony_ci    The EQOS receive path clock. The HW signal name is clk_rx_i.
348c2ecf20Sopenharmony_ci    In some configurations (e.g. GMII/RGMII), this clock is derived from the
358c2ecf20Sopenharmony_ci    PHY's RX clock output. In other configurations, other clocks (such as
368c2ecf20Sopenharmony_ci    rx_125, rmii) may drive the EQOS RX path.
378c2ecf20Sopenharmony_ci    In cases where the PHY clock is directly fed into the EQOS receive path
388c2ecf20Sopenharmony_ci    without intervening logic, the DT need not represent this clock, since it
398c2ecf20Sopenharmony_ci    is assumed to be fully under the control of the PHY device/driver. In
408c2ecf20Sopenharmony_ci    cases where SoC integration adds additional logic to this path, such as a
418c2ecf20Sopenharmony_ci    SW-controlled clock gate, this clock should be represented in DT.
428c2ecf20Sopenharmony_ci  - "slave_bus"
438c2ecf20Sopenharmony_ci    The CPU/slave-bus (CSR) interface clock. This applies to any bus type;
448c2ecf20Sopenharmony_ci    APB, AHB, AXI, etc. The HW signal name is hclk_i (AHB) or clk_csr_i (other
458c2ecf20Sopenharmony_ci    buses).
468c2ecf20Sopenharmony_ci  - "master_bus"
478c2ecf20Sopenharmony_ci    The master bus interface clock. Only required in configurations that use a
488c2ecf20Sopenharmony_ci    separate clock for the master and slave bus interfaces. The HW signal name
498c2ecf20Sopenharmony_ci    is hclk_i (AHB) or aclk_i (AXI).
508c2ecf20Sopenharmony_ci  - "ptp_ref"
518c2ecf20Sopenharmony_ci    The PTP reference clock. The HW signal name is clk_ptp_ref_i.
528c2ecf20Sopenharmony_ci  - "phy_ref_clk"
538c2ecf20Sopenharmony_ci    This clock is deprecated and should not be used by new compatible values.
548c2ecf20Sopenharmony_ci    It is equivalent to "tx".
558c2ecf20Sopenharmony_ci  - "apb_pclk"
568c2ecf20Sopenharmony_ci    This clock is deprecated and should not be used by new compatible values.
578c2ecf20Sopenharmony_ci    It is equivalent to "slave_bus".
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_ci  Note: Support for additional IP configurations may require adding the
608c2ecf20Sopenharmony_ci  following clocks to this list in the future: clk_rx_125_i, clk_tx_125_i,
618c2ecf20Sopenharmony_ci  clk_pmarx_0_i, clk_pmarx1_i, clk_rmii_i, clk_revmii_rx_i, clk_revmii_tx_i.
628c2ecf20Sopenharmony_ci  Configurations exist where multiple similar clocks are used at once, e.g. all
638c2ecf20Sopenharmony_ci  of clk_rx_125_i, clk_pmarx_0_i, clk_pmarx1_i. For this reason it is best to
648c2ecf20Sopenharmony_ci  extend the binding with a separate clock-names entry for each of those RX
658c2ecf20Sopenharmony_ci  clocks, rather than repurposing the existing "rx" clock-names entry as a
668c2ecf20Sopenharmony_ci  generic/logical clock in a similar fashion to "master_bus" and "slave_bus".
678c2ecf20Sopenharmony_ci  This will allow easy support for configurations that support multiple PHY
688c2ecf20Sopenharmony_ci  interfaces using a mux, and hence need to have explicit control over
698c2ecf20Sopenharmony_ci  specific RX clocks.
708c2ecf20Sopenharmony_ci
718c2ecf20Sopenharmony_ci  The following compatible values require the following set of clocks:
728c2ecf20Sopenharmony_ci  - "nvidia,tegra186-eqos", "snps,dwc-qos-ethernet-4.10":
738c2ecf20Sopenharmony_ci    - "slave_bus"
748c2ecf20Sopenharmony_ci    - "master_bus"
758c2ecf20Sopenharmony_ci    - "rx"
768c2ecf20Sopenharmony_ci    - "tx"
778c2ecf20Sopenharmony_ci    - "ptp_ref"
788c2ecf20Sopenharmony_ci  - "axis,artpec6-eqos", "snps,dwc-qos-ethernet-4.10":
798c2ecf20Sopenharmony_ci    - "slave_bus"
808c2ecf20Sopenharmony_ci    - "master_bus"
818c2ecf20Sopenharmony_ci    - "tx"
828c2ecf20Sopenharmony_ci    - "ptp_ref"
838c2ecf20Sopenharmony_ci  - "snps,dwc-qos-ethernet-4.10" (deprecated):
848c2ecf20Sopenharmony_ci    - "phy_ref_clk"
858c2ecf20Sopenharmony_ci    - "apb_clk"
868c2ecf20Sopenharmony_ci- interrupts: Should contain the core's combined interrupt signal
878c2ecf20Sopenharmony_ci- phy-mode: See ethernet.txt file in the same directory
888c2ecf20Sopenharmony_ci- resets: Phandle and reset specifiers for each entry in reset-names, in the
898c2ecf20Sopenharmony_ci  same order. See ../reset/reset.txt.
908c2ecf20Sopenharmony_ci- reset-names: May contain any/all of the following depending on the IP
918c2ecf20Sopenharmony_ci  configuration, in any order:
928c2ecf20Sopenharmony_ci  - "eqos". The reset to the entire module. The HW signal name is hreset_n
938c2ecf20Sopenharmony_ci    (AHB) or aresetn_i (AXI).
948c2ecf20Sopenharmony_ci
958c2ecf20Sopenharmony_ci  The following compatible values require the following set of resets:
968c2ecf20Sopenharmony_ci  (the reset properties may be omitted if empty)
978c2ecf20Sopenharmony_ci  - "nvidia,tegra186-eqos", "snps,dwc-qos-ethernet-4.10":
988c2ecf20Sopenharmony_ci    - "eqos".
998c2ecf20Sopenharmony_ci  - "axis,artpec6-eqos", "snps,dwc-qos-ethernet-4.10":
1008c2ecf20Sopenharmony_ci    - None.
1018c2ecf20Sopenharmony_ci  - "snps,dwc-qos-ethernet-4.10" (deprecated):
1028c2ecf20Sopenharmony_ci    - None.
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ciOptional properties:
1058c2ecf20Sopenharmony_ci- dma-coherent: Present if dma operations are coherent
1068c2ecf20Sopenharmony_ci- phy-reset-gpios: Phandle and specifier for any GPIO used to reset the PHY.
1078c2ecf20Sopenharmony_ci  See ../gpio/gpio.txt.
1088c2ecf20Sopenharmony_ci- snps,en-lpi: If present it enables use of the AXI low-power interface
1098c2ecf20Sopenharmony_ci- snps,write-requests: Number of write requests that the AXI port can issue.
1108c2ecf20Sopenharmony_ci  It depends on the SoC configuration.
1118c2ecf20Sopenharmony_ci- snps,read-requests: Number of read requests that the AXI port can issue.
1128c2ecf20Sopenharmony_ci  It depends on the SoC configuration.
1138c2ecf20Sopenharmony_ci- snps,burst-map: Bitmap of allowed AXI burst lengts, with the LSB
1148c2ecf20Sopenharmony_ci  representing 4, then 8 etc.
1158c2ecf20Sopenharmony_ci- snps,txpbl: DMA Programmable burst length for the TX DMA
1168c2ecf20Sopenharmony_ci- snps,rxpbl: DMA Programmable burst length for the RX DMA
1178c2ecf20Sopenharmony_ci- snps,en-tx-lpi-clockgating: Enable gating of the MAC TX clock during
1188c2ecf20Sopenharmony_ci  TX low-power mode.
1198c2ecf20Sopenharmony_ci- phy-handle: See ethernet.txt file in the same directory
1208c2ecf20Sopenharmony_ci- mdio device tree subnode: When the GMAC has a phy connected to its local
1218c2ecf20Sopenharmony_ci    mdio, there must be device tree subnode with the following
1228c2ecf20Sopenharmony_ci    required properties:
1238c2ecf20Sopenharmony_ci    - compatible: Must be "snps,dwc-qos-ethernet-mdio".
1248c2ecf20Sopenharmony_ci    - #address-cells: Must be <1>.
1258c2ecf20Sopenharmony_ci    - #size-cells: Must be <0>.
1268c2ecf20Sopenharmony_ci
1278c2ecf20Sopenharmony_ci    For each phy on the mdio bus, there must be a node with the following
1288c2ecf20Sopenharmony_ci    fields:
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_ci    - reg: phy id used to communicate to phy.
1318c2ecf20Sopenharmony_ci    - device_type: Must be "ethernet-phy".
1328c2ecf20Sopenharmony_ci    - fixed-mode device tree subnode: see fixed-link.txt in the same directory
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ciThe MAC address will be determined using the optional properties
1358c2ecf20Sopenharmony_cidefined in ethernet.txt.
1368c2ecf20Sopenharmony_ci
1378c2ecf20Sopenharmony_ciExamples:
1388c2ecf20Sopenharmony_ciethernet2@40010000 {
1398c2ecf20Sopenharmony_ci	clock-names = "phy_ref_clk", "apb_pclk";
1408c2ecf20Sopenharmony_ci	clocks = <&clkc 17>, <&clkc 15>;
1418c2ecf20Sopenharmony_ci	compatible = "snps,dwc-qos-ethernet-4.10";
1428c2ecf20Sopenharmony_ci	interrupt-parent = <&intc>;
1438c2ecf20Sopenharmony_ci	interrupts = <0x0 0x1e 0x4>;
1448c2ecf20Sopenharmony_ci	reg = <0x40010000 0x4000>;
1458c2ecf20Sopenharmony_ci	phy-handle = <&phy2>;
1468c2ecf20Sopenharmony_ci	phy-mode = "gmii";
1478c2ecf20Sopenharmony_ci	phy-reset-gpios = <&gpioctlr 43 GPIO_ACTIVE_LOW>;
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ci	snps,en-tx-lpi-clockgating;
1508c2ecf20Sopenharmony_ci	snps,en-lpi;
1518c2ecf20Sopenharmony_ci	snps,write-requests = <2>;
1528c2ecf20Sopenharmony_ci	snps,read-requests = <16>;
1538c2ecf20Sopenharmony_ci	snps,burst-map = <0x7>;
1548c2ecf20Sopenharmony_ci	snps,txpbl = <8>;
1558c2ecf20Sopenharmony_ci	snps,rxpbl = <2>;
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci	dma-coherent;
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_ci	mdio {
1608c2ecf20Sopenharmony_ci		#address-cells = <0x1>;
1618c2ecf20Sopenharmony_ci		#size-cells = <0x0>;
1628c2ecf20Sopenharmony_ci		phy2: phy@1 {
1638c2ecf20Sopenharmony_ci			compatible = "ethernet-phy-ieee802.3-c22";
1648c2ecf20Sopenharmony_ci			device_type = "ethernet-phy";
1658c2ecf20Sopenharmony_ci			reg = <0x1>;
1668c2ecf20Sopenharmony_ci		};
1678c2ecf20Sopenharmony_ci	};
1688c2ecf20Sopenharmony_ci};
169