MLK-18161-12 imx8qm/imx8qxp - Power down devices enabled by uboot before launching...
authorYe Li <ye.li@nxp.com>
Thu, 19 Apr 2018 02:34:11 +0000 (19:34 -0700)
committerYe Li <ye.li@nxp.com>
Thu, 29 Apr 2021 07:56:23 +0000 (00:56 -0700)
Make sure that all devices that are powered up by uboot
are powered down before bringing up kernel.
Else the subsystem/device will never be powered down by SCFW even though
from the kernel's point of view it should be powered down.

Benefiting from power domain driver, We have implemented the function "power_off_pd_devices"
to power off all active devices. No need to explicitly power off them in board_quiesce_devices.

Apply the same power off interface to SPL as well.

Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
(cherry picked from commit 3ab7cc26500eb78407bc6454a48f4d5f0ebf4f60)
(cherry picked from commit f6c3e3191de31f0249a89a24a477d82feecb526f)
(cherry picked from commit 1105214ef0023bf3df1e0b8071a795d42013a35e)

board/freescale/imx8qm_mek/imx8qm_mek.c
board/freescale/imx8qm_mek/spl.c
board/freescale/imx8qxp_mek/imx8qxp_mek.c
board/freescale/imx8qxp_mek/spl.c

index b71a753..cc823f5 100644 (file)
@@ -332,6 +332,15 @@ int board_init(void)
        return 0;
 }
 
+void board_quiesce_devices(void)
+{
+       const char *power_on_devices[] = {
+               "dma_lpuart0",
+       };
+
+       imx8_power_off_pd_devices(power_on_devices, ARRAY_SIZE(power_on_devices));
+}
+
 /*
  * Board specific reset that is system reset.
  */
index afffacf..9d83fe4 100644 (file)
@@ -16,7 +16,7 @@
 #include <dm/uclass-internal.h>
 #include <dm/device-internal.h>
 #include <dm/lists.h>
-#include <asm/arch/sys_proto.h>
+#include <bootm.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -44,7 +44,7 @@ void spl_board_init(void)
 
 void spl_board_prepare_for_boot(void)
 {
-       imx8_power_off_pd_devices(NULL, 0);
+       board_quiesce_devices();
 }
 
 #ifdef CONFIG_SPL_LOAD_FIT
index fdea685..714e006 100644 (file)
@@ -342,6 +342,19 @@ int board_init(void)
        return 0;
 }
 
+void board_quiesce_devices(void)
+{
+       const char *power_on_devices[] = {
+               "dma_lpuart0",
+
+               /* HIFI DSP boot */
+               "audio_sai0",
+               "audio_ocram",
+       };
+
+       imx8_power_off_pd_devices(power_on_devices, ARRAY_SIZE(power_on_devices));
+}
+
 /*
  * Board specific reset that is system reset.
  */
index 5734545..1e3b479 100644 (file)
@@ -22,6 +22,7 @@
 #include <asm/arch/imx8-pins.h>
 #include <asm/arch/iomux.h>
 #include <asm/arch/sys_proto.h>
+#include <bootm.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -62,7 +63,7 @@ void spl_board_init(void)
 
 void spl_board_prepare_for_boot(void)
 {
-       imx8_power_off_pd_devices(NULL, 0);
+       board_quiesce_devices();
 }
 
 #ifdef CONFIG_SPL_LOAD_FIT