3e475395f9f87c8bbaa8886c508a0a2178874f68
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7620a_fon_fon2601.dts
1 // SPDX-License-Identifier: GPL-2.0-only
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/leds/common.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 function = LED_FUNCTION_POWER;
25 color = <LED_COLOR_ID_RED>;
26 gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
27 };
28
29 internet_g {
30 label = "green:internet";
31 gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
32 };
33
34 net_g {
35 label = "green:net";
36 gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
37 };
38
39 wifi_g {
40 label = "green:wifi";
41 gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
42 };
43 };
44
45 keys {
46 compatible = "gpio-keys";
47
48 reset {
49 label = "reset";
50 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
51 linux,code = <KEY_RESTART>;
52 };
53 };
54 };
55
56 &spi0 {
57 status = "okay";
58
59 flash@0 {
60 compatible = "jedec,spi-nor";
61 reg = <0>;
62 spi-max-frequency = <10000000>;
63
64 partitions {
65 compatible = "fixed-partitions";
66 #address-cells = <1>;
67 #size-cells = <1>;
68
69 partition@0 {
70 label = "u-boot";
71 reg = <0x0 0x30000>;
72 read-only;
73 };
74
75 partition@30000 {
76 label = "u-boot-env";
77 reg = <0x30000 0x10000>;
78 read-only;
79 };
80
81 factory: partition@40000 {
82 label = "factory";
83 reg = <0x40000 0x10000>;
84 read-only;
85
86 nvmem-layout {
87 compatible = "fixed-layout";
88 #address-cells = <1>;
89 #size-cells = <1>;
90
91 eeprom_factory_0: eeprom@0 {
92 reg = <0x0 0x200>;
93 };
94
95 eeprom_factory_8000: eeprom@8000 {
96 reg = <0x8000 0x200>;
97 };
98
99 macaddr_factory_4: macaddr@4 {
100 reg = <0x4 0x6>;
101 };
102 };
103 };
104
105 partition@50000 {
106 compatible = "openwrt,uimage", "denx,uimage";
107 openwrt,padding = <32>;
108 label = "firmware";
109 reg = <0x50000 0xf90000>;
110 };
111
112 partition@fe0000 {
113 label = "board_data";
114 reg = <0xfe0000 0x20000>;
115 read-only;
116 };
117 };
118 };
119 };
120
121 &state_default {
122 gpio {
123 groups = "i2c", "uartf";
124 function = "gpio";
125 };
126 nd_sd {
127 groups = "nd_sd";
128 function = "sd";
129 };
130 spi_cs {
131 groups = "spi refclk";
132 function = "spi refclk";
133 };
134 };
135
136 &ethernet {
137 pinctrl-names = "default";
138 pinctrl-0 = <&rgmii2_pins &mdio_pins>;
139
140 nvmem-cells = <&macaddr_factory_4>;
141 nvmem-cell-names = "mac-address";
142
143 port@4 {
144 status = "okay";
145 phy-handle = <&phy4>;
146 phy-mode = "rgmii";
147 };
148
149 mdio-bus {
150 status = "okay";
151
152 phy4: ethernet-phy@4 {
153 reg = <4>;
154 phy-mode = "rgmii";
155 };
156 };
157 };
158
159 &gsw {
160 mediatek,port4-gmac;
161 mediatek,ephy-base = /bits/ 8 <8>;
162 };
163
164 &wmac {
165 nvmem-cells = <&eeprom_factory_0>;
166 nvmem-cell-names = "eeprom";
167
168 pinctrl-names = "default", "pa_gpio";
169 pinctrl-0 = <&pa_pins>, <&wled_pins>;
170 pinctrl-1 = <&pa_gpio_pins>, <&wled_pins>;
171 };
172
173 &pcie {
174 status = "okay";
175 };
176 &pcie0 {
177 wifi@0,0 {
178 compatible = "pci14c3,7662";
179 reg = <0x0000 0 0 0 0>;
180 nvmem-cells = <&eeprom_factory_8000>;
181 nvmem-cell-names = "eeprom";
182 ieee80211-freq-limit = <5000000 6000000>;
183 };
184 };
185
186 &ehci {
187 status = "okay";
188 };
189
190 &ohci {
191 status = "okay";
192 };