User:Rory/PINE64 QuartzPro64/Installing U-Boot

From Gentoo Wiki
Jump to:navigation Jump to:search
Note
U-Boot may be installed on either the eMMC device or a micro-SDHC card, however it is HIGHLY ADVISED to use a micro-SDHC card until you are absolutely sure that you have a working configuration. The eMMC device is soldered on the board, and the recovery process using the rkdeveloptool will not be covered in this page if you make a mistake. The process to use the eMMC is the same as using micro-SDHC once you have a system booting from the micro-SDHC with the exception of the device name.

What you will need

  • A micro-SDHC card, capacity of at least 4GB is recommended.
  • A micro-SDHC reader/writer for use with your Linux host

Notes on micro-SDHC card brand sensitivity

Warning
There are currently compatibility issues with certain micro-SDHC card brands/models. This is thought to be due to either incorrect voltage regulator settings or reset timing in the handoff between U-Boot and the Linux kernel. SanDisk ultra 16GB cards have exhibited this behavior; the problem manifests itself as timeout/busy messages for mmc1 when booting Linux:
root #dmesg
...
[    3.772758] mmc_host mmc1: Timeout sending command (cmd 0x202000 arg 0x0 status 0x80202000)
[    3.810511] mmc1: error -110 whilst initialising SD card
[    4.310983] dwmmc_rockchip fe2c0000.mmc: Busy; trying anyway
[    4.811481] mmc_host mmc1: Timeout sending command (cmd 0x202000 arg 0x0 status 0x80202000)
[    4.825983] mmc_host mmc1: Bus speed (slot 0) = 300000Hz (slot req 300000Hz, actual 300000HZ div = 0)
[    5.349543] dwmmc_rockchip fe2c0000.mmc: Busy; trying anyway
[    5.850045] mmc_host mmc1: Timeout sending command (cmd 0x202000 arg 0x0 status 0x80202000)
[    5.864729] mmc_host mmc1: Bus speed (slot 0) = 200000Hz (slot req 200000Hz, actual 200000HZ div = 0)
[    6.390953] dwmmc_rockchip fe2c0000.mmc: Busy; trying anyway
[    6.891457] mmc_host mmc1: Timeout sending command (cmd 0x202000 arg 0x0 status 0x80202000)
...


Tip
Recommended micro-SDHC cards are: Silicon Power that say "3D NAND" on the front ("Superior Pro" series) and Kingston Canvas Go! Plus cards. Kingston Canvas Go! Plus cards have been proven to work

Pre-made image availability

For convenience, or if you do not want to build your own U-Boot, there are two pre-built images available that may be copied to a micro-SDHC card of at least 4GB capacity. The two images contain the boot loader, U-Boot, an EFI partition with a Linux kernel, and a root partition with the Gentoo stage3 environment. The difference in the two images is whether you want a little endian (most common) or big endian environment. The images may be downloaded from:

https://drive.google.com/drive/u/1/folders/1hPSGv482IAx_Co0X_1stnLlOjWWJgqLZ

qp64be.flash.image.gz <= big endian environment

qp64.flash.image.gz <= little endian environment (What you probably want)

Once you have downloaded and uncompressed either of these images you may use dd or any other tool you like to copy the image to your micro-SDHC card

root #dd if=./qp64.flash.image of=/dev/sdX

U-Boot repository for RK3588

Until official support is established for the RK3588 and the QuartzPro64 development board, Pine64 suggests using CounterPillow's U-Boot repository:

https://github.com/CounterPillow/uboot-qp64

However it is recommended to use Neggles' repository which contains several bug fixes:

https://github.com/neggles/u-boot-quartz64/tree/rk3588

Build instructions

Once you have cloned or downloaded the source, cd into the source directory and enter the following commands:

user $make mrproper
user $./make.sh rk3588

Install instructions

First you must partition your micro-SDHC card. The following example defines a rather large EFI partition, this is where the Linux kernel will reside.

Tip
A large EFI partition provides space for several kernels so that you may easily switch between them while developing, also it is very handy to have a recovery kernel... just in case.
Note
The last partition is typically the remainder of the device; feel free to alter for your environment.
root #parted -s /dev/sdX mklabel gpt
root #parted -s /dev/sdX mkpart loader 64s 8MiB
root #parted -s /dev/sdX mkpart uboot 8MiB 16MiB
root #parted -s /dev/sdX mkpart env 16MiB 32MiB
root #parted -s /dev/sdX mkpart efi fat32 32MiB 1GiB
root #parted -s /dev/sdX set 4 boot on
root #parted -s /dev/sdX mkpart root ext4 1GiB XXXXGiB

Finally, you must copy the boot loader and U-Boot image that you built into the first two partitions you just created...

root #dd if=./rk3588_spl_loader_v1.08.111.bin of=/dev/sdX1
root #dd if=./uboot.img of=/dev/sdX2