Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

Difference between revisions of "Rockpi4/dev/kernel-mainline"

< Rockpi4‎ | dev
(3 intermediate revisions by the same user not shown)
Line 6: Line 6:
  
 
ROCK Pi 4 is officially supported in mainline kernel since v5.1 thanks to developer Akash Gajjar from Mentor. Below is how to build it on a X86 Linux host PC and run on ROCK Pi 4.
 
ROCK Pi 4 is officially supported in mainline kernel since v5.1 thanks to developer Akash Gajjar from Mentor. Below is how to build it on a X86 Linux host PC and run on ROCK Pi 4.
 +
 +
== Build kernel on linux PC ==
 +
 +
=== Requirement ===
 +
 +
    $ sudo apt-get install libncurses-dev flex bison libssl-dev git
  
 
=== Get the mainline kernel source ===
 
=== Get the mainline kernel source ===
  
     wget https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/snapshot/linux-5.2-rc6.tar.gz
+
     $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
    tar -xvzf linux-5.2-rc6.tar.gz
+
     $ cd linux
     cd linux-5.1.15/
+
  
 
=== Install toolchain from Linaro ===
 
=== Install toolchain from Linaro ===
  
     wget https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
+
     $ wget https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
     sudo tar xvf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz  -C /usr/local/
+
     $ sudo tar xvf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz  -C /usr/local/
     export ARCH=arm64
+
     $ export ARCH=arm64
     export CROSS_COMPILE=/usr/local/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
+
     $ export CROSS_COMPILE=/usr/local/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
  
 
=== Build kernel===
 
=== Build kernel===
  
     make menuconfig
+
     $ make defconfig
 +
    $ make -j6
  
*In the menu-config TUI:
+
Copy '''arch/arm64/boot/Image''' and '''arch/arm64/boot/dts/rk3399-rock-pi-4.dtb''' to your ROCK Pi 4.
*Navigate to Platform selection  ---> Rockchip Platforms
+
*Select Rockchip Platforms
+
  
    make -j6
+
== Install it on ROCK Pi 4.==
  
copy '''arch/arm64/boot/Image''' and '''arch/arm64/boot/dts/rk3399-rock-pi-4.dtb''' to your ROCK Pi 4.
+
=== Copy files ===
  
'''If you run on debian you should Install the latest u-boot and kernel before Install mainline kernel on ROCK Pi 4.'''
+
    $ sudo cp Image rk3399-rock-pi-4.dtb /boot/
  
== Install the latest u-boot and kernel==  
+
=== Configure ===
    apt-get install rockpi4b-rk-u-boot-latest
+
  
Manually run the u-boot flash script
+
     $ sudo vim /boot/extlinux/extlinux.conf
     /usr/local/sbin/rockpi4b_upgrade_bootloader.sh
+
  
 +
*Change the contents to:
  
Type '''YES''' to perform the uboot.img flashing.
 
 
then install kernel 
 
    apt-get install linux-base
 
    apt-get install linux-4.4-latest
 
 
 
After installation, check file '''/boot/extlinux/extlinux.conf'''. It lists all kernel version installed in ROCK Pi. The kernel corresponding to the first label is the newest version and the first boot option.
 
 
==== Install it on ROCK Pi 4.====
 
 
    rockpi4# cp Image rk3399-rock-pi-4.dtb /boot/
 
    rockpi4#vi /boot/extlinux/extlinux.conf
 
 
*Change the contents to:
 
 
   label kernel-mainline
 
   label kernel-mainline
 
   kernel /Image
 
   kernel /Image
 
   fdt /rk3399-rock-pi-4.dtb
 
   fdt /rk3399-rock-pi-4.dtb
   append earlycon=uart8250,mmio32,0xff1a0000 swiotlb=1 coherent_pool=1m earlyp printk console=ttyS2,1500000n8 rw root=PARTUUID=b921b045-1d rootfstype=ext4 init==/sbin/init rootwait
+
   append earlycon=uart8250,mmio32,0xff1a0000 swiotlb=1 coherent_pool=1m earlyprintk console=ttyS2,1500000n8 rw root=PARTUUID=b921b045-1d rootfstype=ext4 init=/sbin/init rootwait
  
 
Reboot you will have the new kernel booting.
 
Reboot you will have the new kernel booting.

Revision as of 11:29, 19 November 2019

    ROCK Pi 4 >  Development >  Build mainline kernel(5.x)

ROCK Pi 4 is officially supported in mainline kernel since v5.1 thanks to developer Akash Gajjar from Mentor. Below is how to build it on a X86 Linux host PC and run on ROCK Pi 4.

Build kernel on linux PC

Requirement

   $ sudo apt-get install libncurses-dev flex bison libssl-dev git

Get the mainline kernel source

   $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
   $ cd linux

Install toolchain from Linaro

   $ wget https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz
   $ sudo tar xvf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz  -C /usr/local/
   $ export ARCH=arm64
   $ export CROSS_COMPILE=/usr/local/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-

Build kernel

   $ make defconfig
   $ make -j6

Copy arch/arm64/boot/Image and arch/arm64/boot/dts/rk3399-rock-pi-4.dtb to your ROCK Pi 4.

Install it on ROCK Pi 4.

Copy files

   $ sudo cp Image rk3399-rock-pi-4.dtb /boot/

Configure

   $ sudo vim /boot/extlinux/extlinux.conf
  • Change the contents to:
  label kernel-mainline
  kernel /Image
  fdt /rk3399-rock-pi-4.dtb
  append earlycon=uart8250,mmio32,0xff1a0000 swiotlb=1 coherent_pool=1m earlyprintk console=ttyS2,1500000n8 rw root=PARTUUID=b921b045-1d rootfstype=ext4 init=/sbin/init rootwait

Reboot you will have the new kernel booting.