Difference between revisions of "Upstream Kernel"

From Rockchip open source Document
Jump to: navigation, search
(Created page with " Rockchip is woring on upstream SoC support to Mainline kernel: https://www.kernel.org/ SoC support including: RK3036, RK3066, RK3188, RK3288, RK3368, RK3399")
 
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  
Rockchip is woring on upstream SoC support to Mainline kernel:
+
Rockchip is working on upstream SoC support to Mainline kernel:
  
https://www.kernel.org/
+
 
  
SoC support including:
+
 
  
RK3036, RK3066, RK3188, RK3288, RK3368, RK3399
+
= Download Kernel =
 +
 
 +
Get the source code from the upstream mainline repository:
 +
<pre>git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git</pre>
 +
 
 +
Alternatively you can use linux-rockchip instead which may with some patches not get in mainline:
 +
<pre>git clone git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git</pre>
 +
 
 +
&nbsp;
 +
 
 +
 
 +
= Supported SoCs and Devices =
 +
 
 +
Mainline&nbsp;kernel supports:
 +
 
 +
RV1108, RK3036, RK3066, RK3188, RK3228, [[RK3288|RK3288]], RK3368, [[RK3399|RK3399]]
 +
 
 +
*RV1108 boards:
 +
<ol style="margin-left: 40px;">
 +
<li>EVB RV1108- use&nbsp;rk1108-evb.dts</li>
 +
</ol>
 +
 
 +
*RK3036 boards:
 +
<ol style="margin-left: 40px;">
 +
<li>EVB RK3036 - use rk3036-evb.dts</li>
 +
<li>Kylin RK3036- use&nbsp;rk3036-kylin.dts</li>
 +
</ol>
 +
 
 +
*RK3066 boards:
 +
<ol style="margin-left: 40px;">
 +
<li>Marsboard - use&nbsp;rk3066a-marsboard.dts</li>
 +
<li>Bqcurie2 - use&nbsp;rk3066a-bqcurie2.dts</li>
 +
<li>Rayeager - use rk3066a-rayeager.dts</li>
 +
</ol>
 +
 
 +
*RK3188 boards:
 +
<ol style="margin-left: 40px;">
 +
<li>Radxa Rock - rk3188-radxarock.dts</li>
 +
</ol>
 +
 
 +
*RK3288 boards:
 +
<ol style="margin-left: 40px;">
 +
<li>EVB RK3288 - use rk3288-evb-rk808.dts or&nbsp;rk3288-evb-act8846.dts</li>
 +
<li>Firefly RK3288 - use rk3288-firefly.dts</li>
 +
<li>Firefly beta RK3288 - use rk3288-firefly-beta.dts</li>
 +
<li>Firefly reload RK3288 - use rk3288-firefly-reload.dts</li>
 +
<li>Hisense Chromebook - use rk3288-veyron-jerry.dts</li>
 +
<li>PopMetal RK3288 - use rk3288-popmetal.dts</li>
 +
<li>Radxa Rock 2 - use rk3288-rock2-square.dts</li>
 +
</ol>
 +
 
 +
*RK3368 boards:
 +
<ol style="margin-left: 40px;">
 +
<li>Geekbok RK3368 - use&nbsp;rk3368-geekbox.dts</li>
 +
<li>Orion r68 - use rk3368-orion-r68-meta.dts</li>
 +
</ol>
 +
 
 +
*RK3399 boards:
 +
<ol style="margin-left: 40px;">
 +
<li>EVB RK3399 - use rk3399-evb.dts</li>
 +
</ol>
 +
 
 +
&nbsp;
 +
 
 +
= Configure and Build =
 +
 
 +
You will need to use multi_v7_defconfig&nbsp;for armv7 SoCs:
 +
<pre>make multi_v7_defconfig</pre>
 +
 
 +
configure for aarch64:
 +
<pre>make ARCH=arm64 defconfig</pre>
 +
 
 +
The arm64 defconfig on upstream is more for server,&nbsp;we recommend you to use rockchip_linux_defconfig from&nbsp;Rockchip github
 +
<pre>make ARCH=arm64 rockchip_linux_defconfig</pre>
 +
 
 +
After configure, build the kernel.
 +
 
 +
For armv7:
 +
<pre>make CROSS_COMPILE=arm-linux-gnueabi-</pre>
 +
 
 +
For aarch64:
 +
<pre>make CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64</pre>
 +
 
 +
Then you can get Image/zImage and dtb files.
 +
 
 +
&nbsp;
 +
 
 +
&nbsp;
 +
 
 +
 
 +
= Install Boot/kernel =
 +
 
 +
We use distro boot in U-Boot, so we need to make a boot partition for U-Boot with kernel image and dtb inside.
 +
<pre>mkdir boot
 +
cp arch/arm64/boot/dts/rockchip/rockchip/rk3399-evb.dtb boot/rk3399.dtb
 +
cp arch/arm64/boot/Image boot/</pre>
 +
 
 +
Add extlinux/extlinux.conf for distro boot.
 +
<pre>mkdir boot/extlinux
 +
vi boot/extlinux/extlinux.conf</pre>
 +
 
 +
&nbsp;
 +
<pre>lable kernel-mainline
 +
    kernel /Image
 +
    fdt /rk3399.dtb
 +
    append earlycon=uart8250,mmio,0xff1a0000 console=ttyS2,1500000n8 root=dev/mmcblk0p7 rootwait rootfstype=ext4 init=/sbin/init</pre>
 +
 
 +
You need to change the base address of debug UART, root partition for your board.
 +
 
 +
Pls reference to&nbsp;[[Partitions|rockchip Linux parttion definition]]&nbsp;for rootfs partition and where boot to flash.
 +
 
 +
After all these file prepare complete, we write the file to the boot partition
 +
 
 +
See [[Rockchip_Kernel|rockchip kernel]] for boot partition generate.
 +
 
 +
= Non-upstream module =
 +
 
 +
[[Graphics|Rockchp Graphics]]
 +
 
 +
[[Mpp|Rockchip Video]]
 +
 
 +
[[Camera|Rockchip Camera]]

Latest revision as of 03:12, 4 September 2019

Rockchip is working on upstream SoC support to Mainline kernel:

 

 

Download Kernel

Get the source code from the upstream mainline repository:

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

Alternatively you can use linux-rockchip instead which may with some patches not get in mainline:

git clone git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git

 


Supported SoCs and Devices

Mainline kernel supports:

RV1108, RK3036, RK3066, RK3188, RK3228, RK3288, RK3368, RK3399

  • RV1108 boards:
  1. EVB RV1108- use rk1108-evb.dts
  • RK3036 boards:
  1. EVB RK3036 - use rk3036-evb.dts
  2. Kylin RK3036- use rk3036-kylin.dts
  • RK3066 boards:
  1. Marsboard - use rk3066a-marsboard.dts
  2. Bqcurie2 - use rk3066a-bqcurie2.dts
  3. Rayeager - use rk3066a-rayeager.dts
  • RK3188 boards:
  1. Radxa Rock - rk3188-radxarock.dts
  • RK3288 boards:
  1. EVB RK3288 - use rk3288-evb-rk808.dts or rk3288-evb-act8846.dts
  2. Firefly RK3288 - use rk3288-firefly.dts
  3. Firefly beta RK3288 - use rk3288-firefly-beta.dts
  4. Firefly reload RK3288 - use rk3288-firefly-reload.dts
  5. Hisense Chromebook - use rk3288-veyron-jerry.dts
  6. PopMetal RK3288 - use rk3288-popmetal.dts
  7. Radxa Rock 2 - use rk3288-rock2-square.dts
  • RK3368 boards:
  1. Geekbok RK3368 - use rk3368-geekbox.dts
  2. Orion r68 - use rk3368-orion-r68-meta.dts
  • RK3399 boards:
  1. EVB RK3399 - use rk3399-evb.dts

 

Configure and Build

You will need to use multi_v7_defconfig for armv7 SoCs:

make multi_v7_defconfig

configure for aarch64:

make ARCH=arm64 defconfig

The arm64 defconfig on upstream is more for server, we recommend you to use rockchip_linux_defconfig from Rockchip github

make ARCH=arm64 rockchip_linux_defconfig

After configure, build the kernel.

For armv7:

make CROSS_COMPILE=arm-linux-gnueabi-

For aarch64:

make CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64

Then you can get Image/zImage and dtb files.

 

 


Install Boot/kernel

We use distro boot in U-Boot, so we need to make a boot partition for U-Boot with kernel image and dtb inside.

mkdir boot
cp arch/arm64/boot/dts/rockchip/rockchip/rk3399-evb.dtb boot/rk3399.dtb
cp arch/arm64/boot/Image boot/

Add extlinux/extlinux.conf for distro boot.

mkdir boot/extlinux
vi boot/extlinux/extlinux.conf

 

lable kernel-mainline
    kernel /Image
    fdt /rk3399.dtb
    append earlycon=uart8250,mmio,0xff1a0000 console=ttyS2,1500000n8 root=dev/mmcblk0p7 rootwait rootfstype=ext4 init=/sbin/init

You need to change the base address of debug UART, root partition for your board.

Pls reference to rockchip Linux parttion definition for rootfs partition and where boot to flash.

After all these file prepare complete, we write the file to the boot partition

See rockchip kernel for boot partition generate.

Non-upstream module

Rockchp Graphics

Rockchip Video

Rockchip Camera