ramips: convert mt76 PCIe NIC EEPROM to NVMEM format for legacy SoCs
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7628an_comfast_cf-wr758ac.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7628an.dtsi"
4
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/gpio/gpio.h>
7
8 / {
9 compatible = "comfast,cf-wr758ac", "mediatek,mt7628an-soc";
10
11 keys {
12 compatible = "gpio-keys";
13
14 wps {
15 label = "wps";
16 gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
17 linux,code = <KEY_WPS_BUTTON>;
18 };
19 };
20
21 leds {
22 compatible = "gpio-leds";
23
24 wifi-high {
25 label = "blue:wifi-high";
26 gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
27 };
28
29 wifi-med {
30 label = "blue:wifi-med";
31 gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
32 };
33
34 wifi-low {
35 label = "blue:wifi-low";
36 gpios = <&gpio 37 GPIO_ACTIVE_LOW>;
37 };
38 };
39 };
40
41 &state_default {
42 gpio {
43 groups = "refclk", "wdt", "wled_an";
44 function = "gpio";
45 };
46 };
47
48 &pcie {
49 status = "okay";
50 };
51
52 &pcie0 {
53 wifi@0,0 {
54 compatible = "mediatek,mt76";
55 reg = <0x0000 0 0 0 0>;
56 nvmem-cells = <&eeprom_factory_8000>;
57 nvmem-cell-names = "eeprom";
58 ieee80211-freq-limit = <5000000 6000000>;
59 };
60 };
61
62 &spi0 {
63 status = "okay";
64
65 flash@0 {
66 compatible = "jedec,spi-nor";
67 reg = <0>;
68 spi-max-frequency = <50000000>;
69
70 partitions {
71 compatible = "fixed-partitions";
72 #address-cells = <1>;
73 #size-cells = <1>;
74
75 partition@0 {
76 label = "u-boot";
77 reg = <0x0 0x30000>;
78 read-only;
79 };
80
81 partition@30000 {
82 label = "u-boot-env";
83 reg = <0x30000 0x10000>;
84 read-only;
85 };
86
87 factory: partition@40000 {
88 compatible = "nvmem-cells";
89 label = "factory";
90 reg = <0x40000 0x10000>;
91 #address-cells = <1>;
92 #size-cells = <1>;
93 read-only;
94
95 eeprom_factory_0: eeprom@0 {
96 reg = <0x0 0x400>;
97 };
98
99 eeprom_factory_8000: eeprom@8000 {
100 reg = <0x8000 0x200>;
101 };
102
103 macaddr_factory_e000: macaddr@e000 {
104 reg = <0xe000 0x6>;
105 };
106 };
107
108 partition@50000 {
109 compatible = "denx,uimage";
110 label = "firmware";
111 reg = <0x50000 0x7b0000>;
112 };
113 };
114 };
115 };
116
117 &wmac {
118 status = "okay";
119
120 nvmem-cells = <&eeprom_factory_0>;
121 nvmem-cell-names = "eeprom";
122 };
123
124 &ethernet {
125 nvmem-cells = <&macaddr_factory_e000>;
126 nvmem-cell-names = "mac-address";
127 };
128
129 &esw {
130 mediatek,portdisable = <0x2f>;
131 };