ramips: clean and improve MAC address setup in 02_network
[oweals/openwrt.git] / target / linux / ramips / dts / mt7620a_fon_fon2601.dts
1 // SPDX-License-Identifier: GPL-2.0
2 /dts-v1/;
3
4 #include "mt7620a.dtsi"
5
6 #include <dt-bindings/gpio/gpio.h>
7 #include <dt-bindings/input/input.h>
8
9 / {
10         compatible = "fon,fon2601", "ralink,mt7620a-soc";
11         model = "Fon FON2601";
12
13         aliases {
14                 led-boot = &led_power;
15                 led-failsafe = &led_power;
16                 led-running = &led_power;
17                 led-upgrade = &led_power;
18         };
19
20         leds {
21                 compatible = "gpio-leds";
22
23                 led_power: power_r {
24                         label = "fon2601:red:power";
25                         gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
26                 };
27
28                 internet_g {
29                         label = "fon2601:green:internet";
30                         gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
31                 };
32
33                 net_g {
34                         label = "fon2601:green:net";
35                         gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
36                 };
37
38                 wifi_g {
39                         label = "fon2601:green:wifi";
40                         gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
41                 };
42         };
43
44         keys {
45                 compatible = "gpio-keys";
46
47                 reset {
48                         label = "reset";
49                         gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
50                         linux,code = <KEY_RESTART>;
51                 };
52         };
53 };
54
55 &spi0 {
56         status = "okay";
57
58         flash@0 {
59                 compatible = "jedec,spi-nor";
60                 reg = <0>;
61                 spi-max-frequency = <10000000>;
62
63                 partitions {
64                         compatible = "fixed-partitions";
65                         #address-cells = <1>;
66                         #size-cells = <1>;
67
68                         partition@0 {
69                                 label = "u-boot";
70                                 reg = <0x0 0x30000>;
71                                 read-only;
72                         };
73
74                         partition@30000 {
75                                 label = "u-boot-env";
76                                 reg = <0x30000 0x10000>;
77                                 read-only;
78                         };
79
80                         factory: partition@40000 {
81                                 label = "factory";
82                                 reg = <0x40000 0x10000>;
83                                 read-only;
84                         };
85
86                         partition@50000 {
87                                 compatible = "fonfxc,uimage";
88                                 label = "firmware";
89                                 reg = <0x50000 0xf90000>;
90                         };
91
92                         partition@fe0000 {
93                                 label = "board_data";
94                                 reg = <0xfe0000 0x20000>;
95                                 read-only;
96                         };
97                 };
98         };
99 };
100
101 &state_default {
102         gpio {
103                 ralink,group = "i2c", "uartf";
104                 ralink,function = "gpio";
105         };
106         nd_sd {
107                 ralink,group = "nd_sd";
108                 ralink,function = "sd";
109         };
110         spi_cs {
111                 ralink,group = "spi refclk";
112                 ralink,function = "spi refclk";
113         };
114 };
115
116 &ethernet {
117         pinctrl-names = "default";
118         pinctrl-0 = <&rgmii2_pins &mdio_pins>;
119
120         mtd-mac-address = <&factory 0x4>;
121
122         port@4 {
123                 status = "okay";
124                 phy-handle = <&phy4>;
125                 phy-mode = "rgmii";
126         };
127
128         mdio-bus {
129                 status = "okay";
130
131                 phy4: ethernet-phy@4 {
132                         reg = <4>;
133                         phy-mode = "rgmii";
134                 };
135         };
136 };
137
138 &gsw {
139         mediatek,port4 = "gmac";
140 };
141
142 &wmac {
143         ralink,mtd-eeprom = <&factory 0>;
144         pinctrl-names = "default";
145         pinctrl-0 = <&pa_pins>, <&wled_pins>;
146 };
147
148 &pcie {
149         status = "okay";
150 };
151 &pcie0 {
152         wifi@0,0 {
153                 compatible = "pci14c3,7662";
154                 reg = <0x0000 0 0 0 0>;
155                 mediatek,mtd-eeprom = <&factory 0x8000>;
156                 ieee80211-freq-limit = <5000000 6000000>;
157         };
158 };
159
160 &ehci {
161         status = "okay";
162 };
163
164 &ohci {
165         status = "okay";
166 };