ramips: mt7621: convert to nvmem-layout
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_xiaomi_mi-router-4a-common.dtsi
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
8 / {
9 aliases {
10 led-boot = &led_status_yellow;
11 led-failsafe = &led_status_yellow;
12 led-running = &led_status_blue;
13 led-upgrade = &led_status_yellow;
14 };
15
16 chosen {
17 bootargs = "console=ttyS0,115200n8";
18 };
19
20 keys {
21 compatible = "gpio-keys";
22
23 reset {
24 label = "reset";
25 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
26 linux,code = <KEY_RESTART>;
27 };
28 };
29 };
30
31 &spi0 {
32 status = "okay";
33
34 flash@0 {
35 compatible = "jedec,spi-nor";
36 reg = <0>;
37 spi-max-frequency = <50000000>;
38 m25p,fast-read;
39
40 partitions: partitions {
41 compatible = "fixed-partitions";
42 #address-cells = <1>;
43 #size-cells = <1>;
44
45 partition@0 {
46 label = "u-boot";
47 reg = <0x0 0x30000>;
48 read-only;
49 };
50
51 partition@30000 {
52 label = "u-boot-env";
53 reg = <0x30000 0x10000>;
54 read-only;
55 };
56
57 partition@40000 {
58 label = "Bdata";
59 reg = <0x40000 0x10000>;
60 read-only;
61 };
62
63 factory: partition@50000 {
64 label = "factory";
65 reg = <0x50000 0x10000>;
66 read-only;
67
68 nvmem-layout {
69 compatible = "fixed-layout";
70 #address-cells = <1>;
71 #size-cells = <1>;
72
73 macaddr_factory_e000: macaddr@e000 {
74 reg = <0xe000 0x6>;
75 };
76
77 macaddr_factory_e006: macaddr@e006 {
78 reg = <0xe006 0x6>;
79 };
80 };
81 };
82
83 partition@60000 {
84 label = "crash";
85 reg = <0x60000 0x10000>;
86 read-only;
87 };
88
89 partition@70000 {
90 label = "cfg_bak";
91 reg = <0x70000 0x10000>;
92 read-only;
93 };
94
95 partition@80000 {
96 label = "overlay";
97 reg = <0x80000 0x100000>;
98 read-only;
99 };
100
101 firmware: partition@180000 {
102 compatible = "denx,uimage";
103 label = "firmware";
104 reg = <0x180000 0xe80000>;
105 };
106 };
107 };
108 };
109
110 &pcie {
111 status = "okay";
112 };
113
114 &pcie0 {
115 wifi0: wifi@0,0 {
116 compatible = "mediatek,mt76";
117 reg = <0x0000 0 0 0 0>;
118 };
119 };
120
121 &pcie1 {
122 wifi1: wifi@0,0 {
123 compatible = "mediatek,mt76";
124 reg = <0x0000 0 0 0 0>;
125 };
126 };
127
128 &gmac0 {
129 nvmem-cells = <&macaddr_factory_e000>;
130 nvmem-cell-names = "mac-address";
131 };
132
133 &state_default {
134 gpio {
135 groups = "jtag", "uart2", "uart3", "wdt";
136 function = "gpio";
137 };
138 };