ramips: convert rt2x00 EEPROM to NVMEM format
[openwrt/staging/wigyori.git] / target / linux / ramips / dts / mt7620a_glinet_gl-mt300a.dts
1 #include "mt7620a.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "glinet,gl-mt300a", "ralink,mt7620a-soc";
8 model = "GL-MT300A";
9
10 aliases {
11 label-mac-device = &wmac;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200";
16 };
17
18 leds {
19 compatible = "gpio-leds";
20
21 wan {
22 label = "gl-mt300a:wan";
23 gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
24 };
25
26 lan {
27 label = "gl-mt300a:lan";
28 gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
29 };
30
31 wlan {
32 label = "gl-mt300a:wlan";
33 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
34 };
35
36 usb {
37 label = "gl-mt300a:usb";
38 gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
39 };
40 };
41
42 keys {
43 compatible = "gpio-keys";
44
45 reset {
46 label = "reset";
47 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
48 linux,code = <KEY_RESTART>;
49 };
50
51 BTN_0 {
52 label = "BTN_0";
53 gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
54 linux,code = <BTN_0>;
55 };
56
57 BTN_1 {
58 label = "BTN_1";
59 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
60 linux,code = <BTN_1>;
61 };
62 };
63 };
64
65 &gpio2 {
66 status = "okay";
67 };
68
69 &gpio3 {
70 status = "okay";
71 };
72
73 &spi0 {
74 status = "okay";
75
76 flash@0 {
77 compatible = "jedec,spi-nor";
78 reg = <0>;
79 spi-max-frequency = <10000000>;
80
81 partitions {
82 compatible = "fixed-partitions";
83 #address-cells = <1>;
84 #size-cells = <1>;
85
86 partition@0 {
87 label = "u-boot";
88 reg = <0x0 0x30000>;
89 };
90
91 partition@30000 {
92 label = "u-boot-env";
93 reg = <0x30000 0x10000>;
94 read-only;
95 };
96
97 factory: partition@40000 {
98 compatible = "nvmem-cells";
99 label = "factory";
100 reg = <0x40000 0x10000>;
101 #address-cells = <1>;
102 #size-cells = <1>;
103 read-only;
104
105 eeprom_factory_0: eeprom@0 {
106 reg = <0x0 0x200>;
107 };
108
109 macaddr_factory_4000: macaddr@4000 {
110 reg = <0x4000 0x6>;
111 };
112 };
113
114 partition@50000 {
115 compatible = "denx,uimage";
116 label = "firmware";
117 reg = <0x50000 0xf80000>;
118 };
119
120 partition@ff0000 {
121 label = "art";
122 reg = <0xff0000 0x10000>;
123 };
124 };
125 };
126 };
127
128 &sdhci {
129 status = "okay";
130 };
131
132 &ehci {
133 status = "okay";
134 };
135
136 &ohci {
137 status = "okay";
138 };
139
140 &ethernet {
141 nvmem-cells = <&macaddr_factory_4000>;
142 nvmem-cell-names = "mac-address";
143
144 mediatek,portmap = "wllll";
145 };
146
147 &wmac {
148 nvmem-cells = <&eeprom_factory_0>;
149 nvmem-cell-names = "eeprom";
150 };
151
152 &state_default {
153 gpio {
154 groups = "wled","ephy","uartf","i2c";
155 function = "gpio";
156 };
157 };