From nobody Thu May 2 05:00:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1567871429; cv=none; d=zoho.com; s=zohoarc; b=D7fMNFiwvyNcFTO84zdzbgVrZ62kvDlJbUArHAgk4yNY8CmYCMp97F8uAAFTp0oiBJlZHuBXHVI7mPvInbs6Q3CgUTUNjMBKj99VR80ZOevJuWDDLHiIKM8D5iXhlz4RD/4tDK0VnAqKQwn3L8zApvLEsDokKjZKfoLkWVClk9U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567871429; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=VpLOyuIbEO1Jv3ImX5dwNgUJpuLil1FFem8OVxVL+ig=; b=Dx6SEOMheq9mi5lRR+kVlZofYwwWVf2Jb4PP0ox+m5t3yp2YudxTsVjA0MtvbQlGiiZxGN72NU2c6uzFf/n40v/rnhIfZuGICvXm8YzIbCl2sb291IOy62Epx5u+20UGfrhoevH0qNGI/bhPssoQj6duEOtXCEmJ0dRL1XmX8rg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1567871429100908.4291796846645; Sat, 7 Sep 2019 08:50:29 -0700 (PDT) Received: from localhost ([::1]:35766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6cyh-0005ST-9i for importer@patchew.org; Sat, 07 Sep 2019 11:50:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48741) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6cwO-0003jW-3U for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:47:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i6cwM-0007gQ-Be for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:47:56 -0400 Received: from mail-wr1-f43.google.com ([209.85.221.43]:43237) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i6cwM-0007fn-54 for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:47:54 -0400 Received: by mail-wr1-f43.google.com with SMTP id q17so4746940wrx.10 for ; Sat, 07 Sep 2019 08:47:54 -0700 (PDT) Received: from thl530.multi.box (pD9E8385F.dip0.t-ipconnect.de. [217.232.56.95]) by smtp.gmail.com with ESMTPSA id s19sm17173418wrb.14.2019.09.07.08.47.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2019 08:47:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VpLOyuIbEO1Jv3ImX5dwNgUJpuLil1FFem8OVxVL+ig=; b=ZkSZCL7COqwPMt9DLauxQsha01PVt+s0FZw0NsI0tbEqXHCyiQ2C0CnObDA5MakNc0 Ge/VqFYKWxz2Hks5z4Ow6E/WiQg2hZhgzZE3pbIHW0gMR9FzfvXpKAN51zTD/xNYQe5I Hax6+c7FtzDV4qzxDKpXd34nErUVAKRAaNRLnk3j3ftYWaN2bJkbZF5zoRmM3kEgqJUd RPIGjcfjaA6D7UM2kQ0XRwqG/S+sD+umlqAXUwp6SWRPstxXSxWWoUjSZNVXEOIP5zNO +O8itM6aGHdaWnsS+nrdw+75+lu9lVlGFJ0PzgXZG9gHGcPk85LRiFE2CC/KGu6tsba6 l7Uw== X-Gm-Message-State: APjAAAUdHjWGLvkLRosBeUZoqoOX9YE+Xp+ww/CweLZjH3FjNlPbQnJ5 KybcWv+XS40AAzMWN2mQaac= X-Google-Smtp-Source: APXvYqzBJZ4HM2UM7A8J5SCK0wdH64AtkxMZZv3oxIbfef2OaGX+QxxDl+H2g0VxCXfCl0vPY1bl6Q== X-Received: by 2002:a5d:4107:: with SMTP id l7mr7097117wrp.303.1567871273114; Sat, 07 Sep 2019 08:47:53 -0700 (PDT) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Sat, 7 Sep 2019 17:47:37 +0200 Message-Id: <20190907154744.4136-2-huth@tuxfamily.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190907154744.4136-1-huth@tuxfamily.org> References: <20190907154744.4136-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.221.43 Subject: [Qemu-devel] [PULL 1/8] m68k: Add NeXTcube framebuffer device emulation 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" The NeXTcube uses a linear framebuffer with 4 greyscale colors and a fixed resolution of 1120 * 832. This code has been taken from Bryce Lanham's GSoC 2011 NeXT branch at https://github.com/blanham/qemu-NeXT/blob/next-cube/hw/next-fb.c and altered to fit the latest interface of the current QEMU (e.g. the device has been "qdev"-ified etc.). Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20190831074519.32613-2-huth@tuxfamily.org> Signed-off-by: Thomas Huth --- default-configs/m68k-softmmu.mak | 1 + hw/display/Makefile.objs | 1 + hw/display/next-fb.c | 146 +++++++++++++++++++++++++++++++ hw/m68k/Kconfig | 4 + include/hw/m68k/next-cube.h | 7 ++ 5 files changed, 159 insertions(+) create mode 100644 hw/display/next-fb.c create mode 100644 include/hw/m68k/next-cube.h diff --git a/default-configs/m68k-softmmu.mak b/default-configs/m68k-softmm= u.mak index 4049a8f2ba..d67ab8b96d 100644 --- a/default-configs/m68k-softmmu.mak +++ b/default-configs/m68k-softmmu.mak @@ -6,3 +6,4 @@ CONFIG_SEMIHOSTING=3Dy # CONFIG_AN5206=3Dy CONFIG_MCF5208=3Dy +CONFIG_NEXTCUBE=3Dy diff --git a/hw/display/Makefile.objs b/hw/display/Makefile.objs index 0f11d55b14..5a4066383b 100644 --- a/hw/display/Makefile.objs +++ b/hw/display/Makefile.objs @@ -38,6 +38,7 @@ common-obj-$(CONFIG_RASPI) +=3D bcm2835_fb.o common-obj-$(CONFIG_SM501) +=3D sm501.o common-obj-$(CONFIG_TCX) +=3D tcx.o common-obj-$(CONFIG_CG3) +=3D cg3.o +common-obj-$(CONFIG_NEXTCUBE) +=3D next-fb.o =20 obj-$(CONFIG_VGA) +=3D vga.o =20 diff --git a/hw/display/next-fb.c b/hw/display/next-fb.c new file mode 100644 index 0000000000..2b726a10f8 --- /dev/null +++ b/hw/display/next-fb.c @@ -0,0 +1,146 @@ +/* + * NeXT Cube/Station Framebuffer Emulation + * + * Copyright (c) 2011 Bryce Lanham + * + * Permission is hereby granted, free of charge, to any person obtaining a= copy + * of this software and associated documentation files (the "Software"), t= o deal + * in the Software without restriction, including without limitation the r= ights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included= in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN + * THE SOFTWARE. + */ +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "ui/console.h" +#include "hw/hw.h" +#include "hw/boards.h" +#include "hw/loader.h" +#include "hw/display/framebuffer.h" +#include "ui/pixel_ops.h" +#include "hw/m68k/next-cube.h" + +#define NEXTFB(obj) OBJECT_CHECK(NeXTFbState, (obj), TYPE_NEXTFB) + +struct NeXTFbState { + SysBusDevice parent_obj; + + MemoryRegion fb_mr; + MemoryRegionSection fbsection; + QemuConsole *con; + + uint32_t cols; + uint32_t rows; + int invalidate; +}; +typedef struct NeXTFbState NeXTFbState; + +static void nextfb_draw_line(void *opaque, uint8_t *d, const uint8_t *s, + int width, int pitch) +{ + NeXTFbState *nfbstate =3D NEXTFB(opaque); + static const uint32_t pal[4] =3D { + 0xFFFFFFFF, 0xFFAAAAAA, 0xFF555555, 0xFF000000 + }; + uint32_t *buf =3D (uint32_t *)d; + int i =3D 0; + + for (i =3D 0; i < nfbstate->cols / 4; i++) { + int j =3D i * 4; + uint8_t src =3D s[i]; + buf[j + 3] =3D pal[src & 0x3]; + src >>=3D 2; + buf[j + 2] =3D pal[src & 0x3]; + src >>=3D 2; + buf[j + 1] =3D pal[src & 0x3]; + src >>=3D 2; + buf[j + 0] =3D pal[src & 0x3]; + } +} + +static void nextfb_update(void *opaque) +{ + NeXTFbState *s =3D NEXTFB(opaque); + int dest_width =3D 4; + int src_width; + int first =3D 0; + int last =3D 0; + DisplaySurface *surface =3D qemu_console_surface(s->con); + + src_width =3D s->cols / 4 + 8; + dest_width =3D s->cols * 4; + + if (s->invalidate) { + framebuffer_update_memory_section(&s->fbsection, &s->fb_mr, 0, + s->cols, src_width); + s->invalidate =3D 0; + } + + framebuffer_update_display(surface, &s->fbsection, s->cols, s->rows, + src_width, dest_width, 0, 1, nextfb_draw_li= ne, + s, &first, &last); + + dpy_gfx_update(s->con, 0, 0, s->cols, s->rows); +} + +static void nextfb_invalidate(void *opaque) +{ + NeXTFbState *s =3D NEXTFB(opaque); + s->invalidate =3D 1; +} + +static const GraphicHwOps nextfb_ops =3D { + .invalidate =3D nextfb_invalidate, + .gfx_update =3D nextfb_update, +}; + +static void nextfb_realize(DeviceState *dev, Error **errp) +{ + NeXTFbState *s =3D NEXTFB(dev); + + memory_region_init_ram(&s->fb_mr, OBJECT(dev), "next-video", 0x1CB100, + &error_fatal); + sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->fb_mr); + + s->invalidate =3D 1; + s->cols =3D 1120; + s->rows =3D 832; + + s->con =3D graphic_console_init(dev, 0, &nextfb_ops, s); + qemu_console_resize(s->con, s->cols, s->rows); +} + +static void nextfb_class_init(ObjectClass *oc, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(oc); + + set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); + dc->realize =3D nextfb_realize; + + /* Note: This device does not any state that we have to reset or migra= te */ +} + +static const TypeInfo nextfb_info =3D { + .name =3D TYPE_NEXTFB, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(NeXTFbState), + .class_init =3D nextfb_class_init, +}; + +static void nextfb_register_types(void) +{ + type_register_static(&nextfb_info); +} + +type_init(nextfb_register_types) diff --git a/hw/m68k/Kconfig b/hw/m68k/Kconfig index 49ef0b3f6d..ec58a2eb06 100644 --- a/hw/m68k/Kconfig +++ b/hw/m68k/Kconfig @@ -7,3 +7,7 @@ config MCF5208 bool select COLDFIRE select PTIMER + +config NEXTCUBE + bool + select FRAMEBUFFER diff --git a/include/hw/m68k/next-cube.h b/include/hw/m68k/next-cube.h new file mode 100644 index 0000000000..090c7c51aa --- /dev/null +++ b/include/hw/m68k/next-cube.h @@ -0,0 +1,7 @@ + +#ifndef NEXT_CUBE_H +#define NEXT_CUBE_H + +#define TYPE_NEXTFB "next-fb" + +#endif /* NEXT_CUBE_H */ --=20 2.21.0 From nobody Thu May 2 05:00:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1567871552; cv=none; d=zoho.com; s=zohoarc; b=kLOFVbtiKeZ54UiyQAdqlczqdAgENJyjeJ8eufnDtho4zMDdW0LsiwfD3kTbtbFIVDyD66h0o6z3y4Zk5UxD32i7xENUYqS3tHIJFEnBkVBAo0gKqZT2JSLk9+YzsgKMEV1WebNlvvZALYBscSttzGVV+S2HwZkxvcOxGnYLcBE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567871552; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=uDIGx0E03a6QELNn/xywvmY2Vf/UxG4+13DlOqREHdA=; b=JIUVvQTUesaVGkCNPXVlL0N4CBcp14XeH705Skhv6/smE5Gf048qEn1xea3A+kYi5cQSvpfcIWinNq50p/KCVSfcf60YXT86HNgL9Z4UupXpiB/W7oYVJ9IAZUxrBOpzcCHLI7pUApFq/6sVzO3GchPW712kA452JO7RmxaYEbk= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1567871552701812.9986276837858; Sat, 7 Sep 2019 08:52:32 -0700 (PDT) Received: from localhost ([::1]:35792 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6d0p-000077-Et for importer@patchew.org; Sat, 07 Sep 2019 11:52:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48756) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6cwP-0003jc-F9 for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:47:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i6cwN-0007hC-9Z for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:47:57 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:35735) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i6cwN-0007gW-2h for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:47:55 -0400 Received: by mail-wr1-f67.google.com with SMTP id g7so9524023wrx.2 for ; Sat, 07 Sep 2019 08:47:55 -0700 (PDT) Received: from thl530.multi.box (pD9E8385F.dip0.t-ipconnect.de. [217.232.56.95]) by smtp.gmail.com with ESMTPSA id s19sm17173418wrb.14.2019.09.07.08.47.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2019 08:47:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uDIGx0E03a6QELNn/xywvmY2Vf/UxG4+13DlOqREHdA=; b=LpbW+ft9y/rc5guR8+GQqdK6jDmlEknZKUUxxoNb7feu5c+CWsuD6eMVhW6ogX/pux P6BqZqPZ2nk+J33DRRkFPDkZqx1X1XZftr6UauCGkQPzg0TlUPtUbDjK7KV6gWFY5ykt 8ivIhdZ0Z1GDYEW6oPEN5s0UezIIH0XOD721Z5Hkq5CapNqlnKlJjwsj9neZNwoGzgGZ Cj/R2M9X40Y4DLltNv/VTvvtrx0xWrjb6DXPiaKc5X7qm1+Wio9HJ+zE0roW8lHaWDjx GauAQyvsZMWSKbi+pPTn5+kuS4ohrJNWDFosmbv1iqWdnMLAtvN1E6ihQc0KV0tcWUSJ q0Kw== X-Gm-Message-State: APjAAAWNqMMLNCqhU6C/goDZ5v7QyyFmLjja5PTxyhmWjSVf9yzfbeMW 9h2CWJ2I1qbdMPJM+c/vVXtDeG5E X-Google-Smtp-Source: APXvYqzcTIwRwPkSWWE/Tl1NFPlIN8nuco7taaG4o4UCXcRDM5kB5FfMv1XSIqynlJ6Dw6Z4C9a2/w== X-Received: by 2002:adf:d1a4:: with SMTP id w4mr12584315wrc.331.1567871273945; Sat, 07 Sep 2019 08:47:53 -0700 (PDT) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Sat, 7 Sep 2019 17:47:38 +0200 Message-Id: <20190907154744.4136-3-huth@tuxfamily.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190907154744.4136-1-huth@tuxfamily.org> References: <20190907154744.4136-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.221.67 Subject: [Qemu-devel] [PULL 2/8] m68k: Add NeXTcube keyboard device 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" It is likely still quite incomplete (e.g. mouse and interrupts are not implemented yet), but it is good enough for keyboard input at the firmware monitor. This code has been taken from Bryce Lanham's GSoC 2011 NeXT branch at https://github.com/blanham/qemu-NeXT/blob/next-cube/hw/next-kbd.c and altered to fit the latest interface of the current QEMU (e.g. to use memory_region_init_io() instead of cpu_register_physical_memory()). Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20190831074519.32613-3-huth@tuxfamily.org> Signed-off-by: Thomas Huth --- hw/m68k/Makefile.objs | 1 + hw/m68k/next-kbd.c | 291 ++++++++++++++++++++++++++++++++++++ include/hw/m68k/next-cube.h | 2 + 3 files changed, 294 insertions(+) create mode 100644 hw/m68k/next-kbd.c diff --git a/hw/m68k/Makefile.objs b/hw/m68k/Makefile.objs index 482f8477b4..688002cac1 100644 --- a/hw/m68k/Makefile.objs +++ b/hw/m68k/Makefile.objs @@ -1,2 +1,3 @@ obj-$(CONFIG_AN5206) +=3D an5206.o mcf5206.o obj-$(CONFIG_MCF5208) +=3D mcf5208.o mcf_intc.o +obj-$(CONFIG_NEXTCUBE) +=3D next-kbd.o diff --git a/hw/m68k/next-kbd.c b/hw/m68k/next-kbd.c new file mode 100644 index 0000000000..2dff87be15 --- /dev/null +++ b/hw/m68k/next-kbd.c @@ -0,0 +1,291 @@ +/* + * QEMU NeXT Keyboard/Mouse emulation + * + * Copyright (c) 2011 Bryce Lanham + * + * Permission is hereby granted, free of charge, to any person obtaining a= copy + * of this software and associated documentation files (the "Software"), t= o deal + * in the Software without restriction, including without limitation the r= ights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or se= ll + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included= in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS= OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OT= HER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING= FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS = IN + * THE SOFTWARE. + */ + +/* + * This is admittedly hackish, but works well enough for basic input. Mouse + * support will be added once we can boot something that needs the mouse. + */ + +#include "qemu/osdep.h" +#include "qemu/log.h" +#include "exec/address-spaces.h" +#include "hw/hw.h" +#include "hw/sysbus.h" +#include "hw/m68k/next-cube.h" +#include "ui/console.h" +#include "sysemu/sysemu.h" +#include "migration/vmstate.h" + +#define NEXTKBD(obj) OBJECT_CHECK(NextKBDState, (obj), TYPE_NEXTKBD) + +/* following defintions from next68k netbsd */ +#define CSR_INT 0x00800000 +#define CSR_DATA 0x00400000 + +#define KD_KEYMASK 0x007f +#define KD_DIRECTION 0x0080 /* pressed or released */ +#define KD_CNTL 0x0100 +#define KD_LSHIFT 0x0200 +#define KD_RSHIFT 0x0400 +#define KD_LCOMM 0x0800 +#define KD_RCOMM 0x1000 +#define KD_LALT 0x2000 +#define KD_RALT 0x4000 +#define KD_VALID 0x8000 /* only set for scancode keys ? */ +#define KD_MODS 0x4f00 + +#define KBD_QUEUE_SIZE 256 + +typedef struct { + uint8_t data[KBD_QUEUE_SIZE]; + int rptr, wptr, count; +} KBDQueue; + + +typedef struct NextKBDState { + SysBusDevice sbd; + MemoryRegion mr; + KBDQueue queue; + uint16_t shift; +} NextKBDState; + +static void queue_code(void *opaque, int code); + +/* lots of magic numbers here */ +static uint32_t kbd_read_byte(void *opaque, hwaddr addr) +{ + switch (addr & 0x3) { + case 0x0: /* 0xe000 */ + return 0x80 | 0x20; + + case 0x1: /* 0xe001 */ + return 0x80 | 0x40 | 0x20 | 0x10; + + case 0x2: /* 0xe002 */ + /* returning 0x40 caused mach to hang */ + return 0x10 | 0x2 | 0x1; + + default: + qemu_log_mask(LOG_UNIMP, "NeXT kbd read byte %"HWADDR_PRIx"\n", ad= dr); + } + + return 0; +} + +static uint32_t kbd_read_word(void *opaque, hwaddr addr) +{ + qemu_log_mask(LOG_UNIMP, "NeXT kbd read word %"HWADDR_PRIx"\n", addr); + return 0; +} + +/* even more magic numbers */ +static uint32_t kbd_read_long(void *opaque, hwaddr addr) +{ + int key =3D 0; + NextKBDState *s =3D NEXTKBD(opaque); + KBDQueue *q =3D &s->queue; + + switch (addr & 0xf) { + case 0x0: /* 0xe000 */ + return 0xA0F09300; + + case 0x8: /* 0xe008 */ + /* get keycode from buffer */ + if (q->count > 0) { + key =3D q->data[q->rptr]; + if (++q->rptr =3D=3D KBD_QUEUE_SIZE) { + q->rptr =3D 0; + } + + q->count--; + + if (s->shift) { + key |=3D s->shift; + } + + if (key & 0x80) { + return 0; + } else { + return 0x10000000 | KD_VALID | key; + } + } else { + return 0; + } + + default: + qemu_log_mask(LOG_UNIMP, "NeXT kbd read long %"HWADDR_PRIx"\n", ad= dr); + return 0; + } +} + +static uint64_t kbd_readfn(void *opaque, hwaddr addr, unsigned size) +{ + switch (size) { + case 1: + return kbd_read_byte(opaque, addr); + case 2: + return kbd_read_word(opaque, addr); + case 4: + return kbd_read_long(opaque, addr); + default: + g_assert_not_reached(); + } +} + +static void kbd_writefn(void *opaque, hwaddr addr, uint64_t value, + unsigned size) +{ + qemu_log_mask(LOG_UNIMP, "NeXT kbd write: size=3D%u addr=3D0x%"HWADDR_= PRIx + "val=3D0x%"PRIx64"\n", size, addr, value); +} + +static const MemoryRegionOps kbd_ops =3D { + .read =3D kbd_readfn, + .write =3D kbd_writefn, + .valid.min_access_size =3D 1, + .valid.max_access_size =3D 4, + .endianness =3D DEVICE_NATIVE_ENDIAN, +}; + +static void nextkbd_event(void *opaque, int ch) +{ + /* + * Will want to set vars for caps/num lock + * if (ch & 0x80) -> key release + * there's also e0 escaped scancodes that might need to be handled + */ + queue_code(opaque, ch); +} + +static const unsigned char next_keycodes[128] =3D { + 0x00, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x50, 0x4F, + 0x4E, 0x1E, 0x1F, 0x20, 0x1D, 0x1C, 0x1B, 0x00, + 0x42, 0x43, 0x44, 0x45, 0x48, 0x47, 0x46, 0x06, + 0x07, 0x08, 0x00, 0x00, 0x2A, 0x00, 0x39, 0x3A, + 0x3B, 0x3C, 0x3D, 0x40, 0x3F, 0x3E, 0x2D, 0x2C, + 0x2B, 0x26, 0x00, 0x00, 0x31, 0x32, 0x33, 0x34, + 0x35, 0x37, 0x36, 0x2e, 0x2f, 0x30, 0x00, 0x00, + 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static void queue_code(void *opaque, int code) +{ + NextKBDState *s =3D NEXTKBD(opaque); + KBDQueue *q =3D &s->queue; + int key =3D code & KD_KEYMASK; + int release =3D code & 0x80; + static int ext; + + if (code =3D=3D 0xE0) { + ext =3D 1; + } + + if (code =3D=3D 0x2A || code =3D=3D 0x1D || code =3D=3D 0x36) { + if (code =3D=3D 0x2A) { + s->shift =3D KD_LSHIFT; + } else if (code =3D=3D 0x36) { + s->shift =3D KD_RSHIFT; + ext =3D 0; + } else if (code =3D=3D 0x1D && !ext) { + s->shift =3D KD_LCOMM; + } else if (code =3D=3D 0x1D && ext) { + ext =3D 0; + s->shift =3D KD_RCOMM; + } + return; + } else if (code =3D=3D (0x2A | 0x80) || code =3D=3D (0x1D | 0x80) || + code =3D=3D (0x36 | 0x80)) { + s->shift =3D 0; + return; + } + + if (q->count >=3D KBD_QUEUE_SIZE) { + return; + } + + q->data[q->wptr] =3D next_keycodes[key] | release; + + if (++q->wptr =3D=3D KBD_QUEUE_SIZE) { + q->wptr =3D 0; + } + + q->count++; + + /* + * might need to actually trigger the NeXT irq, but as the keyboard wo= rks + * at the moment, I'll worry about it later + */ + /* s->update_irq(s->update_arg, 1); */ +} + +static void nextkbd_reset(DeviceState *dev) +{ + NextKBDState *nks =3D NEXTKBD(dev); + + memset(&nks->queue, 0, sizeof(KBDQueue)); + nks->shift =3D 0; +} + +static void nextkbd_realize(DeviceState *dev, Error **errp) +{ + NextKBDState *s =3D NEXTKBD(dev); + + memory_region_init_io(&s->mr, OBJECT(dev), &kbd_ops, s, "next.kbd", 0x= 1000); + sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->mr); + + qemu_add_kbd_event_handler(nextkbd_event, s); +} + +static const VMStateDescription nextkbd_vmstate =3D { + .name =3D TYPE_NEXTKBD, + .unmigratable =3D 1, /* TODO: Implement this when m68k CPU is migra= table */ +}; + +static void nextkbd_class_init(ObjectClass *oc, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(oc); + + set_bit(DEVICE_CATEGORY_INPUT, dc->categories); + dc->vmsd =3D &nextkbd_vmstate; + dc->realize =3D nextkbd_realize; + dc->reset =3D nextkbd_reset; +} + +static const TypeInfo nextkbd_info =3D { + .name =3D TYPE_NEXTKBD, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(NextKBDState), + .class_init =3D nextkbd_class_init, +}; + +static void nextkbd_register_types(void) +{ + type_register_static(&nextkbd_info); +} + +type_init(nextkbd_register_types) diff --git a/include/hw/m68k/next-cube.h b/include/hw/m68k/next-cube.h index 090c7c51aa..37f7ce3e34 100644 --- a/include/hw/m68k/next-cube.h +++ b/include/hw/m68k/next-cube.h @@ -4,4 +4,6 @@ =20 #define TYPE_NEXTFB "next-fb" =20 +#define TYPE_NEXTKBD "next-kbd" + #endif /* NEXT_CUBE_H */ --=20 2.21.0 From nobody Thu May 2 05:00:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1567871430; cv=none; d=zoho.com; s=zohoarc; b=V51MvifUku319KD90tJk6DZQ0d86ooVkiZY4LRkXZAGl6dpr18PYn72fFkYcWpx53Db+lierdgMZzxqZoQkUbMyry8psn4wjx4WHzeiNGy7p49IwPhTm5qdVFVhK+ud3ZXB+M/VZIz1AceeKuwQrieNS8fOHan6RARHRdayeOpU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567871430; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=usmKU5lGN1SbRwJ0rrQVdI6hEqyoiAkZpAkJseEUNL0=; b=bPqz5tNNpTFaR8SwipWRi+Vxk1OoztYzUa2FjT3Rl7qpZTwaO8yjzhNklxNE0gK/spT6DQiHxw3+KtKxJWUwbWxOI2ksBFXuaoEbxW+WMxjnCNqnHuwMFGlmZ+XlylPLZ/C0kIYmcYRLLHPu04IN0IOCkOeBXHhzucw4Vv6HE5s= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1567871430270614.4147321332315; Sat, 7 Sep 2019 08:50:30 -0700 (PDT) Received: from localhost ([::1]:35770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6cyo-0005hc-RO for importer@patchew.org; Sat, 07 Sep 2019 11:50:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48807) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6cwS-0003n8-Jn for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:48:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i6cwO-0007iK-Kr for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:48:00 -0400 Received: from mail-wr1-f53.google.com ([209.85.221.53]:43248) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i6cwO-0007hT-9p for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:47:56 -0400 Received: by mail-wr1-f53.google.com with SMTP id q17so4746987wrx.10 for ; Sat, 07 Sep 2019 08:47:56 -0700 (PDT) Received: from thl530.multi.box (pD9E8385F.dip0.t-ipconnect.de. [217.232.56.95]) by smtp.gmail.com with ESMTPSA id s19sm17173418wrb.14.2019.09.07.08.47.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2019 08:47:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=usmKU5lGN1SbRwJ0rrQVdI6hEqyoiAkZpAkJseEUNL0=; b=c38ezk1RtUDDZX1/vqG1i6hxsYD18cdTMZpEa0fKLWanJIpU1jc+ZrjUi9lnBfjeME 3tYCo+qSZuQcVJFbsSA8d/yVFfqY5jeo8Nt1SZ8hTx6poswqWpi+E6Sp7CS3JE+vPMAf a3JyyDHXrC2w+UdtD0VeT+eREoQPay72kc9qSEy/+CsFk7arocoO1O5FjqQN3jGGP/Gi ETrEnlomEzNgWnGNUVyFMvmblwIZ5x1TWoxA0tmWAqy5fKmWtABZLnrOET9qfytMTpS+ sExqBcmKlL+nTJ7lvF6nqPPGcqgWkEIt8/F38judGqSqwCHhgiHN1swFBr6yaQm+PSFc QXBw== X-Gm-Message-State: APjAAAXfG/L74zIphlW7C+to8sS6yD07Ze0WInYIHjjPpJQjTNPJppcd 5mB5ZOkOKnCJ+v504JV4aNM= X-Google-Smtp-Source: APXvYqy7kqtAGCscVFd7knv+JXAR1ARZ4/yH/90QX0sxpchArQCdZrds2k2tEIdFg/73WHMNQBqbBg== X-Received: by 2002:a5d:6049:: with SMTP id j9mr10647655wrt.213.1567871274853; Sat, 07 Sep 2019 08:47:54 -0700 (PDT) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Sat, 7 Sep 2019 17:47:39 +0200 Message-Id: <20190907154744.4136-4-huth@tuxfamily.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190907154744.4136-1-huth@tuxfamily.org> References: <20190907154744.4136-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.221.53 Subject: [Qemu-devel] [PULL 3/8] m68k: Add NeXTcube machine 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" It is still quite incomplete (no SCSI, no floppy emulation, no network, etc.), but the firmware already shows up the debug monitor prompt in the framebuffer display, so at least the very basics are already working. This code has been taken from Bryce Lanham's GSoC 2011 NeXT branch at https://github.com/blanham/qemu-NeXT/blob/next-cube/hw/next-cube.c and altered quite a bit to fit the latest interface and coding conventions of the current QEMU. Tested-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20190831074519.32613-4-huth@tuxfamily.org> Signed-off-by: Thomas Huth --- hw/m68k/Makefile.objs | 2 +- hw/m68k/next-cube.c | 941 ++++++++++++++++++++++++++++++++++++ include/hw/m68k/next-cube.h | 38 ++ 3 files changed, 980 insertions(+), 1 deletion(-) create mode 100644 hw/m68k/next-cube.c diff --git a/hw/m68k/Makefile.objs b/hw/m68k/Makefile.objs index 688002cac1..f25854730d 100644 --- a/hw/m68k/Makefile.objs +++ b/hw/m68k/Makefile.objs @@ -1,3 +1,3 @@ obj-$(CONFIG_AN5206) +=3D an5206.o mcf5206.o obj-$(CONFIG_MCF5208) +=3D mcf5208.o mcf_intc.o -obj-$(CONFIG_NEXTCUBE) +=3D next-kbd.o +obj-$(CONFIG_NEXTCUBE) +=3D next-kbd.o next-cube.o diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c new file mode 100644 index 0000000000..530c6ac46a --- /dev/null +++ b/hw/m68k/next-cube.c @@ -0,0 +1,941 @@ +/* + * NeXT Cube System Driver + * + * Copyright (c) 2011 Bryce Lanham + * + * This code is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published + * by the Free Software Foundation; either version 2 of the License, + * or (at your option) any later version. + */ + +#include "qemu/osdep.h" +#include "exec/hwaddr.h" +#include "exec/address-spaces.h" +#include "sysemu/sysemu.h" +#include "sysemu/qtest.h" +#include "hw/hw.h" +#include "hw/m68k/next-cube.h" +#include "hw/boards.h" +#include "hw/loader.h" +#include "hw/scsi/esp.h" +#include "hw/sysbus.h" +#include "hw/char/escc.h" /* ZILOG 8530 Serial Emulation */ +#include "hw/block/fdc.h" +#include "qapi/error.h" +#include "ui/console.h" +#include "target/m68k/cpu.h" + +/* #define DEBUG_NEXT */ +#ifdef DEBUG_NEXT +#define DPRINTF(fmt, ...) \ + do { printf("NeXT: " fmt , ## __VA_ARGS__); } while (0) +#else +#define DPRINTF(fmt, ...) do { } while (0) +#endif + +#define TYPE_NEXT_MACHINE MACHINE_TYPE_NAME("next-cube") +#define NEXT_MACHINE(obj) OBJECT_CHECK(NeXTState, (obj), TYPE_NEXT_MACHINE) + +#define ENTRY 0x0100001e +#define RAM_SIZE 0x4000000 +#define ROM_FILE "Rev_2.5_v66.bin" + +typedef struct next_dma { + uint32_t csr; + + uint32_t saved_next; + uint32_t saved_limit; + uint32_t saved_start; + uint32_t saved_stop; + + uint32_t next; + uint32_t limit; + uint32_t start; + uint32_t stop; + + uint32_t next_initbuf; + uint32_t size; +} next_dma; + +typedef struct { + MachineState parent; + + uint32_t int_mask; + uint32_t int_status; + + uint8_t scsi_csr_1; + uint8_t scsi_csr_2; + next_dma dma[10]; + qemu_irq *scsi_irq; + qemu_irq scsi_dma; + qemu_irq scsi_reset; + qemu_irq *fd_irq; + + uint32_t scr1; + uint32_t scr2; + + uint8_t rtc_ram[32]; +} NeXTState; + +/* Thanks to NeXT forums for this */ +/* +static const uint8_t rtc_ram3[32] =3D { + 0x94, 0x0f, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfb, 0x6d, 0x00, 0x00, 0x7B, 0x00, + 0x00, 0x00, 0x65, 0x6e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x13 +}; +*/ +static const uint8_t rtc_ram2[32] =3D { + 0x94, 0x0f, 0x40, 0x03, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfb, 0x6d, 0x00, 0x00, 0x4b, 0x00, + 0x41, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x7e, +}; + +#define SCR2_RTCLK 0x2 +#define SCR2_RTDATA 0x4 +#define SCR2_TOBCD(x) (((x / 10) << 4) + (x % 10)) + +static void nextscr2_write(NeXTState *s, uint32_t val, int size) +{ + static int led; + static int phase; + static uint8_t old_scr2; + static uint8_t rtc_command; + static uint8_t rtc_value; + static uint8_t rtc_status =3D 0x90; + static uint8_t rtc_return; + uint8_t scr2_2; + + if (size =3D=3D 4) { + scr2_2 =3D (val >> 8) & 0xFF; + } else { + scr2_2 =3D val & 0xFF; + } + + if (val & 0x1) { + DPRINTF("fault!\n"); + led++; + if (led =3D=3D 10) { + DPRINTF("LED flashing, possible fault!\n"); + led =3D 0; + } + } + + if (scr2_2 & 0x1) { + /* DPRINTF("RTC %x phase %i\n", scr2_2, phase); */ + if (phase =3D=3D -1) { + phase =3D 0; + } + /* If we are in going down clock... do something */ + if (((old_scr2 & SCR2_RTCLK) !=3D (scr2_2 & SCR2_RTCLK)) && + ((scr2_2 & SCR2_RTCLK) =3D=3D 0)) { + if (phase < 8) { + rtc_command =3D (rtc_command << 1) | + ((scr2_2 & SCR2_RTDATA) ? 1 : 0); + } + if (phase >=3D 8 && phase < 16) { + rtc_value =3D (rtc_value << 1) | ((scr2_2 & SCR2_RTDATA) ?= 1 : 0); + + /* if we read RAM register, output RT_DATA bit */ + if (rtc_command <=3D 0x1F) { + scr2_2 =3D scr2_2 & (~SCR2_RTDATA); + if (s->rtc_ram[rtc_command] & (0x80 >> (phase - 8))) { + scr2_2 |=3D SCR2_RTDATA; + } + + rtc_return =3D (rtc_return << 1) | + ((scr2_2 & SCR2_RTDATA) ? 1 : 0); + } + /* read the status 0x30 */ + if (rtc_command =3D=3D 0x30) { + scr2_2 =3D scr2_2 & (~SCR2_RTDATA); + /* for now status =3D 0x98 (new rtc + FTU) */ + if (rtc_status & (0x80 >> (phase - 8))) { + scr2_2 |=3D SCR2_RTDATA; + } + + rtc_return =3D (rtc_return << 1) | + ((scr2_2 & SCR2_RTDATA) ? 1 : 0); + } + /* read the status 0x31 */ + if (rtc_command =3D=3D 0x31) { + scr2_2 =3D scr2_2 & (~SCR2_RTDATA); + /* for now 0x00 */ + if (0x00 & (0x80 >> (phase - 8))) { + scr2_2 |=3D SCR2_RTDATA; + } + rtc_return =3D (rtc_return << 1) | + ((scr2_2 & SCR2_RTDATA) ? 1 : 0); + } + + if ((rtc_command >=3D 0x20) && (rtc_command <=3D 0x2F)) { + scr2_2 =3D scr2_2 & (~SCR2_RTDATA); + /* for now 0x00 */ + time_t time_h =3D time(NULL); + struct tm *info =3D localtime(&time_h); + int ret =3D 0; + + switch (rtc_command) { + case 0x20: + ret =3D SCR2_TOBCD(info->tm_sec); + break; + case 0x21: + ret =3D SCR2_TOBCD(info->tm_min); + break; + case 0x22: + ret =3D SCR2_TOBCD(info->tm_hour); + break; + case 0x24: + ret =3D SCR2_TOBCD(info->tm_mday); + break; + case 0x25: + ret =3D SCR2_TOBCD((info->tm_mon + 1)); + break; + case 0x26: + ret =3D SCR2_TOBCD((info->tm_year - 100)); + break; + + } + + if (ret & (0x80 >> (phase - 8))) { + scr2_2 |=3D SCR2_RTDATA; + } + rtc_return =3D (rtc_return << 1) | + ((scr2_2 & SCR2_RTDATA) ? 1 : 0); + } + + } + + phase++; + if (phase =3D=3D 16) { + if (rtc_command >=3D 0x80 && rtc_command <=3D 0x9F) { + s->rtc_ram[rtc_command - 0x80] =3D rtc_value; + } + /* write to x30 register */ + if (rtc_command =3D=3D 0xB1) { + /* clear FTU */ + if (rtc_value & 0x04) { + rtc_status =3D rtc_status & (~0x18); + s->int_status =3D s->int_status & (~0x04); + } + } + } + } + } else { + /* else end or abort */ + phase =3D -1; + rtc_command =3D 0; + rtc_value =3D 0; + } + s->scr2 =3D val & 0xFFFF00FF; + s->scr2 |=3D scr2_2 << 8; + old_scr2 =3D scr2_2; +} + +static uint32_t mmio_readb(NeXTState *s, hwaddr addr) +{ + switch (addr) { + case 0xc000: + return (s->scr1 >> 24) & 0xFF; + case 0xc001: + return (s->scr1 >> 16) & 0xFF; + case 0xc002: + return (s->scr1 >> 8) & 0xFF; + case 0xc003: + return (s->scr1 >> 0) & 0xFF; + + case 0xd000: + return (s->scr2 >> 24) & 0xFF; + case 0xd001: + return (s->scr2 >> 16) & 0xFF; + case 0xd002: + return (s->scr2 >> 8) & 0xFF; + case 0xd003: + return (s->scr2 >> 0) & 0xFF; + case 0x14020: + DPRINTF("MMIO Read 0x4020\n"); + return 0x7f; + + default: + DPRINTF("MMIO Read B @ %"HWADDR_PRIx"\n", addr); + return 0x0; + } +} + +static uint32_t mmio_readw(NeXTState *s, hwaddr addr) +{ + switch (addr) { + default: + DPRINTF("MMIO Read W @ %"HWADDR_PRIx"\n", addr); + return 0x0; + } +} + +static uint32_t mmio_readl(NeXTState *s, hwaddr addr) +{ + switch (addr) { + case 0x7000: + /* DPRINTF("Read INT status: %x\n", s->int_status); */ + return s->int_status; + + case 0x7800: + DPRINTF("MMIO Read INT mask: %x\n", s->int_mask); + return s->int_mask; + + case 0xc000: + return s->scr1; + + case 0xd000: + return s->scr2; + + default: + DPRINTF("MMIO Read L @ %"HWADDR_PRIx"\n", addr); + return 0x0; + } +} + +static void mmio_writeb(NeXTState *s, hwaddr addr, uint32_t val) +{ + switch (addr) { + case 0xd003: + nextscr2_write(s, val, 1); + break; + default: + DPRINTF("MMIO Write B @ %x with %x\n", (unsigned int)addr, val); + } + +} + +static void mmio_writew(NeXTState *s, hwaddr addr, uint32_t val) +{ + DPRINTF("MMIO Write W\n"); +} + +static void mmio_writel(NeXTState *s, hwaddr addr, uint32_t val) +{ + switch (addr) { + case 0x7000: + DPRINTF("INT Status old: %x new: %x\n", s->int_status, val); + s->int_status =3D val; + break; + case 0x7800: + DPRINTF("INT Mask old: %x new: %x\n", s->int_mask, val); + s->int_mask =3D val; + break; + case 0xc000: + DPRINTF("SCR1 Write: %x\n", val); + break; + case 0xd000: + nextscr2_write(s, val, 4); + break; + + default: + DPRINTF("MMIO Write l @ %x with %x\n", (unsigned int)addr, val); + } +} + +static uint64_t mmio_readfn(void *opaque, hwaddr addr, unsigned size) +{ + NeXTState *ns =3D NEXT_MACHINE(opaque); + + switch (size) { + case 1: + return mmio_readb(ns, addr); + case 2: + return mmio_readw(ns, addr); + case 4: + return mmio_readl(ns, addr); + default: + g_assert_not_reached(); + } +} + +static void mmio_writefn(void *opaque, hwaddr addr, uint64_t value, + unsigned size) +{ + NeXTState *ns =3D NEXT_MACHINE(opaque); + + switch (size) { + case 1: + mmio_writeb(ns, addr, value); + break; + case 2: + mmio_writew(ns, addr, value); + break; + case 4: + mmio_writel(ns, addr, value); + break; + default: + g_assert_not_reached(); + } +} + +static const MemoryRegionOps mmio_ops =3D { + .read =3D mmio_readfn, + .write =3D mmio_writefn, + .valid.min_access_size =3D 1, + .valid.max_access_size =3D 4, + .endianness =3D DEVICE_NATIVE_ENDIAN, +}; + +static uint32_t scr_readb(NeXTState *s, hwaddr addr) +{ + switch (addr) { + case 0x14108: + DPRINTF("FD read @ %x\n", (unsigned int)addr); + return 0x40 | 0x04 | 0x2 | 0x1; + case 0x14020: + DPRINTF("SCSI 4020 STATUS READ %X\n", s->scsi_csr_1); + return s->scsi_csr_1; + + case 0x14021: + DPRINTF("SCSI 4021 STATUS READ %X\n", s->scsi_csr_2); + return 0x40; + + /* + * These 4 registers are the hardware timer, not sure which register + * is the latch instead of data, but no problems so far + */ + case 0x1a000: + return 0xff & (clock() >> 24); + case 0x1a001: + return 0xff & (clock() >> 16); + case 0x1a002: + return 0xff & (clock() >> 8); + case 0x1a003: + /* Hack: We need to have this change consistently to make it work = */ + return 0xFF & clock(); + + default: + DPRINTF("BMAP Read B @ %x\n", (unsigned int)addr); + return 0; + } +} + +static uint32_t scr_readw(NeXTState *s, hwaddr addr) +{ + DPRINTF("BMAP Read W @ %x\n", (unsigned int)addr); + return 0; +} + +static uint32_t scr_readl(NeXTState *s, hwaddr addr) +{ + DPRINTF("BMAP Read L @ %x\n", (unsigned int)addr); + return 0; +} + +#define SCSICSR_ENABLE 0x01 +#define SCSICSR_RESET 0x02 /* reset scsi dma */ +#define SCSICSR_FIFOFL 0x04 +#define SCSICSR_DMADIR 0x08 /* if set, scsi to mem */ +#define SCSICSR_CPUDMA 0x10 /* if set, dma enabled */ +#define SCSICSR_INTMASK 0x20 /* if set, interrupt enabled */ + +static void scr_writeb(NeXTState *s, hwaddr addr, uint32_t value) +{ + switch (addr) { + case 0x14108: + DPRINTF("FDCSR Write: %x\n", value); + + if (value =3D=3D 0x0) { + /* qemu_irq_raise(s->fd_irq[0]); */ + } + break; + case 0x14020: /* SCSI Control Register */ + if (value & SCSICSR_FIFOFL) { + DPRINTF("SCSICSR FIFO Flush\n"); + /* will have to add another irq to the esp if this is needed */ + /* esp_puflush_fifo(esp_g); */ + /* qemu_irq_pulse(s->scsi_dma); */ + } + + if (value & SCSICSR_ENABLE) { + DPRINTF("SCSICSR Enable\n"); + /* + * qemu_irq_raise(s->scsi_dma); + * s->scsi_csr_1 =3D 0xc0; + * s->scsi_csr_1 |=3D 0x1; + * qemu_irq_pulse(s->scsi_dma); + */ + } + /* + * else + * s->scsi_csr_1 &=3D ~SCSICSR_ENABLE; + */ + + if (value & SCSICSR_RESET) { + DPRINTF("SCSICSR Reset\n"); + /* I think this should set DMADIR. CPUDMA and INTMASK to 0 */ + /* qemu_irq_raise(s->scsi_reset); */ + /* s->scsi_csr_1 &=3D ~(SCSICSR_INTMASK |0x80|0x1); */ + + } + if (value & SCSICSR_DMADIR) { + DPRINTF("SCSICSR DMAdir\n"); + } + if (value & SCSICSR_CPUDMA) { + DPRINTF("SCSICSR CPUDMA\n"); + /* qemu_irq_raise(s->scsi_dma); */ + + s->int_status |=3D 0x4000000; + } else { + s->int_status &=3D ~(0x4000000); + } + if (value & SCSICSR_INTMASK) { + DPRINTF("SCSICSR INTMASK\n"); + /* + * int_mask &=3D ~0x1000; + * s->scsi_csr_1 |=3D value; + * s->scsi_csr_1 &=3D ~SCSICSR_INTMASK; + * if (s->scsi_queued) { + * s->scsi_queued =3D 0; + * next_irq(s, NEXT_SCSI_I, level); + * } + */ + } else { + /* int_mask |=3D 0x1000; */ + } + if (value & 0x80) { + /* int_mask |=3D 0x1000; */ + /* s->scsi_csr_1 |=3D 0x80; */ + } + DPRINTF("SCSICSR Write: %x\n", value); + /* s->scsi_csr_1 =3D value; */ + return; + /* Hardware timer latch - not implemented yet */ + case 0x1a000: + default: + DPRINTF("BMAP Write B @ %x with %x\n", (unsigned int)addr, value); + } +} + +static void scr_writew(NeXTState *s, hwaddr addr, uint32_t value) +{ + DPRINTF("BMAP Write W @ %x with %x\n", (unsigned int)addr, value); +} + +static void scr_writel(NeXTState *s, hwaddr addr, uint32_t value) +{ + DPRINTF("BMAP Write L @ %x with %x\n", (unsigned int)addr, value); +} + +static uint64_t scr_readfn(void *opaque, hwaddr addr, unsigned size) +{ + NeXTState *ns =3D NEXT_MACHINE(opaque); + + switch (size) { + case 1: + return scr_readb(ns, addr); + case 2: + return scr_readw(ns, addr); + case 4: + return scr_readl(ns, addr); + default: + g_assert_not_reached(); + } +} + +static void scr_writefn(void *opaque, hwaddr addr, uint64_t value, + unsigned size) +{ + NeXTState *ns =3D NEXT_MACHINE(opaque); + + switch (size) { + case 1: + scr_writeb(ns, addr, value); + break; + case 2: + scr_writew(ns, addr, value); + break; + case 4: + scr_writel(ns, addr, value); + break; + default: + g_assert_not_reached(); + } +} + +static const MemoryRegionOps scr_ops =3D { + .read =3D scr_readfn, + .write =3D scr_writefn, + .valid.min_access_size =3D 1, + .valid.max_access_size =3D 4, + .endianness =3D DEVICE_NATIVE_ENDIAN, +}; + +#define NEXTDMA_SCSI(x) (0x10 + x) +#define NEXTDMA_FD(x) (0x10 + x) +#define NEXTDMA_ENTX(x) (0x110 + x) +#define NEXTDMA_ENRX(x) (0x150 + x) +#define NEXTDMA_CSR 0x0 +#define NEXTDMA_NEXT 0x4000 +#define NEXTDMA_LIMIT 0x4004 +#define NEXTDMA_START 0x4008 +#define NEXTDMA_STOP 0x400c +#define NEXTDMA_NEXT_INIT 0x4200 +#define NEXTDMA_SIZE 0x4204 + +static void dma_writel(void *opaque, hwaddr addr, uint64_t value, + unsigned int size) +{ + NeXTState *next_state =3D NEXT_MACHINE(opaque); + + switch (addr) { + case NEXTDMA_ENRX(NEXTDMA_CSR): + if (value & DMA_DEV2M) { + next_state->dma[NEXTDMA_ENRX].csr |=3D DMA_DEV2M; + } + + if (value & DMA_SETENABLE) { + /* DPRINTF("SCSI DMA ENABLE\n"); */ + next_state->dma[NEXTDMA_ENRX].csr |=3D DMA_ENABLE; + } + if (value & DMA_SETSUPDATE) { + next_state->dma[NEXTDMA_ENRX].csr |=3D DMA_SUPDATE; + } + if (value & DMA_CLRCOMPLETE) { + next_state->dma[NEXTDMA_ENRX].csr &=3D ~DMA_COMPLETE; + } + + if (value & DMA_RESET) { + next_state->dma[NEXTDMA_ENRX].csr &=3D ~(DMA_COMPLETE | DMA_SU= PDATE | + DMA_ENABLE | DMA_DEV2M); + } + /* DPRINTF("RXCSR \tWrite: %x\n",value); */ + break; + case NEXTDMA_ENRX(NEXTDMA_NEXT_INIT): + next_state->dma[NEXTDMA_ENRX].next_initbuf =3D value; + break; + case NEXTDMA_ENRX(NEXTDMA_NEXT): + next_state->dma[NEXTDMA_ENRX].next =3D value; + break; + case NEXTDMA_ENRX(NEXTDMA_LIMIT): + next_state->dma[NEXTDMA_ENRX].limit =3D value; + break; + case NEXTDMA_SCSI(NEXTDMA_CSR): + if (value & DMA_DEV2M) { + next_state->dma[NEXTDMA_SCSI].csr |=3D DMA_DEV2M; + } + if (value & DMA_SETENABLE) { + /* DPRINTF("SCSI DMA ENABLE\n"); */ + next_state->dma[NEXTDMA_SCSI].csr |=3D DMA_ENABLE; + } + if (value & DMA_SETSUPDATE) { + next_state->dma[NEXTDMA_SCSI].csr |=3D DMA_SUPDATE; + } + if (value & DMA_CLRCOMPLETE) { + next_state->dma[NEXTDMA_SCSI].csr &=3D ~DMA_COMPLETE; + } + + if (value & DMA_RESET) { + next_state->dma[NEXTDMA_SCSI].csr &=3D ~(DMA_COMPLETE | DMA_SU= PDATE | + DMA_ENABLE | DMA_DEV2M); + /* DPRINTF("SCSI DMA RESET\n"); */ + } + /* DPRINTF("RXCSR \tWrite: %x\n",value); */ + break; + + case NEXTDMA_SCSI(NEXTDMA_NEXT): + next_state->dma[NEXTDMA_SCSI].next =3D value; + break; + + case NEXTDMA_SCSI(NEXTDMA_LIMIT): + next_state->dma[NEXTDMA_SCSI].limit =3D value; + break; + + case NEXTDMA_SCSI(NEXTDMA_START): + next_state->dma[NEXTDMA_SCSI].start =3D value; + break; + + case NEXTDMA_SCSI(NEXTDMA_STOP): + next_state->dma[NEXTDMA_SCSI].stop =3D value; + break; + + case NEXTDMA_SCSI(NEXTDMA_NEXT_INIT): + next_state->dma[NEXTDMA_SCSI].next_initbuf =3D value; + break; + + default: + DPRINTF("DMA write @ %x w/ %x\n", (unsigned)addr, (unsigned)value); + } +} + +static uint64_t dma_readl(void *opaque, hwaddr addr, unsigned int size) +{ + NeXTState *next_state =3D NEXT_MACHINE(opaque); + + switch (addr) { + case NEXTDMA_SCSI(NEXTDMA_CSR): + DPRINTF("SCSI DMA CSR READ\n"); + return next_state->dma[NEXTDMA_SCSI].csr; + case NEXTDMA_ENRX(NEXTDMA_CSR): + return next_state->dma[NEXTDMA_ENRX].csr; + case NEXTDMA_ENRX(NEXTDMA_NEXT_INIT): + return next_state->dma[NEXTDMA_ENRX].next_initbuf; + case NEXTDMA_ENRX(NEXTDMA_NEXT): + return next_state->dma[NEXTDMA_ENRX].next; + case NEXTDMA_ENRX(NEXTDMA_LIMIT): + return next_state->dma[NEXTDMA_ENRX].limit; + + case NEXTDMA_SCSI(NEXTDMA_NEXT): + return next_state->dma[NEXTDMA_SCSI].next; + case NEXTDMA_SCSI(NEXTDMA_NEXT_INIT): + return next_state->dma[NEXTDMA_SCSI].next_initbuf; + case NEXTDMA_SCSI(NEXTDMA_LIMIT): + return next_state->dma[NEXTDMA_SCSI].limit; + case NEXTDMA_SCSI(NEXTDMA_START): + return next_state->dma[NEXTDMA_SCSI].start; + case NEXTDMA_SCSI(NEXTDMA_STOP): + return next_state->dma[NEXTDMA_SCSI].stop; + + default: + DPRINTF("DMA read @ %x\n", (unsigned int)addr); + return 0; + } + + /* + * once the csr's are done, subtract 0x3FEC from the addr, and that wi= ll + * normalize the upper registers + */ +} + +static const MemoryRegionOps dma_ops =3D { + .read =3D dma_readl, + .write =3D dma_writel, + .impl.min_access_size =3D 4, + .valid.min_access_size =3D 4, + .valid.max_access_size =3D 4, + .endianness =3D DEVICE_NATIVE_ENDIAN, +}; + +/* + * TODO: set the shift numbers as values in the enum, so the first switch + * will not be needed + */ +void next_irq(void *opaque, int number, int level) +{ + M68kCPU *cpu =3D opaque; + int shift =3D 0; + NeXTState *ns =3D NEXT_MACHINE(qdev_get_machine()); + + /* first switch sets interupt status */ + /* DPRINTF("IRQ %i\n",number); */ + switch (number) { + /* level 3 - floppy, kbd/mouse, power, ether rx/tx, scsi, clock */ + case NEXT_FD_I: + shift =3D 7;; + break; + case NEXT_KBD_I: + shift =3D 3; + break; + case NEXT_PWR_I: + shift =3D 2; + break; + case NEXT_ENRX_I: + shift =3D 9; + break; + case NEXT_ENTX_I: + shift =3D 10; + break; + case NEXT_SCSI_I: + shift =3D 12; + break; + case NEXT_CLK_I: + shift =3D 5; + break; + + /* level 5 - scc (serial) */ + case NEXT_SCC_I: + shift =3D 17; + break; + + /* level 6 - audio etherrx/tx dma */ + case NEXT_ENTX_DMA_I: + shift =3D 28; + break; + case NEXT_ENRX_DMA_I: + shift =3D 27; + break; + case NEXT_SCSI_DMA_I: + shift =3D 26; + break; + case NEXT_SND_I: + shift =3D 23; + break; + case NEXT_SCC_DMA_I: + shift =3D 21; + break; + + } + /* + * this HAS to be wrong, the interrupt handlers in mach and together + * int_status and int_mask and return if there is a hit + */ + if (ns->int_mask & (1 << shift)) { + DPRINTF("%x interrupt masked @ %x\n", 1 << shift, cpu->env.pc); + /* return; */ + } + + /* second switch triggers the correct interrupt */ + if (level) { + ns->int_status |=3D 1 << shift; + + switch (number) { + /* level 3 - floppy, kbd/mouse, power, ether rx/tx, scsi, clock */ + case NEXT_FD_I: + case NEXT_KBD_I: + case NEXT_PWR_I: + case NEXT_ENRX_I: + case NEXT_ENTX_I: + case NEXT_SCSI_I: + case NEXT_CLK_I: + m68k_set_irq_level(cpu, 3, 27); + break; + + /* level 5 - scc (serial) */ + case NEXT_SCC_I: + m68k_set_irq_level(cpu, 5, 29); + break; + + /* level 6 - audio etherrx/tx dma */ + case NEXT_ENTX_DMA_I: + case NEXT_ENRX_DMA_I: + case NEXT_SCSI_DMA_I: + case NEXT_SND_I: + case NEXT_SCC_DMA_I: + m68k_set_irq_level(cpu, 6, 30); + break; + } + } else { + ns->int_status &=3D ~(1 << shift); + cpu_reset_interrupt(CPU(cpu), CPU_INTERRUPT_HARD); + } +} + +static void next_cube_init(MachineState *machine) +{ + M68kCPU *cpu; + CPUM68KState *env; + MemoryRegion *ram =3D g_new(MemoryRegion, 1); + MemoryRegion *rom =3D g_new(MemoryRegion, 1); + MemoryRegion *mmiomem =3D g_new(MemoryRegion, 1); + MemoryRegion *scrmem =3D g_new(MemoryRegion, 1); + MemoryRegion *dmamem =3D g_new(MemoryRegion, 1); + MemoryRegion *bmapm1 =3D g_new(MemoryRegion, 1); + MemoryRegion *bmapm2 =3D g_new(MemoryRegion, 1); + MemoryRegion *sysmem =3D get_system_memory(); + NeXTState *ns =3D NEXT_MACHINE(machine); + DeviceState *dev; + + /* Initialize the cpu core */ + cpu =3D M68K_CPU(cpu_create(machine->cpu_type)); + if (!cpu) { + error_report("Unable to find m68k CPU definition"); + exit(1); + } + env =3D &cpu->env; + + /* Initialize CPU registers. */ + env->vbr =3D 0; + env->sr =3D 0x2700; + + /* Set internal registers to initial values */ + /* 0x0000XX00 << vital bits */ + ns->scr1 =3D 0x00011102; + ns->scr2 =3D 0x00ff0c80; + + /* Load RTC RAM - TODO: provide possibility to load contents from file= */ + memcpy(ns->rtc_ram, rtc_ram2, 32); + + /* 64MB RAM starting at 0x04000000 */ + memory_region_allocate_system_memory(ram, NULL, "next.ram", ram_size); + memory_region_add_subregion(sysmem, 0x04000000, ram); + + /* Framebuffer */ + dev =3D qdev_create(NULL, TYPE_NEXTFB); + qdev_init_nofail(dev); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x0B000000); + + /* MMIO */ + memory_region_init_io(mmiomem, NULL, &mmio_ops, machine, "next.mmio", + 0xD0000); + memory_region_add_subregion(sysmem, 0x02000000, mmiomem); + + /* BMAP memory */ + memory_region_init_ram_shared_nomigrate(bmapm1, NULL, "next.bmapmem", = 64, + true, &error_fatal); + memory_region_add_subregion(sysmem, 0x020c0000, bmapm1); + /* The Rev_2.5_v66.bin firmware accesses it at 0x820c0020, too */ + memory_region_init_alias(bmapm2, NULL, "next.bmapmem2", bmapm1, 0x0, 6= 4); + memory_region_add_subregion(sysmem, 0x820c0000, bmapm2); + + /* BMAP IO - acts as a catch-all for now */ + memory_region_init_io(scrmem, NULL, &scr_ops, machine, "next.scr", + 0x20000); + memory_region_add_subregion(sysmem, 0x02100000, scrmem); + + /* KBD */ + dev =3D qdev_create(NULL, TYPE_NEXTKBD); + qdev_init_nofail(dev); + sysbus_mmio_map(SYS_BUS_DEVICE(dev), 0, 0x0200e000); + + /* Load ROM here */ + if (bios_name =3D=3D NULL) { + bios_name =3D ROM_FILE; + } + /* still not sure if the rom should also be mapped at 0x0*/ + memory_region_init_rom(rom, NULL, "next.rom", 0x20000, &error_fatal); + memory_region_add_subregion(sysmem, 0x01000000, rom); + if (load_image_targphys(bios_name, 0x01000000, 0x20000) < 8) { + if (!qtest_enabled()) { + error_report("Failed to load firmware '%s'.", bios_name); + } + } else { + uint8_t *ptr; + /* Initial PC is always at offset 4 in firmware binaries */ + ptr =3D rom_ptr(0x01000004, 4); + g_assert(ptr !=3D NULL); + env->pc =3D ldl_p(ptr); + if (env->pc >=3D 0x01020000) { + error_report("'%s' does not seem to be a valid firmware image.= ", + bios_name); + exit(1); + } + } + + /* TODO: */ + /* Serial */ + /* Network */ + /* SCSI */ + + /* DMA */ + memory_region_init_io(dmamem, NULL, &dma_ops, machine, "next.dma", 0x5= 000); + memory_region_add_subregion(sysmem, 0x02000000, dmamem); +} + +static void next_machine_class_init(ObjectClass *oc, void *data) +{ + MachineClass *mc =3D MACHINE_CLASS(oc); + + mc->desc =3D "NeXT Cube"; + mc->init =3D next_cube_init; + mc->default_ram_size =3D RAM_SIZE; + mc->default_cpu_type =3D M68K_CPU_TYPE_NAME("m68040"); +} + +static const TypeInfo next_typeinfo =3D { + .name =3D TYPE_NEXT_MACHINE, + .parent =3D TYPE_MACHINE, + .class_init =3D next_machine_class_init, + .instance_size =3D sizeof(NeXTState), +}; + +static void next_register_type(void) +{ + type_register_static(&next_typeinfo); +} + +type_init(next_register_type) diff --git a/include/hw/m68k/next-cube.h b/include/hw/m68k/next-cube.h index 37f7ce3e34..a3be2b32ab 100644 --- a/include/hw/m68k/next-cube.h +++ b/include/hw/m68k/next-cube.h @@ -6,4 +6,42 @@ =20 #define TYPE_NEXTKBD "next-kbd" =20 +enum next_dma_chan { + NEXTDMA_FD, + NEXTDMA_ENRX, + NEXTDMA_ENTX, + NEXTDMA_SCSI, + NEXTDMA_SCC, + NEXTDMA_SND +}; + +#define DMA_ENABLE 0x01000000 +#define DMA_SUPDATE 0x02000000 +#define DMA_COMPLETE 0x08000000 + +#define DMA_M2DEV 0x0 +#define DMA_SETENABLE 0x00010000 +#define DMA_SETSUPDATE 0x00020000 +#define DMA_DEV2M 0x00040000 +#define DMA_CLRCOMPLETE 0x00080000 +#define DMA_RESET 0x00100000 + +enum next_irqs { + NEXT_FD_I, + NEXT_KBD_I, + NEXT_PWR_I, + NEXT_ENRX_I, + NEXT_ENTX_I, + NEXT_SCSI_I, + NEXT_CLK_I, + NEXT_SCC_I, + NEXT_ENTX_DMA_I, + NEXT_ENRX_DMA_I, + NEXT_SCSI_DMA_I, + NEXT_SCC_DMA_I, + NEXT_SND_I +}; + +void next_irq(void *opaque, int number, int level); + #endif /* NEXT_CUBE_H */ --=20 2.21.0 From nobody Thu May 2 05:00:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1567871426; cv=none; d=zoho.com; s=zohoarc; b=fnsz54AgdWahXW/GZMhF+JwtBFMF8wiUM+Kxd7FW9E2zssleQpp/aQW89NyVNTL3Q/tJlGlcSjXMW0b3Is86ORnlQO2Il/yIHbK6YRmblM/eu7VzfvSqxx8emjh+mx3qatkTouwbikDNv04hzb8lbnttbYiTEQPA/72iJXeQN+g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567871426; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=gPC/iaasD4XtjfEeV3SmRnKdOOaU73cKcFnYiqh/4z0=; b=eP+WZKTk4/g6ODUr1Z438XEDW4ApXItBhEIjNYiBbKz9MiAMXTdKvyxfPAguGfjw7Roosz4c52r+933FVw/XfG3Jbm58/Z/peGBU7G2MSP4/A18s4DU5uRi2NG679fnUAomQChgrUfOVrROZrObxyoWC8XvULxcLNTLJ3GkWiyA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1567871426456647.3685966135812; Sat, 7 Sep 2019 08:50:26 -0700 (PDT) Received: from localhost ([::1]:35768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6cyi-0005VW-5E for importer@patchew.org; Sat, 07 Sep 2019 11:50:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48763) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6cwQ-0003k4-55 for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:47:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i6cwO-0007iP-L0 for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:47:58 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:33677) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i6cwO-0007hf-E2 for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:47:56 -0400 Received: by mail-wr1-f67.google.com with SMTP id u16so9510973wrr.0 for ; Sat, 07 Sep 2019 08:47:56 -0700 (PDT) Received: from thl530.multi.box (pD9E8385F.dip0.t-ipconnect.de. [217.232.56.95]) by smtp.gmail.com with ESMTPSA id s19sm17173418wrb.14.2019.09.07.08.47.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2019 08:47:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gPC/iaasD4XtjfEeV3SmRnKdOOaU73cKcFnYiqh/4z0=; b=nnGyowOoCPJoYGpQI+oVRopT+RHD4h3E/6LxYmYaA4vTayKQnESsTXpqR8kIhoCKnh 6SYl+JwIe9PzPOkLZ+4Y1223wLh/6kqqCDchZlf2iEBcBQ9ipSPuPKcXspnhFNoGWn83 IAx7Vh01MJc2r/bdzjzFzq26omOtn0CjeBiVasdJy3ZeZA/1uzvzcVnMViPbDfrMI/87 vzspFFdM54YQH/sOljwsa6/1eO8+2AHCDjJANBU61nDqzAAwR1vVeDVdyk51BVwv1+zN oVrL9KUJkSD/iQpeOTVbtWptU69XigoKlk8Kb/7E8YvYbuyY/pQjPNf7DvGJoSaBF7kv gaPQ== X-Gm-Message-State: APjAAAXDV6H3VhWLz/Fbn0mcp9towuUK8FnOYvQqFxznVvUqz37Z8ytw uBI4eiU7kJeGIVs7fa8taOU= X-Google-Smtp-Source: APXvYqzxJDJsiC+8asg4bOahtuuAXKjY3mycOh94gNHDgXVd0nwj/0P0UuPA7OZTGNDqtMk/Nk78Tg== X-Received: by 2002:a5d:5402:: with SMTP id g2mr12424695wrv.291.1567871275558; Sat, 07 Sep 2019 08:47:55 -0700 (PDT) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Sat, 7 Sep 2019 17:47:40 +0200 Message-Id: <20190907154744.4136-5-huth@tuxfamily.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190907154744.4136-1-huth@tuxfamily.org> References: <20190907154744.4136-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.221.67 Subject: [Qemu-devel] [PULL 4/8] escc: introduce a selector for the register bit 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Laurent Vivier On Sparc and PowerMac, the bit 0 of the address selects the register type (control or data) and bit 1 selects the channel (B or A). On m68k Macintosh and NeXTcube, the bit 0 selects the channel and bit 1 the register type. This patch introduces a new parameter (bit_swap) to the device interface to indicate bits usage must be swapped between registers and channels. For the moment all the machines use the bit 0, but this change will be needed to emulate the Quadra 800 or NeXTcube machine. Signed-off-by: Laurent Vivier Reviewed-by: Herv=C3=A9 Poussineau [thh: added NeXTcube to the patch description] Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20190831074519.32613-5-huth@tuxfamily.org> Signed-off-by: Thomas Huth --- hw/char/escc.c | 30 ++++++++++++++++++++++++------ include/hw/char/escc.h | 1 + 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/hw/char/escc.c b/hw/char/escc.c index e185522e27..8f7bf322cb 100644 --- a/hw/char/escc.c +++ b/hw/char/escc.c @@ -45,14 +45,21 @@ * mouse and keyboard ports don't implement all functions and they are * only asynchronous. There is no DMA. * - * Z85C30 is also used on PowerMacs. There are some small differences - * between Sparc version (sunzilog) and PowerMac (pmac): + * Z85C30 is also used on PowerMacs and m68k Macs. + * + * There are some small differences between Sparc version (sunzilog) + * and PowerMac (pmac): * Offset between control and data registers * There is some kind of lockup bug, but we can ignore it * CTS is inverted * DMA on pmac using DBDMA chip * pmac can do IRDA and faster rates, sunzilog can only do 38400 * pmac baud rate generator clock is 3.6864 MHz, sunzilog 4.9152 MHz + * + * Linux driver for m68k Macs is the same as for PowerMac (pmac_zilog), + * but registers are grouped by type and not by channel: + * channel is selected by bit 0 of the address (instead of bit 1) + * and register is selected by bit 1 of the address (instead of bit 0). */ =20 /* @@ -172,6 +179,16 @@ static void handle_kbd_command(ESCCChannelState *s, in= t val); static int serial_can_receive(void *opaque); static void serial_receive_byte(ESCCChannelState *s, int ch); =20 +static int reg_shift(ESCCState *s) +{ + return s->bit_swap ? s->it_shift + 1 : s->it_shift; +} + +static int chn_shift(ESCCState *s) +{ + return s->bit_swap ? s->it_shift : s->it_shift + 1; +} + static void clear_queue(void *opaque) { ESCCChannelState *s =3D opaque; @@ -436,8 +453,8 @@ static void escc_mem_write(void *opaque, hwaddr addr, int newreg, channel; =20 val &=3D 0xff; - saddr =3D (addr >> serial->it_shift) & 1; - channel =3D (addr >> (serial->it_shift + 1)) & 1; + saddr =3D (addr >> reg_shift(serial)) & 1; + channel =3D (addr >> chn_shift(serial)) & 1; s =3D &serial->chn[channel]; switch (saddr) { case SERIAL_CTRL: @@ -547,8 +564,8 @@ static uint64_t escc_mem_read(void *opaque, hwaddr addr, uint32_t ret; int channel; =20 - saddr =3D (addr >> serial->it_shift) & 1; - channel =3D (addr >> (serial->it_shift + 1)) & 1; + saddr =3D (addr >> reg_shift(serial)) & 1; + channel =3D (addr >> chn_shift(serial)) & 1; s =3D &serial->chn[channel]; switch (saddr) { case SERIAL_CTRL: @@ -832,6 +849,7 @@ static void escc_realize(DeviceState *dev, Error **errp) static Property escc_properties[] =3D { DEFINE_PROP_UINT32("frequency", ESCCState, frequency, 0), DEFINE_PROP_UINT32("it_shift", ESCCState, it_shift, 0), + DEFINE_PROP_BOOL("bit_swap", ESCCState, bit_swap, false), DEFINE_PROP_UINT32("disabled", ESCCState, disabled, 0), DEFINE_PROP_UINT32("chnBtype", ESCCState, chn[0].type, 0), DEFINE_PROP_UINT32("chnAtype", ESCCState, chn[1].type, 0), diff --git a/include/hw/char/escc.h b/include/hw/char/escc.h index d5196c53e6..794b653484 100644 --- a/include/hw/char/escc.h +++ b/include/hw/char/escc.h @@ -51,6 +51,7 @@ typedef struct ESCCState { =20 struct ESCCChannelState chn[2]; uint32_t it_shift; + bool bit_swap; MemoryRegion mmio; uint32_t disabled; uint32_t frequency; --=20 2.21.0 From nobody Thu May 2 05:00:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1567871709; cv=none; d=zoho.com; s=zohoarc; b=dyzEi2lhh9pDDr8+0EqavkzPKQksyZBQfyD8hgxnvMNOlptCBofFmDczlttlprIF8RyUXOxMGexnjUybDILnbkqaWK2H7tn5DozKh8GW5WZQsNm+2A0br/6iqPwZpg1s4iJ8v8+WV6e9OV+xZvJqbP3I3/kihTCK8hEjeLG0ELQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567871709; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=O1nN3uC4WpvEZuW8S1GCd9d83+rwXs1Y8D8aDlJkNMA=; b=c54SUdnybbiNHXmZnpjDRmAI2+NSY3a/iL1GLxWRKH35vew77LcKKmJce3GfSNFmgLtGs/9Ru14lLOIC0xEzB5VnJfeSbhCGPj/YpByXfUG8lGUFvLROTYvvnGEasJp1lQ3MynCs3bUV6sCL6YxsDq8FucOov6mGbNScDqvwSmY= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1567871709919841.5271127015667; Sat, 7 Sep 2019 08:55:09 -0700 (PDT) Received: from localhost ([::1]:35812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6d3M-0002Wm-RZ for importer@patchew.org; Sat, 07 Sep 2019 11:55:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48783) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6cwR-0003lK-85 for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:48:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i6cwP-0007j9-GM for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:47:59 -0400 Received: from mail-wr1-f42.google.com ([209.85.221.42]:38633) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i6cwP-0007iG-6i for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:47:57 -0400 Received: by mail-wr1-f42.google.com with SMTP id l11so9467954wrx.5 for ; Sat, 07 Sep 2019 08:47:57 -0700 (PDT) Received: from thl530.multi.box (pD9E8385F.dip0.t-ipconnect.de. [217.232.56.95]) by smtp.gmail.com with ESMTPSA id s19sm17173418wrb.14.2019.09.07.08.47.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2019 08:47:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O1nN3uC4WpvEZuW8S1GCd9d83+rwXs1Y8D8aDlJkNMA=; b=qvhh05meb6O/Mk53dBJnos4ix7F0xtDUWYs8/e1kgY4YNTVW8Dc40VLV4hcTVSWvmg 7950XpPXVQ6BykF2BKsYZQ5asJy+9mIECP8Fm3iTLdm0tNKMGVV4cGpzgrlWH2yRCm32 sv7sq6wyqSHLD6+2sJnMR6lNdLnc/eqYjs/OVP+BME7/LEtZCfiX0KjrJux8WniUl0Rl BxnLOTpz/1YwyabYgd+s261t4WxnM0Cg9jjWTu4urQFNX5XsMDer1yxgi8o9ebFJdnaB CFgEcJL1iG0AlrjLWfVsWB2KgLNJZxWNLYZ37mZTmIdvjv5V+0LDybQrCcPUA8m75E6N KaHg== X-Gm-Message-State: APjAAAVPj08xjjyIbcZLwkv2HRdoPtWhNqUlokwZrXEMZdCIZGC0Tmcu a+OaR+Yo4XKwfJSL9vi9Wws= X-Google-Smtp-Source: APXvYqzPoPiGUJA63YPiTAtNmzOAWSWlgdsdhP45F+Ef81CkNI61YVzNFtTHBfk+z8DC5qigOBdr3Q== X-Received: by 2002:a05:6000:82:: with SMTP id m2mr6830149wrx.241.1567871276240; Sat, 07 Sep 2019 08:47:56 -0700 (PDT) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Sat, 7 Sep 2019 17:47:41 +0200 Message-Id: <20190907154744.4136-6-huth@tuxfamily.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190907154744.4136-1-huth@tuxfamily.org> References: <20190907154744.4136-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.221.42 Subject: [Qemu-devel] [PULL 5/8] m68k: Add serial controller to the NeXTcube machine 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" The NeXTcube uses a normal 8530 serial controller, so we can simply use our normal "escc" device here. While we're at it, also add a boot-serial-test for the next-cube machine, now that the serial output works. Tested-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20190831074519.32613-6-huth@tuxfamily.org> Signed-off-by: Thomas Huth --- hw/m68k/Kconfig | 1 + hw/m68k/next-cube.c | 41 ++++++++++++++++++++++++++++++++++++++-- tests/boot-serial-test.c | 12 ++++++++++++ 3 files changed, 52 insertions(+), 2 deletions(-) diff --git a/hw/m68k/Kconfig b/hw/m68k/Kconfig index ec58a2eb06..a74fac5abd 100644 --- a/hw/m68k/Kconfig +++ b/hw/m68k/Kconfig @@ -11,3 +11,4 @@ config MCF5208 config NEXTCUBE bool select FRAMEBUFFER + select ESCC diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 530c6ac46a..9a4a7328f9 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -10,11 +10,12 @@ */ =20 #include "qemu/osdep.h" +#include "cpu.h" #include "exec/hwaddr.h" #include "exec/address-spaces.h" #include "sysemu/sysemu.h" #include "sysemu/qtest.h" -#include "hw/hw.h" +#include "hw/irq.h" #include "hw/m68k/next-cube.h" #include "hw/boards.h" #include "hw/loader.h" @@ -22,6 +23,7 @@ #include "hw/sysbus.h" #include "hw/char/escc.h" /* ZILOG 8530 Serial Emulation */ #include "hw/block/fdc.h" +#include "hw/qdev-properties.h" #include "qapi/error.h" #include "ui/console.h" #include "target/m68k/cpu.h" @@ -815,6 +817,39 @@ void next_irq(void *opaque, int number, int level) } } =20 +static void next_serial_irq(void *opaque, int n, int level) +{ + /* DPRINTF("SCC IRQ NUM %i\n",n); */ + if (n) { + next_irq(opaque, NEXT_SCC_DMA_I, level); + } else { + next_irq(opaque, NEXT_SCC_I, level); + } +} + +static void next_escc_init(M68kCPU *cpu) +{ + qemu_irq *ser_irq =3D qemu_allocate_irqs(next_serial_irq, cpu, 2); + DeviceState *dev; + SysBusDevice *s; + + dev =3D qdev_create(NULL, TYPE_ESCC); + qdev_prop_set_uint32(dev, "disabled", 0); + qdev_prop_set_uint32(dev, "frequency", 9600 * 384); + qdev_prop_set_uint32(dev, "it_shift", 0); + qdev_prop_set_bit(dev, "bit_swap", true); + qdev_prop_set_chr(dev, "chrB", serial_hd(1)); + qdev_prop_set_chr(dev, "chrA", serial_hd(0)); + qdev_prop_set_uint32(dev, "chnBtype", escc_serial); + qdev_prop_set_uint32(dev, "chnAtype", escc_serial); + qdev_init_nofail(dev); + + s =3D SYS_BUS_DEVICE(dev); + sysbus_connect_irq(s, 0, ser_irq[0]); + sysbus_connect_irq(s, 1, ser_irq[1]); + sysbus_mmio_map(s, 0, 0x2118000); +} + static void next_cube_init(MachineState *machine) { M68kCPU *cpu; @@ -906,8 +941,10 @@ static void next_cube_init(MachineState *machine) } } =20 - /* TODO: */ /* Serial */ + next_escc_init(cpu); + + /* TODO: */ /* Network */ /* SCSI */ =20 diff --git a/tests/boot-serial-test.c b/tests/boot-serial-test.c index a54d007298..d3a54a0ba5 100644 --- a/tests/boot-serial-test.c +++ b/tests/boot-serial-test.c @@ -24,6 +24,17 @@ static const uint8_t kernel_mcf5208[] =3D { 0x60, 0xfa /* bra.s loop */ }; =20 +static const uint8_t bios_nextcube[] =3D { + 0x06, 0x00, 0x00, 0x00, /* Initial SP */ + 0x01, 0x00, 0x00, 0x08, /* Initial PC */ + 0x41, 0xf9, 0x02, 0x11, 0x80, 0x00, /* lea 0x02118000,%a0 */ + 0x10, 0x3c, 0x00, 0x54, /* move.b #'T',%d0 */ + 0x11, 0x7c, 0x00, 0x05, 0x00, 0x01, /* move.b #5,1(%a0) Sel TXC= TRL */ + 0x11, 0x7c, 0x00, 0x68, 0x00, 0x01, /* move.b #0x68,1(%a0) Enable = TX */ + 0x11, 0x40, 0x00, 0x03, /* move.b %d0,3(%a0) Print '= T' */ + 0x60, 0xfa /* bra.s loop */ +}; + static const uint8_t kernel_pls3adsp1800[] =3D { 0xb0, 0x00, 0x84, 0x00, /* imm 0x8400 */ 0x30, 0x60, 0x00, 0x04, /* addik r3,r0,4 */ @@ -117,6 +128,7 @@ static testdef_t tests[] =3D { { "sparc64", "sun4u", "", "UltraSPARC" }, { "s390x", "s390-ccw-virtio", "", "device" }, { "m68k", "mcf5208evb", "", "TT", sizeof(kernel_mcf5208), kernel_mcf52= 08 }, + { "m68k", "next-cube", "", "TT", sizeof(bios_nextcube), 0, bios_nextcu= be }, { "microblaze", "petalogix-s3adsp1800", "", "TT", sizeof(kernel_pls3adsp1800), kernel_pls3adsp1800 }, { "microblazeel", "petalogix-ml605", "", "TT", --=20 2.21.0 From nobody Thu May 2 05:00:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1567871635; cv=none; d=zoho.com; s=zohoarc; b=QobRcJXhw68JFd9CN6WDnXS911xt6EibR1pQraHn8FyXq/4WYyIYKIcvzIYWqiv86ihs6pfpqPJL226E4LSO8e/g50hZYJ7QLEVfkq+aJMnES12TkFL9Fa5tR++PMUcbpMAS46K7blJacATlYRm0MwGfpb9da+HyHd/uHM10eT0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567871635; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=lJY2KX4dMiks0ukBNUE6RTXhKVBOuRehxmM8BttWJBg=; b=F97C6zCeKDYS5FrceWhXfnuP2OdAYQvBKK7sqFcDQHGj4vxrXNcle9UDrZTZHqzEtPbH9lkmlmG/5c2t5k15+FAgk1Kk5usjfvGdUvBghaB4XvKiMiwyfFxyLDLlomiIwgzztahzYH8W1M+G5FV/8HAt2M0MoVnC2vOtWI968lA= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1567871635840333.7903948885181; Sat, 7 Sep 2019 08:53:55 -0700 (PDT) Received: from localhost ([::1]:35804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6d2A-0001XC-ML for importer@patchew.org; Sat, 07 Sep 2019 11:53:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48781) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6cwR-0003lH-7m for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:48:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i6cwQ-0007jf-2k for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:47:59 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:38809) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i6cwP-0007ir-Re for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:47:57 -0400 Received: by mail-wr1-f67.google.com with SMTP id l11so9467964wrx.5 for ; Sat, 07 Sep 2019 08:47:57 -0700 (PDT) Received: from thl530.multi.box (pD9E8385F.dip0.t-ipconnect.de. [217.232.56.95]) by smtp.gmail.com with ESMTPSA id s19sm17173418wrb.14.2019.09.07.08.47.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2019 08:47:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lJY2KX4dMiks0ukBNUE6RTXhKVBOuRehxmM8BttWJBg=; b=Xr7vKUiWvoIcHWMVjkuw2jeFnEkdCFDf1RNdewAOnDOy+h335958bKhVfOluEAACcb nxriXx+4enx8YfQAVG4K/y7WIw/dumdzjYtRPoEXcjf/PYJYcEZY/NL4lqDIYbdfYk7H +rc3bmi2X8LHi/33L81RRCI/e04RC3dsq4IyT2d52gohbACDhk7Hdid0JL77zYvo0IJ3 UrM80Wf1lsAUrzzDuNm0X/RXeCFY7dpubXBPTPdbMMd5Rj3ITui2fjzB1qY6lGXwaY+A rkFc4t1LE3ws2eL48H1yjjhar6k1Jv+NQsCalqRQ+bPW3CY6xrRKGvCvY1dcJmcacMrS Smdw== X-Gm-Message-State: APjAAAVIaPeNehwOFUpYiWYXwxUZ+IzfDNxpqnfYsIIY4WB2PPnP3m5i FvaJoQsYBVcS+q0pC/fuK/8= X-Google-Smtp-Source: APXvYqwVw07TpKPlsWR6f48IID8eUztL+pz/qJjFKfmBGzjOO7+RR+PyBroJehFiK30PTyB7+os0+w== X-Received: by 2002:a05:6000:11cb:: with SMTP id i11mr11928200wrx.171.1567871276993; Sat, 07 Sep 2019 08:47:56 -0700 (PDT) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Sat, 7 Sep 2019 17:47:42 +0200 Message-Id: <20190907154744.4136-7-huth@tuxfamily.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190907154744.4136-1-huth@tuxfamily.org> References: <20190907154744.4136-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.221.67 Subject: [Qemu-devel] [PULL 6/8] m68k: Add an entry for the NeXTcube machine to the MAINTAINERS file 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" I don't have much clue about the NeXT hardware, but at least I know now the source files a little bit, so I volunteer to pick up patches and send PULL requests for them until someone else with more knowledge steps up to do this job instead. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20190831074519.32613-7-huth@tuxfamily.org> Signed-off-by: Thomas Huth --- MAINTAINERS | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 65d8a7c2d2..50eaf005f4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -910,6 +910,13 @@ F: hw/char/mcf_uart.c F: hw/net/mcf_fec.c F: include/hw/m68k/mcf*.h =20 +NeXTcube +M: Thomas Huth +S: Odd Fixes +F: hw/m68k/next-*.c +F: hw/display/next-fb.c +F: include/hw/m68k/next-cube.h + MicroBlaze Machines ------------------- petalogix_s3adsp1800 --=20 2.21.0 From nobody Thu May 2 05:00:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1567871798; cv=none; d=zoho.com; s=zohoarc; b=ScaaV962N0ApOp1JcP3SYypO4YP6ybdmcrcn1BfSrxwjrQ2Imw2xE8yjUiqmtWRJ3XhWBy62ccI2PHVDlrYQ03posdJje4t47pwv2kfzTi24++8nZ87L9j51Kg1VDQyyzi8jWTZX5X9cvht2Z3scrOQap0KJ1QTc+pjymR6A594= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567871798; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=3/MAIxhVMjzHPxk6i+ZNE+2r2ZgoAuT7WenvBxcwPkY=; b=NDibXPGM37XKp/QKdeNgqwdKJc6/yjEylv4gWhxaTpeGDSvO3Xk+NTMHQIzznbuN4pk89LWeeB/2iLWHeAv9Zuer0q2ic1ZiXft5ZpddpiLRTj+J886J4XrWHh5SEUzsK/iF5SoBbIMuzq/iOnMbetrslgO4ynnBK2eE1U9x4t0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1567871798436537.3636595937766; Sat, 7 Sep 2019 08:56:38 -0700 (PDT) Received: from localhost ([::1]:35830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6d4i-0003hD-6I for importer@patchew.org; Sat, 07 Sep 2019 11:56:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48813) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6cwT-0003o0-2v for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:48:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i6cwR-0007kg-7Z for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:48:00 -0400 Received: from mail-wr1-f54.google.com ([209.85.221.54]:44354) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i6cwQ-0007jv-TT for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:47:59 -0400 Received: by mail-wr1-f54.google.com with SMTP id 30so9437694wrk.11 for ; Sat, 07 Sep 2019 08:47:58 -0700 (PDT) Received: from thl530.multi.box (pD9E8385F.dip0.t-ipconnect.de. [217.232.56.95]) by smtp.gmail.com with ESMTPSA id s19sm17173418wrb.14.2019.09.07.08.47.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2019 08:47:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3/MAIxhVMjzHPxk6i+ZNE+2r2ZgoAuT7WenvBxcwPkY=; b=MJyEucwEEhEh7Et/+RBPSUokCDpTv0/jvoeUhOdSXMElirgr90SoKSzdiKeEnvYgAC hB02tXlgAO5pp3lcjlyIQJ0EB18sCyk5xcCUgU0jh02llB+IHJekMCOui3+QDE+sBZet G88cYWNKAiuj6xvWIs1UaS87ZaeXMjiIF9FWtjzkPTBGbgyn+rNp7As2/uSXXpVm74fQ 0ufmTRgf4oGwAnvlo/f+aw7ckNUfbYLK0Oz2p6NkbNLRei9lubCFd3bC3/srFtJlFwXd Z8nib4wWAAh4XfUkFjz7CASfdRjTwNHTA1zS0ZZnn6Q2l4APLWmniT8JgmYfCXXoaUL5 3bEQ== X-Gm-Message-State: APjAAAVw0yc2DgFR6BkKoawU6aji/PtWA9MCmNVPEMMPGPGSgFUWaRSA S17spF6nDrD7tCcXq8uPJm0= X-Google-Smtp-Source: APXvYqxccI2ATjfH/E3hDu4P8eE+Q+iTrHjMwqSF0ATmzVO/bnmgmM2p7WIb7UPIot53TReApu2MDQ== X-Received: by 2002:a5d:46c4:: with SMTP id g4mr10825226wrs.189.1567871277815; Sat, 07 Sep 2019 08:47:57 -0700 (PDT) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Sat, 7 Sep 2019 17:47:43 +0200 Message-Id: <20190907154744.4136-8-huth@tuxfamily.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190907154744.4136-1-huth@tuxfamily.org> References: <20190907154744.4136-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.221.54 Subject: [Qemu-devel] [PULL 7/8] tests/acceptance: Add test of NeXTcube framebuffer using OCR 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daud=C3=A9 Add a test of the NeXTcube framebuffer using the Tesseract OCR engine on a screenshot of the framebuffer device. The test is very quick: $ avocado --show=3Dapp,console run tests/acceptance/machine_m68k_nextcube= .py JOB ID : 78844a92424cc495bd068c3874d542d1e20f24bc JOB LOG : /home/phil/avocado/job-results/job-2019-08-13T13.16-78844a9/= job.log (1/3) tests/acceptance/machine_m68k_nextcube.py:NextCubeMachine.test_boo= trom_framebuffer_size: PASS (2.16 s) (2/3) tests/acceptance/machine_m68k_nextcube.py:NextCubeMachine.test_boo= trom_framebuffer_ocr_with_tesseract_v3: - ue r pun Honl'=EF=AC=82x ; 5=E2=80=98 55=E2=80=98 avg ncaaaaa 25 MHZ, memary jag m Backplane slat =C2=ABa Ethernet address a a r a r3 2 Memgry sackets aea canflqured far 16MB Darlly page made stMs but have 16M= B page made stMs )nstalled Memgry sackets a and 1 canflqured far 16MB Darlly page made stMs but have= 16MB page made stMs )nstalled [...] Yestlnq the rpu, 5:: system test raneg Errar egge 51 Egg: cammand Default pggc devlce nut fauna NEXY>I PASS (2.64 s) (3/3) tests/acceptance/machine_m68k_nextcube.py:NextCubeMachine.test_boo= trom_framebuffer_ocr_with_tesseract_v4: SKIP: tesseract v4 OCR tool not ava= ilable RESULTS : PASS 2 | ERROR 0 | FAIL 0 | SKIP 1 | WARN 0 | INTERRUPT 0 | = CANCEL 0 JOB TIME : 5.35 s Documentation on how to install tesseract: https://github.com/tesseract-ocr/tesseract/wiki#installation Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20190813134921.30602-2-philmd@redhat.com> Signed-off-by: Thomas Huth --- tests/acceptance/machine_m68k_nextcube.py | 121 ++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 tests/acceptance/machine_m68k_nextcube.py diff --git a/tests/acceptance/machine_m68k_nextcube.py b/tests/acceptance/m= achine_m68k_nextcube.py new file mode 100644 index 0000000000..e09cab9f20 --- /dev/null +++ b/tests/acceptance/machine_m68k_nextcube.py @@ -0,0 +1,121 @@ +# Functional test that boots a VM and run OCR on the framebuffer +# +# Copyright (c) Philippe Mathieu-Daud=C3=A9 +# +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. + +import os +import re +import time +import logging +import distutils.spawn + +from avocado_qemu import Test +from avocado import skipUnless +from avocado.utils import process +from avocado.utils.path import find_command, CmdNotFoundError + +PIL_AVAILABLE =3D True +try: + from PIL import Image +except ImportError: + PIL_AVAILABLE =3D False + + +def tesseract_available(expected_version): + try: + find_command('tesseract') + except CmdNotFoundError: + return False + res =3D process.run('tesseract --version') + try: + version =3D res.stdout_text.split()[1] + except IndexError: + version =3D res.stderr_text.split()[1] + return int(version.split('.')[0]) =3D=3D expected_version + + match =3D re.match(r'tesseract\s(\d)', res) + if match is None: + return False + # now this is guaranteed to be a digit + return int(match.groups()[0]) =3D=3D expected_version + + +class NextCubeMachine(Test): + + timeout =3D 15 + + def check_bootrom_framebuffer(self, screenshot_path): + rom_url =3D ('http://www.nextcomputers.org/NeXTfiles/Software/ROM_= Files/' + '68040_Non-Turbo_Chipset/Rev_2.5_v66.BIN') + rom_hash =3D 'b3534796abae238a0111299fc406a9349f7fee24' + rom_path =3D self.fetch_asset(rom_url, asset_hash=3Drom_hash) + + self.vm.set_machine('next-cube') + self.vm.add_args('-bios', rom_path) + self.vm.launch() + + self.log.info('VM launched, waiting for display') + # TODO: Use avocado.utils.wait.wait_for to catch the + # 'displaysurface_create 1120x832' trace-event. + time.sleep(2) + + self.vm.command('human-monitor-command', + command_line=3D'screendump %s' % screenshot_path) + + @skipUnless(PIL_AVAILABLE, 'Python PIL not installed') + def test_bootrom_framebuffer_size(self): + """ + :avocado: tags=3Darch:m68k + :avocado: tags=3Dmachine:next_cube + :avocado: tags=3Ddevice:framebuffer + """ + screenshot_path =3D os.path.join(self.workdir, "dump.png") + self.check_bootrom_framebuffer(screenshot_path) + + width, height =3D Image.open(screenshot_path).size + self.assertEqual(width, 1120) + self.assertEqual(height, 832) + + @skipUnless(tesseract_available(3), 'tesseract v3 OCR tool not availab= le') + def test_bootrom_framebuffer_ocr_with_tesseract_v3(self): + """ + :avocado: tags=3Darch:m68k + :avocado: tags=3Dmachine:next_cube + :avocado: tags=3Ddevice:framebuffer + """ + screenshot_path =3D os.path.join(self.workdir, "dump.png") + self.check_bootrom_framebuffer(screenshot_path) + + console_logger =3D logging.getLogger('console') + text =3D process.run("tesseract %s stdout" % screenshot_path).stdo= ut_text + for line in text.split('\n'): + if len(line): + console_logger.debug(line) + self.assertIn('Backplane', text) + self.assertIn('Ethernet address', text) + + # Tesseract 4 adds a new OCR engine based on LSTM neural networks. The + # new version is faster and more accurate than version 3. The drawback= is + # that it is still alpha-level software. + @skipUnless(tesseract_available(4), 'tesseract v4 OCR tool not availab= le') + def test_bootrom_framebuffer_ocr_with_tesseract_v4(self): + """ + :avocado: tags=3Darch:m68k + :avocado: tags=3Dmachine:next_cube + :avocado: tags=3Ddevice:framebuffer + """ + screenshot_path =3D os.path.join(self.workdir, "dump.png") + self.check_bootrom_framebuffer(screenshot_path) + + console_logger =3D logging.getLogger('console') + proc =3D process.run("tesseract --oem 1 %s stdout" % screenshot_pa= th) + text =3D proc.stdout_text + for line in text.split('\n'): + if len(line): + console_logger.debug(line) + self.assertIn('Testing the FPU, SCC', text) + self.assertIn('System test failed. Error code 51', text) + self.assertIn('Boot command', text) + self.assertIn('Next>', text) --=20 2.21.0 From nobody Thu May 2 05:00:20 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1567871548; cv=none; d=zoho.com; s=zohoarc; b=T+WM9Y2kv2/fGB7urB4a0+BZv+1EvulV4kzyzxk3yI0Olggq0W4NcfjePBh146m+c+2qR9QVaKZjfF6xS2PBq5Yi7Mm2BKtx18myVbrrqnvDpNt4nW3EHbbT06L3MAbhlH/kHl2vnFQuprhIWF/K484tgF6ssq22SMP0w6TxLek= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1567871548; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=2jdSbx0h06goM+ImaeVDWGxaOiMgDN9DDo/rfIrNBMs=; b=WW6KADhqg39ph1m4aceMQl/N3DzHslj4JF6Qc6NbaDCZx020OpTthwoIHz1bswRxMEHtxluZNnPeG/HkbfVCcfuPaj6cirPIfmeOTsABltJTNVcTCLSdwVw6pzg7Cryy3hvlUEOS0Rb5vA23uLNG8Xt9M7vZdr2JupLYO/lgpX0= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1567871548407895.6344601211622; Sat, 7 Sep 2019 08:52:28 -0700 (PDT) Received: from localhost ([::1]:35790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6d0l-0008TQ-B5 for importer@patchew.org; Sat, 07 Sep 2019 11:52:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48811) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i6cwS-0003no-WD for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:48:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i6cwR-0007l6-LK for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:48:00 -0400 Received: from mail-wr1-f47.google.com ([209.85.221.47]:45599) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i6cwR-0007kA-DU for qemu-devel@nongnu.org; Sat, 07 Sep 2019 11:47:59 -0400 Received: by mail-wr1-f47.google.com with SMTP id l16so9423230wrv.12 for ; Sat, 07 Sep 2019 08:47:59 -0700 (PDT) Received: from thl530.multi.box (pD9E8385F.dip0.t-ipconnect.de. [217.232.56.95]) by smtp.gmail.com with ESMTPSA id s19sm17173418wrb.14.2019.09.07.08.47.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Sep 2019 08:47:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2jdSbx0h06goM+ImaeVDWGxaOiMgDN9DDo/rfIrNBMs=; b=fVG90uJWr/Z0K4IlV4QC8+AArLO1I+LrxM/3/uN6OjQXjk+Mr4qLtzezzb/f4Aj0GM 6iD4dSqKQ7Pxo7CYq+vuabOjoUATlsu0MSAIHIz3ycP8No50bGVD3pA3hc87tlmOrmXJ 4t9KEkqyS3Vs7LSvZEkLRp3rG5wsUXV56JPendhkBp/cxAnQoCBKAaax1M+2ZidUYBWI coh6U8XUWQXq3kJKo5BKiho1vkSV0WNE+RgxxTsHrEDWncFlAzfcRTxwVYftzj3h00YQ S7ckgrppKwctI+l2vbOqHYkEmLHVW3oKKOFxylWsTMi4JF7excdPYx+R3B0Zsmaczhel mX8g== X-Gm-Message-State: APjAAAUZYUlqzwuYFJT1zLLUX2Nqs1QcCPGaXwEvzxda2UJMe/XWrvpV X0rhFlhGZDfhfHgFW912AJ5TVLkh X-Google-Smtp-Source: APXvYqzoz6gsUshQXQNmY2BLVuO+CGYnK9qQ4Z2Zv6IVm+Wa0phykY4HlCVAdCo3IYcLGhVCzOfzTg== X-Received: by 2002:a5d:6b0f:: with SMTP id v15mr10884118wrw.19.1567871278515; Sat, 07 Sep 2019 08:47:58 -0700 (PDT) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Date: Sat, 7 Sep 2019 17:47:44 +0200 Message-Id: <20190907154744.4136-9-huth@tuxfamily.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190907154744.4136-1-huth@tuxfamily.org> References: <20190907154744.4136-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.221.47 Subject: [Qemu-devel] [PULL 8/8] .travis.yml: Let the avocado job run the NeXTcube tests 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20190813134921.30602-3-philmd@redhat.com> [huth: Rebased patch to master branch] Signed-off-by: Thomas Huth --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 92b00927d4..106f9b5d01 100644 --- a/.travis.yml +++ b/.travis.yml @@ -232,15 +232,20 @@ matrix: =20 # Acceptance (Functional) tests - env: - - CONFIG=3D"--python=3D/usr/bin/python3 --target-list=3Dx86_64-sof= tmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmm= u,alpha-softmmu,ppc64-softmmu" + - CONFIG=3D"--python=3D/usr/bin/python3 --target-list=3Dx86_64-sof= tmmu,mips-softmmu,mips64el-softmmu,aarch64-softmmu,arm-softmmu,s390x-softmm= u,alpha-softmmu,ppc64-softmmu,m68k-softmmu" - TEST_CMD=3D"make check-acceptance" after_failure: - cat tests/results/latest/job.log addons: apt: packages: + - python3-pil - python3-pip - python3.5-venv + - tesseract-ocr + - tesseract-ocr-eng + + # Using newer GCC with sanitizers - addons: apt: --=20 2.21.0