Using Mali on Linux for MarsBoard
all credit goes to olegk0 and linux-sunxi community.
I just tried olegk0's code and introduce about it. don't ask olegk0 about any error in this page, he is not responsible for anything written in here.
Contents |
prepare
toolchain
git clone -b android-4.4.2_r1 https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6 prebuilts/gcc/linux-x86/arm/arm-eabi-4.6
this is official toolchain to build Android for Rockchip. you may use another toolchain which is known to work with your kernel source.
kernel source
wget http://www.haoyuelectronics.com/service/RK3066/Images/linux-3.0.36-source-code/marsboard-linux-rockchip.tar.gz
this is up-to-date kernel source from Rockchip, but only drm.ko is needed. you may use your kernel source.
mali source
git clone -b r3p2-01rel2-olegk0 https://github.com/linux-rockchip/mali-modules.git
this is (currently) r3p2-01rel2 source code from ARM + minimal rk30 support code taken from olegk0's repository.
build kernel modules
drm.ko
cd /path/to/rockchip-3.0 make ARCH=arm marsboard_rk3066_px2_hdmi_defconfig make Image make EXTRA_CFLAGS="-D__linux__" M=drivers/gpu/drm
drivers/gpu/drm/drm.ko will be built.
mali_drm.ko
cd /path/to/mali-modules/DX910-SW-99002-r3p2-01rel2/driver/src/egl/x11/drm_module/mali_drm.rk30 ln -s /path/to/rockchip-3.0/drivers/gpu/drm ../ make EXTRA_CFLAGS="-D__linux__" CROSS_COMPILE=/path/to/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi- KDIR=/path/to/rockchip-3.0
DX910-SW-99002-r3p2-01rel2/driver/src/egl/x11/drm_module/mali_drm.rk30/mali_drm.ko will be built.
ump.ko
cd /path/to/mali-modules/DX910-SW-99002-r3p2-01rel2/driver/src/devicedrv/ump make CROSS_COMPILE=/path/to/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi- KDIR=/path/to/rockchip-3.0 CONFIG=rk30-m400-4 BUILD=release
DX910-SW-99002-r3p2-01rel2/driver/src/devicedrv/ump/ump.ko will be built.
mali.ko
cd /path/to/mali-modules/DX910-SW-99002-r3p2-01rel2/driver/src/devicedrv/mali make EXTRA_CFLAGS="-DMALI_VOLTAGE_LOCK=0 -DMALI_POWER_MGMT_TEST_SUITE=0" CROSS_COMPILE=/path/to/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi- KDIR=/path/to/rockchip-3.0 USING_UMP=1 BUILD=release TARGET_PLATFORM=rk30 MALI_PLATFORM=rk30 MALI_SHARED_INTERRUPTS=1
DX910-SW-99002-r3p2-01rel2/driver/src/devicedrv/mali/mali.ko will be built.
compiled binaries
linux-boot-hdmi.img ( for marsboard RK3066 & PX2 linux boot ) linux-boot-hy070ctp-a.img ( for marsboard RK3066 & PX2 linux boot ) linux-boot-hy070ctp-hd.img ( for marsboard RK3066 & PX2 linux boot ) modules-3.0.36.tar.gz ( for marsboard RK3066 & PX2 linux modules )