1 // SPDX-License-Identifier: GPL-2.0
5 #include <dt-bindings/clock/ingenic,tcu.h>
7 #include <dt-bindings/gpio/gpio.h>
8 #include <dt-bindings/iio/adc/ingenic,adc.h>
9 #include <dt-bindings/input/input.h>
12 compatible = "gcw,zero", "ingenic,jz4770";
23 device_type = "memory";
24 reg = <0x0 0x10000000>,
25 <0x30000000 0x10000000>;
29 stdout-path = "serial2:57600n8";
33 compatible = "regulator-fixed";
34 regulator-name = "vcc";
36 regulator-min-microvolt = <3300000>;
37 regulator-max-microvolt = <3300000>;
41 mmc1_power: regulator@1 {
42 compatible = "regulator-fixed";
43 regulator-name = "mmc1_vcc";
46 regulator-min-microvolt = <3300000>;
47 regulator-max-microvolt = <3300000>;
51 headphones_amp: analog-amplifier@0 {
52 compatible = "simple-audio-amplifier";
53 enable-gpios = <&gpf 3 GPIO_ACTIVE_LOW>;
54 enable-delay-ms = <50>;
57 sound-name-prefix = "Headphones Amp";
60 speaker_amp: analog-amplifier@1 {
61 compatible = "simple-audio-amplifier";
62 enable-gpios = <&gpf 20 GPIO_ACTIVE_HIGH>;
65 sound-name-prefix = "Speaker Amp";
69 compatible = "simple-audio-card";
71 simple-audio-card,name = "gcw0-audio";
72 simple-audio-card,format = "i2s";
74 simple-audio-card,widgets =
76 "Headphone", "Headphones",
77 "Microphone", "Built-in Mic";
78 simple-audio-card,routing =
79 "Headphones Amp INL", "LHPOUT",
80 "Headphones Amp INR", "RHPOUT",
81 "Headphones", "Headphones Amp OUTL",
82 "Headphones", "Headphones Amp OUTR",
83 "Speaker Amp INL", "LOUT",
84 "Speaker Amp INR", "ROUT",
85 "Speaker", "Speaker Amp OUTL",
86 "Speaker", "Speaker Amp OUTR",
87 "LLINEIN", "Cap-less",
88 "RLINEIN", "Cap-less",
89 "Built-in Mic", "MICBIAS",
90 "MIC1P", "Built-in Mic",
91 "MIC1N", "Built-in Mic";
92 simple-audio-card,pin-switches = "Speaker", "Headphones";
94 simple-audio-card,hp-det-gpio = <&gpf 21 GPIO_ACTIVE_LOW>;
95 simple-audio-card,aux-devs = <&speaker_amp>, <&headphones_amp>;
97 simple-audio-card,bitclock-master = <&dai_codec>;
98 simple-audio-card,frame-master = <&dai_codec>;
100 dai_cpu: simple-audio-card,cpu {
104 dai_codec: simple-audio-card,codec {
105 sound-dai = <&codec>;
110 compatible = "pwm-vibrator";
111 pwms = <&pwm 4 2000000 0>;
112 pwm-names = "enable";
114 pinctrl-names = "default";
115 pinctrl-0 = <&pins_pwm4>;
118 backlight: backlight {
119 compatible = "pwm-backlight";
120 pwms = <&pwm 1 40000 0>;
121 power-supply = <&vcc>;
123 brightness-levels = <0 16 32 48 64 80 96 112 128
124 144 160 176 192 208 224 240 255>;
125 default-brightness-level = <12>;
127 pinctrl-names = "default";
128 pinctrl-0 = <&pins_pwm1>;
132 compatible = "gpio-keys";
137 linux,code = <KEY_UP>;
139 gpios = <&gpe 21 GPIO_ACTIVE_LOW>;
143 label = "D-pad down";
144 linux,code = <KEY_DOWN>;
146 gpios = <&gpe 25 GPIO_ACTIVE_LOW>;
150 label = "D-pad left";
151 linux,code = <KEY_LEFT>;
153 gpios = <&gpe 23 GPIO_ACTIVE_LOW>;
157 label = "D-pad right";
158 linux,code = <KEY_RIGHT>;
160 gpios = <&gpe 24 GPIO_ACTIVE_LOW>;
165 linux,code = <KEY_LEFTCTRL>;
167 gpios = <&gpe 29 GPIO_ACTIVE_LOW>;
172 linux,code = <KEY_LEFTALT>;
174 gpios = <&gpe 20 GPIO_ACTIVE_LOW>;
179 linux,code = <KEY_SPACE>;
181 gpios = <&gpe 27 GPIO_ACTIVE_LOW>;
186 linux,code = <KEY_LEFTSHIFT>;
188 gpios = <&gpe 28 GPIO_ACTIVE_LOW>;
192 label = "Left shoulder button";
193 linux,code = <KEY_TAB>;
195 gpios = <&gpb 20 GPIO_ACTIVE_LOW>;
199 label = "Right shoulder button";
200 linux,code = <KEY_BACKSPACE>;
202 gpios = <&gpe 26 GPIO_ACTIVE_LOW>;
206 label = "Start button";
207 linux,code = <KEY_ENTER>;
209 gpios = <&gpb 21 GPIO_ACTIVE_LOW>;
213 label = "Select button";
214 linux,code = <KEY_ESC>;
217 * This is the only button that is active high,
218 * since it doubles as BOOT_SEL1.
220 gpios = <&gpd 18 GPIO_ACTIVE_HIGH>;
224 label = "Power slider";
225 linux,code = <KEY_POWER>;
227 gpios = <&gpa 30 GPIO_ACTIVE_LOW>;
232 label = "Power hold";
233 linux,code = <KEY_PAUSE>;
235 gpios = <&gpf 11 GPIO_ACTIVE_LOW>;
239 i2c3: i2c-controller@3 {
240 compatible = "i2c-gpio";
241 #address-cells = <1>;
244 sda-gpios = <&gpd 5 GPIO_ACTIVE_HIGH>;
245 scl-gpios = <&gpd 4 GPIO_ACTIVE_HIGH>;
246 i2c-gpio,delay-us = <2>; /* 250 kHz */
249 compatible = "active-semi,act8600";
254 otg_vbus: SUDCDC_REG4 {
256 * 5.3V instead of 5.0V to compensate
257 * for the voltage drop of a diode
258 * between the regulator and the
261 regulator-min-microvolt = <5300000>;
262 regulator-max-microvolt = <5300000>;
267 * When this is off, there is no sound, but also
271 regulator-min-microvolt = <2500000>;
272 regulator-max-microvolt = <2500000>;
276 /* LCD panel and FM radio */
278 regulator-min-microvolt = <3300000>;
279 regulator-max-microvolt = <3300000>;
285 regulator-min-microvolt = <3300000>;
286 regulator-max-microvolt = <3300000>;
287 /*regulator-always-on;*/
292 * The colors on the LCD are wrong when this is
293 * off. Which is strange, since the LCD panel
294 * data sheet only mentions a 3.3V input.
297 regulator-min-microvolt = <1800000>;
298 regulator-max-microvolt = <1800000>;
305 regulator-min-microvolt = <3300000>;
306 regulator-max-microvolt = <3300000>;
311 /* Unused fixed 1.2V */
320 compatible = "gpio-leds";
323 gpios = <&gpb 30 GPIO_ACTIVE_LOW>;
324 default-state = "on";
329 compatible = "spi-gpio";
330 #address-cells = <1>;
333 sck-gpios = <&gpe 15 GPIO_ACTIVE_HIGH>;
334 mosi-gpios = <&gpe 17 GPIO_ACTIVE_HIGH>;
335 cs-gpios = <&gpe 16 GPIO_ACTIVE_HIGH>;
336 num-chipselects = <1>;
339 compatible = "kingdisplay,kd035g6-54nt";
342 spi-max-frequency = <3125000>;
345 reset-gpios = <&gpe 2 GPIO_ACTIVE_LOW>;
347 backlight = <&backlight>;
348 power-supply = <&ldo6>;
351 panel_input: endpoint {
352 remote-endpoint = <&panel_output>;
359 compatible = "gpio-usb-b-connector", "usb-b-connector";
364 * USB OTG is not yet working reliably, the ID detection
365 * mechanism tends to fry easily for unknown reasons.
366 * Until this is fixed, disable OTG by not providing the
367 * ID GPIO to the driver.
369 //id-gpios = <&gpf 18 GPIO_ACTIVE_LOW>;
371 vbus-gpios = <&gpb 5 GPIO_ACTIVE_HIGH>;
372 vbus-supply = <&otg_vbus>;
374 pinctrl-names = "default";
375 pinctrl-0 = <&pins_otg>;
379 remote-endpoint = <&usb_otg_ep>;
386 clock-frequency = <12000000>;
392 groups = "lcd-24bit";
397 groups = "uart2-data";
402 groups = "mmc0-1bit-a", "mmc0-4bit-a";
407 groups = "mmc1-1bit-d", "mmc1-4bit-d";
434 pinctrl-names = "default";
435 pinctrl-0 = <&pins_uart2>;
442 * Put high-speed peripherals under PLL1, such that we can change the
443 * PLL0 frequency on demand without having to suspend peripherals.
444 * We use a rate of 432 MHz, which is the least common multiple of
445 * 27 MHz (required by TV encoder) and 48 MHz (required by USB host).
446 * Put the GPU under PLL0 since we want a higher frequency.
447 * Use the 32 kHz oscillator as the parent of the RTC for a higher
451 <&cgu JZ4770_CLK_PLL1>,
452 <&cgu JZ4770_CLK_GPU>,
453 <&cgu JZ4770_CLK_RTC>,
454 <&cgu JZ4770_CLK_UHC>,
455 <&cgu JZ4770_CLK_LPCLK_MUX>,
456 <&cgu JZ4770_CLK_MMC0_MUX>,
457 <&cgu JZ4770_CLK_MMC1_MUX>;
458 assigned-clock-parents =
460 <&cgu JZ4770_CLK_PLL0>,
461 <&cgu JZ4770_CLK_OSC32K>,
462 <&cgu JZ4770_CLK_PLL1>,
463 <&cgu JZ4770_CLK_PLL1>,
464 <&cgu JZ4770_CLK_PLL1>,
465 <&cgu JZ4770_CLK_PLL1>;
466 assigned-clock-rates =
472 /* The WiFi module is connected to the UHC. */
478 * 750 kHz for the system timer and clocksource, 12 MHz for the OST,
479 * and use RTC as the parent for the watchdog clock
481 assigned-clocks = <&tcu TCU_CLK_TIMER0>, <&tcu TCU_CLK_TIMER2>,
482 <&tcu TCU_CLK_OST>, <&tcu TCU_CLK_WDT>;
483 assigned-clock-parents = <0>, <0>, <0>, <&cgu JZ4770_CLK_RTC>;
484 assigned-clock-rates = <750000>, <750000>, <12000000>;
486 /* PWM1 is in use, so use channel #2 for the clocksource */
487 ingenic,pwm-channels-mask = <0xfa>;
492 usb_otg_ep: endpoint {
493 remote-endpoint = <&usb_ep>;
499 vcc-supply = <&ldo5>;
503 clocks = <&cgu JZ4770_CLK_RTC>;
506 system-power-controller;
513 max-frequency = <48000000>;
514 vmmc-supply = <&vcc>;
517 pinctrl-names = "default";
518 pinctrl-0 = <&pins_mmc0>;
525 max-frequency = <48000000>;
526 cd-gpios = <&gpb 2 GPIO_ACTIVE_LOW>;
527 vmmc-supply = <&mmc1_power>;
529 pinctrl-names = "default";
530 pinctrl-0 = <&pins_mmc1>;
534 pinctrl-names = "default";
535 pinctrl-0 = <&pins_lcd>;
538 panel_output: endpoint {
539 remote-endpoint = <&panel_input>;