hv:riscv: add memory initizalization

add BSP and AP initialization function.
and call uart16550_init to update uart_base_address
after init paging.

Tracked-On: #8831
Signed-off-by: hangliu1 <hang1.liu@intel.com>
Reviewed-by: Fei Li <fei1.li@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
hangliu1
2025-10-15 16:01:46 +08:00
committed by acrnsi-robot
parent 47ed22bef8
commit 3041b2fd33
3 changed files with 9 additions and 0 deletions

View File

@@ -11,6 +11,7 @@
#include <cpu.h>
#include <per_cpu.h>
#include <logmsg.h>
#include <mmu.h>
#include <timer.h>
#include <console.h>
#include <shell.h>
@@ -64,6 +65,7 @@ void init_primary_pcpu(uint64_t hart_id, uint64_t fdt_paddr)
pcpu_set_current_state(pcpu_id, PCPU_STATE_INITIALIZING);
init_debug_pre();
init_paging();
if (!start_pcpus(AP_MASK)) {
panic("Failed to start all secondary cores!");
@@ -86,6 +88,7 @@ void init_secondary_pcpu(uint64_t hart_id)
}
set_pcpu_active(pcpu_id);
enable_paging();
/*
* Set state for this CPU to initializing, the current pcpu_id

View File

@@ -140,3 +140,8 @@ void init_paging(void)
init_hv_mapping();
}
void enable_paging(void)
{
set_satp(init_satp);
}

View File

@@ -20,5 +20,6 @@ static inline void set_satp(uint64_t satp)
);
}
void init_paging(void);
void enable_paging(void);
#endif /* RISCV_MMU_H */