aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ath79/dts/ar9341_pisen_wmb001n.dts
blob: 8029de549581002eae33a4f6f4c2e5bef4cc4cd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/dts-v1/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

#include "ar9341.dtsi"

/ {
	model = "PISEN WMB001N";
	compatible = "pisen,wmb001n", "qca,ar9341";

	aliases {
		serial0 = &uart;
		led-boot = &wifi;
		led-failsafe = &wifi;
		led-running = &wifi;
		led-upgrade = &wifi;
	};

	i2c {
		compatible = "i2c-gpio";
		pinctrl-names = "default";
		pinctrl-0 = <&pmx_i2c_gpio &pmx_i2s_spdif>;

		sda-gpios = <&gpio 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
		scl-gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
		/*
		 * Pull-up resistor for scl is missing on this board.
		 * Following settings trick i2c-gpio to use output mode
		 * instead of open-drain for scl.
		 */
		i2c-gpio,scl-output-only;
		i2c-gpio,scl-open-drain;
	};

	keys {
		compatible = "gpio-keys";

		reset {
			label = "reset";
			linux,code = <KEY_RESTART>;
			gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
			debounce-interval = <60>;
		};

		vol_down {
			label = "volume down";
			linux,code = <KEY_VOLUMEDOWN>;
			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
			debounce-interval = <60>;
		};

		vol_up {
			label = "volume up";
			linux,code = <KEY_VOLUMEUP>;
			gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
			debounce-interval = <60>;
		};
	};

	leds {
		compatible = "gpio-leds";
		pinctrl-names = "default";
		pinctrl-0 = <&jtag_disable_pins>;

		volume1 {
			label = "wmb001n:blue:volume1";
			gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
		};

		volume2 {
			label = "wmb001n:blue:volume2";
			gpios = <&gpio 1 GPIO_ACTIVE_HIGH>;
		};

		volume3 {
			label = "wmb001n:blue:volume3";
			gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
		};

		volume4 {
			label = "wmb001n:blue:volume4";
			gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
		};

		volume5 {
			label = "wmb001n:blue:volume5";
			gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
		};

		wifi: wifi {
			label = "wmb001n:blue:wifi";
			gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
		};
	};

	virtual_flash {
		compatible = "mtd-concat";
		devices = <&fwpart1 &fwpart2>;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				reg = <0x0 0x0>;
				label = "firmware";
				compatible = "openwrt,okli";
			};
		};
	};
};

&pinmux {
	pmx_i2c_gpio: pinmux_i2c_gpio {
		pinctrl-single,bits = <0x10 0x0 0xff>,
				      <0x14 0x0 0xff>;
	};

	pmx_i2s_spdif: pinmux_i2s_spdif {
		pinctrl-single,bits = <0x8 0x0e000000 0xff000000>,
				      <0xc 0x0f0c0d 0xffffff>,
				      <0x14 0x1900 0xff00>;
	};
};

&ref {
	clock-frequency = <25000000>;
};

&uart {
	status = "okay";
};

&gpio {
	status = "okay";
};

&spi {
	num-cs = <1>;

	status = "okay";

	flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <25000000>;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			uboot: partition@0 {
				label = "u-boot";
				reg = <0x0 0x10000>;
				read-only;
			};

			partition@10000 {
				label = "u-boot-env";
				reg = <0x10000 0x10000>;
				read-only;
			};

			fwpart1: partition@20000 {
				label = "fwpart1";
				reg = <0x20000 0xdc0000>;
			};

			partition@de0000 {
				label = "loader";
				reg = <0xde0000 0x10000>;
			};

			fwpart2: partition@df0000 {
				label = "fwpart2";
				reg = <0xdf0000 0x1f0000>;
			};

			partition@fe0000 {
				label = "mib0";
				reg = <0xfe0000 0x10000>;
				read-only;
			};

			art: partition@ff0000 {
				label = "art";
				reg = <0xff0000 0x10000>;
				read-only;
			};
		};
	};
};

&eth0 {
	status = "okay";
	phy-handle = <&swphy4>;
	mtd-mac-address = <&art 0x0>;
};

&eth1 {
	compatible = "syscon", "simple-mfd";
	status = "okay";

	gmac-config {
		device = <&gmac>;
		switch-phy-swap = <0>;
	};
};

&usb {
	status = "okay";
};

&usb_phy {
	status = "okay";
};

&wmac {
	status = "okay";
	mtd-cal-data = <&art 0x1000>;
};