xref: /linux/arch/mips/boot/dts/ingenic/rs90.dts (revision bdd1a21b52557ea8f61d0a5dc2f77151b576eb70)
1// SPDX-License-Identifier: GPL-2.0
2/dts-v1/;
3
4#include "jz4725b.dtsi"
5
6#include <dt-bindings/gpio/gpio.h>
7#include <dt-bindings/iio/adc/ingenic,adc.h>
8#include <dt-bindings/input/linux-event-codes.h>
9
10/ {
11	compatible = "ylm,rs90", "ingenic,jz4725b";
12	model = "RS-90";
13
14	memory {
15		device_type = "memory";
16		reg = <0x0 0x2000000>;
17	};
18
19	reserved-memory {
20		#address-cells = <1>;
21		#size-cells = <1>;
22		ranges;
23
24		vmem: video-memory@1f00000 {
25			compatible = "shared-dma-pool";
26			reg = <0x1f00000 0x100000>;
27			reusable;
28		};
29	};
30
31	vcc: regulator {
32		compatible = "regulator-fixed";
33
34		regulator-name = "vcc";
35		regulaor-min-microvolt = <3300000>;
36		regulaor-max-microvolt = <3300000>;
37		regulator-always-on;
38	};
39
40	backlight: backlight {
41		compatible = "pwm-backlight";
42		pwms = <&pwm 3 40000 0>;
43
44		brightness-levels = <0 16 32 48 64 80 112 144 192 255>;
45		default-brightness-level = <8>;
46
47		pinctrl-names = "default";
48		pinctrl-0 = <&pins_pwm3>;
49
50		power-supply = <&vcc>;
51	};
52
53	keys@0 {
54		compatible = "gpio-keys";
55		#address-cells = <1>;
56		#size-cells = <0>;
57
58		key@0 {
59			label = "D-pad up";
60			linux,code = <KEY_UP>;
61			gpios = <&gpc 10 GPIO_ACTIVE_LOW>;
62		};
63
64		key@1 {
65			label = "D-pad down";
66			linux,code = <KEY_DOWN>;
67			gpios = <&gpc 11 GPIO_ACTIVE_LOW>;
68		};
69
70		key@2 {
71			label = "D-pad left";
72			linux,code = <KEY_LEFT>;
73			gpios = <&gpb 31 GPIO_ACTIVE_LOW>;
74		};
75
76		key@3 {
77			label = "D-pad right";
78			linux,code = <KEY_RIGHT>;
79			gpios = <&gpd 21 GPIO_ACTIVE_LOW>;
80		};
81
82		key@4 {
83			label = "Button A";
84			linux,code = <KEY_LEFTCTRL>;
85			gpios = <&gpc 31 GPIO_ACTIVE_LOW>;
86		};
87
88		key@5 {
89			label = "Button B";
90			linux,code = <KEY_LEFTALT>;
91			gpios = <&gpc 30 GPIO_ACTIVE_LOW>;
92		};
93
94		key@6 {
95			label = "Right shoulder button";
96			linux,code = <KEY_BACKSPACE>;
97			gpios = <&gpc 12 GPIO_ACTIVE_LOW>;
98			debounce-interval = <10>;
99		};
100
101		key@7 {
102			label = "Start button";
103			linux,code = <KEY_ENTER>;
104			gpios = <&gpd 17 GPIO_ACTIVE_LOW>;
105		};
106	};
107
108	keys@1 {
109		compatible = "adc-keys";
110		io-channels = <&adc INGENIC_ADC_AUX>;
111		io-channel-names = "buttons";
112		keyup-threshold-microvolt = <1400000>;
113		poll-interval = <30>;
114
115		key@0 {
116			label = "Left shoulder button";
117			linux,code = <KEY_TAB>;
118			press-threshold-microvolt = <800000>;
119		};
120
121		key@1 {
122			label = "Select button";
123			linux,code = <KEY_ESC>;
124			press-threshold-microvolt = <1100000>;
125		};
126	};
127
128	amp: analog-amplifier {
129		compatible = "simple-audio-amplifier";
130		enable-gpios = <&gpc 15 GPIO_ACTIVE_HIGH>;
131
132		VCC-supply = <&vcc>;
133	};
134
135	sound {
136		compatible = "simple-audio-card";
137
138		simple-audio-card,name = "rs90-audio";
139		simple-audio-card,format = "i2s";
140
141		simple-audio-card,widgets =
142			"Speaker", "Speaker",
143			"Headphone", "Headphones";
144		simple-audio-card,routing =
145			"INL", "LHPOUT",
146			"INR", "RHPOUT",
147			"Headphones", "LHPOUT",
148			"Headphones", "RHPOUT",
149			"Speaker", "OUTL",
150			"Speaker", "OUTR";
151		simple-audio-card,pin-switches = "Speaker";
152
153		simple-audio-card,hp-det-gpio = <&gpd 16 GPIO_ACTIVE_LOW>;
154		simple-audio-card,aux-devs = <&amp>;
155
156		simple-audio-card,bitclock-master = <&dai_codec>;
157		simple-audio-card,frame-master = <&dai_codec>;
158
159		dai_cpu: simple-audio-card,cpu {
160			sound-dai = <&aic>;
161		};
162
163		dai_codec: simple-audio-card,codec {
164			sound-dai = <&codec>;
165		};
166
167	};
168
169	usb_phy: usb-phy {
170		compatible = "usb-nop-xceiv";
171		#phy-cells = <0>;
172
173		clocks = <&cgu JZ4725B_CLK_UDC_PHY>;
174		clock-names = "main_clk";
175		vcc-supply = <&vcc>;
176	};
177
178	panel {
179		compatible = "sharp,ls020b1dd01d";
180
181		backlight = <&backlight>;
182		power-supply = <&vcc>;
183
184		port {
185			panel_input: endpoint {
186				remote-endpoint = <&panel_output>;
187			};
188		};
189	};
190};
191
192&ext {
193	clock-frequency = <12000000>;
194};
195
196&rtc_dev {
197	system-power-controller;
198};
199
200&udc {
201	phys = <&usb_phy>;
202};
203
204&pinctrl {
205	pins_mmc1: mmc1 {
206		function = "mmc1";
207		groups = "mmc1-1bit";
208	};
209
210	pins_nemc: nemc {
211		function = "nand";
212		groups = "nand-cs1", "nand-cle-ale", "nand-fre-fwe";
213	};
214
215	pins_pwm3: pwm3 {
216		function = "pwm3";
217		groups = "pwm3";
218		bias-disable;
219	};
220
221	pins_lcd: lcd {
222		function = "lcd";
223		groups = "lcd-8bit", "lcd-16bit", "lcd-special";
224	};
225};
226
227&mmc0 {
228	status = "disabled";
229};
230
231&mmc1 {
232	bus-width = <1>;
233	max-frequency = <48000000>;
234
235	pinctrl-names = "default";
236	pinctrl-0 = <&pins_mmc1>;
237
238	cd-gpios = <&gpc 20 GPIO_ACTIVE_LOW>;
239};
240
241&uart {
242	/*
243	 * The pins for RX/TX are used for the right shoulder button and
244	 * backlight PWM.
245	 */
246	status = "disabled";
247};
248
249&nemc {
250	nandc: nand-controller@1 {
251		compatible = "ingenic,jz4725b-nand";
252		reg = <1 0 0x4000000>;
253
254		#address-cells = <1>;
255		#size-cells = <0>;
256
257		ecc-engine = <&bch>;
258
259		ingenic,nemc-tAS = <10>;
260		ingenic,nemc-tAH = <5>;
261		ingenic,nemc-tBP = <10>;
262		ingenic,nemc-tAW = <15>;
263		ingenic,nemc-tSTRV = <100>;
264
265		pinctrl-names = "default";
266		pinctrl-0 = <&pins_nemc>;
267
268		rb-gpios = <&gpc 27 GPIO_ACTIVE_HIGH>;
269
270		nand@1 {
271			reg = <1>;
272
273			nand-ecc-step-size = <512>;
274			nand-ecc-strength = <8>;
275			nand-ecc-mode = "hw";
276			nand-is-boot-medium;
277			nand-on-flash-bbt;
278
279			partitions {
280				compatible = "fixed-partitions";
281				#address-cells = <1>;
282				#size-cells = <1>;
283
284				partition@0 {
285					label = "bootloader";
286					reg = <0x0 0x20000>;
287				};
288
289				partition@20000 {
290					label = "system";
291					reg = <0x20000 0x0>;
292				};
293			};
294		};
295	};
296};
297
298&cgu {
299	/* Use 32kHz oscillator as the parent of the RTC clock */
300	assigned-clocks = <&cgu JZ4725B_CLK_RTC>;
301	assigned-clock-parents = <&cgu JZ4725B_CLK_OSC32K>;
302};
303
304&tcu {
305	/*
306	 * 750 kHz for the system timer and clocksource, and use RTC as the
307	 * parent for the watchdog clock.
308	 */
309	assigned-clocks = <&tcu TCU_CLK_TIMER0>, <&tcu TCU_CLK_TIMER1>, <&tcu TCU_CLK_WDT>;
310	assigned-clock-parents = <0>, <0>, <&cgu JZ4725B_CLK_RTC>;
311	assigned-clock-rates = <750000>, <750000>;
312};
313
314&lcd {
315	memory-region = <&vmem>;
316
317	pinctrl-names = "default";
318	pinctrl-0 = <&pins_lcd>;
319};
320
321&lcd_ports {
322	port@0 {
323		reg = <0>;
324
325		panel_output: endpoint {
326			remote-endpoint = <&panel_input>;
327		};
328	};
329};
330