kirkwood: add ZyXEL NSA310b
[openwrt/openwrt.git] / target / linux / kirkwood / patches-4.4 / 192-nsa310s.patch
1 --- a/arch/arm/boot/dts/Makefile
2 +++ b/arch/arm/boot/dts/Makefile
3 @@ -204,6 +204,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
4 kirkwood-nsa310.dtb \
5 kirkwood-nsa310a.dtb \
6 kirkwood-nsa310b.dtb \
7 + kirkwood-nsa310s.dtb \
8 kirkwood-openblocks_a6.dtb \
9 kirkwood-openblocks_a7.dtb \
10 kirkwood-openrd-base.dtb \
11 --- /dev/null
12 +++ b/arch/arm/boot/dts/kirkwood-nsa310s.dts
13 @@ -0,0 +1,287 @@
14 +/dts-v1/;
15 +
16 +#include "kirkwood.dtsi"
17 +#include "kirkwood-6281.dtsi"
18 +
19 +/ {
20 + model = "ZyXEL NSA310S";
21 + compatible = "zyxel,nsa320s", "marvell,kirkwood-88f6702", "marvell,kirkwood";
22 +
23 + memory {
24 + device_type = "memory";
25 + reg = <0x00000000 0x10000000>;
26 + };
27 +
28 + chosen {
29 + bootargs = "console=ttyS0,115200n8 earlyprintk";
30 + stdout-path = &uart0;
31 + };
32 +
33 + mbus {
34 + pcie-controller {
35 + status = "okay";
36 +
37 + pcie@1,0 {
38 + status = "okay";
39 + };
40 + };
41 + };
42 +
43 + ocp@f1000000 {
44 + pinctrl: pin-controller@10000 {
45 + pinctrl-names = "default";
46 +
47 + pmx_sata0: pmx-sata0 {
48 + marvell,pins;
49 + marvell,function = "sata0";
50 + };
51 + pmx_sata1: pmx-sata1 {
52 + marvell,pins;
53 + marvell,function = "sata1";
54 + };
55 + pmx_usb_power: pmx-usb-power {
56 + marvell,pins = "mpp21";
57 + marvell,function = "gpio";
58 + };
59 + pmx_pwr_off: pmx-pwr-off {
60 + marvell,pins = "mpp27";
61 + marvell,function = "gpio";
62 + };
63 + pmx_btn_reset: pmx-btn-reset {
64 + marvell,pins = "mpp24";
65 + marvell,function = "gpio";
66 + };
67 + pmx_btn_copy: pmx-btn-copy {
68 + marvell,pins = "mpp25";
69 + marvell,function = "gpio";
70 + };
71 + pmx_btn_power: pmx-btn-power {
72 + marvell,pins = "mpp26";
73 + marvell,function = "gpio";
74 + };
75 + pmx_led_hdd2_green: pmx-led-hdd2-green {
76 + marvell,pins = "mpp34";
77 + marvell,function = "gpio";
78 + };
79 + pmx_led_hdd2_red: pmx-led-hdd2-red {
80 + marvell,pins = "mpp12";
81 + marvell,function = "gpio";
82 + };
83 + pmx_led_usb_green: pmx-led-usb-green {
84 + marvell,pins = "mpp15";
85 + marvell,function = "gpio";
86 + };
87 + pmx_led_copy_green: pmx-led-copy-green {
88 + marvell,pins = "mpp22";
89 + marvell,function = "gpio";
90 + };
91 + pmx_led_copy_red: pmx-led-copy-red {
92 + marvell,pins = "mpp23";
93 + marvell,function = "gpio";
94 + };
95 + pmx_led_sys_green: pmx-led-sys-green {
96 + marvell,pins = "mpp28";
97 + marvell,function = "gpio";
98 + };
99 + pmx_led_sys_orange: pmx-led-sys-orange {
100 + marvell,pins = "mpp29";
101 + marvell,function = "gpio";
102 + };
103 + pmx_led_hdd1_green: pmx-led-hdd1-green {
104 + marvell,pins = "mpp16";
105 + marvell,function = "gpio";
106 + };
107 + pmx_led_hdd1_red: pmx-led-hdd1-red {
108 + marvell,pins = "mpp13";
109 + marvell,function = "gpio";
110 + };
111 + pmx_pwr_sata1: pmx-pwr-sata1 {
112 + marvell,pins = "mpp33";
113 + marvell,function = "gpio";
114 + };
115 + };
116 +
117 + serial@12000 {
118 + status = "okay";
119 + };
120 +
121 + sata@80000 {
122 + status = "okay";
123 + nr-ports = <2>;
124 + };
125 +
126 + rtc@10300 {
127 + status = "disabled";
128 + };
129 +
130 + i2c@11000 {
131 + status = "okay";
132 + ht1382: rtc@68 {
133 + compatible = "htk,ht1382";
134 + reg = <0x68>;
135 + };
136 + };
137 + };
138 +
139 + regulators {
140 + compatible = "simple-bus";
141 + #address-cells = <1>;
142 + #size-cells = <0>;
143 + pinctrl-names = "default";
144 + pinctrl-0 = <&pmx_usb_power &pmx_pwr_sata1>;
145 +
146 + usb0_power: regulator@1 {
147 + compatible = "regulator-fixed";
148 + reg = <1>;
149 + regulator-name = "USB Power";
150 + regulator-min-microvolt = <5000000>;
151 + regulator-max-microvolt = <5000000>;
152 + regulator-always-on;
153 + regulator-boot-on;
154 + enable-active-high;
155 + gpio = <&gpio0 21 GPIO_ACTIVE_HIGH>;
156 + };
157 +
158 + sata1_power: regulator@2 {
159 + compatible = "regulator-fixed";
160 + reg = <2>;
161 + regulator-name = "SATA1 Power";
162 + regulator-min-microvolt = <5000000>;
163 + regulator-max-microvolt = <5000000>;
164 + regulator-always-on;
165 + regulator-boot-on;
166 + enable-active-high;
167 + gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>;
168 + };
169 + };
170 +
171 +
172 + gpio_keys {
173 + compatible = "gpio-keys";
174 + #address-cells = <1>;
175 + #size-cells = <0>;
176 + pinctrl-0 = <&pmx_btn_reset &pmx_btn_copy &pmx_btn_power>;
177 + pinctrl-names = "default";
178 +
179 + button@1 {
180 + label = "Power Button";
181 + linux,code = <KEY_POWER>;
182 + gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
183 + };
184 + button@2 {
185 + label = "Copy Button";
186 + linux,code = <KEY_COPY>;
187 + gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
188 + };
189 + button@3 {
190 + label = "Reset Button";
191 + linux,code = <KEY_RESTART>;
192 + gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
193 + };
194 + };
195 +
196 + gpio-leds {
197 + compatible = "gpio-leds";
198 + pinctrl-0 = <&pmx_led_hdd2_green &pmx_led_hdd2_red
199 + &pmx_led_usb_green
200 + &pmx_led_sys_green &pmx_led_sys_orange
201 + &pmx_led_copy_green &pmx_led_copy_red
202 + &pmx_led_hdd1_green &pmx_led_hdd1_red>;
203 + pinctrl-names = "default";
204 +
205 + green-sys {
206 + label = "nsa310s:green:sys";
207 + gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>;
208 + linux,default-trigger = "timer";
209 + };
210 + orange-sys {
211 + label = "nsa310s:orange:sys";
212 + gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
213 + };
214 + green-hdd1 {
215 + label = "nsa310s:green:hdd1";
216 + gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
217 + };
218 + red-hdd1 {
219 + label = "nsa310s:red:hdd1";
220 + gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
221 + };
222 + green-hdd2 {
223 + label = "nsa310s:green:hdd2";
224 + gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
225 + };
226 + red-hdd2 {
227 + label = "nsa310s:red:hdd2";
228 + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
229 + };
230 + green-usb {
231 + label = "nsa310s:green:usb";
232 + gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
233 + };
234 + green-copy {
235 + label = "nsa310s:green:copy";
236 + gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
237 + linux,default-trigger = "ide-disk";
238 + };
239 + red-copy {
240 + label = "nsa310s:red:copy";
241 + gpios = <&gpio0 23 GPIO_ACTIVE_HIGH>;
242 + };
243 + };
244 +
245 + gpio_poweroff {
246 + compatible = "gpio-poweroff";
247 + pinctrl-0 = <&pmx_pwr_off>;
248 + pinctrl-names = "default";
249 + gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
250 + };
251 +};
252 +
253 +&nand {
254 + status = "okay";
255 + chip-delay = <35>;
256 +
257 + partition@0 {
258 + label = "u-boot";
259 + reg = <0x0000000 0xe0000>;
260 + };
261 +
262 + partition@e0000 {
263 + label = "u-boot environment";
264 + reg = <0xe0000 0x100000>;
265 + };
266 +
267 + partition@100000 {
268 + label = "second stage u-boot";
269 + reg = <0x100000 0x200000>;
270 + };
271 +
272 + partition@200000 {
273 + label = "ubi";
274 + reg = <0x200000 0x7e00000>;
275 + };
276 +};
277 +
278 +&mdio {
279 + status = "okay";
280 + ethphy0: ethernet-phy@1 {
281 + compatible = "marvell,88e1318s";
282 + reg = <1>;
283 + marvell,reg-init = <0x1 0x16 0x0 0x3>,
284 + <0x1 0x10 0x0 0x1017>,
285 + <0x1 0x11 0x0 0x4408>,
286 + <0x1 0x16 0x0 0x0>,
287 + <0x1 0x4 0x0 0x1e1>,
288 + <0x1 0x9 0x0 0x300>,
289 + <0x1 0x10 0x0 0x3860>,
290 + <0x1 0x0 0x0 0x9140>;
291 + };
292 +};
293 +
294 +&eth0 {
295 + status = "okay";
296 +
297 + ethernet0-port@0 {
298 + phy-handle = <&ethphy0>;
299 + };
300 +};