Skip to content

Commit

Permalink
MIPS: ingenic: Add support for new JZ4770 based boards
Browse files Browse the repository at this point in the history
Add support for the YLM (known as the Anbernic in the western
world) RG-280V, RG-280M, RG-300X, RG-350, RG-350M, and the Wolsen
PocketGo2 (aka. PlayGo) Rev. 1 & 2.

The YLM RG-280V is almost a carbon copy of the GCW-Zero, with a
different LCD panel (320x480 non-square pixels in diamond pattern),
L2/R2 and Vol +/- buttons added, and with the analog stick, ACT8600
regulator, RDA5807 radio, MXC6225 accelerometer, ITE6610 HDMI chips
removed.

The YLM RG-280M is a RG-280V with a clickable analog stick.

The Wolsen PocketGo2 Rev. 1 & 2 are similar to the RG-280V, with a
proper 320x240 IPS screen this time.

The RG-350 is a RG-280M with two clickable analog sticks, a proper
320x240 IPS screen, and a ITE66121 HDMI chip added.

The RG-350M is a RG-350 with a 640x480 IPS screen.

The RG-300X is a RG-350 without joysticks.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
  • Loading branch information
pcercuei committed Sep 3, 2021
1 parent ff901bb commit 8fdd85c
Show file tree
Hide file tree
Showing 10 changed files with 1,096 additions and 463 deletions.
476 changes: 476 additions & 0 deletions arch/mips/boot/dts/ingenic/bits/gcw0-base.dtsi

Large diffs are not rendered by default.

588 changes: 125 additions & 463 deletions arch/mips/boot/dts/ingenic/gcw0.dts

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions arch/mips/boot/dts/ingenic/jz4770.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,19 @@

clocks = <&cgu JZ4770_CLK_LPCLK_MUX>;
clock-names = "lcd_pclk";

lcd_ports: ports {
#address-cells = <1>;
#size-cells = <0>;

port@8 {
reg = <8>;

ipu_output: endpoint {
remote-endpoint = <&ipu_input>;
};
};
};
};

ipu: ipu@13080000 {
Expand All @@ -465,6 +478,12 @@

clocks = <&cgu JZ4770_CLK_IPU>;
clock-names = "ipu";

port {
ipu_input: endpoint {
remote-endpoint = <&ipu_output>;
};
};
};

vpu: video-decoder@132a0000 {
Expand Down
71 changes: 71 additions & 0 deletions arch/mips/boot/dts/ingenic/pocketgo2.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;

#include "bits/gcw0-base.dtsi"

/ {
compatible = "wolsen,pocketgo2", "ingenic,jz4770";
model = "Wolsen PocketGo2/PlayGo";

panel {
compatible = "frida,frd350h54004";

reset-gpios = <&gpe 2 GPIO_ACTIVE_LOW>;

backlight = <&backlight>;
power-supply = <&vcc>;

port {
panel_input: endpoint {
remote-endpoint = <&panel_output>;
};
};
};
};

&gpio_keys {
btn13: button@13 {
label = "L2 shoulder button";
linux,code = <KEY_PAGEUP>;
linux,can-disable;
gpios = <&gpd 31 GPIO_ACTIVE_LOW>;
};

btn14: button@14 {
label = "R2 shoulder button";
linux,code = <KEY_PAGEDOWN>;
linux,can-disable;
gpios = <&gpf 10 GPIO_ACTIVE_LOW>;
};

btn15: button@15 {
label = "Volume+ button";
linux,code = <KEY_VOLUMEUP>;
linux,can-disable;
gpios = <&gpd 19 GPIO_ACTIVE_LOW>;
};

btn16: button@16 {
label = "Volume- button";
linux,code = <KEY_VOLUMEDOWN>;
linux,can-disable;
gpios = <&gpe 13 GPIO_ACTIVE_LOW>;
};

btn17: button@17 {
label = "Menu button";
linux,code = <KEY_HOME>;
linux,can-disable;
gpios = <&gpe 8 GPIO_ACTIVE_LOW>;
};
};

&lcd_ports {
port@0 {
reg = <0>;

panel_output: endpoint {
remote-endpoint = <&panel_input>;
};
};
};
38 changes: 38 additions & 0 deletions arch/mips/boot/dts/ingenic/pocketgo2v2.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;

#include "pocketgo2.dts"

/ {
compatible = "wolsen,pocketgo2v2", "ingenic,jz4770";
model = "Wolsen PocketGo2/PlayGo Rev. 2";
};

&sound_card {
simple-audio-card,widgets =
"Speaker", "Speaker",
"Headphone", "Headphones";
simple-audio-card,routing =
"Headphones Amp INL", "LHPOUT",
"Headphones Amp INR", "RHPOUT",
"Headphones", "Headphones Amp OUTL",
"Headphones", "Headphones Amp OUTR",
"Speaker Amp INL", "Headphones Amp OUTL",
"Speaker Amp INR", "Headphones Amp OUTR",
"Speaker", "Speaker Amp OUTL",
"Speaker", "Speaker Amp OUTR";
simple-audio-card,pin-switches = "Speaker";
};

&joystick {
io-channels = <&adc INGENIC_ADC_TOUCH_YP>,
<&adc INGENIC_ADC_TOUCH_XP>;
};

&js_axis0 {
abs-range = <3000 200>;
};

&js_axis1 {
abs-range = <3000 200>;
};
45 changes: 45 additions & 0 deletions arch/mips/boot/dts/ingenic/rg280m.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;

#include "rg280v.dts"

/ {
compatible = "ylm,rg280m", "ingenic,jz4770";
model = "Anbernic RG-280M";
};

&joystick {
status = "okay";

io-channels = <&adc INGENIC_ADC_TOUCH_YP>,
<&adc INGENIC_ADC_TOUCH_XP>;
};

&js_axis0 {
abs-range = <3000 200>;
};

&js_axis1 {
abs-range = <3000 200>;
};

&sound_card {
simple-audio-card,routing =
"Headphones Amp INL", "LHPOUT",
"Headphones Amp INR", "RHPOUT",
"Headphones", "Headphones Amp OUTL",
"Headphones", "Headphones Amp OUTR",
"Speaker Amp INL", "Headphones Amp OUTL",
"Speaker Amp INR", "Headphones Amp OUTR",
"Speaker", "Speaker Amp OUTL",
"Speaker", "Speaker Amp OUTR";
};

&gpio_keys {
btn17: button@17 {
label = "L3 joystick button";
linux,code = <KEY_KPSLASH>;
linux,can-disable;
gpios = <&gpb 14 GPIO_ACTIVE_LOW>;
};
};
119 changes: 119 additions & 0 deletions arch/mips/boot/dts/ingenic/rg280v.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;

#include "bits/gcw0-base.dtsi"

/ {
compatible = "ylm,rg280v", "ingenic,jz4770";
model = "Anbernic RG-280V";

rumble: rumble {
compatible = "pwm-vibrator";
pwms = <&pwm 4 2000000 0>;
pwm-names = "enable";

pinctrl-names = "default";
pinctrl-0 = <&pins_pwm4>;
};
};

&joystick {
status = "disabled";
};

&btn8 {
gpios = <&gpb 10 GPIO_ACTIVE_LOW>;
};

&gpio_keys {
btn13: button@13 {
label = "L2 shoulder button";
linux,code = <KEY_PAGEUP>;
linux,can-disable;
gpios = <&gpb 20 GPIO_ACTIVE_LOW>;
};

btn14: button@14 {
label = "R2 shoulder button";
linux,code = <KEY_PAGEDOWN>;
linux,can-disable;
gpios = <&gpb 11 GPIO_ACTIVE_LOW>;
};

btn15: button@15 {
label = "Volume+ button";
linux,code = <KEY_VOLUMEUP>;
linux,can-disable;
gpios = <&gpb 12 GPIO_ACTIVE_LOW>;
};

btn16: button@16 {
label = "Volume- button";
linux,code = <KEY_VOLUMEDOWN>;
linux,can-disable;
gpios = <&gpb 13 GPIO_ACTIVE_LOW>;
};
};

&sound_card {
simple-audio-card,widgets =
"Speaker", "Speaker",
"Headphone", "Headphones";
simple-audio-card,routing =
"Headphones Amp INL", "LHPOUT",
"Headphones Amp INR", "RHPOUT",
"Headphones", "Headphones Amp OUTL",
"Headphones", "Headphones Amp OUTR",
"Speaker Amp INL", "LOUT",
"Speaker Amp INR", "ROUT",
"Speaker", "Speaker Amp OUTL",
"Speaker", "Speaker Amp OUTR";
simple-audio-card,pin-switches = "Speaker";
};

&pinctrl {
pins_pwm4: pwm4 {
function = "pwm4";
groups = "pwm4";
};
};

&spi0_gpio {
status = "okay";

panel: panel@0 {
compatible = "abt,y030xx067a";
reg = <0>;

spi-max-frequency = <3125000>;
spi-3wire;

reset-gpios = <&gpe 2 GPIO_ACTIVE_LOW>;

backlight = <&backlight>;
power-supply = <&vcc>;

port {
panel_input: endpoint {
remote-endpoint = <&panel_output>;
};
};
};
};

&pins_lcd {
groups = "lcd-8bit";
};

&lcd_ports {
lcd_port0: port@0 {
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;

panel_output: endpoint@0 {
reg = <0>;
remote-endpoint = <&panel_input>;
};
};
};
27 changes: 27 additions & 0 deletions arch/mips/boot/dts/ingenic/rg300x.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;

#include "rg350m.dts"

#include <dt-bindings/interrupt-controller/irq.h>

/ {
compatible = "ylm,rg300x", "ingenic,jz4770";
model = "Anbernic RG-300X";
};

&panel {
compatible = "focaltech,gpt3";
};

&btn17 {
status = "disabled";
};

&btn18 {
status = "disabled";
};

&joystick {
status = "disabled";
};
41 changes: 41 additions & 0 deletions arch/mips/boot/dts/ingenic/rg350.dts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// SPDX-License-Identifier: GPL-2.0
/dts-v1/;

#include "rg350m.dts"

/ {
compatible = "ylm,rg350", "ingenic,jz4770";
model = "Anbernic RG-350";

panel {
compatible = "frida,frd350h54004";

reset-gpios = <&gpe 2 GPIO_ACTIVE_LOW>;

backlight = <&backlight>;
power-supply = <&vcc>;

port {
frida_input: endpoint {
remote-endpoint = <&panel_output>;
};
};
};
};

&panel {
status = "disabled";
};

&spi0_gpio {
status = "disabled";
};

/* Make ABT panel port a dummy to avoid DTC complaints */
&panel_input {
remote-endpoint = <&panel_input>;
};

&panel_output {
remote-endpoint = <&frida_input>;
};
Loading

0 comments on commit 8fdd85c

Please sign in to comment.