blob: 3d08b88c39be3c672525b5b5e7e176f12589f05a [file] [log] [blame]
Caleb Connolly6714bbc2023-11-07 14:56:05 +00001.. SPDX-License-Identifier: GPL-2.0+
2.. sectionauthor:: Dzmitry Sankouski <dsankouski@gmail.com>
3
4Qualcomm generic boards
5=======================
6
7About this
8----------
9This document describes how to build and run U-Boot for Qualcomm generic
10boards. Right now the generic target supports the Snapdragon 845 SoC, however
11it's expected to support more SoCs going forward.
12
13SDM845 - hi-end qualcomm chip, introduced in late 2017.
14Mostly used in flagship phones and tablets of 2018.
15
16The current boot flow support loading u-boot as an Android boot image via
17Qualcomm's UEFI-based ABL (Android) Bootloader. The DTB used by U-Boot will
18be appended to the U-Boot image the same way as when booting Linux. U-Boot
19will then retrieve the DTB during init. This way the memory layout and KASLR
20offset will be populated by ABL.
21
22Installation
23------------
24Build
25^^^^^
26Setup ``CROSS_COMPILE`` for aarch64 and build U-Boot for your board::
27
28 $ export CROSS_COMPILE=<aarch64 toolchain prefix>
29 $ make <your board name here, see Boards section>_defconfig
30 $ make
31
32This will build ``u-boot-nodtb.bin`` in the configured output directory.
33
34Generate FIT image
35^^^^^^^^^^^^^^^^^^
36See doc/uImage.FIT for more details
37
38Pack android boot image
39^^^^^^^^^^^^^^^^^^^^^^^
40We'll assemble android boot image with ``u-boot-nodtb.bin`` instead of linux kernel,
41and FIT image instead of ``initramfs``. Android bootloader expect gzipped kernel
42with appended dtb, so let's mimic linux to satisfy stock bootloader.
43
44Boards
45------
46
47starqlte
48^^^^^^^^
49
50The starqltechn is a production board for Samsung S9 (SM-G9600) phone,
51based on the Qualcomm SDM845 SoC.
52
53This device is supported by the common qcom_defconfig.
54
55The DTB is called "starqltechn.dtb"
56
57More information can be found on the `Samsung S9 page`_.
58
59dragonboard845c
60^^^^^^^^^^^^^^^
61
62The dragonboard845c is a Qualcomm Robotics RB3 Development Platform, based on
63the Qualcomm SDM845 SoC.
64
65This device is supported by the common qcom_defconfig
66
67The DTB is called "dragonboard845c.dtb"
68
69More information can be found on the `DragonBoard 845c page`_.
70
71qcs404-evb
72^^^^^^^^^^
73
74The QCS404 EvB is a Qualcomm Development Platform, based on the Qualcomm QCS404 SoC.
75
76This device is supported by the common qcom_defconfig
77
78The DTB is called "qcs404-evb.dtb"
79
80Building steps
81--------------
82
83Steps:
84
85- Build u-boot::
86
87 $ export CROSS_COMPILE=<aarch64 toolchain prefix>
88 $ make qcom_defconfig
89 $ make
90
91- gzip u-boot::
92
93 gzip u-boot-nodtb.bin
94
95- Append dtb to gzipped u-boot::
96
97 cat u-boot-nodtb.bin.gz arch/arm/dts/your-board.dtb > u-boot-nodtb.bin.gz-dtb
98
99- A ``qcom.its`` file can be found in ``board/qualcomm/generic/``
100 directory. It expects a folder as ``qcom_imgs/`` in the main directory
101 containing pre-built kernel, dts and ramdisk images. See ``qcom.its``
102 for full path to images::
103
104 mkimage -f qcom.its qcom.itb
105
106- Now we've got everything to build android boot image::
107
108 mkbootimg --kernel u-boot-nodtb.bin.gz-dtb --ramdisk db845c.itb \
109 --output boot.img --pagesize 4096 --base 0x80000000
110
111- Flash boot.img using fastboot and erase dtbo to avoid conflicts with our DTB:
112
113 .. code-block:: bash
114
115 fastboot flash boot boot.img
116 fastboot erase dtbo
117
118.. _Samsung S9 page: https://en.wikipedia.org/wiki/Samsung_Galaxy_S9
119.. _DragonBoard 845c page: https://www.96boards.org/product/rb3-platform/