ath79: rb91x: enable pcie power early (WIP)
[openwrt/staging/xback.git] / target / linux / ath79 / dts / ar9342_mikrotik_routerboard-911g.dtsi
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 #include <dt-bindings/leds/common.h>
8
9 / {
10 aliases {
11 led-boot = &led_power;
12 led-failsafe = &led_power;
13 led-running = &led_power;
14 led-upgrade = &led_power;
15 };
16
17 gpio_key: gpio_key {
18 compatible = "mikrotik,gpio-rb91x-key";
19 gpio-controller;
20 #gpio-cells = <2>;
21 gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
22 };
23
24 gpio_latch: gpio_latch {
25 compatible = "gpio-latch";
26 gpio-controller;
27 #gpio-cells = <2>;
28 gpios = <&gpio 0 GPIO_ACTIVE_HIGH>,
29 <&gpio 1 GPIO_ACTIVE_HIGH>,
30 <&gpio 2 GPIO_ACTIVE_HIGH>,
31 <&gpio 3 GPIO_ACTIVE_HIGH>,
32 <0>, /* Not connected */
33 <&gpio 13 GPIO_ACTIVE_HIGH>,
34 <&gpio 14 GPIO_ACTIVE_HIGH>,
35 <&gpio_key 0 GPIO_ACTIVE_HIGH>,
36 <&gpio 11 GPIO_ACTIVE_LOW>; /* Latch Enable */
37 };
38
39 nand_gpio {
40 compatible = "mikrotik,rb91x-nand";
41
42 gpios = <&gpio_latch 3 GPIO_ACTIVE_HIGH>, /* Read */
43 <&gpio 4 GPIO_ACTIVE_HIGH>, /* Ready (RDY) */
44 <&gpio_latch 5 GPIO_ACTIVE_LOW>, /* Chip Enable (nCE) */
45 <&gpio_latch 6 GPIO_ACTIVE_HIGH>, /* Command Latch Enable (CLE) */
46 <&gpio_latch 7 GPIO_ACTIVE_HIGH>, /* Address Latch Enable (ALE) */
47 <&gpio 12 GPIO_ACTIVE_LOW>, /* Read/Write Enable (nRW) */
48 <&gpio_latch 8 GPIO_ACTIVE_LOW>, /* Latch Enable (nLE) */
49 <&gpio_key 2 GPIO_ACTIVE_HIGH>; /* Key poll disable */
50
51 partitions {
52 compatible = "fixed-partitions";
53 #address-cells = <1>;
54 #size-cells = <1>;
55
56 partition@0 {
57 label = "booter";
58 reg = <0x0 0x0040000>;
59 read-only;
60 };
61
62 partition@40000 {
63 label = "kernel";
64 reg = <0x0040000 0x03c0000>;
65 };
66
67 partition@400000 {
68 label = "ubi";
69 reg = <0x0400000 0x7c00000>;
70 };
71 };
72 };
73
74 keys {
75 compatible = "gpio-keys-polled";
76 poll-interval = <20>;
77
78 button-reset {
79 label = "reset";
80 linux,code = <KEY_RESTART>;
81 gpios = <&gpio_key 1 GPIO_ACTIVE_LOW>;
82 };
83 };
84
85 leds {
86 compatible = "gpio-leds";
87
88 led_power: power {
89 function = LED_FUNCTION_POWER;
90 color = <LED_COLOR_ID_GREEN>;
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 };
142
143 &ref {
144 clock-frequency = <25000000>;
145 };
146
147 &spi {
148 status = "okay";
149
150 compatible = "qca,ar7100-spi";
151
152 cs-gpios = <0>, <&gpio_latch 0 GPIO_ACTIVE_LOW>;
153
154 flash@0 {
155 compatible = "jedec,spi-nor";
156 reg = <0>;
157 spi-max-frequency = <50000000>;
158
159 partitions {
160 compatible = "mikrotik,routerboot-partitions";
161 #address-cells = <1>;
162 #size-cells = <1>;
163
164 partition@0 {
165 label = "routerboot";
166 reg = <0x0 0x0>;
167 read-only;
168 };
169
170 hard_config {
171 read-only;
172 };
173
174 bios {
175 size = <0x1000>;
176 read-only;
177 };
178
179 soft_config {
180 };
181 };
182 };
183
184 ssr: ssr@1 {
185 compatible = "fairchild,74hc595";
186 gpio-controller;
187 #gpio-cells = <2>;
188 registers-number = <1>;
189 reg = <1>;
190 spi-max-frequency = <50000000>;
191
192 power_pcie {
193 gpio-hog;
194 gpios = <7 0>;
195 output-high;
196 };
197 };
198 };
199
200 &mdio0 {
201 status = "okay";
202
203 phy0: ethernet-phy@0 {
204 reg = <0>;
205 };
206 };
207
208 &eth0 {
209 status = "okay";
210
211 phy-mode = "rgmii-id";
212 phy-handle = <&phy0>;
213 pll-data = <0x02000000 0x00000101 0x00001313>;
214
215 gmac-config {
216 device = <&gmac>;
217 rgmii-gmac0 = <1>;
218 rxd-delay = <1>;
219 txd-delay = <1>;
220 };
221 };
222
223 &wmac {
224 status = "okay";
225 qca,no-eeprom;
226 };