ramips: convert mtd-mac-address to nvmem for D-Link DIR-8xx
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_dlink_dir-853-r1.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include "mt7621_dlink_flash-16m-r1.dtsi"
6
7 #include <dt-bindings/gpio/gpio.h>
8 #include <dt-bindings/input/input.h>
9
10 / {
11 compatible = "dlink,dir-853-r1", "mediatek,mt7621-soc";
12 model = "D-Link DIR-853 R1";
13
14 aliases {
15 label-mac-device = &wan;
16
17 led-boot = &led_power_orange;
18 led-failsafe = &led_power_blue;
19 led-running = &led_power_blue;
20 led-upgrade = &led_net_orange;
21 };
22
23 leds {
24 compatible = "gpio-leds";
25
26 led_power_orange: power_orange {
27 label = "orange:power";
28 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
29 };
30
31 led_power_blue: power_blue {
32 label = "blue:power";
33 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
34 };
35
36 led_net_orange: net_orange {
37 label = "orange:net";
38 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
39 };
40
41 net_blue {
42 label = "blue:net";
43 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
44 };
45
46 usb_blue {
47 label = "blue:usb";
48 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
49 trigger-sources = <&xhci_ehci_port1>;
50 linux,default-trigger = "usbport";
51 };
52
53 wlan2g {
54 label = "blue:wlan2g";
55 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
56 linux,default-trigger = "phy0radio";
57 };
58
59 wlan5g {
60 label = "blue:wlan5g";
61 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
62 linux,default-trigger = "phy1radio";
63 };
64 };
65
66 keys {
67 compatible = "gpio-keys";
68
69 reset {
70 label = "reset";
71 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
72 linux,code = <KEY_RESTART>;
73 };
74
75 wps {
76 label = "wps";
77 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
78 linux,code = <KEY_WPS_BUTTON>;
79 };
80
81 wifi {
82 label = "wifi";
83 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
84 linux,code = <KEY_RFKILL>;
85 };
86 };
87 };
88
89 &pcie {
90 status = "okay";
91 };
92
93 &pcie0 {
94 wifi@0,0 {
95 compatible = "mediatek,mt76";
96 reg = <0x0000 0 0 0 0>;
97
98 mediatek,mtd-eeprom = <&factory 0x0>;
99
100 /* 5 GHz (phy1) does not take the address from calibration data,
101 but setting it manually here works */
102 nvmem-cells = <&macaddr_factory_4>;
103 nvmem-cell-names = "mac-address";
104 };
105 };
106
107 &gmac0 {
108 nvmem-cells = <&macaddr_factory_4>;
109 nvmem-cell-names = "mac-address";
110 mac-address-increment = <(-1)>;
111 };
112
113 &switch0 {
114 ports {
115 port@0 {
116 status = "okay";
117 label = "lan4";
118 };
119
120 port@1 {
121 status = "okay";
122 label = "lan3";
123 };
124
125 port@2 {
126 status = "okay";
127 label = "lan2";
128 };
129
130 port@3 {
131 status = "okay";
132 label = "lan1";
133 };
134
135 wan: port@4 {
136 status = "okay";
137 label = "wan";
138 nvmem-cells = <&macaddr_factory_4>;
139 nvmem-cell-names = "mac-address";
140 mac-address-increment = <(-2)>;
141 };
142 };
143 };
144
145 &state_default {
146 gpio {
147 groups = "i2c", "uart3", "uart2", "jtag", "wdt";
148 function = "gpio";
149 };
150 };
151
152 &factory {
153 compatible = "nvmem-cells";
154 #address-cells = <1>;
155 #size-cells = <1>;
156
157 macaddr_factory_4: macaddr@4 {
158 reg = <0x4 0x6>;
159 };
160 };