ramips: mt7621: convert to nvmem-layout
[openwrt/openwrt.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 label = "factory";
99 reg = <0x40000 0x10000>;
100 read-only;
101
102 nvmem-layout {
103 compatible = "fixed-layout";
104 #address-cells = <1>;
105 #size-cells = <1>;
106
107 eeprom_factory_0: eeprom@0 {
108 reg = <0x0 0x200>;
109 };
110
111 macaddr_factory_4000: macaddr@4000 {
112 reg = <0x4000 0x6>;
113 };
114 };
115 };
116
117 partition@50000 {
118 compatible = "denx,uimage";
119 label = "firmware";
120 reg = <0x50000 0xf80000>;
121 };
122
123 partition@ff0000 {
124 label = "art";
125 reg = <0xff0000 0x10000>;
126 };
127 };
128 };
129 };
130
131 &sdhci {
132 status = "okay";
133 };
134
135 &ehci {
136 status = "okay";
137 };
138
139 &ohci {
140 status = "okay";
141 };
142
143 &ethernet {
144 nvmem-cells = <&macaddr_factory_4000>;
145 nvmem-cell-names = "mac-address";
146
147 mediatek,portmap = "wllll";
148 };
149
150 &wmac {
151 nvmem-cells = <&eeprom_factory_0>;
152 nvmem-cell-names = "eeprom";
153 };
154
155 &state_default {
156 gpio {
157 groups = "wled","ephy","uartf","i2c";
158 function = "gpio";
159 };
160 };