From patchwork Wed Oct 7 17:20:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 11821313 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 005B314D5 for ; Wed, 7 Oct 2020 17:21:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B16402173E for ; Wed, 7 Oct 2020 17:21:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=connolly.tech header.i=@connolly.tech header.b="hmQK3jEG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728126AbgJGRVd (ORCPT ); Wed, 7 Oct 2020 13:21:33 -0400 Received: from mail-41103.protonmail.ch ([185.70.41.103]:62750 "EHLO mail-41103.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727891AbgJGRVc (ORCPT ); Wed, 7 Oct 2020 13:21:32 -0400 Received: from mail-02.mail-europe.com (mail-02.mail-europe.com [51.89.119.103]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail-41103.protonmail.ch (Postfix) with ESMTPS id 8A07A2000424; Wed, 7 Oct 2020 17:21:09 +0000 (UTC) Authentication-Results: mail-41103.protonmail.ch; dkim=pass (1024-bit key) header.d=connolly.tech header.i=@connolly.tech header.b="hmQK3jEG" Date: Wed, 07 Oct 2020 17:20:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=connolly.tech; s=protonmail; t=1602091265; bh=diIhVFPD9xUOq2n1qZyHi4LN1K0w3OUwHNY/r0C+Ldg=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=hmQK3jEGHbIv7edFg4jYgS0Z1XY82f/s1TInEiPQ8v4sU8az/UHe6O/qJ7FN+Bfum eDAghjnk47NpFjtqz07S2Eg9ygSxFuSQtbQo3Tn3NR6ReYMxsE8qOMIPNWNKKpKsBe hi3SKegyZnCzK1ruQRA9BoTRTC77/dC85PShDRV0= To: Andy Gross , Bjorn Andersson , Rob Herring , Kees Cook , Anton Vorontsov , Colin Cross , Tony Luck From: Caleb Connolly Cc: ~postmarketos/upstreaming@lists.sr.ht, Caleb Connolly , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Caleb Connolly Subject: [PATCH 3/5] arm64: dts: sdm845: add oneplus 6/t devices Message-ID: <20201007171807.285298-4-caleb@connolly.tech> In-Reply-To: <20201007171807.285298-1-caleb@connolly.tech> References: <20201007171807.285298-1-caleb@connolly.tech> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add initial support for the OnePlus 6 (enchilada) and 6T (fajita) based on the sdm845-mtp DT. Support includes: * Both display panels work * Touch screen support with rmi4 * RTC support * Remoteprocs boot and can be interacted with over QRTR. * WLAN + Bluetooth both work, although bluetooth doesn't appear in rfkill. * Volume / power buttons and OnePlus Tri-State switch are functional * USB gadget support is forced as it doesn't seem to be able to detect USB cable connect/disconnect, perhaps to do with OnePlus' propriatery fast charge IC. The device successfully boots into Phosh using postmarketOS. Signed-off-by: Caleb Connolly --- arch/arm64/boot/dts/qcom/Makefile | 2 + .../boot/dts/qcom/sdm845-oneplus-common.dtsi | 860 ++++++++++++++++++ .../dts/qcom/sdm845-oneplus-enchilada.dts | 19 + .../boot/dts/qcom/sdm845-oneplus-fajita.dts | 19 + 4 files changed, 900 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi create mode 100644 arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts create mode 100644 arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile index d8f1466e6758..a14f246e2367 100644 --- a/arch/arm64/boot/dts/qcom/Makefile +++ b/arch/arm64/boot/dts/qcom/Makefile @@ -30,6 +30,8 @@ dtb-$(CONFIG_ARCH_QCOM) += sdm845-cheza-r2.dtb dtb-$(CONFIG_ARCH_QCOM) += sdm845-cheza-r3.dtb dtb-$(CONFIG_ARCH_QCOM) += sdm845-db845c.dtb dtb-$(CONFIG_ARCH_QCOM) += sdm845-mtp.dtb +dtb-$(CONFIG_ARCH_QCOM) += sdm845-oneplus-enchilada.dtb +dtb-$(CONFIG_ARCH_QCOM) += sdm845-oneplus-fajita.dtb dtb-$(CONFIG_ARCH_QCOM) += sdm850-lenovo-yoga-c630.dtb dtb-$(CONFIG_ARCH_QCOM) += sm8150-mtp.dtb dtb-$(CONFIG_ARCH_QCOM) += sm8250-mtp.dtb diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi new file mode 100644 index 000000000000..b0b09fe94f20 --- /dev/null +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi @@ -0,0 +1,860 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * SDM845 OnePlus 6(T) (enchilada / fajita) common device tree source + * + * Copyright (c) 2020, The Linux Foundation. All rights reserved. + */ + +/dts-v1/; + +#include +#include +#include +#include "sdm845.dtsi" + +// Needed for some GPIO (like the volume buttons) +#include "pm8998.dtsi" + +// For LEDs +#include "pmi8998.dtsi" + +/ { + + aliases { + hsuart0 = &uart6; + }; + + vph_pwr: vph-pwr-regulator { + compatible = "regulator-fixed"; + regulator-name = "vph_pwr"; + regulator-min-microvolt = <3700000>; + regulator-max-microvolt = <3700000>; + }; + + /* + * Apparently RPMh does not provide support for PM8998 S4 because it + * is always-on; model it as a fixed regulator. + */ + vreg_s4a_1p8: pm8998-smps4 { + compatible = "regulator-fixed"; + regulator-name = "vreg_s4a_1p8"; + + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + + regulator-always-on; + regulator-boot-on; + + vin-supply = <&vph_pwr>; + }; + + gpio_tristate_key: gpio-keys { + compatible = "gpio-keys"; + label = "Tri-state key"; + + pinctrl-names = "default"; + pinctrl-0 = <&tri_state_key_default>; + + state-top { + label = "Tri-state key top"; + linux,code = ; + // gpios = <&tlmm 40 GPIO_ACTIVE_LOW>; + interrupt-parent = <&tlmm>; + interrupts = <24 IRQ_TYPE_EDGE_FALLING>; + debounce-interval = <500>; + linux,can-disable; + }; + + state-middle { + label = "Tri-state key middle"; + linux,code = ; + // gpios = <&tlmm 42 GPIO_ACTIVE_LOW>; + interrupt-parent = <&tlmm>; + interrupts = <52 IRQ_TYPE_EDGE_FALLING>; + debounce-interval = <500>; + linux,can-disable; + }; + + state-bottom { + label = "Tri-state key bottom"; + linux,code = ; + // gpios = <&tlmm 26 GPIO_ACTIVE_LOW>; + interrupt-parent = <&tlmm>; + interrupts = <126 IRQ_TYPE_EDGE_FALLING>; + debounce-interval = <500>; + linux,can-disable; + }; + }; + + gpio_vol_keys: gpio-keys { + compatible = "gpio-keys"; + label = "Volume keys"; + autorepeat; + + pinctrl-names = "default"; + pinctrl-0 = <&volume_down_gpio &volume_up_gpio>; + + vol-down { + label = "Volume down"; + linux,code = ; + gpios = <&pm8998_gpio 5 GPIO_ACTIVE_LOW>; + debounce-interval = <15>; + }; + + vol-up { + label = "Volume up"; + linux,code = ; + gpios = <&pm8998_gpio 6 GPIO_ACTIVE_LOW>; + debounce-interval = <15>; + }; + }; + + extcon_usb1: extcon-usb-1 { + compatible = "linux,extcon-usb-gpio"; + id-gpio = <&tlmm 38 GPIO_ACTIVE_HIGH>; + }; +}; + +&apps_rsc { + pm8998-rpmh-regulators { + compatible = "qcom,pm8998-rpmh-regulators"; + qcom,pmic-id = "a"; + + vdd-s1-supply = <&vph_pwr>; + vdd-s2-supply = <&vph_pwr>; + vdd-s3-supply = <&vph_pwr>; + vdd-s4-supply = <&vph_pwr>; + vdd-s5-supply = <&vph_pwr>; + vdd-s6-supply = <&vph_pwr>; + vdd-s7-supply = <&vph_pwr>; + vdd-s8-supply = <&vph_pwr>; + vdd-s9-supply = <&vph_pwr>; + vdd-s10-supply = <&vph_pwr>; + vdd-s11-supply = <&vph_pwr>; + vdd-s12-supply = <&vph_pwr>; + vdd-s13-supply = <&vph_pwr>; + vdd-l1-l27-supply = <&vreg_s7a_1p025>; + vdd-l2-l8-l17-supply = <&vreg_s3a_1p35>; + vdd-l3-l11-supply = <&vreg_s7a_1p025>; + vdd-l4-l5-supply = <&vreg_s7a_1p025>; + vdd-l6-supply = <&vph_pwr>; + vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p04>; + vdd-l9-supply = <&vreg_bob>; + vdd-l10-l23-l25-supply = <&vreg_bob>; + vdd-l13-l19-l21-supply = <&vreg_bob>; + vdd-l16-l28-supply = <&vreg_bob>; + vdd-l18-l22-supply = <&vreg_bob>; + vdd-l20-l24-supply = <&vreg_bob>; + vdd-l26-supply = <&vreg_s3a_1p35>; + vin-lvs-1-2-supply = <&vreg_s4a_1p8>; + + vreg_s2a_1p125: smps2 { + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + }; + + vreg_s3a_1p35: smps3 { + regulator-min-microvolt = <1352000>; + regulator-max-microvolt = <1352000>; + }; + + vreg_s5a_2p04: smps5 { + regulator-min-microvolt = <1904000>; + regulator-max-microvolt = <2040000>; + }; + + vreg_s7a_1p025: smps7 { + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <1028000>; + }; + + vdd_qusb_hs0: + vdda_hp_pcie_core: + vdda_mipi_csi0_0p9: + vdda_mipi_csi1_0p9: + vdda_mipi_csi2_0p9: + vdda_mipi_dsi0_pll: + vdda_mipi_dsi1_pll: + vdda_qlink_lv: + vdda_qlink_lv_ck: + vdda_qrefs_0p875: + vdda_pcie_core: + vdda_pll_cc_ebi01: + vdda_pll_cc_ebi23: + vdda_sp_sensor: + vdda_ufs1_core: + vdda_ufs2_core: + vdda_usb1_ss_core: + vdda_usb2_ss_core: + vreg_l1a_0p875: ldo1 { + regulator-min-microvolt = <880000>; + regulator-max-microvolt = <880000>; + regulator-initial-mode = ; + }; + + vddpx_10: + vreg_l2a_1p2: ldo2 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-initial-mode = ; + regulator-always-on; + }; + + vreg_l3a_1p0: ldo3 { + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1000000>; + regulator-initial-mode = ; + }; + + vdd_wcss_cx: + vdd_wcss_mx: + vdda_wcss_pll: + vreg_l5a_0p8: ldo5 { + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <800000>; + regulator-initial-mode = ; + }; + + vddpx_13: + vreg_l6a_1p8: ldo6 { + regulator-min-microvolt = <1856000>; + regulator-max-microvolt = <1856000>; + regulator-initial-mode = ; + }; + + vreg_l7a_1p8: ldo7 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-initial-mode = ; + }; + + vreg_l8a_1p2: ldo8 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1248000>; + regulator-initial-mode = ; + }; + + vreg_l9a_1p8: ldo9 { + regulator-min-microvolt = <1704000>; + regulator-max-microvolt = <2928000>; + regulator-initial-mode = ; + }; + + vreg_l10a_1p8: ldo10 { + regulator-min-microvolt = <1704000>; + regulator-max-microvolt = <2928000>; + regulator-initial-mode = ; + }; + + vreg_l11a_1p0: ldo11 { + regulator-min-microvolt = <1000000>; + regulator-max-microvolt = <1048000>; + regulator-initial-mode = ; + }; + + vdd_qfprom: + vdd_qfprom_sp: + vdda_apc1_cs_1p8: + vdda_gfx_cs_1p8: + vdda_qrefs_1p8: + vdda_qusb_hs0_1p8: + vddpx_11: + vreg_l12a_1p8: ldo12 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-initial-mode = ; + }; + + vddpx_2: + vreg_l13a_2p95: ldo13 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <2960000>; + regulator-initial-mode = ; + }; + + vreg_l14a_1p88: ldo14 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-initial-mode = ; + regulator-always-on; + }; + + vreg_l15a_1p8: ldo15 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-initial-mode = ; + }; + + vreg_l16a_2p7: ldo16 { + regulator-min-microvolt = <2704000>; + regulator-max-microvolt = <2704000>; + regulator-initial-mode = ; + }; + + vreg_l17a_1p3: ldo17 { + regulator-min-microvolt = <1304000>; + regulator-max-microvolt = <1304000>; + regulator-initial-mode = ; + }; + + vreg_l18a_2p7: ldo18 { + regulator-min-microvolt = <2704000>; + regulator-max-microvolt = <2960000>; + regulator-initial-mode = ; + }; + + vreg_l19a_3p0: ldo19 { + regulator-min-microvolt = <2856000>; + regulator-max-microvolt = <3104000>; + regulator-initial-mode = ; + }; + + vreg_l20a_2p95: ldo20 { + regulator-min-microvolt = <2704000>; + regulator-max-microvolt = <2960000>; + regulator-initial-mode = ; + }; + + vreg_l21a_2p95: ldo21 { + regulator-min-microvolt = <2704000>; + regulator-max-microvolt = <2960000>; + regulator-initial-mode = ; + }; + + vreg_l22a_2p85: ldo22 { + regulator-min-microvolt = <2864000>; + regulator-max-microvolt = <3312000>; + regulator-initial-mode = ; + }; + + vreg_l23a_3p3: ldo23 { + regulator-min-microvolt = <3000000>; + regulator-max-microvolt = <3312000>; + regulator-initial-mode = ; + }; + + vdda_qusb_hs0_3p1: + vreg_l24a_3p075: ldo24 { + regulator-min-microvolt = <3088000>; + regulator-max-microvolt = <3088000>; + regulator-initial-mode = ; + }; + + vreg_l25a_3p3: ldo25 { + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3312000>; + regulator-initial-mode = ; + }; + + vdda_hp_pcie_1p2: + vdda_hv_ebi0: + vdda_hv_ebi1: + vdda_hv_ebi2: + vdda_hv_ebi3: + vdda_mipi_csi_1p25: + vdda_mipi_dsi0_1p2: + vdda_mipi_dsi1_1p2: + vdda_pcie_1p2: + vdda_ufs1_1p2: + vdda_ufs2_1p2: + vdda_usb1_ss_1p2: + vdda_usb2_ss_1p2: + vreg_l26a_1p2: ldo26 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-initial-mode = ; + }; + + vreg_l28a_3p0: ldo28 { + regulator-min-microvolt = <2856000>; + regulator-max-microvolt = <3008000>; + regulator-initial-mode = ; + }; + + vreg_lvs1a_1p8: lvs1 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + + vreg_lvs2a_1p8: lvs2 { + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + }; + }; + + pmi8998-rpmh-regulators { + compatible = "qcom,pmi8998-rpmh-regulators"; + qcom,pmic-id = "b"; + + vdd-bob-supply = <&vph_pwr>; + + vreg_bob: bob { + regulator-min-microvolt = <3312000>; + regulator-max-microvolt = <3600000>; + regulator-initial-mode = ; + regulator-allow-bypass; + }; + }; + + pm8005-rpmh-regulators { + compatible = "qcom,pm8005-rpmh-regulators"; + qcom,pmic-id = "c"; + + vdd-s1-supply = <&vph_pwr>; + vdd-s2-supply = <&vph_pwr>; + vdd-s3-supply = <&vph_pwr>; + vdd-s4-supply = <&vph_pwr>; + + vreg_s3c_0p6: smps3 { + regulator-min-microvolt = <600000>; + regulator-max-microvolt = <600000>; + }; + }; +}; + +/* Reserved memory changes */ +/* + * The rmtfs memory region in downstream is 'dynamically allocated' + * but given the same address every time. hard code it here as this address is + * where the modem firmware expects it to be. + */ +/delete-node/ &rmtfs_mem; + +/ { + reserved-memory { + rmtfs_mem: memory@f5b01000 { + compatible = "qcom,rmtfs-mem"; + reg = <0 0xf5b01000 0 0x200000>; + no-map; + + qcom,client-id = <1>; + qcom,vmid = <15>; + }; + + /* + * This must be reserved as the device will + * crash if memory is allocated here. + */ + removed_region: memory@88f00000 { + no-map; + reg = <0 0x88f00000 0 0x1c00000>; + }; + + ramoops: ramoops@ac300000 { + compatible = "ramoops"; + reg = <0 0xac300000 0 0x400000>; + record-size = <0x40000>; + console-size = <0x40000>; + ftrace-size = <0x40000>; + pmsg-size = <0x200000>; + devinfo-size = <0x1000>; + ecc-size = <16>; + }; + }; +}; + +&gcc { + protected-clocks = , + , + , + , + ; +}; + +&gpu { + zap-shader { + memory-region = <&gpu_mem>; + firmware-name = "qcom/sdm845/oneplus6/a630_zap.mbn"; + }; +}; + +&adsp_pas { + status = "okay"; + firmware-name = "qcom/sdm845/oneplus6/adsp.mbn"; +}; + +&cdsp_pas { + status = "okay"; + firmware-name = "qcom/sdm845/oneplus6/cdsp.mbn"; +}; + +/* Modem/wifi*/ +&mss_pil { + status = "okay"; + firmware-name = "qcom/sdm845/oneplus6/mba.mbn", "qcom/sdm845/oneplus6/modem.mbn"; +}; + +&uart6 { + status = "okay"; + + bluetooth { + compatible = "qcom,wcn3990-bt"; + + /* In subdir qca/ in /lib/firmware */ + firmware-name = "oneplus6/crnv21.bin"; + + vddio-supply = <&vreg_s4a_1p8>; + vddxo-supply = <&vreg_l7a_1p8>; + vddrf-supply = <&vreg_l17a_1p3>; + vddch0-supply = <&vreg_l25a_3p3>; + max-speed = <3200000>; + }; +}; + +&qup_uart6_default { + pinmux { + pins = "gpio45", "gpio46", "gpio47", "gpio48"; + function = "qup6"; + }; + + cts { + pins = "gpio45"; + bias-pull-down; + }; + + rts-tx { + pins = "gpio46", "gpio47"; + drive-strength = <2>; + bias-disable; + }; + + rx { + pins = "gpio48"; + bias-pull-up; + }; +}; + +&ufs_mem_hc { + status = "okay"; + + reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>; + + vcc-supply = <&vreg_l20a_2p95>; + vcc-max-microamp = <600000>; +}; + +&ufs_mem_phy { + status = "okay"; + + vdda-phy-supply = <&vdda_ufs1_core>; + vdda-pll-supply = <&vdda_ufs1_1p2>; +}; + +&usb_1 { + status = "okay"; + + /* disable USB3 clock requirement as we are in USB 2 mode */ + qcom,select-utmi-as-pipe-clk; +}; + +&usb_1_dwc3 { + /* + * Can't detect USB cable being plugged / unplugged, so this is needed + * for gadget mode + */ + dr_mode = "peripheral"; + + /* fastest mode for USB 2 */ + maximum-speed = "high-speed"; + + extcon = <&extcon_usb1>; + + /* Remove USB3 phy */ + phys = <&usb_1_hsphy>; + phy-names = "usb2-phy"; +}; + +&usb_1_hsphy { + status = "okay"; + + vdd-supply = <&vdda_usb1_ss_core>; + vdda-pll-supply = <&vdda_qusb_hs0_1p8>; + vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>; + + qcom,imp-res-offset-value = <8>; + qcom,hstx-trim-value = ; + qcom,preemphasis-level = ; + qcom,preemphasis-width = ; +}; + +&wifi { + status = "okay"; + vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>; + vdd-1.8-xo-supply = <&vreg_l7a_1p8>; + vdd-1.3-rfa-supply = <&vreg_l17a_1p3>; + vdd-3.3-ch0-supply = <&vreg_l25a_3p3>; + + qcom,snoc-host-cap-8bit-quirk; +}; + +&mdss { + status = "okay"; +}; + +&mdss_mdp { + status = "okay"; +}; + +&dsi0 { + status = "okay"; + vdda-supply = <&vdda_mipi_dsi0_1p2>; + + #address-cells = <1>; + #size-cells = <0>; + + display_panel: panel@0 { + status = "disabled"; + + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + vddio-supply = <&vreg_l14a_1p88>; + + reset-gpios = <&tlmm 6 GPIO_ACTIVE_HIGH>; + + pinctrl-names = "default"; + pinctrl-0 = <&panel_reset_pins &panel_te_pin &panel_esd_pin>; + + + port { + panel_in: endpoint { + remote-endpoint = <&dsi0_out>; + }; + }; + }; +}; + +&dsi0_out { + remote-endpoint = <&panel_in>; + data-lanes = <0 1 2 3>; +}; + +&dsi0_phy { + status = "okay"; + vdds-supply = <&vdda_mipi_dsi0_pll>; +}; + +/* GENI device - does i2c, uart, spi and all that stuff */ +&qupv3_id_1 { + status = "okay"; +}; + +&qupv3_id_0 { + status = "okay"; +}; + +&i2c10 { + status = "okay"; + clock-frequency = <100000>; + + bq27541_battery: bq27541-battery@55 { + status = "okay"; + compatible = "ti,bq27541"; + reg = <0x55>; + }; +}; + +&i2c12 { + status = "okay"; + + touchscreen: synaptics-rmi4-i2c@20 { + compatible = "syna,rmi4-i2c"; + reg = <0x20>; + #address-cells = <1>; + #size-cells = <0>; + interrupts-extended = <&tlmm 125 0x2008>; // IRQF_ONESHOT | IRQF_TRIGGER_LOW + + pinctrl-names = "default"; + pinctrl-0 = <&ts_default_pins &ts_enable_1p8>; + + vdd-supply = <&vreg_l28a_3p0>; + vio-supply = <&vreg_l6a_1p8>; + + syna,reset-delay-ms = <200>; + syna,startup-delay-ms = <200>; + + rmi4-f01@1 { + reg = <0x01>; + syna,nosleep-mode = <1>; + }; + + rmi4_f12: rmi4-f12@12 { + reg = <0x12>; + touchscreen-x-mm = <68>; + touchscreen-y-mm = <144>; + syna,sensor-type = <1>; + syna,rezero-wait-ms = <200>; + }; + }; +}; + +/* PINCTRL - additions to nodes defined in sdm845.dtsi */ + +&qup_i2c12_default { + mux { + pins = "gpio49", "gpio50"; + function = "qup12"; + }; + config { + pins = "gpio49", "gpio50"; + drive-strength = <2>; + bias-disable; + }; +}; + +&qup_i2c10_default { + pinconf { + pins = "gpio55", "gpio56"; + drive-strength = <2>; + bias-disable; + }; +}; + +&qup_uart9_default { + pinconf-tx { + pins = "gpio4"; + drive-strength = <2>; + bias-disable; + }; + + pinconf-rx { + pins = "gpio5"; + drive-strength = <2>; + bias-pull-up; + }; +}; + +&pm8998_gpio { + volume_down_gpio: pm8998_gpio5 { + pinconf { + pins = "gpio5"; + function = "normal"; + input-enable; + bias-pull-up; + qcom,drive-strength = <0>; + }; + }; + + volume_up_gpio: pm8998_gpio6 { + pinconf { + pins = "gpio6"; + function = "normal"; + input-enable; + bias-pull-up; + qcom,drive-strength = <0>; + }; + }; +}; + +&tlmm { + gpio-reserved-ranges = <0 4>, <81 4>; + + sdc2_clk: sdc2-clk { + pinconf { + pins = "sdc2_clk"; + bias-disable; + + /* + * It seems that mmc_test reports errors if drive + * strength is not 16 on clk, cmd, and data pins. + */ + drive-strength = <16>; + }; + }; + + sdc2_cmd: sdc2-cmd { + pinconf { + pins = "sdc2_cmd"; + bias-pull-up; + drive-strength = <16>; + }; + }; + + sdc2_data: sdc2-data { + pinconf { + pins = "sdc2_data"; + bias-pull-up; + drive-strength = <16>; + }; + }; + + tri_state_key_default: tri_state_key_default { + mux { + pins = "gpio40", "gpio42", "gpio26"; + function = "gpio"; + }; + + config { + pins = "gpio40", "gpio42", "gpio26"; + drive-strength = <2>; + bias-disable; + }; + }; + + ts_default_pins: ts-int { + mux { + pins = "gpio99", "gpio125"; + function = "gpio"; + }; + + config { + pins = "gpio99", "gpio125"; + drive-strength = <16>; + bias-pull-up; + }; + }; + + ts_enable_1p8: ts-1p8 { + mux { + pins = "gpio88"; + function = "gpio"; + }; + + config { + pins = "gpio88"; + drive-strength = <16>; + bias-pull-up; + }; + }; + + panel_reset_pins: panel-reset { + mux { + pins = "gpio6", "gpio25", "gpio26"; + function = "gpio"; + }; + + config { + pins = "gpio6", "gpio25", "gpio26"; + drive-strength = <8>; + bias-disable = <0>; + }; + }; + + panel_te_pin: panel-te { + mux { + pins = "gpio10"; + function = "mdp_vsync"; + }; + + config { + pins = "gpio10"; + drive-strength = <2>; + bias-disable; + input-enable; + }; + }; + + panel_esd_pin: panel-esd { + mux { + pins = "gpio30"; + function = "gpio"; + }; + config { + pins = "gpio30"; + drive-strength = <2>; + bias-pull-down; + input-enable; + }; + }; +}; diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts new file mode 100644 index 000000000000..a62e211a2797 --- /dev/null +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dts @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * SDM845 OnePlus 6 (enchilada) specific device tree + * + * Copyright (c) 2020, The Linux Foundation. All rights reserved. + */ + +#include "sdm845-oneplus-common.dtsi" + +/ { + model = "OnePlus 6"; + compatible = "oneplus,enchilada", "oneplus,oneplus6", "qcom,sdm845"; +}; + +&display_panel { + status = "okay"; + + compatible = "samsung,sofef00"; +}; diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts b/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts new file mode 100644 index 000000000000..d418389bb2d0 --- /dev/null +++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dts @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * SDM845 OnePlus 6T (fajita) specific device tree + * + * Copyright (c) 2020, The Linux Foundation. All rights reserved. + */ + +#include "sdm845-oneplus-common.dtsi" + +/ { + model = "OnePlus 6T"; + compatible = "oneplus,fajita", "oneplus,oneplus6", "qcom,sdm845"; +}; + +&display_panel { + status = "okay"; + + compatible = "samsung,s6e3fc2x01"; +}; From patchwork Wed Oct 7 17:20:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 11821311 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3497A6CA for ; Wed, 7 Oct 2020 17:21:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0E1AB2173E for ; Wed, 7 Oct 2020 17:20:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=connolly.tech header.i=@connolly.tech header.b="V2BIlimC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728231AbgJGRU7 (ORCPT ); Wed, 7 Oct 2020 13:20:59 -0400 Received: from mail-41104.protonmail.ch ([185.70.41.104]:11242 "EHLO mail-41104.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727891AbgJGRU7 (ORCPT ); Wed, 7 Oct 2020 13:20:59 -0400 Received: from mail-03.mail-europe.com (mail-03.mail-europe.com [91.134.188.129]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail-41104.protonmail.ch (Postfix) with ESMTPS id E5DA420035C1; Wed, 7 Oct 2020 17:20:56 +0000 (UTC) Authentication-Results: mail-41104.protonmail.ch; dkim=pass (1024-bit key) header.d=connolly.tech header.i=@connolly.tech header.b="V2BIlimC" Date: Wed, 07 Oct 2020 17:20:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=connolly.tech; s=protonmail; t=1602091253; bh=UHVeS8mhguivBrMvSGJLXZGFXdxxnZc9zuVyS2Pzp9c=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=V2BIlimCjeDjKFKCRlR4nwVZwK4a/wJwL5PzhTUiKr0vG0V8VpBtvfRGxTmbs/lWw NuLPb0dx7zykJWJhaW4k4HpeYLvF268FgLvZ7LWdOWo4SUOlj9sfwCjhTwqF0kG6VG b5QBD2n3vG3wOMrfE3LvGAMrpdXe+1vhrrN0kYUk= To: Akash Asthana , Mukesh Savaliya , Andy Gross , Bjorn Andersson From: Caleb Connolly Cc: ~postmarketos/upstreaming@lists.sr.ht, Caleb Connolly , linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Caleb Connolly Subject: [PATCH 5/5] i2c: geni: sdm845: dont perform DMA for the oneplus6 Message-ID: <20201007171807.285298-6-caleb@connolly.tech> In-Reply-To: <20201007171807.285298-1-caleb@connolly.tech> References: <20201007171807.285298-1-caleb@connolly.tech> MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The OnePlus 6/T has the same issues as the c630 causing a crash when DMA is used for i2c, so disable it. https://patchwork.kernel.org/patch/11133827/ Signed-off-by: Caleb Connolly --- drivers/i2c/busses/i2c-qcom-geni.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c index dead5db3315a..50a0674a6553 100644 --- a/drivers/i2c/busses/i2c-qcom-geni.c +++ b/drivers/i2c/busses/i2c-qcom-geni.c @@ -358,7 +358,8 @@ static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, struct geni_se *se = &gi2c->se; size_t len = msg->len; - if (!of_machine_is_compatible("lenovo,yoga-c630")) + if (!of_machine_is_compatible("lenovo,yoga-c630") && + !of_machine_is_compatible("oneplus,oneplus6")) dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); if (dma_buf) @@ -400,7 +401,8 @@ static int geni_i2c_tx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, struct geni_se *se = &gi2c->se; size_t len = msg->len; - if (!of_machine_is_compatible("lenovo,yoga-c630")) + if (!of_machine_is_compatible("lenovo,yoga-c630") && + !of_machine_is_compatible("oneplus,oneplus6")) dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); if (dma_buf)