From patchwork Wed Jul 27 16:46:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 9250177 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D75C060866 for ; Wed, 27 Jul 2016 16:56:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C99B21FE6A for ; Wed, 27 Jul 2016 16:56:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BDD1D26598; Wed, 27 Jul 2016 16:56:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6DC3925D91 for ; Wed, 27 Jul 2016 16:56:02 +0000 (UTC) Received: from localhost ([::1]:47732 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSS7l-0006Cj-La for patchwork-qemu-devel@patchwork.kernel.org; Wed, 27 Jul 2016 12:56:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60373) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSRzg-0007MI-Nq for qemu-devel@nongnu.org; Wed, 27 Jul 2016 12:47:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bSRzd-0001zt-SZ for qemu-devel@nongnu.org; Wed, 27 Jul 2016 12:47:40 -0400 Received: from 4.mo7.mail-out.ovh.net ([178.32.122.254]:39490) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bSRzd-0001zS-La for qemu-devel@nongnu.org; Wed, 27 Jul 2016 12:47:37 -0400 Received: from player796.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo7.mail-out.ovh.net (Postfix) with ESMTP id AD303FFCF8F for ; Wed, 27 Jul 2016 18:47:36 +0200 (CEST) Received: from hermes.kaod.org (LFbn-1-2234-107.w90-76.abo.wanadoo.fr [90.76.55.107]) (Authenticated sender: clg@kaod.org) by player796.ha.ovh.net (Postfix) with ESMTPSA id 64A845C008A; Wed, 27 Jul 2016 18:47:31 +0200 (CEST) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: Peter Maydell Date: Wed, 27 Jul 2016 18:46:55 +0200 Message-Id: <1469638018-17590-4-git-send-email-clg@kaod.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1469638018-17590-1-git-send-email-clg@kaod.org> References: <1469638018-17590-1-git-send-email-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 16548476834957265681 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeltddrieehgdellecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 178.32.122.254 Subject: [Qemu-devel] [PATCH 3/6] ast2400: use machine cpu_model to initialize the soc cpu X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Jeffery , qemu-arm@nongnu.org, qemu-devel@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP It will be easier to specify a different cpu for other soc derived from the ast2400 soc. Signed-off-by: Cédric Le Goater --- hw/arm/ast2400.c | 8 +++++++- hw/arm/palmetto-bmc.c | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/arm/ast2400.c b/hw/arm/ast2400.c index fa535065f765..7f3517a2c6c6 100644 --- a/hw/arm/ast2400.c +++ b/hw/arm/ast2400.c @@ -15,6 +15,7 @@ #include "qemu-common.h" #include "cpu.h" #include "exec/address-spaces.h" +#include "hw/boards.h" #include "hw/arm/ast2400.h" #include "hw/char/serial.h" #include "qemu/log.h" @@ -65,9 +66,14 @@ static const MemoryRegionOps ast2400_io_ops = { static void ast2400_init(Object *obj) { + const char *cpu_model = current_machine->cpu_model; AST2400State *s = AST2400(obj); - s->cpu = cpu_arm_init("arm926"); + if (!cpu_model) { + cpu_model = "arm926"; + } + + s->cpu = cpu_arm_init(cpu_model); object_initialize(&s->vic, sizeof(s->vic), TYPE_ASPEED_VIC); object_property_add_child(obj, "vic", OBJECT(&s->vic), NULL); diff --git a/hw/arm/palmetto-bmc.c b/hw/arm/palmetto-bmc.c index f80a15733864..8a3ff5568575 100644 --- a/hw/arm/palmetto-bmc.c +++ b/hw/arm/palmetto-bmc.c @@ -91,6 +91,7 @@ static void aspeed_init(MachineState *machine) static void palmetto_bmc_init(MachineState *machine) { + machine->cpu_model = "arm926"; aspeed_init(machine); }