From nobody Mon May 13 18:32:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1677345040; cv=none; d=zohomail.com; s=zohoarc; b=CXdy/+qNgU+y7BCmYYj1qmx1CX/6rPlp1Qt5sP0xwC+zkf3Tos4aCAaJJJz3AmbaqS9FcDRWMmW5vYxsK6d8azcHMAjIO1CZ7sgZpweGk3ETYkWts4xcPMaPqQeM9G1sWImdIHQuSeCnjf/Agrue9ZnEcw6scRcupK3tg5pfcjk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677345040; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7DZ4IC21cN4EEqkYPJ+LbANCivKRiX+Zc8yuBjmuGaQ=; b=de7GuJEztKzQFGrV1uVVdO5L8ojw3b2uWh7sRWV3+IC/4BnmLqhLbBkEY3Sn/iWFZm0zV9ZImvydjb6I3X9PdEjaS9i/jKA6gydZGbCOyA7OYwnMtpiDHdMrYBaeMeu6b+SYJg9N3llpxhRHRSRt4sZdaz+dSwjJ48pBLe9hlW0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677345040388649.2692554598218; Sat, 25 Feb 2023 09:10:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVy2y-0001af-4J; Sat, 25 Feb 2023 12:09: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 1pVy2w-0001a2-AM; Sat, 25 Feb 2023 12:09:18 -0500 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVy2u-0005bf-NA; Sat, 25 Feb 2023 12:09:18 -0500 Received: by mail-ed1-x536.google.com with SMTP id s26so9298661edw.11; Sat, 25 Feb 2023 09:09:16 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf06ee000578a61baa078133.dip0.t-ipconnect.de. [2003:fa:af06:ee00:578:a61b:aa07:8133]) by smtp.gmail.com with ESMTPSA id t6-20020a17090616c600b008d356cafaedsm989066ejd.40.2023.02.25.09.09.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Feb 2023 09:09:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7DZ4IC21cN4EEqkYPJ+LbANCivKRiX+Zc8yuBjmuGaQ=; b=fb8l3FH5vliNikDo69X9Z02iyOrPe/M2G8yPO3sgiPR3PiAM74fLA2X3wiV/GEu4ea U/1X5CyFVK+H3xePtdhsiMvSAS/InYEZRLQdcbUHZwoH3U6dycJCuqPDqWIr+qD6gAh+ FxA8bZJrZoNhMy8t2QWZGxVL/nAn0a3Wao+n0SMxICCM/O0bsxFjZO2HUhiDvY8Rx9A0 vwCGFe6Wx2nwoUuGeLYORQhlhHvREvJ5TkgOku7vK2c5Vid/lg7wedCQnZPNHyiVFgvw WYZ7AYhNvUeP11MV3AFTQRpM0/8vMVx/VqFA6gq0XaJYNar3fwaoSDpeYV9xlDZl4wnX knKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7DZ4IC21cN4EEqkYPJ+LbANCivKRiX+Zc8yuBjmuGaQ=; b=vG/6L9aPVhonDeaG23Mmr90ckTy1HUAshJvPCKMAR+pCBHxveJfroXsmZ+HN4znzer qePXgPt5ubK/vsGTZ9dkAWSiq1Q4o+RiiuDMr3HldailJtkRX2hl/2pIsf8fuHkNX4Wt 8Chf1OXezNRvQ3rbqe3ik5MJ3wd4Tzhgzg8r8qin24NZfNMgmNhrbuodyNgxkGAfzPpR vTeyglr1+TgY02LvdgVftCjbAg92dq9x9NMJ+HJE0a13ElxUM6f2DGNr9V/nHLLa4SF1 UPP4ld9HsGHeD4I6Sovv3MzbU3r11IRoDbWH4FFA4O0atR++FA/uEUaeanX9X2dOdHmA hQMg== X-Gm-Message-State: AO0yUKUDNzRXJ2Y8SHP+pJYlyRXYImke9+KdxGFhoLX4PS2bDqhmFZnK C31TWF6rIKVKz0qODWJ+2OLxOOsRDII5iA== X-Google-Smtp-Source: AK7set9DC+rcRxmXaOCkkb1d8suLuaBY/jFWlWRquJh4qeaEBkqRewV4rVm6g+vGxnltdMdtFuKxAA== X-Received: by 2002:a17:906:4909:b0:8af:2191:89a6 with SMTP id b9-20020a170906490900b008af219189a6mr24361766ejq.72.1677344954627; Sat, 25 Feb 2023 09:09:14 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Gerd Hoffmann , Huacai Chen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, BALATON Zoltan , Bernhard Beschow Subject: [PATCH v2 1/3] hw/ppc/pegasos2: Initialize VT8231 PCI IRQ router Date: Sat, 25 Feb 2023 18:08:55 +0100 Message-Id: <20230225170857.15774-2-shentey@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230225170857.15774-1-shentey@gmail.com> References: <20230225170857.15774-1-shentey@gmail.com> 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=2a00:1450:4864:20::536; envelope-from=shentey@gmail.com; helo=mail-ed1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1677345042743100003 Content-Type: text/plain; charset="utf-8" The firmware of the real PegasosII board routes all PIRQx to IRQ9, so do the same in QEMU. The PCI_INTERRUPT_LINE registers of the respective internal PCI functions are already initialized with IRQ9 which are currently used for routing. Note that the PCI interrupt router isn't implemented yet in the VIA south bridges. This change has therefore no effect until this happens. Inspired-by: ("hw/ppc/pegasos2: Fix PCI interrupt routing") Signed-off-by: Bernhard Beschow --- hw/ppc/pegasos2.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c index a9563f4fb2..41688699eb 100644 --- a/hw/ppc/pegasos2.c +++ b/hw/ppc/pegasos2.c @@ -268,6 +268,12 @@ static void pegasos2_machine_reset(MachineState *machi= ne, ShutdownCause reason) PCI_INTERRUPT_LINE, 2, 0x9); pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) | 0x50, 1, 0x2); + pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) | + 0x55, 1, 0x90); + pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) | + 0x56, 1, 0x99); + pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 0) << 8) | + 0x57, 1, 0x90); =20 pegasos2_pci_config_write(pm, 1, (PCI_DEVFN(12, 1) << 8) | PCI_INTERRUPT_LINE, 2, 0x109); --=20 2.39.2 From nobody Mon May 13 18:32:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1677345053; cv=none; d=zohomail.com; s=zohoarc; b=CRBeNEX568VHjk0HZgy0JB+zIo0mZ0cBFyu9d2pum6zNdDTBJjKgoNc72uoO3GYn81bE72ZUDme+JR1xSM8pAckC/sAzFnzOpJWWcz9vQ4yJzql8pVvCe0YV1yloZPMZW23eCAEcrqeod/XZ8s4URyWIvxkUegOdukq/fmoEhBs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677345053; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=URC4QULn1s6Vm1JS2+nnjxOu3AuTbC5LZ+8A63obzbk=; b=WivIKnuybniG93xNHJZ+/NpnVv0ATmIq8b78eHM1y+GnwtQHWgtUY7ZxqKiGXrsi47VoCI2EdG0C2H9SDG/uuZwtRBJhMSNFwTX01CDy8yY+OmaIlbSmjT0NLtr8BQmzmXrksqwOUKsbNPYUNiryEIgU1qJNh8dVBTMJQ4RuOiY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677345053064307.90850117369314; Sat, 25 Feb 2023 09:10:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVy2z-0001c3-Hr; Sat, 25 Feb 2023 12:09:21 -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 1pVy2x-0001ab-Tf; Sat, 25 Feb 2023 12:09:19 -0500 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVy2v-0005co-HO; Sat, 25 Feb 2023 12:09:19 -0500 Received: by mail-ed1-x52d.google.com with SMTP id cq23so9535368edb.1; Sat, 25 Feb 2023 09:09:16 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf06ee000578a61baa078133.dip0.t-ipconnect.de. [2003:fa:af06:ee00:578:a61b:aa07:8133]) by smtp.gmail.com with ESMTPSA id t6-20020a17090616c600b008d356cafaedsm989066ejd.40.2023.02.25.09.09.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Feb 2023 09:09:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=URC4QULn1s6Vm1JS2+nnjxOu3AuTbC5LZ+8A63obzbk=; b=dieEEyiDTvB7t7aoMeXFfM18WiGE9+IoqB7nDW1gfo85+2R/tvrv4BBuzU8dOeR1Pe Y1rN3PX/D2raoI7eEqPpNgg/6RJScEGgbVH6gHjs6TB+iny/6elfKGIj4rpnwXloGeWA Ud/3NH+5IgCbb0bbo+cSX9Ck9afioJHwserHD+vTsCxjEya6NiZ1QSugA6G8WbkjbMds iAkJS21S45uX31p57WP1CON80FnY8fgJXMQ37OxRBoo5N8M/k0moo4G3UNkhtReQzqPe 9GV8fOaeXaEca0Wl3H++VHaUNocHjmOEBAoRCVzJVi7LiVnYOlUI3hHVhM/76GEChKGr 3kkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=URC4QULn1s6Vm1JS2+nnjxOu3AuTbC5LZ+8A63obzbk=; b=QkRVzyTDAcZ2YoZvTMCKzvJwOqC4OORvOiQ32J28biRGfNI9Zjb9Jyfrc0YwkWTrLR eWT7xSbTAwSHmoD4GoyiNCbn+g7fewYdewtkPCanNuWx/lzEQWCxAggYXkMItqSBK9BC vnx9ghYlQJc80y1bv+WoDYdRtGCDL2GLa1TqyX028CgCYQrTWdJ8+wDIkq/ECduPcNRq l+o5o4tLfg4+P+rARKyP1m7AkcYUxPxao76hHTRD+Dd1JkJyikz9hVkbPMENAWARPaDG 3XweYVd8vdAAhTvnOlxclkMWtuNdSM6+nrt/1Q+jXO9a8OdxdI0Uo84BoNtyDdYj5bYX SXsA== X-Gm-Message-State: AO0yUKVMPV/lnwZnk/uSPPKpzMt2exDCbJYswH9fU5M67nqf3p949iC9 66gAbqRihNbxD13dFOQ16WgzgAz0l5dVAg== X-Google-Smtp-Source: AK7set8RudUZM7uL76kAOH5izV1ijB9Vkgt50kyP/gJH4t04XiPzpJtw5WK4HdAZ561wlNVeGHT6Xg== X-Received: by 2002:a17:906:2610:b0:8b1:2e7c:df49 with SMTP id h16-20020a170906261000b008b12e7cdf49mr26114898ejc.7.1677344955454; Sat, 25 Feb 2023 09:09:15 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Gerd Hoffmann , Huacai Chen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, BALATON Zoltan , Bernhard Beschow Subject: [PATCH v2 2/3] hw/isa/vt82c686: Implement PCI IRQ routing Date: Sat, 25 Feb 2023 18:08:56 +0100 Message-Id: <20230225170857.15774-3-shentey@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230225170857.15774-1-shentey@gmail.com> References: <20230225170857.15774-1-shentey@gmail.com> 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=2a00:1450:4864:20::52d; envelope-from=shentey@gmail.com; helo=mail-ed1-x52d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1677345053728100001 Content-Type: text/plain; charset="utf-8" The real VIA south bridges implement a PCI IRQ router which is configured by the BIOS or the OS. In order to respect these configurations, QEMU needs to implement it as well. Note: The implementation was taken from piix4_set_irq() in hw/isa/piix4. Signed-off-by: Bernhard Beschow --- hw/isa/vt82c686.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 3f9bd0c04d..f24e387d63 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -604,6 +604,48 @@ static void via_isa_request_i8259_irq(void *opaque, in= t irq, int level) qemu_set_irq(s->cpu_intr, level); } =20 +static int via_isa_get_pci_irq(const ViaISAState *s, int irq_num) +{ + switch (irq_num) { + case 0: + return s->dev.config[0x55] >> 4; + + case 1: + return s->dev.config[0x56] & 0xf; + + case 2: + return s->dev.config[0x56] >> 4; + + case 3: + return s->dev.config[0x57] >> 4; + } + + return 0; +} + +static void via_isa_set_pci_irq(void *opaque, int irq_num, int level) +{ + ViaISAState *s =3D opaque; + PCIBus *bus =3D pci_get_bus(&s->dev); + int pic_irq; + + /* now we change the pic irq level according to the via irq mappings */ + /* XXX: optimize */ + pic_irq =3D via_isa_get_pci_irq(s, irq_num); + if (pic_irq < ISA_NUM_IRQS) { + int i, pic_level; + + /* The pic level is the logical OR of all the PCI irqs mapped to i= t. */ + pic_level =3D 0; + for (i =3D 0; i < PCI_NUM_PINS; i++) { + if (pic_irq =3D=3D via_isa_get_pci_irq(s, i)) { + pic_level |=3D pci_bus_get_irq_level(bus, i); + } + } + qemu_set_irq(s->isa_irqs[pic_irq], pic_level); + } +} + static void via_isa_realize(PCIDevice *d, Error **errp) { ViaISAState *s =3D VIA_ISA(d); @@ -676,6 +718,8 @@ static void via_isa_realize(PCIDevice *d, Error **errp) if (!qdev_realize(DEVICE(&s->mc97), BUS(pci_bus), errp)) { return; } + + pci_bus_irqs(pci_bus, via_isa_set_pci_irq, s, PCI_NUM_PINS); } =20 /* TYPE_VT82C686B_ISA */ --=20 2.39.2 From nobody Mon May 13 18:32:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1677345048; cv=none; d=zohomail.com; s=zohoarc; b=CCiVKge/gfN/L7iYmKnNcTjKAJmEwcz6NU6lBIXf6VtyA8ukh78GuZbPjlQHwvFS/X/1BtgQDVOLLEmJdBqeXwdx0MyOu11as2xooXsEzeT0fKu3KYHbmNIoWq/ilf047GzsyZjLaEH6IlljY1Hdd9l66o+jRpaYfj5wNEGdQqQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677345048; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Xl/DOZlATxgugred1fzKweHRfgNnXhLpLoX6XzlsSKs=; b=Sb1bRTe8FWx6A7UXhFzePMKkfZxsOy5qxJRbvlzd1bFtpzf7oOfaghspjQPnKb4LL45BFKM6TpR9Q5gkXld+zU4JohEX/uozfGy/Nip6dQKWzY8VLl1y6JgFKET9mAMCpQplm7rPRjhSyciuRPi617ZpX/SQxpv07iUurXWaJH4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1677345048017353.51011409373007; Sat, 25 Feb 2023 09:10:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVy2z-0001c6-RM; Sat, 25 Feb 2023 12:09:21 -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 1pVy2y-0001ak-4d; Sat, 25 Feb 2023 12:09:20 -0500 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVy2w-0005dD-Ix; Sat, 25 Feb 2023 12:09:19 -0500 Received: by mail-ed1-x52e.google.com with SMTP id ec43so9370277edb.8; Sat, 25 Feb 2023 09:09:17 -0800 (PST) Received: from osoxes.fritz.box (p200300faaf06ee000578a61baa078133.dip0.t-ipconnect.de. [2003:fa:af06:ee00:578:a61b:aa07:8133]) by smtp.gmail.com with ESMTPSA id t6-20020a17090616c600b008d356cafaedsm989066ejd.40.2023.02.25.09.09.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Feb 2023 09:09:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Xl/DOZlATxgugred1fzKweHRfgNnXhLpLoX6XzlsSKs=; b=JMdqwGFtPgxlI94YDuKnYNYtGjysm6MU9owjSn3zHvqf6NibPSvwW2AgNRZ1SSBXTj i6Z2yHwGlHQRvMYes7EgCY6xOcykEPw3+nP8EUZfN3HULT6nAMvQU9xU5i92iYh4k8kX isjr4PlPXGWPHZFvzq+pWppzPhFngNE4LzoP5lQ2WnWAuaDvuQTFCc9HGXl6LrNu2n95 c6YFCSiXdH2axEgUhuTNioCeE/C6BoAYGQ2YjQD1XmEk0zbHNhbGysY6XrJP4hEZu1Bk VVFk426TshC2D73ab6C5SlOPmcmCs6DIaUz2nAKHej9ZYrKXoWGAVopcpyZrmPuhRfYA UFWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Xl/DOZlATxgugred1fzKweHRfgNnXhLpLoX6XzlsSKs=; b=Xv/FHIqJT64S3zWzPf0tE57LFXO5Z7VmQAByjhfcU5D/oT/4ZXtE3h76ESefue5zD/ oMZ8S6nPFPQMmLNO4IQ0Bq5b/cAt7M2mzsUnI0OzYZM41f8YAEk3JdXlJSzsukiFJ9ym Qk+aXgrHO1AR0zIi3AHkX2HDoc0KvEPR3s2q9LhXueUHsjNjER29NwtwF8uuTvDhpffR qEorB6G2iDs3BuW0zE5l1N6K7jKl9h+qQG34HXJBmbjwzd69UtilzuC8Ms0h+YwVWOTu 3BvzuJt45XNoVxvlEzXKPz4j+x4FfRWgJYyryvQTMEGEl0VPCW1loN06tibKxhQsBbpQ /oaw== X-Gm-Message-State: AO0yUKUbREZK7f1RriIT9UVlhOL01YHAcgiofPLvt1qtmf5787GmHAh7 mwL6Y4bN/kyNTDsHQy7KNBfM78TGZmlzWg== X-Google-Smtp-Source: AK7set9eNHJzHz6iYyU+6Tan7r4YRib39D76L9ClSK4mp3n/lOuSpvIaBaIL/4h2Gl0AvW8UKP8ahQ== X-Received: by 2002:a17:907:2d29:b0:8e6:bcb6:469e with SMTP id gs41-20020a1709072d2900b008e6bcb6469emr19613507ejc.0.1677344956491; Sat, 25 Feb 2023 09:09:16 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Jiaxun Yang , Gerd Hoffmann , Huacai Chen , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-ppc@nongnu.org, BALATON Zoltan , Bernhard Beschow Subject: [PATCH v2 3/3] hw/usb/vt82c686-uhci-pci: Use PCI IRQ routing Date: Sat, 25 Feb 2023 18:08:57 +0100 Message-Id: <20230225170857.15774-4-shentey@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230225170857.15774-1-shentey@gmail.com> References: <20230225170857.15774-1-shentey@gmail.com> 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=2a00:1450:4864:20::52e; envelope-from=shentey@gmail.com; helo=mail-ed1-x52e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1677345049692100003 Content-Type: text/plain; charset="utf-8" According to the PCI specification, PCI_INTERRUPT_LINE shall have no effect on hardware operations. Now that the VIA south bridges implement the internal PCI interrupt router let's be more conformant to the PCI specification. Signed-off-by: Bernhard Beschow --- hw/usb/vt82c686-uhci-pci.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/hw/usb/vt82c686-uhci-pci.c b/hw/usb/vt82c686-uhci-pci.c index 46a901f56f..b4884c9011 100644 --- a/hw/usb/vt82c686-uhci-pci.c +++ b/hw/usb/vt82c686-uhci-pci.c @@ -1,17 +1,7 @@ #include "qemu/osdep.h" -#include "hw/irq.h" #include "hw/isa/vt82c686.h" #include "hcd-uhci.h" =20 -static void uhci_isa_set_irq(void *opaque, int irq_num, int level) -{ - UHCIState *s =3D opaque; - uint8_t irq =3D pci_get_byte(s->dev.config + PCI_INTERRUPT_LINE); - if (irq > 0 && irq < 15) { - via_isa_set_irq(pci_get_function_0(&s->dev), irq, level); - } -} - static void usb_uhci_vt82c686b_realize(PCIDevice *dev, Error **errp) { UHCIState *s =3D UHCI(dev); @@ -25,8 +15,6 @@ static void usb_uhci_vt82c686b_realize(PCIDevice *dev, Er= ror **errp) pci_set_long(pci_conf + 0xc0, 0x00002000); =20 usb_uhci_common_realize(dev, errp); - object_unref(s->irq); - s->irq =3D qemu_allocate_irq(uhci_isa_set_irq, s, 0); } =20 static UHCIInfo uhci_info[] =3D { --=20 2.39.2