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