[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.
This commit is contained in:
Travis Geiselbrecht
2024-08-11 12:16:18 -07:00
parent fdf48a80c8
commit 84053e4cde

View File

@@ -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);