From patchwork Mon Jan 14 19:22:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 10763331 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B194D13B5 for ; Mon, 14 Jan 2019 19:24:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A17E3286CC for ; Mon, 14 Jan 2019 19:24:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 932CC2877E; Mon, 14 Jan 2019 19:24:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5D50C29E7A for ; Mon, 14 Jan 2019 19:24:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2VY/N04Fw6qxfKdtyqEkOrwxxL8z49P9DGs1ww+FMb0=; b=fQDRJocQoGYpZ6 SM3Qdz7Bo0Q7d7algzU3GWa6mwosL0lm4mg7/LOnId/ip7YizyyMceI+pYfRIi5FqfCbXGZL3wzTT NZlzikMs2G1LsIHMghvVASjyVg3UlUPOQvY92JAily0UHU6x3wuN5NDFx8pdCJPKAYVxSltRAxHvy qbyU2ddqd9AZ8+suu4uynn266Qw88mleVy1uBoo5b5BEETfJaNig0S4gf3UKW6wUeExYQctbLDyqU SNTIb9prLEdDg7WYA2FijuFaROG3L+dQBV5VM1Mz2P/xgfLw6AdSP4ibpERgU99p5AtjaQ6ukKBdb WpCjgtCj8BGF6rWN0Ffw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gj7qQ-0003GO-QS; Mon, 14 Jan 2019 19:24:22 +0000 Received: from mail-eopbgr700060.outbound.protection.outlook.com ([40.107.70.60] helo=NAM04-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gj7pZ-0002Hr-Ia for linux-arm-kernel@lists.infradead.org; Mon, 14 Jan 2019 19:23:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JrJg8WuU4Q5FHv+Mu37FlEw6dlRWX2QSWzPFzlLmDbs=; b=5U3BVuAMZPpFyFSr/4cpovZrbZ5Ev0p6HaXvQfOVIe6WlYomnyhPr1i07xFhDGCAbNhglPsRiLBaeX+ww4tTsyf7lOTw/TyiMgXNWl5fi//kirUF7ZKV6ci+CDbggLexwgjk63ucM+OVoD1K4OnseNpeuQlKJXvMGjM7fkHuSx8= Received: from MWHPR02CA0046.namprd02.prod.outlook.com (2603:10b6:301:60::35) by DM5PR0201MB3509.namprd02.prod.outlook.com (2603:10b6:4:76::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1516.18; Mon, 14 Jan 2019 19:23:25 +0000 Received: from CY1NAM02FT019.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::203) by MWHPR02CA0046.outlook.office365.com (2603:10b6:301:60::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1516.18 via Frontend Transport; Mon, 14 Jan 2019 19:23:25 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT019.mail.protection.outlook.com (10.152.75.177) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1471.13 via Frontend Transport; Mon, 14 Jan 2019 19:23:20 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1gj7pP-0001l3-Tp; Mon, 14 Jan 2019 11:23:19 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1gj7pK-0006Hg-QT; Mon, 14 Jan 2019 11:23:14 -0800 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id x0EJN6Z4023263; Mon, 14 Jan 2019 11:23:06 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1gj7pC-0006DT-1b; Mon, 14 Jan 2019 11:23:06 -0800 From: Jolly Shah To: , , , , , , , , , Subject: [PATCH v5 2/3] firmware: xilinx: Implement ZynqMP power management APIs Date: Mon, 14 Jan 2019 11:22:57 -0800 Message-ID: <1547493778-22720-3-git-send-email-jollys@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547493778-22720-1-git-send-email-jollys@xilinx.com> References: <1547493778-22720-1-git-send-email-jollys@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(39860400002)(136003)(396003)(346002)(2980300002)(199004)(189003)(478600001)(126002)(7696005)(486006)(36756003)(72206003)(305945005)(9786002)(11346002)(426003)(446003)(48376002)(8676002)(26005)(77096007)(356004)(2201001)(6666004)(186003)(476003)(2616005)(54906003)(51416003)(16586007)(110136005)(316002)(76176011)(44832011)(106002)(50466002)(5660300001)(47776003)(50226002)(14444005)(7416002)(106466001)(81156014)(2906002)(81166006)(4326008)(336012)(107886003)(63266004)(36386004)(39060400002)(8936002)(921003)(107986001)(1121003)(2101003)(83996005); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR0201MB3509; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT019; 1:zkkRvIH0v7L6NjIrcR5bfJ/NCaWxc1pnsd3m1HzHypPcfNRaYQem4Ui6I8nA3MsEFwkkAnz46Bs9jyI7frDG3VPghx3BwHOiyrMOo8CdZOTQTxf2z3KsOxaTFnW82LHw MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f1888bd5-43e3-4157-dc64-08d67a55c127 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4608076)(4709027)(2017052603328)(7153060); SRVR:DM5PR0201MB3509; X-Microsoft-Exchange-Diagnostics: 1; DM5PR0201MB3509; 3:76oyFUONiBgF3e+hlXeiYwkJYQGxsGvmJatm7RdlWxS7QNDybr2C1UjVLdTF1LO+phKJfr0u4SWo2rgELj1H/6hC3HEJ2ZejmCkDZ7GO+JfLazXrmXJSi5PEjeyvQeyMVDba2sEGd/NdD0BLfw6xtwE8guPUH+WAXXtbJ4Ibdin2aO97rTRuRnq+R9EOaK/dQoe6JwCguywIiMsKTZblV0cCUBKyNVu8YAonEK2FF7kaLMbs5X8MBBh0AgAAVUsT31ivHwZhK10dwHseCdQbNekNbfxZgkKOnLeiv73iEe/uXUFOAuRQ5Rc//Nmu1M7hjv5Y/JJaiQMIuW/cekmgVNwVw1tvkzK3EQoqeyaCaZY3za9NkRJE63Rv5y1Uy9FZ; 25:hD0Oj2RkJA4DKahBIPg2TecGXM9QnseUrKIBSbT1poowKPiEft46X6lYMWZzl8ra1dp6+iHtdUeBqdBusGejdBawR8mLHVy5voeOGaMH5Mwo5LZE2udNIzki6Ti/hEWM1aC4QjYIbgExEOQfxyD5kGAXVq0tNdinCfwxtgzNL5xZ4N/ZCYARZ5/w+jXEOwpZq1AZSywH32nZT37VLBYGwNeAWhb4lLBoVL4j7RGyXXslfnvow8Ri+JR7X8JQIuWS9YPYtoD0anvSOLVwV+n/8rfgtQ4J313Fc9J866oDaloOq3sds48SiXQiAzBii/g3AS7C8vT91+IA7xxYZ2XHJg== X-MS-TrafficTypeDiagnostic: DM5PR0201MB3509: X-Microsoft-Exchange-Diagnostics: 1; DM5PR0201MB3509; 31:VU9NvErFOGagtw2ME5rvpcP3ahLLUUAmVXSO3R+k0R4CTX61hhNSQ8JtgAQHVlzdbsuiznrlheP+7wtcJB0FzsEiBpLeYpYIoq06uCdALEcRIN/30/uUKVvHgWaoaiZd6oZeQM50bL4j6CvTu+cE4IDyxx61QJuDT8wzVrb2yH+r1d89PVoGddIHuBt5LKSk7p4/xEZ0Tr4qBQvGGpHme+6i/7uTXj1K0EeYi6dW46I=; 20:8P0JFFvWEqBW1iXEIu6R8wLb7zABrKFHSTvzZiltG3XXIBhCtx+rOgdn5mCsF7eoBKBuhRlf6D0kXuiWSK1mniT5bvC8UC3DMUz/uLp0RoIMrYBiP9dvnC2u45l1OY0InEyq1xufLYPfDml1r2WGTxmjnxdb/aAx2PE5+alZYWlqa9JZl/XFUxZLXdg57tTzEeJazNZeNIwQO0scE8gItyFfgMKBqiaV8S/+D7T0TV7YgbZYWRw2T97J37lEjY2AiIwqt7foSiyp+5MpK/5kRb5SMluDucNYBxlz827954FWdstD/9VAnIWT2yj3m1qWMDHCtDG1FBdXtaaZIu+zGf//pNPD4jUHlXnDn1Z/mXJVZ0ErlvZzNdexmQZtLYq/yCiqm1s7xt5u+cGEbMkpNkzIUPlwSIukLOSm4JYYF1S2CkScLUfwHTDDFj9ee3Z8jadTTu6V5yK8OT3Q0ndw2FeObVBZkn5mnB84jUtGsej/M6UyUDB4i2h1JXVRETun X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Microsoft-Exchange-Diagnostics: 1; DM5PR0201MB3509; 4:CdlABoTq92ZdBEDlcOitoE9qqsB5PXDgPggL9MdDjrCdoaCfl1gPLqW+aAbxxSC5xDLYr/i8ophjM06D3fnnWat2YSaArAETHkfoA1Humx56c4WUFtO/scm1C7y54uPJRyPHopl06PryaZrwvNV9C8XXdOyegD93gyIHzxtKX8auB6lkPekFXNRM4aNxzfjclkUvj5OJZjU9owiw8iq1gX2Iv3N8QhN+BI9XI8vEWkI+OBpJVp58e5etNBJEaw2ysJhzc4dROpHypL+59ih7d0eA6/oh7e56pwZyuxJo7qHZTPt7b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4Iqf5Q/hCHQpoHBKmV1P9aSaSPtOYBwWbp+atzGjGmoqBPXzxzt3GGcqhwygpXK9LVSCBFTZrdyxG0mu0DSw5UrjzWJAZUwd6C/WekqHV/XA08K/w2yKwn01T/H5AtsVuoeypobfRQsj5D78fiVVQW/N8Uz1wR9q5OTdv8zNapPgXN3sz95yP90hmnH8jGU1oB/aiJrLLC/3A==; 5:1NUimQAzdjSdr2bXOkFXT0YHfW2O2jvcPdPb5AdvHPWhgjkG1WB1ApIvc1rkQISv0dkHkVhUhH3u/hSQ90sKtqNJK4mFcrgMt1EL5cP4CjvjTtWeU1Vrew/pGuBfST4rHUOz9S9A5OeG7GK6Pc6cTB1HLppLZPIj8+CplE6YYaMSTVMctIv0JU5a7gEJ9Rhsuskx5l54XMcywO9RBME4XQ==; 7:AJpB1CXpHv3N1iC0vmlOSyuZgcsNQDXmaAXAcXJdPGxd4nYqWqi5id0Oxvf7XaZ+H3Tidx+tW7dNjPIE+Vu42prDp8N1Zqk0MBwXLjBnfQLFmCDMXVmAaKzB2DGXsz7tl+ne7ZwTjiy2XvaLQjgKAQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jan 2019 19:23:20.6395 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f1888bd5-43e3-4157-dc64-08d67a55c127 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR0201MB3509 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190114_112329_611898_8EC55ED0 X-CRM114-Status: GOOD ( 11.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Rajan Vaja , linux-kernel@vger.kernel.org, Jolly Shah , rajanv@xilinx.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rajan Vaja Add Xilinx ZynqMP firmware APIs to set suspend mode and inform firmware that master has initialized its own power management. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/zynqmp.c | 29 +++++++++++++++++++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 20 ++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 84b3fd2..c7a3b6c 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -428,6 +428,33 @@ static int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id) return ret; } +/** + * zynqmp_pm_init_finalize() - PM call to inform firmware that the caller + * master has initialized its own power management + * + * This API function is to be used for notify the power management controller + * about the completed power management initialization. + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_init_finalize(void) +{ + return zynqmp_pm_invoke_fn(PM_PM_INIT_FINALIZE, 0, 0, 0, 0, NULL); +} + +/** + * zynqmp_pm_set_suspend_mode() - Set system suspend mode + * @mode: Mode to set for system suspend + * + * This API function is used to set mode of system suspend. + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_set_suspend_mode(u32 mode) +{ + return zynqmp_pm_invoke_fn(PM_SET_SUSPEND_MODE, mode, 0, 0, 0, NULL); +} + static const struct zynqmp_eemi_ops eemi_ops = { .get_api_version = zynqmp_pm_get_api_version, .query_data = zynqmp_pm_query_data, @@ -440,6 +467,8 @@ static const struct zynqmp_eemi_ops eemi_ops = { .clock_getrate = zynqmp_pm_clock_getrate, .clock_setparent = zynqmp_pm_clock_setparent, .clock_getparent = zynqmp_pm_clock_getparent, + .init_finalize = zynqmp_pm_init_finalize, + .set_suspend_mode = zynqmp_pm_set_suspend_mode, }; /** diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 015e130..1424170 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -28,12 +28,21 @@ /* SMC SIP service Call Function Identifier Prefix */ #define PM_SIP_SVC 0xC2000000 #define PM_GET_TRUSTZONE_VERSION 0xa03 +#define PM_SET_SUSPEND_MODE 0xa02 +#define GET_CALLBACK_DATA 0xa01 /* Number of 32bits values in payload */ #define PAYLOAD_ARG_CNT 4U +/* Number of arguments for a callback */ +#define CB_ARG_CNT 4 + +/* Payload size (consists of callback API ID + arguments) */ +#define CB_PAYLOAD_SIZE (CB_ARG_CNT + 1) + enum pm_api_id { PM_GET_API_VERSION = 1, + PM_PM_INIT_FINALIZE = 21, PM_QUERY_DATA = 35, PM_CLOCK_ENABLE, PM_CLOCK_DISABLE, @@ -73,6 +82,12 @@ enum pm_query_id { PM_QID_CLOCK_GET_ATTRIBUTES, }; +enum zynqmp_pm_suspend_reason { + SUSPEND_POWER_REQUEST = 201, + SUSPEND_ALERT, + SUSPEND_SYSTEM_SHUTDOWN, +}; + /** * struct zynqmp_pm_query_data - PM query data * @qid: query ID @@ -99,8 +114,13 @@ struct zynqmp_eemi_ops { int (*clock_getrate)(u32 clock_id, u64 *rate); int (*clock_setparent)(u32 clock_id, u32 parent_id); int (*clock_getparent)(u32 clock_id, u32 *parent_id); + int (*init_finalize)(void); + int (*set_suspend_mode)(u32 mode); }; +int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, + u32 arg2, u32 arg3, u32 *ret_payload); + #if IS_REACHABLE(CONFIG_ARCH_ZYNQMP) const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void); #else