ramips: convert rt2x00 EEPROM to NVMEM format
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_cameo_810.dtsi
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 aliases {
10 label-mac-device = &ethernet;
11 led-boot = &led_power_green;
12 led-failsafe = &led_power_green;
13 led-running = &led_power_green;
14 led-upgrade = &led_power_green;
15 };
16
17 keys {
18 compatible = "gpio-keys";
19
20 reset {
21 label = "reset";
22 gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
23 linux,code = <KEY_RESTART>;
24 };
25
26 wps {
27 label = "wps";
28 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
29 linux,code = <KEY_WPS_BUTTON>;
30 };
31 };
32
33 leds {
34 compatible = "gpio-leds";
35
36 led_power_green: power_green {
37 label = "green:power";
38 gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
39 };
40
41 wan_orange {
42 label = "orange:wan";
43 gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
44 };
45
46 wan_green {
47 label = "green:wan";
48 gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
49 };
50
51 power_orange {
52 label = "orange:power";
53 gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
54 };
55 };
56 };
57
58 &spi0 {
59 status = "okay";
60
61 flash@0 {
62 compatible = "jedec,spi-nor";
63 reg = <0>;
64 spi-max-frequency = <50000000>;
65
66 partitions {
67 compatible = "fixed-partitions";
68 #address-cells = <1>;
69 #size-cells = <1>;
70
71 partition@0 {
72 label = "u-boot";
73 reg = <0x0 0x30000>;
74 read-only;
75 };
76
77 partition@30000 {
78 label = "u-boot-env";
79 reg = <0x30000 0x10000>;
80 read-only;
81 };
82
83 factory: partition@40000 {
84 compatible = "nvmem-cells";
85 label = "factory";
86 reg = <0x40000 0x10000>;
87 #address-cells = <1>;
88 #size-cells = <1>;
89 read-only;
90
91 eeprom_factory_0: eeprom@0 {
92 reg = <0x0 0x200>;
93 };
94
95 macaddr_factory_28: macaddr@28 {
96 reg = <0x28 0x6>;
97 };
98 };
99
100 factory5g: partition@50000 {
101 label = "factory5g";
102 reg = <0x50000 0x10000>;
103 read-only;
104 };
105
106 partition@60000 {
107 label = "Wolf_Config";
108 reg = <0x60000 0x10000>;
109 read-only;
110 };
111
112 partition@70000 {
113 label = "MyDlink";
114 reg = <0x70000 0x80000>;
115 read-only;
116 };
117
118 partition@f0000 {
119 label = "Jffs2";
120 reg = <0xf0000 0x80000>;
121 read-only;
122 };
123
124 partition@170000 {
125 compatible = "denx,uimage";
126 label = "firmware";
127 reg = <0x170000 0x690000>;
128 };
129 };
130 };
131 };
132
133 &state_default {
134 gpio {
135 groups = "i2c", "uartf", "ephy";
136 function = "gpio";
137 };
138 };
139
140 &ethernet {
141 nvmem-cells = <&macaddr_factory_28>;
142 nvmem-cell-names = "mac-address";
143
144 mediatek,portmap = "llllw";
145 };
146
147 &gpio2 {
148 status = "okay";
149 };
150
151 &wmac {
152 pinctrl-names = "default", "pa_gpio";
153 pinctrl-0 = <&pa_pins>;
154 pinctrl-1 = <&pa_gpio_pins>;
155 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_28>;
156 nvmem-cell-names = "eeprom", "mac-address";
157 };
158
159 &pcie {
160 status = "okay";
161 };
162
163 &pcie0 {
164 wifi@0,0 {
165 reg = <0x0000 0 0 0 0>;
166 mediatek,mtd-eeprom = <&factory 0x8000>;
167 ieee80211-freq-limit = <5000000 6000000>;
168 nvmem-cells = <&macaddr_factory_28>;
169 nvmem-cell-names = "mac-address";
170 mac-address-increment = <2>;
171 };
172 };