ramips: convert mtd-mac-address to nvmem implementation
[openwrt/staging/wigyori.git] / target / linux / ramips / dts / mt7620a_dlink_dwr-118-a2.dts
1 #include "mt7620a.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "dlink,dwr-118-a2", "ralink,mt7620a-soc";
8 model = "D-Link DWR-118 A2";
9
10 aliases {
11 led-boot = &led_internet;
12 led-failsafe = &led_internet;
13 };
14
15 keys {
16 compatible = "gpio-keys";
17
18 wps {
19 label = "wps";
20 gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
21 linux,code = <KEY_WPS_BUTTON>;
22 };
23
24 reset {
25 label = "reset";
26 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
27 linux,code = <KEY_RESTART>;
28 };
29 };
30
31 leds {
32 compatible = "gpio-leds";
33
34 wan {
35 label = "green:wan";
36 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
37 };
38
39 led_internet: internet {
40 label = "green:internet";
41 gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
42 };
43
44 lan {
45 label = "green:lan";
46 gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
47 };
48
49 wlan2g {
50 label = "green:wlan2g";
51 gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
52 };
53
54 usb {
55 label = "green:usb";
56 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
57 trigger-sources = <&ohci_port1>, <&ehci_port1>;
58 linux,default-trigger = "usbport";
59 };
60 };
61
62 gpio_export {
63 compatible = "gpio-export";
64 #size-cells = <0>;
65
66 usb {
67 gpio-export,name = "usb";
68 gpio-export,output = <1>;
69 gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
70 };
71 };
72 };
73
74 &gpio1 {
75 status = "okay";
76 };
77
78 &gpio2 {
79 status = "okay";
80 };
81
82 &gpio3 {
83 status = "okay";
84 };
85
86 &spi0 {
87 status = "okay";
88
89 flash@0 {
90 compatible = "jedec,spi-nor";
91 reg = <0>;
92 spi-max-frequency = <50000000>;
93
94 partitions {
95 compatible = "fixed-partitions";
96 #address-cells = <1>;
97 #size-cells = <1>;
98
99 partition@0 {
100 label = "jboot";
101 reg = <0x0 0x10000>;
102 read-only;
103 };
104
105 partition@10000 {
106 compatible = "amit,jimage";
107 label = "firmware";
108 reg = <0x10000 0xfe0000>;
109 };
110
111 config: partition@ff0000 {
112 label = "config";
113 reg = <0xff0000 0x10000>;
114 read-only;
115 };
116 };
117 };
118 };
119
120 &ehci {
121 status = "okay";
122 };
123
124 &ohci {
125 status = "okay";
126 };
127
128 &state_default {
129 default {
130 groups = "ephy", "uartf", "spi refclk", "wled";
131 function = "gpio";
132 };
133 };
134
135 &pcie {
136 status = "okay";
137 };
138
139 &pcie0 {
140 wifi@0,0 {
141 reg = <0x0000 0 0 0 0>;
142 ieee80211-freq-limit = <5000000 6000000>;
143 nvmem-cells = <&macaddr_config_e4a8>;
144 nvmem-cell-names = "mac-address";
145 mac-address-increment = <(2)>;
146
147 led {
148 led-sources = <2>;
149 led-active-low;
150 };
151 };
152 };
153
154 &ethernet {
155 pinctrl-names = "default";
156 pinctrl-0 = <&rgmii1_pins &mdio_pins>;
157
158 mediatek,portmap = "wllll";
159
160 port@4 {
161 status = "okay";
162 phy-handle = <&phy0>;
163 phy-mode = "rgmii";
164 };
165
166 mdio-bus {
167 status = "okay";
168
169 phy0: ethernet-phy@0 {
170 reg = <0>;
171 phy-mode = "rgmii-rxid";
172 };
173 };
174 };
175
176 &gsw {
177 mediatek,port4-gmac;
178 mediatek,ephy-base = /bits/ 8 <2>;
179 };
180
181 &config {
182 compatible = "nvmem-cells";
183 #address-cells = <1>;
184 #size-cells = <1>;
185
186 macaddr_config_e4a8: macaddr@e4a8 {
187 reg = <0xe4a8 0x6>;
188 };
189 };