ath79: add support for MikroTik RouterBOARD 493G (rb4xx series)
[openwrt/staging/nbd.git] / target / linux / ath79 / dts / ar7100_mikrotik_routerboard-4xx.dtsi
1 // SPDX-License-Identifier: GPL-1.0-or-later OR MIT
2
3 #include <dt-bindings/gpio/gpio.h>
4 #include <dt-bindings/input/input.h>
5
6 #include "ar7100.dtsi"
7
8 / {
9 aliases {
10 led-boot = &led_user;
11 led-failsafe = &led_user;
12 led-running = &led_user;
13 };
14
15 chosen {
16 bootargs = "console=ttyS0,115200";
17 };
18
19 leds {
20 compatible = "gpio-leds";
21
22 led_user: user {
23 label = "mikrotik:yellow:user";
24 gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
25 default-state = "on";
26 };
27
28 led1 {
29 label = "mikrotik:green:led1";
30 gpios = <&cpld_gpio 0 GPIO_ACTIVE_LOW>;
31 };
32
33 led2 {
34 label = "mikrotik:green:led2";
35 gpios = <&cpld_gpio 2 GPIO_ACTIVE_LOW>;
36 };
37
38 led3 {
39 label = "mikrotik:green:led3";
40 gpios = <&cpld_gpio 1 GPIO_ACTIVE_LOW>;
41 };
42
43 led4 {
44 label = "mikrotik:green:led4";
45 gpios = <&cpld_gpio 3 GPIO_ACTIVE_LOW>;
46 };
47
48 led5 {
49 label = "mikrotik:green:led5";
50 gpios = <&cpld_gpio 8 GPIO_ACTIVE_LOW>;
51 };
52 };
53 };
54
55 &uart {
56 status = "okay";
57 };
58
59 &gpio {
60 ngpios = <31>;
61 gpio-line-names =
62 "", "", "", "", "LED", "RDY", "", "MDC",
63 "MDIO", "", "", "", "", "", "", "",
64 "", "", "", "", "", "", "", "",
65 "", "", "", "", "", "", "", "";
66 };
67
68 &pcie0 {
69 status = "okay";
70 };
71
72 &spi {
73 status = "okay";
74
75 compatible = "mikrotik,rb4xx-spi";
76
77 flash@0 {
78 compatible = "pm25lv512", "jedec,spi-nor";
79
80 reg = <0>;
81 spi-max-frequency = <25000000>;
82
83 partitions {
84 compatible = "mikrotik,routerboot-partitions";
85 #address-cells = <1>;
86 #size-cells = <1>;
87
88 partition@0 {
89 label = "routerboot1";
90 reg = <0x0 0x0>;
91 read-only;
92 };
93
94 hard_config {
95 label = "hard_config";
96 read-only;
97 };
98
99 bios {
100 label = "bios";
101 size = <0x1000>;
102 read-only;
103 };
104
105 routerboot2 {
106 label = "routerboot2";
107 read-only;
108 };
109
110 soft_config {
111 label = "soft_config";
112 };
113 };
114 };
115
116 cpld@1 {
117 compatible = "mikrotik,rb4xx-cpld";
118
119 reg = <1>;
120 spi-max-frequency = <25000000>;
121
122 cpld_gpio: gpio {
123 compatible = "mikrotik,rb4xx-gpio";
124
125 base = <32>;
126
127 gpio-controller;
128 #gpio-cells = <2>;
129 gpio-line-names =
130 "LED1", "LED2", "LED3", "LED4",
131 "FAN", "ALE", "CLE", "nCE",
132 "LED5";
133 };
134
135 nand {
136 compatible = "mikrotik,rb4xx-nand";
137
138 gpios = <&cpld_gpio 5 GPIO_ACTIVE_HIGH>, // ALE
139 <&cpld_gpio 6 GPIO_ACTIVE_HIGH>, // CLE
140 <&cpld_gpio 7 GPIO_ACTIVE_HIGH>, // nCE
141 <&gpio 5 GPIO_ACTIVE_HIGH>; // RDY
142
143 partitions {
144 compatible = "fixed-partitions";
145 #address-cells = <1>;
146 #size-cells = <1>;
147
148 partition@0 {
149 label = "booter";
150 reg = <0x0000000 0x0040000>;
151 read-only;
152 };
153
154 partition@40000 {
155 label = "kernel";
156 reg = <0x0040000 0x0800000>;
157 };
158
159 partition@840000 {
160 label = "ubi";
161 reg = <0x0840000 0x77c0000>;
162 };
163 };
164 };
165 };
166 };
167
168 &eth0 {
169 status = "okay";
170
171 phy-handle = <&phy0>;
172 };
173
174 &mdio0 {
175 status = "okay";
176
177 phy0: ethernet-phy@0 {
178 reg = <0>;
179 };
180 };