From 8cfd540d0d8874331ac084f312eb2ab8aac817a4 Mon Sep 17 00:00:00 2001 From: Martin Schmiedel Date: Mon, 2 Jun 2025 13:01:16 +0200 Subject: [PATCH] MBa8MPxL-RAS314: fix sd-card regulator error fixes a problem which unpredictable switch of the sd-card voltage Signed-off-by: Martin Schmiedel --- .../imx8m-6.12/0003-TQMa8MPXL-LDO5-Fix.patch | 259 ++++++++++++++++++ 1 file changed, 259 insertions(+) create mode 100644 patch/kernel/archive/imx8m-6.12/0003-TQMa8MPXL-LDO5-Fix.patch diff --git a/patch/kernel/archive/imx8m-6.12/0003-TQMa8MPXL-LDO5-Fix.patch b/patch/kernel/archive/imx8m-6.12/0003-TQMa8MPXL-LDO5-Fix.patch new file mode 100644 index 0000000000..86dd3c0927 --- /dev/null +++ b/patch/kernel/archive/imx8m-6.12/0003-TQMa8MPXL-LDO5-Fix.patch @@ -0,0 +1,259 @@ +From 17f6e064d93013f2aaca40e9f44bf2c5b45652eb Mon Sep 17 00:00:00 2001 +From: Martin Schmiedel +Date: Thu, 5 Jun 2025 13:11:40 +0200 +Subject: [PATCH] TQMa8MPXL LDO5 Fix + +Signed-off-by: Martin Schmiedel +Signed-off-by: Markus Niebel +--- + .../imx8mp-tqma8mpql-mba8mp-ras314.dts | 13 ++--- + .../freescale/imx8mp-tqma8mpql-mba8mpxl.dts | 13 ++--- + .../boot/dts/freescale/imx8mp-tqma8mpql.dtsi | 48 +++++++++++++++---- + 3 files changed, 53 insertions(+), 21 deletions(-) + +diff --git a/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql-mba8mp-ras314.dts b/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql-mba8mp-ras314.dts +index d7fd9d36f824..f7346b3d35fe 100644 +--- a/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql-mba8mp-ras314.dts ++++ b/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql-mba8mp-ras314.dts +@@ -467,6 +467,10 @@ &pwm4 { + status = "okay"; + }; + ++®_usdhc2_vqmmc { ++ status = "okay"; ++}; ++ + &sai5 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sai5>; +@@ -876,8 +880,7 @@ pinctrl_usdhc2: usdhc2grp { + , + , + , +- , +- ; ++ ; + }; + + pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp { +@@ -886,8 +889,7 @@ pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp { + , + , + , +- , +- ; ++ ; + }; + + pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp { +@@ -896,8 +898,7 @@ pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp { + , + , + , +- , +- ; ++ ; + }; + + pinctrl_usdhc2_gpio: usdhc2-gpiogrp { +diff --git a/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql-mba8mpxl.dts b/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql-mba8mpxl.dts +index ae64731266f3..e7c16a7ee6c2 100644 +--- a/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql-mba8mpxl.dts ++++ b/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql-mba8mpxl.dts +@@ -603,6 +603,10 @@ &pwm3 { + status = "okay"; + }; + ++®_usdhc2_vqmmc { ++ status = "okay"; ++}; ++ + &sai3 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sai3>; +@@ -982,8 +986,7 @@ pinctrl_usdhc2: usdhc2grp { + , + , + , +- , +- ; ++ ; + }; + + pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp { +@@ -992,8 +995,7 @@ pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp { + , + , + , +- , +- ; ++ ; + }; + + pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp { +@@ -1002,8 +1004,7 @@ pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp { + , + , + , +- , +- ; ++ ; + }; + + pinctrl_usdhc2_gpio: usdhc2-gpiogrp { +diff --git a/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql.dtsi b/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql.dtsi +index 3ddc5aaa7c5f..05a518209b59 100644 +--- a/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql.dtsi ++++ b/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql.dtsi +@@ -16,13 +16,26 @@ memory@40000000 { + reg = <0x0 0x40000000 0 0x80000000>; + }; + +- /* identical to buck4_reg, but should never change */ +- reg_vcc3v3: regulator-vcc3v3 { +- compatible = "regulator-fixed"; +- regulator-name = "VCC3V3"; +- regulator-min-microvolt = <3300000>; ++ reg_usdhc2_vqmmc: regulator-usdhc2-vqmmc { ++ compatible = "regulator-gpio"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pinctrl_reg_usdhc2_vqmmc>; ++ regulator-name = "V_SD2"; ++ regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; +- regulator-always-on; ++ gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; ++ states = <1800000 0x1>, ++ <3300000 0x0>; ++ vin-supply = <&ldo5_reg>; ++ status = "disabled"; ++ }; ++ ++ reg_5v_in: regulator-5v-in { ++ compatible = "regulator-fixed"; ++ regulator-name = "V_5V_IN"; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ regulator-boot-on; + }; + }; + +@@ -80,6 +93,7 @@ buck1_reg: BUCK1 { + regulator-name = "BUCK1"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <950000>; ++ vin-supply = <®_5v_in>; + regulator-boot-on; + regulator-always-on; + regulator-ramp-delay = <3125>; +@@ -90,6 +104,7 @@ buck2_reg: BUCK2 { + regulator-name = "BUCK2"; + regulator-min-microvolt = <850000>; + regulator-max-microvolt = <1000000>; ++ vin-supply = <®_5v_in>; + regulator-boot-on; + regulator-always-on; + nxp,dvs-run-voltage = <950000>; +@@ -102,6 +117,7 @@ buck4_reg: BUCK4 { + regulator-name = "BUCK4"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; ++ vin-supply = <®_5v_in>; + regulator-boot-on; + regulator-always-on; + }; +@@ -111,6 +127,7 @@ buck5_reg: BUCK5 { + regulator-name = "BUCK5"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; ++ vin-supply = <®_5v_in>; + regulator-boot-on; + regulator-always-on; + }; +@@ -120,6 +137,7 @@ buck6_reg: BUCK6 { + regulator-name = "BUCK6"; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; ++ vin-supply = <®_5v_in>; + regulator-boot-on; + regulator-always-on; + }; +@@ -129,6 +147,7 @@ ldo1_reg: LDO1 { + regulator-name = "LDO1"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; ++ vin-supply = <®_5v_in>; + regulator-boot-on; + regulator-always-on; + }; +@@ -138,6 +157,7 @@ ldo3_reg: LDO3 { + regulator-name = "LDO3"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; ++ vin-supply = <®_5v_in>; + regulator-boot-on; + regulator-always-on; + }; +@@ -147,6 +167,7 @@ ldo4_reg: LDO4 { + regulator-name = "LDO4"; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <3300000>; ++ vin-supply = <®_5v_in>; + }; + + /* VCC SD IO - switched using SD2 VSELECT */ +@@ -154,6 +175,7 @@ ldo5_reg: LDO5 { + regulator-name = "LDO5"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; ++ vin-supply = <®_5v_in>; + }; + }; + }; +@@ -168,17 +190,21 @@ at24c02: eeprom@53 { + read-only; + reg = <0x53>; + pagesize = <16>; +- vcc-supply = <®_vcc3v3>; ++ vcc-supply = <&buck4_reg>; + }; + + m24c64: eeprom@57 { + compatible = "atmel,24c64"; + reg = <0x57>; + pagesize = <32>; +- vcc-supply = <®_vcc3v3>; ++ vcc-supply = <&buck4_reg>; + }; + }; + ++&usdhc2 { ++ vqmmc-supply = <®_usdhc2_vqmmc>; ++}; ++ + &usdhc3 { + pinctrl-names = "default", "state_100mhz", "state_200mhz"; + pinctrl-0 = <&pinctrl_usdhc3>; +@@ -188,7 +214,7 @@ &usdhc3 { + non-removable; + no-sd; + no-sdio; +- vmmc-supply = <®_vcc3v3>; ++ vmmc-supply = <&buck4_reg>; + vqmmc-supply = <&buck5_reg>; + status = "okay"; + }; +@@ -228,6 +254,10 @@ pinctrl_reg_usdhc2_vmmc: regusdhc2vmmcgrp { + fsl,pins = ; + }; + ++ pinctrl_reg_usdhc2_vqmmc: regusdhc2vqmmcgrp { ++ fsl,pins = ; ++ }; ++ + pinctrl_usdhc3: usdhc3grp { + fsl,pins = , + , +-- +2.43.0 +