All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] arm64: dts: qcom: sdm845-xiaomi-beryllium: Add DSI and panel bits
@ 2021-02-04  8:09 Amit Pundir
  2021-02-04 14:16 ` Konrad Dybcio
  0 siblings, 1 reply; 5+ messages in thread
From: Amit Pundir @ 2021-02-04  8:09 UTC (permalink / raw)
  To: Andy Gross, Bjorn Andersson, Konrad Dybcio, Rob Herring,
	John Stultz, Sumit Semwal
  Cc: linux-arm-msm, dt, lkml, phone-devel

From: Sumit Semwal <sumit.semwal@linaro.org>

Enabling the Display panel for beryllium phone (Xiaomi
Pocophone F1) requires DSI labibb regulators and panel
dts nodes to be added. It is also required to keep some
of the regulators as always-on.

Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
---
v2: Rebased to mainline (v5.11-rc6) and fixed build warnings.

 .../boot/dts/qcom/sdm845-xiaomi-beryllium.dts      | 58 ++++++++++++++++++++++
 1 file changed, 58 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium.dts b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium.dts
index 86cbae63eaf7..034246b5c529 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium.dts
+++ b/arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium.dts
@@ -157,6 +157,14 @@
 			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
 		};
 
+		vreg_l14a_1p88: ldo14 {
+			regulator-min-microvolt = <1800000>;
+			regulator-max-microvolt = <1800000>;
+			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+			regulator-boot-on;
+			regulator-always-on;
+		};
+
 		vreg_l17a_1p3: ldo17 {
 			regulator-min-microvolt = <1304000>;
 			regulator-max-microvolt = <1304000>;
@@ -191,6 +199,7 @@
 			regulator-min-microvolt = <1200000>;
 			regulator-max-microvolt = <1200000>;
 			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
+			regulator-boot-on;
 		};
 	};
 };
@@ -200,6 +209,47 @@
 	firmware-name = "qcom/sdm845/cdsp.mdt";
 };
 
+&dsi0 {
+	status = "okay";
+	vdda-supply = <&vreg_l26a_1p2>;
+
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	ports {
+		port@1 {
+			endpoint {
+				remote-endpoint = <&tianma_nt36672a_in_0>;
+				data-lanes = <0 1 2 3>;
+			};
+		};
+	};
+
+	panel@0 {
+		compatible = "tianma,fhd-video";
+		reg = <0>;
+		vddi0-supply = <&vreg_l14a_1p88>;
+		vddpos-supply = <&lab>;
+		vddneg-supply = <&ibb>;
+
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		reset-gpios = <&tlmm 6 GPIO_ACTIVE_LOW>;
+
+		port {
+			tianma_nt36672a_in_0: endpoint {
+				remote-endpoint = <&dsi0_out>;
+			};
+		};
+	};
+};
+
+&dsi0_phy {
+	status = "okay";
+	vdds-supply = <&vreg_l1a_0p875>;
+};
+
 &gcc {
 	protected-clocks = <GCC_QSPI_CORE_CLK>,
 			   <GCC_QSPI_CORE_CLK_SRC>,
@@ -215,6 +265,14 @@
 	};
 };
 
+&mdss {
+	status = "okay";
+};
+
+&mdss_mdp {
+	status = "okay";
+};
+
 &mss_pil {
 	status = "okay";
 	firmware-name = "qcom/sdm845/mba.mbn", "qcom/sdm845/modem.mdt";
-- 
2.7.4


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

* Re: [PATCH v2] arm64: dts: qcom: sdm845-xiaomi-beryllium: Add DSI and panel bits
  2021-02-04  8:09 [PATCH v2] arm64: dts: qcom: sdm845-xiaomi-beryllium: Add DSI and panel bits Amit Pundir
@ 2021-02-04 14:16 ` Konrad Dybcio
  2021-02-05 13:15   ` Amit Pundir
  0 siblings, 1 reply; 5+ messages in thread
From: Konrad Dybcio @ 2021-02-04 14:16 UTC (permalink / raw)
  To: Amit Pundir, Andy Gross, Bjorn Andersson, Rob Herring,
	John Stultz, Sumit Semwal
  Cc: linux-arm-msm, dt, lkml, phone-devel

Hi!

>vreg_l14a_1p88: ldo14 {
>+			regulator-min-microvolt = <1800000>;
>+			regulator-max-microvolt = <1800000>;

Should probably be renamed to vreg_l14a_1p8 then.


>+	ports {
>+		port@1 {
>+			endpoint {
>+				remote-endpoint = <&tianma_nt36672a_in_0>;
>+				data-lanes = <0 1 2 3>;
>+			};
>+		};
>+	};

The endpoint has a label, you can simply use &dsi0_out {};.

>+		vddpos-supply = <&lab>;
>+		vddneg-supply = <&ibb>;

With Angelo's latest series [1] merged in, I reckon you should explicitly configure lab/ibb (like in [2]),
as wrong settings (which CAN BE SET BY THE BOOTLOADER in some instances!!) can lead to hardware damage.



Konrad

[1] https://lore.kernel.org/linux-arm-msm/20210119174421.226541-1-angelogioacchino.delregno@somainline.org/
[2] https://github.com/SoMainline/linux/commit/4f4853b2e252b5f9d03e90119110aac80258fc53

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

* Re: [PATCH v2] arm64: dts: qcom: sdm845-xiaomi-beryllium: Add DSI and panel bits
  2021-02-04 14:16 ` Konrad Dybcio
@ 2021-02-05 13:15   ` Amit Pundir
  2021-02-08 14:41     ` Konrad Dybcio
  0 siblings, 1 reply; 5+ messages in thread
From: Amit Pundir @ 2021-02-05 13:15 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Andy Gross, Bjorn Andersson, Rob Herring, John Stultz,
	Sumit Semwal, linux-arm-msm, dt, lkml, phone-devel

Hi Konrad,

On Thu, 4 Feb 2021 at 19:46, Konrad Dybcio <konrad.dybcio@somainline.org> wrote:
>
> Hi!
>
> >vreg_l14a_1p88: ldo14 {
> >+                      regulator-min-microvolt = <1800000>;
> >+                      regulator-max-microvolt = <1800000>;
>
> Should probably be renamed to vreg_l14a_1p8 then.

ack.

>
>
> >+      ports {
> >+              port@1 {
> >+                      endpoint {
> >+                              remote-endpoint = <&tianma_nt36672a_in_0>;
> >+                              data-lanes = <0 1 2 3>;
> >+                      };
> >+              };
> >+      };
>
> The endpoint has a label, you can simply use &dsi0_out {};.

I didn't get what you meant there. Care to point to some reference dts
snippet please?

>
> >+              vddpos-supply = <&lab>;
> >+              vddneg-supply = <&ibb>;
>
> With Angelo's latest series [1] merged in, I reckon you should explicitly configure lab/ibb (like in [2]),
> as wrong settings (which CAN BE SET BY THE BOOTLOADER in some instances!!) can lead to hardware damage.

So iirc in the case of beryllium device, these regulators are pre set
by the bootloader and I can't find any reference of we
setting/resetting it explicitly to switch ON the panel and display. So
far default lab/ibb nodes are working fine for us and I'm hesitant to
tinker around anything regulator related that can potentially damage
the hardware. Having said that, I do see lab/ibb nodes being set in
the downstream dts, with relevant soft-start and discharge-resistor
properties and I can try switching to that once the new lab/ibb
changes land upstream.

Regards,
Amit Pundir


>
>
>
> Konrad
>
> [1] https://lore.kernel.org/linux-arm-msm/20210119174421.226541-1-angelogioacchino.delregno@somainline.org/
> [2] https://github.com/SoMainline/linux/commit/4f4853b2e252b5f9d03e90119110aac80258fc53

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

* Re: [PATCH v2] arm64: dts: qcom: sdm845-xiaomi-beryllium: Add DSI and panel bits
  2021-02-05 13:15   ` Amit Pundir
@ 2021-02-08 14:41     ` Konrad Dybcio
  2021-02-10  8:21       ` Amit Pundir
  0 siblings, 1 reply; 5+ messages in thread
From: Konrad Dybcio @ 2021-02-08 14:41 UTC (permalink / raw)
  To: Amit Pundir
  Cc: Andy Gross, Bjorn Andersson, Rob Herring, John Stultz,
	Sumit Semwal, linux-arm-msm, dt, lkml, phone-devel


>>> +      ports {
>>> +              port@1 {
>>> +                      endpoint {
>>> +                              remote-endpoint = <&tianma_nt36672a_in_0>;
>>> +                              data-lanes = <0 1 2 3>;
>>> +                      };
>>> +              };
>>> +      };
>> The endpoint has a label, you can simply use &dsi0_out {};.
> I didn't get what you meant there. Care to point to some reference dts
> snippet please?

sdm845.dtsi, L4139 as of v5.11-rc7:


port@1 {
                        reg = <1>;
                        dsi0_out: endpoint {
                        };
                    };


This means you can essentially do:

&dsi0_out {

    remote-endpoint = <&tianma_nt36672a_in_0>;
    lanes = <0 1 2 3>;

};


in your dt :)


>>> +              vddpos-supply = <&lab>;
>>> +              vddneg-supply = <&ibb>;
>> With Angelo's latest series [1] merged in, I reckon you should explicitly configure lab/ibb (like in [2]),
>> as wrong settings (which CAN BE SET BY THE BOOTLOADER in some instances!!) can lead to hardware damage.
> So iirc in the case of beryllium device, these regulators are pre set
> by the bootloader and I can't find any reference of we
> setting/resetting it explicitly to switch ON the panel and display. So
> far default lab/ibb nodes are working fine for us and I'm hesitant to
> tinker around anything regulator related that can potentially damage
> the hardware. Having said that, I do see lab/ibb nodes being set in
> the downstream dts, with relevant soft-start and discharge-resistor
> properties and I can try switching to that once the new lab/ibb
> changes land upstream.
>
> Regards,
> Amit Pundir
>
I understand your concerns, however we actually did find out that at least one device had LAB/IBB set up by the bootloader in a way that could potentially damage the electronics, so I'm just making you aware. If it works as-is, it's probably OK.


Konrad


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

* Re: [PATCH v2] arm64: dts: qcom: sdm845-xiaomi-beryllium: Add DSI and panel bits
  2021-02-08 14:41     ` Konrad Dybcio
@ 2021-02-10  8:21       ` Amit Pundir
  0 siblings, 0 replies; 5+ messages in thread
From: Amit Pundir @ 2021-02-10  8:21 UTC (permalink / raw)
  To: Konrad Dybcio
  Cc: Andy Gross, Bjorn Andersson, Rob Herring, John Stultz,
	Sumit Semwal, linux-arm-msm, dt, lkml, phone-devel

Hi,

On Mon, 8 Feb 2021 at 20:11, Konrad Dybcio <konrad.dybcio@somainline.org> wrote:
>
>
> >>> +      ports {
> >>> +              port@1 {
> >>> +                      endpoint {
> >>> +                              remote-endpoint = <&tianma_nt36672a_in_0>;
> >>> +                              data-lanes = <0 1 2 3>;
> >>> +                      };
> >>> +              };
> >>> +      };
> >> The endpoint has a label, you can simply use &dsi0_out {};.
> > I didn't get what you meant there. Care to point to some reference dts
> > snippet please?
>
> sdm845.dtsi, L4139 as of v5.11-rc7:
>
>
> port@1 {
>                         reg = <1>;
>                         dsi0_out: endpoint {
>                         };
>                     };
>
>
> This means you can essentially do:
>
> &dsi0_out {
>
>     remote-endpoint = <&tianma_nt36672a_in_0>;
>     lanes = <0 1 2 3>;
>
> };
>
>
> in your dt :)
>

Thank you. Added in v3.

>
> >>> +              vddpos-supply = <&lab>;
> >>> +              vddneg-supply = <&ibb>;
> >> With Angelo's latest series [1] merged in, I reckon you should explicitly configure lab/ibb (like in [2]),
> >> as wrong settings (which CAN BE SET BY THE BOOTLOADER in some instances!!) can lead to hardware damage.
> > So iirc in the case of beryllium device, these regulators are pre set
> > by the bootloader and I can't find any reference of we
> > setting/resetting it explicitly to switch ON the panel and display. So
> > far default lab/ibb nodes are working fine for us and I'm hesitant to
> > tinker around anything regulator related that can potentially damage
> > the hardware. Having said that, I do see lab/ibb nodes being set in
> > the downstream dts, with relevant soft-start and discharge-resistor
> > properties and I can try switching to that once the new lab/ibb
> > changes land upstream.
> >
> > Regards,
> > Amit Pundir
> >
> I understand your concerns, however we actually did find out that at least one device had LAB/IBB set up by the bootloader in a way that could potentially damage the electronics, so I'm just making you aware. If it works as-is, it's probably OK.

Device seem to be booting fine with downstream labibb regulator node
changes, hence added them in v3 as well. Smoke tested on
5.11.0-rc7-next-20210209.

Regards,
Amit Pundir

>
>
> Konrad
>

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

end of thread, other threads:[~2021-02-10  8:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-04  8:09 [PATCH v2] arm64: dts: qcom: sdm845-xiaomi-beryllium: Add DSI and panel bits Amit Pundir
2021-02-04 14:16 ` Konrad Dybcio
2021-02-05 13:15   ` Amit Pundir
2021-02-08 14:41     ` Konrad Dybcio
2021-02-10  8:21       ` Amit Pundir

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.