Skip to content

Commit 114508a

Browse files
inochisakuba-moo
authored andcommitted
dt-bindings: net: Add support for Sophgo SG2044 dwmac
The GMAC IP on SG2044 is almost a standard Synopsys DesignWare MAC (version 5.30a) with some extra clock. Add necessary compatible string for this device. Signed-off-by: Inochi Amaoto <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c8be701 commit 114508a

File tree

2 files changed

+130
-0
lines changed

2 files changed

+130
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ select:
3232
- snps,dwmac-4.20a
3333
- snps,dwmac-5.10a
3434
- snps,dwmac-5.20
35+
- snps,dwmac-5.30a
3536
- snps,dwxgmac
3637
- snps,dwxgmac-2.10
3738

@@ -98,8 +99,10 @@ properties:
9899
- snps,dwmac-4.20a
99100
- snps,dwmac-5.10a
100101
- snps,dwmac-5.20
102+
- snps,dwmac-5.30a
101103
- snps,dwxgmac
102104
- snps,dwxgmac-2.10
105+
- sophgo,sg2044-dwmac
103106
- starfive,jh7100-dwmac
104107
- starfive,jh7110-dwmac
105108
- tesla,fsd-ethqos
@@ -632,6 +635,7 @@ allOf:
632635
- snps,dwmac-4.20a
633636
- snps,dwmac-5.10a
634637
- snps,dwmac-5.20
638+
- snps,dwmac-5.30a
635639
- snps,dwxgmac
636640
- snps,dwxgmac-2.10
637641
- st,spear600-gmac
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/net/sophgo,sg2044-dwmac.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Sophgo SG2044 DWMAC glue layer
8+
9+
maintainers:
10+
- Inochi Amaoto <[email protected]>
11+
12+
select:
13+
properties:
14+
compatible:
15+
contains:
16+
enum:
17+
- sophgo,sg2044-dwmac
18+
required:
19+
- compatible
20+
21+
properties:
22+
compatible:
23+
items:
24+
- const: sophgo,sg2044-dwmac
25+
- const: snps,dwmac-5.30a
26+
27+
reg:
28+
maxItems: 1
29+
30+
clocks:
31+
items:
32+
- description: GMAC main clock
33+
- description: PTP clock
34+
- description: TX clock
35+
36+
clock-names:
37+
items:
38+
- const: stmmaceth
39+
- const: ptp_ref
40+
- const: tx
41+
42+
dma-noncoherent: true
43+
44+
interrupts:
45+
maxItems: 1
46+
47+
interrupt-names:
48+
maxItems: 1
49+
50+
resets:
51+
maxItems: 1
52+
53+
reset-names:
54+
const: stmmaceth
55+
56+
required:
57+
- compatible
58+
- reg
59+
- clocks
60+
- clock-names
61+
- interrupts
62+
- interrupt-names
63+
- resets
64+
- reset-names
65+
66+
allOf:
67+
- $ref: snps,dwmac.yaml#
68+
69+
unevaluatedProperties: false
70+
71+
examples:
72+
- |
73+
#include <dt-bindings/interrupt-controller/irq.h>
74+
75+
ethernet@30006000 {
76+
compatible = "sophgo,sg2044-dwmac", "snps,dwmac-5.30a";
77+
reg = <0x30006000 0x4000>;
78+
clocks = <&clk 151>, <&clk 152>, <&clk 154>;
79+
clock-names = "stmmaceth", "ptp_ref", "tx";
80+
interrupt-parent = <&intc>;
81+
interrupts = <296 IRQ_TYPE_LEVEL_HIGH>;
82+
interrupt-names = "macirq";
83+
resets = <&rst 30>;
84+
reset-names = "stmmaceth";
85+
snps,multicast-filter-bins = <0>;
86+
snps,perfect-filter-entries = <1>;
87+
snps,aal;
88+
snps,tso;
89+
snps,txpbl = <32>;
90+
snps,rxpbl = <32>;
91+
snps,mtl-rx-config = <&gmac0_mtl_rx_setup>;
92+
snps,mtl-tx-config = <&gmac0_mtl_tx_setup>;
93+
snps,axi-config = <&gmac0_stmmac_axi_setup>;
94+
status = "disabled";
95+
96+
gmac0_mtl_rx_setup: rx-queues-config {
97+
snps,rx-queues-to-use = <8>;
98+
snps,rx-sched-wsp;
99+
queue0 {};
100+
queue1 {};
101+
queue2 {};
102+
queue3 {};
103+
queue4 {};
104+
queue5 {};
105+
queue6 {};
106+
queue7 {};
107+
};
108+
109+
gmac0_mtl_tx_setup: tx-queues-config {
110+
snps,tx-queues-to-use = <8>;
111+
queue0 {};
112+
queue1 {};
113+
queue2 {};
114+
queue3 {};
115+
queue4 {};
116+
queue5 {};
117+
queue6 {};
118+
queue7 {};
119+
};
120+
121+
gmac0_stmmac_axi_setup: stmmac-axi-config {
122+
snps,blen = <16 8 4 0 0 0 0>;
123+
snps,wr_osr_lmt = <1>;
124+
snps,rd_osr_lmt = <2>;
125+
};
126+
};

0 commit comments

Comments
 (0)