cc979df26a6725ef6ad6288ad97028f495d28221
[openwrt/staging/nbd.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 compatible = "nvmem-cells";
97 label = "factory";
98 reg = <0x40000 0x10000>;
99 #address-cells = <1>;
100 #size-cells = <1>;
101 read-only;
102
103 eeprom_factory_0: eeprom@0 {
104 reg = <0x0 0x4da8>;
105 };
106
107 macaddr_factory_e000: macaddr@e000 {
108 reg = <0xe000 0x6>;
109 };
110 };
111
112 partition@50000 {
113 compatible = "denx,uimage";
114 label = "firmware";
115 reg = <0x50000 0xfb0000>;
116 };
117 };
118 };
119 };
120
121 &pcie {
122 status = "okay";
123 };
124
125 &pcie0 {
126 wifi@0,0 {
127 compatible = "mediatek,mt76";
128 reg = <0x0000 0 0 0 0>;
129 nvmem-cells = <&eeprom_factory_0>;
130 nvmem-cell-names = "eeprom";
131 /* The correct MAC addresses are set in 10_fix_wifi_mac. */
132 };
133 };
134
135 &gmac0 {
136 nvmem-cells = <&macaddr_factory_e000>;
137 nvmem-cell-names = "mac-address";
138 };
139
140 &switch0 {
141 ports {
142 port@0 {
143 status = "okay";
144 label = "lan";
145 };
146 };
147 };
148
149 &ethernet {
150 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
151 };
152
153 &state_default {
154 gpio {
155 groups = "uart3", "jtag", "wdt";
156 function = "gpio";
157 };
158 };