Difference between revisions of "Mainline Linux on Orange Pi 4"
Jump to navigation
Jump to search
| Line 11: | Line 11: | ||
== U-Boot == | == 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]] | ||
=== Setup === | === Setup === | ||
Revision as of 13:10, 24 March 2020
Mainline Linux used on Orange Pi 4.
Contents
Overview
There are several components that need to be compiled and prepared from the ground up:
- U-Boot
- Linux kernel
- rootfs
- Creating a Disk Image
- Flashing to SD Card
U-Boot
Mainline repository: [1]
Details: U-Boot on Orange Pi 4
Setup
git clone https://gitlab.denx.de/u-boot/u-boot.git cd u-boot make orangepi-rk3399_defconfig
Option 1: Package the image with Rockchip miniloader
- 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)
Option 2: Package the image with SPL
- 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)
Source: README.rockchip
Building
make all
Linux Kernel
TODO: THIS
RootFS
TODO: THIS
Creating a Disk Image
TODO: THIS
Flashing an SD Card
See Flashing Linux to SD Card.
External Links
- Compiling RK3399 BSP for the Puma board [2]