Firefly Open Source Community

   Login   |   Register   |
New_Topic
12
New Topic
Print Previous Topic Next Topic

First successful try of the main line kernel

403

Credits

10

Prestige

12

Contribution

intermediate

Rank: 3Rank: 3

Credits
403

First successful try of the main line kernel

Posted at 1/4/2015 16:57:18      View7727 | Replies7        Print      Only Author   [Copy Link] 1#

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
  

Reply

Use props Report

403

Credits

10

Prestige

12

Contribution

intermediate

Rank: 3Rank: 3

Credits
403
Posted at 1/4/2015 16:59:33        Only Author  2#
Many thanks to the linux-rockchip community!
Reply

Use props Report

244

Credits

0

Prestige

0

Contribution

intermediate

Rank: 3Rank: 3

Credits
244
Posted at 1/15/2015 10:53:24        Only Author  3#

you can use more up-to-date gcc for mainline kernel. currently I'm using gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux fromhttp://www.linaro.org/downloads/


I prepared new patch here https://github.com/naobsd/linux/tree/naobsd/next-20150114

gmac (GbE) works now, but it seems sdmmc has a problem...

Reply

Use props Report

244

Credits

0

Prestige

0

Contribution

intermediate

Rank: 3Rank: 3

Credits
244
Posted at 1/25/2015 21:00:34        Only Author  4#

Re: First successful try of the main line kernel

https://github.com/naobsd/linux/tree/na ... t-20150123

this version fixes sdmmc issue. please use this.


I hope this version will be merged into upstream...

Reply

Use props Report

2

Credits

0

Prestige

0

Contribution

new registration

Rank: 1

Credits
2
Posted at 2/14/2015 06:20:13        Only Author  5#

Re: First successful try of the main line kernel

Hello,

Have anyone ported   Debian/Ubuntu with kernel 3.19  with firefly...

I will appreciate if any one can suggest me in brief how I can do it .

thanks in advance ..

Reply

Use props Report

244

Credits

0

Prestige

0

Contribution

intermediate

Rank: 3Rank: 3

Credits
244
Posted at 2/14/2015 07:52:08        Only Author  6#

Re: First successful try of the main line kernel

Hello,

Have anyone ported   Debian/Ubuntu with kernel 3.19  with firefly...

I will appreciate if any one can suggest me in brief how I can do it .

thanks in advance ..

any existing root file system image will work, or you may make your own root file system with debootstrap or similar common tools.


minor modification may be needed, but it should be minor.

Reply

Use props Report

90

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
90
Posted at 1/9/2026 08:54:44        Only Author  7#
What an insightful article, I truly appreciate your sharing it! Free Exam 156-836 actual tests materials are here. Best of luck in your exams!
Reply

Use props Report

94

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
94
Posted at 1/9/2026 16:01:31        Only Author  8#
I am deeply inspired by this article, thanks for sharing! Reliable test Sustainable-Investing cram sheet file offers a wealth of content and is available for free, hoping it assists you.
Reply

Use props Report

79

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
79
Posted at 1/10/2026 08:43:08        Only Author  9#
Im really grateful for your article, it left an indelible mark. Wishing you the best! Here are the free H12-821_V1.0 brain dump free resources.
Reply

Use props Report

82

Credits

0

Prestige

0

Contribution

registered members

Rank: 2

Credits
82
Posted at 1/11/2026 05:14:52        Only Author  10#
I cant express how much I appreciate your article, it was truly memorable. This is the Valid study guide GICSP book exam that helped me get promoted and earn a pay raise. Its available for free todaygood luck with your career goals!
Reply

Use props Report

Return to List
12
You need to log in before you can reply Login | Register

This forum Credits Rules

Quick Reply Back to top Back to list