User:Rory/PINE64 QuartzPro64/Installing U-Boot

'''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
 * A micro-SDHC reader/writer for use with your Linux host

Notes on micro-SDHC card brand sensitivity
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. I have personally encountered this using SanDisk ultra 16GB cards; the problem manifests itself as timeout/busy messages for mmc1 when booting Linux:

[   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)

'''Recommended micro-SDHC cards are: Silicon Power that say "3D NAND" on the front ("Superior Pro" series) and Kingston Canvas Go! Plus cards. I personally have successfully used the Kingston Canvas Go! Plus cards.'''

Pre-made image availability
For convenience, or if you do not want to build your own U-Boot, I have uploaded two images 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

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 I recommend and 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:

make mrproper ./make.sh rk3588

Install instructions
First you must partition your micro-SDHC card. Note that the following example defines a rather large EFI partition, this is where the Linux kernel will reside; I like to have space for several kernels so that I may easily switch between them while developing, also it is very handy to have a recovery kernel... just in case.

Note that for the last partition I use the remainder of the device; feel free to alter for your environment.

parted -s /dev/sdX mklabel gpt parted -s /dev/sdX mkpart loader 64s 8MiB parted -s /dev/sdX mkpart uboot 8MiB 16MiB parted -s /dev/sdX mkpart env 16MiB 32MiB parted -s /dev/sdX mkpart efi fat32 32MiB 1GiB parted -s /dev/sdX set 4 boot on 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...

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