mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-19 02:54:24 +00:00
synquacer: Enable PL011 UART Console
Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Signed-off-by: Sumit Garg <sumit.garg@linaro.org>
This commit is contained in:
parent
85427debb1
commit
67b400705f
3 changed files with 55 additions and 0 deletions
|
@ -18,6 +18,11 @@
|
||||||
#define BL31_SIZE 0x00080000
|
#define BL31_SIZE 0x00080000
|
||||||
#define BL31_LIMIT (BL31_BASE + BL31_SIZE)
|
#define BL31_LIMIT (BL31_BASE + BL31_SIZE)
|
||||||
|
|
||||||
|
/* UART related constants */
|
||||||
|
#define PLAT_SQ_BOOT_UART_BASE 0x2A400000
|
||||||
|
#define PLAT_SQ_BOOT_UART_CLK_IN_HZ 62500000
|
||||||
|
#define SQ_CONSOLE_BAUDRATE 115200
|
||||||
|
|
||||||
#define SQ_BOOT_CFG_ADDR 0x45410000
|
#define SQ_BOOT_CFG_ADDR 0x45410000
|
||||||
#define PLAT_SQ_PRIMARY_CPU_SHIFT 8
|
#define PLAT_SQ_PRIMARY_CPU_SHIFT 8
|
||||||
#define PLAT_SQ_PRIMARY_CPU_BIT_WIDTH 6
|
#define PLAT_SQ_PRIMARY_CPU_BIT_WIDTH 6
|
||||||
|
|
|
@ -9,11 +9,22 @@
|
||||||
#include <platform_def.h>
|
#include <platform_def.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <bl_common.h>
|
#include <bl_common.h>
|
||||||
|
#include <pl011.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
|
static console_pl011_t console;
|
||||||
|
|
||||||
void bl31_early_platform_setup(bl31_params_t *from_bl2,
|
void bl31_early_platform_setup(bl31_params_t *from_bl2,
|
||||||
void *plat_params_from_bl2)
|
void *plat_params_from_bl2)
|
||||||
{
|
{
|
||||||
|
/* Initialize the console to provide early debug support */
|
||||||
|
(void)console_pl011_register(PLAT_SQ_BOOT_UART_BASE,
|
||||||
|
PLAT_SQ_BOOT_UART_CLK_IN_HZ,
|
||||||
|
SQ_CONSOLE_BAUDRATE, &console);
|
||||||
|
|
||||||
|
console_set_scope(&console.console, CONSOLE_FLAG_BOOT |
|
||||||
|
CONSOLE_FLAG_RUNTIME);
|
||||||
|
|
||||||
/* There are no parameters from BL2 if BL31 is a reset vector */
|
/* There are no parameters from BL2 if BL31 is a reset vector */
|
||||||
assert(from_bl2 == NULL);
|
assert(from_bl2 == NULL);
|
||||||
assert(plat_params_from_bl2 == NULL);
|
assert(plat_params_from_bl2 == NULL);
|
||||||
|
|
|
@ -14,6 +14,9 @@
|
||||||
.global platform_mem_init
|
.global platform_mem_init
|
||||||
.global plat_is_my_cpu_primary
|
.global plat_is_my_cpu_primary
|
||||||
.global plat_secondary_cold_boot_setup
|
.global plat_secondary_cold_boot_setup
|
||||||
|
.global plat_crash_console_init
|
||||||
|
.global plat_crash_console_putc
|
||||||
|
.global plat_crash_console_flush
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* unsigned int sq_calc_core_pos(u_register_t mpidr)
|
* unsigned int sq_calc_core_pos(u_register_t mpidr)
|
||||||
|
@ -69,3 +72,39 @@ func plat_is_my_cpu_primary
|
||||||
cset w0, eq
|
cset w0, eq
|
||||||
ret x9
|
ret x9
|
||||||
endfunc plat_is_my_cpu_primary
|
endfunc plat_is_my_cpu_primary
|
||||||
|
|
||||||
|
/*
|
||||||
|
* int plat_crash_console_init(void)
|
||||||
|
* Function to initialize the crash console
|
||||||
|
* without a C Runtime to print crash report.
|
||||||
|
* Clobber list : x0, x1, x2
|
||||||
|
*/
|
||||||
|
func plat_crash_console_init
|
||||||
|
mov_imm x0, PLAT_SQ_BOOT_UART_BASE
|
||||||
|
mov_imm x1, PLAT_SQ_BOOT_UART_CLK_IN_HZ
|
||||||
|
mov_imm x2, SQ_CONSOLE_BAUDRATE
|
||||||
|
b console_pl011_core_init
|
||||||
|
endfunc plat_crash_console_init
|
||||||
|
|
||||||
|
/*
|
||||||
|
* int plat_crash_console_putc(int c)
|
||||||
|
* Function to print a character on the crash
|
||||||
|
* console without a C Runtime.
|
||||||
|
* Clobber list : x1, x2
|
||||||
|
*/
|
||||||
|
func plat_crash_console_putc
|
||||||
|
mov_imm x1, PLAT_SQ_BOOT_UART_BASE
|
||||||
|
b console_pl011_core_putc
|
||||||
|
endfunc plat_crash_console_putc
|
||||||
|
|
||||||
|
/*
|
||||||
|
* int plat_crash_console_flush(int c)
|
||||||
|
* Function to force a write of all buffered
|
||||||
|
* data that hasn't been output.
|
||||||
|
* Out : return -1 on error else return 0.
|
||||||
|
* Clobber list : x0, x1
|
||||||
|
*/
|
||||||
|
func plat_crash_console_flush
|
||||||
|
mov_imm x0, PLAT_SQ_BOOT_UART_BASE
|
||||||
|
b console_pl011_core_flush
|
||||||
|
endfunc plat_crash_console_flush
|
||||||
|
|
Loading…
Add table
Reference in a new issue