Skip to content

Commit 2c2166e

Browse files
committed
Merge branch 'net-stmmac-dwc-qos-add-fsd-eqos-support'
Swathi says: ==================== net: stmmac: dwc-qos: Add FSD EQoS support FSD platform has two instances of EQoS IP, one is in FSYS0 block and another one is in PERIC block. This patch series add required DT binding and platform driver specific changes for the same. ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents e8f57a7 + ae7f6b3 commit 2c2166e

File tree

3 files changed

+128
-3
lines changed

3 files changed

+128
-3
lines changed

Documentation/devicetree/bindings/net/snps,dwmac.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ properties:
102102
- snps,dwxgmac-2.10
103103
- starfive,jh7100-dwmac
104104
- starfive,jh7110-dwmac
105+
- tesla,fsd-ethqos
105106
- thead,th1520-gmac
106107

107108
reg:
@@ -126,7 +127,7 @@ properties:
126127

127128
clocks:
128129
minItems: 1
129-
maxItems: 8
130+
maxItems: 10
130131
additionalItems: true
131132
items:
132133
- description: GMAC main clock
@@ -138,7 +139,7 @@ properties:
138139

139140
clock-names:
140141
minItems: 1
141-
maxItems: 8
142+
maxItems: 10
142143
additionalItems: true
143144
contains:
144145
enum:
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/net/tesla,fsd-ethqos.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: FSD Ethernet Quality of Service
8+
9+
maintainers:
10+
- Swathi K S <[email protected]>
11+
12+
description:
13+
Tesla ethernet devices based on dwmmac support Gigabit ethernet.
14+
15+
allOf:
16+
- $ref: snps,dwmac.yaml#
17+
18+
properties:
19+
compatible:
20+
const: tesla,fsd-ethqos
21+
22+
reg:
23+
maxItems: 1
24+
25+
interrupts:
26+
maxItems: 1
27+
28+
interrupt-names:
29+
items:
30+
- const: macirq
31+
32+
clocks:
33+
minItems: 5
34+
items:
35+
- description: PTP clock
36+
- description: Master bus clock
37+
- description: Slave bus clock
38+
- description: MAC TX clock
39+
- description: MAC RX clock
40+
- description: Master2 bus clock
41+
- description: Slave2 bus clock
42+
- description: RX MUX clock
43+
- description: PHY RX clock
44+
- description: PERIC RGMII clock
45+
46+
clock-names:
47+
minItems: 5
48+
items:
49+
- const: ptp_ref
50+
- const: master_bus
51+
- const: slave_bus
52+
- const: tx
53+
- const: rx
54+
- const: master2_bus
55+
- const: slave2_bus
56+
- const: eqos_rxclk_mux
57+
- const: eqos_phyrxclk
58+
- const: dout_peric_rgmii_clk
59+
60+
iommus:
61+
maxItems: 1
62+
63+
phy-mode:
64+
enum:
65+
- rgmii
66+
- rgmii-id
67+
- rgmii-rxid
68+
- rgmii-txid
69+
70+
required:
71+
- compatible
72+
- reg
73+
- interrupts
74+
- clocks
75+
- clock-names
76+
- iommus
77+
- phy-mode
78+
79+
unevaluatedProperties: false
80+
81+
examples:
82+
- |
83+
#include <dt-bindings/clock/fsd-clk.h>
84+
#include <dt-bindings/interrupt-controller/arm-gic.h>
85+
soc {
86+
#address-cells = <2>;
87+
#size-cells = <2>;
88+
ethernet1: ethernet@14300000 {
89+
compatible = "tesla,fsd-ethqos";
90+
reg = <0x0 0x14300000 0x0 0x10000>;
91+
interrupts = <GIC_SPI 176 IRQ_TYPE_LEVEL_HIGH>;
92+
interrupt-names = "macirq";
93+
clocks = <&clock_peric PERIC_EQOS_TOP_IPCLKPORT_CLK_PTP_REF_I>,
94+
<&clock_peric PERIC_EQOS_TOP_IPCLKPORT_ACLK_I>,
95+
<&clock_peric PERIC_EQOS_TOP_IPCLKPORT_HCLK_I>,
96+
<&clock_peric PERIC_EQOS_TOP_IPCLKPORT_RGMII_CLK_I>,
97+
<&clock_peric PERIC_EQOS_TOP_IPCLKPORT_CLK_RX_I>,
98+
<&clock_peric PERIC_BUS_D_PERIC_IPCLKPORT_EQOSCLK>,
99+
<&clock_peric PERIC_BUS_P_PERIC_IPCLKPORT_EQOSCLK>,
100+
<&clock_peric PERIC_EQOS_PHYRXCLK_MUX>,
101+
<&clock_peric PERIC_EQOS_PHYRXCLK>,
102+
<&clock_peric PERIC_DOUT_RGMII_CLK>;
103+
clock-names = "ptp_ref", "master_bus", "slave_bus","tx",
104+
"rx", "master2_bus", "slave2_bus", "eqos_rxclk_mux",
105+
"eqos_phyrxclk","dout_peric_rgmii_clk";
106+
assigned-clocks = <&clock_peric PERIC_EQOS_PHYRXCLK_MUX>,
107+
<&clock_peric PERIC_EQOS_PHYRXCLK>;
108+
assigned-clock-parents = <&clock_peric PERIC_EQOS_PHYRXCLK>;
109+
pinctrl-names = "default";
110+
pinctrl-0 = <&eth1_tx_clk>, <&eth1_tx_data>, <&eth1_tx_ctrl>,
111+
<&eth1_phy_intr>, <&eth1_rx_clk>, <&eth1_rx_data>,
112+
<&eth1_rx_ctrl>, <&eth1_mdio>;
113+
iommus = <&smmu_peric 0x0 0x1>;
114+
phy-mode = "rgmii-id";
115+
};
116+
};
117+
118+
...

drivers/net/ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,10 @@ static const struct dwc_eth_dwmac_data tegra_eqos_data = {
319319
.stmmac_clk_name = "slave_bus",
320320
};
321321

322+
static const struct dwc_eth_dwmac_data fsd_eqos_data = {
323+
.stmmac_clk_name = "slave_bus",
324+
};
325+
322326
static int dwc_eth_dwmac_probe(struct platform_device *pdev)
323327
{
324328
const struct dwc_eth_dwmac_data *data;
@@ -359,7 +363,8 @@ static int dwc_eth_dwmac_probe(struct platform_device *pdev)
359363
plat_dat->stmmac_clk = dwc_eth_find_clk(plat_dat,
360364
data->stmmac_clk_name);
361365

362-
ret = data->probe(pdev, plat_dat, &stmmac_res);
366+
if (data->probe)
367+
ret = data->probe(pdev, plat_dat, &stmmac_res);
363368
if (ret < 0) {
364369
dev_err_probe(&pdev->dev, ret, "failed to probe subdriver\n");
365370
clk_bulk_disable_unprepare(plat_dat->num_clks, plat_dat->clks);
@@ -400,6 +405,7 @@ static void dwc_eth_dwmac_remove(struct platform_device *pdev)
400405
static const struct of_device_id dwc_eth_dwmac_match[] = {
401406
{ .compatible = "snps,dwc-qos-ethernet-4.10", .data = &dwc_qos_data },
402407
{ .compatible = "nvidia,tegra186-eqos", .data = &tegra_eqos_data },
408+
{ .compatible = "tesla,fsd-ethqos", .data = &fsd_eqos_data },
403409
{ }
404410
};
405411
MODULE_DEVICE_TABLE(of, dwc_eth_dwmac_match);

0 commit comments

Comments
 (0)