Skip to content

Commit

Permalink
Initial GPi Case support
Browse files Browse the repository at this point in the history
This is for the original GPi Case but specifically for the following Pi models:

- Raspberry Pi Zero 2 W
- Raspberry Pi Compute Module 3 via GPi Mate
- Raspberry Pi Compute Module 4 via GPi Mate+

This work in progress as the current issues are know:

- All have no OpenGL hardware acceleration. I think a KMS device tree overlay is required for the screen.
 - CM3 has no sound
  • Loading branch information
flexiondotorg committed Jul 8, 2022
1 parent 6681363 commit 63aad6b
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 192 deletions.
80 changes: 0 additions & 80 deletions case/gpi/config.txt

This file was deleted.

Binary file added case/gpicase/boot/overlays/disable-pcie.dtbo
Binary file not shown.
File renamed without changes.
1 change: 1 addition & 0 deletions case/gpicase/cmdline.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zswap.enabled=1 zswap.zpool=z3fold zswap.compressor=lz4 dwc_otg.lpm_enable=0 console=tty2 root=LABEL=writable rootfstype=ext4 rootwait fixrtc quiet loglevel=0 rd.systemd.show_status=false udev.log_level=0 udev.log_priority=0 rd.plymouth=0 plymouth.enable=0 plymouth.ignore-serial-consoles consoleblank=0 vt.global_cursor_default=0 snd_bcm2835.enable_compat_alsa=1 snd_bcm2835.enable_hdmi=0
76 changes: 76 additions & 0 deletions case/gpicase/config.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
[all]
kernel=vmlinuz
cmdline=cmdline.txt
initramfs initrd.img followkernel

[pi4]
max_framebuffers=1
arm_boost=1

[all]
# Enable the audio output, I2C and SPI interfaces on the GPIO header. As these
# parameters related to the base device-tree they must appear *before* any
# other dtoverlay= specification
dtparam=audio=on
dtparam=i2c_arm=on
dtparam=spi=on

# Enable the serial pins
enable_uart=1

# RetroFlag GPi Case with Pi Zero 2, GPi Mate and GPi Mate Plus

# Video
cec_osd_name=retrohome
display_rotate=1
dtoverlay=dpi24-gpi
overscan_left=0
overscan_right=0
overscan_top=0
overscan_bottom=0
framebuffer_width=320
framebuffer_height=240
enable_dpi_lcd=1
display_default_lcd=1
dpi_group=2
dpi_mode=87
dpi_output_format=0x6016
hdmi_timings=240 1 38 10 20 320 1 20 4 4 0 0 0 60 0 6400000 1
disable_audio_dither=1

[pi0]
dtoverlay=pwm-2chan,pin=18,func=2,pin2=19,func2=2
dtoverlay=pwm-audio-pi-zero
audio_pwm_mode=2

# Pi Zero 2 stabilization
arm_freq=1000
gpu_freq=500
core_freq=500
sdram_freq=500
sdram_schmoo=0x02000020
# 6 is default
over_voltage=6
sdram_over_voltage=2

[cm3]
dtoverlay=pwm-2chan,pin=18,func=2,pin2=19,func2=2
dtoverlay=pwm-audio-pi-zero
audio_pwm_mode=0

[cm4]
dtoverlay=disable-pcie
dtoverlay=sdtweak,overclock_50=100
dtoverlay=dwc2,dr_mode=host
dtoverlay=audremap,pins_18_19
audio_pwm_mode=2
hdmi_ignore_hotplug=1
hdmi_ignore_edid=0xa5000080
hdmi_edid_file=1

[all]
camera_auto_detect=0

# disable activity leds
dtparam=act_led_trigger=none
dtparam=act_led_activelow=on
File renamed without changes.
86 changes: 0 additions & 86 deletions case/gpimateplus/config.txt

This file was deleted.

2 changes: 2 additions & 0 deletions case/retroflag/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ camera_auto_detect=1
display_auto_detect=1

# RetroFlag cases - https://www.retroflag.com/
# https://gitlab.com/recalbox/recalbox/-/tree/master/projects/recalbox-hardware/case/installers/retroflags
# https://github.com/kristijandraca/GPi_Case_patch

enable_uart=1
dtoverlay=RetroFlag_pw_io.dtbo
46 changes: 20 additions & 26 deletions retro-home-image
Original file line number Diff line number Diff line change
Expand Up @@ -539,24 +539,16 @@ dtoverlay=dwc2" >> "${B}/config.txt"
gpicase)
nspawn apt-get -y install --no-install-recommends python3-gpiozero python3-lgpio python3-psutil python3-setproctitle
CASE_SUPPORT="gpi.py"
# https://support.retroflag.com/
# https://github.com/tsoliman/Retroflag-GPi-case
# https://github.com/CrashCortez/gpi-case/blob/master/config.txt
# .dts source from https://github.com/kristijandraca/GPi_Case_patch
#
#dtc -W no-unit_address_vs_reg -I dts -O dtb -o "${B}/overlays/dpi24-gpi.dtbo" case/${REMIX}/boot/overlays/dpi24-gpi-overlay.dts
#dtc -W no-unit_address_vs_reg -I dts -O dtb -o "${B}/overlays/pwm-audio-pi-zero-gpi.dtbo" case/${REMIX}/boot/overlays/pwm-audio-pi-zero-gpi-overlay.dts
;;
gpimate)
nspawn apt-get -y install --no-install-recommends python3-gpiozero python3-lgpio python3-psutil python3-setproctitle
CASE_SUPPORT="gpi.py"
# https://forum.batocera.org/d/4097-support-for-gpimate/5
;;
gpimateplus)
nspawn apt-get -y install --no-install-recommends python3-gpiozero python3-lgpio python3-psutil python3-setproctitle
CASE_SUPPORT="gpi.py"
# https://github.com/martinx72/GPiMatePlusHowTo

#dtc -W no-unit_address_vs_reg -I dts -O dtb -o "${B}/overlays/dpi24-gpi.dtbo" case/${REMIX}/boot/overlays/dpi24-gpi-overlay.dts
#dtc -W no-unit_address_vs_reg -I dts -O dtb -o "${B}/overlays/disable-pcie.dtbo" case/${REMIX}/boot/overlays/disable-pcie-overlay.dts
;;
Expand Down Expand Up @@ -779,8 +771,26 @@ case "${REMIX}" in
echo "[+] Specified Waveshare GamePi43"
not_implemented
shift;;
gpicase)
echo "[+] Specified RetroFlag GPi Case with Raspberry Pi Zero 2 W"
gpicase|gpimate*)
# GPi Case
# https://support.retroflag.com/
# https://github.com/tsoliman/Retroflag-GPi-case
# https://github.com/kristijandraca/GPi_Case_patch - Re-eng device tree source
# https://gitlab.com/recalbox/recalbox/-/tree/master/projects/recalbox-hardware/case/installers/gpi

# GPi Mate
# https://retrogamerestore.com/store/gpimate/

# GPi Mate+
# https://retrogamerestore.com/store/gpimateplus/
# https://github.com/martinx72/GPiMatePlusHowTo

# KMS
# https://forums.raspberrypi.com/viewtopic.php?t=322556 - Possible device tree KMS overylay for the GPi Case screen
echo "[+] Specified RetroFlag GPi Case with:"
echo " - Raspberry Pi Zero 2 W"
echo " - GPiMatePlus and CM3+Lite"
echo " - GPiMatePlus and CM4+Lite"
SIZE_FB="320x240"
SIZE_LOGO="128"
SIZE_FRAME="192"
Expand All @@ -790,22 +800,6 @@ case "${REMIX}" in
SIZE_FB="640x480"
not_implemented
shift;;
gpimate)
# https://retrogamerestore.com/store/gpimate/
echo "[+] Specified RetroFlag GPi Case with GPiMate for CM3+Lite"
SIZE_FB="320x240"
SIZE_LOGO="128"
SIZE_FRAME="192"
shift;;
gpimateplus)
# https://retrogamerestore.com/store/gpimateplus/
# https://github.com/martinx72/GPiMatePlusHowTo
echo "[+] Specified RetroFlag GPi Case with GPiMatePlus for CM4+Lite"
SIZE_FB="320x240"
SIZE_LOGO="128"
SIZE_FRAME="192"
REMIX="gpicase"
shift;;
gpm2803)
# https://www.waveshare.com/wiki/GPM280
echo "[+] Specified Waveshare GPM2803 with CM3+Lite"
Expand Down

0 comments on commit 63aad6b

Please sign in to comment.