U-Boot

Introduction

RK U-Boot is developed based on open-source U-Boot, with boot mode and download mode. Boot mode is the normal working mode of U-Boot. U-Boot usually works in this mode. It is mainly used to load the kernel into memory and start up system. Download mode is mainly used to download firmware to flash. Long press recovery button to enter the download mode while boot up. The following describes the use of U-Boot. You can read U-Boot development document in Android SDK’s /RKDocs/common/u-boot/` for more details.

Compile

The compiling steps of U-Boot are similar to kernel compiling. Before compiling, you need to write the configuration to .config, run the command:

  • Android:

make rk3399_box_defconfig
  • Linux:

make rk3399_linux_defconfig

If you need to modify the relative option, you can run:

make menuconfig

Run below command to compile:

make ARCH=aarch64

After compiling successfully, there will be a new file created at the follow path:

u-boot/uboot.img
u-boot/trust.img
u-boot/rk3399_loader_vx.xx.xxx.bin

Flash Image

Open the upgrade tool, connect the board with the USB OTG cable, press the Recovery key when the power is on, and make the development board enter the U-Boot download mode. Select the compiled Loader file in the upgrade tool and click execute, as shown below:

_images/uboot_download.jpg

Verify that the new Loader is correctly upgraded

If you flash the loader successfully, there will be some information output from the debug UART as the follow log shows:

#Boot ver: 2019-05-08#1.09

If the time shows the same as your compile time, it means you flash the loader successfully.

Enter u-boot command line mode

Since Firefly product is mainly used for development, we set the 1 second countdown time when starting up by default. At this time, if any key is input in the serial port, it can enter the u-boot command line mode. The product released does not need to enter the U-Boot command line mode. If U-Boot is not required to enter the command line mode by default, the following modifications can be made in the file: u-boot/include/configs/rk33plat.h:

/* mod it to enable console commands.  */
#define CONFIG_BOOTDELAY               0

If the macro CONFIG_BOOTDELAY is changed to 0, it will not enter command line mode by default.