ath79: ar: convert to nvmem-layout
[openwrt/staging/hauke.git] / target / linux / ath79 / dts / ar9344_pcs_cr5000.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "ar9344.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 model = "PowerCloud Systems CR5000";
10 compatible = "pcs,cr5000", "qca,ar9344";
11
12 aliases {
13 led-boot = &led_power;
14 led-failsafe = &led_power;
15 led-running = &led_power;
16 led-upgrade = &led_power;
17 };
18
19 keys {
20 compatible = "gpio-keys";
21
22 pinctrl-names = "default";
23 pinctrl-0 = <&jtag_disable_pins>;
24
25 reset {
26 label = "Reset button";
27 linux,code = <KEY_RESTART>;
28 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
29 debounce-interval = <60>;
30 };
31
32 wps {
33 label = "WPS button";
34 linux,code = <KEY_WPS_BUTTON>;
35 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
36 debounce-interval = <60>;
37 };
38 };
39
40 leds {
41 compatible = "gpio-leds";
42
43 led_power: power {
44 label = "amber:power";
45 gpios = <&gpio 2 GPIO_ACTIVE_LOW>,
46 <&gpio 4 GPIO_ACTIVE_LOW>;
47 default-state = "on";
48 };
49
50 wlan2g {
51 label = "blue:wlan";
52 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
53 linux,default-trigger = "phy0tpt";
54 };
55
56 wps_white {
57 label = "white:wps";
58 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
59 };
60 };
61 };
62
63 &ref {
64 clock-frequency = <25000000>;
65 };
66
67 &spi {
68 status = "okay";
69
70 flash@0 {
71 compatible = "jedec,spi-nor";
72 reg = <0>;
73 spi-max-frequency = <25000000>;
74
75 partitions {
76 compatible = "fixed-partitions";
77 #address-cells = <1>;
78 #size-cells = <1>;
79
80 uboot: partition@0 {
81 label = "u-boot";
82 reg = <0x000000 0x040000>;
83 read-only;
84 };
85
86 partition@40000 {
87 label = "u-boot-env";
88 reg = <0x040000 0x010000>;
89 read-only;
90 };
91
92 partition@50000 {
93 compatible = "denx,uimage";
94 label = "firmware";
95 reg = <0x050000 0x07a0000>;
96 };
97
98 art: partition@7f0000 {
99 label = "art";
100 reg = <0x7f0000 0x010000>;
101 read-only;
102
103 nvmem-layout {
104 compatible = "fixed-layout";
105 #address-cells = <1>;
106 #size-cells = <1>;
107
108 macaddr_art_0: macaddr@0 {
109 reg = <0x0 0x6>;
110 };
111
112 macaddr_art_5002: macaddr@5002 {
113 reg = <0x5002 0x6>;
114 };
115 };
116 };
117 };
118 };
119 };
120
121 &usb {
122 status = "okay";
123 };
124
125 &usb_phy {
126 status = "okay";
127 };
128
129 &pcie {
130 status = "okay";
131
132 ath9k: wifi@0,0 {
133 compatible = "pci168c,0030";
134 reg = <0x0000 0 0 0 0>;
135 nvmem-cells = <&macaddr_art_5002>;
136 nvmem-cell-names = "mac-address";
137 #gpio-cells = <2>;
138 gpio-controller;
139 };
140 };
141
142 &mdio0 {
143 status = "okay";
144
145 phy0: ethernet-phy@0 {
146 reg = <0>;
147 phy-mode = "rgmii";
148 qca,ar8327-initvals = <
149 0x04 0x07600000 /* PORT0 PAD MODE CTRL */
150 0x10 0x81000080 /* POWER_ON_STRAP */
151 0x50 0xcc35cc35 /* LED_CTRL0 */
152 0x54 0xca35ca35 /* LED_CTRL1 */
153 0x58 0xc935c935 /* LED_CTRL2 */
154 0x5c 0x03ffff00 /* LED_CTRL3 */
155 0x7c 0x0000007e /* PORT0_STATUS */
156 >;
157 };
158 };
159
160 &eth0 {
161 #address-cells = <1>;
162 #size-cells = <0>;
163 status = "okay";
164
165 /* default for ar934x, except for 1000M */
166 pll-data = <0x06000000 0x00000101 0x00001616>;
167
168 nvmem-cells = <&macaddr_art_0>;
169 nvmem-cell-names = "mac-address";
170
171 phy-mode = "rgmii";
172 phy-handle = <&phy0>;
173
174 aliases {
175 ag0 = &eth1;
176 };
177
178 port@0 {
179 compatible = "swconfig,port";
180 reg = <0>;
181 swconfig,segment = "lan";
182 swconfig,portmap = <1 1>;
183 };
184
185 port@1 {
186 compatible = "swconfig,port";
187 reg = <1>;
188 swconfig,segment = "lan";
189 swconfig,portmap = <2 2>;
190 };
191
192 port@2 {
193 compatible = "swconfig,port";
194 reg = <2>;
195 swconfig,segment = "lan";
196 swconfig,portmap = <3 3>;
197 };
198
199 port@3 {
200 compatible = "swconfig,port";
201 reg = <3>;
202 swconfig,segment = "lan";
203 swconfig,portmap = <4 4>;
204 };
205
206 port@4 {
207 compatible = "swconfig,port";
208 reg = <4>;
209 swconfig,segment = "wan";
210 swconfig,portmap = <5 5>;
211 };
212 };
213
214 &wmac {
215 status = "okay";
216
217 mtd-cal-data = <&art 0x1000>;
218 };