How to run FreeBSD on new boards built on Rockchip 35XX..

it seems that graphics on arm boards that are not raspberry pi's do not interest many freebsd users
nobody on the arm mailling list replied (except you and jsm)
 
it seems that graphics on arm boards that are not raspberry pi's do not interest many freebsd users
nobody on the arm mailling list replied (except you and jsm)

My suggestion is to don't think at this. JSM is very good. Soren is also present. To have these two great developers interested to work with the rockchip 35xx is a great lucky and advantage. Think positive. And let's go ahead. Today most developers may not be interested,tomorrow this tendency may change.
 
Now I'm planning to capture the dmesg log file produced by FreeBSD installed to my RK3399 with the panfrost driver installed and compare it with the dmesg log file produced by FreeBSD installed on the Radxa board. I'm curious to see what are the differences.
 
I have some questions for you. Which GPU has the radxa zero 3W ? G76 ? If yes,I should also install this patch :

https://people.freebsd.org/~br/mesa3d_panfrost.patch (only for G76 GPU)

in addition to this one :


how should I install this patch ? It's just enough to copy it under /usr/ports/graphics/libdrm/files ?

Did u install also the mesa libs and the mesa-dri packages ? You prepared these packages some time ago for the rockchip RK3399 using your Apple Silicon. I hope that they can be also installed on the Radxa board.

JSM also suggests to apply these patches :



Did you have already apply the clock patch of Soren ? Did u apply all the patches of Soren on your "sys" directory ?
 
* This kernel panic happened without installing the libdrm patched *
1)

WhatsApp Image 2025-07-03 at 19.41.57.jpeg


2)

WhatsApp Image 2025-07-03 at 19.48.38.jpeg
 
package of libdrm and also i put patch inside
where does it panic before the login or after ?
if it fails to init panfrost then i don't know, maybe it is unable to set powerdomain
it needs the GENERIC-DRM kernel for powerdomain to work
libdrm wont help with the panic it only makes xorg capable of using panfrost

difficult do debug without a serial console
 

Attachments

  • z.zip
    z.zip
    253.2 KB · Views: 149
What's the cause of is this error ? Do you know ?

Code:
fan53555_pmic0 : Error when reading reg 0x03, rv: 2
fan53555_pmic0 : cannot read ID1
fan53555_pmic0 : cannot attach regulator
 
Now I'm planning to capture the dmesg log file produced by FreeBSD installed to my RK3399 with the panfrost driver installed and compare it with the dmesg log file produced by FreeBSD installed on the Radxa board. I'm curious to see what are the differences.

Radxa Zero 3W :

Code:
rk_drm0: <Rockchip Display Subsystem> on ofubus0
rk_drm0: port found
[drm] Connector HDMI -A-1: get mode from tunables:
[drm] - kern.vt.fb.modes.HDMI-A-1
[drm] - kern.vt.fb.default_mode
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] Initialized rockchip 1.0.0 20201113 for rk_drm on minor 0

RockChip RK3399 :

Code:
panfrost0: <Mali Midgard/Bifrost GPU> mem 0xff9a0000-0xff9affff irq 73,74,75 on ofwbus0
panfrost0: Mali GPU clock rate 500000000 Hz
panfrost0: GPU revision 2000, id 860
panfrost0: Mali 860, major 2, minor 0, status 0
panfrost0: Features: L2 7120206, Shader 0, Tiler 809, Mem 1, MMU 2830, AS ff, JS 7
panfrost0: panfrost_gpu_intr: pending 600
panfrost0: panfrost_gpu_intr: pending 600
panfrost0: panfrost_gpu_intr: pending 600
panfrost0: GPU is powered on
panfrost0: panfrost_gpu_intr: pending 20000
[drm] Initialized panfrost 1.2.0 20201124 for panfrost on minor 1

on the RockChip RK3399 the log is more verbose...why ? what you have removed ? On your porting the presence of the panfrost driver is not even mentioned,as well as I don't see the message "GPU is activated".
 
it's not removed from kernel, just panfrost is disabled in a.dtb. c.dtb should have it enabled
Code:
panfrost0: GPU revision 1000, id 7402
panfrost0: Mali 7402, major 1, minor 0, status 0
panfrost0: Features: L2 7110206, Shader 2, Tiler 209, Mem 1, MMU 2823, AS ff, JS 7
panfrost0: panfrost_gpu_intr: pending 600
panfrost0: panfrost_gpu_intr: pending 600
panfrost0: panfrost_gpu_intr: pending 600
panfrost0: GPU is powered on
panfrost0: panfrost_gpu_intr: pending 20000
 
I copied your c.dtb file in /boot/dtb/rockchip,but I get this error :

mountroot from ufs:/dev/gpt/root failed with error 19

mountroot> ?

List of GEOM managed disk devices:

empty.

(on /boot/dtb/rockchip I have only c.dtb).
 
weird because this is the diff between a and c
#cooling-cells = <0x2>;
operating-points-v2 = <0x9>;
power-domains = <0x39 0x7>;
- status = "disabled";
+ status = "okay";
mali-supply = <0x25>;
phandle = <0x3a>;
 
I fixed this weird situation by copying the file c.dtb in a.dtb and now I have the panfrost driver enabled.
The name of the file should be a.dtb. Different names than this will cause the error.
Can you guess why ?
 
Using c.dtb I see an error that there wasn't before :

Code:
cpufreq_dt0: can't find the current freq (1992000000z) in opp
 
Soren says : "If not using any frequency control you can set the start frequency from the setup menu in EDK2"

I did this. I chosen low or medium,I don't remember well,but it made no difference.
 
The kernel panic happened again. A corruption of the sd card partition table comes after it. This time I had the panfrost driver enabled and I tried to watch some youtube videos. I suspect that it needs 8 Gb or RAM. I will try soon. If it will happens also with 8 GB or RAM,then there is a bug that needs to be fixed.
 
The kernel panic happened again. A corruption of the sd card partition table comes after it. This time I had the panfrost driver enabled and I tried to watch some youtube videos. I suspect that it needs 8 Gb or RAM. I will try soon. If it will happens also with 8 GB or RAM,then there is a bug that needs to be fixed.
The bug that needs to be fixed is the need of support of rk_iommu so that the gpu mem does not have to be physically contig.. (IIUC)..
 
there is no rk iommu driver in cheribsd. its just the generic cma module seems more solid than in the original drm subtree
i started writing a rk_iommu driver but its just a stub as of now. even when it will be finished the rk gem part has to be adjusted to use it. adding panfrost in the game is yet another challenge
 
Back
Top