ramips: mt7620n: convert to nvmem-layout
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_humax_e2.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 #include <dt-bindings/mtd/partitions/uimage.h>
8
9 / {
10 compatible = "humax,e2", "ralink,mt7620a-soc";
11 model = "HUMAX E2";
12
13 aliases {
14 led-boot = &led_power;
15 led-failsafe = &led_power;
16 led-running = &led_power;
17 led-upgrade = &led_power;
18 label-mac-device = &ethernet;
19 };
20
21 leds {
22 compatible = "gpio-leds";
23
24 led_power: power {
25 label = "green:power";
26 gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
27 };
28
29 pairing {
30 label = "green:pairing";
31 gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
32 };
33
34 wlan {
35 label = "green:wlan";
36 gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
37 };
38
39 lan {
40 label = "green:lan";
41 gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
42 };
43
44 wps {
45 label = "green:wps";
46 gpios = <&gpio1 5 GPIO_ACTIVE_LOW>;
47 };
48 };
49
50 keys {
51 compatible = "gpio-keys";
52
53 reset {
54 label = "reset";
55 gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
56 linux,code = <KEY_RESTART>;
57 };
58 };
59 };
60
61 &gpio1 {
62 status = "okay";
63 };
64
65 &spi0 {
66 status = "okay";
67
68 flash@0 {
69 compatible = "jedec,spi-nor";
70 reg = <0>;
71 spi-max-frequency = <50000000>;
72
73 partitions {
74 compatible = "fixed-partitions";
75 #address-cells = <1>;
76 #size-cells = <1>;
77
78 partition@0 {
79 label = "u-boot";
80 reg = <0x0 0x30000>;
81 read-only;
82 };
83
84 partition@30000 {
85 label = "u-boot-env";
86 reg = <0x30000 0x10000>;
87 read-only;
88 };
89
90 factory: partition@40000 {
91 compatible = "nvmem-cells";
92 label = "factory";
93 reg = <0x40000 0x30000>;
94 #address-cells = <1>;
95 #size-cells = <1>;
96 read-only;
97
98 eeprom_factory_0: eeprom@0 {
99 reg = <0x0 0x200>;
100 };
101
102 eeprom_factory_8000: eeprom@8000 {
103 reg = <0x8000 0x200>;
104 };
105
106 macaddr_factory_10007: macaddr@10007 {
107 reg = <0x10007 0x6>;
108 };
109 };
110
111 partition@70000 {
112 compatible = "openwrt,uimage", "denx,uimage";
113 openwrt,offset = <FW_EDIMAX_OFFSET>;
114 openwrt,partition-magic = <FW_MAGIC_EDIMAX>;
115 label = "firmware";
116 reg = <0x70000 0x790000>;
117 };
118 };
119 };
120 };
121
122 &ethernet {
123 nvmem-cells = <&macaddr_factory_10007>;
124 nvmem-cell-names = "mac-address";
125 };
126
127 &pcie {
128 status = "okay";
129 };
130
131 &pcie0 {
132 wifi@0,0 {
133 compatible = "mediatek,mt76";
134 reg = <0x0000 0 0 0 0>;
135 nvmem-cells = <&eeprom_factory_8000>;
136 nvmem-cell-names = "eeprom";
137 ieee80211-freq-limit = <5000000 6000000>;
138 };
139 };
140
141 &wmac {
142 nvmem-cells = <&eeprom_factory_0>;
143 nvmem-cell-names = "eeprom";
144 };
145
146 &state_default {
147 gpio {
148 groups = "rgmii1";
149 function = "gpio";
150 };
151 };