@@ -48,6 +48,7 @@
#include "qemu/units.h"
#include "qemu/cutils.h"
#include "qapi/error.h"
+#include "qapi/qmp/qlist.h"
#include "qemu/error-report.h"
#include "hw/arm/boot.h"
#include "hw/arm/armv7m.h"
@@ -461,6 +462,7 @@ static MemoryRegion *make_scc(MPS2TZMachineState *mms, void *opaque,
MPS2SCC *scc = opaque;
DeviceState *sccdev;
MPS2TZMachineClass *mmc = MPS2TZ_MACHINE_GET_CLASS(mms);
+ QList *oscclk;
uint32_t i;
object_initialize_child(OBJECT(mms), "scc", scc, TYPE_MPS2_SCC);
@@ -469,11 +471,13 @@ static MemoryRegion *make_scc(MPS2TZMachineState *mms, void *opaque,
qdev_prop_set_uint32(sccdev, "scc-cfg4", 0x2);
qdev_prop_set_uint32(sccdev, "scc-aid", 0x00200008);
qdev_prop_set_uint32(sccdev, "scc-id", mmc->scc_id);
- qdev_prop_set_uint32(sccdev, "len-oscclk", mmc->len_oscclk);
+
+ oscclk = qlist_new();
for (i = 0; i < mmc->len_oscclk; i++) {
- g_autofree char *propname = g_strdup_printf("oscclk[%u]", i);
- qdev_prop_set_uint32(sccdev, propname, mmc->oscclk[i]);
+ qlist_append_int(oscclk, mmc->oscclk[i]);
}
+ qdev_prop_set_array(sccdev, "oscclk", oscclk);
+
sysbus_realize(SYS_BUS_DEVICE(scc), &error_fatal);
return sysbus_mmio_get_region(SYS_BUS_DEVICE(sccdev), 0);
}