ramips: fix MTD EEPROM offset for TL-WR840N v5
[oweals/openwrt.git] / target / linux / ramips / dts / EX3700.dts
1 /* This file is released into the public domain */
2
3 /dts-v1/;
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 #include "mt7620a.dtsi"
9
10 / {
11         compatible = "netgear,ex3700", "ralink,mt7620a-soc";
12         model = "Netgear EX3700/EX3800";
13
14         aliases {
15                 led-boot = &led_power_green;
16                 led-failsafe = &led_power_green;
17                 led-running = &led_power_green;
18                 led-upgrade = &led_power_green;
19         };
20
21         chosen {
22                 bootargs = "console=ttyS0,57600";
23         };
24
25         gpio-leds {
26                 compatible = "gpio-leds";
27
28                 led_power_green: power_g {
29                         label = "ex3700:green:power";
30                         gpios = <&gpio2 23 GPIO_ACTIVE_LOW>;
31                         default-state = "on";
32                 };
33
34                 power_a {
35                         label = "ex3700:amber:power";
36                         gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
37                         default-state = "off";
38                 };
39
40                 router_g {
41                         label = "ex3700:green:router";
42                         gpios = <&gpio2 25 GPIO_ACTIVE_LOW>;
43                 };
44
45                 router_r {
46                         label = "ex3700:red:router";
47                         gpios = <&gpio2 24 GPIO_ACTIVE_LOW>;
48                 };
49
50                 device_g {
51                         label = "ex3700:green:device";
52                         gpios = <&gpio2 20 GPIO_ACTIVE_LOW>;
53                 };
54
55                 device_r {
56                         label = "ex3700:red:device";
57                         gpios = <&gpio2 21 GPIO_ACTIVE_LOW>;
58                 };
59
60                 wps {
61                         label = "ex3700:green:wps";
62                         gpios = <&gpio2 27 GPIO_ACTIVE_LOW>;
63                 };
64         };
65
66         gpio-keys-polled {
67                 compatible = "gpio-keys-polled";
68                 poll-interval = <20>;
69
70                 reset {
71                         label = "reset";
72                         gpios = <&gpio2 26 GPIO_ACTIVE_LOW>;
73                         linux,code = <KEY_RESTART>;
74                 };
75
76                 wps {
77                         label = "wps";
78                         gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
79                         linux,code = <KEY_WPS_BUTTON>;
80                 };
81         };
82 };
83
84 &gpio0 {
85         status = "okay";
86 };
87
88 &gpio2 {
89         status = "okay";
90 };
91
92 &spi0 {
93         status = "okay";
94
95         m25p80@0 {
96                 compatible = "jedec,spi-nor";
97                 reg = <0>;
98                 spi-max-frequency = <10000000>;
99
100                 partitions {
101                         compatible = "fixed-partitions";
102                         #address-cells = <1>;
103                         #size-cells = <1>;
104
105                         partition@0 {
106                                 label = "u-boot";
107                                 reg = <0x0 0x30000>;
108                                 read-only;
109                         };
110
111                         partition@30000 {
112                                 label = "config";
113                                 reg = <0x30000 0x10000>;
114                                 read-only;
115                         };
116
117                         factory: partition@40000 {
118                                 label = "factory";
119                                 reg = <0x40000 0x10000>;
120                                 read-only;
121                         };
122
123                         partition@50000 {
124                                 label = "firmware";
125                                 reg = <0x50000 0x790000>;
126                         };
127
128                         partition@7e0000 {
129                                 label = "board_data";
130                                 reg = <0x7e0000 0x10000>;
131                                 read-only;
132                         };
133
134                         partition@7f0000 {
135                                 label = "nvram";
136                                 reg = <0x7f0000 0x10000>;
137                                 read-only;
138                         };
139                 };
140         };
141 };
142
143 &pcie {
144         status = "okay";
145 };
146
147 &pcie0 {
148         mt76@0,0 {
149                 reg = <0x0000 0 0 0 0 >;
150                 mediatek,mtd-eeprom = <&factory 0x8000>;
151                 ieee80211-freq-limit = <5000000 6000000>;
152         };
153 };
154
155 &ethernet {
156         mtd-mac-address = <&factory 0x28>;
157 };
158
159 &wmac {
160         ralink,mtd-eeprom = <&factory 0x0>;
161 };
162
163 &pinctrl {
164         state_default: pinctrl0 {
165                 default {
166                         ralink,group = "i2c", "rgmii2", "spi refclk";
167                         ralink,function = "gpio";
168                 };
169         };
170 };