qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

hw/arm/collie: Create the RAM in the board

The SDRAM is incorrectly created in the SA1110 SoC.
Move its creation in the board code, this will later allow the
board to have the QOM ownership of the RAM.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20191021190653.9511-4-philmd@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

authored by

Philippe Mathieu-Daudé and committed by
Peter Maydell
3cd892da eba59997

+8 -11
+6 -2
hw/arm/collie.c
··· 27 27 { 28 28 StrongARMState *s; 29 29 DriveInfo *dinfo; 30 - MemoryRegion *sysmem = get_system_memory(); 30 + MemoryRegion *sdram = g_new(MemoryRegion, 1); 31 31 32 - s = sa1110_init(sysmem, collie_binfo.ram_size, machine->cpu_type); 32 + s = sa1110_init(machine->cpu_type); 33 + 34 + memory_region_allocate_system_memory(sdram, NULL, "strongarm.sdram", 35 + collie_binfo.ram_size); 36 + memory_region_add_subregion(get_system_memory(), SA_SDCS0, sdram); 33 37 34 38 dinfo = drive_get(IF_PFLASH, 0, 0); 35 39 pflash_cfi01_register(SA_CS0, "collie.fl1", 0x02000000,
+1 -6
hw/arm/strongarm.c
··· 1586 1586 }; 1587 1587 1588 1588 /* Main CPU functions */ 1589 - StrongARMState *sa1110_init(MemoryRegion *sysmem, 1590 - unsigned int sdram_size, const char *cpu_type) 1589 + StrongARMState *sa1110_init(const char *cpu_type) 1591 1590 { 1592 1591 StrongARMState *s; 1593 1592 int i; ··· 1600 1599 } 1601 1600 1602 1601 s->cpu = ARM_CPU(cpu_create(cpu_type)); 1603 - 1604 - memory_region_allocate_system_memory(&s->sdram, NULL, "strongarm.sdram", 1605 - sdram_size); 1606 - memory_region_add_subregion(sysmem, SA_SDCS0, &s->sdram); 1607 1602 1608 1603 s->pic = sysbus_create_varargs("strongarm_pic", 0x90050000, 1609 1604 qdev_get_gpio_in(DEVICE(s->cpu), ARM_CPU_IRQ),
+1 -3
hw/arm/strongarm.h
··· 55 55 56 56 typedef struct { 57 57 ARMCPU *cpu; 58 - MemoryRegion sdram; 59 58 DeviceState *pic; 60 59 DeviceState *gpio; 61 60 DeviceState *ppc; ··· 63 62 SSIBus *ssp_bus; 64 63 } StrongARMState; 65 64 66 - StrongARMState *sa1110_init(MemoryRegion *sysmem, 67 - unsigned int sdram_size, const char *rev); 65 + StrongARMState *sa1110_init(const char *cpu_type); 68 66 69 67 #endif