Difference between revisions of "Mainline Linux on Orange Pi 4"

From Dejvino's Knowledge Base
Jump to navigation Jump to search
 
(4 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
There are several components that need to be compiled and prepared from the ground up:
 
There are several components that need to be compiled and prepared from the ground up:
 
# [[U-Boot]]
 
# [[U-Boot]]
# [[Linux]] kernel
+
# [[Linux kernel]]
 
# [[rootfs]]
 
# [[rootfs]]
 +
 +
The installation of these components consists of:
 
# Creating a Disk Image
 
# Creating a Disk Image
 
# [[Flashing Linux to SD Card|Flashing to SD Card]]
 
# [[Flashing Linux to SD Card|Flashing to SD Card]]
  
== U-Boot ==
+
== Compilation ==
 +
=== U-Boot ===
 
Mainline repository: [https://gitlab.denx.de/u-boot/u-boot]
 
Mainline repository: [https://gitlab.denx.de/u-boot/u-boot]
  
 
Details: [[U-Boot on Orange Pi 4]]
 
Details: [[U-Boot on Orange Pi 4]]
  
=== Setup ===
+
=== Linux kernel ===
<pre>git clone https://gitlab.denx.de/u-boot/u-boot.git
+
Mainline repository: [https://www.kernel.org/]
cd u-boot
 
make orangepi-rk3399_defconfig</pre>
 
 
 
==== Option 1: Package the image with Rockchip miniloader ====
 
<pre>
 
  - Compile U-Boot
 
 
 
    => cd /path/to/u-boot
 
    => make orangepi-rk3399_defconfig
 
    => make
 
 
 
  - Get the rkbin
 
 
 
    => git clone https://github.com/rockchip-linux/rkbin.git
 
 
 
  - Create trust.img
 
 
 
    => cd /path/to/rkbin
 
    => ./tools/trust_merger RKTRUST/RK3399TRUST.ini
 
 
 
  - Create uboot.img
 
 
 
    => cd /path/to/rkbin
 
    => ./tools/loaderimage --pack --uboot /path/to/u-boot/u-boot-dtb.bin uboot.img
 
 
 
    (Get trust.img and uboot.img)
 
</pre>
 
 
 
==== Option 2: Package the image with SPL ====
 
<pre>
 
  - Export cross compiler path for aarch64
 
 
 
  - Compile ATF
 
 
 
=> git clone https://github.com/ARM-software/arm-trusted-firmware.git
 
=> cd arm-trusted-firmware
 
 
 
(export cross compiler path for Cortex-M0 MCU likely arm-none-eabi-)
 
=> make realclean
 
=> make CROSS_COMPILE=aarch64-linux-gnu- PLAT=rk3399
 
 
 
(export bl31.elf)
 
=> export BL31=/path/to/arm-trusted-firmware/build/rk3399/release/bl31/bl31.elf
 
 
 
  - Compile PMU M0 firmware
 
 
 
    This is optional for most of the rk3399 boards and required only for Puma board.
 
 
 
    => git clone git://git.theobroma-systems.com/rk3399-cortex-m0.git
 
    => cd rk3399-cortex-m0
 
 
 
    (export cross compiler path for Cortex-M0 PMU)
 
    => make CROSS_COMPILE=arm-cortex_m0-eabi-
 
 
 
    (export rk3399m0.bin)
 
    => export PMUM0=/path/to/rk3399-cortex-m0/rk3399m0.bin
 
 
 
  - Compile U-Boot
 
 
 
    => cd /path/to/u-boot
 
    => make orangepi-rk3399_defconfig
 
    => make
 
 
 
    (Get spl/u-boot-spl-dtb.bin, u-boot.itb images and some boards would get
 
      spl/u-boot-spl.bin since it doesn't enable CONFIG_SPL_OF_CONTROL
 
 
 
      If TPL enabled on the target, get tpl/u-boot-tpl-dtb.bin or tpl/u-boot-tpl.bin
 
      if CONFIG_TPL_OF_CONTROL not enabled)
 
</pre> Source: [https://gitlab.denx.de/u-boot/u-boot/-/blob/master/doc/README.rockchip README.rockchip]
 
 
 
=== Building ===
 
<pre>make all</pre>
 
  
== Linux Kernel ==
+
Details: [[Linux kernel on Orange Pi 4]]
{{Todo|THIS}}
 
  
== RootFS ==
+
=== rootfs ===
{{Todo|THIS}}
+
Details: [[Linux rootfs on Orange Pi 4]]
  
== Creating a Disk Image ==
+
== Installation ==
{{Todo|THIS}}
+
=== Creating a Disk Image ===
 +
Details: [[Linux disk image for Orange Pi 4]]
  
== Flashing an SD Card ==
+
=== Flashing an SD Card ===
 
See [[Flashing Linux to SD Card]].
 
See [[Flashing Linux to SD Card]].
  
 
== External Links ==
 
== External Links ==
 
* Compiling RK3399 BSP for the Puma board [https://www.theobroma-systems.com/rk3399-q7-user-manual/04-software.html]
 
* Compiling RK3399 BSP for the Puma board [https://www.theobroma-systems.com/rk3399-q7-user-manual/04-software.html]

Latest revision as of 10:54, 28 March 2020

Mainline Linux used on Orange Pi 4.

Overview

There are several components that need to be compiled and prepared from the ground up:

  1. U-Boot
  2. Linux kernel
  3. rootfs

The installation of these components consists of:

  1. Creating a Disk Image
  2. Flashing to SD Card

Compilation

U-Boot

Mainline repository: [1]

Details: U-Boot on Orange Pi 4

Linux kernel

Mainline repository: [2]

Details: Linux kernel on Orange Pi 4

rootfs

Details: Linux rootfs on Orange Pi 4

Installation

Creating a Disk Image

Details: Linux disk image for Orange Pi 4

Flashing an SD Card

See Flashing Linux to SD Card.

External Links

  • Compiling RK3399 BSP for the Puma board [3]