Message ID | 1502859419-33696-6-git-send-email-Zhiqiang.Hou@nxp.com (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Bjorn Helgaas |
Headers | show
Return-Path: <linux-pci-owner@kernel.org> 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 89A326028A for <patchwork-linux-pci@patchwork.kernel.org>; Wed, 16 Aug 2017 05:14:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DC3228862 for <patchwork-linux-pci@patchwork.kernel.org>; Wed, 16 Aug 2017 05:14:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D67528966; Wed, 16 Aug 2017 05:14:49 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B3FA2896D for <patchwork-linux-pci@patchwork.kernel.org>; Wed, 16 Aug 2017 05:14:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751313AbdHPFOM (ORCPT <rfc822;patchwork-linux-pci@patchwork.kernel.org>); Wed, 16 Aug 2017 01:14:12 -0400 Received: from mail-by2nam03on0051.outbound.protection.outlook.com ([104.47.42.51]:53979 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750912AbdHPFOL (ORCPT <rfc822;linux-pci@vger.kernel.org>); Wed, 16 Aug 2017 01:14:11 -0400 Received: from BLUPR0301CA0040.namprd03.prod.outlook.com (10.162.113.178) by BN6PR03MB3316.namprd03.prod.outlook.com (10.174.233.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1341.21; Wed, 16 Aug 2017 05:14:09 +0000 Received: from BN1BFFO11FD046.protection.gbl (2a01:111:f400:7c10::1:160) by BLUPR0301CA0040.outlook.office365.com (2a01:111:e400:5259::50) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1341.21 via Frontend Transport; Wed, 16 Aug 2017 05:14:09 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD046.mail.protection.outlook.com (10.58.145.1) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1304.16 via Frontend Transport; Wed, 16 Aug 2017 05:14:09 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v7G5DiU4012144; Tue, 15 Aug 2017 22:14:05 -0700 From: Zhiqiang Hou <Zhiqiang.Hou@nxp.com> To: <linux-pci@vger.kernel.org>, <bhelgaas@google.com>, <jingoohan1@gmail.com>, <Joao.Pinto@synopsys.com> CC: <minghuan.lian@nxp.com>, <mingkai.hu@nxp.com>, <roy.zang@nxp.com>, <svarbanov@mm-sol.com>, <niklas.cassel@axis.com>, <jesper.nilsson@axis.com>, Hou Zhiqiang <Zhiqiang.Hou@nxp.com> Subject: [PATCHv3 5/9] PCI: layerscape: Disable the outbound windows configured by bootloader Date: Wed, 16 Aug 2017 12:56:55 +0800 Message-ID: <1502859419-33696-6-git-send-email-Zhiqiang.Hou@nxp.com> X-Mailer: git-send-email 2.1.0.27.g96db324 In-Reply-To: <1502859419-33696-1-git-send-email-Zhiqiang.Hou@nxp.com> References: <1502859419-33696-1-git-send-email-Zhiqiang.Hou@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131473340494751821; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(6666003)(8656003)(2950100002)(8676002)(81156014)(81166006)(106466001)(551934003)(305945005)(105606002)(36756003)(77096006)(68736007)(2201001)(4326008)(85426001)(39060400002)(498600001)(626005)(48376002)(50226002)(50466002)(47776003)(189998001)(5003940100001)(54906002)(97736004)(72206003)(104016004)(86362001)(53936002)(50986999)(76176999)(8936002)(7416002)(356003)(5660300001)(2906002)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB3316; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN1BFFO11FD046; 1:OppFZ/CvQAXSVbOWkiD8gV4LZfgCOJFHz8Rgirpla?= =?us-ascii?Q?Qc8TnYeCVT1OgAiuYdg5oXDUxhKlw/txzsg7t5v8eO5C11UCUL5rH4RekHB6?= =?us-ascii?Q?qUTNQ2/n9WSrYQuMict2HjzuFJkINXC6u2GqINaVtu1T6TgWM185pKQvq+BN?= =?us-ascii?Q?rp+q9px5GZfcHMWc3Dru6mVUAyMEC/yBd3eH34VK/wsBTTOeycLGD4l8jNg9?= =?us-ascii?Q?Lmiqd8sJiIG0eP+Pzg5b04lvhWebGH0NqC2dDlOp/BwPUnb7l8pqRswnrnJZ?= =?us-ascii?Q?+uUDkPtlusTeOgj3qj8XmF4XT0/Q+wpVPcJc2hqXsCuX7mEz1VVBvM03rHHD?= =?us-ascii?Q?hyLquOjmFgfngDI5dFHbEeL9M+CHDtJtC+7+tIm39UnzT1T9eyDKSLJRFkPJ?= =?us-ascii?Q?JbUoVTa6+EveWEeEFy7sQtLHYP76kOv3vfDvJGbmWmzhpjQrbH6SPPWyp4+D?= =?us-ascii?Q?eoD+iLaqgl1iQWLW9jO7iHEK+pBQGc3HESSk0ZF7sBv65z7DJQ6iWiyVd8/O?= =?us-ascii?Q?0a9OC7mwM+z5+yXamXtnGAQY+t0BAYXqjzZTnmJNEAhPmzIH/4wPUI+VCc/w?= =?us-ascii?Q?bdeAXdV4xBzdSWwaLUu6dcAIYbJqT2C0ETUTOQUgeKtnrDIkfb/iMDb0vKMJ?= =?us-ascii?Q?bpn1GssvLbWnP4wgwkgL8YKUu020TzrXZ+7XLVb/ryjw8vMyVUik18Bq2R4m?= =?us-ascii?Q?ioQCKxhKV5Wm1GJf6eeiZojtE1XPJ0WI7xpQLrGmk2k6oJRiA5dWLqg/N8u9?= =?us-ascii?Q?TIfTkVaNHcSBmtnCjlrqoGTyPzCjnavPI7En61g5AStu8iGWKbYvJJV0DNWJ?= =?us-ascii?Q?W4XIY5MwQ+vaaArr1Y9mg20QfBBt80YhGcR4tVG5YfBX5gKswlpTR6Jz2Wpf?= =?us-ascii?Q?Y6FyyzsMhop9AioHEiaxdaiAQ5hdOFFYbiY6c1TZAZnVi4ib5p534hYkmh7M?= =?us-ascii?Q?eAHNsTlTSmAOTWn10pGp63R5Zz/wWX8vZSV5WnAcQ=3D=3D?= MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 62a533d5-6c4f-4c3e-9d5d-08d4e465a003 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603031)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BN6PR03MB3316; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB3316; 3:1wTnYpAiFHNfNe8+5LfBZDKV2l1UH6SWkCOZGlQ0b4b4shLjzftNvPVusHKLqAmfcVqRahg/odxFUdoB1lU/LMiMArdqH1+70ZdkBfBResFNcXGuZpzqPmzikwUPASXOFaefaBQo/FONkI2fHwpJpNpHEeFwzE1cpCZ8BGdCPST/6DDH2k0+D9QVao61wBQM6uMKTGFXfIRnmOF+gQoevo+8/peEuEFNAgO3cAKE9aI6809/zQPnDuhTpz5fOgmGI7I4gLfidOsUQnxTc6adxZeE0/INhcYilBr8AwDabGwEqMQ4oHnM70YazXxjAYQSF4imDAYy3yuD9jfiqB1IsSNNIcO8gaVjpYYR40qXbrI=; 25:5hLXMrnHMMJovnlHbJsxmSyjEzyrgrmlCb0geQlm39XqzyhgO+mUPTYw8w/isEML2WPscH7eS6bSwHeZLW2tMc2BqmyNKg+D5JITe3psm9nqkSzCotP3nDONINWne7nfy8yDK9AerqXb3XSqxoQXdjSxaL8nD1bauwHLv5VIsEaq3akL9tfQozpfyV5AR1rAacq5Xntxe86WNMKQpXArNVfQm10O+GZ13N95lcMO2E67P8D+C1jqrArkXF1OhFk4yKRwxCHptTnOmpKxAu41J/6kcqqueX3qsEy/yRSmGVHBDxLm6MN5rWNbxex8RbekYVBy5dHcPydm4zk5MwuYEw== X-MS-TrafficTypeDiagnostic: BN6PR03MB3316: X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB3316; 31:gyXPQ1oR9HA3qa0ruxcBDauTD2XbFrFQ5oBxQisrIfY6SpwyJpaD/ToQrzknCJ1YSy6UX7zN1vgb08I8JeYKJhs6KlkVjqKjlLsvI5z5PAa5G2llWAVlluIW392jYjGdL1M+ZPVRYgegDZi+072NszIFOThYIQXswCcdJfeC3ErJznqLUbLJj+V+5Bfyu4I2KXICb/1Ytf4M1xjrKhw0y7aG9z8LrxeeY1hr3vksw40=; 4:8G0eYsKX41eZKD1ivUS0fzbG73WIc+ZPMo9ZmMEQgWav8x6r7jFpgfXPc2iqQO3m3YA1ms32PfXJCm/oLIEipl13TZpNIXXhhEs17QCeO4naOTNw4DURTGE7+/GQ3tZBP95PraXUkac2B2GTj03GoaPS0t4v3w7SAOipM2ET2iexxiH9yi9fLvdhqMtSJAAQe70gioR7lEGDgD8G6sF5ZR9mWp7bptM4zXk2r+6RDqV58ZYpEBnE6ApvR4GL7h7WghIaH4zFzDbw5iIefdqX1jm+16xqp5GGFqqJYQo8eeY= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: <BN6PR03MB3316A57A082C8843129797DF84820@BN6PR03MB3316.namprd03.prod.outlook.com> X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(8121501046)(5005006)(13016025)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6055026)(6096035)(20161123565025)(20161123561025)(20161123559100)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123563025)(20161123556025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR03MB3316; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR03MB3316; X-Forefront-PRVS: 0401647B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB3316; 23:lhcZX0KBg9C0iVFatjMGxtxB8x9udTraf8GqR4zVG?= =?us-ascii?Q?vQa/j/ihvyNOl28aaQKsEcsUglF23pSlygGKld46lTbTs2CIB1+w8Smayrau?= =?us-ascii?Q?YxopCTsBZ1wDc7EH7IqgT+SSaoSOXc7/z7+pXJvR3jY53C7J4Y5XYE0ZCzln?= =?us-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KqJ3eNoaOvpIMhDcQRdhBQAgsTAHIk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2017 05:14:09.1475 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB3316 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: <linux-pci.vger.kernel.org> X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/pci/dwc/pci-layerscape.c b/drivers/pci/dwc/pci-layerscape.c index 57b86a0..44a603d 100644 --- a/drivers/pci/dwc/pci-layerscape.c +++ b/drivers/pci/dwc/pci-layerscape.c @@ -35,6 +35,8 @@ #define PCIE_STRFMR1 0x71c /* Symbol Timer & Filter Mask Register1 */ #define PCIE_DBI_RO_WR_EN 0x8bc /* DBI Read-Only Write Enable Register */ +#define PCIE_IATU_NUM 6 + struct ls_pcie_drvdata { u32 lut_offset; u32 ltssm_shift; @@ -91,6 +93,14 @@ static void ls_pcie_drop_msg_tlp(struct ls_pcie *pcie) iowrite32(val, pci->dbi_base + PCIE_STRFMR1); } +static void ls_pcie_disable_outbound_atus(struct ls_pcie *pcie) +{ + int i; + + for (i = 0; i < PCIE_IATU_NUM; i++) + dw_pcie_disable_atu(pcie->pci, DW_PCIE_REGION_OUTBOUND, i); +} + static int ls1021_pcie_link_up(struct dw_pcie *pci) { u32 state; @@ -128,6 +138,13 @@ static int ls_pcie_host_init(struct pcie_port *pp) struct dw_pcie *pci = to_dw_pcie_from_pp(pp); struct ls_pcie *pcie = to_ls_pcie(pci); + /* + * Disable the outbound windows configured by bootloader to avoid + * one transaction hitting multiple outbound windows and the function + * dw_pcie_setup_rc will re-configure the outbound windows. + */ + ls_pcie_disable_outbound_atus(pcie); + iowrite32(1, pci->dbi_base + PCIE_DBI_RO_WR_EN); ls_pcie_fix_class(pcie); ls_pcie_clear_multifunction(pcie);