Rockchip Kernel

From Rockchip open source Document
Revision as of 13:59, 15 March 2017 by Kever (talk | contribs)
Jump to: navigation, search

Download Kernel

You can clone the rockchip kernel repository from github which is kernel 4.4 based:

git clone

Supported SoCs and Devices

Rockchip kernel 4.4 supports:

RK3036, RK3066, RK312X, RK3188, RK322X, RK3288, RK3328, RK3368, RK3399

Configure and Build

You will need to use rockchip_linux_defconfig for Linux OS

configure for armv7:

make rockchip_linux_defcofig

configure for aarch64:

make ARCH=arm64 rockchip_linux_defconfig

After configure, you need to decide which board to use, get the dts file name, and replace its postfix to img in make command,

For armv7:

make rk3288-firefly.img -j8

For aarch64:

make ARCH=arm64 rk3399-evb.img -j8

Then you can get Image/zImage and dtb file.

Install Boot/kernel

We use distro boot in U-Boot, so we need to make a boot partition for U-Boot with kernel image and dtb inside.

Generate ext2fs boot partition


mkdir boot
cp arch/arm64/boot/dts/rockchip/rockchip/rk3399-evb.dtb boot/rk3399.dtb
cp arch/arm64/boot/Image boot/

Add extlinux/extlinux.conf for distro boot.

mkdir boot/extlinux
vi boot/extlinux/extlinux.conf


lable rockchip-kernel-4.4
    kernel /Image
    fdt /rk3399.dtb
    append earlycon=uart8250,mmio,0xff1a0000 root=dev/mmcblk1p7 rootwait rootfstype=ext4 init=/sbin/init

You need to change the base address of debug UART, root partition for your board.

Pls reference to rockchip Linux parttion definition for rootfs partition and where boot to flash.

After all these file prepare complete, we can generate the boot partition by genext2fs:

genext2fs -b 32768 -B $((32*1024*1024/32768)) -d boot/ -i 8192 -U boot_rk3399.img

According to Rockchip partition definition, you need to flash this image to boot partiton which offset is 0x8000.