ath79: use the new DT fixed partitions syntax
[oweals/openwrt.git] / target / linux / ath79 / dts / ar7161_netgear_wndr3800.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6
7 #include "ar7100.dtsi"
8
9 / {
10         compatible = "netgear,wndr3800", "qca,ar7161";
11         model = "Netgear WNDR3800";
12
13         memory@0 {
14                 device_type = "memory";
15                 reg = <0x0 0x8000000>;
16         };
17
18         extosc: ref {
19                 compatible = "fixed-clock";
20                 #clock-cells = <0>;
21                 clock-output-names = "ref";
22                 clock-frequency = <40000000>;
23         };
24
25         reset-leds {
26                 compatible = "reset-leds";
27
28                 wps {
29                         label = "netgear:green:usb";
30                         resets = <&rst 12>;
31                 };
32         };
33
34         gpio-leds {
35                 compatible = "gpio-leds";
36
37                 wps {
38                         label = "netgear:orange:wps";
39                         gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
40                         default-state = "off";
41                 };
42
43                 power_green {
44                         label = "netgear:green:power";
45                         gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
46                         default-state = "off";
47                 };
48
49                 power_orange {
50                         label = "netgear:orange:power";
51                         gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
52                         default-state = "off";
53                 };
54
55                 wps_green {
56                         label = "netgear:green:wps";
57                         gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
58                         default-state = "off";
59                 };
60
61                 wan_green {
62                         label = "netgear:green:wan";
63                         gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
64                         default-state = "off";
65                 };
66         };
67
68         gpio-keys-polled {
69                 compatible = "gpio-keys-polled";
70                 #address-cells = <1>;
71                 #size-cells = <0>;
72                 poll-interval = <100>;
73
74                 button@0 {
75                         label = "wps";
76                         linux,code = <KEY_WPS_BUTTON>;
77                         gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
78                 };
79
80                 button@1 {
81                         label = "reset";
82                         linux,code = <KEY_RESTART>;
83                         gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
84                 };
85
86                 button@2 {
87                         label = "wifi";
88                         linux,code = <BTN_2>;
89                         gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
90                 };
91         };
92
93         rtl8366s {
94                 compatible = "realtek,rtl8366s";
95                 gpio-sda = <&gpio 5 GPIO_ACTIVE_HIGH>;
96                 gpio-sck = <&gpio 7 GPIO_ACTIVE_HIGH>;
97
98                 mdio-bus {
99                         status = "okay";
100
101                         phy-mask = <0x10>;
102
103                         phy4: ethernet-phy@4 {
104                                 reg = <4>;
105                                 phy-mode = "rgmii";
106                         };
107                 };
108         };
109 };
110
111 &usb_phy {
112         status = "okay";
113 };
114
115 &usb1 {
116         status = "okay";
117 };
118
119 &usb2 {
120         status = "okay";
121 };
122
123 &pcie0 {
124         status = "okay";
125 };
126
127 &uart {
128         status = "okay";
129 };
130
131 &spi {
132         status = "okay";
133         num-cs = <1>;
134
135         flash@0 {
136                 #address-cells = <1>;
137                 #size-cells = <1>;
138                 compatible = "mx25l12805d";
139                 reg = <0>;
140                 spi-max-frequency = <25000000>;
141
142                 partitions {
143                         compatible = "fixed-partitions";
144                         #address-cells = <1>;
145                         #size-cells = <1>;
146
147                         partition@0 {
148                                 label = "u-boot";
149                                 reg = <0x000000 0x050000>;
150                                 read-only;
151                         };
152
153                         partition@1 {
154                                 label = "u-boot-env";
155                                 reg = <0x050000 0x020000>;
156                         };
157
158                         partition@2 {
159                                 label = "firmware";
160                                 reg = <0x70000 0xf80000>;
161                         };
162
163                         partition@3 {
164                                 label = "art";
165                                 reg = <0xff0000 0x010000>;
166                                 read-only;
167                         };
168                 };
169         };
170 };
171
172 &eth0 {
173         status = "okay";
174
175         pll-data = <0x11110000 0x00001099 0x00991099>;
176
177         fixed-link {
178                 speed = <1000>;
179                 full-duplex;
180         };
181 };
182
183 &eth1 {
184         status = "okay";
185
186         pll-data = <0x11110000 0x00001099 0x00991099>;
187
188         resets = <&rst 13>;
189         reset-names = "mac";
190
191         phy-handle = <&phy4>;
192 };