ramips: convert MT7915 EEPROM to NVMEM format
[openwrt/staging/nbd.git] / target / linux / ramips / dts / mt7621_cudy_x6.dtsi
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 aliases {
10 led-boot = &led_internet_blue;
11 led-failsafe = &led_internet_red;
12 led-running = &led_internet_blue;
13 led-upgrade = &led_internet_red;
14 label-mac-device = &gmac0;
15 };
16
17 chosen {
18 bootargs = "console=ttyS0,115200";
19 };
20
21 keys {
22 compatible = "gpio-keys";
23
24 reset {
25 label = "reset";
26 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
27 linux,code = <KEY_RESTART>;
28 };
29
30 wps {
31 label = "wps";
32 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
33 linux,code = <KEY_WPS_BUTTON>;
34 };
35 };
36
37 leds {
38 compatible = "gpio-leds";
39
40 led_internet_blue: internet_blue {
41 label = "blue:internet";
42 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
43 };
44
45 led_internet_red: internet_red {
46 label = "red:internet";
47 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
48 };
49 };
50
51 };
52
53 &spi0 {
54 status = "okay";
55
56 flash@0 {
57 compatible = "jedec,spi-nor";
58 reg = <0>;
59 spi-max-frequency = <50000000>;
60
61 partitions: partitions {
62 compatible = "fixed-partitions";
63 #address-cells = <1>;
64 #size-cells = <1>;
65
66 partition@0 {
67 label = "u-boot";
68 reg = <0x0 0x30000>;
69 read-only;
70 };
71
72 partition@30000 {
73 label = "u-boot-env";
74 reg = <0x30000 0x10000>;
75 read-only;
76 };
77
78 factory: partition@40000 {
79 compatible = "nvmem-cells";
80 label = "factory";
81 reg = <0x40000 0x10000>;
82 #address-cells = <1>;
83 #size-cells = <1>;
84 read-only;
85
86 eeprom_factory_0: eeprom@0 {
87 reg = <0x0 0xe00>;
88 };
89 };
90
91 /* additional partitions in DTS */
92 };
93 };
94 };
95
96 &pcie {
97 status = "okay";
98 };
99
100 &pcie1 {
101 wifi:wifi@0,0 {
102 compatible = "mediatek,mt76";
103 reg = <0x0000 0 0 0 0>;
104 nvmem-cells = <&eeprom_factory_0>;
105 nvmem-cell-names = "eeprom";
106 mediatek,disable-radar-background;
107 };
108 };
109
110 &gmac1 {
111 status = "okay";
112 label = "wan";
113 phy-handle = <&ethphy4>;
114 };
115
116 &mdio {
117 ethphy4: ethernet-phy@4 {
118 reg = <4>;
119 };
120 };
121
122 &switch0 {
123 ports {
124 port@0 {
125 status = "okay";
126 label = "lan1";
127 };
128
129 port@1 {
130 status = "okay";
131 label = "lan2";
132 };
133
134 port@2 {
135 status = "okay";
136 label = "lan3";
137 };
138
139 port@3 {
140 status = "okay";
141 label = "lan4";
142 };
143 };
144 };
145
146 &state_default {
147 gpio {
148 groups = "uart3", "jtag";
149 function = "gpio";
150 };
151 };