Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 21, 2018
1 parent 8cd918a commit f3249e4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 15 additions & 1 deletion hw/arm/virt.c
Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions include/hw/arm/virt.h
Expand Up @@ -79,6 +79,8 @@ enum {
VIRT_SECURE_UART,
VIRT_SECURE_MEM,
VIRT_S3C_UART,
VIRT_AMCC,
VIRT_AIC,
};

typedef enum VirtIOMMUType {
Expand Down

0 comments on commit f3249e4

Please sign in to comment.