@@ -36,7 +36,8 @@ static void fsl_imx25_init(Object *obj)
FslIMX25State *s = FSL_IMX25(obj);
int i;
- object_initialize_child(obj, "cpu", &s->cpu, ARM_CPU_TYPE_NAME("arm926"));
+ s->cpu = ARM_CPU(object_new(ARM_CPU_TYPE_NAME("arm926")));
+ object_property_add_child(obj, "cpu", OBJECT(s->cpu));
object_initialize_child(obj, "avic", &s->avic, TYPE_IMX_AVIC);
@@ -83,7 +84,7 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
uint8_t i;
Error *err = NULL;
- if (!qdev_realize(DEVICE(&s->cpu), NULL, errp)) {
+ if (!qdev_realize(DEVICE(s->cpu), NULL, errp)) {
return;
}
@@ -92,9 +93,9 @@ static void fsl_imx25_realize(DeviceState *dev, Error **errp)
}
sysbus_mmio_map(SYS_BUS_DEVICE(&s->avic), 0, FSL_IMX25_AVIC_ADDR);
sysbus_connect_irq(SYS_BUS_DEVICE(&s->avic), 0,
- qdev_get_gpio_in(DEVICE(&s->cpu), ARM_CPU_IRQ));
+ qdev_get_gpio_in(DEVICE(s->cpu), ARM_CPU_IRQ));
sysbus_connect_irq(SYS_BUS_DEVICE(&s->avic), 1,
- qdev_get_gpio_in(DEVICE(&s->cpu), ARM_CPU_FIQ));
+ qdev_get_gpio_in(DEVICE(s->cpu), ARM_CPU_FIQ));
if (!sysbus_realize(SYS_BUS_DEVICE(&s->ccm), errp)) {
return;
@@ -136,7 +136,7 @@ static void imx25_pdk_init(MachineState *machine)
* fail.
*/
if (!qtest_enabled()) {
- arm_load_kernel(&s->soc.cpu, machine, &imx25_pdk_binfo);
+ arm_load_kernel(s->soc.cpu, machine, &imx25_pdk_binfo);
}
}
@@ -20,7 +20,6 @@ arm_ss.add(when: 'CONFIG_ALLWINNER_H3', if_true: files('allwinner-h3.c', 'orange
arm_ss.add(when: 'CONFIG_RASPI', if_true: files('bcm2836.c', 'raspi.c'))
arm_ss.add(when: 'CONFIG_XLNX_ZYNQMP_ARM', if_true: files('xlnx-zynqmp.c', 'xlnx-zcu102.c'))
arm_ss.add(when: 'CONFIG_XLNX_VERSAL', if_true: files('xlnx-versal.c', 'xlnx-versal-virt.c'))
-arm_ss.add(when: 'CONFIG_FSL_IMX25', if_true: files('fsl-imx25.c', 'imx25_pdk.c'))
arm_ss.add(when: 'CONFIG_FSL_IMX31', if_true: files('fsl-imx31.c', 'kzm.c'))
arm_ss.add(when: 'CONFIG_FSL_IMX6', if_true: files('fsl-imx6.c'))
arm_ss.add(when: 'CONFIG_ASPEED_SOC', if_true: files(
@@ -41,6 +40,7 @@ softmmu_ss.add(when: 'CONFIG_DIGIC', if_true: files('digic.c'))
softmmu_ss.add(when: 'CONFIG_DIGIC', if_true: files('digic_boards.c'))
softmmu_ss.add(when: 'CONFIG_EMCRAFT_SF2', if_true: files('msf2-som.c'))
softmmu_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4_boards.c'))
+softmmu_ss.add(when: 'CONFIG_FSL_IMX25', if_true: files('fsl-imx25.c', 'imx25_pdk.c'))
softmmu_ss.add(when: 'CONFIG_GUMSTIX', if_true: files('gumstix.c'))
softmmu_ss.add(when: 'CONFIG_HIGHBANK', if_true: files('highbank.c'))
softmmu_ss.add(when: 'CONFIG_INTEGRATOR', if_true: files('integratorcp.c'))
@@ -31,7 +31,7 @@
#include "hw/usb/chipidea.h"
#include "hw/watchdog/wdt_imx2.h"
#include "exec/memory.h"
-#include "target/arm/cpu.h"
+#include "hw/arm/cpu.h"
#include "qom/object.h"
#define TYPE_FSL_IMX25 "fsl-imx25"
@@ -50,7 +50,7 @@ struct FslIMX25State {
DeviceState parent_obj;
/*< public >*/
- ARMCPU cpu;
+ ARMCPU *cpu;
IMXAVICState avic;
IMX25CCMState ccm;
IMXSerialState uart[FSL_IMX25_NUM_UARTS];
Replace the ARMCPU field in FslIMX25State by a reference to an allocated ARMCPU. Instead of initializing the field with object_initialize(), allocate it with object_new(). As we don't access ARMCPU internal fields or size, we can move from arm_ss[] to the more generic softmmu_ss[] the followin units: - fsl-imx25.c - imx25_pdk.c Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> --- hw/arm/fsl-imx25.c | 9 +++++---- hw/arm/imx25_pdk.c | 2 +- hw/arm/meson.build | 2 +- include/hw/arm/fsl-imx25.h | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-)