ath79: add support for ELECOM WRC-300GHBK2-I
[oweals/openwrt.git] / target / linux / ath79 / dts / qca9563_elecom_wrc-300ghbk2-i.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 "qca956x.dtsi"
8
9 / {
10         model = "ELECOM WRC-300GHBK2-I";
11         compatible = "elecom,wrc-300ghbk2-i", "qca,qca9563";
12
13         chosen {
14                 bootargs = "console=ttyS0,115200n8";
15         };
16
17         aliases {
18                 led-boot = &power;
19                 led-failsafe = &power;
20                 led-running = &power;
21                 led-upgrade = &power;
22         };
23
24         leds {
25                 compatible = "gpio-leds";
26
27                 power: power {
28                         label = "wrc-300ghbk2-i:white:power";
29                         gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
30                         default-state = "on";
31                 };
32
33                 wlan2g {
34                         label = "wrc-300ghbk2-i:white:wlan2g";
35                         gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
36                         default-state = "off";
37                         linux,default-trigger = "phy0tpt";
38                 };
39
40                 wps {
41                         label = "wrc-300ghbk2-i:red:wps";
42                         gpios = <&gpio 9 GPIO_ACTIVE_HIGH>;
43                         default-state = "off";
44                 };
45         };
46
47         keys {
48                 compatible = "gpio-keys";
49
50                 reset {
51                         label = "reset";
52                         gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
53                         linux,code = <KEY_RESTART>;
54                         debounce-interval = <60>;
55                 };
56
57                 button_wps {
58                         label = "wps";
59                         gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
60                         linux,code = <KEY_WPS_BUTTON>;
61                         debounce-interval = <60>;
62                 };
63
64                 ap {
65                         label = "ap";
66                         gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
67                         linux,code = <BTN_0>;
68                         linux,input-type = <EV_SW>;
69                         debounce-interval = <60>;
70                 };
71         };
72 };
73
74 &spi {
75         status = "okay";
76         num-cs = <1>;
77
78         flash@0 {
79                 compatible = "jedec,spi-nor";
80                 reg = <0>;
81                 spi-max-frequency = <25000000>;
82
83                 partitions {
84                         compatible = "fixed-partitions";
85                         #address-cells = <1>;
86                         #size-cells = <1>;
87
88                         partition@0 {
89                                 label = "u-boot";
90                                 reg = <0x000000 0x040000>;
91                                 read-only;
92                         };
93
94                         partition@40000 {
95                                 label = "u-boot-env";
96                                 reg = <0x040000 0x010000>;
97                                 read-only;
98                         };
99
100                         partition@50000 {
101                                 label = "nvram";
102                                 reg = <0x050000 0x020000>;
103                                 read-only;
104                         };
105
106                         partition@70000 {
107                                 label = "firmware";
108                                 reg = <0x070000 0x770000>;
109                         };
110
111                         partition@7e0000 {
112                                 label = "hwconfig";
113                                 reg = <0x7e0000 0x010000>;
114                                 read-only;
115                         };
116
117                         ART: partition@7f0000 {
118                                 label = "ART";
119                                 reg = <0x7f0000 0x010000>;
120                                 read-only;
121                         };
122                 };
123         };
124 };
125
126 &mdio0 {
127         status = "okay";
128
129         phy0: ethernet-phy@0 {
130                 reg = <0>;
131                 phy-mode = "sgmii";
132
133                 qca,ar8327-initvals = <
134                         0x04 0x00000080 /* PORT0 PAD MODE CTRL */
135                         0x50 0xcf37cf37 /* LED_CTRL0 */
136                         0x54 0x00000000 /* LED_CTRL1 */
137                         0x58 0x00000000 /* LED_CTRL2 */
138                         0x5c 0x03ffff00 /* LED_CTRL3 */
139                         0x7c 0x0000007e /* PORT0_STATUS */
140                 >;
141         };
142 };
143
144 &eth0 {
145         status = "okay";
146
147         mtd-mac-address = <&ART 0x1002>;
148         mtd-mac-address-increment = <(-1)>;
149         phy-mode = "sgmii";
150         phy-handle = <&phy0>;
151 };
152
153 &uart {
154         status = "okay";
155 };
156
157 &wmac {
158         status = "okay";
159         mtd-cal-data = <&ART 0x1000>;
160 };