Skip to content

Commit

Permalink
[platform][qemu-virt-arm] move uart initialization first
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
travisg committed Aug 11, 2024
1 parent fdf48a8 commit 84053e4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions platform/qemu-virt-arm/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,19 @@ 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,
};

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);
Expand Down

0 comments on commit 84053e4

Please sign in to comment.