ramips: mt7620n: convert to 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 compatible = "mac-base";
110 reg = <0x2008 0x6>;
111 #nvmem-cell-cells = <1>;
112 };
113 };
114 };
115
116 radio: partition@7f0000 {
117 label = "radio";
118 reg = <0x7f0000 0x10000>;
119 read-only;
120
121 nvmem-layout {
122 compatible = "fixed-layout";
123 #address-cells = <1>;
124 #size-cells = <1>;
125
126 eeprom_radio_0: eeprom@0 {
127 reg = <0x0 0x400>;
128 };
129
130 eeprom_radio_8000: eeprom@8000 {
131 reg = <0x8000 0x200>;
132 };
133 };
134 };
135 };
136 };
137 };
138
139 &state_default {
140 gpio {
141 groups = "p4led_an", "p3led_an", "p2led_an", "p1led_an",
142 "p0led_an", "wled_an", "i2c", "wdt", "refclk";
143 function = "gpio";
144 };
145 };
146
147 &ethernet {
148 nvmem-cells = <&macaddr_config_2008 0>;
149 nvmem-cell-names = "mac-address";
150 };
151
152 &wmac {
153 status = "okay";
154
155 nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_2008 1>;
156 nvmem-cell-names = "eeprom", "mac-address";
157 };
158
159 &pcie {
160 status = "okay";
161 };
162
163 &pcie0 {
164 mt76@0,0 {
165 reg = <0x0000 0 0 0 0>;
166 ieee80211-freq-limit = <5000000 6000000>;
167 nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_2008 2>;
168 nvmem-cell-names = "eeprom", "mac-address";
169 };
170 };