@@ -128,7 +128,7 @@ static void lowrisc_ibex_soc_init(Object *obj)
128128{
129129 LowRISCIbexSoCState * s = RISCV_IBEX_SOC (obj );
130130
131- object_initialize_child (obj , "cpu " , & s -> cpu , TYPE_RISCV_CPU_LOWRISC_IBEX );
131+ object_initialize_child (obj , "cpus " , & s -> cpus , TYPE_RISCV_HART_ARRAY );
132132
133133 object_initialize_child (obj , "plic" , & s -> plic , TYPE_SIFIVE_PLIC );
134134
@@ -152,7 +152,7 @@ static void lowrisc_ibex_soc_realize(DeviceState *dev_soc, Error **errp)
152152 MemoryRegion * sys_mem = get_system_memory ();
153153 int i ;
154154
155- Object * cpu = OBJECT (& s -> cpu );
155+ Object * cpu = OBJECT (& s -> cpus . harts [ 0 ] );
156156 object_property_set_int (cpu , "resetvec" , s -> resetvec ,
157157 & error_fatal );
158158 object_property_set_bool (cpu , "m" , true, & error_fatal );
@@ -162,7 +162,7 @@ static void lowrisc_ibex_soc_realize(DeviceState *dev_soc, Error **errp)
162162 object_property_set_bool (cpu , "zbc" , true, & error_fatal );
163163 object_property_set_bool (cpu , "zbs" , true, & error_fatal );
164164 object_property_set_bool (cpu , "smepmp" , true, & error_fatal );
165- qdev_realize (DEVICE (& s -> cpu ), NULL , & error_fatal );
165+ qdev_realize (DEVICE (& s -> cpus ), NULL , & error_fatal );
166166
167167 /* Boot ROM */
168168 memory_region_init_rom (& s -> rom , OBJECT (dev_soc ), "riscv.lowrisc.ibex.rom" ,
@@ -198,10 +198,10 @@ static void lowrisc_ibex_soc_realize(DeviceState *dev_soc, Error **errp)
198198 sysbus_mmio_map (SYS_BUS_DEVICE (& s -> plic ), 0 , memmap [IBEX_DEV_PLIC ].base );
199199
200200 for (i = 0 ; i < ms -> smp .cpus ; i ++ ) {
201- CPUState * cpu = qemu_get_cpu (i );
201+ CPUState * cpu_state = qemu_get_cpu (i );
202202
203203 qdev_connect_gpio_out (DEVICE (& s -> plic ), ms -> smp .cpus + i ,
204- qdev_get_gpio_in (DEVICE (cpu ), IRQ_M_EXT ));
204+ qdev_get_gpio_in (DEVICE (cpu_state ), IRQ_M_EXT ));
205205 }
206206
207207 /* UART */
0 commit comments