From patchwork Tue Apr 16 01:39:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 10901775 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E2AA31515 for ; Tue, 16 Apr 2019 01:41:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8C7B28763 for ; Tue, 16 Apr 2019 01:41:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BCFE42898D; Tue, 16 Apr 2019 01:41:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5C84528763 for ; Tue, 16 Apr 2019 01:41:07 +0000 (UTC) Received: from localhost ([127.0.0.1]:57828 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGD5u-0007gB-MF for patchwork-qemu-devel@patchwork.kernel.org; Mon, 15 Apr 2019 21:41:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44088) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hGD4W-0006XX-1i for qemu-devel@nongnu.org; Mon, 15 Apr 2019 21:39:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hGD4V-0007qx-1d for qemu-devel@nongnu.org; Mon, 15 Apr 2019 21:39:40 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:39762) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hGD4S-0007p0-Kc; Mon, 15 Apr 2019 21:39:36 -0400 Received: by mail-pl1-x642.google.com with SMTP id a96so9474552pla.6; Mon, 15 Apr 2019 18:39:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2Jrfp6guHhu12IiPCjZRuA1AOo7RUF4vA5QQQUxraEE=; b=PnIQM4f1YSKwxMRbTTZ5RnvgndeWOtz4LRBQmjWczMxAVNGCBb73BXFoIc3057WBct BiWz1XS5dM09B2yAQVbYG+F+clxiM/wbc9Ol7cG+vNt5X0bTwuEZWyEOYBeSmpUNfSZT kdx1yf/01UHfp7UgjKIcFyWpFwIZJZncsnkSM1iVXidjgcMMpglUdTNOQfNElpgFTvXL VwZ62yk+7bjPm9rWi85C78+qgeoTbXmhQ83/hmuR7Cy9NrOn6ykJWDvK73115TjoEhOc kS0Y8zXv/duOV7r3MPIGU80+Qp5xBVhlyeenX252pIWCjaOKkeZ5ScFZrBjlrB1zDXmr cWcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2Jrfp6guHhu12IiPCjZRuA1AOo7RUF4vA5QQQUxraEE=; b=TWNCJyjAPqH7yJkWGM8EnEtdphH4FbNTWyMJ56CW8AWhl7sTUxW0ftQe5tJsBv1hTa XZSJDzzz8yFBiVRU180/uVSFrVkZTpNwO9YW8U2ggzkcfKwUDUfkfRWycD6lT5GhPgFv llBeZwESsJ6FkxbzNeSSv/WfooYvtBKRlN1xkJVhD9JcMnmoKKc+9fY66Yvsd31Sur22 jG0LqJC4j1N5zCh1VfELUbU8hBxTaPBTETokS/YcKdmEn2SzcNZmvXogANkkjBu5ma3V BunHAPLsyKFWCvrKzp+u1lDI1Tv2xAYQaeGqOVvfTTjkLPkkizfLa9keBcoa8KB1Uyt9 2QKA== X-Gm-Message-State: APjAAAVUO8olaqz8y74yKq8WQK0Ol3qFh6eA0gS19q5SUEPJuAEuoxhk DvNsUBvleoTQiaz73/O6D3AgLzy+ X-Google-Smtp-Source: APXvYqy1m4rplTbpYgUevdHEeRqfyc/1765/R/yv1kLkK4B3vFwXgFCUN0xMQTMB6bcKUt9ozCh58Q== X-Received: by 2002:a17:902:a5ca:: with SMTP id t10mr76432641plq.234.1555378775344; Mon, 15 Apr 2019 18:39:35 -0700 (PDT) Received: from squirtle.lan (c-24-22-235-96.hsd1.wa.comcast.net. [24.22.235.96]) by smtp.gmail.com with ESMTPSA id v20sm74710362pfn.116.2019.04.15.18.39.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Apr 2019 18:39:34 -0700 (PDT) From: Andrey Smirnov To: qemu-arm@nongnu.org Date: Mon, 15 Apr 2019 18:39:02 -0700 Message-Id: <20190416013902.4941-6-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190416013902.4941-1-andrew.smirnov@gmail.com> References: <20190416013902.4941-1-andrew.smirnov@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::642 Subject: [Qemu-devel] [PATCH 5/5] i.mx7d: pci: Update PCI IRQ mapping to match HW X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrey Smirnov , Peter Maydell , qemu-devel@nongnu.org, "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Datasheet for i.MX7 is incorrect and i.MX7's PCI IRQ mapping matches that of i.MX6: * INTD/MSI 122 * INTC 123 * INTB 124 * INTA 125 Fix all of the relevant code to reflect that fact. Needed by latest Linux kernels. Signed-off-by: Andrey Smirnov Cc: Peter Maydell Cc: Michael S. Tsirkin Cc: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Reviewed-by: Peter Maydell --- include/hw/arm/fsl-imx7.h | 8 ++++---- hw/pci-host/designware.c | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h index 3efa697adc..9750003a4f 100644 --- a/include/hw/arm/fsl-imx7.h +++ b/include/hw/arm/fsl-imx7.h @@ -213,10 +213,10 @@ enum FslIMX7IRQs { FSL_IMX7_USB2_IRQ = 42, FSL_IMX7_USB3_IRQ = 40, - FSL_IMX7_PCI_INTA_IRQ = 122, - FSL_IMX7_PCI_INTB_IRQ = 123, - FSL_IMX7_PCI_INTC_IRQ = 124, - FSL_IMX7_PCI_INTD_IRQ = 125, + FSL_IMX7_PCI_INTA_IRQ = 125, + FSL_IMX7_PCI_INTB_IRQ = 124, + FSL_IMX7_PCI_INTC_IRQ = 123, + FSL_IMX7_PCI_INTD_IRQ = 122, FSL_IMX7_UART7_IRQ = 126, diff --git a/hw/pci-host/designware.c b/hw/pci-host/designware.c index e80facc4a0..f4c58b25c1 100644 --- a/hw/pci-host/designware.c +++ b/hw/pci-host/designware.c @@ -50,6 +50,8 @@ #define DESIGNWARE_PCIE_ATU_DEVFN(x) (((x) >> 16) & 0xff) #define DESIGNWARE_PCIE_ATU_UPPER_TARGET 0x91C +#define DESIGNWARE_PCIE_IRQ_MSI 3 + static DesignwarePCIEHost * designware_pcie_root_to_host(DesignwarePCIERoot *root) { @@ -66,7 +68,7 @@ static void designware_pcie_root_msi_write(void *opaque, hwaddr addr, root->msi.intr[0].status |= BIT(val) & root->msi.intr[0].enable; if (root->msi.intr[0].status & ~root->msi.intr[0].mask) { - qemu_set_irq(host->pci.irqs[0], 1); + qemu_set_irq(host->pci.irqs[DESIGNWARE_PCIE_IRQ_MSI], 1); } } @@ -310,7 +312,7 @@ static void designware_pcie_root_config_write(PCIDevice *d, uint32_t address, case DESIGNWARE_PCIE_MSI_INTR0_STATUS: root->msi.intr[0].status ^= val; if (!root->msi.intr[0].status) { - qemu_set_irq(host->pci.irqs[0], 0); + qemu_set_irq(host->pci.irqs[DESIGNWARE_PCIE_IRQ_MSI], 0); } break;