From nobody Wed May 1 22:32:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487461832530530.3763955331874; Sat, 18 Feb 2017 15:50:32 -0800 (PST) Received: from localhost ([::1]:60151 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfElq-0002h4-8i for importer@patchew.org; Sat, 18 Feb 2017 18:50:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfEk7-0001s5-S7 for qemu-devel@nongnu.org; Sat, 18 Feb 2017 18:48:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cfEk5-0007CD-3Q for qemu-devel@nongnu.org; Sat, 18 Feb 2017 18:48:43 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33944) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cfEk4-0007Bw-T6 for qemu-devel@nongnu.org; Sat, 18 Feb 2017 18:48:41 -0500 Received: by mail-wm0-f68.google.com with SMTP id c85so8448101wmi.1 for ; Sat, 18 Feb 2017 15:48:40 -0800 (PST) Received: from thl530.multi.box (pD9E83E3C.dip0.t-ipconnect.de. [217.232.62.60]) by smtp.gmail.com with ESMTPSA id w127sm7350085wmg.30.2017.02.18.15.48.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Feb 2017 15:48:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SPxqJEY9ALnZGwWOaFgGLd5D73EwxWlVtes4pzKB18I=; b=GHCmkMyWrF+hLyBTfs23CzGxXkEzf1tvTXpP+tESfQ1z8QQKujpuP1o0fGEVVgCAAZ DuTNKJWn/IBdM+bBIjjK6F8CtwtGDK0aCQWsbzYnNKQbxLqZDIUkd50OmVxRInHQSomI dYiyMhRVRxHC/yZx+pmdJGTSSFUpfa6aEU+FYbaoTqojbCHqZ64A16oNgFe+SK5Rw8tG QzKaUQVYmHjQc8WyYj71LcXZWhWmYVxsVCoPHMPWRnU7EDfVcAh9RcKTngV2FHlT72Pd vUcvY3VA1aGz3pNk68gfIQjowUXVri3t2n0EoefZgs9PzSVlV0c5ydTUZv1v1TUw1Tze 8t5A== X-Gm-Message-State: AMke39nzHUU5Ha3cDmlZfqwuXcz0jBrQPvsFsga2G4D1f/Bmm8WH/LrcPk55qGYs0WavBg== X-Received: by 10.28.178.16 with SMTP id b16mr11975899wmf.83.1487461719919; Sat, 18 Feb 2017 15:48:39 -0800 (PST) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Sun, 19 Feb 2017 00:48:31 +0100 Message-Id: <1487461713-23092-2-git-send-email-huth@tuxfamily.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487461713-23092-1-git-send-email-huth@tuxfamily.org> References: <1487461713-23092-1-git-send-email-huth@tuxfamily.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.82.68 Subject: [Qemu-devel] [PULL 1/3] hw/m68k: Remove dummy machine 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: Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Since it is now possible to instantiate a CPU and RAM with the "none" machine, too, and a kernel can be loaded there with the generic loader device, there is no more need for the m68k "dummy" machine. Thus let's remove this unmaintained file now. Reviewed-by: Laurent Vivier Signed-off-by: Thomas Huth --- MAINTAINERS | 4 --- hw/m68k/Makefile.objs | 2 -- hw/m68k/dummy_m68k.c | 84 -----------------------------------------------= ---- 3 files changed, 90 deletions(-) delete mode 100644 hw/m68k/dummy_m68k.c diff --git a/MAINTAINERS b/MAINTAINERS index fb57d8e..3efe7c5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -565,10 +565,6 @@ S: Orphan F: hw/m68k/an5206.c F: hw/m68k/mcf5206.c =20 -dummy_m68k -S: Orphan -F: hw/m68k/dummy_m68k.c - mcf5208 S: Orphan F: hw/m68k/mcf5208.c diff --git a/hw/m68k/Makefile.objs b/hw/m68k/Makefile.objs index c4352e7..d1f089c 100644 --- a/hw/m68k/Makefile.objs +++ b/hw/m68k/Makefile.objs @@ -1,4 +1,2 @@ obj-y +=3D an5206.o mcf5208.o -obj-y +=3D dummy_m68k.o - obj-y +=3D mcf5206.o mcf_intc.o diff --git a/hw/m68k/dummy_m68k.c b/hw/m68k/dummy_m68k.c deleted file mode 100644 index 0b11d20..0000000 --- a/hw/m68k/dummy_m68k.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Dummy board with just RAM and CPU for use as an ISS. - * - * Copyright (c) 2007 CodeSourcery. - * - * This code is licensed under the GPL - */ - -#include "qemu/osdep.h" -#include "qemu-common.h" -#include "cpu.h" -#include "hw/hw.h" -#include "hw/boards.h" -#include "hw/loader.h" -#include "elf.h" -#include "exec/address-spaces.h" - -#define KERNEL_LOAD_ADDR 0x10000 - -/* Board init. */ - -static void dummy_m68k_init(MachineState *machine) -{ - ram_addr_t ram_size =3D machine->ram_size; - const char *cpu_model =3D machine->cpu_model; - const char *kernel_filename =3D machine->kernel_filename; - M68kCPU *cpu; - CPUM68KState *env; - MemoryRegion *address_space_mem =3D get_system_memory(); - MemoryRegion *ram =3D g_new(MemoryRegion, 1); - int kernel_size; - uint64_t elf_entry; - hwaddr entry; - - if (!cpu_model) - cpu_model =3D "cfv4e"; - cpu =3D cpu_m68k_init(cpu_model); - if (!cpu) { - fprintf(stderr, "Unable to find m68k CPU definition\n"); - exit(1); - } - env =3D &cpu->env; - - /* Initialize CPU registers. */ - env->vbr =3D 0; - - /* RAM at address zero */ - memory_region_allocate_system_memory(ram, NULL, "dummy_m68k.ram", - ram_size); - memory_region_add_subregion(address_space_mem, 0, ram); - - /* Load kernel. */ - if (kernel_filename) { - kernel_size =3D load_elf(kernel_filename, NULL, NULL, &elf_entry, - NULL, NULL, 1, EM_68K, 0, 0); - entry =3D elf_entry; - if (kernel_size < 0) { - kernel_size =3D load_uimage(kernel_filename, &entry, NULL, NUL= L, - NULL, NULL); - } - if (kernel_size < 0) { - kernel_size =3D load_image_targphys(kernel_filename, - KERNEL_LOAD_ADDR, - ram_size - KERNEL_LOAD_ADDR); - entry =3D KERNEL_LOAD_ADDR; - } - if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); - exit(1); - } - } else { - entry =3D 0; - } - env->pc =3D entry; -} - -static void dummy_m68k_machine_init(MachineClass *mc) -{ - mc->desc =3D "Dummy board"; - mc->init =3D dummy_m68k_init; -} - -DEFINE_MACHINE("dummy", dummy_m68k_machine_init) --=20 2.7.4 From nobody Wed May 1 22:32:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487461836715843.1804698260623; Sat, 18 Feb 2017 15:50:36 -0800 (PST) Received: from localhost ([::1]:60152 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfElt-0002jQ-Lp for importer@patchew.org; Sat, 18 Feb 2017 18:50:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54206) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfEk9-0001sF-7G for qemu-devel@nongnu.org; Sat, 18 Feb 2017 18:48:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cfEk5-0007CS-V4 for qemu-devel@nongnu.org; Sat, 18 Feb 2017 18:48:45 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35595) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cfEk5-0007CB-Op for qemu-devel@nongnu.org; Sat, 18 Feb 2017 18:48:41 -0500 Received: by mail-wm0-f67.google.com with SMTP id u63so8403277wmu.2 for ; Sat, 18 Feb 2017 15:48:41 -0800 (PST) Received: from thl530.multi.box (pD9E83E3C.dip0.t-ipconnect.de. [217.232.62.60]) by smtp.gmail.com with ESMTPSA id w127sm7350085wmg.30.2017.02.18.15.48.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Feb 2017 15:48:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IDGW2MVg+gBZDNa7Q1QR3eh3efCfHbb2L8oznXxawIQ=; b=kgUcXI9w5O84xcufJ5oNmbCY/YEWyDijuUPBFr4pDXrzD7caLnBmJq80er/FjT3vaA LA+82aWfxo+34Gn4oHkOfyWSSnLqNYNZzUYGwuEEP2+y0x5puJD/4q9BWl6rPy7tfpQf s5jMplCjbP+M5zztJqQLxaX/aK3iY8P9oBhdfqPUO8juY7lc2OIpH9+XKBls5GKJ8Ko/ mAtzhQthjytkbrBiFf/pTCB3lnl9rt7ZApujHqcjhrt7hPoZoDVInBBbh/CyDXY/EA4M zF/Dx9i/OWoGMIuw5o7yaOJOTd0GGNI7eccPL8Oh/sQJ7H/8QMVuGoaSOkpPUjIsD130 Lglg== X-Gm-Message-State: AMke39lrlDAEFCPwuS1udsDOFx5P9xDDjg7GBhRJ0RujYE25VkBE7sNBPPkzjTMpdqC6Uw== X-Received: by 10.28.46.73 with SMTP id u70mr10563471wmu.54.1487461720638; Sat, 18 Feb 2017 15:48:40 -0800 (PST) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Sun, 19 Feb 2017 00:48:32 +0100 Message-Id: <1487461713-23092-3-git-send-email-huth@tuxfamily.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487461713-23092-1-git-send-email-huth@tuxfamily.org> References: <1487461713-23092-1-git-send-email-huth@tuxfamily.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.82.67 Subject: [Qemu-devel] [PULL 2/3] hw/m68k: QOMify the ColdFire interrupt controller 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: Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Use type_init() and friends to adapt the ColdFire interrupt controller to the latest QEMU device conventions. Reviewed-by: Laurent Vivier Signed-off-by: Thomas Huth --- hw/m68k/mcf_intc.c | 48 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/hw/m68k/mcf_intc.c b/hw/m68k/mcf_intc.c index cf58132..8198afa 100644 --- a/hw/m68k/mcf_intc.c +++ b/hw/m68k/mcf_intc.c @@ -9,10 +9,16 @@ #include "qemu-common.h" #include "cpu.h" #include "hw/hw.h" +#include "hw/sysbus.h" #include "hw/m68k/mcf.h" #include "exec/address-spaces.h" =20 +#define TYPE_MCF_INTC "mcf-intc" +#define MCF_INTC(obj) OBJECT_CHECK(mcf_intc_state, (obj), TYPE_MCF_INTC) + typedef struct { + SysBusDevice parent_obj; + MemoryRegion iomem; uint64_t ipr; uint64_t imr; @@ -138,8 +144,10 @@ static void mcf_intc_set_irq(void *opaque, int irq, in= t level) mcf_intc_update(s); } =20 -static void mcf_intc_reset(mcf_intc_state *s) +static void mcf_intc_reset(DeviceState *dev) { + mcf_intc_state *s =3D MCF_INTC(dev); + s->imr =3D ~0ull; s->ipr =3D 0; s->ifr =3D 0; @@ -154,17 +162,49 @@ static const MemoryRegionOps mcf_intc_ops =3D { .endianness =3D DEVICE_NATIVE_ENDIAN, }; =20 +static void mcf_intc_instance_init(Object *obj) +{ + mcf_intc_state *s =3D MCF_INTC(obj); + + memory_region_init_io(&s->iomem, obj, &mcf_intc_ops, s, "mcf", 0x100); +} + +static void mcf_intc_class_init(ObjectClass *oc, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(oc); + + set_bit(DEVICE_CATEGORY_MISC, dc->categories); + dc->reset =3D mcf_intc_reset; +} + +static const TypeInfo mcf_intc_gate_info =3D { + .name =3D TYPE_MCF_INTC, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(mcf_intc_state), + .instance_init =3D mcf_intc_instance_init, + .class_init =3D mcf_intc_class_init, +}; + +static void mcf_intc_register_types(void) +{ + type_register_static(&mcf_intc_gate_info); +} + +type_init(mcf_intc_register_types) + qemu_irq *mcf_intc_init(MemoryRegion *sysmem, hwaddr base, M68kCPU *cpu) { + DeviceState *dev; mcf_intc_state *s; =20 - s =3D g_malloc0(sizeof(mcf_intc_state)); + dev =3D qdev_create(NULL, TYPE_MCF_INTC); + qdev_init_nofail(dev); + + s =3D MCF_INTC(dev); s->cpu =3D cpu; - mcf_intc_reset(s); =20 - memory_region_init_io(&s->iomem, NULL, &mcf_intc_ops, s, "mcf", 0x100); memory_region_add_subregion(sysmem, base, &s->iomem); =20 return qemu_allocate_irqs(mcf_intc_set_irq, s, 64); --=20 2.7.4 From nobody Wed May 1 22:32:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1487462020661777.8960941149878; Sat, 18 Feb 2017 15:53:40 -0800 (PST) Received: from localhost ([::1]:60170 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfEot-0005VW-IR for importer@patchew.org; Sat, 18 Feb 2017 18:53:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54205) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cfEk9-0001sE-77 for qemu-devel@nongnu.org; Sat, 18 Feb 2017 18:48:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cfEk6-0007CY-E1 for qemu-devel@nongnu.org; Sat, 18 Feb 2017 18:48:45 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:36378) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cfEk6-0007CK-7s for qemu-devel@nongnu.org; Sat, 18 Feb 2017 18:48:42 -0500 Received: by mail-wm0-f67.google.com with SMTP id r18so8429740wmd.3 for ; Sat, 18 Feb 2017 15:48:42 -0800 (PST) Received: from thl530.multi.box (pD9E83E3C.dip0.t-ipconnect.de. [217.232.62.60]) by smtp.gmail.com with ESMTPSA id w127sm7350085wmg.30.2017.02.18.15.48.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 18 Feb 2017 15:48:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OFCukoEYnoZgHxovZyAyZ69JjtUO7OqPgZP5Y0T1o70=; b=dnkm6UtvCEQJqd+XMKujGLCRFAUXkE2LLk742XMnDG2UoIM0hVrJR1IXKCrOl88CUF 8LCIQlevaIVCOoevR9g71xzL6WVC8VFdsU1ow17gfA2Ubw3uyPzwQ88959epMJCA1OHv +QhzKVvnxWg7anPsaXr46lGXKRYBLv7VLYW/qEaziyjM9Sy7kkRGTesBR4OjpnHTrCG6 09FtpfcW8SXGlAKWdRawIRQg5w2nRhYfod88anXRJBlpR5XJs0zpvnVzAGPWJv4DKxw1 YnaOQ+1ewJQft8rvgRFPIccGYOyK0MWtWbjWuQ1jXKbM+Pe0A+Lp4Uc6dRI0Jccq0EWh /jaA== X-Gm-Message-State: AMke39khKymgj8dao0wEVcRwfl0NzvTfeYoS4xA3+nknHjXI/KHrXW0H/gz25DCdJsfGXg== X-Received: by 10.28.111.78 with SMTP id k75mr11446851wmc.71.1487461721201; Sat, 18 Feb 2017 15:48:41 -0800 (PST) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Sun, 19 Feb 2017 00:48:33 +0100 Message-Id: <1487461713-23092-4-git-send-email-huth@tuxfamily.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487461713-23092-1-git-send-email-huth@tuxfamily.org> References: <1487461713-23092-1-git-send-email-huth@tuxfamily.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 74.125.82.67 Subject: [Qemu-devel] [PULL 3/3] MAINTAINERS: Add odd fixer for the ColdFire boards 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: Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" I did some work with real ColdFire boards in the past, and after QOMifying most of the ColdFire devices recently, I feel confident that I could at least take care of odd fixes for these boards. Signed-off-by: Thomas Huth --- MAINTAINERS | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 3efe7c5..4714df8 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -561,16 +561,19 @@ F: hw/lm32/milkymist.c M68K Machines ------------- an5206 -S: Orphan +M: Thomas Huth +S: Odd Fixes F: hw/m68k/an5206.c F: hw/m68k/mcf5206.c =20 mcf5208 -S: Orphan +M: Thomas Huth +S: Odd Fixes F: hw/m68k/mcf5208.c F: hw/m68k/mcf_intc.c F: hw/char/mcf_uart.c F: hw/net/mcf_fec.c +F: include/hw/m68k/mcf*.h =20 MicroBlaze Machines ------------------- --=20 2.7.4