ramips: mt7621: convert MT7915 EEPROM to NVMEM format
[openwrt/staging/dangole.git] / target / linux / ramips / dts / mt7621_comfast_cf-e390ax.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/leds/common.h>
8
9 / {
10 compatible = "comfast,cf-e390ax", "mediatek,mt7621-soc";
11 model = "COMFAST CF-E390AX";
12
13 chosen {
14 bootargs = "console=ttyS0,115200";
15 };
16
17 keys {
18 compatible = "gpio-keys";
19
20 reset {
21 label = "reset";
22 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
23 linux,code = <KEY_RESTART>;
24 };
25 };
26
27 leds {
28 compatible = "gpio-leds";
29
30 led_status_green: status_green {
31 label = "green:status";
32 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
33 };
34
35 led_status_blue: status_blue {
36 label = "blue:status";
37 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
38 };
39
40 led_status_red: status_red {
41 label = "red:status";
42 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
43 };
44 };
45
46 aliases {
47 led-boot = &led_status_green;
48 led-failsafe = &led_status_red;
49 led-running = &led_status_blue;
50 led-upgrade = &led_status_red;
51 };
52 };
53
54 &pcie {
55 status = "okay";
56 };
57
58 &pcie1 {
59 wifi@0,0 {
60 compatible = "mediatek,mt76";
61 reg = <0x0000 0 0 0 0>;
62 nvmem-cells = <&eeprom_factory_0>;
63 nvmem-cell-names = "eeprom";
64 };
65 };
66
67 &spi0 {
68 status = "okay";
69 flash@0 {
70 compatible = "jedec,spi-nor";
71 reg = <0>;
72 spi-max-frequency = <14000000>;
73 partitions {
74 compatible = "fixed-partitions";
75 #address-cells = <1>;
76 #size-cells = <1>;
77
78 partition@0 {
79 label = "bootloader";
80 reg = <0x0 0x30000>;
81 read-only;
82 };
83
84 partition@30000 {
85 label = "config";
86 reg = <0x30000 0x10000>;
87 read-only;
88 };
89
90 factory: partition@50000 {
91 label = "factory";
92 reg = <0x50000 0x10000>;
93 read-only;
94
95 nvmem-layout {
96 compatible = "fixed-layout";
97 #address-cells = <1>;
98 #size-cells = <1>;
99
100 eeprom_factory_0: eeprom@0 {
101 reg = <0x0 0xe00>;
102 };
103
104 macaddr_factory_e000: macaddr@e000 {
105 compatible = "mac-base";
106 reg = <0xe000 0x6>;
107 #nvmem-cell-cells = <1>;
108 };
109 };
110 };
111
112 partition@90000 {
113 compatible = "denx,uimage";
114 label = "firmware";
115 reg = <0x90000 0xf70000>;
116 };
117 };
118 };
119 };
120
121 &gmac0 {
122 nvmem-cells = <&macaddr_factory_e000 0>;
123 nvmem-cell-names = "mac-address";
124 };
125
126 &switch0 {
127 ports {
128 port@0 {
129 status = "okay";
130 label = "wan";
131 nvmem-cells = <&macaddr_factory_e000 1>;
132 nvmem-cell-names = "mac-address";
133 };
134
135 port@4 {
136 status = "okay";
137 label = "lan";
138 };
139 };
140 };
141