blob: b6642c957909c52845b4514fd875007035829b77 [file] [log] [blame]
Dzmitry Sankouski4e6df402021-10-17 13:44:32 +03001.. SPDX-License-Identifier: GPL-2.0+
2.. sectionauthor:: Dzmitry Sankouski <dsankouski@gmail.com>
3
4Snapdragon 845
5================
6
7About this
8----------
9This document describes the information about Qualcomm Snapdragon 845
10supported boards and it's usage steps.
11
12SDM845 - hi-end qualcomm chip, introduced in late 2017.
13Mostly used in flagship phones and tablets of 2018.
14
15U-Boot can be used as a replacement for Qualcomm's original ABL (UEFI) bootloader.
16It is loaded as an Android boot image through ABL
17
18Installation
19------------
Dzmitry Sankouski8e3bdd52022-02-22 21:49:53 +030020Build
21^^^^^
22Setup ``CROSS_COMPILE`` for aarch64 and build U-Boot for your board::
Dzmitry Sankouski4e6df402021-10-17 13:44:32 +030023
24 $ export CROSS_COMPILE=<aarch64 toolchain prefix>
25 $ make <your board name here, see Boards section>_defconfig
26 $ make
27
28This will build ``u-boot.bin`` in the configured output directory.
29
Dzmitry Sankouski8e3bdd52022-02-22 21:49:53 +030030Generate FIT image
31^^^^^^^^^^^^^^^^^^
32See doc/uImage.FIT for more details
33
34Pack android boot image
35^^^^^^^^^^^^^^^^^^^^^^^
36We'll assemble android boot image with ``u-boot.bin`` instead of linux kernel,
37and FIT image instead of ``initramfs``. Android bootloader expect gzipped kernel
38with appended dtb, so let's mimic linux to satisfy stock bootloader:
39
40- create dump dtb::
41
42 workdir=/tmp/prepare_payload
43 mkdir -p "$workdir"
44 cd "$workdir"
45 mock_dtb="$workdir"/payload_mock.dtb
46
47 dtc -I dts -O dtb -o "$mock_dtb" << EOF
48 /dts-v1/;
49 / {
50 memory {
51 /* We expect the bootloader to fill in the size */
52 reg = <0 0 0 0>;
53 };
54
55 chosen { };
56 };
57 EOF
58
59- gzip u-boot ``gzip u-boot.bin``
60- append dtb to gzipped u-boot: ``cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb``
61
62Now we've got everything to build android boot image:::
63
64 mkbootimg --base 0x0 --kernel_offset 0x00008000 \
65 --ramdisk_offset 0x02000000 --tags_offset 0x01e00000 \
66 --pagesize 4096 --second_offset 0x00f00000 \
67 --ramdisk "$fit_image" \
68 --kernel u-boot.bin.gz-dtb \
69 -o boot.img
70
71Flash image with your phone's flashing method.
72
Dzmitry Sankouski4e6df402021-10-17 13:44:32 +030073Boards
74------------
75starqlte
76^^^^^^^^^^^^
77
78The starqltechn is a production board for Samsung S9 (SM-G9600) phone,
79based on the Qualcomm SDM845 SoC.
80
81More information can be found on the `Samsung S9 page`_.
82
83.. _Samsung S9 page: https://en.wikipedia.org/wiki/Samsung_Galaxy_S9