kirkwood: add ZyXEL NSA310b
[openwrt/openwrt.git] / target / linux / kirkwood / patches-4.4 / 191-nsa310b.patch
1 kirkwood: add nsa310b dtb, a zyxel nsa310 variant
2
3 add support to a nsa310 variant with red/green usb led
4 and lm85 temp/fan controller
5
6 Signed-off-by: Alberto Bursi <alberto.bursi@outlook.it>
7
8 NOTE: this patch can be upstreamed as-is, LEDE-specific
9 nand partitions are set in another patch
10
11 --- a/arch/arm/boot/dts/Makefile
12 +++ b/arch/arm/boot/dts/Makefile
13 @@ -203,6 +203,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
14 kirkwood-ns2mini.dtb \
15 kirkwood-nsa310.dtb \
16 kirkwood-nsa310a.dtb \
17 + kirkwood-nsa310b.dtb \
18 kirkwood-openblocks_a6.dtb \
19 kirkwood-openblocks_a7.dtb \
20 kirkwood-openrd-base.dtb \
21 --- /dev/null
22 +++ b/arch/arm/boot/dts/kirkwood-nsa310b.dts
23 @@ -0,0 +1,146 @@
24 +/dts-v1/;
25 +
26 +#include "kirkwood-nsa3x0-common.dtsi"
27 +
28 +/*
29 + * There are at least two different NSA310 designs. This variant has
30 + * a red/green USB Led (same as nsa310) and a lm85 temp/fan controller.
31 + */
32 +
33 +/ {
34 + model = "ZyXEL NSA310b";
35 + compatible = "zyxel,nsa310a", "zyxel,nsa310", "marvell,kirkwood-88f6281", "marvell,kirkwood";
36 +
37 + memory {
38 + device_type = "memory";
39 + reg = <0x00000000 0x10000000>;
40 + };
41 +
42 + chosen {
43 + bootargs = "console=ttyS0,115200";
44 + stdout-path = "&uart0";
45 + };
46 +
47 + mbus {
48 + pcie-controller {
49 + status = "okay";
50 +
51 + pcie@1,0 {
52 + status = "okay";
53 + };
54 + };
55 + };
56 +
57 + ocp@f1000000 {
58 + pinctrl: pin-controller@10000 {
59 + pinctrl-0 = <&pmx_unknown>;
60 + pinctrl-names = "default";
61 +
62 + pmx_led_esata_green: pmx-led-esata-green {
63 + marvell,pins = "mpp12";
64 + marvell,function = "gpio";
65 + };
66 +
67 + pmx_led_esata_red: pmx-led-esata-red {
68 + marvell,pins = "mpp13";
69 + marvell,function = "gpio";
70 + };
71 +
72 + pmx_led_usb_green: pmx-led-usb-green {
73 + marvell,pins = "mpp15";
74 + marvell,function = "gpio";
75 + };
76 +
77 + pmx_led_usb_red: pmx-led-usb-red {
78 + marvell,pins = "mpp16";
79 + marvell,function = "gpio";
80 + };
81 +
82 + pmx_led_sys_green: pmx-led-sys-green {
83 + marvell,pins = "mpp28";
84 + marvell,function = "gpio";
85 + };
86 +
87 + pmx_led_sys_red: pmx-led-sys-red {
88 + marvell,pins = "mpp29";
89 + marvell,function = "gpio";
90 + };
91 +
92 + pmx_led_hdd_green: pmx-led-hdd-green {
93 + marvell,pins = "mpp41";
94 + marvell,function = "gpio";
95 + };
96 +
97 + pmx_led_hdd_red: pmx-led-hdd-red {
98 + marvell,pins = "mpp42";
99 + marvell,function = "gpio";
100 + };
101 +
102 + pmx_unknown: pmx-unknown {
103 + marvell,pins = "mpp44";
104 + marvell,function = "gpio";
105 + };
106 +
107 + };
108 +
109 + i2c@11000 {
110 + status = "okay";
111 +
112 + lm85@2e {
113 + compatible = "national,lm85";
114 + reg = <0x2e>;
115 + };
116 + };
117 + };
118 +
119 + gpio-leds {
120 + compatible = "gpio-leds";
121 + pinctrl-0 = <&pmx_led_esata_green &pmx_led_esata_red
122 + &pmx_led_usb_green &pmx_led_usb_red
123 + &pmx_led_sys_green &pmx_led_sys_red
124 + &pmx_led_copy_green &pmx_led_copy_red
125 + &pmx_led_hdd_green &pmx_led_hdd_red>;
126 + pinctrl-names = "default";
127 +
128 + green-sys {
129 + label = "nsa310:green:sys";
130 + gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>;
131 + };
132 + red-sys {
133 + label = "nsa310:red:sys";
134 + gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
135 + };
136 + green-hdd {
137 + label = "nsa310:green:hdd";
138 + gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
139 + };
140 + red-hdd {
141 + label = "nsa310:red:hdd";
142 + gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
143 + };
144 + green-esata {
145 + label = "nsa310:green:esata";
146 + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
147 + };
148 + red-esata {
149 + label = "nsa310:red:esata";
150 + gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
151 + };
152 + green-usb {
153 + label = "nsa310:green:usb";
154 + gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
155 + };
156 + red-usb {
157 + label = "nsa310:red:usb";
158 + gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
159 + };
160 + green-copy {
161 + label = "nsa310:green:copy";
162 + gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
163 + };
164 + red-copy {
165 + label = "nsa310:red:copy";
166 + gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
167 + };
168 + };
169 +};