ramips: mt7621: convert Xiaomi devices EEPROM to NVMEM format
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620n_nexx_wt3020.dtsi
1 #include "mt7620n.dtsi"
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 / {
7 compatible = "nexx,wt3020", "ralink,mt7620n-soc";
8
9 aliases {
10 led-boot = &led_power;
11 led-failsafe = &led_power;
12 led-running = &led_power;
13 led-upgrade = &led_power;
14 label-mac-device = &ethernet;
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
27 leds {
28 compatible = "gpio-leds";
29
30 led_power: power {
31 label = "blue:power";
32 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
33 };
34 };
35 };
36
37 &spi0 {
38 status = "okay";
39
40 flash@0 {
41 compatible = "jedec,spi-nor";
42 reg = <0>;
43 spi-max-frequency = <10000000>;
44
45 partitions {
46 compatible = "fixed-partitions";
47 #address-cells = <1>;
48 #size-cells = <1>;
49
50 partition@0 {
51 label = "u-boot";
52 reg = <0x0 0x30000>;
53 read-only;
54 };
55
56 partition@30000 {
57 label = "u-boot-env";
58 reg = <0x30000 0x10000>;
59 read-only;
60 };
61
62 factory: partition@40000 {
63 label = "factory";
64 reg = <0x40000 0x10000>;
65 read-only;
66
67 nvmem-layout {
68 compatible = "fixed-layout";
69 #address-cells = <1>;
70 #size-cells = <1>;
71
72 eeprom_factory_0: eeprom@0 {
73 reg = <0x0 0x200>;
74 };
75
76 macaddr_factory_4: macaddr@4 {
77 reg = <0x4 0x6>;
78 };
79 };
80 };
81
82 firmware: partition@50000 {
83 compatible = "denx,uimage";
84 label = "firmware";
85 /* reg property is set based on flash size in DTS files */
86 };
87 };
88 };
89 };
90
91 &gpio3 {
92 status = "okay";
93 };
94
95 &ethernet {
96 nvmem-cells = <&macaddr_factory_4>;
97 nvmem-cell-names = "mac-address";
98
99 mediatek,portmap = "wllll";
100 };
101
102 &wmac {
103 nvmem-cells = <&eeprom_factory_0>;
104 nvmem-cell-names = "eeprom";
105 };
106
107 &state_default {
108 default {
109 groups = "ephy", "wled", "pa", "i2c", "wdt", "uartf";
110 function = "gpio";
111 };
112 };