ramips: mt7621: convert to nvmem-layout
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_belkin_rt1800.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/leds/common.h>
8
9 / {
10 compatible = "belkin,rt1800", "mediatek,mt7621-soc";
11 model = "Belkin RT1800";
12
13 aliases {
14 led-boot = &led_power;
15 led-failsafe = &led_power;
16 led-running = &led_power;
17 led-upgrade = &led_power;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 keys {
25 compatible = "gpio-keys";
26
27 reset {
28 label = "reset";
29 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
30 linux,code = <KEY_RESTART>;
31 };
32
33 wps {
34 label = "wps";
35 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
36 linux,code = <KEY_WPS_BUTTON>;
37 };
38 };
39
40 leds {
41 compatible = "gpio-leds";
42
43 led-wps {
44 color = <LED_COLOR_ID_AMBER>;
45 function = LED_FUNCTION_WPS;
46 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
47 };
48
49 led_power: led-power {
50 label = "white:power";
51 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
52 default-state = "on";
53 };
54
55 led-wan2 {
56 color = <LED_COLOR_ID_AMBER>;
57 function = LED_FUNCTION_WAN;
58 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
59 };
60
61 led-wan {
62 color = <LED_COLOR_ID_WHITE>;
63 function = LED_FUNCTION_WAN;
64 gpios = <&switch0 0 GPIO_ACTIVE_LOW>;
65 };
66 };
67 };
68
69 &nand {
70 status = "okay";
71
72 partitions {
73 compatible = "fixed-partitions";
74 #address-cells = <1>;
75 #size-cells = <1>;
76
77 partition@0 {
78 label = "Boot";
79 reg = <0x0 0x80000>;
80 read-only;
81 };
82
83 partition@80000 {
84 label = "Config";
85 reg = <0x80000 0x80000>;
86 };
87
88 factory: partition@100000 {
89 label = "Factory";
90 reg = <0x100000 0x80000>;
91 read-only;
92
93 nvmem-layout {
94 compatible = "fixed-layout";
95 #address-cells = <1>;
96 #size-cells = <1>;
97
98 eeprom_factory_0: eeprom@0 {
99 reg = <0x0 0xe00>;
100 };
101 };
102 };
103
104 partition@180000 {
105 label = "firmware";
106 reg = <0x180000 0x3000000>;
107
108 compatible = "fixed-partitions";
109 #address-cells = <1>;
110 #size-cells = <1>;
111
112 partition@0 {
113 label = "kernel";
114 reg = <0x0 0x400000>;
115 };
116
117 partition@400000 {
118 label = "ubi";
119 reg = <0x400000 0x2c00000>;
120 };
121 };
122
123 partition@3180000 {
124 label = "alt_firmware";
125 reg = <0x3180000 0x3000000>;
126 read-only;
127 };
128
129 partition@6180000 {
130 label = "cbtinfo";
131 reg = <0x6180000 0x80000>;
132 read-only;
133 };
134 /* seems to be the end here. Can't read past 0x6200000 */
135 };
136 };
137
138 &pcie {
139 status = "okay";
140 };
141
142 &pcie1 {
143 wifi@0,0 {
144 compatible = "mediatek,mt76";
145 reg = <0x0000 0 0 0 0>;
146 nvmem-cells = <&eeprom_factory_0>;
147 nvmem-cell-names = "eeprom";
148 };
149 };
150
151 &state_default {
152 gpio {
153 groups = "i2c", "uart3", "jtag", "wdt";
154 function = "gpio";
155 };
156 };
157
158 &gmac1 {
159 status = "okay";
160 label = "wan";
161 phy-handle = <&ethphy0>;
162 };
163
164 &mdio {
165 ethphy0: ethernet-phy@0 {
166 reg = <0>;
167 };
168 };
169
170 &switch0 {
171 gpio-controller;
172 #gpio-cells = <2>;
173
174 ports {
175 port@1 {
176 status = "okay";
177 label = "lan4";
178 };
179
180 port@2 {
181 status = "okay";
182 label = "lan3";
183 };
184
185 port@3 {
186 status = "okay";
187 label = "lan2";
188 };
189
190 port@4 {
191 status = "okay";
192 label = "lan1";
193 };
194 };
195 };