ramips: fix MAC address setup for Xiaomi MiWiFi Nano
[oweals/openwrt.git] / target / linux / ramips / dts / mt7621_iptime_a6ns-m.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include "mt7621.dtsi"
5
6 #include <dt-bindings/gpio/gpio.h>
7 #include <dt-bindings/input/input.h>
8
9 / {
10         compatible = "iptime,a6ns-m", "mediatek,mt7621-soc";
11         model = "ipTIME A6ns-M";
12
13         aliases {
14                 led-boot = &led_cpu;
15                 led-failsafe = &led_cpu;
16                 led-running = &led_cpu;
17                 led-upgrade = &led_cpu;
18                 label-mac-device = &ethernet;
19         };
20
21         chosen {
22                 bootargs = "console=ttyS0,57600";
23         };
24
25         leds {
26                 compatible = "gpio-leds";
27
28                 usb {
29                         label = "a6ns-m:blue:usb";
30                         gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
31                         trigger-sources = <&xhci_ehci_port1>;
32                         linux,default-trigger = "usbport";
33                 };
34
35                 wlan5g {
36                         label = "a6ns-m:blue:wlan5g";
37                         gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
38                         linux,default-trigger = "phy0radio";
39                 };
40
41                 wlan2g {
42                         label = "a6ns-m:blue:wlan2g";
43                         gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
44                         linux,default-trigger = "phy1radio";
45                 };
46
47                 led_cpu: cpu {
48                         label = "a6ns-m:blue:cpu";
49                         gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
50                 };
51         };
52
53         keys {
54                 compatible = "gpio-keys";
55
56                 wps {
57                         label = "wps";
58                         gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
59                         linux,code = <KEY_WPS_BUTTON>;
60                 };
61
62                 reset {
63                         label = "reset";
64                         gpios = <&gpio0 4 GPIO_ACTIVE_LOW>;
65                         linux,code = <KEY_RESTART>;
66                 };
67         };
68 };
69
70 &spi0 {
71         status = "okay";
72
73         flash@0 {
74                 compatible = "jedec,spi-nor";
75                 reg = <0>;
76                 spi-max-frequency = <80000000>;
77                 m25p,fast-read;
78
79                 partitions {
80                         compatible = "fixed-partitions";
81                         #address-cells = <1>;
82                         #size-cells = <1>;
83
84                         uboot: partition@0 {
85                                 label = "u-boot";
86                                 reg = <0x0 0x20000>;
87                                 read-only;
88                         };
89
90                         partition@20000 {
91                                 label = "config";
92                                 reg = <0x20000 0x10000>;
93                                 read-only;
94                         };
95
96                         factory: partition@30000 {
97                                 label = "factory";
98                                 reg = <0x30000 0x10000>;
99                                 read-only;
100                         };
101
102                         partition@40000 {
103                                 compatible = "denx,uimage";
104                                 label = "firmware";
105                                 reg = <0x40000 0xfc0000>;
106                         };
107                 };
108         };
109 };
110
111 &state_default {
112         gpio {
113                 ralink,group = "i2c", "uart3", "jtag", "wdt";
114                 ralink,function = "gpio";
115         };
116 };
117
118 &ethernet {
119         mtd-mac-address = <&uboot 0x1fc20>;
120 };
121
122 &pcie {
123         status = "okay";
124 };
125
126 &pcie0 {
127         wifi@0,0 {
128                 compatible = "mediatek,mt76";
129                 reg = <0x0000 0 0 0 0>;
130                 mediatek,mtd-eeprom = <&factory 0x0>;
131                 ieee80211-freq-limit = <5000000 6000000>;
132         };
133 };
134
135 &pcie1 {
136         wifi@0,0 {
137                 compatible = "mediatek,mt76";
138                 reg = <0x0000 0 0 0 0>;
139                 mediatek,mtd-eeprom = <&factory 0x8000>;
140                 ieee80211-freq-limit = <2400000 2500000>;
141         };
142 };