sdm845.rst 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. .. SPDX-License-Identifier: GPL-2.0+
  2. .. sectionauthor:: Dzmitry Sankouski <dsankouski@gmail.com>
  3. Snapdragon 845
  4. ================
  5. About this
  6. ----------
  7. This document describes the information about Qualcomm Snapdragon 845
  8. supported boards and it's usage steps.
  9. SDM845 - hi-end qualcomm chip, introduced in late 2017.
  10. Mostly used in flagship phones and tablets of 2018.
  11. The current boot flow support loading u-boot as an Android boot image via
  12. Qualcomm's UEFI-based ABL (Android) Bootloader.
  13. Installation
  14. ------------
  15. Build
  16. ^^^^^
  17. Setup ``CROSS_COMPILE`` for aarch64 and build U-Boot for your board::
  18. $ export CROSS_COMPILE=<aarch64 toolchain prefix>
  19. $ make <your board name here, see Boards section>_defconfig
  20. $ make
  21. This will build ``u-boot.bin`` in the configured output directory.
  22. Generate FIT image
  23. ^^^^^^^^^^^^^^^^^^
  24. See doc/uImage.FIT for more details
  25. Pack android boot image
  26. ^^^^^^^^^^^^^^^^^^^^^^^
  27. We'll assemble android boot image with ``u-boot.bin`` instead of linux kernel,
  28. and FIT image instead of ``initramfs``. Android bootloader expect gzipped kernel
  29. with appended dtb, so let's mimic linux to satisfy stock bootloader.
  30. Boards
  31. ------
  32. starqlte
  33. ^^^^^^^^
  34. The starqltechn is a production board for Samsung S9 (SM-G9600) phone,
  35. based on the Qualcomm SDM845 SoC.
  36. Steps:
  37. - Build u-boot::
  38. $ export CROSS_COMPILE=<aarch64 toolchain prefix>
  39. $ make starqltechn_defconfig
  40. $ make
  41. - Create dump dtb::
  42. workdir=/tmp/prepare_payload
  43. mkdir -p "$workdir"
  44. cd "$workdir"
  45. mock_dtb="$workdir"/payload_mock.dtb
  46. dtc -I dts -O dtb -o "$mock_dtb" << EOF
  47. /dts-v1/;
  48. / {
  49. memory {
  50. /* We expect the bootloader to fill in the size */
  51. reg = <0 0 0 0>;
  52. };
  53. chosen { };
  54. };
  55. EOF
  56. - gzip u-boot::
  57. gzip u-boot.bin
  58. - Append dtb to gzipped u-boot::
  59. cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb
  60. - Now we've got everything to build android boot image::
  61. mkbootimg --base 0x0 --kernel_offset 0x00008000 \
  62. --ramdisk_offset 0x02000000 --tags_offset 0x01e00000 \
  63. --pagesize 4096 --second_offset 0x00f00000 \
  64. --ramdisk "$fit_image" \
  65. --kernel u-boot.bin.gz-dtb \
  66. -o boot.img
  67. - Flash image with your phone's flashing method.
  68. More information can be found on the `Samsung S9 page`_.
  69. dragonboard845c
  70. ^^^^^^^^^^^^^^^
  71. The dragonboard845c is a Qualcomm Robotics RB3 Development Platform, based on
  72. the Qualcomm SDM845 SoC.
  73. Steps:
  74. - Build u-boot::
  75. $ export CROSS_COMPILE=<aarch64 toolchain prefix>
  76. $ make dragonboard845c_defconfig
  77. $ make
  78. - Create dummy dtb::
  79. workdir=/tmp/prepare_payload
  80. mkdir -p "$workdir"
  81. mock_dtb="$workdir"/payload_mock.dtb
  82. dtc -I dts -O dtb -o "$mock_dtb" << EOF
  83. /dts-v1/;
  84. / {
  85. #address-cells = <2>;
  86. #size-cells = <2>;
  87. memory@80000000 {
  88. device_type = "memory";
  89. /* We expect the bootloader to fill in the size */
  90. reg = <0 0x80000000 0 0>;
  91. };
  92. chosen { };
  93. };
  94. EOF
  95. - gzip u-boot::
  96. gzip u-boot.bin
  97. - Append dtb to gzipped u-boot::
  98. cat u-boot.bin.gz "$mock_dtb" > u-boot.bin.gz-dtb
  99. - A ``db845c.its`` file can be found in ``board/qualcomm/dragonboard845c/``
  100. directory. It expects a folder as ``db845c_imgs/`` in the main directory
  101. containing pre-built kernel, dts and ramdisk images. See ``db845c.its``
  102. for full path to images::
  103. mkimage -f db845c.its db845c.itb
  104. - Now we've got everything to build android boot image::
  105. mkbootimg --kernel u-boot.bin.gz-dtb --ramdisk db845c.itb \
  106. --output boot.img --pagesize 4096 --base 0x80000000
  107. - Flash boot.img using db845c fastboot method:
  108. .. code-block:: bash
  109. sudo fastboot flash boot boot.img
  110. More information can be found on the `DragonBoard 845c page`_.
  111. .. _Samsung S9 page: https://en.wikipedia.org/wiki/Samsung_Galaxy_S9
  112. .. _DragonBoard 845c page: https://www.96boards.org/product/rb3-platform/