blob: 71879c2a6e399ac7194d153c945455d78fad2924 [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
Bhupesh Sharma1f92ef12023-04-20 16:58:48 +053015The current boot flow support loading u-boot as an Android boot image via
16Qualcomm's UEFI-based ABL (Android) Bootloader.
Dzmitry Sankouski4e6df402021-10-17 13:44:32 +030017
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
Sumit Garg5b32da42022-07-12 12:42:08 +053038with appended dtb, so let's mimic linux to satisfy stock bootloader.
Dzmitry Sankouski8e3bdd52022-02-22 21:49:53 +030039
Sumit Garg5b32da42022-07-12 12:42:08 +053040Boards
41------------
42starqlte
43^^^^^^^^^^^^
44
45The starqltechn is a production board for Samsung S9 (SM-G9600) phone,
46based on the Qualcomm SDM845 SoC.
47
48Steps:
49
50- Build u-boot::
51
52 $ export CROSS_COMPILE=<aarch64 toolchain prefix>
53 $ make starqltechn_defconfig
54 $ make
55
56- Create dump dtb::
Dzmitry Sankouski8e3bdd52022-02-22 21:49:53 +030057
58 workdir=/tmp/prepare_payload
59 mkdir -p "$workdir"
60 cd "$workdir"
61 mock_dtb="$workdir"/payload_mock.dtb
62
63 dtc -I dts -O dtb -o "$mock_dtb" << EOF
64 /dts-v1/;
65 / {
66 memory {
67 /* We expect the bootloader to fill in the size */
68 reg = <0 0 0 0>;
69 };
70
71 chosen { };
72 };
73 EOF
74
Sumit Garg5b32da42022-07-12 12:42:08 +053075- gzip u-boot::
76
77 gzip u-boot.bin
78
79- Append dtb to gzipped u-boot::
Dzmitry Sankouski8e3bdd52022-02-22 21:49:53 +030080
Sumit Garg5b32da42022-07-12 12:42:08 +053081 cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb
82
83- Now we've got everything to build android boot image::
Dzmitry Sankouski8e3bdd52022-02-22 21:49:53 +030084
85 mkbootimg --base 0x0 --kernel_offset 0x00008000 \
86 --ramdisk_offset 0x02000000 --tags_offset 0x01e00000 \
87 --pagesize 4096 --second_offset 0x00f00000 \
88 --ramdisk "$fit_image" \
89 --kernel u-boot.bin.gz-dtb \
90 -o boot.img
91
Sumit Garg5b32da42022-07-12 12:42:08 +053092- Flash image with your phone's flashing method.
Dzmitry Sankouski8e3bdd52022-02-22 21:49:53 +030093
Sumit Garg5b32da42022-07-12 12:42:08 +053094More information can be found on the `Samsung S9 page`_.
Dzmitry Sankouski4e6df402021-10-17 13:44:32 +030095
Sumit Garg5b32da42022-07-12 12:42:08 +053096dragonboard845c
97^^^^^^^^^^^^^^^
Dzmitry Sankouski4e6df402021-10-17 13:44:32 +030098
Sumit Garg5b32da42022-07-12 12:42:08 +053099The dragonboard845c is a Qualcomm Robotics RB3 Development Platform, based on
100the Qualcomm SDM845 SoC.
101
102Steps:
103
104- Build u-boot::
105
106 $ export CROSS_COMPILE=<aarch64 toolchain prefix>
107 $ make dragonboard845c_defconfig
108 $ make
109
110- Create dummy dtb::
111
112 workdir=/tmp/prepare_payload
113 mkdir -p "$workdir"
114 mock_dtb="$workdir"/payload_mock.dtb
115
116 dtc -I dts -O dtb -o "$mock_dtb" << EOF
117 /dts-v1/;
118 / {
119 #address-cells = <2>;
120 #size-cells = <2>;
121
122 memory@80000000 {
123 device_type = "memory";
124 /* We expect the bootloader to fill in the size */
125 reg = <0 0x80000000 0 0>;
126 };
127
128 chosen { };
129 };
130 EOF
131
132- gzip u-boot::
133
134 gzip u-boot.bin
135
136- Append dtb to gzipped u-boot::
137
138 cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb
139
140- A ``db845c.its`` file can be found in ``board/qualcomm/dragonboard845c/``
141 directory. It expects a folder as ``db845c_imgs/`` in the main directory
142 containing pre-built kernel, dts and ramdisk images. See ``db845c.its``
143 for full path to images::
144
145 mkimage -f db845c.its db845c.itb
146
147- Now we've got everything to build android boot image::
148
149 mkbootimg --kernel u-boot.bin.gz-dtb --ramdisk db845c.itb \
150 --output boot.img --pagesize 4096 --base 0x80000000
151
152- Flash boot.img using db845c fastboot method.
153
154More information can be found on the `DragonBoard 845c page`_.
Dzmitry Sankouski4e6df402021-10-17 13:44:32 +0300155
156.. _Samsung S9 page: https://en.wikipedia.org/wiki/Samsung_Galaxy_S9
Sumit Garg5b32da42022-07-12 12:42:08 +0530157.. _DragonBoard 845c page: https://www.96boards.org/product/rb3-platform/