aboutsummaryrefslogtreecommitdiff
path: root/hw/arm/xlnx-zynqmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/arm/xlnx-zynqmp.c')
-rw-r--r--hw/arm/xlnx-zynqmp.c117
1 files changed, 40 insertions, 77 deletions
diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
index 1de9d4a89d..772cfa3771 100644
--- a/hw/arm/xlnx-zynqmp.c
+++ b/hw/arm/xlnx-zynqmp.c
@@ -176,7 +176,6 @@ static inline int arm_gic_ppi_index(int cpu_nr, int ppi_index)
static void xlnx_zynqmp_create_rpu(MachineState *ms, XlnxZynqMPState *s,
const char *boot_cpu, Error **errp)
{
- Error *err = NULL;
int i;
int num_rpus = MIN(ms->smp.cpus - XLNX_ZYNQMP_NUM_APU_CPUS,
XLNX_ZYNQMP_NUM_RPU_CPUS);
@@ -200,18 +199,16 @@ static void xlnx_zynqmp_create_rpu(MachineState *ms, XlnxZynqMPState *s,
name = object_get_canonical_path_component(OBJECT(&s->rpu_cpu[i]));
if (strcmp(name, boot_cpu)) {
/* Secondary CPUs start in PSCI powered-down state */
- object_property_set_bool(OBJECT(&s->rpu_cpu[i]), true,
- "start-powered-off", &error_abort);
+ object_property_set_bool(OBJECT(&s->rpu_cpu[i]),
+ "start-powered-off", true, &error_abort);
} else {
s->boot_cpu_ptr = &s->rpu_cpu[i];
}
g_free(name);
- object_property_set_bool(OBJECT(&s->rpu_cpu[i]), true, "reset-hivecs",
+ object_property_set_bool(OBJECT(&s->rpu_cpu[i]), "reset-hivecs", true,
&error_abort);
- qdev_realize(DEVICE(&s->rpu_cpu[i]), NULL, &err);
- if (err) {
- error_propagate(errp, err);
+ if (!qdev_realize(DEVICE(&s->rpu_cpu[i]), NULL, errp)) {
return;
}
}
@@ -346,37 +343,33 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
for (i = 0; i < num_apus; i++) {
char *name;
- object_property_set_int(OBJECT(&s->apu_cpu[i]), QEMU_PSCI_CONDUIT_SMC,
- "psci-conduit", &error_abort);
+ object_property_set_int(OBJECT(&s->apu_cpu[i]), "psci-conduit",
+ QEMU_PSCI_CONDUIT_SMC, &error_abort);
name = object_get_canonical_path_component(OBJECT(&s->apu_cpu[i]));
if (strcmp(name, boot_cpu)) {
/* Secondary CPUs start in PSCI powered-down state */
- object_property_set_bool(OBJECT(&s->apu_cpu[i]), true,
- "start-powered-off", &error_abort);
+ object_property_set_bool(OBJECT(&s->apu_cpu[i]),
+ "start-powered-off", true, &error_abort);
} else {
s->boot_cpu_ptr = &s->apu_cpu[i];
}
g_free(name);
- object_property_set_bool(OBJECT(&s->apu_cpu[i]),
- s->secure, "has_el3", NULL);
- object_property_set_bool(OBJECT(&s->apu_cpu[i]),
- s->virt, "has_el2", NULL);
- object_property_set_int(OBJECT(&s->apu_cpu[i]), GIC_BASE_ADDR,
- "reset-cbar", &error_abort);
- object_property_set_int(OBJECT(&s->apu_cpu[i]), num_apus,
- "core-count", &error_abort);
- qdev_realize(DEVICE(&s->apu_cpu[i]), NULL, &err);
- if (err) {
- error_propagate(errp, err);
+ object_property_set_bool(OBJECT(&s->apu_cpu[i]), "has_el3", s->secure,
+ NULL);
+ object_property_set_bool(OBJECT(&s->apu_cpu[i]), "has_el2", s->virt,
+ NULL);
+ object_property_set_int(OBJECT(&s->apu_cpu[i]), "reset-cbar",
+ GIC_BASE_ADDR, &error_abort);
+ object_property_set_int(OBJECT(&s->apu_cpu[i]), "core-count",
+ num_apus, &error_abort);
+ if (!qdev_realize(DEVICE(&s->apu_cpu[i]), NULL, errp)) {
return;
}
}
- sysbus_realize(SYS_BUS_DEVICE(&s->gic), &err);
- if (err) {
- error_propagate(errp, err);
+ if (!sysbus_realize(SYS_BUS_DEVICE(&s->gic), errp)) {
return;
}
@@ -466,13 +459,11 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
qemu_check_nic_model(nd, TYPE_CADENCE_GEM);
qdev_set_nic_properties(DEVICE(&s->gem[i]), nd);
}
- object_property_set_int(OBJECT(&s->gem[i]), GEM_REVISION, "revision",
+ object_property_set_int(OBJECT(&s->gem[i]), "revision", GEM_REVISION,
&error_abort);
- object_property_set_int(OBJECT(&s->gem[i]), 2, "num-priority-queues",
+ object_property_set_int(OBJECT(&s->gem[i]), "num-priority-queues", 2,
&error_abort);
- sysbus_realize(SYS_BUS_DEVICE(&s->gem[i]), &err);
- if (err) {
- error_propagate(errp, err);
+ if (!sysbus_realize(SYS_BUS_DEVICE(&s->gem[i]), errp)) {
return;
}
sysbus_mmio_map(SYS_BUS_DEVICE(&s->gem[i]), 0, gem_addr[i]);
@@ -482,9 +473,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
for (i = 0; i < XLNX_ZYNQMP_NUM_UARTS; i++) {
qdev_prop_set_chr(DEVICE(&s->uart[i]), "chardev", serial_hd(i));
- sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), &err);
- if (err) {
- error_propagate(errp, err);
+ if (!sysbus_realize(SYS_BUS_DEVICE(&s->uart[i]), errp)) {
return;
}
sysbus_mmio_map(SYS_BUS_DEVICE(&s->uart[i]), 0, uart_addr[i]);
@@ -492,11 +481,9 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
gic_spi[uart_intr[i]]);
}
- object_property_set_int(OBJECT(&s->sata), SATA_NUM_PORTS, "num-ports",
+ object_property_set_int(OBJECT(&s->sata), "num-ports", SATA_NUM_PORTS,
&error_abort);
- sysbus_realize(SYS_BUS_DEVICE(&s->sata), &err);
- if (err) {
- error_propagate(errp, err);
+ if (!sysbus_realize(SYS_BUS_DEVICE(&s->sata), errp)) {
return;
}
@@ -513,24 +500,17 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
* - SDIO Specification Version 3.0
* - eMMC Specification Version 4.51
*/
- object_property_set_uint(sdhci, 3, "sd-spec-version", &err);
- if (err) {
- error_propagate(errp, err);
+ if (!object_property_set_uint(sdhci, "sd-spec-version", 3, errp)) {
return;
}
- object_property_set_uint(sdhci, SDHCI_CAPABILITIES, "capareg", &err);
- if (err) {
- error_propagate(errp, err);
+ if (!object_property_set_uint(sdhci, "capareg", SDHCI_CAPABILITIES,
+ errp)) {
return;
}
- object_property_set_uint(sdhci, UHS_I, "uhs", &err);
- if (err) {
- error_propagate(errp, err);
+ if (!object_property_set_uint(sdhci, "uhs", UHS_I, errp)) {
return;
}
- sysbus_realize(SYS_BUS_DEVICE(sdhci), &err);
- if (err) {
- error_propagate(errp, err);
+ if (!sysbus_realize(SYS_BUS_DEVICE(sdhci), errp)) {
return;
}
sysbus_mmio_map(sbd, 0, sdhci_addr[i]);
@@ -545,9 +525,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
for (i = 0; i < XLNX_ZYNQMP_NUM_SPIS; i++) {
gchar *bus_name;
- sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), &err);
- if (err) {
- error_propagate(errp, err);
+ if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi[i]), errp)) {
return;
}
@@ -562,9 +540,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
g_free(bus_name);
}
- sysbus_realize(SYS_BUS_DEVICE(&s->qspi), &err);
- if (err) {
- error_propagate(errp, err);
+ if (!sysbus_realize(SYS_BUS_DEVICE(&s->qspi), errp)) {
return;
}
sysbus_mmio_map(SYS_BUS_DEVICE(&s->qspi), 0, QSPI_ADDR);
@@ -584,49 +560,38 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
g_free(target_bus);
}
- sysbus_realize(SYS_BUS_DEVICE(&s->dp), &err);
- if (err) {
- error_propagate(errp, err);
+ if (!sysbus_realize(SYS_BUS_DEVICE(&s->dp), errp)) {
return;
}
sysbus_mmio_map(SYS_BUS_DEVICE(&s->dp), 0, DP_ADDR);
sysbus_connect_irq(SYS_BUS_DEVICE(&s->dp), 0, gic_spi[DP_IRQ]);
- sysbus_realize(SYS_BUS_DEVICE(&s->dpdma), &err);
- if (err) {
- error_propagate(errp, err);
+ if (!sysbus_realize(SYS_BUS_DEVICE(&s->dpdma), errp)) {
return;
}
- object_property_set_link(OBJECT(&s->dp), OBJECT(&s->dpdma), "dpdma",
+ object_property_set_link(OBJECT(&s->dp), "dpdma", OBJECT(&s->dpdma),
&error_abort);
sysbus_mmio_map(SYS_BUS_DEVICE(&s->dpdma), 0, DPDMA_ADDR);
sysbus_connect_irq(SYS_BUS_DEVICE(&s->dpdma), 0, gic_spi[DPDMA_IRQ]);
- sysbus_realize(SYS_BUS_DEVICE(&s->ipi), &err);
- if (err) {
- error_propagate(errp, err);
+ if (!sysbus_realize(SYS_BUS_DEVICE(&s->ipi), errp)) {
return;
}
sysbus_mmio_map(SYS_BUS_DEVICE(&s->ipi), 0, IPI_ADDR);
sysbus_connect_irq(SYS_BUS_DEVICE(&s->ipi), 0, gic_spi[IPI_IRQ]);
- sysbus_realize(SYS_BUS_DEVICE(&s->rtc), &err);
- if (err) {
- error_propagate(errp, err);
+ if (!sysbus_realize(SYS_BUS_DEVICE(&s->rtc), errp)) {
return;
}
sysbus_mmio_map(SYS_BUS_DEVICE(&s->rtc), 0, RTC_ADDR);
sysbus_connect_irq(SYS_BUS_DEVICE(&s->rtc), 0, gic_spi[RTC_IRQ]);
for (i = 0; i < XLNX_ZYNQMP_NUM_GDMA_CH; i++) {
- object_property_set_uint(OBJECT(&s->gdma[i]), 128, "bus-width", &err);
- if (err) {
- error_propagate(errp, err);
+ if (!object_property_set_uint(OBJECT(&s->gdma[i]), "bus-width", 128,
+ errp)) {
return;
}
- sysbus_realize(SYS_BUS_DEVICE(&s->gdma[i]), &err);
- if (err) {
- error_propagate(errp, err);
+ if (!sysbus_realize(SYS_BUS_DEVICE(&s->gdma[i]), errp)) {
return;
}
@@ -636,9 +601,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
}
for (i = 0; i < XLNX_ZYNQMP_NUM_ADMA_CH; i++) {
- sysbus_realize(SYS_BUS_DEVICE(&s->adma[i]), &err);
- if (err) {
- error_propagate(errp, err);
+ if (!sysbus_realize(SYS_BUS_DEVICE(&s->adma[i]), errp)) {
return;
}