Hi Peng,

On 13.04.22 05:00, Peng Fan (OSS) wrote:
Hi Stefano,

On 2022/4/13 1:10, Stefano Babic wrote:
Hi Peng,Ye,

On 06.04.22 08:30, Peng Fan (OSS) wrote:
From: Ye Li <ye...@nxp.com>

Since ATF power domain will hold the enable counter for each power domain,
We need to power off them before entering kernel to avoid this
power domain can't be really powered off.

Signed-off-by: Ye Li <ye...@nxp.com>
Signed-off-by: Peng Fan <peng....@nxp.com>
---
   board/freescale/imx8ulp_evk/imx8ulp_evk.c | 30 +++++++++++++++++++++++
   1 file changed, 30 insertions(+)

diff --git a/board/freescale/imx8ulp_evk/imx8ulp_evk.c b/board/freescale/imx8ulp_evk/imx8ulp_evk.c
index b61a4cfbe8d..1bd308148f3 100644
--- a/board/freescale/imx8ulp_evk/imx8ulp_evk.c
+++ b/board/freescale/imx8ulp_evk/imx8ulp_evk.c
@@ -13,6 +13,8 @@
   #include <miiphy.h>
   #include <netdev.h>
   #include <asm/gpio.h>
+#include <power-domain.h>
+#include <dt-bindings/power/imx8ulp-power.h>

But which patch is adding the file above ? I cannot find it, it is not
part of this series and of course build is broken without it.

V5 patchset should not have such issue. I just see you already picked up V5 in your repo.


Which series are you talking about ? This series is in V2, and yes, I merged the whole series with the exception of this patch, but none of the applied patches added imx8ulp-power.h.

Regards,
Stefano

Thanks,
Peng.


Best regards,
Stefano

   DECLARE_GLOBAL_DATA_PTR;
@@ -129,3 +131,31 @@ int board_late_init(void)
   {
       return 0;
   }
+
+void board_quiesce_devices(void)
+{
+    /* Disable the power domains may used in u-boot before entering kernel */
+#if CONFIG_IS_ENABLED(POWER_DOMAIN)
+    struct udevice *scmi_devpd;
+    int ret, i;
+    struct power_domain pd;
+    ulong ids[] = { IMX8ULP_PD_FLEXSPI2, IMX8ULP_PD_USB0, IMX8ULP_PD_USDHC0, +            IMX8ULP_PD_USDHC1, IMX8ULP_PD_USDHC2_USB1, IMX8ULP_PD_DCNANO,
+            IMX8ULP_PD_MIPI_DSI };
+
+    ret = uclass_get_device(UCLASS_POWER_DOMAIN, 0, &scmi_devpd);
+    if (ret) {
+        printf("Cannot get scmi devpd: err=%d\n", ret);
+        return;
+    }
+
+    pd.dev = scmi_devpd;
+
+    for (i = 0; i < ARRAY_SIZE(ids); i++) {
+        pd.id = ids[i];
+        ret = power_domain_off(&pd);
+        if (ret)
+            printf("power_domain_off %lu failed: err=%d\n", ids[i], ret);
+    }
+#endif
+}



--
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=====================================================================

Reply via email to