ramips: add support for TP-Link RE500 v1
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_tplink_rexx0-v1.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
13 chosen {
14 bootargs = "console=ttyS0,57600";
15 };
16
17 keys {
18 compatible = "gpio-keys";
19
20 wps {
21 label = "wps";
22 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
23 debounce-interval = <60>;
24 linux,code = <KEY_WPS_BUTTON>;
25 };
26
27 power {
28 label = "power";
29 gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
30 debounce-interval = <60>;
31 linux,code = <KEY_POWER>;
32 };
33
34 led {
35 label = "led";
36 gpios = <&gpio 30 GPIO_ACTIVE_LOW>;
37 debounce-interval = <60>;
38 linux,code = <KEY_LIGHTS_TOGGLE>;
39 };
40
41 reset {
42 label = "reset";
43 gpios = <&gpio 31 GPIO_ACTIVE_LOW>;
44 debounce-interval = <60>;
45 linux,code = <KEY_RESTART>;
46 };
47 };
48 };
49
50 &spi0 {
51 status = "okay";
52
53 flash@0 {
54 compatible = "jedec,spi-nor";
55 reg = <0>;
56 spi-max-frequency = <40000000>;
57
58 partitions {
59 compatible = "fixed-partitions";
60 #address-cells = <1>;
61 #size-cells = <1>;
62
63 partition@0 {
64 label = "u-boot";
65 reg = <0x0 0x20000>;
66 read-only;
67 };
68
69 partition@20000 {
70 compatible = "tplink,firmware";
71 label = "firmware";
72 reg = <0x20000 0xde0000>;
73 };
74
75 config: partition@e00000 {
76 label = "config";
77 reg = <0xe00000 0x50000>;
78 read-only;
79 };
80
81 /* range 0xe50000 to 0xff0000 is empty in vendor
82 * firmware, so we do not use it either
83 */
84
85 radio: partition@ff0000 {
86 label = "radio";
87 reg = <0xff0000 0x10000>;
88 read-only;
89 };
90 };
91 };
92 };
93
94 &pcie {
95 status = "okay";
96 };
97
98 &pcie0 {
99 wifi@0,0 {
100 compatible = "mediatek,mt76";
101 reg = <0x0000 0 0 0 0>;
102 mediatek,mtd-eeprom = <&radio 0x0>;
103 mtd-mac-address = <&config 0x10008>;
104 mtd-mac-address-increment = <1>;
105 ieee80211-freq-limit = <2400000 2500000>;
106 };
107 };
108
109 &pcie1 {
110 wifi@0,0 {
111 compatible = "mediatek,mt76";
112 reg = <0x0000 0 0 0 0>;
113 mediatek,mtd-eeprom = <&radio 0x8000>;
114 mtd-mac-address = <&config 0x10008>;
115 mtd-mac-address-increment = <2>;
116 ieee80211-freq-limit = <5000000 6000000>;
117 };
118 };
119
120 &gmac0 {
121 mtd-mac-address = <&config 0x10008>;
122 };
123
124 &switch0 {
125 ports {
126 port@0 {
127 status = "okay";
128 label = "lan";
129 };
130 };
131 };