ramips: convert MT7628 EEPROM to NVMEM format
[openwrt/staging/hauke.git] / target / linux / ramips / dts / mt7628an_linksys_e5400.dts
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 compatible = "linksys,e5400", "mediatek,mt7628an-soc";
10 model = "Linksys E5400";
11
12 aliases {
13 led-boot = &led_wps;
14 led-failsafe = &led_wps;
15 led-running = &led_wps;
16 led-upgrade = &led_wps;
17 label-mac-device = &ethernet;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 memory@0 {
25 device_type = "memory";
26 reg = <0x0 0x4000000>;
27 };
28
29 keys {
30 compatible = "gpio-keys";
31
32 reset {
33 label = "reset";
34 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
35 linux,code = <KEY_RESTART>;
36 };
37
38 wps {
39 label = "wps";
40 gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
41 linux,code = <KEY_WPS_BUTTON>;
42 };
43 };
44
45 leds {
46 compatible = "gpio-leds";
47
48 led_wps: wps {
49 label = "green:wps";
50 gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
51 };
52 };
53 };
54
55 &spi0 {
56 status = "okay";
57
58 flash@0 {
59 compatible = "jedec,spi-nor";
60 reg = <0>;
61 spi-max-frequency = <40000000>;
62
63 partitions {
64 compatible = "fixed-partitions";
65 #address-cells = <1>;
66 #size-cells = <1>;
67
68 partition@0 {
69 label = "u-boot";
70 reg = <0x0 0x30000>;
71 read-only;
72 };
73
74 partition@30000 {
75 label = "u-boot-env";
76 reg = <0x30000 0x10000>;
77 read-only;
78 };
79
80 factory: partition@40000 {
81 compatible = "nvmem-cells";
82 label = "factory";
83 reg = <0x40000 0x10000>;
84 #address-cells = <1>;
85 #size-cells = <1>;
86 read-only;
87
88 eeprom_factory_0: eeprom@0 {
89 reg = <0x0 0x400>;
90 };
91
92 macaddr_factory_28: macaddr@28 {
93 reg = <0x28 0x6>;
94 };
95 };
96
97 partition@50000 {
98 compatible = "denx,uimage";
99 label = "firmware";
100 reg = <0x50000 0xfa0000>;
101 };
102
103 partition@ff0000 {
104 label = "cbtinfo";
105 reg = <0xff0000 0x10000>;
106 read-only;
107 };
108 };
109 };
110 };
111
112 &ehci {
113 status = "disabled";
114 };
115
116 &esw {
117 mediatek,portmap = <0x2f>;
118 mediatek,portdisable = <0x20>;
119 };
120
121 &ethernet {
122 nvmem-cells = <&macaddr_factory_28>;
123 nvmem-cell-names = "mac-address";
124 };
125
126 &ohci {
127 status = "disabled";
128 };
129
130 &pcie {
131 status = "okay";
132 };
133
134 &pcie0 {
135 wifi5: wifi@0,0 {
136 compatible = "mediatek,mt76";
137 reg = <0x0000 0 0 0 0>;
138 mediatek,mtd-eeprom = <&factory 0x8000>;
139 ieee80211-freq-limit = <5000000 6000000>;
140
141 nvmem-cells = <&macaddr_factory_28>;
142 nvmem-cell-names = "mac-address";
143 mac-address-increment = <3>;
144 };
145 };
146
147 &state_default {
148 gpio {
149 group = "gpio", "i2c", "i2s", "refclk", "uart1", "wdt", "wled_an";
150 function = "gpio";
151 };
152 };
153
154 &usbphy {
155 status = "disabled";
156 };
157
158 &wmac {
159 status = "okay";
160
161 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_28>;
162 nvmem-cell-names = "eeprom", "mac-address";
163 mac-address-increment = <2>;
164 };
165