ramips: mt7628: use nvmem-layout
[openwrt/staging/stintel.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 label = "factory";
125 reg = <0x7d0000 0x30000>;
126 read-only;
127
128 nvmem-layout {
129 compatible = "fixed-layout";
130 #address-cells = <1>;
131 #size-cells = <1>;
132
133 eeprom_factory_20000: eeprom@20000 {
134 reg = <0x20000 0x400>;
135 };
136
137 macaddr_factory_f100: macaddr@f100 {
138 reg = <0xf100 0x6>;
139 };
140 };
141 };
142 };
143 };
144 };
145
146 &state_default {
147 gpio {
148 groups = "i2s", "refclk", "wdt", "p4led_an", "p2led_an", "p1led_an", "p0led_an", "wled_an";
149 function = "gpio";
150 };
151 };
152
153 &wmac {
154 status = "okay";
155
156 nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100>;
157 nvmem-cell-names = "eeprom", "mac-address";
158 };
159
160 &ethernet {
161 nvmem-cells = <&macaddr_factory_f100>;
162 nvmem-cell-names = "mac-address";
163 };