From patchwork Tue May 22 13:33:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Douglas X-Patchwork-Id: 10418681 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 8408460224 for ; Tue, 22 May 2018 13:33:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7511520182 for ; Tue, 22 May 2018 13:33:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 68F26205FD; Tue, 22 May 2018 13:33:27 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, 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 2028920182 for ; Tue, 22 May 2018 13:33:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751369AbeEVNdZ (ORCPT ); Tue, 22 May 2018 09:33:25 -0400 Received: from mail-cys01nam02on0055.outbound.protection.outlook.com ([104.47.37.55]:43712 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751214AbeEVNdX (ORCPT ); Tue, 22 May 2018 09:33:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ua2lvjDlqn7df3Q6vHKmeSkxHYSUbmat6KVhzbS9SZY=; b=FNhWrwJxixqiHYy7xVADIfyI2LfwUcBm/8ZmfziCHrE6VgIUrQqlZB1/pGFpmVTTEd3SaV5VcDX2290JI/xepA+Sfy6c5/1nq9TifUH+AWRsCYj/il16aKYPYwUJh+fwBHMNwPhFFRyv42GuUxHMRr0UZQnTwah/JnajZkeaw1Y= Received: from CY1PR07CA0031.namprd07.prod.outlook.com (2a01:111:e400:c60a::41) by CY4PR0701MB3666.namprd07.prod.outlook.com (2603:10b6:910:93::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.797.11; Tue, 22 May 2018 13:33:21 +0000 Received: from BY2NAM05FT007.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::204) by CY1PR07CA0031.outlook.office365.com (2a01:111:e400:c60a::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.776.11 via Frontend Transport; Tue, 22 May 2018 13:33:21 +0000 Authentication-Results: spf=softfail (sender IP is 158.140.1.28) smtp.mailfrom=cadence.com; arm.com; dkim=none (message not signed) header.d=none; arm.com; dmarc=fail action=none header.from=cadence.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning cadence.com discourages use of 158.140.1.28 as permitted sender) Received: from sjmaillnx2.cadence.com (158.140.1.28) by BY2NAM05FT007.mail.protection.outlook.com (10.152.100.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.797.3 via Frontend Transport; Tue, 22 May 2018 13:33:20 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by sjmaillnx2.cadence.com (8.14.4/8.14.4) with ESMTP id w4MDXIks028110 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Tue, 22 May 2018 06:33:19 -0700 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu3.global.cadence.com (10.160.88.99) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 22 May 2018 15:33:27 +0200 Received: from lvloginb.cadence.com (10.165.177.11) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 22 May 2018 15:33:27 +0200 Received: from lvloginb.cadence.com (localhost [127.0.0.1]) by lvloginb.cadence.com (8.14.4/8.14.4) with ESMTP id w4MDXHbp024024; Tue, 22 May 2018 14:33:17 +0100 Received: (from adouglas@localhost) by lvloginb.cadence.com (8.14.4/8.14.4/Submit) id w4MDXHrZ024021; Tue, 22 May 2018 14:33:17 +0100 From: Alan Douglas To: , , , CC: , , , Alan Douglas Subject: [RESEND PATCH 4/4] PCI: cadence: Add Power Management ops for host and EP Date: Tue, 22 May 2018 14:33:15 +0100 Message-ID: <1526995995-23872-1-git-send-email-adouglas@cadence.com> X-Mailer: git-send-email 2.2.2 MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:158.140.1.28; IPV:CAL; SCL:-1; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39380400002)(396003)(376002)(346002)(39860400002)(2980300002)(3190300001)(36092001)(189003)(199004)(26826003)(186003)(87636003)(478600001)(2906002)(426003)(47776003)(2616005)(8936002)(8676002)(126002)(5660300001)(486006)(48376002)(59450400001)(476003)(50466002)(26005)(336012)(50226002)(51416003)(2201001)(36756003)(86362001)(54906003)(42186006)(110136005)(316002)(305945005)(16586007)(4326008)(246002)(106466001)(7636002)(356003)(105596002)(107886003)(2101003)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR0701MB3666; H:sjmaillnx2.cadence.com; FPR:; SPF:SoftFail; LANG:en; PTR:corp.cadence.com; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM05FT007; 1:u3LmBpLyO+fm7KSSpEMtzS1rOyDmXRLP6spC1cbPj7uF/05zG8XT4kejvjkh5xbIFiTlbsIi2OAo+zWe+ByxVXY3t0KKNdCcmURwgtlU7apvvoypv/4227N+iuNytuMJ X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:CY4PR0701MB3666; X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3666; 3:H1ecb16x+k3QHKMkIf6F9QwjkZCrqFQjHMBjjeXYR0wnwF5olLCIYj8LB6xuoZsjXW/WRqTK7rMybYKq8yVVqGcoygCDvsQFcdN2dMJMFujweKinTq3AvICt7+pN+kKyAQNCH0i2YTB/T0hIUTgBlt5pI/Z+GbIbpJjDPM76rhES+rtCNSy1/pX+CyHLDwLbq8zEc249lxI95B1DoelKv97+33iEE6PzMUP/6eZrm+D1G2vZyA7FsBgnd07fEYgT093591SAJWxXGTnZoVlq5TfERzEU5Dplf11Xwn6Y/XMfYW69bJapBHD0rZp3jwo/hLQCIm9HSHw71wwUO5/Wmqj7MxvP+q+5wz7C1pIIYR4=; 25:RdPN1GwJMRJaXpgnSJES0DZU2XuedtJLzWbagLScqHM9McBuznFCm6oQMAEfDEAdGt3Pqrh5Gv59R5kRxf5FJIY/s12b0jatr2cPdaBmsd7Ekt9GjG/r0+8O0IuA5W8Jlw1O6mI0orz/VCqEEYlTAqbyhXCnf3mkR7yzYIF605PynbygxrEq6nlif7fakfDumYIBW4vE0kdnevarNIZW6SAGOPslCMOViSO0xb5JAtTq7/qL8P14Im3bhJLg1rT8SnMqBfS9LbGeUsNUrB9G/kv7ApemHFjs0TLxstR9PE7FmYLO6HBRdye3juiTwkn0FPJG1taAC7kYIZQZHBVUEA== X-MS-TrafficTypeDiagnostic: CY4PR0701MB3666: X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3666; 31:rvOFdDwslGRtnhaf1Zq3MBAahFRyonTHACsUGsZiH/SaS5a1PykwbfoX3Fp8X2ddVv6PqIEVeqJbr2890EbSBwOOzqbB/PRwM9NFKFjWLrpYbJ7ngoiweZyBntWUIiSeSpqMlA0nOFz4vAFEQ0wdEk+EJpl6IWN3DR1B9WafyAYgpLxgDv6b90xXVSKKeA1++I33ZckRMiMB4XYoYQYCYQ4IeMJhtaH7vJ/e+MUcmwc=; 20:vql1Lj7dooKfDXhJf/qA/5mnbxkmUiviaIewd4AkLcHrrm1hqvlXDTnRmfghInX95xpDuDUqromG+eGay3Gg6mrqz0WvzmAx6HuQcia8mlvpHFJsnZ9yW797GKCcVLI9fEJmH8C5LEdRoMEwtO6wanLvR2crIrHqjonZr8duvcN7NKMNGD98jZ1eGCpnzgLfriYM0+8lcqPdtEe0q4bbrWcrtll7A8/svdePMiqen1QkbKAd7W7x939CPknWFTow12MixO8+dhzPQaBKEFAHgb4K3jmEBU+KADyrIYdN//OLe7MoO/YdPuFsZsagXl4pppoLKYT/leCdz3NZgCzc0mlgcMbgwjzrAtukVPtVk9hAk81KZdJPKSASXpGLWLyKWftdze1RHh7Eu/LMhJkdfSn2x/uf+fKVYF3mO10fxNjUq+Gwy84TbWo3H4LxGukRq09EgJ3QwYWOUtae5rUp5NyoKq0s/W95lSZjXZ24WZZtHO4i3awCW2h5uDvPhfvv X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(72806322054110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231254)(944501410)(52105095)(93006095)(93003095)(149027)(150027)(6041310)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:CY4PR0701MB3666; BCL:0; PCL:0; RULEID:; SRVR:CY4PR0701MB3666; X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3666; 4:+43vgpp2DDy9zUV0EJyASHdL0mrJIpjEYI4rmpwIOr7OprE694+KQ8pIXm7RRT6E5Ni+cGomY0CSim7dCRHPRrMfrTmiUWomOrQ1QAlJhZnS8zXSv1VkzI4Lg3EGf6+ub32EAs57IRWVlMw8/EYaR9feA0cVZ7/NJySCmIlBYi/vFC/LNmAJD+rMvHX1Y8QPt6mTrdfCbyVvSiEjkLl2k1XQVPzxPlvjDi2MjhKfBRaVRAJ5pcpa74ZpNAfPN3XvxNpPB9D0WSd7UFZCIm4npekEIS8x8qjtjC/ZYK4cZSp5+3+SVsN6eapLvYVh3pnc X-Forefront-PRVS: 0680FADD48 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR0701MB3666; 23:0i66D+jZ/+6aYXZwohHWhVwGj3X9q+WZ+WH0sJB?= =?us-ascii?Q?14okuXyK4WeQdAPU7AEPT1LoHRiO+rKNS5Q5Akn7cSZZ1wrWgikuAfaenZuz?= =?us-ascii?Q?m9pHcmc8YGCcXZQUyShwkKBeqsQV4XFsmco/ESm4dNdihy/CXnU1Gt3WHUY7?= =?us-ascii?Q?qFrz1HbadDI0NUUVfOlI0Vw21nSmuSud7Bk8L2tdFKBQEAgb7tZwDglQbiQn?= =?us-ascii?Q?HuqW4jykO8H3g56c/wMiEifWfoLYjJ8Q4gTR6KIVETxsctWRD6ylZEqD2Ch4?= =?us-ascii?Q?OBLN3RbRHkOZeZ92KR50L1gRzIxCZa90vfB/ZzeenXqEM326gr/n67i607zz?= =?us-ascii?Q?geh9KsWVJQahf6cnY1GXafdg30P0+oyXu6uPycs4fNmRQYkGZlbb8c7Ot4sW?= =?us-ascii?Q?bdRjPbbfjbXn+QBLzyG4WxFb/PR/O0iJE+eyePyIU+SjuHpqbZQXyGN7ANRn?= =?us-ascii?Q?yqrBIrsx5pMhvV+ailRCdcyVg8ai2VM0vpjrL6mAomtxlH31s63iJJklxi6M?= =?us-ascii?Q?HC61vrCujRRSYIAtROycprgFoVz7U6UTRqZ8doyGWIbxbdvumzIfHbliyVsM?= =?us-ascii?Q?3XdeD4g7mn2l7J0d1zM+sxtsHeiNAEig4FzpAOvy187UCznHCc0Ms9LXNY4Z?= =?us-ascii?Q?qEi8jvZBtyh3RsgAuCC+JPI+AM68Q+FN/7sKapxNarl909xI0g+wuZU59iRJ?= =?us-ascii?Q?dWLIYBdzAlTeitZu1+pxHFl/7/KqpeVHnpyG7peL919n5JQXH22rE6ITK4Ay?= =?us-ascii?Q?9BdB5tB5O+WtNcb13xL4I8SHQEZdGqizqo/fdA7d+6ACj9JS54TYVAewNFHH?= =?us-ascii?Q?NSx6Y4Vxa+VuIN4OtyIiXLnZMb72B35hEZZdLC+nWQDHaRZniKOEjUWkdQ1J?= =?us-ascii?Q?DWsByTYkF2VAwhoKw71jVf/5z7DDS7aSi/LchoBSR5RIB4hVkOtsQLYDVwJW?= =?us-ascii?Q?SH/b1GrTaJyA7ZTzHuFUrxeWt76miocFuEijtGA0DGcjHqq979ZNwPUDSWEM?= =?us-ascii?Q?ZcpC/ez3ugkmNvNWym38sWiLwsSqf07iGcdSJPmSva6t/FKmMb4gPag+v62z?= =?us-ascii?Q?kIv02eupmwie8gfHWo2mTRZZslIKOC+ZvcnJ7PhYhukiis0UjnSnM+VMId6h?= =?us-ascii?Q?0Y1TiWXHVjB4=3D?= X-Microsoft-Antispam-Message-Info: FAp5Yi0+3Pshylv8rdrwT2vbioEuxQ8fhGJnrjle8ha2M0kJSxjWuw6L1i6qvEwrlE8qE9JttnDiMbdt3oISHpbcfsO41o7+mEfagloukHOm7G9hy6OTZpo3E7Rv0+y4IU/0Z3m+EtgI7fpUNKu11wJB2uXAZ3Ly8RR+kbv5k74iLrBI0Q8h1PRWNO/UUb/vr2vMUUpK1MNjgvQGuYMZfNT5VQEiLviDo3WWNsr18TqkPNlyuQ1iCMl0MVEL4V4o X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3666; 6:T8Ipoblu+i3xWzwnGggxL5QNIw4O2JbVQlSGHcw0x7o2utpPyMZ2LOu9PZClcJCEFEI6kFP5DrCWtHMb8SlkyObG1MvDM1ixLAcGBzYKIFABLS6zZDYHX/j7Hw4PJjbzuGIaMVV7OhE9EQMJBfflbKjXaHJNznkz1ECJRcZwiVWXb3HESwm+LS3bizaXOVBFelxvWys136gIFWMy49yWCSGjH8rAg0YIj7uWHU09e8Pj61DxP36Dj6g88O1f7/W3fovIhKMdgWp25GRGshvvVqfdr9QnH9FY64y55HcAJqVOhjTTxWwq/+znUYPLDk0yaj7qXuNYWPXgKzU2V27f+B+mOC1wwGch2BUNgKz+OcsboM+kQ+fAckQBnCZAZP255RQ08cl5NYiQbXggdjZdHAnb1LoPaRExEtdNLeb1fD4wGIS2zSax8edkzsZ0YrUnPSDZrlgH3Fg1b1fFopL3cw==; 5:8w5Xa4gDn59LryJpu3gE8QnMus3MNAC/mujH8AzuhsPKTzCMcJiipKL7jLCjiLfmMSW4EAAfwlXdnechGt2MYSIXsw1T7dLSEjUmHF6Zq9byjsod6GeVZSCT7oMyBhBzfckNNLM2n+TVWQS1yaaUEeS4rSnGjdbklz3qFhVhSOI=; 24:eSpd+G8d+wVmR4DV6M3XvUNTd5vaYvC36YO9gFbeM8SKTj2LiQDNS6Z7GHw20PZFxYUdhCDplJU120mDgPrUGNf7+XVhFgsnbOwyw2PXL/o= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR0701MB3666; 7:RbPP4hL346EaQdmvpPayvRKSqCwJzlANHNsL7aE+7yK0DFu3HI40KVwwh+bu30X5X9+Uqocz4SWTDbYVrAH0bTvbRLtrvsDUCTOY3SSLNyHwt8vSaOkdXayHw7LnIQgnvkXw/+U8oXOK21H9zyT/7bpPpqGzD4rYJqRKZZkVQr6wNp1OYAGZpmcxRVnqb6MEzMcaG6tVUUGaeJDsbNpu16/tZ1xqEbsrlg6ncwMBZ08JYnEibjgs8cmpS7ysF4lx; 20:W3aAlkDr0MQhs48jbk1cCXD+KoR1sKZD+jeVv5N64psN1aDvX1glSuvsiBKS6BWxw/wtDqZW5geys9HRFkX05vJVS7blMBM1jRMap6B1IU5nQRdAeTV/JN3MVhDjYwVLPqor/h0VGXxk31UA7r4dbXa49HoLXgJwqlUEOylONBKpLpda6652yMuQH3XoRNB7PyTHXShJ1szAXkkIMSk645ZZ/VLvLSTmm/W0EejL8x0uguofi2RzXotgfHZhFRAd X-MS-Office365-Filtering-Correlation-Id: 4a3ad26b-fb51-4f5e-deb4-08d5bfe895e4 X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2018 13:33:20.5446 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4a3ad26b-fb51-4f5e-deb4-08d5bfe895e4 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9; Ip=[158.140.1.28]; Helo=[sjmaillnx2.cadence.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0701MB3666 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 These PM ops will enable/disable the optional PHYs if present. The AXI link-down register in the host driver is now cleared in cdns_pci_map_bus since the link-down bit will be set if the PHY has been disabled. It is not cleared when enabling the PHY, since the link will not yet be up. Signed-off-by: Alan Douglas --- drivers/pci/cadence/pcie-cadence-ep.c | 1 + drivers/pci/cadence/pcie-cadence-host.c | 3 +++ drivers/pci/cadence/pcie-cadence.c | 30 ++++++++++++++++++++++++++++++ drivers/pci/cadence/pcie-cadence.h | 4 ++++ 4 files changed, 38 insertions(+) diff --git a/drivers/pci/cadence/pcie-cadence-ep.c b/drivers/pci/cadence/pcie-cadence-ep.c index 2581caf..e74b8a4 100644 --- a/drivers/pci/cadence/pcie-cadence-ep.c +++ b/drivers/pci/cadence/pcie-cadence-ep.c @@ -554,6 +554,7 @@ static struct platform_driver cdns_pcie_ep_driver = { .driver = { .name = "cdns-pcie-ep", .of_match_table = cdns_pcie_ep_of_match, + .pm = &cdns_pcie_pm_ops, }, .probe = cdns_pcie_ep_probe, .shutdown = cdns_pcie_ep_shutdown, diff --git a/drivers/pci/cadence/pcie-cadence-host.c b/drivers/pci/cadence/pcie-cadence-host.c index 7536926a..a8b5eda 100644 --- a/drivers/pci/cadence/pcie-cadence-host.c +++ b/drivers/pci/cadence/pcie-cadence-host.c @@ -61,6 +61,8 @@ static void __iomem *cdns_pci_map_bus(struct pci_bus *bus, unsigned int devfn, /* Check that the link is up */ if (!(cdns_pcie_readl(pcie, CDNS_PCIE_LM_BASE) & 0x1)) return NULL; + /* Clear AXI link-down status */ + cdns_pcie_writel(pcie, CDNS_PCIE_AT_LINKDOWN, 0x0); /* Update Output registers for AXI region 0. */ addr0 = CDNS_PCIE_AT_OB_REGION_PCI_ADDR0_NBITS(12) | @@ -360,6 +362,7 @@ static struct platform_driver cdns_pcie_host_driver = { .driver = { .name = "cdns-pcie-host", .of_match_table = cdns_pcie_host_of_match, + .pm = &cdns_pcie_pm_ops, }, .probe = cdns_pcie_host_probe, .shutdown = cdns_pcie_shutdown, diff --git a/drivers/pci/cadence/pcie-cadence.c b/drivers/pci/cadence/pcie-cadence.c index 681609a..7a34780 100644 --- a/drivers/pci/cadence/pcie-cadence.c +++ b/drivers/pci/cadence/pcie-cadence.c @@ -217,3 +217,33 @@ int cdns_pcie_init_phy(struct device *dev, struct cdns_pcie *pcie) return ret; } + +#ifdef CONFIG_PM_SLEEP +static int cdns_pcie_suspend_noirq(struct device *dev) +{ + struct cdns_pcie *pcie = dev_get_drvdata(dev); + + cdns_pcie_disable_phy(pcie); + + return 0; +} + +static int cdns_pcie_resume_noirq(struct device *dev) +{ + struct cdns_pcie *pcie = dev_get_drvdata(dev); + int ret; + + ret = cdns_pcie_enable_phy(pcie); + if (ret) { + dev_err(dev, "failed to enable phy\n"); + return ret; + } + + return 0; +} +#endif + +const struct dev_pm_ops cdns_pcie_pm_ops = { + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(cdns_pcie_suspend_noirq, + cdns_pcie_resume_noirq) +}; diff --git a/drivers/pci/cadence/pcie-cadence.h b/drivers/pci/cadence/pcie-cadence.h index b342c80..ae6bf2a 100644 --- a/drivers/pci/cadence/pcie-cadence.h +++ b/drivers/pci/cadence/pcie-cadence.h @@ -166,6 +166,9 @@ #define CDNS_PCIE_AT_IB_RP_BAR_ADDR1(bar) \ (CDNS_PCIE_AT_BASE + 0x0804 + (bar) * 0x0008) +/* AXI link down register */ +#define CDNS_PCIE_AT_LINKDOWN (CDNS_PCIE_AT_BASE + 0x0824) + enum cdns_pcie_rp_bar { RP_BAR0, RP_BAR1, @@ -314,5 +317,6 @@ void cdns_pcie_reset_outbound_region(struct cdns_pcie *pcie, u32 r); void cdns_pcie_disable_phy(struct cdns_pcie *pcie); int cdns_pcie_enable_phy(struct cdns_pcie *pcie); int cdns_pcie_init_phy(struct device *dev, struct cdns_pcie *pcie); +extern const struct dev_pm_ops cdns_pcie_pm_ops; #endif /* _PCIE_CADENCE_H */