ramips: mt7620a: convert to nvmem-layout
[openwrt/staging/hauke.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 label = "u-boot";
49 reg = <0x0 0x20000>;
50 read-only;
51
52 nvmem-layout {
53 compatible = "fixed-layout";
54 #address-cells = <1>;
55 #size-cells = <1>;
56
57 macaddr_uboot_1fc00: macaddr@1fc00 {
58 reg = <0x1fc00 0x6>;
59 };
60 };
61 };
62
63 partition@20000 {
64 compatible = "tplink,firmware";
65 label = "firmware";
66 reg = <0x20000 0x7c0000>;
67 };
68
69 partition@7e0000 {
70 label = "config";
71 reg = <0x7e0000 0x10000>;
72 read-only;
73 };
74
75 radio: partition@7f0000 {
76 label = "radio";
77 reg = <0x7f0000 0x10000>;
78 read-only;
79
80 nvmem-layout {
81 compatible = "fixed-layout";
82 #address-cells = <1>;
83 #size-cells = <1>;
84
85 eeprom_radio_0: eeprom@0 {
86 reg = <0x0 0x200>;
87 };
88
89 eeprom_radio_8000: eeprom@8000 {
90 reg = <0x8000 0x200>;
91 };
92 };
93 };
94 };
95 };
96 };
97
98 &ethernet {
99 nvmem-cells = <&macaddr_uboot_1fc00>;
100 nvmem-cell-names = "mac-address";
101 };
102
103 &wmac {
104 nvmem-cells = <&eeprom_radio_0>, <&macaddr_uboot_1fc00>;
105 nvmem-cell-names = "eeprom", "mac-address";
106 };
107
108 &pcie {
109 status = "okay";
110 };
111
112 &pcie0 {
113 mt76@0,0 {
114 reg = <0x0000 0 0 0 0>;
115 ieee80211-freq-limit = <5000000 6000000>;
116 nvmem-cells = <&eeprom_radio_8000>, <&macaddr_uboot_1fc00>;
117 nvmem-cell-names = "eeprom", "mac-address";
118 mac-address-increment = <2>;
119 };
120 };