ramips: mt7621: convert to nvmem-layout
[openwrt/staging/hauke.git] / target / linux / ramips / dts / mt7621_dlink_dxx-1xx0-x1.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 label-mac-device = &gmac0;
11
12 led-boot = &led_status_red;
13 led-failsafe = &led_status_green;
14 led-running = &led_status_green;
15 led-upgrade = &led_status_red;
16 };
17
18 keys {
19 compatible = "gpio-keys";
20
21 reset {
22 label = "reset";
23 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
24 linux,code = <KEY_RESTART>;
25 debounce-interval = <60>;
26 };
27
28 wps {
29 label = "wps";
30 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_WPS_BUTTON>;
32 };
33 };
34
35 leds {
36 compatible = "gpio-leds";
37
38 led_status_red: status_red {
39 label = "red:status";
40 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
41 };
42
43 led_status_green: status_green {
44 label = "green:status";
45 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
46 };
47
48 rssi_low_red {
49 label = "red:rssilow";
50 gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
51 };
52
53 rssi_low_green {
54 label = "green:rssilow";
55 gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
56 };
57
58 rssi_med_green {
59 label = "green:rssimed";
60 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
61 };
62
63 rssi_high_green {
64 label = "green:rssihigh";
65 gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
66 };
67 };
68 };
69
70 &spi0 {
71 status = "okay";
72
73 flash@0 {
74 compatible = "jedec,spi-nor";
75 reg = <0>;
76 spi-max-frequency = <50000000>;
77
78 partitions {
79 compatible = "fixed-partitions";
80 #address-cells = <1>;
81 #size-cells = <1>;
82
83 partition@0 {
84 label = "u-boot";
85 reg = <0x0 0x30000>;
86 read-only;
87 };
88
89 partition@30000 {
90 label = "u-boot-env";
91 reg = <0x30000 0x10000>;
92 read-only;
93 };
94
95 factory: partition@40000 {
96 label = "factory";
97 reg = <0x40000 0x10000>;
98 read-only;
99
100 nvmem-layout {
101 compatible = "fixed-layout";
102 #address-cells = <1>;
103 #size-cells = <1>;
104
105 eeprom_factory_0: eeprom@0 {
106 reg = <0x0 0x4da8>;
107 };
108
109 macaddr_factory_e000: macaddr@e000 {
110 reg = <0xe000 0x6>;
111 };
112 };
113 };
114
115 partition@50000 {
116 compatible = "denx,uimage";
117 label = "firmware";
118 reg = <0x50000 0xfb0000>;
119 };
120 };
121 };
122 };
123
124 &pcie {
125 status = "okay";
126 };
127
128 &pcie0 {
129 wifi@0,0 {
130 compatible = "mediatek,mt76";
131 reg = <0x0000 0 0 0 0>;
132 nvmem-cells = <&eeprom_factory_0>;
133 nvmem-cell-names = "eeprom";
134 /* The correct MAC addresses are set in 10_fix_wifi_mac. */
135 };
136 };
137
138 &gmac0 {
139 nvmem-cells = <&macaddr_factory_e000>;
140 nvmem-cell-names = "mac-address";
141 };
142
143 &switch0 {
144 ports {
145 port@0 {
146 status = "okay";
147 label = "lan";
148 };
149 };
150 };
151
152 &ethernet {
153 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
154 };
155
156 &state_default {
157 gpio {
158 groups = "uart3", "jtag", "wdt";
159 function = "gpio";
160 };
161 };