diff options
| author | Anup Patel <[email protected]> | 2024-07-04 12:15:58 +0530 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2024-07-24 12:18:31 +0530 |
| commit | 9e8a18fd0dd72de8cda71f7278cafa7033ae2d34 (patch) | |
| tree | 3677802baa3eb87e38d236b48f37fc302c8c08fb /platform/template | |
| parent | 4afb57c9ebe27e29ce3777024bfc186991a8b4fe (diff) | |
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 <[email protected]>
Reviewed-By: Himanshu Chauhan <[email protected]>
Diffstat (limited to 'platform/template')
| -rw-r--r-- | platform/template/platform.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/platform/template/platform.c b/platform/template/platform.c index 4b3f2acf..b4d30a57 100644 --- a/platform/template/platform.c +++ b/platform/template/platform.c @@ -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); } /* @@ -76,16 +81,6 @@ static int platform_final_init(bool cold_boot) } /* - * 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. */ static int platform_irqchip_init(bool cold_boot) @@ -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 |
