Firefly Open Source Community

   Login   |   Register   |
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      View:5375 | Replies:2        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
═════════════

  Suppose your working directory is "~/proj/linux-rockchip"

  ╭────
  │ mkdir -p ~/proj/linux-rockchip
  ╰────


1.1 Toolchain
─────────────

  Then copy the Android prebuilt directory to it:

  ╭────
  │ cd ~/proj/linux-rockchip
  │ cp -rl ANDROID_SDK/prebuilts .
  ╰────

  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
════════

2.1 Compile U-Boot
──────────────────

  Compile U-Boot first:
  ╭────
  │ 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
  ╰────

  If U-Boot is built succeesfully, the last lines of the build process
  are:
  ╭────
  │   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)
  ╰────

  "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
────────────────

  ╭────
  │ sudo rk_upgrade_tool ul RK3288UbootLoader_V2.19.01.bin
  ╰────


3 Parameter file
════════════════

  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:
  ╭────
  │ 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)
  ╰────

  To fetch the parameter file of your device, run:
  ╭────
  │ sudo rkflashkit backup @parameter parameter.txt
  ╰────

  To flash the new parameter file to your device, run:
  ╭────
  │ sudo rkflashkit flash @parameter parameter.txt
  ╰────


4 Kernel
════════

  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:
  ╭────
  │ cd ~/proj/linux-rockchip
  │ git clone -b naobsd/next-20141231 https://github.com/naobsd/linux.git kernel
  ╰────

  kerne.img can be made with following commands:
  ╭────
  │ 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
  ╰────


4.2 Flash Kernel
────────────────

  ╭────
  │ sudo rkflashkit erase @resource
  │ sudo rkflashkit flash @kernel kernel.img
  ╰────


5 Linux rootfs
══════════════

  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:

  ╭────
  │ CONFIG_CMDLINE="console=ttyS2,115200 earlyprintk init=/sbin/init root=/dev/mmcblk0p1 rootwait"
  ╰────


6 Initramfs
═══════════

  If you want to use initramfs, please use rkcrc to pack it first, then
  flash it to boot partition

  ╭────
  │ rkcrc -k initramfs.img boot.img
  │ sudo rkflashkit flash @boot boot.img
  ╰────


7 Reboot
════════

  Insert the SD-card, and reboot the device with:

  ╭────
  │ sudo rkflashkit reboot
  ╰────


8 FAQ
═════

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

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

This forum Credits Rules

Quick Reply Back to top Back to list