Commit 5df202a4 authored by Umair Jameel Hashim's avatar Umair Jameel Hashim
Browse files

Update README.md

parent a245f338
......@@ -11,42 +11,137 @@ There are three Evaluation Platforms being used as platform for the verification
| Lenovo Leez | Leez-P710.xml | Leez-p710 |
| Pine 64 | RockPro64.xml | RockPro 64 |
```
Note: The guide below has been extensively tested with the TB_RK3399ProD but is expected
to work with all of the above platforms.
```
## 1. Prepare Host machine
The following package installations and steps are required to be completed to build and install the firmware binaries.
```
sudo apt-get install -y cmake python3 python-is-python3 git gnupg bison flex
sudo apt-get install -y libssl-dev device-tree-compiler
# Configure git with your details
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
# Install repo
# Option 1 - package manager
sudo apt-get install repo
## Option 2 - manual download
## curl https://storage.googleapis.com/git-repo-downloads/repo > /opt/repo
## chmod +x /opt/repo
## export PATH=$PATH:/opt
```
## 2. Clone the repositories
```
mkdir <New_Dir>
cd <New_Dir>
repo init -u https://gitlab.arm.com/systemready/firmware-build/rk3399-manifest -m TB-RK3399proD.xml
repo sync -j4 --no-clone-bundle
```
## 3. Get the Toolchains
If you dont have an aarch64-linux-gnu cross compiler already installed on your host machine, there are 2 ways of suppling the toolkits required to build the firmware and u-boot binaries.
* Option 1: Package install the cross-compilers on the host machine OS.
* Option 2: Use the toolchain installer thats provided by the makefile
## 1. Install repo
Follow the instructions under the "Installing Repo" section
[here](https://source.android.com/source/downloading.html).
### Option 1: PREFERRED
## 2. Get the source code
```
$ mkdir <New_Dir>
$ cd <New_Dir>
$ repo init -u https://gitlab.arm.com/systemready/firmware-build/rk3399-manifest -m ${TARGET}.xml [-b ${BRANCH}]
$ repo sync -j4 --no-clone-bundle
sudo apt-get install gcc-aarch64-linux-gnu arm-none-eabi-gcc
which aarch64-linux-gnu-gcc
```
Copy the path reported by the above command (excluding the tailing `bin/aarch64-linux-gnu-gcc`) and paste it after the command below:
## 3. Get the Aarch64 toolchain (optional)
```
$ cd <New_Dir>/build/
$ make -j2 toolchains
export AARCH64_PATH=
```
For example:
## 4. Build the target
```
$ make -j `nproc`
$ which aarch64-linux-gnu-gcc
/usr/bin/aarch64-linux-gnu-gcc
$ export AARCH64_PATH=/usr
$ echo $AARCH64_PATH
/usr
```
## 5.Target Image Flashing Procedure
### Option 2: ALTERNATIVE (skip this if using option 1)
```
cd build/
make -j2 toolchains
```
The sequence will sync the atf(bl31), uboot(uboot.itb) to the local repo and
make the images for the selected target. Image flashing can be carried out
manually using the rktool, or the `make flash` target will use rkdeveloptool to
copy the images to a board in BOOTROM mode.
## 4. Build u-boot binaries for target
```
cd build/
make -j `nproc`
```
Amongst other things the above command will generate the following files of interest in the `../out/bin/u-boot/` directory:
```
Install Android Tool v2.71
Address Name Path :
0x0000 Miniloader — ../miniloader.bin
0x0000 GPT Partition Table — ../paramter_toybrick.txt
0x0040 loader1 — ../idbloader.img
0x4000 loader2 — ../uboot.itb
u-boot.itb
idbloader.img
```
Check the above by running:
```
ls -ltr ../out/bin/u-boot/
```
## 5. Building the FW binaries
```
cd ../rkbin
./tools/boot_merger ./RKBOOT/RK3399PROMINIALL.ini
```
The above command will generate the miniloader file: eg. `rk3399pro_loader_v1.25.126.bin`
## 6. Flashing the FW binaries and U-Boot
### 6-a: Preparing the host-machine
To succesgfully detect and flash the board the following packages are required to be installed on the host machine
```
sudo apt-get install pkg-config libudev-dev libusb-1.0-0-dev libusb-1.0
```
### 6-b: Put the board in MaskROM mode
1. Power-off the board
2. Keep the Maskrom button pressed for 10 seconds
3. Power on the board (either by long-pressing the power button OR plugging in the Power connector)
4. Release maskrom button after 5 seconds
5. The device should now be in Maskrom mode ready for flashing
6. Check if the board has entered MaskROM mode:
```
# Check if the following device is detected:
# Fuzhou Rockchip Electronics Company RK3399 in Mask ROM mode
lsusb
```
### 6-c: Writing the binaries to device
```
sudo ./tools/rkdeveloptool db rk3399pro_loader_v1.25.126.bin && sleep 2
sudo ./tools/rkdeveloptool wl 0x40 ../out/bin/u-boot/idbloader.img && sleep 2
sudo ./tools/rkdeveloptool wl 0x4000 ../out/bin/u-boot/u-boot.itb && sleep 2
sudo ./tools/rkdeveloptool rd
```
The TB_RK3399ProD board should restart and boot into u-boot
If you have a bootable storage device with LINUX installed connected to USB or installed in MMCslot the board should start booting the linux kernel.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment