9faddcc37f372f55b6dc83ce49ec39a890bac231
[openwrt/staging/jow.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 #address-cells = <1>;
56 #size-cells = <1>;
57
58 partition@0 {
59 label = "booter";
60 reg = <0x0 0x0040000>;
61 read-only;
62 };
63
64 partition@40000 {
65 label = "kernel";
66 reg = <0x0040000 0x03c0000>;
67 };
68
69 partition@400000 {
70 label = "ubi";
71 reg = <0x0400000 0x7c00000>;
72 };
73 };
74 };
75
76 keys {
77 compatible = "gpio-keys-polled";
78 poll-interval = <20>;
79
80 button-reset {
81 label = "reset";
82 linux,code = <KEY_RESTART>;
83 gpios = <&gpio_key 1 GPIO_ACTIVE_LOW>;
84 };
85 };
86
87 leds {
88 compatible = "gpio-leds";
89
90 led_power: power {
91 label = "green:power";
92 gpios = <&gpio_latch 1 GPIO_ACTIVE_HIGH>;
93 default-state = "on";
94 };
95
96 user {
97 label = "green:user";
98 gpios = <&gpio_latch 2 GPIO_ACTIVE_HIGH>;
99 };
100
101 led1 {
102 label = "green:led1";
103 gpios = <&ssr 0 GPIO_ACTIVE_HIGH>;
104 };
105
106 led2 {
107 label = "green:led2";
108 gpios = <&ssr 1 GPIO_ACTIVE_HIGH>;
109 };
110
111 led3 {
112 label = "green:led3";
113 gpios = <&ssr 2 GPIO_ACTIVE_HIGH>;
114 };
115
116 led4 {
117 label = "green:led4";
118 gpios = <&ssr 3 GPIO_ACTIVE_HIGH>;
119 };
120
121 led5 {
122 label = "green:led5";
123 gpios = <&ssr 4 GPIO_ACTIVE_HIGH>;
124 };
125 };
126
127 gpio-export {
128 compatible = "gpio-export";
129
130 beeper {
131 gpio-export,name = "beeper";
132 gpio-export,output = <1>; /* Must be 1 to avoid EMI induced clicking noise */
133 gpios = <&ssr 5 GPIO_ACTIVE_HIGH>;
134 };
135
136 usb_power {
137 gpio-export,name = "power-usb";
138 gpio-export,output = <1>;
139 gpios = <&ssr 6 GPIO_ACTIVE_HIGH>;
140 };
141
142 pcie_power {
143 gpio-export,name = "power-pcie";
144 gpio-export,output = <0>;
145 gpios = <&ssr 7 GPIO_ACTIVE_HIGH>;
146 };
147 };
148 };
149
150 &ref {
151 clock-frequency = <40000000>;
152 };
153
154 &spi {
155 status = "okay";
156
157 compatible = "qca,ar7100-spi";
158
159 cs-gpios = <0>, <&gpio_latch 0 GPIO_ACTIVE_LOW>;
160
161 flash@0 {
162 compatible = "jedec,spi-nor";
163 reg = <0>;
164 spi-max-frequency = <50000000>;
165
166 partitions {
167 compatible = "mikrotik,routerboot-partitions";
168 #address-cells = <1>;
169 #size-cells = <1>;
170
171 partition@0 {
172 label = "routerboot";
173 reg = <0x0 0x0>;
174 read-only;
175 };
176
177 hard_config {
178 read-only;
179 };
180
181 bios {
182 size = <0x1000>;
183 read-only;
184 };
185
186 soft_config {
187 };
188 };
189 };
190
191 ssr: ssr@1 {
192 compatible = "fairchild,74hc595";
193 gpio-controller;
194 #gpio-cells = <2>;
195 registers-number = <1>;
196 reg = <1>;
197 spi-max-frequency = <50000000>;
198 };
199 };
200
201 &mdio0 {
202 status = "okay";
203
204 phy0: ethernet-phy@0 {
205 reg = <0>;
206 };
207 };
208
209 &eth0 {
210 status = "okay";
211
212 phy-mode = "rgmii-id";
213 phy-handle = <&phy0>;
214 pll-data = <0x02000000 0x00000101 0x00001313>;
215
216 gmac-config {
217 device = <&gmac>;
218 rgmii-gmac0 = <1>;
219 rxd-delay = <1>;
220 txd-delay = <1>;
221 };
222 };
223
224 &wmac {
225 status = "okay";
226 qca,no-eeprom;
227 };
228
229 &pcie {
230 status = "okay";
231 };
232
233 &usb {
234 status = "okay";
235 };
236
237 &usb_phy {
238 status = "okay";
239 };