[PATCH v5 01/12] arm64: dts: qcom: sdm845-lg-common: Sort nodes and properties

Paul Sajna posted 12 patches 1 week, 6 days ago
[PATCH v5 01/12] arm64: dts: qcom: sdm845-lg-common: Sort nodes and properties
Posted by Paul Sajna 1 week, 6 days ago
Improve adherance to style guidelines below:
https://docs.kernel.org/devicetree/bindings/dts-coding-style.html

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Paul Sajna <sajattack@postmarketos.org>
---
 arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi | 144 ++++++++++++++-----------
 1 file changed, 82 insertions(+), 62 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
index 0ee2f4b99fbd..b8ab64a8de1c 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
@@ -38,11 +38,6 @@ reserved-memory {
 		#size-cells = <2>;
 		ranges;
 
-		qseecom_mem: memory@b2000000 {
-			reg = <0 0xb2000000 0 0x1800000>;
-			no-map;
-		};
-
 		gpu_mem: memory@8c415000 {
 			reg = <0 0x8c415000 0 0x2000>;
 			no-map;
@@ -99,7 +94,12 @@ memory@9d400000 {
 			no-map;
 		};
 
-		rmtfs_mem: rmtfs-region@f0800000 {
+		qseecom_mem: memory@b2000000 {
+			reg = <0 0xb2000000 0 0x1800000>;
+			no-map;
+		};
+
+		rmtfs_mem: memory@f0801000 {
 			compatible = "qcom,rmtfs-mem";
 			reg = <0 0xf0800000 0 0x202000>;
 			qcom,use-guard-pages;
@@ -467,14 +467,22 @@ &mss_pil {
 	status = "okay";
 };
 
+&pm8998_gpios {
+	vol_up_pin_a: vol-up-active-state {
+		pins = "gpio6";
+		function = "normal";
+		input-enable;
+		bias-pull-up;
+		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
+	};
+};
+
 &pm8998_resin {
 	linux,code = <KEY_VOLUMEDOWN>;
 	status = "okay";
 };
 
 &sdhc_2 {
-	status = "okay";
-
 	cd-gpios = <&tlmm 126 GPIO_ACTIVE_LOW>;
 
 	pinctrl-names = "default";
@@ -482,26 +490,70 @@ &sdhc_2 {
 
 	vmmc-supply = <&vreg_l21a_2p95>;
 	vqmmc-supply = <&vddpx_2>;
+
+	status = "okay";
 };
 
-/*
- * UFS works partially and only with clk_ignore_unused.
- * Sometimes it crashes with I/O errors.
- */
-&ufs_mem_hc {
+/* PINCTRL - additions to nodes defined in sdm845.dtsi */
+
+&tlmm {
+	gpio-reserved-ranges = <28 4>, <81 4>;
+
+	sdc2_clk: sdc2-clk-state {
+		pins = "sdc2_clk";
+		bias-disable;
+
+		/*
+		 * It seems that mmc_test reports errors if drive
+		 * strength is not 16 on clk, cmd, and data pins.
+		 *
+		 * TODO: copy-pasted from mtp, try other values
+		 * on these devices.
+		 */
+		drive-strength = <16>;
+	};
+
+	sdc2_cmd: sdc2-cmd-state {
+		pins = "sdc2_cmd";
+		bias-pull-up;
+		drive-strength = <16>;
+	};
+
+	sdc2_data: sdc2-data-state {
+		pins = "sdc2_data";
+		bias-pull-up;
+		drive-strength = <16>;
+	};
+
+	sd_card_det_n: sd-card-det-n-state {
+		pins = "gpio126";
+		function = "gpio";
+		bias-pull-up;
+	};
+};
+
+&qupv3_id_0 {
 	status = "okay";
+};
 
+&qupv3_id_1 {
+	status = "okay";
+};
+
+&ufs_mem_hc {
 	reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>;
 
 	vcc-supply = <&vreg_l20a_2p95>;
 	vcc-max-microamp = <600000>;
-};
 
-&ufs_mem_phy {
 	status = "okay";
+};
 
+&ufs_mem_phy {
 	vdda-phy-supply = <&vdda_ufs1_core>;
 	vdda-pll-supply = <&vdda_ufs1_1p2>;
+
+	status = "okay";
 };
 
 &usb_1 {
@@ -514,8 +566,6 @@ &usb_1_dwc3 {
 };
 
 &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>;
@@ -524,59 +574,29 @@ &usb_1_hsphy {
 	qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_21_6_MA>;
 	qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_5_PERCENT>;
 	qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>;
-};
 
-&usb_1_qmpphy {
 	status = "okay";
+};
 
+&usb_1_qmpphy {
 	vdda-phy-supply = <&vdda_usb1_ss_1p2>;
 	vdda-pll-supply = <&vdda_usb1_ss_core>;
-};
-
-/* PINCTRL - additions to nodes defined in sdm845.dtsi */
-
-&tlmm {
-	gpio-reserved-ranges = <28 4>, <81 4>;
-
-	sdc2_clk: sdc2-clk-state {
-		pins = "sdc2_clk";
-		bias-disable;
 
-		/*
-		 * It seems that mmc_test reports errors if drive
-		 * strength is not 16 on clk, cmd, and data pins.
-		 *
-		 * TODO: copy-pasted from mtp, try other values
-		 * on these devices.
-		 */
-		drive-strength = <16>;
-	};
+	status = "okay";
+};
 
-	sdc2_cmd: sdc2-cmd-state {
-		pins = "sdc2_cmd";
-		bias-pull-up;
-		drive-strength = <16>;
-	};
+&venus {
+	status = "okay";
+};
 
-	sdc2_data: sdc2-data-state {
-		pins = "sdc2_data";
-		bias-pull-up;
-		drive-strength = <16>;
-	};
+&wifi {
+	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>;
+	vdd-3.3-ch1-supply = <&vreg_l23a_3p3>;
 
-	sd_card_det_n: sd-card-det-n-state {
-		pins = "gpio126";
-		function = "gpio";
-		bias-pull-up;
-	};
-};
+	qcom,snoc-host-cap-skip-quirk;
 
-&pm8998_gpios {
-	vol_up_pin_a: vol-up-active-state {
-		pins = "gpio6";
-		function = "normal";
-		input-enable;
-		bias-pull-up;
-		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
-	};
+	status = "okay";
 };

-- 
2.52.0
Re: [PATCH v5 01/12] arm64: dts: qcom: sdm845-lg-common: Sort nodes and properties
Posted by David Heidelberg 1 week, 2 days ago
On 03/12/2025 10:40, Paul Sajna wrote:

[...]

> -		rmtfs_mem: rmtfs-region@f0800000 {

this is a correct region f0800000

> +		qseecom_mem: memory@b2000000 {
> +			reg = <0 0xb2000000 0 0x1800000>;
> +			no-map;
> +		};
> +
> +		rmtfs_mem: memory@f0801000 {

this is f0801000 (+1000) offset from old sdm845 downstream with boundaries.

[...]

I noticed this when I tried apply your changes on top of sdm845-next repo.

If you need testing, this repo should help you (as all phone-related 
patches should be applied on top of recent -next and work)

David

-- 
David Heidelberg
Re: [PATCH v5 01/12] arm64: dts: qcom: sdm845-lg-common: Sort nodes and properties
Posted by Krzysztof Kozlowski 1 week, 5 days ago
On 03/12/2025 10:40, Paul Sajna wrote:
> Improve adherance to style guidelines below:
> https://docs.kernel.org/devicetree/bindings/dts-coding-style.html
> 
> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> Signed-off-by: Paul Sajna <sajattack@postmarketos.org>
> ---
>  arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi | 144 ++++++++++++++-----------
>  1 file changed, 82 insertions(+), 62 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
> index 0ee2f4b99fbd..b8ab64a8de1c 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
> @@ -38,11 +38,6 @@ reserved-memory {
>  		#size-cells = <2>;
>  		ranges;
>  
> -		qseecom_mem: memory@b2000000 {
> -			reg = <0 0xb2000000 0 0x1800000>;
> -			no-map;
> -		};
> -
>  		gpu_mem: memory@8c415000 {
>  			reg = <0 0x8c415000 0 0x2000>;
>  			no-map;
> @@ -99,7 +94,12 @@ memory@9d400000 {
>  			no-map;
>  		};
>  
> -		rmtfs_mem: rmtfs-region@f0800000 {

Why?

> +		qseecom_mem: memory@b2000000 {
> +			reg = <0 0xb2000000 0 0x1800000>;
> +			no-map;
> +		};
> +
> +		rmtfs_mem: memory@f0801000 {

No, you are doing much more then sorting. You are changing names to
incorrect ones and maybe (tricky to say) change also unit address to
buggy one.

@Konrad,
Why are we started resorting the addresses BEFORE we came up with proper
linter? Why the rule suddenly changed?

Best regards,
Krzysztof
Re: [PATCH v5 01/12] arm64: dts: qcom: sdm845-lg-common: Sort nodes and properties
Posted by Konrad Dybcio 1 week, 5 days ago
On 12/4/25 2:11 PM, Krzysztof Kozlowski wrote:
> On 03/12/2025 10:40, Paul Sajna wrote:
>> Improve adherance to style guidelines below:
>> https://docs.kernel.org/devicetree/bindings/dts-coding-style.html
>>
>> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
>> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>> Signed-off-by: Paul Sajna <sajattack@postmarketos.org>
>> ---
>>  arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi | 144 ++++++++++++++-----------
>>  1 file changed, 82 insertions(+), 62 deletions(-)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
>> index 0ee2f4b99fbd..b8ab64a8de1c 100644
>> --- a/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
>> +++ b/arch/arm64/boot/dts/qcom/sdm845-lg-common.dtsi
>> @@ -38,11 +38,6 @@ reserved-memory {
>>  		#size-cells = <2>;
>>  		ranges;
>>  
>> -		qseecom_mem: memory@b2000000 {
>> -			reg = <0 0xb2000000 0 0x1800000>;
>> -			no-map;
>> -		};
>> -
>>  		gpu_mem: memory@8c415000 {
>>  			reg = <0 0x8c415000 0 0x2000>;
>>  			no-map;
>> @@ -99,7 +94,12 @@ memory@9d400000 {
>>  			no-map;
>>  		};
>>  
>> -		rmtfs_mem: rmtfs-region@f0800000 {
> 
> Why?
> 
>> +		qseecom_mem: memory@b2000000 {
>> +			reg = <0 0xb2000000 0 0x1800000>;
>> +			no-map;
>> +		};
>> +
>> +		rmtfs_mem: memory@f0801000 {
> 
> No, you are doing much more then sorting. You are changing names to
> incorrect ones and maybe (tricky to say) change also unit address to
> buggy one.
> 
> @Konrad,
> Why are we started resorting the addresses BEFORE we came up with proper
> linter? Why the rule suddenly changed?

I don't really mind small cleanups that are done as part of bigger
feature additions, as opposed to fixing a single file for the sake
of it

Konrad