From patchwork Fri Sep 14 19:39:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 10601173 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 95A0D14BD for ; Fri, 14 Sep 2018 19:43:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E6182B742 for ; Fri, 14 Sep 2018 19:43:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C88D2B75B; Fri, 14 Sep 2018 19:43:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 A3B002BCFD for ; Fri, 14 Sep 2018 19:43:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2VY/N04Fw6qxfKdtyqEkOrwxxL8z49P9DGs1ww+FMb0=; b=u1oDZWXIvGUfYC sS5MFVtkQjrjH/vP5SmN2pecqvjAiOngHMK44sIlPD9iKKZ5Bj5v5fMVpn0SqM+VKqW4/l70cY1Bi 3UKVkBtduXqsMfwJr7GIRH1qdUeIzqAroC1IzbxouBVHyEiM6sbkOFjwYLGBlSu39K+7G72ELqkDq 6UmAel8gXB7xM5f+nQmD+jW1RtpPRddQMUMLeM+5rLlRxFvJWMqf3vWvYKnix3aMzR2fqTNXQE+Wi cQ1ZUOt3H42o9ChlNClgKyiAyCiUBuWBaigFM43Mnwb4NUcVCD+FA1ycWUxYojMnRF9cWuJ7xdKPL wGj2Kaw3xq3Vr0BB+S4A==; 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 1g0tzm-0006Ku-OL; Fri, 14 Sep 2018 19:43:14 +0000 Received: from mail-eopbgr680082.outbound.protection.outlook.com ([40.107.68.82] helo=NAM04-BN3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0txG-0004Ab-G1 for linux-arm-kernel@lists.infradead.org; Fri, 14 Sep 2018 19:40:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JrJg8WuU4Q5FHv+Mu37FlEw6dlRWX2QSWzPFzlLmDbs=; b=IoaWJQEkMzrz5/E3p6u0ViHBbOg8vnPLfwKI9Yz0aMEhLlS2D2BGthY9tWJUrNefE2qKK7AN2Uov7ZAFyp4w6bffqtP84TzGrAQSqPqIgy6DAExmRR99ekzS1h43eTKz7Muymw+z42Bfqp6sWYpqxA/iA9h9q7wUL/l4KsNUR0g= Received: from SN4PR0201CA0047.namprd02.prod.outlook.com (2603:10b6:803:2e::33) by DM6PR02MB5113.namprd02.prod.outlook.com (2603:10b6:5:51::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Fri, 14 Sep 2018 19:40:19 +0000 Received: from SN1NAM02FT053.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::206) by SN4PR0201CA0047.outlook.office365.com (2603:10b6:803:2e::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1143.15 via Frontend Transport; Fri, 14 Sep 2018 19:40:19 +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 SN1NAM02FT053.mail.protection.outlook.com (10.152.72.102) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1143.14 via Frontend Transport; Fri, 14 Sep 2018 19:40:19 +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 1g0tww-0005SG-OB; Fri, 14 Sep 2018 12:40:18 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g0twr-0006TC-KJ; Fri, 14 Sep 2018 12:40:13 -0700 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w8EJe20u012223; Fri, 14 Sep 2018 12:40:03 -0700 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g0twg-0006EA-6D; Fri, 14 Sep 2018 12:40:02 -0700 From: Jolly Shah To: , , , , , , , , , Subject: [PATCH v4 2/3] firmware: xilinx: Implement ZynqMP power management APIs Date: Fri, 14 Sep 2018 12:39:49 -0700 Message-ID: <1536953990-12755-3-git-send-email-jollys@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536953990-12755-1-git-send-email-jollys@xilinx.com> References: <1536953990-12755-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)(376002)(39860400002)(396003)(136003)(2980300002)(438002)(199004)(189003)(126002)(14444005)(51416003)(305945005)(7696005)(356003)(8676002)(26005)(7416002)(76176011)(476003)(2616005)(2201001)(11346002)(47776003)(426003)(16586007)(446003)(336012)(63266004)(478600001)(186003)(44832011)(486006)(72206003)(106002)(77096007)(36756003)(110136005)(50226002)(6666003)(2906002)(36386004)(107886003)(316002)(5660300001)(54906003)(50466002)(4326008)(9786002)(81166006)(106466001)(81156014)(48376002)(8936002)(39060400002)(107986001)(921003)(83996005)(1121003)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR02MB5113; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT053; 1:Ypsf+rMkjPXw8h5t5pHzfSnQ7i4KVhrotMuhT56LKXpFfhcMKgFleQLd3IyfBWSYXM22TPCluEo636LNdKpmOut759ZWO9VEVPkOdwiiuL/ZWFQyXdBIJX6H8gedpCtt MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3ca4619e-26a0-4206-21fd-08d61a79e780 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060); SRVR:DM6PR02MB5113; X-Microsoft-Exchange-Diagnostics: 1; DM6PR02MB5113; 3:vS4ATr6OuK0wIoyctOl8DKefn6soynT539qoDoOmJ0/TYNl4SqKgLm8nGrvebRE0wICTpyxxnp9RD9v2w6E65ip+Jr/271A8Aze674eRjQ4IfKdtuchhjT0VNucxczaZrHcNRVQm5FF+mbHZmFVajGDuV0WHiWfaFjb0Psb20ZszKckBq5+0Z0LWJAj9KkKT+aw5RZh5FmrqbKOJRbTMXVsj3oGLt1VDse9/ta/FmENi3yqQlMfFN+oqu37MXsc/qENrAfk6fiiqAQRjB2cwO6ouLQqgp/F/073Qcw2LClL5NunlI8kiEWQv/ILbkSRw3s1Ls5l/mnd0NsVO6fWihn31VF6sqorADiCTQ8Iu6GQ=; 25:tPcvG1n3SzZQfsFjPzdwamQh6gv7XMM4giE5zJdCu8A/5fsiKcY1DTNYoThRlq0rRTQ2oU8SOxk6RoqPtqD88dlGSHwUS0YUq6ol6dJHFazlktBXV4SJLmEU/RBoslMtojjOZMbZ2hb0v5R8NAmXrIdTMTw22SawxmX8aZrxF1wZC6OafT+x/aOPwQwUqsIDjfprkCNyHM/363VVPysv5G20yZrinsXCFwi/tLrWT/UUxPK2fd6FHU31ReIdt+W82zxj+4nE4kxFLpcmF0Cx2B0WLvGsHtggdyIFOvRcY3H3BFW9kNFrE8gXusQf+aG7eISdWWBdNX6/E1enmif+GQ== X-MS-TrafficTypeDiagnostic: DM6PR02MB5113: X-Microsoft-Exchange-Diagnostics: 1; DM6PR02MB5113; 31:loPVp4HnYcuP69hLBruAEx2cZPbCtQZDS0x3h79ZLltL+vEWp5nxLIROhM/V5FEF0rBv64d3GVSZBU8Hw+RLdbHi1JeQSlwghH97wfmqVxaaMOVAo5TPv2r1oT6mvtWXbTfKToapw3rVfa+iEiyyL16xh5jWR7nHhub5y5BItGt9uklcn33zUvVoifr808nZEfLKLUb/T2GSEYountNBzyiB1yiHTEFfibP6gXkr3yI=; 20:JY3Shqs0uP6RDHIX4GZmYK+JCbDjbvAnQHqsHjhJ+E7cecYSfLqFdG7llq+pI8ByzoHbHo/k0cqbBPrk79QhB+ha1S7qJYaSpvLKkeR2O7XDNCMR/9KYK2SQyIrGJbLT8z0RjKIJrqUoh9YhTgBpegMbqvY0KwqfKsJhb0g+EmQmoAEBclomyqxRreR8iwFenJkd2NjOyel1fKfi5EpA1WfAqUvHVT2vg/FJ1e+sxLcRMbi06HjY4McbQZZ/pGByOUAgvT2sXEnW35FB8rOXbaHNfyPoKqcy+Sawnj9agoLyDIJotySJ8KhP720I+7YBZF2P5Fwo0xLpy/oSmhCQ/SAIKmL1OgYMQ0wRAbnysk/4BVOFroIWdnIM8q525NtWSvINjWKkhfXGXJcifEX1NTP035qT5Yujp091SlgUhvYt2AiskdKaTUjMv4O8wj34CTZihPTx4aY8ZYRvp/XhNbYg7ZaSfb1T2mFQP5VWx9IfqMR4WNFanvu3O4lCv53h X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(10201501046)(3002001)(93006095)(93004095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699050); SRVR:DM6PR02MB5113; BCL:0; PCL:0; RULEID:; SRVR:DM6PR02MB5113; X-Microsoft-Exchange-Diagnostics: 1; DM6PR02MB5113; 4:Ai6ub3xbekXxRRI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AAjszzRGq+jSXXTJOpptRD/I2J6jIHER2K5Oy838l7vA34R6KXxY9GA0tUMhENr9X1o4XwT+5sLAHyWoN6jmNaoxlAXUqkb2h5X/me3g5scsnCilzGZMwyF7laxBrvE63pLDERQ3gIEX4+a2gt+9D+0W6ByAQqHo3TbGA7r5wCjbOwGThD7gxX2yqPladOyAxUP9YL7cukpeNopGAD97BYNBf/qEE6EVctdzgGY8ZUo3d5dqI2/0VNWZHGE4ZsWrGKY3ut4xfojOwSHJ06AUsM0hpWf6wkMSeq1OkVKRPQ7dlmCh2w3vWo7uzy1bcMuSc3XL6IZgj3VjaObZTlZBRDX6ihfCKAdGmvI5BP9S79OYkYDCR1UfTA1Xtqlfkupj/76n8b89yY4VifWT7JHot4c0V2GnZ8U1SsdlmWd8ZqgbALLb8rKA==; 5:iL4TB/rR/6MdIiVK5y3BBshDuz/3lMg7M8LW3ZAlPTIW4NuNjbRyGtqYbRCS2j/BLCloCFAJ4iVTjyBSFlLjhuB+nuL/wETUdw0slOUFzB73ri5IIGzocCB1E2rkln6c0u0+AkN+fuFZdVSq+atR5TwvrtML7u/k4GD/DKsi8zo=; 7://gobCvAVaxQDniGwgffba9HEY/QCVUUyMbpqDH29lN4Cq85hT0bdNwb/+W46XH8eqDL2mkzX3j0pdhtmNq7AW3DjxWdbMhgIyWFePR8N1EjN/E4r/AxtICbnUTTQH5IVzjmcxzyKS7wsU07Aut0k48f40Z6RjxDf2IFk8KRSMezTylaMxdlLHOz7R/dHe8foWEjQNbgNbOunUfe8fJuk7Hx/WxuK4wP6iM07CELPQszRFYX/wqpyKmEDRlWT9pB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2018 19:40:19.1490 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ca4619e-26a0-4206-21fd-08d61a79e780 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: DM6PR02MB5113 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180914_124038_769789_645D7626 X-CRM114-Status: GOOD ( 11.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 From: Rajan Vaja Add Xilinx ZynqMP firmware APIs to set suspend mode and inform firmware that master has initialized its own power management. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/zynqmp.c | 29 +++++++++++++++++++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 20 ++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 84b3fd2..c7a3b6c 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -428,6 +428,33 @@ static int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id) return ret; } +/** + * zynqmp_pm_init_finalize() - PM call to inform firmware that the caller + * master has initialized its own power management + * + * This API function is to be used for notify the power management controller + * about the completed power management initialization. + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_init_finalize(void) +{ + return zynqmp_pm_invoke_fn(PM_PM_INIT_FINALIZE, 0, 0, 0, 0, NULL); +} + +/** + * zynqmp_pm_set_suspend_mode() - Set system suspend mode + * @mode: Mode to set for system suspend + * + * This API function is used to set mode of system suspend. + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_set_suspend_mode(u32 mode) +{ + return zynqmp_pm_invoke_fn(PM_SET_SUSPEND_MODE, mode, 0, 0, 0, NULL); +} + static const struct zynqmp_eemi_ops eemi_ops = { .get_api_version = zynqmp_pm_get_api_version, .query_data = zynqmp_pm_query_data, @@ -440,6 +467,8 @@ static const struct zynqmp_eemi_ops eemi_ops = { .clock_getrate = zynqmp_pm_clock_getrate, .clock_setparent = zynqmp_pm_clock_setparent, .clock_getparent = zynqmp_pm_clock_getparent, + .init_finalize = zynqmp_pm_init_finalize, + .set_suspend_mode = zynqmp_pm_set_suspend_mode, }; /** diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 015e130..1424170 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -28,12 +28,21 @@ /* SMC SIP service Call Function Identifier Prefix */ #define PM_SIP_SVC 0xC2000000 #define PM_GET_TRUSTZONE_VERSION 0xa03 +#define PM_SET_SUSPEND_MODE 0xa02 +#define GET_CALLBACK_DATA 0xa01 /* Number of 32bits values in payload */ #define PAYLOAD_ARG_CNT 4U +/* Number of arguments for a callback */ +#define CB_ARG_CNT 4 + +/* Payload size (consists of callback API ID + arguments) */ +#define CB_PAYLOAD_SIZE (CB_ARG_CNT + 1) + enum pm_api_id { PM_GET_API_VERSION = 1, + PM_PM_INIT_FINALIZE = 21, PM_QUERY_DATA = 35, PM_CLOCK_ENABLE, PM_CLOCK_DISABLE, @@ -73,6 +82,12 @@ enum pm_query_id { PM_QID_CLOCK_GET_ATTRIBUTES, }; +enum zynqmp_pm_suspend_reason { + SUSPEND_POWER_REQUEST = 201, + SUSPEND_ALERT, + SUSPEND_SYSTEM_SHUTDOWN, +}; + /** * struct zynqmp_pm_query_data - PM query data * @qid: query ID @@ -99,8 +114,13 @@ struct zynqmp_eemi_ops { int (*clock_getrate)(u32 clock_id, u64 *rate); int (*clock_setparent)(u32 clock_id, u32 parent_id); int (*clock_getparent)(u32 clock_id, u32 *parent_id); + int (*init_finalize)(void); + int (*set_suspend_mode)(u32 mode); }; +int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, + u32 arg2, u32 arg3, u32 *ret_payload); + #if IS_REACHABLE(CONFIG_ARCH_ZYNQMP) const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void); #else