Skip to content

Instantly share code, notes, and snippets.

@stvhay
Last active May 11, 2023 15:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stvhay/5654368e73f93349c3ffae395eccd892 to your computer and use it in GitHub Desktop.
Save stvhay/5654368e73f93349c3ffae395eccd892 to your computer and use it in GitHub Desktop.
rock5b retropie notes

Build Custom Armbian Kernel

git clone https://github.com/armbian/build
mkdir -p userpatches/kernel/rockchip-rk3588-legacy/ && \
    cd userpatches/kernel/rockchip-rk3588-legacy/ && \
    git clone https://gitlab.com/panfork/rk3588-implicit-sync ./
cd - && ./compile.sh BOARD=rock-5b BUILD_ONLY=kernel KERNEL_CONFIGURE=no

Gofaster Patch

PAN_MESA_DEBUG=gofaster

Rock5B Platform system.sh

diff --git a/scriptmodules/system.sh b/scriptmodules/system.sh
index 64be8287..a9e6e371 100644
--- a/scriptmodules/system.sh
+++ b/scriptmodules/system.sh
@@ -430,6 +430,9 @@ function get_platform() {
                         *rockpro64*)
                             __platform="rockpro64"
                             ;;
+                        *rock-5*)
+                            __platform="rock5"
+                            ;;
                     esac
                 elif [[ -e "/sys/devices/soc0/family" ]]; then
                     case "$(tr -d '\0' < /sys/devices/soc0/family)" in
@@ -538,6 +541,11 @@ function platform_rockpro64() {
     __platform_flags+=(gles kms)
 }
 
+function platform_rock5() {
+    cpu_armv8 "cortex-a76.cortex-a55"
+    __platform_flags+=(x11 gles)
+}
+
 function platform_rpi3() {
     cpu_armv8 "cortex-a53"
     __platform_flags+=(rpi gles)

rockchip repo

You have to create the following udev rules to enable mpp and rga hardware acceleration:

/etc/udev/rules.d/99-rockchip-multimedia.rules

KERNEL=="mpp_service", MODE="0660", GROUP="video"
KERNEL=="rga", MODE="0660", GROUP="video"
KERNEL=="system-dma32", MODE="0666", GROUP="video"
KERNEL=="system-uncached-dma32", MODE="0666", GROUP="video" RUN+="/usr/bin/chmod a+rw /dev/dma_heap"

Switch between Mali and Panfrost

wget https://github.com/JeffyCN/rockchip_mirrors/blob/debian/packages/arm64/libmali/libmali-valhall-g610-g6p0-wayland_1.9-1_arm64.deb
ar x libmali-valhall-g610-g6p0-wayland_1.9-1_arm64.deb
tar xvf data.tar.xz
mkdir -p /usr/lib/aarch64-linux-gnu/mali
wget https://github.com/JeffyCN/rockchip_mirrors/raw/libmali/lib/aarch64-linux-gnu/libmali-valhall-g610-g6p0-wayland-gbm.so
  • Use the stuff in the .deb package (above) to make this set of symlinks:
drwxr-xr-x  2 root root 4.0K Dec 21 22:42 .
drwxr-xr-x 88 root root  84K Dec 21 22:26 ..
lrwxrwxrwx  1 root root   11 Dec 21 22:38 libEGL.so -> libEGL.so.1
-rw-r--r--  1 root root 5.8K Dec 21 22:27 libEGL.so.1
lrwxrwxrwx  1 root root   11 Dec 21 22:38 libgbm.so -> libgbm.so.1
-rw-r--r--  1 root root  10K Dec 21 22:28 libgbm.so.1
lrwxrwxrwx  1 root root   17 Dec 21 22:39 libGLESv1_CM.so -> libGLESv1_CM.so.1
-rw-r--r--  1 root root 5.8K Dec 21 22:28 libGLESv1_CM.so.1
lrwxrwxrwx  1 root root   14 Dec 21 22:39 libGLESv2.so -> libGLESv2.so.2
-rw-r--r--  1 root root 5.8K Dec 21 22:28 libGLESv2.so.2
lrwxrwxrwx  1 root root   18 Dec 21 22:39 libMaliOpenCL.so -> libMaliOpenCL.so.1
-rw-r--r--  1 root root 5.8K Dec 21 22:28 libMaliOpenCL.so.1
lrwxrwxrwx  1 root root   12 Dec 21 22:41 libmali.so -> libmali.so.1
lrwxrwxrwx  1 root root   10 Dec 21 22:41 libMali.so -> libmali.so
lrwxrwxrwx  1 root root   40 Dec 21 22:40 libmali.so.1 -> libmali-valhall-g610-g6p0-wayland-gbm.so
lrwxrwxrwx  1 root root   12 Dec 21 22:41 libMali.so.1 -> libmali.so.1
-rw-r--r--  1 root root  42M Dec 21 22:29 libmali.so.1.9.0
-rw-r--r--  1 root root  42M Dec 21 22:37 libmali-valhall-g610-g6p0-wayland-gbm.so
lrwxrwxrwx  1 root root   19 Dec 21 22:42 libwayland-egl.so -> libwayland-egl.so.1
-rw-r--r--  1 root root 5.8K Dec 21 22:42 libwayland-egl.so.1
  • Copy over the file /etc/OpenCL/vendors/mali.icd

  • Prefixed N64 and GC commands with LD_LIBRARY_PATH=/usr/lib/aarch64-linux-gnu/mali in es_config.cfg, or globally in a runcommand configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment