Custom bootloader and Boot ROM


#1

Hello,

  1. Is it possible to flash the existing bootloader in Hikey960 board and put a custom bootloader based on little kernel? If yes where can I find the procedure document?

  2. Is it possible to flash the existing Boot ROM in Hikey960 board and put a custom Boot ROM? If yes where can I find the procedure document and Boot ROM source code?

This is entirely for a research purpose related to Trusted Programming.

Thanks & Regards,
Dhiman Chakraborty


#2

Pretty much… there are instructions on how to build and install ARM trusted firmware and UEFI:

This gives you strong control over the machine (i.e. you are running open source code at EL3) although IIRC I think the code in sec_xloader.img will still be run before we enter ARM TF.

I don’t think so. Boot ROM on phone parts are usually mask programmed.


#3

Thank you. The links are helpful.


#4

Where can we find the non-customized bootloader files to bring the board in a standard configuration?


#5

Sorry, not clear what you mean here. Most bootloaders are intrinsically customized to boot the platform they are bootloading (ok… maybe not loaders like grub but the bootloader that loads grub definitely is customized).


#6

I would like to download the bootloader files and flash the hikey 960 without going through the pain of building the files myself. Let’s assume the instructions are not clear enough and I end up with a broken system, how can I go back to a standard installation?


#7

Some suggestions:

In step 1 replace the links with git clone commands:
git clone https://github.com/ARM-software/arm-trusted-firmware.git -b integration
git clone https://github.com/96boards-hikey/edk2.git -b testing/hikey960_v2.5
git clone https://github.com/96boards-hikey/OpenPlatformPkg.git -b testing/hikey960_v1.3.4
git clone https://github.com/96boards-hikey/l-loader.git -b testing/hikey960_v1.2
git clone https://git.linaro.org/uefi/uefi-tools.git
git clone https://github.com/96boards-hikey/atf-fastboot.git

In step 4.
Clarify the line “Fetch that are used in recovery mode. The code location is in below. link” and replace the link with:
git clone https://github.com/96boards-hikey/tools-images-hikey960

Instead of removing the modemmanager package you can do:
systemctl stop ModemManager.service

In general, remove the $ sign in front of the commands
e.g. $sudo fastboot flash xloader sec_xloader.img


#8

how can I go back to a standard installation?

https://github.com/96boards-hikey/tools-images-hikey960/blob/master/README-technical.md#rescue-using-hisi_idt.

Some suggestions:

Please send pull request to https://github.com/96boards-hikey/tools-images-hikey960.


#9

The rescue steps are very error prone, could you please double check them?

e.g. step 3)
Some commands require ‘sudo’ otherwise the process get’s stuck e.g.

tools-images-hikey960$ fastboot flash ptable ${IMG_FOLDER}/ptable.img
< waiting for device >

Please use braces: { and } , otherwise the commands don’t work
${IMG_FOLDER} instead of $(IMG_FOLDER)

Step 1 is redundant.


#10

It might be easier if you use the scripts in either
https://github.com/96boards-hikey/tools-images-hikey960/blob/master/recovery-flash.sh.
or
https://android.googlesource.com/device/linaro/hikey/+/master/installer/hikey960/flash-all.sh.