Skip to content

Commit 53e41b7

Browse files
cristiccdavem330
authored andcommitted
dt-bindings: net: starfive,jh7110-dwmac: Add JH7100 SoC compatible
The Synopsys DesignWare MAC found on StarFive JH7100 SoC is mostly similar to the newer JH7110, but it requires only two interrupts and a single reset line, which is 'ahb' instead of the commonly used 'stmmaceth'. Since the common binding 'snps,dwmac' allows selecting 'ahb' only in conjunction with 'stmmaceth', extend the logic to also permit exclusive usage of the 'ahb' reset name. This ensures the following use cases are supported: JH7110: reset-names = "stmmaceth", "ahb"; JH7100: reset-names = "ahb"; other: reset-names = "stmmaceth"; Also note the need to use a different dwmac fallback, as v5.20 applies to JH7110 only, while JH7100 relies on v3.7x. Additionally, drop the reset description items from top-level binding as they are already provided by the included snps,dwmac schema. Signed-off-by: Cristian Ciocaltea <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Reviewed-by: Rob Herring <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ccf1445 commit 53e41b7

File tree

2 files changed

+57
-26
lines changed

2 files changed

+57
-26
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ properties:
9595
- snps,dwmac-5.20
9696
- snps,dwxgmac
9797
- snps,dwxgmac-2.10
98+
- starfive,jh7100-dwmac
9899
- starfive,jh7110-dwmac
99100

100101
reg:
@@ -144,10 +145,12 @@ properties:
144145
- description: AHB reset
145146

146147
reset-names:
147-
minItems: 1
148-
items:
149-
- const: stmmaceth
150-
- const: ahb
148+
oneOf:
149+
- items:
150+
- enum: [stmmaceth, ahb]
151+
- items:
152+
- const: stmmaceth
153+
- const: ahb
151154

152155
power-domains:
153156
maxItems: 1

Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml

Lines changed: 50 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,20 @@ select:
1616
compatible:
1717
contains:
1818
enum:
19+
- starfive,jh7100-dwmac
1920
- starfive,jh7110-dwmac
2021
required:
2122
- compatible
2223

2324
properties:
2425
compatible:
25-
items:
26-
- enum:
27-
- starfive,jh7110-dwmac
28-
- const: snps,dwmac-5.20
26+
oneOf:
27+
- items:
28+
- const: starfive,jh7100-dwmac
29+
- const: snps,dwmac
30+
- items:
31+
- const: starfive,jh7110-dwmac
32+
- const: snps,dwmac-5.20
2933

3034
reg:
3135
maxItems: 1
@@ -46,24 +50,6 @@ properties:
4650
- const: tx
4751
- const: gtx
4852

49-
interrupts:
50-
minItems: 3
51-
maxItems: 3
52-
53-
interrupt-names:
54-
minItems: 3
55-
maxItems: 3
56-
57-
resets:
58-
items:
59-
- description: MAC Reset signal.
60-
- description: AHB Reset signal.
61-
62-
reset-names:
63-
items:
64-
- const: stmmaceth
65-
- const: ahb
66-
6753
starfive,tx-use-rgmii-clk:
6854
description:
6955
Tx clock is provided by external rgmii clock.
@@ -94,6 +80,48 @@ required:
9480
allOf:
9581
- $ref: snps,dwmac.yaml#
9682

83+
- if:
84+
properties:
85+
compatible:
86+
contains:
87+
const: starfive,jh7100-dwmac
88+
then:
89+
properties:
90+
interrupts:
91+
minItems: 2
92+
maxItems: 2
93+
94+
interrupt-names:
95+
minItems: 2
96+
maxItems: 2
97+
98+
resets:
99+
maxItems: 1
100+
101+
reset-names:
102+
const: ahb
103+
104+
- if:
105+
properties:
106+
compatible:
107+
contains:
108+
const: starfive,jh7110-dwmac
109+
then:
110+
properties:
111+
interrupts:
112+
minItems: 3
113+
maxItems: 3
114+
115+
interrupt-names:
116+
minItems: 3
117+
maxItems: 3
118+
119+
resets:
120+
minItems: 2
121+
122+
reset-names:
123+
minItems: 2
124+
97125
unevaluatedProperties: false
98126

99127
examples:

0 commit comments

Comments
 (0)