Dzmitry Sankouski | 4e6df40 | 2021-10-17 13:44:32 +0300 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | .. sectionauthor:: Dzmitry Sankouski <dsankouski@gmail.com> |
| 3 | |
| 4 | Snapdragon 845 |
| 5 | ================ |
| 6 | |
| 7 | About this |
| 8 | ---------- |
| 9 | This document describes the information about Qualcomm Snapdragon 845 |
| 10 | supported boards and it's usage steps. |
| 11 | |
| 12 | SDM845 - hi-end qualcomm chip, introduced in late 2017. |
| 13 | Mostly used in flagship phones and tablets of 2018. |
| 14 | |
| 15 | U-Boot can be used as a replacement for Qualcomm's original ABL (UEFI) bootloader. |
| 16 | It is loaded as an Android boot image through ABL |
| 17 | |
| 18 | Installation |
| 19 | ------------ |
Dzmitry Sankouski | 8e3bdd5 | 2022-02-22 21:49:53 +0300 | [diff] [blame^] | 20 | Build |
| 21 | ^^^^^ |
| 22 | Setup ``CROSS_COMPILE`` for aarch64 and build U-Boot for your board:: |
Dzmitry Sankouski | 4e6df40 | 2021-10-17 13:44:32 +0300 | [diff] [blame] | 23 | |
| 24 | $ export CROSS_COMPILE=<aarch64 toolchain prefix> |
| 25 | $ make <your board name here, see Boards section>_defconfig |
| 26 | $ make |
| 27 | |
| 28 | This will build ``u-boot.bin`` in the configured output directory. |
| 29 | |
Dzmitry Sankouski | 8e3bdd5 | 2022-02-22 21:49:53 +0300 | [diff] [blame^] | 30 | Generate FIT image |
| 31 | ^^^^^^^^^^^^^^^^^^ |
| 32 | See doc/uImage.FIT for more details |
| 33 | |
| 34 | Pack android boot image |
| 35 | ^^^^^^^^^^^^^^^^^^^^^^^ |
| 36 | We'll assemble android boot image with ``u-boot.bin`` instead of linux kernel, |
| 37 | and FIT image instead of ``initramfs``. Android bootloader expect gzipped kernel |
| 38 | with 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 | |
| 62 | Now 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 | |
| 71 | Flash image with your phone's flashing method. |
| 72 | |
Dzmitry Sankouski | 4e6df40 | 2021-10-17 13:44:32 +0300 | [diff] [blame] | 73 | Boards |
| 74 | ------------ |
| 75 | starqlte |
| 76 | ^^^^^^^^^^^^ |
| 77 | |
| 78 | The starqltechn is a production board for Samsung S9 (SM-G9600) phone, |
| 79 | based on the Qualcomm SDM845 SoC. |
| 80 | |
| 81 | More information can be found on the `Samsung S9 page`_. |
| 82 | |
| 83 | .. _Samsung S9 page: https://en.wikipedia.org/wiki/Samsung_Galaxy_S9 |