ramips: mt7620n: convert to nvmem-layout
[openwrt/staging/hauke.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 label = "factory";
84 reg = <0x40000 0x10000>;
85 read-only;
86
87 nvmem-layout {
88 compatible = "fixed-layout";
89 #address-cells = <1>;
90 #size-cells = <1>;
91
92 eeprom_factory_0: eeprom@0 {
93 reg = <0x0 0x200>;
94 };
95
96 macaddr_factory_28: macaddr@28 {
97 reg = <0x28 0x6>;
98 };
99 };
100 };
101
102 partition@50000 {
103 label = "loader";
104 reg = <0x50000 0x10000>;
105 read-only;
106 };
107
108 fwconcat1: partition@60000 {
109 label = "fwconcat1";
110 reg = <0x60000 0x170000>;
111 };
112
113 partition@1d0000 {
114 label = "u-boot-env";
115 reg = <0x1d0000 0x10000>;
116 };
117
118 fwconcat2: partition@1e0000 {
119 label = "fwconcat2";
120 reg = <0x1e0000 0x20000>;
121 };
122
123 fwconcat0: partition@200000 {
124 label = "fwconcat0";
125 reg = <0x200000 0x600000>;
126 };
127 };
128 };
129 };
130
131 &ehci {
132 status = "okay";
133 };
134
135 &ohci {
136 status = "okay";
137 };
138
139 &ethernet {
140 nvmem-cells = <&macaddr_factory_28>;
141 nvmem-cell-names = "mac-address";
142 };
143
144 &wmac {
145 nvmem-cells = <&eeprom_factory_0>;
146 nvmem-cell-names = "eeprom";
147 };
148
149 &state_default {
150 gpio {
151 groups = "wled", "ephy";
152 function = "gpio";
153 };
154 };