hv: riscv: add uart init after paging

After BSP enable paging, add init uart to update
uart virtual address.

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-17 16:46:17 +08:00
committed by acrnsi-robot
parent cbab9cbab8
commit 445eb573a6
2 changed files with 7 additions and 1 deletions

View File

@@ -15,6 +15,7 @@
#include <timer.h>
#include <console.h>
#include <shell.h>
#include <uart16550.h>
static void init_pcpu_comm_post(void);
@@ -66,6 +67,11 @@ void init_primary_pcpu(uint64_t hart_id, uint64_t fdt_paddr)
init_debug_pre();
init_paging();
/*
* Need update uart_base_address here for vaddr2paddr mapping may changed
* WARNNING: DO NOT CALL PRINTF BETWEEN ENABLE PAGING IN init_paging AND HERE!
*/
uart16550_init(false);
if (!start_pcpus(AP_MASK)) {
panic("Failed to start all secondary cores!");

View File

@@ -137,7 +137,7 @@ enum serial_dev_type {
#if CONFIG_SERIAL_8250_PCI
#include <asm/pagemisc.h>
#endif
union pci_bdf;
void uart16550_init(bool early_boot);
char uart16550_getc(void);
size_t uart16550_puts(const char *buf, uint32_t len);