ramips: mt7620: use OKLI loader with Jboot devices
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_dlink_dwr-960.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/gpio/gpio.h>
7 #include <dt-bindings/mtd/partitions/uimage.h>
8
9 / {
10 compatible = "dlink,dwr-960", "ralink,mt7620a-soc";
11 model = "D-Link DWR-960";
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 leds {
37 compatible = "gpio-leds";
38
39 led_status: status {
40 label = "green:status";
41 gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
42 };
43
44 wan {
45 label = "green:wan";
46 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
47 };
48
49 lan {
50 label = "green:lan";
51 gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
52 };
53
54 sms {
55 label = "green:sms";
56 gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
57 };
58
59 signal_green {
60 label = "green:signal";
61 gpios = <&gpio2 0 GPIO_ACTIVE_HIGH>;
62 };
63
64 signal_red {
65 label = "red:signal";
66 gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>;
67 };
68
69 4g {
70 label = "green:4g";
71 gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
72 };
73
74 3g {
75 label = "green:3g";
76 gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
77 };
78
79 wlan5g {
80 label = "green:wlan5g";
81 gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
82 linux,default-trigger = "phy0tpt";
83 };
84
85 wlan2g {
86 label = "green:wlan2g";
87 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
88 linux,default-trigger = "phy1tpt";
89 };
90 };
91 };
92
93 &ethernet {
94 pinctrl-names = "default";
95 pinctrl-0 = <&rgmii2_pins &mdio_pins>;
96
97 mediatek,portmap = "wllll";
98
99 port@5 {
100 status = "okay";
101 phy-mode = "rgmii-txid";
102 phy-handle = <&phy7>;
103 };
104
105 mdio-bus {
106 status = "okay";
107
108 phy7: ethernet-phy@7 {
109 reg = <7>;
110 phy-mode = "rgmii-id";
111 };
112 };
113 };
114
115 &gpio1 {
116 status = "okay";
117 };
118
119 &gpio2 {
120 status = "okay";
121 };
122
123 &gpio3 {
124 status = "okay";
125 };
126
127 &spi0 {
128 status = "okay";
129
130 flash@0 {
131 compatible = "jedec,spi-nor";
132 reg = <0>;
133 spi-max-frequency = <50000000>;
134
135 partitions {
136 compatible = "fixed-partitions";
137 #address-cells = <1>;
138 #size-cells = <1>;
139
140 partition@0 {
141 label = "jboot";
142 reg = <0x0 0x10000>;
143 read-only;
144 };
145
146 partition@10000 {
147 compatible = "openwrt,uimage", "denx,uimage";
148 openwrt,ih-magic = <IH_MAGIC_OKLI>;
149 openwrt,offset = <0x10000>;
150 label = "firmware";
151 reg = <0x10000 0xfe0000>;
152 };
153
154 config: partition@ff0000 {
155 label = "config";
156 reg = <0xff0000 0x10000>;
157 read-only;
158 };
159 };
160 };
161 };
162
163 &ehci {
164 status = "okay";
165 };
166
167 &ohci {
168 status = "okay";
169 };
170
171 &pcie {
172 status = "okay";
173 };
174
175 &pcie0 {
176 wifi@0,0 {
177 compatible = "mediatek,mt76";
178 reg = <0x0000 0 0 0 0>;
179 ieee80211-freq-limit = <5000000 6000000>;
180 mediatek,mtd-eeprom = <&config 0xe08e>;
181 nvmem-cells = <&macaddr_config_e50e>;
182 nvmem-cell-names = "mac-address";
183 mac-address-increment = <2>;
184 };
185 };
186
187 &state_default {
188 default {
189 groups = "i2c", "wled", "spi refclk", "uartf", "ephy";
190 function = "gpio";
191 };
192 };
193
194 &config {
195 compatible = "nvmem-cells";
196 #address-cells = <1>;
197 #size-cells = <1>;
198
199 macaddr_config_e50e: macaddr@e50e {
200 reg = <0xe50e 0x6>;
201 };
202 };