Star64: GPU firmware loading on Armbian
#13
(06-03-2023, 01:01 PM)Der Geist der Maschine Wrote: GPU firmware loading fails on armbian:

Code:
[    0.698528] PVR_K:(Fatal):    1: All RGX Firmware image loads failed for 'rgx.fw.36.50.54.182' (PVRSRV_ERROR_NOT_FOUND) [1599]
[    0.698565] PVR_K:(Error):    1: RGXInit: InitFirmware failed (275) [1556]
[    0.698592] PVR_K:(Error):    1: RGXInit() failed (PVRSRV_ERROR_NOT_FOUND) in PVRSRVCommonDeviceInitialise() [2156]
[    0.698626] PVR_K:(Error):    1: PVRSRVDeviceFinalise() failed (PVRSRV_ERROR_NOT_INITIALISED) in PVRSRVCommonDeviceInitialise() [2170]
[    0.698664] [drm:pvr_drm_load] *ERROR* device (____ptrval____) initialisation failed (err=-19)

This is probably a first step in having GPU support in Xorg and Wayland.

Apply this kernel patch

Code:
schaecsn@pc:~/risc/linux# git diff drivers/gpu/drm/img/img-rogue/Kconfig
diff --git a/drivers/gpu/drm/img/img-rogue/Kconfig b/drivers/gpu/drm/img/img-rogue/Kconfig
index 5b793bb9da0e..6f84a2643e02 100644
--- a/drivers/gpu/drm/img/img-rogue/Kconfig
+++ b/drivers/gpu/drm/img/img-rogue/Kconfig
@@ -1,5 +1,5 @@
config DRM_IMG_ROGUE
-      bool "DRM support for PowerVR GPU"
+      tristate "DRM support for PowerVR GPU"
        select DRM_IMG
        default n
        help


Configure the gpu driver as a module

Code:
schaecsn@pc:~/riscv/linux$ scripts/config -m CONFIG_DRM_IMG_ROGUE


Rebuild the kernel and modules and install them.

The driver needs to be compiled as a kernel module. Unsophisticated guess: that moves out the initialization of the gpu from initrd into systemd-land. That is why the firmware does not need to be in initrd but can reside on the /-filesystem.

The two firmware blobs rgx.fw.36.50.54.182  rgx.sh.36.50.54.182 need to be moved into /lib/firmware/ directory. They come from starfive-'s github repro https://media.githubusercontent.com/medi...866.tar.gz

Code:
schaecsn@star64:~$ sudo mv img-gpu-powervr-bin-1.17.6210866/target/lib/firmware/* /lib/firmware/


A reboot shows successful firmware load

Code:
[  26.414834] PVR_K:  362: Read BVNC 36.50.54.182 from HW device registers
[  26.414879] PVR_K:  362: RGX Device registered BVNC 36.50.54.182 with 1 core in the system
[  26.422574] PVR_K:  362: RGX Firmware image 'rgx.fw.36.50.54.182' loaded
[  26.442903] PVR_K:  362: Shader binary image 'rgx.sh.36.50.54.182' loaded


Th next step in having GPU support in Xorg and Wayland is probably installing the libs, bin, and headers from said img-gpu-powervr-bin-1.17.6210866.tar.gz "[this] is a GPU library packages from Imagination and provide GPU firmware, libOpenCL, vulkan, gles2, gles3. This library is not open source, only provide with binary library." I have not tried that.

(06-06-2023, 12:12 AM)Fishwaldo Wrote: This is where you are going to have lots of "fun" - GPU support requires tons of patches to various userland apps, including mesa, wayland, apps etc to correctly use the GPU. The challenge is the patches starfive distribute are for older versions of userspace, namely mesa, that don't apply to current mainline (same issue for VPU as well). I tried to build GPU acceleration initially on debian, but ran in version dependency nightmares... newer apps wont compile against older mesa versions etc etc etc. I gave up and went with yocto as its not as "fussy" about version dependencies and is easier to overcome

Xorg is going to be very "challenging", and i've not started on it yet, as wayland is easier go get running with GPU.

The setup in the form of a firmware module is loaded, but there is no output to the monitor, even to the console

Code:
[   38.232439] mailbox_test mailbox_client: Successfully registered
[   41.669558] @@ dev ptr:ffffffe0bfedac00/1500/1
[   41.669717] PVR_K:  272: Read BVNC 36.50.54.182 from HW device registers
[   41.669766] PVR_K:  272: RGX Device registered BVNC 36.50.54.182 with 1 core in the system
[   41.705177] PVR_K:  272: RGX Firmware image 'rgx.fw.36.50.54.182' loaded
[   41.728503] PVR_K:  272: Shader binary image 'rgx.sh.36.50.54.182' loaded
[   41.730429] [drm] Initialized pvr 1.19.6345021 20170530 for 18000000.gpu on minor 1
[   42.423200] device-mapper: ioctl: 4.45.0-ioctl (2021-03-22) initialised: dm-devel@redhat.
donation   slarm64

  Reply


Messages In This Thread
RE: Star64: GPU firmware loading on Armbian - by mara - 09-11-2023, 11:09 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Star64] Help needed in understanding Yocto and U-boot build process InterestedinFOSS 0 231 04-23-2024, 10:58 AM
Last Post: InterestedinFOSS
  Star64 JH7110 (slarm64, riscv64) mara 2 1,248 10-09-2023, 03:43 AM
Last Post: mara
  Star64: jtag debugging? bluepill 1 1,096 09-20-2023, 08:26 AM
Last Post: bwooster0
  Star64: 4GB on 8GB boards Der Geist der Maschine 4 2,199 07-27-2023, 12:32 AM
Last Post: balbes150
  Star64: SATA Der Geist der Maschine 1 1,141 07-26-2023, 12:35 PM
Last Post: Gladox114
Information Star64: Armbian Installation Der Geist der Maschine 5 4,730 06-03-2023, 01:26 PM
Last Post: Der Geist der Maschine
  Star64: a first benchmark Der Geist der Maschine 0 1,127 05-29-2023, 01:00 PM
Last Post: Der Geist der Maschine
  Star64 first boot (and success) bortzmeyer 1 1,732 05-24-2023, 02:45 AM
Last Post: draintroup

Forum Jump:


Users browsing this thread: 1 Guest(s)