Hi Kuan-Jui
I tested this series with ax3005-evb machine,the initialization did not
complete.
The process showed it repeatedly executing in 'ax3005_init'
> +static const TypeInfo ax3005_soc_types[] = {
> + {
> + .name = TYPE_AX3005_SOC,
> + .parent = TYPE_SYS_BUS_DEVICE,
> + .instance_size = sizeof(Ax3005SoCState),
> + .instance_init = ax3005_init,
> + .class_init = ax3005_class_init,
> + }
> +};
You add instance_size here but forget to add class_size. Then qemu defaultly
use SysBusDeviceClass’s class_size cause of father-son relationship.
> +typedef struct Ax3005SoCClass {
> + SysBusDeviceClass parent;
> +
> + uint32_t num_cpus;
> +} Ax3005SoCClass;
Here your struct apparently extend SysBusDeviceClass field. I think it is the
way why previous repeating behavior.After add class_size locally and rebuild
the the machine completed initialization and responded to QMP commands
successfully.
Best regards :)
Jack Wang