Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1jCYXE-0004jA-Jy for mharc-qemu-riscv@gnu.org; Thu, 12 Mar 2020 20:50:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32991) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jCYCt-0004EE-0c for qemu-riscv@nongnu.org; Thu, 12 Mar 2020 20:29:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jCYCq-0002EE-TQ for qemu-riscv@nongnu.org; Thu, 12 Mar 2020 20:29:42 -0400 Received: from wnew1-smtp.messagingengine.com ([64.147.123.26]:60067) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jCYCm-00026h-S8; Thu, 12 Mar 2020 20:29:37 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.west.internal (Postfix) with ESMTP id 36F7F5C1; Thu, 12 Mar 2020 20:29:35 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 12 Mar 2020 20:29:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=z5i76bGEffOQrMkoMBClRukxuQsLtxLA5shXKZlaPV4=; b=olaJTCzO L3W/paf7sxZmUrmwD4hGOab591dB8OVsjM9HwN5h6TsGqtBa2kv0NwoMO+8zlfDe ghfmpOer+Mf1GSDduBOaCwNCK4omFnBbFdRFbXvlqNCAB7/77PhjCFgbexNXqN3c PeqFZ12vmAL4T4l5tZ1pk4i7QIanJKgmvIOkK/1Z8FLNvDwZApUVviUbWQ2XR8dg 72TZMIdB6K8uoa3dR96dP3h+mVIyvssY1WxmfYRKC7b8hRFkxEE9DKcAuSpuoLP9 QJrUAHql1bFE5n7XDBA4+LS8m7C0FvcpTDVV5goDZvqoVwTq23efQx9JjJbHnHlC iKWoRDJLG2TwPw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedruddviedgvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeevohhrvgih ucghhhgrrhhtohhnuceotghorhgvhiifjeesfhgsrdgtohhmqeenucfkphepudeifedrud dugedrudefvddruddvkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpegtohhrvgihfiejsehfsgdrtghomh X-ME-Proxy: Received: from coreyw7-fedora-MJ09BKJM.thefacebook.com (unknown [163.114.132.128]) by mail.messagingengine.com (Postfix) with ESMTPA id C9FEE3061393; Thu, 12 Mar 2020 20:29:33 -0400 (EDT) From: Corey Wharton To: qemu-devel@nongnu.org, qemu-riscv@nongnu.org Cc: Palmer Dabbelt , Alistair Francis , Sagar Karandikar , Bastian Koppelmann , Corey Wharton Subject: [PATCH 1/2] riscv: sifive_e: Support changing CPU type Date: Thu, 12 Mar 2020 17:29:22 -0700 Message-Id: <20200313002923.30905-2-coreyw7@fb.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200313002923.30905-1-coreyw7@fb.com> References: <20200313002923.30905-1-coreyw7@fb.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.123.26 X-Mailman-Approved-At: Thu, 12 Mar 2020 20:50:42 -0400 X-BeenThere: qemu-riscv@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Mar 2020 00:29:44 -0000 Allows the CPU to be changed from the default via the -cpu command line option. Signed-off-by: Corey Wharton --- hw/riscv/sifive_e.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/riscv/sifive_e.c b/hw/riscv/sifive_e.c index a254cad489..b0a611adb9 100644 --- a/hw/riscv/sifive_e.c +++ b/hw/riscv/sifive_e.c @@ -123,7 +123,7 @@ static void riscv_sifive_e_soc_init(Object *obj) object_initialize_child(obj, "cpus", &s->cpus, sizeof(s->cpus), TYPE_RISCV_HART_ARRAY, &error_abort, NULL); - object_property_set_str(OBJECT(&s->cpus), SIFIVE_E_CPU, "cpu-type", + object_property_set_str(OBJECT(&s->cpus), ms->cpu_type, "cpu-type", &error_abort); object_property_set_int(OBJECT(&s->cpus), ms->smp.cpus, "num-harts", &error_abort); @@ -220,6 +220,7 @@ static void riscv_sifive_e_machine_init(MachineClass *mc) mc->desc = "RISC-V Board compatible with SiFive E SDK"; mc->init = riscv_sifive_e_init; mc->max_cpus = 1; + mc->default_cpu_type = SIFIVE_E_CPU; } DEFINE_MACHINE("sifive_e", riscv_sifive_e_machine_init) -- 2.21.1