Message ID | 1394462692-8871-4-git-send-email-peter.maydell@linaro.org |
---|---|
State | Accepted |
Headers | show |
On Tue, Mar 11, 2014 at 12:44 AM, Peter Maydell <peter.maydell@linaro.org> wrote: > Set the reset-cbar property of the Exynos4210 SoC's Cortex-A9 > CPUs, so that Linux doesn't misrecognize them as a broken > uniprocessor SoC. > > Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> > --- > hw/arm/exynos4210.c | 16 +++++++++++++--- > 1 file changed, 13 insertions(+), 3 deletions(-) > > diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c > index 9f137e9..6426d16 100644 > --- a/hw/arm/exynos4210.c > +++ b/hw/arm/exynos4210.c > @@ -143,11 +143,21 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem, > unsigned long mem_size; > DeviceState *dev; > SysBusDevice *busdev; > + ObjectClass *cpu_oc; > + > + cpu_oc = cpu_class_by_name(TYPE_ARM_CPU, "cortex-a9"); > + assert(cpu_oc); > > for (n = 0; n < EXYNOS4210_NCPUS; n++) { > - s->cpu[n] = cpu_arm_init("cortex-a9"); > - if (!s->cpu[n]) { > - fprintf(stderr, "Unable to find CPU %d definition\n", n); > + Object *cpuobj = object_new(object_class_get_name(cpu_oc)); > + Error *err = NULL; > + > + s->cpu[n] = ARM_CPU(cpuobj); > + object_property_set_int(cpuobj, EXYNOS4210_SMP_PRIVATE_BASE_ADDR, > + "reset-cbar", &error_abort); > + object_property_set_bool(cpuobj, true, "realized", &err); > + if (err) { > + error_report("%s", error_get_pretty(err)); > exit(1); > } > } > -- > 1.9.0 > >
diff --git a/hw/arm/exynos4210.c b/hw/arm/exynos4210.c index 9f137e9..6426d16 100644 --- a/hw/arm/exynos4210.c +++ b/hw/arm/exynos4210.c @@ -143,11 +143,21 @@ Exynos4210State *exynos4210_init(MemoryRegion *system_mem, unsigned long mem_size; DeviceState *dev; SysBusDevice *busdev; + ObjectClass *cpu_oc; + + cpu_oc = cpu_class_by_name(TYPE_ARM_CPU, "cortex-a9"); + assert(cpu_oc); for (n = 0; n < EXYNOS4210_NCPUS; n++) { - s->cpu[n] = cpu_arm_init("cortex-a9"); - if (!s->cpu[n]) { - fprintf(stderr, "Unable to find CPU %d definition\n", n); + Object *cpuobj = object_new(object_class_get_name(cpu_oc)); + Error *err = NULL; + + s->cpu[n] = ARM_CPU(cpuobj); + object_property_set_int(cpuobj, EXYNOS4210_SMP_PRIVATE_BASE_ADDR, + "reset-cbar", &error_abort); + object_property_set_bool(cpuobj, true, "realized", &err); + if (err) { + error_report("%s", error_get_pretty(err)); exit(1); } }
Set the reset-cbar property of the Exynos4210 SoC's Cortex-A9 CPUs, so that Linux doesn't misrecognize them as a broken uniprocessor SoC. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> --- hw/arm/exynos4210.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)