ramips: convert mtd-mac-address to nvmem implementation
[openwrt/openwrt.git] / target / linux / ramips / dts / rt3883_trendnet_tew-692gr.dts
1 #include "rt3883.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "trendnet,tew-692gr", "ralink,rt3883-soc";
8 model = "TRENDnet TEW-692GR";
9
10 aliases {
11 led-boot = &led_wps_green;
12 led-failsafe = &led_wps_green;
13 led-running = &led_wps_green;
14 led-upgrade = &led_wps_green;
15 };
16
17 flash@1c000000 {
18 compatible = "cfi-flash";
19 reg = <0x1c000000 0x800000>;
20 bank-width = <2>;
21
22 partitions {
23 compatible = "fixed-partitions";
24 #address-cells = <1>;
25 #size-cells = <1>;
26
27 partition@0 {
28 reg = <0x0 0x0030000>;
29 label = "u-boot";
30 read-only;
31 };
32
33 partition@30000 {
34 reg = <0x00030000 0x00010000>;
35 label = "u-boot-env";
36 read-only;
37 };
38
39 factory: partition@40000 {
40 reg = <0x00040000 0x00010000>;
41 label = "factory";
42 read-only;
43 };
44
45 partition@50000 {
46 compatible = "denx,uimage";
47 reg = <0x00050000 0x007b0000>;
48 label = "firmware";
49 };
50 };
51 };
52
53 keys {
54 compatible = "gpio-keys-polled";
55 poll-interval = <100>;
56
57 reset {
58 label = "reset";
59 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
60 linux,code = <KEY_RESTART>;
61 };
62
63 wps {
64 label = "wps";
65 gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
66 linux,code = <KEY_WPS_BUTTON>;
67 };
68 };
69
70 leds {
71 compatible = "gpio-leds";
72
73 wps {
74 label = "orange:wps";
75 gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
76 };
77
78 led_wps_green: wps2 {
79 label = "green:wps";
80 gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
81 };
82 };
83 };
84
85 &gpio1 {
86 status = "okay";
87 };
88
89 &state_default {
90 gpio {
91 groups = "spi", "i2c", "jtag", "uartf";
92 function = "gpio";
93 };
94 };
95
96 &ethernet {
97 status = "okay";
98 nvmem-cells = <&macaddr_factory_4>;
99 nvmem-cell-names = "mac-address";
100
101 port@0 {
102 phy-handle = <&phy0>;
103 phy-mode = "rgmii";
104 };
105
106 mdio-bus {
107 status = "okay";
108
109 phy0: ethernet-phy@0 {
110 reg = <0>;
111 phy-mode = "rgmii";
112
113 qca,ar8327-initvals = <
114 0x04 0x07600000 /* PORT0 PAD MODE CTRL */
115 0x0c 0x07600000 /* PORT6 PAD MODE CTRL */
116 0x10 0x40000000 /* Power-on Strapping: 176-pin interface configuration */
117 0x50 0xc437c437 /* LED Control Register 0 */
118 0x54 0xc337c337 /* LED Control Register 1 */
119 0x58 0x00000000 /* LED Control Register 2 */
120 0x5c 0x03ffff00 /* LED Control Register 3 */
121 0x7c 0x0000007e /* PORT0_STATUS */
122 0x94 0x0000007e /* PORT6 STATUS */
123 >;
124 };
125 };
126 };
127
128 &pci {
129 status = "okay";
130 };
131
132 &pci1 {
133 status = "okay";
134
135 wifi@0,0 {
136 compatible = "pci0,0";
137 reg = < 0x10000 0 0 0 0 >;
138 ralink,2ghz = <0>;
139 };
140 };
141
142 &wmac {
143 status = "okay";
144 ralink,mtd-eeprom = <&factory 0x0>;
145 ralink,5ghz = <0>;
146 nvmem-cells = <&macaddr_factory_4>;
147 nvmem-cell-names = "mac-address";
148 mac-address-increment = <3>;
149 };
150
151 &factory {
152 compatible = "nvmem-cells";
153 #address-cells = <1>;
154 #size-cells = <1>;
155
156 macaddr_factory_4: macaddr@4 {
157 reg = <0x4 0x6>;
158 };
159 };