ramips: convert mt76 PCIe NIC EEPROM to NVMEM format for legacy SoCs
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_tplink_re2x0-v1.dtsi
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
8 / {
9 aliases {
10 label-mac-device = &ethernet;
11 };
12
13 chosen {
14 bootargs = "console=ttyS0,57600n8";
15 };
16
17 keys: keys {
18 compatible = "gpio-keys";
19
20 reset {
21 label = "reset";
22 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
23 linux,code = <KEY_RESTART>;
24 };
25
26 wps {
27 label = "wps";
28 gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
29 linux,code = <KEY_WPS_BUTTON>;
30 };
31 };
32 };
33
34 &spi0 {
35 status = "okay";
36
37 flash@0 {
38 compatible = "jedec,spi-nor";
39 reg = <0>;
40 spi-max-frequency = <50000000>;
41
42 partitions {
43 compatible = "fixed-partitions";
44 #address-cells = <1>;
45 #size-cells = <1>;
46
47 uboot: partition@0 {
48 compatible = "nvmem-cells";
49 label = "u-boot";
50 reg = <0x0 0x20000>;
51 #address-cells = <1>;
52 #size-cells = <1>;
53 read-only;
54
55 macaddr_uboot_1fc00: macaddr@1fc00 {
56 reg = <0x1fc00 0x6>;
57 };
58 };
59
60 partition@20000 {
61 compatible = "tplink,firmware";
62 label = "firmware";
63 reg = <0x20000 0x7c0000>;
64 };
65
66 partition@7e0000 {
67 label = "config";
68 reg = <0x7e0000 0x10000>;
69 read-only;
70 };
71
72 radio: partition@7f0000 {
73 compatible = "nvmem-cells";
74 label = "radio";
75 reg = <0x7f0000 0x10000>;
76 #address-cells = <1>;
77 #size-cells = <1>;
78 read-only;
79
80 eeprom_radio_0: eeprom@0 {
81 reg = <0x0 0x200>;
82 };
83
84 eeprom_radio_8000: eeprom@8000 {
85 reg = <0x8000 0x200>;
86 };
87 };
88 };
89 };
90 };
91
92 &ethernet {
93 nvmem-cells = <&macaddr_uboot_1fc00>;
94 nvmem-cell-names = "mac-address";
95 };
96
97 &wmac {
98 nvmem-cells = <&eeprom_radio_0>, <&macaddr_uboot_1fc00>;
99 nvmem-cell-names = "eeprom", "mac-address";
100 };
101
102 &pcie {
103 status = "okay";
104 };
105
106 &pcie0 {
107 mt76@0,0 {
108 reg = <0x0000 0 0 0 0>;
109 ieee80211-freq-limit = <5000000 6000000>;
110 nvmem-cells = <&eeprom_radio_8000>, <&macaddr_uboot_1fc00>;
111 nvmem-cell-names = "eeprom", "mac-address";
112 mac-address-increment = <2>;
113 };
114 };