forked from Mirrors/opensbi
platform: Setup serial console device in early_init()
The sbi_console_init() does not do any special initialization so setup serial console device in early_init() so that console prints work as early as possible. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Reviewed-By: Himanshu Chauhan <hchauhan@ventanamicro.com>
This commit is contained in:
@@ -64,7 +64,12 @@ static struct aclint_mtimer_data mtimer = {
|
||||
*/
|
||||
static int platform_early_init(bool cold_boot)
|
||||
{
|
||||
return 0;
|
||||
if (!cold_boot)
|
||||
return 0;
|
||||
|
||||
/* Example if the generic UART8250 driver is used */
|
||||
return uart8250_init(PLATFORM_UART_ADDR, PLATFORM_UART_INPUT_FREQ,
|
||||
PLATFORM_UART_BAUDRATE, 0, 1, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -75,16 +80,6 @@ static int platform_final_init(bool cold_boot)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize the platform console.
|
||||
*/
|
||||
static int platform_console_init(void)
|
||||
{
|
||||
/* Example if the generic UART8250 driver is used */
|
||||
return uart8250_init(PLATFORM_UART_ADDR, PLATFORM_UART_INPUT_FREQ,
|
||||
PLATFORM_UART_BAUDRATE, 0, 1, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize the platform interrupt controller for current HART.
|
||||
*/
|
||||
@@ -143,7 +138,6 @@ static int platform_timer_init(bool cold_boot)
|
||||
const struct sbi_platform_operations platform_ops = {
|
||||
.early_init = platform_early_init,
|
||||
.final_init = platform_final_init,
|
||||
.console_init = platform_console_init,
|
||||
.irqchip_init = platform_irqchip_init,
|
||||
.ipi_init = platform_ipi_init,
|
||||
.timer_init = platform_timer_init
|
||||
|
Reference in New Issue
Block a user