From patchwork Thu Oct 4 21:23:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 10626791 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 7903213BB for ; Thu, 4 Oct 2018 21:28:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67489288C7 for ; Thu, 4 Oct 2018 21:28:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AE6329289; Thu, 4 Oct 2018 21:28:09 +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 9E28F288C7 for ; Thu, 4 Oct 2018 21:28:08 +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=WFhUKixyC1Vtp/1mfka2Dbib5fW9VE/LPWe0kUjwwRs=; b=a8AoInjZf6u4AU T9D3Xox0xB7p3+ax0gQ9ejvvTsUjlPgFA9VdXAjMHxsIDCPyQkgxRi0TRetKlZevbbHdhm7PtxfPx HEaRUBkhr6hPcG4G/KjaVBaG+fnAZSfYyYfAs3CZ78DZaU3Bm4/9tiKDXSN9l8x0TqSkZfSqKToOw qSJadkl/T2RF+n8vTq+4LprOmLc9yh2n7xm0aoq19pJDclKKjM+DU6XU3CgGlqcuh1luvy7uvoqQS NWfZMJ4saalrqxra/AYwV0mWg9j/JfbUkr37Kg55Fx+e1YQeUWpgRfklhFesA5ETXGctjxrc6D2zj DYEBdEbmcnnTxgWnVsmg==; 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 1g8B9z-0000e5-JX; Thu, 04 Oct 2018 21:27:51 +0000 Received: from mail-by2nam01on0044.outbound.protection.outlook.com ([104.47.34.44] helo=NAM01-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g8B6c-0006GQ-Tn for linux-arm-kernel@lists.infradead.org; Thu, 04 Oct 2018 21:26: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=LQUAg2zEnhJHhxj56+Qf30lNEYmBi97e55gUiTkzj0s=; b=zDLiNIJgj2wyjQUbmZnd+G/acmXzPIMqCU/wAp0r++/mLRKqnyiFaBrFXVOxkbmL5E7LizXeA//HH4NvqoIAE5pHHJmvRB47cid3++8xD5GEhMOVACzyDquQRlXBXGB5Dec7mYZYXzNVoKQA38FwnE1CJkK4bDOUBwfUBFnn2sc= Received: from MWHPR0201CA0088.namprd02.prod.outlook.com (2603:10b6:301:75::29) by BYAPR02MB4757.namprd02.prod.outlook.com (2603:10b6:a03:4e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.22; Thu, 4 Oct 2018 21:24:06 +0000 Received: from BL2NAM02FT062.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::206) by MWHPR0201CA0088.outlook.office365.com (2603:10b6:301:75::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1207.21 via Frontend Transport; Thu, 4 Oct 2018 21:24:06 +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 BL2NAM02FT062.mail.protection.outlook.com (10.152.77.57) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1207.19 via Frontend Transport; Thu, 4 Oct 2018 21:24:04 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:48244 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1g8B6K-0004fA-4W; Thu, 04 Oct 2018 14:24:04 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g8B6F-0001wm-0T; Thu, 04 Oct 2018 14:23:59 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w94LNujB006252; Thu, 4 Oct 2018 14:23:57 -0700 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g8B6C-0001w6-PR; Thu, 04 Oct 2018 14:23:56 -0700 From: Jolly Shah To: , , , , , , , , , Subject: [PATCH v3 2/4] firmware: xilinx: Add APIs to control node status/power Date: Thu, 4 Oct 2018 14:23:39 -0700 Message-ID: <1538688221-9823-3-git-send-email-jollys@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1538688221-9823-1-git-send-email-jollys@xilinx.com> References: <1538688221-9823-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)(346002)(376002)(396003)(136003)(39850400004)(2980300002)(438002)(189003)(199004)(110136005)(4326008)(16586007)(26005)(36386004)(106466001)(47776003)(316002)(2906002)(107886003)(39060400002)(63266004)(186003)(11346002)(7416002)(76176011)(77096007)(486006)(44832011)(51416003)(305945005)(2616005)(36756003)(8676002)(7696005)(476003)(126002)(2201001)(48376002)(336012)(50226002)(5660300001)(9786002)(72206003)(81166006)(81156014)(8936002)(6666003)(356003)(50466002)(106002)(426003)(14444005)(446003)(54906003)(478600001)(107986001)(921003)(2101003)(5001870100001)(1121003)(83996005); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR02MB4757; 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; BL2NAM02FT062; 1:yLOfmo53v1+dWxlRp+2AZ5uwzyZyetRiiGoppnhWFwrxpOZfbJHI+5s2Ep+4BtnrVNL9vC4C4EvmRBmTFxaKkKAAcfr6yd51hB0frsBHXU9AX7MBiMEyfon8CRFCBBUc MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 202cfb3f-f42b-4a26-f16c-08d62a3fb6eb X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4608076)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060); SRVR:BYAPR02MB4757; X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB4757; 3:HYxWaUx10qeEVg90rV+LZlo8Puo1slbxU5INCDxRyM5bVDQx2rlpCqzrflNmaPoAzHoxBlyjGdpoI8u9aEmuAeQkyKSEN/+P5syouK4tZOsR/0BDrykmcmozKha168yPk4p6rhZcxlZ4AFcMe8vH+DtZbuhItrozd0ckG7cjrFBCPZg+fklzy33sC05zUaQwAqNE1mSQzcV+mmx0g6rd5OaoaDEkVZX35BjiYrU/jdGlA7UUJiJ/wsAIcICZFySTFLJhNhLXZYO3UUyMsfFvLMLIQbYmVHdRf/Gjc7qEDe6avHlxCdLiO5RaaFx2/SMPw6lHIR2dhu8AtYa20JM6WjvB7OgWrUw9pe7ldEN88qk=; 25:BCs1STq7vWdoyelivcnt5eyjLsE9IGN8nvTJSQ70iP/ilirwqNrHOXGbzXu/DngOvRYyGlnjF3Gmt2NFi2yQbKeFpsyraNeQJVvCe7sxreuD+WxETQ94yg/QvQDrRuUG5BuyJyoaQQ/fl5E93KhQ8E5Ayfzgq+4IVhqq6LN5iNtEaTWDDVteSfAf8+NZ7r6ZkmfS7Qq/D2L9QNLTcdcOBUreK0faFXulBu0zAVdsc3kCIGL0iNZr5jyMZLr1wpNxysG+F32woYVnwtV4sfSVFOv5tNxdBEeKJ395T+M6w0oQ2cstIJ1R27d+5FBckoAJrrMIyebQuaa70Sqmbt1iWQ== X-MS-TrafficTypeDiagnostic: BYAPR02MB4757: X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB4757; 31:2jlvkQ1DxjrkrZ4e5PWtoI7l1OoKwYmsN/cZubbUHJDYP1UmDtEHImn0uu8TwUjXola2R4OauSA0rI9SP7ZPTUGPo+1xnJ+iUoLvqfQBhRc6cwcakU1LFHYm+7CDAfO37Vg5U7/JbwcZNfd13bwb6KD4wN1EHdVgS9YvABXakgHXuQ9Oo5UATesh3C1ZVAyNSu89bzYWR6GIGoHd6AarviU5uI7j5bqxwMCawYG58JY=; 20:3DkubFmc80pHc9S7HozS07qE4RHV+fRQ2BJCWICDu99fwRActnIwofTV4gmf0WkWPFgcOGtoq48c7Rc37QQOv2gbDCt8VGiNuzsvKR5HAsDbhaCcHEDkfsiab5RbOns/plkwNvRzLRn/vPX2fK/0vZ5iyBGsLAsFWjcfTqSJ1KzWfwNB3/FWRE+X3B7gbaIjkEg9Zx229CU+2KOXrEX5vhySUIiJkAZPWB/UPgn9yHc02JqNbywh65f/wxikVdB3nyJE1uTk0zg9JCWbt7coQUhwMOHeRclIdTgcVyeXkg67o1xf1sRqiNW8dGooDdQ4HHG6GdwbqvLDhwW8dRJ7rP9sxUgMxnDxMCuO01MZpD1mHwVEQ3OY0yROY4Cdyxng4LLXlmStwbtV/XqCyLA3EweFql30Qh4MCHzyxunbikGXdu5oel9snCGtKbUi7dmccXtec9ohkLVBe61OqyD/sGexxtSjEYETwwVd2C/A2geri43nzMgD3+7bG6vzli3N X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592)(269456686620040); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93004095)(3231355)(944501410)(52105095)(10201501046)(3002001)(6055026)(149066)(150057)(6041310)(20161123560045)(20161123558120)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:BYAPR02MB4757; BCL:0; PCL:0; RULEID:; SRVR:BYAPR02MB4757; X-Microsoft-Exchange-Diagnostics: 1;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DevPid99ZAououFt6IIzVpeHbw= X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB4757; 6:3xttu3sZIUwfFmWW5jE+yXJaupgvjzrQ3ASA5SZZHq3BdrjdP7lhgDliy+dpfV0QhA6rUH6z18FOXwvjdA+2t40cER/YVPA2ZJDl/w4xrfqdwaCBkP5TBl8ITYY8JNmsw1xpYC7Z+W4LzuVtKF0eIQO4N7HQA/z0Go53LRst1OLWwqMsBD1GEhS1KJ0l52DmA1QRrXuShWfnpoJWZ4Z4URMxh72QT2jaqEHp+Er1qec2UMbP2k2UPZwQqkHxi7fqLqhfRqcY1u0lZM2IB/IxFsBWYItN6WQeRwWK03l2iKjA8CGOh0Or0Ec+8tET5B5kTrxNOnec0wo16s2tsdzFbzLL3L/GGIbcHpBeCD897Zsycglfb0UzQrkyRLO0NgEER94Eu26MW6eFDWViV1bzTZRoPuiAXWVp/2+YtXsbCtJFgqPzEeJxrl311Bz6FBkB2Z1IWJOw+07BBtAwdh/3EQ==; 5:fN/lsXsgouu/4Jft43WssJpHEwGsc2LjAFn2sIPpuxgYkE9f7JSkNgWjWukq8PoAuPXsAIWo+cZymjzRuCilsV2l3+buOaQL/ssHTnzT1HYDx9iP37fA77+A6MAXn5JtajuYyCCkJA/oOEn25TCvQn+kCdLBxCNjTziay/XRybk=; 7:FpgoP+ARllTLgg06BiYb7h/iEq1b2FEEuP38ND+eLVeJs7iFvoFSjSqf9xtX7eDihW7ZA5qLR597iYWEFkOulIFgZxa+4aE4v5nReBsO7gy6Yg55pHj1tyqdHzshxGKyBCtNNj1IilrHhCpQGGglT4VlbRrdjGWBdIWyBKlqyhHe5ZAyfj3H0V9x4y/eHPi/JVzvaA5FX1qSe55QNZlxEcFHX/TGEDylrnUMjbZw0UJTPrmGWj3U9VijiWnnywph SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2018 21:24:04.8788 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 202cfb3f-f42b-4a26-f16c-08d62a3fb6eb 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: BYAPR02MB4757 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181004_142423_046380_38008993 X-CRM114-Status: GOOD ( 12.03 ) 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 9a1c72a..faf6a52 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -469,6 +469,61 @@ static int zynqmp_pm_ioctl(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2, arg1, arg2, out); } +/** + * 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, @@ -482,6 +537,9 @@ static const struct zynqmp_eemi_ops eemi_ops = { .clock_setparent = zynqmp_pm_clock_setparent, .clock_getparent = zynqmp_pm_clock_getparent, .ioctl = zynqmp_pm_ioctl, + .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 3c3c28e..6998f7d 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -32,8 +32,19 @@ /* Number of 32bits values in payload */ #define PAYLOAD_ARG_CNT 4U +#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_IOCTL = 34, PM_QUERY_DATA, PM_CLOCK_ENABLE, @@ -75,6 +86,12 @@ enum pm_query_id { PM_QID_CLOCK_GET_NUM_CLOCKS = 12, }; +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 @@ -102,6 +119,15 @@ struct zynqmp_eemi_ops { int (*clock_setparent)(u32 clock_id, u32 parent_id); int (*clock_getparent)(u32 clock_id, u32 *parent_id); int (*ioctl)(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2, u32 *out); + 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); }; #if IS_REACHABLE(CONFIG_ARCH_ZYNQMP)