ramips: convert rt2x00 EEPROM to NVMEM format
[openwrt/staging/stintel.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 macaddr_factory_10007: macaddr@10007 {
103 reg = <0x10007 0x6>;
104 };
105 };
106
107 partition@70000 {
108 compatible = "openwrt,uimage", "denx,uimage";
109 openwrt,offset = <FW_EDIMAX_OFFSET>;
110 openwrt,partition-magic = <FW_MAGIC_EDIMAX>;
111 label = "firmware";
112 reg = <0x70000 0x790000>;
113 };
114 };
115 };
116 };
117
118 &ethernet {
119 nvmem-cells = <&macaddr_factory_10007>;
120 nvmem-cell-names = "mac-address";
121 };
122
123 &pcie {
124 status = "okay";
125 };
126
127 &pcie0 {
128 wifi@0,0 {
129 compatible = "mediatek,mt76";
130 reg = <0x0000 0 0 0 0>;
131 mediatek,mtd-eeprom = <&factory 0x8000>;
132 ieee80211-freq-limit = <5000000 6000000>;
133 };
134 };
135
136 &wmac {
137 nvmem-cells = <&eeprom_factory_0>;
138 nvmem-cell-names = "eeprom";
139 };
140
141 &state_default {
142 gpio {
143 groups = "rgmii1";
144 function = "gpio";
145 };
146 };