Permalink
Browse files

hw: arm: virt: HACK: add empty memory regions where t8015 memory and …

…interrupt controller's supposed to be

This is a hack to avoid the data aborts from accessing peripherals that don't exist.
  • Loading branch information...
zhuowei committed Jul 18, 2018
1 parent 8cd918a commit f3249e44660223a38096f3f6f4aa781d2a4bf7d9
Showing with 17 additions and 1 deletion.
  1. +15 −1 hw/arm/virt.c
  2. +2 −0 include/hw/arm/virt.h
@@ -151,8 +151,11 @@ static const MemMapEntry a15memmap[] = {
[VIRT_PCIE_PIO] = { 0x3eff0000, 0x00010000 },
[VIRT_PCIE_ECAM] = { 0x3f000000, 0x01000000 },
[VIRT_MEM] = { 0x40000000, RAMLIMIT_BYTES },
/* Additional 64 MB redist region (can contain up to 512 redistributors) */
// zhuowei: t8015 peripherals
[VIRT_AMCC] = { 0x200000000, 0x00300000 }, // zhuowei: hack
[VIRT_S3C_UART] = { 0x22e600000, 0x00001000 }, // zhuowei: hack
[VIRT_AIC] = { 0x232100000, 0x00009000 }, // zhuowei: hack
/* Additional 64 MB redist region (can contain up to 512 redistributors) */
[VIRT_GIC_REDIST2] = { 0x4000000000ULL, 0x4000000 },
[VIRT_PCIE_ECAM_HIGH] = { 0x4010000000ULL, 0x10000000 },
/* Second PCIe window, 512GB wide at the 512GB boundary */
@@ -1542,6 +1545,17 @@ static void machvirt_init(MachineState *machine)
create_platform_bus(vms, pic);
// zhuowei: hack: amcc
MemoryRegion *mcc = g_new(MemoryRegion, 1);
memory_region_allocate_system_memory(mcc, NULL, "mach-virt.mcc",
vms->memmap[VIRT_AMCC].size);
memory_region_add_subregion(sysmem, vms->memmap[VIRT_AMCC].base, mcc);
MemoryRegion *aic = g_new(MemoryRegion, 1);
memory_region_allocate_system_memory(aic, NULL, "mach-virt.aic",
vms->memmap[VIRT_AIC].size);
memory_region_add_subregion(sysmem, vms->memmap[VIRT_AIC].base, aic);
vms->bootinfo.ram_size = machine->ram_size;
vms->bootinfo.kernel_filename = machine->kernel_filename;
vms->bootinfo.kernel_cmdline = machine->kernel_cmdline;
@@ -79,6 +79,8 @@ enum {
VIRT_SECURE_UART,
VIRT_SECURE_MEM,
VIRT_S3C_UART,
VIRT_AMCC,
VIRT_AIC,
};
typedef enum VirtIOMMUType {

0 comments on commit f3249e4

Please sign in to comment.