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",
78 "Microphone", "Built-in Mic";
79 simple-audio-card,routing =
80 "Headphones Amp INL", "LHPOUT",
81 "Headphones Amp INR", "RHPOUT",
82 "Headphones", "Headphones Amp OUTL",
83 "Headphones", "Headphones Amp OUTR",
84 "Speaker Amp INL", "LOUT",
85 "Speaker Amp INR", "ROUT",
86 "Speaker", "Speaker Amp OUTL",
87 "Speaker", "Speaker Amp OUTR",
88 "LLINEIN", "FM Radio",
89 "RLINEIN", "FM Radio",
90 "Built-in Mic", "MICBIAS",
91 "MIC1P", "Built-in Mic",
92 "MIC1N", "Built-in Mic";
93 simple-audio-card,pin-switches = "Speaker", "Headphones";
95 simple-audio-card,hp-det-gpio = <&gpf 21 GPIO_ACTIVE_LOW>;
96 simple-audio-card,aux-devs = <&speaker_amp>, <&headphones_amp>;
98 simple-audio-card,bitclock-master = <&dai_codec>;
99 simple-audio-card,frame-master = <&dai_codec>;
101 dai_cpu: simple-audio-card,cpu {
105 dai_codec: simple-audio-card,codec {
106 sound-dai = <&codec>;
111 compatible = "pwm-vibrator";
112 pwms = <&pwm 4 2000000 0>;
113 pwm-names = "enable";
115 pinctrl-names = "default";
116 pinctrl-0 = <&pins_pwm4>;
119 backlight: backlight {
120 compatible = "pwm-backlight";
121 pwms = <&pwm 1 40000 0>;
122 power-supply = <&vcc>;
124 brightness-levels = <0 16 32 48 64 80 96 112 128
125 144 160 176 192 208 224 240 255>;
126 default-brightness-level = <12>;
128 pinctrl-names = "default";
129 pinctrl-0 = <&pins_pwm1>;
133 compatible = "gpio-keys";
134 #address-cells = <1>;
141 linux,code = <KEY_UP>;
143 gpios = <&gpe 21 GPIO_ACTIVE_LOW>;
147 label = "D-pad down";
148 linux,code = <KEY_DOWN>;
150 gpios = <&gpe 25 GPIO_ACTIVE_LOW>;
154 label = "D-pad left";
155 linux,code = <KEY_LEFT>;
157 gpios = <&gpe 23 GPIO_ACTIVE_LOW>;
161 label = "D-pad right";
162 linux,code = <KEY_RIGHT>;
164 gpios = <&gpe 24 GPIO_ACTIVE_LOW>;
169 linux,code = <KEY_LEFTCTRL>;
171 gpios = <&gpe 29 GPIO_ACTIVE_LOW>;
176 linux,code = <KEY_LEFTALT>;
178 gpios = <&gpe 20 GPIO_ACTIVE_LOW>;
183 linux,code = <KEY_SPACE>;
185 gpios = <&gpe 27 GPIO_ACTIVE_LOW>;
190 linux,code = <KEY_LEFTSHIFT>;
192 gpios = <&gpe 28 GPIO_ACTIVE_LOW>;
196 label = "Left shoulder button";
197 linux,code = <KEY_TAB>;
199 gpios = <&gpb 20 GPIO_ACTIVE_LOW>;
203 label = "Right shoulder button";
204 linux,code = <KEY_BACKSPACE>;
206 gpios = <&gpe 26 GPIO_ACTIVE_LOW>;
210 label = "Start button";
211 linux,code = <KEY_ENTER>;
213 gpios = <&gpb 21 GPIO_ACTIVE_LOW>;
217 label = "Select button";
218 linux,code = <KEY_ESC>;
221 * This is the only button that is active high,
222 * since it doubles as BOOT_SEL1.
224 gpios = <&gpd 18 GPIO_ACTIVE_HIGH>;
228 label = "Power slider";
229 linux,code = <KEY_POWER>;
231 gpios = <&gpa 30 GPIO_ACTIVE_LOW>;
236 label = "Power hold";
237 linux,code = <KEY_PAUSE>;
239 gpios = <&gpf 11 GPIO_ACTIVE_LOW>;
243 i2c3: i2c-controller@3 {
244 compatible = "i2c-gpio";
245 #address-cells = <1>;
248 sda-gpios = <&gpd 5 GPIO_ACTIVE_HIGH>;
249 scl-gpios = <&gpd 4 GPIO_ACTIVE_HIGH>;
250 i2c-gpio,delay-us = <2>; /* 250 kHz */
253 compatible = "active-semi,act8600";
258 otg_vbus: SUDCDC_REG4 {
260 * 5.3V instead of 5.0V to compensate
261 * for the voltage drop of a diode
262 * between the regulator and the
265 regulator-min-microvolt = <5300000>;
266 regulator-max-microvolt = <5300000>;
271 * When this is off, there is no sound, but also
275 regulator-min-microvolt = <2500000>;
276 regulator-max-microvolt = <2500000>;
280 /* LCD panel and FM radio */
282 regulator-min-microvolt = <3300000>;
283 regulator-max-microvolt = <3300000>;
289 regulator-min-microvolt = <3300000>;
290 regulator-max-microvolt = <3300000>;
291 /*regulator-always-on;*/
296 * The colors on the LCD are wrong when this is
297 * off. Which is strange, since the LCD panel
298 * data sheet only mentions a 3.3V input.
301 regulator-min-microvolt = <1800000>;
302 regulator-max-microvolt = <1800000>;
309 regulator-min-microvolt = <3300000>;
310 regulator-max-microvolt = <3300000>;
315 /* Unused fixed 1.2V */
324 compatible = "gpio-leds";
327 gpios = <&gpb 30 GPIO_ACTIVE_LOW>;
328 default-state = "on";
333 compatible = "spi-gpio";
334 #address-cells = <1>;
337 sck-gpios = <&gpe 15 GPIO_ACTIVE_HIGH>;
338 mosi-gpios = <&gpe 17 GPIO_ACTIVE_HIGH>;
339 cs-gpios = <&gpe 16 GPIO_ACTIVE_HIGH>;
340 num-chipselects = <1>;
343 compatible = "kingdisplay,kd035g6-54nt";
346 spi-max-frequency = <3125000>;
350 reset-gpios = <&gpe 2 GPIO_ACTIVE_LOW>;
352 backlight = <&backlight>;
353 power-supply = <&ldo6>;
356 panel_input: endpoint {
357 remote-endpoint = <&panel_output>;
364 compatible = "gpio-usb-b-connector", "usb-b-connector";
369 * USB OTG is not yet working reliably, the ID detection
370 * mechanism tends to fry easily for unknown reasons.
371 * Until this is fixed, disable OTG by not providing the
372 * ID GPIO to the driver.
374 //id-gpios = <&gpf 18 GPIO_ACTIVE_LOW>;
376 vbus-gpios = <&gpb 5 GPIO_ACTIVE_HIGH>;
377 vbus-supply = <&otg_vbus>;
379 pinctrl-names = "default";
380 pinctrl-0 = <&pins_otg>;
384 remote-endpoint = <&usb_otg_ep>;
391 clock-frequency = <12000000>;
397 groups = "lcd-24bit";
402 groups = "uart2-data";
407 groups = "mmc0-1bit-a", "mmc0-4bit-a";
412 groups = "mmc1-1bit-d", "mmc1-4bit-d";
439 pinctrl-names = "default";
440 pinctrl-0 = <&pins_uart2>;
447 * Put high-speed peripherals under PLL1, such that we can change the
448 * PLL0 frequency on demand without having to suspend peripherals.
449 * We use a rate of 432 MHz, which is the least common multiple of
450 * 27 MHz (required by TV encoder) and 48 MHz (required by USB host).
451 * Put the GPU under PLL0 since we want a higher frequency.
452 * Use the 32 kHz oscillator as the parent of the RTC for a higher
456 <&cgu JZ4770_CLK_PLL1>,
457 <&cgu JZ4770_CLK_GPU>,
458 <&cgu JZ4770_CLK_RTC>,
459 <&cgu JZ4770_CLK_UHC>,
460 <&cgu JZ4770_CLK_LPCLK_MUX>,
461 <&cgu JZ4770_CLK_MMC0_MUX>,
462 <&cgu JZ4770_CLK_MMC1_MUX>;
463 assigned-clock-parents =
465 <&cgu JZ4770_CLK_PLL0>,
466 <&cgu JZ4770_CLK_OSC32K>,
467 <&cgu JZ4770_CLK_PLL1>,
468 <&cgu JZ4770_CLK_PLL1>,
469 <&cgu JZ4770_CLK_PLL1>,
470 <&cgu JZ4770_CLK_PLL1>;
471 assigned-clock-rates =
477 /* The WiFi module is connected to the UHC. */
483 * 750 kHz for the system timer and clocksource, 12 MHz for the OST,
484 * and use RTC as the parent for the watchdog clock
486 assigned-clocks = <&tcu TCU_CLK_TIMER0>, <&tcu TCU_CLK_TIMER2>,
487 <&tcu TCU_CLK_OST>, <&tcu TCU_CLK_WDT>;
488 assigned-clock-parents = <0>, <0>, <0>, <&cgu JZ4770_CLK_RTC>;
489 assigned-clock-rates = <750000>, <750000>, <12000000>;
491 /* PWM1 is in use, so use channel #2 for the clocksource */
492 ingenic,pwm-channels-mask = <0xfa>;
497 usb_otg_ep: endpoint {
498 remote-endpoint = <&usb_ep>;
504 vcc-supply = <&ldo5>;
508 clocks = <&cgu JZ4770_CLK_RTC>;
511 system-power-controller;
518 max-frequency = <48000000>;
519 vmmc-supply = <&vcc>;
522 pinctrl-names = "default";
523 pinctrl-0 = <&pins_mmc0>;
530 max-frequency = <48000000>;
531 cd-gpios = <&gpb 2 GPIO_ACTIVE_LOW>;
532 vmmc-supply = <&mmc1_power>;
534 pinctrl-names = "default";
535 pinctrl-0 = <&pins_mmc1>;
539 pinctrl-names = "default";
540 pinctrl-0 = <&pins_lcd>;
543 panel_output: endpoint {
544 remote-endpoint = <&panel_input>;