-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
board: samsung: add support for Galaxy A series of 2017 (a5y17lte)
Samsung Galaxy A3, A5, A7 (2017) - middle class Samsung smartphones. U-boot can be used as chain-loaded bootloader to gain control on booting vanilla linux(and possibly others) kernels Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com> Cc: Minkyu Kang <mk7.kang@samsung.com>
- Loading branch information
Showing
13 changed files
with
316 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// SPDX-License-Identifier: GPL-2.0+ | ||
/* | ||
* Samsung Exynos78x0 SoC device tree source | ||
* | ||
* Copyright (c) 2020 Dzmitry Sankouski (dsankouski@gmail.com) | ||
*/ | ||
|
||
/dts-v1/; | ||
#include "exynos78x0.dtsi" | ||
/ { | ||
compatible = "samsung,exynos78x0", "samsung,exynos7880", "samsung,exynos7870"; | ||
|
||
aliases { | ||
console = &uart2; | ||
}; | ||
|
||
chosen { | ||
stdout-path = &uart2; | ||
}; | ||
}; | ||
|
||
&gpioi2c0 { | ||
status = "okay"; | ||
}; | ||
|
||
&fin_pll { | ||
clock-frequency = <26000000>; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
config SYS_CONFIG_NAME | ||
string "Board configuration name" | ||
default "exynos78x0-common.h" | ||
help | ||
This option contains information about board configuration name. | ||
Based on this option include/configs/<CONFIG_SYS_CONFIG_NAME>.h header | ||
will be used for board configuration. | ||
|
||
if TARGET_A5Y17LTE | ||
config SYS_BOARD | ||
default "axy17lte" | ||
help | ||
a5y17lte is a production board for SM-A520F phone on Exynos7880 SoC. | ||
|
||
config SYS_VENDOR | ||
default "samsung" | ||
|
||
config SYS_CONFIG_NAME | ||
default "a5y17lte" | ||
|
||
config EXYNOS7880 | ||
bool "Exynos 7880 SOC support" | ||
default y | ||
endif | ||
|
||
if TARGET_A7Y17LTE | ||
config SYS_BOARD | ||
default "axy17lte" | ||
help | ||
a5y17lte is a production board for SM-A520F phone on Exynos7880 SoC. | ||
|
||
config SYS_VENDOR | ||
default "samsung" | ||
|
||
config SYS_CONFIG_NAME | ||
default "a5y17lte" | ||
|
||
config EXYNOS7880 | ||
bool "Exynos 7880 SOC support" | ||
default y | ||
endif | ||
|
||
if TARGET_A3Y17LTE | ||
config SYS_BOARD | ||
default "axy17lte" | ||
help | ||
a3y17lte is a production board for SM-A520F phone on Exynos7880 SoC. | ||
|
||
config SYS_VENDOR | ||
default "samsung" | ||
|
||
config SYS_CONFIG_NAME | ||
default "a3y17lte" | ||
|
||
config EXYNOS7870 | ||
bool "Exynos 7870 SOC support" | ||
default y | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Samsung A series 2017 phones Board | ||
M: Dzmitry Sankouski <dsankouski@gmail.com> | ||
S: Maintained | ||
F: board/samsung/axy17lte/ | ||
F: include/configs/exynos78x0-common.h | ||
F: configs/a3y17lte_defconfig | ||
F: configs/a5y17lte_defconfig | ||
F: configs/a7y17lte_defconfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# SPDX-License-Identifier: GPL-2.0+ | ||
# | ||
obj-y += axy17lte.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// SPDX-License-Identifier: GPL-2.0+ | ||
/* | ||
* Samsung A5Y17 and A3Y17 LTE boards based on Exynos 7880 and Exynos 7870 SoCs | ||
*/ | ||
|
||
#include <common.h> | ||
|
||
int exynos_init(void) | ||
{ | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
CONFIG_ARM=y | ||
CONFIG_ARCH_EXYNOS=y | ||
CONFIG_ARCH_EXYNOS7=y | ||
CONFIG_S5P=y | ||
CONFIG_TARGET_A3Y17LTE=y | ||
# This option is a number of 256MB DRAM banks, i.e. (ram size) / 256MB. | ||
# Used in samsung common board dram_init function. | ||
CONFIG_NR_DRAM_BANKS=8 | ||
CONFIG_SYS_CONFIG_NAME="exynos78x0-common" | ||
CONFIG_DEFAULT_DEVICE_TREE="exynos78x0-axy17lte" | ||
CONFIG_SYS_TEXT_BASE=0x40001000 | ||
CONFIG_SYS_LOAD_ADDR=0x40001000 | ||
CONFIG_HUSH_PARSER=y | ||
CONFIG_FIT=y | ||
CONFIG_BOARD_EARLY_INIT_F=n | ||
CONFIG_SKIP_LOWLEVEL_INIT=y | ||
CONFIG_CMD_GPIO=y | ||
CONFIG_DISPLAY_CPUINFO=n | ||
CONFIG_CMD_I2C=y | ||
CONFIG_DM_I2C_GPIO=y | ||
CONFIG_PINCTRL_EXYNOS78x0=y | ||
CONFIG_PINCTRL_EXYNOS=y | ||
# CONFIG_DEBUG_UART_S5P=y | ||
# CONFIG_DEBUG_UART_BASE=0x13820000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
CONFIG_ARM=y | ||
CONFIG_ARCH_EXYNOS=y | ||
CONFIG_ARCH_EXYNOS7=y | ||
CONFIG_S5P=y | ||
CONFIG_TARGET_A5Y17LTE=y | ||
# This option is a number of 256MB DRAM banks, i.e. (ram size) / 256MB. | ||
# Used in samsung common board dram_init function. | ||
CONFIG_NR_DRAM_BANKS=12 | ||
CONFIG_SYS_CONFIG_NAME="exynos78x0-common" | ||
CONFIG_DEFAULT_DEVICE_TREE="exynos78x0-axy17lte" | ||
CONFIG_SYS_TEXT_BASE=0x40001000 | ||
CONFIG_SYS_LOAD_ADDR=0x40001000 | ||
CONFIG_HUSH_PARSER=y | ||
CONFIG_FIT=y | ||
CONFIG_BOARD_EARLY_INIT_F=n | ||
CONFIG_SKIP_LOWLEVEL_INIT=y | ||
CONFIG_CMD_GPIO=y | ||
CONFIG_DISPLAY_CPUINFO=n | ||
CONFIG_CMD_I2C=y | ||
CONFIG_DM_I2C_GPIO=y | ||
CONFIG_PINCTRL_EXYNOS78x0=y | ||
CONFIG_PINCTRL_EXYNOS=y | ||
# CONFIG_DEBUG_UART_S5P=y | ||
# CONFIG_DEBUG_UART_BASE=0x13820000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
CONFIG_ARM=y | ||
CONFIG_ARCH_EXYNOS=y | ||
CONFIG_ARCH_EXYNOS7=y | ||
CONFIG_S5P=y | ||
CONFIG_TARGET_A7Y17LTE=y | ||
# This option is a number of 256MB DRAM banks, i.e. (ram size) / 256MB. | ||
# Used in samsung common board dram_init function. | ||
CONFIG_NR_DRAM_BANKS=12 | ||
CONFIG_SYS_CONFIG_NAME="exynos78x0-common" | ||
CONFIG_DEFAULT_DEVICE_TREE="exynos78x0-axy17lte" | ||
CONFIG_SYS_TEXT_BASE=0x40001000 | ||
CONFIG_SYS_LOAD_ADDR=0x40001000 | ||
CONFIG_HUSH_PARSER=y | ||
CONFIG_FIT=y | ||
CONFIG_BOARD_EARLY_INIT_F=n | ||
CONFIG_SKIP_LOWLEVEL_INIT=y | ||
CONFIG_CMD_GPIO=y | ||
CONFIG_DISPLAY_CPUINFO=n | ||
CONFIG_CMD_I2C=y | ||
CONFIG_DM_I2C_GPIO=y | ||
CONFIG_PINCTRL_EXYNOS78x0=y | ||
CONFIG_PINCTRL_EXYNOS=y | ||
# CONFIG_DEBUG_UART_S5P=y | ||
# CONFIG_DEBUG_UART_BASE=0x13820000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
.. SPDX-License-Identifier: GPL-2.0+ | ||
.. sectionauthor:: Dzmitry Sankouski <dsankouski@gmail.com> | ||
|
||
Samsung 2017 A series phones | ||
============================ | ||
|
||
About this | ||
---------- | ||
This document describes the information about Samsung A(7/5/3) 2017 midrange | ||
phones and u-boot usage steps. | ||
|
||
U-Boot can be used as a chain-loaded bootloader to replace Samsung's original SBOOT bootloader. | ||
It is loaded as an Android boot image through SBOOT. | ||
|
||
Phone specs | ||
----------- | ||
A3 (SM-320) (a3y17lte) | ||
^^^^^^^^^^^^^^^^^^^^^^ | ||
- 4.7 AMOLED display | ||
- Exynos 7870 SoC | ||
- 16GB flash | ||
- 2GB RAM | ||
|
||
.. A3 2017 wiki page: https://en.wikipedia.org/wiki/Samsung_Galaxy_A3_(2017) | ||
A5 (SM-520) (a5y17lte) | ||
^^^^^^^^^^^^^^^^^^^^^^ | ||
- 5.2 AMOLED display | ||
- Exynos 7880 SoC | ||
- 32GB flash | ||
- 3GB RAM | ||
|
||
.. A5 2017 wiki page: https://en.wikipedia.org/wiki/Samsung_Galaxy_A5_(2017) | ||
A7 (SM-720) (a5y17lte) | ||
^^^^^^^^^^^^^^^^^^^^^^ | ||
- 5.7 AMOLED display | ||
- Exynos 7880 SoC | ||
- 32GB flash | ||
- 3GB RAM | ||
|
||
.. A7 2017 wiki page: https://en.wikipedia.org/wiki/Samsung_Galaxy_A7_(2017) | ||
Installation | ||
------------ | ||
|
||
Building u-boot | ||
^^^^^^^^^^^^^^^ | ||
|
||
First, setup ``CROSS_COMPILE`` for aarch64. | ||
Then, build U-Boot for your phone, for example ``a5y17lte``:: | ||
|
||
$ export CROSS_COMPILE=<aarch64 toolchain prefix> | ||
$ make a5y17lte_defconfig | ||
$ make | ||
|
||
This will build ``u-boot.bin`` in the configured output directory. | ||
|
||
Payload | ||
^^^^^^^ | ||
What is a payload? | ||
"""""""""""""""""" | ||
A payload file is a file to be used instead of linux kernel in android boot image. | ||
This file will be loaded into memory, and executed by SBOOT, | ||
and is therefore SBOOT's payload. | ||
It may be pure u-boot (with loading u-boot's payload from flash in mind), | ||
or u-boot + u-boot's payload. | ||
|
||
It should be kept in mind, that SBOOT binary patches it's payload after loading | ||
in address range 0x401f8550-0x401f9280. Given SBOOT loads payload to 0x40001000, | ||
a range of 0x1f7550-0x1f8280 (2061648-2065024) in a payload file | ||
will be corrupted after loading to RAM. | ||
|
||
Creating payload file | ||
""""""""""""""""""""" | ||
- Assemble FIT image for your kernel | ||
- Create a file for u-boot payload ``touch sboot-payload`` | ||
- Write zeroes till 0x200000 address to be sure SBOOT won't corrupt your info | ||
``dd if=/dev/zero of=sboot-payload bs=$((0x200000)) count=1`` | ||
- Write u-boot to the start of the payload ``dd if=<u-boot.bin path> of=sboot-payload`` | ||
- Write FIT image to payload from 0x200000 address | ||
``dd if=<FIT image path> of=sboot-payload seek=1 bs=2M`` | ||
|
||
Creating android boot image | ||
""""""""""""""""""""""""""" | ||
Once payload created, it's time for android image:: | ||
|
||
mkbootimg --base 0x40000000 --kernel_offset 0x00000000 --ramdisk_offset 0x01000000 --tags_offset 0x00000100 --pagesize 2048 --second_offset 0x00f00000 --kernel <sboot-payload path> -o uboot.img | ||
|
||
Note, that stock Samsung bootloader ignores offsets, set in mkbootimg. | ||
|
||
Flashing | ||
"""""""" | ||
Flash like regular android boot image. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.. SPDX-License-Identifier: GPL-2.0+ | ||
Samsung | ||
======== | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
|
||
axy17lte |