summaryrefslogtreecommitdiffstats
path: root/hw/arm/mcimx6ul-evk.c
diff options
context:
space:
mode:
authorPeter Maydell2020-02-25 14:31:16 +0100
committerPeter Maydell2020-02-25 14:31:16 +0100
commitdb736e0437aa6fd7c1b7e4599c17f9619ab6b837 (patch)
treed34751ef2c77e5fbc83c19e814c4413b0fa2618a /hw/arm/mcimx6ul-evk.c
parentMerge remote-tracking branch 'remotes/pmaydell/tags/pull-docs-20200225' into ... (diff)
parentMerge branch 'exec_rw_const_v4' of https://github.com/philmd/qemu into HEAD (diff)
downloadqemu-db736e0437aa6fd7c1b7e4599c17f9619ab6b837.tar.gz
qemu-db736e0437aa6fd7c1b7e4599c17f9619ab6b837.tar.xz
qemu-db736e0437aa6fd7c1b7e4599c17f9619ab6b837.zip
Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging
* device_del fix (Julia) * FXAM fix (myself) * memdev refactoring (Igor) * memory region API cleanups (Peter, Philippe) * ioeventfd optimization (Stefan) * new WHPX maintainer (Sunil) * Large guest startup optimizations (Chen) # gpg: Signature made Tue 25 Feb 2020 12:42:24 GMT # gpg: using RSA key BFFBD25F78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full] # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: (104 commits) WHPX: Assigning maintainer for Windows Hypervisor Platform accel/kvm: Check ioctl(KVM_SET_USER_MEMORY_REGION) return value target/i386: check for empty register in FXAM qdev-monitor: Forbid repeated device_del mem-prealloc: optimize large guest startup memory: batch allocate ioeventfds[] in address_space_update_ioeventfds() Avoid cpu_physical_memory_rw() with a constant is_write argument Let cpu_[physical]_memory() calls pass a boolean 'is_write' argument exec: Let cpu_[physical]_memory API use a boolean 'is_write' argument Avoid address_space_rw() with a constant is_write argument Let address_space_rw() calls pass a boolean 'is_write' argument exec: Let address_space_unmap() use a boolean 'is_write' argument hw/virtio: Let vhost_memory_map() use a boolean 'is_write' argument hw/virtio: Let virtqueue_map_iovec() use a boolean 'is_write' argument hw/ide: Let the DMAIntFunc prototype use a boolean 'is_write' argument hw/ide/internal: Remove unused DMARestartFunc typedef Remove unnecessary cast when using the cpu_[physical]_memory API exec: Let the cpu_[physical]_memory API use void pointer arguments Remove unnecessary cast when using the address_space API hw/net: Avoid casting non-const pointer, use address_space_write() ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/arm/mcimx6ul-evk.c')
-rw-r--r--hw/arm/mcimx6ul-evk.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/hw/arm/mcimx6ul-evk.c b/hw/arm/mcimx6ul-evk.c
index e90b393a44..23a71ed378 100644
--- a/hw/arm/mcimx6ul-evk.c
+++ b/hw/arm/mcimx6ul-evk.c
@@ -19,15 +19,10 @@
#include "qemu/error-report.h"
#include "sysemu/qtest.h"
-typedef struct {
- FslIMX6ULState soc;
- MemoryRegion ram;
-} MCIMX6ULEVK;
-
static void mcimx6ul_evk_init(MachineState *machine)
{
static struct arm_boot_info boot_info;
- MCIMX6ULEVK *s = g_new0(MCIMX6ULEVK, 1);
+ FslIMX6ULState *s;
int i;
if (machine->ram_size > FSL_IMX6UL_MMDC_SIZE) {
@@ -43,15 +38,12 @@ static void mcimx6ul_evk_init(MachineState *machine)
.nb_cpus = machine->smp.cpus,
};
- object_initialize_child(OBJECT(machine), "soc", &s->soc, sizeof(s->soc),
- TYPE_FSL_IMX6UL, &error_fatal, NULL);
-
- object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_fatal);
+ s = FSL_IMX6UL(object_new(TYPE_FSL_IMX6UL));
+ object_property_add_child(OBJECT(machine), "soc", OBJECT(s), &error_fatal);
+ object_property_set_bool(OBJECT(s), true, "realized", &error_fatal);
- memory_region_allocate_system_memory(&s->ram, NULL, "mcimx6ul-evk.ram",
- machine->ram_size);
- memory_region_add_subregion(get_system_memory(),
- FSL_IMX6UL_MMDC_ADDR, &s->ram);
+ memory_region_add_subregion(get_system_memory(), FSL_IMX6UL_MMDC_ADDR,
+ machine->ram);
for (i = 0; i < FSL_IMX6UL_NUM_USDHCS; i++) {
BusState *bus;
@@ -61,7 +53,7 @@ static void mcimx6ul_evk_init(MachineState *machine)
di = drive_get_next(IF_SD);
blk = di ? blk_by_legacy_dinfo(di) : NULL;
- bus = qdev_get_child_bus(DEVICE(&s->soc.usdhc[i]), "sd-bus");
+ bus = qdev_get_child_bus(DEVICE(&s->usdhc[i]), "sd-bus");
carddev = qdev_create(bus, TYPE_SD_CARD);
qdev_prop_set_drive(carddev, "drive", blk, &error_fatal);
object_property_set_bool(OBJECT(carddev), true,
@@ -69,7 +61,7 @@ static void mcimx6ul_evk_init(MachineState *machine)
}
if (!qtest_enabled()) {
- arm_load_kernel(&s->soc.cpu, machine, &boot_info);
+ arm_load_kernel(&s->cpu, machine, &boot_info);
}
}
@@ -78,5 +70,6 @@ static void mcimx6ul_evk_machine_init(MachineClass *mc)
mc->desc = "Freescale i.MX6UL Evaluation Kit (Cortex A7)";
mc->init = mcimx6ul_evk_init;
mc->max_cpus = FSL_IMX6UL_NUM_CPUS;
+ mc->default_ram_id = "mcimx6ul-evk.ram";
}
DEFINE_MACHINE("mcimx6ul-evk", mcimx6ul_evk_machine_init)