kirkwood: set default state for status LEDs in device tree
[openwrt/openwrt.git] / target / linux / kirkwood / patches-4.19 / 108-on100.patch
1 --- /dev/null
2 +++ b/arch/arm/boot/dts/kirkwood-on100.dts
3 @@ -0,0 +1,163 @@
4 +/dts-v1/;
5 +
6 +#include "kirkwood.dtsi"
7 +#include "kirkwood-6282.dtsi"
8 +
9 +/ {
10 + model = "Cisco Systems ON100";
11 + compatible = "cisco,on100", "marvell,kirkwood-88f6282", "marvell,kirkwood";
12 +
13 + memory@0 {
14 + device_type = "memory";
15 + reg = <0x00000000 0x20000000>;
16 + };
17 +
18 + aliases {
19 + led-boot = &led_health_green;
20 + led-failsafe = &led_health_red;
21 + led-running = &led_health_green;
22 + led-upgrade = &led_health_red;
23 + serial0 = &uart0;
24 + };
25 +
26 + chosen {
27 + bootargs = "console=ttyS0,115200n8 earlyprintk";
28 + stdout-path = "serial0:115200n8";
29 + };
30 +
31 + gpio_keys {
32 + compatible = "gpio-keys";
33 + pinctrl-0 = <&pmx_btn_reset>;
34 + pinctrl-names = "default";
35 +
36 + reset {
37 + label = "Reset Button";
38 + linux,code = <KEY_RESTART>;
39 + gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
40 + };
41 + };
42 +
43 + gpio-leds {
44 + compatible = "gpio-leds";
45 + pinctrl-0 = < &pmx_led_health_r &pmx_led_health_g >;
46 + pinctrl-names = "default";
47 +
48 + led_health_green: health_green {
49 + label = "on100:green:health";
50 + gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
51 + default-state = "on";
52 + };
53 +
54 + led_health_red: health_red {
55 + label = "on100:red:health";
56 + gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
57 + };
58 +
59 + health2_green {
60 + label = "on100:green:health2";
61 + gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
62 + };
63 +
64 + health2_red {
65 + label = "on100:red:health2";
66 + gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
67 + };
68 + };
69 +};
70 +
71 +&eth0 {
72 + status = "okay";
73 +
74 + ethernet0-port@0 {
75 + phy-handle = <&ethphy0>;
76 + phy-connection-type = "rgmii-id";
77 + };
78 +};
79 +
80 +&eth1 {
81 + status = "okay";
82 +
83 + ethernet1-port@0 {
84 + phy-handle = <&ethphy1>;
85 + phy-connection-type = "rgmii-id";
86 + };
87 +};
88 +
89 +&mdio {
90 + status = "okay";
91 +
92 + ethphy0: ethernet-phy@0 {
93 + /* Marvell 88E1121R */
94 + compatible = "ethernet-phy-id0141.0cb0",
95 + "ethernet-phy-ieee802.3-c22";
96 + reg = <0>;
97 + };
98 +
99 + ethphy1: ethernet-phy@1 {
100 + /* Marvell 88E1121R */
101 + compatible = "ethernet-phy-id0141.0cb0",
102 + "ethernet-phy-ieee802.3-c22";
103 + reg = <1>;
104 + };
105 +};
106 +
107 +&nand {
108 + status = "okay";
109 +
110 + partition@0 {
111 + label = "u-boot";
112 + reg = <0x00000000 0x000a0000>;
113 + read-only;
114 + };
115 +
116 + partition@a0000 {
117 + label = "u-boot environment";
118 + reg = <0x000a0000 0x00020000>;
119 + read-only;
120 + };
121 +
122 + partition@c0000 {
123 + label = "kernel";
124 + reg = <0x000c0000 0x00540000>;
125 + };
126 +
127 + partition@600000 {
128 + label = "ubi";
129 + reg = <0x00600000 0x1fa00000>;
130 + };
131 +};
132 +
133 +&pinctrl {
134 + pmx_led_health_r: pmx-led-health-r {
135 + marvell,pins = "mpp45";
136 + marvell,function = "gpio";
137 + };
138 +
139 + pmx_led_health_g: pmx-led-health-g {
140 + marvell,pins = "mpp44";
141 + marvell,function = "gpio";
142 + };
143 +
144 + pmx_led_health2_r: pmx-led-health2-r {
145 + marvell,pins = "mpp47";
146 + marvell,function = "gpio";
147 + };
148 +
149 + pmx_led_health2_g: pmx-led-health2-g {
150 + marvell,pins = "mpp46";
151 + marvell,function = "gpio";
152 + };
153 +
154 + pmx_btn_reset: pmx-led-reset {
155 + marvell,pins = "mpp31";
156 + marvell,function = "gpio";
157 + };
158 +};
159 +
160 +&sdio {
161 + status = "okay";
162 +};
163 +
164 +&uart0 {
165 + status = "okay";
166 +};
167 --- a/arch/arm/boot/dts/Makefile
168 +++ b/arch/arm/boot/dts/Makefile
169 @@ -290,6 +290,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
170 kirkwood-nsa310b.dtb \
171 kirkwood-nsa320.dtb \
172 kirkwood-nsa325.dtb \
173 + kirkwood-on100.dtb \
174 kirkwood-openblocks_a6.dtb \
175 kirkwood-openblocks_a7.dtb \
176 kirkwood-openrd-base.dtb \