From 84053e4cde8565f66b02be60d14fc7481e6b1100 Mon Sep 17 00:00:00 2001 From: Travis Geiselbrecht Date: Sun, 11 Aug 2024 12:16:18 -0700 Subject: [PATCH] [platform][qemu-virt-arm] move uart initialization first It should be safe to do this since the uart does not use the gic or timers. This will allow printing from the gic or timer driver. --- platform/qemu-virt-arm/platform.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/platform/qemu-virt-arm/platform.c b/platform/qemu-virt-arm/platform.c index 4fcd882de..6b722f72d 100644 --- a/platform/qemu-virt-arm/platform.c +++ b/platform/qemu-virt-arm/platform.c @@ -61,12 +61,7 @@ struct mmu_initial_mapping mmu_initial_mappings[] = { const void *fdt = (void *)KERNEL_BASE; void platform_early_init(void) { - /* initialize the interrupt controller */ - arm_gic_init(); - - arm_generic_timer_init(ARM_GENERIC_TIMER_VIRTUAL_INT, 0); - - struct pl011_config uart_config = { + const struct pl011_config uart_config = { .base = UART_BASE, .irq = UART0_INT, .flag = PL011_FLAG_DEBUG_UART, @@ -74,6 +69,11 @@ void platform_early_init(void) { pl011_init_early(0, &uart_config); + /* initialize the interrupt controller */ + arm_gic_init(); + + arm_generic_timer_init(ARM_GENERIC_TIMER_VIRTUAL_INT, 0); + if (LOCAL_TRACE) { LTRACEF("dumping FDT at %p\n", fdt); fdt_walk_dump(fdt);