Bootloader
This page describes layout of bootloader and auxiliary data. It is usually a file called fastboot.bin
in upgrade packages.
S5 series
For 32-bit S5 series, if Secure Boot is not enabled, fastboot.bin
contains only the bootloader (plain U-Boot), i.e. the first word must be a valid instruction.
If Secure Boot is enabled, fastboot.bin
will be read after MBR (offset 0x200
) from eMMC, and the following structure applies to fastboot.bin
.
Area |
Offset |
Name |
Size |
Description |
Possible value |
---|---|---|---|---|---|
Key Area |
|
|
|
External RSA Public Key |
|
|
RSA modulus |
|
|
||
|
|
|
Market Segment ID, must be same as |
|
|
|
Area Signature |
|
Signed by |
||
Param Area |
|
|
|
CA Config offset in Param Area |
|
|
|
|
Unckecked Area length |
|
|
|
|
|
(Boot Area - Signature) length |
||
|
|
Signature offset? |
|
||
|
|
|
(Unckecked Area + Boot Area) length |
||
|
|
flag |
|||
|
CA Config |
? |
|
||
|
Area Signature |
|
Signed by |
||
Unckecked Area |
|
|
Free for bootloader to use |
||
Boot Area |
|
Bootloader |
|
Vendor bootloader |
|
|
Version ID |
|
Field defined by vendor bootloader |
|
|
|
|
|
Field defined and enforced by vendor bootloader |
|
|
aligned to |
Area Signature |
|
Signed by |
This means you will need different offset when writing fastboot.bin
.
# if SB not enabled
dd if=/mnt/fastboot.bin of=/dev/mmcblk0p1
# if SB enabled
dd if=/mnt/fastboot.bin of=/dev/mmcblk0p1 bs=512 skip=1
You can use ca_getsecbootstatus
in vendor Fastboot to check Secure Boot status.
S40 series
A new layout is introduced on 64-bit S40 series, so same fastboot.bin
could fit into both SB or non-SB environment.
While this means all SB-related fields could be reused if no Secure Boot is enforced, please notice S40 requires AUXIMAGE
for proper initialization, thus layout is not complete free to change.
Area |
Offset |
Name |
Size |
Description |
Possible value |
---|---|---|---|---|---|
HSL Area |
|
|
|
|
|
Key Area |
|
Unused jump instruction |
|
Jump to |
|
|
|
|
External RSA Public Key |
||
|
RSA modulus |
|
|||
… |
|||||
|
Area Signature |
|
Signed by |
||
Param Area |
… |
||||
|
Area Signature |
|
Signed by |
||
Unckecked Hisi Area |
|
|
|
SCS simulation flag |
|
|
|
|
Boot flag |
|
|
|
|
|
Auxiliary Code encrypt flag |
|
|
|
|
|
|
||
|
|
|
Param start offset |
||
|
|
|
Param item length |
|
|
|
|
|
Boot store address |
|
|
Auxiliary Code Area |
|
|
|
|
|
ACPU Start Code Area |
aligned to |
|
|
|
|
Unckecked Area |
aligned to |
|
Free for bootloader to use |
||
Boot Area |
aligned to |
Bootloader |
|
Vendor bootloader |
|
aligned to |
Area Signature |
|
Signed by |
||
Reg list [3] |
aligned to |
|
|
||
… |
… |
|
|||
aligned to |
|
|
Area |
Offset |
Name |
Size |
Description |
Possible value |
---|---|---|---|---|---|
Key Area |
|
|
|
|
|
|
|
|
Auxiliary Code length |
|
|
|
|
|
Boot entry address |
||
Param Area |
|
|
|
Unckecked Area length |
|
|
|
|
Bootloader length |
||
|
|
|
(Unckecked Area + Boot Area) length |
||
|
|
|
|
Area |
Offset |
Name |
Size |
Description |
Possible value |
---|---|---|---|---|---|
Key Area |
|
|
|
|
|
|
|
|
Auxiliary Code length |
|
|
|
|
|
ACPU Start Code length |
|
|
|
|
|
Flash protection key |
|
|
|
|
|
Flash protection key |
|
|
|
|
|
Flash protection key |
|
|
|
|
|
Auxiliary Code key |
||
Param Area |
|
|
|
Unckecked Area length |
|
|
|
|
Bootloader length |
||
|
|
|
(Unckecked Area + Boot Area) length |
||
|
|
|
Boot flag |
|
|
|
|
|
|
# no matter the status of SB
dd if=/mnt/fastboot.bin of=/dev/mmcblk0p1