From patchwork Tue Jun 18 14:11:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yoshinori Sato X-Patchwork-Id: 11001937 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 602E714BB for ; Tue, 18 Jun 2019 14:48:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EBD828A18 for ; Tue, 18 Jun 2019 14:48:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4218828A25; Tue, 18 Jun 2019 14:48:26 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DEC3F28A18 for ; Tue, 18 Jun 2019 14:48:25 +0000 (UTC) Received: from localhost ([::1]:58642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdFPM-0001bC-TT for patchwork-qemu-devel@patchwork.kernel.org; Tue, 18 Jun 2019 10:48:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60375) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdEqF-00032N-NC for qemu-devel@nongnu.org; Tue, 18 Jun 2019 10:12:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdEqA-0008O5-75 for qemu-devel@nongnu.org; Tue, 18 Jun 2019 10:12:07 -0400 Received: from mail03.asahi-net.or.jp ([202.224.55.15]:57079) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hdEq6-0007xc-Q4 for qemu-devel@nongnu.org; Tue, 18 Jun 2019 10:11:59 -0400 Received: from h61-195-96-97.vps.ablenet.jp (h61-195-96-97.ablenetvps.ne.jp [61.195.96.97]) (Authenticated sender: PQ4Y-STU) by mail03.asahi-net.or.jp (Postfix) with ESMTPA id 085334A2ED; Tue, 18 Jun 2019 23:11:38 +0900 (JST) Received: from yo-satoh-debian.localdomain (ZM005235.ppp.dion.ne.jp [222.8.5.235]) by h61-195-96-97.vps.ablenet.jp (Postfix) with ESMTPSA id 84732240086; Tue, 18 Jun 2019 23:11:37 +0900 (JST) From: Yoshinori Sato To: qemu-devel@nongnu.org Date: Tue, 18 Jun 2019 23:11:12 +0900 Message-Id: <20190618141118.52955-34-ysato@users.sourceforge.jp> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190618141118.52955-1-ysato@users.sourceforge.jp> References: <20190618141118.52955-1-ysato@users.sourceforge.jp> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 202.224.55.15 Subject: [Qemu-devel] [PATCH v21 17/21] hw/rx: Restrict the RX62N microcontroller to the RX62N CPU core X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, richard.henderson@linaro.org, =?utf-8?q?Philip?= =?utf-8?q?pe_Mathieu-Daud=C3=A9?= , Yoshinori Sato , imammedo@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Philippe Mathieu-Daudé While the VIRT machine can use different microcontrollers, the RX62N microcontroller is tied to the RX62N CPU core. Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Yoshinori Sato --- hw/rx/rx-virt.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/rx/rx-virt.c b/hw/rx/rx-virt.c index 4cfe2e3123..9676a5e7bf 100644 --- a/hw/rx/rx-virt.c +++ b/hw/rx/rx-virt.c @@ -17,6 +17,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -56,6 +57,7 @@ static void rx_load_image(RXCPU *cpu, const char *filename, static void rxvirt_init(MachineState *machine) { + MachineClass *mc = MACHINE_GET_CLASS(machine); RX62NState *s = g_new(RX62NState, 1); MemoryRegion *sysmem = get_system_memory(); MemoryRegion *sdram = g_new(MemoryRegion, 1); @@ -64,6 +66,12 @@ static void rxvirt_init(MachineState *machine) void *dtb = NULL; int dtb_size; + if (strcmp(machine->cpu_type, mc->default_cpu_type) != 0) { + error_report("This board can only be used with CPU %s", + mc->default_cpu_type); + exit(1); + } + /* Allocate memory space */ memory_region_init_ram(sdram, NULL, "sdram", 16 * MiB, &error_fatal);