From patchwork Mon Jan 14 19:22:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 10763325 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 80B03746 for ; Mon, 14 Jan 2019 19:23:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E550287B8 for ; Mon, 14 Jan 2019 19:23:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 62510223B3; Mon, 14 Jan 2019 19:23:50 +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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 C3BBE2877E for ; Mon, 14 Jan 2019 19:23:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4TJxR8jHl8rMrleAuduGYKIzpe77wNDe3r6f22T7baU=; b=jRfrv0FVrcYl5x 41KeNV1Qq4Oc0bNTEAbAGqWkk3uODGx6UxhIRcPIvWG+MwcgMUUinKrqjSSp4I7P2wW6ORh8HY6sA orfrCta8N73RJhaMAetk+MHQvETOaQXxVpqL+/75WE2EG85tzOGjlENR/aHozjIKS4KvGPlh33h0/ eSZ8dyQd2X8/NA6crhRma/U+p2DBJVIm1cByRcOQ6ZtwaJ1D1D/DvHCtGxepKTa866g2IdYM3uX0R tLUASt4tJSntjz4edU+hyohG6FBPPlAtvULhQ0lMLBNxqvcyJI8kSmdyAv2D6MhyIzp1Etz2VpX+7 LwK2jQiG2qlZCRohOcZQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gj7pr-0002a6-9L; Mon, 14 Jan 2019 19:23:47 +0000 Received: from mail-eopbgr780073.outbound.protection.outlook.com ([40.107.78.73] helo=NAM03-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gj7pY-0002Hj-K0 for linux-arm-kernel@lists.infradead.org; Mon, 14 Jan 2019 19:23:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qOprgopWaThs2RZVQAxl3VL9bMTAW5QLsOWAa5YF6qc=; b=JUTnf9794uxAAi/OdtybXkefsQi73qLqFf4wFKECM4+vOyNWvZIGSsas41pcSz9UvXcRox4wgVoVyYqQYLptY0AuDcmw5x+aZFX6jVs09W14z89qHq2IFs1x2agep4jr+A0JSMrxmVKLS9qYlMJw9nuR82WpHnz+F/i2rFSn8TM= Received: from MWHPR0201CA0106.namprd02.prod.outlook.com (2603:10b6:301:75::47) by SN6PR02MB4336.namprd02.prod.outlook.com (2603:10b6:805:a4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1516.18; Mon, 14 Jan 2019 19:23:22 +0000 Received: from CY1NAM02FT039.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::209) by MWHPR0201CA0106.outlook.office365.com (2603:10b6:301:75::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1516.18 via Frontend Transport; Mon, 14 Jan 2019 19:23:22 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT039.mail.protection.outlook.com (10.152.75.140) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1471.13 via Frontend Transport; Mon, 14 Jan 2019 19:23:20 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:60809 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1gj7pP-0000zj-SM; Mon, 14 Jan 2019 11:23:19 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1gj7pK-0006Hg-Ou; Mon, 14 Jan 2019 11:23:14 -0800 Received: from xsj-pvapsmtp01 (xsj-smtp1.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x0EJN6gJ020663; Mon, 14 Jan 2019 11:23:06 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1gj7pB-0006DT-VT; Mon, 14 Jan 2019 11:23:06 -0800 From: Jolly Shah To: , , , , , , , , , Subject: [PATCH v5 1/3] dt-bindings: soc: Add ZynqMP PM bindings Date: Mon, 14 Jan 2019 11:22:56 -0800 Message-ID: <1547493778-22720-2-git-send-email-jollys@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547493778-22720-1-git-send-email-jollys@xilinx.com> References: <1547493778-22720-1-git-send-email-jollys@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(136003)(346002)(376002)(39860400002)(2980300002)(189003)(199004)(186003)(76176011)(2201001)(36756003)(426003)(356004)(6666004)(336012)(9786002)(7696005)(478600001)(51416003)(5660300001)(77096007)(7416002)(107886003)(47776003)(14444005)(486006)(106002)(305945005)(4326008)(106466001)(8676002)(110136005)(2906002)(63266004)(2616005)(54906003)(316002)(50466002)(476003)(44832011)(50226002)(11346002)(72206003)(126002)(16586007)(26005)(81166006)(39060400002)(8936002)(81156014)(36386004)(48376002)(446003)(107986001)(921003)(1121003)(5001870100001)(83996005)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR02MB4336; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; LANG:en; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT039; 1:4JzUapYvOHdTPWY0112udjgqz5F9K8LxN2LtuHKVQZPnztaUw8GGBx+yvEd3zrGa31KP0YAuiB8koBxZIiie7IogEqi26nq7KAbnE5Cj6RdvSQ3jp4NTCviaALrTPnwO MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8235f6e6-86dc-433a-7fe4-08d67a55bf73 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4608076)(4709027)(2017052603328)(7153060); SRVR:SN6PR02MB4336; X-Microsoft-Exchange-Diagnostics: 1; SN6PR02MB4336; 3:XpcU5odkncc0OMxMnGJF3BriVwBs1IrM9uuK4UZqjwh0tQRIf1zcEJZBL2SFtiV/p2TbNC+maD+1pJvVZeeO16knlFoENUbORQehpGhGNfJNbnoOauTn3u7I2IoKcTKo02EcX9xotNhYWy2LvITxZLIDcntQGQneIZmonmrCUfKfNQhCyghOMm356tUVuVitNrQpn/n1PDkPWHNnncEP9Zurk4a3lp2bPVGpLwYaS+a1nV04rJPdGdprVp20gP1hNzbaeCpUvdjBzIKgCt3n22ziL+eJQ/naYRueH4pkf+bxYg2aNB5n4Jqw3RV2hR9IxD+F+D7a1vbaupeKIk66BZriOBoN5dlMMew4E4InIO5wAO9cIPvx+pAtq2tovs58; 25:PR1j3/65nGNRtTKdr4P2HMR+ItWcsLyZJD60U2lzzhEQaUZu2v4ERBp2ONEGCJgDRfUN1FpWlfACk20HQzYsVzZWb78B0AmL17BmEfnDWE4DD70hrEi16UqTzDF1+9ezwMSLKdFeNFMN3XTawGizQMXqy/W9Ke7U0JoJ0QMFNl0DVcTakzKXaQsMKQqbm8zPiy+gicyHk2bVbFiAu9qJ9rmxH2+yS4Xd3ilwaEkHDC8isi/r0eMpBjzZVp50DKHLMw+pq1HwcQfGiP2ZCvc7VFVjSCuIcGIuF2DVdoyB8svBYGmFU/JkfWJvopRiarCBs4Z2c8EcnCyx5cOBXfdtmw== X-MS-TrafficTypeDiagnostic: SN6PR02MB4336: X-Microsoft-Exchange-Diagnostics: 1; SN6PR02MB4336; 31:RQTrpwkoDmu2iTzwAT2Bg9K0bcl/Kz525vs5qqSZAdUk2yCIcCp6d6GXESqnLhp/OGYCK9lPy8AUsxOTKpu+JbvzFPSUjMNaga5c4XVl4n8lthInSZpq5NPFyctyVMzspWv7C1wkaX8hkn4sCohlHGs0xKxzpqh+3MqqX5yXR01P7Mjo32vPrU+BAPfDOLXI2awV2ab8bNvISycLvtBEaohjnMM9Tpq91IpBUij92Yg=; 20:PsRsTztytkoORa1TmFV7KlBJGDZUi32dW0NC/BSb7PdfJ2Adn5tuksPrp49DBvIKGvqr3tSvWifQCKAEqjWQVVY2c/4t+F5uI1T9bAH8W1W5SQ/Ydfw8SCw3n3dimHbiWSdbTT97wZgR0wO3xpC0UMD62aJfKpBC90PhZgQROY2Uasb9t0r7c98o1o224erxAYKVudMWXogePm94vlvQqQjbK+fI24+c1L7rYZg44EyBPscij8onT4KFU7uipxDmEYrEJDY+tsQmBAq7LzJCRGLdTH4T9882Hb6EtpkfktUqRlWZ9jTi2Y3wGNXRDi25UHsD2gKmg8PseSdpg6HsZz20ntbb4Os+2YEmSn5t4lpEzmf7DIWAKBAfZjG7XoQa1Yu1g629yxk4z3OK/dKv33aPI297uCqirru7uHvar38KN7EPbo1hS6je5fkcVJsK2tUGrqQmEKyhwn8zngNc6EHFT6dIspV1Xf5kWceKCQ4O0m2oEQEgJHeHnGaLylrg X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Microsoft-Exchange-Diagnostics: 1; SN6PR02MB4336; 4:bJbjOWd2WxpMwdoiih8oUibfQjo7bALRwO4VayVFr/WGepkB6EaWh7hEXx6Jevhh93ozr5a/ne5zmd6H/VHp+HwbQZn+ioNe/vV2tJmzkkotxaVPGCLLVnRwkqG3ns1Ss4RdSnxC0e0NEhja1RNXd2+mJLCosB0OZ2/hkjUp3JeAoMbbnqWLIjUEvyDXhOcxrGbhzVnY0f3shAQqhy2KknUqdDfN5PlDUgUoMLQ88e4vS1CJ/1qMZ11d3laA/Qp75CFqjMUwKr5A604ZsbMbeON/b5sUI7i5nCtued+Pjj7X8nfiwBU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Na9c5hOhJtGVCpE5B57C0/IAUUOo23YWDY3tn5yo9vuFgHtWXewlWzo+lJZPqMrlXcYercgFAwh0D60oM8vliGBoObPiv5VTZmO934d5ZXDDlcuc7O1+iF5++jeYom05wmNtPs/op7DAIGbfgU8pJRw0mhsTw9LbOBb9m2Kv+iI4G3l2wm/I86ppT0jVIP4Lrr2su6w7mErZ/tT/fWAJk88kzOK98qUviiB2LylCeZ8NcZxnX43lrK0LOkaw==; 5:1F9+07V16fMVbgEJjS0laDzZFH17DVm+1f8rgm8xMT8gOA26fUERX+oX5ToXI/P5j3RauDxWdw7j2kC1gKgFa4b6Sq0ERdw/3E6PmWkKXd3WYQnw70nXEVV302LlMh7llIMmwnJnzU0GT86gJdiBQ3IWfrn2TnHRzu+sFU2bfLAImHnd4p55fITKgyPZjQ1SDwTnohxBnC2nKDnmaQTCog==; 7:AOcJbV9LrSFuzkTm18qD50FaACmoLMOhqmt4yQRD4QO1N+22tqJpg4DY8GYSkBriRIIpKhGjKmaJJrc8gmz0kRSwfYloxyMEOl/G62Nm4jBfXttfsqp1zJ587NQ/6qSh0wIW3jeddIVp2meav+Wd0w== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2019 19:23:20.6079 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8235f6e6-86dc-433a-7fe4-08d67a55bf73 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB4336 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190114_112328_710757_03E20A5B X-CRM114-Status: UNSURE ( 9.09 ) X-CRM114-Notice: Please train this message. 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: devicetree@vger.kernel.org, Rajan Vaja , linux-kernel@vger.kernel.org, Jolly Shah , rajanv@xilinx.com, linux-arm-kernel@lists.infradead.org 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 From: Rajan Vaja Add documentation to describe Xilinx ZynqMP power management bindings. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Reviewed-by: Rob Herring --- .../bindings/power/reset/xlnx,zynqmp-power.txt | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/reset/xlnx,zynqmp-power.txt diff --git a/Documentation/devicetree/bindings/power/reset/xlnx,zynqmp-power.txt b/Documentation/devicetree/bindings/power/reset/xlnx,zynqmp-power.txt new file mode 100644 index 0000000..d366f1e --- /dev/null +++ b/Documentation/devicetree/bindings/power/reset/xlnx,zynqmp-power.txt @@ -0,0 +1,25 @@ +-------------------------------------------------------------------- +Device Tree Bindings for the Xilinx Zynq MPSoC Power Management +-------------------------------------------------------------------- +The zynqmp-power node describes the power management configurations. +It will control remote suspend/shutdown interfaces. + +Required properties: + - compatible: Must contain: "xlnx,zynqmp-power" + - interrupts: Interrupt specifier + +------- +Example +------- + +firmware { + zynqmp_firmware: zynqmp-firmware { + compatible = "xlnx,zynqmp-firmware"; + method = "smc"; + + zynqmp_power: zynqmp-power { + compatible = "xlnx,zynqmp-power"; + interrupts = <0 35 4>; + }; + }; +}; From patchwork Mon Jan 14 19:22:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 10763331 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 B194D13B5 for ; Mon, 14 Jan 2019 19:24:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A17E3286CC for ; Mon, 14 Jan 2019 19:24:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 932CC2877E; Mon, 14 Jan 2019 19:24: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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 5D50C29E7A for ; Mon, 14 Jan 2019 19:24:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2VY/N04Fw6qxfKdtyqEkOrwxxL8z49P9DGs1ww+FMb0=; b=fQDRJocQoGYpZ6 SM3Qdz7Bo0Q7d7algzU3GWa6mwosL0lm4mg7/LOnId/ip7YizyyMceI+pYfRIi5FqfCbXGZL3wzTT NZlzikMs2G1LsIHMghvVASjyVg3UlUPOQvY92JAily0UHU6x3wuN5NDFx8pdCJPKAYVxSltRAxHvy qbyU2ddqd9AZ8+suu4uynn266Qw88mleVy1uBoo5b5BEETfJaNig0S4gf3UKW6wUeExYQctbLDyqU SNTIb9prLEdDg7WYA2FijuFaROG3L+dQBV5VM1Mz2P/xgfLw6AdSP4ibpERgU99p5AtjaQ6ukKBdb WpCjgtCj8BGF6rWN0Ffw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gj7qQ-0003GO-QS; Mon, 14 Jan 2019 19:24:22 +0000 Received: from mail-eopbgr700060.outbound.protection.outlook.com ([40.107.70.60] helo=NAM04-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gj7pZ-0002Hr-Ia for linux-arm-kernel@lists.infradead.org; Mon, 14 Jan 2019 19:23:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JrJg8WuU4Q5FHv+Mu37FlEw6dlRWX2QSWzPFzlLmDbs=; b=5U3BVuAMZPpFyFSr/4cpovZrbZ5Ev0p6HaXvQfOVIe6WlYomnyhPr1i07xFhDGCAbNhglPsRiLBaeX+ww4tTsyf7lOTw/TyiMgXNWl5fi//kirUF7ZKV6ci+CDbggLexwgjk63ucM+OVoD1K4OnseNpeuQlKJXvMGjM7fkHuSx8= Received: from MWHPR02CA0046.namprd02.prod.outlook.com (2603:10b6:301:60::35) by DM5PR0201MB3509.namprd02.prod.outlook.com (2603:10b6:4:76::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1516.18; Mon, 14 Jan 2019 19:23:25 +0000 Received: from CY1NAM02FT019.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::203) by MWHPR02CA0046.outlook.office365.com (2603:10b6:301:60::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1516.18 via Frontend Transport; Mon, 14 Jan 2019 19:23:25 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT019.mail.protection.outlook.com (10.152.75.177) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1471.13 via Frontend Transport; Mon, 14 Jan 2019 19:23:20 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1gj7pP-0001l3-Tp; Mon, 14 Jan 2019 11:23:19 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1gj7pK-0006Hg-QT; Mon, 14 Jan 2019 11:23:14 -0800 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x0EJN6Z4023263; Mon, 14 Jan 2019 11:23:06 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1gj7pC-0006DT-1b; Mon, 14 Jan 2019 11:23:06 -0800 From: Jolly Shah To: , , , , , , , , , Subject: [PATCH v5 2/3] firmware: xilinx: Implement ZynqMP power management APIs Date: Mon, 14 Jan 2019 11:22:57 -0800 Message-ID: <1547493778-22720-3-git-send-email-jollys@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547493778-22720-1-git-send-email-jollys@xilinx.com> References: <1547493778-22720-1-git-send-email-jollys@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(39860400002)(136003)(396003)(346002)(2980300002)(199004)(189003)(478600001)(126002)(7696005)(486006)(36756003)(72206003)(305945005)(9786002)(11346002)(426003)(446003)(48376002)(8676002)(26005)(77096007)(356004)(2201001)(6666004)(186003)(476003)(2616005)(54906003)(51416003)(16586007)(110136005)(316002)(76176011)(44832011)(106002)(50466002)(5660300001)(47776003)(50226002)(14444005)(7416002)(106466001)(81156014)(2906002)(81166006)(4326008)(336012)(107886003)(63266004)(36386004)(39060400002)(8936002)(921003)(107986001)(1121003)(2101003)(83996005); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR0201MB3509; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT019; 1:zkkRvIH0v7L6NjIrcR5bfJ/NCaWxc1pnsd3m1HzHypPcfNRaYQem4Ui6I8nA3MsEFwkkAnz46Bs9jyI7frDG3VPghx3BwHOiyrMOo8CdZOTQTxf2z3KsOxaTFnW82LHw MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f1888bd5-43e3-4157-dc64-08d67a55c127 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4608076)(4709027)(2017052603328)(7153060); SRVR:DM5PR0201MB3509; X-Microsoft-Exchange-Diagnostics: 1; DM5PR0201MB3509; 3:76oyFUONiBgF3e+hlXeiYwkJYQGxsGvmJatm7RdlWxS7QNDybr2C1UjVLdTF1LO+phKJfr0u4SWo2rgELj1H/6hC3HEJ2ZejmCkDZ7GO+JfLazXrmXJSi5PEjeyvQeyMVDba2sEGd/NdD0BLfw6xtwE8guPUH+WAXXtbJ4Ibdin2aO97rTRuRnq+R9EOaK/dQoe6JwCguywIiMsKTZblV0cCUBKyNVu8YAonEK2FF7kaLMbs5X8MBBh0AgAAVUsT31ivHwZhK10dwHseCdQbNekNbfxZgkKOnLeiv73iEe/uXUFOAuRQ5Rc//Nmu1M7hjv5Y/JJaiQMIuW/cekmgVNwVw1tvkzK3EQoqeyaCaZY3za9NkRJE63Rv5y1Uy9FZ; 25:hD0Oj2RkJA4DKahBIPg2TecGXM9QnseUrKIBSbT1poowKPiEft46X6lYMWZzl8ra1dp6+iHtdUeBqdBusGejdBawR8mLHVy5voeOGaMH5Mwo5LZE2udNIzki6Ti/hEWM1aC4QjYIbgExEOQfxyD5kGAXVq0tNdinCfwxtgzNL5xZ4N/ZCYARZ5/w+jXEOwpZq1AZSywH32nZT37VLBYGwNeAWhb4lLBoVL4j7RGyXXslfnvow8Ri+JR7X8JQIuWS9YPYtoD0anvSOLVwV+n/8rfgtQ4J313Fc9J866oDaloOq3sds48SiXQiAzBii/g3AS7C8vT91+IA7xxYZ2XHJg== X-MS-TrafficTypeDiagnostic: DM5PR0201MB3509: X-Microsoft-Exchange-Diagnostics: 1; DM5PR0201MB3509; 31:VU9NvErFOGagtw2ME5rvpcP3ahLLUUAmVXSO3R+k0R4CTX61hhNSQ8JtgAQHVlzdbsuiznrlheP+7wtcJB0FzsEiBpLeYpYIoq06uCdALEcRIN/30/uUKVvHgWaoaiZd6oZeQM50bL4j6CvTu+cE4IDyxx61QJuDT8wzVrb2yH+r1d89PVoGddIHuBt5LKSk7p4/xEZ0Tr4qBQvGGpHme+6i/7uTXj1K0EeYi6dW46I=; 20:8P0JFFvWEqBW1iXEIu6R8wLb7zABrKFHSTvzZiltG3XXIBhCtx+rOgdn5mCsF7eoBKBuhRlf6D0kXuiWSK1mniT5bvC8UC3DMUz/uLp0RoIMrYBiP9dvnC2u45l1OY0InEyq1xufLYPfDml1r2WGTxmjnxdb/aAx2PE5+alZYWlqa9JZl/XFUxZLXdg57tTzEeJazNZeNIwQO0scE8gItyFfgMKBqiaV8S/+D7T0TV7YgbZYWRw2T97J37lEjY2AiIwqt7foSiyp+5MpK/5kRb5SMluDucNYBxlz827954FWdstD/9VAnIWT2yj3m1qWMDHCtDG1FBdXtaaZIu+zGf//pNPD4jUHlXnDn1Z/mXJVZ0ErlvZzNdexmQZtLYq/yCiqm1s7xt5u+cGEbMkpNkzIUPlwSIukLOSm4JYYF1S2CkScLUfwHTDDFj9ee3Z8jadTTu6V5yK8OT3Q0ndw2FeObVBZkn5mnB84jUtGsej/M6UyUDB4i2h1JXVRETun X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Microsoft-Exchange-Diagnostics: 1; DM5PR0201MB3509; 4:CdlABoTq92ZdBEDlcOitoE9qqsB5PXDgPggL9MdDjrCdoaCfl1gPLqW+aAbxxSC5xDLYr/i8ophjM06D3fnnWat2YSaArAETHkfoA1Humx56c4WUFtO/scm1C7y54uPJRyPHopl06PryaZrwvNV9C8XXdOyegD93gyIHzxtKX8auB6lkPekFXNRM4aNxzfjclkUvj5OJZjU9owiw8iq1gX2Iv3N8QhN+BI9XI8vEWkI+OBpJVp58e5etNBJEaw2ysJhzc4dROpHypL+59ih7d0eA6/oh7e56pwZyuxJo7qHZTPt7bIhUxxFOJfi9+L3a X-Forefront-PRVS: 0917DFAC67 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR0201MB3509; 23:QUQG16IJBdsiL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6C/WekqHV/XA08K/w2yKwn01T/H5AtsVuoeypobfRQsj5D78fiVVQW/N8Uz1wR9q5OTdv8zNapPgXN3sz95yP90hmnH8jGU1oB/aiJrLLC/3A==; 5:1NUimQAzdjSdr2bXOkFXT0YHfW2O2jvcPdPb5AdvHPWhgjkG1WB1ApIvc1rkQISv0dkHkVhUhH3u/hSQ90sKtqNJK4mFcrgMt1EL5cP4CjvjTtWeU1Vrew/pGuBfST4rHUOz9S9A5OeG7GK6Pc6cTB1HLppLZPIj8+CplE6YYaMSTVMctIv0JU5a7gEJ9Rhsuskx5l54XMcywO9RBME4XQ==; 7:AJpB1CXpHv3N1iC0vmlOSyuZgcsNQDXmaAXAcXJdPGxd4nYqWqi5id0Oxvf7XaZ+H3Tidx+tW7dNjPIE+Vu42prDp8N1Zqk0MBwXLjBnfQLFmCDMXVmAaKzB2DGXsz7tl+ne7ZwTjiy2XvaLQjgKAQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2019 19:23:20.6395 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f1888bd5-43e3-4157-dc64-08d67a55c127 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR0201MB3509 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190114_112329_611898_8EC55ED0 X-CRM114-Status: GOOD ( 11.25 ) 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: devicetree@vger.kernel.org, Rajan Vaja , linux-kernel@vger.kernel.org, Jolly Shah , rajanv@xilinx.com, linux-arm-kernel@lists.infradead.org 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 From: Rajan Vaja Add Xilinx ZynqMP firmware APIs to set suspend mode and inform firmware that master has initialized its own power management. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/zynqmp.c | 29 +++++++++++++++++++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 20 ++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 84b3fd2..c7a3b6c 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -428,6 +428,33 @@ static int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id) return ret; } +/** + * zynqmp_pm_init_finalize() - PM call to inform firmware that the caller + * master has initialized its own power management + * + * This API function is to be used for notify the power management controller + * about the completed power management initialization. + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_init_finalize(void) +{ + return zynqmp_pm_invoke_fn(PM_PM_INIT_FINALIZE, 0, 0, 0, 0, NULL); +} + +/** + * zynqmp_pm_set_suspend_mode() - Set system suspend mode + * @mode: Mode to set for system suspend + * + * This API function is used to set mode of system suspend. + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_set_suspend_mode(u32 mode) +{ + return zynqmp_pm_invoke_fn(PM_SET_SUSPEND_MODE, mode, 0, 0, 0, NULL); +} + static const struct zynqmp_eemi_ops eemi_ops = { .get_api_version = zynqmp_pm_get_api_version, .query_data = zynqmp_pm_query_data, @@ -440,6 +467,8 @@ static const struct zynqmp_eemi_ops eemi_ops = { .clock_getrate = zynqmp_pm_clock_getrate, .clock_setparent = zynqmp_pm_clock_setparent, .clock_getparent = zynqmp_pm_clock_getparent, + .init_finalize = zynqmp_pm_init_finalize, + .set_suspend_mode = zynqmp_pm_set_suspend_mode, }; /** diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 015e130..1424170 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -28,12 +28,21 @@ /* SMC SIP service Call Function Identifier Prefix */ #define PM_SIP_SVC 0xC2000000 #define PM_GET_TRUSTZONE_VERSION 0xa03 +#define PM_SET_SUSPEND_MODE 0xa02 +#define GET_CALLBACK_DATA 0xa01 /* Number of 32bits values in payload */ #define PAYLOAD_ARG_CNT 4U +/* Number of arguments for a callback */ +#define CB_ARG_CNT 4 + +/* Payload size (consists of callback API ID + arguments) */ +#define CB_PAYLOAD_SIZE (CB_ARG_CNT + 1) + enum pm_api_id { PM_GET_API_VERSION = 1, + PM_PM_INIT_FINALIZE = 21, PM_QUERY_DATA = 35, PM_CLOCK_ENABLE, PM_CLOCK_DISABLE, @@ -73,6 +82,12 @@ enum pm_query_id { PM_QID_CLOCK_GET_ATTRIBUTES, }; +enum zynqmp_pm_suspend_reason { + SUSPEND_POWER_REQUEST = 201, + SUSPEND_ALERT, + SUSPEND_SYSTEM_SHUTDOWN, +}; + /** * struct zynqmp_pm_query_data - PM query data * @qid: query ID @@ -99,8 +114,13 @@ struct zynqmp_eemi_ops { int (*clock_getrate)(u32 clock_id, u64 *rate); int (*clock_setparent)(u32 clock_id, u32 parent_id); int (*clock_getparent)(u32 clock_id, u32 *parent_id); + int (*init_finalize)(void); + int (*set_suspend_mode)(u32 mode); }; +int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, + u32 arg2, u32 arg3, u32 *ret_payload); + #if IS_REACHABLE(CONFIG_ARCH_ZYNQMP) const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void); #else From patchwork Mon Jan 14 19:22:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 10763327 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 0739E746 for ; Mon, 14 Jan 2019 19:24:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E91E929DDD for ; Mon, 14 Jan 2019 19:24:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E25AE29E27; Mon, 14 Jan 2019 19:24:10 +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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 0F5832974C for ; Mon, 14 Jan 2019 19:24:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rTa/yeH4nYpzNxGfXejfVXP9eeBbExPIkcfDdqRbGfc=; b=isoppNKlMG7ris ahayEJEwBwao72+8UhdNhAWkrTORaYtwb4kjBzMtNknTaYnrqUleXD1hKVzld+dsTSVjg2uzTr1qC zh59wE+7fd9Ml9hyA59xwqoInVh5Vxg30LaEz1/2AKbcdzdIRzZp4jcYAyD78fhwvN+LQu53tSodE gLBz45qa2QOktEPkeG6vOE37VsyOSQgSdNBfnjrqrZdN/rKDkyULNbYvLL/dZl7W6fK16Atxuc0/k jedzpwnYj4ZRXDwDZjJh0CPjdd6l5tpU2IZEspfu3IC0KsOzMImCzsvOEuOwe7lLD8a3tyianiems ZeA261fz9yaG4TTP0DOQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gj7q8-0002uH-Sy; Mon, 14 Jan 2019 19:24:04 +0000 Received: from mail-eopbgr810047.outbound.protection.outlook.com ([40.107.81.47] helo=NAM01-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gj7pY-0002Hp-Kx for linux-arm-kernel@lists.infradead.org; Mon, 14 Jan 2019 19:23:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2rRCt/Fp2LLqjvnno6HZDN4J5l5gTptrmTa7RJuTUAg=; b=luuS+VoOQhC+/ZxluQJB3R/iL1AS/n04bsA5hWbn8FvZnTRLR7otikNJIsqrTUhPJC2KItyCFyZQyhD5C0CrCdPlhlyWrI3XpjbE0Z9JBLi07vcw0QXReD9vrSR2WarjGXdkAqwS3UP255du4i+bB00QfIgMWyeW+b6lZYlXbCc= Received: from BL0PR02CA0028.namprd02.prod.outlook.com (2603:10b6:207:3c::41) by DM5PR0201MB3510.namprd02.prod.outlook.com (2603:10b6:4:77::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1516.19; Mon, 14 Jan 2019 19:23:25 +0000 Received: from SN1NAM02FT034.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::206) by BL0PR02CA0028.outlook.office365.com (2603:10b6:207:3c::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1516.15 via Frontend Transport; Mon, 14 Jan 2019 19:23:25 +0000 Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT034.mail.protection.outlook.com (10.152.72.141) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1471.13 via Frontend Transport; Mon, 14 Jan 2019 19:23:20 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1gj7pP-0001l4-VP; Mon, 14 Jan 2019 11:23:19 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1gj7pK-0006Hg-Rz; Mon, 14 Jan 2019 11:23:14 -0800 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x0EJN6Sd023265; Mon, 14 Jan 2019 11:23:06 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1gj7pC-0006DT-4A; Mon, 14 Jan 2019 11:23:06 -0800 From: Jolly Shah To: , , , , , , , , , Subject: [PATCH v5 3/3] drivers: soc: xilinx: Add ZynqMP PM driver Date: Mon, 14 Jan 2019 11:22:58 -0800 Message-ID: <1547493778-22720-4-git-send-email-jollys@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547493778-22720-1-git-send-email-jollys@xilinx.com> References: <1547493778-22720-1-git-send-email-jollys@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(39860400002)(136003)(376002)(396003)(2980300002)(189003)(199004)(39060400002)(54906003)(16586007)(8676002)(4326008)(110136005)(48376002)(50466002)(107886003)(44832011)(8936002)(50226002)(316002)(106466001)(2906002)(36756003)(106002)(7416002)(63266004)(305945005)(81166006)(81156014)(9786002)(5660300001)(486006)(478600001)(72206003)(47776003)(2201001)(6666004)(356004)(575784001)(76176011)(11346002)(426003)(6346003)(7696005)(446003)(51416003)(36386004)(186003)(476003)(126002)(2616005)(77096007)(26005)(336012)(14444005)(107986001)(921003)(2101003)(83996005)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR0201MB3510; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT034; 1:zaSwk3BsIqcatVJsl1IGtsh10CnsK5o0fME/ZAAoIkfE0JBhdPgG1EP7ElPYCa3vw1GSEeXH9wgdwM0/aIL2aFS8mJ4r6R65QLNpsAgweCYueMB24BtAZ1V4Fx3pS90c MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eee247e9-a99d-4bc0-8576-08d67a55c138 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4608076)(4709027)(2017052603328)(7153060); SRVR:DM5PR0201MB3510; X-Microsoft-Exchange-Diagnostics: 1; DM5PR0201MB3510; 3:cb3Y/luvyis5FFe+N9CLSvQR0fNRhVDN7wfiMkjZo8MU9IIo5DchR3qypbVcHFzI7TpAoTSxTWBMYrBzWextm5CYLQf1NOIL+o0fe0T/vv1AuEEhZH2sD3v6r0vAYHOxGsKVmuqgeoYiAkW7RIB8T8H07Jx5DH6MEhunAg/qyLqfyxk/kouc6QpbijCRjtFktbTPTfdKr3Lg0EovT78nZejXX7qPXgLs8Ek+4coGk/DSavjkLkggdsU1AC3HgfFu/zHBjLJmc/673I41Wq37O4pkqCNuNVh0YXpr58tP1zYUd2dDM2USskoMMTA7bfv7HXvV9m8/CDVuEUD6dfSsgSXD8MxM+GZbHBXjYSMi7KBCT7dAykL3al4uV52FSs00; 25:QJSpQCQ+xcZXY7lnzABFutyawObRPvVfUPc4z0i4arr4jKLT64KxPqUmM3gGabBI7Khnn5lme7UX39OA15AaUIeO5otUi6KNv2HTbrsLjysD4oV5MNe8t7kSY3SR3gnbk00OFaFCojxYl6j6nhfW2CW2l751TQr7oJRu7piFtnQ0EKjnz53dykmp9dHmpzckAet715gmoGutkEG7SVS8pWqH3kRMAShVEjpodUOuEudrNXCDXYv2c0Q6foEhG1QlV0ftSdC+mYgao5Hws/1uu0ADCx1jyJKBgNuS4gsiKbRnIww4hP3a7XPxlYx2eN5jismr9i9FSb5/WT4GEK2vRQ== X-MS-TrafficTypeDiagnostic: DM5PR0201MB3510: X-Microsoft-Exchange-Diagnostics: 1; DM5PR0201MB3510; 31:7mweFguGok38ZO7v/13n50j9PyZmCq+MVFQwFQHnc9oopCvZZCUCDlQuPaMgp7les+xTsdoSlrBGDgwb8CpE8owCgfuP2LXABP5YHruWFh3Kd8V/IkZNf6R6WF/C0QWJ4wjtHoaozkSjpq9tH5ZEUyJqsKwpmMNnDTv2znkxrYiCwyqrRZGgvNMuzkmewxauuLLoZm5BqfbTXxn3pU8mEQE1ErpZH74y2om32X1qyxQ=; 20:8CL5yzRDqy7FIpYN2glS4Hp3iyXjOM2O7DLgvj8hay8ds4ETGb0h/YduBG9U2h4Ho86uvDtzCMkr+PDKNy+n+9A8DUqpkR+qHDrFoze1hVDYH6MLv3kP4fSiVGcHmc5QPcitnGw7fGft9Q05dEPhdFsjxHlQLkEs2khhk1iy34QZAU3s6936LxlPwz6Qipk/rlBgqz0SeEeBSoeFBdhnpqgD3RGcDtmuqH4im3wptYEjE7JKKEtlo9SFD/xr+KFdH1yvxAy75bLPrHH46POAz8EZYteq2skkXiG16OakfjrM6YVfIjwjOfMEL2FAAVA0rjnajDfzraETq83yGDjPaBZzQn3UjEceiif0l54oePeGgnCIO3IIlxptD6IzO+mQDiJFSrT6gv+da1kJpSpuB37agjgV3/01lDvyfIeoxofM8sNPZHBAgHdBj/xQnKhxtX1kyY8/SgtwgIozwjP9QdqUHsOCB2bUizmQsvrRBKOSSyFI9bC43Qhpheq08ulH X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Microsoft-Exchange-Diagnostics: 1; DM5PR0201MB3510; 4:ukqDglr7MVDKQkv+CqH3zleZBF+Tb3w8F705hBH1oygL0Kxd3RhKhTELkR1FiVcbkkkQQLc7LqAqYzmiRjd5ALUaQa2m/03ezYxU2q/HdF8+BiQHI/m9xyGbsQInaZELWJRKccE4Pt/5kUO1JbrNIHCP+8RjJ+7PuYM4BG9KBt7rJcYNc/3iWsyNKL9NkpDpP74qxdE34AnBoibA5zaRjDWhLM88IrhXcexfOMhB11f5p/lKgMZnH34m4pTF1kltal5oiSRXSY54ty0Vq6cmT4A3iweOtgKwh/djmv+7rAzTBbMHGgRRbM97R6nRw0fc X-Forefront-PRVS: 0917DFAC67 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR0201MB3510; 23:uNW5GEaObPIrKdfY2hQ4DwVrE5WA1UGapjgVt9H?= fgydGmzZLei66FBWGsk4GjKRKtmcbz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pXKT9woMyv9+bREVuYKnpp1l62ZsQvDf2vk8M0a4TLE2PAkOEHrpPeuwyYwxmAJRUVLx1ESdOj0txZIU/fAkfI0D+t0NTwI7HBt0GDRWNJlvxRVJU1N7VC40ZKnQ==; 5:yMaMQWzk8mCy/JhsBwoM6z1dM5K6PrVlOQjjMD318QWYMrmAEs/rNLfN2bSv8JP9ABvmP0VXGpla2znVFMAUL0ngE0BK78RpuiLWxLxPThs8sJMaQ0H1p+tjSRQxvgbo+We2j8ScwXfEMaGWlKEO7DimwV5Ml8fvv9pizXBSH5nO3zTACORUSXkvuXnYUnhFpOhUnqMS6LZb5xMOtyWhOQ==; 7:FGEU2rbcnFrpsCHiuZ8fM1eCqgQq3JOHmpRQ2NEehSFRHATjGeMR5a1455m8qx3KtS99FJc14mxrP2ZwC7d+A6fnfa6uAh9jFaJxSckMc0sdO4gJ2ZezPHSJKi14J6LO3z20dCMX+XiSY71hT2coiw== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2019 19:23:20.7019 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eee247e9-a99d-4bc0-8576-08d67a55c138 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR0201MB3510 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190114_112328_735415_49723369 X-CRM114-Status: GOOD ( 15.85 ) 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: devicetree@vger.kernel.org, Rajan Vaja , linux-kernel@vger.kernel.org, Jolly Shah , rajanv@xilinx.com, linux-arm-kernel@lists.infradead.org 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 From: Rajan Vaja Add ZynqMP PM driver. PM driver provides power management support for ZynqMP. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/soc/xilinx/Kconfig | 11 +++ drivers/soc/xilinx/Makefile | 1 + drivers/soc/xilinx/zynqmp_power.c | 178 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 190 insertions(+) create mode 100644 drivers/soc/xilinx/zynqmp_power.c diff --git a/drivers/soc/xilinx/Kconfig b/drivers/soc/xilinx/Kconfig index 687c8f3..5025e0e 100644 --- a/drivers/soc/xilinx/Kconfig +++ b/drivers/soc/xilinx/Kconfig @@ -17,4 +17,15 @@ config XILINX_VCU To compile this driver as a module, choose M here: the module will be called xlnx_vcu. +config ZYNQMP_POWER + bool "Enable Xilinx Zynq MPSoC Power Management driver" + depends on PM && ARCH_ZYNQMP + default y + help + Say yes to enable power management support for ZyqnMP SoC. + This driver uses firmware driver as an interface for power + management request to firmware. It registers isr to handle + power management callbacks from firmware. + If in doubt, say N. + endmenu diff --git a/drivers/soc/xilinx/Makefile b/drivers/soc/xilinx/Makefile index dee8fd5..428b9db 100644 --- a/drivers/soc/xilinx/Makefile +++ b/drivers/soc/xilinx/Makefile @@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_XILINX_VCU) += xlnx_vcu.o +obj-$(CONFIG_ZYNQMP_POWER) += zynqmp_power.o diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_power.c new file mode 100644 index 0000000..771cb59 --- /dev/null +++ b/drivers/soc/xilinx/zynqmp_power.c @@ -0,0 +1,178 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Xilinx Zynq MPSoC Power Management + * + * Copyright (C) 2014-2018 Xilinx, Inc. + * + * Davorin Mista + * Jolly Shah + * Rajan Vaja + */ + +#include +#include +#include +#include +#include + +#include + +enum pm_suspend_mode { + PM_SUSPEND_MODE_FIRST = 0, + PM_SUSPEND_MODE_STD = PM_SUSPEND_MODE_FIRST, + PM_SUSPEND_MODE_POWER_OFF, +}; + +#define PM_SUSPEND_MODE_FIRST PM_SUSPEND_MODE_STD + +static const char *const suspend_modes[] = { + [PM_SUSPEND_MODE_STD] = "standard", + [PM_SUSPEND_MODE_POWER_OFF] = "power-off", +}; + +static enum pm_suspend_mode suspend_mode = PM_SUSPEND_MODE_STD; + +enum pm_api_cb_id { + PM_INIT_SUSPEND_CB = 30, + PM_ACKNOWLEDGE_CB, + PM_NOTIFY_CB, +}; + +static void zynqmp_pm_get_callback_data(u32 *buf) +{ + zynqmp_pm_invoke_fn(GET_CALLBACK_DATA, 0, 0, 0, 0, buf); +} + +static irqreturn_t zynqmp_pm_isr(int irq, void *data) +{ + u32 payload[CB_PAYLOAD_SIZE]; + + zynqmp_pm_get_callback_data(payload); + + /* First element is callback API ID, others are callback arguments */ + if (payload[0] == PM_INIT_SUSPEND_CB) { + switch (payload[1]) { + case SUSPEND_SYSTEM_SHUTDOWN: + orderly_poweroff(true); + break; + case SUSPEND_POWER_REQUEST: + pm_suspend(PM_SUSPEND_MEM); + break; + default: + pr_err("%s Unsupported InitSuspendCb reason " + "code %d\n", __func__, payload[1]); + } + } + + return IRQ_HANDLED; +} + +static ssize_t suspend_mode_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + char *s = buf; + int md; + + for (md = PM_SUSPEND_MODE_FIRST; md < ARRAY_SIZE(suspend_modes); md++) + if (suspend_modes[md]) { + if (md == suspend_mode) + s += sprintf(s, "[%s] ", suspend_modes[md]); + else + s += sprintf(s, "%s ", suspend_modes[md]); + } + + /* Convert last space to newline */ + if (s != buf) + *(s - 1) = '\n'; + return (s - buf); +} + +static ssize_t suspend_mode_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + int md, ret = -EINVAL; + const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); + + if (!eemi_ops || !eemi_ops->set_suspend_mode) + return ret; + + for (md = PM_SUSPEND_MODE_FIRST; md < ARRAY_SIZE(suspend_modes); md++) + if (suspend_modes[md] && + sysfs_streq(suspend_modes[md], buf)) { + ret = 0; + break; + } + + if (!ret && md != suspend_mode) { + ret = eemi_ops->set_suspend_mode(md); + if (likely(!ret)) + suspend_mode = md; + } + + return ret ? ret : count; +} + +static DEVICE_ATTR_RW(suspend_mode); + +static int zynqmp_pm_probe(struct platform_device *pdev) +{ + int ret, irq; + u32 pm_api_version; + + const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); + + if (!eemi_ops || !eemi_ops->get_api_version || !eemi_ops->init_finalize) + return -ENXIO; + + eemi_ops->init_finalize(); + eemi_ops->get_api_version(&pm_api_version); + + /* Check PM API version number */ + if (pm_api_version < ZYNQMP_PM_VERSION) + return -ENODEV; + + irq = platform_get_irq(pdev, 0); + if (irq <= 0) + return -ENXIO; + + ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, zynqmp_pm_isr, + IRQF_NO_SUSPEND | IRQF_ONESHOT, + dev_name(&pdev->dev), &pdev->dev); + if (ret) { + dev_err(&pdev->dev, "devm_request_threaded_irq '%d' failed " + "with %d\n", irq, ret); + return ret; + } + + ret = sysfs_create_file(&pdev->dev.kobj, &dev_attr_suspend_mode.attr); + if (ret) { + dev_err(&pdev->dev, "unable to create sysfs interface\n"); + return ret; + } + + return 0; +} + +static int zynqmp_pm_remove(struct platform_device *pdev) +{ + sysfs_remove_file(&pdev->dev.kobj, &dev_attr_suspend_mode.attr); + + return 0; +} + +static const struct of_device_id pm_of_match[] = { + { .compatible = "xlnx,zynqmp-power", }, + { /* end of table */ }, +}; +MODULE_DEVICE_TABLE(of, pm_of_match); + +static struct platform_driver zynqmp_pm_platform_driver = { + .probe = zynqmp_pm_probe, + .remove = zynqmp_pm_remove, + .driver = { + .name = "zynqmp_power", + .of_match_table = pm_of_match, + }, +}; +module_platform_driver(zynqmp_pm_platform_driver);