kirkwood: use generic diag.sh
[openwrt/openwrt.git] / target / linux / kirkwood / patches-4.19 / 107-02-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 @@ -287,6 +287,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
14 kirkwood-ns2mini.dtb \
15 kirkwood-nsa310.dtb \
16 kirkwood-nsa310a.dtb \
17 + kirkwood-nsa310b.dtb \
18 kirkwood-nsa320.dtb \
19 kirkwood-nsa325.dtb \
20 kirkwood-openblocks_a6.dtb \
21 --- /dev/null
22 +++ b/arch/arm/boot/dts/kirkwood-nsa310b.dts
23 @@ -0,0 +1,131 @@
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,nsa310b", "zyxel,nsa310", "marvell,kirkwood-88f6281", "marvell,kirkwood";
36 +
37 + aliases {
38 + led-boot = &led_green_sys;
39 + led-failsafe = &led_red_sys;
40 + led-running = &led_green_sys;
41 + led-upgrade = &led_red_sys;
42 + };
43 +
44 + memory@0 {
45 + device_type = "memory";
46 + reg = <0x00000000 0x10000000>;
47 + };
48 +
49 + chosen {
50 + bootargs = "console=ttyS0,115200";
51 + stdout-path = &uart0;
52 + };
53 +
54 + ocp@f1000000 {
55 + pinctrl: pin-controller@10000 {
56 + pinctrl-names = "default";
57 +
58 + pmx_led_esata_green: pmx-led-esata-green {
59 + marvell,pins = "mpp12";
60 + marvell,function = "gpio";
61 + };
62 +
63 + pmx_led_esata_red: pmx-led-esata-red {
64 + marvell,pins = "mpp13";
65 + marvell,function = "gpio";
66 + };
67 +
68 + pmx_led_usb_green: pmx-led-usb-green {
69 + marvell,pins = "mpp15";
70 + marvell,function = "gpio";
71 + };
72 +
73 + pmx_led_usb_red: pmx-led-usb-red {
74 + marvell,pins = "mpp16";
75 + marvell,function = "gpio";
76 + };
77 +
78 + pmx_led_sys_green: pmx-led-sys-green {
79 + marvell,pins = "mpp28";
80 + marvell,function = "gpio";
81 + };
82 +
83 + pmx_led_sys_red: pmx-led-sys-red {
84 + marvell,pins = "mpp29";
85 + marvell,function = "gpio";
86 + };
87 +
88 + pmx_led_hdd_green: pmx-led-hdd-green {
89 + marvell,pins = "mpp41";
90 + marvell,function = "gpio";
91 + };
92 +
93 + pmx_led_hdd_red: pmx-led-hdd-red {
94 + marvell,pins = "mpp42";
95 + marvell,function = "gpio";
96 + };
97 +
98 + };
99 +
100 + i2c@11000 {
101 + status = "okay";
102 +
103 + lm85: lm85@2e {
104 + compatible = "national,lm85";
105 + reg = <0x2e>;
106 + };
107 + };
108 + };
109 +
110 + gpio-leds {
111 + compatible = "gpio-leds";
112 +
113 + led_green_sys: green-sys {
114 + label = "nsa310:green:sys";
115 + gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>;
116 + };
117 + led_red_sys: red-sys {
118 + label = "nsa310:red:sys";
119 + gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
120 + };
121 + green-hdd {
122 + label = "nsa310:green:hdd";
123 + gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
124 + };
125 + red-hdd {
126 + label = "nsa310:red:hdd";
127 + gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>;
128 + };
129 + green-esata {
130 + label = "nsa310:green:esata";
131 + gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
132 + };
133 + red-esata {
134 + label = "nsa310:red:esata";
135 + gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
136 + };
137 + green-usb {
138 + label = "nsa310:green:usb";
139 + gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
140 + };
141 + red-usb {
142 + label = "nsa310:red:usb";
143 + gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
144 + };
145 + green-copy {
146 + label = "nsa310:green:copy";
147 + gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
148 + };
149 + red-copy {
150 + label = "nsa310:red:copy";
151 + gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
152 + };
153 + };
154 +};