qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Rob Herring" <rob.herring@linaro.org>,
	"Peter Crosthwaite" <peter.crosthwaite@xilinx.com>,
	"Evgeny Voevodin" <e.voevodin@samsung.com>,
	patches@linaro.org, "Igor Mitsyanko" <i.mitsyanko@gmail.com>,
	"Dmitry Solodkiy" <d.solodkiy@samsung.com>,
	"Maksim Kozlov" <m.kozlov@samsung.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PATCH v2 3/4] exynos4210: Set reset-cbar property of Cortex-A9 CPUs
Date: Mon, 10 Mar 2014 14:44:51 +0000	[thread overview]
Message-ID: <1394462692-8871-4-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1394462692-8871-1-git-send-email-peter.maydell@linaro.org>

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(-)

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

  parent reply	other threads:[~2014-03-10 14:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-10 14:44 [Qemu-devel] [PATCH v2 0/4] ARM: Set reset-cbar property for A9 and A15 boards Peter Maydell
2014-03-10 14:44 ` [Qemu-devel] [PATCH v2 1/4] vexpress: Set reset-cbar property for CPUs Peter Maydell
2014-03-10 14:44 ` [Qemu-devel] [PATCH v2 2/4] realview-pbx-a9: " Peter Maydell
2014-03-10 14:44 ` Peter Maydell [this message]
2014-03-14 23:04   ` [Qemu-devel] [PATCH v2 3/4] exynos4210: Set reset-cbar property of Cortex-A9 CPUs Peter Crosthwaite
2014-03-10 14:44 ` [Qemu-devel] [PATCH v2 4/4] virt: Set reset-cbar on CPUs Peter Maydell
2014-03-14 23:02   ` Peter Crosthwaite

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1394462692-8871-4-git-send-email-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=afaerber@suse.de \
    --cc=d.solodkiy@samsung.com \
    --cc=e.voevodin@samsung.com \
    --cc=i.mitsyanko@gmail.com \
    --cc=m.kozlov@samsung.com \
    --cc=patches@linaro.org \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rob.herring@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).