ath79: fix MAC address assignment for TP-Link ar7241 devices
[openwrt/openwrt.git] / target / linux / ath79 / dts / ar9331_alfa-network_ap121f.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "ar9331.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 aliases {
10 label-mac-device = &wmac;
11 led-boot = &led_vpn;
12 led-failsafe = &led_vpn;
13 led-upgrade = &led_vpn;
14 };
15
16 keys {
17 compatible = "gpio-keys";
18
19 reset {
20 label = "reset";
21 linux,code = <KEY_RESTART>;
22 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
23 debounce-interval = <60>;
24 };
25
26 switch {
27 label = "switch";
28 linux,code = <BTN_0>;
29 gpios = <&gpio 21 GPIO_ACTIVE_HIGH>;
30 debounce-interval = <60>;
31 };
32 };
33
34 leds {
35 compatible = "gpio-leds";
36
37 lan {
38 label = "green:lan";
39 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
40 };
41
42 led_vpn: vpn {
43 label = "green:vpn";
44 gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
45 };
46
47 wlan {
48 label = "green:wlan";
49 gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
50 linux,default-trigger = "phy0tpt";
51 };
52 };
53 };
54
55 &eth0 {
56 status = "okay";
57
58 nvmem-cells = <&macaddr_art_0>;
59 nvmem-cell-names = "mac-address";
60
61 gmac-config {
62 device = <&gmac>;
63 switch-phy-addr-swap = <0>;
64 switch-phy-swap = <0>;
65 };
66 };
67
68 &eth1 {
69 status = "okay";
70
71 compatible = "syscon", "simple-mfd";
72 };
73
74 &spi {
75 status = "okay";
76
77 flash@0 {
78 compatible = "jedec,spi-nor";
79 reg = <0>;
80 spi-max-frequency = <50000000>;
81 m25p,fast-read;
82
83 partitions {
84 compatible = "fixed-partitions";
85 #address-cells = <1>;
86 #size-cells = <1>;
87
88 partition@0 {
89 label = "u-boot";
90 reg = <0x000000 0x030000>;
91 read-only;
92 };
93
94 partition@30000 {
95 label = "u-boot-env";
96 reg = <0x030000 0x010000>;
97 };
98
99 partition@40000 {
100 label = "art";
101 reg = <0x040000 0x010000>;
102 read-only;
103
104 compatible = "nvmem-cells";
105 #address-cells = <1>;
106 #size-cells = <1>;
107
108 cal_art_1000: cal@1000 {
109 reg = <0x1000 0x440>;
110 };
111
112 macaddr_art_0: macaddr@0 {
113 reg = <0x0 0x6>;
114 };
115
116 macaddr_art_1002: macaddr@1002 {
117 reg = <0x1002 0x6>;
118 };
119 };
120
121 partition@50000 {
122 compatible = "denx,uimage";
123 label = "firmware";
124 reg = <0x050000 0xfb0000>;
125 };
126 };
127 };
128 };
129
130 &usb {
131 status = "okay";
132 };
133
134 &usb_phy {
135 status = "okay";
136 };
137
138 &wmac {
139 status = "okay";
140
141 nvmem-cells = <&cal_art_1000>, <&macaddr_art_1002>;
142 nvmem-cell-names = "calibration", "mac-address";
143 };