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