ramips: convert rt2x00 EEPROM to NVMEM format
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_bdcom_wap2100-sk.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "bdcom,wap2100-sk", "ralink,mt7620a-soc";
10 model = "BDCOM WAP2100-SK";
11
12 aliases {
13 led-boot = &led_power;
14 led-failsafe = &led_power;
15 };
16
17 chosen {
18 bootargs = "console=ttyS0,115200";
19 };
20
21 leds {
22 compatible = "gpio-leds";
23
24 usb {
25 label = "green:usb";
26 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
27 trigger-sources = <&ohci_port1>, <&ehci_port1>;
28 linux,default-trigger = "usbport";
29 };
30
31 led_power: wps {
32 label = "green:wps";
33 gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
34 };
35
36 wlan2g {
37 label = "green:wlan2g";
38 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
39 };
40 };
41
42 keys {
43 compatible = "gpio-keys";
44
45 wps {
46 label = "wps";
47 gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
48 linux,code = <KEY_WPS_BUTTON>;
49 };
50
51 reset {
52 label = "reset";
53 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
54 linux,code = <KEY_RESTART>;
55 };
56 };
57 };
58
59 &spi0 {
60 status = "okay";
61
62 flash@0 {
63 compatible = "jedec,spi-nor";
64 reg = <0>;
65 spi-max-frequency = <10000000>;
66
67 partitions {
68 compatible = "fixed-partitions";
69 #address-cells = <1>;
70 #size-cells = <1>;
71
72 partition@0 {
73 label = "u-boot";
74 reg = <0x0 0x30000>;
75 read-only;
76 };
77
78 partition@30000 {
79 label = "u-boot-env";
80 reg = <0x30000 0x10000>;
81 read-only;
82 };
83
84 factory: partition@40000 {
85 compatible = "nvmem-cells";
86 label = "factory";
87 reg = <0x40000 0x10000>;
88 #address-cells = <1>;
89 #size-cells = <1>;
90 read-only;
91
92 eeprom_factory_0: eeprom@0 {
93 reg = <0x0 0x200>;
94 };
95
96 macaddr_factory_4: macaddr@4 {
97 reg = <0x4 0x6>;
98 };
99 };
100
101 partition@50000 {
102 compatible = "denx,uimage";
103 label = "firmware";
104 reg = <0x50000 0xf70000>;
105 };
106 };
107 };
108 };
109
110 &gpio1 {
111 status = "okay";
112 };
113
114 &gpio3 {
115 status = "okay";
116 };
117
118 &sdhci {
119 status = "okay";
120 };
121
122 &ehci {
123 status = "okay";
124 };
125
126 &ohci {
127 status = "okay";
128 };
129
130 &ethernet {
131 nvmem-cells = <&macaddr_factory_4>;
132 nvmem-cell-names = "mac-address";
133
134 mediatek,portmap = "wllll";
135 };
136
137 &wmac {
138 nvmem-cells = <&eeprom_factory_0>;
139 nvmem-cell-names = "eeprom";
140 };
141
142 &pcie {
143 status = "okay";
144 };
145
146 &pcie0 {
147 wifi@0,0 {
148 reg = <0x0000 0 0 0 0>;
149 mediatek,mtd-eeprom = <&factory 0x8000>;
150 ieee80211-freq-limit = <5000000 6000000>;
151 };
152 };
153
154 &state_default {
155 default {
156 groups = "spi refclk", "uartf", "wled";
157 function = "gpio";
158 };
159 };