From patchwork Fri Feb 1 22:08:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 10793801 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 5C224922 for ; Fri, 1 Feb 2019 22:09:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B7E232E9E for ; Fri, 1 Feb 2019 22:09:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E91D32F11; Fri, 1 Feb 2019 22:09:25 +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 B08A132E9E for ; Fri, 1 Feb 2019 22:09:24 +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=A5GoOG3HZY+OAGB0NEMBZb8dBc8y+KN0e25IodRFKLU=; b=tKrLqBB+f1ou8f Ab8NzaQ4JQ8IKGf+WiHsWzpHFPxFwUcdVWxJXUNWiVW2j+Mzy3Fto8sVBE2ExKK+n+ZA4NIsFS6eS UOwZBGFni4sjYWSrKLbspvZKTymWcONCI1347Jq+UayMehGrFPQJQRTwTx0ynFB8BY2OOoDHhkSKy kQCZFjceymDBh5PmgK6fZyopFaRQzbs+dnCE0TQFnvQcH2nBmQ5FlT6MtP+fqtG47hdzcxtfz1X++ 6x7aASWRIrJZmv3NzX32oDsJfLFAPb9w51YvGNRf++SBOLaDqvtjVpja+QWLJ4fGkJLGf0pLIh5Da CmPikwHVFweabjhQuSTA==; 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 1gpgzx-0000z5-6q; Fri, 01 Feb 2019 22:09:21 +0000 Received: from mail-eopbgr760057.outbound.protection.outlook.com ([40.107.76.57] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gpgzu-0000xi-HA for linux-arm-kernel@lists.infradead.org; Fri, 01 Feb 2019 22:09:20 +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=CAlFs8vIEjre3QL4wQyH0AonXzbUYX77T+xn1Em08g0=; b=PMVsx7LtDtsCtQNTFMXRLMxw0Lv/gRWT3NX2OTh90Gm0VcFrSA3RzlYSHZhEbIK0155yMPe0Zj1q1X1dfVgAVkg5gBGGlkOA/mcFIyiFhkFXt/NzULyGbGLMa0W4v1nU1RlH9ULsLXn91FhyTfON4oflk9BltkZb7tXk5LXQMfQ= Received: from MWHPR0201CA0054.namprd02.prod.outlook.com (2603:10b6:301:73::31) by SN6PR02MB5023.namprd02.prod.outlook.com (2603:10b6:805:67::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.17; Fri, 1 Feb 2019 22:09:15 +0000 Received: from SN1NAM02FT035.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::200) by MWHPR0201CA0054.outlook.office365.com (2603:10b6:301:73::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1580.17 via Frontend Transport; Fri, 1 Feb 2019 22:09:15 +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 SN1NAM02FT035.mail.protection.outlook.com (10.152.72.145) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.10 via Frontend Transport; Fri, 1 Feb 2019 22:09:14 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:40513 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1gpgzq-0005vs-5s; Fri, 01 Feb 2019 14:09:14 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1gpgzl-0000P8-2R; Fri, 01 Feb 2019 14:09:09 -0800 Received: from xsj-pvapsmtp01 (mailhost.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x11M8wXt027119; Fri, 1 Feb 2019 14:08:58 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1gpgza-0000LK-KG; Fri, 01 Feb 2019 14:08:58 -0800 From: Jolly Shah To: , , , , , , , , , Subject: [PATCH v4 1/3] dt-bindings: power: Add ZynqMP power domain bindings Date: Fri, 1 Feb 2019 14:08:48 -0800 Message-ID: <1549058930-18644-2-git-send-email-jollys@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1549058930-18644-1-git-send-email-jollys@xilinx.com> References: <1549058930-18644-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)(376002)(396003)(39850400004)(346002)(136003)(2980300002)(189003)(199004)(486006)(81156014)(9786002)(11346002)(2906002)(54906003)(72206003)(478600001)(106002)(7416002)(36386004)(50226002)(39060400002)(44832011)(8676002)(81166006)(51416003)(8936002)(476003)(76176011)(107886003)(7696005)(77096007)(126002)(186003)(106466001)(26005)(2616005)(2201001)(36756003)(63266004)(6666004)(336012)(356004)(16586007)(110136005)(426003)(4326008)(446003)(47776003)(50466002)(48376002)(316002)(305945005)(921003)(107986001)(5001870100001)(1121003)(2101003)(83996005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR02MB5023; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT035; 1:EGSmQpUD9ZU6YZkkhb4bVTvHY+zCTf3lyZDUVasyYK9XOfo1SXpPfiCG9hyGJ5I13WLtdIeTDGc5iQDKCQ4ebeI1aC3XUXPTTr7lK0R09KtdNPLvopd+3u6j1lEQJp4iRxgLjOUuL42sDm50P3SZbUdgyfk+JDNp//HLN6TLtzs= MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 19dc6251-8b19-4530-f53f-08d68891e74b X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4608076)(4709027)(2017052603328)(7153060); SRVR:SN6PR02MB5023; X-Microsoft-Exchange-Diagnostics: 1; SN6PR02MB5023; 3:pem+Cdw7zSd4DSvpBksr1dEDwTzINUO8wH36OPOOHe4vfUn19EGVCzOMrzzxDw6ie0TeWt+kl3xQIKjD2f9Ci1QJCCsNbnRVMPve8JogAisa0tWVEgTSLZ/O8MnQRYiJcPCD2nI+kppuhbfU49Iq71/tyNSCqP7QjW9p6l2x+9UdVYYjKFOmCaep0U/4IrlMedIPH0mT8f95jBBMDuIf4QtHPWc/svfxZfGC50t2E5gL4O9JTY5TlioKF15j+7e1mrHhS3LGTvFuhTYR5jfB75U1rulRXW2sZ1TZJbyG21/jXWDFfO//3t7sFSUwSsHyVziTCS2nzinqOM4ew6RTEKqWqg2XEmtrcIpabupVISXmIiLQlrH6vikWjtLZH/M5; 25:r6deKfqV73RTeewa+HlhOEq50u9QuTbYSE60/M4EfK9Pd3oW2FJA1WNz02M+NKVvhj8BPXqf3H5taRo4WfDiXEDMnk8x05hzJFdtyDjmQy3a+Nxk4sMN+Rvo9y0qrAICH0LQqpCLSTiLYKQGzVlmMFj9p8y28JBBJp5dHeFrbfst2r56xRYeUo4JSkOdRHmTZfO4Wx4f4xiMflayqUS6bXXY76Nt73lZ1bbSFGGlHF1xLdbdDB04OxPXe/cnAhVP1rMcwv36QNQVuukzCSbO/C6HThcaxfi7dooTb67h0ebYPsJXVhBx7+JDkM/XaA+5qA2hHjBydk1kypPT73Owlw== X-MS-TrafficTypeDiagnostic: SN6PR02MB5023: X-Microsoft-Exchange-Diagnostics: 1; SN6PR02MB5023; 31:BSSRtMyDKet9JN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9O8rsNm1pLCPTuiVRPl0VNJ/TzOg7Dw1Ll0IiO1E5TLevxQYsfSI5XhJZzgqG3EajLeCWPqKih8egVnrBumzU1YyBUcjM/99DuEPLAKfF6ke0I92JPvyBuRaEqWjn5O4Otl5+bREdiJQUtdPfJ9butMHqFo+lnCss6/DJYwzgez2jXgYj4A/q7mCIV4oVGBSBqu1W1ewgx2PPC471n8pWQOQNEgwccjTjfUt0rjJi7Do+MNf9Ww3YcVSGXY/iOV/GSptPA7pNo+yvc/io/VoGktp90r/ko5MHLY2H67aW23Ic3+1bM57sYOLMym X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: mmKVG3tpBAbtuF1JeYsuO0+YRwOArv624T7Z5M/Est0MIfDXoP/N8aQ8/37RXIgMNW3rCLAVITVK/olm9n96P+JLbnWMxSeCuHZZkW0Ch3yfUBaRvnKEJqDTIZNgSh2KDHeZB2xRxcTyLf6YoxZqer87PE0Oyx3hbIOepubyOaMGUfKsorWT5ObKBi4W23K7vYlR5sfBGHRNaJQz6AGUe662rWhEHL+Yz7bnYCmL/NVhuzD17jNw4cWz0FZHyFmc4Ibt3GXTSMddyU/InbcY0/kQQe6BcdjTF6W1H9UPshQdMENL1VQd24jjEktfnHwcdvqByQVzxmSwiBcuB4RZzG5W5kqD42+QD1biy862+qQN5xlIY9sgEgNmb4U8oJo1dApxjGp/xSymepuHUSoteimzMlLE5SAMGuKAm3Uckhc= X-Microsoft-Exchange-Diagnostics: 1; SN6PR02MB5023; 6:IzYYU4/H8nOMXZ267L6FMiCUN2SKfm3KU+1KMmKbl39Z2Dl6N0LR2/J+ncSND5ATGllI7XqK81pDb0c45vFZkde+pyFdonnKkg+MdjWlmmUakkMGWi8YXxNHtHRBeQMwhEbLup4ekclKOIBKPrrKOGjnRxhGADZ08tnH4Q2CKKL5CBelvvfukbWYkgArUOf5jYEyoi4IRCl93nh0z9I4LOuqRLjHX+Nv0JIxRPzFQA7DZASyNVnyMVPjQSpAflm/spqtzeajrbz+WDd1rYzL5izSlOgCCxvW2UPisRZkEroGyn+UBBFpUS70FFn6HLoyH1uKK7a1+AbuvIbbB9mw97cZmV1rtwgtfJd3389zvuALYrbS/UIDUWUkz4Da6IuI/hA4rfcsOAsKUHQ5q1eKKEWGB0WPmqxFGcAWGdaSbgmw7LWl9YceDo5nRSUrEkvTKeRkBB1DXtSzbC4lwIJHhw==; 5:rfIr+VwkqVXWB1YGGB9Zl52GhEEYtCdZeNWz4O/e+ScYg+uWqQz0lvUaKhtBAQYHkw2PBx6HOluJUxyaMcd+0o1sA+eGWpVlu6UP1LeonXLmyO+aMdBGbY2c1bFE/HxMVwOQQJf3CSJGx93bQFJNcgSwcnmIyrUidMN07527jzyB2YzhjPK3g6EpGBDjSbPBPCIWNHa7K4XkxaJN7lKFFQ==; 7:a4ShTMKTlVPGWiXmE1/WnMUP+7jLFFjPLtq9DRMDUop0bMGLEhl5Tro0bwoCZsNBWlk6sJLFQV2o3XG05XjUi55COc03GCPUqoQSn9o5Pb03h5gzRoB7kLNyM8NjjRefSXjJGlOsccY6lgU++Vql5A== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2019 22:09:14.6430 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 19dc6251-8b19-4530-f53f-08d68891e74b 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: SN6PR02MB5023 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190201_140918_631272_24E8FE44 X-CRM114-Status: GOOD ( 10.64 ) 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 ZynqMP power domain bindings. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Reviewed-by: Rob Herring --- .../bindings/power/xlnx,zynqmp-genpd.txt | 34 +++++++++++++++++++ include/dt-bindings/power/xlnx-zynqmp-power.h | 39 ++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/xlnx,zynqmp-genpd.txt create mode 100644 include/dt-bindings/power/xlnx-zynqmp-power.h diff --git a/Documentation/devicetree/bindings/power/xlnx,zynqmp-genpd.txt b/Documentation/devicetree/bindings/power/xlnx,zynqmp-genpd.txt new file mode 100644 index 0000000..3c7f237 --- /dev/null +++ b/Documentation/devicetree/bindings/power/xlnx,zynqmp-genpd.txt @@ -0,0 +1,34 @@ +----------------------------------------------------------- +Device Tree Bindings for the Xilinx Zynq MPSoC PM domains +----------------------------------------------------------- +The binding for zynqmp-power-controller follow the common +generic PM domain binding[1]. + +[1] Documentation/devicetree/bindings/power/power_domain.txt + +== Zynq MPSoC Generic PM Domain Node == + +Required property: + - Below property should be in zynqmp-firmware node. + - #power-domain-cells: Number of cells in a PM domain specifier. Must be 1. + +Power domain ID indexes are mentioned in +include/dt-bindings/power/xlnx-zynqmp-power.h. + +------- +Example +------- + +firmware { + zynqmp_firmware: zynqmp-firmware { + ... + #power-domain-cells = <1>; + ... + }; +}; + +sata { + ... + power-domains = <&zynqmp_firmware 28>; + ... +}; diff --git a/include/dt-bindings/power/xlnx-zynqmp-power.h b/include/dt-bindings/power/xlnx-zynqmp-power.h new file mode 100644 index 0000000..0d9a412 --- /dev/null +++ b/include/dt-bindings/power/xlnx-zynqmp-power.h @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2018 Xilinx, Inc. + */ + +#ifndef _DT_BINDINGS_ZYNQMP_POWER_H +#define _DT_BINDINGS_ZYNQMP_POWER_H + +#define PD_USB_0 22 +#define PD_USB_1 23 +#define PD_TTC_0 24 +#define PD_TTC_1 25 +#define PD_TTC_2 26 +#define PD_TTC_3 27 +#define PD_SATA 28 +#define PD_ETH_0 29 +#define PD_ETH_1 30 +#define PD_ETH_2 31 +#define PD_ETH_3 32 +#define PD_UART_0 33 +#define PD_UART_1 34 +#define PD_SPI_0 35 +#define PD_SPI_1 36 +#define PD_I2C_0 37 +#define PD_I2C_1 38 +#define PD_SD_0 39 +#define PD_SD_1 40 +#define PD_DP 41 +#define PD_GDMA 42 +#define PD_ADMA 43 +#define PD_NAND 44 +#define PD_QSPI 45 +#define PD_GPIO 46 +#define PD_CAN_0 47 +#define PD_CAN_1 48 +#define PD_GPU 58 +#define PD_PCIE 59 + +#endif From patchwork Fri Feb 1 22:08:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 10793805 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 9BF62922 for ; Fri, 1 Feb 2019 22:09:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A57B32E9E for ; Fri, 1 Feb 2019 22:09:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D92032F11; Fri, 1 Feb 2019 22:09:51 +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 DF2C132E9E for ; Fri, 1 Feb 2019 22:09:50 +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=kzSvEuQD2CIUSeYecrDqAN7ryejKKTphav6jysDRK0g=; b=qgD4d18wgsrw0/ EVj4Rn07FtTAVxRXpUUFV7tHReiS3uwNic9OwJKpIRV/UW5UMB4olBrzCeZf6KMw6Bv9ZQm4Deh9r 8X7qlpKjxMaF7FtdgxPGrdBgrjzCpT8DQTLl3md6PvrTZm6eGIbVrcLu7hpJKQQSdsbW3byivuKkU GMHnlqfRkMGaO8DCTGBesaNXsKyANDPv6tnd5SrlS4veJa09rigPiJpHC3Arn64N3O14EUiiiKYLy VQjKNEXHtmr+cmtjJvQBk2zRjwNVqkfR9l57o8dGSPb70LdcPFAy2KrcGLXeGlgYeQ5ku8mWEzZzz htreNuGJLkB/98I3sD+A==; 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 1gph0N-0001Qs-W8; Fri, 01 Feb 2019 22:09:48 +0000 Received: from mail-co1nam05on0601.outbound.protection.outlook.com ([2a01:111:f400:fe50::601] helo=NAM05-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gpgzv-0000xo-Dc for linux-arm-kernel@lists.infradead.org; Fri, 01 Feb 2019 22:09:21 +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=oRpVOCM6ngbHXXWym1UvBWBRbMKIWQaU+4lzzI3Adro=; b=sswKfz66LP1DtTvOjNp4XbF8a1HxMo9Y8IZHjRHfmWzXF12uTK8o3UNxlUdoeatt4O7kK8DOMZLUGuu+q4+q2xaNiWnKeoV/98kiPnAfiHBTqdHv3cB5mwxAwi6abhzIak0Up+pXcwOkah1xns6icDDoENgBaE61AVo2O0F8Zrg= Received: from SN4PR0201CA0035.namprd02.prod.outlook.com (2603:10b6:803:2e::21) by BL2PR02MB2145.namprd02.prod.outlook.com (2a01:111:e400:c74b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.21; Fri, 1 Feb 2019 22:09:15 +0000 Received: from SN1NAM02FT009.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::206) by SN4PR0201CA0035.outlook.office365.com (2603:10b6:803:2e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1580.20 via Frontend Transport; Fri, 1 Feb 2019 22:09:15 +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 SN1NAM02FT009.mail.protection.outlook.com (10.152.73.32) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.10 via Frontend Transport; Fri, 1 Feb 2019 22:09:14 +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 1gpgzq-0007Ts-6x; Fri, 01 Feb 2019 14:09:14 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1gpgzl-0000P8-3z; Fri, 01 Feb 2019 14:09:09 -0800 Received: from xsj-pvapsmtp01 (mail.xilinx.com [149.199.38.66] (may be forged)) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x11M8wLp030350; Fri, 1 Feb 2019 14:08:58 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1gpgza-0000LK-LD; Fri, 01 Feb 2019 14:08:58 -0800 From: Jolly Shah To: , , , , , , , , , Subject: [PATCH v4 2/3] firmware: xilinx: Add APIs to control node status/power Date: Fri, 1 Feb 2019 14:08:49 -0800 Message-ID: <1549058930-18644-3-git-send-email-jollys@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1549058930-18644-1-git-send-email-jollys@xilinx.com> References: <1549058930-18644-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)(136003)(376002)(39860400002)(396003)(2980300002)(199004)(189003)(39060400002)(486006)(476003)(2201001)(126002)(6666004)(356004)(4326008)(63266004)(50226002)(44832011)(106002)(26005)(426003)(11346002)(336012)(50466002)(48376002)(2616005)(446003)(14444005)(107886003)(77096007)(186003)(478600001)(36386004)(2906002)(9786002)(7696005)(72206003)(76176011)(110136005)(51416003)(81156014)(16586007)(305945005)(106466001)(8936002)(8676002)(47776003)(81166006)(36756003)(316002)(54906003)(7416002)(107986001)(921003)(42866002)(83996005)(2101003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:BL2PR02MB2145; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT009; 1:g2Qb4n9ExSejUGUljR8ZhXiIVh92O7CqKv1RLbr+O463koj8tb2NRtT9le330FI/QayHUJE/0UMZDMEUHX4Wh074rr7JRedGb1GjKSDVWljM/dCHOI0UmQMWMxAcWzxj6s5k/3Yd7m/xO9eyC/57KUGWBFrlwrrQSCgjesBNE5I= MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f5ca038a-cc8c-4772-5f81-08d68891e75a X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4608076)(4709027)(2017052603328)(7153060); SRVR:BL2PR02MB2145; X-Microsoft-Exchange-Diagnostics: 1; BL2PR02MB2145; 3:KzAuRigncdHIu4T7frxxm0HFba0BNs6GmRWkauAfEYGhQibbJAgVpmv1eprgWRosqNfSN2RYx7yVaSVLTjYoqa/bX7JWDFz14gkvwwhsFrDWV02sPZf4dwPqq/BcGK/gyCPUM1fh9wH9lF1ZxM4w1TWaPgYNCKyztrR4+kq8nl7083VrCiA0GZ4y2j1hIGmbLmukSUCPaJaoisWuOdZjH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kkbUi1eQ99zRbQm1Ygv1KF7IZMPblrlsgvIjJYT8+6F1ekmnSn3dVxIdjJxdbRb+EICqqbgjelxZyrFqm6C4MWu+y2JXjgvFjsKTOX/AC5vw9IvJsx/wvyxU+cskSv4TEmgSdhQuqi3Ai4Cjch6zgQ73ZnsqbPrZVgKpcru3OuiiJYVOOkZsLffqx10qgacluxwVsGwDL4Ip3jK5cuWJwZTmdD2qQSH4KAXNN3FvKP1uLevyF4PDt0bBRTYpbs2pVuBdO82WUIgu X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Microsoft-Exchange-Diagnostics: 1; BL2PR02MB2145; 4:2Tk45V29ClMwXPS1Y0t1j16rQ9Fo/bYXGkHq7gKxsB4eAVLU/cyYqI6QlsWQSVWEgTkljOYRjTrwMcMufi4EQi8BlemaP5EzcoiuLnKL5t/LrbshYb+j+z+YX/T4yisHtS2XZ8yngTKKPa8weeUBaTc8EU9AzigTvjkXWJSoU2LVip08N53T+yYdRfwNk7YsLsgLvMScXBu9fbCwXSnXi1+Qz1KlO/NRV1VhUYYRjurIh+vBqJjbFaktbPlOPErdPdT7c6edJ367r+KbtthprGA0isdkpr1a3yazdTL83b0lUzw5P8zbEDSEqatJ6+RU X-Forefront-PRVS: 09352FD734 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL2PR02MB2145; 23:6SGGBM8r3o2DwEX+tSU6xXV2sVBSSPWi/Zb3GaFNS?= FhrBsyliYu7VsPDHsEeBjkNd4x44WlIa7fs9/rZShkS7+47iYIxeN9vvssY+PKdJji93yt4vpCl4UWlyymAWhYJmIWtEl2Ziwgt32f/7Pb++U2M9kBHV5eafV/EAUhIGcbmSebJjUT6fpLXrMk6jPm33qfX9mPgBqWrnl+Wo4DjaHvYIUh1qUxb6xruzblAboMdr4iqc2MLpIouWYVzsKDM5R8zH5S7xBEAo0DTvXKHGtOWyPeDo46PTExVO/qd5aL92BSAQduO2Rci3VKvdRj0Xit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EGPYtA==; 7:eddyK+kgrLHh32GU+jvV0jriDdSTOt4v5/wknwlzfx5auininG+FCITdAY8obP0ZXqDDyEr7lxs+Xb/tbdY6N6Rurumd47/wpRLhz88WY5H2lowfqDwXmi3TBTFSEojfNtnXYYlQGr+TbeNcMKix4g== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2019 22:09:14.6984 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f5ca038a-cc8c-4772-5f81-08d68891e75a 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: BL2PR02MB2145 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190201_140919_634441_1CF4D6FE X-CRM114-Status: GOOD ( 12.04 ) 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 control node status and power. These APIs allows turning on/off power domain and setting capabilities of devices present in power domain. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/zynqmp.c | 58 ++++++++++++++++++++++++++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 26 ++++++++++++++++ 2 files changed, 84 insertions(+) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 8065e33..6660b8c 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -534,6 +534,61 @@ static int zynqmp_pm_set_suspend_mode(u32 mode) return zynqmp_pm_invoke_fn(PM_SET_SUSPEND_MODE, mode, 0, 0, 0, NULL); } +/** + * zynqmp_pm_request_node() - Request a node with specific capabilities + * @node: Node ID of the slave + * @capabilities: Requested capabilities of the slave + * @qos: Quality of service (not supported) + * @ack: Flag to specify whether acknowledge is requested + * + * This function is used by master to request particular node from firmware. + * Every master must request node before using it. + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_request_node(const u32 node, const u32 capabilities, + const u32 qos, + const enum zynqmp_pm_request_ack ack) +{ + return zynqmp_pm_invoke_fn(PM_REQUEST_NODE, node, capabilities, + qos, ack, NULL); +} + +/** + * zynqmp_pm_release_node() - Release a node + * @node: Node ID of the slave + * + * This function is used by master to inform firmware that master + * has released node. Once released, master must not use that node + * without re-request. + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_release_node(const u32 node) +{ + return zynqmp_pm_invoke_fn(PM_RELEASE_NODE, node, 0, 0, 0, NULL); +} + +/** + * zynqmp_pm_set_requirement() - PM call to set requirement for PM slaves + * @node: Node ID of the slave + * @capabilities: Requested capabilities of the slave + * @qos: Quality of service (not supported) + * @ack: Flag to specify whether acknowledge is requested + * + * This API function is to be used for slaves a PU already has requested + * to change its capabilities. + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, + const u32 qos, + const enum zynqmp_pm_request_ack ack) +{ + return zynqmp_pm_invoke_fn(PM_SET_REQUIREMENT, node, capabilities, + qos, ack, NULL); +} + static const struct zynqmp_eemi_ops eemi_ops = { .get_api_version = zynqmp_pm_get_api_version, .query_data = zynqmp_pm_query_data, @@ -551,6 +606,9 @@ static const struct zynqmp_eemi_ops eemi_ops = { .reset_get_status = zynqmp_pm_reset_get_status, .init_finalize = zynqmp_pm_init_finalize, .set_suspend_mode = zynqmp_pm_set_suspend_mode, + .request_node = zynqmp_pm_request_node, + .release_node = zynqmp_pm_release_node, + .set_requirement = zynqmp_pm_set_requirement, }; /** diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index f84d700..c7a7748 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -40,8 +40,19 @@ /* Payload size (consists of callback API ID + arguments) */ #define CB_PAYLOAD_SIZE (CB_ARG_CNT + 1) +#define ZYNQMP_PM_MAX_QOS 100U + +/* Node capabilities */ +#define ZYNQMP_PM_CAPABILITY_ACCESS 0x1U +#define ZYNQMP_PM_CAPABILITY_CONTEXT 0x2U +#define ZYNQMP_PM_CAPABILITY_WAKEUP 0x4U +#define ZYNQMP_PM_CAPABILITY_POWER 0x8U + enum pm_api_id { PM_GET_API_VERSION = 1, + PM_REQUEST_NODE = 13, + PM_RELEASE_NODE, + PM_SET_REQUIREMENT, PM_RESET_ASSERT = 17, PM_RESET_GET_STATUS, PM_PM_INIT_FINALIZE = 21, @@ -223,6 +234,12 @@ enum zynqmp_pm_suspend_reason { SUSPEND_SYSTEM_SHUTDOWN, }; +enum zynqmp_pm_request_ack { + ZYNQMP_PM_REQUEST_ACK_NO = 1, + ZYNQMP_PM_REQUEST_ACK_BLOCKING, + ZYNQMP_PM_REQUEST_ACK_NON_BLOCKING, +}; + /** * struct zynqmp_pm_query_data - PM query data * @qid: query ID @@ -255,6 +272,15 @@ struct zynqmp_eemi_ops { int (*reset_get_status)(const enum zynqmp_pm_reset reset, u32 *status); int (*init_finalize)(void); int (*set_suspend_mode)(u32 mode); + int (*request_node)(const u32 node, + const u32 capabilities, + const u32 qos, + const enum zynqmp_pm_request_ack ack); + int (*release_node)(const u32 node); + int (*set_requirement)(const u32 node, + const u32 capabilities, + const u32 qos, + const enum zynqmp_pm_request_ack ack); }; int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, From patchwork Fri Feb 1 22:08:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 10793815 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 AE86814E1 for ; Fri, 1 Feb 2019 22:10:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9C4B832ED9 for ; Fri, 1 Feb 2019 22:10:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9002832F13; Fri, 1 Feb 2019 22:10:12 +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 8244732ED9 for ; Fri, 1 Feb 2019 22:10:11 +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=PTIiFaskO7rSsZxtyPhPs//DXRcgDI7TL+hHoZHR7f4=; b=AXwwhE0nxpItqw Xx2ELJoF24G0olSHtQ63CUB1bhxjVONBSKQxZDdSBFkrZjcWao4xqVWghgO6U5LLNYo1dk8VndNME HQSat8sweh4HXLWcS+GC0bAX1IvN9YBr1Oa+5KqtTwCY+b4NRxbkpyksvzH7GejWNTinv4NWn5f10 b71KBw6lrvFRSLUo6A9i7c7oSJg9cxsLuHSfFwubpfRsfPgvaPPyIn7m8II3Rig66sP1epccjNwV7 znGlkRWpk1k1g1n43eEAqGPpKgjHYVTGqel6MYZFRiWIrwfk6warQcsqhqX1h58ajyfmqr0nr1n2R wLjAyFEEjkoIp0XOBHYw==; 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 1gph0i-0001xN-Ub; Fri, 01 Feb 2019 22:10:09 +0000 Received: from mail-cys01nam02on061f.outbound.protection.outlook.com ([2a01:111:f400:fe45::61f] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gpgzv-0000xr-Ry for linux-arm-kernel@lists.infradead.org; Fri, 01 Feb 2019 22:09:23 +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=bw5hHpT8Y8oC0drDRboRs3tOy5YpvmOIY05EPAoTZX0=; b=AXUOEXfwhQvI9TaDfrCZ1gqwqQLU7LTtQZqmie7SQkBwkHxsdhN6j4qQEJqJcvdi4/kW71I8TSrvhBqXVNUAkJT/lmk6yeQtHC59sD3HpEfIz/m3A/idQA21wJxTKfhLu5wMlQqC44v/7tAx8KdcfG4mKHRQOsUz8C6nlQPLYeM= Received: from DM6PR02CA0020.namprd02.prod.outlook.com (2603:10b6:5:1c::33) by SN1PR02MB2157.namprd02.prod.outlook.com (2a01:111:e400:7a48::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.20; Fri, 1 Feb 2019 22:09:16 +0000 Received: from SN1NAM02FT063.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::201) by DM6PR02CA0020.outlook.office365.com (2603:10b6:5:1c::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1580.20 via Frontend Transport; Fri, 1 Feb 2019 22:09:15 +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 SN1NAM02FT063.mail.protection.outlook.com (10.152.72.213) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.10 via Frontend Transport; Fri, 1 Feb 2019 22:09:14 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:40519 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1gpgzq-0005vt-8i; Fri, 01 Feb 2019 14:09:14 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1gpgzl-0000P8-5X; Fri, 01 Feb 2019 14:09:09 -0800 Received: from xsj-pvapsmtp01 (mail.xilinx.com [149.199.38.66] (may be forged)) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x11M8wV8027121; Fri, 1 Feb 2019 14:08:59 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1gpgza-0000LK-Nb; Fri, 01 Feb 2019 14:08:58 -0800 From: Jolly Shah To: , , , , , , , , , Subject: [PATCH v4 3/3] drivers: soc: xilinx: Add ZynqMP power domain driver Date: Fri, 1 Feb 2019 14:08:50 -0800 Message-ID: <1549058930-18644-4-git-send-email-jollys@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1549058930-18644-1-git-send-email-jollys@xilinx.com> References: <1549058930-18644-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)(136003)(346002)(376002)(39860400002)(396003)(2980300002)(189003)(199004)(356004)(8676002)(81166006)(81156014)(8936002)(2906002)(44832011)(426003)(446003)(51416003)(50226002)(476003)(2616005)(126002)(11346002)(36756003)(106466001)(336012)(7696005)(486006)(47776003)(478600001)(106002)(76176011)(48376002)(305945005)(50466002)(107886003)(110136005)(77096007)(39060400002)(63266004)(54906003)(9786002)(72206003)(14444005)(36386004)(5024004)(16586007)(30864003)(4326008)(186003)(6666004)(316002)(26005)(2201001)(7416002)(921003)(42866002)(107986001)(83996005)(2101003)(5001870100001)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR02MB2157; 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; SN1NAM02FT063; 1:YozjsxclgA1ln4nwc6gcsvXaCkbNAmBAeRdLJaOrRhm4UxfXaX3sij75eCakNiacUYHosZF2WMZLYTuUWc6xyWnw46qoTA2DIZtutUP6fsWOOP7J2aXMck6CPmnQGVpLZzAu5fGOVgR2bGGCE/5j5SSxpUX1W/OmClRhJu0TuWM= MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fc51f936-ba3f-43a1-10c2-08d68891e75f X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600110)(711020)(4605077)(4608076)(4709027)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060); SRVR:SN1PR02MB2157; X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB2157; 3:LO7QwSYotUwxDPGSbkOa1dwMzAH6LdUkDuiCVwWR8fBx4weYCmB21xbfsje8N1+E9V9S5sXJ3EAHNSSVf9AzddghbJDzeTTOjYJ97Mx6Gc9SnweusdwLxEvf5WqLASUTKfdkQ6DzvMvZ645iEg0LE2OQEBKitJrcTMkj/WRM0MGquEr13GrfCKqeTRwuMsKQQ8a+ptMUFjjS41+J32GW/0+MHwd/Ki97QlcnGwtgTMS5J3jz5y57XObMO7/dPytZ/w3TZUCcuX/FjJleEAiJmnJY/NZw5nTN5U9c2Sp2/Txd4rsDsMBXOKlg+toYgJMHw0vmpvm51USRup7MG9708m2oBzSTiYaoR772iTa4kP7oWRZhnNgFSMkiGev/e6dg; 25:v34nXIo0RNnEF0Bqmz2k9S31Oa8yi4LhFV938V4FpjS8vbDzONhqIXoM4l7zFM3G4Zb+HUtNGp0V71IUsKG2gV6TrRqYZEXgmIlIUKjS1JWzyR8r3KHtGRK1wxHTrg3jcSOUYmh+8pgR5P2OlCLw4ellM5QGkbMluwq7KiC79EB7WdYGTzJemscj/btgKbSW0LN88jmCgp9CRNcTpG/7R+qqxH6ST3Ngs6JAwShxDg9eImBuyiZXScdqgs0ajGktoQhn1BxDa8ZW0f+DORuDE+jjiRCsS010nlqP0VJ8phb0Qz8uFKS+qZr3f4IUrBvrEQbFmn/Sdi5/jeUW3w5FCQ== X-MS-TrafficTypeDiagnostic: SN1PR02MB2157: X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB2157; 31:dZoCLjrKEF4wH6J+7JLnx5O/e0XUDadJS2R1G4lSUqTkOxroCCjDxioMVpC9iRUnnfeQ/0cvDZNueVZYmdd/MqtfT7zNqE5UFTL2LlJHXoROMIeX2QdMDFuZIUMa6zKVZ13SNRRBQZWipZsQ7iqjUKWe3Wqwlum3vGWvv+4BsCl6j2u+gFnK4fYgmR8HK1laiGdMZfFRKzBzPr/Y1oSF6WPXb8h9EcPPozx/e38ZSdk=; 20:FlqYq1gLtd6X+id/fJl015F7Mlg85OBv3FOmCzjGYkyr8eUCKWx226k9d1RNLEJGERhuaBYzow3TcRYJLgTJ5rb3v4QWEHPvamcdI5fJGUY6fCHwS22HERhHQsMHajCWVWqNPlS//HoGVq8SXY6f/SVPH74h+4Ljep0huRwgvXIyLhSuARlcr6HhSdbFb6C6fE/rzq5CjjKZ0l7AdAk4JwuZItVT1Wh3bhfEZiCA0VTrN+9Htx9/rIyTiEEpJ94gWCh5thm3MlJeBm4MQTWfGKUGEdP5nVuMoAIlXW68y6JrdImnBbxXBJVUMJ32rKd4KehgEwgD7qqYAdn2heJCv+L7Bg7f/1xX+miBb2UVay3+0x1eIHuCiusDXu3SL+kmo+co2WHGqgja7fOjRlclHoqs4ebPNDraUs7e9hoA9LA0zc8DlxqH4ZEbxPxC8vAelEsIcMUFzFLu/kL2ihQAiClBqh7oR7HYgp+yzCMsSh9JNjaA/ExnTx1ciRYXw5Rm X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB2157; 4:ob3pOZfDtPIgF81pzpG4l8DRik80+IyzvF1YexQue999F6Mxn5btYw1pZW0Jib67kI9raeZUtzwai2+hvRKLHk+P0bSCaRNoUVZMmp/XFL+b42lSsS+90XKmLVgsMvv7X0DW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gs+mgBFzmZt/j0pICZmz3VT2vEsDN5J29TyuLMKszySwvJbuN0LuIIZI/HqfXwiXS50mHc8LVeygoYP6OMdmwyqAUB577TrG2b3uf/lA4/bvzN8oz98iH7D1BC6K9/EYM44fN/aIAWYEwkVvOX5BjMXhLluo74bD+bjeSzPKFQaNqwiZDl4Alb1xjI/WIYxf/gRNy9a7z0Jpt2lYE4+G6jgnrfuQWsdnwK0af00gfZiq/xNTUshHt2Hg2HtlV9aH/vul8geyU3u1XRACrQxUqDvBP7e+VwZ4b917k4RyLQdbj2R0gF7/hHh6Lo7CCkpl8iLLeSjia5d34nN9aT1meqmpriy+VbCano6I76Ku8XuD4ApUaQyNFyjB/TgwpsZOXpcNMboaOy7DjMjus/sSJldh4z0qmWxhXXJKW8uhT/EWud2iuRsN8N0mK2jl9g3C6B3yJvl/bw==; 5:bjefww6BWhtGB9w9CKM1o7EpbLqIZ5VZQY8n3tEgUzB8gXoHk7AIAXzm2egxZ+Z8xiE0PGkh8N0tSFkCaRczekAjykcTu77PuY+y9w4QWMAtvNSySfzVHhUKqEnyExQWXwEBMarwfT0ze6u53RQnIB2omnCZq/5ZWsq+tZr/GsibDD1jpmBnqi/2l6uAPa/FUAr0hv6hPsztp1+9R0PuYw==; 7:CX0N4T88TKgYOZj1UzZwGo+MwbbRUkD0i5Yd99LsyH1OW9kJW7WtI9YTlQYcZsvn4zG2bOPhyLLj605pY+/Jb1bIPnb83P0g33IuNT61CBA5+CXb9yBYtBljWHroIO7dwBtqEgi3LP1lkUCsA+pBeg== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2019 22:09:14.7271 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc51f936-ba3f-43a1-10c2-08d68891e75f 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: SN1PR02MB2157 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190201_140920_242715_1E8FD15F X-CRM114-Status: GOOD ( 16.29 ) 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 The zynqmp-genpd driver communicates the usage requirements for logical power domains / devices to the platform FW. FW is responsible for choosing appropriate power states, taking Linux' usage information into account. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/Kconfig | 1 + drivers/firmware/xilinx/zynqmp.c | 15 ++ drivers/soc/xilinx/Kconfig | 9 + drivers/soc/xilinx/Makefile | 1 + drivers/soc/xilinx/zynqmp_pm_domains.c | 321 +++++++++++++++++++++++++++++++++ 5 files changed, 347 insertions(+) create mode 100644 drivers/soc/xilinx/zynqmp_pm_domains.c diff --git a/drivers/firmware/xilinx/Kconfig b/drivers/firmware/xilinx/Kconfig index 8f44b9c..bd33bbf 100644 --- a/drivers/firmware/xilinx/Kconfig +++ b/drivers/firmware/xilinx/Kconfig @@ -6,6 +6,7 @@ menu "Zynq MPSoC Firmware Drivers" config ZYNQMP_FIRMWARE bool "Enable Xilinx Zynq MPSoC firmware interface" + select MFD_CORE help Firmware interface driver is used by different drivers to communicate with the firmware for diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 6660b8c..dab1350 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -23,6 +24,12 @@ #include #include "zynqmp-debug.h" +static const struct mfd_cell firmware_devs[] = { + { + .name = "zynqmp_power_controller", + }, +}; + /** * zynqmp_pm_ret_code() - Convert PMU-FW error codes to Linux error codes * @ret_status: PMUFW return code @@ -665,11 +672,19 @@ static int zynqmp_firmware_probe(struct platform_device *pdev) zynqmp_pm_api_debugfs_init(); + ret = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, firmware_devs, + ARRAY_SIZE(firmware_devs), NULL, 0, NULL); + if (ret) { + dev_err(&pdev->dev, "failed to add MFD devices %d\n", ret); + return ret; + } + return of_platform_populate(dev->of_node, NULL, NULL, dev); } static int zynqmp_firmware_remove(struct platform_device *pdev) { + mfd_remove_devices(&pdev->dev); zynqmp_pm_api_debugfs_exit(); return 0; diff --git a/drivers/soc/xilinx/Kconfig b/drivers/soc/xilinx/Kconfig index 5025e0e..01e76b5 100644 --- a/drivers/soc/xilinx/Kconfig +++ b/drivers/soc/xilinx/Kconfig @@ -28,4 +28,13 @@ config ZYNQMP_POWER power management callbacks from firmware. If in doubt, say N. +config ZYNQMP_PM_DOMAINS + bool "Enable Zynq MPSoC generic PM domains" + default y + depends on PM && ARCH_ZYNQMP && ZYNQMP_FIRMWARE + select PM_GENERIC_DOMAINS + help + Say yes to enable device power management through PM domains + If in doubt, say N. + endmenu diff --git a/drivers/soc/xilinx/Makefile b/drivers/soc/xilinx/Makefile index 428b9db..f66bfea 100644 --- a/drivers/soc/xilinx/Makefile +++ b/drivers/soc/xilinx/Makefile @@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_XILINX_VCU) += xlnx_vcu.o obj-$(CONFIG_ZYNQMP_POWER) += zynqmp_power.o +obj-$(CONFIG_ZYNQMP_PM_DOMAINS) += zynqmp_pm_domains.o diff --git a/drivers/soc/xilinx/zynqmp_pm_domains.c b/drivers/soc/xilinx/zynqmp_pm_domains.c new file mode 100644 index 0000000..354d256 --- /dev/null +++ b/drivers/soc/xilinx/zynqmp_pm_domains.c @@ -0,0 +1,321 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * ZynqMP Generic PM domain support + * + * Copyright (C) 2015-2018 Xilinx, Inc. + * + * Davorin Mista + * Jolly Shah + * Rajan Vaja + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#define ZYNQMP_NUM_DOMAINS (100) +/* Flag stating if PM nodes mapped to the PM domain has been requested */ +#define ZYNQMP_PM_DOMAIN_REQUESTED BIT(0) + +/** + * struct zynqmp_pm_domain - Wrapper around struct generic_pm_domain + * @gpd: Generic power domain + * @node_id: PM node ID corresponding to device inside PM domain + * @flags: ZynqMP PM domain flags + */ +struct zynqmp_pm_domain { + struct generic_pm_domain gpd; + u32 node_id; + u8 flags; +}; + +/** + * zynqmp_gpd_is_active_wakeup_path() - Check if device is in wakeup source + * path + * @dev: Device to check for wakeup source path + * @not_used: Data member (not required) + * + * This function is checks device's child hierarchy and checks if any device is + * set as wakeup source. + * + * Return: 1 if device is in wakeup source path else 0 + */ +static int zynqmp_gpd_is_active_wakeup_path(struct device *dev, void *not_used) +{ + int may_wakeup; + + may_wakeup = device_may_wakeup(dev); + if (may_wakeup) + return may_wakeup; + + return device_for_each_child(dev, NULL, + zynqmp_gpd_is_active_wakeup_path); +} + +/** + * zynqmp_gpd_power_on() - Power on PM domain + * @domain: Generic PM domain + * + * This function is called before devices inside a PM domain are resumed, to + * power on PM domain. + * + * Return: 0 on success, error code otherwise + */ +static int zynqmp_gpd_power_on(struct generic_pm_domain *domain) +{ + int ret; + struct zynqmp_pm_domain *pd; + const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); + + if (!eemi_ops || !eemi_ops->set_requirement) + return -ENXIO; + + pd = container_of(domain, struct zynqmp_pm_domain, gpd); + ret = eemi_ops->set_requirement(pd->node_id, + ZYNQMP_PM_CAPABILITY_ACCESS, + ZYNQMP_PM_MAX_QOS, + ZYNQMP_PM_REQUEST_ACK_BLOCKING); + if (ret) { + pr_err("%s() %s set requirement for node %d failed: %d\n", + __func__, domain->name, pd->node_id, ret); + return ret; + } + + pr_debug("%s() Powered on %s domain\n", __func__, domain->name); + return 0; +} + +/** + * zynqmp_gpd_power_off() - Power off PM domain + * @domain: Generic PM domain + * + * This function is called after devices inside a PM domain are suspended, to + * power off PM domain. + * + * Return: 0 on success, error code otherwise + */ +static int zynqmp_gpd_power_off(struct generic_pm_domain *domain) +{ + int ret; + struct pm_domain_data *pdd, *tmp; + struct zynqmp_pm_domain *pd; + u32 capabilities = 0; + bool may_wakeup; + const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); + + if (!eemi_ops || !eemi_ops->set_requirement) + return -ENXIO; + + pd = container_of(domain, struct zynqmp_pm_domain, gpd); + + /* If domain is already released there is nothing to be done */ + if (!(pd->flags & ZYNQMP_PM_DOMAIN_REQUESTED)) { + pr_debug("%s() %s domain is already released\n", + __func__, domain->name); + return 0; + } + + list_for_each_entry_safe(pdd, tmp, &domain->dev_list, list_node) { + /* If device is in wakeup path, set capability to WAKEUP */ + may_wakeup = zynqmp_gpd_is_active_wakeup_path(pdd->dev, NULL); + if (may_wakeup) { + dev_dbg(pdd->dev, "device is in wakeup path in %s\n", + domain->name); + capabilities = ZYNQMP_PM_CAPABILITY_WAKEUP; + break; + } + } + + ret = eemi_ops->set_requirement(pd->node_id, capabilities, 0, + ZYNQMP_PM_REQUEST_ACK_NO); + /** + * If powering down of any node inside this domain fails, + * report and return the error + */ + if (ret) { + pr_err("%s() %s set requirement for node %d failed: %d\n", + __func__, domain->name, pd->node_id, ret); + return ret; + } + + pr_debug("%s() Powered off %s domain\n", __func__, domain->name); + return 0; +} + +/** + * zynqmp_gpd_attach_dev() - Attach device to the PM domain + * @domain: Generic PM domain + * @dev: Device to attach + * + * Return: 0 on success, error code otherwise + */ +static int zynqmp_gpd_attach_dev(struct generic_pm_domain *domain, + struct device *dev) +{ + int ret; + struct zynqmp_pm_domain *pd; + const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); + + if (!eemi_ops || !eemi_ops->request_node) + return -ENXIO; + + pd = container_of(domain, struct zynqmp_pm_domain, gpd); + + /* If this is not the first device to attach there is nothing to do */ + if (domain->device_count) + return 0; + + ret = eemi_ops->request_node(pd->node_id, 0, 0, + ZYNQMP_PM_REQUEST_ACK_BLOCKING); + /* If requesting a node fails print and return the error */ + if (ret) { + pr_err("%s() %s request failed for node %d: %d\n", + __func__, domain->name, pd->node_id, ret); + return ret; + } + + pd->flags |= ZYNQMP_PM_DOMAIN_REQUESTED; + + pr_debug("%s() %s attached to %s domain\n", __func__, + dev_name(dev), domain->name); + return 0; +} + +/** + * zynqmp_gpd_detach_dev() - Detach device from the PM domain + * @domain: Generic PM domain + * @dev: Device to detach + */ +static void zynqmp_gpd_detach_dev(struct generic_pm_domain *domain, + struct device *dev) +{ + int ret; + struct zynqmp_pm_domain *pd; + const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); + + if (!eemi_ops || !eemi_ops->release_node) + return; + + pd = container_of(domain, struct zynqmp_pm_domain, gpd); + + /* If this is not the last device to detach there is nothing to do */ + if (domain->device_count) + return; + + ret = eemi_ops->release_node(pd->node_id); + /* If releasing a node fails print the error and return */ + if (ret) { + pr_err("%s() %s release failed for node %d: %d\n", + __func__, domain->name, pd->node_id, ret); + return; + } + + pd->flags &= ~ZYNQMP_PM_DOMAIN_REQUESTED; + + pr_debug("%s() %s detached from %s domain\n", __func__, + dev_name(dev), domain->name); +} + +static struct generic_pm_domain *zynqmp_gpd_xlate + (struct of_phandle_args *genpdspec, void *data) +{ + struct genpd_onecell_data *genpd_data = data; + unsigned int i, idx = genpdspec->args[0]; + struct zynqmp_pm_domain *pd; + + pd = container_of(genpd_data->domains[0], struct zynqmp_pm_domain, gpd); + + if (genpdspec->args_count != 1) + return ERR_PTR(-EINVAL); + + /* Check for existing pm domains */ + for (i = 0; i < ZYNQMP_NUM_DOMAINS; i++) { + if (pd[i].node_id == idx) + goto done; + } + + /** + * Add index in empty node_id of power domain list as no existing + * power domain found for current index. + */ + for (i = 0; i < ZYNQMP_NUM_DOMAINS; i++) { + if (pd[i].node_id == 0) { + pd[i].node_id = idx; + break; + } + } + +done: + if (!genpd_data->domains[i] || i == ZYNQMP_NUM_DOMAINS) + return ERR_PTR(-ENOENT); + + return genpd_data->domains[i]; +} + +static int zynqmp_gpd_probe(struct platform_device *pdev) +{ + int i; + struct genpd_onecell_data *zynqmp_pd_data; + struct generic_pm_domain **domains; + struct zynqmp_pm_domain *pd; + struct device *dev = &pdev->dev; + + pd = devm_kcalloc(dev, ZYNQMP_NUM_DOMAINS, sizeof(*pd), GFP_KERNEL); + if (!pd) + return -ENOMEM; + + zynqmp_pd_data = devm_kzalloc(dev, sizeof(*zynqmp_pd_data), GFP_KERNEL); + if (!zynqmp_pd_data) + return -ENOMEM; + + zynqmp_pd_data->xlate = zynqmp_gpd_xlate; + + domains = devm_kcalloc(dev, ZYNQMP_NUM_DOMAINS, sizeof(*domains), + GFP_KERNEL); + if (!domains) + return -ENOMEM; + + for (i = 0; i < ZYNQMP_NUM_DOMAINS; i++, pd++) { + pd->node_id = 0; + pd->gpd.name = kasprintf(GFP_KERNEL, "domain%d", i); + pd->gpd.power_off = zynqmp_gpd_power_off; + pd->gpd.power_on = zynqmp_gpd_power_on; + pd->gpd.attach_dev = zynqmp_gpd_attach_dev; + pd->gpd.detach_dev = zynqmp_gpd_detach_dev; + + domains[i] = &pd->gpd; + + /* Mark all PM domains as initially powered off */ + pm_genpd_init(&pd->gpd, NULL, true); + } + + zynqmp_pd_data->domains = domains; + zynqmp_pd_data->num_domains = ZYNQMP_NUM_DOMAINS; + of_genpd_add_provider_onecell(dev->parent->of_node, zynqmp_pd_data); + + return 0; +} + +static int zynqmp_gpd_remove(struct platform_device *pdev) +{ + of_genpd_del_provider(pdev->dev.parent->of_node); + + return 0; +} + +static struct platform_driver zynqmp_power_domain_driver = { + .driver = { + .name = "zynqmp_power_controller", + }, + .probe = zynqmp_gpd_probe, + .remove = zynqmp_gpd_remove, +}; +module_platform_driver(zynqmp_power_domain_driver); + +MODULE_ALIAS("platform:zynqmp_power_controller");