ramips: fix MTD EEPROM offset for TL-WR840N v5
[oweals/openwrt.git] / target / linux / ramips / dts / ArcherC2-v1.dts
1 /dts-v1/;
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9         compatible = "tplink,c2-v1", "ralink,mt7620a-soc";
10         model = "TP-Link Archer C2 v1";
11
12         aliases {
13                 led-boot = &led_wps;
14                 led-failsafe = &led_wps;
15                 led-running = &led_wps;
16                 led-upgrade = &led_wps;
17         };
18
19         chosen {
20                 bootargs = "console=ttyS0,115200";
21         };
22
23         pinctrl {
24                 state_default: pinctrl0 {
25                         gpio {
26                                 ralink,group = "i2c", "uartf", "wled", "ephy", "spi refclk";
27                                 ralink,function = "gpio";
28                         };
29                 };
30         };
31
32         gpio-leds {
33                 compatible = "gpio-leds";
34
35                 lan {
36                         label = "c2-v1:green:lan";
37                         gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
38                 };
39
40                 usb {
41                         label = "c2-v1:green:usb";
42                         gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
43                         trigger-sources = <&ohci_port1>, <&ehci_port1>;
44                         linux,default-trigger = "usbport";
45                 };
46
47                 led_wps: wps {
48                         label = "c2-v1:green:wps";
49                         gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
50                 };
51
52                 wan {
53                         label = "c2-v1:green:wan";
54                         gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
55                 };
56
57                 wlan {
58                         label = "c2-v1:green:wlan";
59                         gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
60                 };
61         };
62
63         gpio-keys {
64                 compatible = "gpio-keys";
65
66                 reset_wps {
67                         label = "reset_wps";
68                         gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
69                         linux,code = <KEY_RESTART>;
70                 };
71
72                 rfkill {
73                         label = "rfkill";
74                         gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
75                         linux,code = <KEY_RFKILL>;
76                 };
77         };
78
79         rtl8367rb {
80                 compatible = "realtek,rtl8367b", "rtl8367b";
81                 cpu_port = <6>;
82                 realtek,extif1 = <1 0 1 1 1 1 1 1 2>;
83                 mii-bus = <&mdio0>;
84         };
85 };
86
87 &spi0 {
88         status = "okay";
89
90         m25p80@0 {
91                 compatible = "jedec,spi-nor";
92                 reg = <0>;
93                 spi-max-frequency = <10000000>;
94
95                 partitions {
96                         compatible = "fixed-partitions";
97                         #address-cells = <1>;
98                         #size-cells = <1>;
99
100                         partition@0 {
101                                 label = "u-boot";
102                                 reg = <0x0 0x20000>;
103                                 read-only;
104                         };
105
106                         partition@20000 {
107                                 label = "firmware";
108                                 reg = <0x20000 0x7a0000>;
109                         };
110
111                         partition@7c0000 {
112                                 label = "config";
113                                 reg = <0x7c0000 0x10000>;
114                                 read-only;
115                         };
116
117                         rom: partition@7d0000 {
118                                 label = "rom";
119                                 reg = <0x7d0000 0x10000>;
120                                 read-only;
121                         };
122
123                         partition@7e0000 {
124                                 label = "romfile";
125                                 reg = <0x7e0000 0x10000>;
126                                 read-only;
127                         };
128
129                         radio: partition@7f0000 {
130                                 label = "radio";
131                                 reg = <0x7f0000 0x10000>;
132                                 read-only;
133                         };
134                 };
135         };
136 };
137
138 &ethernet {
139         status = "okay";
140         mtd-mac-address = <&rom 0xf100>;
141         pinctrl-names = "default";
142         pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
143
144         port@5 {
145                 status = "okay";
146                 mediatek,fixed-link = <1000 1 1 1>;
147                 phy-mode = "rgmii";
148         };
149
150         mdio0: mdio-bus {
151                 status = "okay";
152         };
153 };
154
155
156 &gpio1 {
157         status = "okay";
158 };
159
160 &gpio2 {
161         status = "okay";
162 };
163
164 &gpio3 {
165         status = "okay";
166 };
167
168 &wmac {
169         ralink,mtd-eeprom = <&radio 0>;
170         mtd-mac-address = <&rom 0xf100>;
171 };
172
173 &ehci {
174         status = "okay";
175 };
176
177 &ohci {
178         status = "okay";
179 };
180
181 &pcie {
182         status = "okay";
183 };
184
185 &pcie0 {
186         mt76@0,0 {
187                 reg = <0x0000 0 0 0 0>;
188                 mediatek,mtd-eeprom = <&radio 0x8000>;
189         };
190 };