From nobody Wed May 8 08:36:00 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1677501257; cv=none; d=zohomail.com; s=zohoarc; b=Xm9ijEf8RHdTzWAUj8mG4sY7yBerDUfc2uYv3YTwOV84xM8uo2KxraehVQjdVnNXOJhHY6Hd7zsoCghQkXBfhPWzgLEIr9tc9J64qgvLXEqzz1St7D743y2ieclkF27gNxIOkQeoZH25wbX7ZOC+rUz5wwDE2F2nqlcIo0HVyMw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677501257; 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=DtKzK1BAP5qgc5e6SaSOEGCdkIK2zODhcNccyfr0rWmCJOg0H7l4xRuHtUPzedrOc1NyVhn3IcpXAmX/+HOfusFrMsR6Nd2z0ny0n0Jkbt5gYYWtS2oKcstJrCD0q/dpvuBLtUU+ZXoc5sYSm3FDCYq0LqbajW2xr4hHQ0UDtjE= 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+importer2=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 167750125782775.7701951299257; Mon, 27 Feb 2023 04:34:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWchi-0004b8-FR; Mon, 27 Feb 2023 07:34:08 -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 1pWchS-0004Vr-Pn; Mon, 27 Feb 2023 07:33:52 -0500 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWchR-0008Nc-0D; Mon, 27 Feb 2023 07:33:50 -0500 Received: by mail-ed1-x532.google.com with SMTP id da10so25185886edb.3; Mon, 27 Feb 2023 04:33:47 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-154-008.78.55.pool.telefonica.de. [78.55.154.8]) by smtp.gmail.com with ESMTPSA id oy26-20020a170907105a00b008b133f9b33dsm3092124ejb.169.2023.02.27.04.33.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 04:33:45 -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=CC1bktP+LJPs3UrSIQM7DNO/SKMFI+vqiFvC/ccuYAn8lY/zC5WyNz5YSrmJPkPUAp nDHdHbO6DpfLc9FRxBeNNwwiH0vfJYPqLjeMCaupHZSD539t8VTiwDNRON3NtznHDqvS oblyOWTet9SxBb0/+Znb4f7DIyiofPO24IsFGpr3HpvGRYAJdE9KmZ9t1nSPT6d4dgbp jgRgUm2laPIgI9e85WCGbVZUt3L85J9v0Qpt6IiydTv5lnLHJpN//we4wnXcFcTHEBc9 W4cUi0tzadsFxUCV6DAdTbkDG4PS148xoIr9mKDwGgtQentgI8oTMIyUeZN7sHs2xS8n PAQw== 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=slq5pbUWiXPDr0iGXimUJOMN4FSlFqSbEMcwPuxlHtBMAa5sxFhvy+TjOgUfJ3aJ8q erabZMPQrVyfnAMW7VRtLiNYQKWPneD1yy30qrTveYl8DSBYvX2KnTprrG+l75QicxVI a16e2HytHZezdVfilBW84pZLkLfDhKtKjgVEpr13/R3473xLZmBwEifKHd9Xl8juTqS/ E6qY53/sswCnisV/JVp3ng0GAz4BSmH8cxr/b/+svJtZXcL/Okib+pClGTOR8+IJ9Xoq d1vAM14qnqp7R4zB+B7vZYac+gJMrv8wxPyCMWO5rF2yOghapZ+tNbyFPnA1Wm50ztBX lZFQ== X-Gm-Message-State: AO0yUKV/WoeCBGcojZ9NgeCaDujP7jTbqatcPHWM3lsdmW2zWFWDth12 ajkyLodjulb5Wj9Qn1dIcu7KS6YrzIg= X-Google-Smtp-Source: AK7set8+2+s0sU/w0B1Ah8mNoenrajOhK+l8GJDekWcgEgWAonBL/Cb4kR2iZZ4fhuCTda35oOhTVg== X-Received: by 2002:a17:907:33cc:b0:895:58be:94a with SMTP id zk12-20020a17090733cc00b0089558be094amr35270535ejb.14.1677501225607; Mon, 27 Feb 2023 04:33:45 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Huacai Chen , Gerd Hoffmann , qemu-ppc@nongnu.org, Jiaxun Yang , BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PATCH v3 1/3] hw/ppc/pegasos2: Initialize VT8231 PCI IRQ router Date: Mon, 27 Feb 2023 13:33:14 +0100 Message-Id: <20230227123316.18719-2-shentey@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230227123316.18719-1-shentey@gmail.com> References: <20230227123316.18719-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=shentey@gmail.com; helo=mail-ed1-x532.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1677501259695100005 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 Wed May 8 08:36:00 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1677501258; cv=none; d=zohomail.com; s=zohoarc; b=EfeaYJAVLU2exLlD/5w6auwn4xasyys14Z1qDnf3vGCEQd3Z4WMpAgrLK5yKPmpZ4Dw06hhrUQc+R8ijHg1TaxghvQ+6IYHWeYtqBanaZlanf4SyfbqwLc+sXQYcFVtqA9a/cjcWsngvlf5CbOSDt7DmzMaXUXLZHYv9T43ZCJs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677501258; 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=cCBIFmIAWg8Q7D4jp9k+Iwr3obFsmdZ+ZJHDhgQt8XU=; b=FbhiEHfA26ZXQczRu6bIgyo0NhfHt0A6u+wBxTtJWDILSl5BU9ypdQBKzcELDJWT71+b+Ohx1N38MaHgJnp2mCl5UNpfpJTTzzZr+enJY4aoRcLX6ThhqO7tcELWXTc+d74+7f8fKhevmMS7UTTseTNnKEi8cGkuZAyjQfYdgcQ= 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+importer2=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 1677501258497249.9074891057029; Mon, 27 Feb 2023 04:34:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWchk-0004cl-MO; Mon, 27 Feb 2023 07:34:08 -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 1pWchS-0004Vs-Us; Mon, 27 Feb 2023 07:33:52 -0500 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWchR-0008Nq-0q; Mon, 27 Feb 2023 07:33:50 -0500 Received: by mail-ed1-x531.google.com with SMTP id s26so24984217edw.11; Mon, 27 Feb 2023 04:33:48 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-154-008.78.55.pool.telefonica.de. [78.55.154.8]) by smtp.gmail.com with ESMTPSA id oy26-20020a170907105a00b008b133f9b33dsm3092124ejb.169.2023.02.27.04.33.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 04:33:46 -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=cCBIFmIAWg8Q7D4jp9k+Iwr3obFsmdZ+ZJHDhgQt8XU=; b=UluoqGh2k28P+JS0Vz01Xgq1pelqHd7j8F8guZTsTdZp+Yk4Q23i1MQMs/EIk6eHvt 6xwDbc1/nHs4P43SqaT1X+SeJ4UhnTgWKEzVxuhZcu7f8Y9PrHtVOMsmcJIEOsxwN+6P MNTqlzZ3KwTIWT7sYQwTLIPiUfbHDVI8He6aRU1rDQdLcF6R/xhQOrY2OubpCxaBc9v7 sHLbmA5IiOGarhPRuuzVJFGQ3cc0EB9x1LuSA3P0lWmCpwkgXcpD2FZpNVhmw2HUsfcg yuwqDgAsZAxPyLAw59YaXyEnP5qWE8wDmaVKmd/wK/NwrNvw33nG0CpBNuwedF6RXlTJ q7NQ== 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=cCBIFmIAWg8Q7D4jp9k+Iwr3obFsmdZ+ZJHDhgQt8XU=; b=LS8aMwyRJ/VMxWBqC/J9bVDJFimYaMbhC3TtknQ2MZMKsg8PHKWaEyB/12d42idpX9 hAriqW2pkZ2jgUjXsMIvub9/FIvZpSSEdBGqVHFRgazadLXZmoXx4CFgVUyId5LymfKP 5685Qk4aoRYyQJZ38ExchIvDhM/EikFo9rWtHE361Xu3CGwiEIF5g3axixV0O4JM+zwM qP4c06gdYWNU7aE7EcF4tFcxTTzGCX9Y14hXy2b5keKBKWBGH0lleg5YQZNp6O6POR7Z E2t8qomNNra2rStthePyQ25Ho1B8UNb7UoMMWXwyHN+z8dyg1/Par8kjNYZ4GpQuc0z+ 0qug== X-Gm-Message-State: AO0yUKWR+NhPQ062UTnTmr4A33kIpOIFY2crNPjikkhmyGqQfN7oKh4i 44LPdy/Q8e5GmBLbMsB6la2fqiUU1dU= X-Google-Smtp-Source: AK7set/PEW0Bk0Ynz4srIWs/iyqiqSMmZUjXNYRpfOZS4BTgnthbye31ZQVxzwuiu/AiXYGbm1/bQw== X-Received: by 2002:a17:907:d87:b0:885:5682:7e52 with SMTP id go7-20020a1709070d8700b0088556827e52mr40648626ejc.13.1677501226668; Mon, 27 Feb 2023 04:33:46 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Huacai Chen , Gerd Hoffmann , qemu-ppc@nongnu.org, Jiaxun Yang , BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PATCH v3 2/3] hw/isa/vt82c686: Implement PCI IRQ routing Date: Mon, 27 Feb 2023 13:33:15 +0100 Message-Id: <20230227123316.18719-3-shentey@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230227123316.18719-1-shentey@gmail.com> References: <20230227123316.18719-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=shentey@gmail.com; helo=mail-ed1-x531.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1677501259727100007 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. Signed-off-by: Bernhard Beschow --- hw/isa/vt82c686.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 3f9bd0c04d..7aea97365f 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -604,6 +604,45 @@ static void via_isa_request_i8259_irq(void *opaque, in= t irq, int level) qemu_set_irq(s->cpu_intr, level); } =20 +static unsigned 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); + unsigned pic_irq =3D via_isa_get_pci_irq(s, irq_num); + int i, pic_level =3D 0; + + assert(pic_irq < ISA_NUM_IRQS); + + /* The PIC level is the logical OR of all the PCI irqs mapped to it. */ + 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); + } + } + + /* Now we change the pic irq level according to the via irq mappings. = */ + 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 +715,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 Wed May 8 08:36:00 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1677501285; cv=none; d=zohomail.com; s=zohoarc; b=G0ZZtKKADgYk9dpVoJjhqyCHygWAcOwdjnk4KfkpbqjsNqprnywwdEJ8/wcXuCncka2IsSISUJJPOgYddWPp5RzYWSyiUjC+1Ufa5JqQaqUG7GOABFzyoaPt4A9agq4yC0a4lNGfZcPNy9DVtlsdCLb6fNgnFLpq1yBr4Y3TIl8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677501285; 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=sXt1ZpsJN5ZgwRHSb4ipAOnMsP1I28K0i627Hl46eSc=; b=FLvQO0Y7zphmnyG/wqTf+WBkJJlxX3BMsYWCXt2/3oPVr8jHDb1scxLUOqwtnGc7Ld8WIwjBSU7huyt+OVnpaEcO4hb3aknO9D++A5cymhOxMQ5ixSPOVOnq9ZrZgqAteLvdINvRX4F1QGijLQxL81CtHkFy/XgtHj0kMkl7xYs= 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+importer2=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 1677501285891370.7912122640439; Mon, 27 Feb 2023 04:34:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWchp-0004jI-8j; Mon, 27 Feb 2023 07:34:13 -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 1pWchT-0004Ws-TZ; Mon, 27 Feb 2023 07:33:52 -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 1pWchR-0008Nv-OW; Mon, 27 Feb 2023 07:33:51 -0500 Received: by mail-ed1-x52d.google.com with SMTP id o15so22614294edr.13; Mon, 27 Feb 2023 04:33:49 -0800 (PST) Received: from localhost.localdomain (dynamic-078-055-154-008.78.55.pool.telefonica.de. [78.55.154.8]) by smtp.gmail.com with ESMTPSA id oy26-20020a170907105a00b008b133f9b33dsm3092124ejb.169.2023.02.27.04.33.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 04:33:47 -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=sXt1ZpsJN5ZgwRHSb4ipAOnMsP1I28K0i627Hl46eSc=; b=mhw+0a26KA9Adgf4nsVCwN6IY4+U7DL58nT9urpc5bWlueZb1aZ8Wuuhns+pFDmLBj o8D238/f40ml8gsDjj3bXMS84Hzozh3FS2cnIkh4cKphsp4yhS+eWZolA+jo+jig5oKe +tl9DbR/eB1oJi615Qo1833/cwccr+AB/CwJU9HrOvdsULQMredl6ZzBsg+WzrmiYaU6 iUIqrdfUXPszcmOZqECcSkjaXOiX9M1ymxdIbwrpq8DUEBQXR2kHjE06SLrFpEPwIph3 8k1fqyOYp/MOkt40ZC453kTseU76/gO5SI6LdmYBmdnE/INpg0MsNi5hzVO9GfBHaH8V uLPA== 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=sXt1ZpsJN5ZgwRHSb4ipAOnMsP1I28K0i627Hl46eSc=; b=MW/2FlstkjrmYpYw92rf5MPDpLRXqutMUxQ+NoG1iAPghSnWRlrOhZVTzHRpEeaHw+ wRgD/SFYjQuQum7CJQ7sjSXc9dHlxQ18nPVu8jUO/ZphwFT8NS+nZOJEmZnKJ7inyh98 UI9mbGn690vqNIuvf4XiYSqX1FxbtkE927gcbOGzx4anCnYet3WGedXKP1YOOd2fR0IF LYQSQNBXDNXfFNs3BvOd+rlJZ3e8G9aolWZv0CP5m5EHCteJ4pVDtCNFfzlDh8Wpgb6x brfBEhq/YxWPvAhAyOLWn4ApwrPZfQKMtiTD7va7fXGyI9yrtp5FWStsE8rorwwIaI1w +f/A== X-Gm-Message-State: AO0yUKUOLuOVMkKukajSopP55dEkLsfgbFHf+8Ii7rlyMJEAxhBpDRyL 8fLwWjE4powJxq1/JQhPdfuR/voYXLk= X-Google-Smtp-Source: AK7set97bFlND77iX6WS3TrFL3URVpbMPOqOYcR0KQb5/IdzTv41y25jrrVpKv8ZRyHa46J7w942cw== X-Received: by 2002:a17:907:6e8a:b0:8de:502e:2061 with SMTP id sh10-20020a1709076e8a00b008de502e2061mr7998006ejc.3.1677501227871; Mon, 27 Feb 2023 04:33:47 -0800 (PST) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Huacai Chen , Gerd Hoffmann , qemu-ppc@nongnu.org, Jiaxun Yang , BALATON Zoltan , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Bernhard Beschow , Rene Engel Subject: [PATCH v3 3/3] hw/usb/vt82c686-uhci-pci: Use PCI IRQ routing Date: Mon, 27 Feb 2023 13:33:16 +0100 Message-Id: <20230227123316.18719-4-shentey@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230227123316.18719-1-shentey@gmail.com> References: <20230227123316.18719-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+importer2=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1677501287824100003 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 Tested-by: Rene Engel --- 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