ramips: clean and improve MAC address setup in 02_network
[oweals/openwrt.git] / target / linux / ramips / dts / mt7620a_tplink_archer-c20i.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,archer-c20i", "ralink,mt7620a-soc";
10         model = "TP-Link Archer C20i";
11
12         chosen {
13                 bootargs = "console=ttyS0,115200";
14         };
15
16         leds {
17                 compatible = "gpio-leds";
18                 lan {
19                         label = "archer-c20i:blue:lan";
20                         gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
21                 };
22                 usb {
23                         label = "archer-c20i:blue:usb";
24                         gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
25                         trigger-sources = <&ohci_port1>, <&ehci_port1>;
26                         linux,default-trigger = "usbport";
27                 };
28                 wps {
29                         label = "archer-c20i:blue:wps";
30                         gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
31                 };
32                 wan {
33                         label = "archer-c20i:blue:wan";
34                         gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
35                 };
36                 wlan {
37                         label = "archer-c20i:blue:wlan";
38                         gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
39                 };
40         };
41
42         keys {
43                 compatible = "gpio-keys";
44
45                 rfkill {
46                         label = "rfkill";
47                         gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
48                         linux,code = <KEY_RFKILL>;
49                 };
50                 reset_wps {
51                         label = "reset_wps";
52                         gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
53                         linux,code = <KEY_RESTART>;
54                 };
55         };
56 };
57
58 &gpio1 {
59         status = "okay";
60 };
61
62 &gpio2 {
63         status = "okay";
64 };
65
66 &gpio3 {
67         status = "okay";
68 };
69
70 &spi0 {
71         status = "okay";
72
73         m25p80@0 {
74                 compatible = "jedec,spi-nor";
75                 reg = <0>;
76                 spi-max-frequency = <10000000>;
77
78                 partitions {
79                         compatible = "fixed-partitions";
80                         #address-cells = <1>;
81                         #size-cells = <1>;
82
83                         partition@0 {
84                                 label = "u-boot";
85                                 reg = <0x0 0x20000>;
86                                 read-only;
87                         };
88
89                         partition@20000 {
90                                 compatible = "tplink,firmware";
91                                 label = "firmware";
92                                 reg = <0x20000 0x7a0000>;
93                         };
94
95                         partition@7c0000 {
96                                 label = "config";
97                                 reg = <0x7c0000 0x10000>;
98                         };
99
100                         rom: partition@7d0000 {
101                                 label = "rom";
102                                 reg = <0x7d0000 0x10000>;
103                         };
104
105                         partition@7e0000 {
106                                 label = "romfile";
107                                 reg = <0x7e0000 0x10000>;
108                         };
109
110                         radio: partition@7f0000 {
111                                 label = "radio";
112                                 reg = <0x7f0000 0x10000>;
113                         };
114                 };
115         };
116 };
117
118 &pinctrl {
119         state_default: pinctrl0 {
120                 gpio {
121                         ralink,group = "i2c", "uartf", "rgmii1", "rgmii2", "wled", "nd_sd", "ephy", "spi refclk";
122                         ralink,function = "gpio";
123                 };
124         };
125 };
126
127 &ethernet {
128                 pinctrl-names = "default";
129                 mtd-mac-address = <&rom 0xf100>;
130                 mediatek,portmap = "wllll";
131         };
132
133 &ehci {
134         status = "okay";
135 };
136
137 &ohci {
138         status = "okay";
139 };
140
141 &gsw {
142         mediatek,port4 = "ephy";
143 };
144
145 &wmac {
146         ralink,mtd-eeprom = <&radio 0>;
147 };
148
149 &pcie {
150         status = "okay";
151 };
152
153 &pcie0 {
154         mt76@0,0 {
155                 reg = <0x0000 0 0 0 0>;
156                 mediatek,mtd-eeprom = <&radio 32768>;
157                 ieee80211-freq-limit = <5000000 6000000>;
158         };
159 };