Newer revisions of the i.MX8MM EVK are equipped with a different PMIC than
the initial ones (PCA9540 instead of BD71847), which has already been
reflected in 4c07a21e5.

These changes have been reverted implicitly as part of the device tree
re-sync with the Linux kernel done in 24a7a3c1c.

This lead to an inconsistent state: while the device tree describes the old
PMIC again the code in board/freescale/imx8mm_evk/spl.c tries to initialize
the new PMIC:

    ret = pmic_get("pca9450@25", &dev);
    if (ret == -ENODEV) {
            puts("No pmic\n");
            return 0;
    }

This leads to the expected error message from SPL:

    U-Boot SPL 2023.07.02 (Sep 04 2023 - 15:57:57 +0200)
 -> No pmic
    SEC0:  RNG instantiated
    WDT:   Started watchdog@30280000 with servicing every 1000ms (60s timeout)
    Trying to boot from NOR
    NOTICE:  BL31: v2.2(release):rel_imx_5.4.70_2.3.6-0-g15e8ff164
    NOTICE:  BL31: Built : 13:51:09, Sep  4 2023

Fix by re-applying the device tree changes from 4c07a21e5.

Signed-off-by: Alexander Koch <ak...@initse.com>
---
 arch/arm/dts/imx8mm-evk-u-boot.dtsi |   4 +-
 arch/arm/dts/imx8mm-evk.dtsi        | 126 ++++++++++++++--------------
 2 files changed, 67 insertions(+), 63 deletions(-)

diff --git a/arch/arm/dts/imx8mm-evk-u-boot.dtsi 
b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
index 13688ec0d0..1bc7e4a38b 100644
--- a/arch/arm/dts/imx8mm-evk-u-boot.dtsi
+++ b/arch/arm/dts/imx8mm-evk-u-boot.dtsi
@@ -121,11 +121,11 @@
        bootph-pre-ram;
 };
 
-&{/soc@0/bus@30800000/i2c@30a20000/pmic@4b} {
+&{/soc@0/bus@30800000/i2c@30a20000/pca9450@25} {
        bootph-pre-ram;
 };
 
-&{/soc@0/bus@30800000/i2c@30a20000/pmic@4b/regulators} {
+&{/soc@0/bus@30800000/i2c@30a20000/pca9450@25/regulators} {
        bootph-pre-ram;
 };
 
diff --git a/arch/arm/dts/imx8mm-evk.dtsi b/arch/arm/dts/imx8mm-evk.dtsi
index 7d6317d95b..f2c15bf0ff 100644
--- a/arch/arm/dts/imx8mm-evk.dtsi
+++ b/arch/arm/dts/imx8mm-evk.dtsi
@@ -183,114 +183,118 @@
        pinctrl-0 = <&pinctrl_i2c1>;
        status = "okay";
 
-       pmic@4b {
-               compatible = "rohm,bd71847";
-               reg = <0x4b>;
-               pinctrl-names = "default";
+       pmic: pca9450@25 {
+               reg = <0x25>;
+               compatible = "nxp,pca9450a";
+               /* PMIC PCA9450 PMIC_nINT GPIO1_IO3 */
                pinctrl-0 = <&pinctrl_pmic>;
-               interrupt-parent = <&gpio1>;
-               interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
-               rohm,reset-snvs-powered;
-
-               #clock-cells = <0>;
-               clocks = <&osc_32k 0>;
-               clock-output-names = "clk-32k-out";
+               gpio_intr = <&gpio1 3 GPIO_ACTIVE_LOW>;
 
                regulators {
-                       buck1_reg: BUCK1 {
-                               regulator-name = "buck1";
-                               regulator-min-microvolt = <700000>;
-                               regulator-max-microvolt = <1300000>;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+
+                       pca9450,pmic-buck2-uses-i2c-dvs;
+                       /* Run/Standby voltage */
+                       pca9450,pmic-buck2-dvs-voltage = <950000>, <850000>;
+
+                       buck1_reg: regulator@0 {
+                               reg = <0>;
+                               regulator-compatible = "buck1";
+                               regulator-min-microvolt = <600000>;
+                               regulator-max-microvolt = <2187500>;
                                regulator-boot-on;
                                regulator-always-on;
-                               regulator-ramp-delay = <1250>;
+                               regulator-ramp-delay = <3125>;
                        };
 
-                       buck2_reg: BUCK2 {
-                               regulator-name = "buck2";
-                               regulator-min-microvolt = <700000>;
-                               regulator-max-microvolt = <1300000>;
+                       buck2_reg: regulator@1 {
+                               reg = <1>;
+                               regulator-compatible = "buck2";
+                               regulator-min-microvolt = <600000>;
+                               regulator-max-microvolt = <2187500>;
                                regulator-boot-on;
                                regulator-always-on;
-                               regulator-ramp-delay = <1250>;
-                               rohm,dvs-run-voltage = <1000000>;
-                               rohm,dvs-idle-voltage = <900000>;
+                               regulator-ramp-delay = <3125>;
                        };
 
-                       buck3_reg: BUCK3 {
-                               // BUCK5 in datasheet
-                               regulator-name = "buck3";
-                               regulator-min-microvolt = <700000>;
-                               regulator-max-microvolt = <1350000>;
+                       buck3_reg: regulator@2 {
+                               reg = <2>;
+                               regulator-compatible = "buck3";
+                               regulator-min-microvolt = <600000>;
+                               regulator-max-microvolt = <2187500>;
                                regulator-boot-on;
                                regulator-always-on;
                        };
 
-                       buck4_reg: BUCK4 {
-                               // BUCK6 in datasheet
-                               regulator-name = "buck4";
-                               regulator-min-microvolt = <3000000>;
-                               regulator-max-microvolt = <3300000>;
+                       buck4_reg: regulator@3 {
+                               reg = <3>;
+                               regulator-compatible = "buck4";
+                               regulator-min-microvolt = <600000>;
+                               regulator-max-microvolt = <3400000>;
                                regulator-boot-on;
                                regulator-always-on;
                        };
 
-                       buck5_reg: BUCK5 {
-                               // BUCK7 in datasheet
-                               regulator-name = "buck5";
-                               regulator-min-microvolt = <1605000>;
-                               regulator-max-microvolt = <1995000>;
+                       buck5_reg: regulator@4 {
+                               reg = <4>;
+                               regulator-compatible = "buck5";
+                               regulator-min-microvolt = <600000>;
+                               regulator-max-microvolt = <3400000>;
                                regulator-boot-on;
                                regulator-always-on;
                        };
 
-                       buck6_reg: BUCK6 {
-                               // BUCK8 in datasheet
-                               regulator-name = "buck6";
-                               regulator-min-microvolt = <800000>;
-                               regulator-max-microvolt = <1400000>;
+                       buck6_reg: regulator@5 {
+                               reg = <5>;
+                               regulator-compatible = "buck6";
+                               regulator-min-microvolt = <600000>;
+                               regulator-max-microvolt = <3400000>;
                                regulator-boot-on;
                                regulator-always-on;
                        };
 
-                       ldo1_reg: LDO1 {
-                               regulator-name = "ldo1";
+                       ldo1_reg: regulator@6 {
+                               reg = <6>;
+                               regulator-compatible = "ldo1";
                                regulator-min-microvolt = <1600000>;
                                regulator-max-microvolt = <3300000>;
                                regulator-boot-on;
                                regulator-always-on;
                        };
 
-                       ldo2_reg: LDO2 {
-                               regulator-name = "ldo2";
+                       ldo2_reg: regulator@7 {
+                               reg = <7>;
+                               regulator-compatible = "ldo2";
                                regulator-min-microvolt = <800000>;
-                               regulator-max-microvolt = <900000>;
+                               regulator-max-microvolt = <1150000>;
                                regulator-boot-on;
                                regulator-always-on;
                        };
 
-                       ldo3_reg: LDO3 {
-                               regulator-name = "ldo3";
-                               regulator-min-microvolt = <1800000>;
+                       ldo3_reg: regulator@8 {
+                               reg = <8>;
+                               regulator-compatible = "ldo3";
+                               regulator-min-microvolt = <800000>;
                                regulator-max-microvolt = <3300000>;
                                regulator-boot-on;
                                regulator-always-on;
                        };
 
-                       ldo4_reg: LDO4 {
-                               regulator-name = "ldo4";
-                               regulator-min-microvolt = <900000>;
-                               regulator-max-microvolt = <1800000>;
+                       ldo4_reg: regulator@9 {
+                               reg = <9>;
+                               regulator-compatible = "ldo4";
+                               regulator-min-microvolt = <800000>;
+                               regulator-max-microvolt = <3300000>;
                                regulator-boot-on;
                                regulator-always-on;
                        };
 
-                       ldo6_reg: LDO6 {
-                               regulator-name = "ldo6";
-                               regulator-min-microvolt = <900000>;
-                               regulator-max-microvolt = <1800000>;
-                               regulator-boot-on;
-                               regulator-always-on;
+                       ldo5_reg: regulator@10 {
+                               reg = <10>;
+                               regulator-compatible = "ldo5";
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <3300000>;
                        };
                };
        };
-- 
2.42.0

Reply via email to