Saturday, June 15, 2013

Linux on RK3188 work in progress

Please note this is not a blog post, it's a my personal pastebin where I can put in writing to myself and other fellow developers the small things I find in the latest 3.0.36 kernel that supports rk3188 devices.

MALI and CONFIG_SYNC ( sync_fence_cancel_async )

Talking about Omegamoon's codebase (but with backported drivers folder from my previous one)

Once MALI is configured in as:

# CONFIG_ION is not set
# CONFIG_MALI400_DEBUG is not set
# CONFIG_UMP_DEBUG is not set

And /include/drm/drm.h is backported to rk3x's version, that is, the first:
#if defined(__linux__)
#if defined(__KERNEL__) || defined(__linux__)

Then compiling throws this new error:
drivers/gpu/mali/mali/common/mali_kernel_core.c:1084:4: error: implicit declaration of function 'sync_fence_cancel_async'

That function is called because now CONFIG_SYNC is forced by PLAT_RK and should be implemented in /drivers/base/sync.c (see but it's missing.
Hence, since MALI has worked without CONFIG_SYNC and a quick grep of the codebase shows it's the only driver talking about CONFIG_SYNC, my fix for this is removing the dependence with PLAT_RK by going to /arch/arm/Kconfig
and in the config for PLAT_RK commenting the following lines:

# select SYNC
# select SW_SYNC
# select SW_SYNC_USER

and then in the .config removing:


Also had to add this line at the top of /drivers/video/rockchip/rk_fb.c due to missing references to 'GET_UMP_SECURE_ID_BUF2':

#include "mali_def.h"


  1. Would this kernel work with the Android images too, or it's limited to PicUntu only?

    I've got an RK3188 stick (quite similar to the MK802IV or MK809III, but some different chips such as the WiFi was changed to a BroadCom one), and right now I'm running a custom firmware with 1080p enabled, but as it has different chips, I would need to recompile the kernel (pain in the ass it is when someone changes the stock configuration, I know). And so far only your code is online, so I suppose this was used in the NeoTV ROMs by Neomode.

    1. I think so, but I can't answer for it since I ignore all about Android development. Sorry!

    2. So you did not disable any Android support, or enabled Linux support that would break the former? Any way, gonna test your zImage to see if it boots or not!

      I wish I could find Neomode's kernel sources...

      Any way, thanks for the info, and for the hard work too!

  2. I have the new kernel compiled for rk3066 (mk808b), but mali(opengl ES) does not work ...? :(

  3. Hi M. Galland :) Working with your kernels for a few days now ( And it works pretty well: my cs918 runs a very decent picuntu @ 1080p. But do have any clue on why the kernel hangs (very early) during boot when mali/ump drivers are activated in the .config (no hdmi activity nor usb powering up) ? Is Mali a dead-end on Linux/RK3188 for the time being ? Best regards from France.

    1. Correct, no Mali on RK3188 Linux at the time. You should disable it in the .config file