ramips: mt7620a: use mac-base
[openwrt/staging/hauke.git] / target / linux / ramips / dts / mt7620a_dlink_dwr-96x.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * D-Link DWR-96x Common Board Description
4 * Copyright 2022 Pawel Dembicki <paweldembicki@gmail.com>
5 */
6 #include "mt7620a.dtsi"
7
8 #include <dt-bindings/gpio/gpio.h>
9 #include <dt-bindings/input/input.h>
10 #include <dt-bindings/mtd/partitions/uimage.h>
11
12 / {
13 aliases {
14 led-boot = &led_status;
15 led-failsafe = &led_status;
16 led-running = &led_status;
17 led-upgrade = &led_status;
18 };
19
20 keys {
21 compatible = "gpio-keys";
22
23 reset {
24 label = "reset";
25 gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
26 linux,code = <KEY_RESTART>;
27 };
28
29 wps {
30 label = "wps";
31 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
32 linux,code = <KEY_WPS_BUTTON>;
33 };
34
35 };
36
37 leds {
38 compatible = "gpio-leds";
39
40 led_status: status {
41 label = "green:status";
42 gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
43 };
44
45 wan {
46 label = "green:wan";
47 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
48 };
49
50 lan {
51 label = "green:lan";
52 gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
53 };
54
55 sms {
56 label = "green:sms";
57 gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
58 };
59
60 signal_green {
61 label = "green:signal";
62 gpios = <&gpio2 0 GPIO_ACTIVE_HIGH>;
63 };
64
65 signal_red {
66 label = "red:signal";
67 gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
68 };
69
70 4g {
71 label = "green:4g";
72 gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
73 };
74
75 3g {
76 label = "green:3g";
77 gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
78 };
79
80 wlan5g {
81 label = "green:wlan5g";
82 gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
83 linux,default-trigger = "phy0tpt";
84 };
85
86 wlan2g {
87 label = "green:wlan2g";
88 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
89 linux,default-trigger = "phy1tpt";
90 };
91 };
92 };
93
94 &ehci {
95 status = "okay";
96 };
97
98 &gpio1 {
99 status = "okay";
100 };
101
102 &gpio2 {
103 status = "okay";
104 };
105
106 &gpio3 {
107 status = "okay";
108 };
109
110 &ohci {
111 status = "okay";
112 };
113
114 &pcie {
115 status = "okay";
116 };
117
118 &pcie0 {
119 wifi: wifi@0,0 {
120 compatible = "mediatek,mt76";
121 reg = <0x0000 0 0 0 0>;
122 ieee80211-freq-limit = <5000000 6000000>;
123 };
124 };
125
126 &spi0 {
127 status = "okay";
128
129 flash@0 {
130 compatible = "jedec,spi-nor";
131 reg = <0>;
132 spi-max-frequency = <50000000>;
133
134 partitions {
135 compatible = "fixed-partitions";
136 #address-cells = <1>;
137 #size-cells = <1>;
138
139 partition@0 {
140 label = "jboot";
141 reg = <0x0 0x10000>;
142 read-only;
143 };
144
145 partition@10000 {
146 compatible = "openwrt,uimage", "denx,uimage";
147 openwrt,ih-magic = <IH_MAGIC_OKLI>;
148 openwrt,offset = <0x10000>;
149 label = "firmware";
150 reg = <0x10000 0xfe0000>;
151 };
152
153 config: partition@ff0000 {
154 label = "config";
155 reg = <0xff0000 0x10000>;
156 read-only;
157
158 nvmem-layout {
159 compatible = "fixed-layout";
160 #address-cells = <1>;
161 #size-cells = <1>;
162
163 eeprom_config_e08e: eeprom@e08e {
164 reg = <0xe08e 0x200>;
165 };
166
167 eeprom_config_e29e: eeprom@e29e {
168 reg = <0xe29e 0x200>;
169 };
170
171 macaddr_config_e50e: macaddr@e50e {
172 compatible = "mac-base";
173 reg = <0xe50e 0x6>;
174 #nvmem-cell-cells = <1>;
175 };
176 };
177 };
178 };
179 };
180 };
181
182 &state_default {
183 default {
184 groups = "i2c", "wled", "spi refclk", "uartf", "ephy";
185 function = "gpio";
186 };
187 };