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