From patchwork Sun Jul 24 09:55:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lin, Meng-Bo" X-Patchwork-Id: 593324 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06E68C433EF for ; Sun, 24 Jul 2022 09:55:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234019AbiGXJzt (ORCPT ); Sun, 24 Jul 2022 05:55:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233968AbiGXJzs (ORCPT ); Sun, 24 Jul 2022 05:55:48 -0400 Received: from mail-40135.protonmail.ch (mail-40135.protonmail.ch [185.70.40.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3CCABC3A; Sun, 24 Jul 2022 02:55:46 -0700 (PDT) Date: Sun, 24 Jul 2022 09:55:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1658656544; x=1658915744; bh=9Mg93JHhqoIgJqkfUdPBuVFfMWu2Rmt6WIclSQemsR0=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=c70c+a7EpKeMRBz+1dUz+9PlJcFcxRFMg0N2Z9jPsIUPZzSH7B6jR8zYEaGDieFKp J2J7EU2ptjCHaYlzsq5EW9p720GQt3CHRjWJsRdt80zvb3QqTTO8TJTVl2A3wrq4BL XJvNRzAT65ZllK2Y/Pi6LPmhfKi/cCXgeBVs7/AfDwgja1pGKFNX/hIduXA+5iemZ0 anb1jeayGLDQ2/UwhgBnJPTF67kGY22Kn8AFjmucCkaALtYDdsq0TQXRSSKS3uBpj8 e+Z7xZtBOHCjXiXRy+nxZSRgACa3t8H23XVpRemDKVJOPdGkETwT1Accm3jZdKhA/d 8uQS65PeQtecg== To: devicetree@vger.kernel.org From: "Lin, Meng-Bo" Cc: Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Arnd Bergmann , Olof Johansson , Stephen Boyd , Stephan Gerhold , Nikita Travkin , soc@kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, ~postmarketos/upstreaming@lists.sr.ht Reply-To: "Lin, Meng-Bo" Subject: [PATCH v7 2/5] arm64: dts: qcom: msm8916-samsung-e2015: Add initial common dtsi Message-ID: <20220724095400.14081-1-linmengbo0689@protonmail.com> In-Reply-To: <20220724095039.13568-1-linmengbo0689@protonmail.com> References: <20220724095039.13568-1-linmengbo0689@protonmail.com> Feedback-ID: 40467236:user:proton MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Samsung Galaxy E5, E7 and Grand Max are smartphones using the MSM8916 SoC released in 2015. e2015 and a2015 are similar, with some differences in accelerometer, MUIC and Vibrator. The common parts are shared in msm8916-samsung-a2015-common.dtsi to reduce duplication. Add a common device tree for with initial support for: - GPIO keys - GPIO LEDs for Grand Max - Regulator haptic - Hall sensor (except Grand Max) - SDHCI (internal and external storage) - USB Device Mode - UART (on USB connector via the SM5504 MUIC) - WCNSS (WiFi/BT) - Regulators - S3FWRN5 NFC (except Grand Max) The three devices (and all other variants of E5/E7/Grand Max released in 2015) are very similar, with some differences in display, touchscreen, sensors and NFC. The common parts are shared in msm8916-samsung-e2015-common.dtsi to reduce duplication. Unfortunately, some E5/E7/Grand Max were released with outdated 32-bit only firmware and never received any update from Samsung. Since the 32-bit TrustZone firmware is signed there seems to be no way currently to actually boot this device tree on arm64 Linux on those variants at the moment. However, it is possible to use this device tree by compiling an ARM32 kernel instead. The device tree can be easily built on ARM32 with an #include and it works really well there. To avoid confusion for others it is still better to add this device tree on arm64. Otherwise it's easy to forget to update this one when making some changes that affect all MSM8916 devices. Maybe someone finds a way to boot ARM64 Linux on those device at some point. In this case I expect that this device tree can be simply used as-is. Co-developed-by: Stephan Gerhold Signed-off-by: Stephan Gerhold Signed-off-by: Lin, Meng-Bo --- arch/arm64/boot/dts/qcom/Makefile | 3 + .../qcom/msm8916-samsung-e2015-common.dtsi | 59 +++++++++++++++++++ .../boot/dts/qcom/msm8916-samsung-e5.dts | 24 ++++++++ .../boot/dts/qcom/msm8916-samsung-e7.dts | 29 +++++++++ .../dts/qcom/msm8916-samsung-grandmax.dts | 56 ++++++++++++++++++ 5 files changed, 171 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/msm8916-samsung-e2015-common.dtsi create mode 100644 arch/arm64/boot/dts/qcom/msm8916-samsung-e5.dts create mode 100644 arch/arm64/boot/dts/qcom/msm8916-samsung-e7.dts create mode 100644 arch/arm64/boot/dts/qcom/msm8916-samsung-grandmax.dts -- 2.30.2 diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile index 2f8aec2cc6db..941494553b9e 100644 --- a/arch/arm64/boot/dts/qcom/Makefile +++ b/arch/arm64/boot/dts/qcom/Makefile @@ -15,6 +15,9 @@ dtb-$(CONFIG_ARCH_QCOM) += msm8916-longcheer-l8910.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-mtp.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-a3u-eur.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-a5u-eur.dtb +dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-e5.dtb +dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-e7.dtb +dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-grandmax.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-j5.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-samsung-serranove.dtb dtb-$(CONFIG_ARCH_QCOM) += msm8916-wingtech-wt88047.dtb diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-e2015-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-e2015-common.dtsi new file mode 100644 index 000000000000..9caa8a161d31 --- /dev/null +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-e2015-common.dtsi @@ -0,0 +1,59 @@ +// SPDX-License-Identifier: GPL-2.0-only + +#include "msm8916-samsung-a2015-common.dtsi" + +/ { + haptic { + compatible = "regulator-haptic"; + haptic-supply = <®_motor_vdd>; + min-microvolt = <3300000>; + max-microvolt = <3300000>; + }; + + i2c-muic { + /* SM5504 MUIC instead of SM5502 */ + /delete-node/ extcon@25; + + muic: extcon@14 { + compatible = "siliconmitus,sm5504-muic"; + reg = <0x14>; + + interrupt-parent = <&msmgpio>; + interrupts = <12 IRQ_TYPE_EDGE_FALLING>; + + pinctrl-names = "default"; + pinctrl-0 = <&muic_int_default>; + }; + }; + + reg_motor_vdd: regulator-motor-vdd { + compatible = "regulator-fixed"; + regulator-name = "motor_vdd"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + + gpio = <&msmgpio 76 GPIO_ACTIVE_HIGH>; + enable-active-high; + + pinctrl-names = "default"; + pinctrl-0 = <&motor_en_default>; + }; +}; + +&blsp_i2c2 { + /* lis2hh12 accelerometer instead of BMC150 */ + status = "disabled"; + + /delete-node/ accelerometer@10; + /delete-node/ magnetometer@12; +}; + +&msmgpio { + motor_en_default: motor-en-default { + pins = "gpio76"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; +}; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-e5.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-e5.dts new file mode 100644 index 000000000000..777eb934eb4b --- /dev/null +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-e5.dts @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0-only + +/dts-v1/; + +#include "msm8916-samsung-e2015-common.dtsi" + +/* + * NOTE: The original firmware from Samsung can only boot ARM32 kernels on some + * variants. + * Unfortunately, the firmware is signed and cannot be replaced easily. + * There seems to be no way to boot ARM64 kernels on 32-bit devices at the + * moment, even though the hardware would support it. + * + * However, it is possible to use this device tree by compiling an ARM32 kernel + * instead. For clarity and build testing this device tree is maintained next + * to the other MSM8916 device trees. However, it is actually used through + * arch/arm/boot/dts/qcom-msm8916-samsung-e5.dts + */ + +/ { + model = "Samsung Galaxy E5"; + compatible = "samsung,e5", "qcom,msm8916"; + chassis-type = "handset"; +}; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-e7.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-e7.dts new file mode 100644 index 000000000000..b412b61ca258 --- /dev/null +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-e7.dts @@ -0,0 +1,29 @@ +// SPDX-License-Identifier: GPL-2.0-only + +/dts-v1/; + +#include "msm8916-samsung-e2015-common.dtsi" + +/* + * NOTE: The original firmware from Samsung can only boot ARM32 kernels on some + * variants. + * Unfortunately, the firmware is signed and cannot be replaced easily. + * There seems to be no way to boot ARM64 kernels on 32-bit devices at the + * moment, even though the hardware would support it. + * + * However, it is possible to use this device tree by compiling an ARM32 kernel + * instead. For clarity and build testing this device tree is maintained next + * to the other MSM8916 device trees. However, it is actually used through + * arch/arm/boot/dts/qcom-msm8916-samsung-e7.dts + */ + +/ { + model = "Samsung Galaxy E7"; + compatible = "samsung,e7", "qcom,msm8916"; + chassis-type = "handset"; +}; + +&pm8916_l17 { + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3000000>; +}; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-grandmax.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-grandmax.dts new file mode 100644 index 000000000000..4c1becdb9428 --- /dev/null +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-grandmax.dts @@ -0,0 +1,56 @@ +// SPDX-License-Identifier: GPL-2.0-only + +/dts-v1/; + +#include "msm8916-samsung-e2015-common.dtsi" +#include + +/* + * NOTE: The original firmware from Samsung can only boot ARM32 kernels on some + * variants. + * Unfortunately, the firmware is signed and cannot be replaced easily. + * There seems to be no way to boot ARM64 kernels on 32-bit devices at the + * moment, even though the hardware would support it. + * + * However, it is possible to use this device tree by compiling an ARM32 kernel + * instead. For clarity and build testing this device tree is maintained next + * to the other MSM8916 device trees. However, it is actually used through + * arch/arm/boot/dts/qcom-msm8916-samsung-grandmax.dts + */ + +/ { + model = "Samsung Galaxy Grand Max"; + compatible = "samsung,grandmax", "qcom,msm8916"; + chassis-type = "handset"; + + /delete-node/ gpio-hall-sensor; + /delete-node/ i2c-nfc; + /delete-node/ i2c-tkey; + + gpio-leds { + compatible = "gpio-leds"; + keyled { + gpios = <&msmgpio 60 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&gpio_leds_default>; + }; + }; +}; + +®_motor_vdd { + gpio = <&msmgpio 72 GPIO_ACTIVE_HIGH>; +}; + +&msmgpio { + gpio_leds_default: gpio-led-default { + pins = "gpio60"; + function = "gpio"; + + drive-strength = <2>; + bias-disable; + }; +}; + +&motor_en_default { + pins = "gpio72"; +};