[PATCH v1] arm64: dts: qcom: sm8250-xiaomi-pipa: Drop nonexistent hardware

Arseniy Velikanov posted 1 patch 2 months, 3 weeks ago
.../boot/dts/qcom/sm8250-xiaomi-pipa.dts      | 95 +------------------
1 file changed, 5 insertions(+), 90 deletions(-)
[PATCH v1] arm64: dts: qcom: sm8250-xiaomi-pipa: Drop nonexistent hardware
Posted by Arseniy Velikanov 2 months, 3 weeks ago
PM8009 was erroneously added since this device doesn't actually have it.
It triggers a big critical error at boot, so we're drop it.

Also it looks like the fuel gauge is not connected to the battery,
it reports nonsense info. Downstream kernel uses pmic fg.

PMIC fuel-gauge driver uses mixed stats about dual-cell battery,
so I combined it into one.

Fixes: 264beb3cbd0d ("arm64: dts: qcom: sm8250-xiaomi-pipa: Add initial device tree")

Signed-off-by: Arseniy Velikanov <me@adomerle.pw>
---
 .../boot/dts/qcom/sm8250-xiaomi-pipa.dts      | 95 +------------------
 1 file changed, 5 insertions(+), 90 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8250-xiaomi-pipa.dts b/arch/arm64/boot/dts/qcom/sm8250-xiaomi-pipa.dts
index 668078ea4f04..b74c3c9b4076 100644
--- a/arch/arm64/boot/dts/qcom/sm8250-xiaomi-pipa.dts
+++ b/arch/arm64/boot/dts/qcom/sm8250-xiaomi-pipa.dts
@@ -50,18 +50,12 @@ framebuffer: framebuffer@9c000000 {
 		};
 	};
 
-	battery_l: battery-l {
+	battery: battery {
 		compatible = "simple-battery";
-		voltage-min-design-microvolt = <3870000>;
-		energy-full-design-microwatt-hours = <16700000>;
-		charge-full-design-microamp-hours = <4420000>;
-	};
-
-	battery_r: battery-r {
-		compatible = "simple-battery";
-		voltage-min-design-microvolt = <3870000>;
-		energy-full-design-microwatt-hours = <16700000>;
-		charge-full-design-microamp-hours = <4420000>;
+		charge-full-design-microamp-hours = <8840000>;
+		energy-full-design-microwatt-hours = <34300000>;
+		voltage-min-design-microvolt = <3400000>;
+		voltage-max-design-microvolt = <4370000>;
 	};
 
 	bl_vddpos_5p5: bl-vddpos-regulator {
@@ -406,63 +400,6 @@ vreg_l11c_3p0: ldo11 {
 			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
 		};
 	};
-
-	regulators-2 {
-		compatible = "qcom,pm8009-rpmh-regulators";
-		qcom,pmic-id = "f";
-
-		vdd-s1-supply = <&vph_pwr>;
-		vdd-s2-supply = <&vreg_bob>;
-		vdd-l2-supply = <&vreg_s8c_1p35>;
-		vdd-l5-l6-supply = <&vreg_bob>;
-		vdd-l7-supply = <&vreg_s4a_1p8>;
-
-		vreg_s1f_1p2: smps1 {
-			regulator-name = "vreg_s1f_1p2";
-			regulator-min-microvolt = <1200000>;
-			regulator-max-microvolt = <1300000>;
-			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-		};
-
-		vreg_s2f_0p5: smps2 {
-			regulator-name = "vreg_s2f_0p5";
-			regulator-min-microvolt = <512000>;
-			regulator-max-microvolt = <1100000>;
-			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-		};
-
-		/* L1 is unused. */
-
-		vreg_l2f_1p3: ldo2 {
-			regulator-name = "vreg_l2f_1p3";
-			regulator-min-microvolt = <1056000>;
-			regulator-max-microvolt = <1200000>;
-			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-		};
-
-		/* L3 & L4 are unused. */
-
-		vreg_l5f_2p8: ldo5 {
-			regulator-name = "vreg_l5f_2p85";
-			regulator-min-microvolt = <2800000>;
-			regulator-max-microvolt = <3000000>;
-			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-		};
-
-		vreg_l6f_2p8: ldo6 {
-			regulator-name = "vreg_l6f_2p8";
-			regulator-min-microvolt = <2800000>;
-			regulator-max-microvolt = <3000000>;
-			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-		};
-
-		vreg_l7f_1p8: ldo7 {
-			regulator-name = "vreg_l7f_1p8";
-			regulator-min-microvolt = <1800000>;
-			regulator-max-microvolt = <1800000>;
-			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
-		};
-	};
 };
 
 &cdsp {
@@ -495,17 +432,6 @@ zap-shader {
 	};
 };
 
-&i2c0 {
-	clock-frequency = <400000>;
-	status = "okay";
-
-	fuel-gauge@55 {
-		compatible = "ti,bq27z561";
-		reg = <0x55>;
-		monitored-battery = <&battery_r>;
-	};
-};
-
 &i2c11 {
 	clock-frequency = <400000>;
 	status = "okay";
@@ -523,17 +449,6 @@ backlight: backlight@11 {
 	};
 };
 
-&i2c13 {
-	clock-frequency = <400000>;
-	status = "okay";
-
-	fuel-gauge@55 {
-		compatible = "ti,bq27z561";
-		reg = <0x55>;
-		monitored-battery = <&battery_l>;
-	};
-};
-
 &pcie0 {
 	status = "okay";
 };
-- 
2.50.0
Re: [PATCH v1] arm64: dts: qcom: sm8250-xiaomi-pipa: Drop nonexistent hardware
Posted by Danila Tikhonov 2 months, 3 weeks ago
On 7/15/25 21:56, Arseniy Velikanov wrote:
> PM8009 was erroneously added since this device doesn't actually have it.
> It triggers a big critical error at boot, so we're drop it.
>
> Also it looks like the fuel gauge is not connected to the battery,
> it reports nonsense info. Downstream kernel uses pmic fg.
>
> PMIC fuel-gauge driver uses mixed stats about dual-cell battery,
> so I combined it into one.
>
> Fixes: 264beb3cbd0d ("arm64: dts: qcom: sm8250-xiaomi-pipa: Add initial device tree")
>
> Signed-off-by: Arseniy Velikanov <me@adomerle.pw>
> ---
>   .../boot/dts/qcom/sm8250-xiaomi-pipa.dts      | 95 +------------------
>   1 file changed, 5 insertions(+), 90 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sm8250-xiaomi-pipa.dts b/arch/arm64/boot/dts/qcom/sm8250-xiaomi-pipa.dts
> index 668078ea4f04..b74c3c9b4076 100644
> --- a/arch/arm64/boot/dts/qcom/sm8250-xiaomi-pipa.dts
> +++ b/arch/arm64/boot/dts/qcom/sm8250-xiaomi-pipa.dts
> @@ -50,18 +50,12 @@ framebuffer: framebuffer@9c000000 {
>   		};
>   	};
>   
> -	battery_l: battery-l {
> +	battery: battery {
>   		compatible = "simple-battery";
> -		voltage-min-design-microvolt = <3870000>;
> -		energy-full-design-microwatt-hours = <16700000>;
> -		charge-full-design-microamp-hours = <4420000>;
> -	};
> -
> -	battery_r: battery-r {
> -		compatible = "simple-battery";
> -		voltage-min-design-microvolt = <3870000>;
> -		energy-full-design-microwatt-hours = <16700000>;
> -		charge-full-design-microamp-hours = <4420000>;
> +		charge-full-design-microamp-hours = <8840000>;
> +		energy-full-design-microwatt-hours = <34300000>;
> +		voltage-min-design-microvolt = <3400000>;
> +		voltage-max-design-microvolt = <4370000>;
>   	};
>   
>   	bl_vddpos_5p5: bl-vddpos-regulator {
> @@ -406,63 +400,6 @@ vreg_l11c_3p0: ldo11 {
>   			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
>   		};
>   	};
> -
> -	regulators-2 {
> -		compatible = "qcom,pm8009-rpmh-regulators";
Thanks for the patch.
Please remove the extra pm8009.dtsi include too.
> -		qcom,pmic-id = "f";
> -
> -		vdd-s1-supply = <&vph_pwr>;
> -		vdd-s2-supply = <&vreg_bob>;
> -		vdd-l2-supply = <&vreg_s8c_1p35>;
> -		vdd-l5-l6-supply = <&vreg_bob>;
> -		vdd-l7-supply = <&vreg_s4a_1p8>;
> -
> -		vreg_s1f_1p2: smps1 {
> -			regulator-name = "vreg_s1f_1p2";
> -			regulator-min-microvolt = <1200000>;
> -			regulator-max-microvolt = <1300000>;
> -			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> -		};
> -
> -		vreg_s2f_0p5: smps2 {
> -			regulator-name = "vreg_s2f_0p5";
> -			regulator-min-microvolt = <512000>;
> -			regulator-max-microvolt = <1100000>;
> -			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> -		};
> -
> -		/* L1 is unused. */
> -
> -		vreg_l2f_1p3: ldo2 {
> -			regulator-name = "vreg_l2f_1p3";
> -			regulator-min-microvolt = <1056000>;
> -			regulator-max-microvolt = <1200000>;
> -			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> -		};
> -
> -		/* L3 & L4 are unused. */
> -
> -		vreg_l5f_2p8: ldo5 {
> -			regulator-name = "vreg_l5f_2p85";
> -			regulator-min-microvolt = <2800000>;
> -			regulator-max-microvolt = <3000000>;
> -			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> -		};
> -
> -		vreg_l6f_2p8: ldo6 {
> -			regulator-name = "vreg_l6f_2p8";
> -			regulator-min-microvolt = <2800000>;
> -			regulator-max-microvolt = <3000000>;
> -			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> -		};
> -
> -		vreg_l7f_1p8: ldo7 {
> -			regulator-name = "vreg_l7f_1p8";
> -			regulator-min-microvolt = <1800000>;
> -			regulator-max-microvolt = <1800000>;
> -			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> -		};
> -	};
>   };
>   
>   &cdsp {
> @@ -495,17 +432,6 @@ zap-shader {
>   	};
>   };
>   
> -&i2c0 {
> -	clock-frequency = <400000>;
> -	status = "okay";
> -
> -	fuel-gauge@55 {
> -		compatible = "ti,bq27z561";
> -		reg = <0x55>;
> -		monitored-battery = <&battery_r>;
> -	};
> -};
> -
>   &i2c11 {
>   	clock-frequency = <400000>;
>   	status = "okay";
> @@ -523,17 +449,6 @@ backlight: backlight@11 {
>   	};
>   };
>   
> -&i2c13 {
> -	clock-frequency = <400000>;
> -	status = "okay";
> -
> -	fuel-gauge@55 {
> -		compatible = "ti,bq27z561";
> -		reg = <0x55>;
> -		monitored-battery = <&battery_l>;
> -	};
> -};
> -
>   &pcie0 {
>   	status = "okay";
>   };
---
Best wishes
Danila
Re: [PATCH v1] arm64: dts: qcom: sm8250-xiaomi-pipa: Drop nonexistent hardware
Posted by Dmitry Baryshkov 2 months, 3 weeks ago
On Tue, Jul 15, 2025 at 10:56:36PM +0400, Arseniy Velikanov wrote:
> PM8009 was erroneously added since this device doesn't actually have it.
> It triggers a big critical error at boot, so we're drop it.

Might it be that there are different SKUs?

> 
> Also it looks like the fuel gauge is not connected to the battery,
> it reports nonsense info. Downstream kernel uses pmic fg.

Separate commit, please.

> 
> PMIC fuel-gauge driver uses mixed stats about dual-cell battery,
> so I combined it into one.
> 
> Fixes: 264beb3cbd0d ("arm64: dts: qcom: sm8250-xiaomi-pipa: Add initial device tree")
> 
> Signed-off-by: Arseniy Velikanov <me@adomerle.pw>

Please remove empty line between tags (i.e. between Fixes and SoB).

> ---
>  .../boot/dts/qcom/sm8250-xiaomi-pipa.dts      | 95 +------------------
>  1 file changed, 5 insertions(+), 90 deletions(-)
> 

-- 
With best wishes
Dmitry
Re: [PATCH v1] arm64: dts: qcom: sm8250-xiaomi-pipa: Drop nonexistent hardware
Posted by Arseniy Velikanov 2 months, 3 weeks ago
On 15.07.2025 23:22, Dmitry Baryshkov wrote:
> On Tue, Jul 15, 2025 at 10:56:36PM +0400, Arseniy Velikanov wrote:
>> PM8009 was erroneously added since this device doesn't actually have it.
>> It triggers a big critical error at boot, so we're drop it.
> Might it be that there are different SKUs?
Well, while it's in dts, but it was disabled in the kernel config:
https://github.com/MiCode/Xiaomi_Kernel_OpenSource/blob/pipa-t-oss/arch/arm64/configs/vendor/pipa_user_defconfig#L413

Maybe they just forgot to remove it from dts (I still don't understand 
why it is displayed in i2cdetect though).
>
>> Also it looks like the fuel gauge is not connected to the battery,
>> it reports nonsense info. Downstream kernel uses pmic fg.
> Separate commit, please.
>
>> PMIC fuel-gauge driver uses mixed stats about dual-cell battery,
>> so I combined it into one.
>>
>> Fixes: 264beb3cbd0d ("arm64: dts: qcom: sm8250-xiaomi-pipa: Add initial device tree")
>>
>> Signed-off-by: Arseniy Velikanov <me@adomerle.pw>
> Please remove empty line between tags (i.e. between Fixes and SoB).
>
>> ---
>>   .../boot/dts/qcom/sm8250-xiaomi-pipa.dts      | 95 +------------------
>>   1 file changed, 5 insertions(+), 90 deletions(-)
>>
>
---
Kind regards,
Arseniy.
Re: [PATCH v1] arm64: dts: qcom: sm8250-xiaomi-pipa: Drop nonexistent hardware
Posted by Dmitry Baryshkov 2 months, 3 weeks ago
On Tue, 15 Jul 2025 at 22:37, Arseniy Velikanov <me@adomerle.pw> wrote:
>
>
> On 15.07.2025 23:22, Dmitry Baryshkov wrote:
> > On Tue, Jul 15, 2025 at 10:56:36PM +0400, Arseniy Velikanov wrote:
> >> PM8009 was erroneously added since this device doesn't actually have it.
> >> It triggers a big critical error at boot, so we're drop it.
> > Might it be that there are different SKUs?
> Well, while it's in dts, but it was disabled in the kernel config:
> https://github.com/MiCode/Xiaomi_Kernel_OpenSource/blob/pipa-t-oss/arch/arm64/configs/vendor/pipa_user_defconfig#L413
>
> Maybe they just forgot to remove it from dts (I still don't understand
> why it is displayed in i2cdetect though).

For PMIC you can check in
/sys/kernel/debug/soc/qcom_socinfo/pmic_model_array. For FG it's not
possible.

> >
> >> Also it looks like the fuel gauge is not connected to the battery,
> >> it reports nonsense info. Downstream kernel uses pmic fg.
> > Separate commit, please.
> >
> >> PMIC fuel-gauge driver uses mixed stats about dual-cell battery,
> >> so I combined it into one.
> >>
> >> Fixes: 264beb3cbd0d ("arm64: dts: qcom: sm8250-xiaomi-pipa: Add initial device tree")
> >>
> >> Signed-off-by: Arseniy Velikanov <me@adomerle.pw>
> > Please remove empty line between tags (i.e. between Fixes and SoB).
> >
> >> ---
> >>   .../boot/dts/qcom/sm8250-xiaomi-pipa.dts      | 95 +------------------
> >>   1 file changed, 5 insertions(+), 90 deletions(-)
> >>
> >
> ---
> Kind regards,
> Arseniy.
>


-- 
With best wishes
Dmitry
Re: [PATCH v1] arm64: dts: qcom: sm8250-xiaomi-pipa: Drop nonexistent hardware
Posted by Luka Panio 2 months, 3 weeks ago
Reviewed-by: Luka Panio lukapanio@gmail.com

On Tue, Jul 15, 2025 at 9:02 PM Arseniy Velikanov <me@adomerle.pw> wrote:
>
> PM8009 was erroneously added since this device doesn't actually have it.
> It triggers a big critical error at boot, so we're drop it.
>
> Also it looks like the fuel gauge is not connected to the battery,
> it reports nonsense info. Downstream kernel uses pmic fg.
>
> PMIC fuel-gauge driver uses mixed stats about dual-cell battery,
> so I combined it into one.
>
> Fixes: 264beb3cbd0d ("arm64: dts: qcom: sm8250-xiaomi-pipa: Add initial device tree")
>
> Signed-off-by: Arseniy Velikanov <me@adomerle.pw>
> ---
>  .../boot/dts/qcom/sm8250-xiaomi-pipa.dts      | 95 +------------------
>  1 file changed, 5 insertions(+), 90 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sm8250-xiaomi-pipa.dts b/arch/arm64/boot/dts/qcom/sm8250-xiaomi-pipa.dts
> index 668078ea4f04..b74c3c9b4076 100644
> --- a/arch/arm64/boot/dts/qcom/sm8250-xiaomi-pipa.dts
> +++ b/arch/arm64/boot/dts/qcom/sm8250-xiaomi-pipa.dts
> @@ -50,18 +50,12 @@ framebuffer: framebuffer@9c000000 {
>                 };
>         };
>
> -       battery_l: battery-l {
> +       battery: battery {
>                 compatible = "simple-battery";
> -               voltage-min-design-microvolt = <3870000>;
> -               energy-full-design-microwatt-hours = <16700000>;
> -               charge-full-design-microamp-hours = <4420000>;
> -       };
> -
> -       battery_r: battery-r {
> -               compatible = "simple-battery";
> -               voltage-min-design-microvolt = <3870000>;
> -               energy-full-design-microwatt-hours = <16700000>;
> -               charge-full-design-microamp-hours = <4420000>;
> +               charge-full-design-microamp-hours = <8840000>;
> +               energy-full-design-microwatt-hours = <34300000>;
> +               voltage-min-design-microvolt = <3400000>;
> +               voltage-max-design-microvolt = <4370000>;
>         };
>
>         bl_vddpos_5p5: bl-vddpos-regulator {
> @@ -406,63 +400,6 @@ vreg_l11c_3p0: ldo11 {
>                         regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
>                 };
>         };
> -
> -       regulators-2 {
> -               compatible = "qcom,pm8009-rpmh-regulators";
> -               qcom,pmic-id = "f";
> -
> -               vdd-s1-supply = <&vph_pwr>;
> -               vdd-s2-supply = <&vreg_bob>;
> -               vdd-l2-supply = <&vreg_s8c_1p35>;
> -               vdd-l5-l6-supply = <&vreg_bob>;
> -               vdd-l7-supply = <&vreg_s4a_1p8>;
> -
> -               vreg_s1f_1p2: smps1 {
> -                       regulator-name = "vreg_s1f_1p2";
> -                       regulator-min-microvolt = <1200000>;
> -                       regulator-max-microvolt = <1300000>;
> -                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> -               };
> -
> -               vreg_s2f_0p5: smps2 {
> -                       regulator-name = "vreg_s2f_0p5";
> -                       regulator-min-microvolt = <512000>;
> -                       regulator-max-microvolt = <1100000>;
> -                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> -               };
> -
> -               /* L1 is unused. */
> -
> -               vreg_l2f_1p3: ldo2 {
> -                       regulator-name = "vreg_l2f_1p3";
> -                       regulator-min-microvolt = <1056000>;
> -                       regulator-max-microvolt = <1200000>;
> -                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> -               };
> -
> -               /* L3 & L4 are unused. */
> -
> -               vreg_l5f_2p8: ldo5 {
> -                       regulator-name = "vreg_l5f_2p85";
> -                       regulator-min-microvolt = <2800000>;
> -                       regulator-max-microvolt = <3000000>;
> -                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> -               };
> -
> -               vreg_l6f_2p8: ldo6 {
> -                       regulator-name = "vreg_l6f_2p8";
> -                       regulator-min-microvolt = <2800000>;
> -                       regulator-max-microvolt = <3000000>;
> -                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> -               };
> -
> -               vreg_l7f_1p8: ldo7 {
> -                       regulator-name = "vreg_l7f_1p8";
> -                       regulator-min-microvolt = <1800000>;
> -                       regulator-max-microvolt = <1800000>;
> -                       regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
> -               };
> -       };
>  };
>
>  &cdsp {
> @@ -495,17 +432,6 @@ zap-shader {
>         };
>  };
>
> -&i2c0 {
> -       clock-frequency = <400000>;
> -       status = "okay";
> -
> -       fuel-gauge@55 {
> -               compatible = "ti,bq27z561";
> -               reg = <0x55>;
> -               monitored-battery = <&battery_r>;
> -       };
> -};
> -
>  &i2c11 {
>         clock-frequency = <400000>;
>         status = "okay";
> @@ -523,17 +449,6 @@ backlight: backlight@11 {
>         };
>  };
>
> -&i2c13 {
> -       clock-frequency = <400000>;
> -       status = "okay";
> -
> -       fuel-gauge@55 {
> -               compatible = "ti,bq27z561";
> -               reg = <0x55>;
> -               monitored-battery = <&battery_l>;
> -       };
> -};
> -
>  &pcie0 {
>         status = "okay";
>  };
> --
> 2.50.0