2021-10-17 10:44:32 +00:00
|
|
|
.. SPDX-License-Identifier: GPL-2.0+
|
|
|
|
.. sectionauthor:: Dzmitry Sankouski <dsankouski@gmail.com>
|
|
|
|
|
|
|
|
Snapdragon 845
|
|
|
|
================
|
|
|
|
|
|
|
|
About this
|
|
|
|
----------
|
|
|
|
This document describes the information about Qualcomm Snapdragon 845
|
|
|
|
supported boards and it's usage steps.
|
|
|
|
|
|
|
|
SDM845 - hi-end qualcomm chip, introduced in late 2017.
|
|
|
|
Mostly used in flagship phones and tablets of 2018.
|
|
|
|
|
|
|
|
U-Boot can be used as a replacement for Qualcomm's original ABL (UEFI) bootloader.
|
|
|
|
It is loaded as an Android boot image through ABL
|
|
|
|
|
|
|
|
Installation
|
|
|
|
------------
|
board: starqltechn: get board usable - add bootcmd and docs
U-boot is intended to replace linux kernel in android boot image(ABL), and
it's FIT payload to replace initramfs file. The boot process is similar to
boot image with linux:
- android bootloader (ABL) unpacks android boot image
- ABL sets `linux,initrd-start property` in chosen node in unpacked FDT
- ABL sets x0 register to FDT address, and passes control to u-boot
- u-boot reads x0 register, and stores it in `prevbl_fdt_addr` env variable
- u-boot reads `linux,initrd-start` property,
and stores it in `prevbl_initrd_start_addr`
In this way, u-boot bootcmd relies on `prevbl_initrd_start_addr` env
variable, and boils down to `bootm $prevbl_initrd_start_addr`.
If more control on boot process is desired, pack a boot script in
FIT image, and put it to default configuration
What done:
- strip unneeded config options
- add FIT image support
- add framebuffer node, u-boot logo and video console
- increase LMB_MAX_REGIONS, to store all linux dtb reserved memory regions
- add linux kernel image header
Uart driver causes hang, when u-boot is used in android boot image instead
of linux. Temporary disable console driver, until investigated and fixed.
Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2022-02-22 18:49:53 +00:00
|
|
|
Build
|
|
|
|
^^^^^
|
|
|
|
Setup ``CROSS_COMPILE`` for aarch64 and build U-Boot for your board::
|
2021-10-17 10:44:32 +00:00
|
|
|
|
|
|
|
$ export CROSS_COMPILE=<aarch64 toolchain prefix>
|
|
|
|
$ make <your board name here, see Boards section>_defconfig
|
|
|
|
$ make
|
|
|
|
|
|
|
|
This will build ``u-boot.bin`` in the configured output directory.
|
|
|
|
|
board: starqltechn: get board usable - add bootcmd and docs
U-boot is intended to replace linux kernel in android boot image(ABL), and
it's FIT payload to replace initramfs file. The boot process is similar to
boot image with linux:
- android bootloader (ABL) unpacks android boot image
- ABL sets `linux,initrd-start property` in chosen node in unpacked FDT
- ABL sets x0 register to FDT address, and passes control to u-boot
- u-boot reads x0 register, and stores it in `prevbl_fdt_addr` env variable
- u-boot reads `linux,initrd-start` property,
and stores it in `prevbl_initrd_start_addr`
In this way, u-boot bootcmd relies on `prevbl_initrd_start_addr` env
variable, and boils down to `bootm $prevbl_initrd_start_addr`.
If more control on boot process is desired, pack a boot script in
FIT image, and put it to default configuration
What done:
- strip unneeded config options
- add FIT image support
- add framebuffer node, u-boot logo and video console
- increase LMB_MAX_REGIONS, to store all linux dtb reserved memory regions
- add linux kernel image header
Uart driver causes hang, when u-boot is used in android boot image instead
of linux. Temporary disable console driver, until investigated and fixed.
Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2022-02-22 18:49:53 +00:00
|
|
|
Generate FIT image
|
|
|
|
^^^^^^^^^^^^^^^^^^
|
|
|
|
See doc/uImage.FIT for more details
|
|
|
|
|
|
|
|
Pack android boot image
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
We'll assemble android boot image with ``u-boot.bin`` instead of linux kernel,
|
|
|
|
and FIT image instead of ``initramfs``. Android bootloader expect gzipped kernel
|
2022-07-12 07:12:08 +00:00
|
|
|
with appended dtb, so let's mimic linux to satisfy stock bootloader.
|
board: starqltechn: get board usable - add bootcmd and docs
U-boot is intended to replace linux kernel in android boot image(ABL), and
it's FIT payload to replace initramfs file. The boot process is similar to
boot image with linux:
- android bootloader (ABL) unpacks android boot image
- ABL sets `linux,initrd-start property` in chosen node in unpacked FDT
- ABL sets x0 register to FDT address, and passes control to u-boot
- u-boot reads x0 register, and stores it in `prevbl_fdt_addr` env variable
- u-boot reads `linux,initrd-start` property,
and stores it in `prevbl_initrd_start_addr`
In this way, u-boot bootcmd relies on `prevbl_initrd_start_addr` env
variable, and boils down to `bootm $prevbl_initrd_start_addr`.
If more control on boot process is desired, pack a boot script in
FIT image, and put it to default configuration
What done:
- strip unneeded config options
- add FIT image support
- add framebuffer node, u-boot logo and video console
- increase LMB_MAX_REGIONS, to store all linux dtb reserved memory regions
- add linux kernel image header
Uart driver causes hang, when u-boot is used in android boot image instead
of linux. Temporary disable console driver, until investigated and fixed.
Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2022-02-22 18:49:53 +00:00
|
|
|
|
2022-07-12 07:12:08 +00:00
|
|
|
Boards
|
|
|
|
------------
|
|
|
|
starqlte
|
|
|
|
^^^^^^^^^^^^
|
|
|
|
|
|
|
|
The starqltechn is a production board for Samsung S9 (SM-G9600) phone,
|
|
|
|
based on the Qualcomm SDM845 SoC.
|
|
|
|
|
|
|
|
Steps:
|
|
|
|
|
|
|
|
- Build u-boot::
|
|
|
|
|
|
|
|
$ export CROSS_COMPILE=<aarch64 toolchain prefix>
|
|
|
|
$ make starqltechn_defconfig
|
|
|
|
$ make
|
|
|
|
|
|
|
|
- Create dump dtb::
|
board: starqltechn: get board usable - add bootcmd and docs
U-boot is intended to replace linux kernel in android boot image(ABL), and
it's FIT payload to replace initramfs file. The boot process is similar to
boot image with linux:
- android bootloader (ABL) unpacks android boot image
- ABL sets `linux,initrd-start property` in chosen node in unpacked FDT
- ABL sets x0 register to FDT address, and passes control to u-boot
- u-boot reads x0 register, and stores it in `prevbl_fdt_addr` env variable
- u-boot reads `linux,initrd-start` property,
and stores it in `prevbl_initrd_start_addr`
In this way, u-boot bootcmd relies on `prevbl_initrd_start_addr` env
variable, and boils down to `bootm $prevbl_initrd_start_addr`.
If more control on boot process is desired, pack a boot script in
FIT image, and put it to default configuration
What done:
- strip unneeded config options
- add FIT image support
- add framebuffer node, u-boot logo and video console
- increase LMB_MAX_REGIONS, to store all linux dtb reserved memory regions
- add linux kernel image header
Uart driver causes hang, when u-boot is used in android boot image instead
of linux. Temporary disable console driver, until investigated and fixed.
Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2022-02-22 18:49:53 +00:00
|
|
|
|
|
|
|
workdir=/tmp/prepare_payload
|
|
|
|
mkdir -p "$workdir"
|
|
|
|
cd "$workdir"
|
|
|
|
mock_dtb="$workdir"/payload_mock.dtb
|
|
|
|
|
|
|
|
dtc -I dts -O dtb -o "$mock_dtb" << EOF
|
|
|
|
/dts-v1/;
|
|
|
|
/ {
|
|
|
|
memory {
|
|
|
|
/* We expect the bootloader to fill in the size */
|
|
|
|
reg = <0 0 0 0>;
|
|
|
|
};
|
|
|
|
|
|
|
|
chosen { };
|
|
|
|
};
|
|
|
|
EOF
|
|
|
|
|
2022-07-12 07:12:08 +00:00
|
|
|
- gzip u-boot::
|
|
|
|
|
|
|
|
gzip u-boot.bin
|
board: starqltechn: get board usable - add bootcmd and docs
U-boot is intended to replace linux kernel in android boot image(ABL), and
it's FIT payload to replace initramfs file. The boot process is similar to
boot image with linux:
- android bootloader (ABL) unpacks android boot image
- ABL sets `linux,initrd-start property` in chosen node in unpacked FDT
- ABL sets x0 register to FDT address, and passes control to u-boot
- u-boot reads x0 register, and stores it in `prevbl_fdt_addr` env variable
- u-boot reads `linux,initrd-start` property,
and stores it in `prevbl_initrd_start_addr`
In this way, u-boot bootcmd relies on `prevbl_initrd_start_addr` env
variable, and boils down to `bootm $prevbl_initrd_start_addr`.
If more control on boot process is desired, pack a boot script in
FIT image, and put it to default configuration
What done:
- strip unneeded config options
- add FIT image support
- add framebuffer node, u-boot logo and video console
- increase LMB_MAX_REGIONS, to store all linux dtb reserved memory regions
- add linux kernel image header
Uart driver causes hang, when u-boot is used in android boot image instead
of linux. Temporary disable console driver, until investigated and fixed.
Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2022-02-22 18:49:53 +00:00
|
|
|
|
2022-07-12 07:12:08 +00:00
|
|
|
- Append dtb to gzipped u-boot::
|
|
|
|
|
|
|
|
cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb
|
|
|
|
|
|
|
|
- Now we've got everything to build android boot image::
|
board: starqltechn: get board usable - add bootcmd and docs
U-boot is intended to replace linux kernel in android boot image(ABL), and
it's FIT payload to replace initramfs file. The boot process is similar to
boot image with linux:
- android bootloader (ABL) unpacks android boot image
- ABL sets `linux,initrd-start property` in chosen node in unpacked FDT
- ABL sets x0 register to FDT address, and passes control to u-boot
- u-boot reads x0 register, and stores it in `prevbl_fdt_addr` env variable
- u-boot reads `linux,initrd-start` property,
and stores it in `prevbl_initrd_start_addr`
In this way, u-boot bootcmd relies on `prevbl_initrd_start_addr` env
variable, and boils down to `bootm $prevbl_initrd_start_addr`.
If more control on boot process is desired, pack a boot script in
FIT image, and put it to default configuration
What done:
- strip unneeded config options
- add FIT image support
- add framebuffer node, u-boot logo and video console
- increase LMB_MAX_REGIONS, to store all linux dtb reserved memory regions
- add linux kernel image header
Uart driver causes hang, when u-boot is used in android boot image instead
of linux. Temporary disable console driver, until investigated and fixed.
Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2022-02-22 18:49:53 +00:00
|
|
|
|
|
|
|
mkbootimg --base 0x0 --kernel_offset 0x00008000 \
|
|
|
|
--ramdisk_offset 0x02000000 --tags_offset 0x01e00000 \
|
|
|
|
--pagesize 4096 --second_offset 0x00f00000 \
|
|
|
|
--ramdisk "$fit_image" \
|
|
|
|
--kernel u-boot.bin.gz-dtb \
|
|
|
|
-o boot.img
|
|
|
|
|
2022-07-12 07:12:08 +00:00
|
|
|
- Flash image with your phone's flashing method.
|
board: starqltechn: get board usable - add bootcmd and docs
U-boot is intended to replace linux kernel in android boot image(ABL), and
it's FIT payload to replace initramfs file. The boot process is similar to
boot image with linux:
- android bootloader (ABL) unpacks android boot image
- ABL sets `linux,initrd-start property` in chosen node in unpacked FDT
- ABL sets x0 register to FDT address, and passes control to u-boot
- u-boot reads x0 register, and stores it in `prevbl_fdt_addr` env variable
- u-boot reads `linux,initrd-start` property,
and stores it in `prevbl_initrd_start_addr`
In this way, u-boot bootcmd relies on `prevbl_initrd_start_addr` env
variable, and boils down to `bootm $prevbl_initrd_start_addr`.
If more control on boot process is desired, pack a boot script in
FIT image, and put it to default configuration
What done:
- strip unneeded config options
- add FIT image support
- add framebuffer node, u-boot logo and video console
- increase LMB_MAX_REGIONS, to store all linux dtb reserved memory regions
- add linux kernel image header
Uart driver causes hang, when u-boot is used in android boot image instead
of linux. Temporary disable console driver, until investigated and fixed.
Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Cc: Ramon Fried <rfried.dev@gmail.com>
2022-02-22 18:49:53 +00:00
|
|
|
|
2022-07-12 07:12:08 +00:00
|
|
|
More information can be found on the `Samsung S9 page`_.
|
2021-10-17 10:44:32 +00:00
|
|
|
|
2022-07-12 07:12:08 +00:00
|
|
|
dragonboard845c
|
|
|
|
^^^^^^^^^^^^^^^
|
2021-10-17 10:44:32 +00:00
|
|
|
|
2022-07-12 07:12:08 +00:00
|
|
|
The dragonboard845c is a Qualcomm Robotics RB3 Development Platform, based on
|
|
|
|
the Qualcomm SDM845 SoC.
|
|
|
|
|
|
|
|
Steps:
|
|
|
|
|
|
|
|
- Build u-boot::
|
|
|
|
|
|
|
|
$ export CROSS_COMPILE=<aarch64 toolchain prefix>
|
|
|
|
$ make dragonboard845c_defconfig
|
|
|
|
$ make
|
|
|
|
|
|
|
|
- Create dummy dtb::
|
|
|
|
|
|
|
|
workdir=/tmp/prepare_payload
|
|
|
|
mkdir -p "$workdir"
|
|
|
|
mock_dtb="$workdir"/payload_mock.dtb
|
|
|
|
|
|
|
|
dtc -I dts -O dtb -o "$mock_dtb" << EOF
|
|
|
|
/dts-v1/;
|
|
|
|
/ {
|
|
|
|
#address-cells = <2>;
|
|
|
|
#size-cells = <2>;
|
|
|
|
|
|
|
|
memory@80000000 {
|
|
|
|
device_type = "memory";
|
|
|
|
/* We expect the bootloader to fill in the size */
|
|
|
|
reg = <0 0x80000000 0 0>;
|
|
|
|
};
|
|
|
|
|
|
|
|
chosen { };
|
|
|
|
};
|
|
|
|
EOF
|
|
|
|
|
|
|
|
- gzip u-boot::
|
|
|
|
|
|
|
|
gzip u-boot.bin
|
|
|
|
|
|
|
|
- Append dtb to gzipped u-boot::
|
|
|
|
|
|
|
|
cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb
|
|
|
|
|
|
|
|
- A ``db845c.its`` file can be found in ``board/qualcomm/dragonboard845c/``
|
|
|
|
directory. It expects a folder as ``db845c_imgs/`` in the main directory
|
|
|
|
containing pre-built kernel, dts and ramdisk images. See ``db845c.its``
|
|
|
|
for full path to images::
|
|
|
|
|
|
|
|
mkimage -f db845c.its db845c.itb
|
|
|
|
|
|
|
|
- Now we've got everything to build android boot image::
|
|
|
|
|
|
|
|
mkbootimg --kernel u-boot.bin.gz-dtb --ramdisk db845c.itb \
|
|
|
|
--output boot.img --pagesize 4096 --base 0x80000000
|
|
|
|
|
|
|
|
- Flash boot.img using db845c fastboot method.
|
|
|
|
|
|
|
|
More information can be found on the `DragonBoard 845c page`_.
|
2021-10-17 10:44:32 +00:00
|
|
|
|
|
|
|
.. _Samsung S9 page: https://en.wikipedia.org/wiki/Samsung_Galaxy_S9
|
2022-07-12 07:12:08 +00:00
|
|
|
.. _DragonBoard 845c page: https://www.96boards.org/product/rb3-platform/
|