From patchwork Fri Jan 27 21:44:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jon Mason X-Patchwork-Id: 9542721 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0DF1E60415 for ; Fri, 27 Jan 2017 21:47:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00365204C1 for ; Fri, 27 Jan 2017 21:47:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E957B276D6; Fri, 27 Jan 2017 21:47:28 +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=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 88B2C204C1 for ; Fri, 27 Jan 2017 21:47:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cXEMe-0007na-Po; Fri, 27 Jan 2017 21:47:24 +0000 Received: from merlin.infradead.org ([205.233.59.134]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cXEL8-0006bz-NC for linux-arm-kernel@bombadil.infradead.org; Fri, 27 Jan 2017 21:45:50 +0000 Received: from mail-qt0-x235.google.com ([2607:f8b0:400d:c0d::235]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cXEL6-0001ep-So for linux-arm-kernel@lists.infradead.org; Fri, 27 Jan 2017 21:45:49 +0000 Received: by mail-qt0-x235.google.com with SMTP id v23so158021336qtb.0 for ; Fri, 27 Jan 2017 13:45:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5t22yknTRWjz3htzggylwCKERCKzkl8g5yWGiP2aeqI=; b=AqQniENmVbLv7/usIvSy8wTyPRXgYbsm3mOt5XVA2JILBxY1MCwS3c2ZBr9KEoTJGc 6fQNv34tNNT55VNzvklAm7+Kk00FmWzGh6wZQOlQjmwSSrxi9ocUBn9Subaa6yM0+r/u V+2aawgBRmONwF3QsdBUOU31qfsos9/KmAh54= 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; bh=5t22yknTRWjz3htzggylwCKERCKzkl8g5yWGiP2aeqI=; b=Y3BMQrB7bopXn8cAzwp/Dc7a7ZTJCgRAYvVA0PSSwFjh+yMiBBaNgb4WoEJFX19OfB 3HeyRPi+/9nmZUErgBgCpOEBqGz74rN3VwW1A2VlkA64BwymaMF+cayIeZB8ALdaCYWU MBqOHSszu+rsZMEg2eWaC7pCUhVNGdG4KK8T7xcY1RhCvg8b6jl/VVB8BdCjAy6K41Yq nUpanWlX6bz7MXggxoOIDXoXxqsaiwlsaL9XUSQWRCnWEZxjCa77YxzJRsAQ6ErIXlq5 MwsS7DZB+JLzfh5IdhsMgBeMCgpjkNZUCYoiOgb8PLAMKpx0kM7fq1IfcyUEOKJSja2t M0yg== X-Gm-Message-State: AIkVDXKdi3nHnw7PrCo/9BhiwZWg91jpMAx56QGLQ6MLoFNcCB/gbblzyEEbXi1jxyJ9O2MY X-Received: by 10.55.165.131 with SMTP id o125mr10416987qke.254.1485553466762; Fri, 27 Jan 2017 13:44:26 -0800 (PST) Received: from venom.dhcp.broadcom.net ([192.19.218.250]) by smtp.gmail.com with ESMTPSA id 37sm5171252qto.43.2017.01.27.13.44.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Jan 2017 13:44:26 -0800 (PST) From: Jon Mason To: Bjorn Helgaas Subject: [PATCH 2/2] PCI: Add quirk entry for NS2 PAXC PCI Date: Fri, 27 Jan 2017 16:44:09 -0500 Message-Id: <1485553449-9345-3-git-send-email-jon.mason@broadcom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485553449-9345-1-git-send-email-jon.mason@broadcom.com> References: <1485553449-9345-1-git-send-email-jon.mason@broadcom.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170127_164549_031831_18451D85 X-CRM114-Status: GOOD ( 14.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-pci@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The Broadcom Northstar2 SoC has a number of quirks for the PAXC (internal/fake) PCI bus. Specifically, the PCI config space is shared between the root port and the first PF (ie., PF0), and a number of fields are tied to zero (thus preventing them from being set). These cannot be "fixed" in device firmware, so we must fix them with a quirk. Signed-off-by: Jon Mason --- drivers/pci/quirks.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 1800bef..c5ef20a 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -2239,6 +2239,27 @@ DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5719, quirk_brcm_5719_limit_mrrs); +#ifdef CONFIG_PCIE_IPROC_PLATFORM +static void quirk_paxc_bridge(struct pci_dev *pdev) +{ + /* The PCI config space is shared with the PAXC root port and the first + * Ethernet device. So, we need to workaround this by telling the PCI + * code that the bridge is not an Ethernet device. + */ + if (pdev->hdr_type == PCI_HEADER_TYPE_BRIDGE) + pdev->class = PCI_CLASS_BRIDGE_PCI << 8; + + /* MPSS is not being set properly (as it is currently 0). This is + * because that area of the PCI config space is hard coded to zero, and + * is not modifiable by firmware. Set this to 2 (e.g., 512 byte MPS) + * so that the MPS can be set to the real max value. + */ + pdev->pcie_mpss = 2; +} +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16cd, quirk_paxc_bridge); +DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0x16f0, quirk_paxc_bridge); +#endif + /* Originally in EDAC sources for i82875P: * Intel tells BIOS developers to hide device 6 which * configures the overflow device access containing