ramips: fix and clean up D-Link MAC address
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7628an_tplink_tl-mr3020-v3.dts
1 #include "mt7628an.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5 #include <dt-bindings/leds/common.h>
6
7 / {
8 compatible = "tplink,tl-mr3020-v3", "mediatek,mt7628an-soc";
9 model = "TP-Link TL-MR3020 v3";
10
11 aliases {
12 led-boot = &led_power;
13 led-failsafe = &led_power;
14 led-running = &led_power;
15 led-upgrade = &led_power;
16 label-mac-device = &ethernet;
17 };
18
19 chosen {
20 bootargs = "console=ttyS0,115200";
21 };
22
23 keys {
24 compatible = "gpio-keys";
25
26 wps {
27 label = "wps";
28 gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
29 linux,code = <KEY_WPS_BUTTON>;
30 };
31
32 modec1 {
33 label = "sw1";
34 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
35 linux,code = <BTN_0>;
36 linux,input-type = <EV_SW>;
37 };
38
39 modec2 {
40 label = "sw2";
41 gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
42 linux,code = <BTN_1>;
43 linux,input-type = <EV_SW>;
44 };
45 };
46
47 leds {
48 compatible = "gpio-leds";
49
50 led_power: power {
51 function = LED_FUNCTION_POWER;
52 color = <LED_COLOR_ID_GREEN>;
53 gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
54 default-state = "on";
55 };
56
57 wan {
58 label = "green:3g";
59 gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
60 trigger-sources = <&ehci_port1>, <&ohci_port1>;
61 linux,default-trigger = "usbport";
62 };
63
64 wlan {
65 function = LED_FUNCTION_WLAN;
66 color = <LED_COLOR_ID_GREEN>;
67 gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
68 linux,default-trigger = "phy0tpt";
69 };
70
71 wps {
72 function = LED_FUNCTION_WPS;
73 color = <LED_COLOR_ID_GREEN>;
74 gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
75 };
76
77 lan {
78 function = LED_FUNCTION_LAN;
79 color = <LED_COLOR_ID_GREEN>;
80 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
81 };
82 };
83
84 gpio_export {
85 compatible = "gpio-export";
86 #size-cells = <0>;
87
88 usbpower {
89 gpio-export,name = "usbpower";
90 gpio-export,output = <1>;
91 gpios = <&gpio 39 GPIO_ACTIVE_HIGH>;
92 };
93 };
94 };
95
96 &spi0 {
97 status = "okay";
98
99 flash@0 {
100 compatible = "jedec,spi-nor";
101 reg = <0>;
102 spi-max-frequency = <50000000>;
103 m25p,fast-read;
104
105 partitions {
106 compatible = "fixed-partitions";
107 #address-cells = <1>;
108 #size-cells = <1>;
109
110 partition@0 {
111 label = "boot";
112 reg = <0x0 0x20000>;
113 read-only;
114 };
115
116 partition@20000 {
117 compatible = "tplink,firmware";
118 label = "firmware";
119 reg = <0x20000 0x7a0000>;
120 };
121
122 partition@7c0000 {
123 label = "config";
124 reg = <0x7c0000 0x10000>;
125 read-only;
126 };
127
128 partition@7d0000 {
129 label = "factory";
130 reg = <0x7d0000 0x30000>;
131 read-only;
132
133 nvmem-layout {
134 compatible = "fixed-layout";
135 #address-cells = <1>;
136 #size-cells = <1>;
137
138 eeprom_factory_20000: eeprom@20000 {
139 reg = <0x20000 0x400>;
140 };
141
142 macaddr_factory_f100: macaddr@f100 {
143 reg = <0xf100 0x6>;
144 };
145 };
146 };
147 };
148 };
149 };
150
151 &state_default {
152 gpio {
153 groups = "i2s", "refclk", "wdt", "p4led_an", "p2led_an", "p1led_an", "p0led_an", "wled_an";
154 function = "gpio";
155 };
156 };
157
158 &wmac {
159 status = "okay";
160
161 nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100>;
162 nvmem-cell-names = "eeprom", "mac-address";
163 };
164
165 &ethernet {
166 nvmem-cells = <&macaddr_factory_f100>;
167 nvmem-cell-names = "mac-address";
168 };