ath79: fix ethernet configurations for I-O DATA ETG3-R
[oweals/openwrt.git] / target / linux / ath79 / dts / ar9342_iodata_etg3-r.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6
7 #include "ar9344.dtsi"
8
9 / {
10         compatible = "iodata,etg3-r", "qca,ar9344";
11         model = "I-O DATA ETG3-R";
12
13         aliases {
14                 led-boot = &power;
15                 led-failsafe = &power;
16                 led-running = &power;
17                 led-upgrade = &power;
18         };
19
20         leds {
21                 compatible = "gpio-leds";
22
23                 power: power {
24                         label = "etg3-r:green:power";
25                         gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
26                         default-state = "on";
27                 };
28
29                 notification {
30                         label = "etg3-r:green:notification";
31                         gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
32                         default-state = "off";
33                 };
34         };
35
36         keys {
37                 compatible = "gpio-keys-polled";
38                 poll-interval = <20>;
39
40                 reset {
41                         label = "reset";
42                         linux,code = <KEY_RESTART>;
43                         gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
44                         debounce-interval = <60>;
45                 };
46         };
47 };
48
49 &ref {
50         clock-frequency = <40000000>;
51 };
52
53 &spi {
54         num-cs = <1>;
55         status = "okay";
56
57         flash@0 {
58                 compatible = "jedec,spi-nor";
59                 reg = <0>;
60                 spi-max-frequency = <25000000>;
61
62                 partitions {
63                         compatible = "fixed-partitions";
64                         #address-cells = <1>;
65                         #size-cells = <1>;
66
67                         partition@0 {
68                                 label = "u-boot";
69                                 reg = <0x000000 0x040000>;
70                                 read-only;
71                         };
72
73                         partition@40000 {
74                                 label = "u-boot-env";
75                                 reg = <0x040000 0x010000>;
76                         };
77
78                         partition@50000 {
79                                 compatible = "denx,uimage";
80                                 label = "firmware";
81                                 reg = <0x050000 0x780000>;
82                         };
83
84                         partition@7d0000 {
85                                 label = "Config";
86                                 reg = <0x07d0000 0x10000>;
87                                 read-only;
88                         };
89
90                         partition@7e0000 {
91                                 label = "Rsv";
92                                 reg = <0x07e0000 0x10000>;
93                                 read-only;
94                         };
95
96                         partition@7f0000 {
97                                 label = "ART";
98                                 reg = <0x7f0000 0x010000>;
99                                 read-only;
100                         };
101                 };
102         };
103 };
104
105 &mdio0 {
106         status = "okay";
107
108         phy0: ethernet-phy@0 {
109                 reg = <0>;
110                 phy-mode = "rgmii";
111
112                 qca,ar8327-initvals = <
113                         0x04 0x07600000 /* PORT0 PAD MODE CTRL */
114                         0x50 0xffb7ffb7 /* LED_CTRL0 */
115                         0x54 0xffb7ffb7 /* LED_CTRL1 */
116                         0x58 0xffb7ffb7 /* LED_CTRL2 */
117                         0x5c 0x03ffff00 /* LED_CTRL3 */
118                         0x7c 0x0000007e /* PORT0_STATUS */
119                 >;
120         };
121 };
122
123 &eth0 {
124         status = "okay";
125
126         pll-data = <0x0e000000 0x00000101 0x00001616>;
127
128         phy-mode = "rgmii";
129         phy-handle = <&phy0>;
130
131         gmac-config {
132                 device = <&gmac>;
133
134                 rgmii-gmac0 = <1>;
135                 rxd-delay = <3>;
136                 rxdv-delay = <3>;
137         };
138 };
139
140 &uart {
141         status = "okay";
142 };