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

Difference between revisions of "RockpiE/dev/kernel-4.4"

< RockpiE‎ | dev
(Created page with "{{rockpiE_header}} {{Languages|rockpiE/dev/kernel-4.4}} ROCK Pi E > Development > rockpiE/dev/kernel-4.4 | Build vendor kernel(Rockchip...")
 
(FAQs)
 
(5 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
     [[rockpiE | ROCK Pi E]] > [[rockpiE/dev | Development]] > [[rockpiE/dev/kernel-4.4 | Build vendor kernel(Rockchip 4.4)]]
 
     [[rockpiE | ROCK Pi E]] > [[rockpiE/dev | Development]] > [[rockpiE/dev/kernel-4.4 | Build vendor kernel(Rockchip 4.4)]]
  
 +
__TOC__
 +
 +
=== Build verdor kernel (Rockchip 4.4) ===
 +
 +
This guide describes how to build verdor kernel (Rockchip 4.4).
 +
<br />
 
The vendor kernel is based on the Rockchip 4.4 kernel with hardware support for ROCK Pi E. Below is how to build it on a X86 Linux host PC.
 
The vendor kernel is based on the Rockchip 4.4 kernel with hardware support for ROCK Pi E. Below is how to build it on a X86 Linux host PC.
  
=== Get the kernel source ===
+
==== Get the kernel source ====
  
Branch release-4.4-rockpi4 supports ROCK Pi E board.
+
Branch stable-4.4-rockpie supports ROCK Pi E board.
  
     git clone -b release-4.4-rockpi4 https://github.com/radxa/kernel.git
+
     git clone -b stable-4.4-rockpie https://github.com/radxa/kernel.git
 
     cd kernel
 
     cd kernel
  
=== 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
Line 21: Line 27:
 
     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 rockchip_linux_defconfig
 
     make rockchip_linux_defconfig
Line 35: Line 41:
 
The built targets we are interested are '''arch/arm64/boot/Image''' and dtb file '''arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dtb'''.
 
The built targets we are interested are '''arch/arm64/boot/Image''' and dtb file '''arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dtb'''.
  
=== Build kernel deb package ===
+
==== Build kernel deb package ====
  
 
The kernel package build can pack the kernel, device tree, modules and firmware into Debian packages, which makes it easier to install on the ROCK Pi E.
 
The kernel package build can pack the kernel, device tree, modules and firmware into Debian packages, which makes it easier to install on the ROCK Pi E.
Line 50: Line 56:
 
The generated packages are(the kernel revision name maybe different):  
 
The generated packages are(the kernel revision name maybe different):  
  
<pre>
+
    ls ../*.deb
ls ../*.deb
+
   
 +
    ../linux-firmware-image-4.4.194-999-rockchip-58823-g67ab7d4_4.4.194-999-rockchip_arm64.deb
 +
    ../linux-headers-4.4.194-999-rockchip-58823-g67ab7d4_4.4.194-999-rockchip_arm64.deb
 +
    ../linux-image-4.4.194-999-rockchip-58823-g67ab7d4_4.4.194-999-rockchip_arm64.deb
 +
    ../linux-image-4.4.194-999-rockchip-58823-g67ab7d4-dbg_4.4.194-999-rockchip_arm64.deb
 +
    ../linux-libc-dev_4.4.194-999-rockchip_arm64.deb
  
../linux-firmware-image-4.4.154-999-rockchip-g8b7b311_4.4.154-999-rockchip_all.deb
+
copy '''linux-image-4.4.194-999-rockchip-*_arm64.deb''' and '''linux-firmware-image-4.4.194-999-rockchip-*_arm64.deb''' to your ROCK Pi E.
../linux-headers-4.4.154-999-rockchip-g8b7b311_4.4.154-999-rockchip_all.deb
+
../linux-image-4.4.154-999-rockchip-g8b7b311_4.4.154-999-rockchip_all.deb
+
../linux-image-4.4.154-999-rockchip-g8b7b311-dbg_4.4.154-999-rockchip_all.deb
+
../linux-libc-dev_4.4.154-999-rockchip_all.deb
+
</pre>
+
  
 +
==== Install it on ROCK Pi E.====
  
copy '''linux-image-4.4.154-999-rockchip-*_all.deb''' and '''linux-firmware-image-4.4.154-999-rockchip-*_all.deb''' to your ROCK Pi E.
+
    rockpie# dpkg -i linux-image-4.4.194-999-rockchip-*_arm64.deb linux-firmware-image-4.4.194-999-rockchip-*_arm64.deb
  
==== Install it on ROCK Pi E.====
+
Reboot and you will have the new kernel booting.
 +
 
 +
==== FAQs ====
 +
 
 +
===== 1.I have built one ROCK Pi E system image using rockchip-bsp SDK. With an USB to TTL serial cable connected with UART2 pins (pin#10, pin#8, ping#6 on 40-PIN Header) on ROCK Pi E, the last one line of system logs is shown as follows. =====
 +
 
 +
    [    0.932225] bootconsole [uart0] disabled
 +
 
 +
In fact the system starts up. If your ROCK Pi E system supports Ethernet/WiFi and SSH, you can access ROCK Pi E via SSH.
 +
 
 +
If you read the kernel command line of system log, you will find that the default console is ttyS2 (1500000n8). But due to uart2 is disabled by default in file rk3328-rock-pi-e.dts, there will be no more system logs on the screen.
 +
 
 +
To enable console ttyS2, you need to enable uart2 node. Add the following lines at the end of file rk3328-rock-pi-e.dts.
  
     rockpie# dpkg -i linux-image-4.4.154-999-rockchip-*_all.deb linux-firmware-image-4.4.154-999-rockchip-*_all.deb
+
     &uart2 {
 +
        status = "okay";
 +
    };
  
Reboot you will have the new kernel booting.
+
==== Troubleshooting ====
 +
* Post your issue at the forum: https://forum.radxa.com/c/rockpie

Latest revision as of 03:38, 28 May 2020

    ROCK Pi E >  Development >  Build vendor kernel(Rockchip 4.4)

Build verdor kernel (Rockchip 4.4)

This guide describes how to build verdor kernel (Rockchip 4.4).
The vendor kernel is based on the Rockchip 4.4 kernel with hardware support for ROCK Pi E. Below is how to build it on a X86 Linux host PC.

Get the kernel source

Branch stable-4.4-rockpie supports ROCK Pi E board.

   git clone -b stable-4.4-rockpie https://github.com/radxa/kernel.git
   cd kernel

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 rockchip_linux_defconfig

If you need to build kernel modules that are not in the default config, you can select it in menu config

   make menuconfig    #(optional)

Now build it

   make -j8

The built targets we are interested are arch/arm64/boot/Image and dtb file arch/arm64/boot/dts/rockchip/rk3328-rock-pi-e.dtb.

Build kernel deb package

The kernel package build can pack the kernel, device tree, modules and firmware into Debian packages, which makes it easier to install on the ROCK Pi E.

First, setup the version number, make sure the format is right.

   export build_id="999"             # make sure it's big enough so that our kernel is the newest.
   export lv="-$build_id-rockchip"
   export kv=$(make kernelversion)
   export debv="$kv$lv"
   make  bindeb-pkg -j8    LOCALVERSION=$lv    KDEB_PKGVERSION=$debv

The generated packages are(the kernel revision name maybe different):

   ls ../*.deb
   
   ../linux-firmware-image-4.4.194-999-rockchip-58823-g67ab7d4_4.4.194-999-rockchip_arm64.deb
   ../linux-headers-4.4.194-999-rockchip-58823-g67ab7d4_4.4.194-999-rockchip_arm64.deb
   ../linux-image-4.4.194-999-rockchip-58823-g67ab7d4_4.4.194-999-rockchip_arm64.deb
   ../linux-image-4.4.194-999-rockchip-58823-g67ab7d4-dbg_4.4.194-999-rockchip_arm64.deb
   ../linux-libc-dev_4.4.194-999-rockchip_arm64.deb

copy linux-image-4.4.194-999-rockchip-*_arm64.deb and linux-firmware-image-4.4.194-999-rockchip-*_arm64.deb to your ROCK Pi E.

Install it on ROCK Pi E.

   rockpie# dpkg -i linux-image-4.4.194-999-rockchip-*_arm64.deb linux-firmware-image-4.4.194-999-rockchip-*_arm64.deb

Reboot and you will have the new kernel booting.

FAQs

1.I have built one ROCK Pi E system image using rockchip-bsp SDK. With an USB to TTL serial cable connected with UART2 pins (pin#10, pin#8, ping#6 on 40-PIN Header) on ROCK Pi E, the last one line of system logs is shown as follows.
   [    0.932225] bootconsole [uart0] disabled

In fact the system starts up. If your ROCK Pi E system supports Ethernet/WiFi and SSH, you can access ROCK Pi E via SSH.

If you read the kernel command line of system log, you will find that the default console is ttyS2 (1500000n8). But due to uart2 is disabled by default in file rk3328-rock-pi-e.dts, there will be no more system logs on the screen.

To enable console ttyS2, you need to enable uart2 node. Add the following lines at the end of file rk3328-rock-pi-e.dts.

   &uart2 {
       status = "okay";
   };

Troubleshooting