cc5553acdaff025ad3b9c27ccd278fa3fce2c2f1
[openwrt/staging/mkresin.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_latch: gpio_latch {
20 compatible = "gpio-latch";
21 gpio-controller;
22 #gpio-cells = <2>;
23 gpios = <&gpio 0 GPIO_ACTIVE_HIGH>,
24 <&gpio 1 GPIO_ACTIVE_HIGH>,
25 <&gpio 2 GPIO_ACTIVE_HIGH>,
26 <&gpio 3 GPIO_ACTIVE_HIGH>,
27 <0>, /* Not connected */
28 <&gpio 13 GPIO_ACTIVE_HIGH>,
29 <&gpio 14 GPIO_ACTIVE_HIGH>,
30 <&gpio 15 GPIO_ACTIVE_HIGH>,
31 <&gpio 11 GPIO_ACTIVE_LOW>; /* Latch Enable */
32 };
33
34 nand_gpio {
35 compatible = "mikrotik,rb91x-nand";
36
37 gpios = <&gpio_latch 3 GPIO_ACTIVE_HIGH>, /* Read */
38 <&gpio 4 GPIO_ACTIVE_HIGH>, /* Ready (RDY) */
39 <&gpio_latch 5 GPIO_ACTIVE_LOW>, /* Chip Enable (nCE) */
40 <&gpio_latch 6 GPIO_ACTIVE_HIGH>, /* Command Latch Enable (CLE) */
41 <&gpio_latch 7 GPIO_ACTIVE_HIGH>, /* Address Latch Enable (ALE) */
42 <&gpio 12 GPIO_ACTIVE_LOW>, /* Read/Write Enable (nRW) */
43 <&gpio_latch 8 GPIO_ACTIVE_LOW>; /* Latch Enable (nLE) */
44
45 partitions {
46 compatible = "fixed-partitions";
47 #size-cells = <1>;
48
49 partition@0 {
50 label = "booter";
51 reg = <0x0 0x0040000>;
52 read-only;
53 };
54
55 partition@40000 {
56 label = "kernel";
57 reg = <0x0040000 0x03c0000>;
58 };
59
60 partition@400000 {
61 label = "ubi";
62 reg = <0x0400000 0x7c00000>;
63 };
64 };
65 };
66
67 leds {
68 compatible = "gpio-leds";
69
70 led_power: power {
71 label = "green:power";
72 gpios = <&gpio_latch 1 GPIO_ACTIVE_HIGH>;
73 default-state = "on";
74 };
75
76 user {
77 label = "green:user";
78 gpios = <&gpio_latch 2 GPIO_ACTIVE_HIGH>;
79 };
80
81 led1 {
82 label = "green:led1";
83 gpios = <&ssr 0 GPIO_ACTIVE_HIGH>;
84 };
85
86 led2 {
87 label = "green:led2";
88 gpios = <&ssr 1 GPIO_ACTIVE_HIGH>;
89 };
90
91 led3 {
92 label = "green:led3";
93 gpios = <&ssr 2 GPIO_ACTIVE_HIGH>;
94 };
95
96 led4 {
97 label = "green:led4";
98 gpios = <&ssr 3 GPIO_ACTIVE_HIGH>;
99 };
100
101 led5 {
102 label = "green:led5";
103 gpios = <&ssr 4 GPIO_ACTIVE_HIGH>;
104 };
105 };
106
107 gpio-export {
108 compatible = "gpio-export";
109
110 usb_power {
111 gpio-export,name = "power-usb";
112 gpio-export,output = <1>;
113 gpios = <&ssr 6 GPIO_ACTIVE_HIGH>;
114 };
115
116 pcie_power {
117 gpio-export,name = "power-pcie";
118 gpio-export,output = <0>;
119 gpios = <&ssr 7 GPIO_ACTIVE_HIGH>;
120 };
121 };
122 };
123
124 &spi {
125 status = "okay";
126
127 compatible = "qca,ar7100-spi";
128
129 cs-gpios = <0>, <&gpio_latch 0 GPIO_ACTIVE_LOW>;
130
131 flash@0 {
132 compatible = "jedec,spi-nor";
133 reg = <0>;
134 spi-max-frequency = <50000000>;
135
136 partitions {
137 compatible = "mikrotik,routerboot-partitions";
138 #address-cells = <1>;
139 #size-cells = <1>;
140
141 partition@0 {
142 label = "routerboot";
143 reg = <0x0 0x0>;
144 read-only;
145 };
146
147 hard_config: hard_config {
148 read-only;
149 };
150
151 bios {
152 size = <0x1000>;
153 read-only;
154 };
155
156 soft_config {
157 };
158 };
159 };
160
161 ssr: ssr@1 {
162 compatible = "fairchild,74hc595";
163 gpio-controller;
164 #gpio-cells = <2>;
165 registers-number = <1>;
166 reg = <1>;
167 spi-max-frequency = <50000000>;
168 };
169 };
170
171 &mdio0 {
172 status = "okay";
173
174 phy-mask = <0>;
175
176 phy0: ethernet-phy@0 {
177 reg = <0>;
178 };
179 };
180
181 &eth0 {
182 status = "okay";
183
184 phy-mode = "rgmii-id";
185 phy-handle = <&phy0>;
186 pll-data = <0x02000000 0x00000101 0x00001313>;
187
188 gmac-config {
189 device = <&gmac>;
190 rgmii-gmac0 = <1>;
191 rgmii-enabled = <1>;
192 rxd-delay = <1>;
193 txd-delay = <1>;
194 };
195 };
196
197 &wmac {
198 status = "okay";
199 qca,no-eeprom;
200 };
201
202 &pcie {
203 status = "okay";
204 };
205
206 &usb {
207 status = "okay";
208 };
209
210 &usb_phy {
211 status = "okay";
212 };