Wiki

Clone wiki

Q8-RK3288-kernel / Home

Tim P's notes on get OpenCL working on a cheapo RK3288 box

The box in question is commonly called a ENY 3288 or Q8. The motherboard has XT-Q8L-V10 written on it.

Serial access.

It's possible to connect a CP2102 based USB-serial converter to the serial port on the motherboard.

The connections left to right are:

GND - Purple TX - Blue RX - Green

Connect with 115200-8-N-1 without flow control.

XT_Q8L_V10serial.png

Tools and bits.

Rockchip's upgrade_tool. At Radxa http://dl.radxa.com/rock/tools/linux Usage: Radxa's usage page

Firefly's kernel page http://twiki.t-firefly.com/index.php/Firefly-RK3288/Build_android/en

Linux root file system images, no kernels http://www.armhf.com/download/

UBoot(Also contains the resource_tool command) https://github.com/linux-rockchip/u-boot-rockchip.git

Pack and flashing commands that weren't obvious, documented well or caused problems.

resource_tool q8-rk3288.dtb    # Generates resource.img.  A boot image can be added here too
upgrade_tool DI resource resource.img     # The 'resource' option?! 

find * | cpio -o -H newc | gzip > ../boot.cpio.gz
rkcrc -k boot.cpio.gz boot.img    # The -k option here when it's not a kernel!?

Boot image modified from one built by Linuxium for use on SD cards https://plus.google.com/u/0/+IanMORRISON/posts/22Vxc6Sr5Ei?cfem=1

parameters.txt. Commented out line logs to the serial port, also has shell to the boot image environment.

FIRMWARE_VER:4.4.2
MACHINE_MODEL:Q8_RK3288
MACHINE_ID:007
MANUFACTURER:RK30SDK
MAGIC: 0x5041524B
ATAG: 0x60000800
MACHINE: 3288
CHECK_MASK: 0x80
PWR_HLD: 0,0,A,0,1
#KERNEL_IMG: 0x62008000
#FDT_NAME: rk-kernel.dtb
#RECOVER_KEY: 1,1,0,20,0
CMDLINE:console=tty0 init=/init initrd=0x62000000,0x00800000 mtdparts=rk29xxnand:0x00008000@0x00002000(resource),0x00008000@0x0000A000(kernel),0x00010000@0x00012000(boot),-@0x00022000(system)
# CMDLINE:console=ttyS2,115200 earlyprintk init=/init initrd=0x62000000,0x00800000 mtdparts=rk29xxnand:0x00008000@0x00002000(resource),0x00008000@0x0000A000(kernel),0x00010000@0x00012000(boot),-@0x00022000(system)

Kernel Version Observations

The linux-rockchip kernel repo on github seems to have a bug in the framebuffer code that causes a hang on boot.

The mmind kernel on github 3.20 and 4 kernels still seem to require some work. Hanging on boot using LZO compression probably due to the version on lzop on the build host.

The firefly 3.10 kernel on bitbucket which I assume is forked of the linux-rockchip repo seem the most usable.

Investigate the chromeos-kernel (3.14) and markyzq drm kernel on github

Building

Kernel zImage

export ARCH=arm
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:.../arm-eabi-4.6/bin

make q8-rk3288_defconfig
make zImage

If all files and directories have massive sizes after booting with this kernel make sure CONFIG_AEABI=y. (Could possibly be related to the extend Ext4 attributes too..)

Device tree binary for resource.img

make q8-rk3288.dtb

Wifi

The two firmware files

/system/etc/firmware/fw_RK903_ag.bin
/system/etc/firmware/nvram_AP6330.txt

Enable wifi. Not with rfkill!?! Adding it to /etc/init.d/networking start and stop seems to work okay although sometimes needs a restart.

echo 1 > /sys/class/rkwifi/power
sleep 1
echo 1 > /sys/class/rkwifi/driver
In /etc/network/interfaces


GPU bits

Watch this URL http://malideveloper.arm.com/develop-for-mali/drivers/

Current version of user space binaries: r5p0-06rel0 To link stuff against the binaries you need a system running glibc >= 2.15 otherwise it'll give undefined for posix_spawn. Debian Wheezy is 2.13..

OpenCL Benchmarks

Well it works!!

#
tp@debian-armhf:~/Downloads/ViennaCL-1.6.2/build/examples/benchmarks$ ./opencl-bench-opencl 

----------------------------------------------
               Device Info
----------------------------------------------
Name:                Mali-T760
Vendor:              ARM
Type:                GPU 
Available:           1
Max Compute Units:   4
Max Work Group Size: 256
Global Mem Size:     2114854912
Local Mem Size:      32768
Local Mem Type:      2
Host Unified Memory: 1


----------------------------------------------
----------------------------------------------
## Benchmark :: OpenCL performance
----------------------------------------------

   -------------------------------
   # benchmarking single-precision
   -------------------------------
Time for building scalar kernels: 5e-06
Time for building vector kernels: 8.42177
Time for building matrix kernels: 12.5972
Time for building compressed_matrix kernels: 0.000491
Time for 100000 entry accesses on host: 0.001513
Time per entry: 1.513e-08
Result of operation on host: 104839
Time for 100000 entry accesses via OpenCL: 15.8376
Time per entry: 0.000158376
Result of operation via OpenCL: 104839

   -------------------------------
   # benchmarking double-precision
   -------------------------------
Time for building scalar kernels: 2e-06
Time for building vector kernels: 10.6382
Time for building matrix kernels: 14.4585
Time for building compressed_matrix kernels: 0.000471
Time for 100000 entry accesses on host: 0.001487
Time per entry: 1.487e-08
Result of operation on host: 105171
Time for 100000 entry accesses via OpenCL: 16.2138
Time per entry: 0.000162138
Result of operation via OpenCL: 105171
tp@debian-armhf:~/Downloads/ViennaCL-1.6.2/build/examples/benchmarks$ 
Is this a good number?!

OpenCL on Mali-T760 MP4

tp@debian-armhf:~/Downloads/ViennaCL-1.6.2/build/examples/benchmarks$ ./dense_blas-bench-opencl 

----------------------------------------------
               Device Info
----------------------------------------------

Name:                Mali-T760
Vendor:              ARM
Type:                GPU 
Available:           1
Max Compute Units:   4
Max Work Group Size: 256
Global Mem Size:     2114854912
Local Mem Size:      32768
Local Mem Type:      2
Host Unified Memory: 1


Benchmark : BLAS
----------------
sCOPY : 2.14 GB/s
sAXPY : 2.25 GB/s
sDOT : 2.23 GB/s
sGEMV-N : 0.05 GB/s
sGEMV-T : 0.427 GB/s
sGEMM-NN : 0.163 GFLOPs/s
sGEMM-NT : 0.165 GFLOPs/s
sGEMM-TN : 0.163 GFLOPs/s
sGEMM-TT : 0.163 GFLOPs/s
----
dCOPY : 3.08 GB/s
dAXPY : 3.38 GB/s
dDOT : 3.9 GB/s
dGEMV-N : 0.19 GB/s
dGEMV-T : 0.596 GB/s
dGEMM-NN : 0.119 GFLOPs/s
dGEMM-NT : 0.123 GFLOPs/s
dGEMM-TN : 0.121 GFLOPs/s
dGEMM-TT : 0.122 GFLOPs/s

On a single CPU core

tp@debian-armhf:~/Downloads/ViennaCL-1.6.2/build/examples/benchmarks$ ./dense_blas-bench-cpu
Benchmark : BLAS
----------------
sCOPY : 0.55 GB/s
sAXPY : 0.593 GB/s
sDOT : 0.476 GB/s
sGEMV-N : 0.0346 GB/s
sGEMV-T : 0.0414 GB/s
sGEMM-NN : 0.0231 GFLOPs/s
sGEMM-NT : 0.023 GFLOPs/s
sGEMM-TN : 0.0233 GFLOPs/s         
sGEMM-TT : 0.0231 GFLOPs/s
----
dCOPY : 1.11 GB/s
dAXPY : 1.19 GB/s
dDOT : 0.996 GB/s
dGEMV-N : 0.0754 GB/s
dGEMV-T : 0.0736 GB/s
dGEMM-NN : 0.0227 GFLOPs/s
dGEMM-NT : 0.0221 GFLOPs/s
dGEMM-TN : 0.0232 GFLOPs/s
dGEMM-TT : 0.0227 GFLOPs/s
tp@debian-armhf:~/Downloads/ViennaCL-1.6.2/build/examples/benchmarks$ 

I was expecting more...

Another go with the intention of running ROS(ros.org). Sept 2015

Using the kernel from https://github.com/mmind/linux-rockchip/commits/devel/somewhat-stable

And Ubuntu core armhf 14.04.03

Added iwconfig by copying not using apt-get. ''' resize2fs /dev/mmcblk0p1 300M apt-get install rfkill wpasupplicant openssh-server

'''

Updated