From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D674C4332F for ; Fri, 8 Oct 2021 06:38:44 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 92B5361040 for ; Fri, 8 Oct 2021 06:38:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 92B5361040 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9C97E835B0; Fri, 8 Oct 2021 08:38:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="K5Ap4rkV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 64E22835A2; Fri, 8 Oct 2021 08:38:30 +0200 (CEST) Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 74F6683572 for ; Fri, 8 Oct 2021 08:38:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dsankouski@gmail.com Received: by mail-wr1-x42a.google.com with SMTP id o20so26303852wro.3 for ; Thu, 07 Oct 2021 23:38:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2noHIt2CcX6Yl0Ft8Li7AfTubNWtmBaQA/I7JiCTsdo=; b=K5Ap4rkV8T0CXJrGlYqknXJpTHPb7edXMS8jxW0P4Hk6yhHt0pVdQ6XyI++cB2Sj+C 6FG08WXVH2hJ7bZxH/Ax0ETlxoy/bEFMIHsCQkOQgww5vPJQGBfzoUKaObQu28SjPUK5 o1sgfQUUaxgtgYLKRp7HoE9gYTH5fLoPawljzrU1Vx5XWLLLm3au1HbcOLy2gbHy9nYK CirNTDH7dQuyB3ULi2n59VWnOy+LnIQqXrkXkgfFvCjKh5BLmv/BLqpOhCw1zsr880Cw V2xu8Se4T7urPPyoHZ9sWhcZ8KThcg5ym5xu0JymmemncITV00Xt14Z1elFg1a/gSTnN TtTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2noHIt2CcX6Yl0Ft8Li7AfTubNWtmBaQA/I7JiCTsdo=; b=I/epSSovpZXsihYYyUm9f1VNsk8WEvM6on7K1tpDb6wtwlp+AYo/aBFWpUTaGFNhfM BFai2ADFOG6Q3REOdG3ln5UzOSs6MHaZ03+iy8TCPLXkAtJVWpzhAD2eJ4Go+OmtD/6l O8jv6p+l0FPDy/yFSmOo+9sPCkGtZ5Jq5O5lz8VgdHvS4FzOm76xjBi4JrDXj7bEQhHE o6VDAQwsrnWXaj87iy/+nnkdR6Gbd8Ta/egkwgn4uuWMCczQ/iS2SXvyVYcxmQeYpyfJ nFEXfAkIvc7+Y6QMFB9UtdCIJWmPotF7oZkJnkxIT3ZEdn0ybSJxhjDYikUzice6qwGG Es9g== X-Gm-Message-State: AOAM532CwVcMNEWwBgdvQCzKNQrxuNDyY0HO26pjZMnsQcLI/s2YR5L9 yDwaQbJe947wp6rz4+NszjGyvhb315w= X-Google-Smtp-Source: ABdhPJwlw6uPoXEkU6MKtdum4r8hRtz0Q6ix5E4LQotSOG5Ylz7KHINyU+6Ygsdk5zvyNaJFTpdn/Q== X-Received: by 2002:adf:9bd3:: with SMTP id e19mr1791583wrc.167.1633675097707; Thu, 07 Oct 2021 23:38:17 -0700 (PDT) Received: from localhost.localdomain ([5.100.192.233]) by smtp.gmail.com with ESMTPSA id z20sm1497199wmi.42.2021.10.07.23.38.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Oct 2021 23:38:17 -0700 (PDT) From: Dzmitry Sankouski To: u-boot@lists.denx.de Cc: Dzmitry Sankouski , Ramon Fried , Tom Rini Subject: [PATCH 6/6 v4] board: samsung: add Samsung Galaxy S9/S9+(SM-G96x0) board Date: Fri, 8 Oct 2021 09:37:15 +0300 Message-Id: <20211008063715.13375-3-dsankouski@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211008063715.13375-1-dsankouski@gmail.com> References: <20211008063715.13375-1-dsankouski@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean 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 Cc: Ramon Fried Cc: Tom Rini --- Changes for v2: - Create documentation file for SDM845 boards - Add starqltechn board documentation Changes for v3: - fix comment in starqltechn.c Changes for v4: - move configs to Kconfig file - remove starqltechn.h file - set SYS_CONFIG_NAME to default of sdm845 - remove unneeded options from starqltechn_defconfig arch/arm/dts/Makefile | 1 + arch/arm/dts/starqltechn-uboot.dtsi | 39 ++++++++++++++++++ arch/arm/dts/starqltechn.dts | 53 +++++++++++++++++++++++++ arch/arm/mach-snapdragon/Kconfig | 17 ++++++++ board/samsung/starqltechn/Kconfig | 22 ++++++++++ board/samsung/starqltechn/MAINTAINERS | 6 +++ board/samsung/starqltechn/Makefile | 9 +++++ board/samsung/starqltechn/starqltechn.c | 10 +++++ configs/starqltechn_defconfig | 30 ++++++++++++++ doc/board/qualcomm/index.rst | 1 + doc/board/qualcomm/sdm845.rst | 38 ++++++++++++++++++ 11 files changed, 226 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 doc/board/qualcomm/sdm845.rst 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 + * + */ + +/ +{ + soc { + u-boot,dm-pre-reloc; + gcc { + clock-controller@100000 { + u-boot,dm-pre-reloc; + }; + serial@0xa84000 { + u-boot,dm-pre-reloc; + }; + gpio_north@3900000 { + u-boot,dm-pre-reloc; + }; + pinctrl@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 + * + */ + +/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@0xa84000 { + status = "ok"; + }; + + pinctrl@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..12cf02a56a 100644 --- a/arch/arm/mach-snapdragon/Kconfig +++ b/arch/arm/mach-snapdragon/Kconfig @@ -12,6 +12,10 @@ config SPL_SYS_MALLOC_F_LEN config SDM845 bool "Qualcomm Snapdragon 845 SoC" default n + select LINUX_KERNEL_IMAGE_HEADER + +config LNX_KRNL_IMG_TEXT_OFFSET_BASE + default 0x80000000 choice prompt "Snapdragon board select" @@ -40,9 +44,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..0eea666d03 --- /dev/null +++ b/board/samsung/starqltechn/Kconfig @@ -0,0 +1,22 @@ +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_CONFIG_NAME + string "Board configuration name" + default "sdm845" + help + This option contains information about board configuration name. + Based on this option include/configs/.h header + will be used for board configuration. + +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 +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 +# +# 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..f2cdb4eec2 --- /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. + * No custom logic for starqltechn so far. + * + * (C) Copyright 2021 Dzmitry Sankouski + * + */ + +void nooop(void) {} diff --git a/configs/starqltechn_defconfig b/configs/starqltechn_defconfig new file mode 100644 index 0000000000..438a6c2f05 --- /dev/null +++ b/configs/starqltechn_defconfig @@ -0,0 +1,30 @@ +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=0x80000000 +CONFIG_POSITION_INDEPENDENT=y +CONFIG_BOARD_EARLY_INIT_F=n +CONFIG_SKIP_LOWLEVEL_INIT=y +CONFIG_DISPLAY_CPUINFO=n +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 diff --git a/doc/board/qualcomm/index.rst b/doc/board/qualcomm/index.rst index f7e0aa9298..10b98214e9 100644 --- a/doc/board/qualcomm/index.rst +++ b/doc/board/qualcomm/index.rst @@ -7,3 +7,4 @@ Qualcomm :maxdepth: 2 dragonboard410c + sdm845 diff --git a/doc/board/qualcomm/sdm845.rst b/doc/board/qualcomm/sdm845.rst new file mode 100644 index 0000000000..cd46cbe9cf --- /dev/null +++ b/doc/board/qualcomm/sdm845.rst @@ -0,0 +1,38 @@ +.. SPDX-License-Identifier: GPL-2.0+ +.. sectionauthor:: Dzmitry Sankouski + +Snapdragon 845 +================ + +About this +---------- +This document describes the information about Qualcomm Snapdragon 845 +supported boards and it's usage steps. + +SDM845 - hi-end qualcomm chip, introduced in late 2017. +Mostly used in flagship phones and tablets of 2018. + +U-Boot can be used as a replacement for Qualcomm's original ABL (UEFI) bootloader. +It is loaded as an Android boot image through ABL + +Installation +------------ +First, setup ``CROSS_COMPILE`` for aarch64. Then, build U-Boot for your board:: + + $ export CROSS_COMPILE= + $ make _defconfig + $ make + +This will build ``u-boot.bin`` in the configured output directory. + +Boards +------------ +starqlte +^^^^^^^^^^^^ + +The starqltechn is a production board for Samsung S9 (SM-G9600) phone, +based on the Qualcomm SDM845 SoC. + +More information can be found on the `Samsung S9 page`_. + +.. _Samsung S9 page: https://en.wikipedia.org/wiki/Samsung_Galaxy_S9 -- 2.20.1