From patchwork Tue Jan 29 20:38:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 10787225 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 41C041390 for ; Tue, 29 Jan 2019 20:39:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E2AE2D0DF for ; Tue, 29 Jan 2019 20:39:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1EEAC2D0EB; Tue, 29 Jan 2019 20:39:07 +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 981EB2D0DF for ; Tue, 29 Jan 2019 20:39:06 +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=W8rKT2MB+K5Mzj bmr/RL/IpWpvv3l55p3JZnBjEJ+s0+FY8ykhVzNwzg/BcqkxCG+lCqzsB/pYN3KT+XPLrS1uuNFbY C/7h9zUz3o6I186q8AuV/Un1vRRNn8imjbjLBnI/FEwHE/c3E1WxQG2DyYpYBb8KMIpjbGHaxSXbd X1SLyBTPeUkndn2U/4GCSictRu6WY8lwcwiNlUShmEKc3NAl4d5nigFJyhQKpvBWTnxF2O88NHcEf Td1cQ2NPTd231hgoaTd8Vbgy/kS2ElSNYIpbeFnBltz4vwCbQD+avldK9o8vM/PtmBhmWnJ2ORIxh 0IOCDxuWbnku2bjetBnQ==; 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 1goa9v-0008Hh-0Q; Tue, 29 Jan 2019 20:39:03 +0000 Received: from mail-eopbgr780071.outbound.protection.outlook.com ([40.107.78.71] helo=NAM03-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1goa9r-0008GR-BT for linux-arm-kernel@lists.infradead.org; Tue, 29 Jan 2019 20:39:00 +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=tqu5iUkLXYAI1IcAE2J6FUsgP/dXaTlWxWCFrVTX6uql3wRfu3MUsoldD+Vf5OrCmCJCIby8lEMNf0foxhW+X1lC+YUi7b80tQuwgheEfX3Y9jU0/MntE2jpJ417Qf2Ai6N695hT7/g071OsL3O9ZxSQf7Q8m8Q9Dkps7hhQA0Q= Received: from MWHPR0201CA0036.namprd02.prod.outlook.com (2603:10b6:301:74::49) by BYAPR02MB5015.namprd02.prod.outlook.com (2603:10b6:a03:71::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.21; Tue, 29 Jan 2019 20:38:54 +0000 Received: from BL2NAM02FT053.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::207) by MWHPR0201CA0036.outlook.office365.com (2603:10b6:301:74::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.18 via Frontend Transport; Tue, 29 Jan 2019 20:38:54 +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 BL2NAM02FT053.mail.protection.outlook.com (10.152.76.225) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.10 via Frontend Transport; Tue, 29 Jan 2019 20:38:53 +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 1goa9l-0007ir-5w; Tue, 29 Jan 2019 12:38:53 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1goa9g-0007aV-24; Tue, 29 Jan 2019 12:38:48 -0800 Received: from xsj-pvapsmtp01 (xsj-pvapsmtp01.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x0TKcaDj023880; Tue, 29 Jan 2019 12:38:36 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1goa9U-0007YY-G6; Tue, 29 Jan 2019 12:38:36 -0800 From: Jolly Shah To: , , , , , , , , , Subject: [PATCH v6 1/3] dt-bindings: soc: Add ZynqMP PM bindings Date: Tue, 29 Jan 2019 12:38:19 -0800 Message-ID: <1548794301-30483-2-git-send-email-jollys@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548794301-30483-1-git-send-email-jollys@xilinx.com> References: <1548794301-30483-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)(136003)(39860400002)(376002)(396003)(346002)(2980300002)(199004)(189003)(110136005)(54906003)(50466002)(9786002)(14444005)(356004)(6666004)(36386004)(26005)(336012)(77096007)(186003)(51416003)(47776003)(48376002)(76176011)(7696005)(2201001)(426003)(106002)(72206003)(2906002)(81166006)(81156014)(39060400002)(8936002)(4326008)(478600001)(63266004)(36756003)(126002)(486006)(50226002)(16586007)(11346002)(476003)(305945005)(7416002)(44832011)(446003)(8676002)(106466001)(316002)(2616005)(107886003)(921003)(107986001)(83996005)(2101003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR02MB5015; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT053; 1:POCAFKSG6rtF1FWIp+NTOASiJja8UpN4s9wSs+Sy7D0ApXaweFHQYd59oAXk0Rk8P2U1W4Hl7iWYbE5hVcpfE9g2rlKJM1Gdob9B2zTVylS9NGlBG1VVqZ24aootFmC4a/R8RMLMAfnJjykwdgCvLfws76AKPNYfE6Di1Oq5nOI= MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2f1bb559-a50a-495c-43e1-08d68629c8bf 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:BYAPR02MB5015; X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB5015; 3:xqulMMTqnNMFMki4o5EtrJPUX9ljzrrxX6eqzXMdjP23rDFlOkTFv9S4yicSImkS+LVr11CoOYSh4npNSydvOMH8c58Idnbw9oeguBQKorFWK1FROhKKHekI1fFnP0m77ngEPOV4QgmwCx24MCeaXtIeTEcsAosoUxxiftcwfJez0jCH4c16g09Qwb3wpR2TL/6ggGoBnGr08DuT88vpQ4Hoo7U8JXfZuC7s1jL+xWGPONP4I6dExRi7c5A+Cv3O37kpK6hTpFQ3m7AId2sKytisNY2zbktJ10XXCxJZH7DVDsWknrp2RFMRD1UcwnDxSqhxu0JOWAIoGYK69bnPt1cHmXi1pyHmUqO4kmlz5hPMedn7cgUMe5trfeCJbSRq; 25:UWclD4c8eFVGiZWTTo78n+dcrNGbJkBXX0Q4syJL3KMI+j4DvUXeTSNfGr16XdeIQ2WfjWHjE721pcsUvslZ/WT9bt+d85PFFjGVPmyZpwtFqAu2eADPXxPVSY64LTc9FafI9S8dJwxYKtN8xJXjC4NmqGSvMQVTIrTs3Jy+yoICxiG+oWMdTze9TCS7ju7KZYWTf7rqP0/Uyt9GNsapcd4yrVG6Oaa5Xnz4/+LB+MQgVZ/IO3wZ3Nkp0sikYUt8hwiAyvoPOAtjolEzDRL7KjOMTvQJ6+SkwcEYpHw7EkJqkc/r47Dj1QSCTfF/px9RGb/qucpH1ruzsaONyBh2OQ== X-MS-TrafficTypeDiagnostic: BYAPR02MB5015: X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB5015; 31:FIyUNL5eHqKq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nJD1ws8j9J/3EtVhGbPsB7FVhJelWRXhXBteZauxxxeHZ3/cyB40eK3pfwH9DhbEz8uF01DmRmT//YBPtFl2gfXPS9u1zVuXM8+zZ5N+ZQBhTktQNAqrVy5m7YVbKUr2HK86kUoDgD5oLohigeeCVGLxCR8lPdUbn9ZZiaF6W91z1BQcq+NdJg7htVULZQjGGF5vstJvvq5lKdt9y9U2yRIvZSDe7P6fCRzjNhPxWOqkxv8ekWVP0wLOxIghKzu0uiY2dkCVua1gVN43vcsXVEinC27Q4VDt8DaXsAQqlo/h5NY8Xd+BIRNgDcSKubUoVFHnxDBFElD0ScRwQOU87WjR/Ruivy8Sqp X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: Lz9uBC17GnLo2+WJIwuyBSpCbFN+776JYKzos1ZZA//vAWnv+OvJalq+sAUb0VGBYLsTk36V9VffRdpBlzpc+zVY5B5ZiEsscyBqWMIsJh5yMDwaVApRzxJHyip1wr7roylBOQcizisqXzey1vAf6YbD9j4CSMnGH7ygZYLBJtkgX0oQs7YkzwRfRjSCDlY+NI5yxp+blNmJBJjf40IpD/69PWkLrGGAmPaJBOP2h6KUSKoHAUkiT8XdPq37bPrc5sXbpKMGfHIjQNjNgwL4k44sI2ov1bJ9ZBu5+P4MT+vfVpjJRSuJCHK4QlkhCR6Ils2P3IdzRWW3GiVYpO0l624CgwjMV8/yzeFlBsDiNAVrN0yY18aheqAivjAmuidbOXI334kEFhBmuv5jQdSqi9pkRgGoddzrPF2xqdWBGn0= X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB5015; 6:rgMjsvJB6osaP2MhHiLCGLrBtWl5m7oK7KPbDW+Q701/L/EJpMTr96TdKjmpaQLFPjhpjlFOP95Ya5duSX69to3iHJ+fH3Yj6y9fZ56UgV+axinof0jsTlqJC37iz+4ec2IoezZQrg5WEprdCVjfk9BCOGZntCP5HBhArq+RbCv7PfzikteaVxHNaEtFO2PzwalBkQkNuiDs5NxO23WMR+qAg21fknV24VPwjzmwUJ1msaMVAWxfqaPJcoAdoUPOfb294toIDYVOhcfLpoBjm0puAP6shJowAXXCu3knKLtdb6GDQCRJCarfTThALFmcbQQuWBjDPTgNqMt88NeMLU0VEhdo5PogdaE9Siefa+f4qz+emMMpMZ1eClDk6rA7PLD26Wu4mNFJWgSuvV+dSuAaQYMyx1HVfrz6Uemy7hNFwlUt6NgWVWQfVGZ2Wlq0eNrMTb+siNrun+j6BKrThw==; 5:bLLx/goqcrM4QW7bM971L0psO2vgFGRlE24Cc5DufbuxTUdxeQzgyRRSEzuXtNEsuiZMvKRMPHTW2GDaXYR2crh+7zxTrvh+P0C75lnAik3iG6WXrAFs5XbeZgN8VKhKNPrWH2D1HTHZyc1b98c/Qtx8sI1RZnbKY5CaLANyP1EfOp4JMLAWdH0BrFg5GOm3Fz+uzz9rUIGbifCs1381sQ==; 7:H0vZEW1aX/AQZTZR5r7ao02SlVEIoHVKL0S22FFHN00FyTWT4CGTS8WIMTX0oeyz1sWzvS9uDohomXImU683ga63MrfknVKNIB9JtzadDo04gLrVR/XcpBgkyYAGQbQwpNQkaPoQZgs+kMvWwBhrfg== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2019 20:38:53.7511 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2f1bb559-a50a-495c-43e1-08d68629c8bf 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: BYAPR02MB5015 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190129_123859_400249_1164E483 X-CRM114-Status: UNSURE ( 9.98 ) 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 Tue Jan 29 20:38:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 10787227 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 23E781390 for ; Tue, 29 Jan 2019 20:39:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1353E2D0DF for ; Tue, 29 Jan 2019 20:39:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06F892D0ED; Tue, 29 Jan 2019 20:39:19 +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 7E2DE2D0DF for ; Tue, 29 Jan 2019 20:39:18 +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=aDbtLq9+dqpkvPTgsb4jQkbjWJ4bQO8pDkqBOhm8AU8=; b=r9+5BIFuuUxEeh pjQKAiPsicrK1UNpi1OAo6zT+hrC1n3blKcUA8dv44/6ydyagfct1Gs+Ixi/fiPkzxP6DOAlJCzkZ oeQaY1fBLzA5xRmEI3QDfNpfHFmTFBh/6ZNAQDAela2wr0vhT8bPD3GCbzCv4Cz+LrPO26mMmLbjG Z0W7oAQFYgeXOmf4Xu0r5Y78Cngx95oWEtM1FalMz1UQoPkpnJG2KBsIAVZe0rja/+Z5DpQ/nj9lG 53tThYQP0KqW2XO/3LuM/H4fQTOdM0sKsUUICXTAiDWJHvDNPIJXRZtFjUzFmyxXYSYMHK86aVsoZ WFEeDH/JVQQjdJYlLVTg==; 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 1goaA7-0008UI-Qf; Tue, 29 Jan 2019 20:39:15 +0000 Received: from mail-sn1nam04on060d.outbound.protection.outlook.com ([2a01:111:f400:fe4c::60d] helo=NAM04-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1goa9r-0008GN-Tp for linux-arm-kernel@lists.infradead.org; Tue, 29 Jan 2019 20:39:01 +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=pnSGs9z/sekXqACS8dcM3ARJes8ekF/mYtHhHGqnBMw=; b=jwA8SZKiZCP+Oc0QzvHCy8Mk7yXjdubvThvZldNh05K2+Edv4Ea/rmBXcK8qFxf7AMOU+gn5Se8QQ2bc1Lab7qz+1fKk4vMJyxSewBOA/NX3TQ3dutOR2wO3kd+dp/eOG0RmYFeHkQuiVLqqjpZwC7dTPWWPOy/UbvE5jLCa54A= Received: from SN4PR0201CA0033.namprd02.prod.outlook.com (2603:10b6:803:2e::19) by BN7PR02MB5009.namprd02.prod.outlook.com (2603:10b6:408:21::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1580.16; Tue, 29 Jan 2019 20:38:54 +0000 Received: from BL2NAM02FT018.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::207) by SN4PR0201CA0033.outlook.office365.com (2603:10b6:803:2e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1558.16 via Frontend Transport; Tue, 29 Jan 2019 20:38:53 +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 BL2NAM02FT018.mail.protection.outlook.com (10.152.77.170) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.10 via Frontend Transport; Tue, 29 Jan 2019 20:38:53 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:33336 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1goa9k-00059Z-Sg; Tue, 29 Jan 2019 12:38:52 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1goa9f-0007aV-Og; Tue, 29 Jan 2019 12:38:47 -0800 Received: from xsj-pvapsmtp01 (smtp-fallback.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 x0TKcaYP008058; Tue, 29 Jan 2019 12:38:36 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1goa9U-0007YY-IM; Tue, 29 Jan 2019 12:38:36 -0800 From: Jolly Shah To: , , , , , , , , , Subject: [PATCH v6 2/3] firmware: xilinx: Implement ZynqMP power management APIs Date: Tue, 29 Jan 2019 12:38:20 -0800 Message-ID: <1548794301-30483-3-git-send-email-jollys@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548794301-30483-1-git-send-email-jollys@xilinx.com> References: <1548794301-30483-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)(39860400002)(376002)(136003)(346002)(396003)(2980300002)(199004)(189003)(7416002)(316002)(336012)(77096007)(110136005)(63266004)(54906003)(39060400002)(26005)(16586007)(106002)(107886003)(186003)(4326008)(14444005)(6666004)(356004)(36386004)(2906002)(7696005)(76176011)(51416003)(305945005)(44832011)(486006)(8676002)(81156014)(81166006)(9786002)(50226002)(8936002)(478600001)(47776003)(446003)(126002)(11346002)(2616005)(476003)(106466001)(48376002)(72206003)(426003)(50466002)(36756003)(2201001)(107986001)(921003)(42866002)(5001870100001)(1121003)(83996005)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR02MB5009; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; LANG:en; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT018; 1:Udma5CBRAx4cmo3Xf4AtAe1oHRDoITGw8MWm7T9P0RYFXmWAGXubq7nCf7gCZRDhMWs1K32WUxJNAyP+HbW3IhL2NKUkMP9/uoh+wB2YJGLGp9wPA4Um64RJ0KWrPwXPEhzQlw1QV9r05q6ZcyjMB0BOGk8NbnpDKx2ORIXD1ek= MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3bc698dc-5586-4b59-1d92-08d68629c89c 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:BN7PR02MB5009; X-Microsoft-Exchange-Diagnostics: 1; BN7PR02MB5009; 3:fSs6RZ82vOhYZ+x7sG9d+NAKu9Dvdfoz1h5MVJEu32KwQuF+poBnOW91jOghLkUZUEh6m7qXVNTOqZ/NpK4iydW7Bng3H/NRE4IMvq4XIuQErHa07Mx9oXbqXB5ZSg7OiqAiC/UKJ1oEbFFRw0EIjg2EHoGcXlbXANZSC8w/gl/4mN6D8Dk6nSrZ3Jyy6PgspI4AeiF/fN80Ukblj44CHJDZiT31EhlLGJbOp7Ql9oA2eJc/4EyzFWb8deY8xjOTrUNw4pvzTYH+uVNxVhPJ4DYj09OWgZ1eo4OGeoK2s3tchraT9elj1YsSj8lPlaaJt3l6S1AY0UYNxojdr1hMxiQTkeYuEgvgslsppRNxIvJcERVhoNgWofTf19V066gi; 25:M7w7l82lNuK74Xq8z2cBpIzBsYgeU0LS6D4Gb0Ks46PwbjqDczx7gmsZ0q0WBoyZFx0Y+OroDqePiexKLFJS7YmycVYszXZMyHm0wWGfnN56o3vhw8pNjEc99Bua2tnhnqUA9nm7Vo0QcLr9ACJdT2E8h3W/hD6BN/K1RfBFM4niHS4b7gejmBhFCR0xmg35OC9EG7gLXhgHgtcaIkaLwyOO0cthPskvG+eWG4GbN6p1eA2ev8jhYQb60CDdwXeewICT15C8QZKA+9HFgfMM0Vfs+VxcLo3CZA1SIboMOKSb4KQt/2h1F3viXFxRG/HuVhgTN9ymbdwiXcH+M2dfoA== X-MS-TrafficTypeDiagnostic: BN7PR02MB5009: X-Microsoft-Exchange-Diagnostics: 1; BN7PR02MB5009; 31:8NSNYkBE4JJAuujmsy7dcS+29OZDxmZ67aCvshJEE+G/pN+z0a4NGB+Y/NehQlNzEYbUiORZajFQaLTxNyFVFT7NigwsxprhoJGb9gWXinuA2o+mnbXPEJki+W4mKcZ6lbfKKYud4oTUxQkV0iVBdmfuyEPjY8w7wwuOmBJkjILEI5ZeV6s94OLEhBKSw6jOoIeKPrpS1DZteoobZ2EJF26cDog4OxJJuA/efS3GU9I=; 20:arXz0dSuOgbJFqJzYWlxA59qmTQEemwLPQ3FU+5RoAp3WUu+Nd1H9x39ucI/eDZPg7aAH1rgjyW1oHsCFVlUQk7vTZtky1nowxx3OY91u00ApoNLGLPl4WyyrlNNPnCAQwbLp7sOXldRpd62GrRruIA/ZA5sphVSlzXnYgZbjgcpRa/A5N56QROXF5TTNjBeGqtHEyk6dlhhHmj8m5gDuv4Krtl4jILC1nmXBzicHHbvHoMkZFMtrdxamBHOPD79QxQAVurcNZ/Cw6w98y4irb180EAsO3NC5QCvS4G+b6vSaAz4sfO7QHWYdb0fY0OvuejHR4ToCi7FSuDEKWO/lsX2zwQ+FJqsOOvGJdVUP81tNu3Sab1276EJjbVwrdheX0HoJt4QKCOEvVOSTpWgQ/Lk9efe71rq1EpKdBbtMt7O4MGmG3V/XdRY+slb8Evqa45Aw0VhooHe4mhSLhWaMAp4sZ/7hlrDPYTi/oTojKG+3wvv0QqhqrbYV4PVxGng X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Microsoft-Exchange-Diagnostics: 1; BN7PR02MB5009; 4:hn8c8fxajMcA4OuN2PAN7U+CXONroKCb8/BP9Bfx1H381SAYLH+ZqczD+BsGzip9rFh/CegHOBr4oh+wJLCtlCYMU5BQezmgAooEO+3F3RXfVGzGkDwkYJbIz33DYhsiK3gh4tEw8FPZXtzyoSht5Gp67zk1c94IgvcqQibInsNYi8i9/X/F6iqKBoVNJkyrb7+P8JAG4bwmine27kqVGAZlqwq4Glr1UwnRVYAQi6wGWuq50ML17rHLEdOihyoOpA9SXTHbJLMTYFy1FepqcmT7SsqA+Wy+nC00xi7by1sqJ+2/kfhFwdoZdFqKVWEJ X-Forefront-P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0kKjuEBgI2wmWkRWG9u0plHqsvCH7CR6QPwD03quUTLOkLxMa9lp1D7TMcLdFXNdUFXbYOoRHty8IIE4CBolETzIw9ed0RDCzl8M/RYk5mJN5SRtdkhfCHK1xFkevt6mN7KgDrcJjl/kSeNMcY5d1+wmJtFl1uzSAdjv5pB0u6R3FQyI7H7YrY8W9WTcxZR5bhNGuahNdqT1NIaI7xNKf8De2T6JO4TA==; 5:sRqvRN3NcnVYNnvjdnR8EGywlr525tyTlcGnb/nUZ+UlX3exRH02zZ6xo0mmujXH9D1/Ao3/qDTO57K5ESIOxJ7ned7OW/ZprjuhrSxyDZcmbytVVK6GawXZU6Fnk4G0Abmysw1C84x8K1KxcAjKCA1sXyXjk6hRiat3WGcX034SwnD2qpwKKOX85BhbdEru4RiDAf8+KuZgTou4D4eR8g==; 7:i7E/tnpJrrXGC1WNpTd3iNPZQQVBe5O79b0ylHMGvOYegQliMjtoMwA0K/Zk6A8AtA8j6ify04cmx3x1pHe29MljG9Qi3KXwnFIrrphNfq4L3auNCPEF3TePT221UR53U0VNhv8yVZXVdDoQXuDvFw== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2019 20:38:53.4527 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3bc698dc-5586-4b59-1d92-08d68629c89c 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: BN7PR02MB5009 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190129_123859_962216_2760E662 X-CRM114-Status: GOOD ( 12.19 ) 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 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 70b5037..8065e33 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -507,6 +507,33 @@ static int zynqmp_pm_reset_get_status(const enum zynqmp_pm_reset reset, 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, @@ -522,6 +549,8 @@ static const struct zynqmp_eemi_ops eemi_ops = { .ioctl = zynqmp_pm_ioctl, .reset_assert = zynqmp_pm_reset_assert, .reset_get_status = zynqmp_pm_reset_get_status, + .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 07c587a..f84d700 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -28,14 +28,23 @@ /* 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_RESET_ASSERT = 17, PM_RESET_GET_STATUS, + PM_PM_INIT_FINALIZE = 21, PM_IOCTL = 34, PM_QUERY_DATA, PM_CLOCK_ENABLE, @@ -208,6 +217,12 @@ enum zynqmp_pm_reset { ZYNQMP_PM_RESET_END = ZYNQMP_PM_RESET_PS_PL3 }; +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 @@ -238,8 +253,13 @@ struct zynqmp_eemi_ops { int (*reset_assert)(const enum zynqmp_pm_reset reset, const enum zynqmp_pm_reset_action assert_flag); int (*reset_get_status)(const enum zynqmp_pm_reset reset, u32 *status); + 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 Tue Jan 29 20:38:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 10787229 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 BE6B41390 for ; Tue, 29 Jan 2019 20:39:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AAA382D655 for ; Tue, 29 Jan 2019 20:39:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E0B62D661; Tue, 29 Jan 2019 20:39:56 +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 ECB212D655 for ; Tue, 29 Jan 2019 20:39:55 +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=Umd/UYrxrOhyEV HDYEzvQZD4jI8QmB3YU3srjE7ljOYpLEZtSArk37FZlG0A1mxX+PqSE1wcRPaOaKx0kJNEuwRUKZO uuYUYRWBwIkavkeAuxQSigNLLPDQtNuTwheO8QwRf6ieCPfJ7Vd3QABckvYqK3dOfprhGtf88+bRD xCO36Sd+pc587qhtn/bez8jDzlIBkx/5ohXTss8F/DYYy+uGcl/KdC92X5HdxHovE4bpo0Lc7iF5+ TIma+Koj3WfgiFF+/TWMAJwJBVmus/T0bFgoZDEPbjdG1Y9VUGfLbuijmi+Cj4b0ltCai367rYw6V gVb4guHCxEMg6Z47oMIw==; 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 1goaAi-0000XN-66; Tue, 29 Jan 2019 20:39:52 +0000 Received: from mail-dm3nam05on0614.outbound.protection.outlook.com ([2a01:111:f400:fe51::614] helo=NAM05-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1goa9s-0008GP-4F for linux-arm-kernel@lists.infradead.org; Tue, 29 Jan 2019 20:39:02 +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=JnnUqQJtGELUwhFmxmS63KTDI4k3x6apZcZJ6CZ2llilZG1zFJIP0iNpUWrPv0RbCm9kR9cX5NJkgYX6TPdcVLCGvKIphyv9FBn7Le+F0/5B7Nim2LV5IebHf1QONQdXia708enS6uLYAqp7T68BZG6rY2ocgvw78//CP1I2DI0= Received: from BN6PR02CA0048.namprd02.prod.outlook.com (2603:10b6:404:5f::34) by BN6PR02MB2641.namprd02.prod.outlook.com (2603:10b6:404:57::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1558.21; Tue, 29 Jan 2019 20:38:54 +0000 Received: from SN1NAM02FT029.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::207) by BN6PR02CA0048.outlook.office365.com (2603:10b6:404:5f::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1558.17 via Frontend Transport; Tue, 29 Jan 2019 20:38:54 +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 SN1NAM02FT029.mail.protection.outlook.com (10.152.72.110) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1580.10 via Frontend Transport; Tue, 29 Jan 2019 20:38:53 +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 1goa9l-0007iq-47; Tue, 29 Jan 2019 12:38:53 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1goa9g-0007aV-0S; Tue, 29 Jan 2019 12:38:48 -0800 Received: from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x0TKcaWK008060; Tue, 29 Jan 2019 12:38:36 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1goa9U-0007YY-Kh; Tue, 29 Jan 2019 12:38:36 -0800 From: Jolly Shah To: , , , , , , , , , Subject: [PATCH v6 3/3] drivers: soc: xilinx: Add ZynqMP PM driver Date: Tue, 29 Jan 2019 12:38:21 -0800 Message-ID: <1548794301-30483-4-git-send-email-jollys@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548794301-30483-1-git-send-email-jollys@xilinx.com> References: <1548794301-30483-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)(136003)(376002)(39850400004)(396003)(346002)(2980300002)(189003)(199004)(4326008)(7416002)(356004)(6666004)(54906003)(106002)(16586007)(110136005)(316002)(39060400002)(76176011)(51416003)(2616005)(426003)(486006)(8936002)(81166006)(77096007)(14444005)(476003)(7696005)(2906002)(186003)(11346002)(446003)(336012)(81156014)(126002)(8676002)(305945005)(26005)(36386004)(107886003)(63266004)(106466001)(50226002)(478600001)(44832011)(36756003)(2201001)(50466002)(47776003)(48376002)(72206003)(9786002)(921003)(107986001)(1121003)(83996005)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR02MB2641; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT029; 1:KkTLsWd84p66RDItUqqnwBz3Q3NL221wnVGB8aoMnXKqyZiUB62cieZ/wJ9YrMytmOvtvPLgcR5ifC9elNBN9CU0lZAjNrEo6/d47jiIImcQVlssF/gYOSi7P/bCc7OUoKYPSzjhbMS3tM5mzCrYbLPfe4nFV0IcITvhn0ce5qg= MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a74f6ddf-8c1a-4ae0-cf2f-08d68629c8dd 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:BN6PR02MB2641; X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB2641; 3:5bE999v5Fua2o/zE6jVZsf3qG068YQpg0MY4zvZiqETIt2S0DUGfmX8ctxZ6jaL+MIHMSTBxwlsU6kcEKOxR8CN7ScZZ3Ioao31S52psppMJls8bim+6sv6eHbyZjd61cSLLbpc3AbCg7qpBXQRQFZxb0iz8o688o9MUriAa12YDKen/rZcboGtzHaoi09/ud2rp5nki4vfOWyrxYE5UBwBtBVryQatIKCngeu6UJ/7DB0qN/3AlHcPJmvTi4Dr1AdVq0CIDlxyYtfgwCJSGT6Au+V9np/AMzSpfO/4ltZK4kVNN3yHwU/ssRCmQSIbdY1++CjSF2ibIBVcyYqT8GoTM8xQVx75BFHr8OzouBDsJJhKHRYYlvMOLNgE24LG9; 25:J79yoQy7JIkQMrA+UadX/xqrnt4pWRYJFZj5LMyeYrrfEVRUtfYt0/FnASwqocDmqZS/TILbRUPGnOWgCeiERYbF8Me0zZNLBC3X+Si/nD4+8hY1auoblNnHW4iXoIEL9D8v0FscrGsd2u1dLqbnj4CKHVOPkC2gdE0EoXDOXgaH/t9/h15BrBFDmpMSVGiMc95weTR4uuiW/WVJrFumGPuWijZXS7svNX4T4w7OBOd0geeI86zs/v+M3X4qdeL9wD/FPdOdOP623Lx8mG85OaO4K5h3VpRa6Ub3CnsLOvLcqiAB7Xia7FVIjCkoWs37a+35+Swctjdm+/E9TX06mA== X-MS-TrafficTypeDiagnostic: BN6PR02MB2641: X-Microsoft-Exchange-Diagnostics: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bBxzUHijMKayGjc730U7cIoeov/AVijrWq2a2lrt/aXIA57VUqL0OaGOPexYXmsFcTaGTi71Nf27JhNrbiN/Oeb6npaFJdmiwyStX6+L/Hq9TBFog+Vrezm9l69c0PnY3qtAum2vI782wR1G5nJACXzzs2l5TNsYM6mryC4wCeOCyNTplUDvlPRpKE8/h1mv1/XitFlqMKCsjz7ZC6Twgl/nCXhCaQHY1vlb3ukF27nkqa4CC/4vj8iD1Jt3ffb54DOABmcTJrmEre7tnocA+te8hsS8cltofn0yfFylV4t5msL+V6tMmdXhZ/uvhnVbDLphmTryeTH9sJgk1gCMiiq6yteuvTaQuMJSVcyB8e444sNdSWti9ieHcfCpMThu+eDVK7VC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: bz3zmq7fg0HEQy9UG/GDyLYSkF0T+5/8NndDE93/SHH0x1X+CXHbO8r+xkgfukmaPQ5m9j0mZBLnT4NJ3ZBxWbB94uLoHYxAtzYhmmvUvtTPSnvuQsDyURApYEectV8CBUV+Dqb3q7er9368vZKrhjKEDaVFAv6/+OjxcT4A9KHsyw8x0v9KO6g3H5Hi+9aS5loNauV6aAGybFDiI10l9sqXptiZOtdiOhGBk4dlvpyczGSq9l/gafZhQpmljIWRZX7grmHp/N8LVhbiphzHG8CIspr0nRUkrfoIUkHcGkRZrMr1wqXJIESuwv8j16L9h0s1Ltqqd0ZL1I3wQp6ZOpabBQ9jmFuVd4yeLxz+JIj596C5NBjM9IiORzEb0XHzTltSg2ANZcIcg30pauelf9ov/wyZxZt54HQlqonM5zk= X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB2641; 6:gySsulw7fQ6uZ4cfQXGEpi461+lsK2su/DZFbI6QJG4nafD/AoqGysNIZErKmzlQRWNFuopBsOFZpqT8YY4Q8dFdBfKLsosNeVMZHrOKvwD3KvyqPzCVfBYH1HLFVqHGyf30c7PqpW2Fp8GEcBTsVyl0tOvX4JjoxeS/bxDyH0KtbAJGJmFoUvLWV3tL1/AUi6HGfIA1Cd9hb6KVTJdp9BJsoMnzoCGCHITFGb3aA4Odg2WIMUtcgWHEozG2YwyiWzi7KwcwAaULkKkuS56w7BmTWO0MztkMiObS+y0O1G0wSs5W51gRIzktqcya4VUNAERLbLqomeHk0+m7jwLIvxW3FeLCDXAesXc3wZwAFtb7d9w05IGqTyy9KNpAi2wcYSUgfTbG+4hjIwkGf64YHoTuYvQOM3zzegB0sBSLsJcxh0IokbaePNiboyP9oqXcK7P6HgOI/V07tomxb8sLCQ==; 5:/oPHUtpuHc2wuE4o4wbqUqze/M3zZqiD4sqw8z73oZGK5hT5jcowc15jnbSfIoyLlJLWDuPQ5mjYlhmRDkzHfWZzmxigJ8G5Ifrlm62J0cWwlNzbh63syaihzgVo/LRWwtY7/HS3v1guZAXTT5oQV2kvlN+Xd9XXWtFuPWNRkQgzCHJZVv2NbNMEMQlxtHQftDoewwF/hdiT1J7nHCVM3Q==; 7:EEmDtb5vFmsu4jOXbr96APcZtgITyrMYgnEoTZWAFIgcFeFPFDucKAR6PzVGNaUTv4R6xBi9/BO8QjT+RUW60g8EAEFLJvOeG0reARHwgQeuFf9XvFL7i7PmG4CI7MlYtt4RT6tmD8HxPZBFR1y4Og== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2019 20:38:53.6010 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a74f6ddf-8c1a-4ae0-cf2f-08d68629c8dd 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: BN6PR02MB2641 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190129_123900_369003_0BD84EF8 X-CRM114-Status: GOOD ( 16.98 ) 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);