From patchwork Mon Aug 28 10:52:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Z.Q. Hou" X-Patchwork-Id: 9925295 X-Patchwork-Delegate: bhelgaas@google.com 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 31DB160311 for ; Mon, 28 Aug 2017 11:11:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 263AB286BA for ; Mon, 28 Aug 2017 11:11:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B179286BC; Mon, 28 Aug 2017 11:11:01 +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 44FB4286BD for ; Mon, 28 Aug 2017 11:10:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751172AbdH1LKT (ORCPT ); Mon, 28 Aug 2017 07:10:19 -0400 Received: from mail-bl2nam02on0066.outbound.protection.outlook.com ([104.47.38.66]:20431 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751234AbdH1LKS (ORCPT ); Mon, 28 Aug 2017 07:10:18 -0400 Received: from BN6PR03CA0009.namprd03.prod.outlook.com (10.168.230.147) by CO2PR03MB2264.namprd03.prod.outlook.com (10.166.92.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9; Mon, 28 Aug 2017 11:10:16 +0000 Received: from BN1BFFO11FD023.protection.gbl (2a01:111:f400:7c10::1:154) by BN6PR03CA0009.outlook.office365.com (2603:10b6:404:23::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9 via Frontend Transport; Mon, 28 Aug 2017 11:10:15 +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 BN1BFFO11FD023.mail.protection.outlook.com (10.58.144.86) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Mon, 28 Aug 2017 11:10:15 +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 v7SB9vXL006251; Mon, 28 Aug 2017 04:10:12 -0700 From: Zhiqiang Hou To: , , , CC: , , , , , Hou Zhiqiang Subject: [PATCHv5 4/9] PCI: layerscape: move ls1021 specific host_init behind the common one Date: Mon, 28 Aug 2017 18:52:56 +0800 Message-ID: <20170828105301.8511-5-Zhiqiang.Hou@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170828105301.8511-1-Zhiqiang.Hou@nxp.com> References: <20170828105301.8511-1-Zhiqiang.Hou@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131483922159000258; (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)(4326008)(104016004)(2906002)(48376002)(2201001)(76176999)(85426001)(47776003)(50986999)(8656003)(36756003)(97736004)(86362001)(77096006)(50466002)(356003)(53936002)(50226002)(106466001)(105606002)(5660300001)(2950100002)(81166006)(8936002)(81156014)(7416002)(305945005)(8676002)(626005)(1076002)(5003940100001)(189998001)(72206003)(498600001)(54906002)(68736007)(39060400002)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2264; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD023; 1:w7/SBQ5kN4vk/kNrFzRuTolZF90d1ZmcruraHpSBdHN6sKsmAf3w1pAG+REeVk/KJAJBOEdIVNjp/ya5EpxcCe7wXG7EzMvRQDknMC1HVgsU5OzBElndoCZpQdwI5b7p MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f6872c7e-e3d0-4316-f962-08d4ee055c6a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CO2PR03MB2264; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2264; 3:Bp7xn9hN6kZPekKvze5yGsCgitJZIQ9CmiHrP2oHNOWSckskk6fExy3FfzLwJC6tjcVjUP3NQWK6C/8yTWXxEZDMXMJJTC1jElQe3nMPvYE5Cq5JMsCluaXv5HpxJhCdgEqMOZju44nRvwrrzaIbTImdWyRxMiOmDeyNORlejNFuveFsKyI5FcXLPwrbMS4qbw9/Xb1DtnK2fLF/LK+6JX/AxfkTRFQwc8ttpPim+vPVO7BtApuTTWY3px3B9Do7CE1882Vb9zHBJB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abjpQzgAP/5Hr835w== X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(101931422205132); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(5005006)(8121501046)(13016025)(13018025)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6055026)(6096035)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123561025)(20161123556025)(20161123565025)(20161123563025)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO2PR03MB2264; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO2PR03MB2264; X-Forefront-PRVS: 0413C9F1ED X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2264; 23:9y4GvrumZIy9tsDFvFVjmui0dxmAFwrIt9qatfJtC?= =?us-ascii?Q?HfkjUR/lersXQJoUOlhnVIQv9jhEux3bkxsfuoBVOQty15oqyH/nmXUzpLCG?= =?us-ascii?Q?PkGg2YByT/Vz5yd4D9JiMVEZVUX/RL8CR0Q0wT6NETABBg7XqYCcf2xWhneC?= =?us-ascii?Q?MKjtJMr+EY5UmhhGMUI5a4G3qHSvRPcb+0V2Z1JGBfFDkaIlJMc/4ZOi2mt+?= =?us-ascii?Q?l66gkpe3EpYemyjpVFLXHs8JKhRc/x/TK4krDbX0hsZ8pmq+48cNkokDF09i?= =?us-ascii?Q?UfEPJNezcAaFi42mVnq2EY47EjycEAVDscc5upgPLUd0DZwadxPNRo5SoQDS?= =?us-ascii?Q?mAxCOUmNNZfcJ2v7WhBA92AH7En/v9O6fUWERCs2j9QYQIGU07ns8KyTM5AQ?= =?us-ascii?Q?OD1sGFLCehX5LjX8kdAf6v9aDWmjnp8oxTpXm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hrxWWN1SuigJRI6bJBZKBL2rhWb2p0DPLJd0jxXEjibWdBPf0R4A1KpFyLqvmVPIlhgXzK1WC8u6lVCZllkR3wYQgcU9kQHqrzNZGh3cBD5NuDfyOpVs2F6lMVN1GlCqBe1WEhKVUz2kP0f+b50309aDFi5WE+W+GmZ8qHb5VrG02phzniqDHdAB6JgMnUPH6OJh5qahmCAb1S6TbJk6ouLGqP+cZW6SakDMDSN2OgzZYtCMLSrj72roVg==; 5:Szz67HP0hKgsw2bHBQsLroqw6GnXw9FzWtevDmoPCJTvU0Z6nImNmxruM5Z3EiyR9A460eW6B9qec/x1VA2cKtpliotf/Ljc/2OoU1LtZIw9sQPeo01+6kBKTgR5BlSV7SbaJyaW0PlgGcE5lpG3fw==; 24:/Vyna77dOghQICtMBOHMPNUVODBytcQkZGDHFIebGXvUYW8sdE6EKStVz9ahuQji3rd6uv25PVTEVFRWmRjHwT1oOx3lYhWZegx7wlYyfwc=; 7:+6C0AWb3UQZKgzGEcY1Gi4/PBHlUg51gjWtxOm4oRKKsa4Cm/c3Z4RExDV56Y759q7nWNGquBZodR+0bD0Uz0POjCruUVNvEFPWckyYagdvl8zn1i1TgtvHFoDjoe0/8ln8rfPKdzXbkdxeaV4YZZY7Unt7K2RwIbUGAZCRgbAPxOuOweLhhUjbjjrzXNMyAo4qn7lJkah/rppysEWXTfZ2UlV3SRSg9nCDvBMJaOlA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2017 11:10:15.6660 (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: CO2PR03MB2264 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hou Zhiqiang To prepare for calling the common host_init in ls1021 spceific host_init, moves ls1021 specific host_init behind the common host_init function. Signed-off-by: Hou Zhiqiang Acked-by: Roy Zang --- V5: - New patch, split from 4/9 patch v4 drivers/pci/dwc/pci-layerscape.c | 64 ++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/drivers/pci/dwc/pci-layerscape.c b/drivers/pci/dwc/pci-layerscape.c index 3aa34214643c..160035efa4d9 100644 --- a/drivers/pci/dwc/pci-layerscape.c +++ b/drivers/pci/dwc/pci-layerscape.c @@ -108,6 +108,38 @@ static int ls1021_pcie_link_up(struct dw_pcie *pci) return 1; } +static int ls_pcie_link_up(struct dw_pcie *pci) +{ + struct ls_pcie *pcie = to_ls_pcie(pci); + u32 state; + + state = (ioread32(pcie->lut + pcie->drvdata->lut_dbg) >> + pcie->drvdata->ltssm_shift) & + LTSSM_STATE_MASK; + + if (state < LTSSM_PCIE_L0) + return 0; + + return 1; +} + +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); + + iowrite32(1, pci->dbi_base + PCIE_DBI_RO_WR_EN); + ls_pcie_fix_class(pcie); + ls_pcie_clear_multifunction(pcie); + iowrite32(0, pci->dbi_base + PCIE_DBI_RO_WR_EN); + + ls_pcie_drop_msg_tlp(pcie); + + dw_pcie_setup_rc(pp); + + return 0; +} + static int ls1021_pcie_host_init(struct pcie_port *pp) { struct dw_pcie *pci = to_dw_pcie_from_pp(pp); @@ -144,38 +176,6 @@ static int ls1021_pcie_host_init(struct pcie_port *pp) return 0; } -static int ls_pcie_link_up(struct dw_pcie *pci) -{ - struct ls_pcie *pcie = to_ls_pcie(pci); - u32 state; - - state = (ioread32(pcie->lut + pcie->drvdata->lut_dbg) >> - pcie->drvdata->ltssm_shift) & - LTSSM_STATE_MASK; - - if (state < LTSSM_PCIE_L0) - return 0; - - return 1; -} - -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); - - iowrite32(1, pci->dbi_base + PCIE_DBI_RO_WR_EN); - ls_pcie_fix_class(pcie); - ls_pcie_clear_multifunction(pcie); - iowrite32(0, pci->dbi_base + PCIE_DBI_RO_WR_EN); - - ls_pcie_drop_msg_tlp(pcie); - - dw_pcie_setup_rc(pp); - - return 0; -} - static int ls_pcie_msi_host_init(struct pcie_port *pp, struct msi_controller *chip) {