mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-05-04 01:49:28 +00:00
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:
@@ -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
|
||||
|
||||
@@ -140,3 +140,8 @@ void init_paging(void)
|
||||
|
||||
init_hv_mapping();
|
||||
}
|
||||
|
||||
void enable_paging(void)
|
||||
{
|
||||
set_satp(init_satp);
|
||||
}
|
||||
|
||||
@@ -20,5 +20,6 @@ static inline void set_satp(uint64_t satp)
|
||||
);
|
||||
}
|
||||
void init_paging(void);
|
||||
void enable_paging(void);
|
||||
|
||||
#endif /* RISCV_MMU_H */
|
||||
|
||||
Reference in New Issue
Block a user