Skip to content

Commit f3249e4

Browse files
committed
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.
1 parent 8cd918a commit f3249e4

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

hw/arm/virt.c

+15-1
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,11 @@ static const MemMapEntry a15memmap[] = {
151151
[VIRT_PCIE_PIO] = { 0x3eff0000, 0x00010000 },
152152
[VIRT_PCIE_ECAM] = { 0x3f000000, 0x01000000 },
153153
[VIRT_MEM] = { 0x40000000, RAMLIMIT_BYTES },
154-
/* Additional 64 MB redist region (can contain up to 512 redistributors) */
154+
// zhuowei: t8015 peripherals
155+
[VIRT_AMCC] = { 0x200000000, 0x00300000 }, // zhuowei: hack
155156
[VIRT_S3C_UART] = { 0x22e600000, 0x00001000 }, // zhuowei: hack
157+
[VIRT_AIC] = { 0x232100000, 0x00009000 }, // zhuowei: hack
158+
/* Additional 64 MB redist region (can contain up to 512 redistributors) */
156159
[VIRT_GIC_REDIST2] = { 0x4000000000ULL, 0x4000000 },
157160
[VIRT_PCIE_ECAM_HIGH] = { 0x4010000000ULL, 0x10000000 },
158161
/* Second PCIe window, 512GB wide at the 512GB boundary */
@@ -1542,6 +1545,17 @@ static void machvirt_init(MachineState *machine)
15421545

15431546
create_platform_bus(vms, pic);
15441547

1548+
// zhuowei: hack: amcc
1549+
MemoryRegion *mcc = g_new(MemoryRegion, 1);
1550+
memory_region_allocate_system_memory(mcc, NULL, "mach-virt.mcc",
1551+
vms->memmap[VIRT_AMCC].size);
1552+
memory_region_add_subregion(sysmem, vms->memmap[VIRT_AMCC].base, mcc);
1553+
1554+
MemoryRegion *aic = g_new(MemoryRegion, 1);
1555+
memory_region_allocate_system_memory(aic, NULL, "mach-virt.aic",
1556+
vms->memmap[VIRT_AIC].size);
1557+
memory_region_add_subregion(sysmem, vms->memmap[VIRT_AIC].base, aic);
1558+
15451559
vms->bootinfo.ram_size = machine->ram_size;
15461560
vms->bootinfo.kernel_filename = machine->kernel_filename;
15471561
vms->bootinfo.kernel_cmdline = machine->kernel_cmdline;

include/hw/arm/virt.h

+2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ enum {
7979
VIRT_SECURE_UART,
8080
VIRT_SECURE_MEM,
8181
VIRT_S3C_UART,
82+
VIRT_AMCC,
83+
VIRT_AIC,
8284
};
8385

8486
typedef enum VirtIOMMUType {

0 commit comments

Comments
 (0)