Subject: [PATCH 6/6] board: samsung: add Samsung Galaxy S9/S9+(SM-G96x0) board
Дмитрий Санковский
dsankouski at gmail.com
Tue Aug 31 10:46:07 CEST 2021
>From 94e21cc200e09c51752e4bb86cfac320a92c48a5 Mon Sep 17 00:00:00 2001
From: Dzmitry Sankouski <dsankouski at gmail.com>
Date: Sun, 29 Aug 2021 21:57:33 +0300
Subject: [PATCH 6/6] board: samsung: add Samsung Galaxy S9/S9+(SM-G96x0)
board
Samsung S9 SM-G9600 - Snapdragon SDM845 version of the phone,
for China \ Hong Kong markets.
Has unlockable bootloader, unlike SM-G960U (American market version),
which allows running u-boot as a chain-loaded bootloader.
Signed-off-by: Dzmitry Sankouski <dsankouski at gmail.com>
---
arch/arm/dts/Makefile | 1 +
arch/arm/dts/starqltechn-uboot.dtsi | 39 ++++++++++++++++++
arch/arm/dts/starqltechn.dts | 53 +++++++++++++++++++++++++
arch/arm/mach-snapdragon/Kconfig | 13 ++++++
board/samsung/starqltechn/Kconfig | 14 +++++++
board/samsung/starqltechn/MAINTAINERS | 6 +++
board/samsung/starqltechn/Makefile | 9 +++++
board/samsung/starqltechn/starqltechn.c | 10 +++++
configs/starqltechn_defconfig | 33 +++++++++++++++
include/configs/starqltechn.h | 16 ++++++++
10 files changed, 194 insertions(+)
create mode 100644 arch/arm/dts/starqltechn-uboot.dtsi
create mode 100644 arch/arm/dts/starqltechn.dts
create mode 100644 board/samsung/starqltechn/Kconfig
create mode 100644 board/samsung/starqltechn/MAINTAINERS
create mode 100644 board/samsung/starqltechn/Makefile
create mode 100644 board/samsung/starqltechn/starqltechn.c
create mode 100644 configs/starqltechn_defconfig
create mode 100644 include/configs/starqltechn.h
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
index 82a0790cc0..90d922dab7 100644
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
@@ -467,6 +467,7 @@ dtb-$(CONFIG_TARGET_SL28) +=
fsl-ls1028a-kontron-sl28.dtb \
dtb-$(CONFIG_TARGET_DRAGONBOARD410C) += dragonboard410c.dtb
dtb-$(CONFIG_TARGET_DRAGONBOARD820C) += dragonboard820c.dtb
+dtb-$(CONFIG_TARGET_STARQLTECHN) += starqltechn.dtb
dtb-$(CONFIG_TARGET_STEMMY) += ste-ux500-samsung-stemmy.dtb
diff --git a/arch/arm/dts/starqltechn-uboot.dtsi
b/arch/arm/dts/starqltechn-uboot.dtsi
new file mode 100644
index 0000000000..d8d75e018a
--- /dev/null
+++ b/arch/arm/dts/starqltechn-uboot.dtsi
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot addition to handle Samsung S9 SM-G9600 (starqltechn) pins
+ *
+ * (C) Copyright 2021 Dzmitry Sankouski <dsankouski at gmail.com>
+ *
+ */
+
+/
+{
+ soc {
+ u-boot,dm-pre-reloc;
+ gcc {
+ clock-controller at 100000 {
+ u-boot,dm-pre-reloc;
+ };
+ serial at 0xa84000 {
+ u-boot,dm-pre-reloc;
+ };
+ gpio_north at 3900000 {
+ u-boot,dm-pre-reloc;
+ };
+ pinctrl at 3900000 {
+ u-boot,dm-pre-reloc;
+ };
+ };
+ };
+};
+
+&pm8998_pon {
+ key_vol_down {
+ gpios = <&pm8998_pon 1 0>;
+ label = "key_vol_down";
+ };
+ key_power {
+ gpios = <&pm8998_pon 0 0>;
+ label = "key_power";
+ };
+};
diff --git a/arch/arm/dts/starqltechn.dts b/arch/arm/dts/starqltechn.dts
new file mode 100644
index 0000000000..387420f30b
--- /dev/null
+++ b/arch/arm/dts/starqltechn.dts
@@ -0,0 +1,53 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Samsung S9 SM-G9600 (starqltechn) board device tree source
+ *
+ * (C) Copyright 2021 Dzmitry Sankouski <dsankouski at gmail.com>
+ *
+ */
+
+/dts-v1/;
+
+#include "sdm845.dtsi"
+
+/ {
+ model = "Samsung S9 (SM-G9600)";
+ compatible = "qcom,sdm845-mtp", "qcom,sdm845", "qcom,mtp";
+ #address-cells = <2>;
+ #size-cells = <2>;
+
+ chosen {
+ stdout-path = "serial0:921600n8";
+ };
+
+ aliases {
+ serial0 = &debug_uart;
+ };
+
+ memory {
+ device_type = "memory";
+ reg = <0 0x80000000 0 0xfe1bffff>;
+ };
+
+ psci {
+ compatible = "arm,psci-1.0";
+ method = "smc";
+ };
+
+ soc: soc {
+ serial at 0xa84000 {
+ status = "ok";
+ };
+
+ pinctrl at 3900000 {
+ muic_i2c: muic_i2c {
+ pins = "GPIO_33", "GPIO_34";
+ drive-strength = <0x2>;
+ function = "gpio";
+ bias-disable;
+ };
+ };
+ };
+};
+
+#include "starqltechn-uboot.dtsi"
diff --git a/arch/arm/mach-snapdragon/Kconfig
b/arch/arm/mach-snapdragon/Kconfig
index 1a6a608967..90c9fcca2c 100644
--- a/arch/arm/mach-snapdragon/Kconfig
+++ b/arch/arm/mach-snapdragon/Kconfig
@@ -40,9 +40,22 @@ config TARGET_DRAGONBOARD820C
- 3GiB RAM
- 32GiB UFS drive
+config TARGET_STARQLTECHN
+ bool "Samsung S9 SM-G9600(starqltechn)"
+ help
+ Support for Samsung S9 SM-G9600(starqltechn) board.
+ Features:
+ - Qualcomm Snapdragon SDM845 SoC
+ - 4GiB RAM
+ - 64GiB UFS drive
+ select MISC_INIT_R
+ select SDM845
+ select DM_ETH if NET
+
endchoice
source "board/qualcomm/dragonboard410c/Kconfig"
source "board/qualcomm/dragonboard820c/Kconfig"
+source "board/samsung/starqltechn/Kconfig"
endif
diff --git a/board/samsung/starqltechn/Kconfig
b/board/samsung/starqltechn/Kconfig
new file mode 100644
index 0000000000..7662eb87ab
--- /dev/null
+++ b/board/samsung/starqltechn/Kconfig
@@ -0,0 +1,14 @@
+if TARGET_STARQLTECHN
+
+config SYS_BOARD
+ default "starqltechn"
+ help
+ starqltechn is a production board for S9 and S9+ phones(SM-G96x0) phones
based on SDM845 SoC.
+
+config SYS_VENDOR
+ default "samsung"
+
+config SYS_CONFIG_NAME
+ default "starqltechn"
+
+endif
diff --git a/board/samsung/starqltechn/MAINTAINERS
b/board/samsung/starqltechn/MAINTAINERS
new file mode 100644
index 0000000000..135cafdd69
--- /dev/null
+++ b/board/samsung/starqltechn/MAINTAINERS
@@ -0,0 +1,6 @@
+Samsung S9 (SM-G9600)(starqltechn) Board
+M: Dzmitry Sankouski <dsankouski at gmail.com>
+S: Maintained
+F: board/samsung/starqltechn/
+F: include/configs/starqltechn.h
+F: configs/starqltechn_defconfig
diff --git a/board/samsung/starqltechn/Makefile
b/board/samsung/starqltechn/Makefile
new file mode 100644
index 0000000000..c38c0b4710
--- /dev/null
+++ b/board/samsung/starqltechn/Makefile
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# (C) Copyright 2021 Dzmitry Sankouski <dsankouski at gmail.com>
+#
+# This empty file prevents make error.
+# Board logic defined in board/qualcomm/common/sdm845.c, no custom logic
for starqltechn so far.
+#
+
+obj-y += starqltechn.o
diff --git a/board/samsung/starqltechn/starqltechn.c
b/board/samsung/starqltechn/starqltechn.c
new file mode 100644
index 0000000000..e26aee24d7
--- /dev/null
+++ b/board/samsung/starqltechn/starqltechn.c
@@ -0,0 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * This empty file prevents make linking error.
+ * Board logic defined in board/qualcomm/common/sdm845.c, no custom logic
for starqltechn so far.
+ *
+ * (C) Copyright 2021 Dzmitry Sankouski <dsankouski at gmail.com>
+ *
+ */
+
+void nooop(void) {}
diff --git a/configs/starqltechn_defconfig b/configs/starqltechn_defconfig
new file mode 100644
index 0000000000..8f729e1048
--- /dev/null
+++ b/configs/starqltechn_defconfig
@@ -0,0 +1,33 @@
+CONFIG_TARGET_STARQLTECHN=y
+CONFIG_ARM=y
+CONFIG_ARM_SMCCC=y
+CONFIG_ARCH_SNAPDRAGON=y
+CONFIG_IDENT_STRING="\nSamsung S9 SM-G9600"
+CONFIG_DEFAULT_DEVICE_TREE="starqltechn"
+CONFIG_SYS_TEXT_BASE=0x000000016cb00000
+CONFIG_POSITION_INDEPENDENT=y
+CONFIG_BOARD_EARLY_INIT_F=n
+CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_DISPLAY_CPUINFO=n
+CONFIG_STANDALONE_LOAD_ADDR=0x000000016cb00000
+CONFIG_SYS_MALLOC_F_LEN=0x8000
+CONFIG_HUSH_PARSER=y
+CONFIG_OF_CONTROL=y
+CONFIG_DM_STDIO=n
+CONFIG_MSM_GPIO=y
+CONFIG_DM_PMIC=y
+CONFIG_PMIC_PM8916=y
+CONFIG_PM8916_GPIO=y
+CONFIG_SPMI_MSM=y
+CONFIG_CLK=y
+CONFIG_NET=n
+CONFIG_USE_PREBOOT=y
+CONFIG_CMD_GPIO=y
+CONFIG_PINCTRL=y
+CONFIG_MSM_GENI_SERIAL=y
+# CONFIG_DEBUG_UART=y
+# CONFIG_DEBUG_UART_MSM_GENI=y
+# CONFIG_DEBUG_UART_BASE=0xa84000
+# CONFIG_DEBUG_UART_CLOCK=7372800
+# CONFIG_DEBUG_UART_ANNOUNCE=y
+CONFIG_BAUDRATE=921600
diff --git a/include/configs/starqltechn.h b/include/configs/starqltechn.h
new file mode 100644
index 0000000000..c9736a443b
--- /dev/null
+++ b/include/configs/starqltechn.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Board configuration file for Samsung S9(SM-G9600)(starqltechn)
+ *
+ * (C) Copyright 2017 Jorge Ramirez-Ortiz <jorge.ramirez-ortiz at linaro.org>
+ */
+
+#ifndef __CONFIGS_STARQLTECHN_H
+#define __CONFIGS_STARQLTECHN_H
+
+#include <configs/sdm845.h>
+
+#define CONFIG_LNX_KRNL_IMG_TEXT_OFFSET_BASE CONFIG_SYS_LOAD_ADDR
+#define CONFIG_LINUX_KERNEL_IMAGE_HEADER
+
+#endif
--
2.20.1
More information about the U-Boot
mailing list