Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp1635350imi; Sat, 23 Jul 2022 12:02:26 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sg3x0ytW7f2h9ij2psg/r4B3ykE15vSU4cfK/oBsIzKx2rU0c5m/rnmhWlGKtJEFCg9Ioi X-Received: by 2002:a05:6402:2405:b0:43a:86c6:862 with SMTP id t5-20020a056402240500b0043a86c60862mr5449450eda.210.1658602946463; Sat, 23 Jul 2022 12:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658602946; cv=none; d=google.com; s=arc-20160816; b=JXMMz2bVLX9PMDKz0cMK6v9RCQXoABWC7QL0/CZvOMcjCkQuV8H3zgjUb5lMNk/Ytv 9Wz56nEBsaQV/v8nJvgAY8197AMyuwZiyg4Tk0BplfGvwotysSiqDlNpRjjCaqjbCgtM SGvUHdAyJcg6i8ZkEDR39cakATzHwAW+0OEtIqmxuYHIcd/SFGaHvENQhicHPYxD0Jub UwfoMhQ2L/zBChCgWj37pRqBNkjiJ2ZoQsP/SdQI66CcgG4Pa9Zdhvw4Y8AAcUyZiLpr u9g2pnu4NxeT6Z23vuo4sdYq6D8VrHcWHdn8SU/KWTyJsLffXqGnnhlXQ+BEyOXFX3Fe OUAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :feedback-id:references:in-reply-to:message-id:subject:reply-to:cc :from:to:dkim-signature:date; bh=9Mg93JHhqoIgJqkfUdPBuVFfMWu2Rmt6WIclSQemsR0=; b=qxNaT5IrCwhxeuc4Ts+mVMiWtWhVAoD9ZnP2G6ZqVA8/DgbHInG3eiYNHFtRAaVPMX EZ2we3T0uFpYx8O4fp05qpNgItqHQpKx7sORxRiQURejSQTG4AQ+Ms1InJbx1wE2IDLz pYLHQgQSVP2QLpQZP8CqT/QlPSy/ypX8OsirrFgeARMn8A9gQixv35yv202VgOyE/nRZ rkXovPO3ergUWTMykZ0hqawnk4P/7sStN8VvRfqGWpdu2w0ocXXC0cxdDg6dr5FkRaL4 9yq5EoweudV8y3FZPKBXngutCk9BZ2Q6aZ0/r7urW09aHMTjCLfockUz61tKbL58IhQ1 WHoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b="W/lsUL8G"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k3-20020aa7c383000000b0043bb9f01aaesi8665734edq.335.2022.07.23.12.02.01; Sat, 23 Jul 2022 12:02:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b="W/lsUL8G"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238716AbiGWTAn (ORCPT + 99 others); Sat, 23 Jul 2022 15:00:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58290 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238685AbiGWTAj (ORCPT ); Sat, 23 Jul 2022 15:00:39 -0400 Received: from mail-4324.protonmail.ch (mail-4324.protonmail.ch [185.70.43.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B494715805; Sat, 23 Jul 2022 12:00:35 -0700 (PDT) Date: Sat, 23 Jul 2022 19:00:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1658602833; x=1658862033; 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=W/lsUL8GtfNw3h0vsNOk52nos6Mp1eSLHgKzULnn6a4AC2l40JTRHmtotFJedub8L gTqz32ngyAZKfaX4Rp/RLN1WG/7cDUjB77y+qoCQ7M3Bs6HeY5IHx2QZHcYBnh5RK7 awGfMG6pjvJX0RzQiNSQssKoLqTNpQgPQOEzCXt/Hqu68HhslJP4Wvv6KpFq53TalG FFCW0cYWZMX/BV7iuQMTTMgIG2qz1dwQvRXXUDVGShrVHzSk/P3u8dlvKUc4a+n13l 2FICeQPNd9XUYVpXN7E5/NYPqD7Nq/1PPtzAYCkru4aQTa8uU2W2i50ET9PnXcWBmL wEbWoBV2/O1Sg== 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 v6 2/5] arm64: dts: qcom: msm8916-samsung-e2015: Add initial common dtsi Message-ID: <20220723185859.203693-1-linmengbo0689@protonmail.com> In-Reply-To: <20220723185424.203340-1-linmengbo0689@protonmail.com> References: <20220723185424.203340-1-linmengbo0689@protonmail.com> Feedback-ID: 40467236:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,FREEMAIL_REPLYTO_END_DIGIT,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.d= tsi 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 diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/M= akefile 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)=09+=3D msm8916-longcheer-l8910.dt= b dtb-$(CONFIG_ARCH_QCOM)=09+=3D msm8916-mtp.dtb dtb-$(CONFIG_ARCH_QCOM)=09+=3D msm8916-samsung-a3u-eur.dtb dtb-$(CONFIG_ARCH_QCOM)=09+=3D msm8916-samsung-a5u-eur.dtb +dtb-$(CONFIG_ARCH_QCOM)=09+=3D msm8916-samsung-e5.dtb +dtb-$(CONFIG_ARCH_QCOM)=09+=3D msm8916-samsung-e7.dtb +dtb-$(CONFIG_ARCH_QCOM)=09+=3D msm8916-samsung-grandmax.dtb dtb-$(CONFIG_ARCH_QCOM)=09+=3D msm8916-samsung-j5.dtb dtb-$(CONFIG_ARCH_QCOM)=09+=3D msm8916-samsung-serranove.dtb dtb-$(CONFIG_ARCH_QCOM)=09+=3D msm8916-wingtech-wt88047.dtb diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-e2015-common.dtsi b/a= rch/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" + +/ { +=09haptic { +=09=09compatible =3D "regulator-haptic"; +=09=09haptic-supply =3D <®_motor_vdd>; +=09=09min-microvolt =3D <3300000>; +=09=09max-microvolt =3D <3300000>; +=09}; + +=09i2c-muic { +=09=09/* SM5504 MUIC instead of SM5502 */ +=09=09/delete-node/ extcon@25; + +=09=09muic: extcon@14 { +=09=09=09compatible =3D "siliconmitus,sm5504-muic"; +=09=09=09reg =3D <0x14>; + +=09=09=09interrupt-parent =3D <&msmgpio>; +=09=09=09interrupts =3D <12 IRQ_TYPE_EDGE_FALLING>; + +=09=09=09pinctrl-names =3D "default"; +=09=09=09pinctrl-0 =3D <&muic_int_default>; +=09=09}; +=09}; + +=09reg_motor_vdd: regulator-motor-vdd { +=09=09compatible =3D "regulator-fixed"; +=09=09regulator-name =3D "motor_vdd"; +=09=09regulator-min-microvolt =3D <3300000>; +=09=09regulator-max-microvolt =3D <3300000>; + +=09=09gpio =3D <&msmgpio 76 GPIO_ACTIVE_HIGH>; +=09=09enable-active-high; + +=09=09pinctrl-names =3D "default"; +=09=09pinctrl-0 =3D <&motor_en_default>; +=09}; +}; + +&blsp_i2c2 { +=09/* lis2hh12 accelerometer instead of BMC150 */ +=09status =3D "disabled"; + +=09/delete-node/ accelerometer@10; +=09/delete-node/ magnetometer@12; +}; + +&msmgpio { +=09motor_en_default: motor-en-default { +=09=09pins =3D "gpio76"; +=09=09function =3D "gpio"; + +=09=09drive-strength =3D <2>; +=09=09bias-disable; +=09}; +}; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-e5.dts b/arch/arm64/b= oot/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 k= ernel + * instead. For clarity and build testing this device tree is maintained n= ext + * to the other MSM8916 device trees. However, it is actually used through + * arch/arm/boot/dts/qcom-msm8916-samsung-e5.dts + */ + +/ { +=09model =3D "Samsung Galaxy E5"; +=09compatible =3D "samsung,e5", "qcom,msm8916"; +=09chassis-type =3D "handset"; +}; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-e7.dts b/arch/arm64/b= oot/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 k= ernel + * instead. For clarity and build testing this device tree is maintained n= ext + * to the other MSM8916 device trees. However, it is actually used through + * arch/arm/boot/dts/qcom-msm8916-samsung-e7.dts + */ + +/ { +=09model =3D "Samsung Galaxy E7"; +=09compatible =3D "samsung,e7", "qcom,msm8916"; +=09chassis-type =3D "handset"; +}; + +&pm8916_l17 { +=09regulator-min-microvolt =3D <3000000>; +=09regulator-max-microvolt =3D <3000000>; +}; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-grandmax.dts b/arch/a= rm64/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 k= ernel + * instead. For clarity and build testing this device tree is maintained n= ext + * to the other MSM8916 device trees. However, it is actually used through + * arch/arm/boot/dts/qcom-msm8916-samsung-grandmax.dts + */ + +/ { +=09model =3D "Samsung Galaxy Grand Max"; +=09compatible =3D "samsung,grandmax", "qcom,msm8916"; +=09chassis-type =3D "handset"; + +=09/delete-node/ gpio-hall-sensor; +=09/delete-node/ i2c-nfc; +=09/delete-node/ i2c-tkey; + +=09gpio-leds { +=09=09compatible =3D "gpio-leds"; +=09=09keyled { +=09=09=09gpios =3D <&msmgpio 60 GPIO_ACTIVE_HIGH>; +=09=09=09pinctrl-names =3D "default"; +=09=09=09pinctrl-0 =3D <&gpio_leds_default>; +=09=09}; +=09}; +}; + +®_motor_vdd { +=09gpio =3D <&msmgpio 72 GPIO_ACTIVE_HIGH>; +}; + +&msmgpio { +=09gpio_leds_default: gpio-led-default { +=09=09pins =3D "gpio60"; +=09=09function =3D "gpio"; + +=09=09drive-strength =3D <2>; +=09=09bias-disable; +=09}; +}; + +&motor_en_default { +=09pins =3D "gpio72"; +}; -- 2.30.2