|
Table of Contents
1 Preparation
.. 1.1 Toolchain
.. 1.2 Tools
.. 1.3 Put your device into loader mode
2 U-Boot
.. 2.1 Compile U-Boot
.. 2.2 Flash U-Boot
3 Parameter file
4 Kernel
.. 4.1 Compile Kernel
.. 4.2 Flash Kernel
5 Linux rootfs
6 Initramfs
7 Reboot
8 FAQ
.. 8.1 Where're my paritions in eMMC storage?
.. 8.2 What currently works in mainline kernel
.. 8.3 What currently not work in mainline kernel
.. 8.4 Mainline & sdk kernel difference
1 Preparation
TTTTTTTTTTTTT Suppose your working directory is "~/proj/linux-rockchip" q
mkdir -p ~/proj/linux-rockchip
t
1.1 Toolchain
Then copy the Android prebuilt directory to it: q
cd ~/proj/linux-rockchip
cp -rl ANDROID_SDK/prebuilts .
t We're using arm-eabi-4.6 and arm-eabi-4.7 in
"prebuilts/gcc/linux-x86/arm/". U-Boot prefers arm-eabi-4.7 than arm-eabi-4.6, and kernel uses
arm-eabi-4.6.
1.2 Tools
Install
• rkflashtool: [https://github.com/linux-rockchip/rkflashtool]
• rkflashkit: [https://github.com/linuxerwang/rkflashkit]
• rk_upgrade_tool:
RK3288_SDK/RKTools/linux/Linux_Upgrade_Tool_v1.2/upgrade_tool
1.3 Put your device into loader mode
Check
[http://wiki.t-firefly.com/index.php/Firefly-RK3288/Flash_image/en] .
2 U-Boot
TTTTTTTT
2.1 Compile U-Boot
Compile U-Boot first:
q
cd ~/proj/linux-rockchip
git clone https://github.com/linux-rockchip/u-boot-rockchip.git u-boot
cd u-boot
make rk3288_defconfig
make -j4
t If U-Boot is built succeesfully, the last lines of the build process
are:
q
LD u-boot
OBJCOPY u-boot.bin
OBJCOPY u-boot.srec
./tools/boot_merger --subfix ".01.bin" ./tools/rk_tools/RKBOOT/RK3288.ini
out:RK3288UbootLoader.bin
fix opt:RK3288UbootLoader_V2.19.01.bin
merge success(RK3288UbootLoader_V2.19.01.bin)
t "RK3288UbootLoader_V2.19.01.bin" is the newly built u-boot which is
ready to flash using rk_upgrade_tool:
2.2 Flash U-Boot
q
sudo rk_upgrade_tool ul RK3288UbootLoader_V2.19.01.bin
t
3 Parameter file
TTTTTTTTTTTTTTTT
You need the kernel partition to hold main line kernel image, and an
optional boot partition to hold initramfs (if you use it). Below is the default dual boot parameter, which is sufficient to test
the main line kernel:
q
FIRMWARE_VER:4.4.2
MACHINE_MODEL:rk30sdk
MACHINE_ID:007
MANUFACTURER:RK30SDK
MAGIC: 0x5041524B
ATAG: 0x60000800
MACHINE: 3066
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=ttyFIQ0 androidboot.hardware=rk30board androidboot.console=ttyFIQ0 board.ap_has_alsa=0 root=/dev/block/mtd/by-name/linuxroot rw rootfstype=ext4 init=/sbin/init initrd=0x62000000,0x00800000 mtdparts=rk29xxnand:0x00002000@0x00002000(uboot),0x00002000@0x00004000(misc),0x00008000@0x00006000(resource),0x00008000@0x0000e000(kernel),0x00010000@0x00016000(boot),0x00010000@0x00026000(recovery),0x0001a000@0x00036000(backup),0x00040000@0x00050000(cache),0x00002000@0x00090000(kpanic),0x00180000@0x00092000(system),0x00002000@0x00212000(metadata),0x00200000@0x00214000(userdata),0x00620000@0x00414000(linuxroot),-@0x00a34000(user)
t To fetch the parameter file of your device, run:
q
sudo rkflashkit backup @parameter parameter.txt
t To flash the new parameter file to your device, run:
q
sudo rkflashkit flash @parameter parameter.txt
t
4 Kernel
TTTTTTTT
This is naobsd's linux-next tree with Firefly-RK3288 develpment board
support:
[https://github.com/naobsd/linux/tree/naobsd/next-20141231]
4.1 Compile Kernel
First, fetch the sources:
q
cd ~/proj/linux-rockchip
git clone -b naobsd/next-20141231 https://github.com/naobsd/linux.git kernel
t kerne.img can be made with following commands:
q
cd ~/proj/linux-rockchip/kernel
export ARCH=arm
export CROSS_COMPILE=$PWD/../prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-
make rk3288_defconfig
make -j4 zImage
make rk3288-firefly.dtb
cat arch/arm/boot/zImage arch/arm/boot/dts/rk3288-firefly.dtb > zImage-dtb
rkcrc -k zImage-dtb kernel.img
t
4.2 Flash Kernel
q
sudo rkflashkit erase @resource
sudo rkflashkit flash @kernel kernel.img
t
5 Linux rootfs
TTTTTTTTTTTTTT
Put your rootfs to the first partition of your SD-card. If you want to change the root path, please change CONFIG_CMDLINE in
the kernel configuration file: q
CONFIG_CMDLINE="console=ttyS2,115200 earlyprintk init=/sbin/init root=/dev/mmcblk0p1 rootwait"
t
6 Initramfs
TTTTTTTTTTT
If you want to use initramfs, please use rkcrc to pack it first, then
flash it to boot partition q
rkcrc -k initramfs.img boot.img
sudo rkflashkit flash @boot boot.img
t
7 Reboot
TTTTTTTT
Insert the SD-card, and reboot the device with: q
sudo rkflashkit reboot
t
8 FAQ
TTTTT
8.1 Where're my paritions in eMMC storage?
The main line kernel does not support rk style partition scheme which
uses command line to specify partition layout.
8.2 What currently works in mainline kernel
• USB
• TF-CARD
8.3 What currently not work in mainline kernel
• Ethernet
• HDMI
• WiFi
8.4 Mainline & sdk kernel difference
mainline sdk
console /dev/ttyS2 /dev/ttyFIQ0
|