Tegra: uninit and re-init console across System Suspend
authorVarun Wadekar <vwadekar@nvidia.com>
Tue, 2 Aug 2016 05:16:21 +0000 (22:16 -0700)
committerVarun Wadekar <vwadekar@nvidia.com>
Thu, 2 Mar 2017 21:01:18 +0000 (13:01 -0800)
This patch removes the console_init() from runtime_setup() as we already
initialize it earlier and disables/enables it across "System Suspend".

Change-Id: I992d3ca56ff4797faf83e8d7fa52c0ef3e1c3367
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
plat/nvidia/tegra/common/tegra_bl31_setup.c
plat/nvidia/tegra/common/tegra_pm.c

index 246a03e0e2a4db047e6cb90e1954977a8d3710d9..be7092b9ec3f63a24198815f49b9f6f6c1bc44d1 100644 (file)
@@ -293,9 +293,7 @@ void bl31_platform_setup(void)
  ******************************************************************************/
 void bl31_plat_runtime_setup(void)
 {
-       /* Initialize the runtime console */
-       console_init(tegra_console_base, TEGRA_BOOT_UART_CLK_IN_HZ,
-               TEGRA_CONSOLE_BAUDRATE);
+       ; /* do nothing */
 }
 
 /*******************************************************************************
index b2703ddee3aa06159ba11dbced302daf840162c5..13ae6c4ba94d910a891960f76ba9bd26063d0331 100644 (file)
@@ -33,6 +33,7 @@
 #include <bl_common.h>
 #include <context.h>
 #include <context_mgmt.h>
+#include <console.h>
 #include <debug.h>
 #include <memctrl.h>
 #include <mmio.h>
@@ -45,6 +46,7 @@
 
 extern uint64_t tegra_bl31_phys_base;
 extern uint64_t tegra_sec_entry_point;
+extern uint64_t tegra_console_base;
 
 /*
  * The following platform setup functions are weakly defined. They
@@ -164,6 +166,11 @@ void tegra_pwr_domain_suspend(const psci_power_state_t *target_state)
 {
        tegra_soc_pwr_domain_suspend(target_state);
 
+       /* Disable console if we are entering deep sleep. */
+       if (target_state->pwr_domain_state[PLAT_MAX_PWR_LVL] ==
+                       PSTATE_ID_SOC_POWERDN)
+               console_uninit();
+
        /* disable GICC */
        tegra_gic_cpuif_deactivate();
 }
@@ -206,6 +213,10 @@ void tegra_pwr_domain_on_finish(const psci_power_state_t *target_state)
        if (target_state->pwr_domain_state[PLAT_MAX_PWR_LVL] ==
                        PSTATE_ID_SOC_POWERDN) {
 
+               /* Initialize the runtime console */
+               console_init(tegra_console_base, TEGRA_BOOT_UART_CLK_IN_HZ,
+                       TEGRA_CONSOLE_BAUDRATE);
+
                /*
                 * Restore Memory Controller settings as it loses state
                 * during system suspend.