ramips: mt7628: use nvmem-layout
[openwrt/staging/hauke.git] / target / linux / ramips / dts / mt7628an_tplink_re200.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7628an.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 aliases {
10 label-mac-device = &ethernet;
11 led-boot = &led_power;
12 led-failsafe = &led_power;
13 led-running = &led_power;
14 led-upgrade = &led_power;
15 };
16
17 chosen {
18 bootargs = "console=ttyS0,57600n8";
19 };
20
21 keys {
22 compatible = "gpio-keys";
23
24 reset {
25 label = "reset";
26 gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
27 linux,code = <KEY_RESTART>;
28 };
29
30 wps {
31 label = "wps";
32 gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
33 linux,code = <KEY_WPS_BUTTON>;
34 };
35 };
36
37 leds {
38 compatible = "gpio-leds";
39
40 wps {
41 label = "green:wps";
42 gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
43 };
44
45 wifi {
46 label = "green:wifi";
47 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
48 };
49
50 lan {
51 label = "green:lan";
52 gpios = <&gpio 39 GPIO_ACTIVE_LOW>;
53 };
54
55 led_power: power {
56 label = "green:power";
57 };
58
59 wifi2g_green {
60 label = "green:wifi2g";
61 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
62 linux,default-trigger = "phy0tpt";
63 };
64
65 wifi5g_green {
66 label = "green:wifi5g";
67 gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
68 linux,default-trigger = "phy1tpt";
69 };
70 };
71 };
72
73 &spi0 {
74 status = "okay";
75
76 flash@0 {
77 compatible = "jedec,spi-nor";
78 reg = <0>;
79 spi-max-frequency = <50000000>;
80
81 partitions {
82 compatible = "fixed-partitions";
83 #address-cells = <1>;
84 #size-cells = <1>;
85
86 partition@0 {
87 label = "u-boot";
88 reg = <0x0 0x20000>;
89 read-only;
90 };
91
92 partition@20000 {
93 compatible = "tplink,firmware";
94 label = "firmware";
95 reg = <0x20000 0x7a0000>;
96 };
97
98 config: partition@7c0000 {
99 label = "config";
100 reg = <0x7c0000 0x30000>;
101 read-only;
102
103 nvmem-layout {
104 compatible = "fixed-layout";
105 #address-cells = <1>;
106 #size-cells = <1>;
107
108 macaddr_config_2008: macaddr@2008 {
109 reg = <0x2008 0x6>;
110 };
111 };
112 };
113
114 radio: partition@7f0000 {
115 label = "radio";
116 reg = <0x7f0000 0x10000>;
117 read-only;
118
119 nvmem-layout {
120 compatible = "fixed-layout";
121 #address-cells = <1>;
122 #size-cells = <1>;
123
124 eeprom_radio_0: eeprom@0 {
125 reg = <0x0 0x400>;
126 };
127
128 eeprom_radio_8000: eeprom@8000 {
129 reg = <0x8000 0x200>;
130 };
131 };
132 };
133 };
134 };
135 };
136
137 &state_default {
138 gpio {
139 groups = "p4led_an", "p3led_an", "p2led_an", "p1led_an",
140 "p0led_an", "wled_an", "i2c", "wdt", "refclk";
141 function = "gpio";
142 };
143 };
144
145 &ethernet {
146 nvmem-cells = <&macaddr_config_2008>;
147 nvmem-cell-names = "mac-address";
148 };
149
150 &wmac {
151 status = "okay";
152
153 nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_2008>;
154 nvmem-cell-names = "eeprom", "mac-address";
155 mac-address-increment = <1>;
156 };
157
158 &pcie {
159 status = "okay";
160 };
161
162 &pcie0 {
163 mt76@0,0 {
164 reg = <0x0000 0 0 0 0>;
165 ieee80211-freq-limit = <5000000 6000000>;
166 nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_2008>;
167 nvmem-cell-names = "eeprom", "mac-address";
168 mac-address-increment = <2>;
169 };
170 };