ramips: mt7621: convert to nvmem-layout
[openwrt/staging/stintel.git] / target / linux / ramips / dts / mt7621_totolink_x5000r.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
8 / {
9 compatible = "totolink,x5000r", "mediatek,mt7621-soc";
10 model = "TOTOLINK X5000R";
11
12 aliases {
13 led-boot = &led_sys;
14 led-failsafe = &led_sys;
15 led-running = &led_sys;
16 led-upgrade = &led_sys;
17 label-mac-device = &gmac0;
18 };
19
20 chosen {
21 stdout-path = "serial0:115200n8";
22 bootargs = "console=ttyS0,115200n8";
23 };
24
25 leds {
26 compatible = "gpio-leds";
27
28 led_sys: sys {
29 label = "blue:sys";
30 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
31 };
32 };
33
34 keys {
35 compatible = "gpio-keys";
36
37 reset {
38 label = "reset";
39 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
40 debounce-interval = <60>;
41 linux,code = <KEY_RESTART>;
42 };
43 };
44 };
45
46 &spi0 {
47 status = "okay";
48
49 flash@0 {
50 compatible = "jedec,spi-nor";
51 reg = <0>;
52 spi-max-frequency = <50000000>;
53 m25p,fast-read;
54
55 partitions {
56 compatible = "fixed-partitions";
57 #address-cells = <1>;
58 #size-cells = <1>;
59
60 partition@0 {
61 label = "u-boot";
62 reg = <0x0 0x30000>;
63 read-only;
64 };
65
66 partition@30000 {
67 label = "u-boot-env";
68 reg = <0x30000 0x10000>;
69 read-only;
70 };
71
72 factory: partition@40000 {
73 label = "factory";
74 reg = <0x40000 0x10000>;
75 read-only;
76
77 nvmem-layout {
78 compatible = "fixed-layout";
79 #address-cells = <1>;
80 #size-cells = <1>;
81
82 eeprom_factory_0: eeprom@0 {
83 reg = <0x0 0xe00>;
84 };
85
86 macaddr_factory_e000: macaddr@e000 {
87 reg = <0xe000 0x6>;
88 };
89
90 macaddr_factory_e006: macaddr@e006 {
91 reg = <0xe006 0x6>;
92 };
93 };
94 };
95
96 partition@50000 {
97 compatible = "denx,uimage";
98 label = "firmware";
99 reg = <0x50000 0xfb0000>;
100 };
101 };
102 };
103 };
104
105 &pcie {
106 status = "okay";
107 };
108
109 &pcie1 {
110 wifi@0,0 {
111 compatible = "mediatek,mt76";
112 reg = <0x0000 0 0 0 0>;
113 nvmem-cells = <&eeprom_factory_0>;
114 nvmem-cell-names = "eeprom";
115 mediatek,disable-radar-background;
116 };
117 };
118
119 &gmac0 {
120 nvmem-cells = <&macaddr_factory_e000>;
121 nvmem-cell-names = "mac-address";
122 };
123
124 &gmac1 {
125 status = "okay";
126 label = "wan";
127 phy-handle = <&ethphy4>;
128
129 nvmem-cells = <&macaddr_factory_e006>;
130 nvmem-cell-names = "mac-address";
131 };
132
133 &mdio {
134 ethphy4: ethernet-phy@4 {
135 reg = <4>;
136 };
137 };
138
139 &switch0 {
140 ports {
141 port@0 {
142 status = "okay";
143 label = "lan1";
144 };
145
146 port@1 {
147 status = "okay";
148 label = "lan2";
149 };
150
151 port@2 {
152 status = "okay";
153 label = "lan3";
154 };
155
156 port@3 {
157 status = "okay";
158 label = "lan4";
159 };
160 };
161 };
162
163 &state_default {
164 gpio {
165 groups = "i2c", "wdt";
166 function = "gpio";
167 };
168 };