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