ramips: convert rt2x00 EEPROM to NVMEM format
[openwrt/staging/stintel.git] / target / linux / ramips / dts / mt7620a_netcore_nw5212.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 = "netcore,nw5212", "ralink,mt7620a-soc";
10 model = "Netcore NW5212";
11
12 aliases {
13 label-mac-device = &ethernet;
14 };
15
16 leds {
17 compatible = "gpio-leds";
18
19 lan4 {
20 label = "green:lan4";
21 gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
22 };
23
24 lan3 {
25 label = "green:lan3";
26 gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
27 };
28
29 lan2 {
30 label = "green:lan2";
31 gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
32 };
33
34 lan1 {
35 label = "green:lan1";
36 gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
37 };
38
39 wan {
40 label = "green:wan";
41 gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
42 };
43
44 wlan2g {
45 label = "green:wlan2g";
46 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
47 linux,default-trigger = "phy0tpt";
48 };
49 };
50
51 keys {
52 compatible = "gpio-keys";
53
54 reset {
55 label = "reset";
56 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
57 linux,code = <KEY_RESTART>;
58 };
59 };
60 };
61
62 &gpio2 {
63 status = "okay";
64 };
65
66 &gpio3 {
67 status = "okay";
68 };
69
70 &spi0 {
71 status = "okay";
72
73 flash@0 {
74 compatible = "jedec,spi-nor";
75 reg = <0>;
76 spi-max-frequency = <70000000>;
77 m25p,fast-read;
78
79 partitions {
80 compatible = "fixed-partitions";
81 #address-cells = <1>;
82 #size-cells = <1>;
83
84 partition@0 {
85 label = "u-boot";
86 reg = <0x0 0x30000>;
87 read-only;
88 };
89
90 partition@30000 {
91 label = "u-boot-env";
92 reg = <0x30000 0x10000>;
93 };
94
95 factory: partition@40000 {
96 compatible = "nvmem-cells";
97 label = "factory";
98 reg = <0x40000 0x10000>;
99 #address-cells = <1>;
100 #size-cells = <1>;
101 read-only;
102
103 eeprom_factory_0: eeprom@0 {
104 reg = <0x0 0x200>;
105 };
106
107 macaddr_factory_28: macaddr@28 {
108 reg = <0x28 0x6>;
109 };
110 };
111
112 partition@50000 {
113 compatible = "denx,uimage";
114 label = "firmware";
115 reg = <0x50000 0xfb0000>;
116 };
117 };
118 };
119 };
120
121 &state_default {
122 gpio {
123 groups = "uartf", "wled", "ephy";
124 function = "gpio";
125 };
126 };
127
128 &ethernet {
129 mediatek,portmap = "llllw";
130 nvmem-cells = <&macaddr_factory_28>;
131 nvmem-cell-names = "mac-address";
132 };
133
134 &ehci {
135 status = "okay";
136 };
137
138 &ohci {
139 status = "okay";
140 };
141
142 &wmac {
143 nvmem-cells = <&eeprom_factory_0>;
144 nvmem-cell-names = "eeprom";
145 };