summaryrefslogtreecommitdiff
path: root/core/arch/arm/plat-d02/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/arch/arm/plat-d02/main.c')
-rw-r--r--core/arch/arm/plat-d02/main.c35
1 files changed, 6 insertions, 29 deletions
diff --git a/core/arch/arm/plat-d02/main.c b/core/arch/arm/plat-d02/main.c
index 95161d1..2cd339b 100644
--- a/core/arch/arm/plat-d02/main.c
+++ b/core/arch/arm/plat-d02/main.c
@@ -42,7 +42,7 @@ static void main_fiq(void);
static const struct thread_handlers handlers = {
.std_smc = tee_entry_std,
.fast_smc = tee_entry_fast,
- .fiq = main_fiq,
+ .nintr = main_fiq,
.cpu_on = cpu_on_handler,
.cpu_off = pm_do_nothing,
.cpu_suspend = pm_do_nothing,
@@ -51,6 +51,8 @@ static const struct thread_handlers handlers = {
.system_reset = pm_do_nothing,
};
+static struct hi16xx_uart_data console_data __early_bss;
+
register_phys_mem(MEM_AREA_IO_NSEC, CONSOLE_UART_BASE, HI16XX_UART_REG_SIZE);
const struct thread_handlers *generic_boot_get_handlers(void)
@@ -63,34 +65,9 @@ static void main_fiq(void)
panic();
}
-static vaddr_t console_base(void)
-{
- static void *va;
-
- if (cpu_mmu_enabled()) {
- if (!va)
- va = phys_to_virt(CONSOLE_UART_BASE, MEM_AREA_IO_NSEC);
- return (vaddr_t)va;
- }
- return CONSOLE_UART_BASE;
-}
-
void console_init(void)
{
- hi16xx_uart_init(console_base(), CONSOLE_UART_CLK_IN_HZ,
- CONSOLE_BAUDRATE);
-}
-
-void console_putc(int ch)
-{
- vaddr_t base = console_base();
-
- if (ch == '\n')
- hi16xx_uart_putc('\r', base);
- hi16xx_uart_putc(ch, base);
-}
-
-void console_flush(void)
-{
- hi16xx_uart_flush(console_base());
+ hi16xx_uart_init(&console_data, CONSOLE_UART_BASE,
+ CONSOLE_UART_CLK_IN_HZ, CONSOLE_BAUDRATE);
+ register_serial_console(&console_data.chip);
}