ipq40xx: only include ath10k-board-qca4019 for the generic subtarget
[openwrt/staging/chunkeey.git] / target / linux / ath79 / dts / ar9342_mikrotik_routerboard-912uag-2hpnd.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later
2
3 #include "ar9344.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "mikrotik,routerboard-912uag-2hpnd", "qca,ar9342";
10 model = "MikroTik RouterBOARD 912UAG-2HPnD";
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 gpio_key: gpio_key {
20 compatible = "mikrotik,gpio-rb91x-key";
21 gpio-controller;
22 #gpio-cells = <2>;
23 gpio = <&gpio 15 GPIO_ACTIVE_HIGH>;
24 };
25
26 gpio_latch: gpio_latch {
27 compatible = "gpio-latch";
28 gpio-controller;
29 #gpio-cells = <2>;
30 gpios = <&gpio 0 GPIO_ACTIVE_HIGH>,
31 <&gpio 1 GPIO_ACTIVE_HIGH>,
32 <&gpio 2 GPIO_ACTIVE_HIGH>,
33 <&gpio 3 GPIO_ACTIVE_HIGH>,
34 <0>, /* Not connected */
35 <&gpio 13 GPIO_ACTIVE_HIGH>,
36 <&gpio 14 GPIO_ACTIVE_HIGH>,
37 <&gpio_key 0 GPIO_ACTIVE_HIGH>,
38 <&gpio 11 GPIO_ACTIVE_LOW>; /* Latch Enable */
39 };
40
41 nand_gpio {
42 compatible = "mikrotik,rb91x-nand";
43
44 gpios = <&gpio_latch 3 GPIO_ACTIVE_HIGH>, /* Read */
45 <&gpio 4 GPIO_ACTIVE_HIGH>, /* Ready (RDY) */
46 <&gpio_latch 5 GPIO_ACTIVE_LOW>, /* Chip Enable (nCE) */
47 <&gpio_latch 6 GPIO_ACTIVE_HIGH>, /* Command Latch Enable (CLE) */
48 <&gpio_latch 7 GPIO_ACTIVE_HIGH>, /* Address Latch Enable (ALE) */
49 <&gpio 12 GPIO_ACTIVE_LOW>, /* Read/Write Enable (nRW) */
50 <&gpio_latch 8 GPIO_ACTIVE_LOW>, /* Latch Enable (nLE) */
51 <&gpio_key 2 GPIO_ACTIVE_HIGH>; /* Key poll disable */
52
53 partitions {
54 compatible = "fixed-partitions";
55 #size-cells = <1>;
56
57 partition@0 {
58 label = "booter";
59 reg = <0x0 0x0040000>;
60 read-only;
61 };
62
63 partition@40000 {
64 label = "kernel";
65 reg = <0x0040000 0x03c0000>;
66 };
67
68 partition@400000 {
69 label = "ubi";
70 reg = <0x0400000 0x7c00000>;
71 };
72 };
73 };
74
75 keys {
76 compatible = "gpio-keys-polled";
77 poll-interval = <20>;
78
79 button@0 {
80 label = "reset";
81 linux,code = <KEY_RESTART>;
82 gpios = <&gpio_key 1 GPIO_ACTIVE_LOW>;
83 };
84 };
85
86 leds {
87 compatible = "gpio-leds";
88
89 led_power: power {
90 label = "green:power";
91 gpios = <&gpio_latch 1 GPIO_ACTIVE_HIGH>;
92 default-state = "on";
93 };
94
95 user {
96 label = "green:user";
97 gpios = <&gpio_latch 2 GPIO_ACTIVE_HIGH>;
98 };
99
100 led1 {
101 label = "green:led1";
102 gpios = <&ssr 0 GPIO_ACTIVE_HIGH>;
103 };
104
105 led2 {
106 label = "green:led2";
107 gpios = <&ssr 1 GPIO_ACTIVE_HIGH>;
108 };
109
110 led3 {
111 label = "green:led3";
112 gpios = <&ssr 2 GPIO_ACTIVE_HIGH>;
113 };
114
115 led4 {
116 label = "green:led4";
117 gpios = <&ssr 3 GPIO_ACTIVE_HIGH>;
118 };
119
120 led5 {
121 label = "green:led5";
122 gpios = <&ssr 4 GPIO_ACTIVE_HIGH>;
123 };
124 };
125
126 gpio-export {
127 compatible = "gpio-export";
128
129 beeper {
130 gpio-export,name = "beeper";
131 gpio-export,output = <1>; /* Must be 1 to avoid EMI induced clicking noise */
132 gpios = <&ssr 5 GPIO_ACTIVE_HIGH>;
133 };
134
135 usb_power {
136 gpio-export,name = "power-usb";
137 gpio-export,output = <1>;
138 gpios = <&ssr 6 GPIO_ACTIVE_HIGH>;
139 };
140
141 pcie_power {
142 gpio-export,name = "power-pcie";
143 gpio-export,output = <0>;
144 gpios = <&ssr 7 GPIO_ACTIVE_HIGH>;
145 };
146 };
147 };
148
149 &ref {
150 clock-frequency = <25000000>;
151 };
152
153 &spi {
154 status = "okay";
155
156 compatible = "qca,ar7100-spi";
157
158 cs-gpios = <0>, <&gpio_latch 0 GPIO_ACTIVE_LOW>;
159
160 flash@0 {
161 compatible = "jedec,spi-nor";
162 reg = <0>;
163 spi-max-frequency = <50000000>;
164
165 partitions {
166 compatible = "mikrotik,routerboot-partitions";
167 #address-cells = <1>;
168 #size-cells = <1>;
169
170 partition@0 {
171 label = "routerboot";
172 reg = <0x0 0x0>;
173 read-only;
174 };
175
176 hard_config {
177 read-only;
178 };
179
180 bios {
181 size = <0x1000>;
182 read-only;
183 };
184
185 soft_config {
186 };
187 };
188 };
189
190 ssr: ssr@1 {
191 compatible = "fairchild,74hc595";
192 gpio-controller;
193 #gpio-cells = <2>;
194 registers-number = <1>;
195 reg = <1>;
196 spi-max-frequency = <50000000>;
197 };
198 };
199
200 &mdio0 {
201 status = "okay";
202
203 phy-mask = <0>;
204
205 phy0: ethernet-phy@0 {
206 reg = <0>;
207 };
208 };
209
210 &eth0 {
211 status = "okay";
212
213 phy-mode = "rgmii-id";
214 phy-handle = <&phy0>;
215 pll-data = <0x02000000 0x00000101 0x00001313>;
216
217 gmac-config {
218 device = <&gmac>;
219 rgmii-gmac0 = <1>;
220 rxd-delay = <1>;
221 txd-delay = <1>;
222 };
223 };
224
225 &wmac {
226 status = "okay";
227 qca,no-eeprom;
228 };
229
230 &pcie {
231 status = "okay";
232 };
233
234 &usb {
235 status = "okay";
236 };
237
238 &usb_phy {
239 status = "okay";
240 };