Commit c8deb8b4 authored by Sandrine Bailleux's avatar Sandrine Bailleux
Browse files

juno: Initialise UART console in all bootloader stages

Ensure that each bootloader stage initializes the UART console
independently. As a result, both BL3-1 and BL2 platform code now
calls console_init() instead of relying on BL1 to perform console
setup.

Also perform the console initialisation earlier in BL1 because
it must be done before it is used e.g. through a printf() call
in an assert() statement.

Change-Id: I8bb58cf1f0e42a71a01abf65da30bfa4ae533665
parent 4114d891
...@@ -77,6 +77,9 @@ void bl1_early_platform_setup(void) ...@@ -77,6 +77,9 @@ void bl1_early_platform_setup(void)
const unsigned long bl1_ram_limit = BL1_RAM_LIMIT; const unsigned long bl1_ram_limit = BL1_RAM_LIMIT;
const unsigned long tzram_limit = TZRAM_BASE + TZRAM_SIZE; const unsigned long tzram_limit = TZRAM_BASE + TZRAM_SIZE;
/* Initialize the console to provide early debug support */
console_init(PL011_UART0_BASE);
/* /*
* Calculate how much ram is BL1 using & how much remains free. * Calculate how much ram is BL1 using & how much remains free.
* This also includes a rudimentary mechanism to detect whether * This also includes a rudimentary mechanism to detect whether
...@@ -98,9 +101,6 @@ void bl1_early_platform_setup(void) ...@@ -98,9 +101,6 @@ void bl1_early_platform_setup(void)
bl1_tzram_layout.free_size = bl1_tzram_layout.free_size =
tzram_limit - bl1_ram_limit; tzram_limit - bl1_ram_limit;
} }
/* Initialize the console */
console_init(PL011_UART0_BASE);
} }
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <bl_common.h> #include <bl_common.h>
#include <scp_bootloader.h> #include <scp_bootloader.h>
#include <debug.h> #include <debug.h>
#include <console.h>
/******************************************************************************* /*******************************************************************************
* Declarations of linker defined symbols which will help us find the layout * Declarations of linker defined symbols which will help us find the layout
...@@ -97,6 +98,10 @@ bl31_args *bl2_get_bl31_args_ptr(void) ...@@ -97,6 +98,10 @@ bl31_args *bl2_get_bl31_args_ptr(void)
void bl2_early_platform_setup(meminfo *mem_layout, void bl2_early_platform_setup(meminfo *mem_layout,
void *data) void *data)
{ {
/* Initialize the console to provide early debug support */
console_init(PL011_UART0_BASE);
/* Setup the BL2 memory layout */ /* Setup the BL2 memory layout */
bl2_tzram_layout.total_base = mem_layout->total_base; bl2_tzram_layout.total_base = mem_layout->total_base;
bl2_tzram_layout.total_size = mem_layout->total_size; bl2_tzram_layout.total_size = mem_layout->total_size;
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <platform.h> #include <platform.h>
#include <assert.h> #include <assert.h>
#include <arch_helpers.h> #include <arch_helpers.h>
#include <console.h>
/******************************************************************************* /*******************************************************************************
* Declarations of linker defined symbols which will help us find the layout * Declarations of linker defined symbols which will help us find the layout
...@@ -107,6 +108,9 @@ el_change_info *bl31_get_next_image_info(uint32_t type) ...@@ -107,6 +108,9 @@ el_change_info *bl31_get_next_image_info(uint32_t type)
void bl31_early_platform_setup(bl31_args *from_bl2, void bl31_early_platform_setup(bl31_args *from_bl2,
void *data) void *data)
{ {
/* Initialize the console to provide early debug support */
console_init(PL011_UART0_BASE);
bl2_to_bl31_args = *from_bl2; bl2_to_bl31_args = *from_bl2;
/* UEFI expects x0 to be primary CPU MPID */ /* UEFI expects x0 to be primary CPU MPID */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment