Difference between revisions of "U-Boot"

From PINE64
Jump to navigation Jump to search
Line 1: Line 1:
{{hint|This page is incomplete, you're welcome to improve it.}}
{{hint|This page is incomplete, you're welcome to improve it.}}
{{hint|It is helpful to have a debugging serial cable for this.}}
{{hint|It is helpful to have a debugging serial cable for this.}}
{{warning|1= This guide is written with the Pinephone in mind. On non-A64 based devices you will need to set a different platform variable.}}
{{hint| This guide is written with the Pinephone in mind. On non-A64 based devices you will need to set a different platform variable.}}
{{warning|1= This is purely U-boot build instructions at this time! You will not have crust for your Pinephone should you follow this guide.}}
{{warning|1= This is purely U-boot build instructions at this time! You will not have crust for your Pinephone should you follow this guide.}}



Revision as of 19:26, 16 October 2020

This page is incomplete, you're welcome to improve it.
It is helpful to have a debugging serial cable for this.
This guide is written with the Pinephone in mind. On non-A64 based devices you will need to set a different platform variable.
Warning: This is purely U-boot build instructions at this time! You will not have crust for your Pinephone should you follow this guide.

Building Uboot Manually

Prerequisites

These instructions are written with a host Arch Linux desktop system in mind.

You must have these packages installed: dtc swig bc aarch64-linux-gnu-gcc

If you are using a different system such as Ubuntu, there are plenty of cross compilation instructions available online with which you can grab the needed package names from, and then proceed to follow these instructions.

Compilation

First, You need to compile ATF (Arm Trusted Firmware):

 git clone https://github.com/crust-firmware/arm-trusted-firmware/
 cd arm-trusted-firmware
 CROSS_COMPILE=aarch64-linux-gnu-
 export CROSS_COMPILE
 export ARCH=arm64
 make PLAT=sun50i_a64 bl31
 cp build/sun50i_a64/release/bl31.bin ../u-boot/
 cd ..

After ATF is compiled clone u-boot and copy the bl31.bin file into the u-boot directly.

cd ..
git clone https://gitlab.com/pine64-org/u-boot.git
cd arm-trusted-firmware
cp build/sun50i_a64/release/bl31.bin ../u-boot/
cd ..

Note that you can append -j# to the end of make all in the proceeding instructions. Replacing the hashtag with the number of threads in your computer's CPU which you want to use for compiling, will make it go faster and use more of your processor.

 cd u-boot/
 git checkout crust
 CROSS_COMPILE=aarch64-linux-gnu-
 export CROSS_COMPILE
 export BL31=bl31.bin
 export ARCH=arm64
 make distclean
 make pinephone_defconfig
 make all

Uboot installation

Once successfully compiled you can proceed to flash the device

Warning: Replace [CHANGE THIS] with the location of your SD card

sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/[CHANGE THIS] bs=1024 seek=8

External Links

Sunxi Uboot Wiki