From patchwork Sat Oct 28 23:56:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: BALATON Zoltan X-Patchwork-Id: 13439638 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 20984C4167B for ; Sat, 28 Oct 2023 23:57:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwtAI-0007bU-VU; Sat, 28 Oct 2023 19:56:27 -0400 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 1qwtAH-0007ah-An for qemu-devel@nongnu.org; Sat, 28 Oct 2023 19:56:25 -0400 Received: from zero.eik.bme.hu ([152.66.115.2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qwtAE-0006JN-Q3 for qemu-devel@nongnu.org; Sat, 28 Oct 2023 19:56:25 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id 6AF07756078; Sun, 29 Oct 2023 01:56:22 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id EEEEF7456A7; Sun, 29 Oct 2023 01:56:21 +0200 (CEST) Message-Id: From: BALATON Zoltan Subject: [PATCH 0/4] Fix IRQ routing in via south bridge To: qemu-devel@nongnu.org Cc: philmd@linaro.org, Jiaxun Yang , Bernhard Beschow , vr_qemu@t-online.de Date: Sun, 29 Oct 2023 01:56:21 +0200 (CEST) Received-SPF: pass client-ip=152.66.115.2; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This is going back to my otiginal proposal in https://patchew.org/QEMU/cover.1677004414.git.balaton@eik.bme.hu/ implementing routing of interrupts from device functions and PCI devices to ISA interrupts. On pegasos2 the firmware sets evertyhing to share IRQ 9 so the current simpified version worked for taht but with the amigaone machine its firmware makes use of this feature and assigns different interrupts to functions and PCI devices so we need to properly impelent this. Since any ISA interrupt can be controlled by any interrupt source (different functions of the multifunction device plus the 4 input pins from PCI devices) there are more than 4 possible sources so this can't be handled by just the 4 PCI interrupt lines. We need to keep track of the state of each interrupt source to be able to determine the level of the ISA interrupt and avoid one device clearing it while other still has an interrupt. This fixes USB on amigaone and maybe other bugs not discovered yet. Regards, BALATON Zoltan BALATON Zoltan (4): hw/isa/vt82c686: Bring back via_isa_set_irq() hw/usb/vt82c686-uhci-pci: Use ISA instead of PCI interrupts hw/isa/vt82c686: Route PIRQ inputs using via_isa_set_irq() hw/audio/via-ac97: Route interrupts using via_isa_set_irq() hw/audio/via-ac97.c | 8 ++--- hw/isa/vt82c686.c | 67 +++++++++++++++++++++++--------------- hw/usb/vt82c686-uhci-pci.c | 9 +++++ include/hw/isa/vt82c686.h | 2 ++ 4 files changed, 56 insertions(+), 30 deletions(-)