linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] arm64: dts: qcom: Add PMI8996 DTSI file
@ 2021-05-25 20:02 Konrad Dybcio
  2021-05-25 20:02 ` [PATCH 2/7] arm64: dts: qcom: Add MSM8996v3.0 " Konrad Dybcio
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: Konrad Dybcio @ 2021-05-25 20:02 UTC (permalink / raw)
  To: ~postmarketos/upstreaming
  Cc: martin.botka, angelogioacchino.delregno, marijn.suijten,
	jamipkettunen, Konrad Dybcio, Andy Gross, Bjorn Andersson,
	Rob Herring, linux-arm-msm, devicetree, linux-kernel

PMI8996 is *almost* the same hardware as PMI8994, say for some annoyances:

- Boards equipped with PMI8996 now have to include pmic-id (which wasn't the case before)
- Different qpnp-ibb-discharge-resistor value (will be addressed after LABIBB is introduced)
- Different inhibit-derating-ua value (will be addressed after BCL is introduced)
- Different ramp_up_step value (will be addressed after [if?] QPNP Flash LED is introduced)

Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
---
 arch/arm64/boot/dts/qcom/pmi8996.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 arch/arm64/boot/dts/qcom/pmi8996.dtsi

diff --git a/arch/arm64/boot/dts/qcom/pmi8996.dtsi b/arch/arm64/boot/dts/qcom/pmi8996.dtsi
new file mode 100644
index 000000000000..31b47209e261
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/pmi8996.dtsi
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
+ */
+
+ /*
+  * PMI8996 is a slight modification of PMI8994 with
+  * some notable changes, like being the first PMIC
+  * whose the bootloader has to check to continue booting
+  * and a change to a LABIBB parameter.
+  */
+
+/ {
+	qcom,pmic-id = <0x20009 0x10013 0 0>;
+};
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 2/7] arm64: dts: qcom: Add MSM8996v3.0 DTSI file
  2021-05-25 20:02 [PATCH 1/7] arm64: dts: qcom: Add PMI8996 DTSI file Konrad Dybcio
@ 2021-05-25 20:02 ` Konrad Dybcio
  2021-05-26  3:18   ` Bjorn Andersson
  2021-05-25 20:02 ` [PATCH 3/7] arm64: dts: qcom: msm8996: Strictly limit USB2 host to USB2 speeds Konrad Dybcio
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: Konrad Dybcio @ 2021-05-25 20:02 UTC (permalink / raw)
  To: ~postmarketos/upstreaming
  Cc: martin.botka, angelogioacchino.delregno, marijn.suijten,
	jamipkettunen, Konrad Dybcio, Andy Gross, Bjorn Andersson,
	Rob Herring, linux-arm-msm, devicetree, linux-kernel

Add an overlay for MSM8996v3.0, which is a pre-final revision
of the said SoC. It has some stark differences with regards to
GPU, or more specifically its power delivery path. Oh, and of
course a different msm-id.

Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
---
 arch/arm64/boot/dts/qcom/msm8996-v3.0.dtsi | 59 ++++++++++++++++++++++
 1 file changed, 59 insertions(+)
 create mode 100644 arch/arm64/boot/dts/qcom/msm8996-v3.0.dtsi

diff --git a/arch/arm64/boot/dts/qcom/msm8996-v3.0.dtsi b/arch/arm64/boot/dts/qcom/msm8996-v3.0.dtsi
new file mode 100644
index 000000000000..b46f10b7413a
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8996-v3.0.dtsi
@@ -0,0 +1,59 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
+ */
+
+#include "msm8996.dtsi"
+
+ / {
+	qcom,msm-id = <246 0x30000>;
+ };
+
+ /*
+  * This revision seems to have differ GPU CPR
+  * parameters, GPU frequencies and some differences
+  * when it comes to voltage delivery to.. once again
+  * the GPU. Funnily enough, it's simpler to make it an
+  * overlay on top of 3.1 (the final one) than vice versa.
+  * The differences will show here as more and more
+  * features get enabled upstream.
+  */
+
+gpu_opp_table_3_0: gpu-opp-table-30 {
+	compatible = "operating-points-v2";
+
+	opp-624000000 {
+		opp-hz = /bits/ 64 <624000000>;
+		opp-level = <7>;
+	};
+
+	opp-560000000 {
+		opp-hz = /bits/ 64 <560000000>;
+		opp-level = <6>;
+	};
+
+	opp-510000000 {
+		opp-hz = /bits/ 64 <510000000>;
+		opp-level = <5>;
+	};
+
+	opp-401800000 {
+		opp-hz = /bits/ 64 <401800000>;
+		opp-level = <4>;
+	};
+
+	opp-315000000 {
+		opp-hz = /bits/ 64 <315000000>;
+		opp-level = <3>;
+	};
+
+	opp-214000000 {
+		opp-hz = /bits/ 64 <214000000>;
+		opp-level = <3>;
+	};
+
+	opp-133000000 {
+		opp-hz = /bits/ 64 <133000000>;
+		opp-level = <3>;
+	};
+};
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 3/7] arm64: dts: qcom: msm8996: Strictly limit USB2 host to USB2 speeds
  2021-05-25 20:02 [PATCH 1/7] arm64: dts: qcom: Add PMI8996 DTSI file Konrad Dybcio
  2021-05-25 20:02 ` [PATCH 2/7] arm64: dts: qcom: Add MSM8996v3.0 " Konrad Dybcio
@ 2021-05-25 20:02 ` Konrad Dybcio
  2021-05-25 20:02 ` [PATCH 4/7] arm64: dts: qcom: msm8996: Disable ADSP by default Konrad Dybcio
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: Konrad Dybcio @ 2021-05-25 20:02 UTC (permalink / raw)
  To: ~postmarketos/upstreaming
  Cc: martin.botka, angelogioacchino.delregno, marijn.suijten,
	jamipkettunen, Konrad Dybcio, Andy Gross, Bjorn Andersson,
	Rob Herring, linux-arm-msm, devicetree, linux-kernel

As the name implies, the USB2 controller should only operate at
USB2 speeds. Make sure it does just that by pinning it to USB
High-Speed (USB2) mode.

Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
---
 arch/arm64/boot/dts/qcom/msm8996.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
index 12afd49e0097..08a6e2b5a54b 100644
--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
@@ -2588,6 +2588,7 @@ usb2: usb@76f8800 {
 			assigned-clock-rates = <19200000>, <60000000>;
 
 			power-domains = <&gcc USB30_GDSC>;
+			qcom,select-utmi-as-pipe-clk;
 			status = "disabled";
 
 			dwc3@7600000 {
@@ -2596,6 +2597,7 @@ dwc3@7600000 {
 				interrupts = <0 138 IRQ_TYPE_LEVEL_HIGH>;
 				phys = <&hsusb_phy2>;
 				phy-names = "usb2-phy";
+				maximum-speed = "high-speed";
 				snps,dis_u2_susphy_quirk;
 				snps,dis_enblslpm_quirk;
 			};
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 4/7] arm64: dts: qcom: msm8996: Disable ADSP by default
  2021-05-25 20:02 [PATCH 1/7] arm64: dts: qcom: Add PMI8996 DTSI file Konrad Dybcio
  2021-05-25 20:02 ` [PATCH 2/7] arm64: dts: qcom: Add MSM8996v3.0 " Konrad Dybcio
  2021-05-25 20:02 ` [PATCH 3/7] arm64: dts: qcom: msm8996: Strictly limit USB2 host to USB2 speeds Konrad Dybcio
@ 2021-05-25 20:02 ` Konrad Dybcio
  2021-05-25 20:02 ` [PATCH 5/7] arm64: dts: qcom: msm8996: Add DMA to QUPs and UARTs Konrad Dybcio
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: Konrad Dybcio @ 2021-05-25 20:02 UTC (permalink / raw)
  To: ~postmarketos/upstreaming
  Cc: martin.botka, angelogioacchino.delregno, marijn.suijten,
	jamipkettunen, Konrad Dybcio, Andy Gross, Bjorn Andersson,
	Rob Herring, linux-arm-msm, devicetree, linux-kernel

Disable the ADSP by default to reduce boot times when
no firmware is supplied. Enable it on boards that did not
previously disable it.

Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
---
 arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi | 4 ++++
 arch/arm64/boot/dts/qcom/apq8096-ifc6640.dts | 4 ++++
 arch/arm64/boot/dts/qcom/msm8996.dtsi        | 2 ++
 3 files changed, 10 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi b/arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi
index d2a5fb0c8df1..5deffdaeca01 100644
--- a/arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi
+++ b/arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi
@@ -133,6 +133,10 @@ wlan_en: wlan-en-1-8v {
 	};
 };
 
+&adsp_pil {
+	status = "okay";
+};
+
 &blsp1_i2c3 {
 	/* On Low speed expansion */
 	label = "LS-I2C0";
diff --git a/arch/arm64/boot/dts/qcom/apq8096-ifc6640.dts b/arch/arm64/boot/dts/qcom/apq8096-ifc6640.dts
index 8c7a27e972b7..1c7355014250 100644
--- a/arch/arm64/boot/dts/qcom/apq8096-ifc6640.dts
+++ b/arch/arm64/boot/dts/qcom/apq8096-ifc6640.dts
@@ -81,6 +81,10 @@ vph_pwr: vph-pwr-regulator {
 	};
 };
 
+&adsp_pil {
+	status = "okay";
+};
+
 &blsp2_uart2 {
 	status = "okay";
 	pinctrl-names = "default", "sleep";
diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
index 08a6e2b5a54b..2327101c255d 100644
--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
@@ -2676,6 +2676,8 @@ adsp_pil: remoteproc@9300000 {
 			qcom,smem-states = <&smp2p_adsp_out 0>;
 			qcom,smem-state-names = "stop";
 
+			status = "disabled";
+
 			smd-edge {
 				interrupts = <GIC_SPI 156 IRQ_TYPE_EDGE_RISING>;
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 5/7] arm64: dts: qcom: msm8996: Add DMA to QUPs and UARTs
  2021-05-25 20:02 [PATCH 1/7] arm64: dts: qcom: Add PMI8996 DTSI file Konrad Dybcio
                   ` (2 preceding siblings ...)
  2021-05-25 20:02 ` [PATCH 4/7] arm64: dts: qcom: msm8996: Disable ADSP by default Konrad Dybcio
@ 2021-05-25 20:02 ` Konrad Dybcio
  2021-05-25 20:02 ` [PATCH 6/7] arm64: dts: qcom: msm8996: Fix BLSP2_I2C6 IRQ Konrad Dybcio
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 15+ messages in thread
From: Konrad Dybcio @ 2021-05-25 20:02 UTC (permalink / raw)
  To: ~postmarketos/upstreaming
  Cc: martin.botka, angelogioacchino.delregno, marijn.suijten,
	jamipkettunen, Konrad Dybcio, Andy Gross, Bjorn Andersson,
	Rob Herring, linux-arm-msm, devicetree, linux-kernel

Add BAM DMA nodes and add required properties to devices
to enable DMA operations.

Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
---
 arch/arm64/boot/dts/qcom/msm8996.dtsi | 38 +++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
index 2327101c255d..cc12de5a9d6b 100644
--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
@@ -2436,6 +2436,17 @@ sdhc2: sdhci@74a4900 {
 			status = "disabled";
 		 };
 
+		blsp1_dma: dma@7544000 {
+			compatible = "qcom,bam-v1.7.0";
+			reg = <0x07544000 0x2b000>;
+			interrupts = <GIC_SPI 238 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&gcc GCC_BLSP1_AHB_CLK>;
+			clock-names = "bam_clk";
+			qcom,controlled-remotely;
+			#dma-cells = <1>;
+			qcom,ee = <0>;
+		};
+
 		blsp1_uart2: serial@7570000 {
 			compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
 			reg = <0x07570000 0x1000>;
@@ -2443,6 +2454,8 @@ blsp1_uart2: serial@7570000 {
 			clocks = <&gcc GCC_BLSP1_UART2_APPS_CLK>,
 				 <&gcc GCC_BLSP1_AHB_CLK>;
 			clock-names = "core", "iface";
+			dmas = <&blsp1_dma 2>, <&blsp1_dma 3>;
+			dma-names = "tx", "rx";
 			status = "disabled";
 		};
 
@@ -2456,6 +2469,8 @@ blsp1_spi1: spi@7575000 {
 			pinctrl-names = "default", "sleep";
 			pinctrl-0 = <&blsp1_spi1_default>;
 			pinctrl-1 = <&blsp1_spi1_sleep>;
+			dmas = <&blsp1_dma 12>, <&blsp1_dma 13>;
+			dma-names = "tx", "rx";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			status = "disabled";
@@ -2471,11 +2486,24 @@ blsp1_i2c3: i2c@7577000 {
 			pinctrl-names = "default", "sleep";
 			pinctrl-0 = <&blsp1_i2c3_default>;
 			pinctrl-1 = <&blsp1_i2c3_sleep>;
+			dmas = <&blsp1_dma 16>, <&blsp1_dma 17>;
+			dma-names = "tx", "rx";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			status = "disabled";
 		};
 
+		blsp2_dma: dma@7584000 {
+			compatible = "qcom,bam-v1.7.0";
+			reg = <0x07584000 0x2b000>;
+			interrupts = <GIC_SPI 239 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&gcc GCC_BLSP2_AHB_CLK>;
+			clock-names = "bam_clk";
+			qcom,controlled-remotely;
+			#dma-cells = <1>;
+			qcom,ee = <0>;
+		};
+
 		blsp2_uart2: serial@75b0000 {
 			compatible = "qcom,msm-uartdm-v1.4", "qcom,msm-uartdm";
 			reg = <0x075b0000 0x1000>;
@@ -2506,6 +2534,8 @@ blsp2_i2c1: i2c@75b5000 {
 			pinctrl-names = "default", "sleep";
 			pinctrl-0 = <&blsp2_i2c1_default>;
 			pinctrl-1 = <&blsp2_i2c1_sleep>;
+			dmas = <&blsp2_dma 12>, <&blsp2_dma 13>;
+			dma-names = "tx", "rx";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			status = "disabled";
@@ -2521,6 +2551,8 @@ blsp2_i2c2: i2c@75b6000 {
 			pinctrl-names = "default", "sleep";
 			pinctrl-0 = <&blsp2_i2c2_default>;
 			pinctrl-1 = <&blsp2_i2c2_sleep>;
+			dmas = <&blsp2_dma 14>, <&blsp2_dma 15>;
+			dma-names = "tx", "rx";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			status = "disabled";
@@ -2535,6 +2567,8 @@ blsp2_i2c5: i2c@75b9000 {
 			clock-names = "iface", "core";
 			pinctrl-names = "default";
 			pinctrl-0 = <&blsp2_i2c5_default>;
+			dmas = <&blsp2_dma 20>, <&blsp2_dma 21>;
+			dma-names = "tx", "rx";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			status = "disabled";
@@ -2550,6 +2584,8 @@ blsp2_i2c6: i2c@75ba000 {
 			pinctrl-names = "default", "sleep";
 			pinctrl-0 = <&blsp2_i2c6_default>;
 			pinctrl-1 = <&blsp2_i2c6_sleep>;
+			dmas = <&blsp2_dma 22>, <&blsp2_dma 23>;
+			dma-names = "tx", "rx";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			status = "disabled";
@@ -2565,6 +2601,8 @@ blsp2_spi6: spi@75ba000{
 			pinctrl-names = "default", "sleep";
 			pinctrl-0 = <&blsp2_spi6_default>;
 			pinctrl-1 = <&blsp2_spi6_sleep>;
+			dmas = <&blsp2_dma 22>, <&blsp2_dma 23>;
+			dma-names = "tx", "rx";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			status = "disabled";
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 6/7] arm64: dts: qcom: msm8996: Fix BLSP2_I2C6 IRQ
  2021-05-25 20:02 [PATCH 1/7] arm64: dts: qcom: Add PMI8996 DTSI file Konrad Dybcio
                   ` (3 preceding siblings ...)
  2021-05-25 20:02 ` [PATCH 5/7] arm64: dts: qcom: msm8996: Add DMA to QUPs and UARTs Konrad Dybcio
@ 2021-05-25 20:02 ` Konrad Dybcio
  2021-05-25 20:02 ` [PATCH 7/7] arm64: dts: qcom: Add support for SONY Xperia X Performance / XZ / XZs (msm8996, Tone platform) Konrad Dybcio
  2021-05-26  3:16 ` [PATCH 1/7] arm64: dts: qcom: Add PMI8996 DTSI file Bjorn Andersson
  6 siblings, 0 replies; 15+ messages in thread
From: Konrad Dybcio @ 2021-05-25 20:02 UTC (permalink / raw)
  To: ~postmarketos/upstreaming
  Cc: martin.botka, angelogioacchino.delregno, marijn.suijten,
	jamipkettunen, Konrad Dybcio, Andy Gross, Bjorn Andersson,
	Rob Herring, linux-arm-msm, devicetree, linux-kernel

Fix a wrong IRQ in BLSP2_I2C6 node.

Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
---
 arch/arm64/boot/dts/qcom/msm8996.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
index cc12de5a9d6b..57f32e0aa4a3 100644
--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
@@ -2577,7 +2577,7 @@ blsp2_i2c5: i2c@75b9000 {
 		blsp2_i2c6: i2c@75ba000 {
 			compatible = "qcom,i2c-qup-v2.2.1";
 			reg = <0x75ba000 0x1000>;
-			interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
+			interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&gcc GCC_BLSP2_AHB_CLK>,
 				<&gcc GCC_BLSP2_QUP6_I2C_APPS_CLK>;
 			clock-names = "iface", "core";
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 7/7] arm64: dts: qcom: Add support for SONY Xperia X Performance / XZ / XZs (msm8996, Tone platform)
  2021-05-25 20:02 [PATCH 1/7] arm64: dts: qcom: Add PMI8996 DTSI file Konrad Dybcio
                   ` (4 preceding siblings ...)
  2021-05-25 20:02 ` [PATCH 6/7] arm64: dts: qcom: msm8996: Fix BLSP2_I2C6 IRQ Konrad Dybcio
@ 2021-05-25 20:02 ` Konrad Dybcio
  2021-05-26  3:38   ` Bjorn Andersson
  2021-05-26  3:16 ` [PATCH 1/7] arm64: dts: qcom: Add PMI8996 DTSI file Bjorn Andersson
  6 siblings, 1 reply; 15+ messages in thread
From: Konrad Dybcio @ 2021-05-25 20:02 UTC (permalink / raw)
  To: ~postmarketos/upstreaming
  Cc: martin.botka, angelogioacchino.delregno, marijn.suijten,
	jamipkettunen, Konrad Dybcio, Andy Gross, Bjorn Andersson,
	Rob Herring, linux-arm-msm, devicetree, linux-kernel, Kees Cook,
	Anton Vorontsov, Colin Cross, Tony Luck

From: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>

Add support for following boards:

- Xperia X Performance (dora)
- Xperia XZ (kagura)
- Xperia XZs (keyaki)

They are all based on the SONY Tone platform and feature largely similar hardware
with the most obvious differences being lack of USB-C and ToF sensor on Dora and
different camera sensor on Keyaki.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
---
 arch/arm64/boot/dts/qcom/Makefile             |   6 +
 .../msm8996-pmi8996-sony-xperia-tone-dora.dts |  11 +
 ...sm8996-pmi8996-sony-xperia-tone-kagura.dts |  11 +
 ...sm8996-pmi8996-sony-xperia-tone-keyaki.dts |  11 +
 .../qcom/msm8996-sony-xperia-tone-dora.dts    |  27 +
 .../qcom/msm8996-sony-xperia-tone-kagura.dts  |  15 +
 .../qcom/msm8996-sony-xperia-tone-keyaki.dts  |  26 +
 .../dts/qcom/msm8996-sony-xperia-tone.dtsi    | 980 ++++++++++++++++++
 arch/arm64/boot/dts/qcom/msm8996.dtsi         |  12 +-
 9 files changed, 1093 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dts
 create mode 100644 arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-kagura.dts
 create mode 100644 arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-keyaki.dts
 create mode 100644 arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-dora.dts
 create mode 100644 arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-kagura.dts
 create mode 100644 arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-keyaki.dts
 create mode 100644 arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi

diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
index ca4a7819d2c4..d079dc33d833 100644
--- a/arch/arm64/boot/dts/qcom/Makefile
+++ b/arch/arm64/boot/dts/qcom/Makefile
@@ -25,6 +25,12 @@ dtb-$(CONFIG_ARCH_QCOM)	+= msm8994-sony-xperia-kitakami-satsuki.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= msm8994-sony-xperia-kitakami-sumire.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= msm8994-sony-xperia-kitakami-suzuran.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-mtp.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-sony-xperia-tone-dora.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-sony-xperia-tone-kagura.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-sony-xperia-tone-keyaki.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-pmi8996-sony-xperia-tone-dora.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-pmi8996-sony-xperia-tone-kagura.dtb
+dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-pmi8996-sony-xperia-tone-keyaki.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= msm8998-asus-novago-tp370ql.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= msm8998-hp-envy-x2.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= msm8998-lenovo-miix-630.dtb
diff --git a/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dts b/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dts
new file mode 100644
index 000000000000..b57ea0824ea5
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dts
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
+ */
+
+#include "msm8996-sony-xperia-tone-dora.dts"
+#include "pmi8996.dtsi"
+
+/ {
+	model = "Sony Xperia X Performance (PMI8996)";
+};
\ No newline at end of file
diff --git a/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-kagura.dts b/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-kagura.dts
new file mode 100644
index 000000000000..dd3dc8860ce1
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-kagura.dts
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
+ */
+
+#include "msm8996-sony-xperia-tone-kagura.dts"
+#include "pmi8996.dtsi"
+
+/ {
+	model = "Sony Xperia XZ (PMI8996)";
+};
\ No newline at end of file
diff --git a/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-keyaki.dts b/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-keyaki.dts
new file mode 100644
index 000000000000..95e04287126d
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-keyaki.dts
@@ -0,0 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
+ */
+
+#include "msm8996-sony-xperia-tone-keyaki.dts"
+#include "pmi8996.dtsi"
+
+/ {
+	model = "Sony Xperia XZs (PMI8996)";
+};
\ No newline at end of file
diff --git a/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-dora.dts b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-dora.dts
new file mode 100644
index 000000000000..4e44d6f32345
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-dora.dts
@@ -0,0 +1,27 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2021, AngeloGioacchino Del Regno
+ *                     <angelogioacchino.delregno@somainline.org>
+ * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
+ */
+
+/dts-v1/;
+
+#include "msm8996-sony-xperia-tone.dtsi"
+
+/ {
+	model = "Sony Xperia X Performance";
+	compatible = "sony,dora-row", "qcom,msm8996";
+};
+
+/delete-node/ &tof_sensor;
+/delete-node/ &pm8994_l11;
+/delete-node/ &pm8994_l14;
+
+&usb_detect {
+	pins = "gpio24";
+};
+
+&usb3_id {
+	id-gpio = <&tlmm 24 GPIO_ACTIVE_LOW>;
+};
diff --git a/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-kagura.dts b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-kagura.dts
new file mode 100644
index 000000000000..38caa1ee371e
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-kagura.dts
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2021, AngeloGioacchino Del Regno
+ *                     <angelogioacchino.delregno@somainline.org>
+ * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
+ */
+
+/dts-v1/;
+
+#include "msm8996-sony-xperia-tone.dtsi"
+
+/ {
+	model = "Sony Xperia XZ";
+	compatible = "sony,kagura-row", "qcom,msm8996";
+};
diff --git a/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-keyaki.dts b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-keyaki.dts
new file mode 100644
index 000000000000..df61b16a2905
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-keyaki.dts
@@ -0,0 +1,26 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2021, AngeloGioacchino Del Regno
+ *                     <angelogioacchino.delregno@somainline.org>
+ * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
+ */
+
+/dts-v1/;
+
+#include "msm8996-sony-xperia-tone.dtsi"
+
+/ {
+	model = "Sony Xperia XZs";
+	compatible = "sony,keyaki-row", "qcom,msm8996";
+};
+
+&pm8994_l19 {
+	regulator-min-microvolt = <2700000>;
+	regulator-max-microvolt = <2700000>;
+};
+
+&pm8994_l30 {
+	regulator-min-microvolt = <2800000>;
+	regulator-max-microvolt = <2800000>;
+	regulator-pull-down;
+};
diff --git a/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi
new file mode 100644
index 000000000000..4644d5f9d1a6
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi
@@ -0,0 +1,980 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2021, AngeloGioacchino Del Regno
+ *                     <angelogioacchino.delregno@somainline.org>
+ * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
+ */
+
+#include "msm8996.dtsi"
+#include "pm8994.dtsi"
+#include "pmi8994.dtsi"
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/input/gpio-keys.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
+#include <dt-bindings/pinctrl/qcom,pmic-mpp.h>
+
+/delete-node/ &hdmi;
+/delete-node/ &hdmi_phy;
+/delete-node/ &mdp5_intf3_out;
+/delete-node/ &slpi_region;
+/delete-node/ &venus_region;
+/delete-node/ &zap_shader_region;
+
+/ {
+	qcom,msm-id = <246 0x30001>; /* MSM8996 V3.1 (Final) */
+	qcom,pmic-id = <0x20009 0x2000a 0 0>; /* PM8994 + PMI8994 */
+	qcom,board-id = <8 0>;
+
+	chosen {
+		/*
+		 * Due to an unknown-for-a-few-years regression,
+		 * SDHCI only works on MSM8996 in PIO (lame) mode.
+		 */
+		bootargs = "sdhci.debug_quirks=0x40 sdhci.debug_quirks2=0x4 maxcpus=2";
+	};
+
+	reserved-memory {
+		ramoops@a7f00000 {
+			compatible = "ramoops";
+			reg = <0 0xa7f00000 0 0x100000>;
+			record-size = <0x20000>;
+			console-size = <0x40000>;
+			ftrace-size = <0x20000>;
+			pmsg-size = <0x20000>;
+			ecc-size = <16>;
+		};
+
+		cont_splash_mem: memory@83401000 {
+			reg = <0 0x83401000 0 0x23ff000>;
+			no-map;
+		};
+
+		zap_shader_region: gpu@90400000 {
+			compatible = "shared-dma-pool";
+			reg = <0x0 0x90400000 0x0 0x2000>;
+			no-map;
+		};
+
+		slpi_region: memory@90500000 {
+			reg = <0 0x90500000 0 0xa00000>;
+			no-map;
+		};
+
+		venus_region: memory@90f00000 {
+			reg = <0 0x90f00000 0 0x500000>;
+			no-map;
+		};
+	};
+
+	panel_tvdd: tvdd-regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "panel_tvdd";
+		gpio = <&tlmm 50 GPIO_ACTIVE_HIGH>;
+		pinctrl-0 = <&tp_vddio_en>;
+		pinctrl-names = "default";
+	};
+
+	usb3_id: usb3-id {
+		compatible = "linux,extcon-usb-gpio";
+		id-gpio = <&tlmm 25 GPIO_ACTIVE_LOW>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&usb_detect>;
+	};
+
+	vph_pwr: vph-pwr-regulator {
+		compatible = "regulator-fixed";
+		regulator-min-microvolt = <3700000>;
+		regulator-max-microvolt = <3700000>;
+		regulator-name = "vph_pwr";
+		regulator-always-on;
+		regulator-boot-on;
+	};
+
+	wlan_en: wlan-en-1-8v {
+		compatible = "regulator-fixed";
+		regulator-name = "wlan-en-regulator";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		gpio = <&tlmm 84 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&wl_reg_on>;
+
+		/* WLAN card specific delay */
+		startup-delay-us = <70000>;
+		enable-active-high;
+	};
+};
+
+&blsp1_i2c3 {
+	status = "okay";
+	clock-frequency = <355000>;
+
+	tof_sensor: vl53l0x@29 {
+		compatible = "st,vl53l0x";
+		reg = <0x29>;
+	};
+};
+
+&blsp1_uart2 {
+	status = "okay";
+};
+
+&blsp2_i2c5 {
+	status = "okay";
+	clock-frequency = <355000>;
+
+	/* FUSB301 USB-C controller */
+};
+
+&blsp2_i2c6 {
+	status = "okay";
+	clock-frequency = <355000>;
+
+	synaptics@2c {
+		compatible = "syna,rmi4-i2c";
+		reg = <0x2c>;
+		interrupt-parent = <&tlmm>;
+		interrupts = <125 IRQ_TYPE_EDGE_FALLING>;
+		vdd-supply = <&panel_tvdd>;
+
+		syna,reset-delay-ms = <220>;
+		syna,startup-delay-ms = <220>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		rmi4-f01@1 {
+			reg = <0x1>;
+			syna,nosleep-mode = <1>;
+		};
+
+		rmi4-f11@11 {
+			reg = <0x11>;
+			syna,sensor-type = <1>;
+		};
+	};
+};
+
+&blsp2_uart2 {
+	status = "okay";
+};
+
+&camera0_mclk {
+	drive-strength = <2>;
+	output-low;
+};
+
+&camera0_pwdn {
+	drive-strength = <2>;
+	output-low;
+};
+
+&camera0_rst {
+	pins = "gpio30";
+	drive-strength = <2>;
+	output-low;
+};
+
+&camera2_mclk {
+	drive-strength = <2>;
+	output-low;
+};
+
+&camera2_rst {
+	drive-strength = <2>;
+	output-low;
+};
+
+&CPU0 {
+	cpu-supply = <&pmi8994_s11>;
+};
+
+&CPU1 {
+	cpu-supply = <&pmi8994_s11>;
+};
+
+&CPU2 {
+	cpu-supply = <&pmi8994_s11>;
+};
+
+&CPU3 {
+	cpu-supply = <&pmi8994_s11>;
+};
+
+&hsusb_phy1 {
+	status = "okay";
+
+	vdda-pll-supply = <&pm8994_l12>;
+	vdda-phy-dpdm-supply = <&pm8994_l24>;
+};
+
+&mmcc {
+	vdd-gfx-supply = <&vdd_gfx>;
+};
+
+&pcie0 {
+	status = "okay";
+	perst-gpio = <&tlmm 35 GPIO_ACTIVE_LOW>;
+	wake-gpio = <&tlmm 37 GPIO_ACTIVE_HIGH>;
+	vddpe-3v3-supply = <&wlan_en>;
+	vdda-supply = <&pm8994_l28>;
+};
+
+&pcie_phy {
+	status = "okay";
+
+	vdda-phy-supply = <&pm8994_l28>;
+	vdda-pll-supply = <&pm8994_l12>;
+};
+
+&pm8994_gpios {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pm8994_gpio_1 &pm8994_vol_down_n &pm8994_vol_up_n
+		     &pm8994_cam_snap_n &pm8994_cam_focus_n &pm8994_gpio_6
+		     &pm8994_nfc_dload &pm8994_gpio_8 &pm8994_gpio_9
+		     &pm8994_gpio_nfc_clk &pm8994_gpio_11 &pm8994_gpio_12
+		     &pm8994_ear_en &pm8994_gpio_14 &pm8994_pm_divclk1
+		     &pm8994_pmi_clk &pm8994_gpio_17 &pm8994_rome_sleep
+		     &pm8994_gpio_19 &pm8994_gpio_22>;
+
+	gpio-line-names =
+		"NC",
+		"VOL_DOWN_N",
+		"VOL_UP_N",
+		"SNAPSHOT_N",
+		"FOCUS_N",
+		"NC",
+		"NFC_VEN",
+		"NC",
+		"NC",
+		"NC",
+		"NC",
+		"NC",
+		"EAR_EN",
+		"NC",
+		"PM_DIVCLK1",
+		"PMI_CLK",
+		"NC",
+		"WL_SLEEP_CLK",
+		"NC",
+		"PMIC_SPON",
+		"UIM_BATT_ALARM",
+		"PMK_SLEEP_CLK";
+
+	pm8994_gpio_1: pm-gpio1-nc {
+		pins = "gpio1";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		bias-high-impedance;
+	};
+
+	pm8994_vol_down_n: vol-down-n {
+		pins = "gpio2";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		input-enable;
+		bias-pull-up;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pm8994_vol_up_n: vol-up-n {
+		pins = "gpio3";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		input-enable;
+		bias-pull-up;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pm8994_cam_snap_n: camera-snapshot-n {
+		pins = "gpio4";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		input-enable;
+		bias-pull-up;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pm8994_cam_focus_n: camera-focus-n {
+		pins = "gpio5";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		input-enable;
+		bias-pull-up;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pm8994_gpio_6: pm-gpio6-nc {
+		pins = "gpio6";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		bias-high-impedance;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pm8994_nfc_dload: nfc-download {
+		pins = "gpio7";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		output-low;
+		drive-push-pull;
+		bias-disable;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pm8994_gpio_8: pm-gpio8-nc {
+		pins = "gpio8";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		output-low;
+		drive-push-pull;
+		bias-high-impedance;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pm8994_gpio_9: pm-gpio9-nc {
+		pins = "gpio9";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		output-high;
+		drive-push-pull;
+		bias-high-impedance;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pm8994_gpio_nfc_clk: nfc-clock {
+		pins = "gpio10";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		input-enable;
+		drive-push-pull;
+		bias-pull-down;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pm8994_gpio_11: pm-gpio11-nc {
+		pins = "gpio11";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		bias-high-impedance;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pm8994_gpio_12: pm-gpio12-nc {
+		pins = "gpio12";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		bias-high-impedance;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pm8994_ear_en: ear-enable {
+		pins = "gpio13";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		output-high;
+		drive-push-pull;
+		bias-disable;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pm8994_gpio_14: pm-gpio14-nc {
+		pins = "gpio14";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		input-enable;
+		bias-high-impedance;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pm8994_pm_divclk1: pm-divclk1-gpio {
+		pins = "gpio15";
+		function = "func1";
+		output-high;
+		drive-push-pull;
+		bias-high-impedance;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pm8994_pmi_clk: pmi-clk-gpio {
+		pins = "gpio16";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+	};
+
+	pm8994_gpio_17: pm-gpio17-nc {
+		pins = "gpio17";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		bias-high-impedance;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pm8994_rome_sleep: rome-sleep {
+		pins = "gpio18";
+		function = PMIC_GPIO_FUNC_FUNC2;
+		output-low;
+		drive-push-pull;
+		bias-disable;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_MED>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pm8994_gpio_19: pm-gpio19-nc {
+		pins = "gpio19";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		output-low;
+		drive-push-pull;
+		bias-high-impedance;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pm8994_gpio_22: pm-gpio22-nc {
+		pins = "gpio22";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		bias-high-impedance;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+};
+
+&pm8994_mpps {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pm8994_mpp_lcd_id_adc &pm8994_mpp4
+			&pm8994_mpp_flash_th &pm8994_mpp6_def
+			&pm8994_mpp_rf_id>;
+
+	gpio-line-names =
+		"SDC_UIM_VBIAS",
+		"LCD_ID_ADC",
+		"VREF_DACX",
+		"NC",
+		"FLASH_THERM",
+		"NC",
+		"NC",
+		"RF_ID";
+
+	pm8994_mpp_lcd_id_adc: lcd-id_adc-mpp {
+		pins = "mpp2";
+		function = PMIC_MPP_FUNC_ANALOG;
+		input-enable;
+		qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH6>;
+	};
+
+	pm8994_mpp4: pm-mpp4-nc {
+		pins = "mpp4";
+		function = PMIC_MPP_FUNC_DIGITAL;
+		bias-high-impedance;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pm8994_mpp_flash_th: flash-therm-mpp {
+		pins = "mpp5";
+		function = PMIC_MPP_FUNC_ANALOG;
+		input-enable;
+		qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH5>;
+	};
+
+	pm8994_mpp6_def: mpp6-nc {
+		pins = "mpp6";
+		function = PMIC_MPP_FUNC_DIGITAL;
+		bias-high-impedance;
+	};
+
+	pm8994_mpp_rf_id: rf-id-mpp {
+		pins = "mpp8";
+		function = PMIC_MPP_FUNC_ANALOG;
+		input-enable;
+		qcom,amux-route = <PMIC_MPP_AMUX_ROUTE_CH8>;
+	};
+};
+
+&pm8994_resin {
+	status = "okay";
+	linux,code = <KEY_VOLUMEUP>;
+};
+
+&pmi8994_gpios {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pmi8994_vib_ldo_en &pmi8994_gpio_2 &pmi8994_gpio_3
+		     &pmi8994_gpio_4 &pmi8994_gpio_5 &pmi8994_gpio_6
+		     &pmi8994_gpio_7 &pmi8994_gpio_8 &pmi8994_usb_switch_sel
+		     &pmi8994_gpio_10>;
+
+	gpio-line-names =
+		"VIB_LDO_EN",
+		"NC",
+		"NC",
+		"NC",
+		"NC",
+		"NC",
+		"NC",
+		"NC",
+		"USB_SWITCH_SEL",
+		"NC";
+
+	pmi8994_vib_ldo_en: vib-ldo-en-gpio {
+		pins = "gpio1";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		output-low;
+		bias-disable;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pmi8994_gpio_2: pmi-gpio2-nc {
+		pins = "gpio2";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		input-enable;
+		bias-high-impedance;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pmi8994_gpio_3: pmi-gpio3-nc {
+		pins = "gpio3";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		input-enable;
+		bias-high-impedance;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+		power-source = <PM8994_GPIO_VPH>;
+	};
+
+	pmi8994_gpio_4: pmi-gpio4-nc {
+		pins = "gpio4";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		output-high;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pmi8994_gpio_5: pmi-gpio5-nc {
+		pins = "gpio5";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		output-high;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pmi8994_gpio_6: pmi-gpio6-nc {
+		pins = "gpio6";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		output-high;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pmi8994_gpio_7: pmi-gpio7-nc {
+		pins = "gpio7";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		output-high;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pmi8994_gpio_8: pmi-gpio8-nc {
+		pins = "gpio8";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+		output-high;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+
+	pmi8994_usb_switch_sel: usb-switch-sel {
+		pins = "gpio9";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		drive-push-pull;
+	};
+
+	pmi8994_gpio_10: pmi-gpio10-nc {
+		pins = "gpio10";
+		function = PMIC_GPIO_FUNC_NORMAL;
+		output-low;
+		drive-push-pull;
+		bias-disable;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+		power-source = <PM8994_GPIO_S4>;
+	};
+};
+
+&pmi8994_spmi_regulators {
+	qcom,saw-reg = <&saw3>;
+
+	vdd_gfx:
+	pmi8994_s2: s2 {
+		/* Pinned to a high value for now to avoid random crashes. */
+		regulator-min-microvolt = <1015000>;
+		regulator-max-microvolt = <1015000>;
+		regulator-name = "vdd_gfx";
+		regulator-always-on;
+	};
+
+	pmi8994_s9: s9 {
+		qcom,saw-slave;
+	};
+
+	pmi8994_s10: s10 {
+		qcom,saw-slave;
+	};
+
+	pmi8994_s11: s11 {
+		qcom,saw-leader;
+		regulator-always-on;
+		regulator-min-microvolt = <470000>;
+		regulator-max-microvolt = <1140000>;
+	};
+};
+
+&pmi8994_wled {
+	status = "okay";
+	default-brightness = <512>;
+};
+
+&rpm_requests {
+	pm8994-regulators {
+		compatible = "qcom,rpm-pm8994-regulators";
+
+		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_l1-supply = <&pm8994_s3>;
+		vdd_l2_l26_l28-supply = <&pm8994_s3>;
+		vdd_l3_l11-supply = <&pm8994_s3>;
+		vdd_l4_l27_l31-supply = <&pm8994_s3>;
+		vdd_l5_l7-supply = <&pm8994_s5>;
+		vdd_l6_l12_l32-supply = <&pm8994_s5>;
+		vdd_l8_l16_l30-supply = <&vph_pwr>;
+		vdd_l14_l15-supply = <&pm8994_s5>;
+		vdd_l20_l21-supply = <&pm8994_s5>;
+		vdd_l25-supply = <&pm8994_s3>;
+		vdd_lvs1_2-supply = <&pm8994_s4>;
+
+		pm8994_s3: s3 {
+			regulator-min-microvolt = <1300000>;
+			regulator-max-microvolt = <1300000>;
+		};
+
+		pm8994_s4: s4 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+			regulator-system-load = <325000>;
+			regulator-always-on;
+		};
+
+		pm8994_s5: s5 {
+			regulator-min-microvolt = <2150000>;
+			regulator-max-microvolt = <2150000>;
+		};
+
+		pm8994_s7: s7 {
+			regulator-min-microvolt = <800000>;
+			regulator-max-microvolt = <800000>;
+		};
+
+		pm8994_l1: l1 {
+			regulator-min-microvolt = <1000000>;
+			regulator-max-microvolt = <1000000>;
+		};
+
+		pm8994_l2: l2 {
+			regulator-min-microvolt = <1250000>;
+			regulator-max-microvolt = <1250000>;
+		};
+
+		pm8994_l3: l3 {
+			regulator-min-microvolt = <1100000>;
+			regulator-max-microvolt = <1100000>;
+		};
+
+		pm8994_l4: l4 {
+			regulator-min-microvolt = <1225000>;
+			regulator-max-microvolt = <1225000>;
+		};
+
+		/* L6 and L7 seem unused. */
+
+		pm8994_l8: l8 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+		};
+
+		pm8994_l9: l9 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+		};
+
+		pm8994_l10: l10 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+		};
+
+		pm8994_l11: l11 {
+			regulator-min-microvolt = <1100000>;
+			regulator-max-microvolt = <1100000>;
+		};
+
+		pm8994_l12: l12 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+			regulator-allow-set-load;
+		};
+
+		pm8994_l13: l13 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <2950000>;
+			regulator-system-load = <22000>;
+			regulator-allow-set-load;
+		};
+
+		pm8994_l14: l14 {
+			regulator-min-microvolt = <1700000>;
+			regulator-max-microvolt = <1900000>;
+		};
+
+		pm8994_l15: l15 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+		};
+
+		pm8994_l16: l16 {
+			regulator-min-microvolt = <2700000>;
+			regulator-max-microvolt = <2700000>;
+		};
+
+		pm8994_l17: l17 {
+			regulator-min-microvolt = <2200000>;
+			regulator-max-microvolt = <2500000>;
+		};
+
+		pm8994_l18: l18 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+		};
+
+		pm8994_l19: l19 {
+			regulator-min-microvolt = <3000000>;
+			regulator-max-microvolt = <3000000>;
+		};
+
+		pm8994_l20: l20 {
+			regulator-min-microvolt = <2950000>;
+			regulator-max-microvolt = <2950000>;
+			regulator-system-load = <570000>;
+			regulator-allow-set-load;
+		};
+
+		pm8994_l21: l21 {
+			regulator-min-microvolt = <2950000>;
+			regulator-max-microvolt = <2950000>;
+			regulator-system-load = <800000>;
+			regulator-allow-set-load;
+		};
+
+		pm8994_l22: l22 {
+			regulator-min-microvolt = <3000000>;
+			regulator-max-microvolt = <3000000>;
+		};
+
+		pm8994_l23: l23 {
+			regulator-min-microvolt = <2700000>;
+			regulator-max-microvolt = <2700000>;
+		};
+
+		pm8994_l24: l24 {
+			regulator-min-microvolt = <3075000>;
+			regulator-max-microvolt = <3075000>;
+			regulator-allow-set-load;
+		};
+
+		pm8994_l25: l25 {
+			regulator-min-microvolt = <1200000>;
+			regulator-max-microvolt = <1200000>;
+			regulator-allow-set-load;
+		};
+
+		pm8994_l27: l27 {
+			regulator-min-microvolt = <1000000>;
+			regulator-max-microvolt = <1200000>;
+		};
+
+		pm8994_l28: l28 {
+			regulator-min-microvolt = <925000>;
+			regulator-max-microvolt = <925000>;
+			regulator-allow-set-load;
+		};
+
+		pm8994_l29: l29 {
+			regulator-min-microvolt = <2700000>;
+			regulator-max-microvolt = <2700000>;
+		};
+
+		pm8994_l30: l30 { };
+
+		pm8994_l32: l32 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+		};
+	};
+};
+
+&sdhc1 {
+	/* eMMC doesn't seem to cooperate even in PIO mode.. */
+	status = "disabled";
+
+	vmmc-supply = <&pm8994_l20>;
+	vqmmc-supply = <&pm8994_s4>;
+	mmc-hs400-1_8v;
+	mmc-hs200-1_8v;
+};
+
+&sdhc2 {
+	status = "okay";
+
+	cd-gpios = <&tlmm 40 GPIO_ACTIVE_HIGH>;
+	vmmc-supply = <&pm8994_l21>;
+	vqmmc-supply = <&pm8994_l13>;
+};
+
+&tlmm {
+	gpio-reserved-ranges = <0 4>;
+	pinctrl-0 = <&sw_service_gpio>;
+	pinctrl-names = "default";
+
+	disp_reset_n_gpio: disp-reset-n {
+		pins = "gpio8";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	mdp_vsync_p_gpio: mdp-vsync-p {
+		pins = "gpio10";
+		function = "mdp_vsync";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	sw_service_gpio: sw-service-gpio {
+		pins = "gpio16";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
+	usb_detect: usb-detect {
+		pins = "gpio25";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+		output-high;
+	};
+
+	uim_detect_en: uim-detect-en {
+		pins = "gpio29";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+		output-high;
+	};
+
+	tray_det_pin: tray-det {
+		pins = "gpio40";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+	};
+
+	tp_vddio_en: tp-vddio-en {
+		pins = "gpio50";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+		output-high;
+	};
+
+	lcd_vddio_en: lcd-vddio-en {
+		pins = "gpio51";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+		output-low;
+	};
+
+	wl_host_wake: wl-host-wake {
+		pins = "gpio79";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-down;
+		input-high;
+	};
+
+	wl_reg_on: wl-reg-on {
+		pins = "gpio84";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-disable;
+		output-low;
+	};
+
+	ts_reset_n: ts-rst-n {
+		pins = "gpio89";
+		function = "gpio";
+		drive-strength = <2>;
+	};
+
+	touch_int_n: touch-int-n {
+		pins = "gpio125";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
+	touch_int_sleep: touch-int-sleep {
+		pins = "gpio125";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-down;
+	};
+};
+
+/*
+ * For reasons that are currently unknown
+ * (but probably related to fusb301), USB
+ * takes about 6 minutes to wake up (nothing
+ * interesting in kernel logs), but then it
+ * works as it should.
+ */
+&usb3 {
+	status = "okay";
+	qcom,select-utmi-as-pipe-clk;
+};
+
+&usb3_dwc3 {
+	extcon = <&usb3_id>;
+	dr_mode = "peripheral";
+	phys = <&hsusb_phy1>;
+	phy-names = "usb2-phy";
+	snps,hird-threshold = /bits/ 8 <0>;
+};
diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
index 57f32e0aa4a3..78477a550eba 100644
--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
@@ -847,21 +847,21 @@ cci0_default: cci0-default {
 
 			camera0_state_on:
 			camera_rear_default: camera-rear-default {
-				mclk0 {
+				camera0_mclk: mclk0 {
 					pins = "gpio13";
 					function = "cam_mclk";
 					drive-strength = <16>;
 					bias-disable;
 				};
 
-				rst {
+				camera0_rst: rst {
 					pins = "gpio25";
 					function = "gpio";
 					drive-strength = <16>;
 					bias-disable;
 				};
 
-				pwdn {
+				camera0_pwdn: pwdn {
 					pins = "gpio26";
 					function = "gpio";
 					drive-strength = <16>;
@@ -902,14 +902,14 @@ rst {
 
 			camera2_state_on:
 			camera_front_default: camera-front-default {
-				mclk2 {
+				camera2_mclk: mclk2 {
 					pins = "gpio15";
 					function = "cam_mclk";
 					drive-strength = <16>;
 					bias-disable;
 				};
 
-				rst {
+				camera2_rst: rst {
 					pins = "gpio23";
 					function = "gpio";
 					drive-strength = <16>;
@@ -2322,7 +2322,7 @@ usb3: usb@6af8800 {
 			power-domains = <&gcc USB30_GDSC>;
 			status = "disabled";
 
-			dwc3@6a00000 {
+			usb3_dwc3: dwc3@6a00000 {
 				compatible = "snps,dwc3";
 				reg = <0x06a00000 0xcc00>;
 				interrupts = <0 131 IRQ_TYPE_LEVEL_HIGH>;
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/7] arm64: dts: qcom: Add PMI8996 DTSI file
  2021-05-25 20:02 [PATCH 1/7] arm64: dts: qcom: Add PMI8996 DTSI file Konrad Dybcio
                   ` (5 preceding siblings ...)
  2021-05-25 20:02 ` [PATCH 7/7] arm64: dts: qcom: Add support for SONY Xperia X Performance / XZ / XZs (msm8996, Tone platform) Konrad Dybcio
@ 2021-05-26  3:16 ` Bjorn Andersson
  2021-05-26  9:29   ` Konrad Dybcio
  6 siblings, 1 reply; 15+ messages in thread
From: Bjorn Andersson @ 2021-05-26  3:16 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: ~postmarketos/upstreaming, martin.botka,
	angelogioacchino.delregno, marijn.suijten, jamipkettunen,
	Andy Gross, Rob Herring, linux-arm-msm, devicetree, linux-kernel

On Tue 25 May 15:02 CDT 2021, Konrad Dybcio wrote:

> PMI8996 is *almost* the same hardware as PMI8994, say for some annoyances:
> 
> - Boards equipped with PMI8996 now have to include pmic-id (which wasn't the case before)
> - Different qpnp-ibb-discharge-resistor value (will be addressed after LABIBB is introduced)
> - Different inhibit-derating-ua value (will be addressed after BCL is introduced)
> - Different ramp_up_step value (will be addressed after [if?] QPNP Flash LED is introduced)
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
> ---
>  arch/arm64/boot/dts/qcom/pmi8996.dtsi | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/qcom/pmi8996.dtsi
> 
> diff --git a/arch/arm64/boot/dts/qcom/pmi8996.dtsi b/arch/arm64/boot/dts/qcom/pmi8996.dtsi
> new file mode 100644
> index 000000000000..31b47209e261
> --- /dev/null
> +++ b/arch/arm64/boot/dts/qcom/pmi8996.dtsi
> @@ -0,0 +1,15 @@
> +// SPDX-License-Identifier: GPL-2.0

Can we have this with BSD license (as well)?

> +/*
> + * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
> + */
> +
> + /*
> +  * PMI8996 is a slight modification of PMI8994 with
> +  * some notable changes, like being the first PMIC
> +  * whose the bootloader has to check to continue booting
> +  * and a change to a LABIBB parameter.
> +  */
> +
> +/ {
> +	qcom,pmic-id = <0x20009 0x10013 0 0>;
> +};

So I'm supposed to include this and the pmi8994? I was expecting an
include of pmi8994.dtsi from here and then some override of the
necessary properties.

Regards,
Bjorn

> -- 
> 2.31.1
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/7] arm64: dts: qcom: Add MSM8996v3.0 DTSI file
  2021-05-25 20:02 ` [PATCH 2/7] arm64: dts: qcom: Add MSM8996v3.0 " Konrad Dybcio
@ 2021-05-26  3:18   ` Bjorn Andersson
  2021-05-26  9:24     ` Konrad Dybcio
  0 siblings, 1 reply; 15+ messages in thread
From: Bjorn Andersson @ 2021-05-26  3:18 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: ~postmarketos/upstreaming, martin.botka,
	angelogioacchino.delregno, marijn.suijten, jamipkettunen,
	Andy Gross, Rob Herring, linux-arm-msm, devicetree, linux-kernel

On Tue 25 May 15:02 CDT 2021, Konrad Dybcio wrote:

> Add an overlay for MSM8996v3.0, which is a pre-final revision
> of the said SoC. It has some stark differences with regards to
> GPU, or more specifically its power delivery path. Oh, and of
> course a different msm-id.
> 
> Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
> ---
>  arch/arm64/boot/dts/qcom/msm8996-v3.0.dtsi | 59 ++++++++++++++++++++++
>  1 file changed, 59 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/qcom/msm8996-v3.0.dtsi
> 
> diff --git a/arch/arm64/boot/dts/qcom/msm8996-v3.0.dtsi b/arch/arm64/boot/dts/qcom/msm8996-v3.0.dtsi
> new file mode 100644
> index 000000000000..b46f10b7413a
> --- /dev/null
> +++ b/arch/arm64/boot/dts/qcom/msm8996-v3.0.dtsi
> @@ -0,0 +1,59 @@
> +// SPDX-License-Identifier: GPL-2.0

BSD license?

> +/*
> + * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
> + */
> +
> +#include "msm8996.dtsi"
> +
> + / {
> +	qcom,msm-id = <246 0x30000>;
> + };
> +
> + /*
> +  * This revision seems to have differ GPU CPR
> +  * parameters, GPU frequencies and some differences
> +  * when it comes to voltage delivery to.. once again
> +  * the GPU. Funnily enough, it's simpler to make it an
> +  * overlay on top of 3.1 (the final one) than vice versa.
> +  * The differences will show here as more and more
> +  * features get enabled upstream.
> +  */
> +
> +gpu_opp_table_3_0: gpu-opp-table-30 {

Unused for now?

Can you link it up this with the &gpu even if you don't enable it
for now?

Regards,
Bjorn

> +	compatible = "operating-points-v2";
> +
> +	opp-624000000 {
> +		opp-hz = /bits/ 64 <624000000>;
> +		opp-level = <7>;
> +	};
> +
> +	opp-560000000 {
> +		opp-hz = /bits/ 64 <560000000>;
> +		opp-level = <6>;
> +	};
> +
> +	opp-510000000 {
> +		opp-hz = /bits/ 64 <510000000>;
> +		opp-level = <5>;
> +	};
> +
> +	opp-401800000 {
> +		opp-hz = /bits/ 64 <401800000>;
> +		opp-level = <4>;
> +	};
> +
> +	opp-315000000 {
> +		opp-hz = /bits/ 64 <315000000>;
> +		opp-level = <3>;
> +	};
> +
> +	opp-214000000 {
> +		opp-hz = /bits/ 64 <214000000>;
> +		opp-level = <3>;
> +	};
> +
> +	opp-133000000 {
> +		opp-hz = /bits/ 64 <133000000>;
> +		opp-level = <3>;
> +	};
> +};
> -- 
> 2.31.1
> 

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 7/7] arm64: dts: qcom: Add support for SONY Xperia X Performance / XZ / XZs (msm8996, Tone platform)
  2021-05-25 20:02 ` [PATCH 7/7] arm64: dts: qcom: Add support for SONY Xperia X Performance / XZ / XZs (msm8996, Tone platform) Konrad Dybcio
@ 2021-05-26  3:38   ` Bjorn Andersson
  2021-05-26  9:21     ` Konrad Dybcio
  0 siblings, 1 reply; 15+ messages in thread
From: Bjorn Andersson @ 2021-05-26  3:38 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: ~postmarketos/upstreaming, martin.botka,
	angelogioacchino.delregno, marijn.suijten, jamipkettunen,
	Andy Gross, Rob Herring, linux-arm-msm, devicetree, linux-kernel,
	Kees Cook, Anton Vorontsov, Colin Cross, Tony Luck

On Tue 25 May 15:02 CDT 2021, Konrad Dybcio wrote:

> From: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
> 
> Add support for following boards:
> 
> - Xperia X Performance (dora)
> - Xperia XZ (kagura)
> - Xperia XZs (keyaki)
> 
> They are all based on the SONY Tone platform and feature largely similar hardware
> with the most obvious differences being lack of USB-C and ToF sensor on Dora and
> different camera sensor on Keyaki.
> 
> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
> ---
>  arch/arm64/boot/dts/qcom/Makefile             |   6 +
>  .../msm8996-pmi8996-sony-xperia-tone-dora.dts |  11 +
>  ...sm8996-pmi8996-sony-xperia-tone-kagura.dts |  11 +
>  ...sm8996-pmi8996-sony-xperia-tone-keyaki.dts |  11 +
>  .../qcom/msm8996-sony-xperia-tone-dora.dts    |  27 +
>  .../qcom/msm8996-sony-xperia-tone-kagura.dts  |  15 +
>  .../qcom/msm8996-sony-xperia-tone-keyaki.dts  |  26 +
>  .../dts/qcom/msm8996-sony-xperia-tone.dtsi    | 980 ++++++++++++++++++
>  arch/arm64/boot/dts/qcom/msm8996.dtsi         |  12 +-
>  9 files changed, 1093 insertions(+), 6 deletions(-)
>  create mode 100644 arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dts
>  create mode 100644 arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-kagura.dts
>  create mode 100644 arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-keyaki.dts
>  create mode 100644 arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-dora.dts
>  create mode 100644 arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-kagura.dts
>  create mode 100644 arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-keyaki.dts
>  create mode 100644 arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi
> 
> diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
> index ca4a7819d2c4..d079dc33d833 100644
> --- a/arch/arm64/boot/dts/qcom/Makefile
> +++ b/arch/arm64/boot/dts/qcom/Makefile
> @@ -25,6 +25,12 @@ dtb-$(CONFIG_ARCH_QCOM)	+= msm8994-sony-xperia-kitakami-satsuki.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= msm8994-sony-xperia-kitakami-sumire.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= msm8994-sony-xperia-kitakami-suzuran.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-mtp.dtb
> +dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-sony-xperia-tone-dora.dtb
> +dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-sony-xperia-tone-kagura.dtb
> +dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-sony-xperia-tone-keyaki.dtb

's' > 'p', please keep them sorted alphabetically.

That said, perhaps it would look better to move the "pmi8996" part later
in the name?

> +dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-pmi8996-sony-xperia-tone-dora.dtb
> +dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-pmi8996-sony-xperia-tone-kagura.dtb
> +dtb-$(CONFIG_ARCH_QCOM)	+= msm8996-pmi8996-sony-xperia-tone-keyaki.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= msm8998-asus-novago-tp370ql.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= msm8998-hp-envy-x2.dtb
>  dtb-$(CONFIG_ARCH_QCOM)	+= msm8998-lenovo-miix-630.dtb
> diff --git a/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dts b/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dts
> new file mode 100644
> index 000000000000..b57ea0824ea5
> --- /dev/null
> +++ b/arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dts
> @@ -0,0 +1,11 @@
> +// SPDX-License-Identifier: GPL-2.0

BSD license in all the files please.

> +/*
> + * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
> + */
> +
> +#include "msm8996-sony-xperia-tone-dora.dts"
> +#include "pmi8996.dtsi"
> +
> +/ {
> +	model = "Sony Xperia X Performance (PMI8996)";
> +};
> \ No newline at end of file
[..]
> diff --git a/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi
> new file mode 100644
> index 000000000000..4644d5f9d1a6
> --- /dev/null
> +++ b/arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone.dtsi
> @@ -0,0 +1,980 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Copyright (c) 2021, AngeloGioacchino Del Regno
> + *                     <angelogioacchino.delregno@somainline.org>
> + * Copyright (c) 2021, Konrad Dybcio <konrad.dybcio@somainline.org>
> + */
> +
> +#include "msm8996.dtsi"
> +#include "pm8994.dtsi"
> +#include "pmi8994.dtsi"
> +#include <dt-bindings/input/input.h>
> +#include <dt-bindings/input/gpio-keys.h>

This seems to be unused for now.

> +#include <dt-bindings/gpio/gpio.h>
> +#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
> +#include <dt-bindings/pinctrl/qcom,pmic-mpp.h>
> +
> +/delete-node/ &hdmi;
> +/delete-node/ &hdmi_phy;
> +/delete-node/ &mdp5_intf3_out;
> +/delete-node/ &slpi_region;
> +/delete-node/ &venus_region;
> +/delete-node/ &zap_shader_region;
> +
> +/ {
> +	qcom,msm-id = <246 0x30001>; /* MSM8996 V3.1 (Final) */
> +	qcom,pmic-id = <0x20009 0x2000a 0 0>; /* PM8994 + PMI8994 */
> +	qcom,board-id = <8 0>;
> +
> +	chosen {
> +		/*
> +		 * Due to an unknown-for-a-few-years regression,
> +		 * SDHCI only works on MSM8996 in PIO (lame) mode.
> +		 */
> +		bootargs = "sdhci.debug_quirks=0x40 sdhci.debug_quirks2=0x4 maxcpus=2";

What's up with maxcpus=2? Is this simply because the last 2 are really
really slow?

> +	};
> +
> +	reserved-memory {
> +		ramoops@a7f00000 {
> +			compatible = "ramoops";
> +			reg = <0 0xa7f00000 0 0x100000>;
> +			record-size = <0x20000>;
> +			console-size = <0x40000>;
> +			ftrace-size = <0x20000>;
> +			pmsg-size = <0x20000>;
> +			ecc-size = <16>;
> +		};
> +
> +		cont_splash_mem: memory@83401000 {
> +			reg = <0 0x83401000 0 0x23ff000>;
> +			no-map;
> +		};
> +
> +		zap_shader_region: gpu@90400000 {
> +			compatible = "shared-dma-pool";
> +			reg = <0x0 0x90400000 0x0 0x2000>;
> +			no-map;
> +		};
> +
> +		slpi_region: memory@90500000 {
> +			reg = <0 0x90500000 0 0xa00000>;
> +			no-map;
> +		};
> +
> +		venus_region: memory@90f00000 {
> +			reg = <0 0x90f00000 0 0x500000>;
> +			no-map;
> +		};
> +	};
> +
> +	panel_tvdd: tvdd-regulator {
> +		compatible = "regulator-fixed";
> +		regulator-name = "panel_tvdd";
> +		gpio = <&tlmm 50 GPIO_ACTIVE_HIGH>;
> +		pinctrl-0 = <&tp_vddio_en>;
> +		pinctrl-names = "default";
> +	};
> +
> +	usb3_id: usb3-id {
> +		compatible = "linux,extcon-usb-gpio";
> +		id-gpio = <&tlmm 25 GPIO_ACTIVE_LOW>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&usb_detect>;
> +	};
> +
> +	vph_pwr: vph-pwr-regulator {
> +		compatible = "regulator-fixed";
> +		regulator-min-microvolt = <3700000>;
> +		regulator-max-microvolt = <3700000>;
> +		regulator-name = "vph_pwr";
> +		regulator-always-on;
> +		regulator-boot-on;
> +	};
> +
> +	wlan_en: wlan-en-1-8v {
> +		compatible = "regulator-fixed";
> +		regulator-name = "wlan-en-regulator";
> +		regulator-min-microvolt = <1800000>;
> +		regulator-max-microvolt = <1800000>;
> +		gpio = <&tlmm 84 GPIO_ACTIVE_HIGH>;
> +		pinctrl-names = "default";
> +		pinctrl-0 = <&wl_reg_on>;
> +
> +		/* WLAN card specific delay */
> +		startup-delay-us = <70000>;
> +		enable-active-high;
> +	};
> +};
> +
> +&blsp1_i2c3 {
> +	status = "okay";
> +	clock-frequency = <355000>;
> +
> +	tof_sensor: vl53l0x@29 {
> +		compatible = "st,vl53l0x";
> +		reg = <0x29>;
> +	};
> +};
> +
> +&blsp1_uart2 {
> +	status = "okay";
> +};
> +
> +&blsp2_i2c5 {
> +	status = "okay";
> +	clock-frequency = <355000>;
> +
> +	/* FUSB301 USB-C controller */
> +};
> +
> +&blsp2_i2c6 {
> +	status = "okay";
> +	clock-frequency = <355000>;
> +
> +	synaptics@2c {
> +		compatible = "syna,rmi4-i2c";
> +		reg = <0x2c>;
> +		interrupt-parent = <&tlmm>;
> +		interrupts = <125 IRQ_TYPE_EDGE_FALLING>;
> +		vdd-supply = <&panel_tvdd>;
> +
> +		syna,reset-delay-ms = <220>;
> +		syna,startup-delay-ms = <220>;
> +		#address-cells = <1>;
> +		#size-cells = <0>;
> +
> +		rmi4-f01@1 {
> +			reg = <0x1>;
> +			syna,nosleep-mode = <1>;
> +		};
> +
> +		rmi4-f11@11 {
> +			reg = <0x11>;
> +			syna,sensor-type = <1>;
> +		};
> +	};
> +};
> +
> +&blsp2_uart2 {
> +	status = "okay";
> +};
> +
> +&camera0_mclk {
> +	drive-strength = <2>;
> +	output-low;
> +};
> +
> +&camera0_pwdn {
> +	drive-strength = <2>;
> +	output-low;
> +};
> +
> +&camera0_rst {
> +	pins = "gpio30";
> +	drive-strength = <2>;
> +	output-low;
> +};
> +
> +&camera2_mclk {
> +	drive-strength = <2>;
> +	output-low;
> +};
> +
> +&camera2_rst {
> +	drive-strength = <2>;
> +	output-low;
> +};
> +
> +&CPU0 {
> +	cpu-supply = <&pmi8994_s11>;

Isn't this the supply to the CPU-subsystem-internal LDO that actually
feeds the CPU? Is there a benefit to describing this here?

> +};
> +
> +&CPU1 {
> +	cpu-supply = <&pmi8994_s11>;
> +};
> +
> +&CPU2 {
> +	cpu-supply = <&pmi8994_s11>;
> +};
> +
> +&CPU3 {
> +	cpu-supply = <&pmi8994_s11>;
> +};
> +
> +&hsusb_phy1 {
> +	status = "okay";
> +
> +	vdda-pll-supply = <&pm8994_l12>;
> +	vdda-phy-dpdm-supply = <&pm8994_l24>;
> +};
> +
> +&mmcc {
> +	vdd-gfx-supply = <&vdd_gfx>;
> +};
> +
> +&pcie0 {
> +	status = "okay";
> +	perst-gpio = <&tlmm 35 GPIO_ACTIVE_LOW>;
> +	wake-gpio = <&tlmm 37 GPIO_ACTIVE_HIGH>;
> +	vddpe-3v3-supply = <&wlan_en>;
> +	vdda-supply = <&pm8994_l28>;
> +};
> +
> +&pcie_phy {
> +	status = "okay";
> +
> +	vdda-phy-supply = <&pm8994_l28>;
> +	vdda-pll-supply = <&pm8994_l12>;
> +};
> +
> +&pm8994_gpios {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pm8994_gpio_1 &pm8994_vol_down_n &pm8994_vol_up_n
> +		     &pm8994_cam_snap_n &pm8994_cam_focus_n &pm8994_gpio_6
> +		     &pm8994_nfc_dload &pm8994_gpio_8 &pm8994_gpio_9
> +		     &pm8994_gpio_nfc_clk &pm8994_gpio_11 &pm8994_gpio_12
> +		     &pm8994_ear_en &pm8994_gpio_14 &pm8994_pm_divclk1
> +		     &pm8994_pmi_clk &pm8994_gpio_17 &pm8994_rome_sleep
> +		     &pm8994_gpio_19 &pm8994_gpio_22>;

Shouldn't several of these reference be done from the relevant nodes?

For the ones that isn't, and that you're not going to ever change I
think it would look better to have a single:

pm8994_gpios_defaults: default-state {
	nc {
		nc pins...
	};

	vol-up {
		...
	};

	...
};

> +
> +	gpio-line-names =
> +		"NC",
> +		"VOL_DOWN_N",
> +		"VOL_UP_N",
> +		"SNAPSHOT_N",
> +		"FOCUS_N",
> +		"NC",
> +		"NFC_VEN",
> +		"NC",
> +		"NC",
> +		"NC",
> +		"NC",
> +		"NC",
> +		"EAR_EN",
> +		"NC",
> +		"PM_DIVCLK1",
> +		"PMI_CLK",
> +		"NC",
> +		"WL_SLEEP_CLK",
> +		"NC",
> +		"PMIC_SPON",
> +		"UIM_BATT_ALARM",
> +		"PMK_SLEEP_CLK";
> +
> +	pm8994_gpio_1: pm-gpio1-nc {
> +		pins = "gpio1";
> +		function = PMIC_GPIO_FUNC_NORMAL;
> +		drive-push-pull;
> +		bias-high-impedance;
> +	};
> +
> +	pm8994_vol_down_n: vol-down-n {
> +		pins = "gpio2";
> +		function = PMIC_GPIO_FUNC_NORMAL;
> +		drive-push-pull;
> +		input-enable;
> +		bias-pull-up;
> +		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
> +		power-source = <PM8994_GPIO_S4>;
> +	};
> +
[..]
> +/*
> + * For reasons that are currently unknown
> + * (but probably related to fusb301), USB
> + * takes about 6 minutes to wake up (nothing
> + * interesting in kernel logs), but then it
> + * works as it should.

This is funny (but please make it ~80 chars wide).

Regards,
Bjorn

> + */
> +&usb3 {
> +	status = "okay";
> +	qcom,select-utmi-as-pipe-clk;
> +};
> +
> +&usb3_dwc3 {
> +	extcon = <&usb3_id>;
> +	dr_mode = "peripheral";
> +	phys = <&hsusb_phy1>;
> +	phy-names = "usb2-phy";
> +	snps,hird-threshold = /bits/ 8 <0>;
> +};

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 7/7] arm64: dts: qcom: Add support for SONY Xperia X Performance / XZ / XZs (msm8996, Tone platform)
  2021-05-26  3:38   ` Bjorn Andersson
@ 2021-05-26  9:21     ` Konrad Dybcio
  2021-05-27 15:48       ` Bjorn Andersson
  0 siblings, 1 reply; 15+ messages in thread
From: Konrad Dybcio @ 2021-05-26  9:21 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: ~postmarketos/upstreaming, martin.botka,
	angelogioacchino.delregno, marijn.suijten, jamipkettunen,
	Andy Gross, Rob Herring, linux-arm-msm, devicetree, linux-kernel,
	Kees Cook, Anton Vorontsov, Colin Cross, Tony Luck

Hi,


> BSD license in all the files please.

msm8996.dtsi is gpl2-only, so I wasn't sure I can include it..


>> +};
>> \ No newline at end of file
> [..]

Yikes... my mistake


>> +#include "pmi8994.dtsi"
>> +#include <dt-bindings/input/input.h>
>> +#include <dt-bindings/input/gpio-keys.h>
> This seems to be unused for now.

Right. I will add the keys in a separate patch, this one is plenty big already.


>> +		/*
>> +		 * Due to an unknown-for-a-few-years regression,
>> +		 * SDHCI only works on MSM8996 in PIO (lame) mode.
>> +		 */
>> +		bootargs = "sdhci.debug_quirks=0x40 sdhci.debug_quirks2=0x4 maxcpus=2";
> What's up with maxcpus=2? Is this simply because the last 2 are really
> really slow?

Yeah, I think the L2 and cci being stuck at bl clocks are to blame again.. there was a lot of msm8996 cpufreq work but I am not sure if anybody got it to *actually* work in the end, I'll try to look into this soon(tm)..


>> +};
>> +
>> +&CPU0 {
>> +	cpu-supply = <&pmi8994_s11>;
> Isn't this the supply to the CPU-subsystem-internal LDO that actually
> feeds the CPU? Is there a benefit to describing this here?

I believe it was related to the cpufreq-dt madness, I will remove this.


>> +
>> +&pm8994_gpios {
>> +	pinctrl-names = "default";
>> +	pinctrl-0 = <&pm8994_gpio_1 &pm8994_vol_down_n &pm8994_vol_up_n
>> +		     &pm8994_cam_snap_n &pm8994_cam_focus_n &pm8994_gpio_6
>> +		     &pm8994_nfc_dload &pm8994_gpio_8 &pm8994_gpio_9
>> +		     &pm8994_gpio_nfc_clk &pm8994_gpio_11 &pm8994_gpio_12
>> +		     &pm8994_ear_en &pm8994_gpio_14 &pm8994_pm_divclk1
>> +		     &pm8994_pmi_clk &pm8994_gpio_17 &pm8994_rome_sleep
>> +		     &pm8994_gpio_19 &pm8994_gpio_22>;
> Shouldn't several of these reference be done from the relevant nodes?

Certainly, but not all peripherals have drivers upstream, and other ones

are hardcoded to their state downstream, and knowing what shady stuff

some vendors do, I'm reluctant to trust the bootloader-default state with

my expensive toys..



> For the ones that isn't, and that you're not going to ever change I
> think it would look better to have a single:
>
> pm8994_gpios_defaults: default-state {
> 	nc {
> 		nc pins...
> 	};
>
> 	vol-up {
> 		...
> 	};
>
> 	...
> };

That does look like a good idea, but I also think it would become a big

mess if any of these pins turned out required for some obscure peripheral,

and then I'd have to dig it out of there, re-create the pin definition outside

and I think you know where this is going..


> +/*
> + * For reasons that are currently unknown
> + * (but probably related to fusb301), USB
> + * takes about 6 minutes to wake up (nothing
> + * interesting in kernel logs), but then it
> + * works as it should.
> This is funny (but please make it ~80 chars wide).

Eh, Torvalds said 100 is fine :P


Konrad


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/7] arm64: dts: qcom: Add MSM8996v3.0 DTSI file
  2021-05-26  3:18   ` Bjorn Andersson
@ 2021-05-26  9:24     ` Konrad Dybcio
  0 siblings, 0 replies; 15+ messages in thread
From: Konrad Dybcio @ 2021-05-26  9:24 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: ~postmarketos/upstreaming, martin.botka,
	angelogioacchino.delregno, marijn.suijten, jamipkettunen,
	Andy Gross, Rob Herring, linux-arm-msm, devicetree, linux-kernel

Hi,


> Unused for now?
>
> Can you link it up this with the &gpu even if you don't enable it
> for now?

Indeed, actually applying the setting sounds like a good idea, heh.


The GPU will be enabled on a per-board basis like it's usually done,

but for tone we need to resolve the issue with fw loader complaining

about PT_LOAD header (it works fine if we omit the checks).


As for v3.0 specifically, it's a lottery and you might have a device with

either (with this one being much less probable afaiaa), so it's better to support both.


Konrad


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/7] arm64: dts: qcom: Add PMI8996 DTSI file
  2021-05-26  3:16 ` [PATCH 1/7] arm64: dts: qcom: Add PMI8996 DTSI file Bjorn Andersson
@ 2021-05-26  9:29   ` Konrad Dybcio
  0 siblings, 0 replies; 15+ messages in thread
From: Konrad Dybcio @ 2021-05-26  9:29 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: ~postmarketos/upstreaming, martin.botka,
	angelogioacchino.delregno, marijn.suijten, jamipkettunen,
	Andy Gross, Rob Herring, linux-arm-msm, devicetree, linux-kernel

Hi,


> So I'm supposed to include this and the pmi8994? I was expecting an
> include of pmi8994.dtsi from here and then some override of the
> necessary properties.

This way we would have to get three dts files for each device:

one for device-common stuff, one including pmi8994 and one

including pmi8996. Otherwise pmi8994 contents would be included

twice, as the "base" device dt already includes pmi8994.


If you check how I solved that on Tone, I just took the pmi8994-equipped

phone dt as a baseline and only included this small dtsi as an overlay on top.


Konrad


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 7/7] arm64: dts: qcom: Add support for SONY Xperia X Performance / XZ / XZs (msm8996, Tone platform)
  2021-05-26  9:21     ` Konrad Dybcio
@ 2021-05-27 15:48       ` Bjorn Andersson
  2021-05-27 15:55         ` Konrad Dybcio
  0 siblings, 1 reply; 15+ messages in thread
From: Bjorn Andersson @ 2021-05-27 15:48 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: ~postmarketos/upstreaming, martin.botka,
	angelogioacchino.delregno, marijn.suijten, jamipkettunen,
	Andy Gross, Rob Herring, linux-arm-msm, devicetree, linux-kernel,
	Kees Cook, Anton Vorontsov, Colin Cross, Tony Luck

On Wed 26 May 04:21 CDT 2021, Konrad Dybcio wrote:

> Hi,
> 
> 
> > BSD license in all the files please.
> 
> msm8996.dtsi is gpl2-only, so I wasn't sure I can include it..
> 

Very good question, I think it's fine, would prefer it that way and will
be merge it, but ianal.

> 
> >> +};
> >> \ No newline at end of file
> > [..]
> 
> Yikes... my mistake
> 
> 
> >> +#include "pmi8994.dtsi"
> >> +#include <dt-bindings/input/input.h>
> >> +#include <dt-bindings/input/gpio-keys.h>
> > This seems to be unused for now.
> 
> Right. I will add the keys in a separate patch, this one is plenty big already.
> 
> 
> >> +		/*
> >> +		 * Due to an unknown-for-a-few-years regression,
> >> +		 * SDHCI only works on MSM8996 in PIO (lame) mode.
> >> +		 */
> >> +		bootargs = "sdhci.debug_quirks=0x40 sdhci.debug_quirks2=0x4 maxcpus=2";
> > What's up with maxcpus=2? Is this simply because the last 2 are really
> > really slow?
> 
> Yeah, I think the L2 and cci being stuck at bl clocks are to blame
> again.. there was a lot of msm8996 cpufreq work but I am not sure if
> anybody got it to *actually* work in the end, I'll try to look into
> this soon(tm)..
> 

Right, we have some lingering patches on our side for this as well,
unfortunately I have one db82c0 that gets unstable when we bring the
last 2 CPUs up to speed.

I started looking at this and found that some care needs to be taken
when switching between the lower half and higher half of the frequencies
(or perhaps it was voltages?) Unfortunately I didn't conclude anything
in this area, but I would be happy to see this resolved.

> 
> >> +};
> >> +
> >> +&CPU0 {
> >> +	cpu-supply = <&pmi8994_s11>;
> > Isn't this the supply to the CPU-subsystem-internal LDO that actually
> > feeds the CPU? Is there a benefit to describing this here?
> 
> I believe it was related to the cpufreq-dt madness, I will remove this.
> 
> 
> >> +
> >> +&pm8994_gpios {
> >> +	pinctrl-names = "default";
> >> +	pinctrl-0 = <&pm8994_gpio_1 &pm8994_vol_down_n &pm8994_vol_up_n
> >> +		     &pm8994_cam_snap_n &pm8994_cam_focus_n &pm8994_gpio_6
> >> +		     &pm8994_nfc_dload &pm8994_gpio_8 &pm8994_gpio_9
> >> +		     &pm8994_gpio_nfc_clk &pm8994_gpio_11 &pm8994_gpio_12
> >> +		     &pm8994_ear_en &pm8994_gpio_14 &pm8994_pm_divclk1
> >> +		     &pm8994_pmi_clk &pm8994_gpio_17 &pm8994_rome_sleep
> >> +		     &pm8994_gpio_19 &pm8994_gpio_22>;
> > Shouldn't several of these reference be done from the relevant nodes?
> 
> Certainly, but not all peripherals have drivers upstream, and other ones
> 
> are hardcoded to their state downstream, and knowing what shady stuff
> 
> some vendors do, I'm reluctant to trust the bootloader-default state with
> 
> my expensive toys..
> 

I'm in agreement with you that we should vote for these somewhere, so
I'm fine with us agreeing that they are voted for here for now.

> 
> 
> > For the ones that isn't, and that you're not going to ever change I
> > think it would look better to have a single:
> >
> > pm8994_gpios_defaults: default-state {
> > 	nc {
> > 		nc pins...
> > 	};
> >
> > 	vol-up {
> > 		...
> > 	};
> >
> > 	...
> > };
> 
> That does look like a good idea, but I also think it would become a big
> 
> mess if any of these pins turned out required for some obscure peripheral,
> 
> and then I'd have to dig it out of there, re-create the pin definition outside
> 
> and I think you know where this is going..
> 

But if this happens you need to override the giant pinctrl-0 in such
device dts and hope that you don't miss any of the entries anyways.

> 
> > +/*
> > + * For reasons that are currently unknown
> > + * (but probably related to fusb301), USB
> > + * takes about 6 minutes to wake up (nothing
> > + * interesting in kernel logs), but then it
> > + * works as it should.
> > This is funny (but please make it ~80 chars wide).
> 
> Eh, Torvalds said 100 is fine :P
> 

Right, 100 is the new "limit", but 80 is still a good target. What I'm
opposing is that you wrap at 44.

Thanks,
Bjorn

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 7/7] arm64: dts: qcom: Add support for SONY Xperia X Performance / XZ / XZs (msm8996, Tone platform)
  2021-05-27 15:48       ` Bjorn Andersson
@ 2021-05-27 15:55         ` Konrad Dybcio
  0 siblings, 0 replies; 15+ messages in thread
From: Konrad Dybcio @ 2021-05-27 15:55 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: ~postmarketos/upstreaming, martin.botka,
	angelogioacchino.delregno, marijn.suijten, jamipkettunen,
	Andy Gross, Rob Herring, linux-arm-msm, devicetree, linux-kernel,
	Kees Cook, Anton Vorontsov, Colin Cross, Tony Luck

Hi,


>> Very good question, I think it's fine, would prefer it that way and will
>> be merge it, but ianal.

Wikipedia says that 2- and 3- clause BSD and GPLv2 are compatible, so let's trust random folks from the interwebz and go with BSD.


>> Yeah, I think the L2 and cci being stuck at bl clocks are to blame
>> again.. there was a lot of msm8996 cpufreq work but I am not sure if
>> anybody got it to *actually* work in the end, I'll try to look into
>> this soon(tm)..
>>
> Right, we have some lingering patches on our side for this as well,
> unfortunately I have one db82c0 that gets unstable when we bring the
> last 2 CPUs up to speed.
>
> I started looking at this and found that some care needs to be taken
> when switching between the lower half and higher half of the frequencies
> (or perhaps it was voltages?) Unfortunately I didn't conclude anything
> in this area, but I would be happy to see this resolved.

Yeah.. as if 96 didn't have enough problems already.. :/



>> That does look like a good idea, but I also think it would become a big
>>
>> mess if any of these pins turned out required for some obscure peripheral,
>>
>> and then I'd have to dig it out of there, re-create the pin definition outside
>>
>> and I think you know where this is going..
>>
> But if this happens you need to override the giant pinctrl-0 in such
> device dts and hope that you don't miss any of the entries anyways.

Ok, you convinced me.



>> Eh, Torvalds said 100 is fine :P
>>
> Right, 100 is the new "limit", but 80 is still a good target. What I'm
> opposing is that you wrap at 44.

That's what I get when I skip supper and don't feed my brain.. Ofc I can make it longer per-line, heh. V2 should hit your inbox soon.


Konrad


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-05-27 15:55 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25 20:02 [PATCH 1/7] arm64: dts: qcom: Add PMI8996 DTSI file Konrad Dybcio
2021-05-25 20:02 ` [PATCH 2/7] arm64: dts: qcom: Add MSM8996v3.0 " Konrad Dybcio
2021-05-26  3:18   ` Bjorn Andersson
2021-05-26  9:24     ` Konrad Dybcio
2021-05-25 20:02 ` [PATCH 3/7] arm64: dts: qcom: msm8996: Strictly limit USB2 host to USB2 speeds Konrad Dybcio
2021-05-25 20:02 ` [PATCH 4/7] arm64: dts: qcom: msm8996: Disable ADSP by default Konrad Dybcio
2021-05-25 20:02 ` [PATCH 5/7] arm64: dts: qcom: msm8996: Add DMA to QUPs and UARTs Konrad Dybcio
2021-05-25 20:02 ` [PATCH 6/7] arm64: dts: qcom: msm8996: Fix BLSP2_I2C6 IRQ Konrad Dybcio
2021-05-25 20:02 ` [PATCH 7/7] arm64: dts: qcom: Add support for SONY Xperia X Performance / XZ / XZs (msm8996, Tone platform) Konrad Dybcio
2021-05-26  3:38   ` Bjorn Andersson
2021-05-26  9:21     ` Konrad Dybcio
2021-05-27 15:48       ` Bjorn Andersson
2021-05-27 15:55         ` Konrad Dybcio
2021-05-26  3:16 ` [PATCH 1/7] arm64: dts: qcom: Add PMI8996 DTSI file Bjorn Andersson
2021-05-26  9:29   ` Konrad Dybcio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).