diff options
author | Damon Duan <danield@nvidia.com> | 2016-11-07 19:37:50 +0800 |
---|---|---|
committer | Varun Wadekar <vwadekar@nvidia.com> | 2017-03-02 13:02:17 -0800 |
commit | 9b514f83121fc03f5a519254df9a04200503ae20 (patch) | |
tree | 4f8c93d5379b98c26faca17e2d72d0bac18df635 | |
parent | 8d8d8d095c3b58d94d0904c12e7e37e25d2872f8 (diff) |
Tegra: init the console only if the platform supports it
Some platforms might want to keep the uart console disabled
during boot. This patch checks if the platform supports a
console, before calling console_init().
Change-Id: Icc9c59cb979d91fd0a72e4732403b3284bdd2dfc
Signed-off-by: Damon Duan <danield@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
-rw-r--r-- | plat/nvidia/tegra/common/tegra_bl31_setup.c | 18 | ||||
-rw-r--r-- | plat/nvidia/tegra/common/tegra_pm.c | 6 |
2 files changed, 13 insertions, 11 deletions
diff --git a/plat/nvidia/tegra/common/tegra_bl31_setup.c b/plat/nvidia/tegra/common/tegra_bl31_setup.c index be7092b9..c499c991 100644 --- a/plat/nvidia/tegra/common/tegra_bl31_setup.c +++ b/plat/nvidia/tegra/common/tegra_bl31_setup.c @@ -188,18 +188,18 @@ void bl31_early_platform_setup(bl31_params_t *from_bl2, * Get the base address of the UART controller to be used for the * console */ - assert(plat_params->uart_id); tegra_console_base = plat_get_console_from_id(plat_params->uart_id); - /* - * Configure the UART port to be used as the console - */ - assert(tegra_console_base); - console_init(tegra_console_base, TEGRA_BOOT_UART_CLK_IN_HZ, - TEGRA_CONSOLE_BAUDRATE); + if (tegra_console_base != (uint64_t)0) { + /* + * Configure the UART port to be used as the console + */ + console_init(tegra_console_base, TEGRA_BOOT_UART_CLK_IN_HZ, + TEGRA_CONSOLE_BAUDRATE); - /* Initialise crash console */ - plat_crash_console_init(); + /* Initialise crash console */ + plat_crash_console_init(); + } /* * Do initial security configuration to allow DRAM/device access. diff --git a/plat/nvidia/tegra/common/tegra_pm.c b/plat/nvidia/tegra/common/tegra_pm.c index 75124365..5376d523 100644 --- a/plat/nvidia/tegra/common/tegra_pm.c +++ b/plat/nvidia/tegra/common/tegra_pm.c @@ -214,8 +214,10 @@ void tegra_pwr_domain_on_finish(const psci_power_state_t *target_state) PSTATE_ID_SOC_POWERDN) { /* Initialize the runtime console */ - console_init(tegra_console_base, TEGRA_BOOT_UART_CLK_IN_HZ, - TEGRA_CONSOLE_BAUDRATE); + if (tegra_console_base != (uint64_t)0) { + console_init(tegra_console_base, TEGRA_BOOT_UART_CLK_IN_HZ, + TEGRA_CONSOLE_BAUDRATE); + } /* * Restore Memory Controller settings as it loses state |