ramips: convert rt2x00 EEPROM to NVMEM format
[openwrt/staging/stintel.git] / target / linux / ramips / dts / mt7620n_sunvalley_filehub.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7620n.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/mtd/partitions/uimage.h>
8
9 / {
10 aliases {
11 label-mac-device = &ethernet;
12 };
13
14 keys {
15 compatible = "gpio-keys";
16
17 reset {
18 label = "reset";
19 gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
20 linux,code = <KEY_RESTART>;
21 };
22 };
23
24 virtual_flash {
25 compatible = "mtd-concat";
26
27 devices = <&fwconcat0 &fwconcat1 &fwconcat2>;
28
29 partitions {
30 compatible = "fixed-partitions";
31 #address-cells = <1>;
32 #size-cells = <1>;
33
34 partition@0 {
35 compatible = "openwrt,uimage", "denx,uimage";
36 openwrt,ih-magic = <IH_MAGIC_OKLI>;
37 label = "firmware";
38 reg = <0x0 0x0>;
39 };
40 };
41 };
42 };
43
44 &gpio2 {
45 status = "okay";
46 };
47
48 &gpio3 {
49 status = "okay";
50 };
51
52 &i2c {
53 status = "okay";
54 };
55
56 &spi0 {
57 status = "okay";
58
59 flash@0 {
60 compatible = "jedec,spi-nor";
61 reg = <0>;
62 spi-max-frequency = <50000000>;
63 m25p,fast-read;
64
65 partitions {
66 compatible = "fixed-partitions";
67 #address-cells = <1>;
68 #size-cells = <1>;
69
70 partition@0 {
71 label = "u-boot";
72 reg = <0x0 0x30000>;
73 read-only;
74 };
75
76 partition@30000 {
77 label = "config";
78 reg = <0x30000 0x10000>;
79 read-only;
80 };
81
82 factory: partition@40000 {
83 compatible = "nvmem-cells";
84 label = "factory";
85 reg = <0x40000 0x10000>;
86 #address-cells = <1>;
87 #size-cells = <1>;
88 read-only;
89
90 eeprom_factory_0: eeprom@0 {
91 reg = <0x0 0x200>;
92 };
93
94 macaddr_factory_28: macaddr@28 {
95 reg = <0x28 0x6>;
96 };
97 };
98
99 partition@50000 {
100 label = "loader";
101 reg = <0x50000 0x10000>;
102 read-only;
103 };
104
105 fwconcat1: partition@60000 {
106 label = "fwconcat1";
107 reg = <0x60000 0x170000>;
108 };
109
110 partition@1d0000 {
111 label = "u-boot-env";
112 reg = <0x1d0000 0x10000>;
113 };
114
115 fwconcat2: partition@1e0000 {
116 label = "fwconcat2";
117 reg = <0x1e0000 0x20000>;
118 };
119
120 fwconcat0: partition@200000 {
121 label = "fwconcat0";
122 reg = <0x200000 0x600000>;
123 };
124 };
125 };
126 };
127
128 &ehci {
129 status = "okay";
130 };
131
132 &ohci {
133 status = "okay";
134 };
135
136 &ethernet {
137 nvmem-cells = <&macaddr_factory_28>;
138 nvmem-cell-names = "mac-address";
139 };
140
141 &wmac {
142 nvmem-cells = <&eeprom_factory_0>;
143 nvmem-cell-names = "eeprom";
144 };
145
146 &state_default {
147 gpio {
148 groups = "wled", "ephy";
149 function = "gpio";
150 };
151 };