Skip to contentSkip to conversation

arm: dts: imx8mm_evk: Fix PMIC definition

PATCH In review Alexander Koch 2 participants 2 messages Sep 26, 2023 – Dec 15, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: dts: imx8mm_evk: Fix PMIC definition

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.

---
 arch/arm/dts/imx8mm-evk-u-boot.dtsi |   4 +-
 arch/arm/dts/imx8mm-evk.dtsi        | 126 ++++++++++++++--------------
 2 files changed, 67 insertions(+), 63 deletions(-)
arch/arm/dts/imx8mm-evk-u-boot.dtsi +2 -2
index 13688ec0d0..1bc7e4a38b 100644
@@ -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;
 };
 
arch/arm/dts/imx8mm-evk.dtsi +65 -61

179 lines not on this page · raw message

Signature · 1 line
2.42.0
reviewer
#1 lore raw

Hi Alexander,

Quoted 4 lines · Alexander Koch

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.

This commit hash does not exist:

$ git show 4c07a21e5
fatal: ambiguous argument '4c07a21e5': unknown revision or path not in
the working tree.
Quoted 7 lines

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:

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

Yes, I agree this is inconsistent and we need to fix it.

arch/arm/dts/imx8mm-evk.dtsi line 188

Quoted 10 lines

This leads to the expected error message from SPL:

arch/arm/dts/imx8mm-evk.dtsi +3 -4
-       pmic@4b {
-               compatible = "rohm,bd71847";
-               reg = <0x4b>;
-               pinctrl-names = "default";
+       pmic: pca9450@25 {
+               reg = <0x25>;
+               compatible = "nxp,pca9450a";

If we change like this, we will lose the change after a sync with the Linux dts.

In Linux we have arch/arm64/boot/dts/freescale/imx8mm-evk.dtsi that contains:

pmic@4b {
compatible = "rohm,bd71847";

and arch/arm64/boot/dts/freescale/imx8mm-evkb.dts that contains:

&i2c1 {
/delete-node/ pmic@4b;

pmic@25 {
compatible = "nxp,pca9450a";

We need to have a new imx8mm-evkb_defconfig in U-Boot to deal with the PCA9450 PMIC.