From patchwork Mon Oct 1 19:53:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Crestez X-Patchwork-Id: 10622707 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 2855115E8 for ; Mon, 1 Oct 2018 19:54:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1512528449 for ; Mon, 1 Oct 2018 19:54:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08CC028470; Mon, 1 Oct 2018 19:54:14 +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 8431328449 for ; Mon, 1 Oct 2018 19:54:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726236AbeJBCdf (ORCPT ); Mon, 1 Oct 2018 22:33:35 -0400 Received: from mail-eopbgr80058.outbound.protection.outlook.com ([40.107.8.58]:27854 "EHLO EUR04-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726204AbeJBCdf (ORCPT ); Mon, 1 Oct 2018 22:33:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vfYDRpGtNhiB+2uKYtJvLbU0siQgKtoIlPCdtkEKwB8=; b=AHySRpLKjZ1N/GdsaHiF97jGkKYehcTxaLj6L+aMaG8/0ZkmD5OjRr/cAg/nq9UUdruZ/sUa1A/CtysKZOjC5BQQfrCSE8a/QoN8le8aKUlSCkyoMUvrmUY3RMD+nBf5ILQWt4xh/N4TbSSBm8tfGLSjToqWqf4nGCCS+9mE7Wc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leonard.crestez@nxp.com; Received: from localhost.localdomain (95.76.156.53) by AM6PR04MB4293.eurprd04.prod.outlook.com (2603:10a6:209:4f::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.22; Mon, 1 Oct 2018 19:54:07 +0000 From: Leonard Crestez To: Lucas Stach , Philipp Zabel , Richard Zhu , Lorenzo Pieralisi Cc: Andrey Smirnov , Gustavo Pimentel , Jingoo Han , Bjorn Helgaas , Shawn Guo , Fabio Estevam , linux-imx@nxp.com, kernel@pengutronix.de, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/4] PCI: imx: Add PME_Turn_Off support Date: Mon, 1 Oct 2018 22:53:44 +0300 Message-Id: X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [95.76.156.53] X-ClientProxiedBy: VI1P194CA0013.EURP194.PROD.OUTLOOK.COM (2603:10a6:800:be::23) To AM6PR04MB4293.eurprd04.prod.outlook.com (2603:10a6:209:4f::31) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ec455bf9-227c-4b2b-9d3c-08d627d7a64f X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM6PR04MB4293; X-Microsoft-Exchange-Diagnostics: 1;AM6PR04MB4293;3:5Yuq1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ljw+bIBurwCB1FPFDcQdoBrTR2K4WbNRNvDPLppoTOcqPYSva8f/LfrOypVpOvKzGcthf7LU2IqJNBVMm9HaUNgq7NRMzvDZw6ZbWsmy8ImdgusKfZuScY3kSoGNDTzbDFo45huxI0UWRH7G8vwQC0FE6G/tWlW69Zj3DTey/PLBF2dr80W+KZSvuD7+y+xjWFDfqRJjwofjpsW7DAujSFWHF+Dd90hZZKsqpbYxNXndugn1PXmADRRwFhQ+D7q5FmvnVTBoS3GQwyJJnb0cfCq47D6Qp2FBf93tdHcuJitnKSA9WO5F7rXl0wJ8F5W8OHjhX72tTre1QFnZiQ;4:2Y9+wLbPzxrMHYV6SpoHiZsxSBkU1ng90WSZZYvAFy3LluO/AuuWdsGlatQf1x7NLLZ0sxLLiF4MAvmvIoodBBBT5aunRik41l+eFCniS/BCE7qiWxoyxDcG3kcPPo8ITtZrbPndjWKuNFHKM1FUsVZFp5YywIl4/qzffYjzA2GdHkVdSp0MN+xywBpucH+5n7VdZDHrdMPP+oDKqflbXeeO4LV8u8KJdeQD9/8xLgSuT4V9xjyYq3myeeOCMaCa6vyAZQ2Go3MxdrSynvRRzw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231355)(944501410)(52105095)(3002001)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(20161123558120)(20161123560045)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051);SRVR:AM6PR04MB4293;BCL:0;PCL:0;RULEID:;SRVR:AM6PR04MB4293; X-Forefront-PRVS: 0812095267 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(39860400002)(366004)(346002)(396003)(136003)(376002)(189003)(199004)(6486002)(7416002)(110136005)(54906003)(6116002)(53936002)(6506007)(386003)(3846002)(478600001)(966005)(105586002)(16586007)(6306002)(7736002)(50466002)(6512007)(66066001)(47776003)(25786009)(956004)(486006)(305945005)(476003)(48376002)(26005)(2616005)(51416003)(52116002)(106356001)(6666003)(2906002)(39060400002)(97736004)(16526019)(186003)(14444005)(44832011)(86362001)(5660300001)(50226002)(68736007)(69590400006)(8936002)(81166006)(81156014)(36756003)(8676002)(4326008)(316002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM6PR04MB4293;H:localhost.localdomain;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: 1;AM6PR04MB4293;23:TernGcnDwnMjLHnYfY1hJS1rKQyi2BRkYSvnj1sAZMsAq0pZ+Ejgyq17fWjolR7Bqr5qLd2I/iA3Fup8v2xA4TUhwyCy6RVEM/36RMxDcx7aCjCetKlrPynywtyEsupJ0ic7NAbgS8fq1AD4kAGdSVi7jYScT+vIavGtENQJCw4aI4h5s8zzvSZuDRaTfYCSwwoOkDVZ5UUOOubty8PlE+P1Bo09ZGFP6f6lvdxGNNZu4DFR8+D+ZTn5vfYFJbxT4ftQVh2L5SAiS1/VewuyUvC4GtCQ3TrFbOuOWAXf48FaCr6o9/YopByTR3UUcSVGw66xbc02Pe7R/S3GPKtVcH9ObcgzKmPrHWOt+KewBPPXR3KZ+SQxB5622g217QNQJY0weRiQlk0GZyfN1Yqfmc6g7OGX9O9dECC3pbFRzTv/m69EZhQ1FYNfu+1s9nEVBHGAv6frgL573ZPXXxPJYulHf6I3LhFMj60RwmMyE1bAmHEsbRWZRhWBAkvyEghMVhHJwyEs59hs7stH0J3elrntxpCGI53wnNKcG9orn3Ar8TWAT09vR6fA/gz2P8UEtvRyxdearrJ77l7FNH+oARGR+eeAd0htBcKNZf3ttsWy51TonKcfMjZ2T120huiENLtVinxILSHQ4ovrbO3b6eC/IFWdNLjC4Etl6GbomokhG7G1QlRMsI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Vt1U1+5JaUd+5LoX4RweYXR4H4KlgCIRA/HxhbfZTg44Eu5hoJCbck3porMvo9Kx7ofP70jL/Z6CZgJhGLqnY3Zb/RkeX+pFcye7np+8Cc+6H4ubHJjW5hVIen9in86bsFsl9cIGf8mRcY/LS9nw787edn7LyReAP2O1Pt+PCYEhcxIheHa2y9xx5DuQXfYLTmG5WrnYR3mnNt2VpsSs0evP62B+0RqBqI2P9AYcquTHLrne3jw45CwuAFf0MbDKN7TvuOgfl8+ZtTco8257VnIHUsQkb6xkV//AcOOThNeXpemCy0u/bjiAkhnq7rZGhvwocDiH/ApR+fdARfvfiirBkILEAISsR2gZHnOTWbLhsxlF1dCuFoh83qVwiUX0QA1FqsDynCzEgUC/IYTZWlZd9J9jYXAnH/d2POEY6qoBSoviAJmgA==;5:Uz/KeY7lWZm3rVN7OcDwU4wBs9oZBC35kxMqcZ3WowWZwI9i0caw7cG/9EmKHdpX1XWxVyMd9/ZzKRjB0FhfhItQAaEANMYryaa3nCgxN98u1M+46OI9+y66om5eToe2gqlopl8rZlDazX5cqI4ya6RgrCIFPhRyK6364i5E5l0=;7:krx5K5EvknqBMse8XNNBgtkEwXiWHURnlV5QXc5vQbvUlQFjU3nPA4ykgfZPpaIZFGNyKWMdAcMMaU8tWGU0ZcPYDvpMzRtbV+9XeY8yGpMDtW8fluygK+bk2wiv4186WFRdVUzT2ltQ4vmpxObACYZocvXShiqGPGtC1ZQevQL6BFcQNvEkX8bFwxyEP2+uTj908OmlsgiKwGRiWGtRRLCALLDUg6W6LPawcQQOPBAucajNUL2QoYDdFPvQlAcI SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Oct 2018 19:54:07.2284 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ec455bf9-227c-4b2b-9d3c-08d627d7a64f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB4293 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 When the root complex suspends it must send a PME_Turn_Off TLP. Implement this by asserting the "turnoff" reset. On imx7d this is functionality is part of the SRC and exposed through the linux reset-controller subsystem. On imx6 equivalent bits are in the IOMUXC GPR area which the imx6-pcie driver accesses directly. This is only for imx7d right now but it's deliberately implemented as an optional reset, ignoring the chip variant: * Older dtbs won't have this reset so it will be ignored. * Future chips might also expose this as a reset controller. For example imx8m (not yet supported) has the exact same PCIE_CTRL_APPS_TURNOFF bit in the same location. --- Previously posted here: https://patchwork.kernel.org/cover/10565871/ Parts of that were already merged and available in linux-next so reposting as a focused series. This is not very complex but needs to be split because it touches multiple trees. Merging out of order should be fine. Some patches already carry acks for DT but somebody needs to ack the pci/reset parts. Leonard Crestez (4): reset: imx7: Add PCIE_CTRL_APPS_TURNOFF dt-bindings: imx6q-pcie: Add turnoff reset for imx7d ARM: dts: imx7d: Add turnoff reset PCI: imx: Add PME_Turn_Off support .../devicetree/bindings/pci/fsl,imx6q-pcie.txt | 1 + arch/arm/boot/dts/imx7d.dtsi | 5 +++-- drivers/pci/controller/dwc/pci-imx6.c | 15 +++++++++++++++ drivers/reset/reset-imx7.c | 1 + include/dt-bindings/reset/imx7-reset.h | 4 +++- 5 files changed, 23 insertions(+), 3 deletions(-)