blob: e84fefec707b725d6982b137ea03dfcabbdf09c6 [file] [log] [blame]
Dzmitry Sankouski83af4cb2021-10-17 13:45:42 +03001.. SPDX-License-Identifier: GPL-2.0+
2.. sectionauthor:: Dzmitry Sankouski <dsankouski@gmail.com>
3
4Samsung 2017 A series phones
5============================
6
7About this
8----------
9This document describes the information about Samsung A(7/5/3) 2017 midrange
10phones and u-boot usage steps.
11
12U-Boot can be used as a chain-loaded bootloader to replace Samsung's original SBOOT bootloader.
13It is loaded as an Android boot image through SBOOT.
14
15Phone specs
16-----------
Henrik Grimler2492c462022-01-07 20:12:55 +010017A3 (SM-A320) (a3y17lte)
Tom Rinid8339802022-01-19 11:06:07 -050018^^^^^^^^^^^^^^^^^^^^^^^
Dzmitry Sankouski83af4cb2021-10-17 13:45:42 +030019- 4.7 AMOLED display
20- Exynos 7870 SoC
21- 16GB flash
22- 2GB RAM
23
24.. A3 2017 wiki page: https://en.wikipedia.org/wiki/Samsung_Galaxy_A3_(2017)
25
Henrik Grimler2492c462022-01-07 20:12:55 +010026A5 (SM-A520) (a5y17lte)
Tom Rinid8339802022-01-19 11:06:07 -050027^^^^^^^^^^^^^^^^^^^^^^^
Dzmitry Sankouski83af4cb2021-10-17 13:45:42 +030028- 5.2 AMOLED display
29- Exynos 7880 SoC
30- 32GB flash
31- 3GB RAM
32
33.. A5 2017 wiki page: https://en.wikipedia.org/wiki/Samsung_Galaxy_A5_(2017)
34
Henrik Grimler2492c462022-01-07 20:12:55 +010035A7 (SM-A720) (a5y17lte)
Tom Rinid8339802022-01-19 11:06:07 -050036^^^^^^^^^^^^^^^^^^^^^^^
Dzmitry Sankouski83af4cb2021-10-17 13:45:42 +030037- 5.7 AMOLED display
38- Exynos 7880 SoC
39- 32GB flash
40- 3GB RAM
41
42.. A7 2017 wiki page: https://en.wikipedia.org/wiki/Samsung_Galaxy_A7_(2017)
43
44Installation
45------------
46
47Building u-boot
48^^^^^^^^^^^^^^^
49
50First, setup ``CROSS_COMPILE`` for aarch64.
51Then, build U-Boot for your phone, for example ``a5y17lte``::
52
53 $ export CROSS_COMPILE=<aarch64 toolchain prefix>
54 $ make a5y17lte_defconfig
55 $ make
56
57This will build ``u-boot.bin`` in the configured output directory.
58
59Payload
60^^^^^^^
61What is a payload?
62""""""""""""""""""
63A payload file is a file to be used instead of linux kernel in android boot image.
64This file will be loaded into memory, and executed by SBOOT,
65and is therefore SBOOT's payload.
66It may be pure u-boot (with loading u-boot's payload from flash in mind),
67or u-boot + u-boot's payload.
68
69It should be kept in mind, that SBOOT binary patches it's payload after loading
70in address range 0x401f8550-0x401f9280. Given SBOOT loads payload to 0x40001000,
71a range of 0x1f7550-0x1f8280 (2061648-2065024) in a payload file
72will be corrupted after loading to RAM.
73
74Creating payload file
75"""""""""""""""""""""
76- Assemble FIT image for your kernel
77- Create a file for u-boot payload ``touch sboot-payload``
78- Write zeroes till 0x200000 address to be sure SBOOT won't corrupt your info
79 ``dd if=/dev/zero of=sboot-payload bs=$((0x200000)) count=1``
80- Write u-boot to the start of the payload ``dd if=<u-boot.bin path> of=sboot-payload``
81- Write FIT image to payload from 0x200000 address
82 ``dd if=<FIT image path> of=sboot-payload seek=1 bs=2M``
83
84Creating android boot image
85"""""""""""""""""""""""""""
86Once payload created, it's time for android image::
87
88 mkbootimg --base 0x40000000 --kernel_offset 0x00000000 --ramdisk_offset 0x01000000 --tags_offset 0x00000100 --pagesize 2048 --second_offset 0x00f00000 --kernel <sboot-payload path> -o uboot.img
89
90Note, that stock Samsung bootloader ignores offsets, set in mkbootimg.
91
92Flashing
93""""""""
94Flash like regular android boot image.