Skip to content

Commit 17981d2

Browse files
TonyHan11kartben
authored andcommitted
dts: arm: atmel: refactor to use common parent nodes for sam ethernet
The ethernet mac and mdio share registers, refactor them to have common parent nodes. Signed-off-by: Tony Han <[email protected]>
1 parent c62985f commit 17981d2

File tree

6 files changed

+66
-51
lines changed

6 files changed

+66
-51
lines changed

dts/arm/atmel/sam4e.dtsi

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -165,24 +165,26 @@
165165
status = "disabled";
166166
};
167167

168-
gmac: ethernet@40034000 {
169-
compatible = "atmel,sam-gmac";
168+
ethernet@40034000 {
169+
compatible = "microchip,sam-ethernet-controller";
170170
reg = <0x40034000 0x4000>;
171171
clocks = <&pmc PMC_TYPE_PERIPHERAL 44>;
172-
interrupts = <44 0>;
173-
interrupt-names = "gmac";
174-
num-queues = <1>;
175-
phy-connection-type = "mii";
176-
status = "disabled";
177-
};
178172

179-
mdio: mdio@40034000 {
180-
compatible = "atmel,sam-mdio";
181-
reg = <0x40034000 0x4000>;
182-
clocks = <&pmc PMC_TYPE_PERIPHERAL 44>;
183-
status = "disabled";
184-
#address-cells = <1>;
185-
#size-cells = <0>;
173+
gmac: ethernet {
174+
compatible = "atmel,sam-gmac";
175+
interrupts = <44 0>;
176+
interrupt-names = "gmac";
177+
num-queues = <1>;
178+
phy-connection-type = "mii";
179+
status = "disabled";
180+
};
181+
182+
mdio: mdio {
183+
compatible = "atmel,sam-mdio";
184+
status = "disabled";
185+
#address-cells = <1>;
186+
#size-cells = <0>;
187+
};
186188
};
187189

188190
pinctrl: pinctrl@400e0e00 {

dts/arm/atmel/same5x.dtsi

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,27 @@
1010

1111
/ {
1212
soc {
13-
gmac: ethernet@42000800 {
14-
compatible = "atmel,sam0-gmac";
13+
ethernet@42000800 {
14+
compatible = "microchip,sam-ethernet-controller";
1515
reg = <0x42000800 0x400>;
16-
interrupts = <84 0>;
17-
interrupt-names = "gmac";
18-
status = "disabled";
1916

20-
num-queues = <1>;
21-
local-mac-address = [00 00 00 00 00 00];
22-
};
17+
gmac: ethernet {
18+
compatible = "atmel,sam0-gmac";
19+
interrupts = <84 0>;
20+
interrupt-names = "gmac";
21+
status = "disabled";
2322

24-
mdio: mdio@42000800 {
25-
compatible = "atmel,sam-mdio";
26-
reg = <0x42000800 0x400>;
27-
status = "disabled";
23+
num-queues = <1>;
24+
local-mac-address = [00 00 00 00 00 00];
25+
};
26+
27+
mdio: mdio {
28+
compatible = "atmel,sam-mdio";
29+
status = "disabled";
2830

29-
#address-cells = <1>;
30-
#size-cells = <0>;
31+
#address-cells = <1>;
32+
#size-cells = <0>;
33+
};
3134
};
3235

3336
can0: can@42000000 {

dts/arm/atmel/samx7x.dtsi

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -232,24 +232,26 @@
232232
#io-channel-cells = <1>;
233233
};
234234

235-
gmac: ethernet@40050000 {
236-
compatible = "atmel,sam-gmac";
235+
ethernet@40050000 {
236+
compatible = "microchip,sam-ethernet-controller";
237237
reg = <0x40050000 0x4000>;
238238
clocks = <&pmc PMC_TYPE_PERIPHERAL 39>;
239-
interrupts = <39 0>, <66 0>, <67 0>;
240-
interrupt-names = "gmac", "q1", "q2";
241-
num-queues = <3>;
242-
local-mac-address = [00 00 00 00 00 00];
243-
status = "disabled";
244-
};
245239

246-
mdio: mdio@40050000 {
247-
compatible = "atmel,sam-mdio";
248-
reg = <0x40050000 0x4000>;
249-
clocks = <&pmc PMC_TYPE_PERIPHERAL 39>;
250-
status = "disabled";
251-
#address-cells = <1>;
252-
#size-cells = <0>;
240+
gmac: ethernet {
241+
compatible = "atmel,sam-gmac";
242+
interrupts = <39 0>, <66 0>, <67 0>;
243+
interrupt-names = "gmac", "q1", "q2";
244+
num-queues = <3>;
245+
local-mac-address = [00 00 00 00 00 00];
246+
status = "disabled";
247+
};
248+
249+
mdio: mdio {
250+
compatible = "atmel,sam-mdio";
251+
status = "disabled";
252+
#address-cells = <1>;
253+
#size-cells = <0>;
254+
};
253255
};
254256

255257
tc3: tc@40054000 {

dts/bindings/ethernet/atmel,gmac-common.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ include:
77
- name: pinctrl-device.yaml
88

99
properties:
10-
reg:
11-
required: true
12-
1310
phy-handle:
1411
required: true
1512

dts/bindings/ethernet/atmel,sam-gmac.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,3 @@ description: Atmel SAM-family GMAC Ethernet
66
compatible: "atmel,sam-gmac"
77

88
include: atmel,gmac-common.yaml
9-
10-
properties:
11-
clocks:
12-
required: true
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright (C) 2025 Microchip Technology Inc. and its subsidiaries
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
title: Microchip SAM Ethernet Controller
5+
6+
description: |
7+
Contains the Ethernet MAC and the MDIO as child nodes.
8+
9+
compatible: "microchip,sam-ethernet-controller"
10+
11+
include: base.yaml
12+
13+
properties:
14+
reg:
15+
required: true

0 commit comments

Comments
 (0)