From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 17354573068381023.7071908400886; Sat, 28 Dec 2024 23:28:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnh6-0006TU-7c; Sun, 29 Dec 2024 02:26:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRngz-0006Sc-Vz for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:30 -0500 Received: from mail-ej1-f49.google.com ([209.85.218.49]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRngy-00026c-CR for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:29 -0500 Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-aaee0b309adso766586666b.3 for ; Sat, 28 Dec 2024 23:26:28 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.26.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:26:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457187; x=1736061987; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qAtx5jrlA9KZeccpdqCh6rBdfWSP4VBSS5wQmXaUrf4=; b=FuTJX/NSrLQQ1RbikITnI5M+wZywnCKZ+M0iU11jH1wfggFPhE7Ss7VXuAqXeNfvZp vzYgLMA0X27JV88XQu2HDBrHl/ZfSEy0gTPl6m7BA37EosB64SEjMCLFlqRAf16ebwEf VLpW6k1aUS326/INQSj7KtnUOphmaxvWeyXwv9uAoW+oZLqB9N7o8wADm20jspeShS1b kC8VTStLezZXysJLvywuafTFReClS++6zc3zZ1u3IzuNey5BlZ7IqC7hzwRRSwmchnax FV0IWp5iijKvr2QhblN9c4BmwRiSfOG8/ZPu/XWN7bh13/Q6fz7kz3b/eZu6dFwbCWAF TZsg== X-Forwarded-Encrypted: i=1; AJvYcCUvXL0F/x8EzXNfUdNmyhv3vc+GVqtUyHMBUIoYWxBpoTg/qyT3rlcdX36+iyPlTjHv2H39LnkSJVEN@nongnu.org X-Gm-Message-State: AOJu0YylgAnIveAMsMret4mgtAJVlHoKhc1/x9t1c829O5QEDalHlXXj FAJckBt/lPJZKWEYu/OeguUSokq24MWHEekd0C+wrS4XWWkEWhfmOTSXXg== X-Gm-Gg: ASbGnctTV8RirMmy/P6Q0RyOsW5snWonMLti1FNiOo3GaDErDyFkEwvrTy5+ooWhmYB VnI2xt1VfR6tgrcWJYWXjYjgUlmmn2A4cN3NBJKrmdZwEgXSMIj6VBVCKBC+T8TzxADOIc9+beE PVKHI3QJxHcykACo0+UupeLoUJIuftrzGtKLNMf7y5rm4mTv479wYLwLXlzsHGp1jZIohvqBqkG a+jG67If9I4M/uS4yuXCFRFMrq5oIHPfJlYy/fllnK9dwcbUkSSSjPxa4OUjW1Efm7xwJWmj6gz o7Y= X-Google-Smtp-Source: AGHT+IF9uhpuvCwWKUdIhPoHRQfwSQwZsc1LWgTIExMDJJd73hVf5fqLjVx1KQxz1uIDtqZX2eaIfA== X-Received: by 2002:a17:907:2d8b:b0:aa6:6e41:ea53 with SMTP id a640c23a62f3a-aac271316a3mr3208956766b.7.1735457186535; Sat, 28 Dec 2024 23:26:26 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 01/35] hw/m68k: Mark devices as big-endian Date: Sun, 29 Dec 2024 08:24:52 +0100 Message-ID: <20241229072526.166555-2-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.49; envelope-from=th.huth@gmail.com; helo=mail-ej1-f49.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457307301116600 From: Philippe Mathieu-Daud=C3=A9 These devices are only used by the M68K target, which is only built as big-endian. Therefore the DEVICE_NATIVE_ENDIAN definition expand to DEVICE_BIG_ENDIAN (besides, the DEVICE_LITTLE_ENDIAN case isn't tested). Simplify directly using DEVICE_BIG_ENDIAN. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20241106184612.71897-4-philmd@linaro.org> Signed-off-by: Thomas Huth --- hw/m68k/mcf5206.c | 2 +- hw/m68k/mcf5208.c | 6 +++--- hw/m68k/mcf_intc.c | 2 +- hw/m68k/next-kbd.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/m68k/mcf5206.c b/hw/m68k/mcf5206.c index ef619cb9a4..c22e615f7a 100644 --- a/hw/m68k/mcf5206.c +++ b/hw/m68k/mcf5206.c @@ -582,7 +582,7 @@ static const MemoryRegionOps m5206_mbar_ops =3D { .write =3D m5206_mbar_writefn, .valid.min_access_size =3D 1, .valid.max_access_size =3D 4, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_BIG_ENDIAN, }; =20 static void mcf5206_mbar_realize(DeviceState *dev, Error **errp) diff --git a/hw/m68k/mcf5208.c b/hw/m68k/mcf5208.c index f290ccc739..409bb72574 100644 --- a/hw/m68k/mcf5208.c +++ b/hw/m68k/mcf5208.c @@ -155,7 +155,7 @@ static uint64_t m5208_timer_read(void *opaque, hwaddr a= ddr, static const MemoryRegionOps m5208_timer_ops =3D { .read =3D m5208_timer_read, .write =3D m5208_timer_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_BIG_ENDIAN, }; =20 static uint64_t m5208_sys_read(void *opaque, hwaddr addr, @@ -192,7 +192,7 @@ static void m5208_sys_write(void *opaque, hwaddr addr, static const MemoryRegionOps m5208_sys_ops =3D { .read =3D m5208_sys_read, .write =3D m5208_sys_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_BIG_ENDIAN, }; =20 static uint64_t m5208_rcm_read(void *opaque, hwaddr addr, @@ -224,7 +224,7 @@ static void m5208_rcm_write(void *opaque, hwaddr addr, static const MemoryRegionOps m5208_rcm_ops =3D { .read =3D m5208_rcm_read, .write =3D m5208_rcm_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_BIG_ENDIAN, }; =20 static void mcf5208_sys_init(MemoryRegion *address_space, qemu_irq *pic, diff --git a/hw/m68k/mcf_intc.c b/hw/m68k/mcf_intc.c index 008626f813..7b9213947d 100644 --- a/hw/m68k/mcf_intc.c +++ b/hw/m68k/mcf_intc.c @@ -166,7 +166,7 @@ static void mcf_intc_reset(DeviceState *dev) static const MemoryRegionOps mcf_intc_ops =3D { .read =3D mcf_intc_read, .write =3D mcf_intc_write, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_BIG_ENDIAN, }; =20 static void mcf_intc_instance_init(Object *obj) diff --git a/hw/m68k/next-kbd.c b/hw/m68k/next-kbd.c index dacc26413f..68b17786b2 100644 --- a/hw/m68k/next-kbd.c +++ b/hw/m68k/next-kbd.c @@ -162,7 +162,7 @@ static const MemoryRegionOps kbd_ops =3D { .write =3D kbd_writefn, .valid.min_access_size =3D 1, .valid.max_access_size =3D 4, - .endianness =3D DEVICE_NATIVE_ENDIAN, + .endianness =3D DEVICE_BIG_ENDIAN, }; =20 static const int qcode_to_nextkbd_keycode[] =3D { --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457625588893.0422136828518; Sat, 28 Dec 2024 23:33:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnhE-0006V6-S6; Sun, 29 Dec 2024 02:26:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnh2-0006T3-EB for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:34 -0500 Received: from mail-ej1-f46.google.com ([209.85.218.46]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnh1-000270-0Z for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:32 -0500 Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-aa6a618981eso1397254266b.3 for ; Sat, 28 Dec 2024 23:26:30 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.26.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:26:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457189; x=1736061989; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kPB4XNLstlc0AegxJ7G/7FURT7P2TWUfnqz8PPlgcsA=; b=YCN+NZKbC6O1x6tQNfVcZXjw3lGz4sNZa1oIyVvEHB3Y6GStRFf1wsqaiV+0ERu5tN ojWyIau1/I/NwloEylbHjwEmVuW4lC5DvX1ZuH1faR+4R6L4aAucpkSI0rcbbgCIzcmd sMdXH/YCZoeWuWsbrLHTMofPUo2UVqC1XC9JqWMMxprqaXUAcKYGBzX4HYzRlANZkyzP rJSNogZBiryDO2/B6COaYyhuFei8SeThqYyfA0BN2YqrCGloFibkjoRwyfUVxTJbmAdH i+KXS1G+TdH3FMCXY9cn5mPVByErhy43cRCOvRhTZ4LdpqbjypqWCiiI6Bghm6DmTSni vWLA== X-Forwarded-Encrypted: i=1; AJvYcCVu4CWAQp+VPLXQsE89ZNJyCt3SAtQq+GyIfsfmxb3Lfq086a9CHDeiAsz45hEchDbg21OBa2/KtjCp@nongnu.org X-Gm-Message-State: AOJu0YzYO987byMqSGBobUI95/T+ZDeHZIozbR1W8p8XqyE68CnZmI5l JFl11jiBoc6t4w5b6eABeJjT2yCDgkHNlHdCY07pkqyQFKwk4wfEx0f9VQ== X-Gm-Gg: ASbGnculaIfuhGRtBp3UEguf9JUCjCZ4+psLyxLgmB1c4BcOtO6+nubWTuW71JgzFVg of8z+KsmNVAu4y8AOscw0hrfMZm8B5m31MtuCnY7FmSh0nGYfUqj7kle8/2ByersxnhJfZHt6OA alFR6lzD8J3f543RK5TakAEdtJeQH/qAi8eA/LZLON1aP0SG13IEVyAsTAJyELmoYeXZH9Z5MQk /elcIkrClusbfbh48Syob1/Z/tLOdaGQRCrekhiUXnyjOUgYO+Kt3cTxTxZcqbd9m4Eusv3XoN4 7dU= X-Google-Smtp-Source: AGHT+IHR62IazP+nCv4oXviE1FM/RuaTGZMYXnrLfj9foh+YjVn9q84bHyoYMbj/6NLuxqRewktS5Q== X-Received: by 2002:a17:907:2d1e:b0:aa6:aedb:6030 with SMTP id a640c23a62f3a-aac33666079mr2549158866b.52.1735457188769; Sat, 28 Dec 2024 23:26:28 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 02/35] hw/m68k/next-cube: Disable the default CD-ROM drive Date: Sun, 29 Dec 2024 08:24:53 +0100 Message-ID: <20241229072526.166555-3-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.46; envelope-from=th.huth@gmail.com; helo=mail-ej1-f46.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457626411116600 The NeXT-Cube does not have a CD-ROM drive by default, and the kernel does not seem to deal with the empty drive very well, so let's disable the CD-ROM drive for this machine. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Mark Cave-Ayland Message-ID: <20241214091720.49779-1-huth@tuxfamily.org> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 0ecdcea823..94d56b4654 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -1067,6 +1067,7 @@ static void next_machine_class_init(ObjectClass *oc, = void *data) mc->default_ram_size =3D RAM_SIZE; mc->default_ram_id =3D "next.ram"; mc->default_cpu_type =3D M68K_CPU_TYPE_NAME("m68040"); + mc->no_cdrom =3D true; } =20 static const TypeInfo next_typeinfo =3D { --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 173545745555817.82038544900695; Sat, 28 Dec 2024 23:30:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnhA-0006Tr-Tb; Sun, 29 Dec 2024 02:26:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnh4-0006TJ-L2 for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:35 -0500 Received: from mail-ej1-f54.google.com ([209.85.218.54]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnh3-00027K-31 for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:34 -0500 Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-aaee0b309adso766589566b.3 for ; Sat, 28 Dec 2024 23:26:32 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.26.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:26:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457191; x=1736061991; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dogHZq8IreSzSR1AAe+dCE7TE8hDuQ0Bzq/9Cj2rhi4=; b=pN4ilznvhlxdVzrMXgefzM7FtQDxqj7XnN+5/hfV6IF4T0zhh+SjwWxyHk2hL0w8kJ odU2Y8/Sn1HDnUv8IA90Kc5OuJY5wBhLd7y3xqWprd6qr1yh2raibkabhDRWfKDdYbcA Lkp7ItuRSGjGhVozEFISaBhFKZ0ZD4dYLCfLOdOT2iMZAjwwznDavzA8PorN8Ns8bqNW ekWWC3U5LRLHR+2059TrYFbRfk1Q2CmQOZ9E0Px4ItloCN++HvF4e33q09MuS0sV7Ah1 yXnm1Lg5cxMLySZl/iQOO8ebMsjwQcPNMVHpZT8UICg21HzRPN99P5X9JydkfSROfqfc Bcxw== X-Forwarded-Encrypted: i=1; AJvYcCXqnkDpJlEnF/JersZ+DqyUo3puYPNpYbi99fp2CaZ187EJRm/FRf6a+Oca/5sibwnM8KCD6GZRMTkU@nongnu.org X-Gm-Message-State: AOJu0YyOhx4vbxDhSD5h3zTRf8wY+T7DQrQUNoxvHbY1WAXZ2u5Q5LE5 AH/aSjamUaBq332eNNg+Vy0HSwZ/AT05IuMPxkoY3y79lX2IuYez X-Gm-Gg: ASbGncv9ZMO7hKAZdG5EdIGKFIkWOaiUWu0c16J/5k+osw8ahg//1aNOVMhAZfsSaov nLmdx/fvq/MzskNTxpzmV0bnyZelkW8Z5thqmbiPKFzJGKR5YGUivV8qsmKHvFKntIcuWFspazU f5PMEjmW03udniJwaykN+3sGbaHPouqCSOIZGPsvcLcWdY7KdWMrHN8OQ9rGSOPtf8tdcPedpmv P2FEYuIIa36fiFDX4qRjqdt2IuyL0oBusrO/Ztw9RYJdPHjcRLXuK4q4Wx88F//t3wF2oBA/+D2 f6s= X-Google-Smtp-Source: AGHT+IF0oznSzs0JoCCY2EXckf3PWwVJwHtwqUr7Ow2dvDrKC5sleI8MC43yfcQTvFgjbCHQcvUkDA== X-Received: by 2002:a17:907:2d27:b0:aa6:7470:8efe with SMTP id a640c23a62f3a-aac2ad94a1amr2846525666b.13.1735457191346; Sat, 28 Dec 2024 23:26:31 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 03/35] next-cube: remove 0x14020 dummy value from next_mmio_read() Date: Sun, 29 Dec 2024 08:24:54 +0100 Message-ID: <20241229072526.166555-4-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.54; envelope-from=th.huth@gmail.com; helo=mail-ej1-f54.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457455941116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland This is a dummy value for the SCSI CSR which appears to have no effect when removed. Eventually the reads/writes to this register will be directed towards the WIP implementations in next_scr_readfn() and next_scr_writefn(). Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-2-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 94d56b4654..243d9e7e66 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -286,10 +286,6 @@ static uint64_t next_mmio_read(void *opaque, hwaddr ad= dr, unsigned size) size << 3); break; =20 - case 0x14020: - val =3D 0x7f; - break; - default: val =3D 0; DPRINTF("MMIO Read @ 0x%"HWADDR_PRIx" size %d\n", addr, size); --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 173545731852161.23606730975348; Sat, 28 Dec 2024 23:28:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnhH-0006Vs-9r; Sun, 29 Dec 2024 02:26:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnh7-0006Tj-LI for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:37 -0500 Received: from mail-ej1-f48.google.com ([209.85.218.48]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnh6-00027Z-2z for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:37 -0500 Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-aa689a37dd4so1249691666b.3 for ; Sat, 28 Dec 2024 23:26:35 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.26.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:26:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457194; x=1736061994; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BY3Nbpch55a2OXFwP4iqNPbMPRnYJkcP0SNHBbJMknQ=; b=jT/im3IciryrYbIHU5O3MBkNovJH3Iacrm91NAg5Y9iSsm7O8GPvdW8P5lL+v33iZV iD4J7EzHjFhv46W6QEQv4vyHqdut28fvIV1T72UQYUVXzZnXqelNgs5A6aIHYhJRTpkH 64R+nZswgmNfp6UFM480ifJWICtvRjvx30XtHwCq1m+aadCfU4rf1HpHjbc9wpBc6k7z QxEZSkx8mD4We4Zl5ENM2drOMDF2+g+BCSrHLDeTjZRt5L09ceoO4YYJ5liqQmD6j2FN jkswlDnQ7eWBcpnOQkMh9rf8kRdDLnsnuu654D805zN8liYysko9qkFnrWjIkTgyVJD6 ajvg== X-Forwarded-Encrypted: i=1; AJvYcCXOohtB6aHs8X7LEhff1dbFBYiEKYFgs1TN9qRGz7hbQl+gIL+krhlOiQE8wmZwnQ80U12s1QXjFT2K@nongnu.org X-Gm-Message-State: AOJu0YyBJinj2nARk577TZOJBtSfCeWwT848hpEud6tDuQPovQEzqxTL NAQolMuj4BU7M8oDQm72LcmVozfTcZrva4Z54PTCw5HzG9PxLbaP X-Gm-Gg: ASbGncuaQvTz7lVku+1bKAweYXzf4ks62OtXptatVSKzQ9RemuUBogA/i4FzWhv35zo SqWKHTn1/f6LqT6LiQwY/S8gQFSCadtbt2FnmGF2i0q1AqguyQHKkVOsDztK34lOIilR0cRg4kL ov1tUMYo9MUGQxj03OZmPRd8gzDjF+LQAGladz5Fvptk1eT6qV1JoNIUG8urrrK60cn5PqX6XlP Q7QdVou/WhaK9whV4IsU0Bbg34/wRuL5PYO1w24ZKGkK9LedUvCO0hgFKQw0RJezfQL/lgnh+Ou LmQ= X-Google-Smtp-Source: AGHT+IGxMtt+RoVwUhGC3UA2oBFlj+RjJklGpX8jPoAE/H7P4fzfuoVz9caYRMdJHIGNRab7eyIJqA== X-Received: by 2002:a17:906:c10d:b0:aa6:7881:1e84 with SMTP id a640c23a62f3a-aac2ad82cf6mr3446765366b.15.1735457194210; Sat, 28 Dec 2024 23:26:34 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 04/35] next-cube: remove overlap between next.dma and next.mmio memory regions Date: Sun, 29 Dec 2024 08:24:55 +0100 Message-ID: <20241229072526.166555-5-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.48; envelope-from=th.huth@gmail.com; helo=mail-ej1-f48.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457319359116600 From: Mark Cave-Ayland Change the start of the next.mmio memory region so that it follows on direc= tly after the next.dma memory region. Increase the address offsets in next_mmio_read() and next_mmio_write(), and reduce the size of the next.mmio memory region accordingly. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-3-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 243d9e7e66..5f07791707 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -266,23 +266,23 @@ static uint64_t next_mmio_read(void *opaque, hwaddr a= ddr, unsigned size) uint64_t val; =20 switch (addr) { - case 0x7000: + case 0x2000: /* 0x2007000 */ /* DPRINTF("Read INT status: %x\n", s->int_status); */ val =3D s->int_status; break; =20 - case 0x7800: + case 0x2800: /* 0x2007800 */ DPRINTF("MMIO Read INT mask: %x\n", s->int_mask); val =3D s->int_mask; break; =20 - case 0xc000 ... 0xc003: - val =3D extract32(s->scr1, (4 - (addr - 0xc000) - size) << 3, + case 0x7000 ... 0x7003: /* 0x200c000 */ + val =3D extract32(s->scr1, (4 - (addr - 0x7000) - size) << 3, size << 3); break; =20 - case 0xd000 ... 0xd003: - val =3D extract32(s->scr2, (4 - (addr - 0xd000) - size) << 3, + case 0x8000 ... 0x8003: /* 0x200d000 */ + val =3D extract32(s->scr2, (4 - (addr - 0x8000) - size) << 3, size << 3); break; =20 @@ -301,25 +301,25 @@ static void next_mmio_write(void *opaque, hwaddr addr= , uint64_t val, NeXTPC *s =3D NEXT_PC(opaque); =20 switch (addr) { - case 0x7000: + case 0x2000: /* 0x2007000 */ DPRINTF("INT Status old: %x new: %x\n", s->int_status, (unsigned int)val); s->int_status =3D val; break; =20 - case 0x7800: + case 0x2800: /* 0x2007800 */ DPRINTF("INT Mask old: %x new: %x\n", s->int_mask, (unsigned int)v= al); s->int_mask =3D val; break; =20 - case 0xc000 ... 0xc003: + case 0x7000 ... 0x7003: /* 0x200c000 */ DPRINTF("SCR1 Write: %x\n", (unsigned int)val); - s->scr1 =3D deposit32(s->scr1, (4 - (addr - 0xc000) - size) << 3, + s->scr1 =3D deposit32(s->scr1, (4 - (addr - 0x7000) - size) << 3, size << 3, val); break; =20 - case 0xd000 ... 0xd003: - s->scr2 =3D deposit32(s->scr2, (4 - (addr - 0xd000) - size) << 3, + case 0x8000 ... 0x8003: /* 0x200d000 */ + s->scr2 =3D deposit32(s->scr2, (4 - (addr - 0x8000) - size) << 3, size << 3, val); next_scr2_led_update(s); next_scr2_rtc_update(s); @@ -897,7 +897,7 @@ static void next_pc_realize(DeviceState *dev, Error **e= rrp) qdev_init_gpio_in(dev, next_irq, NEXT_NUM_IRQS); =20 memory_region_init_io(&s->mmiomem, OBJECT(s), &next_mmio_ops, s, - "next.mmio", 0xd0000); + "next.mmio", 0x9000); memory_region_init_io(&s->scrmem, OBJECT(s), &next_scr_ops, s, "next.scr", 0x20000); sysbus_init_mmio(sbd, &s->mmiomem); @@ -999,7 +999,7 @@ static void next_cube_init(MachineState *machine) sysbus_create_simple(TYPE_NEXTFB, 0x0B000000, NULL); =20 /* MMIO */ - sysbus_mmio_map(SYS_BUS_DEVICE(pcdev), 0, 0x02000000); + sysbus_mmio_map(SYS_BUS_DEVICE(pcdev), 0, 0x02005000); =20 /* BMAP IO - acts as a catch-all for now */ sysbus_mmio_map(SYS_BUS_DEVICE(pcdev), 1, 0x02100000); --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457278040681.6608371100796; Sat, 28 Dec 2024 23:27:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnhC-0006UU-Jv; Sun, 29 Dec 2024 02:26:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnhB-0006UL-MS for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:41 -0500 Received: from mail-ed1-f44.google.com ([209.85.208.44]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnh8-00027g-Gn for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:40 -0500 Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-5d122cf8dd1so14279180a12.2 for ; Sat, 28 Dec 2024 23:26:38 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.26.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:26:35 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457197; x=1736061997; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5xOWX5rUHlpEZkafc0mWpxiHUlUMjALIHfNNYRm0LGQ=; b=qv6z6KvCyhmWTmZYuBkrRIAIF2ryHsQdG/WzIpqyejurU1gJJ6QkXdSZEKPoh9C4gP NXm56yu+GVR+rsBoBJp0Yzd/YPCxd2ibDYPD/cyzfO0rcTvjBiuCOVIFTH3/tWLE9YcR nmllPPHSrNHrdUCe/R0rnSJMIBkeBxsovEQgQAb0a+A/g9bvSBccS2FGCrMQ7PvH2nKE zGYLQxxbbBaf50m4XESYf3cahnPo8Ai75EbV6Mn4UGSVouyiGRzjoz3IqyYW3WGDMtva mMZFSBSNMVUtFXhK+zzxmkj1bOcEhGz0AcF5VaIls9CDTvlBlkYs+OObDYKAeoBBI2bB YCOA== X-Forwarded-Encrypted: i=1; AJvYcCX+boY4xI5KBOMnKQ+O7DvMzUttRk9h8MJ3hOpmxU5ESISUQ0/D6O1F1OrZr+tfudSWv/hErZpe7ye9@nongnu.org X-Gm-Message-State: AOJu0YwtFowUba3Jao8ROKDLYuYuwHe1C6uajZXPKmJdzXapb7FTf9ng +ppnHzGlSL/dkFFUY6jHeX6E0zWvHF/pcmzNFTCSsQ6D6s3laYm8 X-Gm-Gg: ASbGncvmCXnQXz3l6f6y67zNVN96uLKcY6sVKTXb07U83F7PUsxQ35AIeEWJrQa0IlF fdDE36O/rhLMdU8JotFVPPltq3Jdy+e4ZttNeP6ykCGJbkNEVShkk3wLPXPVvcVsGjta5C+eEzD McrfgHCvvyalcqgaGR82y3oRLMsydPRQM2QWKrP1eWuiM7sVMjfjQU93oSYR/uahFiOHCMWE1/5 /VwVqEV/jiFO9/TcqI/30RgwGyCmmLZSN0hseicU4B4eDduxdmpq2RKKEewDajCGxiro0RXYrgz FTI= X-Google-Smtp-Source: AGHT+IFT/wyKfiPeWuPVH4QIkpvN/X0Wu/9174/E+9sqAk9amRMroQSWZqW0YEyzbOITY9xmvf2wLQ== X-Received: by 2002:a17:907:c1c:b0:aa6:8520:718b with SMTP id a640c23a62f3a-aac34218aabmr2620028366b.56.1735457196745; Sat, 28 Dec 2024 23:26:36 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 05/35] next-cube: create new next.scsi container memory region Date: Sun, 29 Dec 2024 08:24:56 +0100 Message-ID: <20241229072526.166555-6-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.208.44; envelope-from=th.huth@gmail.com; helo=mail-ed1-f44.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457280267116600 From: Mark Cave-Ayland Move the ESP SCSI and SCSI CSR registers to the new next.scsi container mem= ory region. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20241222130012.1013374-4-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 5f07791707..31c0532aff 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -94,6 +94,7 @@ struct NeXTPC { =20 MemoryRegion mmiomem; MemoryRegion scrmem; + MemoryRegion scsimem; =20 uint32_t scr1; uint32_t scr2; @@ -843,7 +844,12 @@ static void next_scsi_init(DeviceState *pcdev) sysbusdev =3D SYS_BUS_DEVICE(dev); sysbus_realize_and_unref(sysbusdev, &error_fatal); sysbus_connect_irq(sysbusdev, 0, qdev_get_gpio_in(pcdev, NEXT_SCSI_I)); - sysbus_mmio_map(sysbusdev, 0, 0x2114000); + + memory_region_init(&next_pc->scsimem, OBJECT(next_pc), "next.scsi", 0x= 40); + memory_region_add_subregion(&next_pc->scsimem, 0x0, + sysbus_mmio_get_region(sysbusdev, 0)); + + memory_region_add_subregion(&next_pc->scrmem, 0x14000, &next_pc->scsim= em); =20 next_pc->scsi_reset =3D qdev_get_gpio_in(dev, 0); next_pc->scsi_dma =3D qdev_get_gpio_in(dev, 1); --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457294161269.19078510789427; Sat, 28 Dec 2024 23:28:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnhJ-0006WD-2y; Sun, 29 Dec 2024 02:26:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnhC-0006UV-Ql for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:42 -0500 Received: from mail-ej1-f47.google.com ([209.85.218.47]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhB-00027u-Ep for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:42 -0500 Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-aa662795ca3so1751980166b.1 for ; Sat, 28 Dec 2024 23:26:40 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.26.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:26:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457199; x=1736061999; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NBzddoYpBkIm07+U/ldCBxDCjZBVJD4vMlMTweT6GA4=; b=TbM0zpKQGY2brEmuQ1g8AR1ishzp0ST3gNAO4buT5YojKlmvS6tkhjNOZMOKsTW+T1 OanMv9HzoyWh0X9gfkFkAQ1aIR6SbuVn9bPfMcMEGpsh5WnXOZQTWEqkUKKwspW0qnF8 Vad3If2oXEKOwwRBtIF/WCgeYsysw4n/sOhinkRb0WnWI4eEBZg9f0WuPQDYyZTpqVSe GZvgZ2MZD55uF4Tevo8b1BcafYGT1Y8kraqNuYZsUhqg68mVnFUspfDyZyoRQaS8liBX TbqhIsqzGj0XDbD32hcmFcJTSGLu5qkUQAmLDx2hzbASYNjnrys2ICi2gjgKiyww4RSO SwEg== X-Forwarded-Encrypted: i=1; AJvYcCUbSw/i67yjQT3fba6gg72X4IrMBqIKx3JDkLzNLdo/nSBRSX0znumvQknDX0pfY2u4q3qJEr/SoDAh@nongnu.org X-Gm-Message-State: AOJu0YxCU54Oa23clY0nx/4JWgCpCieScY+PRbzM4W5YvyDGc/1CE1xL ljosPrOeABd7Tzg/sg0ITBaiEOcRfmtr1DFN/NwE/zKJnl2uJ+eL X-Gm-Gg: ASbGncuuFyoBblxrhhwjVnEwKEx8j2bPjyeFWOUpWm59LTSBtxNxJqZGccscA6cLJIY IBMoW57TZd1GllIRbWl33xeoLXyiKkrhoXANjBpUog9gsKXRxuBElLIW9JCKbFRi9j6dCWIZiQi KuWGWW6y5x6VfcNOA4b0PuvxFEmnGhXpknHtcCqJiE+ZWP+etWHSyxoMvDzf0pu0RqXaZMWmxmW BZMVec9x+9vPy7zgvr+mS4Eza6KrUOgrEDZvL+1wO8Zb7dsxJAMAOm/LNuj3F4BP2NHCuFuWA+j LN4= X-Google-Smtp-Source: AGHT+IEVik0Twn904+owDuwl/g/GuvtBga164aXkQdlRuXBkE8szt4NaMyetIbywdg6JYQb0G5vLhw== X-Received: by 2002:a17:907:3f19:b0:aa6:75f4:20df with SMTP id a640c23a62f3a-aac08126683mr2943414966b.9.1735457199026; Sat, 28 Dec 2024 23:26:39 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 06/35] next-cube: move next_scsi_init() to next_pc_realize() Date: Sun, 29 Dec 2024 08:24:57 +0100 Message-ID: <20241229072526.166555-7-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.47; envelope-from=th.huth@gmail.com; helo=mail-ej1-f47.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457295599116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland This reflects that the SCSI interface exists within the NeXT Peripheral Controller (PC). Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-5-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 31c0532aff..97dea45b13 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -908,6 +908,9 @@ static void next_pc_realize(DeviceState *dev, Error **e= rrp) "next.scr", 0x20000); sysbus_init_mmio(sbd, &s->mmiomem); sysbus_init_mmio(sbd, &s->scrmem); + + /* SCSI */ + next_scsi_init(dev); } =20 /* @@ -1050,8 +1053,6 @@ static void next_cube_init(MachineState *machine) =20 /* TODO: */ /* Network */ - /* SCSI */ - next_scsi_init(pcdev); =20 /* DMA */ memory_region_init_io(&m->dmamem, NULL, &next_dma_ops, machine, --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457309543729.0274490020369; Sat, 28 Dec 2024 23:28:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnhL-0006Wa-8e; Sun, 29 Dec 2024 02:26:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnhE-0006V2-OS for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:44 -0500 Received: from mail-ej1-f42.google.com ([209.85.218.42]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhD-00028M-AW for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:44 -0500 Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-aa6c0d1833eso1746793866b.1 for ; Sat, 28 Dec 2024 23:26:42 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.26.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:26:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457202; x=1736062002; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jKMbZ7tOE4zEmIm/XjRbDObEJm0egPj+8uDYK+TX4uk=; b=nk4HVy0ZEzh5DvRT2+zL6l8lhWaG0/jtKS0ZTz9HZySAWGlkFhRx81duFzcoaCeAmI HuSTYSqfZyb/fRF4wzLlpC70r4ciS9F2YBMTfIozElQ4cn0/U6xV3ILpF+VlSVa1UGkL VNaW7CDkLnNrdbKaVIAiTITp1DcJBs/yRhvy/WBCZDW3e9y9azFPizLbWsjnBuyzN3kj MFrR0w0JyMp3UGEcEJjQrKEDJqq4JM7Kbb7lNvOUJU5rHpyfuezyEPxPYSGy+vfajEn5 6OUeH1NyqwXHBEybZ4mndYwI9CxGuzTJg8hVIQyzZJxMTwk4Cv4Aoh9VCn0BxRC0Wm3a fFEg== X-Forwarded-Encrypted: i=1; AJvYcCXqZPlIPpvchoLdHypQEssjxgczUgBWwJ0zpF53MOXegQLFxMmCOgoVa8jWuibJyfztWH/92Bq4T5um@nongnu.org X-Gm-Message-State: AOJu0YwqSU/NNQMNosIfMVgInTegfik5X1qoVCxugj5wJfgXD+Q3PuvY 3GF22GUKqGPJcWkxKfjE4cSUNnmnPjL27O1JrxrKNJcgD8az8D9odmq+xA== X-Gm-Gg: ASbGncscg0ZtUYxv2jUzclBgFSEEQ8027euZUR3GoqOnnJHZCvzzWh3JYNFxdfjDWpd RYjaPOjUSZPUGvOOc/8p/mAypd5XI9ubar+9rymijwFXjnho/orhGubj5gHUL0cbhvboTI0jJIJ 25kVMoOVXFYojylkjjlES8eSuduvT7vwyQ0ip9I4dsYmsLmMtlwlNNsz2a9bH+FKgrqOc33JPGu 7VRsOsUR5DmEe1p26wQ9xRrWx74KeWrjrU3xeXPVBOY17fB9SDSIMrMOwvEqT2zVa0yzI3quQzJ LIM= X-Google-Smtp-Source: AGHT+IFhw8Up3yiaWgbctfRePQ9guT2Ftb9o+5mSHuxeKcejS2MyKxrLFUq8N5/hUVEmKP5yiJX4bg== X-Received: by 2002:a17:906:dc89:b0:aa6:af4b:7c89 with SMTP id a640c23a62f3a-aac3446dd7cmr2563586066b.61.1735457201616; Sat, 28 Dec 2024 23:26:41 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 07/35] next-cube: introduce next_pc_init() object init function Date: Sun, 29 Dec 2024 08:24:58 +0100 Message-ID: <20241229072526.166555-8-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.42; envelope-from=th.huth@gmail.com; helo=mail-ej1-f42.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457311262116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland Move initialisation of the memory regions and GPIOs from next_pc_realize() = to the new next_pc_init() function. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-6-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 97dea45b13..c187a469d9 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -897,20 +897,24 @@ static void next_pc_reset(DeviceState *dev) =20 static void next_pc_realize(DeviceState *dev, Error **errp) { - NeXTPC *s =3D NEXT_PC(dev); - SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); + /* SCSI */ + next_scsi_init(dev); +} + +static void next_pc_init(Object *obj) +{ + NeXTPC *s =3D NEXT_PC(obj); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); =20 - qdev_init_gpio_in(dev, next_irq, NEXT_NUM_IRQS); + qdev_init_gpio_in(DEVICE(obj), next_irq, NEXT_NUM_IRQS); =20 memory_region_init_io(&s->mmiomem, OBJECT(s), &next_mmio_ops, s, "next.mmio", 0x9000); memory_region_init_io(&s->scrmem, OBJECT(s), &next_scr_ops, s, "next.scr", 0x20000); + sysbus_init_mmio(sbd, &s->mmiomem); sysbus_init_mmio(sbd, &s->scrmem); - - /* SCSI */ - next_scsi_init(dev); } =20 /* @@ -971,6 +975,7 @@ static void next_pc_class_init(ObjectClass *klass, void= *data) static const TypeInfo next_pc_info =3D { .name =3D TYPE_NEXT_PC, .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_init =3D next_pc_init, .instance_size =3D sizeof(NeXTPC), .class_init =3D next_pc_class_init, }; --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457594591173.3106205813218; Sat, 28 Dec 2024 23:33:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnhP-0006Xc-An; Sun, 29 Dec 2024 02:26:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnhH-0006W8-LW for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:48 -0500 Received: from mail-ej1-f51.google.com ([209.85.218.51]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhG-00028j-23 for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:47 -0500 Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-aaef00ab172so630807066b.3 for ; Sat, 28 Dec 2024 23:26:45 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.26.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:26:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457204; x=1736062004; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ils5tuXfHtph1hTzd0HLTrs6Eu7Mo2u0cItG3OZiwZw=; b=fJsoJeugHwnFUj/+uWsESI59hXpBJGZA6pxLGoUv4DkvpRHNdC9SEwwzRR3N5apa+P BGAxQWsGyjuWdDxsw66rdki7LRALmmgXJLs7OM9n4doe6nSpgUPqNLf+db7VemIeCRur TTvJn9diXEIEt4qMzS2vKDj7U4elAnMEhdfxtL3uH3RAIfnZPU4KYBompsg9bmWSVK2i pXGAo/1R+WBrnq+ixEvIbADUn9p9zQO7h+T1ceW1xTtr7duojAdQJ+lGIOx+MfnYh3qO 2seo5HXnKZpxzUQS5xT7duOxS5Nedy8L19C4dDJHyqZkNGQKT6qvI5LGrEb9ve+pulSQ W+8Q== X-Forwarded-Encrypted: i=1; AJvYcCXySbQoxpaWGUGuzOsUaUP6JUO+aAfF4t7+oeJpBHtYKSF+FInB87lI1xR4gka0UTNCcdvsryfJlnHr@nongnu.org X-Gm-Message-State: AOJu0Ywj2E3n2aMxyCwseeiFJDi/jCvB+ZbUhQ5/BqIgqdIcSo4V2FbW e3ma1VD8eBEED9ZcwW16lOvDNFuF8o9UETInf0Mvr6EUM5YvmZjNbmw/TQ== X-Gm-Gg: ASbGncuP7Mo7XjbYyF8dqdquacN8nFXtVWLcyc/UpTIWn8dvcrnmvIXsyYnnYyPsCP2 R8vq8CVhzfMo/zQAGEGuEQiEEvdolWBNX4kW8cESLmH85FIXZwa5Lo17ad6g5V5DzTtx9T2OjVy 3Dz6vynQCOHE9NXCD6Zr/fycdAyOrZg5blWOHzfb+jbG97suJ1/SKRh6XnlcBQHxsAY9MO3696d dgpIPYa5JVEpQ2dTTpWDdb/FUveHpeyU6h/aECpOJPq5AmLCqVzarPQdVtdxhhIZStelwv9qkiz WAE= X-Google-Smtp-Source: AGHT+IGvJg1lEUc1MRwQ1WFrKdgCLDXVtCwFQ/6OfozB0LNXnFw4YUPvtJEmPmSEkGpltvBLDOVsOg== X-Received: by 2002:a05:6402:2790:b0:5d0:e73c:b7f0 with SMTP id 4fb4d7f45d1cf-5d81de1c241mr78521972a12.28.1735457204205; Sat, 28 Dec 2024 23:26:44 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 08/35] next-cube: introduce next-scsi device Date: Sun, 29 Dec 2024 08:24:59 +0100 Message-ID: <20241229072526.166555-9-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.51; envelope-from=th.huth@gmail.com; helo=mail-ej1-f51.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457596294116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland This device is intended to hold the ESP SCSI controller and the NeXT SCSI C= SRs. Start by creating the device and moving the ESP SCSI controller to be an embedded child device. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-7-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 93 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 74 insertions(+), 19 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index c187a469d9..ce147fa9af 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -83,6 +83,18 @@ struct NeXTState { next_dma dma[10]; }; =20 +#define TYPE_NEXT_SCSI "next-scsi" +OBJECT_DECLARE_SIMPLE_TYPE(NeXTSCSI, NEXT_SCSI) + +/* NeXT SCSI Controller */ +struct NeXTSCSI { + SysBusDevice parent_obj; + + MemoryRegion scsi_mem; + + SysBusESPState sysbus_esp; +}; + #define TYPE_NEXT_PC "next-pc" OBJECT_DECLARE_SIMPLE_TYPE(NeXTPC, NEXT_PC) =20 @@ -94,7 +106,6 @@ struct NeXTPC { =20 MemoryRegion mmiomem; MemoryRegion scrmem; - MemoryRegion scsimem; =20 uint32_t scr1; uint32_t scr2; @@ -102,6 +113,8 @@ struct NeXTPC { uint32_t int_mask; uint32_t int_status; uint32_t led; + + NeXTSCSI next_scsi; uint8_t scsi_csr_1; uint8_t scsi_csr_2; =20 @@ -825,38 +838,61 @@ static void nextscsi_write(void *opaque, uint8_t *buf= , int size) nextdma_write(opaque, buf, size, NEXTDMA_SCSI); } =20 -static void next_scsi_init(DeviceState *pcdev) +static void next_scsi_init(Object *obj) { - struct NeXTPC *next_pc =3D NEXT_PC(pcdev); - DeviceState *dev; - SysBusDevice *sysbusdev; + NeXTSCSI *s =3D NEXT_SCSI(obj); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(obj); + + object_initialize_child(obj, "esp", &s->sysbus_esp, TYPE_SYSBUS_ESP); + + memory_region_init(&s->scsi_mem, obj, "next.scsi", 0x40); + sysbus_init_mmio(sbd, &s->scsi_mem); +} + +static void next_scsi_realize(DeviceState *dev, Error **errp) +{ + NeXTSCSI *s =3D NEXT_SCSI(dev); SysBusESPState *sysbus_esp; + SysBusDevice *sbd; ESPState *esp; + NeXTPC *pcdev; + + pcdev =3D NEXT_PC(container_of(s, NeXTPC, next_scsi)); =20 - dev =3D qdev_new(TYPE_SYSBUS_ESP); - sysbus_esp =3D SYSBUS_ESP(dev); + /* ESP */ + sysbus_esp =3D SYSBUS_ESP(&s->sysbus_esp); esp =3D &sysbus_esp->esp; esp->dma_memory_read =3D nextscsi_read; esp->dma_memory_write =3D nextscsi_write; esp->dma_opaque =3D pcdev; sysbus_esp->it_shift =3D 0; esp->dma_enabled =3D 1; - sysbusdev =3D SYS_BUS_DEVICE(dev); - sysbus_realize_and_unref(sysbusdev, &error_fatal); - sysbus_connect_irq(sysbusdev, 0, qdev_get_gpio_in(pcdev, NEXT_SCSI_I)); - - memory_region_init(&next_pc->scsimem, OBJECT(next_pc), "next.scsi", 0x= 40); - memory_region_add_subregion(&next_pc->scsimem, 0x0, - sysbus_mmio_get_region(sysbusdev, 0)); + sbd =3D SYS_BUS_DEVICE(sysbus_esp); + if (!sysbus_realize(sbd, errp)) { + return; + } + memory_region_add_subregion(&s->scsi_mem, 0x0, + sysbus_mmio_get_region(sbd, 0)); =20 - memory_region_add_subregion(&next_pc->scrmem, 0x14000, &next_pc->scsim= em); + scsi_bus_legacy_handle_cmdline(&s->sysbus_esp.esp.bus); +} =20 - next_pc->scsi_reset =3D qdev_get_gpio_in(dev, 0); - next_pc->scsi_dma =3D qdev_get_gpio_in(dev, 1); +static void next_scsi_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); =20 - scsi_bus_legacy_handle_cmdline(&esp->bus); + dc->desc =3D "NeXT SCSI Controller"; + dc->realize =3D next_scsi_realize; } =20 +static const TypeInfo next_scsi_info =3D { + .name =3D TYPE_NEXT_SCSI, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_init =3D next_scsi_init, + .instance_size =3D sizeof(NeXTSCSI), + .class_init =3D next_scsi_class_init, +}; + static void next_escc_init(DeviceState *pcdev) { DeviceState *dev; @@ -897,8 +933,24 @@ static void next_pc_reset(DeviceState *dev) =20 static void next_pc_realize(DeviceState *dev, Error **errp) { + NeXTPC *s =3D NEXT_PC(dev); + SysBusDevice *sbd; + DeviceState *d; + /* SCSI */ - next_scsi_init(dev); + sbd =3D SYS_BUS_DEVICE(&s->next_scsi); + if (!sysbus_realize(sbd, errp)) { + return; + } + memory_region_add_subregion(&s->scrmem, 0x14000, + sysbus_mmio_get_region(sbd, 0)); + + d =3D DEVICE(object_resolve_path_component(OBJECT(&s->next_scsi), "esp= ")); + sysbus_connect_irq(SYS_BUS_DEVICE(d), 0, + qdev_get_gpio_in(DEVICE(s), NEXT_SCSI_I)); + + s->scsi_reset =3D qdev_get_gpio_in(d, 0); + s->scsi_dma =3D qdev_get_gpio_in(d, 1); } =20 static void next_pc_init(Object *obj) @@ -915,6 +967,8 @@ static void next_pc_init(Object *obj) =20 sysbus_init_mmio(sbd, &s->mmiomem); sysbus_init_mmio(sbd, &s->scrmem); + + object_initialize_child(obj, "next-scsi", &s->next_scsi, TYPE_NEXT_SCS= I); } =20 /* @@ -1089,6 +1143,7 @@ static void next_register_type(void) { type_register_static(&next_typeinfo); type_register_static(&next_pc_info); + type_register_static(&next_scsi_info); } =20 type_init(next_register_type) --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457278067983.2755186550894; Sat, 28 Dec 2024 23:27:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnhO-0006XN-SE; Sun, 29 Dec 2024 02:26:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnhJ-0006WQ-GC for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:49 -0500 Received: from mail-ej1-f47.google.com ([209.85.218.47]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhH-00028t-Tv for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:49 -0500 Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-aa5f1909d6fso1222658066b.3 for ; Sat, 28 Dec 2024 23:26:47 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.26.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:26:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457206; x=1736062006; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JfP72JC2fK1YTGLvj0y9Jxg1LY7+nBroE5JdeEJSXHY=; b=rEMNvugIzmmDPO1swsaIlwOtimn+vJNvfME3E2MW5/hAc9zQE5oPEgQ3jCB+cfSw0T e3paRW/FJlhYrUGkmSNjD8MV64FKfJO/x2srn/O1emHL0SFr70Tl9YQhrSXC+4l3TgpJ Q6WrJYkb4A6voeuCJkeEd2ZadiDz2bb9V79O6kbmr+e+8sWTx3buCjcCV7StYDwePx3G 36UaNubHK2OGTphEXnjtYNkmkXkiiVVDi4wBnunpFE34Uab2QIAHk642jJsacbNyK+5x 7J7ufDX8l4l6at++IMCIErx3NS6rsfg9UiQKO5boPIJcRjXrd2/DfzWe1o/167c7NFwS HR1Q== X-Forwarded-Encrypted: i=1; AJvYcCUKN4q1/P5U56wIfQMBqHDorbZqsm5nRkUk8vFVrxN+y0dzuMStxwCy15se2AWLPsrhUknS9AqteCvh@nongnu.org X-Gm-Message-State: AOJu0YxioDn5K6o9mD1LeCOegXmlYf4xyDWUnebEfqDn7+xu/BMSKcLR D4E//uv6cBXXWHThYlYNdFOy2AlufGdCG0H5J1DOnrJa6nJSFUfrdNqSFQ== X-Gm-Gg: ASbGncsciiYrClqPdAQBal195E52ZlxTJ60YdzgZAFGbKTU46X4v6fl3bvJyT91vMRm INEas4wKZ6G4CDTOosDf6RZjM8+VGWzPi1SCHZXqYUZ7Y+UWuESZZFvEtTI0tMGLV22AKXvNAOH xP1EQS4mbmf/McRslmzXDX365PqgslQHCeGceC/kEDqTJiqd7AXdIk4FQXLlIhzJm3p7mXNsMIT awJDFnoj/D67cY599VNRVDhdG0oiX9WK20WA1jPbGZhJSsK3YLi5HdfLYxk/VQ6U0bVQkcGV2GL vj4= X-Google-Smtp-Source: AGHT+IH2JPQs42Wu07z9V64ugqJFVDsjF8q/bTncP5jWTxr2ta1t6dhxugP/jm26ZVf01F+/kCx6FA== X-Received: by 2002:a17:907:d25:b0:aa6:93c4:c68c with SMTP id a640c23a62f3a-aac334f3050mr2996132066b.41.1735457206143; Sat, 28 Dec 2024 23:26:46 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 09/35] next-cube: move SCSI CSRs from next-pc to the next-scsi device Date: Sun, 29 Dec 2024 08:25:00 +0100 Message-ID: <20241229072526.166555-10-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.47; envelope-from=th.huth@gmail.com; helo=mail-ej1-f47.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457280238116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland The SCSI CSRs are located within the SCSI subsystem of the NeXT PC (Periphe= ral Contoller) which is now modelled as a separate QEMU device. Add a new memory region subregion to contain the SCSI CSRs that simply store and retrieve the register values. Add a new VMStateDescription for the next-scsi device to enable the SCSI CS= Rs to be migrated. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-8-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 88 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 78 insertions(+), 10 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index ce147fa9af..687d1b3cb0 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -93,6 +93,10 @@ struct NeXTSCSI { MemoryRegion scsi_mem; =20 SysBusESPState sysbus_esp; + + MemoryRegion scsi_csr_mem; + uint8_t scsi_csr_1; + uint8_t scsi_csr_2; }; =20 #define TYPE_NEXT_PC "next-pc" @@ -115,8 +119,6 @@ struct NeXTPC { uint32_t led; =20 NeXTSCSI next_scsi; - uint8_t scsi_csr_1; - uint8_t scsi_csr_2; =20 qemu_irq scsi_reset; qemu_irq scsi_dma; @@ -364,6 +366,7 @@ static const MemoryRegionOps next_mmio_ops =3D { static uint64_t next_scr_readfn(void *opaque, hwaddr addr, unsigned size) { NeXTPC *s =3D NEXT_PC(opaque); + NeXTSCSI *ns =3D NEXT_SCSI(&s->next_scsi); uint64_t val; =20 switch (addr) { @@ -373,12 +376,12 @@ static uint64_t next_scr_readfn(void *opaque, hwaddr = addr, unsigned size) break; =20 case 0x14020: - DPRINTF("SCSI 4020 STATUS READ %X\n", s->scsi_csr_1); - val =3D s->scsi_csr_1; + DPRINTF("SCSI 4020 STATUS READ %X\n", ns->scsi_csr_1); + val =3D ns->scsi_csr_1; break; =20 case 0x14021: - DPRINTF("SCSI 4021 STATUS READ %X\n", s->scsi_csr_2); + DPRINTF("SCSI 4021 STATUS READ %X\n", ns->scsi_csr_2); val =3D 0x40; break; =20 @@ -411,6 +414,7 @@ static void next_scr_writefn(void *opaque, hwaddr addr,= uint64_t val, unsigned size) { NeXTPC *s =3D NEXT_PC(opaque); + NeXTSCSI *ns =3D NEXT_SCSI(&s->next_scsi); =20 switch (addr) { case 0x14108: @@ -445,7 +449,7 @@ static void next_scr_writefn(void *opaque, hwaddr addr,= uint64_t val, 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); + ns->scsi_csr_1 &=3D ~(SCSICSR_INTMASK | 0x80 | 0x1); qemu_irq_lower(s->scsi_reset); } if (val & SCSICSR_DMADIR) { @@ -838,6 +842,54 @@ static void nextscsi_write(void *opaque, uint8_t *buf,= int size) nextdma_write(opaque, buf, size, NEXTDMA_SCSI); } =20 +static void next_scsi_csr_write(void *opaque, hwaddr addr, uint64_t val, + unsigned size) +{ + NeXTSCSI *s =3D NEXT_SCSI(opaque); + + switch (addr) { + case 0: + s->scsi_csr_1 =3D val; + break; + + case 1: + s->scsi_csr_2 =3D val; + break; + + default: + g_assert_not_reached(); + } +} + +static uint64_t next_scsi_csr_read(void *opaque, hwaddr addr, unsigned siz= e) +{ + NeXTSCSI *s =3D NEXT_SCSI(opaque); + uint64_t val; + + switch (addr) { + case 0: + val =3D s->scsi_csr_1; + break; + + case 1: + val =3D s->scsi_csr_2; + break; + + default: + g_assert_not_reached(); + } + + return val; +} + +static const MemoryRegionOps next_scsi_csr_ops =3D { + .read =3D next_scsi_csr_read, + .write =3D next_scsi_csr_write, + .valid.min_access_size =3D 1, + .valid.max_access_size =3D 1, + .endianness =3D DEVICE_BIG_ENDIAN, +}; + static void next_scsi_init(Object *obj) { NeXTSCSI *s =3D NEXT_SCSI(obj); @@ -845,6 +897,9 @@ static void next_scsi_init(Object *obj) =20 object_initialize_child(obj, "esp", &s->sysbus_esp, TYPE_SYSBUS_ESP); =20 + memory_region_init_io(&s->scsi_csr_mem, obj, &next_scsi_csr_ops, + s, "csrs", 2); + memory_region_init(&s->scsi_mem, obj, "next.scsi", 0x40); sysbus_init_mmio(sbd, &s->scsi_mem); } @@ -874,15 +929,30 @@ static void next_scsi_realize(DeviceState *dev, Error= **errp) memory_region_add_subregion(&s->scsi_mem, 0x0, sysbus_mmio_get_region(sbd, 0)); =20 + /* SCSI CSRs */ + memory_region_add_subregion(&s->scsi_mem, 0x20, &s->scsi_csr_mem); + scsi_bus_legacy_handle_cmdline(&s->sysbus_esp.esp.bus); } =20 +static const VMStateDescription next_scsi_vmstate =3D { + .name =3D "next-scsi", + .version_id =3D 0, + .minimum_version_id =3D 0, + .fields =3D (const VMStateField[]) { + VMSTATE_UINT8(scsi_csr_1, NeXTSCSI), + VMSTATE_UINT8(scsi_csr_2, NeXTSCSI), + VMSTATE_END_OF_LIST() + }, +}; + static void next_scsi_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); =20 dc->desc =3D "NeXT SCSI Controller"; dc->realize =3D next_scsi_realize; + dc->vmsd =3D &next_scsi_vmstate; } =20 static const TypeInfo next_scsi_info =3D { @@ -999,8 +1069,8 @@ static const VMStateDescription next_rtc_vmstate =3D { =20 static const VMStateDescription next_pc_vmstate =3D { .name =3D "next-pc", - .version_id =3D 2, - .minimum_version_id =3D 2, + .version_id =3D 3, + .minimum_version_id =3D 3, .fields =3D (const VMStateField[]) { VMSTATE_UINT32(scr1, NeXTPC), VMSTATE_UINT32(scr2, NeXTPC), @@ -1008,8 +1078,6 @@ static const VMStateDescription next_pc_vmstate =3D { VMSTATE_UINT32(int_mask, NeXTPC), VMSTATE_UINT32(int_status, NeXTPC), VMSTATE_UINT32(led, NeXTPC), - VMSTATE_UINT8(scsi_csr_1, NeXTPC), - VMSTATE_UINT8(scsi_csr_2, NeXTPC), VMSTATE_STRUCT(rtc, NeXTPC, 0, next_rtc_vmstate, NextRtc), VMSTATE_END_OF_LIST() }, --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 17354577598294.612581218805758; Sat, 28 Dec 2024 23:35:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnhP-0006Y9-Pc; Sun, 29 Dec 2024 02:26:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnhM-0006Wv-Lc for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:53 -0500 Received: from mail-ej1-f46.google.com ([209.85.218.46]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhK-00029B-Np for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:52 -0500 Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-aa696d3901bso762751266b.1 for ; Sat, 28 Dec 2024 23:26:50 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.26.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:26:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457209; x=1736062009; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8g4JDK2gP7kBGIRp58PLikXD1WmmiHmJeQox3/MKTjs=; b=m5xNMUTUgfBgw91/9PWAvUwUYBPXBMXyxGx6E8GaqacxD/ud7V3tBw/J2LlVFJiG5e KjCvq/8NkngP/NHpcC5+21UuveYXt2HldAN0477qIK6YlRo3+at5/rXMqThH4CV9gyyt kFM6W+kLXUgUDN/MlWXSVNUh/3XPAoLBd+TVQM8sd7WfMQl48jYGZc6ATI/eYHS0Jivy wKBZ2TxphqLc+2Knk07PRPk2ijUe3qbTCmuXVDsrCtNdn0/erIQBFwndMFQsZx93vZcC zMNpAx8z+ATPGe4NogyMuc+awZEh9UA0RGBGeDgqX0AnIU0/R9hUomAcJ02Tfix+1H79 rwcQ== X-Forwarded-Encrypted: i=1; AJvYcCVk1OqycUmdZkGH5UTVxTV5BkgxUrVfe+2k4YU6CldL3g6FS4WWU2lnITdriTtN1cuU8qu2cMMZ+s34@nongnu.org X-Gm-Message-State: AOJu0YymN3SMJ/JOgXTSFXEH7Zd/3Z+osLnqoWpkQgbB5bqSdY8Knf9B KbMQvLUmxDFTaqgGNVQ5YChPBDXiy2d/KnggAG/eYQ+1KCDBsluu X-Gm-Gg: ASbGnctpY1KcDEF3edg/0QEpIA3C/WuFYkrjNNQl3I/J2mAXA3vL1FIp/Lw23OwKFIW mkiIV/+otYsGoauRkqavHACkR9swOF5qFQOeZ3iMxxkiCN3CE8VbC67QuUGbuKW2KPhOkYgZmMJ w4VuWsfsY3cWnM+t8xZMYgqjd8Tiw3vLZxLwX2HAYtXEhey+X1pD1ZfEtDD8EvchYDsWiMuezx/ 9LDAx6/nNyZwyUUDGDTEmWorjHw1UbH1njrUdADsigKC70vJyoHEMgDS/klUUOJ2GX0iJe8nZ1T g1I= X-Google-Smtp-Source: AGHT+IGP457vSLVn1pcZ7UqdRH1rB2XcUREvQNpeqwpJNge7QAz3g4s2hjFyW0skv/h/6ylILhAqaA== X-Received: by 2002:a17:907:3da0:b0:aab:cd45:5d3c with SMTP id a640c23a62f3a-aac33685df3mr2770574866b.50.1735457209031; Sat, 28 Dec 2024 23:26:49 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 10/35] next-cube: move SCSI 4020/4021 logic from next-pc device to next-scsi device Date: Sun, 29 Dec 2024 08:25:01 +0100 Message-ID: <20241229072526.166555-11-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.46; envelope-from=th.huth@gmail.com; helo=mail-ej1-f46.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457760848116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland The SCSI 4020/4021 logic refers to the offset of the SCSI CSRs within the N= eXTCube address space. Due to the previously overlapping memory regions, there were duplicate MMIO accessors in the next.scr memory region for these registers = but this has now been resolved. Move the remaining SCSI 4020/4021 logic from the next-pc device to the next= -scsi device, with the exception that the SCSI 4021 register now returns its prev= ious value like a normal register instead of a hardcoded 0x40 value. This also m= atches how the registers are implemented in the Previous emulator. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-9-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 139 ++++++++++++++++++++------------------------ 1 file changed, 62 insertions(+), 77 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 687d1b3cb0..402e268f6b 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -365,8 +365,6 @@ static const MemoryRegionOps next_mmio_ops =3D { =20 static uint64_t next_scr_readfn(void *opaque, hwaddr addr, unsigned size) { - NeXTPC *s =3D NEXT_PC(opaque); - NeXTSCSI *ns =3D NEXT_SCSI(&s->next_scsi); uint64_t val; =20 switch (addr) { @@ -375,16 +373,6 @@ static uint64_t next_scr_readfn(void *opaque, hwaddr a= ddr, unsigned size) val =3D 0x40 | 0x04 | 0x2 | 0x1; break; =20 - case 0x14020: - DPRINTF("SCSI 4020 STATUS READ %X\n", ns->scsi_csr_1); - val =3D ns->scsi_csr_1; - break; - - case 0x14021: - DPRINTF("SCSI 4021 STATUS READ %X\n", ns->scsi_csr_2); - val =3D 0x40; - break; - /* * These 4 registers are the hardware timer, not sure which register * is the latch instead of data, but no problems so far. @@ -413,9 +401,6 @@ static uint64_t next_scr_readfn(void *opaque, hwaddr ad= dr, unsigned size) static void next_scr_writefn(void *opaque, hwaddr addr, uint64_t val, unsigned size) { - NeXTPC *s =3D NEXT_PC(opaque); - NeXTSCSI *ns =3D NEXT_SCSI(&s->next_scsi); - switch (addr) { case 0x14108: DPRINTF("FDCSR Write: %"PRIx64 "\n", val); @@ -424,68 +409,6 @@ static void next_scr_writefn(void *opaque, hwaddr addr= , uint64_t val, } break; =20 - case 0x14020: /* SCSI Control Register */ - if (val & 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); */ - } - - if (val & 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 (val & SCSICSR_RESET) { - DPRINTF("SCSICSR Reset\n"); - /* I think this should set DMADIR. CPUDMA and INTMASK to 0 */ - qemu_irq_raise(s->scsi_reset); - ns->scsi_csr_1 &=3D ~(SCSICSR_INTMASK | 0x80 | 0x1); - qemu_irq_lower(s->scsi_reset); - } - if (val & SCSICSR_DMADIR) { - DPRINTF("SCSICSR DMAdir\n"); - } - if (val & SCSICSR_CPUDMA) { - DPRINTF("SCSICSR CPUDMA\n"); - /* qemu_irq_raise(s->scsi_dma); */ - s->int_status |=3D 0x4000000; - } else { - /* fprintf(stderr,"SCSICSR CPUDMA disabled\n"); */ - s->int_status &=3D ~(0x4000000); - /* qemu_irq_lower(s->scsi_dma); */ - } - if (val & SCSICSR_INTMASK) { - DPRINTF("SCSICSR INTMASK\n"); - /* - * int_mask &=3D ~0x1000; - * s->scsi_csr_1 |=3D val; - * 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 (val & 0x80) { - /* int_mask |=3D 0x1000; */ - /* s->scsi_csr_1 |=3D 0x80; */ - } - DPRINTF("SCSICSR Write: %"PRIx64 "\n", val); - /* s->scsi_csr_1 =3D val; */ - break; - /* Hardware timer latch - not implemented yet */ case 0x1a000: default: @@ -846,13 +769,73 @@ static void next_scsi_csr_write(void *opaque, hwaddr = addr, uint64_t val, unsigned size) { NeXTSCSI *s =3D NEXT_SCSI(opaque); + NeXTPC *pc =3D NEXT_PC(container_of(s, NeXTPC, next_scsi)); =20 switch (addr) { case 0: + if (val & 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); */ + } + + if (val & 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 (val & SCSICSR_RESET) { + DPRINTF("SCSICSR Reset\n"); + /* I think this should set DMADIR. CPUDMA and INTMASK to 0 */ + qemu_irq_raise(pc->scsi_reset); + s->scsi_csr_1 &=3D ~(SCSICSR_INTMASK | 0x80 | 0x1); + qemu_irq_lower(pc->scsi_reset); + } + if (val & SCSICSR_DMADIR) { + DPRINTF("SCSICSR DMAdir\n"); + } + if (val & SCSICSR_CPUDMA) { + DPRINTF("SCSICSR CPUDMA\n"); + /* qemu_irq_raise(s->scsi_dma); */ + pc->int_status |=3D 0x4000000; + } else { + /* fprintf(stderr,"SCSICSR CPUDMA disabled\n"); */ + pc->int_status &=3D ~(0x4000000); + /* qemu_irq_lower(s->scsi_dma); */ + } + if (val & SCSICSR_INTMASK) { + DPRINTF("SCSICSR INTMASK\n"); + /* + * int_mask &=3D ~0x1000; + * s->scsi_csr_1 |=3D val; + * 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 (val & 0x80) { + /* int_mask |=3D 0x1000; */ + /* s->scsi_csr_1 |=3D 0x80; */ + } + DPRINTF("SCSICSR1 Write: %"PRIx64 "\n", val); s->scsi_csr_1 =3D val; break; =20 case 1: + DPRINTF("SCSICSR2 Write: %"PRIx64 "\n", val); s->scsi_csr_2 =3D val; break; =20 @@ -868,10 +851,12 @@ static uint64_t next_scsi_csr_read(void *opaque, hwad= dr addr, unsigned size) =20 switch (addr) { case 0: + DPRINTF("SCSI 4020 STATUS READ %X\n", s->scsi_csr_1); val =3D s->scsi_csr_1; break; =20 case 1: + DPRINTF("SCSI 4021 STATUS READ %X\n", s->scsi_csr_2); val =3D s->scsi_csr_2; break; =20 --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457318877580.4255213161625; Sat, 28 Dec 2024 23:28:38 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnhR-0006YB-2z; Sun, 29 Dec 2024 02:26:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnhO-0006XU-VM for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:55 -0500 Received: from mail-ej1-f48.google.com ([209.85.218.48]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhN-00029S-Ha for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:54 -0500 Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-aaec111762bso1088793466b.2 for ; Sat, 28 Dec 2024 23:26:53 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.26.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:26:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457212; x=1736062012; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fqZjoK0ZImfPOgOFtgojHS/Q0wDjVJPffV/7c5jWce0=; b=mDxY4TNDfaSkmP/g4r+f/cpBI2N66Mp/fsHgSn8gnn6ake+JWdds2HXYzgit5SmZbn 1uaynuTQ+/Xrn0+6L+9g55saGwsIdEURbitl/cLeo+tW2wK6IgfefNcKqtgEzRS2T6TB 2wXN/YnLbFei6tt/A+1FuCjjfhC42GEb3lAUKgC9JKk1yz5yNZLUZNQHF/LZe9LFt0vl +qeePAk4qQda7vrDW3G4HF7cT6JITiLQnOI/CsG9nxqkYKuAvicZO9naOitiR4xEkjf1 6f1lKNmqVLVKm1xH3mBxexYeGEPxo0RKpsuuDUXvEYgIN1iDEdMKQGQzqC6I2pTS8Qxu UMkQ== X-Forwarded-Encrypted: i=1; AJvYcCUBQklvsy7tJi3WrXf+MhB1MBe6FpWUxhyC5IFACI65usRuu1e9zEfSpsWogR/lKGj2vsH6ax2TguR+@nongnu.org X-Gm-Message-State: AOJu0YzcXzV5aRQgSO/8ZlRjEVB2IY+2PtEjBgE4DQ4EdVzadgcw3SWC 9X3ni2mAaUDjWfuOW0JzSiRglhDJ52BfJlJWzVk2564c3zJjCklT5h5rEQ== X-Gm-Gg: ASbGncthyUfzG5tJDU0rrsGh1XBuDmleHHfMOhT8DykhRQCKGeR9ocwQ9u1k5EtgZ8x c++kRYV4DV4/LjJtbxnup+y/511HlN3TtDYuuIgA+DCE9B/2dy5VrFtLLdc815bjm7KHYxHRiF8 ykhJU18+Nr25cX3Gs+Jmbjm+nx7Msy4F8X3TU0UZgYYlZx5MOptzehCRFzSyPqmDLMJdY1MhrNL 4G4iDoWRkPkGrC2Kz3m4+u8o0I7s5a/wMDZqfJzXDXUO6af586OkMhcbv1nmEK7n0KCLCbDnnhJ Poo= X-Google-Smtp-Source: AGHT+IEdlXartQrmt3BF9c3P+JhldIpvAdRxM7wJgXeS6dUWxgdqTMp2+3ZJc65rFaiWyHfRInn+WA== X-Received: by 2002:a17:906:f5a6:b0:aae:b259:ef6c with SMTP id a640c23a62f3a-aaeb259f285mr2465766266b.0.1735457211916; Sat, 28 Dec 2024 23:26:51 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 11/35] next-cube: move floppy disk MMIO to separate memory region in next-pc Date: Sun, 29 Dec 2024 08:25:02 +0100 Message-ID: <20241229072526.166555-12-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.48; envelope-from=th.huth@gmail.com; helo=mail-ej1-f48.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457319259116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland The dummy floppy disk device is part of the next-pc device, and not related= to the NeXTCube SCRs. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-10-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 61 ++++++++++++++++++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 12 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 402e268f6b..4d7fcdd943 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -108,6 +108,7 @@ struct NeXTPC { =20 M68kCPU *cpu; =20 + MemoryRegion floppy_mem; MemoryRegion mmiomem; MemoryRegion scrmem; =20 @@ -368,11 +369,6 @@ static uint64_t next_scr_readfn(void *opaque, hwaddr a= ddr, unsigned size) uint64_t val; =20 switch (addr) { - case 0x14108: - DPRINTF("FD read @ %x\n", (unsigned int)addr); - val =3D 0x40 | 0x04 | 0x2 | 0x1; - break; - /* * These 4 registers are the hardware timer, not sure which register * is the latch instead of data, but no problems so far. @@ -402,13 +398,6 @@ static void next_scr_writefn(void *opaque, hwaddr addr= , uint64_t val, unsigned size) { switch (addr) { - case 0x14108: - DPRINTF("FDCSR Write: %"PRIx64 "\n", val); - if (val =3D=3D 0x0) { - /* qemu_irq_raise(s->fd_irq[0]); */ - } - break; - /* Hardware timer latch - not implemented yet */ case 0x1a000: default: @@ -948,6 +937,47 @@ static const TypeInfo next_scsi_info =3D { .class_init =3D next_scsi_class_init, }; =20 +static void next_floppy_write(void *opaque, hwaddr addr, uint64_t val, + unsigned size) +{ + switch (addr) { + case 0: + DPRINTF("FDCSR Write: %"PRIx64 "\n", val); + if (val =3D=3D 0x0) { + /* qemu_irq_raise(s->fd_irq[0]); */ + } + break; + + default: + g_assert_not_reached(); + } +} + +static uint64_t next_floppy_read(void *opaque, hwaddr addr, unsigned size) +{ + uint64_t val; + + switch (addr) { + case 0: + DPRINTF("FD read @ %x\n", (unsigned int)addr); + val =3D 0x40 | 0x04 | 0x2 | 0x1; + break; + + default: + g_assert_not_reached(); + } + + return val; +} + +static const MemoryRegionOps next_floppy_ops =3D { + .read =3D next_floppy_read, + .write =3D next_floppy_write, + .valid.min_access_size =3D 1, + .valid.max_access_size =3D 4, + .endianness =3D DEVICE_BIG_ENDIAN, +}; + static void next_escc_init(DeviceState *pcdev) { DeviceState *dev; @@ -1006,6 +1036,10 @@ static void next_pc_realize(DeviceState *dev, Error = **errp) =20 s->scsi_reset =3D qdev_get_gpio_in(d, 0); s->scsi_dma =3D qdev_get_gpio_in(d, 1); + + /* Floppy */ + memory_region_add_subregion(&s->scrmem, 0x14108, + &s->floppy_mem); } =20 static void next_pc_init(Object *obj) @@ -1024,6 +1058,9 @@ static void next_pc_init(Object *obj) sysbus_init_mmio(sbd, &s->scrmem); =20 object_initialize_child(obj, "next-scsi", &s->next_scsi, TYPE_NEXT_SCS= I); + + memory_region_init_io(&s->floppy_mem, OBJECT(s), &next_floppy_ops, s, + "next.floppy", 4); } =20 /* --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457316649841.4961247570186; Sat, 28 Dec 2024 23:28:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnhS-0006Yd-OZ; Sun, 29 Dec 2024 02:26:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnhR-0006YD-9U for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:57 -0500 Received: from mail-ej1-f48.google.com ([209.85.218.48]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhP-00029g-Tl for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:57 -0500 Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-aaec61d0f65so1187740866b.1 for ; Sat, 28 Dec 2024 23:26:55 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.26.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:26:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457214; x=1736062014; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y0TLko33F2MaasDIQT476NGblIvnt2E8jIKb4P34+54=; b=ADC77sc4cP2W26Dg/izOCYTSpVhFiPoRhzWpm/+XvvdcDqhVnMWYKOkHqa2wlnR6jt 99I2tU4iCzXc9EkHPckC/mUF6jVgH7th/G8uozuA8EQ+ZvQABf/vSXgDV5lw5DkJK0LV Fv8NW0M0F18X6QrBVf/dArU4kpzfNm6lWYN8bWUXtujofEsoKyRs42BDunu0vlwwk8as KmqKJEihMBn1IgBnHtCT3nJZHbQrnHc4BT7AdVvLrVvTehNFpHEJr5ePOAFAq54ZV1pw /I+52Z9oOGcdz+k42AUumXtTg35GJpOl77ehmODpGW4ovV60P1StqOeCrnChsmx9uLZy w3lw== X-Forwarded-Encrypted: i=1; AJvYcCUM23oSWMO8jKuImeh0scLlQzddF4RjqKqTPhA8VNW/fA0PWp3tVXkDmYtq/CYNoxRR345Uey50oR1a@nongnu.org X-Gm-Message-State: AOJu0Yy35fdK/gMz+ANVcH0QeOGHbCMBcLDoGyTQrLZwosGEsVOhP96G 0wX0k8yAR4DERHqVNS+eFU3yKaeQo52t7fLIInXVFo7a7q8VY13oSvQRCA== X-Gm-Gg: ASbGnctQOiHFFtjnHhs1bqZYvWD7LDHZcxk2EwvyJAt+RmTuL1b4NumSe6kyLx316na D8CSJZbHAJ6iehkHmNfQaOYtegdB339KCBIbVNmlgcINr8zAEQbSOfWdv9EJXsQux//HX5HBIW0 jabtgC+alKQWJwOAFmfezWmgNJu6EcpIRWODTYZq8IBvCot+KymK29pdj9zti8QwNfgEstB0+oO mUtOUT1lsg/9kdb8iG1q6IBAKE1YHY6sf4iJsKVGFklQdz8NJUgiMUySnoBvD3j+QqiSSlQnfWF xEM= X-Google-Smtp-Source: AGHT+IHMjjUArp9xGeb+wlWNZWsn5pQpSBhiLqU3bnG0kY32kR8uc+hQLx3xssDy2axR2jwoGYr/DA== X-Received: by 2002:a17:907:c03:b0:aab:9361:f8f8 with SMTP id a640c23a62f3a-aac335624cemr2785930166b.50.1735457214452; Sat, 28 Dec 2024 23:26:54 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 12/35] next-cube: map ESCC registers as a subregion of the next.scr memory region Date: Sun, 29 Dec 2024 08:25:03 +0100 Message-ID: <20241229072526.166555-13-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.48; envelope-from=th.huth@gmail.com; helo=mail-ej1-f48.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457317522116600 From: Mark Cave-Ayland Since the ESCC device exists within the memory range of the next.scr memory= region, map the ESCC device registers as a subregion of the next.scr memory region inst= ead of directly to the system address space. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20241222130012.1013374-11-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 4d7fcdd943..6ddd9ad0ec 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -980,6 +980,7 @@ static const MemoryRegionOps next_floppy_ops =3D { =20 static void next_escc_init(DeviceState *pcdev) { + NeXTPC *next_pc =3D NEXT_PC(pcdev); DeviceState *dev; SysBusDevice *s; =20 @@ -997,7 +998,9 @@ static void next_escc_init(DeviceState *pcdev) sysbus_realize_and_unref(s, &error_fatal); sysbus_connect_irq(s, 0, qdev_get_gpio_in(pcdev, NEXT_SCC_I)); sysbus_connect_irq(s, 1, qdev_get_gpio_in(pcdev, NEXT_SCC_DMA_I)); - sysbus_mmio_map(s, 0, 0x2118000); + + memory_region_add_subregion(&next_pc->scrmem, 0x18000, + sysbus_mmio_get_region(s, 0)); } =20 static void next_pc_reset(DeviceState *dev) --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 173545732025485.5533452049267; Sat, 28 Dec 2024 23:28:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnhU-0006ZD-UH; Sun, 29 Dec 2024 02:27:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnhU-0006Z2-17 for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:00 -0500 Received: from mail-ed1-f47.google.com ([209.85.208.47]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhS-0002A7-IU for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:26:59 -0500 Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-5d0d32cd31aso11793368a12.0 for ; Sat, 28 Dec 2024 23:26:58 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.26.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:26:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457217; x=1736062017; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wTxvGFISXS09RDJWJfWcPbX5LopumkcLdvr0lAAgjX4=; b=lNGvG5NA/MZaDCugYUOIHTBUK1ih4PPMrXH2A/Y6gLCa0wLAt0o0Zq+lYIx+tQKn7B fUkhgiw/NjZoqU93u7mIPPArPkwL9FdmsGfvIFFpL7d4OFSlmwUq37lpMSzP1wqKjPgM nfbqyE/ypff6gPc+mNAruQTv8Q/gw47/P7rmbYCOkbQfVztApznDIfO5DZwI8fHt8YGB 30ZZMUm6Ujk4Xb8oUISrXuMR4WNu4YQuleaLlzhX2aNelwK9AWmWEoHW6i0yujIIyOIn 0Hdj2S5xuJMryrWpfsplPduS+WaswptC7TrWhKBeOXEoiIpGVb1GFfNzxrRgH2p9aZuQ i52A== X-Forwarded-Encrypted: i=1; AJvYcCVEM1fBzDUCsCsihwxYSmWi7XEjJVfacgNknr4+F9WzzbU/3Pg+JhylDX3E6qUmwSybhVQ0pFkqDL/W@nongnu.org X-Gm-Message-State: AOJu0YzV3g1lkoX36pF+YUzG4kX3rTTurn8UNhUdwvj6oFeGzrm4EwWG KX5BS2aMR7k9Zd3nK91aWArb06EXxn7zKWXqXFXONd10uh/GfR8H X-Gm-Gg: ASbGncuS4TKlJZU0Ubvw3TSfiHVNFuNwtakTXfGKjwpLhCzIy+Qvr/jEzxzdo0AqEIi 3CFI74ywB+A1VzXj/C+6mVELwxeHS1soDcEGFQMDOOdwSS8sMvpO++InnJ5JpL8ztjmpSNXMQ2l uF38KCynUsYTUaa1DZA2sNq0Nc3OSZEICi/JscOzIlXGsgBLJQOELCR3IDKqxQw1Ll6QGxlGUar cct0w8HM6/WIug3DNIYVOt/LxfTgYuEQQnSRazFEQd/dpJs3T9rw16l5/qhRFHN9r+IN+3uFbs8 ZbA= X-Google-Smtp-Source: AGHT+IFBNkft+S8TNz4Ra+uiSaz1qkNULRSlTIHRYGTktHozzSGBW89rABiQ9Q2gGHcCEu9TrbsZ9Q== X-Received: by 2002:a05:6402:348d:b0:5d4:55e:f99e with SMTP id 4fb4d7f45d1cf-5d81ddc09abmr74171444a12.18.1735457216965; Sat, 28 Dec 2024 23:26:56 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 13/35] next-cube: move ESCC to be QOM child of next-pc device Date: Sun, 29 Dec 2024 08:25:04 +0100 Message-ID: <20241229072526.166555-14-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.208.47; envelope-from=th.huth@gmail.com; helo=mail-ed1-f47.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457321350116600 From: Mark Cave-Ayland Since the ESCC is part of the next-pc device, move the ESCC to be a QOM chi= ld of the next-pc device. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20241222130012.1013374-12-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 54 ++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 6ddd9ad0ec..9f49c33bdd 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -124,6 +124,8 @@ struct NeXTPC { qemu_irq scsi_reset; qemu_irq scsi_dma; =20 + ESCCState escc; + NextRtc rtc; }; =20 @@ -978,31 +980,6 @@ static const MemoryRegionOps next_floppy_ops =3D { .endianness =3D DEVICE_BIG_ENDIAN, }; =20 -static void next_escc_init(DeviceState *pcdev) -{ - NeXTPC *next_pc =3D NEXT_PC(pcdev); - DeviceState *dev; - SysBusDevice *s; - - dev =3D qdev_new(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); - - s =3D SYS_BUS_DEVICE(dev); - sysbus_realize_and_unref(s, &error_fatal); - sysbus_connect_irq(s, 0, qdev_get_gpio_in(pcdev, NEXT_SCC_I)); - sysbus_connect_irq(s, 1, qdev_get_gpio_in(pcdev, NEXT_SCC_DMA_I)); - - memory_region_add_subregion(&next_pc->scrmem, 0x18000, - sysbus_mmio_get_region(s, 0)); -} - static void next_pc_reset(DeviceState *dev) { NeXTPC *s =3D NEXT_PC(dev); @@ -1043,6 +1020,28 @@ static void next_pc_realize(DeviceState *dev, Error = **errp) /* Floppy */ memory_region_add_subregion(&s->scrmem, 0x14108, &s->floppy_mem); + + /* ESCC */ + d =3D DEVICE(&s->escc); + qdev_prop_set_uint32(d, "disabled", 0); + qdev_prop_set_uint32(d, "frequency", 9600 * 384); + qdev_prop_set_uint32(d, "it_shift", 0); + qdev_prop_set_bit(d, "bit_swap", true); + qdev_prop_set_chr(d, "chrB", serial_hd(1)); + qdev_prop_set_chr(d, "chrA", serial_hd(0)); + qdev_prop_set_uint32(d, "chnBtype", escc_serial); + qdev_prop_set_uint32(d, "chnAtype", escc_serial); + + sbd =3D SYS_BUS_DEVICE(d); + if (!sysbus_realize(sbd, errp)) { + return; + } + sysbus_connect_irq(sbd, 0, qdev_get_gpio_in(dev, NEXT_SCC_I)); + sysbus_connect_irq(sbd, 1, qdev_get_gpio_in(dev, NEXT_SCC_DMA_I)); + + memory_region_add_subregion(&s->scrmem, 0x18000, + sysbus_mmio_get_region(sbd, 0)); + } =20 static void next_pc_init(Object *obj) @@ -1064,6 +1063,8 @@ static void next_pc_init(Object *obj) =20 memory_region_init_io(&s->floppy_mem, OBJECT(s), &next_floppy_ops, s, "next.floppy", 4); + + object_initialize_child(obj, "escc", &s->escc, TYPE_ESCC); } =20 /* @@ -1200,9 +1201,6 @@ static void next_cube_init(MachineState *machine) } } =20 - /* Serial */ - next_escc_init(pcdev); - /* TODO: */ /* Network */ =20 --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457568408844.8037947315571; Sat, 28 Dec 2024 23:32:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnhY-0006Zz-NU; Sun, 29 Dec 2024 02:27:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnhW-0006ZV-SP for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:02 -0500 Received: from mail-ed1-f53.google.com ([209.85.208.53]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhV-0002AN-Ak for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:02 -0500 Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5d4e2aa7ea9so14962948a12.2 for ; Sat, 28 Dec 2024 23:27:00 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.26.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:26:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457220; x=1736062020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ugCxO5yyfagZMYJJ0uCQVVshXi6/5tCw+NNyfH9jYgU=; b=Tie90xGxCM2P1xRO3U+uTJ7KwFLM9/87bWQbd/OXjP1dTmDzYNG/sCpSa1qlef/5W0 JjvHg0hm5G9gW2yLz9PKrlodeQT1GOiqdQHiOUs6T1RlV/oSrX6ngrEoXuUjIDCMM2gK XeCWr0kfJszzO26rtuvXA/r6nVG7h7QOagyND3oj5vNqyGU48GPSzEHlwXRdjKEychfh IVLLZLTfB9c2+s8c6I+QGmWID300Kh9jzIsvoXHzKZE3LfvLw/DCWnShpCy/Xr5o0qrq dlKqLl2fVMQs5Y7tvouKneuc94N9cS0VbhKwTYF+hH+WdM+u7osUfCmL7XtG+Du6eAcw ogLg== X-Forwarded-Encrypted: i=1; AJvYcCU5hXIzlLLfEy8JJE8slbtA9d8p5Lulmt3nvp8ADH9qYOEaW7tfTflVEV7vl8hNWZr41ZsVHgUkPEzR@nongnu.org X-Gm-Message-State: AOJu0YxLxG5nIBDj/xOkvx4kL4SRQRx9sjtqArbMDsSOtKdEG3Qm1cAh EDNoM6dYYtwz48n9vKLtDWwYAmDHGCrJgxvPgpOgbeLjGOu896Vu X-Gm-Gg: ASbGnct6/WB1ldV2edAA2b3i0vZTKAiA8FDepY0AZDujt7NiQQrasnLDb86teL8xNYt vOzfFS6kUqMXb2FM2GIWQLkhSoaKbYyRj3UMTWzYye4Yq+ePD7HLtf2TdTzi/PNxUnVzuy/anVY HHtZMUaGxwi6kRTWerXS4OVg40Z+n6gnQa6a6P/37sP8vPMXmSIZqlQzWnngUW91B5oRWhUCkcd 3pI/6QtG5W/ETM/OebKUzWyj86JsaTAUtPAi3P15N44M2zHQAUmoHwgLcQpeSfkVH4UnWHTCr2R CvM= X-Google-Smtp-Source: AGHT+IHTlG2ku5V9n8ZwEEieZpP4YxaEaTl9G3h/EkOCzB2Crmqi8XkXCn7RpBVj90ubZg0r1kCtxQ== X-Received: by 2002:a17:907:c1d:b0:aae:ccbe:993d with SMTP id a640c23a62f3a-aaeccbe9ac9mr2240794266b.35.1735457219550; Sat, 28 Dec 2024 23:26:59 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 14/35] next-cube: move timer MMIO to separate memory region on next-pc device Date: Sun, 29 Dec 2024 08:25:05 +0100 Message-ID: <20241229072526.166555-15-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.208.53; envelope-from=th.huth@gmail.com; helo=mail-ed1-f53.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457570231116600 From: Mark Cave-Ayland Move the timer MMIO accesses to a separate memory region on the next-pc dev= ice instead of being part of the next.scr MMIO memory region. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20241222130012.1013374-13-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 63 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 50 insertions(+), 13 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 9f49c33bdd..ba468ce922 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -109,6 +109,7 @@ struct NeXTPC { M68kCPU *cpu; =20 MemoryRegion floppy_mem; + MemoryRegion timer_mem; MemoryRegion mmiomem; MemoryRegion scrmem; =20 @@ -371,17 +372,6 @@ static uint64_t next_scr_readfn(void *opaque, hwaddr a= ddr, unsigned size) uint64_t val; =20 switch (addr) { - /* - * These 4 registers are the hardware timer, not sure which register - * is the latch instead of data, but no problems so far. - * - * Hack: We need to have the LSB change consistently to make it work - */ - case 0x1a000 ... 0x1a003: - val =3D extract32(clock(), (4 - (addr - 0x1a000) - size) << 3, - size << 3); - break; - /* For now return dummy byte to allow the Ethernet test to timeout */ case 0x6000: val =3D 0xff; @@ -400,8 +390,6 @@ static void next_scr_writefn(void *opaque, hwaddr addr,= uint64_t val, unsigned size) { switch (addr) { - /* Hardware timer latch - not implemented yet */ - case 0x1a000: default: DPRINTF("BMAP Write @ 0x%x with 0x%"PRIx64 " size %u\n", (unsigned int)addr, val, size); @@ -980,6 +968,50 @@ static const MemoryRegionOps next_floppy_ops =3D { .endianness =3D DEVICE_BIG_ENDIAN, }; =20 +static void next_timer_write(void *opaque, hwaddr addr, uint64_t val, + unsigned size) +{ + switch (addr) { + case 0 ... 3: + /* Hardware timer latch - not implemented yet */ + break; + + default: + g_assert_not_reached(); + } +} + +static uint64_t next_timer_read(void *opaque, hwaddr addr, unsigned size) +{ + uint64_t val; + + switch (addr) { + case 0 ... 3: + /* + * These 4 registers are the hardware timer, not sure which regist= er + * is the latch instead of data, but no problems so far. + * + * Hack: We need to have the LSB change consistently to make it wo= rk + */ + val =3D extract32(clock(), (4 - addr - size) << 3, + size << 3); + break; + + default: + g_assert_not_reached(); + } + + return val; +} + +static const MemoryRegionOps next_timer_ops =3D { + .read =3D next_timer_read, + .write =3D next_timer_write, + .valid.min_access_size =3D 1, + .valid.max_access_size =3D 4, + .endianness =3D DEVICE_BIG_ENDIAN, +}; + static void next_pc_reset(DeviceState *dev) { NeXTPC *s =3D NEXT_PC(dev); @@ -1042,6 +1074,8 @@ static void next_pc_realize(DeviceState *dev, Error *= *errp) memory_region_add_subregion(&s->scrmem, 0x18000, sysbus_mmio_get_region(sbd, 0)); =20 + /* Timer */ + memory_region_add_subregion(&s->scrmem, 0x1a000, &s->timer_mem); } =20 static void next_pc_init(Object *obj) @@ -1065,6 +1099,9 @@ static void next_pc_init(Object *obj) "next.floppy", 4); =20 object_initialize_child(obj, "escc", &s->escc, TYPE_ESCC); + + memory_region_init_io(&s->timer_mem, OBJECT(s), &next_timer_ops, s, + "next.timer", 4); } =20 /* --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457768450152.23254441403822; Sat, 28 Dec 2024 23:36:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnhZ-0006a9-Bj; Sun, 29 Dec 2024 02:27:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnhY-0006Zj-9z for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:04 -0500 Received: from mail-ej1-f47.google.com ([209.85.218.47]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhW-0002AT-Pu for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:04 -0500 Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-aaec61d0f65so1187748466b.1 for ; Sat, 28 Dec 2024 23:27:02 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.26.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457221; x=1736062021; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GCDyP0HU91an/SgNVURIRYR9ahqGS4imiUg5gQkD/5Q=; b=dx39hVDsKi/5qkhT+B7P1UDdVUU/msb+y3X2rM5ayIbHXfD+cb5uYr/gQJVSlwPYsC 5uW3o/YXYdNvtaHGES029OQSevasdKoUTXmv7/jNLz5Uz3+XRYrhnL/J6aHrTeYheYYc A0VOUawcAFZg4OPlFAiyhaFMuCsOE4lEAIORM6xOIEe4asB0AlCowtZwYMDm+mnnIeEj MYjlh+PBlSEtna0UmkdMcZnBnFmePB+Qr8n5CHTEzAoswWeMUkqJB68alvhl/DR8ddIU kPe5poQNYE1lFzSm1Zz/5UfdRAGBaFaXRGzsOWziMtyPTCaaVxMmQmAOosw5AKPyBHmG rfMg== X-Forwarded-Encrypted: i=1; AJvYcCXjOHGprI1MWy2WxHoeu6+1WJjyGTxO1ddayyL0iVpA6hZpfRsI3q6fv4Pjd23ISsinb559nbCI1hMr@nongnu.org X-Gm-Message-State: AOJu0YxrUonqEQtJ3EKBVGcJk7zgRJTuaksH2EBPyfWA5z+Q21wfJh/Z WcGVL5Tn1hoIjPo71KMw3y9poMIRqDXzpbDxgCcfXL3y68TO8DPfDOHTfg== X-Gm-Gg: ASbGncsuelZi7PY6DjbEjTPWpF9jgO0nuavu/xuOexI1L/A1D+F17ggFN2ySTmZVVkT GKuGgnw7+a1utvWow6gf7Oj+Fqs2OiX0Yr7rntz78RENXBVWBaHhLqPzepE5eTVUEaxnXPir+mc KEB7lYtUSiMva/JamGCpDmRuzDiuBtlGffb6xJyn/mTf8rtALJIoaZA0B6peoPQh3zLQyku+cBN sF1D5RSRtcrSG9jz5D0XLLjqC1DO7EanSjYz9DvO+xE8ZLMVt/9QvZKfiRtRMXNSZBgO43L7Bxl Fmw= X-Google-Smtp-Source: AGHT+IFYeGWG/ZAMES4LwkvoOFO8eWlzW+G2WkuBc11XqDj5bj8NWcbfZLzxMX6GstxmDbWxSdREBw== X-Received: by 2002:a17:907:96a0:b0:aa6:7feb:193f with SMTP id a640c23a62f3a-aac2ad81a25mr3086979766b.20.1735457221313; Sat, 28 Dec 2024 23:27:01 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 15/35] next-cube: move en ethernet MMIO to separate memory region on next-pc device Date: Sun, 29 Dec 2024 08:25:06 +0100 Message-ID: <20241229072526.166555-16-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.47; envelope-from=th.huth@gmail.com; helo=mail-ej1-f47.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457768778116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland Move the en ethernet MMIO accesses to a separate memory region on the next-= pc device instead of being part of the next.scr MMIO memory region. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-14-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 48 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index ba468ce922..97a6f6c472 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -110,6 +110,7 @@ struct NeXTPC { =20 MemoryRegion floppy_mem; MemoryRegion timer_mem; + MemoryRegion dummyen_mem; MemoryRegion mmiomem; MemoryRegion scrmem; =20 @@ -372,11 +373,6 @@ static uint64_t next_scr_readfn(void *opaque, hwaddr a= ddr, unsigned size) uint64_t val; =20 switch (addr) { - /* For now return dummy byte to allow the Ethernet test to timeout */ - case 0x6000: - val =3D 0xff; - break; - default: DPRINTF("BMAP Read @ 0x%x size %u\n", (unsigned int)addr, size); val =3D 0; @@ -1012,6 +1008,38 @@ static const MemoryRegionOps next_timer_ops =3D { .endianness =3D DEVICE_BIG_ENDIAN, }; =20 +static void next_dummy_en_write(void *opaque, hwaddr addr, uint64_t val, + unsigned size) +{ + /* Do nothing */ + return; +} + +static uint64_t next_dummy_en_read(void *opaque, hwaddr addr, unsigned siz= e) +{ + uint64_t val; + + switch (addr) { + case 0: + /* For now return dummy byte to allow the Ethernet test to timeout= */ + val =3D 0xff; + break; + + default: + val =3D 0; + } + + return val; +} + +static const MemoryRegionOps next_dummy_en_ops =3D { + .read =3D next_dummy_en_read, + .write =3D next_dummy_en_write, + .valid.min_access_size =3D 1, + .valid.max_access_size =3D 4, + .endianness =3D DEVICE_BIG_ENDIAN, +}; + static void next_pc_reset(DeviceState *dev) { NeXTPC *s =3D NEXT_PC(dev); @@ -1034,6 +1062,10 @@ static void next_pc_realize(DeviceState *dev, Error = **errp) SysBusDevice *sbd; DeviceState *d; =20 + /* en network (dummy) */ + memory_region_add_subregion(&s->scrmem, 0x6000, + &s->dummyen_mem); + /* SCSI */ sbd =3D SYS_BUS_DEVICE(&s->next_scsi); if (!sysbus_realize(sbd, errp)) { @@ -1093,6 +1125,9 @@ static void next_pc_init(Object *obj) sysbus_init_mmio(sbd, &s->mmiomem); sysbus_init_mmio(sbd, &s->scrmem); =20 + memory_region_init_io(&s->dummyen_mem, OBJECT(s), &next_dummy_en_ops, = s, + "next.en", 0x20); + object_initialize_child(obj, "next-scsi", &s->next_scsi, TYPE_NEXT_SCS= I); =20 memory_region_init_io(&s->floppy_mem, OBJECT(s), &next_floppy_ops, s, @@ -1238,9 +1273,6 @@ static void next_cube_init(MachineState *machine) } } =20 - /* TODO: */ - /* Network */ - /* DMA */ memory_region_init_io(&m->dmamem, NULL, &next_dma_ops, machine, "next.dma", 0x5000); --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 17354573145671005.9885060559733; Sat, 28 Dec 2024 23:28:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnhd-0006ak-BI; Sun, 29 Dec 2024 02:27:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnha-0006aQ-Rn for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:06 -0500 Received: from mail-ed1-f45.google.com ([209.85.208.45]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhZ-0002Al-EE for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:06 -0500 Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-5d3d479b1e6so11449643a12.2 for ; Sat, 28 Dec 2024 23:27:05 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.27.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457224; x=1736062024; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jN7K7JNEyg0RRrGevmD5fTXXIIKMk8NZp3aW6mH533I=; b=eMKIFkDApHOahmF3lRBnDY3Ex1vkS2wnebfRGiFRioh888+NEB0yzfEVQkb+NT7sJK u+ZuLb0OjfdhZGMiUS6cogv6i5j0y/9f1vIlhOwXoL0C7L8OgjvBfHl0KBwKdXFiOfAo HB/I05MrOLbMiJpbGO5ml27h8hq1/mEV2FrdFWuiPPVujuWft4oV7OtIcl/zp5Qv7EsT R1bhCJlYr2vs7D+jlGXLQgyvOaFimD6uhtGqzan+9ufQLwh4w44ISX7g3pacgI3sspak Xi/BaUjoyxVa34hj2MBkIvbGZpPEFdEbrVavkkCHJLgP/D2SrSL4fLXE6gsdccfx0OHd BLYg== X-Forwarded-Encrypted: i=1; AJvYcCWUcXX0xmTdE1R2R4qVZ+MEaisYiFI3lOfsnjS2ajusozmG0gCaA4h7o7R5p8fExytehB6voMv/9lhP@nongnu.org X-Gm-Message-State: AOJu0YyyCfP34b5sJoTpfY2DZJppfRJyBPiW9I7ULaksNIe1LNOVSsIP kwu2y1pt2meKru821xx2X35n5kR5pWh1Hms8KU59XRzsGfI/TC4AyPMTKA== X-Gm-Gg: ASbGncuvlKUoGlGbn6q/x3sKzwmOUo0Wx56a+oMnkHWdDXltx8ON1A1n3hSIijpBrsv e2DRL1ohl0KOv1o2qnZEc+OM7JWv2OhMbvlsmNhqRq9yTaHBgc3JvODAr52Hkp+et7Bj9unhGMB kPuRQGqd2SKiJIgBGjkGrgnd1dOV6X06csQubPv0qUrahnj2ntGxipbRV2SATx/ASE/jN1xfk8K 6HaVg3soEF9VHFLQtn3FVYVPNGcir2riso8ZvG9GtKgrSqcGdwvWdVkwEnkjRxeEPaGKSKk/tJV kwc= X-Google-Smtp-Source: AGHT+IEgVZFU+wJ5r1umzxmfRlBXncVdS2bZXXLTlAS0nls6KVQ45ikJzGj+0NkQUWTu9+YGIw+VSA== X-Received: by 2002:a05:6402:540b:b0:5d6:48ef:c19f with SMTP id 4fb4d7f45d1cf-5d81de1c28fmr75252062a12.29.1735457223852; Sat, 28 Dec 2024 23:27:03 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 16/35] next-cube: add empty slots for unknown accesses to next.scr memory region Date: Sun, 29 Dec 2024 08:25:07 +0100 Message-ID: <20241229072526.166555-17-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.208.45; envelope-from=th.huth@gmail.com; helo=mail-ed1-f45.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457315362116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland The next.scr memory is now effectively unused, however there are 3 separate= region accesses still logged that occur when booting a NeXTStep disk image. Use the empty_slot device to capture and ignore memory accesses to these 3 memory r= egions. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-15-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/Kconfig | 1 + hw/m68k/next-cube.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/hw/m68k/Kconfig b/hw/m68k/Kconfig index 0092cda4e9..aff769b30f 100644 --- a/hw/m68k/Kconfig +++ b/hw/m68k/Kconfig @@ -18,6 +18,7 @@ config NEXTCUBE depends on M68K select FRAMEBUFFER select ESCC + select EMPTY_SLOT =20 config Q800 bool diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 97a6f6c472..6ca9170108 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -22,6 +22,7 @@ #include "qom/object.h" #include "hw/char/escc.h" /* ZILOG 8530 Serial Emulation */ #include "hw/block/fdc.h" +#include "hw/misc/empty_slot.h" #include "hw/qdev-properties.h" #include "qapi/error.h" #include "qemu/error-report.h" @@ -1238,6 +1239,13 @@ static void next_cube_init(MachineState *machine) /* BMAP IO - acts as a catch-all for now */ sysbus_mmio_map(SYS_BUS_DEVICE(pcdev), 1, 0x02100000); =20 + /* unknown: Brightness control register? */ + empty_slot_init("next.unknown.0", 0x02110000, 0x10); + /* unknown: Magneto-Optical drive controller? */ + empty_slot_init("next.unknown.1", 0x02112000, 0x10); + /* unknown: Serial clock configuration register? */ + empty_slot_init("next.unknown.2", 0x02118004, 0x10); + /* BMAP memory */ memory_region_init_ram_flags_nomigrate(&m->bmapm1, NULL, "next.bmapmem= ", 64, RAM_SHARED, &error_fatal); --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457592793152.38191798895434; Sat, 28 Dec 2024 23:33:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnhe-0006b8-Ot; Sun, 29 Dec 2024 02:27:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnhd-0006aw-S8 for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:09 -0500 Received: from mail-ed1-f52.google.com ([209.85.208.52]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhc-0002Aw-5a for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:09 -0500 Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5d7e527becaso13380405a12.3 for ; Sat, 28 Dec 2024 23:27:07 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.27.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457226; x=1736062026; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i4l+TGHlXOBajtfUIglTchzUa6DZDsxbmzAyjdJQacs=; b=lf+ZVmriNmfMiWIHnznIJr0ru8cf+ZUi9uH27a3tbowMIa+JJLEQyb5L/oqQJ0lEQz 9cgYghh/rwS+6Kp5idDJigqC1Y+TL/vQyQsRZNKVZhelwGT6ysXVJNFbiFlHZB7zGQsS 5izSo7/jgBNz5GGQ6a6FSU5tYxHxpx50nq/ruRhzQxjtEaEt2tJu9fvvyclkcvAGbOVg j31UbYy9+D8ZL8IENXPLs90IX2efRhqkWKqfbzsu8vV2hsgCTgq6o/bWcAMEB1GnUV7F dNVbEdVV+vTWhOVCA20DnRzNTnm009eH7P9kFrwD04MVMGa23C9zrMEirvG/gVL6hPba J4Vw== X-Forwarded-Encrypted: i=1; AJvYcCURhht7p5uUAJ+m5Fyg9ENgGefqU5h4i0QHlDQyxwO5WvV7y7yBHYytEWTEar/RC4NX7vUJqmPU6Pno@nongnu.org X-Gm-Message-State: AOJu0YxVAg/FFkcCRJAUKOneo8XEXuHAKWoFmUp/snQz/ueXRktb+lgU vwz5PXgyxZHTmJOmTJKzl1haakcK6MGK8++ivAJ/nLyxVH6QN+DD X-Gm-Gg: ASbGnculiAJWfSF8EJoA94ih4M7KUjBlIC0/agH7pDDNmxNv0dGAOUXkyfaFRe32sNw Ua/IgS6neQYXk8LN536Don7bc9PMSTcYnggK8xCex40GjcUMGLFkll59pZkrQrVjMmIKadShEp0 8t0rTtAVBRFFAcrh3im6qjgodzGhi6dX+PjIr1t8RsQW41omeb/+P7t6vzh2tJiRc6s31mUgRyq hQ8nPetorjJECi2GyrT7qE6iZherhYsRVMPjrd136+g+My5M/UMfV2X5s1aihVsGZJb1pnB3mQ0 MdY= X-Google-Smtp-Source: AGHT+IFHK/AsFRSwlXIsHkLKFfrsPQ/pqefIt3wxAU1U3u2GWl4YXoUkZSDO4uOR5jkrm8aKV/IwWg== X-Received: by 2002:a05:6402:270d:b0:5d0:fb56:3f with SMTP id 4fb4d7f45d1cf-5d81dd9cdf0mr70072915a12.12.1735457226192; Sat, 28 Dec 2024 23:27:06 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 17/35] next-cube: remove unused next.scr memory region Date: Sun, 29 Dec 2024 08:25:08 +0100 Message-ID: <20241229072526.166555-18-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.208.52; envelope-from=th.huth@gmail.com; helo=mail-ed1-f52.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457594326116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland Now that the next.scr memory region is unused it can be removed and the nex= t-pc devices mapped directly within the machine init function. This is the last remaining overlapping memory region within the NeXTCube machine. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-16-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 73 +++++++++++++-------------------------------- 1 file changed, 21 insertions(+), 52 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 6ca9170108..73c4d4ea9c 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -369,38 +369,6 @@ static const MemoryRegionOps next_mmio_ops =3D { #define SCSICSR_CPUDMA 0x10 /* if set, dma enabled */ #define SCSICSR_INTMASK 0x20 /* if set, interrupt enabled */ =20 -static uint64_t next_scr_readfn(void *opaque, hwaddr addr, unsigned size) -{ - uint64_t val; - - switch (addr) { - default: - DPRINTF("BMAP Read @ 0x%x size %u\n", (unsigned int)addr, size); - val =3D 0; - break; - } - - return val; -} - -static void next_scr_writefn(void *opaque, hwaddr addr, uint64_t val, - unsigned size) -{ - switch (addr) { - default: - DPRINTF("BMAP Write @ 0x%x with 0x%"PRIx64 " size %u\n", - (unsigned int)addr, val, size); - } -} - -static const MemoryRegionOps next_scr_ops =3D { - .read =3D next_scr_readfn, - .write =3D next_scr_writefn, - .valid.min_access_size =3D 1, - .valid.max_access_size =3D 4, - .endianness =3D DEVICE_BIG_ENDIAN, -}; - #define NEXTDMA_SCSI(x) (0x10 + x) #define NEXTDMA_FD(x) (0x10 + x) #define NEXTDMA_ENTX(x) (0x110 + x) @@ -1063,17 +1031,11 @@ static void next_pc_realize(DeviceState *dev, Error= **errp) SysBusDevice *sbd; DeviceState *d; =20 - /* en network (dummy) */ - memory_region_add_subregion(&s->scrmem, 0x6000, - &s->dummyen_mem); - /* SCSI */ sbd =3D SYS_BUS_DEVICE(&s->next_scsi); if (!sysbus_realize(sbd, errp)) { return; } - memory_region_add_subregion(&s->scrmem, 0x14000, - sysbus_mmio_get_region(sbd, 0)); =20 d =3D DEVICE(object_resolve_path_component(OBJECT(&s->next_scsi), "esp= ")); sysbus_connect_irq(SYS_BUS_DEVICE(d), 0, @@ -1082,10 +1044,6 @@ static void next_pc_realize(DeviceState *dev, Error = **errp) s->scsi_reset =3D qdev_get_gpio_in(d, 0); s->scsi_dma =3D qdev_get_gpio_in(d, 1); =20 - /* Floppy */ - memory_region_add_subregion(&s->scrmem, 0x14108, - &s->floppy_mem); - /* ESCC */ d =3D DEVICE(&s->escc); qdev_prop_set_uint32(d, "disabled", 0); @@ -1103,12 +1061,6 @@ static void next_pc_realize(DeviceState *dev, Error = **errp) } sysbus_connect_irq(sbd, 0, qdev_get_gpio_in(dev, NEXT_SCC_I)); sysbus_connect_irq(sbd, 1, qdev_get_gpio_in(dev, NEXT_SCC_DMA_I)); - - memory_region_add_subregion(&s->scrmem, 0x18000, - sysbus_mmio_get_region(sbd, 0)); - - /* Timer */ - memory_region_add_subregion(&s->scrmem, 0x1a000, &s->timer_mem); } =20 static void next_pc_init(Object *obj) @@ -1120,24 +1072,27 @@ static void next_pc_init(Object *obj) =20 memory_region_init_io(&s->mmiomem, OBJECT(s), &next_mmio_ops, s, "next.mmio", 0x9000); - memory_region_init_io(&s->scrmem, OBJECT(s), &next_scr_ops, s, - "next.scr", 0x20000); - sysbus_init_mmio(sbd, &s->mmiomem); - sysbus_init_mmio(sbd, &s->scrmem); =20 memory_region_init_io(&s->dummyen_mem, OBJECT(s), &next_dummy_en_ops, = s, "next.en", 0x20); + sysbus_init_mmio(sbd, &s->dummyen_mem); =20 object_initialize_child(obj, "next-scsi", &s->next_scsi, TYPE_NEXT_SCS= I); + sysbus_init_mmio(sbd, + sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->next_scsi),= 0)); =20 memory_region_init_io(&s->floppy_mem, OBJECT(s), &next_floppy_ops, s, "next.floppy", 4); + sysbus_init_mmio(sbd, &s->floppy_mem); =20 object_initialize_child(obj, "escc", &s->escc, TYPE_ESCC); + sysbus_init_mmio(sbd, + sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->escc), 0)); =20 memory_region_init_io(&s->timer_mem, OBJECT(s), &next_timer_ops, s, "next.timer", 4); + sysbus_init_mmio(sbd, &s->timer_mem); } =20 /* @@ -1239,13 +1194,27 @@ static void next_cube_init(MachineState *machine) /* BMAP IO - acts as a catch-all for now */ sysbus_mmio_map(SYS_BUS_DEVICE(pcdev), 1, 0x02100000); =20 + /* en network (dummy) */ + sysbus_mmio_map(SYS_BUS_DEVICE(pcdev), 1, 0x02106000); + /* unknown: Brightness control register? */ empty_slot_init("next.unknown.0", 0x02110000, 0x10); /* unknown: Magneto-Optical drive controller? */ empty_slot_init("next.unknown.1", 0x02112000, 0x10); + + /* SCSI */ + sysbus_mmio_map(SYS_BUS_DEVICE(pcdev), 2, 0x02114000); + /* Floppy */ + sysbus_mmio_map(SYS_BUS_DEVICE(pcdev), 3, 0x02114108); + /* ESCC */ + sysbus_mmio_map(SYS_BUS_DEVICE(pcdev), 4, 0x02118000); + /* unknown: Serial clock configuration register? */ empty_slot_init("next.unknown.2", 0x02118004, 0x10); =20 + /* Timer */ + sysbus_mmio_map(SYS_BUS_DEVICE(pcdev), 5, 0x0211a000); + /* BMAP memory */ memory_region_init_ram_flags_nomigrate(&m->bmapm1, NULL, "next.bmapmem= ", 64, RAM_SHARED, &error_fatal); --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457346498235.01124152679586; Sat, 28 Dec 2024 23:29:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRniA-0006vH-S0; Sun, 29 Dec 2024 02:27:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnhh-0006d1-F8 for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:16 -0500 Received: from mail-ej1-f43.google.com ([209.85.218.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhe-0002B9-7E for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:11 -0500 Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-aa67f31a858so1492559766b.2 for ; Sat, 28 Dec 2024 23:27:09 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.27.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457229; x=1736062029; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DwMuN75c9NjsqQ/BaCCQ0FGhDQvIu13vYaZ8NeniCDw=; b=oogBPqWikHQCSmH4oPtNw41VVCmhCqCydgM5gDwdP8yWgBcne+8Rt1i8/lURIl6RZx qpaBEPrlKj86ZyYdF6E5uLogrDMzspnnbLVwYIf5DUApaeOpS4rRzxUnq+JvUO2jrvdt r3YPiMPWhmUeLC8po9TKdf1d3Ojhpkl0Pw36EPanhLgIFnyM796hHV4EkWJsWM6+wH2f B6/Gzr0oBCqi7NhYvUckRCW8wdB4lVg+8s/zgJeHwt6Z0f7iI8ClHG9zHy5zYlcBLz5v LUVrq3C3059qCw7F5faQshomp/DQWXbF+Wg0bK9x7UMMtknFXVfaPngRtU5ui/Bb9cUy AT3Q== X-Forwarded-Encrypted: i=1; AJvYcCXjDTY79T0DHAdDQgRfm7Rvj1RHof1R+ILrDP4zsp6Zl6LbdR46PCbbFYa01WE/GTj69t0rEWbSKO5D@nongnu.org X-Gm-Message-State: AOJu0Yz1jUomYRglaj6Aub7JkFD4kzVmSEWbprox9ZU/z7SeFG+jcExP CuW6+JsYJ1+F6gmdOlFL0/CnNpS9rgrIrkXpT3cmPQeZ73J0XWzO X-Gm-Gg: ASbGnctB3IV4CKfe1PiGCa4+i9SEyBvqoTb4bHT6gsth8+uX8+PFbDgXx73pPIfiEw/ a75rfN8UX+byuFShsvYnHpad8svuVyAMdi3QXsMGxikH9FgATWkpguYzYXmrdzmvZWXb8SYC8XY 0qB/HAAbgywZ+yBLbYE9aAgG33AH0ny9ZG93lPeRv9nBzF2MI4SkcbxHT+FMPrTOVWtsrRx7YCI mi7cX/KgPC4SphCnQQshfVSayrU9U+DB1gbaZy1TU35tsovH+G0URp6ad6sAyNh2wplossNLfhE Emg= X-Google-Smtp-Source: AGHT+IE/fRKGol2OR7aC/FD+P5mFMGTcUbXsBdfVWglPWKCo8Lk9ZXPAwrPwuFEWfNdUdv8XASO8Jg== X-Received: by 2002:a17:907:9689:b0:aae:ee49:e000 with SMTP id a640c23a62f3a-aaeee49e11dmr1441065966b.18.1735457228453; Sat, 28 Dec 2024 23:27:08 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 18/35] next-cube: rearrange NeXTState declarations to improve readability Date: Sun, 29 Dec 2024 08:25:09 +0100 Message-ID: <20241229072526.166555-19-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.43; envelope-from=th.huth@gmail.com; helo=mail-ej1-f43.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457347389116600 From: Mark Cave-Ayland Move the NeXTState, next_dma and TYPE_NEXT_MACHINE definition to the same a= rea at the top of next-cube.c. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20241222130012.1013374-17-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 64 ++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 73c4d4ea9c..0cf4470ce8 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -38,30 +38,10 @@ #define DPRINTF(fmt, ...) do { } while (0) #endif =20 -#define TYPE_NEXT_MACHINE MACHINE_TYPE_NAME("next-cube") -OBJECT_DECLARE_SIMPLE_TYPE(NeXTState, NEXT_MACHINE) - #define ENTRY 0x0100001e #define RAM_SIZE 0x4000000 #define ROM_FILE "Rev_2.5_v66.bin" =20 -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 NextRtc { int8_t phase; uint8_t ram[32]; @@ -72,18 +52,6 @@ typedef struct NextRtc { uint8_t retval; } NextRtc; =20 -struct NeXTState { - MachineState parent; - - MemoryRegion rom; - MemoryRegion rom2; - MemoryRegion dmamem; - MemoryRegion bmapm1; - MemoryRegion bmapm2; - - next_dma dma[10]; -}; - #define TYPE_NEXT_SCSI "next-scsi" OBJECT_DECLARE_SIMPLE_TYPE(NeXTSCSI, NEXT_SCSI) =20 @@ -132,6 +100,38 @@ struct NeXTPC { NextRtc rtc; }; =20 +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; + +#define TYPE_NEXT_MACHINE MACHINE_TYPE_NAME("next-cube") +OBJECT_DECLARE_SIMPLE_TYPE(NeXTState, NEXT_MACHINE) + +struct NeXTState { + MachineState parent; + + MemoryRegion rom; + MemoryRegion rom2; + MemoryRegion dmamem; + MemoryRegion bmapm1; + MemoryRegion bmapm2; + + next_dma dma[10]; +}; + /* Thanks to NeXT forums for this */ /* static const uint8_t rtc_ram3[32] =3D { --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457594290246.27939255626495; Sat, 28 Dec 2024 23:33:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRniE-0007LW-CF; Sun, 29 Dec 2024 02:27:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnhl-0006j9-8r for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:21 -0500 Received: from mail-ej1-f51.google.com ([209.85.218.51]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhh-0002Ba-8B for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:16 -0500 Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-aa69077b93fso1197371366b.0 for ; Sat, 28 Dec 2024 23:27:11 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.27.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457231; x=1736062031; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gFWsx6elcziOUVCYZBguRZxlSU/L1G/iY9+fG5LR1KA=; b=YPxvYOs53zsY9KbZAt6onc49+ucIZjROPJQWXyHozGN1cPl6VzkeJxn8oPUQpStTPQ hKIwTJoC4IUaAbo8qt1lG/GN9Wc8d+bNRR04Iu0xfchT7quu9ggYn+9Qr0vmTvQEe4/w gEK87gyaLuWntbuY0dcjE8QdczA/x+e811O2y832H6i5mzccOlqnLCPQ3Y+ywDnbAJ1/ 48BQ+swgJZwGU3sZVQpMNsHW82RP/4M9hCR0ab05fl4ddxlVlxlBv1NR9h0we8KhAB1K L1AsD7jiokGubwc0Iw1oVwUl6iNZPFFNdtMXseKW6LM6wyux/0ejaJMO79uQlX40gPFL 9NDw== X-Forwarded-Encrypted: i=1; AJvYcCV7iHYHpRovObybX22DbSMpqa8DwnuvsHi/YtvuXolTT4HhLedBPQp3OTGMLbQfCaIex/VFB4OXVwz+@nongnu.org X-Gm-Message-State: AOJu0YyA0g3+cKNDZkOno7rB664RFptuDZgsSgrvKwJKpWakUzT8tZqu I39qdeRWnjiUdMLj9MRohYs9y+4Rj5HFZJHpYMCjLMGI7q9rpfDf X-Gm-Gg: ASbGncuDwQF2rPs7VWCLNTZbyKXMLAHPNU1HihxqAlHfvO5+FKQ8YwOaSpDw165tayf 4tQnzVtlCIhJzwGDcq+m19/8nGFlVYTVaoO7SVeAUEUBlCRbowC/QzaYNfYYys2ifo3AGOwniwh qlIt8b6V4vZE7r0P1m3xDWNbJKRnRmDTloFudgtYMdQZDSUwERamcDal9TM2yFjeHGd2qZ+b2pE MX941MOxjCuUjZoGkeW+hxSMnh65wIf4itgTdj6vsdupZgUMv/8PZnOcGSXGO8kGoTP+TmqrmsH /9I= X-Google-Smtp-Source: AGHT+IFuPE+U/rLxKNq1p8a/FgcCF2/nOJSJWy/xF/6Ebr/oA++QBz7YpoNPAiI//mI2v88X4nVFeQ== X-Received: by 2002:a17:906:4fce:b0:aab:73c5:836 with SMTP id a640c23a62f3a-aac334c3d70mr3317532166b.32.1735457230692; Sat, 28 Dec 2024 23:27:10 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 19/35] next-cube: convert next-pc device to use Resettable interface Date: Sun, 29 Dec 2024 08:25:10 +0100 Message-ID: <20241229072526.166555-20-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.51; envelope-from=th.huth@gmail.com; helo=mail-ej1-f51.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457596174116600 From: Mark Cave-Ayland Signed-off-by: Mark Cave-Ayland Acked-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20241222130012.1013374-18-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 0cf4470ce8..091e05465e 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -1009,9 +1009,9 @@ static const MemoryRegionOps next_dummy_en_ops =3D { .endianness =3D DEVICE_BIG_ENDIAN, }; =20 -static void next_pc_reset(DeviceState *dev) +static void next_pc_reset_hold(Object *obj, ResetType type) { - NeXTPC *s =3D NEXT_PC(dev); + NeXTPC *s =3D NEXT_PC(obj); =20 /* Set internal registers to initial values */ /* 0x0000XX00 << vital bits */ @@ -1140,12 +1140,13 @@ static const VMStateDescription next_pc_vmstate =3D= { static void next_pc_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 dc->desc =3D "NeXT Peripheral Controller"; dc->realize =3D next_pc_realize; - device_class_set_legacy_reset(dc, next_pc_reset); device_class_set_props(dc, next_pc_properties); dc->vmsd =3D &next_pc_vmstate; + rc->phases.hold =3D next_pc_reset_hold; } =20 static const TypeInfo next_pc_info =3D { --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457294259982.0944328351958; Sat, 28 Dec 2024 23:28:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRniF-0007X9-US; Sun, 29 Dec 2024 02:27:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnhn-0006jM-4N for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:22 -0500 Received: from mail-ej1-f47.google.com ([209.85.218.47]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhj-0002Bu-4v for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:17 -0500 Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-aa6a92f863cso1340222966b.1 for ; Sat, 28 Dec 2024 23:27:14 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457233; x=1736062033; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+X3ya5rXN39/mO09hGL80z1v7BeQ/OkCOt3Wnid8T5s=; b=HtTZeDSyThy2r9LE3CObeXTxb/ECNrRWURMhdoRTA6jJs8lM1KyLBh8K1fzxccSc9N loojxxOU/ipVRjhx8x5f9Vy3C1ckB5ftqUt/rDdlaJA96Vy12/QwuocAL1fr5cDsdyQf kADpHVdxFEUTbQmYjnWCzTHQcr0lEaf0TaM2TeR2SfUUi40HSaBmN1r/VJ07tGnvdQnP ACPTk1itwyrgXv64Q44nk9iNSIwUHowcis9mTT/zPBCmuxibRZSj0/+TtWk7m1ra9E30 TqCyIoyLiIr7V4jllgBNSKVrqbnZQbfcU7vyIVfjFwrecsSAnQR/ZqPiTbMUQXMDX2u6 iL8w== X-Forwarded-Encrypted: i=1; AJvYcCWzKGsYIHtf6Z7L1ulCbKRf1yMb7hUdbqUTxjd4Cs0fk2KfHnodvwJZSSVeaLxEIM8kSDZZKB+gfzDb@nongnu.org X-Gm-Message-State: AOJu0Yx8tp9ZwRgbHZqoj1txqF1LoGz89iJgghrGFlhKW0yZOPfFSUYa aigy72Vp5HF2+2z8AYW5D/1F13cMG0iF/PePwsPtVxlqoP0A82MiNTCSQg== X-Gm-Gg: ASbGncuQo1tM0b/o1r9od9lGmXkvN+1jKi66V+pPB4q22uMN1pm+OX0HInnwEBaXtTL Xqg0dPeiSK53XJIk69CnlxL1hDXedYvqtmriSs3jP8KC29mH/RNYWhVg6LkE/FclCwH+OE/MfZ0 KQ7peomuJMsb8LcL3smph4Sc7MObAdjH4d9TqqrqM1ubXbeUrn86xo5s2Solgp/PGxHt0PTKxs+ 6qXM/SwnQFSxkr0y2ki1KB+svkHFY1cb0IAD9ZVbOUShIBpJNMdiXBNaU8R/dDGIl6LXyBf5Pg6 JDs= X-Google-Smtp-Source: AGHT+IEf3RvAXH84sVIcbuXTAyGkk3DbkuGZNU3gylLckm2xgb204IqdYv7VUd8ZBny1s5bedv2qug== X-Received: by 2002:a17:907:728c:b0:aa6:6c08:dc79 with SMTP id a640c23a62f3a-aac2cf50e65mr2583230766b.35.1735457233314; Sat, 28 Dec 2024 23:27:13 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 20/35] next-cube: rename typedef struct NextRtc to NeXTRTC Date: Sun, 29 Dec 2024 08:25:11 +0100 Message-ID: <20241229072526.166555-21-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.47; envelope-from=th.huth@gmail.com; helo=mail-ej1-f47.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457295646116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland This brings the capitalisation in line with the other NeXTCube definitions. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-19-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 091e05465e..19b9100094 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -42,7 +42,7 @@ #define RAM_SIZE 0x4000000 #define ROM_FILE "Rev_2.5_v66.bin" =20 -typedef struct NextRtc { +typedef struct NeXTRTC { int8_t phase; uint8_t ram[32]; uint8_t command; @@ -50,7 +50,7 @@ typedef struct NextRtc { uint8_t status; uint8_t control; uint8_t retval; -} NextRtc; +} NeXTRTC; =20 #define TYPE_NEXT_SCSI "next-scsi" OBJECT_DECLARE_SIMPLE_TYPE(NeXTSCSI, NEXT_SCSI) @@ -97,7 +97,7 @@ struct NeXTPC { =20 ESCCState escc; =20 - NextRtc rtc; + NeXTRTC rtc; }; =20 typedef struct next_dma { @@ -167,7 +167,7 @@ static void next_scr2_led_update(NeXTPC *s) static void next_scr2_rtc_update(NeXTPC *s) { uint8_t old_scr2, scr2_2; - NextRtc *rtc =3D &s->rtc; + NeXTRTC *rtc =3D &s->rtc; =20 old_scr2 =3D extract32(s->old_scr2, 8, 8); scr2_2 =3D extract32(s->scr2, 8, 8); @@ -1110,13 +1110,13 @@ static const VMStateDescription next_rtc_vmstate = =3D { .version_id =3D 2, .minimum_version_id =3D 2, .fields =3D (const VMStateField[]) { - VMSTATE_INT8(phase, NextRtc), - VMSTATE_UINT8_ARRAY(ram, NextRtc, 32), - VMSTATE_UINT8(command, NextRtc), - VMSTATE_UINT8(value, NextRtc), - VMSTATE_UINT8(status, NextRtc), - VMSTATE_UINT8(control, NextRtc), - VMSTATE_UINT8(retval, NextRtc), + VMSTATE_INT8(phase, NeXTRTC), + VMSTATE_UINT8_ARRAY(ram, NeXTRTC, 32), + VMSTATE_UINT8(command, NeXTRTC), + VMSTATE_UINT8(value, NeXTRTC), + VMSTATE_UINT8(status, NeXTRTC), + VMSTATE_UINT8(control, NeXTRTC), + VMSTATE_UINT8(retval, NeXTRTC), VMSTATE_END_OF_LIST() }, }; @@ -1132,7 +1132,7 @@ static const VMStateDescription next_pc_vmstate =3D { VMSTATE_UINT32(int_mask, NeXTPC), VMSTATE_UINT32(int_status, NeXTPC), VMSTATE_UINT32(led, NeXTPC), - VMSTATE_STRUCT(rtc, NeXTPC, 0, next_rtc_vmstate, NextRtc), + VMSTATE_STRUCT(rtc, NeXTPC, 0, next_rtc_vmstate, NeXTRTC), VMSTATE_END_OF_LIST() }, }; --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457718091906.1153609409938; Sat, 28 Dec 2024 23:35:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRniD-0007I2-S7; Sun, 29 Dec 2024 02:27:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnhp-0006jV-0Z for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:26 -0500 Received: from mail-ed1-f53.google.com ([209.85.208.53]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhm-0002C5-U1 for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:20 -0500 Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5d3ecae02beso10066151a12.0 for ; Sat, 28 Dec 2024 23:27:17 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457236; x=1736062036; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LIkWul9PfyaP4XPHUd7oxej4ykz8QWuqnHdgbRarPHo=; b=DVfF3DENlGr9n8Y0rGThYsgJyKhZn5IX5DRuI0UyuMJUODuQfssxHfzU4fO3qj2IY4 oKDHYrrD5y3Qjigr1M4cCh6TuNUwkke0GyRdu11hXN5yWhtT49Q6tin2EMewW2z0msQj F2FZqirZkwsHvntIXB/iETlkWug7Q9WG2YgY7OtJ4Z5MOoakfgS0eRrSVplal5zMPqNJ jstAwbtZdqYdGhXVDgSqTWllNHi/39rCYbPGFp476Cwk2Cjc8Wam/gNRBtfbtWSzfwFm k8a1RRa/cZpuGDuAfFjHoItExjmUDQvpDdMfh3KILoiSaUiG2v+B1Cg/h0OwD60OW+KD Jirg== X-Forwarded-Encrypted: i=1; AJvYcCWH4VaGmy9fnZz1m+l9clMNU2yFxJ7WfUqzfsGqv9JufJg+ujcLj/bbrtb4e3vLoQRqHvySroIbzITL@nongnu.org X-Gm-Message-State: AOJu0YxQlsjRgPP32n2ViOxG+FYdFfGU+VNPO0/nt35i1623zekrQuJN Qef8vU6BFsv+S3Mg+K92VC2M/DCuGiHiZgM+AgGUu1WamdavScS/ X-Gm-Gg: ASbGncsk4zI9VJecIMoVIf0O+7Rcm5Fe6MF8NZNmNVA8ZoX7wCL4WJOtRcBFVzTRQR3 A1Z81ZnxARwiz2RJrgBIi6ICpQa0w8pSTrHV1hT2A38vregm4PCotvYdhhA1JKyHVlPp+vnaTJk Ez7h1AlcBC0jwl6o95NS8ftmvGkdlKuOzmz+ofFFs/GLO0qKNOh6hIycQdA+LkQcpvF6M+Yv5C5 44mwatRl8l+gP2N5BUpm2KP5lI56CU/tnTQBaStl0TMpqBDxVs/kux3jyka9f41pT6eTtuYrAAC dX0= X-Google-Smtp-Source: AGHT+IEs+LhNzEyWbFqwFEOlA9BBoc30YAbFirkdvlCgPr6hp+kqoYxoZFJfKngSUiQQO5TaeKHh6w== X-Received: by 2002:a17:906:c14b:b0:aa6:6c6b:15fd with SMTP id a640c23a62f3a-aac2ad9ae60mr2807969766b.20.1735457235946; Sat, 28 Dec 2024 23:27:15 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 21/35] next-cube: use qemu_irq to drive int_status in next_scr2_rtc_update() Date: Sun, 29 Dec 2024 08:25:12 +0100 Message-ID: <20241229072526.166555-22-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.208.53; envelope-from=th.huth@gmail.com; helo=mail-ed1-f53.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457718536116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland Rather than directly clear bit 3 in int_status in next_scr2_rtc_update(), u= se a qemu_irq to drive the equivalent NEXT_PWR_I signal. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-20-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 19b9100094..12f8ecd2d4 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -98,6 +98,7 @@ struct NeXTPC { ESCCState escc; =20 NeXTRTC rtc; + qemu_irq rtc_power_irq; }; =20 typedef struct next_dma { @@ -267,7 +268,7 @@ static void next_scr2_rtc_update(NeXTPC *s) /* clear FTU */ if (rtc->value & 0x04) { rtc->status =3D rtc->status & (~0x18); - s->int_status =3D s->int_status & (~0x04); + qemu_irq_lower(s->rtc_power_irq); } } } @@ -1093,6 +1094,8 @@ static void next_pc_init(Object *obj) memory_region_init_io(&s->timer_mem, OBJECT(s), &next_timer_ops, s, "next.timer", 4); sysbus_init_mmio(sbd, &s->timer_mem); + + s->rtc_power_irq =3D qdev_get_gpio_in(DEVICE(obj), NEXT_PWR_I); } =20 /* --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457505950359.96009526797434; Sat, 28 Dec 2024 23:31:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnie-0000ou-8V; Sun, 29 Dec 2024 02:28:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnhr-0006mj-IQ for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:29 -0500 Received: from mail-ej1-f48.google.com ([209.85.218.48]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhn-0002CH-EF for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:21 -0500 Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-aaec111762bso1088817366b.2 for ; Sat, 28 Dec 2024 23:27:19 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.27.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457238; x=1736062038; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DzveOhRiIEBig4HvofWIGXADQFAE0L+6BqYli124gd8=; b=TqX5fgBMGBX/YIxDVzff+c8kZv0PdCDgVCscM0dVafrpe5dfXHsUAaXB2pZllEWoVA LyJXXxlf8rYAtNU9u9wEdcT92mSjULaTZACf05U8iN7k/Kj0wVJOK39gZvMayFVaV64a 0Qvz/sZA8FcrfH/AOE54DjOll8LubpnwlZ64oYH9RoaYNT7ZcxhRQYAhbFDpfxJKy+pc V/AVNWqnaEWVd7AGh7hkWfvXGqWBXZ3DGLj3u8c/U6sgngw/d+iagONPWzHZCRLM/Ebp meCBLYX9qslKhScWeCB9CMjrsj0wI44TSSUA7iTK73dj9bGLO4rbQwcqfLIAbrA0K+13 2oLQ== X-Forwarded-Encrypted: i=1; AJvYcCWs2f9Zv34n9j3OaylXgcaz0s+wHwmD799Iwsc8DKmBVu1IdAkY4r1mpM660nmlXmRsKDq6xvWX4+DY@nongnu.org X-Gm-Message-State: AOJu0YwYd98G8s65qCQvTFEzSysO5KnI5UdrYyQ65GfiJrnGg5fwgLeu aZlGpOqdf+Z1GsAZ6bXZ3yzmlWbk49X7dz0AQ9RFjBwDPyikJMd7w+UCKA== X-Gm-Gg: ASbGncuCYG6UncTjYRwjfWw3236QVjbX4+/KJHPifiW6VkZeMIh3da7zlgle30Sk19w WMIS9vxXCpCow+6uDGBD1DVP7WfZNouWWGv8Udzk0dbNE82h25jWN1kZ1y5UNSiHmvx3i0OofbV rtTz561J+eq/n8SW+KS4ejSTtWCtPpmmVCNvCNIAcS4FY9FptGRjn8cUHY/wx/jbwO9nbwbbq2V R9I+o1oQVvN3xGUMBc2n9PacnHcyOPgi0925PdNrKD8DsWXepg2i3sxI2hQjlvROI2Brn35c447 g64= X-Google-Smtp-Source: AGHT+IF8p66uGfxFARLrByW0GB83ZMKxyby79MDcHRYemDv1UIYUfIBL6VhZRlenlEd4NvT4kXaOJA== X-Received: by 2002:a17:907:1a4e:b0:aac:4324:977e with SMTP id a640c23a62f3a-aac432497bamr2509176966b.27.1735457237843; Sat, 28 Dec 2024 23:27:17 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 22/35] next-cube: separate rtc read and write shift logic Date: Sun, 29 Dec 2024 08:25:13 +0100 Message-ID: <20241229072526.166555-23-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.48; envelope-from=th.huth@gmail.com; helo=mail-ej1-f48.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457508017116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland Introduce a new next_rtc_cmd_is_write() function to determine if an rtc com= mand is a read or write, and start by using it to avoid shifting the rtc input v= alue if a rtc read command is executed. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-21-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 138 ++++++++++++++++++++++++-------------------- 1 file changed, 74 insertions(+), 64 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 12f8ecd2d4..eb7d3a9cbd 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -165,6 +165,12 @@ static void next_scr2_led_update(NeXTPC *s) } } =20 +static bool next_rtc_cmd_is_write(uint8_t cmd) +{ + return (cmd >=3D 0x80 && cmd <=3D 0x9f) || + (cmd =3D=3D 0xb1); +} + static void next_scr2_rtc_update(NeXTPC *s) { uint8_t old_scr2, scr2_2; @@ -186,76 +192,80 @@ static void next_scr2_rtc_update(NeXTPC *s) ((scr2_2 & SCR2_RTDATA) ? 1 : 0); } if (rtc->phase >=3D 8 && rtc->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 (rtc->ram[rtc->command] & (0x80 >> (rtc->phase - 8)= )) { - scr2_2 |=3D SCR2_RTDATA; - } - - rtc->retval =3D (rtc->retval << 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 >> (rtc->phase - 8))) { - scr2_2 |=3D SCR2_RTDATA; + if (next_rtc_cmd_is_write(rtc->command)) { + /* Shift in value to write */ + rtc->value =3D (rtc->value << 1) | + ((scr2_2 & SCR2_RTDATA) ? 1 : 0); + } else { + /* Shift out value to read */ + + /* if we read RAM register, output RT_DATA bit */ + if (rtc->command <=3D 0x1F) { + scr2_2 =3D scr2_2 & (~SCR2_RTDATA); + if (rtc->ram[rtc->command] & + (0x80 >> (rtc->phase - 8))) { + scr2_2 |=3D SCR2_RTDATA; + } + + rtc->retval =3D (rtc->retval << 1) | + ((scr2_2 & SCR2_RTDATA) ? 1 : 0); } - - rtc->retval =3D (rtc->retval << 1) | - ((scr2_2 & SCR2_RTDATA) ? 1 : 0); - } - /* read the status 0x31 */ - if (rtc->command =3D=3D 0x31) { - scr2_2 =3D scr2_2 & (~SCR2_RTDATA); - if (rtc->control & (0x80 >> (rtc->phase - 8))) { - scr2_2 |=3D SCR2_RTDATA; + /* 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 >> (rtc->phase - 8))) { + scr2_2 |=3D SCR2_RTDATA; + } + + rtc->retval =3D (rtc->retval << 1) | + ((scr2_2 & SCR2_RTDATA) ? 1 : 0); } - rtc->retval =3D (rtc->retval << 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; - + /* read the status 0x31 */ + if (rtc->command =3D=3D 0x31) { + scr2_2 =3D scr2_2 & (~SCR2_RTDATA); + if (rtc->control & (0x80 >> (rtc->phase - 8))) { + scr2_2 |=3D SCR2_RTDATA; + } + rtc->retval =3D (rtc->retval << 1) | + ((scr2_2 & SCR2_RTDATA) ? 1 : 0); } =20 - if (ret & (0x80 >> (rtc->phase - 8))) { - scr2_2 |=3D SCR2_RTDATA; + if ((rtc->command >=3D 0x20) && (rtc->command <=3D 0x2= F)) { + 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 >> (rtc->phase - 8))) { + scr2_2 |=3D SCR2_RTDATA; + } + rtc->retval =3D (rtc->retval << 1) | + ((scr2_2 & SCR2_RTDATA) ? 1 : 0); } - rtc->retval =3D (rtc->retval << 1) | - ((scr2_2 & SCR2_RTDATA) ? 1 : 0); } - } =20 rtc->phase++; --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457674933852.4089223100813; Sat, 28 Dec 2024 23:34:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRniD-0007Gy-RK; Sun, 29 Dec 2024 02:27:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnhw-0006n2-Ja for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:33 -0500 Received: from mail-ej1-f49.google.com ([209.85.218.49]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhq-0002CZ-PR for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:25 -0500 Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-aaec111762bso1088819666b.2 for ; Sat, 28 Dec 2024 23:27:21 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.27.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457240; x=1736062040; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1CKmsiBxDsEcPgpVnWfaRNwB5nXqfB3bWSG3OJN/nu8=; b=HZwfiMT4z+sIipzSK8oLd2vJQb1NmaXqALHKuVdZsD8+evEWRjhEhlOpKnBc8PGGIg s9sP93aQc9Ug5Gcu6CaFV+SXZiLC0q87CUYO4evroLE8VXTz7qLtQ/xmy9UPkWFs3ztP 1mO4gODR43EWzjkOXuv21tZdKLIi6+qIibk8xT3yl8tSUsVkegqH8zzeK2hZGCTzZgnE F7u9nfZzdRhqTtGlh9WinzBEQlQG8C7KIaRnwu2uSbJhsS0d1rNI94gWYgX/BXtYGAwA IRBdMKN7Gbffr8kKCsYO8iiPNd1QBPxF/iQTYdfeMqQ+yePG9QEaF9qKi4VQ06SwlQ7i uZqw== X-Forwarded-Encrypted: i=1; AJvYcCVuMocMHieuE8qTgGJ1ZBqtK+kTLAR52IDq0bYCJ8CQSLZqxuP+h/lnlSsYhK5i661fk7LoDK6Zl9Nd@nongnu.org X-Gm-Message-State: AOJu0Yy+qJIlWg8NnnkaNESIKuMlxsj6elEATOps40IswajcHBOc0ot+ 04ULpvt/wYpofuh/pR+5LMISr6Oe9O1lzOs/sIIA43rams9hvMd6DtishQ== X-Gm-Gg: ASbGncuxUaXcORmTibO9Np0SAxu8zfVxscnrAUd/DOYyTQh2NoieP2i+9w9aZwZYk98 qKzQNn3gCMM7Zt3xfkGri3P2TaMgXyuwAsHK4nM4y4PMLb1PiG76+/qsr/TFls7LRZhLXswgsJp HIvVTtrkTRtVb8gvwo7EdBsHw0oPNzVh+1T+PlEKWERq2dvz95npeBPh1dCHiQLIZ1P3W0w32Cs 0+OcJYW97crYUq0Vmd+q+myP3nhhwBWM/yj9F+d3DJXN7rg83HgFYEiNRSDiZ5rF6ALfeYhD56v R5o= X-Google-Smtp-Source: AGHT+IGhIzZ3iM8xN5fzSaXW/rbb7Lu2jkIa8x1BN6wjSry39XeIVzBcFBVxa4Xok+rO4CxgMTWwPQ== X-Received: by 2002:a17:907:9722:b0:aa6:6fa5:65b3 with SMTP id a640c23a62f3a-aac3352c204mr2881754366b.47.1735457240275; Sat, 28 Dec 2024 23:27:20 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 23/35] next-cube: always use retval to return rtc read values Date: Sun, 29 Dec 2024 08:25:14 +0100 Message-ID: <20241229072526.166555-24-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.49; envelope-from=th.huth@gmail.com; helo=mail-ej1-f49.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457676501116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland Instead of shifting out rtc read values from individual rtc registers, chan= ge the logic so that rtc read commands are executed when the last bit of the r= tc command is received and the result stored in retval. This simplifies the rtc read logic such that the shift out logic can be consolidated for rtc phases between 8 and 16. Signed-off-by: Mark Cave-Ayland Message-ID: <20241222130012.1013374-22-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 99 ++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 59 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index eb7d3a9cbd..a39117144c 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -190,93 +190,74 @@ static void next_scr2_rtc_update(NeXTPC *s) if (rtc->phase < 8) { rtc->command =3D (rtc->command << 1) | ((scr2_2 & SCR2_RTDATA) ? 1 : 0); - } - if (rtc->phase >=3D 8 && rtc->phase < 16) { - if (next_rtc_cmd_is_write(rtc->command)) { - /* Shift in value to write */ - rtc->value =3D (rtc->value << 1) | - ((scr2_2 & SCR2_RTDATA) ? 1 : 0); - } else { - /* Shift out value to read */ =20 - /* if we read RAM register, output RT_DATA bit */ - if (rtc->command <=3D 0x1F) { - scr2_2 =3D scr2_2 & (~SCR2_RTDATA); - if (rtc->ram[rtc->command] & - (0x80 >> (rtc->phase - 8))) { - scr2_2 |=3D SCR2_RTDATA; - } - - rtc->retval =3D (rtc->retval << 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 >> (rtc->phase - 8))) { - scr2_2 |=3D SCR2_RTDATA; - } - - rtc->retval =3D (rtc->retval << 1) | - ((scr2_2 & SCR2_RTDATA) ? 1 : 0); - } - /* read the status 0x31 */ - if (rtc->command =3D=3D 0x31) { - scr2_2 =3D scr2_2 & (~SCR2_RTDATA); - if (rtc->control & (0x80 >> (rtc->phase - 8))) { - scr2_2 |=3D SCR2_RTDATA; - } - rtc->retval =3D (rtc->retval << 1) | - ((scr2_2 & SCR2_RTDATA) ? 1 : 0); + if (rtc->phase =3D=3D 7 && !next_rtc_cmd_is_write(rtc->com= mand)) { + if (rtc->command <=3D 0x1f) { + /* RAM registers */ + rtc->retval =3D rtc->ram[rtc->command]; } - if ((rtc->command >=3D 0x20) && (rtc->command <=3D 0x2= F)) { - scr2_2 =3D scr2_2 & (~SCR2_RTDATA); - /* for now 0x00 */ + /* RTC */ time_t time_h =3D time(NULL); struct tm *info =3D localtime(&time_h); - int ret =3D 0; + rtc->retval =3D 0; =20 switch (rtc->command) { case 0x20: - ret =3D SCR2_TOBCD(info->tm_sec); + rtc->retval =3D SCR2_TOBCD(info->tm_sec); break; case 0x21: - ret =3D SCR2_TOBCD(info->tm_min); + rtc->retval =3D SCR2_TOBCD(info->tm_min); break; case 0x22: - ret =3D SCR2_TOBCD(info->tm_hour); + rtc->retval =3D SCR2_TOBCD(info->tm_hour); break; case 0x24: - ret =3D SCR2_TOBCD(info->tm_mday); + rtc->retval =3D SCR2_TOBCD(info->tm_mday); break; case 0x25: - ret =3D SCR2_TOBCD((info->tm_mon + 1)); + rtc->retval =3D SCR2_TOBCD((info->tm_mon + 1)); break; case 0x26: - ret =3D SCR2_TOBCD((info->tm_year - 100)); + rtc->retval =3D SCR2_TOBCD((info->tm_year - 10= 0)); break; } - - if (ret & (0x80 >> (rtc->phase - 8))) { - scr2_2 |=3D SCR2_RTDATA; - } - rtc->retval =3D (rtc->retval << 1) | - ((scr2_2 & SCR2_RTDATA) ? 1 : 0); + } + if (rtc->command =3D=3D 0x30) { + /* read the status 0x30 */ + rtc->retval =3D rtc->status; + } + if (rtc->command =3D=3D 0x31) { + /* read the control 0x31 */ + rtc->retval =3D rtc->control; + } + } + } + if (rtc->phase >=3D 8 && rtc->phase < 16) { + if (next_rtc_cmd_is_write(rtc->command)) { + /* Shift in value to write */ + rtc->value =3D (rtc->value << 1) | + ((scr2_2 & SCR2_RTDATA) ? 1 : 0); + } else { + /* Shift out value to read */ + if (rtc->retval & (0x80 >> (rtc->phase - 8))) { + scr2_2 |=3D SCR2_RTDATA; + } else { + scr2_2 &=3D ~SCR2_RTDATA; } } } =20 rtc->phase++; - if (rtc->phase =3D=3D 16) { - if (rtc->command >=3D 0x80 && rtc->command <=3D 0x9F) { + if (rtc->phase =3D=3D 16 && next_rtc_cmd_is_write(rtc->command= )) { + if (rtc->command >=3D 0x80 && rtc->command <=3D 0x9f) { + /* RAM registers */ rtc->ram[rtc->command - 0x80] =3D rtc->value; } - /* write to x30 register */ - if (rtc->command =3D=3D 0xB1) { - /* clear FTU */ + if (rtc->command =3D=3D 0xb1) { + /* write to 0x30 register */ if (rtc->value & 0x04) { + /* clear FTU */ rtc->status =3D rtc->status & (~0x18); qemu_irq_lower(s->rtc_power_irq); } --=20 2.47.1 From nobody Sun Apr 6 22:18:25 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457597541826.9822238732866; Sat, 28 Dec 2024 23:33:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRniM-0007rg-6j; Sun, 29 Dec 2024 02:27:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnhx-0006nH-S1 for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:34 -0500 Received: from mail-ed1-f48.google.com ([209.85.208.48]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhs-0002Cg-Bs for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:25 -0500 Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5d7e527becaso13380571a12.3 for ; Sat, 28 Dec 2024 23:27:23 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.27.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457243; x=1736062043; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uANl3b4vNRW+zDDFjIkJDoWOvGKMQzBH26IA3gV2sTw=; b=R4vSBH9IaTJgS6QFwxDgm/88kpGSRG16Omj7EIeK1oKN8EPOIrrXVTX6mYXRDUBcrH grU/5W5n92jKBTbMnhSvYyRtYy4TXDHZN6gcXCH47AMSD9hIa6PcdpUmfqUb7Oe4YOa7 NfECbrQuupeV6CKEiQghSQi5NDAn8ZTCI4+7S3EiqfR19nn1yiULU9WkxIFHwkKcl5gM BrMW2LM+JKXruurGq8iOZeCKd/aW/jmzexnPJ5+KiJ4/Su54A5qwaZ7K3kpvdRGQ+WPd QG16D8rv62LilVYWAX1RESjmqyj0KgrVCa+LmqjytF32HoeFcsfFtaNgd20zCLSnai96 5eEw== X-Forwarded-Encrypted: i=1; AJvYcCW/UfdOkJ1PgFWGd1hJ/Wb9IVG3d+7vN5x3ji73+7WKcTelNBehylYHs43OeJMUPpfcqAF+JnJ/q9pq@nongnu.org X-Gm-Message-State: AOJu0YwIWBik1oQ10w/4WO1yPH1H67Vziy6hIFDw+npime/q7WHceVmR SBkIXudkOm8qD7bPpDM+dcTfuQD7pWgGM2RQZ8XTZHDHCLDUgXYb X-Gm-Gg: ASbGncvmcoLAELyTB6rKVVqpWOmxW+eCZu5yUkf598AQ9oyLdxfuMBjfpD3vxPLElrQ ZlnI73u5vDmBkFO74ZQhfWQYbdbC3I6pAHaQciel/8sGviXMxCzwlSPgSatMtgCcU1AQt00bRuU E2jPqhIz5WHtpaJW3jtpSeHWWcj3J5GtZvvQgFVI/pBOuRi0w2trdGvkG0EQr712OkrHXZnm0P5 hWby4jzebwRH8kOjP+HyF8D7gnb5gb7FT6U0OUM6BZSw+3OKEnVtrNIvClRRUvv7MrcWv33685S Cqs= X-Google-Smtp-Source: AGHT+IGtGGdK0WUC2QLWuqlRm0vebD+hSNcMGx8zOkBZbmeqlUKbY6PeX/uPlyHku+1x3R6LhymRyw== X-Received: by 2002:a05:6402:270d:b0:5d0:fb56:3f with SMTP id 4fb4d7f45d1cf-5d81dd9cdf0mr70073860a12.12.1735457242541; Sat, 28 Dec 2024 23:27:22 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 24/35] next-cube: use named gpio to set RTC data bit in scr2 Date: Sun, 29 Dec 2024 08:25:15 +0100 Message-ID: <20241229072526.166555-25-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.208.48; envelope-from=th.huth@gmail.com; helo=mail-ed1-f48.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457598197116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland This is in preparation for moving NeXTRTC to its own separate device. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-23-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index a39117144c..1e9e662b40 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -240,10 +240,13 @@ static void next_scr2_rtc_update(NeXTPC *s) ((scr2_2 & SCR2_RTDATA) ? 1 : 0); } else { /* Shift out value to read */ + qemu_irq rtc_data_in_irq =3D qdev_get_gpio_in_named( + DEVICE(s), "pc-rtc-data-in", 0); + if (rtc->retval & (0x80 >> (rtc->phase - 8))) { - scr2_2 |=3D SCR2_RTDATA; + qemu_irq_raise(rtc_data_in_irq); } else { - scr2_2 &=3D ~SCR2_RTDATA; + qemu_irq_lower(rtc_data_in_irq); } } } @@ -270,8 +273,6 @@ static void next_scr2_rtc_update(NeXTPC *s) rtc->command =3D 0; rtc->value =3D 0; } - - s->scr2 =3D deposit32(s->scr2, 8, 8, scr2_2); } =20 static uint64_t next_mmio_read(void *opaque, hwaddr addr, unsigned size) @@ -1001,6 +1002,20 @@ static const MemoryRegionOps next_dummy_en_ops =3D { .endianness =3D DEVICE_BIG_ENDIAN, }; =20 +static void next_pc_rtc_data_in_irq(void *opaque, int n, int level) +{ + NeXTPC *s =3D NEXT_PC(opaque); + uint8_t scr2_2 =3D extract32(s->scr2, 8, 8); + + if (level) { + scr2_2 |=3D SCR2_RTDATA; + } else { + scr2_2 &=3D ~SCR2_RTDATA; + } + + s->scr2 =3D deposit32(s->scr2, 8, 8, scr2_2); +} + static void next_pc_reset_hold(Object *obj, ResetType type) { NeXTPC *s =3D NEXT_PC(obj); @@ -1087,6 +1102,8 @@ static void next_pc_init(Object *obj) sysbus_init_mmio(sbd, &s->timer_mem); =20 s->rtc_power_irq =3D qdev_get_gpio_in(DEVICE(obj), NEXT_PWR_I); + qdev_init_gpio_in_named(DEVICE(obj), next_pc_rtc_data_in_irq, + "pc-rtc-data-in", 1); } =20 /* --=20 2.47.1 From nobody Sun Apr 6 22:18:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457312633954.870487185927; Sat, 28 Dec 2024 23:28:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRniF-0007VD-In; Sun, 29 Dec 2024 02:27:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRnhz-0006nR-Me for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:35 -0500 Received: from mail-ed1-f41.google.com ([209.85.208.41]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhv-0002D5-SI for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:30 -0500 Received: by mail-ed1-f41.google.com with SMTP id 4fb4d7f45d1cf-5d3d479b1e6so11449794a12.2 for ; Sat, 28 Dec 2024 23:27:26 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.27.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457245; x=1736062045; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+3vAzuYZc9RRRWT5kph1vz0cBKumYJzBkalZjnIrAFY=; b=DYaZBiVa9Yc9N1rXTypxt8TlPCo7W5SOpt8NIB/1d7F30UCOufP140/Xv6Lo6SqOs7 JM2ZPabx1qDcVkYBgKEIg0q83P/28hnS6J45Qff58+fj3hX62RiIg9s4RRig3FPDvTgA hgo923XqVL9uaHWC6bWFIjA3c9TNFKxe8ozW5m2rMWasL1ufQnSfon1Tr1zvGiosR9nW 4KvRyntyHdID9Ha33+q6hK2abfHWGTE692r2vBAyirg4tmnETRkjTt7eWUZm56iTaOl7 CmiJxNPh8nMnTh0OHz9oXKaGl6mAkv1zQ55ZAGt39m9A9KlMPMCv7NljHE5Hq0oX2IXM nEFQ== X-Forwarded-Encrypted: i=1; AJvYcCXJ7+rNrH7Ipgwo45pjCuxAO63Cf2Yxam8sjculdK7XOFK1Qr3Z6/lkROvKB12bjxmPxHUU9+IZrpLc@nongnu.org X-Gm-Message-State: AOJu0YwF4PkiiRMQOcOqxe1ZcPfDdG/9Q4FQZLDMFHEozjabLvtPYyHD 99E6JQhGjQtHVySYmMWp/RWvtsqVQMquGuC2TaKgJ+yeCkSvyLDR X-Gm-Gg: ASbGncsQStc2HoKVvpOJRQaZtyVIc6307UuJNgoqI2Op8YTel5L0x6Gx8SijiaMKhxP LrYD2bRqOc04Os7BIvF1KrIdW5mamKXOax1X/qjGSOdpK9//FCItIUTqQXxExCdjp3r8ix6pNLk 1FhlWUWZUGjobCjCLLW9KR4MviA8P9R1/YAT1IqFv1w6lvPz2BX0eE/9tHrgMdQOT6VwAVf0xF2 3KnTQjuD52Vk23soGSNFjQ/8puoHtnafER7hXmJaB18mnSGbl6RxJfiWBV6f/7d+EWGrto7mOiz 2Ds= X-Google-Smtp-Source: AGHT+IGzCg9KE49W/YIFU2JD7XUWItdi+KaHwdNlrFvkADcze917cwPKihlzAQCQYKBLQZ2vdUOkMg== X-Received: by 2002:a50:cc48:0:b0:5d3:cf89:bd3e with SMTP id 4fb4d7f45d1cf-5d81de1c92cmr60092193a12.30.1735457244875; Sat, 28 Dec 2024 23:27:24 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 25/35] next-cube: use named gpio to read RTC data bit in scr2 Date: Sun, 29 Dec 2024 08:25:16 +0100 Message-ID: <20241229072526.166555-26-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.208.41; envelope-from=th.huth@gmail.com; helo=mail-ed1-f41.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457313380116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland This is in preparation for moving NeXTRTC to its own separate device. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-24-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 169 ++++++++++++++++++++++++-------------------- 1 file changed, 92 insertions(+), 77 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 1e9e662b40..0f24905525 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -171,6 +171,90 @@ static bool next_rtc_cmd_is_write(uint8_t cmd) (cmd =3D=3D 0xb1); } =20 +static void next_rtc_data_in_irq(void *opaque, int n, int level) +{ + NeXTPC *s =3D NEXT_PC(opaque); + NeXTRTC *rtc =3D &s->rtc; + + if (rtc->phase < 8) { + rtc->command =3D (rtc->command << 1) | level; + + if (rtc->phase =3D=3D 7 && !next_rtc_cmd_is_write(rtc->command)) { + if (rtc->command <=3D 0x1f) { + /* RAM registers */ + rtc->retval =3D rtc->ram[rtc->command]; + } + if ((rtc->command >=3D 0x20) && (rtc->command <=3D 0x2f)) { + /* RTC */ + time_t time_h =3D time(NULL); + struct tm *info =3D localtime(&time_h); + rtc->retval =3D 0; + + switch (rtc->command) { + case 0x20: + rtc->retval =3D SCR2_TOBCD(info->tm_sec); + break; + case 0x21: + rtc->retval =3D SCR2_TOBCD(info->tm_min); + break; + case 0x22: + rtc->retval =3D SCR2_TOBCD(info->tm_hour); + break; + case 0x24: + rtc->retval =3D SCR2_TOBCD(info->tm_mday); + break; + case 0x25: + rtc->retval =3D SCR2_TOBCD((info->tm_mon + 1)); + break; + case 0x26: + rtc->retval =3D SCR2_TOBCD((info->tm_year - 100)); + break; + } + } + if (rtc->command =3D=3D 0x30) { + /* read the status 0x30 */ + rtc->retval =3D rtc->status; + } + if (rtc->command =3D=3D 0x31) { + /* read the control 0x31 */ + rtc->retval =3D rtc->control; + } + } + } + if (rtc->phase >=3D 8 && rtc->phase < 16) { + if (next_rtc_cmd_is_write(rtc->command)) { + /* Shift in value to write */ + rtc->value =3D (rtc->value << 1) | level; + } else { + /* Shift out value to read */ + qemu_irq rtc_data_in_irq =3D qdev_get_gpio_in_named( + DEVICE(s), "pc-rtc-data-in", 0); + + if (rtc->retval & (0x80 >> (rtc->phase - 8))) { + qemu_irq_raise(rtc_data_in_irq); + } else { + qemu_irq_lower(rtc_data_in_irq); + } + } + } + + rtc->phase++; + if (rtc->phase =3D=3D 16 && next_rtc_cmd_is_write(rtc->command)) { + if (rtc->command >=3D 0x80 && rtc->command <=3D 0x9f) { + /* RAM registers */ + rtc->ram[rtc->command - 0x80] =3D rtc->value; + } + if (rtc->command =3D=3D 0xb1) { + /* write to 0x30 register */ + if (rtc->value & 0x04) { + /* clear FTU */ + rtc->status =3D rtc->status & (~0x18); + qemu_irq_lower(s->rtc_power_irq); + } + } + } +} + static void next_scr2_rtc_update(NeXTPC *s) { uint8_t old_scr2, scr2_2; @@ -187,84 +271,13 @@ static void next_scr2_rtc_update(NeXTPC *s) /* 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 (rtc->phase < 8) { - rtc->command =3D (rtc->command << 1) | - ((scr2_2 & SCR2_RTDATA) ? 1 : 0); - - if (rtc->phase =3D=3D 7 && !next_rtc_cmd_is_write(rtc->com= mand)) { - if (rtc->command <=3D 0x1f) { - /* RAM registers */ - rtc->retval =3D rtc->ram[rtc->command]; - } - if ((rtc->command >=3D 0x20) && (rtc->command <=3D 0x2= F)) { - /* RTC */ - time_t time_h =3D time(NULL); - struct tm *info =3D localtime(&time_h); - rtc->retval =3D 0; - - switch (rtc->command) { - case 0x20: - rtc->retval =3D SCR2_TOBCD(info->tm_sec); - break; - case 0x21: - rtc->retval =3D SCR2_TOBCD(info->tm_min); - break; - case 0x22: - rtc->retval =3D SCR2_TOBCD(info->tm_hour); - break; - case 0x24: - rtc->retval =3D SCR2_TOBCD(info->tm_mday); - break; - case 0x25: - rtc->retval =3D SCR2_TOBCD((info->tm_mon + 1)); - break; - case 0x26: - rtc->retval =3D SCR2_TOBCD((info->tm_year - 10= 0)); - break; - } - } - if (rtc->command =3D=3D 0x30) { - /* read the status 0x30 */ - rtc->retval =3D rtc->status; - } - if (rtc->command =3D=3D 0x31) { - /* read the control 0x31 */ - rtc->retval =3D rtc->control; - } - } - } - if (rtc->phase >=3D 8 && rtc->phase < 16) { - if (next_rtc_cmd_is_write(rtc->command)) { - /* Shift in value to write */ - rtc->value =3D (rtc->value << 1) | - ((scr2_2 & SCR2_RTDATA) ? 1 : 0); - } else { - /* Shift out value to read */ - qemu_irq rtc_data_in_irq =3D qdev_get_gpio_in_named( - DEVICE(s), "pc-rtc-data-in", 0); - - if (rtc->retval & (0x80 >> (rtc->phase - 8))) { - qemu_irq_raise(rtc_data_in_irq); - } else { - qemu_irq_lower(rtc_data_in_irq); - } - } - } + qemu_irq rtc_data_in_irq =3D qdev_get_gpio_in_named( + DEVICE(s), "rtc-data-in", 0); =20 - rtc->phase++; - if (rtc->phase =3D=3D 16 && next_rtc_cmd_is_write(rtc->command= )) { - if (rtc->command >=3D 0x80 && rtc->command <=3D 0x9f) { - /* RAM registers */ - rtc->ram[rtc->command - 0x80] =3D rtc->value; - } - if (rtc->command =3D=3D 0xb1) { - /* write to 0x30 register */ - if (rtc->value & 0x04) { - /* clear FTU */ - rtc->status =3D rtc->status & (~0x18); - qemu_irq_lower(s->rtc_power_irq); - } - } + if (scr2_2 & SCR2_RTDATA) { + qemu_irq_raise(rtc_data_in_irq); + } else { + qemu_irq_lower(rtc_data_in_irq); } } } else { @@ -1104,6 +1117,8 @@ static void next_pc_init(Object *obj) s->rtc_power_irq =3D qdev_get_gpio_in(DEVICE(obj), NEXT_PWR_I); qdev_init_gpio_in_named(DEVICE(obj), next_pc_rtc_data_in_irq, "pc-rtc-data-in", 1); + qdev_init_gpio_in_named(DEVICE(obj), next_rtc_data_in_irq, + "rtc-data-in", 1); } =20 /* --=20 2.47.1 From nobody Sun Apr 6 22:18:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457278231525.6829131782769; Sat, 28 Dec 2024 23:27:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRniJ-0007gf-25; Sun, 29 Dec 2024 02:27:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRni1-0006ng-K3 for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:36 -0500 Received: from mail-ed1-f48.google.com ([209.85.208.48]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhx-0002DA-LM for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:32 -0500 Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5d3ecae02beso10066204a12.0 for ; Sat, 28 Dec 2024 23:27:29 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.27.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457248; x=1736062048; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AM4uNV/hC87i9UJ4aHzCgzM3ZV+ooGFBQ58b2dkPsnk=; b=FXsNs7O/HC66T97ARFRsQfdHjWoBduj5p/5E9mHO7dXZyp34ytzXQRl9EI47eeWwkA hoC+yQ6jtvgOx9JxWW2Q52wsU7+Ni7coALUJZ8gh0FJ4EmfYyoOsUh/Vh3TY2M6ESPvg iWL4MQ1uDcGZ86vhHn4hA6qkI96rDue9VPYSRDAsIPUJYfg3Z4wxSCPRmZ1IIxySEUsJ 2oX09JVdsXxyCIhPo5p+4mnwC23miKCcDtrzwAAtss6P1xYnN+Q+ffMKdERKIG4kd6fV t/iVoZKPx76H3x7MNz0gcO7RTrN0YobLRsSCj0DQIF1NjynDA/diGCBnNxFgmc3lpi01 AEow== X-Forwarded-Encrypted: i=1; AJvYcCXvpesSQU7REPit0PaFZjmXg5jbsSRAn5oDq4L85bqjD8Fd0mlpomVpZMOjbtwyvj5YcSy4tKI4t2Wi@nongnu.org X-Gm-Message-State: AOJu0YyXf0BgVfgEvELXt8bZ4XAJW8qkXxeNL7El10FSQNWJy8IisXFc Qk+StGtXcNsoYMlz1HqRDRmDBJCWEbothnEUqQ7BnUQ97Qwlidfa X-Gm-Gg: ASbGnct5D5Rrhn7OtrNYAfBaRYlKJYQO7fzh2hNXUwcPrKTE2HU/cg6ROBUYGeqkl7C SHR/wtffHyVYxwqGTKHvkGWF+RLIjqZymmSnuq3uTxcMuaplRN3yulHc7IZXak/9OF/lQsRg0VD ZLeEzlk9yD54mU30NmvXQ1I6a0146GihV1i4jF8GVsrbCAdZX7v/ibYZVSuWbimni0DtY7lYC13 esQQcvb8S0t3nSpHax38CJ7JfctqZFqgxnD18FcRzfTrji4DzbLLz9KTVePe1h0oGEw4R7LRg97 tVE= X-Google-Smtp-Source: AGHT+IHn0GS6r0K0Za+0S5OXdSsjMJSsfhNYo3t7E+ktRiWgsphoq7ME3UeTeLjMGkYnvHhLfAJL8Q== X-Received: by 2002:a05:6402:270d:b0:5d6:66cf:2a3a with SMTP id 4fb4d7f45d1cf-5d81dda7e79mr27146740a12.17.1735457247704; Sat, 28 Dec 2024 23:27:27 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 26/35] next-cube: don't use rtc phase value of -1 Date: Sun, 29 Dec 2024 08:25:17 +0100 Message-ID: <20241229072526.166555-27-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.208.48; envelope-from=th.huth@gmail.com; helo=mail-ed1-f48.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457280255116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland The rtc phase value of -1 is directly equivalent to using a phase value of = 0 so simplify the logic to use an initial rtc phase of 0. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-25-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 0f24905525..3ca70e376e 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -265,9 +265,6 @@ static void next_scr2_rtc_update(NeXTPC *s) =20 if (scr2_2 & 0x1) { /* DPRINTF("RTC %x phase %i\n", scr2_2, rtc->phase); */ - if (rtc->phase =3D=3D -1) { - rtc->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)) { @@ -282,7 +279,7 @@ static void next_scr2_rtc_update(NeXTPC *s) } } else { /* else end or abort */ - rtc->phase =3D -1; + rtc->phase =3D 0; rtc->command =3D 0; rtc->value =3D 0; } --=20 2.47.1 From nobody Sun Apr 6 22:18:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457293687289.16010289493033; Sat, 28 Dec 2024 23:28:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRniR-00089j-1O; Sun, 29 Dec 2024 02:27:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRni3-0006o5-Fv for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:37 -0500 Received: from mail-ej1-f48.google.com ([209.85.218.48]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRnhz-0002DW-FL for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:34 -0500 Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-aaecf50578eso967962166b.2 for ; Sat, 28 Dec 2024 23:27:30 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.27.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457250; x=1736062050; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=feQ0o0AR8lm4HYTI3gKWuN73bpZVkWiDuFcBbBOU3wA=; b=we88/nwX6KioGSeqKvfXkn0vGV2AiOJkcMUSI0scwAGOxnAnYPV3IQp0cOGdrAQm2Y tI3NO/FWX0+EaeBt+TS0jxk+PRj8lKNO0XdYpNc18Iz6L4SyLtV3BjymMjgGIQIJhtVN SUztL9BeOJ2+cV+ZLywjlvJZqghgUFC1In2JNMgyWE8cLtzoOvNGvkcmLxR+L5DoTwel 3tLKa6oVeeFWh9HxoAz43Lh1Al2z5UajGuBxAd+2OCETKQ/yNDx90csXu01+Z8OAtxO7 mHfX5hTwskCYUSbt6qeDa/wNW71loEe9ZTC/kWSwv7cvWxgUSS90bd3UM6rKMhQorXPN lVZw== X-Forwarded-Encrypted: i=1; AJvYcCVGHujHcX4+Olf3mq72v3B16f5vNzO+tr3TfyYldNjIgHo3JAmBwWvlF8gunNNJZHpU0pifv2LMXDia@nongnu.org X-Gm-Message-State: AOJu0Yz1m/ZgdgbcnFx4qNB26alVnwXMtqSiNpwTTCpQ7sYiA2JMtX+J qTTZoSs1YRW7t+HlBhDf+xRdndpaVUEPZGhGFRlTifYB/dxp3+C3ZSo3sw== X-Gm-Gg: ASbGncvnVuarDsPZtalx4iHgxYDr88XUANITmckqZV/vmHGvTX54aAX9ub0N4rzaH6i 8gvdDb8gCXbdEIUXwqC5+xs44BfRhhlSov2XnuZM0UAPOgl7ZQKiodtwx3TdGzEs10CJ9KNZCSY Xza5zrqhk9n0nrXvXnOjQmqeXlHljvfJAD1q6q/3xOWzy7lciwDC10iQ/eVTpdt6L2zf+P3RhrF 5FNSnyKxuIzBR98x+vsdLvYb/APAkve18Ce8s/pRSfxKz9a1EzKd1zyBPtCA8yFi06eZ5oWjUAP 8Xs= X-Google-Smtp-Source: AGHT+IE38h5MRKO21Z8CL4tMV355WsfvqnUfci0PEW689RhEm9TsvRL+LwQUNLuxuXU9AKpgZvjOTQ== X-Received: by 2002:a17:907:940d:b0:aa6:6a55:ad81 with SMTP id a640c23a62f3a-aac334f621fmr2912533866b.41.1735457249523; Sat, 28 Dec 2024 23:27:29 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 27/35] next-cube: QOMify NeXTRTC Date: Sun, 29 Dec 2024 08:25:18 +0100 Message-ID: <20241229072526.166555-28-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.48; envelope-from=th.huth@gmail.com; helo=mail-ej1-f48.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457295708116600 From: Mark Cave-Ayland This is to allow the RTC functionality to be maintained within its own sepa= rate device rather than as part of the next-pc device. Signed-off-by: Mark Cave-Ayland Message-ID: <20241222130012.1013374-26-mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 71 +++++++++++++++++++++++++++++++-------------- 1 file changed, 50 insertions(+), 21 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 3ca70e376e..883891ce6b 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -42,7 +42,13 @@ #define RAM_SIZE 0x4000000 #define ROM_FILE "Rev_2.5_v66.bin" =20 -typedef struct NeXTRTC { + +#define TYPE_NEXT_RTC "next-rtc" +OBJECT_DECLARE_SIMPLE_TYPE(NeXTRTC, NEXT_RTC) + +struct NeXTRTC { + SysBusDevice parent_obj; + int8_t phase; uint8_t ram[32]; uint8_t command; @@ -50,7 +56,7 @@ typedef struct NeXTRTC { uint8_t status; uint8_t control; uint8_t retval; -} NeXTRTC; +}; =20 #define TYPE_NEXT_SCSI "next-scsi" OBJECT_DECLARE_SIMPLE_TYPE(NeXTSCSI, NEXT_SCSI) @@ -1012,6 +1018,37 @@ static const MemoryRegionOps next_dummy_en_ops =3D { .endianness =3D DEVICE_BIG_ENDIAN, }; =20 +static const VMStateDescription next_rtc_vmstate =3D { + .name =3D "next-rtc", + .version_id =3D 3, + .minimum_version_id =3D 3, + .fields =3D (const VMStateField[]) { + VMSTATE_INT8(phase, NeXTRTC), + VMSTATE_UINT8_ARRAY(ram, NeXTRTC, 32), + VMSTATE_UINT8(command, NeXTRTC), + VMSTATE_UINT8(value, NeXTRTC), + VMSTATE_UINT8(status, NeXTRTC), + VMSTATE_UINT8(control, NeXTRTC), + VMSTATE_UINT8(retval, NeXTRTC), + VMSTATE_END_OF_LIST() + }, +}; + +static void next_rtc_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + + dc->desc =3D "NeXT RTC"; + dc->vmsd =3D &next_rtc_vmstate; +} + +static const TypeInfo next_rtc_info =3D { + .name =3D TYPE_NEXT_RTC, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(NeXTRTC), + .class_init =3D next_rtc_class_init, +}; + static void next_pc_rtc_data_in_irq(void *opaque, int n, int level) { NeXTPC *s =3D NEXT_PC(opaque); @@ -1078,6 +1115,12 @@ static void next_pc_realize(DeviceState *dev, Error = **errp) } sysbus_connect_irq(sbd, 0, qdev_get_gpio_in(dev, NEXT_SCC_I)); sysbus_connect_irq(sbd, 1, qdev_get_gpio_in(dev, NEXT_SCC_DMA_I)); + + /* RTC */ + d =3D DEVICE(&s->rtc); + if (!sysbus_realize(SYS_BUS_DEVICE(d), errp)) { + return; + } } =20 static void next_pc_init(Object *obj) @@ -1111,6 +1154,8 @@ static void next_pc_init(Object *obj) "next.timer", 4); sysbus_init_mmio(sbd, &s->timer_mem); =20 + object_initialize_child(obj, "rtc", &s->rtc, TYPE_NEXT_RTC); + s->rtc_power_irq =3D qdev_get_gpio_in(DEVICE(obj), NEXT_PWR_I); qdev_init_gpio_in_named(DEVICE(obj), next_pc_rtc_data_in_irq, "pc-rtc-data-in", 1); @@ -1128,26 +1173,10 @@ static const Property next_pc_properties[] =3D { DEFINE_PROP_LINK("cpu", NeXTPC, cpu, TYPE_M68K_CPU, M68kCPU *), }; =20 -static const VMStateDescription next_rtc_vmstate =3D { - .name =3D "next-rtc", - .version_id =3D 2, - .minimum_version_id =3D 2, - .fields =3D (const VMStateField[]) { - VMSTATE_INT8(phase, NeXTRTC), - VMSTATE_UINT8_ARRAY(ram, NeXTRTC, 32), - VMSTATE_UINT8(command, NeXTRTC), - VMSTATE_UINT8(value, NeXTRTC), - VMSTATE_UINT8(status, NeXTRTC), - VMSTATE_UINT8(control, NeXTRTC), - VMSTATE_UINT8(retval, NeXTRTC), - VMSTATE_END_OF_LIST() - }, -}; - static const VMStateDescription next_pc_vmstate =3D { .name =3D "next-pc", - .version_id =3D 3, - .minimum_version_id =3D 3, + .version_id =3D 4, + .minimum_version_id =3D 4, .fields =3D (const VMStateField[]) { VMSTATE_UINT32(scr1, NeXTPC), VMSTATE_UINT32(scr2, NeXTPC), @@ -1155,7 +1184,6 @@ static const VMStateDescription next_pc_vmstate =3D { VMSTATE_UINT32(int_mask, NeXTPC), VMSTATE_UINT32(int_status, NeXTPC), VMSTATE_UINT32(led, NeXTPC), - VMSTATE_STRUCT(rtc, NeXTPC, 0, next_rtc_vmstate, NeXTRTC), VMSTATE_END_OF_LIST() }, }; @@ -1305,6 +1333,7 @@ static void next_register_type(void) type_register_static(&next_typeinfo); type_register_static(&next_pc_info); type_register_static(&next_scsi_info); + type_register_static(&next_rtc_info); } =20 type_init(next_register_type) --=20 2.47.1 From nobody Sun Apr 6 22:18:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457313233284.2522315352029; Sat, 28 Dec 2024 23:28:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnip-0001TU-8n; Sun, 29 Dec 2024 02:28:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRni3-0006o6-GL for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:37 -0500 Received: from mail-ej1-f41.google.com ([209.85.218.41]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRni1-0002Dg-97 for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:34 -0500 Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-aa67333f7d2so1218086566b.0 for ; Sat, 28 Dec 2024 23:27:31 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.27.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457251; x=1736062051; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yT/I4StE3NBO0rAz2NgqzeKWrPklbWt2SCG7OJpykKQ=; b=WNP/CPONxY/OA5D/3mH2nfZ7XK7u874vwgSNn2sEA1Ftr57eyNqYmlWXslX3HpKKD1 C8WiOcDf/gGu3meQJ4ETlnYvNdhh/+RUcZIQLV0+CWYEKEAdYH2/y8CRaux5OORg/VoJ qmCJhuLhkd+LkSAZKXEQZfIMBJXJGYX/xp3Zt1QymBtvnMGvrz5d5GD3J12HP88i1oVW 90b6867spV+raAsb+jAbn27usMxd0FtZIJk4ZXJdU0/uLSbzX2VfFw9ebGxchDVu5Zmo DxvK+sa5K6hj8ypweTzSKy9LhDbEip8E0hMkvl4NalDsGbKU6EcbR6hq+fN+XFyhn7x6 MbZg== X-Forwarded-Encrypted: i=1; AJvYcCXYoUmYml9TKDdjKVgBloXqZp5B5FK46Vi0b0qtiumQ3/+AoRF/B+pOkQsWjtrbVTMY5LZjqw3FktRJ@nongnu.org X-Gm-Message-State: AOJu0YyX5oP5dcLQ0uXZeP+rj2cDYkl3oCPhq3aIcjseMWyR5VfkrraY 1YCoYRiggWf42j40boXwftIianYLTSoma0/f6pvKmyGf7EVNoAAIpgNtAA== X-Gm-Gg: ASbGnct0uPElxYeEDxEIs9PzKkDYIBp9ujz/3ZOqyyiD6vzX1/Qdv+jYxNoBQFoUSz6 zCaBJWtdbXlx9IFA/nfmRW9+4qbQxZ6BaRf1zTn5rHdnXmMzaa0iztz1QFMybL/KZRyfa/18LHq 6tCiBA1euMjAB8j79H8lGU+7GbtcRgkKvBCZolQpT28SrG+R4qbf73hbB/O78RNgNpLyjTn1UaY s0cJfDLZSMtyiNOTB+pil0WZ+wYKO4SNRpqGISYZNn6a+N64Xfo4wv5d9814N836yLNhtYEbEPk WyY= X-Google-Smtp-Source: AGHT+IG3/QcRP8cvxsWg0sXUI3MsXFwrehsL/pQpxugWE7/rag4AShFWNomYTCHp/KTKNZhIG8EE+Q== X-Received: by 2002:a17:906:6a15:b0:aab:d8e4:2062 with SMTP id a640c23a62f3a-aac3366b549mr2497360566b.56.1735457250589; Sat, 28 Dec 2024 23:27:30 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 28/35] next-cube: move reset of next-rtc fields from next-pc to next-rtc Date: Sun, 29 Dec 2024 08:25:19 +0100 Message-ID: <20241229072526.166555-29-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.41; envelope-from=th.huth@gmail.com; helo=mail-ej1-f41.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457315408116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-27-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 883891ce6b..bd7c76c35e 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -1018,6 +1018,16 @@ static const MemoryRegionOps next_dummy_en_ops =3D { .endianness =3D DEVICE_BIG_ENDIAN, }; =20 +static void next_rtc_reset_hold(Object *obj, ResetType type) +{ + NeXTRTC *rtc =3D NEXT_RTC(obj); + + rtc->status =3D 0x90; + + /* Load RTC RAM - TODO: provide possibility to load contents from file= */ + memcpy(rtc->ram, rtc_ram2, 32); +} + static const VMStateDescription next_rtc_vmstate =3D { .name =3D "next-rtc", .version_id =3D 3, @@ -1037,9 +1047,11 @@ static const VMStateDescription next_rtc_vmstate =3D= { static void next_rtc_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 dc->desc =3D "NeXT RTC"; dc->vmsd =3D &next_rtc_vmstate; + rc->phases.hold =3D next_rtc_reset_hold; } =20 static const TypeInfo next_rtc_info =3D { @@ -1072,11 +1084,6 @@ static void next_pc_reset_hold(Object *obj, ResetTyp= e type) s->scr1 =3D 0x00011102; s->scr2 =3D 0x00ff0c80; s->old_scr2 =3D s->scr2; - - s->rtc.status =3D 0x90; - - /* Load RTC RAM - TODO: provide possibility to load contents from file= */ - memcpy(s->rtc.ram, rtc_ram2, 32); } =20 static void next_pc_realize(DeviceState *dev, Error **errp) --=20 2.47.1 From nobody Sun Apr 6 22:18:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 173545734022013.578517423384142; Sat, 28 Dec 2024 23:29:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRniW-0000C9-DA; Sun, 29 Dec 2024 02:28:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRni9-0007A4-5j for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:42 -0500 Received: from mail-ej1-f43.google.com ([209.85.218.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRni3-0002Eo-8t for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:37 -0500 Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-aa67f31a858so1492577366b.2 for ; Sat, 28 Dec 2024 23:27:34 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.27.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457253; x=1736062053; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JC8R4FfjHmxhyioHHkX5WbR6EsnpGfoLaQR1PrvrBGo=; b=shsJ9bQ+yODZTX0ELJQpTd9t2OVbRz0Ti14MVKGtbp1UP6BY96sM/fd26w6UEovWHv aVC5JHlVlNwMLMudgsLx3eh+I3mOE2ZNoSBN+c3K3GvqE6v4mAJ806ttc3IG9X0IdTrF tLWQS9SN/sZhTlhGjv/12EuAaFptR5s1WXuP4f14ngehT9HzFv/zwXnfM8nTR5N/nuWM X3uktwohehwQm8iHXkUIJ+zqVa9WWGvf6+wVATfLubrAWmEPPpuUlmvd2w504/zDAwrW xpOcX/69MF47W7GpSrbp4dlSOX/mgIU9IvA2lnmFNwkEn0ArR+K7vL2iVbG2Byvo+//M H03Q== X-Forwarded-Encrypted: i=1; AJvYcCVMM6I8WlptRSOraU7jprbLPrdJq1fFksmVcofUP06PCd7PCKXpZrhH8aTzcweKXYhuWBa2cs68CteQ@nongnu.org X-Gm-Message-State: AOJu0Yyq3hn0rn41ugAizMKxdoK/gC30ElAaHrf4tKPtFl1clKRTHg7M Qc40s2mrpl130zodox1O3EPt+vpJWcj26qOLp11/KSBoiRg0+JHi1F8x3w== X-Gm-Gg: ASbGncvO34DRWw3qjc1uoZyO4VVRiNHYWu+dUkNM95bqFXcdjIjcihZJBTXC1aRp2wn TRCTzkLtbJovDAArcYhprhmuxeeWl5oInIM40Qqxm507pBEBqu+P2znzmMeLRSstJK43uVQPiAS CC3O/LPM1vFVHHsQx7Fm/1kCFGC2c+WTk+qCCPkTaOOhlwCsUqZ0FUWAwYMTDU9dFjuMAbkY0na gsKOq8382yi5k1WM9SjdpvtBO91aUPw/bCrEf0NV31LKtAviRKzZpwlOgMNlw7V7OjISAHU0TRl WFo= X-Google-Smtp-Source: AGHT+IHO5HqoCwSOlZR2j3HYiIvwCwh1wVbFOEpLtMvA/vOQt2eGvyniOaBanHRj7B7CNxwduC+Efg== X-Received: by 2002:a17:906:9c8f:b0:aae:d199:6eae with SMTP id a640c23a62f3a-aaed1998ef7mr1925688766b.14.1735457253024; Sat, 28 Dec 2024 23:27:33 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 29/35] next-cube: move rtc-data-in gpio from next-pc to next-rtc device Date: Sun, 29 Dec 2024 08:25:20 +0100 Message-ID: <20241229072526.166555-30-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.43; envelope-from=th.huth@gmail.com; helo=mail-ej1-f43.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457341755116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland Add a new rtc-data-out gpio to the next-pc device and wire it up to the nex= t-rtc rtc-data-in gpio using the standard qdev gpio APIs. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-28-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index bd7c76c35e..69f5c7aaec 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -105,6 +105,7 @@ struct NeXTPC { =20 NeXTRTC rtc; qemu_irq rtc_power_irq; + qemu_irq rtc_data_irq; }; =20 typedef struct next_dma { @@ -179,8 +180,8 @@ static bool next_rtc_cmd_is_write(uint8_t cmd) =20 static void next_rtc_data_in_irq(void *opaque, int n, int level) { - NeXTPC *s =3D NEXT_PC(opaque); - NeXTRTC *rtc =3D &s->rtc; + NeXTRTC *rtc =3D NEXT_RTC(opaque); + NeXTPC *s =3D NEXT_PC(container_of(rtc, NeXTPC, rtc)); =20 if (rtc->phase < 8) { rtc->command =3D (rtc->command << 1) | level; @@ -274,13 +275,10 @@ static void next_scr2_rtc_update(NeXTPC *s) /* 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)) { - qemu_irq rtc_data_in_irq =3D qdev_get_gpio_in_named( - DEVICE(s), "rtc-data-in", 0); - if (scr2_2 & SCR2_RTDATA) { - qemu_irq_raise(rtc_data_in_irq); + qemu_irq_raise(s->rtc_data_irq); } else { - qemu_irq_lower(rtc_data_in_irq); + qemu_irq_lower(s->rtc_data_irq); } } } else { @@ -1028,6 +1026,12 @@ static void next_rtc_reset_hold(Object *obj, ResetTy= pe type) memcpy(rtc->ram, rtc_ram2, 32); } =20 +static void next_rtc_init(Object *obj) +{ + qdev_init_gpio_in_named(DEVICE(obj), next_rtc_data_in_irq, + "rtc-data-in", 1); +} + static const VMStateDescription next_rtc_vmstate =3D { .name =3D "next-rtc", .version_id =3D 3, @@ -1057,6 +1061,7 @@ static void next_rtc_class_init(ObjectClass *klass, v= oid *data) static const TypeInfo next_rtc_info =3D { .name =3D TYPE_NEXT_RTC, .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_init =3D next_rtc_init, .instance_size =3D sizeof(NeXTRTC), .class_init =3D next_rtc_class_init, }; @@ -1128,6 +1133,9 @@ static void next_pc_realize(DeviceState *dev, Error *= *errp) if (!sysbus_realize(SYS_BUS_DEVICE(d), errp)) { return; } + /* Data from NeXTPC to RTC */ + qdev_connect_gpio_out_named(dev, "rtc-data-out", 0, + qdev_get_gpio_in_named(d, "rtc-data-in", 0= )); } =20 static void next_pc_init(Object *obj) @@ -1166,8 +1174,8 @@ static void next_pc_init(Object *obj) s->rtc_power_irq =3D qdev_get_gpio_in(DEVICE(obj), NEXT_PWR_I); qdev_init_gpio_in_named(DEVICE(obj), next_pc_rtc_data_in_irq, "pc-rtc-data-in", 1); - qdev_init_gpio_in_named(DEVICE(obj), next_rtc_data_in_irq, - "rtc-data-in", 1); + qdev_init_gpio_out_named(DEVICE(obj), &s->rtc_data_irq, + "rtc-data-out", 1); } =20 /* --=20 2.47.1 From nobody Sun Apr 6 22:18:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457625589558.9270242413661; Sat, 28 Dec 2024 23:33:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnib-0000X8-NG; Sun, 29 Dec 2024 02:28:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRni9-0007AE-7B for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:42 -0500 Received: from mail-ed1-f52.google.com ([209.85.208.52]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRni5-0002FY-8j for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:40 -0500 Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5d84179ef26so10556293a12.3 for ; Sat, 28 Dec 2024 23:27:36 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.27.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457255; x=1736062055; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QOPz+HDDyrtt7om/GXISvDlgUY8tOSmNDX0mLPvWlak=; b=qeOsj4bzkN09Jeg2Lx8RY9dVnYi2Y9iGRZ96fzdjVghJTLdYbWyAh9tsmz8+bvJqo/ cJcJZUcjOs/VXNzYnayqL1b+5BIZn+vWMCbQGw74MY0N9AFSra+jYzMz+K7zZyoTR7iu FlqCYgOqvl74iwROtp5mJw28e9Fd1TmgpZWaKWgvLmbLSZApbTibEXOgCUEJ2IPADFt3 w5B0KnmAM6JIbvuH/bldnaLR1jk3LB7PiVhYdsk4lCiKe3xrdEqDt6jCU04cAoe9KbPt w7W7mJGPy75WkAg0o4j0m8zhw6LOvIBEDXaYWSlkFeob2R5OUOvgl56E6/ZOqW+s4TyZ QqjQ== X-Forwarded-Encrypted: i=1; AJvYcCWh6fKI4mursrhqbw9Mw4QSGJeozQfZKvsIFUAj7smnA3T3rvt/8vdDS61EZvFFSV6l1NGdgosba9yP@nongnu.org X-Gm-Message-State: AOJu0Yy1P8OqocGQfTAU4/scvVG00ASN1BZwyafFYJsmvure9QU3Q3ET CkoXHZFMe+fVC0kPqwyvT4/AZvgCzC1xVe3VnZs07VAAJ89VVSZU X-Gm-Gg: ASbGncsRrb9yIMF/CG1QOrCdpXLQpKODZsw5kHLF4VpnECd8D2wcyJIv6Pqjr/NklKR pKfdH79X7zh1od0w+FjrjXUlLR+O8ZelxB1A2EXel8N8p36u1NMy4LGTS5UEeHbVvZGb50WnF8+ WNnmWmBz+hVMFGagO/rr3hfIlDSUWp2HDDDgaNMTtW9d6h21sITjts+Jz50NhxOl6YyKREG+2Q7 6AT+bZgk2+uiT2xgZlhBM4HyLn4tXYoLP8IkOgtnirl3GRm5eJH+h46KIcaEJd3B5J6GP4baEOq eEQ= X-Google-Smtp-Source: AGHT+IFmP+2YTSgma0G9OIaBN3ZRpElOOLZjgJVbfr6M55zXo/WvNtWRFwsjB7TUuo59r6CLAb40+Q== X-Received: by 2002:a05:6402:3585:b0:5d0:ea2a:726c with SMTP id 4fb4d7f45d1cf-5d81dd8faaamr26154473a12.8.1735457255361; Sat, 28 Dec 2024 23:27:35 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 30/35] next-cube: use named gpio output for next-rtc data Date: Sun, 29 Dec 2024 08:25:21 +0100 Message-ID: <20241229072526.166555-31-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.208.52; envelope-from=th.huth@gmail.com; helo=mail-ed1-f52.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457626432116600 From: Mark Cave-Ayland Add a named gpio output for the next-rtc data and then update next_rtc_data_in_irq() to drive the IRQ directly. This enables the next-rtc= to next-pc data to be wired up using the standard qdev gpio APIs. At the same time rename the pc-rtc-data-in gpio to rtc-data-in which is pos= sible now that the previous rtc-data-in gpio has been moved to the next-rtc devic= e. Signed-off-by: Mark Cave-Ayland Message-ID: <20241222130012.1013374-29-mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 69f5c7aaec..2bc6d49c34 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -56,6 +56,8 @@ struct NeXTRTC { uint8_t status; uint8_t control; uint8_t retval; + + qemu_irq data_out_irq; }; =20 #define TYPE_NEXT_SCSI "next-scsi" @@ -234,13 +236,10 @@ static void next_rtc_data_in_irq(void *opaque, int n,= int level) rtc->value =3D (rtc->value << 1) | level; } else { /* Shift out value to read */ - qemu_irq rtc_data_in_irq =3D qdev_get_gpio_in_named( - DEVICE(s), "pc-rtc-data-in", 0); - if (rtc->retval & (0x80 >> (rtc->phase - 8))) { - qemu_irq_raise(rtc_data_in_irq); + qemu_irq_raise(rtc->data_out_irq); } else { - qemu_irq_lower(rtc_data_in_irq); + qemu_irq_lower(rtc->data_out_irq); } } } @@ -1028,8 +1027,12 @@ static void next_rtc_reset_hold(Object *obj, ResetTy= pe type) =20 static void next_rtc_init(Object *obj) { + NeXTRTC *rtc =3D NEXT_RTC(obj); + qdev_init_gpio_in_named(DEVICE(obj), next_rtc_data_in_irq, "rtc-data-in", 1); + qdev_init_gpio_out_named(DEVICE(obj), &rtc->data_out_irq, + "rtc-data-out", 1); } =20 static const VMStateDescription next_rtc_vmstate =3D { @@ -1136,6 +1139,10 @@ static void next_pc_realize(DeviceState *dev, Error = **errp) /* Data from NeXTPC to RTC */ qdev_connect_gpio_out_named(dev, "rtc-data-out", 0, qdev_get_gpio_in_named(d, "rtc-data-in", 0= )); + /* Data from RTC to NeXTPC */ + qdev_connect_gpio_out_named(d, "rtc-data-out", 0, + qdev_get_gpio_in_named(dev, + "rtc-data-in", 0)); } =20 static void next_pc_init(Object *obj) @@ -1173,7 +1180,7 @@ static void next_pc_init(Object *obj) =20 s->rtc_power_irq =3D qdev_get_gpio_in(DEVICE(obj), NEXT_PWR_I); qdev_init_gpio_in_named(DEVICE(obj), next_pc_rtc_data_in_irq, - "pc-rtc-data-in", 1); + "rtc-data-in", 1); qdev_init_gpio_out_named(DEVICE(obj), &s->rtc_data_irq, "rtc-data-out", 1); } --=20 2.47.1 From nobody Sun Apr 6 22:18:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457593223411.60874154613066; Sat, 28 Dec 2024 23:33:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRniM-0007sp-7n; Sun, 29 Dec 2024 02:27:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRniD-0007Ev-0E for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:45 -0500 Received: from mail-ed1-f52.google.com ([209.85.208.52]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRni8-0002Hz-W2 for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:43 -0500 Received: by mail-ed1-f52.google.com with SMTP id 4fb4d7f45d1cf-5d0d32cd31aso11793722a12.0 for ; Sat, 28 Dec 2024 23:27:39 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.27.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457258; x=1736062058; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qfS3GhF1awVp92+r32OqyA+kFgYxtyMS0V30YdbjWn4=; b=aS9ZK5nkiut17wehgY/OXESl0nsGdDdjpiPgPkWpjceCVeeNJd7C6mD+Hq0+YcF6jN SH5S49pwQIPiGKsm0OwrVgdKoOqlyyE8wiEFK6Vxb0RxTRcrzMjw5yWb9Vj6o5n57KtM +Q3JL44CyX3OXe7yI29BUD/JK07bgs6ThlytVJvXbr92TltTXXH9itae1yQ+9AX7epw+ a23pXkUoIJZlvO71mfj6md+q8e6HFbI85xboKmtDm6ejZfagcO/XBhUCDVUDT3mQjjjU ZPaLvRqOj/viSnAiuIrhJY41DO6p8MoD4JhmR0HrbpyZCU1MbVee9bpvqvZQEQy1Hqpd D98g== X-Forwarded-Encrypted: i=1; AJvYcCW+u7Fff1DzAi8B6izmUpSPPxSe09A0uXphp/HTu/xjI93HuERa5QslMogrK83XMtVl5gEyeBzb8GZ+@nongnu.org X-Gm-Message-State: AOJu0Yw2+V9G5v1FDKhX/EhTaQiujEiO0Frpth8j/PzPyINis5C/sUvH qFc5boMG2mcDZnLH5Adiubvq+AqAJkCU4y2uz0o4BcaNMIQimphC X-Gm-Gg: ASbGncvak67dy1UM4Q0J5tRFN3fCCYAJ1ruqyPtcl1LwyskYaRz82qNQJgQRqKftI/c egEbkEpGPNOBZqZ2uwo1FXhs0JyEFhwRRIDrqbkxJ9uWVhrct3c3iwE5uw7/3IdkY/T0Rp9vwBl 4cg+91J7DyrRuyOWnDCJJHKxl1hfOXEsGi7hLDxV+9/kC7PP2KpG9uzzVPh7vlk0OnXtsKfXRyL Uf7PLL3xtj6Qhku8dtztqnyZI7GmmOZ56wmfEVXvB88yYF0TH6DDuEVGV8OvnlopldbdF7a1ZSY CSc= X-Google-Smtp-Source: AGHT+IEFWQ0SXvXdJpB4ZTHsVEYUFuat4UCm7vjFw62q80Z22GimPubsrFz1a4dweYk6B8qa7RFe1w== X-Received: by 2002:a05:6402:3206:b0:5d1:2377:5af3 with SMTP id 4fb4d7f45d1cf-5d81dd83b23mr70704841a12.5.1735457257944; Sat, 28 Dec 2024 23:27:37 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 31/35] next-cube: add rtc-cmd-reset named gpio to reset the rtc state machine Date: Sun, 29 Dec 2024 08:25:22 +0100 Message-ID: <20241229072526.166555-32-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.208.52; envelope-from=th.huth@gmail.com; helo=mail-ed1-f52.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457594245116600 From: Mark Cave-Ayland This allows us to decouple the next-pc and next-rtc devices from each other in next_scr2_rtc_update(). Signed-off-by: Mark Cave-Ayland Message-ID: <20241222130012.1013374-30-mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 2bc6d49c34..621e8dc832 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -108,6 +108,7 @@ struct NeXTPC { NeXTRTC rtc; qemu_irq rtc_power_irq; qemu_irq rtc_data_irq; + qemu_irq rtc_cmd_reset_irq; }; =20 typedef struct next_dma { @@ -264,7 +265,6 @@ static void next_rtc_data_in_irq(void *opaque, int n, i= nt level) static void next_scr2_rtc_update(NeXTPC *s) { uint8_t old_scr2, scr2_2; - NeXTRTC *rtc =3D &s->rtc; =20 old_scr2 =3D extract32(s->old_scr2, 8, 8); scr2_2 =3D extract32(s->scr2, 8, 8); @@ -282,9 +282,7 @@ static void next_scr2_rtc_update(NeXTPC *s) } } else { /* else end or abort */ - rtc->phase =3D 0; - rtc->command =3D 0; - rtc->value =3D 0; + qemu_irq_raise(s->rtc_cmd_reset_irq); } } =20 @@ -1015,6 +1013,17 @@ static const MemoryRegionOps next_dummy_en_ops =3D { .endianness =3D DEVICE_BIG_ENDIAN, }; =20 +static void next_rtc_cmd_reset_irq(void *opaque, int n, int level) +{ + NeXTRTC *rtc =3D NEXT_RTC(opaque); + + if (level) { + rtc->phase =3D 0; + rtc->command =3D 0; + rtc->value =3D 0; + } +} + static void next_rtc_reset_hold(Object *obj, ResetType type) { NeXTRTC *rtc =3D NEXT_RTC(obj); @@ -1033,6 +1042,8 @@ static void next_rtc_init(Object *obj) "rtc-data-in", 1); qdev_init_gpio_out_named(DEVICE(obj), &rtc->data_out_irq, "rtc-data-out", 1); + qdev_init_gpio_in_named(DEVICE(obj), next_rtc_cmd_reset_irq, + "rtc-cmd-reset", 1); } =20 static const VMStateDescription next_rtc_vmstate =3D { @@ -1143,6 +1154,8 @@ static void next_pc_realize(DeviceState *dev, Error *= *errp) qdev_connect_gpio_out_named(d, "rtc-data-out", 0, qdev_get_gpio_in_named(dev, "rtc-data-in", 0)); + qdev_connect_gpio_out_named(dev, "rtc-cmd-reset", 0, + qdev_get_gpio_in_named(d, "rtc-cmd-reset",= 0)); } =20 static void next_pc_init(Object *obj) @@ -1183,6 +1196,8 @@ static void next_pc_init(Object *obj) "rtc-data-in", 1); qdev_init_gpio_out_named(DEVICE(obj), &s->rtc_data_irq, "rtc-data-out", 1); + qdev_init_gpio_out_named(DEVICE(obj), &s->rtc_cmd_reset_irq, + "rtc-cmd-reset", 1); } =20 /* --=20 2.47.1 From nobody Sun Apr 6 22:18:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457767278472.62690496493803; Sat, 28 Dec 2024 23:36:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRniO-00084W-7f; Sun, 29 Dec 2024 02:27:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRniE-0007Lo-5H for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:46 -0500 Received: from mail-ej1-f47.google.com ([209.85.218.47]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRniA-0002Mb-Qs for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:45 -0500 Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a9e44654ae3so1355187666b.1 for ; Sat, 28 Dec 2024 23:27:41 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.27.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457261; x=1736062061; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C/fX2BDzfuTauaBQ4WZcOdxemf3BdSm//8XQTAUOovs=; b=pQdSHhkaVbc05KDnfOqbYXORcWPaQtUv/8um1Bt0473fqJBOtma4dTOjBZupL2QZ1p gKKjv9IFNGe6U/0UzRW/MyKKMJATAdihZniYs/Nnc4uSGO9V/6npX6vv8b6QQf6cuO8E 5RepKfafBLtsL+AJWOSl2GXIGRUbpyHUPG/V2Kxa84aifKbMlrU43pHprApHndXfdQTA VkjRXJYGpjVXJJv2OB6nmZQpaNtZGLCx4Lx7slbaFVbWHBabr2Ebme6Cc2HZ6CJcLCHw YK0CS6q0NsKhtDJiszA1a1IQXRzehd98sk+sSG0PPI9HtP1nQ6IMCOAzgJpgGvDya8gq cixg== X-Forwarded-Encrypted: i=1; AJvYcCVvb+AJ4n6wNDEcOXiYix/yTpaAXUskEp5A1l9jtk87HymwtNC10Yh5+F/zUI04UoGKJHbybUJdqDk9@nongnu.org X-Gm-Message-State: AOJu0YzyxOaoBzwGFaxiHYeWOy2m+UnlK4Deq+49KwVXCtRc7W0nb0Fe zWl5oMgIoC8oqy0ICyn9FMLUm7+3Vcz9RVIsukgoHkop4Sq0R6nI/VX/+Q== X-Gm-Gg: ASbGncuyyPedMQwZz+QbO7/t0ogj/KKYI/4RcJemsmOyPaSK9AURM5WERFYwyrWtUg0 Uxd4u+CyiLnbqm5wlAnyycjoK5BZfkyLWoYVLiUVBwA9qBdG1Q/RYuSRqVc0hr/LSHwLYpB5iNB 3dgdRV+wi8ttkytU5V026mYC3ZqO8jtY2p/5Kq+P+sptGQP3rHnniJPARkQGNunMRmUR8farGUs BLmhuH/MZIUWpHs81KpEcWIFQZIiqGWYv9d4TGWcGZ2Y50QCQsaj2phegCU2tNjQUevr1pXqCX/ vmE= X-Google-Smtp-Source: AGHT+IFdU81tXt5uzgvWKXxVy0jm8r/Irxp7ZSeQlWBpT4VFski1++LihhpN/LRAalOdxZnTjbWKXw== X-Received: by 2002:a17:907:1c93:b0:aa6:2b8b:20c6 with SMTP id a640c23a62f3a-aac2ad8a628mr2255037866b.20.1735457260538; Sat, 28 Dec 2024 23:27:40 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 32/35] next-cube: add rtc-power-out named gpio to trigger the NEXT_PWR_I interrupt Date: Sun, 29 Dec 2024 08:25:23 +0100 Message-ID: <20241229072526.166555-33-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.47; envelope-from=th.huth@gmail.com; helo=mail-ej1-f47.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457768772116600 From: Mark Cave-Ayland This allows us to decouple the next-pc and next-rtc devices from each other in next_rtc_data_in_irq(). Signed-off-by: Mark Cave-Ayland Message-ID: <20241222130012.1013374-31-mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 621e8dc832..9f40640b5d 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -58,6 +58,7 @@ struct NeXTRTC { uint8_t retval; =20 qemu_irq data_out_irq; + qemu_irq power_irq; }; =20 #define TYPE_NEXT_SCSI "next-scsi" @@ -106,7 +107,6 @@ struct NeXTPC { ESCCState escc; =20 NeXTRTC rtc; - qemu_irq rtc_power_irq; qemu_irq rtc_data_irq; qemu_irq rtc_cmd_reset_irq; }; @@ -184,7 +184,6 @@ static bool next_rtc_cmd_is_write(uint8_t cmd) static void next_rtc_data_in_irq(void *opaque, int n, int level) { NeXTRTC *rtc =3D NEXT_RTC(opaque); - NeXTPC *s =3D NEXT_PC(container_of(rtc, NeXTPC, rtc)); =20 if (rtc->phase < 8) { rtc->command =3D (rtc->command << 1) | level; @@ -256,7 +255,7 @@ static void next_rtc_data_in_irq(void *opaque, int n, i= nt level) if (rtc->value & 0x04) { /* clear FTU */ rtc->status =3D rtc->status & (~0x18); - qemu_irq_lower(s->rtc_power_irq); + qemu_irq_lower(rtc->power_irq); } } } @@ -1044,6 +1043,8 @@ static void next_rtc_init(Object *obj) "rtc-data-out", 1); qdev_init_gpio_in_named(DEVICE(obj), next_rtc_cmd_reset_irq, "rtc-cmd-reset", 1); + qdev_init_gpio_out_named(DEVICE(obj), &rtc->power_irq, + "rtc-power-out", 1); } =20 static const VMStateDescription next_rtc_vmstate =3D { @@ -1156,6 +1157,8 @@ static void next_pc_realize(DeviceState *dev, Error *= *errp) "rtc-data-in", 0)); qdev_connect_gpio_out_named(dev, "rtc-cmd-reset", 0, qdev_get_gpio_in_named(d, "rtc-cmd-reset",= 0)); + qdev_connect_gpio_out_named(d, "rtc-power-out", 0, + qdev_get_gpio_in(dev, NEXT_PWR_I)); } =20 static void next_pc_init(Object *obj) @@ -1191,7 +1194,6 @@ static void next_pc_init(Object *obj) =20 object_initialize_child(obj, "rtc", &s->rtc, TYPE_NEXT_RTC); =20 - s->rtc_power_irq =3D qdev_get_gpio_in(DEVICE(obj), NEXT_PWR_I); qdev_init_gpio_in_named(DEVICE(obj), next_pc_rtc_data_in_irq, "rtc-data-in", 1); qdev_init_gpio_out_named(DEVICE(obj), &s->rtc_data_irq, --=20 2.47.1 From nobody Sun Apr 6 22:18:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457583511510.8907476537198; Sat, 28 Dec 2024 23:33:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnig-0000xH-4x; Sun, 29 Dec 2024 02:28:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRniF-0007Wy-Kx for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:47 -0500 Received: from mail-ej1-f48.google.com ([209.85.218.48]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRniC-0002QM-Oo for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:47 -0500 Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-aa66ead88b3so1545136266b.0 for ; Sat, 28 Dec 2024 23:27:44 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.27.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457263; x=1736062063; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WiBy0J8yqLlyV4J5K+8NrqYNcSUPfedA9uj7buimwak=; b=BUNRUDfN1FN4qCkkT3YSCEgL6U44LLGXhDsU2cQzaUQfbqygqO/nT/6TdginlApHhF jr3LFT39Q3WS1q5vuA7gTXTqa0ipTulECqq/drvmnCG52aUVUEhXLR8SSLvOLZSqeeDD nF4zsW32+xWGk2xzeriVwkB2rPMdXMEan44Zfy8dL1Y0+DEJuO3vF9v4S67darM3uvw0 e4Gyi1jj2JgZdGZ0lQ4nl+JKkj2Djf82xaPew6JLKdAlF5uu1AvAE69WLu9W3XRm26OS y0ha9xG86TJzNkqibqLB9auSB3gJhojkbzYTq7bLnwq4e/mUbt8Ga6GVR2lCT8MboQPl zTTg== X-Forwarded-Encrypted: i=1; AJvYcCXqOh+dlvVENzUnMoXlYMrgt/qCVKlA08KHxFUDVOHRaGD6HcHgG6uS3sfFZqhMiZoIeDYoefS8repP@nongnu.org X-Gm-Message-State: AOJu0YwPbPBjfqgIl1f0HMojNPb5gLmII0fx0bVL2oMfv2lgFn4zbQVD +x/dSrU3TsGHGECkuMNkMzYzvFzp4PlNjb8TafUeU9NBTTRkTcNR X-Gm-Gg: ASbGncve8H0Y5zCB3AWdzCZmWbCRYcqwl0FypNKUmwakpn8RFUrov5sIcsqpHYQ4kHZ FfRARVxIsLq4h4oestxih2mzQBtseS07qGeYIyubbeq+Ug4tki0n0jFjM3ViizMOjOR2wkCipiA Yyy97yuEhIjo315rCOJEgvkif2Ob5nOvPZHtzf/d4IpfwaXyXRheyMe4Skh4XTAlzh0pwntR2Fr R0PAPdu+QnnpBXSJ1s0RtD2zSTAizpNiHMfGJ9BSR8Bz0153Sb2rW7SHJzIEJRX4+p5kkFP03/9 g5Y= X-Google-Smtp-Source: AGHT+IFicz2nqAt3e1+14crZsqv4JWhuEdxZS7tUf4shZuFsq+3KyLZZ0llBUM3MWcriGk6p3NFGAQ== X-Received: by 2002:a17:906:c10d:b0:aa6:6c08:dc71 with SMTP id a640c23a62f3a-aac2ad8ba3fmr2679643866b.23.1735457262825; Sat, 28 Dec 2024 23:27:42 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 33/35] next-cube: move next_rtc_cmd_is_write() and next_rtc_data_in_irq() functions Date: Sun, 29 Dec 2024 08:25:24 +0100 Message-ID: <20241229072526.166555-34-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.48; envelope-from=th.huth@gmail.com; helo=mail-ej1-f48.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457584271116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland Move these functions in next-cube.c so that they are with the rest of the next-rtc functions. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-32-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 172 ++++++++++++++++++++++---------------------- 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 9f40640b5d..360a46c32e 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -175,92 +175,6 @@ static void next_scr2_led_update(NeXTPC *s) } } =20 -static bool next_rtc_cmd_is_write(uint8_t cmd) -{ - return (cmd >=3D 0x80 && cmd <=3D 0x9f) || - (cmd =3D=3D 0xb1); -} - -static void next_rtc_data_in_irq(void *opaque, int n, int level) -{ - NeXTRTC *rtc =3D NEXT_RTC(opaque); - - if (rtc->phase < 8) { - rtc->command =3D (rtc->command << 1) | level; - - if (rtc->phase =3D=3D 7 && !next_rtc_cmd_is_write(rtc->command)) { - if (rtc->command <=3D 0x1f) { - /* RAM registers */ - rtc->retval =3D rtc->ram[rtc->command]; - } - if ((rtc->command >=3D 0x20) && (rtc->command <=3D 0x2f)) { - /* RTC */ - time_t time_h =3D time(NULL); - struct tm *info =3D localtime(&time_h); - rtc->retval =3D 0; - - switch (rtc->command) { - case 0x20: - rtc->retval =3D SCR2_TOBCD(info->tm_sec); - break; - case 0x21: - rtc->retval =3D SCR2_TOBCD(info->tm_min); - break; - case 0x22: - rtc->retval =3D SCR2_TOBCD(info->tm_hour); - break; - case 0x24: - rtc->retval =3D SCR2_TOBCD(info->tm_mday); - break; - case 0x25: - rtc->retval =3D SCR2_TOBCD((info->tm_mon + 1)); - break; - case 0x26: - rtc->retval =3D SCR2_TOBCD((info->tm_year - 100)); - break; - } - } - if (rtc->command =3D=3D 0x30) { - /* read the status 0x30 */ - rtc->retval =3D rtc->status; - } - if (rtc->command =3D=3D 0x31) { - /* read the control 0x31 */ - rtc->retval =3D rtc->control; - } - } - } - if (rtc->phase >=3D 8 && rtc->phase < 16) { - if (next_rtc_cmd_is_write(rtc->command)) { - /* Shift in value to write */ - rtc->value =3D (rtc->value << 1) | level; - } else { - /* Shift out value to read */ - if (rtc->retval & (0x80 >> (rtc->phase - 8))) { - qemu_irq_raise(rtc->data_out_irq); - } else { - qemu_irq_lower(rtc->data_out_irq); - } - } - } - - rtc->phase++; - if (rtc->phase =3D=3D 16 && next_rtc_cmd_is_write(rtc->command)) { - if (rtc->command >=3D 0x80 && rtc->command <=3D 0x9f) { - /* RAM registers */ - rtc->ram[rtc->command - 0x80] =3D rtc->value; - } - if (rtc->command =3D=3D 0xb1) { - /* write to 0x30 register */ - if (rtc->value & 0x04) { - /* clear FTU */ - rtc->status =3D rtc->status & (~0x18); - qemu_irq_lower(rtc->power_irq); - } - } - } -} - static void next_scr2_rtc_update(NeXTPC *s) { uint8_t old_scr2, scr2_2; @@ -1012,6 +926,92 @@ static const MemoryRegionOps next_dummy_en_ops =3D { .endianness =3D DEVICE_BIG_ENDIAN, }; =20 +static bool next_rtc_cmd_is_write(uint8_t cmd) +{ + return (cmd >=3D 0x80 && cmd <=3D 0x9f) || + (cmd =3D=3D 0xb1); +} + +static void next_rtc_data_in_irq(void *opaque, int n, int level) +{ + NeXTRTC *rtc =3D NEXT_RTC(opaque); + + if (rtc->phase < 8) { + rtc->command =3D (rtc->command << 1) | level; + + if (rtc->phase =3D=3D 7 && !next_rtc_cmd_is_write(rtc->command)) { + if (rtc->command <=3D 0x1f) { + /* RAM registers */ + rtc->retval =3D rtc->ram[rtc->command]; + } + if ((rtc->command >=3D 0x20) && (rtc->command <=3D 0x2f)) { + /* RTC */ + time_t time_h =3D time(NULL); + struct tm *info =3D localtime(&time_h); + rtc->retval =3D 0; + + switch (rtc->command) { + case 0x20: + rtc->retval =3D SCR2_TOBCD(info->tm_sec); + break; + case 0x21: + rtc->retval =3D SCR2_TOBCD(info->tm_min); + break; + case 0x22: + rtc->retval =3D SCR2_TOBCD(info->tm_hour); + break; + case 0x24: + rtc->retval =3D SCR2_TOBCD(info->tm_mday); + break; + case 0x25: + rtc->retval =3D SCR2_TOBCD((info->tm_mon + 1)); + break; + case 0x26: + rtc->retval =3D SCR2_TOBCD((info->tm_year - 100)); + break; + } + } + if (rtc->command =3D=3D 0x30) { + /* read the status 0x30 */ + rtc->retval =3D rtc->status; + } + if (rtc->command =3D=3D 0x31) { + /* read the control 0x31 */ + rtc->retval =3D rtc->control; + } + } + } + if (rtc->phase >=3D 8 && rtc->phase < 16) { + if (next_rtc_cmd_is_write(rtc->command)) { + /* Shift in value to write */ + rtc->value =3D (rtc->value << 1) | level; + } else { + /* Shift out value to read */ + if (rtc->retval & (0x80 >> (rtc->phase - 8))) { + qemu_irq_raise(rtc->data_out_irq); + } else { + qemu_irq_lower(rtc->data_out_irq); + } + } + } + + rtc->phase++; + if (rtc->phase =3D=3D 16 && next_rtc_cmd_is_write(rtc->command)) { + if (rtc->command >=3D 0x80 && rtc->command <=3D 0x9f) { + /* RAM registers */ + rtc->ram[rtc->command - 0x80] =3D rtc->value; + } + if (rtc->command =3D=3D 0xb1) { + /* write to 0x30 register */ + if (rtc->value & 0x04) { + /* clear FTU */ + rtc->status =3D rtc->status & (~0x18); + qemu_irq_lower(rtc->power_irq); + } + } + } +} + static void next_rtc_cmd_reset_irq(void *opaque, int n, int level) { NeXTRTC *rtc =3D NEXT_RTC(opaque); --=20 2.47.1 From nobody Sun Apr 6 22:18:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457767389111.9868776942601; Sat, 28 Dec 2024 23:36:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnim-0001CS-3a; Sun, 29 Dec 2024 02:28:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRniG-0007cB-AS for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:48 -0500 Received: from mail-ej1-f48.google.com ([209.85.218.48]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRniE-0002Wi-Sn for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:48 -0500 Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-aaf57c2e0beso23398366b.3 for ; Sat, 28 Dec 2024 23:27:46 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.27.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457265; x=1736062065; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6c+6XcbVtB2vqqzGJAKMAXsg3ZBXmuneXOWCq5giJbQ=; b=iuiybkpVPPCpXJpm1/7Vhru90Y3qknS62mjLauJjQv30imVSUF4R6ONItgrDwiF8gN BLD3t+27lpE26xyVUg46tBEUoaUt6DbX6FN4gjYsF7CxS0UfNHLAKeM2zn6fGG29l0/w 9RFDJjL1ckEoqNuWwzrdZ33hkmhz398ZSDva0SYRc0VTDrKIohFwhOzYOkN+0okpvpEx Tj7mLSE8p/V4srlcLjbS4S56/OjtwCKxJqLRrEnfRMKBPD0txQvVsYqVGZKuMxiInsTa j7RNxkpIRvdu26oZt8HCSfWt5rIuzP4ClXRhoNu6u+Wo5LloPR2zjI+/vzQqLU7QcAka MuOg== X-Forwarded-Encrypted: i=1; AJvYcCWf9i7+P6rv58hngO1H8ne5nRPqxht5Li38IB4kctGhish4nK2AzaMv9LjnZ9jeVH/iyCOAxgsvwsri@nongnu.org X-Gm-Message-State: AOJu0Yy0N6PYSwcFs6SC8q9cM5W6JOizsaftMBPF5bJd1z/zndNGkUMq 9qaJ52st4+RVfv5tv7GmWchaMs7dj+r16UqL2ikpx28eyxazh9je X-Gm-Gg: ASbGncsAg1USwV38D7BaTr2cfQkAS0cf9mdSnNK/NkosZRMAkoTdXUau9VbCRS9a8ah +mL2LJI58vKj6IkGq4vfnwr3G47HpNcukJtZ68E+t1e5Ac1cdB9A/Lk4BaKt5C6hzxuic6troOH aW2M7GymOe9FwV/N/eyOqgaZaU1w0/fx3GAQP0MiOTSgid/P1QxHPu+9uRuio44XqGOxxB9RzFs kHE602eLm9mlk88o/0MhRZrowY5sSoUK1XHIS+QeeCfuRNZykTRBIJrFRexRt30iy8Np8bcthn2 uLI= X-Google-Smtp-Source: AGHT+IGJr0AUtJYDjZBp60jy2IDosGHIXjqTvumQEGwH1FwCtEVHYd56CHQRtEuPa62Fxx2th1ai4Q== X-Received: by 2002:a17:906:4795:b0:aa6:ab70:4a78 with SMTP id a640c23a62f3a-aac3355ea10mr2438685666b.37.1735457265398; Sat, 28 Dec 2024 23:27:45 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 34/35] next-cube: rename old_scr2 and scr2_2 in next_scr2_rtc_update() Date: Sun, 29 Dec 2024 08:25:25 +0100 Message-ID: <20241229072526.166555-35-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.218.48; envelope-from=th.huth@gmail.com; helo=mail-ej1-f48.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457768737116600 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland Rename them to old_scr2_rtc and scr2_rtc to reflect that they contain the p= revious and current values of the SCR2 RTC bits. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Message-ID: <20241222130012.1013374-33-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 360a46c32e..513ce5844b 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -177,17 +177,17 @@ static void next_scr2_led_update(NeXTPC *s) =20 static void next_scr2_rtc_update(NeXTPC *s) { - uint8_t old_scr2, scr2_2; + uint8_t old_scr2_rtc, scr2_rtc; =20 - old_scr2 =3D extract32(s->old_scr2, 8, 8); - scr2_2 =3D extract32(s->scr2, 8, 8); + old_scr2_rtc =3D extract32(s->old_scr2, 8, 8); + scr2_rtc =3D extract32(s->scr2, 8, 8); =20 - if (scr2_2 & 0x1) { + if (scr2_rtc & 0x1) { /* DPRINTF("RTC %x phase %i\n", scr2_2, rtc->phase); */ /* 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 (scr2_2 & SCR2_RTDATA) { + if (((old_scr2_rtc & SCR2_RTCLK) !=3D (scr2_rtc & SCR2_RTCLK)) && + ((scr2_rtc & SCR2_RTCLK) =3D=3D 0)) { + if (scr2_rtc & SCR2_RTDATA) { qemu_irq_raise(s->rtc_data_irq); } else { qemu_irq_lower(s->rtc_data_irq); --=20 2.47.1 From nobody Sun Apr 6 22:18:26 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.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 1735457631808740.4337457800194; Sat, 28 Dec 2024 23:33:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRnib-0000WW-J1; Sun, 29 Dec 2024 02:28:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRniJ-0007nX-La for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:53 -0500 Received: from mail-ed1-f42.google.com ([209.85.208.42]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tRniH-0002ZU-Ei for qemu-devel@nongnu.org; Sun, 29 Dec 2024 02:27:50 -0500 Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-5d4e2aa7ea9so14963527a12.2 for ; Sat, 28 Dec 2024 23:27:49 -0800 (PST) Received: from tpx1.. (ip-109-42-49-90.web.vodafone.de. [109.42.49.90]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aac0e895194sm1329218666b.70.2024.12.28.23.27.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Dec 2024 23:27:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735457268; x=1736062068; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=N2x1C1KETruZ4XgMCe5FOJyXuqUjk3r6Kg+gcBPkahg=; b=O3rpMtHuikT+VN4xJNoQw1YdRcwPs7/jzsechfr2Kz5nzu1hPmMnUM2UxkXSpspmMe 78fUfwye8LVxFHj5Uewgw5f27MMgo+MmvwngBW3+v79qh2rR1EWUtO5hyKjvNTYtdvSE YhktJCt5F77+e6TZctKIujkuz/Q1GqNhe5rQKjeiywBKeh2OrYe5W/fe20WThteilrOC 3hfe4GRuTrslQ4Ef+z7UfM63mjgUMh3jDisyDJH6kjrzg/xu0Jp0FuEmEHrX3kiQHJlx 9D4n37z/MK8hW/VoEtmQqYwKW8S3dTaUOs9BLll0F7WbkjpUzUHd5KbhPWDuSdQ27uUw MLnw== X-Forwarded-Encrypted: i=1; AJvYcCVTT52io1/2QtMAUPo91d+kqs57UXtj9hqnJD3rTLPQaBvL2BBahLYghMnZNUw6LU2G9nq9pkRHqweR@nongnu.org X-Gm-Message-State: AOJu0YxwEo0dZS3UFYyfDHlV4lrQN8c45jUQ63j9YoAnrsqNRVHBPcRe jb6OMhiGMm/48JuuVzgMoVD2YlIkGFXftcMD3GzFCz83n6bs+DKejRKxlw== X-Gm-Gg: ASbGncs1sF03z5sbL97s0sRVe3hfbG5QbE4p3fAXLMW8qEK1JgmZO0DnDOMVDaDcctx tNjWefyAs+4uF5QQeax1i0YhdMBDD8ac6I9I7s7eqXxoZQ4wYBwLB3K52qBznZgOti2fQbnCf0X xVL6HaidqzXp5yAM2vnaez/lwz8w3v2lv8msX/tA8CZFySlShc47iS+JLcVuEJBwBoAYB5x2lGs B1f5DOErsRrAIj/V9UXXlK9ldqh9gR3o7aSBSQU0/dziV9juBSmZvJIkv+lX17EdzlnnS5J/fAb 3gg= X-Google-Smtp-Source: AGHT+IGEhPwSp0E2XfirKl/mp8H32vP7eG4+K67DBezTYR/T094GQMQKYFTBEuUk89bY20xLvN4cUw== X-Received: by 2002:a05:6402:370f:b0:5d4:3761:d196 with SMTP id 4fb4d7f45d1cf-5d81dda7b47mr27160689a12.10.1735457267878; Sat, 28 Dec 2024 23:27:47 -0800 (PST) From: Thomas Huth To: Stefan Hajnoczi , qemu-devel@nongnu.org Subject: [PULL 35/35] next-cube: add my copyright to the top of the file Date: Sun, 29 Dec 2024 08:25:26 +0100 Message-ID: <20241229072526.166555-36-huth@tuxfamily.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241229072526.166555-1-huth@tuxfamily.org> References: <20241229072526.166555-1-huth@tuxfamily.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=209.85.208.42; envelope-from=th.huth@gmail.com; helo=mail-ed1-f42.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.156, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 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-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1735457632283116600 From: Mark Cave-Ayland This series has involved rewriting and/or updating a considerable part of t= he next-cube emulation so update the copyright in next-cube.c to reflect this. Signed-off-by: Mark Cave-Ayland Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20241222130012.1013374-34-mark.cave-ayland@ilande.co.uk> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/m68k/next-cube.c b/hw/m68k/next-cube.c index 513ce5844b..0570e4a76f 100644 --- a/hw/m68k/next-cube.c +++ b/hw/m68k/next-cube.c @@ -2,6 +2,7 @@ * NeXT Cube System Driver * * Copyright (c) 2011 Bryce Lanham + * Copyright (c) 2024 Mark Cave-Ayland * * This code is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published --=20 2.47.1