mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-03 10:17:21 +00:00
xen: xenguest_arm64: map all VIRTIO MMIO region
When run `virtio scan` on i.MX95, there is abort when accessing virtio mmio region. The issue is the mmio region is not mapped. So let's map all virtio mmio regions. Signed-off-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
parent
c95e948870
commit
15f832a7dc
1 changed files with 17 additions and 0 deletions
|
@ -31,6 +31,9 @@
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
#define GUEST_VIRTIO_MMIO_BASE 0x2000000
|
||||||
|
#define GUEST_VIRTIO_MMIO_SIZE 0x100000
|
||||||
|
|
||||||
int board_init(void)
|
int board_init(void)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -212,6 +215,15 @@ static int setup_mem_map(void)
|
||||||
PTE_BLOCK_INNER_SHARE);
|
PTE_BLOCK_INNER_SHARE);
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
|
if (CONFIG_IS_ENABLED(VIRTIO_MMIO)) {
|
||||||
|
xen_mem_map[i].virt = GUEST_VIRTIO_MMIO_BASE;
|
||||||
|
xen_mem_map[i].phys = GUEST_VIRTIO_MMIO_BASE;
|
||||||
|
xen_mem_map[i].size = GUEST_VIRTIO_MMIO_SIZE;
|
||||||
|
xen_mem_map[i].attrs = (PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
|
||||||
|
PTE_BLOCK_NON_SHARE);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
mem = get_next_memory_node(blob, -1);
|
mem = get_next_memory_node(blob, -1);
|
||||||
if (mem < 0) {
|
if (mem < 0) {
|
||||||
printf("%s: Missing /memory node\n", __func__);
|
printf("%s: Missing /memory node\n", __func__);
|
||||||
|
@ -219,6 +231,11 @@ static int setup_mem_map(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; i < MAX_MEM_MAP_REGIONS; i++) {
|
for (; i < MAX_MEM_MAP_REGIONS; i++) {
|
||||||
|
if (CONFIG_IS_ENABLED(VIRTIO_MMIO)) {
|
||||||
|
ret = fdt_node_check_compatible(blob, mem, "virtio,mmio");
|
||||||
|
if (!ret)
|
||||||
|
continue;
|
||||||
|
}
|
||||||
ret = fdt_get_resource(blob, mem, "reg", reg++, &res);
|
ret = fdt_get_resource(blob, mem, "reg", reg++, &res);
|
||||||
if (ret == -FDT_ERR_NOTFOUND) {
|
if (ret == -FDT_ERR_NOTFOUND) {
|
||||||
reg = 0;
|
reg = 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue