ath79: ar: convert to mac-base
[openwrt/staging/hauke.git] / target / linux / ath79 / dts / ar7240_buffalo_whr-g301n.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "ar7240.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "buffalo,whr-g301n", "qca,ar7240";
10 model = "Buffalo WHR-G301N";
11
12 aliases {
13 led-boot = &led_diag;
14 led-failsafe = &led_diag;
15 led-upgrade = &led_diag;
16 };
17
18 keys {
19 compatible = "gpio-keys";
20
21 router_on {
22 label = "router_on";
23 linux,code = <BTN_2>;
24 linux,input-type = <EV_SW>;
25 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
26 debounce-interval = <60>;
27 };
28
29 router_off {
30 label = "router_off";
31 linux,code = <BTN_3>;
32 linux,input-type = <EV_SW>;
33 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
34 debounce-interval = <60>;
35 };
36
37 reset {
38 label = "reset";
39 linux,code = <KEY_RESTART>;
40 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
41 debounce-interval = <60>;
42 };
43
44 wps {
45 label = "wps";
46 linux,code = <KEY_WPS_BUTTON>;
47 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
48 debounce-interval = <60>;
49 };
50 };
51
52 leds {
53 compatible = "gpio-leds";
54 pinctrl-names = "default";
55 pinctrl-0 = <&switch_led_pins>;
56
57 security {
58 label = "orange:security";
59 gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
60 };
61
62 led_diag: diag {
63 label = "red:diag";
64 gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
65 };
66
67 router {
68 label = "green:router";
69 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
70 };
71
72 lan1 {
73 label = "green:lan1";
74 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
75 };
76
77 lan2 {
78 label = "green:lan2";
79 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
80 };
81
82 lan3 {
83 label = "green:lan3";
84 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
85 };
86
87 lan4 {
88 label = "green:lan4";
89 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
90 };
91
92 wan {
93 label = "green:wan";
94 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
95 };
96 };
97
98 ath9k-leds {
99 compatible = "gpio-leds";
100
101 wlan {
102 label = "green:wlan";
103 gpios = <&ath9k 1 GPIO_ACTIVE_LOW>;
104 linux,default-trigger = "phy0tpt";
105 };
106 };
107 };
108
109 &spi {
110 status = "okay";
111
112 flash@0 {
113 compatible = "jedec,spi-nor";
114 reg = <0>;
115 spi-max-frequency = <25000000>;
116
117 partitions {
118 compatible = "fixed-partitions";
119 #address-cells = <1>;
120 #size-cells = <1>;
121
122 partition@0 {
123 reg = <0x0 0x3e000>;
124 label = "u-boot";
125 read-only;
126 };
127
128 partition@3e000 {
129 reg = <0x3e000 0x2000>;
130 label = "u-boot-env";
131 read-only;
132 };
133
134 partition@40000 {
135 compatible = "denx,uimage";
136 reg = <0x40000 0x3a0000>;
137 label = "firmware";
138 };
139
140 partition@3e0000 {
141 reg = <0x3e0000 0x10000>;
142 label = "user_property";
143 read-only;
144 };
145
146 art: partition@3f0000 {
147 reg = <0x3f0000 0x10000>;
148 label = "art";
149 read-only;
150
151 nvmem-layout {
152 compatible = "fixed-layout";
153 #address-cells = <1>;
154 #size-cells = <1>;
155
156 macaddr_art_120c: macaddr@120c {
157 compatible = "mac-base";
158 reg = <0x120c 0x6>;
159 #nvmem-cell-cells = <1>;
160 };
161 };
162 };
163 };
164 };
165 };
166
167 &eth0 {
168 nvmem-cells = <&macaddr_art_120c 0>;
169 nvmem-cell-names = "mac-address";
170 };
171
172 &eth1 {
173 status = "okay";
174
175 nvmem-cells = <&macaddr_art_120c 1>;
176 nvmem-cell-names = "mac-address";
177 };
178
179 &pcie {
180 status = "okay";
181
182 ath9k: wifi@0,0 {
183 compatible = "pci168c,002a";
184 reg = <0x0000 0 0 0 0>;
185 qca,no-eeprom;
186 nvmem-cells = <&macaddr_art_120c 0>;
187 nvmem-cell-names = "mac-address";
188 #gpio-cells = <2>;
189 gpio-controller;
190 };
191 };
192
193 &pinmux {
194 switch_led_pins: switch_led_pins {
195 pinctrl-single,bits = <0x0 0x0 0xf8>;
196 };
197 };