From patchwork Fri Mar 6 23:47:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424861 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EEA1D921 for ; Sat, 7 Mar 2020 00:04:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BA8D6205C9 for ; Sat, 7 Mar 2020 00:04:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YKSkbCeX"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="S3m+8FWg"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="cCx+uenh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BA8D6205C9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=/aA6r9jbtWwTwDsKd4dwBxlFF4/1QiStHbbv2XFnu+M=; b=YKSkbCeXwCb5R7 tl9d8XGd2kl88ETFhowK/B2j7m11Y5eURbkZUtQka4+SPeywStbl0ZlM9OBu0QDSwuZkSPvlPRT4k xZl6FQ4uLRiYYq78iNEZzUaoQt/Ia7aU2hCKUd+6HhyTMkHWDjiMe14IOz+Loa5n4c//14NC+qWZV gS7SxzUBL87xueI3XL4/hD8Dbo6nGR2cubzIEtoufPPUsk61cHO6yC8hGjU8dxAs3k2nZ/4Yo9YEu xGa/Oco7M4MwA2AvXDNf1zoTYGDIXA/zdfTjhOwwhbQT/ag0tpccaduiJqvZTUSNsJ02pxAKaoLlr uqkoKZmS1sGLOSF7E0vQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMwq-0000dj-JQ; Sat, 07 Mar 2020 00:04:08 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMwo-0008Ra-5U for linux-arm-kernel@bombadil.infradead.org; Sat, 07 Mar 2020 00:04:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=L7/77s3eD14O5PIofcgKUXo1YvIOKplIw+paqyHGlGQ=; b=S3m+8FWg2rmlmyDdwRgBFO28gO HvEZIlPwtNpDA6ouqUFsf9Vvk/tBxxd04HHlvFWq5qdmb/UNvqtyB0PTLijggi40LqPH5ZHQ2rwpQ iODts8Txvc63lysJdHXe696HmDCKzyXKYPBGaykoC8v9KjZu4gcXlho6AjErSkcXDIKTpceEAp9jK KNnVhF3I1MwfyWLnn3F1P91xYgg+skBP8mwlZQBnx9XwoWs1DwgbhButsGAWukl/Ali+xjL3errbA 9dRWYv77X7leVxUGJjtKsD6IQVkDoEkYeHwFadbja28rY4R56xsGtlnDinwv4W5xI5aXSPWL9tXSP yt4aAF9A==; Received: from mail-mw2nam12on2087.outbound.protection.outlook.com ([40.107.244.87] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhI-0004bD-RX for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IswnCnn+AQK82d1g7C4UxeurfYbLZiDEaJmIgKChlnxUFBczn49LUB4XYWTGDZhxi2Eh9izhW9xe+Omld6q2fuyblXWxkGheIuKI8RGCjU2Zf38dZlFySiL+cHZ5/8k2fIIyWlW1OICRamSRyjdsDswcL2X/FAdlMgU2Ht2J9lLRKcIC92GGWK+sHDYBp1YPj+v52q/QAk3ry+sndcP3go4oXB52Zu3uCFUyRWPc58gX0rJziU9/f9+IZWhGxVqt/xSNzwmuRHrwZd4oxHqgbx2BCkfpMMuN9gXX1Il/BK8SDdhjJTfLhuetYEYKmaFnM1llyaAT+MnyXPAA5rOGqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L7/77s3eD14O5PIofcgKUXo1YvIOKplIw+paqyHGlGQ=; b=Efc6zV4ZjCUHK2kle4BFCddS8Weg3qxw1u6xmS4uO1cfs6o6oxxNUNZb8RXMr7LLKHyP1cXRtaGFNQ1s92uVEMGh58rY9npHRZdlGvphFK9yMC8kpfsIQq3Atk+TZ2hJth9kGd0IYphPtqyjeg2w9iCJYbmsk5ZvPFNE+7MD40xOzWHFYt/+L8vW6QExCbzEMFWMvPqloTIYxyncE+zZkidtZZ3U+HTBCuwf6ZJ4NOPMWE0wOd5/AS3n0x48Kh/j0ScLWooWA+i+CjnGpMwdM4eMXaM6NnWqVRzC7zuZh1IFOVM9ih+Jnedlp81+zKYo+WX0HCelr5UXuYqBG4V2CA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L7/77s3eD14O5PIofcgKUXo1YvIOKplIw+paqyHGlGQ=; b=cCx+uenh2qFrRuOI5oMmFK1cOTuJekLczf3uqpq61b2E3g1CQLVfzHvNhkvw3jgjng8gUvQpdifBmXU8wHoA6nVPjJWt9EWRdREUfLCwq7nfX1k6YvBFo/+2p43FnQwdV20D5ju/41FRZWzt+QY0O/9aOTbjQelOaEI7e2o01So= Received: from MN2PR10CA0008.namprd10.prod.outlook.com (2603:10b6:208:120::21) by SN4PR0201MB3421.namprd02.prod.outlook.com (2603:10b6:803:43::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.18; Fri, 6 Mar 2020 23:47:59 +0000 Received: from BL2NAM02FT022.eop-nam02.prod.protection.outlook.com (2603:10b6:208:120:cafe::fa) by MN2PR10CA0008.outlook.office365.com (2603:10b6:208:120::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.14 via Frontend Transport; Fri, 6 Mar 2020 23:47:59 +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 BL2NAM02FT022.mail.protection.outlook.com (10.152.77.153) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:59 +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 1jAMhC-0003QL-S4; Fri, 06 Mar 2020 15:47:58 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh7-0002g8-Ou; Fri, 06 Mar 2020 15:47:53 -0800 Received: from xsj-pvapsmtp01 (smtp-fallback.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 026Nljcj002387; Fri, 6 Mar 2020 15:47:45 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMgz-0002eg-MD; Fri, 06 Mar 2020 15:47:45 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 01/24] firmware: xilinx: Remove eemi ops for get_api_version Date: Fri, 6 Mar 2020 15:47:09 -0800 Message-Id: <1583538452-1992-2-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(136003)(39860400002)(346002)(376002)(396003)(189003)(199004)(36756003)(7696005)(9786002)(6636002)(426003)(26005)(2616005)(336012)(70586007)(70206006)(54906003)(316002)(186003)(44832011)(81166006)(478600001)(8676002)(356004)(107886003)(8936002)(81156014)(4326008)(2906002)(6666004)(5660300002)(7416002)(42866002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN4PR0201MB3421; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 43198ba5-7845-44fb-62f5-08d7c228cd68 X-MS-TrafficTypeDiagnostic: SN4PR0201MB3421: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:67; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2Mahzi8+In/k1KK8nGkNT0QbiJKjqfbwIz1GpnfwpfzMgwI31TEj9wpndsOzalQsB47DqS231Q1augKnW4LubvXm0bXtaI9eBAg2/Cb3bWsJ44veb3fwp7KrwrcPgZdrPGOMxqb4pp02/5wSXWrDYV4leQMW1IqUffT8+pX54F5b85BBZECqTcRDh2eFSC4HcMTBjU6Asg9MyVUZsbC5Wmjtnj6vTGlhCBw5BHlZiK4c9FPyaRFNTr7W9r88lrH8e6URp7orKpfWIdVLjsk/FHRt5C8FUW6mVurpQ3WjFiTBN6KlN3UvwLVPsqp88UaI1QDOuZWlS96wf9CSCteotZGsrhVtvPJk4loPTAH6So1JkOcNAQhifRjZAvOZ/TfkYfqwYT2We6OlkBQ8EqALLn6iCmDq2ksVN3elvjzIOMKDEALfibnNqRILnUaTaDynDvEUFpclowu/eUCyc90b54cH2Cr7DZzQES/FScXEBBUkZlWCXzXm6avlZQrFYtp0 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:59.4467 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 43198ba5-7845-44fb-62f5-08d7c228cd68 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: SN4PR0201MB3421 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on merlin.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.244.87 listed in list.dnswl.org] X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , Rajan Vaja , rajanv@xilinx.com, linux-kernel@vger.kernel.org, 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 From: Rajan Vaja Use direct function calls instead of using eemi ops. So remove eemi ops for get_api_version and use direct function call. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/zynqmp-debug.c | 2 +- drivers/firmware/xilinx/zynqmp.c | 4 ++-- drivers/soc/xilinx/zynqmp_power.c | 4 ++-- include/linux/firmware/xlnx-zynqmp.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/firmware/xilinx/zynqmp-debug.c b/drivers/firmware/xilinx/zynqmp-debug.c index c6d0724..de4faf2 100644 --- a/drivers/firmware/xilinx/zynqmp-debug.c +++ b/drivers/firmware/xilinx/zynqmp-debug.c @@ -92,7 +92,7 @@ static int process_api_request(u32 pm_id, u64 *pm_api_arg, u32 *pm_api_ret) switch (pm_id) { case PM_GET_API_VERSION: - ret = eemi_ops->get_api_version(&pm_api_version); + ret = zynqmp_pm_get_api_version(&pm_api_version); sprintf(debugfs_buf, "PM-API Version = %d.%d\n", pm_api_version >> 16, pm_api_version & 0xffff); break; diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index ecc339d..f7725d1 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -219,7 +219,7 @@ static u32 pm_tz_version; * * Return: Returns status, either success or error+reason */ -static int zynqmp_pm_get_api_version(u32 *version) +int zynqmp_pm_get_api_version(u32 *version) { u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; @@ -237,6 +237,7 @@ static int zynqmp_pm_get_api_version(u32 *version) return ret; } +EXPORT_SYMBOL_GPL(zynqmp_pm_get_api_version); /** * zynqmp_pm_get_chipid - Get silicon ID registers @@ -708,7 +709,6 @@ static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, } static const struct zynqmp_eemi_ops eemi_ops = { - .get_api_version = zynqmp_pm_get_api_version, .get_chipid = zynqmp_pm_get_chipid, .query_data = zynqmp_pm_query_data, .clock_enable = zynqmp_pm_clock_enable, diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_power.c index 0922789..d327d9e 100644 --- a/drivers/soc/xilinx/zynqmp_power.c +++ b/drivers/soc/xilinx/zynqmp_power.c @@ -186,11 +186,11 @@ static int zynqmp_pm_probe(struct platform_device *pdev) if (IS_ERR(eemi_ops)) return PTR_ERR(eemi_ops); - if (!eemi_ops->get_api_version || !eemi_ops->init_finalize) + if (!eemi_ops->init_finalize) return -ENXIO; eemi_ops->init_finalize(); - eemi_ops->get_api_version(&pm_api_version); + zynqmp_pm_get_api_version(&pm_api_version); /* Check PM API version number */ if (pm_api_version < ZYNQMP_PM_VERSION) diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 2cd12eb..7529383 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -286,7 +286,6 @@ struct zynqmp_pm_query_data { }; struct zynqmp_eemi_ops { - int (*get_api_version)(u32 *version); int (*get_chipid)(u32 *idcode, u32 *version); int (*fpga_load)(const u64 address, const u32 size, const u32 flags); int (*fpga_get_status)(u32 *value); @@ -317,6 +316,7 @@ struct zynqmp_eemi_ops { const enum zynqmp_pm_request_ack ack); }; +int zynqmp_pm_get_api_version(u32 *version); int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 *ret_payload); From patchwork Fri Mar 6 23:47:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424833 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 68016174A for ; Fri, 6 Mar 2020 23:53:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B4BA20658 for ; Fri, 6 Mar 2020 23:53:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ere90bbx"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="ibfQtlhP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B4BA20658 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=wEd3bSyTpO5NUsMkikYxp3S8o4RO5YnqtVq88/l+xQY=; b=ere90bbxhdyLX/ zb9PeobjehQpnK9XfOXYfZdyXcYqOtExUemC9/eeJFu/nl4xwPBii+PMZIHlWSfW0Ii47bJfZ8pWq hbqJ7lSvz5CeXqYLjRAHKddBGUgG2dkeGRkVgdkpMPdEPHP9l+umMXI89x0qGRGg4oKy0oe/R3fDa Op+ETBwOrR3dptWknSCAWXStJ/bNc25L0Ei0UHxfJumpk5Jmh8WSCX5cle9/de0wgyGzsa94G/uvF q7Z4fWQQQq7ut1Xd9erkWbQqoQ64wNwtd316+GpACDjR24q7Mv9vhQpazIbKhEk0riV0eQcuJCcnO rOFL87SKG+TK7xf3vWFA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMms-0003PU-0F; Fri, 06 Mar 2020 23:53:50 +0000 Received: from mail-dm6nam12on2046.outbound.protection.outlook.com ([40.107.243.46] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhG-00061l-RZ for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l6BcWPifLgT1i7nG0TByZGQWIWIRVu1zbKB1m431HVEineC0RpKDtoX0iMqu0EW6DFD/iexYnjYxYauN8LVsD3tHDhM9HZ/WMO7uOJ67Nweh3uOq+9UytqUlwPO0jB+f2mAejFepxDvHl3kY5sun2bGXVniYgQjYfXtJHbEUj16ndFyXf4odRYgTSJ1X9wvOb1ztcbD1oviBL9p8mJsMR43nqVaxWuj0h+euXdZCUxCU0vuz9mg1QKeCur0udu/OMxfaOaGvdEM9nzFnio74D81rPqz5LL+xvGeUiYlMSVN/5W5n3gFdDvVQ+tAATgAuxKrAfNMlPrUdQ8VOGgvSlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q78TUi1I7yY694ZpbTu1IzJ0EoCIxoaSBKFVA4dgLRM=; b=Lhyu0kCjTFHvEV9kXQ3m4vhfqxLPWSmf/xGxJ2DVUpqhzBE9f8pLZjTFBexpa2gfUVo56jIukftLg+qrr1zPZv9CIOxSWwABe1H+MZPkSkNu7wb6UnnEyORI1kc/th/I3JGOqTnXtS/ABUYoup6fD4/fcvRFlmgUmWqcil5JULdcow5vHcDimCzFoM6nEQbFDdFbzHN+QkGrFoA9ahBzMQ9Fh3XoAYwpVCAoJ2n0KYyUFtEP/OwIqCLKTcUX+J/2sQqYXagqXOyG2gyhV91BPNlWpULLM+L69QI4oTF1WMG35LioUi5HJh8S2lxYpdvSkICXWVkWbd2lqimah1UzFQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q78TUi1I7yY694ZpbTu1IzJ0EoCIxoaSBKFVA4dgLRM=; b=ibfQtlhPiBwaLNm9zKnbmGz0rbr7t+Kxck2yPg2av/mHsNRy5pGCcyYz5tarpzzPrdebA2WmvlmvOg9kd2puecWLj2Hr8To70sgsZkYg1NAcSEbhroAXsGr1fIpmVl+1MwTatkj5/08tEcqvv391+K7MTRz5ZvcxnGYse5HVuH8= Received: from SN4PR0201CA0003.namprd02.prod.outlook.com (2603:10b6:803:2b::13) by BL0PR02MB6498.namprd02.prod.outlook.com (2603:10b6:208:1cb::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.15; Fri, 6 Mar 2020 23:47:59 +0000 Received: from SN1NAM02FT015.eop-nam02.prod.protection.outlook.com (2603:10b6:803:2b:cafe::c8) by SN4PR0201CA0003.outlook.office365.com (2603:10b6:803:2b::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:59 +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 SN1NAM02FT015.mail.protection.outlook.com (10.152.72.109) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:59 +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 1jAMhC-0003QJ-Kn; Fri, 06 Mar 2020 15:47:58 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh7-0002g8-HP; Fri, 06 Mar 2020 15:47:53 -0800 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 026NljFI002389; Fri, 6 Mar 2020 15:47:46 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMgz-0002eg-OD; Fri, 06 Mar 2020 15:47:45 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 02/24] firmware: xilinx: Remove eemi ops for get_chipid Date: Fri, 6 Mar 2020 15:47:10 -0800 Message-Id: <1583538452-1992-3-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(396003)(346002)(376002)(136003)(39860400002)(189003)(199004)(9786002)(81166006)(81156014)(8676002)(7416002)(36756003)(8936002)(478600001)(70206006)(6666004)(70586007)(356004)(5660300002)(7696005)(54906003)(316002)(2906002)(186003)(426003)(26005)(4326008)(336012)(107886003)(2616005)(44832011)(6636002); DIR:OUT; SFP:1101; SCL:1; SRVR:BL0PR02MB6498; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4cf55b9d-df59-4178-1bc5-08d7c228cd18 X-MS-TrafficTypeDiagnostic: BL0PR02MB6498: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:205; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vVm2xo8/gUzCGk8AkINg8Zlk0HLebQ5+tip8SuppfsW/Bhkcp1gGSwu1EM+WLpUTPK5GohsszoNpkOT34gr80t+Q8SxkD03BvzjseZfDkDiNrezkzVZSa5/8p2kDqdGbejXgwjyUv9yiy46EmgSiORjFdT/VzAHwDIV8eujirsS9rbRaUgL3d4/wUvfb6hXer6F3WnfKwNjAgVcKjx2KmEpMEmYE37md+FhyJ0PYYNWImeIlIra0V392ya72XzIHZsicU08dSg09KtwxJ710yzr1AWwmp/bgFFMUGG09VAEbsRUxcLw/ByiRaCkmaV0082Qp8YFhoRBUVYzUkSt5x6Pp0Vv56CvFMmYLAMHpCL+tDLercBkk4jgKS2om//sMIFn5hkdyQ+/CkHZ8HPw8w1O7RqLSFRmsl/KM/rmo5/ligQbcp6H3IkApiQpjKMsh X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:59.0133 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4cf55b9d-df59-4178-1bc5-08d7c228cd18 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: BL0PR02MB6498 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154802_897576_C7025D70 X-CRM114-Status: GOOD ( 11.95 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.243.46 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , Rajan Vaja , rajanv@xilinx.com, linux-kernel@vger.kernel.org, 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 From: Rajan Vaja Use direct function call instead of eemi ops for get_chipid. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/zynqmp.c | 4 ++-- drivers/nvmem/zynqmp_nvmem.c | 11 +---------- include/linux/firmware/xlnx-zynqmp.h | 2 +- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index f7725d1..02d89e9 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -247,7 +247,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_get_api_version); * Return: Returns the status of the operation and the idcode and version * registers in @idcode and @version. */ -static int zynqmp_pm_get_chipid(u32 *idcode, u32 *version) +int zynqmp_pm_get_chipid(u32 *idcode, u32 *version) { u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; @@ -261,6 +261,7 @@ static int zynqmp_pm_get_chipid(u32 *idcode, u32 *version) return ret; } +EXPORT_SYMBOL_GPL(zynqmp_pm_get_chipid); /** * zynqmp_pm_get_trustzone_version() - Get secure trustzone firmware version @@ -709,7 +710,6 @@ static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, } static const struct zynqmp_eemi_ops eemi_ops = { - .get_chipid = zynqmp_pm_get_chipid, .query_data = zynqmp_pm_query_data, .clock_enable = zynqmp_pm_clock_enable, .clock_disable = zynqmp_pm_clock_disable, diff --git a/drivers/nvmem/zynqmp_nvmem.c b/drivers/nvmem/zynqmp_nvmem.c index 5893543..e28d7b1 100644 --- a/drivers/nvmem/zynqmp_nvmem.c +++ b/drivers/nvmem/zynqmp_nvmem.c @@ -16,8 +16,6 @@ struct zynqmp_nvmem_data { struct nvmem_device *nvmem; }; -static const struct zynqmp_eemi_ops *eemi_ops; - static int zynqmp_nvmem_read(void *context, unsigned int offset, void *val, size_t bytes) { @@ -25,10 +23,7 @@ static int zynqmp_nvmem_read(void *context, unsigned int offset, int idcode, version; struct zynqmp_nvmem_data *priv = context; - if (!eemi_ops->get_chipid) - return -ENXIO; - - ret = eemi_ops->get_chipid(&idcode, &version); + ret = zynqmp_pm_get_chipid(&idcode, &version); if (ret < 0) return ret; @@ -61,10 +56,6 @@ static int zynqmp_nvmem_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; - eemi_ops = zynqmp_pm_get_eemi_ops(); - if (IS_ERR(eemi_ops)) - return PTR_ERR(eemi_ops); - priv->dev = dev; econfig.dev = dev; econfig.reg_read = zynqmp_nvmem_read; diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 7529383..84b4160 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -286,7 +286,6 @@ struct zynqmp_pm_query_data { }; struct zynqmp_eemi_ops { - int (*get_chipid)(u32 *idcode, u32 *version); int (*fpga_load)(const u64 address, const u32 size, const u32 flags); int (*fpga_get_status)(u32 *value); int (*query_data)(struct zynqmp_pm_query_data qdata, u32 *out); @@ -317,6 +316,7 @@ struct zynqmp_eemi_ops { }; int zynqmp_pm_get_api_version(u32 *version); +int zynqmp_pm_get_chipid(u32 *idcode, u32 *version); int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 *ret_payload); From patchwork Fri Mar 6 23:47:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424831 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 60324921 for ; Fri, 6 Mar 2020 23:53:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1386020658 for ; Fri, 6 Mar 2020 23:53:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uoKVBjDt"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="hsGEmySH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1386020658 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=fkk6Zl9O14Ow4NmNEh/IEqdl13gb4MK4M/MlXeQS5Sc=; b=uoKVBjDtFN4emS dGYslQXEifeo23/L5r37ss5Yp4O0TZMuQyNpTHz10m+VbC3DuOGF7i1siBLKgOk8+UJqZntvu+KoU tHEBqj6w80hMfRHHHR4kNdemDQveZOVNjDECHIg3sIxlIYgQOZhsDEgHUrAMG/PLQuYoGVU3FRZML UEkuXLxAg6LA3QaPTEKK5q1q2kZ6GvBQbm17ozJ0un3AiJz+4wBWBGb2yJKpo3kH7iy1Z5ISd2M+b sllNaID6PTh/UKiifCAwNGS9c6/DQEzmD5akVkl51hdsHUmHGctnejtTE8qrv6rBif9ml4CfVrBe4 VmEZUNmm2EB2nEOKTZMA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMmW-00037X-N2; Fri, 06 Mar 2020 23:53:28 +0000 Received: from mail-dm6nam12on2065.outbound.protection.outlook.com ([40.107.243.65] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhG-00060k-6M for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NEJrVigc5J9FQCNEN2E6IGPzTieb8NpTtYIHfU/1vtAvxsa4ehs/Ex1dsI/CHBtlN7mP4VfXtWHXNY2vUI5Epr6nNqZSkdxCttaeD8wgF2yK62NTM0PHufC3N5CY/qVwKZHqro0rYEPLD6F8n/OtAgU0z5Ys6E+B7QypIAyeeK6O1oWsIUbW88iHSqwA0Gt2IYuBDGJxqdmSJhjTq0QzYZef9YBrPtEsg+LPiur4+8DY5f0W/jONpy354lTddbb6A5+IFATJouoUWeXfGLsuWzCFuGNWa3KLvH1dTxLyIwfVpoCYPnleCyKmtyVV+E1SRvTud7mBzx2VXrDr6ttAPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UIFPMQjWcfvn/E6eg5DJRyTxjVI4gzGYoKnBjIGBdYg=; b=X+/mY22UJIbXpmd6r1pM59gae0rh+XEqLbBS3IwbtArqYqRtGIlDERsmSdBf2OXzZ0hjH2qOEL26dA7sFEzRlgwQ7lni0DS/3XL+FgILNFDrGPy2MsgywYaFUPTVt30bu1bdF0PX3WnxdLL2qbNpP8CWVMndeZg4nbfyYYKpkvB5CN3yIG+/vX6TBk576pdYShJ3FJrvK93/db5bdwlwcIaYOEzq2GbS3FzXMDfAYMCTYopwzJDJnXNTlKNajf4O98CaCx9vWf8vEAFACDDccnKUmUkImGDQecIjE1Mn7PIEkQ8fTCJxq9gSR7KorlcvS1azQl+vHmBLm2rakklBMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UIFPMQjWcfvn/E6eg5DJRyTxjVI4gzGYoKnBjIGBdYg=; b=hsGEmySHoTjDp49GYmQsnVLGRrItsZVn8wAH+HmBqr0D4xkKjm1tJcDsCejwmXDorER8X8gI9de4y4QzrMxQo7YpdsMdgE5N7BOpz5L+hWrZH2aCg0YOFWjvr7662E+zlrXsnPDlwuFpMPvYvy/+MbLPEVtNhLpyN/Z0KTBffFc= Received: from BL0PR01CA0033.prod.exchangelabs.com (2603:10b6:208:71::46) by DM6PR02MB4602.namprd02.prod.outlook.com (2603:10b6:5:2e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.18; Fri, 6 Mar 2020 23:48:00 +0000 Received: from BL2NAM02FT003.eop-nam02.prod.protection.outlook.com (2603:10b6:208:71:cafe::66) by BL0PR01CA0033.outlook.office365.com (2603:10b6:208:71::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.16 via Frontend Transport; Fri, 6 Mar 2020 23:47:59 +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 BL2NAM02FT003.mail.protection.outlook.com (10.152.76.204) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:59 +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 1jAMhD-0003QN-0G; Fri, 06 Mar 2020 15:47:59 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh7-0002g8-TV; Fri, 06 Mar 2020 15:47:53 -0800 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 026NljcM002392; Fri, 6 Mar 2020 15:47:46 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMgz-0002eg-QD; Fri, 06 Mar 2020 15:47:45 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 03/24] firmware: xilinx: Remove eemi ops for query_data Date: Fri, 6 Mar 2020 15:47:11 -0800 Message-Id: <1583538452-1992-4-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(396003)(136003)(376002)(346002)(39860400002)(199004)(189003)(7696005)(8936002)(70206006)(5660300002)(6636002)(7416002)(8676002)(81156014)(81166006)(426003)(336012)(70586007)(6666004)(26005)(36756003)(478600001)(2906002)(54906003)(4326008)(356004)(316002)(2616005)(107886003)(186003)(9786002)(44832011); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR02MB4602; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b1f80db3-db45-42e8-e533-08d7c228cd87 X-MS-TrafficTypeDiagnostic: DM6PR02MB4602: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:276; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6DhAxtfXExbchhmE8r0PIPtkV9st/aTyR/KVv/P2MK3nO4/aFXGMhOnrQoFyTYcxxixrJe+Mz48suA/3hTydyKN95bw0lRRlEtzSB8kTvqMS1U97Uoe9v6+m+lHLibAtYC5s41kWWZRSFFQvadCevzatnnYMLrNscBYwZO0dwVh9b+zr4r75jcCzcbPH9uZ1smWwLoZnriDYI447ohomZID69ql5qf/IFOfAavoFsNVDoc5MHElsZ6zJ+sXV1Cc+CMO4TEpWCPUAVgMeNOIaQT+AAq+HjEq6UUWGvyKG7nDU36NTz+pGthQC8EHsj/0pAIcoK8JPZl6LyEwm3BQf1fN9YthB9FByxtXhqkENvyoGR8IC8VuylYtYbWWanjisuM7MbqyApPz58Ay6cQL2oax/kum0piZ7iCuYfhQ/Z3OQTy+HlEilk+L4nJy+facL X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:59.6027 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b1f80db3-db45-42e8-e533-08d7c228cd87 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: DM6PR02MB4602 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154802_274996_7416F818 X-CRM114-Status: GOOD ( 12.41 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.243.65 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , Rajan Vaja , rajanv@xilinx.com, linux-kernel@vger.kernel.org, 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 From: Rajan Vaja Use direct function call for query_data instead of using eemi ops. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/clk/zynqmp/clkc.c | 17 ++++++----------- drivers/clk/zynqmp/divider.c | 3 +-- drivers/firmware/xilinx/zynqmp-debug.c | 3 +-- drivers/firmware/xilinx/zynqmp.c | 4 ++-- include/linux/firmware/xlnx-zynqmp.h | 2 +- 5 files changed, 11 insertions(+), 18 deletions(-) diff --git a/drivers/clk/zynqmp/clkc.c b/drivers/clk/zynqmp/clkc.c index 10e89f2..5eed5ce 100644 --- a/drivers/clk/zynqmp/clkc.c +++ b/drivers/clk/zynqmp/clkc.c @@ -134,7 +134,6 @@ static struct clk_hw *(* const clk_topology[]) (const char *name, u32 clk_id, static struct zynqmp_clock *clock; static struct clk_hw_onecell_data *zynqmp_data; static unsigned int clock_max_idx; -static const struct zynqmp_eemi_ops *eemi_ops; /** * zynqmp_is_valid_clock() - Check whether clock is valid or not @@ -206,7 +205,7 @@ static int zynqmp_pm_clock_get_num_clocks(u32 *nclocks) qdata.qid = PM_QID_CLOCK_GET_NUM_CLOCKS; - ret = eemi_ops->query_data(qdata, ret_payload); + ret = zynqmp_pm_query_data(qdata, ret_payload); *nclocks = ret_payload[1]; return ret; @@ -231,7 +230,7 @@ static int zynqmp_pm_clock_get_name(u32 clock_id, qdata.qid = PM_QID_CLOCK_GET_NAME; qdata.arg1 = clock_id; - eemi_ops->query_data(qdata, ret_payload); + zynqmp_pm_query_data(qdata, ret_payload); memcpy(response, ret_payload, sizeof(*response)); return 0; @@ -265,7 +264,7 @@ static int zynqmp_pm_clock_get_topology(u32 clock_id, u32 index, qdata.arg1 = clock_id; qdata.arg2 = index; - ret = eemi_ops->query_data(qdata, ret_payload); + ret = zynqmp_pm_query_data(qdata, ret_payload); memcpy(response, &ret_payload[1], sizeof(*response)); return ret; @@ -296,7 +295,7 @@ struct clk_hw *zynqmp_clk_register_fixed_factor(const char *name, u32 clk_id, qdata.qid = PM_QID_CLOCK_GET_FIXEDFACTOR_PARAMS; qdata.arg1 = clk_id; - ret = eemi_ops->query_data(qdata, ret_payload); + ret = zynqmp_pm_query_data(qdata, ret_payload); if (ret) return ERR_PTR(ret); @@ -339,7 +338,7 @@ static int zynqmp_pm_clock_get_parents(u32 clock_id, u32 index, qdata.arg1 = clock_id; qdata.arg2 = index; - ret = eemi_ops->query_data(qdata, ret_payload); + ret = zynqmp_pm_query_data(qdata, ret_payload); memcpy(response, &ret_payload[1], sizeof(*response)); return ret; @@ -364,7 +363,7 @@ static int zynqmp_pm_clock_get_attributes(u32 clock_id, qdata.qid = PM_QID_CLOCK_GET_ATTRIBUTES; qdata.arg1 = clock_id; - ret = eemi_ops->query_data(qdata, ret_payload); + ret = zynqmp_pm_query_data(qdata, ret_payload); memcpy(response, &ret_payload[1], sizeof(*response)); return ret; @@ -738,10 +737,6 @@ static int zynqmp_clock_probe(struct platform_device *pdev) int ret; struct device *dev = &pdev->dev; - eemi_ops = zynqmp_pm_get_eemi_ops(); - if (IS_ERR(eemi_ops)) - return PTR_ERR(eemi_ops); - ret = zynqmp_clk_setup(dev->of_node); return ret; diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c index 4be2cc7..e21f4ea 100644 --- a/drivers/clk/zynqmp/divider.c +++ b/drivers/clk/zynqmp/divider.c @@ -258,7 +258,6 @@ static const struct clk_ops zynqmp_clk_divider_ops = { */ u32 zynqmp_clk_get_max_divisor(u32 clk_id, u32 type) { - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); struct zynqmp_pm_query_data qdata = {0}; u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; @@ -266,7 +265,7 @@ u32 zynqmp_clk_get_max_divisor(u32 clk_id, u32 type) qdata.qid = PM_QID_CLOCK_GET_MAX_DIVISOR; qdata.arg1 = clk_id; qdata.arg2 = type; - ret = eemi_ops->query_data(qdata, ret_payload); + ret = zynqmp_pm_query_data(qdata, ret_payload); /* * To maintain backward compatibility return maximum possible value * (0xFFFF) if query for max divisor is not successful. diff --git a/drivers/firmware/xilinx/zynqmp-debug.c b/drivers/firmware/xilinx/zynqmp-debug.c index de4faf2..c396f29 100644 --- a/drivers/firmware/xilinx/zynqmp-debug.c +++ b/drivers/firmware/xilinx/zynqmp-debug.c @@ -85,7 +85,6 @@ static int get_pm_api_id(char *pm_api_req, u32 *pm_id) static int process_api_request(u32 pm_id, u64 *pm_api_arg, u32 *pm_api_ret) { - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); u32 pm_api_version; int ret; struct zynqmp_pm_query_data qdata = {0}; @@ -102,7 +101,7 @@ static int process_api_request(u32 pm_id, u64 *pm_api_arg, u32 *pm_api_ret) qdata.arg2 = pm_api_arg[2]; qdata.arg3 = pm_api_arg[3]; - ret = eemi_ops->query_data(qdata, pm_api_ret); + ret = zynqmp_pm_query_data(qdata, pm_api_ret); if (ret) break; diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 02d89e9..e25a540 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -326,7 +326,7 @@ static int get_set_conduit_method(struct device_node *np) * * Return: Returns status, either success or error+reason */ -static int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out) +int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out) { int ret; @@ -340,6 +340,7 @@ static int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out) */ return qdata.qid == PM_QID_CLOCK_GET_NAME ? 0 : ret; } +EXPORT_SYMBOL_GPL(zynqmp_pm_query_data); /** * zynqmp_pm_clock_enable() - Enable the clock for given id @@ -710,7 +711,6 @@ static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, } static const struct zynqmp_eemi_ops eemi_ops = { - .query_data = zynqmp_pm_query_data, .clock_enable = zynqmp_pm_clock_enable, .clock_disable = zynqmp_pm_clock_disable, .clock_getstate = zynqmp_pm_clock_getstate, diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 84b4160..283d039 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -288,7 +288,6 @@ struct zynqmp_pm_query_data { struct zynqmp_eemi_ops { int (*fpga_load)(const u64 address, const u32 size, const u32 flags); int (*fpga_get_status)(u32 *value); - int (*query_data)(struct zynqmp_pm_query_data qdata, u32 *out); int (*clock_enable)(u32 clock_id); int (*clock_disable)(u32 clock_id); int (*clock_getstate)(u32 clock_id, u32 *state); @@ -317,6 +316,7 @@ struct zynqmp_eemi_ops { int zynqmp_pm_get_api_version(u32 *version); int zynqmp_pm_get_chipid(u32 *idcode, u32 *version); +int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out); int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 *ret_payload); From patchwork Fri Mar 6 23:47:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424835 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6328C174A for ; Fri, 6 Mar 2020 23:54:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 40BC6206E2 for ; Fri, 6 Mar 2020 23:54:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DvR+aXU8"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="Ouu9j535" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40BC6206E2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=6OXryBrTUI1ypuAho61wZntnW2KhvPlEHHHV7OucoLk=; b=DvR+aXU8zuuVpa 1sZZMsHr5CN8xo4fM8n7CkTFYYDq+Bjf/8NBpld5T9y32g/8uzKJxYunYex/m/cwfvAz9CsnE4uoE AR5NNUv9iZEEJiDQM4ORv3u0TEZvlghkzE/3SS55dGhTGcL2v4GoRtjceZXx3BbKaJ4cYLwavpsI8 TF5gqnQxLECSBVmOOXZarfxyuq+yGOJdZ+l1hcYkgYVMGWU8gGLMnqA0SFbuoM7MhNO3+i5p00tHI 1Ccn5HkWiW9PjxTEHTfRqRFcN6vtNbyUHE1337fQpJ8GUtvuLNWtu7pgnym++xowBV+MhVGUdRltN SnATmcan961LtBB1kzUw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMn9-0003e1-54; Fri, 06 Mar 2020 23:54:07 +0000 Received: from mail-mw2nam10on2058.outbound.protection.outlook.com ([40.107.94.58] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhJ-000655-63 for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dhar/Od/OhsNjhDrP69NYvhOqOCYK5GBRhi5KPkdDNuiBBKBnTI8s4MfcOd9vish0x147RDfcV98sQZRUiDrAH+SWI2/lv+DB2j7E0TjorI8I97SsC++KtWP7ZkHxxI6EyU2S9yVREu8ggiz08ZFF89ZJ2dqknsUxHbf75EY9+YaGEP4KuQz3OjTOuiOTymmlLXZAF+0jMWTCnHqM44AFllo6ofZNmGSPFJpYYFve/Nd3kI+OXJJ9jCe4BbX9T56cCxO6Vs0HWE+kX3MoIaHgtklcErbwZ05ffFzEgOmeICXwgZeBppmQJJ6/ZFvggbEGDE6QBi2QKTPIqpm3vL6kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=exhMmoAsa48T+xXW5O7w5Dsgjt6wxhjxqlW3XKRBfUA=; b=iSR2LDGJvTvXxV1jPQeBPb3TfZ8/L6gndKOJa7COCEbw7xNCNdIxmxgkyEWuYTmra0Y4FvBdvTR75q1y3jmC/JH8d4UVgeDWm58gj5Pbs21xhJIbfSdGr+2f/j3tDhnjlTts3RZzE1jvG47Hz6HAb/l7V/HKmmeHphd31CnnT5JBySQfHumnYFtksEozct2dcBonz0v1C/MHVVcMDwTZcPGAE5R/zRLrzxF7yqxQwTpHnUcwqAvYqm8BGpICLWqmokC+bDtul5QremPUkfUH5AFn4HAlhOMLGkaKzksJkUu7+B8kXQJHwQcC8EXKcGpNDq3CE2LHu2dKy30tzpaQ6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=exhMmoAsa48T+xXW5O7w5Dsgjt6wxhjxqlW3XKRBfUA=; b=Ouu9j535IVE7b2glQ31bje+pMdT2Fo1nJoKVWwLhXlTSl/MTO5voTx8os6x+etNdOyrogWTDeBGET8/JPqwpPCyKPhxfqx0yhq4QjpDubPXiuarBGi4/TmsGnrJwUZwyP1qIZ+SXW7InVZOhtJYyQ0IP2X1b268l7Gm5vhsq/oo= Received: from SN2PR01CA0026.prod.exchangelabs.com (2603:10b6:804:2::36) by BYAPR02MB4005.namprd02.prod.outlook.com (2603:10b6:a02:f8::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.15; Fri, 6 Mar 2020 23:47:59 +0000 Received: from SN1NAM02FT007.eop-nam02.prod.protection.outlook.com (2603:10b6:804:2:cafe::8a) by SN2PR01CA0026.outlook.office365.com (2603:10b6:804:2::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.16 via Frontend Transport; Fri, 6 Mar 2020 23:47:58 +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 SN1NAM02FT007.mail.protection.outlook.com (10.152.72.88) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:58 +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 1jAMhC-0003QC-2J; Fri, 06 Mar 2020 15:47:58 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh6-0002g8-VR; Fri, 06 Mar 2020 15:47:53 -0800 Received: from xsj-pvapsmtp01 (xsj-pvapsmtp01.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 026Nlj5u001003; Fri, 6 Mar 2020 15:47:46 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMgz-0002eg-SJ; Fri, 06 Mar 2020 15:47:45 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 04/24] firmware: xilinx: Remove eemi ops for clock_enable Date: Fri, 6 Mar 2020 15:47:12 -0800 Message-Id: <1583538452-1992-5-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(396003)(346002)(376002)(136003)(39860400002)(189003)(199004)(9786002)(81166006)(81156014)(8676002)(7416002)(36756003)(8936002)(478600001)(70206006)(6666004)(70586007)(356004)(5660300002)(7696005)(54906003)(316002)(2906002)(186003)(426003)(26005)(4326008)(336012)(107886003)(2616005)(44832011)(6636002); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR02MB4005; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 07a3be69-0a20-4773-dc04-08d7c228ccd4 X-MS-TrafficTypeDiagnostic: BYAPR02MB4005: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:229; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: njOHN2o8uWmkE/AMrrv72COnkZrLeVWDF4yeRc8NtCmlNjGXykxGuO2BZbPjToU2GycLFT199Dk5RGMYRKvSEYz3jCIVoJA7a1qIVkWgtfG4HxHgDPJ4oWMkwVJUDlHLdvT4OBGDc96irNTU5H75mPUrZNKvZ4BpqvJWvK9ognNx1Vo1Br+niIC4Ls5FDCKyyrUvvfiBBsRpASd1HLQ01cOyqrO7z4+MWOkZqmGcSJR9COzovnWVXVPskf2PWcjLelDh0bIX4ROZ31w2EdgGgIDY9FLCYqK3D4PTkUNIMr5GfkM0TBerckyTJIlvOWf7Ag06DelGzztqRWZbxiXigXJKp0DSgdp42JfjOPXir5oOLKVX/2eiDIV5PDevkTDcFH/ZVCuOXolVngLRAexQvtV1cl+01+0S1hyJEqYyaYDw3zC5IwZEK+9RZIckAUnt X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:58.5715 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 07a3be69-0a20-4773-dc04-08d7c228ccd4 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: BYAPR02MB4005 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154805_272478_8417C5B9 X-CRM114-Status: GOOD ( 11.89 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.94.58 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , Rajan Vaja , rajanv@xilinx.com, linux-kernel@vger.kernel.org, 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 From: Rajan Vaja Use direct function call for clock_enable instead of eemi ops. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/clk/zynqmp/clk-gate-zynqmp.c | 2 +- drivers/clk/zynqmp/pll.c | 3 +-- drivers/firmware/xilinx/zynqmp.c | 4 ++-- include/linux/firmware/xlnx-zynqmp.h | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/clk/zynqmp/clk-gate-zynqmp.c b/drivers/clk/zynqmp/clk-gate-zynqmp.c index 83b236f..437b921 100644 --- a/drivers/clk/zynqmp/clk-gate-zynqmp.c +++ b/drivers/clk/zynqmp/clk-gate-zynqmp.c @@ -39,7 +39,7 @@ static int zynqmp_clk_gate_enable(struct clk_hw *hw) int ret; const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); - ret = eemi_ops->clock_enable(clk_id); + ret = zynqmp_pm_clock_enable(clk_id); if (ret) pr_warn_once("%s() clock enabled failed for %s, ret = %d\n", diff --git a/drivers/clk/zynqmp/pll.c b/drivers/clk/zynqmp/pll.c index 89b5995..153aa67 100644 --- a/drivers/clk/zynqmp/pll.c +++ b/drivers/clk/zynqmp/pll.c @@ -246,12 +246,11 @@ static int zynqmp_pll_enable(struct clk_hw *hw) const char *clk_name = clk_hw_get_name(hw); u32 clk_id = clk->clk_id; int ret; - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); if (zynqmp_pll_is_enabled(hw)) return 0; - ret = eemi_ops->clock_enable(clk_id); + ret = zynqmp_pm_clock_enable(clk_id); if (ret) pr_warn_once("%s() clock enable failed for %s, ret = %d\n", __func__, clk_name, ret); diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index e25a540..dd98214 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -351,10 +351,11 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_query_data); * * Return: Returns status, either success or error+reason */ -static int zynqmp_pm_clock_enable(u32 clock_id) +int zynqmp_pm_clock_enable(u32 clock_id) { return zynqmp_pm_invoke_fn(PM_CLOCK_ENABLE, clock_id, 0, 0, 0, NULL); } +EXPORT_SYMBOL_GPL(zynqmp_pm_clock_enable); /** * zynqmp_pm_clock_disable() - Disable the clock for given id @@ -711,7 +712,6 @@ static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, } static const struct zynqmp_eemi_ops eemi_ops = { - .clock_enable = zynqmp_pm_clock_enable, .clock_disable = zynqmp_pm_clock_disable, .clock_getstate = zynqmp_pm_clock_getstate, .clock_setdivider = zynqmp_pm_clock_setdivider, diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 283d039..7dc72d3 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -288,7 +288,6 @@ struct zynqmp_pm_query_data { struct zynqmp_eemi_ops { int (*fpga_load)(const u64 address, const u32 size, const u32 flags); int (*fpga_get_status)(u32 *value); - int (*clock_enable)(u32 clock_id); int (*clock_disable)(u32 clock_id); int (*clock_getstate)(u32 clock_id, u32 *state); int (*clock_setdivider)(u32 clock_id, u32 divider); @@ -317,6 +316,7 @@ struct zynqmp_eemi_ops { int zynqmp_pm_get_api_version(u32 *version); int zynqmp_pm_get_chipid(u32 *idcode, u32 *version); int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out); +int zynqmp_pm_clock_enable(u32 clock_id); int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 *ret_payload); From patchwork Fri Mar 6 23:47:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424839 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DDB4F174A for ; Fri, 6 Mar 2020 23:54:44 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B77BD20658 for ; Fri, 6 Mar 2020 23:54:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tLrppUli"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="XAt64xgV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B77BD20658 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=InojvRuux+8/ZE+RwnAoQ6pcTOkTmQbxS84jUP92EbM=; b=tLrppUli0Tm0y0 W3DnIib3dbW6Mg6PRoR5aTNHXfAUqvKGL1ReFtJgFqnd3gft0Cw/MDSoyhUbIzapRV4awoK2eBa0C gqVp2nS1+PKEFbEIAz47zh0UcnsFfnS10bpI4TAySltMoRtWHixh8q4CWp345WSWiHAz8aEbZHYcb 9JlPF0b9asz/W4ohY4tR4KLQ/EkLic5s5tVzjSKk46fZA/AgJh5LVSw4CnXpRuLaemViSgZxQBTl1 2XuTB+WE++hetZrwDKredtvTMQQ/k8dZJBbohSTWepmg6YuKqEPeSkwK11orgyRAKVrBtjl5qf0EJ eZA+MKVKrX7EfHDv+Lww==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMnf-00047C-Vn; Fri, 06 Mar 2020 23:54:40 +0000 Received: from mail-dm6nam11on20602.outbound.protection.outlook.com ([2a01:111:f400:7eaa::602] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhK-00065y-RO for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xa3LSPBeDx+qmhaSmQEypbcsrQ8tVseih/rdT4gSQX861mjl7ESq6gilA8TORegHGTAu1N5hyYYkauJyDsojuZVqpU5q7Xyv67HtsNvR2OH/Z+72mhlCkJsBj/0ie5IWyOSf3c2PHX1qlWwafCzW+iiaa6bhRvo8wsfsJw0xoPmJu2olakuYv9094fJXxVWCpxeY7Ax//KOkAkksGdu52mlAf43ol5p+99aAehyiPWMKhZQd/e+G4eA9LeHu04OY/1y5G3WffB4Es6S1oC+9Dxfv2vfuxVe3dLAsPXs7IVmmHUROdAMBsV7x0VQk9XiFob3QLQlBavqJkRcUGZcIrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qAPsQqe+QHBLr1+vx2Hjc5o4AgJtvdzJaHm7GufGCZc=; b=agz+NuR5RGRIxF8IskfidloCDWt7NCrSxWHuR7t3BNumGpDjthqN6jHOz9T2nFsqv/Tp+uG7WxFGo5ygxsMMf3lkw1FPOYQuuUM2G/W8/Jfo93jpGg2g6EqGuH4vf9ofLvaIaezDuSP34Sv7flWczEhUakwKf6D3qlvDwGFA3IlFdccRslzjC4q3c7emintaNCLK+Z4Ew1tB1R5xwhzLmN55NZdmrCBOxG8cyb/D1JM71ynjLG0zs5aFj47VO8lkC7rjUuIhT++Oq2vFzn0myKTtgwWHfxpNQYc3dXyfnU1y+k8Xhwf//pXXjoPIR3tNDke9uxfOwfGrJwQsHJzb3A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qAPsQqe+QHBLr1+vx2Hjc5o4AgJtvdzJaHm7GufGCZc=; b=XAt64xgVWEEnXE/wjDvRUsX2qo7L+v2BzN8bEHbPVUwc4ok5jSGRenTfnWbK8gztPF4UpOz4bAb5jxAMqPGqj7+WaM8WUQJCKNVaSoP/E446wloDiGVa0MmSP7mOBradbPv/qPdsUc9MInIueo4Z9Dq4V8r4j3BiTfD9neUKRB0= Received: from SN2PR01CA0002.prod.exchangelabs.com (2603:10b6:804:2::12) by BYAPR02MB4407.namprd02.prod.outlook.com (2603:10b6:a03:55::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.15; Fri, 6 Mar 2020 23:47:59 +0000 Received: from SN1NAM02FT057.eop-nam02.prod.protection.outlook.com (2603:10b6:804:2:cafe::4b) by SN2PR01CA0002.outlook.office365.com (2603:10b6:804:2::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.15 via Frontend Transport; Fri, 6 Mar 2020 23:47:59 +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 SN1NAM02FT057.mail.protection.outlook.com (10.152.73.105) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:58 +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 1jAMhC-0003QG-G4; Fri, 06 Mar 2020 15:47:58 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh7-0002g8-Cy; Fri, 06 Mar 2020 15:47:53 -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 026NlkqE002394; Fri, 6 Mar 2020 15:47:46 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMgz-0002eg-UN; Fri, 06 Mar 2020 15:47:45 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 05/24] firmware: xilinx: Remove eemi ops for clock_disable Date: Fri, 6 Mar 2020 15:47:13 -0800 Message-Id: <1583538452-1992-6-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(136003)(396003)(376002)(346002)(39860400002)(199004)(189003)(2906002)(81156014)(8676002)(81166006)(44832011)(356004)(336012)(6666004)(426003)(7416002)(9786002)(54906003)(8936002)(7696005)(26005)(4326008)(36756003)(186003)(478600001)(107886003)(70206006)(6636002)(316002)(70586007)(2616005)(5660300002)(42866002); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR02MB4407; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e6b63a9f-5352-4964-9448-08d7c228cd08 X-MS-TrafficTypeDiagnostic: BYAPR02MB4407: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:107; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4yGF9QoH0afoCaPIbiQSCVsILbgsR63pr3z8hsqk1WWx0y1luXiwNxunYMC3rEH1nST+SVPhKMlaJdHNDTQlbczFdks+iedy8fdGgTeenwTbl1hfFT9LC4ZT8ercNlkD98NJspwTQhwJNG8QU6lNFP9wxq6i960ny/pQ3ESvEeFLFVzj0W/V2ppb4ojpStva2HuYE34jlYALu56j8HnLMdY+nM32SMVIC2Gkwmf7yDKwV5YrrNyz8Q6q4r/ZtuI5Ehikn2PIl8LFhcGAJbRzNqOFCPIdi8MnUlAlT1IVn6G4yHvxJXisaJEamhlSAwH7DtNREcR+dX1YNFoTLQbhxrhtPUNFZC7KNYfM/z1jmO2fxxekRqxYVm8qLbj8uIgT5PA6NBk0dTSuXCsKh05LF0TToLvlTsc3Eoha0M0QUDJcLR4axuF2vok/8aoNa4BN3VanvjBbCdsfclk49ZTVCvppf5J+5I+TObrphy+Evw1u4GxXZDKBmUNBczZphTEx X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:58.9115 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e6b63a9f-5352-4964-9448-08d7c228cd08 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: BYAPR02MB4407 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154806_909388_AE374E13 X-CRM114-Status: GOOD ( 12.10 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , Rajan Vaja , rajanv@xilinx.com, linux-kernel@vger.kernel.org, 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 From: Rajan Vaja Use direct function call for clock_disable instead using of eemi ops. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/clk/zynqmp/clk-gate-zynqmp.c | 4 +--- drivers/clk/zynqmp/pll.c | 3 +-- drivers/firmware/xilinx/zynqmp.c | 4 ++-- include/linux/firmware/xlnx-zynqmp.h | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/clk/zynqmp/clk-gate-zynqmp.c b/drivers/clk/zynqmp/clk-gate-zynqmp.c index 437b921..11f1b97 100644 --- a/drivers/clk/zynqmp/clk-gate-zynqmp.c +++ b/drivers/clk/zynqmp/clk-gate-zynqmp.c @@ -37,7 +37,6 @@ static int zynqmp_clk_gate_enable(struct clk_hw *hw) const char *clk_name = clk_hw_get_name(hw); u32 clk_id = gate->clk_id; int ret; - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); ret = zynqmp_pm_clock_enable(clk_id); @@ -58,9 +57,8 @@ static void zynqmp_clk_gate_disable(struct clk_hw *hw) const char *clk_name = clk_hw_get_name(hw); u32 clk_id = gate->clk_id; int ret; - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); - ret = eemi_ops->clock_disable(clk_id); + ret = zynqmp_pm_clock_disable(clk_id); if (ret) pr_warn_once("%s() clock disable failed for %s, ret = %d\n", diff --git a/drivers/clk/zynqmp/pll.c b/drivers/clk/zynqmp/pll.c index 153aa67..38b8dbc 100644 --- a/drivers/clk/zynqmp/pll.c +++ b/drivers/clk/zynqmp/pll.c @@ -268,12 +268,11 @@ static void zynqmp_pll_disable(struct clk_hw *hw) const char *clk_name = clk_hw_get_name(hw); u32 clk_id = clk->clk_id; int ret; - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); if (!zynqmp_pll_is_enabled(hw)) return; - ret = eemi_ops->clock_disable(clk_id); + ret = zynqmp_pm_clock_disable(clk_id); if (ret) pr_warn_once("%s() clock disable failed for %s, ret = %d\n", __func__, clk_name, ret); diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index dd98214..00cdaaf 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -366,10 +366,11 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_clock_enable); * * Return: Returns status, either success or error+reason */ -static int zynqmp_pm_clock_disable(u32 clock_id) +int zynqmp_pm_clock_disable(u32 clock_id) { return zynqmp_pm_invoke_fn(PM_CLOCK_DISABLE, clock_id, 0, 0, 0, NULL); } +EXPORT_SYMBOL_GPL(zynqmp_pm_clock_disable); /** * zynqmp_pm_clock_getstate() - Get the clock state for given id @@ -712,7 +713,6 @@ static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, } static const struct zynqmp_eemi_ops eemi_ops = { - .clock_disable = zynqmp_pm_clock_disable, .clock_getstate = zynqmp_pm_clock_getstate, .clock_setdivider = zynqmp_pm_clock_setdivider, .clock_getdivider = zynqmp_pm_clock_getdivider, diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 7dc72d3..d2f5677 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -288,7 +288,6 @@ struct zynqmp_pm_query_data { struct zynqmp_eemi_ops { int (*fpga_load)(const u64 address, const u32 size, const u32 flags); int (*fpga_get_status)(u32 *value); - int (*clock_disable)(u32 clock_id); int (*clock_getstate)(u32 clock_id, u32 *state); int (*clock_setdivider)(u32 clock_id, u32 divider); int (*clock_getdivider)(u32 clock_id, u32 *divider); @@ -317,6 +316,7 @@ int zynqmp_pm_get_api_version(u32 *version); int zynqmp_pm_get_chipid(u32 *idcode, u32 *version); int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out); int zynqmp_pm_clock_enable(u32 clock_id); +int zynqmp_pm_clock_disable(u32 clock_id); int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 *ret_payload); From patchwork Fri Mar 6 23:47:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424799 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D0D1A921 for ; Fri, 6 Mar 2020 23:49:17 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AB7B5206D5 for ; Fri, 6 Mar 2020 23:49:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pSpuHSIr"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="Qu7hczg9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AB7B5206D5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=N3Rqj9qx1sYcoG64QQ/32azBAKU7nn2WQdPjGI/VhZY=; b=pSpuHSIr+7z3r3 m/Hv4WTYF3acIu1B0MzCsDbCEWI0LjtmBGRSafoImqNRaGNozTUXRXhu/ZkihtY3sOpsXq/Swjx7z B/JFTlIi+FwX7u1xrQOqPIQplwlNBB0uFARO6lC0qhseZnmWSFNUPYZaficFd0zXK/F8eNZYwT31R rm0zWMJ8MA0XWzXvLVqJcKJ6SDoIhYXzmHnTDFvVh2wMLfoM6wt0TcYqPr9jHKreyXqkiI6GGIDD8 WrLE61p+bF/7GTgaDSeL2AQBmEM2q0e6rDL/fY6riTqekhh9dDKwNQRDuU+lIbIO3tP8qLgoHpqcH /mEXjCLazaCqJ1vqc79w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMiR-0006yj-6O; Fri, 06 Mar 2020 23:49:15 +0000 Received: from mail-mw2nam10on2085.outbound.protection.outlook.com ([40.107.94.85] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhE-0005yW-HN for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Aju/sRCkwwDrw5Qycc2z0RarbqSq73rZb4hLa++u2Y6d3Pz0UlSN5KSxG1Anlj08S5nr9VRAa/6wZfeBLjxWSappRaAU1PZVKYfzLPO77yF9Q98mQBQzIGuQHA2fT/2zGioCh0hA8REfOdtR+ITvQg95Xx9SlsRnaBkU5JrJH/Wycm5W5m1eefQ63L9uvt9lT0LEBU4+pIvVGMGn2leK9jm4XjCjZerqb/MXsizR9/8lZ1nWI7Y3CdI+DWyLKjIu94W5MRndVcoo55mxcE2pK86X3jgmhKlZrkz25Cfklj5evWUJH2HDXU/v+Ik3nI/pIodrcRvIwkacCS1NUrYNcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vv62Pb4CbY+oJb+aq6hHBludD/jLPpakm8DwS4dhFH0=; b=Tj/E9Im9GHaNmDselUS0BajldurM+7NsydUtnpukLFIl/yHLMAVkntQ4nm/LCbhgpd3e8fiIhqj3FtoqrOP4E/TUIWHYJDFkR6HT35asVjkAsIBJBA+6jte4/Y5xT3yuwMRNHKfuYgCp2K+GZUyTs18v1da+RimLUT++W+ckypwO/hw9yx3Yo7rzQO9/BYcESkzdkGYI3UNGLiKbD78pv4laur37RTC6sB72CCiL78POtRADygS31+b/D2VWQM30D8gFEzxosLSBpUyw7RJrEAG8B1gOpgvVT2fO5RDY2YsFcJYjjK0Jk4YBYbbRtFRuYFvixPOhMWbkGuE8crj/9Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vv62Pb4CbY+oJb+aq6hHBludD/jLPpakm8DwS4dhFH0=; b=Qu7hczg9bEbWs302VQEITgsi1Vjqtn18MSFyJyozTcQ4O6zGYthpsIxeLucrKqg5WzJnaq5tI/FH0p1aM2awIWgOUdmHden9om6j1zbTqPqvkwMQgCJCnAQCPiwzT1CHAw7OawitAjGeqaT/RGEX71FiAUGTQzldeR/OSW95aek= Received: from SN4PR0201CA0010.namprd02.prod.outlook.com (2603:10b6:803:2b::20) by DM5PR0201MB3621.namprd02.prod.outlook.com (2603:10b6:4:77::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.19; Fri, 6 Mar 2020 23:47:57 +0000 Received: from SN1NAM02FT004.eop-nam02.prod.protection.outlook.com (2603:10b6:803:2b:cafe::c1) by SN4PR0201CA0010.outlook.office365.com (2603:10b6:803:2b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:57 +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 SN1NAM02FT004.mail.protection.outlook.com (10.152.72.175) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:57 +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 1jAMhA-0003Q0-Ti; Fri, 06 Mar 2020 15:47:56 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh5-0002g8-QO; Fri, 06 Mar 2020 15:47:51 -0800 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 026NlkwK002396; Fri, 6 Mar 2020 15:47:46 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMh0-0002eg-07; Fri, 06 Mar 2020 15:47:46 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 06/24] firmware: xilinx: Remove eemi ops for clock_getstate Date: Fri, 6 Mar 2020 15:47:14 -0800 Message-Id: <1583538452-1992-7-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(136003)(396003)(346002)(376002)(39860400002)(189003)(199004)(186003)(81166006)(81156014)(336012)(2906002)(2616005)(26005)(5660300002)(7696005)(8936002)(426003)(6636002)(9786002)(316002)(70586007)(54906003)(70206006)(7416002)(356004)(4326008)(107886003)(6666004)(36756003)(44832011)(478600001)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR0201MB3621; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 32cba7d5-6404-4bb0-9669-08d7c228cc17 X-MS-TrafficTypeDiagnostic: DM5PR0201MB3621: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:229; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S4tdsGB8hEgvvhs6UMc1WRCB0PV+wYa0SsyzCp0HxwxCHf6cJlSu1SkvAdJm36yTjL/Kdebe1VFb4Uea1LwdN+H/Z+ZspQQb1K9dc4xBiVi7+QUn62wiOle6DiqRsw17FRPCTWSkaeqf1sE7dY+zp40UfEaErv/VD9TZCYnZ6l4rXi1qF4sJ8wjIUW+hFU7Cd7Lxzx8eB00wOjyFcTw9G3HrZxL+EbdadSFQmRh7IBeI6SNiRckMIyYOdeIE48pc+nfmy9RFGfSJt9BkiWNgkHK4DR7rJhr0h8QMW/GbZapimQKeEIwzUafhg/AHLjCvJeuNTabPV9+tMwmX2yte2HRCw6A/+blVuacf4FyjllYRwL0szq1pnFNMo5i2rqP8RfS65wuSsOlVkdA9Beu5rz/G9jNg8WqMeW47JDoPv3SgW9wlrVa3+05zeG0aRy8O X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:57.3321 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 32cba7d5-6404-4bb0-9669-08d7c228cc17 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: DM5PR0201MB3621 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154800_600479_C5DD5685 X-CRM114-Status: GOOD ( 11.80 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.94.85 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , Rajan Vaja , rajanv@xilinx.com, linux-kernel@vger.kernel.org, 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 From: Rajan Vaja Use direct function call instead of eemi ops for clock_getstate. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/clk/zynqmp/clk-gate-zynqmp.c | 3 +-- drivers/clk/zynqmp/pll.c | 3 +-- drivers/firmware/xilinx/zynqmp.c | 4 ++-- include/linux/firmware/xlnx-zynqmp.h | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/clk/zynqmp/clk-gate-zynqmp.c b/drivers/clk/zynqmp/clk-gate-zynqmp.c index 11f1b97..10c9b88 100644 --- a/drivers/clk/zynqmp/clk-gate-zynqmp.c +++ b/drivers/clk/zynqmp/clk-gate-zynqmp.c @@ -77,9 +77,8 @@ static int zynqmp_clk_gate_is_enabled(struct clk_hw *hw) const char *clk_name = clk_hw_get_name(hw); u32 clk_id = gate->clk_id; int state, ret; - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); - ret = eemi_ops->clock_getstate(clk_id, &state); + ret = zynqmp_pm_clock_getstate(clk_id, &state); if (ret) { pr_warn_once("%s() clock get state failed for %s, ret = %d\n", __func__, clk_name, ret); diff --git a/drivers/clk/zynqmp/pll.c b/drivers/clk/zynqmp/pll.c index 38b8dbc..41f376a 100644 --- a/drivers/clk/zynqmp/pll.c +++ b/drivers/clk/zynqmp/pll.c @@ -222,9 +222,8 @@ static int zynqmp_pll_is_enabled(struct clk_hw *hw) u32 clk_id = clk->clk_id; unsigned int state; int ret; - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); - ret = eemi_ops->clock_getstate(clk_id, &state); + ret = zynqmp_pm_clock_getstate(clk_id, &state); if (ret) { pr_warn_once("%s() clock get state failed for %s, ret = %d\n", __func__, clk_name, ret); diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 00cdaaf..8a0d5af 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -382,7 +382,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_clock_disable); * * Return: Returns status, either success or error+reason */ -static int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state) +int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state) { u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; @@ -393,6 +393,7 @@ static int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state) return ret; } +EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getstate); /** * zynqmp_pm_clock_setdivider() - Set the clock divider for given id @@ -713,7 +714,6 @@ static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, } static const struct zynqmp_eemi_ops eemi_ops = { - .clock_getstate = zynqmp_pm_clock_getstate, .clock_setdivider = zynqmp_pm_clock_setdivider, .clock_getdivider = zynqmp_pm_clock_getdivider, .clock_setrate = zynqmp_pm_clock_setrate, diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index d2f5677..44c6702 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -288,7 +288,6 @@ struct zynqmp_pm_query_data { struct zynqmp_eemi_ops { int (*fpga_load)(const u64 address, const u32 size, const u32 flags); int (*fpga_get_status)(u32 *value); - int (*clock_getstate)(u32 clock_id, u32 *state); int (*clock_setdivider)(u32 clock_id, u32 divider); int (*clock_getdivider)(u32 clock_id, u32 *divider); int (*clock_setrate)(u32 clock_id, u64 rate); @@ -317,6 +316,7 @@ int zynqmp_pm_get_chipid(u32 *idcode, u32 *version); int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out); int zynqmp_pm_clock_enable(u32 clock_id); int zynqmp_pm_clock_disable(u32 clock_id); +int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state); int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 *ret_payload); From patchwork Fri Mar 6 23:47:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424823 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 90090921 for ; Fri, 6 Mar 2020 23:52:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 43A0020658 for ; Fri, 6 Mar 2020 23:52:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="leBTDBnO"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="cSRFqadF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 43A0020658 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=E5Nc5r+awPmdKco162Njtva9gO5iWQKca/vT2nxEqp0=; b=leBTDBnOBb2K7P ip4Nfux2v/62qi9sx2nrOGy9thAm5cay/vYxUzyJfibHcrjsz48ruKvvh+uaJ7kY46b54obP4gFn5 aY3TVeOTH9e9DhHwwkzTlVJbeO6Q+Gxxb5gcW448STca0r9Y2OxDnFqnu2E3SkaXxTlZx+dcaV3Yv Z9Gb39pa1bxmgOf+uWNhVScHa44qvukYAHfzKahDGxRG89FGfYad4GyvEJOS0gKd1eBk4Epk8Fsp1 K5uq/TxEJSmgy5blyhmegsMbuKIx1CCWTV/nfC4ZHtzd+Kxbp1wth0nbLiPE5dlUfEt9TBIkIjVXx DxLZ+FiXDsU6O3DEgavA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMlO-0002Cm-Tm; Fri, 06 Mar 2020 23:52:18 +0000 Received: from mail-bn8nam12on2072.outbound.protection.outlook.com ([40.107.237.72] helo=NAM12-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhG-00060i-8X for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TMqvF8GmvcoFWMNRYVWcMe11WYJgVZsIPFuyr2kziFUsHbAyA9Ix/BPqNdjTH31/7sOqjLzHacV2powZexQ80jh9H70NSFX/ubYKRlzw9FwecYmROoown5oWi/Oy/+AGFHxOf+2KPrVCDV5+mqeOc4bJaVb5g1d6ushaT1STburMdg+xbpJwje7SQ+arEYs9TYufrzomQc26H8cpX5/ZEPHwzSx5SYMwpVX8swP0iL27coq016UY/iEs35I1TYUGr+lYUovlphPYijUScSoIHUQ1o25TOzAofjlxTlKy44PheaeNvn3Jzt656ygOXiaenQ051CaVAqbfr21MDFlT6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WLEAeyI+3oHi4tbKbUDvf4scnaRmOZx6yvHP+DrCo3g=; b=n9YCWyDagFCZXSioK82wK1Sfu4FFiHm2O9xYDf5bbXK4SMsHmF/q4Wr9BSt9FzQlqO+1ds/VFFTNdJgjoiXiEClhWdrsGvTd42JfKK7k/iHRGnW6B686/8+/vIUQdeNnsfpJuGsGvhErm2+UfdBNPKUv6eUCigyqN0gC6C7BYoPEphb6twpYx3Yj0gweBTzqn969fKV9gpbi8str+forzJl3SmIcViOXuoW61IQGWyLPQx6YA0+3/c9OQYUcHfCXN4XOKPPhJhA7OgVmqYxhZniwl9Hf5lxjtgoqJXz3e2ltV5aPQ8Y+aVrrFwWYYWC/syt0YsPbvzBYLYsSVF4FaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WLEAeyI+3oHi4tbKbUDvf4scnaRmOZx6yvHP+DrCo3g=; b=cSRFqadFFbEvnozSgbmn5G5MZRlo95N5lLOPerySa3y6trsWD/r7sI5gU1DIugEd/cnoiXCaW50ZOYnQ45cm9dGccnBchslpEtFe6YV4WuEFeWypVMZotYNo67Rf9/UzeMg3ciOe5jIJ0Hw/CWMTebe+gZC3vBrCETJlVUqIo5Q= Received: from SN4PR0701CA0015.namprd07.prod.outlook.com (2603:10b6:803:28::25) by CY4PR02MB2855.namprd02.prod.outlook.com (2603:10b6:903:11f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.15; Fri, 6 Mar 2020 23:47:59 +0000 Received: from SN1NAM02FT012.eop-nam02.prod.protection.outlook.com (2603:10b6:803:28:cafe::21) by SN4PR0701CA0015.outlook.office365.com (2603:10b6:803:28::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.16 via Frontend Transport; Fri, 6 Mar 2020 23:47:59 +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 SN1NAM02FT012.mail.protection.outlook.com (10.152.72.95) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:58 +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 1jAMhC-0003QH-HX; Fri, 06 Mar 2020 15:47:58 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh7-0002g8-ET; Fri, 06 Mar 2020 15:47:53 -0800 Received: from xsj-pvapsmtp01 (xsj-pvapsmtp01.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 026Nlk9w001005; Fri, 6 Mar 2020 15:47:46 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMh0-0002eg-25; Fri, 06 Mar 2020 15:47:46 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 07/24] firmware: xilinx: Remove eemi ops for clock_setdivider Date: Fri, 6 Mar 2020 15:47:15 -0800 Message-Id: <1583538452-1992-8-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(346002)(136003)(39860400002)(376002)(396003)(189003)(199004)(2906002)(8676002)(81156014)(81166006)(7416002)(9786002)(6636002)(7696005)(478600001)(8936002)(36756003)(336012)(54906003)(426003)(26005)(5660300002)(70586007)(186003)(70206006)(356004)(44832011)(107886003)(316002)(4326008)(6666004)(2616005); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR02MB2855; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d234a217-a76c-4054-447d-08d7c228cd14 X-MS-TrafficTypeDiagnostic: CY4PR02MB2855: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:60; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cGMT3Cjf/4XdVNroF2AAvplymVyfwoIT+miFTRk171Avft2HasTiRwAi8QV59VV83S5WId3EDR3bqidWQe1YJLC7myKFXCNeSGmizvRgiSIERJUOKhlD5ry/broLe+Xb5ms1nYhi5xNoTRhPPw289M0//pYiNagUSpg/9bn+NTXqqbZLTopTJW1lx7lO1DAoPOJHDz6BZrRofiigkw6VkUbzx1N1oIFft1bYXqVyOU35NXfgaBGATo21skjah3ZmtztyGDpvvbc2n+hn0oqKn08BEn05UcFhSmXUhzua8HFz8LYuz9cl81SIys5XhMBpXeCvk7gns58TaDPOYTqbuQcqnWODJoUKxXC3OihNL4rKuswQ6tTetrkK+rdP5aSKXOdWhfQjG3d4yBHG2hWQChXkuTgTkmQTnc8HZtXZkYSyBJeuxrjFZJ09MEyhFOBs X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:58.9621 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d234a217-a76c-4054-447d-08d7c228cd14 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: CY4PR02MB2855 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154802_347861_C7C33133 X-CRM114-Status: GOOD ( 12.18 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.237.72 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , Rajan Vaja , rajanv@xilinx.com, linux-kernel@vger.kernel.org, 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 From: Rajan Vaja Use direct function call instead of using eemi ops for clock_setdivider. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/clk/zynqmp/divider.c | 3 +-- drivers/clk/zynqmp/pll.c | 4 ++-- drivers/firmware/xilinx/zynqmp.c | 4 ++-- include/linux/firmware/xlnx-zynqmp.h | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c index e21f4ea..13041cd 100644 --- a/drivers/clk/zynqmp/divider.c +++ b/drivers/clk/zynqmp/divider.c @@ -219,7 +219,6 @@ static int zynqmp_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate, u32 div_type = divider->div_type; u32 value, div; int ret; - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); value = zynqmp_divider_get_val(parent_rate, rate, divider->flags); if (div_type == TYPE_DIV1) { @@ -233,7 +232,7 @@ static int zynqmp_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate, if (divider->flags & CLK_DIVIDER_POWER_OF_TWO) div = __ffs(div); - ret = eemi_ops->clock_setdivider(clk_id, div); + ret = zynqmp_pm_clock_setdivider(clk_id, div); if (ret) pr_warn_once("%s() set divider failed for %s, ret = %d\n", diff --git a/drivers/clk/zynqmp/pll.c b/drivers/clk/zynqmp/pll.c index 41f376a..95fad06 100644 --- a/drivers/clk/zynqmp/pll.c +++ b/drivers/clk/zynqmp/pll.c @@ -187,7 +187,7 @@ static int zynqmp_pll_set_rate(struct clk_hw *hw, unsigned long rate, rate = parent_rate * m; frac = (parent_rate * f) / FRAC_DIV; - ret = eemi_ops->clock_setdivider(clk_id, m); + ret = zynqmp_pm_clock_setdivider(clk_id, m); if (ret == -EUSERS) WARN(1, "More than allowed devices are using the %s, which is forbidden\n", clk_name); @@ -201,7 +201,7 @@ static int zynqmp_pll_set_rate(struct clk_hw *hw, unsigned long rate, fbdiv = DIV_ROUND_CLOSEST(rate, parent_rate); fbdiv = clamp_t(u32, fbdiv, PLL_FBDIV_MIN, PLL_FBDIV_MAX); - ret = eemi_ops->clock_setdivider(clk_id, fbdiv); + ret = zynqmp_pm_clock_setdivider(clk_id, fbdiv); if (ret) pr_warn_once("%s() set divider failed for %s, ret = %d\n", __func__, clk_name, ret); diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 8a0d5af..eb39735 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -405,11 +405,12 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getstate); * * Return: Returns status, either success or error+reason */ -static int zynqmp_pm_clock_setdivider(u32 clock_id, u32 divider) +int zynqmp_pm_clock_setdivider(u32 clock_id, u32 divider) { return zynqmp_pm_invoke_fn(PM_CLOCK_SETDIVIDER, clock_id, divider, 0, 0, NULL); } +EXPORT_SYMBOL_GPL(zynqmp_pm_clock_setdivider); /** * zynqmp_pm_clock_getdivider() - Get the clock divider for given id @@ -714,7 +715,6 @@ static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, } static const struct zynqmp_eemi_ops eemi_ops = { - .clock_setdivider = zynqmp_pm_clock_setdivider, .clock_getdivider = zynqmp_pm_clock_getdivider, .clock_setrate = zynqmp_pm_clock_setrate, .clock_getrate = zynqmp_pm_clock_getrate, diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 44c6702..412b32f 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -288,7 +288,6 @@ struct zynqmp_pm_query_data { struct zynqmp_eemi_ops { int (*fpga_load)(const u64 address, const u32 size, const u32 flags); int (*fpga_get_status)(u32 *value); - int (*clock_setdivider)(u32 clock_id, u32 divider); int (*clock_getdivider)(u32 clock_id, u32 *divider); int (*clock_setrate)(u32 clock_id, u64 rate); int (*clock_getrate)(u32 clock_id, u64 *rate); @@ -317,6 +316,7 @@ int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out); int zynqmp_pm_clock_enable(u32 clock_id); int zynqmp_pm_clock_disable(u32 clock_id); int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state); +int zynqmp_pm_clock_setdivider(u32 clock_id, u32 divider); int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 *ret_payload); From patchwork Fri Mar 6 23:47:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424863 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 79F4C921 for ; Sat, 7 Mar 2020 00:04:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 53675205C9 for ; Sat, 7 Mar 2020 00:04:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PTlrGWc1"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="qU/YYAX4"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="rYo0GEwl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 53675205C9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=I0xEoimkX2UGMG2gEUayibS4FdOxIgprIjdNtJEdJBI=; b=PTlrGWc1z0JY4O bVCdvvg25HhQ9Ba5cL0NT9Q93/U678Hfy4al5X+xD5VHMmR9DO5Zv1deud5qgK3BziQLGROlWD6kN ioUlQKY0kSEDZlRxmLdMRfqyFDGJkNb3LYaoQnqzTrI6WNPoW4lgIAj07+3zDj/FqJnNhMvdJZUnr BSoyyBcMBUSbRM5w6SbyANwWWgRt7vRL0LCwbogLpSIjRdlDF2jzUOSec4b5P+6C2q+w4/0Y6wlg+ QIUqp+16qhFZ3gix0y0DYtDMYj+nRQun1Vy2BvpUQ24gu196kTGJundw7chKa7rPtoB6Y2ZgoHIMy r6XpBB7tJhFlosmyyQAA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMx0-0000nC-ER; Sat, 07 Mar 2020 00:04:18 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMwo-0008RG-FA for linux-arm-kernel@bombadil.infradead.org; Sat, 07 Mar 2020 00:04:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=I+ScBMBhsGnY/yUTCLQqXP9AduipKfNSXCxGd8xC7Do=; b=qU/YYAX4/VqJjltlEgCxDcmEaW Ge/HHbHcvYu0YcolTLSjvM4IsveUGDOQCDornJwFEFbUoqMiqRhWOA2kTRE0N3sqr27Ki88CeBk4i zZ4dtTOaSHRTvLWbK+upjFAHxRpLucAhH/Wk9p6EjVHUhFbyP/nmgq7cleXI9DgKQZ7peMWApl0N0 gavPxlS7RmZdzCB6mGCo3WXgJAYb6D4ENF5tK8kAXOfbwxOM9wxXCfSlWGKiS0G22Lsyd6Vvd5ilZ fea1pNJirq/jZTv8sD3kTXpfg33oQ6vH7hh4eEVwKfwwy1e88p+mi87Lgb1+R5VO+m7yradxpgHaC UpwjAFHQ==; Received: from mail-bn8nam12on2045.outbound.protection.outlook.com ([40.107.237.45] helo=NAM12-BN8-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhI-0004bL-DJ for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YcKx1/DO28lcFLA4u/gv2Al/+NRhP13/s4+BZ7vdoXSXToiX1ezmgHIjsJbQASj9gApdm3iqN0UUzHqb62EMY8wmApwiUeLwWoqFDeFbSuOjbSobLOvmZ45Zs3fXnFEhWsZvZpIAU9gIs1Tl+Ew1E25kPo0zQgNpAshseopK622xpxbDZqEIJP/ydxCZJcz2LLs+Cf1w3t3KJErYNQ3U1TxJnthB+Or9Zvinx7QI/L+I4sbEIhprK7fa62eJdCGc0ZJusUNnxzbmCO5DAkfjwDLxpI6WaTkQXMM7QpAqshS0uZFvz/VwxQAwhQ81SiEiDBl/ZTZCLE37acL/iYKFkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I+ScBMBhsGnY/yUTCLQqXP9AduipKfNSXCxGd8xC7Do=; b=JoX5Arrd/7Eu7N6v2UGsUBNwU7JdM34xigG9KlBtpsGfGtyhRXE64yd0kPgBeAINQtYd6zqqbQdU72LXIc07uZQNWlF5JvpZkmuPQgOPuAyyejy2fjnyxtbof4h3A4nqCDlUQYcivfI9Gjs8rj4WefY/2gZJlnm7uh+K3K5J/miDJYkhl5Rclfqja5fZoJMcHJ+NoVxKgqSOmpsPhOjnvPhD/HT0+u4hTeFsMKx5korldtlMHVlG18SWvIQThppBufz7LHZO+LJs9EZL4vrTEqK/U34oX2c2nCbTASv8llt76ZDcBntH5p4L0+lPtFvTYX92B7UJ0wCByYbE+p/AUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=I+ScBMBhsGnY/yUTCLQqXP9AduipKfNSXCxGd8xC7Do=; b=rYo0GEwlx9LPhKUlDgVhHdPiixbcNMpQOpbx1yaeXjCIdodo+teXY17Mt5URoti77GHIuxW9V0zhOzQQwY5uTWud6gZmRAupxFvfrCa44gJUXDcZrdoLjNsHEPc4rG/Ym6XMHa/RMPznkB21bYXRFgKYV9gcL14YXxuoSlxho2s= Received: from MN2PR10CA0012.namprd10.prod.outlook.com (2603:10b6:208:120::25) by DM6PR02MB4074.namprd02.prod.outlook.com (2603:10b6:5:96::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.18; Fri, 6 Mar 2020 23:47:59 +0000 Received: from BL2NAM02FT022.eop-nam02.prod.protection.outlook.com (2603:10b6:208:120:cafe::23) by MN2PR10CA0012.outlook.office365.com (2603:10b6:208:120::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:59 +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 BL2NAM02FT022.mail.protection.outlook.com (10.152.77.153) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:59 +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 1jAMhC-0003QK-QY; Fri, 06 Mar 2020 15:47:58 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh7-0002g8-NP; Fri, 06 Mar 2020 15:47:53 -0800 Received: from xsj-pvapsmtp01 (smtp-fallback.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 026NlkRQ002398; Fri, 6 Mar 2020 15:47:46 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMh0-0002eg-2n; Fri, 06 Mar 2020 15:47:46 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 08/24] firmware: xilinx: Remove eemi ops for clock_getdivider Date: Fri, 6 Mar 2020 15:47:16 -0800 Message-Id: <1583538452-1992-9-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(376002)(346002)(396003)(136003)(189003)(199004)(70586007)(336012)(8936002)(26005)(107886003)(44832011)(54906003)(6636002)(186003)(4326008)(7416002)(70206006)(5660300002)(7696005)(81166006)(81156014)(2906002)(9786002)(2616005)(36756003)(478600001)(8676002)(316002)(6666004)(356004)(426003)(42866002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR02MB4074; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5fbcfae6-734f-469f-9cf5-08d7c228cd5e X-MS-TrafficTypeDiagnostic: DM6PR02MB4074: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:229; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: y/q0xPfZrXBnL/UrZDXUf12ukXWFMw3+MV/ZXAYhiP07mIcBUUBWsLpv+Gwmcu/A/YCVNw7kI7x8nQaOgbdDpJz+q0YhMTj9a2gcG7c+lT2pTqF4k0dDAZ/Sqeij3HpgVppd9zxjwYAdKdIOS4dBIt0gJg8yV4NudSPVzNsyj1HQf9J6nCXJc+ECFsDYMozRC3ZO8b5U+q1QE0ZmN5ktTs7ws2fZo2PCjGPq+0ya0wX8+N1DLCKDZsekUArLKYz2j5eEWtqWobNXStJketH0jA7rehYo8mQpnhDoAyHeHZZ+mAB7OQpcF6GLMY+/zWfCEYoxj9gRpTBDLc84L9aDFZnaUZEQVl+2+zjjgMgiMZrrBf9tmLikQTKzjxL3wRGJB46HqaWG8mX4eBTKIcOXHSJ+tFHPVNOKO1P4JigDK0f45deA8ZsguKeo4psMNhiOEAQjqZjDYTq5Oa63ZCktopJGNNH+5HFMInk8kwQeB/yuUqB0EU02tgnCI2ki0uPa X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:59.3837 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5fbcfae6-734f-469f-9cf5-08d7c228cd5e 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: DM6PR02MB4074 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on merlin.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.237.45 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , Rajan Vaja , rajanv@xilinx.com, linux-kernel@vger.kernel.org, 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 From: Rajan Vaja Use direct function call instead of using eemi ops for clock_getdivider. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/clk/zynqmp/divider.c | 6 ++---- drivers/clk/zynqmp/pll.c | 2 +- drivers/firmware/xilinx/zynqmp.c | 4 ++-- include/linux/firmware/xlnx-zynqmp.h | 2 +- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c index 13041cd..8eed715 100644 --- a/drivers/clk/zynqmp/divider.c +++ b/drivers/clk/zynqmp/divider.c @@ -83,9 +83,8 @@ static unsigned long zynqmp_clk_divider_recalc_rate(struct clk_hw *hw, u32 div_type = divider->div_type; u32 div, value; int ret; - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); - ret = eemi_ops->clock_getdivider(clk_id, &div); + ret = zynqmp_pm_clock_getdivider(clk_id, &div); if (ret) pr_warn_once("%s() get divider failed for %s, ret = %d\n", @@ -163,11 +162,10 @@ static long zynqmp_clk_divider_round_rate(struct clk_hw *hw, u32 div_type = divider->div_type; u32 bestdiv; int ret; - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); /* if read only, just return current value */ if (divider->flags & CLK_DIVIDER_READ_ONLY) { - ret = eemi_ops->clock_getdivider(clk_id, &bestdiv); + ret = zynqmp_pm_clock_getdivider(clk_id, &bestdiv); if (ret) pr_warn_once("%s() get divider failed for %s, ret = %d\n", diff --git a/drivers/clk/zynqmp/pll.c b/drivers/clk/zynqmp/pll.c index 95fad06..73fb5bb 100644 --- a/drivers/clk/zynqmp/pll.c +++ b/drivers/clk/zynqmp/pll.c @@ -141,7 +141,7 @@ static unsigned long zynqmp_pll_recalc_rate(struct clk_hw *hw, int ret; const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); - ret = eemi_ops->clock_getdivider(clk_id, &fbdiv); + ret = zynqmp_pm_clock_getdivider(clk_id, &fbdiv); if (ret) pr_warn_once("%s() get divider failed for %s, ret = %d\n", __func__, clk_name, ret); diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index eb39735..2fc6e17 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -422,7 +422,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_clock_setdivider); * * Return: Returns status, either success or error+reason */ -static int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider) +int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider) { u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; @@ -433,6 +433,7 @@ static int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider) return ret; } +EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getdivider); /** * zynqmp_pm_clock_setrate() - Set the clock rate for given id @@ -715,7 +716,6 @@ static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, } static const struct zynqmp_eemi_ops eemi_ops = { - .clock_getdivider = zynqmp_pm_clock_getdivider, .clock_setrate = zynqmp_pm_clock_setrate, .clock_getrate = zynqmp_pm_clock_getrate, .clock_setparent = zynqmp_pm_clock_setparent, diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 412b32f..b55232e 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -288,7 +288,6 @@ struct zynqmp_pm_query_data { struct zynqmp_eemi_ops { int (*fpga_load)(const u64 address, const u32 size, const u32 flags); int (*fpga_get_status)(u32 *value); - int (*clock_getdivider)(u32 clock_id, u32 *divider); int (*clock_setrate)(u32 clock_id, u64 rate); int (*clock_getrate)(u32 clock_id, u64 *rate); int (*clock_setparent)(u32 clock_id, u32 parent_id); @@ -317,6 +316,7 @@ int zynqmp_pm_clock_enable(u32 clock_id); int zynqmp_pm_clock_disable(u32 clock_id); int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state); int zynqmp_pm_clock_setdivider(u32 clock_id, u32 divider); +int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider); int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 *ret_payload); From patchwork Fri Mar 6 23:47:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424795 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 81B97174A for ; Fri, 6 Mar 2020 23:48:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 577E3206E2 for ; Fri, 6 Mar 2020 23:48:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="t13yFcZG"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="m3R2Z+/f" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 577E3206E2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=eDicuMsz7Bo7RKuWVh38+6JubNMnmf1PMH+Q9iuTRRc=; b=t13yFcZGx1vGCm cmtLwLfbfkEfYTl/uWMim1etDqU/MaVxJsEHLtY6BBqKkGqVp6idsIC3FLcj5BW0WaokFqVY3NyQL E69yP5OU6KRbSImUI+0oYg2yYCVqJT4ha6eZI2RGNJD1f+X+hSuMlYwE2nTrcl02bwDXvHoLDsgzU byRtSl0YTbIhq/chr7JmK394gkrTC0oY6FHshOqLi8MkwJooJIIyO9LR7Ada3c/lwQrQwdKJMk0hg 9QvKJ+KbltqoHNf40q5W/4CS7aqOqG9djFYpHpWQ0dwPKoLPewFE9ZI9OHtOi+q8RN2vZmzLGvXOa bGgbRtrfnpXH3AngsnFQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhv-0006Wv-Gm; Fri, 06 Mar 2020 23:48:43 +0000 Received: from mail-co1nam11on2056.outbound.protection.outlook.com ([40.107.220.56] helo=NAM11-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhE-0005yY-BR for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J85sJD1Sx2FY9dN+nB4IqrfGC3eursBMKNyjXs8RFKqx7zR8gw5VJ8iLVolpt+b1Qd3VWVZYuySMMJddKXcPMOZ+Kot5W1Vk759cBK5uog8ih3TC69pJ9e3lREUOzBzvrXeJYDdPeZREeWqahVn7YncWnETW5G01CIbaPt0pxjopNGBUga07H5E8L3jhune3KFg2zVv1aFXWxU1xp7lVHfCEB9NxonUXvx5bclPM2hiYJqKgUELE4COd6lh9F1oaQR745R6YU9iP0IDFIJm/yjuQrX1nAbg/ANpy8CDHDCVu4uogI+YguukUQn9eWLoSVWYs7haC5xw4D5ITodBHNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uENwvfV2/UpidtjU6I7TtHl0TSaWXD8qePM58rgmMmY=; b=daSeBSmc80p7ii9fpv7qe2dSlJhnAY0hsjLNWbcsokHKQGcgWeQA1h/LMfwGQEKPFuewn/v3DioHLjxjbw37Q//sKtQakgAfXNAd93j7bcXFb/wVHqImBWnnRhdBCtBWahnfKdoEEHHoE9uV4vBIDdRBkvBgXnw5FWsoNMeHqe+5kj8IyI0BRsJ3EK87iWo9tTaECek7wNIotroaVS8m+MdEsLpQvrh8p8eJjtxhag4IzRnL/P2tKHoYxb+c/T8meLnONuIdHMZfik5Yhpycs0xFfnIMfY930nVylM3jL4Ps3rx2facmHIHUJ4l+d1Ik4zIK41ZN1p77lJPJ+ednQw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uENwvfV2/UpidtjU6I7TtHl0TSaWXD8qePM58rgmMmY=; b=m3R2Z+/f1GQGNRmuBa/Kiym3kYieyKe4YgpN4uPpQ0ftjrE/LKzkceZFJwwEQApkw6oRhF327XseSSmX6/LLlB5yL9KDgFvlDH+4WcRoRRWOlfXJVF0XeppeEdkbU51uVSxCIS4hyVSeiFXZWOChKLhnoTV1Wx4u0iNf8ZUpD1o= Received: from MN2PR06CA0025.namprd06.prod.outlook.com (2603:10b6:208:23d::30) by DM6PR02MB4665.namprd02.prod.outlook.com (2603:10b6:5:1a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.18; Fri, 6 Mar 2020 23:47:58 +0000 Received: from BL2NAM02FT042.eop-nam02.prod.protection.outlook.com (2603:10b6:208:23d:cafe::a1) by MN2PR06CA0025.outlook.office365.com (2603:10b6:208:23d::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.16 via Frontend Transport; Fri, 6 Mar 2020 23:47:58 +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 BL2NAM02FT042.mail.protection.outlook.com (10.152.76.193) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:58 +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 1jAMhB-0003Q9-SR; Fri, 06 Mar 2020 15:47:57 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh6-0002g8-PL; Fri, 06 Mar 2020 15:47:52 -0800 Received: from xsj-pvapsmtp01 (smtp-fallback.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 026Nlkkx002400; Fri, 6 Mar 2020 15:47:46 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMh0-0002eg-3T; Fri, 06 Mar 2020 15:47:46 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 09/24] firmware: xilinx: Remove eemi ops for clock set/get rate Date: Fri, 6 Mar 2020 15:47:17 -0800 Message-Id: <1583538452-1992-10-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(346002)(136003)(396003)(376002)(189003)(199004)(8676002)(356004)(107886003)(54906003)(6666004)(5660300002)(81156014)(7696005)(4326008)(336012)(8936002)(81166006)(2616005)(426003)(186003)(478600001)(36756003)(70586007)(2906002)(6636002)(70206006)(9786002)(26005)(316002)(44832011)(7416002)(42866002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR02MB4665; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 78415135-1a08-4ce7-e6a5-08d7c228ccce X-MS-TrafficTypeDiagnostic: DM6PR02MB4665: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:541; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fHCoCMipM1wxSE0/RQD3oHyHPWFgaHIZBDNDmVnXxD23vSQHOGqrjKtRZdhZECjXMBGK7Z0V0n09+MqMziHij5XfPrGSFnVBvM7VL2dO3FDfhb3xVCfxIWUmmX9Os9g/4vh458gkesvui9ZoFhAqSAoQP67ABXIg7KLnsstKJDk4lbDDDl3bzeJNC4GkY4XBFg3fRc1kjXHOP9CvLp1jbTHCZNo3nH3513pgAGz82eMzyvRt4TrqAZxtUyU8WqzsRtAf4zzUb+nStD8SLaFlpP2eHKmBeDdHXluopOpA5ztTBLxEXgo21n0fnK4YjySDDqqUAoMgPw8MFy8DWZg6v2lOeFs9C0goqnfr/Fmtihx+Rr1zVAU0NB0yQE7IDurAHb+tbs39SRfUvvSisogBt93A9lqzvR+mecwvXUKbHxA4Z5qMYOmZRB/7WVawNpe8xEfCK9NfQxlWNo+kaxIBcM6EWY05pACTxAC4E2p6BUsEL+jXoAAMg5ZRA/nbqd3j X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:58.4414 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 78415135-1a08-4ce7-e6a5-08d7c228ccce 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: DM6PR02MB4665 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154800_396111_E8D19F4E X-CRM114-Status: GOOD ( 10.16 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.220.56 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , Rajan Vaja , rajanv@xilinx.com, linux-kernel@vger.kernel.org, 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 From: Rajan Vaja Use direct function call instead of eemi ops for clock set/get rate. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/zynqmp.c | 8 ++++---- include/linux/firmware/xlnx-zynqmp.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 2fc6e17..60a5675 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -444,13 +444,14 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getdivider); * * Return: Returns status, either success or error+reason */ -static int zynqmp_pm_clock_setrate(u32 clock_id, u64 rate) +int zynqmp_pm_clock_setrate(u32 clock_id, u64 rate) { return zynqmp_pm_invoke_fn(PM_CLOCK_SETRATE, clock_id, lower_32_bits(rate), upper_32_bits(rate), 0, NULL); } +EXPORT_SYMBOL_GPL(zynqmp_pm_clock_setrate); /** * zynqmp_pm_clock_getrate() - Get the clock rate for given id @@ -462,7 +463,7 @@ static int zynqmp_pm_clock_setrate(u32 clock_id, u64 rate) * * Return: Returns status, either success or error+reason */ -static int zynqmp_pm_clock_getrate(u32 clock_id, u64 *rate) +int zynqmp_pm_clock_getrate(u32 clock_id, u64 *rate) { u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; @@ -473,6 +474,7 @@ static int zynqmp_pm_clock_getrate(u32 clock_id, u64 *rate) return ret; } +EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getrate); /** * zynqmp_pm_clock_setparent() - Set the clock parent for given id @@ -716,8 +718,6 @@ static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, } static const struct zynqmp_eemi_ops eemi_ops = { - .clock_setrate = zynqmp_pm_clock_setrate, - .clock_getrate = zynqmp_pm_clock_getrate, .clock_setparent = zynqmp_pm_clock_setparent, .clock_getparent = zynqmp_pm_clock_getparent, .ioctl = zynqmp_pm_ioctl, diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index b55232e..42dbdf3 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -288,8 +288,6 @@ struct zynqmp_pm_query_data { struct zynqmp_eemi_ops { int (*fpga_load)(const u64 address, const u32 size, const u32 flags); int (*fpga_get_status)(u32 *value); - int (*clock_setrate)(u32 clock_id, u64 rate); - 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 (*ioctl)(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2, u32 *out); @@ -317,6 +315,8 @@ int zynqmp_pm_clock_disable(u32 clock_id); int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state); int zynqmp_pm_clock_setdivider(u32 clock_id, u32 divider); int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider); +int zynqmp_pm_clock_setrate(u32 clock_id, u64 rate); +int zynqmp_pm_clock_getrate(u32 clock_id, u64 *rate); int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 *ret_payload); From patchwork Fri Mar 6 23:47:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424821 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8529B921 for ; Fri, 6 Mar 2020 23:52:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5B50D20658 for ; Fri, 6 Mar 2020 23:52:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YjP2lJ/w"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="OWdbK3O1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B50D20658 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=J5swhkWJ7z3r8XZZ4zhZ1i2bgICPW0KJKuIhLb5yTQY=; b=YjP2lJ/w6ettae hDASi1XYxdm9K5SXqm65PvmSU86lKihpW7LujxXPVgUZhKomgmUIeK4AcFaS2zz4L1Kk10hXqf+4u WH8gcA02Ac/rNnHsO/AbKWfyPQQhIvSAr86knvVfBn4iYA174ymie3NYRGL38hD0uTCC4SRuLR4zL etBwdBJx4fFHZKzY8BAraa15a8FIRzry0GP6YnR+0RtGFdja0HmH+nI7cH3ivmJH3Sg28IW4seW2M WmAd3iWP+eX6cgT+Ggycy1cHv8KY8t0+bOx7SC5GQpHLcCcK3DR3xMNMLfCV5pUsOoVkNIxn90wNH oVWk1cfMjGqOfqKAkTBA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMl4-0001yI-KN; Fri, 06 Mar 2020 23:51:58 +0000 Received: from mail-co1nam11on2042.outbound.protection.outlook.com ([40.107.220.42] helo=NAM11-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhG-00060o-4c for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LymF9Xh0st/nWY+ScajCL3scjGemwPzpWkq1DaAkJc7m61VXB7tnEQzR2IWsNHztjqgs0ujbnnuTEIM0pbrfkZqq61raGVN1FGaK58y3UrUt5NU4eQykHk0pmgcTdklf+KItBhPcTnhiweJsaqxpZFJZzgq4iM+4ba2A/K3GAqhFxYRBr8GHZ1l5+Spk7BzgTDxFV4pFAo2GgRnhoKXNheCG/7zM/yKeKZ/ovVml1ABy1Des9gL1vHvVsMfyw0IqYhrcH+Sx9YrW318slFoqsFswj9griWqSkEjkpiUV2IuKblaF2KtvjKpicg+/z1S0EhmBwi3yKfnuOyoY/jBg5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jaa56BXCyqsMALFjc01SIc4++0Jf6sC60obubvTZMes=; b=LyTvcyq6nOmxAarDyePmSY7RvlgYH37VlajwlTZVfqr4t2zrduk1iicZtuEWCOejifjByBwP2kA+iub/B5M4G0IHdTQ2m4tYLVJ5TSmSvcec/mzuEySkHbi4vJxcYH7ZlVcieqzluJRA4VEoWlbcEQp62WDoIkLt+r9J098+ec9wcTYvpg1v3nLQaPiJWinIOwt4G8gbpNIC4AcdB7CJ4rPPlhHvD5gdxaPp1XPqPqG9BbBhsojeVo3r9nyPP0bFddnukjMMzsLEGv9LCMzAnXNwOuGa9oK0DIvh3tAUsko63RTssziEHh3GsKIiigfnDp+6C/7OPjo90ATWWAUQGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jaa56BXCyqsMALFjc01SIc4++0Jf6sC60obubvTZMes=; b=OWdbK3O1YKHbICIwbK9m4uIfXpo1hhZMc25i1E3/iiJ9Tj3a3II0Zhv7d1LkfYsTABSs3wA0HfDhFS19cRgMPaSdm+Dq4/vlK5QUvWRfYklNAJS3AmjtCtA0m4jipTaXJaoLjhiuDsEvn27P1e7GJixkiBwdi2zWDyvM/8ir+/Q= Received: from MN2PR16CA0027.namprd16.prod.outlook.com (2603:10b6:208:134::40) by CY4PR02MB3237.namprd02.prod.outlook.com (2603:10b6:910:7c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.15; Fri, 6 Mar 2020 23:47:59 +0000 Received: from BL2NAM02FT004.eop-nam02.prod.protection.outlook.com (2603:10b6:208:134:cafe::5e) by MN2PR16CA0027.outlook.office365.com (2603:10b6:208:134::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.15 via Frontend Transport; Fri, 6 Mar 2020 23:47:59 +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 BL2NAM02FT004.mail.protection.outlook.com (10.152.76.168) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:59 +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 1jAMhC-0003QF-EZ; Fri, 06 Mar 2020 15:47:58 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh7-0002g8-BN; Fri, 06 Mar 2020 15:47:53 -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 026NlkMj001007; Fri, 6 Mar 2020 15:47:46 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMh0-0002eg-5X; Fri, 06 Mar 2020 15:47:46 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 10/24] firmware: xilinx: Remove eemi ops for clock set/get parent Date: Fri, 6 Mar 2020 15:47:18 -0800 Message-Id: <1583538452-1992-11-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(396003)(39860400002)(136003)(199004)(189003)(70206006)(36756003)(7416002)(8936002)(336012)(26005)(70586007)(81166006)(81156014)(2906002)(478600001)(186003)(8676002)(6636002)(44832011)(2616005)(9786002)(7696005)(356004)(5660300002)(4326008)(316002)(107886003)(54906003)(426003)(6666004)(42866002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR02MB3237; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dc42d4f0-d4ca-4377-e722-08d7c228cd26 X-MS-TrafficTypeDiagnostic: CY4PR02MB3237: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:115; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tvvbrATaJvlrwWX25ytubTVAgXnyubcWIjynlmjaUVIOnHprOs0Bn/ukuUpfazgB4Z/2gCzT02eV3upXDNRsaJpUn8i033t8N/ioX8/T7AU+BXeHuwaIfNqj4FppaZWQwl/lKqP7AmmcuhGBWdTIv2kx543rJKHDaPsb4wLPwnWWenMm+m8RZqvHbhPskg/YKC2GKGHE84dXsdv931Sy2gqHsBB8v7ZcbjItDe5UKb7IwNIW5WIIjJQI7l5KjdgHYHfSV/dWNDR8SC0qvTy/zPjkPMb/TzsxxQxy9TehgJJ1/B/XEy/lJpCjqFQ+yYG7nxrbMEbscM0s0odqzWJvw3PF1l2+SqwFtGwF+xwIiRA3urHmp51azjpTjY/D1JrQGiT6KMlgbc/yYd0s5D5ARuOUzilviQBoQ+FWvIXefusj9l6IWSv/OiTcAAXvVu9zTgFqKMs3sdLw8gk4ZFGHLjr7g4zVNoIkWuznDyJHCfdh6gXL9DuefcJBo4JyCVEl X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:59.0171 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dc42d4f0-d4ca-4377-e722-08d7c228cd26 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: CY4PR02MB3237 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154802_215255_4530587B X-CRM114-Status: GOOD ( 11.49 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.220.42 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , Rajan Vaja , rajanv@xilinx.com, linux-kernel@vger.kernel.org, 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 From: Rajan Vaja Use direct function call instead of eemi ops for clock set/get parent. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/clk/zynqmp/clk-mux-zynqmp.c | 6 ++---- drivers/firmware/xilinx/zynqmp.c | 8 ++++---- include/linux/firmware/xlnx-zynqmp.h | 4 ++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/drivers/clk/zynqmp/clk-mux-zynqmp.c b/drivers/clk/zynqmp/clk-mux-zynqmp.c index 0af8f74..0619414 100644 --- a/drivers/clk/zynqmp/clk-mux-zynqmp.c +++ b/drivers/clk/zynqmp/clk-mux-zynqmp.c @@ -47,9 +47,8 @@ static u8 zynqmp_clk_mux_get_parent(struct clk_hw *hw) u32 clk_id = mux->clk_id; u32 val; int ret; - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); - ret = eemi_ops->clock_getparent(clk_id, &val); + ret = zynqmp_pm_clock_getparent(clk_id, &val); if (ret) pr_warn_once("%s() getparent failed for clock: %s, ret = %d\n", @@ -71,9 +70,8 @@ static int zynqmp_clk_mux_set_parent(struct clk_hw *hw, u8 index) const char *clk_name = clk_hw_get_name(hw); u32 clk_id = mux->clk_id; int ret; - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); - ret = eemi_ops->clock_setparent(clk_id, index); + ret = zynqmp_pm_clock_setparent(clk_id, index); if (ret) pr_warn_once("%s() set parent failed for clock: %s, ret = %d\n", diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 60a5675..563c77e 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -485,11 +485,12 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getrate); * * Return: Returns status, either success or error+reason */ -static int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id) +int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id) { return zynqmp_pm_invoke_fn(PM_CLOCK_SETPARENT, clock_id, parent_id, 0, 0, NULL); } +EXPORT_SYMBOL_GPL(zynqmp_pm_clock_setparent); /** * zynqmp_pm_clock_getparent() - Get the clock parent for given id @@ -501,7 +502,7 @@ static int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id) * * Return: Returns status, either success or error+reason */ -static int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id) +int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id) { u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; @@ -512,6 +513,7 @@ static int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id) return ret; } +EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getparent); /** * zynqmp_is_valid_ioctl() - Check whether IOCTL ID is valid or not @@ -718,8 +720,6 @@ static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, } static const struct zynqmp_eemi_ops eemi_ops = { - .clock_setparent = zynqmp_pm_clock_setparent, - .clock_getparent = zynqmp_pm_clock_getparent, .ioctl = zynqmp_pm_ioctl, .reset_assert = zynqmp_pm_reset_assert, .reset_get_status = zynqmp_pm_reset_get_status, diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 42dbdf3..f94cfa8 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -288,8 +288,6 @@ struct zynqmp_pm_query_data { struct zynqmp_eemi_ops { int (*fpga_load)(const u64 address, const u32 size, const u32 flags); int (*fpga_get_status)(u32 *value); - 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 (*reset_assert)(const enum zynqmp_pm_reset reset, const enum zynqmp_pm_reset_action assert_flag); @@ -317,6 +315,8 @@ int zynqmp_pm_clock_setdivider(u32 clock_id, u32 divider); int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider); int zynqmp_pm_clock_setrate(u32 clock_id, u64 rate); int zynqmp_pm_clock_getrate(u32 clock_id, u64 *rate); +int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id); +int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id); int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 *ret_payload); From patchwork Fri Mar 6 23:47:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424825 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7689E174A for ; Fri, 6 Mar 2020 23:52:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5130B20658 for ; Fri, 6 Mar 2020 23:52:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QFElwbw7"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="VE1WTWoo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5130B20658 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=lCSSI8zLk3grISuuBvQ4CnMwLoZZLz6Dr63wDyHLN0U=; b=QFElwbw7Lz4FrI 9qFrvb66v8OIgWSfAH3de1mJBhoIn0Bp7XMK2crgxLsdKYndUEH3MSYwoFlEYEsRzLFDsAocgs+V4 ikf9by/367TzPneqBTuEG/xUylcDlQeBduJaY2w4Cs35VLeDpTK9xGgI5cQSD0cMuORhQ+U9SJRE9 rExIdkCVAbvTcBTJPjYsJgGhFWTpI1+GoAlfltKRvfsZVzMwApi1rqw88TfzkGy76U1x/g0TppnER yz9jI0lsgqDIi+HchLQiuqYhGAhgLdIjqnIVMrtBWZ/cOc4UBTXqRHXJ6BhC31Yfthdkkx+ADphxf h+iFzatszCSnB3m/n5tw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMli-0002Rh-TE; Fri, 06 Mar 2020 23:52:38 +0000 Received: from mail-bn8nam11on2074.outbound.protection.outlook.com ([40.107.236.74] helo=NAM11-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhF-000601-Kf for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Iy9LMhqjn3Sw85LE8sSEgAslPpz91f+Y//jyheVot+msCNFQ8khQobr7G179rsMgoUIPdLnFIPjZ5TqEMlWk88dBzh9wgY8nQmR8jImw8lKwbsXXJhH/29aDwlT9zLHs5kl+7wFX+PDojDdeK2VTg5l5UR70FDth4gi5ySPABwNVezUBebi+w/WwDkwtzKYdqbEHBAujxboLflOi4PZRWvpVzxKRXEqFO96VTK8eCWSJdCTTTccbkD2xuetn8X4Ci21aIG33Y+yNbYTLzBEevKtIS2IjiRROfbRuY73wP+e4rchnoAubL0AW241pPvOgBiHbXpzWvtpxJiWD+aUFag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4zwR4pHUKAhUS5+xintUy9thSja0Nlvi/b/oy/Ba1oo=; b=lAOGVfr46NfqxW3uldl7V/q3FHzy5rGbRQw7Y1ZZuHy3FVpXiR1ZqR/h2qjWzloOVg+l0IZXtcVVUK6fjqa2LrXyI0RV2zbqCXXNj6LIqYLf/T59QBfEqSslVUcmg6/JNB07gnwbTmSmW09FzhE99kH6zRj3PHxf+lbZvVSyShbCeFOo06nlJY7PTh4YuMBAPRR3UF9u9niiTl78mRLRYuBSbY0zlSR6KHx9waQ0iR/tQWWq6UZTlq4G4E59VvZ5eZbxOs4vXkvJqGkiH19XmjSSTdyx5OT+/LKM58811KoXZlDc9JSKZZOSFO5LP8lCERwX+zyPAtDg9ZqcIZUlLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4zwR4pHUKAhUS5+xintUy9thSja0Nlvi/b/oy/Ba1oo=; b=VE1WTWooFAzkvTw/qPdi/YyX3inrS3ySTAL+i9/opXdQxm+c5VybLtnEtdcjuHgcrO37Z1//wD7vT0njntEM/GaJOxZE/NTNw2QuSV10SV8GJ4b0PgCloOsrcZlthnTX24BSMfZU7DZrxlK2PzRaNQY1a35FFH7/zdm4o0fhMkQ= Received: from MN2PR11CA0009.namprd11.prod.outlook.com (2603:10b6:208:23b::14) by DM6PR02MB4250.namprd02.prod.outlook.com (2603:10b6:5:9a::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.18; Fri, 6 Mar 2020 23:47:59 +0000 Received: from BL2NAM02FT017.eop-nam02.prod.protection.outlook.com (2603:10b6:208:23b:cafe::d4) by MN2PR11CA0009.outlook.office365.com (2603:10b6:208:23b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.15 via Frontend Transport; Fri, 6 Mar 2020 23:47:59 +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 BL2NAM02FT017.mail.protection.outlook.com (10.152.77.174) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:58 +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 1jAMhC-0003QE-9r; Fri, 06 Mar 2020 15:47:58 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh7-0002g8-6f; Fri, 06 Mar 2020 15:47:53 -0800 Received: from xsj-pvapsmtp01 (smtp3.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 026Nlks5002402; Fri, 6 Mar 2020 15:47:46 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMh0-0002eg-7b; Fri, 06 Mar 2020 15:47:46 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 11/24] firmware: xilinx: Use APIs instead of IOCTLs Date: Fri, 6 Mar 2020 15:47:19 -0800 Message-Id: <1583538452-1992-12-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(396003)(136003)(39860400002)(189003)(199004)(6666004)(54906003)(26005)(70586007)(186003)(5660300002)(4326008)(7696005)(7416002)(70206006)(2906002)(356004)(316002)(478600001)(107886003)(30864003)(336012)(36756003)(9786002)(6636002)(2616005)(44832011)(8936002)(426003)(81166006)(81156014)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR02MB4250; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 87201292-0504-4ac9-4b9a-08d7c228cd1b X-MS-TrafficTypeDiagnostic: DM6PR02MB4250: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:188; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QUM7rmgnpFYKJllqoA2vXr4goP/W22Jf3z/QHSA5K9sYMG2yLcUjK0oX3NqocadjdA3cALJbrpKawwurcGaVGkkMeOPWX6lFqIU5FoK711STkjN/kRUmFGeJHMSWkcu3ei2VrVjYqTVSDDJGW18pqGZQFv9SPU1P2vvZniWiFG4xTgIqJ1plrewboSrxrP8FaqGjFFiNH8fppXz4LtdztdtvgstokiF9zx92dmEUioirpIgV65IOka+Eq3D6iiHhGkDAmBF1BcdRDk6u9HveVP6JOIpcYanQhCsW1WRQhYkT3hlODMHgRqkAXRvYcSpRLR7ppzoyAKQ7RZJ7/ck+VaBOvB/AQBqG4rkR3IgU/D9+Q+HhIMd/2varWWLGAoFSXi5WyYUYQJ4bviNEOFRlX25ULIx+1zDzhCk/MVIPZeTW4LDrGkawAwHLYj8TlAsw X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:58.8745 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 87201292-0504-4ac9-4b9a-08d7c228cd1b 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: DM6PR02MB4250 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154801_738953_2D81486B X-CRM114-Status: GOOD ( 16.13 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.236.74 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , Rajan Vaja , rajanv@xilinx.com, linux-kernel@vger.kernel.org, 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 From: Rajan Vaja Remove IOCTL API and use individual APIs for better readability. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/clk/zynqmp/pll.c | 14 ++--- drivers/firmware/xilinx/zynqmp.c | 99 ++++++++++++++++++++++++++---------- drivers/mmc/host/sdhci-of-arasan.c | 33 +----------- include/linux/firmware/xlnx-zynqmp.h | 6 ++- 4 files changed, 83 insertions(+), 69 deletions(-) diff --git a/drivers/clk/zynqmp/pll.c b/drivers/clk/zynqmp/pll.c index 73fb5bb..92f449e 100644 --- a/drivers/clk/zynqmp/pll.c +++ b/drivers/clk/zynqmp/pll.c @@ -50,10 +50,8 @@ static inline enum pll_mode zynqmp_pll_get_mode(struct clk_hw *hw) const char *clk_name = clk_hw_get_name(hw); u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); - ret = eemi_ops->ioctl(0, IOCTL_GET_PLL_FRAC_MODE, clk_id, 0, - ret_payload); + ret = zynqmp_pm_get_pll_frac_mode(clk_id, ret_payload); if (ret) pr_warn_once("%s() PLL get frac mode failed for %s, ret = %d\n", __func__, clk_name, ret); @@ -73,14 +71,13 @@ static inline void zynqmp_pll_set_mode(struct clk_hw *hw, bool on) const char *clk_name = clk_hw_get_name(hw); int ret; u32 mode; - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); if (on) mode = PLL_MODE_FRAC; else mode = PLL_MODE_INT; - ret = eemi_ops->ioctl(0, IOCTL_SET_PLL_FRAC_MODE, clk_id, mode, NULL); + ret = zynqmp_pm_set_pll_frac_mode(clk_id, mode); if (ret) pr_warn_once("%s() PLL set frac mode failed for %s, ret = %d\n", __func__, clk_name, ret); @@ -139,7 +136,6 @@ static unsigned long zynqmp_pll_recalc_rate(struct clk_hw *hw, unsigned long rate, frac; u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); ret = zynqmp_pm_clock_getdivider(clk_id, &fbdiv); if (ret) @@ -148,8 +144,7 @@ static unsigned long zynqmp_pll_recalc_rate(struct clk_hw *hw, rate = parent_rate * fbdiv; if (zynqmp_pll_get_mode(hw) == PLL_MODE_FRAC) { - eemi_ops->ioctl(0, IOCTL_GET_PLL_FRAC_DATA, clk_id, 0, - ret_payload); + zynqmp_pm_get_pll_frac_data(clk_id, ret_payload); data = ret_payload[1]; frac = (parent_rate * data) / FRAC_DIV; rate = rate + frac; @@ -177,7 +172,6 @@ static int zynqmp_pll_set_rate(struct clk_hw *hw, unsigned long rate, u32 fbdiv; long rate_div, frac, m, f; int ret; - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); if (zynqmp_pll_get_mode(hw) == PLL_MODE_FRAC) { rate_div = (rate * FRAC_DIV) / parent_rate; @@ -194,7 +188,7 @@ static int zynqmp_pll_set_rate(struct clk_hw *hw, unsigned long rate, else if (ret) pr_warn_once("%s() set divider failed for %s, ret = %d\n", __func__, clk_name, ret); - eemi_ops->ioctl(0, IOCTL_SET_PLL_FRAC_DATA, clk_id, f, NULL); + zynqmp_pm_set_pll_frac_data(clk_id, f); return rate + frac; } diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 563c77e..3f0ee1a 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -516,45 +516,91 @@ int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id) EXPORT_SYMBOL_GPL(zynqmp_pm_clock_getparent); /** - * zynqmp_is_valid_ioctl() - Check whether IOCTL ID is valid or not - * @ioctl_id: IOCTL ID + * zynqmp_pm_set_pll_frac_mode() - PM API for set PLL mode * - * Return: 1 if IOCTL is valid else 0 + * @clk_id: PLL clock ID + * @mode: PLL mode (PLL_MODE_FRAC/PLL_MODE_INT) + * + * This function sets PLL mode + * + * Return: Returns status, either success or error+reason */ -static inline int zynqmp_is_valid_ioctl(u32 ioctl_id) +int zynqmp_pm_set_pll_frac_mode(u32 clk_id, u32 mode) { - switch (ioctl_id) { - case IOCTL_SET_PLL_FRAC_MODE: - case IOCTL_GET_PLL_FRAC_MODE: - case IOCTL_SET_PLL_FRAC_DATA: - case IOCTL_GET_PLL_FRAC_DATA: - return 1; - default: - return 0; - } + return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_SET_PLL_FRAC_MODE, + clk_id, mode, NULL); } +EXPORT_SYMBOL_GPL(zynqmp_pm_set_pll_frac_mode); /** - * zynqmp_pm_ioctl() - PM IOCTL API for device control and configs - * @node_id: Node ID of the device - * @ioctl_id: ID of the requested IOCTL - * @arg1: Argument 1 to requested IOCTL call - * @arg2: Argument 2 to requested IOCTL call - * @out: Returned output value + * zynqmp_pm_get_pll_frac_mode() - PM API for get PLL mode * - * This function calls IOCTL to firmware for device control and configuration. + * @clk_id: PLL clock ID + * @mode: PLL mode + * + * This function return current PLL mode * * Return: Returns status, either success or error+reason */ -static int zynqmp_pm_ioctl(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2, - u32 *out) +int zynqmp_pm_get_pll_frac_mode(u32 clk_id, u32 *mode) { - if (!zynqmp_is_valid_ioctl(ioctl_id)) - return -EINVAL; + return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_GET_PLL_FRAC_MODE, + clk_id, 0, mode); +} +EXPORT_SYMBOL_GPL(zynqmp_pm_get_pll_frac_mode); + +/** + * zynqmp_pm_set_pll_frac_data() - PM API for setting pll fraction data + * + * @clk_id: PLL clock ID + * @data: fraction data + * + * This function sets fraction data. + * It is valid for fraction mode only. + * + * Return: Returns status, either success or error+reason + */ +int zynqmp_pm_set_pll_frac_data(u32 clk_id, u32 data) +{ + return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_SET_PLL_FRAC_DATA, + clk_id, data, NULL); +} +EXPORT_SYMBOL_GPL(zynqmp_pm_set_pll_frac_data); - return zynqmp_pm_invoke_fn(PM_IOCTL, node_id, ioctl_id, - arg1, arg2, out); +/** + * zynqmp_pm_get_pll_frac_data() - PM API for getting pll fraction data + * + * @clk_id: PLL clock ID + * @data: fraction data + * + * This function returns fraction data value. + * + * Return: Returns status, either success or error+reason + */ +int zynqmp_pm_get_pll_frac_data(u32 clk_id, u32 *data) +{ + return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_GET_PLL_FRAC_DATA, + clk_id, 0, data); +} +EXPORT_SYMBOL_GPL(zynqmp_pm_get_pll_frac_data); + +/** + * zynqmp_pm_set_sd_tapdelay() - Set tap delay for the SD device + * + * @node_id Node ID of the device + * @type Type of tap delay to set (input/output) + * @value Value to set fot the tap delay + * + * This function sets input/output tap delay for the SD device. + * + * @return Returns status, either success or error+reason + */ +int zynqmp_pm_set_sd_tapdelay(u32 node_id, u32 type, u32 value) +{ + return zynqmp_pm_invoke_fn(PM_IOCTL, node_id, IOCTL_SET_SD_TAPDELAY, + type, value, NULL); } +EXPORT_SYMBOL_GPL(zynqmp_pm_set_sd_tapdelay); /** * zynqmp_pm_reset_assert - Request setting of reset (1 - assert, 0 - release) @@ -720,7 +766,6 @@ static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, } 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, diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index e49b44b..bc31f64 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -98,10 +98,6 @@ struct sdhci_arasan_clk_data { void *clk_of_data; }; -struct sdhci_arasan_zynqmp_clk_data { - const struct zynqmp_eemi_ops *eemi_ops; -}; - /** * struct sdhci_arasan_data * @host: Pointer to the main SDHCI host structure. @@ -630,9 +626,6 @@ static int sdhci_zynqmp_sdcardclk_set_phase(struct clk_hw *hw, int degrees) struct sdhci_arasan_data *sdhci_arasan = container_of(clk_data, struct sdhci_arasan_data, clk_data); struct sdhci_host *host = sdhci_arasan->host; - struct sdhci_arasan_zynqmp_clk_data *zynqmp_clk_data = - clk_data->clk_of_data; - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_clk_data->eemi_ops; const char *clk_name = clk_hw_get_name(hw); u32 node_id = !strcmp(clk_name, "clk_out_sd0") ? NODE_SD_0 : NODE_SD_1; u8 tap_delay, tap_max = 0; @@ -672,8 +665,7 @@ static int sdhci_zynqmp_sdcardclk_set_phase(struct clk_hw *hw, int degrees) tap_delay = (degrees * tap_max) / 360; /* Set the Clock Phase */ - ret = eemi_ops->ioctl(node_id, IOCTL_SET_SD_TAPDELAY, - PM_TAPDELAY_OUTPUT, tap_delay, NULL); + ret = zynqmp_pm_set_sd_tapdelay(node_id, PM_TAPDELAY_OUTPUT, tap_delay); if (ret) pr_err("Error setting Output Tap Delay\n"); @@ -702,9 +694,6 @@ static int sdhci_zynqmp_sampleclk_set_phase(struct clk_hw *hw, int degrees) struct sdhci_arasan_data *sdhci_arasan = container_of(clk_data, struct sdhci_arasan_data, clk_data); struct sdhci_host *host = sdhci_arasan->host; - struct sdhci_arasan_zynqmp_clk_data *zynqmp_clk_data = - clk_data->clk_of_data; - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_clk_data->eemi_ops; const char *clk_name = clk_hw_get_name(hw); u32 node_id = !strcmp(clk_name, "clk_in_sd0") ? NODE_SD_0 : NODE_SD_1; u8 tap_delay, tap_max = 0; @@ -744,8 +733,7 @@ static int sdhci_zynqmp_sampleclk_set_phase(struct clk_hw *hw, int degrees) tap_delay = (degrees * tap_max) / 360; /* Set the Clock Phase */ - ret = eemi_ops->ioctl(node_id, IOCTL_SET_SD_TAPDELAY, - PM_TAPDELAY_INPUT, tap_delay, NULL); + ret = zynqmp_pm_set_sd_tapdelay(node_id, PM_TAPDELAY_INPUT, tap_delay); if (ret) pr_err("Error setting Input Tap Delay\n"); @@ -1232,23 +1220,6 @@ static int sdhci_arasan_probe(struct platform_device *pdev) if (ret) goto clk_disable_all; - if (of_device_is_compatible(np, "xlnx,zynqmp-8.9a")) { - struct sdhci_arasan_zynqmp_clk_data *zynqmp_clk_data; - const struct zynqmp_eemi_ops *eemi_ops; - - zynqmp_clk_data = devm_kzalloc(&pdev->dev, - sizeof(*zynqmp_clk_data), - GFP_KERNEL); - eemi_ops = zynqmp_pm_get_eemi_ops(); - if (IS_ERR(eemi_ops)) { - ret = PTR_ERR(eemi_ops); - goto unreg_clk; - } - - zynqmp_clk_data->eemi_ops = eemi_ops; - sdhci_arasan->clk_data.clk_of_data = zynqmp_clk_data; - } - arasan_dt_parse_clk_phases(&pdev->dev, &sdhci_arasan->clk_data); ret = mmc_of_parse(host->mmc); diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index f94cfa8..0fde06f 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -288,7 +288,6 @@ struct zynqmp_pm_query_data { struct zynqmp_eemi_ops { int (*fpga_load)(const u64 address, const u32 size, const u32 flags); int (*fpga_get_status)(u32 *value); - int (*ioctl)(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2, u32 *out); 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); @@ -317,6 +316,11 @@ int zynqmp_pm_clock_setrate(u32 clock_id, u64 rate); int zynqmp_pm_clock_getrate(u32 clock_id, u64 *rate); int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id); int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id); +int zynqmp_pm_set_pll_frac_mode(u32 clk_id, u32 mode); +int zynqmp_pm_get_pll_frac_mode(u32 clk_id, u32 *mode); +int zynqmp_pm_set_pll_frac_data(u32 clk_id, u32 data); +int zynqmp_pm_get_pll_frac_data(u32 clk_id, u32 *data); +int zynqmp_pm_set_sd_tapdelay(u32 node_id, u32 type, u32 value); int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 *ret_payload); From patchwork Fri Mar 6 23:47:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424837 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6334B921 for ; Fri, 6 Mar 2020 23:54:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3EAB520658 for ; Fri, 6 Mar 2020 23:54:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="M2ZKnCoY"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="Rq8jiMhJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3EAB520658 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=+gLFWNzJ98aJr1t8S8o9GgWaSuB3KjUNGxF58x9Qrps=; b=M2ZKnCoYGeryRj vw1DXPlZsh5yG/RIDlF13TlPSz2qoDtEm5yDdkfTvBVepSRmXq+/+3zy5qoKtyOCeNFFl20FWM1J2 cT1KlVGAEVeTlWF2+KM/q2oh83VqXXQ3PQ3iGzrZU7HJVVjjAdGwhdrTJ7IeReZd5z4hkXWZD/ydk h9Y/CE+kGDkYiWEL8LH9vf2x8Pi2oXNehWDCMN3bh/NlmuJcW4BKEt+N7c9wFcODb3p1GThzrM+kM y25+My9xXbbtdAdZuNKd+GNiCxuDYVMVPUAVLroFVzdMBOU24DlmUhroteNAbw1bwqw4Kvy+a6zxx wQNyy9fBmVBLko3ZwDSQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMnQ-0003tw-U3; Fri, 06 Mar 2020 23:54:24 +0000 Received: from mail-co1nam11on2045.outbound.protection.outlook.com ([40.107.220.45] helo=NAM11-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhG-000624-Rf for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fwjAg1x67MqOrjr+snw0kcrd5UryN3Kfw/PSBXE2mtIz4eI1LVW6AmKvqQFRa6bu9JcLAMYcFhcJtBBB3GJTsFkS3apRFi2dyAALP9jUapV8kYgKeRokN2C7iMbukGta/KTkWJ0fWEfC0q57AlQc9ThrTF4ULh3lp3SG9QCx5gzEDgcgvXiCHgG9rYiWGYPQzksTFubusEwv5SNJqdcSxIKUAk7uMygRCQKvw0YELqJo/ez/c8Y3+SnpOCkF0W3JYsPAOswRFNR18MSDSUgVbTY8RIzyMVrLIAbDi10uf3iov0uL7gDUAjcXUl8KFD6tbP9+lMOdAocDMxWazr1jlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=szzjsTBXNOMXo/rAUkGcBUBt841Fl3wbgmX4xWQLpzk=; b=Utq/JztfNDDybfTa4VvJSA+wstq1nDKksMTksnMXVCZ8wGa4aKvSd3pdBC4bT/VOHj/NqFlrV2BliK4w2V76AXezrg5xXblpZRFNAzQOqJwHAsKz4/4hiT2vPlFZshRlkUqp+ePtQZ7feB7W8R1QALzkSjpwqLRCHY7GToqs7uHWZuUHrB+/U/O3Dh5ZJHdQGv2vpBOCoefL41TSBGK9wSPhLH0pASaVcKzthh9I2WqkTRk7L0i9xnYP/9+8ZmNhj1k9lPbKBZKDs43Vsm3I6veLz+yxWPqZEZJjD70Jt/+sznTH0OG2pQ7S788ggfVMQAtDoMV0jUXQlqkp2/gntg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=szzjsTBXNOMXo/rAUkGcBUBt841Fl3wbgmX4xWQLpzk=; b=Rq8jiMhJ52g/P57vjO6uBwOWFs25tLH0SO+xCT/5gmB4rsvdMat1+ZNyL92WvaPOv2p+VLYiLeW2gUnD4Uqhs7cclFdDNr+ibH2YymZY8E0X8QBwiWv7dCPv13Kd3DyjD3C6wlMH1Wr5i4A3JGWjPBPHAiW6wU08HaNvRstIOOE= Received: from MN2PR19CA0005.namprd19.prod.outlook.com (2603:10b6:208:178::18) by CH2PR02MB6087.namprd02.prod.outlook.com (2603:10b6:610:4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.18; Fri, 6 Mar 2020 23:47:58 +0000 Received: from BL2NAM02FT029.eop-nam02.prod.protection.outlook.com (2603:10b6:208:178:cafe::b1) by MN2PR19CA0005.outlook.office365.com (2603:10b6:208:178::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:58 +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 BL2NAM02FT029.mail.protection.outlook.com (10.152.77.100) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:58 +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 1jAMhB-0003Q7-Jl; Fri, 06 Mar 2020 15:47:57 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh6-0002g8-Gl; Fri, 06 Mar 2020 15:47:52 -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 026Nlk4f001009; Fri, 6 Mar 2020 15:47:46 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMh0-0002eg-9o; Fri, 06 Mar 2020 15:47:46 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 12/24] firmware: xilinx: Remove eemi ops for reset_assert Date: Fri, 6 Mar 2020 15:47:20 -0800 Message-Id: <1583538452-1992-13-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(396003)(136003)(39860400002)(189003)(199004)(26005)(54906003)(6666004)(186003)(7696005)(2906002)(70206006)(70586007)(5660300002)(4326008)(7416002)(356004)(316002)(478600001)(107886003)(9786002)(336012)(6636002)(44832011)(36756003)(426003)(81156014)(8676002)(81166006)(8936002)(2616005)(42866002); DIR:OUT; SFP:1101; SCL:1; SRVR:CH2PR02MB6087; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ea0ffce6-d1f1-4d08-b76a-08d7c228cca8 X-MS-TrafficTypeDiagnostic: CH2PR02MB6087: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:612; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oWYrGIXCZUbKl6cD0V1vcNfZ955A+hL6Id+t1/fhkuGszM/L0/ItsrJhHEOuL3qJMmtwA/nKzXw5yFnTUxnWRUzCUVoyHj5AZuQr6lq+51/Z1dIm4ohSuPS+ww9iBiqFc2d22Gx1KziqlJXc1AJdsqRTseWzXFmRrcSFIXuGwL8FKW7YyOkSBbGShIt+OS+hE6aM5rCR84KiIBS6txByE5yW49tBFZ+ESmU43xeXJgTCvRJ1hLmyhgATnN+qzYqUpBFzUyer8p8Hx0UwDO9tL0qDWDxAsZ2YDbwzlZLHaRhzmHzvPZgypRfveVvhlPB3UCy1Jj9p80TPeaINpfYYwSsZqYDQTKc55rLqyo6+gsNNg2mnuopWvmh6mji6BSExoAjNOvdY0fsEJO7oqaNz8mA6skV9KSHxek0/3xy6JRq0QT/7A/CtyUKWbtiBpWTtLV9hnBo+qNGS2adK0/bvtlWMGDexxLf3AfPe4vL0mwL5Zp3aFiwCB58lOw8I9tnk X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:58.1912 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ea0ffce6-d1f1-4d08-b76a-08d7c228cca8 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: CH2PR02MB6087 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154802_929367_7699BFEE X-CRM114-Status: GOOD ( 11.52 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.220.45 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , Rajan Vaja , rajanv@xilinx.com, linux-kernel@vger.kernel.org, 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 From: Rajan Vaja Use direct function call instead of using eemi ops for reset_assert. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/zynqmp.c | 6 +++--- drivers/reset/reset-zynqmp.c | 18 ++++++------------ include/linux/firmware/xlnx-zynqmp.h | 4 ++-- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 3f0ee1a..1fa52e6 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -610,12 +610,13 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_set_sd_tapdelay); * * Return: Returns status, either success or error+reason */ -static int zynqmp_pm_reset_assert(const enum zynqmp_pm_reset reset, - const enum zynqmp_pm_reset_action assert_flag) +int zynqmp_pm_reset_assert(const enum zynqmp_pm_reset reset, + const enum zynqmp_pm_reset_action assert_flag) { return zynqmp_pm_invoke_fn(PM_RESET_ASSERT, reset, assert_flag, 0, 0, NULL); } +EXPORT_SYMBOL_GPL(zynqmp_pm_reset_assert); /** * zynqmp_pm_reset_get_status - Get status of the reset @@ -766,7 +767,6 @@ static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, } static const struct zynqmp_eemi_ops eemi_ops = { - .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/drivers/reset/reset-zynqmp.c b/drivers/reset/reset-zynqmp.c index 0144075..4a01b7e 100644 --- a/drivers/reset/reset-zynqmp.c +++ b/drivers/reset/reset-zynqmp.c @@ -27,19 +27,15 @@ to_zynqmp_reset_data(struct reset_controller_dev *rcdev) static int zynqmp_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) { - struct zynqmp_reset_data *priv = to_zynqmp_reset_data(rcdev); - - return priv->eemi_ops->reset_assert(ZYNQMP_RESET_ID + id, - PM_RESET_ACTION_ASSERT); + return zynqmp_pm_reset_assert(ZYNQMP_RESET_ID + id, + PM_RESET_ACTION_ASSERT); } static int zynqmp_reset_deassert(struct reset_controller_dev *rcdev, unsigned long id) { - struct zynqmp_reset_data *priv = to_zynqmp_reset_data(rcdev); - - return priv->eemi_ops->reset_assert(ZYNQMP_RESET_ID + id, - PM_RESET_ACTION_RELEASE); + return zynqmp_pm_reset_assert(ZYNQMP_RESET_ID + id, + PM_RESET_ACTION_RELEASE); } static int zynqmp_reset_status(struct reset_controller_dev *rcdev, @@ -58,10 +54,8 @@ static int zynqmp_reset_status(struct reset_controller_dev *rcdev, static int zynqmp_reset_reset(struct reset_controller_dev *rcdev, unsigned long id) { - struct zynqmp_reset_data *priv = to_zynqmp_reset_data(rcdev); - - return priv->eemi_ops->reset_assert(ZYNQMP_RESET_ID + id, - PM_RESET_ACTION_PULSE); + return zynqmp_pm_reset_assert(ZYNQMP_RESET_ID + id, + PM_RESET_ACTION_PULSE); } static const struct reset_control_ops zynqmp_reset_ops = { diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 0fde06f..f882895 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -288,8 +288,6 @@ struct zynqmp_pm_query_data { struct zynqmp_eemi_ops { int (*fpga_load)(const u64 address, const u32 size, const u32 flags); int (*fpga_get_status)(u32 *value); - 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); @@ -321,6 +319,8 @@ int zynqmp_pm_get_pll_frac_mode(u32 clk_id, u32 *mode); int zynqmp_pm_set_pll_frac_data(u32 clk_id, u32 data); int zynqmp_pm_get_pll_frac_data(u32 clk_id, u32 *data); int zynqmp_pm_set_sd_tapdelay(u32 node_id, u32 type, u32 value); +int zynqmp_pm_reset_assert(const enum zynqmp_pm_reset reset, + const enum zynqmp_pm_reset_action assert_flag); int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 *ret_payload); From patchwork Fri Mar 6 23:47:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424803 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E89D174A for ; Fri, 6 Mar 2020 23:49:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4C2B3206D5 for ; Fri, 6 Mar 2020 23:49:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="AYK2P9+2"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="J/FI+J+M" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C2B3206D5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=uoyMboaGnbttofjelP7eYQ0AS+4ZO6+6bYze7ZR/yAw=; b=AYK2P9+2t5YLrd ueSCSm7ZFZ59Ul6xoQtJA6SzAZc3gHrq5iE1SEWc8b1XeKGIRHoeJjbux6xZqsmS8DGyuw5ddOD2o BmyK5zlscijWDTF9BK3QCZ5HCWMVC/0i5/KjWB49xuCNaDpTAYfbrg19CbIfJEY0FDBFOSy4kVY7y D99KcQzFtDbMFg8iyoKxlj3JWRLmplnm0DkUqgKGSk6oGdfXZA+nzAOspM7ugolJIQhN9Zz5pUj0U Qf636DtHd78CjNmGl0wckwFIa2niMlvw6BMcRnGhOMW3Oit+a2QedJgSrZTLM77a9nUSJWlGGZ08W Fe3hO+KsoV3MWtUWrmDw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMii-0007Cy-Tk; Fri, 06 Mar 2020 23:49:32 +0000 Received: from mail-eopbgr690063.outbound.protection.outlook.com ([40.107.69.63] helo=NAM04-CO1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhF-0005z1-09 for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WTg80UaR1hGMpZJQsVOHcbUi5TJlnN14Nr1jrnJ0T8vfGcm2toUV88D97VsKdosEAwyJ8zZUJR0vRFSbKhTceqT4zZ6Eq61PDO20Rvm31r2+1v3lpi+0KuEUXsDux8X2hUmZJadnUSaj1ucTIIBHvDK4sL4QbOmIFTL0J+yx9sb1u91L4AYZZrQQxIANUs1qWxBKmnWSfeOGfElxTMfmNnSx55mt+MGTB1WLEliOg8XkeQm9DITZsQMZpEtZo+am6wLeDJhLpkbJVGxg/6f2wDV3M4/4vPWzSth4YVXXVZns0Ph75xeZmBbt8/UBROdZT7RRBcf8tWddWE/jM8f0aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wV8Fuvh5L+QBE4nfqB5gA+zQ48ZhMCC/DEE/7HpKvp8=; b=Qddmff5gX/sLoeh66xXmIIQfCesNNO2O15dGgZtK7SkxT25VxZQ9kpk7D5dSibg1i0KQArHAuN6s8roI9u9PCdoAb6Ep4IDomwujZENkMHSYUu652s4vTInoQ2Fym+LoMBhV76Rr67zKjzbaRcFN+/hntXxo8NyZZ7hO6i9H66mc6QIqapFjgLzWFNfWBFgPrGLnqEIGN8Re4TAZlH/wFIbnDuLIgUybKXeCWPx1TzjbHdyZLtOG0nvbuePvUPatwElkaW6jJTt4o+b7CdkquFsvqyl+K1oQsJOVdc1iVixRSUMqdQvgSaqOPdXB+uCMeac3lZok2EUKhBqmEs1kIQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wV8Fuvh5L+QBE4nfqB5gA+zQ48ZhMCC/DEE/7HpKvp8=; b=J/FI+J+M/YkBlGnOHhkuJGnMAnRQsVnDGmNg3s+NolZjVbC9hLEvLnGkigRaMwFIntqtGBleWXbufGqErp9Cwq7YBMGIyhgR1w0iBEPV4LdZruM2hPZ8btgrfKQl8/1nEvUobnCHqI8KGOS25qqW9qMZfGlRUGFcTfO2KMyGQL4= Received: from BL0PR1501CA0006.namprd15.prod.outlook.com (2603:10b6:207:17::19) by DM6PR02MB4937.namprd02.prod.outlook.com (2603:10b6:5:1a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.16; Fri, 6 Mar 2020 23:47:59 +0000 Received: from BL2NAM02FT028.eop-nam02.prod.protection.outlook.com (2603:10b6:207:17:cafe::fd) by BL0PR1501CA0006.outlook.office365.com (2603:10b6:207:17::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.14 via Frontend Transport; Fri, 6 Mar 2020 23:47:58 +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 BL2NAM02FT028.mail.protection.outlook.com (10.152.77.165) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:58 +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 1jAMhB-0003QA-VR; Fri, 06 Mar 2020 15:47:57 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh6-0002g8-SJ; Fri, 06 Mar 2020 15:47:52 -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 026NlkhM001011; Fri, 6 Mar 2020 15:47:46 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMh0-0002eg-Bq; Fri, 06 Mar 2020 15:47:46 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 13/24] firmware: xilinx: Remove eemi ops for reset_get_status Date: Fri, 6 Mar 2020 15:47:21 -0800 Message-Id: <1583538452-1992-14-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(346002)(39860400002)(396003)(136003)(376002)(189003)(199004)(4326008)(8936002)(107886003)(7696005)(26005)(6666004)(316002)(7416002)(2906002)(54906003)(356004)(6636002)(70206006)(5660300002)(81156014)(81166006)(8676002)(70586007)(9786002)(36756003)(336012)(186003)(2616005)(44832011)(426003)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR02MB4937; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 02bc1f2a-aa98-44fc-92cf-08d7c228cce1 X-MS-TrafficTypeDiagnostic: DM6PR02MB4937: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:1360; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KJdbVQ+psdy+JI6QnRLPeNjP5oBbK0g3WAYXm7TnWcAJro9rKhWXgoC4kHI0oxlkP+MttSN6OrkVuMbbvI3MfPW6ddLWIfGxCS1Dy6cK/tHx9w67dZp7PoHhRydkyRR4jyafT5HzzBvAhMI6+cSavvZdErv9cvpDtKmqkCM8nOcsPi6kH3fcdSSqnXtgR7XqkecmR2cSqh08H6Pdy3q0TI9x+p9iN8u1J326dS3VBY2OmyCexDEkvb3EWHeAIksVOe3KfETcBiB39b9ztBXZvbqhux6MTMAqSnsGMuipXVVI2b4gFPJvBizlPdlvXcLmhmyfDYtH4Si83+E4XgWl3QAfzpq4eJsBE69yPDl1uaO+TZQO9PUTB6RHrc1RYxuIybrax4jv0aGayrGq7bQ9FMVpAY2IDO4fvC9+u/lXlPC1lytwFcQuS7yZU+w6ZlZW X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:58.5638 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 02bc1f2a-aa98-44fc-92cf-08d7c228cce1 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: DM6PR02MB4937 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154801_041462_31D67D7C X-CRM114-Status: GOOD ( 12.03 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.69.63 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , Rajan Vaja , rajanv@xilinx.com, linux-kernel@vger.kernel.org, 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 From: Rajan Vaja Use direct function call instead of using eemi ops for reset_get_status. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/zynqmp.c | 5 ++--- drivers/reset/reset-zynqmp.c | 8 +------- include/linux/firmware/xlnx-zynqmp.h | 2 +- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 1fa52e6..f5c5d41 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -625,8 +625,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_reset_assert); * * Return: Returns status, either success or error+reason */ -static int zynqmp_pm_reset_get_status(const enum zynqmp_pm_reset reset, - u32 *status) +int zynqmp_pm_reset_get_status(const enum zynqmp_pm_reset reset, u32 *status) { u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; @@ -640,6 +639,7 @@ static int zynqmp_pm_reset_get_status(const enum zynqmp_pm_reset reset, return ret; } +EXPORT_SYMBOL_GPL(zynqmp_pm_reset_get_status); /** * zynqmp_pm_fpga_load - Perform the fpga load @@ -767,7 +767,6 @@ static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, } 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, diff --git a/drivers/reset/reset-zynqmp.c b/drivers/reset/reset-zynqmp.c index 4a01b7e..373ea8d4 100644 --- a/drivers/reset/reset-zynqmp.c +++ b/drivers/reset/reset-zynqmp.c @@ -15,7 +15,6 @@ struct zynqmp_reset_data { struct reset_controller_dev rcdev; - const struct zynqmp_eemi_ops *eemi_ops; }; static inline struct zynqmp_reset_data * @@ -41,10 +40,9 @@ static int zynqmp_reset_deassert(struct reset_controller_dev *rcdev, static int zynqmp_reset_status(struct reset_controller_dev *rcdev, unsigned long id) { - struct zynqmp_reset_data *priv = to_zynqmp_reset_data(rcdev); int val, err; - err = priv->eemi_ops->reset_get_status(ZYNQMP_RESET_ID + id, &val); + err = zynqmp_pm_reset_get_status(ZYNQMP_RESET_ID + id, &val); if (err) return err; @@ -73,10 +71,6 @@ static int zynqmp_reset_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; - priv->eemi_ops = zynqmp_pm_get_eemi_ops(); - if (IS_ERR(priv->eemi_ops)) - return PTR_ERR(priv->eemi_ops); - platform_set_drvdata(pdev, priv); priv->rcdev.ops = &zynqmp_reset_ops; diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index f882895..ce7b545 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -288,7 +288,6 @@ struct zynqmp_pm_query_data { struct zynqmp_eemi_ops { int (*fpga_load)(const u64 address, const u32 size, const u32 flags); int (*fpga_get_status)(u32 *value); - 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, @@ -321,6 +320,7 @@ int zynqmp_pm_get_pll_frac_data(u32 clk_id, u32 *data); int zynqmp_pm_set_sd_tapdelay(u32 node_id, u32 type, u32 value); int zynqmp_pm_reset_assert(const enum zynqmp_pm_reset reset, const enum zynqmp_pm_reset_action assert_flag); +int zynqmp_pm_reset_get_status(const enum zynqmp_pm_reset reset, u32 *status); int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 *ret_payload); From patchwork Fri Mar 6 23:47:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424827 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 553B2921 for ; Fri, 6 Mar 2020 23:53:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 297D920658 for ; Fri, 6 Mar 2020 23:53:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qRWEAt9W"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="hJgB1J5k" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 297D920658 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=+nW5NIYWfRzwkpgI5H3atM2RPbs+7HeiImdlKXeTBQ0=; b=qRWEAt9WnTTrzL DZqI8VOr1CvtUXjG11Gcf58TsGuXNdyH7kO+JmN3SpqQQedhuzPiXRanTOA9HQc1EATCLAimmNkmA aQrejemT0ShETaMhmuuouS6tSyKiWcYloKiQekQ70NSnE/rzaxwikKhimd5fqMclPPkAt/CBQsmLJ /KjxKhH294kEimyIKIAFi4bCVCplrSuJVdPxxUo1tfD0rDilHyaAW2nY7agH3Pfxi51R9sL8CVlQW QsRDXQahTvp4WNWTsfz+ExLMIQVgIvkmInarkUBB9MSnwAiK0ZnXTnJwGULBOrTAWQv7LA8vBGKtS rP4cWAntxsnc6VqCcsnw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMm1-0002gk-Gt; Fri, 06 Mar 2020 23:52:57 +0000 Received: from mail-bn8nam12on2047.outbound.protection.outlook.com ([40.107.237.47] helo=NAM12-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhG-0005zP-2Y for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WxwWxFJlvU+GgmzVFTPIi9fkL8bPg0PdY8gcWfQGjKMo5h9JEJrYN/OdlDcHFzwbZH3i6I/Q7F82DXf4saH0oL1rGRv9xjuACQfXwG76jW/51o7dhMygOg+h+qegG3Eusz1DMrXNz+sCV5s+26nMA+M++IUZAtj1UEMit8UGtYIzlhLeNax0AxliQcwEy1MWl+WfdePgS20Hqr3iX17pvT2e7+jXoi6qpj+OUdRGivVMkE0PtSAQvRrZoS8t9UL1uxERO2ZNGK4DTOfB9CN9HVssmEDTmiKuA8v0hJo9biddCieYGJVc+BHEptZH6/rAyefZPK4DZhlE2CcWE1UrPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Lb9mtDBS0jL8olwwCdBfXpkLlihfOb4pQZauF4cCXFE=; b=JDQs0/pSujS6OKPGY1jO87FrjWIRr25XPWUljeFyH/vSY/cXLN0L3Z3PgAUDeav6dnoMv9bk4lMP5JM5RNYEhS9Q51QYS99yF0OR1Wss5K6vs84/6BeWqaAqluMA89Yo71Cmj55OBaF/FAuwFlMn2hd+tYbKc4CyuuLz4DFHFuUOyw2sIwFNL+heljVNp9oI4FEnpcIcRtwhOqcEUc/PAihLaDbfDm7EiQwE/+JynYYcBsSJLPApzC/5MOlnzfjralr29oDPa+CuDODcQJCik/dny8DbG3m2FgTav34/K9aJcCHqpPxFgKzzZjfxgD7t7A03dXQulRf9gOPodllxaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Lb9mtDBS0jL8olwwCdBfXpkLlihfOb4pQZauF4cCXFE=; b=hJgB1J5k046Z31CCBGyF2YBzpvG86Kmn0rR0QKlk8SRx2cAkHGGy6W+F9UkYBhTpGVS2FsHNLEGiKD+4XnEnFBE7spWtuYhcTdHrsGWEMhWvxsDxch0lskYKk41gJlNAZ4j+rnaXgJqCR0w5tkzxGViyTH807c2Fdhs37W4Fcuc= Received: from MN2PR16CA0061.namprd16.prod.outlook.com (2603:10b6:208:234::30) by MWHPR02MB2526.namprd02.prod.outlook.com (2603:10b6:300:44::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.15; Fri, 6 Mar 2020 23:47:58 +0000 Received: from BL2NAM02FT023.eop-nam02.prod.protection.outlook.com (2603:10b6:208:234::4) by MN2PR16CA0061.outlook.office365.com (2603:10b6:208:234::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.17 via Frontend Transport; Fri, 6 Mar 2020 23:47:58 +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 BL2NAM02FT023.mail.protection.outlook.com (10.152.77.72) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:57 +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 1jAMhB-0003Q1-1t; Fri, 06 Mar 2020 15:47:57 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh5-0002g8-Ur; Fri, 06 Mar 2020 15:47:51 -0800 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 026Nlk5g002404; Fri, 6 Mar 2020 15:47:46 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMh0-0002eg-Dr; Fri, 06 Mar 2020 15:47:46 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 14/24] firmware: xilinx: Remove eemi ops for init_finalize Date: Fri, 6 Mar 2020 15:47:22 -0800 Message-Id: <1583538452-1992-15-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(376002)(136003)(396003)(346002)(39860400002)(189003)(199004)(2906002)(8676002)(81156014)(81166006)(44832011)(336012)(356004)(426003)(9786002)(6666004)(7416002)(54906003)(8936002)(7696005)(478600001)(4326008)(26005)(36756003)(186003)(107886003)(70206006)(6636002)(70586007)(2616005)(5660300002)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR02MB2526; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ae9b961f-05f0-4d1d-1ebc-08d7c228cc57 X-MS-TrafficTypeDiagnostic: MWHPR02MB2526: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:252; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G1blLZcR7rn68dX9BlYjcBk4uhWpQaJ77yi/fRcm8Xh0rxlt9nss/Z6I8et/RplQrma5l3krjDLj7AS9Q+mEyCIIfaxsUs9850C0NPL/rKuoL+/unhaZ91qjf5mdRi3gNZqlqKYAdLmrfLetC8u/h/Gp1orF3WajNJ61++1sVqevjPEJ2B61BlNdh6Dz7uhzm4n0KHJxZYwfTUM3V35jDlNn/G3yyHDvpzxXdg3+3i86Yf03G+Iy7ovMFJ4+bJT40ldJqy6/H3z2C0EkuHcEJ6iP4WcoJeM+U8DMVsxhRd9NbVS2f5/sBWPZjqhJPzwoo0JuvtRLydcY+ir5jU97/zNncnsogB4dAT7sW9XqCHyqTeVIbAM7aqKesnsaTwm7YucJ6h/t26fkyrYKhnR3yUrzPgxUItb3LGNwWXQyMrrBy+ZOiT8B/T3kwxa3dXF5 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:57.6564 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ae9b961f-05f0-4d1d-1ebc-08d7c228cc57 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: MWHPR02MB2526 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154802_139657_089D618A X-CRM114-Status: GOOD ( 11.41 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.237.47 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , Rajan Vaja , rajanv@xilinx.com, linux-kernel@vger.kernel.org, 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 From: Rajan Vaja Use direct function call instead of eemi ops for init_finalize. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/zynqmp.c | 4 ++-- drivers/soc/xilinx/zynqmp_power.c | 9 +-------- include/linux/firmware/xlnx-zynqmp.h | 2 +- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index f5c5d41..61eb11a 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -693,10 +693,11 @@ static int zynqmp_pm_fpga_get_status(u32 *value) * * Return: Returns status, either success or error+reason */ -static int zynqmp_pm_init_finalize(void) +int zynqmp_pm_init_finalize(void) { return zynqmp_pm_invoke_fn(PM_PM_INIT_FINALIZE, 0, 0, 0, 0, NULL); } +EXPORT_SYMBOL_GPL(zynqmp_pm_init_finalize); /** * zynqmp_pm_set_suspend_mode() - Set system suspend mode @@ -767,7 +768,6 @@ static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, } static const struct zynqmp_eemi_ops eemi_ops = { - .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, diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_power.c index d327d9e..f4a9371 100644 --- a/drivers/soc/xilinx/zynqmp_power.c +++ b/drivers/soc/xilinx/zynqmp_power.c @@ -182,14 +182,7 @@ static int zynqmp_pm_probe(struct platform_device *pdev) u32 pm_api_version; struct mbox_client *client; - eemi_ops = zynqmp_pm_get_eemi_ops(); - if (IS_ERR(eemi_ops)) - return PTR_ERR(eemi_ops); - - if (!eemi_ops->init_finalize) - return -ENXIO; - - eemi_ops->init_finalize(); + zynqmp_pm_init_finalize(); zynqmp_pm_get_api_version(&pm_api_version); /* Check PM API version number */ diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index ce7b545..6c42eff 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -288,7 +288,6 @@ struct zynqmp_pm_query_data { struct zynqmp_eemi_ops { int (*fpga_load)(const u64 address, const u32 size, const u32 flags); int (*fpga_get_status)(u32 *value); - int (*init_finalize)(void); int (*set_suspend_mode)(u32 mode); int (*request_node)(const u32 node, const u32 capabilities, @@ -321,6 +320,7 @@ int zynqmp_pm_set_sd_tapdelay(u32 node_id, u32 type, u32 value); int zynqmp_pm_reset_assert(const enum zynqmp_pm_reset reset, const enum zynqmp_pm_reset_action assert_flag); int zynqmp_pm_reset_get_status(const enum zynqmp_pm_reset reset, u32 *status); +int zynqmp_pm_init_finalize(void); int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 *ret_payload); From patchwork Fri Mar 6 23:47:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424829 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9E10E921 for ; Fri, 6 Mar 2020 23:53:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7577920658 for ; Fri, 6 Mar 2020 23:53:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rHvd1Fj1"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="jd4BuzHK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7577920658 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=kts+pTj4ZP8HYJqyU3Vm6BcIneqPHfqycZBJE+hoCDA=; b=rHvd1Fj1KThQuc ZWq80aVPszWLKt/yZQ9YshCTrCqd4QCbgr5A5qV/g0l03a+zcCBXep2VBZcOXEpSAJVg+Cw7Jp1/2 MW34T7EBB0JcfgrqQTFd5uPgtQjr+KM2KNLq/VKJFpvxeQgYWx5zEP5OHH1Nj4qG8BICTleJPxc9d C8pAW67yNTwVyUsmebLo9cXfVbkK5RCuB1UpLxiXPrZUKhY+lc24AdRvTvb/C0NMe35VgPPZlR4qB bcyWGtOgd8xOSPc5eP+mCPlcY6gBpTXxm6jycL0nDwEKL3HCG78/J0KTOi9GKWN52tT4rFi6DTHs4 4Ye227P+EIaPsH6WUOeg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMmJ-0002v7-Qc; Fri, 06 Mar 2020 23:53:15 +0000 Received: from mail-dm6nam10on2072.outbound.protection.outlook.com ([40.107.93.72] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhG-000617-GO for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:11 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NFaO2wHPYsgJQjEVpVdRu38wnU0m01YEvNPFobolip+tnpv6yF4aCcmZEdI68+iz+/MQs7kn+E55k/01xF81lPCoPiEoXTTqRlH/7ubjiONNmZbjMC5LFYAURuUkSIX0UkGBk6hRWjyBa21a2f7KWT7A+SBdohD6ftE4iN1Jt7RXe6ulC5wPnzujVmHYL1Yv2uaf2iqeoJi953USw6vLVQxy3ZD8rMo5nLblt8ATwSKsMCUCaDr14noJAzMC/kj+SA7nk1w5gtDzocuR8SWWLUXXaGPv5fDGbKAoUysqK3SVrY+Rxe1nbu4Jgibyg2IfZyOVvseGTDsZDMxC8SNd7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CjRXhE0atPmSLiXGLG2qD1ILJp6rIJZ1GY+/iq+AYog=; b=jU8ky4kH6J5Rihr9K5pazXCEAocbE8YchsySGkqroqA2+CJABE5CEZV2zDRo7ghdEsnzidO644+yCsqRiXmYvhmcGknP6Vv2nmEOmAHVxL2CCq20udKcnspLpa9xpLi3GglfSgcRzpKIfL28yjH2sXeQ87KR/jBQOExirGUrEvGEBZrMjiVfACucQnWCp0ncwElfXz+8QGmvFQjgToib/zufuOHZRDHSsOKLEbFHSZQOaN7ZXBSTgysXm4ijNzc1ikYhJmI8dVI8oKsG2qSLXNIfyfCzWjeIUr8l4Cmo6gK4P2Rc3PyKQ6OMUzHlVih/8Z18xvdlOQK7hzxB9YizEA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CjRXhE0atPmSLiXGLG2qD1ILJp6rIJZ1GY+/iq+AYog=; b=jd4BuzHKPuXxeE+i9eHGd6t/c0SxVR0Au4ObV6rHKDumo4CtTpzD5Nfq7GiU4ryqDY7EhwV9vMh76r8OrbtJR7ZbQW42zH6Dkuhv2x9fQJvyPiJ0I30316afLUSkwvKZMlQVOk0liXoFz3x/qnWV3EQKICUHKvY4IYdsuZUx/ak= Received: from MN2PR05CA0004.namprd05.prod.outlook.com (2603:10b6:208:c0::17) by BY5PR02MB6993.namprd02.prod.outlook.com (2603:10b6:a03:23f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.16; Fri, 6 Mar 2020 23:47:59 +0000 Received: from BL2NAM02FT061.eop-nam02.prod.protection.outlook.com (2603:10b6:208:c0:cafe::78) by MN2PR05CA0004.outlook.office365.com (2603:10b6:208:c0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.9 via Frontend Transport; Fri, 6 Mar 2020 23:47:59 +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 BL2NAM02FT061.mail.protection.outlook.com (10.152.77.7) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:58 +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 1jAMhC-0003QB-0l; Fri, 06 Mar 2020 15:47:58 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh6-0002g8-Tw; Fri, 06 Mar 2020 15:47:52 -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 026NlkFq002408; Fri, 6 Mar 2020 15:47:46 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMh0-0002eg-Fr; Fri, 06 Mar 2020 15:47:46 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 15/24] firmware: xilinx: Remove eemi ops for set_suspend_mode Date: Fri, 6 Mar 2020 15:47:23 -0800 Message-Id: <1583538452-1992-16-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(376002)(39860400002)(136003)(396003)(346002)(189003)(199004)(478600001)(44832011)(2906002)(6666004)(336012)(426003)(26005)(7416002)(186003)(356004)(2616005)(54906003)(4326008)(8676002)(316002)(70586007)(81166006)(36756003)(81156014)(70206006)(5660300002)(8936002)(7696005)(6636002)(107886003)(9786002)(42866002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY5PR02MB6993; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8efff120-dbc9-45ff-6b49-08d7c228cce2 X-MS-TrafficTypeDiagnostic: BY5PR02MB6993: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:923; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RjO4YxYA1T1+oi8q23V6OsU/3pkqlzApbkwViEoP2lIL5IuWLZzUb5iMBijaYXPToEXGNHRZcvwBH8D2ADrSAaA0PZLVaOSpRKnN26Ugm4zi8+qxsBQiGtcFMprF5JOIn8/+VSdKE2SijvHd+VNeQmb5ZUvplNKW5uvXje9ls2M8KkpfpeRu872RGkE6q/aaSyzDW1WT13/rCeodcznJNgnjReceb/MJ6r3Yq/x5iZ2QakEVF117hfNczRkZUngOcdXvSTqVrtQ3m4S1Xcgw6e+i/W+KOynS7mYPYKSoDIQxI5Cti/uQC2/EsK8vw/VdrkZ2IrU4ISsdGWkw+7M6VxMpSbFOg1z9dyUi/CDPAmu1gd4dtLEHFyl8SH6CE65cI9dIXscg1H/kODqrbEdHmnGO/6cl4z4z88g35dpW2xfI0/sSxqqV6fQ3IVv3LqzI7y6blWJJG7odqf3iOLh6YFOl5dnivFzmXBVYdQs2QVdbuYBTlh49JucedncWLFPa X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:58.5693 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8efff120-dbc9-45ff-6b49-08d7c228cce2 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: BY5PR02MB6993 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154802_554137_C00692D1 X-CRM114-Status: GOOD ( 12.72 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.93.72 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , Rajan Vaja , rajanv@xilinx.com, linux-kernel@vger.kernel.org, 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 From: Rajan Vaja Use direct function call instead of eemi ops for set_suspend_mode. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/zynqmp.c | 4 ++-- drivers/soc/xilinx/zynqmp_power.c | 6 +----- include/linux/firmware/xlnx-zynqmp.h | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 61eb11a..334d16d 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -707,10 +707,11 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_init_finalize); * * Return: Returns status, either success or error+reason */ -static int zynqmp_pm_set_suspend_mode(u32 mode) +int zynqmp_pm_set_suspend_mode(u32 mode) { return zynqmp_pm_invoke_fn(PM_SET_SUSPEND_MODE, mode, 0, 0, 0, NULL); } +EXPORT_SYMBOL_GPL(zynqmp_pm_set_suspend_mode); /** * zynqmp_pm_request_node() - Request a node with specific capabilities @@ -768,7 +769,6 @@ static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, } static const struct zynqmp_eemi_ops eemi_ops = { - .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/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_power.c index f4a9371..31ff49f 100644 --- a/drivers/soc/xilinx/zynqmp_power.c +++ b/drivers/soc/xilinx/zynqmp_power.c @@ -30,7 +30,6 @@ struct zynqmp_pm_work_struct { static struct zynqmp_pm_work_struct *zynqmp_pm_init_suspend_work; static struct mbox_chan *rx_chan; -static const struct zynqmp_eemi_ops *eemi_ops; enum pm_suspend_mode { PM_SUSPEND_MODE_FIRST = 0, @@ -155,9 +154,6 @@ static ssize_t suspend_mode_store(struct device *dev, { int md, ret = -EINVAL; - if (!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)) { @@ -166,7 +162,7 @@ static ssize_t suspend_mode_store(struct device *dev, } if (!ret && md != suspend_mode) { - ret = eemi_ops->set_suspend_mode(md); + ret = zynqmp_pm_set_suspend_mode(md); if (likely(!ret)) suspend_mode = md; } diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 6c42eff..dc60802 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -288,7 +288,6 @@ struct zynqmp_pm_query_data { struct zynqmp_eemi_ops { int (*fpga_load)(const u64 address, const u32 size, const u32 flags); int (*fpga_get_status)(u32 *value); - int (*set_suspend_mode)(u32 mode); int (*request_node)(const u32 node, const u32 capabilities, const u32 qos, @@ -321,6 +320,7 @@ int zynqmp_pm_reset_assert(const enum zynqmp_pm_reset reset, const enum zynqmp_pm_reset_action assert_flag); int zynqmp_pm_reset_get_status(const enum zynqmp_pm_reset reset, u32 *status); int zynqmp_pm_init_finalize(void); +int zynqmp_pm_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); From patchwork Fri Mar 6 23:47:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424865 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 375531580 for ; Sat, 7 Mar 2020 00:04:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 11703205C9 for ; Sat, 7 Mar 2020 00:04:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Z+pP3Saq"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="aFz0iTn9"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="hfruAj8H" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 11703205C9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=bZYfe4fvlRBkB5LP0IhKVx7brAzeUZq548E9s0ouGlo=; b=Z+pP3SaqOCaIEb sCFvg+rxW/Ok63RD9c31qVWq5S3Y5oG7QfSsAtPSFklMAUuW+aFvK7tFpFJWdiIOTZ84OcFIAYbPs NGxcayDtUsA1ymFMBUCWt96b4u4BQBPqy69sTXPZystDAhxLLSZXsqeAQ50B3c+82lcbR1TuRCL98 zy5Qe6dPFjaWs2jVERlKcSWppQCHQ6hkhAmu+UOT4wyVs58fW9t5wGScyca+n3xmWFk8oC5LbwwY4 rMoUhFw8S99VFEMIJPUHtvdfdABK3qRyAtvuPniIQycMtioEp13Dk0VxBhNcbYB25COMuhoY49FjT axp58fmC95PsdYj1XHbw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMxF-00013J-He; Sat, 07 Mar 2020 00:04:33 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMwp-0008Ra-O6 for linux-arm-kernel@bombadil.infradead.org; Sat, 07 Mar 2020 00:04:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=J8twyJT56fHZYPnV/HZTKsbxZxVM3icH2+aOeiifo1Y=; b=aFz0iTn9tZ5NAk0yHQPxESfwCS SGAO2r9nJIIIbzYhmCDD8WFePuKvO/brlHkwk4OTO5LCvPcWlFo7nNW9sHSfnsr7HrDP7fwhf697F 3oMgWZjH9J3QAwaa8Wea/1XSWvZbYytTVX/WVSRJrMKiwlUiVK8AT972NmDCfJN+Nb4Ovfz2OTRHj eHb4hnQoQq7M/3ycpmpzygeZe5JuDuJVSVgpzCql4noXedDqKoWYX9uD2PTgkXQwDWz8EivjysOal Ph/6GmOosIvSkyaeuBrLwv5Q/YFfMtpEGoYL/lxpeOkjrR4gdeD+R8GkvWhCWZ33r8JdCBN1DcbiI IhkatPbg==; Received: from mail-eopbgr760048.outbound.protection.outlook.com ([40.107.76.48] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhI-0004bC-B5 for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gWwS9UWntt+KOrCVGs71H/ONEFV5AfE184MQEhD7E435+ng8F9Wmvx2kjj36zOGtLhEURENc7QJ9mG8F5GMIWNST6ASwu01yfu3TAo2yCABSC+4O8qcSlTEFnDMXAl1sVUuOTKpQoNpBBYG8YhAD9EzyYF6OJKRcy2+lsxAFPTM249KGMWCFNLYGI1DkiDHW6B0EOyy8jQXL0fl1eyfmuJG17h9bJTMnSGYY0b5n/NLE6V984hrzllfwJGgcgoe0ePI8Z9TPHfN5ksAwpcBKuZ20k/lOrva7Z7HgOF1t37d3PRSTU+3OY5pJVah207GLYrTWVFL9NOb5L/B0wPs5cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=J8twyJT56fHZYPnV/HZTKsbxZxVM3icH2+aOeiifo1Y=; b=LuD0+n5GobIex7NR8zYAjh6Ad66Uzsa8hjP5Fljkhg5vDhX6rKAQvzIrtPna/M05UG9476VUeUWevythMHje/TaSHA803O9PYxESYRGT8/R7at2EURW8nvcc+wluB+8UfdmB4bNNWLh+UUoYahRflarkmUUwNtFEO1Ryz5+p/6qqv9nHfhAmjl9DFCCdfCgZJfuMivOg5bpvxiNxPfGsyndgiYk8gWo/b7qUWOZWLJw3B4LKbtv/OkqZtTNWt4PgzHnYgV1ze6SbvnWC9deh1YG4M8XN60LcobS2+sO1lWMyCgbb/IPWjpsEGQ7rqbTUjrayaDu1WywIj8JRYv0QUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=J8twyJT56fHZYPnV/HZTKsbxZxVM3icH2+aOeiifo1Y=; b=hfruAj8HdNbyPAPPH9afIAP/uQRgdObD8M7iChMkAiEDaI9ujmaub3giClXq+ngPbQhIQ6UNUAnPOV3AdHtIOjsYx2OGghHsGCNo/n1d9mCiQfrLvUp4MtbbHK3r9dm4z1AP1nx+krOCHS2ujCcIFw6sj8fAfS2QOEcCd+IKa2s= Received: from MN2PR01CA0052.prod.exchangelabs.com (2603:10b6:208:23f::21) by BN7PR02MB4129.namprd02.prod.outlook.com (2603:10b6:406:f2::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.18; Fri, 6 Mar 2020 23:47:59 +0000 Received: from BL2NAM02FT034.eop-nam02.prod.protection.outlook.com (2603:10b6:208:23f:cafe::ff) by MN2PR01CA0052.outlook.office365.com (2603:10b6:208:23f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.17 via Frontend Transport; Fri, 6 Mar 2020 23:47:59 +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 BL2NAM02FT034.mail.protection.outlook.com (10.152.77.161) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:59 +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 1jAMhC-0003QI-Iz; Fri, 06 Mar 2020 15:47:58 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh7-0002g8-Fx; Fri, 06 Mar 2020 15:47:53 -0800 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 026NlkHk001013; Fri, 6 Mar 2020 15:47:46 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMh0-0002eg-Hr; Fri, 06 Mar 2020 15:47:46 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 16/24] firmware: xilinx: Remove eemi ops for request_node Date: Fri, 6 Mar 2020 15:47:24 -0800 Message-Id: <1583538452-1992-17-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(136003)(376002)(396003)(346002)(39860400002)(199004)(189003)(107886003)(70206006)(2906002)(478600001)(426003)(54906003)(2616005)(8936002)(70586007)(6636002)(9786002)(7696005)(336012)(81166006)(4326008)(6666004)(7416002)(81156014)(5660300002)(8676002)(316002)(36756003)(356004)(26005)(44832011)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR02MB4129; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cac05b29-2860-4f56-0d52-08d7c228cd40 X-MS-TrafficTypeDiagnostic: BN7PR02MB4129: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HyV96Z4JkpRreudfNquM2Rj7AsHsmaO8P1uek+0ZBkRepzEnc1omxIOFC4t0rNHIzOqw5Kw9fnQd5CJsTkpbZSQnlUwh0Y2CV+rkjIpFxZUQ1BuHi9ECYo1vz6Mqc3H52h1Pcx96JC7sIr4qIEUVxD2GhBUeJko+yuve5YTSSYo1/Ycuuo+nRbPCeYxADPcwOTd3iZpHI2iie8twf0wTEZDuyrmNs6jS+cZ1R14VAjfcFU3bPE2C7aoVf4l49SgfOYio0vNPbaKXlnyDi9pW2O9p4H19mJFkT8lQxJoO3QT1j2ZhWZa8EFbWYsdJsRkVIGu4XUaks56qXKC86lQtROs6FuHIrf1bfZZrUi3w/otiw6XwEGGcR3b1kzeKrAqc4/dMceVxX4kr4j+bkwx/xnKdq7DZjY8ybHjXzH9/QhncU7ZppCow1djCu9ISAq8h X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:59.1830 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cac05b29-2860-4f56-0d52-08d7c228cd40 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: BN7PR02MB4129 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on merlin.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.76.48 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , Rajan Vaja , rajanv@xilinx.com, linux-kernel@vger.kernel.org, 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 From: Rajan Vaja Use direct function call instead of using eemi ops for request_node. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/zynqmp.c | 7 +++---- drivers/soc/xilinx/zynqmp_pm_domains.c | 5 +---- include/linux/firmware/xlnx-zynqmp.h | 6 ++---- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 334d16d..08c6960 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -725,13 +725,13 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_set_suspend_mode); * * 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) +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); } +EXPORT_SYMBOL_GPL(zynqmp_pm_request_node); /** * zynqmp_pm_release_node() - Release a node @@ -769,7 +769,6 @@ static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, } static const struct zynqmp_eemi_ops eemi_ops = { - .request_node = zynqmp_pm_request_node, .release_node = zynqmp_pm_release_node, .set_requirement = zynqmp_pm_set_requirement, .fpga_load = zynqmp_pm_fpga_load, diff --git a/drivers/soc/xilinx/zynqmp_pm_domains.c b/drivers/soc/xilinx/zynqmp_pm_domains.c index 23d90cb..cf4eed0 100644 --- a/drivers/soc/xilinx/zynqmp_pm_domains.c +++ b/drivers/soc/xilinx/zynqmp_pm_domains.c @@ -163,16 +163,13 @@ static int zynqmp_gpd_attach_dev(struct generic_pm_domain *domain, int ret; struct zynqmp_pm_domain *pd; - if (!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, + ret = zynqmp_pm_request_node(pd->node_id, 0, 0, ZYNQMP_PM_REQUEST_ACK_BLOCKING); /* If requesting a node fails print and return the error */ if (ret) { diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index dc60802..3e14bd7 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -288,10 +288,6 @@ struct zynqmp_pm_query_data { struct zynqmp_eemi_ops { int (*fpga_load)(const u64 address, const u32 size, const u32 flags); int (*fpga_get_status)(u32 *value); - 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, @@ -321,6 +317,8 @@ int zynqmp_pm_reset_assert(const enum zynqmp_pm_reset reset, int zynqmp_pm_reset_get_status(const enum zynqmp_pm_reset reset, u32 *status); int zynqmp_pm_init_finalize(void); int zynqmp_pm_set_suspend_mode(u32 mode); +int zynqmp_pm_request_node(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, u32 arg2, u32 arg3, u32 *ret_payload); From patchwork Fri Mar 6 23:47:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424815 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 03A53921 for ; Fri, 6 Mar 2020 23:51:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CFCFC206D5 for ; Fri, 6 Mar 2020 23:51:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FLEq+hz8"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="iLhgd8AS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CFCFC206D5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=MHJVWQtxswIoKrQsOZvPVezYv9QB2kqftv34GQUPG24=; b=FLEq+hz8lt66sL ZXIrBLtiCN+0nW6Zfza0ghOlMhGZrsLJ+i92K8ERiyPDSCK4tkwbg9GkG/TIByU8wKmyXUQeT+8Gv MpbzeQKXtbztGGnz6fg8TMwCbbDD2mXG/FYH4dZROBODzvPyHXqxXjzEJjhFKNWbKP7CSDsvvp1iA gaSsU7yRB2tYBsJyXFcxalfid7gc9XN6wtCo/hsIXXrclpLqtTMBkdczt9IVE1VRwhKrElyXurrh/ NpujbbpubzoCgAIeWbiksbt7oMwhiK77YaJQ4XL9CZYlRf6b1VRWOOsrZpGovDk/eTsWNhssFJx3N 4gMimmzRlHnZNNMFm/2A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMk8-0001GT-5Y; Fri, 06 Mar 2020 23:51:00 +0000 Received: from mail-eopbgr680067.outbound.protection.outlook.com ([40.107.68.67] helo=NAM04-BN3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhF-0005yw-7c for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BnxfiJ7pRqBk5ftEADKvy6Eg6VI/kQ3PBXryjTmzEibBuPddNrLda9DdwDmJ0wiak+ISLDOl3fYBM1Zah0fHj6lTSs/kez44DujynLLQJynYJxB24Hlhy1zF1cxchUdJ6Df+7RHvOXOYd6MW8v8fYDIs8EV0ykq0p+3VHh8vQTw1iDdkYC8EzDx+E9yPkq6rKUMFczpWgRwvhHrDEUFGoj5G+Ay8leXchMpyC+HVTKi1pQnPyJD6xNcmoU3QEh/w/ck9JTsxj+L3CF8XhNzBjk+L4Pufh5FqmWyshAsJUb41zt+hBMh4lJSnRQKkFJU2uQmoV9EiUPAErAYOd6C/Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aycpGsfr7l7M5LMGRUVvOc9nwPw3Yz+Hi2W+IySN6tE=; b=nN4AVSxRFE0LMRbkQ86/CJdWyGo1tqXwev0UsGXtsZB2NfKqKTB3AEWohWhHm3w2mUs4AV1hRy/Tiuvjo/4BSfiFP8dNz7ylf5ikHG6NFH1bZ8ALGXITtKOqZJjwugOdRVrJYfz6pPT/t59edfpLTm9qb31r/l62xE4JP3pht8V3vl4evTuV6quv/oyVOvKglNXs8RxrwfVWUxcKlnKGg5hMlHoGiY08/fR4HuLIzvo+4KZLxBHnw3sBHjCamrxtNY57JFuLGUM7LuN9gb8fh6YppLvqBHdlQz9qZJhMW6KtVDhauOkrM6sFJOz8IzmvaPsvTgX2KyEFrbHwheZlSg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aycpGsfr7l7M5LMGRUVvOc9nwPw3Yz+Hi2W+IySN6tE=; b=iLhgd8ASif4vnJ5tzPs1w8jZw+YnbR1UkK/WJHMXuLhT6Mg4IGnaS6GZuyJd6ORkHOwfj9c+N5/b+9ef7nYn0RrP5/2+TQH2ytVojVBS1C+BtTCumYDc4Pk25rTVySvJdrmwtxjNKvSeuTnraTTa9V4eVbZ6K9g50fif19+bnmQ= Received: from BL0PR05CA0007.namprd05.prod.outlook.com (2603:10b6:208:91::17) by CH2PR02MB6280.namprd02.prod.outlook.com (2603:10b6:610:f::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.18; Fri, 6 Mar 2020 23:47:59 +0000 Received: from BL2NAM02FT039.eop-nam02.prod.protection.outlook.com (2603:10b6:208:91:cafe::ba) by BL0PR05CA0007.outlook.office365.com (2603:10b6:208:91::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.5 via Frontend Transport; Fri, 6 Mar 2020 23:47:59 +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 BL2NAM02FT039.mail.protection.outlook.com (10.152.77.152) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:58 +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 1jAMhC-0003QD-6s; Fri, 06 Mar 2020 15:47:58 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh7-0002g8-3i; Fri, 06 Mar 2020 15:47:53 -0800 Received: from xsj-pvapsmtp01 (xsj-pvapsmtp01.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 026NlkKO001015; Fri, 6 Mar 2020 15:47:46 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMh0-0002eg-Jt; Fri, 06 Mar 2020 15:47:46 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 17/24] firmware: xilinx: Remove eemi ops for release_node Date: Fri, 6 Mar 2020 15:47:25 -0800 Message-Id: <1583538452-1992-18-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(136003)(376002)(346002)(396003)(39860400002)(199004)(189003)(54906003)(186003)(70206006)(426003)(478600001)(4326008)(7416002)(26005)(316002)(44832011)(336012)(70586007)(2906002)(8936002)(107886003)(356004)(6636002)(2616005)(7696005)(81156014)(81166006)(36756003)(6666004)(5660300002)(8676002)(9786002); DIR:OUT; SFP:1101; SCL:1; SRVR:CH2PR02MB6280; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8738a718-4832-4c6b-8b0b-08d7c228cd01 X-MS-TrafficTypeDiagnostic: CH2PR02MB6280: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:605; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4yF4RmLxY9SCOjQTWBOiVYPvPpUsGDtyaMn2TmgdWUOvGsWDXMRxj6pS9dQw3Uc4cukJRUtt6BQ9Nulytb5xbhthBfdLAiCwSmyMF7mrr4I16XHrfR7hp9uB9CF5LYAkCmeX/vrUqMSKZ3pWNMCm3w0BwLu3ntJHzYKoDmsEe0KS0r8q1qQcNDrE6utq3BbcYvXcgTDn+jZl3CdjSUIsvfz8esn/vYmnnmK13Jtvx4dYgqeohDAqsd4/eKVKh+KzmzBdAVDjx1mTr3YESd70niUgUu4oLpTGBGLJ+5Dx2l5RSDG5IpFfa9spb20nqmz+ah6mvu5pckCy1+9xOV+iIY1jTlw9Ruau4LJ9iTZbTf5hFL+x8PIDzHbV+lTbjS2Om8t9UtHEJIalwN3G00RA5IXlYHOlsc/3K9gp1IuJx/8JLc7rFevn1s911LQuPuUC X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:58.7653 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8738a718-4832-4c6b-8b0b-08d7c228cd01 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: CH2PR02MB6280 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154801_271265_4A1CF4FE X-CRM114-Status: GOOD ( 13.87 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.68.67 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , Rajan Vaja , rajanv@xilinx.com, linux-kernel@vger.kernel.org, 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 From: Rajan Vaja Use direct function call instead of using eemi ops for release_node. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/zynqmp.c | 4 ++-- drivers/soc/xilinx/zynqmp_pm_domains.c | 5 +---- include/linux/firmware/xlnx-zynqmp.h | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 08c6960..d59a00f 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -743,10 +743,11 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_request_node); * * Return: Returns status, either success or error+reason */ -static int zynqmp_pm_release_node(const u32 node) +int zynqmp_pm_release_node(const u32 node) { return zynqmp_pm_invoke_fn(PM_RELEASE_NODE, node, 0, 0, 0, NULL); } +EXPORT_SYMBOL_GPL(zynqmp_pm_release_node); /** * zynqmp_pm_set_requirement() - PM call to set requirement for PM slaves @@ -769,7 +770,6 @@ static int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, } static const struct zynqmp_eemi_ops eemi_ops = { - .release_node = zynqmp_pm_release_node, .set_requirement = zynqmp_pm_set_requirement, .fpga_load = zynqmp_pm_fpga_load, .fpga_get_status = zynqmp_pm_fpga_get_status, diff --git a/drivers/soc/xilinx/zynqmp_pm_domains.c b/drivers/soc/xilinx/zynqmp_pm_domains.c index cf4eed0..20bee26 100644 --- a/drivers/soc/xilinx/zynqmp_pm_domains.c +++ b/drivers/soc/xilinx/zynqmp_pm_domains.c @@ -196,16 +196,13 @@ static void zynqmp_gpd_detach_dev(struct generic_pm_domain *domain, int ret; struct zynqmp_pm_domain *pd; - if (!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); + ret = zynqmp_pm_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", diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 3e14bd7..e51332e 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -288,7 +288,6 @@ struct zynqmp_pm_query_data { struct zynqmp_eemi_ops { int (*fpga_load)(const u64 address, const u32 size, const u32 flags); int (*fpga_get_status)(u32 *value); - int (*release_node)(const u32 node); int (*set_requirement)(const u32 node, const u32 capabilities, const u32 qos, @@ -319,6 +318,7 @@ int zynqmp_pm_init_finalize(void); int zynqmp_pm_set_suspend_mode(u32 mode); int zynqmp_pm_request_node(const u32 node, const u32 capabilities, const u32 qos, const enum zynqmp_pm_request_ack ack); +int zynqmp_pm_release_node(const u32 node); int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 *ret_payload); From patchwork Fri Mar 6 23:47:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424791 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E54E8921 for ; Fri, 6 Mar 2020 23:48:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BE0C2206E6 for ; Fri, 6 Mar 2020 23:48:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="XLRYT08u"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="bjvWEJTX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE0C2206E6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=OfNorJGPS1j6v8V2eMzJhHn6ruMROW7Nabe6ZE6D1Hg=; b=XLRYT08uNEXxR3 T9057KamR0VIT2H9qW0YoX0+CwWQIiHzVTLI0/aHh0qQL+D+iJPhyyqqnIbTa1JRcmFKxNWrJK99E rD09kobygThQ0Dy+Qi39KOXZ7Kf7SzQ7CcrR0SAy52vtqPuO8U4RcWSOOCra3LmcjmO8jZdEq1RHz NFVSC2vrTgx+FYhfwkL+Yij/s+LsX0drONrGL+EjL2f1lXzvWXyd5s+4IT+V7sU42ltEJxgzjU/Wr J6XUIj2y0OKRqKKR28o4XUMttjyQFE/2yvVxGgKLUJ0Hc3dkoUEHTYGq1212zYlftEf1U6h4jpDId RRgzM9Bom4VnfQ/lELnQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhH-00063D-24; Fri, 06 Mar 2020 23:48:03 +0000 Received: from mail-dm6nam12on2042.outbound.protection.outlook.com ([40.107.243.42] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhE-0005yU-4s for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UfAY2npiKnkvRUleVwLe1KyLuxXlRVFKkL34M2Z0QdrnFiN97W8pnQ2SPQUuGzAtHjO5n5sE1Ijniiytm9RCisDAoWN+vByPY0vM10Z2c7/4JINYA6WmNh+ZZN/nYIDGyzSAUWTADhB9f/XULLBUMfWl7PKNnrVutRd2UZhMbrVxLg24GHTycG48pk0FLeWlr1KQOiKfoZC+wyeB7WyD3t+YYXZtMluAXgtj3RuRkROiV1jkU4rcTPqjuDSQEVNLpCrPijKp5bPATkZDFdY+I/aY5xw03RE3fZ+FEJ33BDtXQPFbDRK5mR1cw2ZWb9WLXpucS7Mgns1HkDJ4oqlOog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DVvLvsJMTXqhYIwK98Y0yR9wFgagh31mNmCTJc7xZ6o=; b=GUbEhAreN2qFg4b0ieg025PXUgBE1SwdptmkVBxzTDZBRWyJhQbButOtkjV1aTTKmh/CNVmCVXBWmu6xBPPHhs10xpF1gpOfTge7eIMZKPYPbHAIpDymvMWU7uim5RhPahuKfeMsFv56b2ez1dO/ydpnI8Xfr/9RPFxaknJjQTW3RRB1KkKWXmxeLk0IEzOPOY/3TeLWwRZA/qQH/zjQYQz0J/YUiokDOa/Cy+5kOCbAelVJFCzFDr5HfyHiUhS8VbXKUqXVFaOo5py0FHF5FWcHRDvaSlpVFpqdLauaZz0hVXOQf+uvWTcsT9AqDI98cf3eUx+KCDcVnOvIqoCn/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DVvLvsJMTXqhYIwK98Y0yR9wFgagh31mNmCTJc7xZ6o=; b=bjvWEJTXe/GDB6ma2es5dEF+PpFkUBdmA1Hw8FFFGGnbyBxA3K6BJqW/qD4BnywL5j2owCKv2Pj/oOm9YYv/UfvlBp48FByVFOt/w7oqat7UTDaZiwaCZ4BdWDqznLIci9pBySvFBk+9IqmTOrVMZCuPoHq9chkCZOJ3jvU6fs4= Received: from SN6PR16CA0051.namprd16.prod.outlook.com (2603:10b6:805:ca::28) by DM6PR02MB5195.namprd02.prod.outlook.com (2603:10b6:5:41::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.18; Fri, 6 Mar 2020 23:47:57 +0000 Received: from SN1NAM02FT022.eop-nam02.prod.protection.outlook.com (2603:10b6:805:ca:cafe::15) by SN6PR16CA0051.outlook.office365.com (2603:10b6:805:ca::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.16 via Frontend Transport; Fri, 6 Mar 2020 23:47:57 +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 SN1NAM02FT022.mail.protection.outlook.com (10.152.72.148) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:57 +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 1jAMhA-0003Py-Os; Fri, 06 Mar 2020 15:47:56 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh5-0002g8-Lu; Fri, 06 Mar 2020 15:47:51 -0800 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 026Nlk2f002414; Fri, 6 Mar 2020 15:47:46 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMh0-0002eg-Lw; Fri, 06 Mar 2020 15:47:46 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 18/24] firmware: xilinx: Remove eemi ops for set_requirement Date: Fri, 6 Mar 2020 15:47:26 -0800 Message-Id: <1583538452-1992-19-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(39860400002)(376002)(346002)(136003)(396003)(199004)(189003)(107886003)(8676002)(5660300002)(7696005)(8936002)(70206006)(81156014)(7416002)(26005)(81166006)(36756003)(186003)(336012)(70586007)(2906002)(478600001)(54906003)(316002)(426003)(356004)(44832011)(6636002)(2616005)(6666004)(9786002)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR02MB5195; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6456afe0-3ebd-44e0-03d5-08d7c228cc02 X-MS-TrafficTypeDiagnostic: DM6PR02MB5195: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Yi4cLbaX8m5BRvlIhbzbR7y4LQqEDKSu4SOlF1L0vHXGoyxNSlJiC4XjUGluFZGYjVwANpvWEAx/2GDOLm8umRuWu/DN+cCjoBlUycJ/VGbx/OZRPHq9v//jOG7rSL3i501T/6qYd427dZyZGpjKlsV3pAf3jzEzFHOEe9JyhMo7Q0ah9HKqKbOpshj3kpqRm1pEpnwBJljcdd7aDURqnyj0E3jc4N1ikQZYOX8cO2EU6O6iSKWE6onfzucx+jkakU7j3VyF95wjPFLbxGr8hH/d/wHPlLzAVDSvl2LksHrR0IajNxb5DCOPS7Noj0bYXetctM0CL60C79HUt2EEGMLxqAsJIlDYvrCbGNXdLdj+F3Lpyi0EOPe70aSAkMxKPRisuIYvlrTgecWxWydJenc9RViHEC7sBXENKp5FXxyGaIceL1DY5NdAX8ta2h4+ X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:57.1907 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6456afe0-3ebd-44e0-03d5-08d7c228cc02 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: DM6PR02MB5195 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154800_262633_9E113974 X-CRM114-Status: GOOD ( 11.98 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.243.42 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , Rajan Vaja , rajanv@xilinx.com, linux-kernel@vger.kernel.org, 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 From: Rajan Vaja Use direct function call instead of using eemi ops for set_requirement. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/zynqmp.c | 8 ++++---- drivers/soc/xilinx/zynqmp_pm_domains.c | 16 ++-------------- include/linux/firmware/xlnx-zynqmp.h | 7 +++---- 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index d59a00f..7426533 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -761,16 +761,16 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_release_node); * * 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) +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); } +EXPORT_SYMBOL_GPL(zynqmp_pm_set_requirement); static const struct zynqmp_eemi_ops eemi_ops = { - .set_requirement = zynqmp_pm_set_requirement, .fpga_load = zynqmp_pm_fpga_load, .fpga_get_status = zynqmp_pm_fpga_get_status, }; diff --git a/drivers/soc/xilinx/zynqmp_pm_domains.c b/drivers/soc/xilinx/zynqmp_pm_domains.c index 20bee26..226d343 100644 --- a/drivers/soc/xilinx/zynqmp_pm_domains.c +++ b/drivers/soc/xilinx/zynqmp_pm_domains.c @@ -23,8 +23,6 @@ /* Flag stating if PM nodes mapped to the PM domain has been requested */ #define ZYNQMP_PM_DOMAIN_REQUESTED BIT(0) -static const struct zynqmp_eemi_ops *eemi_ops; - static int min_capability; /** @@ -76,11 +74,8 @@ static int zynqmp_gpd_power_on(struct generic_pm_domain *domain) int ret; struct zynqmp_pm_domain *pd; - if (!eemi_ops->set_requirement) - return -ENXIO; - pd = container_of(domain, struct zynqmp_pm_domain, gpd); - ret = eemi_ops->set_requirement(pd->node_id, + ret = zynqmp_pm_set_requirement(pd->node_id, ZYNQMP_PM_CAPABILITY_ACCESS, ZYNQMP_PM_MAX_QOS, ZYNQMP_PM_REQUEST_ACK_BLOCKING); @@ -111,9 +106,6 @@ static int zynqmp_gpd_power_off(struct generic_pm_domain *domain) u32 capabilities = min_capability; bool may_wakeup; - if (!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 */ @@ -134,7 +126,7 @@ static int zynqmp_gpd_power_off(struct generic_pm_domain *domain) } } - ret = eemi_ops->set_requirement(pd->node_id, capabilities, 0, + ret = zynqmp_pm_set_requirement(pd->node_id, capabilities, 0, ZYNQMP_PM_REQUEST_ACK_NO); /** * If powering down of any node inside this domain fails, @@ -260,10 +252,6 @@ static int zynqmp_gpd_probe(struct platform_device *pdev) struct zynqmp_pm_domain *pd; struct device *dev = &pdev->dev; - eemi_ops = zynqmp_pm_get_eemi_ops(); - if (IS_ERR(eemi_ops)) - return PTR_ERR(eemi_ops); - pd = devm_kcalloc(dev, ZYNQMP_NUM_DOMAINS, sizeof(*pd), GFP_KERNEL); if (!pd) return -ENOMEM; diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index e51332e..3135d62 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -288,10 +288,6 @@ struct zynqmp_pm_query_data { struct zynqmp_eemi_ops { int (*fpga_load)(const u64 address, const u32 size, const u32 flags); int (*fpga_get_status)(u32 *value); - int (*set_requirement)(const u32 node, - const u32 capabilities, - const u32 qos, - const enum zynqmp_pm_request_ack ack); }; int zynqmp_pm_get_api_version(u32 *version); @@ -319,6 +315,9 @@ int zynqmp_pm_set_suspend_mode(u32 mode); int zynqmp_pm_request_node(const u32 node, const u32 capabilities, const u32 qos, const enum zynqmp_pm_request_ack ack); int zynqmp_pm_release_node(const u32 node); +int zynqmp_pm_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, u32 arg2, u32 arg3, u32 *ret_payload); From patchwork Fri Mar 6 23:47:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424793 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8ED55921 for ; Fri, 6 Mar 2020 23:48:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 60C0E206D5 for ; Fri, 6 Mar 2020 23:48:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="E+QIxSz5"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="GJBw6Zrh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 60C0E206D5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=Fxt7KOG1O1OJcnGNrilACWiH4eWBEjx7Hd8kc3P2Js0=; b=E+QIxSz5ktYaAP C2VrbD4f7QW3qGFupxjLxI7yr49QavAMtWqt5mVWcYxRKle+HoRXWxPOOATeX0RSk48K1b3L726Ao sR9JSHOh15S90sDibhrA6+qJszOxO0QEWrJVX+R8gKPrDHovY/2o49GMSJN5LxChMcwyZZllQcr+w fikjhg2jfcfaw1T8dYIoPGgmL4GtrkQxWzavVNaKL1kHFJEiChIM7C1CTMykoLgD3GQWW+GNjb5r9 1mM4iEK1qTrKBRsdENvmo6xZWI+TEo413jubVZpuOJ1Am9CfjVdyQWJmMcloNUC4I9Uai1SzeRcvc AnNy7CT6bjVf/SotLCig==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhX-0006F7-Ns; Fri, 06 Mar 2020 23:48:19 +0000 Received: from mail-dm6nam10on2047.outbound.protection.outlook.com ([40.107.93.47] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhE-0005yX-B8 for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kZ4kWpJT8DK7C1MHeNaESa1N+Q85lTL6JrpO9faomu5cbRzzsqyV12ozEpDHUmb6r/jyLetcFU38cZQ7heaLgygOxjQH26jGy1lM0otdebDUengqgZiT7viFh4MDosxpDZEJgk1AZIvGlR1hlyZM1xAYdZlCFQAKXhMtqESHsICYUTrIVmug+NRal9XJiCKho7RPBpL+tXsxP0JueC8n7ET3Z0VwoyWvww5iSl5KD+fs5dHPkyQfJCftxs4gJ69jb8gTTH9mj3qH1CMqcRS8bFTES7ShbwnhN4aCIp7QLet92BowCk6nftwj092iE8OEP5kerIcA6l4qI7beomzOqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zQJv3bA85lbOn4f9viX84EuNNa1XDBWLNQKlx7ulF/E=; b=YGzHj4BSIDi3pVyoyJ3bUJLYhGMxOXlhbMPIJ2e+Zj4tWoYBAnugNoQIZUt3DM1YNPjzuUFQ9eHFdSua4fot+lXKrmN45dzGFsSa57ZruBlD3oZvQrL/M3wIvflwS6wCJva2b2ZPmx/wNcD6VvVUry0lgEsrKdhQef16u5VgYGZOe2c/ZSbOprO2NxcQJm3VhgrXTD4shftAYSN70SeRLNHh3bILO68AXLaYhcNppq+2NT99a3RPmBTh7QiFB7FRWew1Q4EuAW+kg3ljwMENBrLA1qZ7PB/x2MP8hHbnH3U7IlDsWKDkVPU96czc9tZFhw34Bwl0cqfSGCX/gxqkhw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zQJv3bA85lbOn4f9viX84EuNNa1XDBWLNQKlx7ulF/E=; b=GJBw6ZrhRSW+sN5DyoLUGC7t6O4EtWibORsBD3y/nmWHn2Qv8sCYe+h9peM7VbSW/EQPaBo6McwAiVpY5IMY0f4HIB9tY+WvlN1a2T5VotyGYQryUA3CrOkEFCOvArIQF1R5ucqGUFsjDJMnOD3A+vwLP7nle99K1rcko2wWQ+0= Received: from SN2PR01CA0001.prod.exchangelabs.com (2603:10b6:804:2::11) by DM6PR02MB4524.namprd02.prod.outlook.com (2603:10b6:5:20::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.18; Fri, 6 Mar 2020 23:47:58 +0000 Received: from SN1NAM02FT057.eop-nam02.prod.protection.outlook.com (2603:10b6:804:2:cafe::d0) by SN2PR01CA0001.outlook.office365.com (2603:10b6:804:2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.16 via Frontend Transport; Fri, 6 Mar 2020 23:47:58 +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 SN1NAM02FT057.mail.protection.outlook.com (10.152.73.105) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:58 +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 1jAMhB-0003Q8-PK; Fri, 06 Mar 2020 15:47:57 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh6-0002g8-M5; Fri, 06 Mar 2020 15:47:52 -0800 Received: from xsj-pvapsmtp01 (smtp-fallback.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 026Nlkij002418; Fri, 6 Mar 2020 15:47:47 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMh0-0002eg-O1; Fri, 06 Mar 2020 15:47:46 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 19/24] firmware: xilinx: Remove eemi ops for fpga related APIs Date: Fri, 6 Mar 2020 15:47:27 -0800 Message-Id: <1583538452-1992-20-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(346002)(396003)(376002)(39860400002)(136003)(199004)(189003)(4326008)(8676002)(81166006)(356004)(107886003)(2906002)(8936002)(81156014)(6666004)(7416002)(478600001)(5660300002)(6636002)(36756003)(7696005)(9786002)(186003)(44832011)(54906003)(2616005)(316002)(426003)(26005)(336012)(70586007)(70206006)(42866002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR02MB4524; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2208ff8c-42ec-40e4-8b5c-08d7c228cc9b X-MS-TrafficTypeDiagnostic: DM6PR02MB4524: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:115; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: v6hW04gVi5YM2gNIFk4FSoEebr4+wsxQqaz/plOXkvc2igHf2z0LSdttHWupzEr606HPRXjdz7pomw8AVqF90lXK5L/ZwwNTUwBU01Yb7SHLruEkfgR6+eYSJYfoMFNKsjamw8niUolvLiUGe4uYl9MDy3/mgEhXURR5MV8Huu8GZedCAysVdplGW0HhS6ehmpbqbVPfnb1ZXCKPt8gmWcaq2glMlaN7wTvv0RRpdUcLDJNfQLZIxN+xOYABKuNn8u86X8KOhewQwi1Z3PTJgc8eMPFulL2LS1ApKKIRyhJNtbenCD1fHmHeU032kXxxOjhx10kjf2wbvYTrcmSqfzZRmkFOr7n57oRamC7gBjBiCZULLF8Q2Ch0lwMI3WXzc9Fgehnb7cMJwmueMWigGI7LVQbPL3/bMkrcdX9GzVVw4Cz98jZRajhZtYUizbOI+VNPRo1VcIK5tTSQOqMrBTUeDsZLQNLkeWLzHUTo3ITEG3ycZIRFd2Z7S5tRSr+2 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:58.1959 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2208ff8c-42ec-40e4-8b5c-08d7c228cc9b 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: DM6PR02MB4524 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154800_386504_5DB89A90 X-CRM114-Status: GOOD ( 11.20 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.93.47 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , Rajan Vaja , rajanv@xilinx.com, linux-kernel@vger.kernel.org, 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 From: Rajan Vaja Use direct function call instead of using eemi ops for fpga related APIs. Also remove eemi ops structure. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/zynqmp.c | 30 ++---------------------------- drivers/fpga/zynqmp-fpga.c | 12 ++---------- drivers/spi/spi-zynqmp-gqspi.c | 5 ----- include/linux/firmware/xlnx-zynqmp.h | 16 ++-------------- 4 files changed, 6 insertions(+), 57 deletions(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 7426533..36d5a3e 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -24,8 +24,6 @@ #include #include "zynqmp-debug.h" -static const struct zynqmp_eemi_ops *eemi_ops_tbl; - static bool feature_check_enabled; static u32 zynqmp_pm_features[PM_API_MAX]; @@ -654,8 +652,7 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_reset_get_status); * * Return: Returns status, either success or error+reason */ -static int zynqmp_pm_fpga_load(const u64 address, const u32 size, - const u32 flags) +int zynqmp_pm_fpga_load(const u64 address, const u32 size, const u32 flags) { return zynqmp_pm_invoke_fn(PM_FPGA_LOAD, lower_32_bits(address), upper_32_bits(address), size, flags, NULL); @@ -670,7 +667,7 @@ static int zynqmp_pm_fpga_load(const u64 address, const u32 size, * * Return: Returns status, either success or error+reason */ -static int zynqmp_pm_fpga_get_status(u32 *value) +int zynqmp_pm_fpga_get_status(u32 *value) { u32 ret_payload[PAYLOAD_ARG_CNT]; int ret; @@ -770,26 +767,6 @@ int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, } EXPORT_SYMBOL_GPL(zynqmp_pm_set_requirement); -static const struct zynqmp_eemi_ops eemi_ops = { - .fpga_load = zynqmp_pm_fpga_load, - .fpga_get_status = zynqmp_pm_fpga_get_status, -}; - -/** - * zynqmp_pm_get_eemi_ops - Get eemi ops functions - * - * Return: Pointer of eemi_ops structure - */ -const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void) -{ - if (eemi_ops_tbl) - return eemi_ops_tbl; - else - return ERR_PTR(-EPROBE_DEFER); - -} -EXPORT_SYMBOL_GPL(zynqmp_pm_get_eemi_ops); - static int zynqmp_firmware_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -836,9 +813,6 @@ static int zynqmp_firmware_probe(struct platform_device *pdev) pr_info("%s Trustzone version v%d.%d\n", __func__, pm_tz_version >> 16, pm_tz_version & 0xFFFF); - /* Assign eemi_ops_table */ - eemi_ops_tbl = &eemi_ops; - zynqmp_pm_api_debugfs_init(); ret = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE, firmware_devs, diff --git a/drivers/fpga/zynqmp-fpga.c b/drivers/fpga/zynqmp-fpga.c index b8a88d2..5be8685 100644 --- a/drivers/fpga/zynqmp-fpga.c +++ b/drivers/fpga/zynqmp-fpga.c @@ -40,16 +40,12 @@ static int zynqmp_fpga_ops_write_init(struct fpga_manager *mgr, static int zynqmp_fpga_ops_write(struct fpga_manager *mgr, const char *buf, size_t size) { - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); struct zynqmp_fpga_priv *priv; dma_addr_t dma_addr; u32 eemi_flags = 0; char *kbuf; int ret; - if (IS_ERR_OR_NULL(eemi_ops) || !eemi_ops->fpga_load) - return -ENXIO; - priv = mgr->priv; kbuf = dma_alloc_coherent(priv->dev, size, &dma_addr, GFP_KERNEL); @@ -63,7 +59,7 @@ static int zynqmp_fpga_ops_write(struct fpga_manager *mgr, if (priv->flags & FPGA_MGR_PARTIAL_RECONFIG) eemi_flags |= XILINX_ZYNQMP_PM_FPGA_PARTIAL; - ret = eemi_ops->fpga_load(dma_addr, size, eemi_flags); + ret = zynqmp_pm_fpga_load(dma_addr, size, eemi_flags); dma_free_coherent(priv->dev, size, kbuf, dma_addr); @@ -78,13 +74,9 @@ static int zynqmp_fpga_ops_write_complete(struct fpga_manager *mgr, static enum fpga_mgr_states zynqmp_fpga_ops_state(struct fpga_manager *mgr) { - const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); u32 status; - if (IS_ERR_OR_NULL(eemi_ops) || !eemi_ops->fpga_get_status) - return FPGA_MGR_STATE_UNKNOWN; - - eemi_ops->fpga_get_status(&status); + zynqmp_pm_fpga_get_status(&status); if (status & IXR_FPGA_DONE_MASK) return FPGA_MGR_STATE_OPERATING; diff --git a/drivers/spi/spi-zynqmp-gqspi.c b/drivers/spi/spi-zynqmp-gqspi.c index 7412a30..811c97a 100644 --- a/drivers/spi/spi-zynqmp-gqspi.c +++ b/drivers/spi/spi-zynqmp-gqspi.c @@ -135,7 +135,6 @@ #define SPI_AUTOSUSPEND_TIMEOUT 3000 enum mode_type {GQSPI_MODE_IO, GQSPI_MODE_DMA}; -static const struct zynqmp_eemi_ops *eemi_ops; /** * struct zynqmp_qspi - Defines qspi driver instance @@ -1015,10 +1014,6 @@ static int zynqmp_qspi_probe(struct platform_device *pdev) struct zynqmp_qspi *xqspi; struct device *dev = &pdev->dev; - eemi_ops = zynqmp_pm_get_eemi_ops(); - if (IS_ERR(eemi_ops)) - return PTR_ERR(eemi_ops); - master = spi_alloc_master(&pdev->dev, sizeof(*xqspi)); if (!master) return -ENOMEM; diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 3135d62..1734d12 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -285,11 +285,6 @@ struct zynqmp_pm_query_data { u32 arg3; }; -struct zynqmp_eemi_ops { - int (*fpga_load)(const u64 address, const u32 size, const u32 flags); - int (*fpga_get_status)(u32 *value); -}; - int zynqmp_pm_get_api_version(u32 *version); int zynqmp_pm_get_chipid(u32 *idcode, u32 *version); int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out); @@ -318,16 +313,9 @@ int zynqmp_pm_release_node(const u32 node); int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, const u32 qos, const enum zynqmp_pm_request_ack ack); +int zynqmp_pm_fpga_load(const u64 address, const u32 size, const u32 flags); +int zynqmp_pm_fpga_get_status(u32 *value); 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 -static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void) -{ - return ERR_PTR(-ENODEV); -} -#endif - #endif /* __FIRMWARE_ZYNQMP_H__ */ From patchwork Fri Mar 6 23:47:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424813 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F35A921 for ; Fri, 6 Mar 2020 23:50:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C41B4206D5 for ; Fri, 6 Mar 2020 23:50:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Az4XZTV+"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="SJqHCgGM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C41B4206D5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=4CtvrUP09py7kvisdpekdt4KsWu6dKtoDiMKTVjaBd8=; b=Az4XZTV+fJZ7HB uc0r9gvO16i+5pEtD6asRjddvnCua9ii6QvRx7829WVtfz10QX2h1hVkM9UHodTCT9FMw50saneyG ZB4T3qBQtuUpRSRwKbF4vZTx9gXhpZOtTZJr7BwM1ywUhJbPoKu9MrHIwNJBKlKPfYc/nzWKPmvCF L/ZHGc5gxkDp9kxWn8F3G7sUSSXPilAY4fsbS2E2FgbDyBHlxpVkMJC3Sm+BjkbIBKrYqzOdN6Zfh y3fdvYPeWIkPNYhhdngbYAYq5OZrcSmVV+0Tok41S41/sautk24QsjeniXRxvtT3AFrxTkUSA9yq5 rACcrGXSyMcKVwLLwFGw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMjm-00087n-SI; Fri, 06 Mar 2020 23:50:38 +0000 Received: from mail-dm6nam12on2049.outbound.protection.outlook.com ([40.107.243.49] helo=NAM12-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhF-000602-IX for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JCRIp0GH0BIB+/KmEvBOcEOpEByHUB4pPOPxQq25gOP0HDastXD9AgL7jGbzYwwOY8tP7cX+yLS9phqZ3XDaSnVRYKCfwXswPVUUOlKXUJzXVLfUjdXArSxPGdHFEbk6tsLjvAddlIytWLyO6cU8Lurig8D3tsAUjJXSxLHAP6X7UNq7iuKYw7SnQP/NPHT5iXBOtAVZCJ2e2bVKLIv/O9YCrq2LxO1SUC5T5qTYvKXS9x7UaY3/I28b8Lo0njqwFAfKivF1Q8m195+mQh34zmsgmufh4nWoFLr5AchbZM02FgjHlyvw3BK1GfslgWPO2oWmw7hK9mPaPqnhtAEyQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g0dJ8TYLdjOgrq0HqfeN6hjk+mNLBLnegGeUKLDMDrA=; b=ZtQnncQnQAYfq06YEli0uxMkxK59ijxraXn1xzuij1i3O4ws09rFVnA5gQk4JiId3Ebs7d54B89XIRZpXwaPRscJOgKB75MDr1tS5eawZ3ejLSWVby1Eh2OJcuu6w8HVignzATqIpOcJ+spfMO0wozHdjqHUu2Ldz7w4d+OQG2lZIQIDpSI5x3fE+wphL/JMr89bYEPK9G2cANSY6zPXcn7fQsWLUyY4JrIY6rFSaSDwPCuayMd4DlOfj9LZ83LfJMWlrJMP6fByczLU7yS0QB3h0MXcjLsx107JOe3Jgi86oKuHk3x6qDGXD+/dfPXxgerTcJz0hJ7A1ZqQSPLy8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g0dJ8TYLdjOgrq0HqfeN6hjk+mNLBLnegGeUKLDMDrA=; b=SJqHCgGMe7HuBldRWO6OHlpLHiD1lmJvYa5BjUNp45AQlGIQz86Lx8X9IeliGskWV/Tx+l4z8EZ4H+BEMPdaiN4SsaNA22M5Cas0NwkpI7uCRj3oQzjftl6ObpwbtI5qv44aCsY+WqI0kiSMaxYLhM4y+3E5SNUVEdprH7xNkhY= Received: from SN6PR04CA0081.namprd04.prod.outlook.com (2603:10b6:805:f2::22) by BY5PR02MB6353.namprd02.prod.outlook.com (2603:10b6:a03:1fb::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.14; Fri, 6 Mar 2020 23:47:58 +0000 Received: from SN1NAM02FT032.eop-nam02.prod.protection.outlook.com (2603:10b6:805:f2:cafe::61) by SN6PR04CA0081.outlook.office365.com (2603:10b6:805:f2::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.16 via Frontend Transport; Fri, 6 Mar 2020 23:47:58 +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 SN1NAM02FT032.mail.protection.outlook.com (10.152.72.126) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:57 +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 1jAMhB-0003Q2-3D; Fri, 06 Mar 2020 15:47:57 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh6-0002g8-05; Fri, 06 Mar 2020 15:47:52 -0800 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 026Nlk8Y001017; Fri, 6 Mar 2020 15:47:47 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMh0-0002eg-QA; Fri, 06 Mar 2020 15:47:46 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 20/24] firmware: xilinx: Add APIs to read/write GGS/PGGS registers Date: Fri, 6 Mar 2020 15:47:28 -0800 Message-Id: <1583538452-1992-21-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(376002)(136003)(396003)(346002)(39860400002)(199004)(189003)(426003)(2906002)(54906003)(26005)(81156014)(81166006)(8676002)(6636002)(7696005)(356004)(44832011)(186003)(336012)(2616005)(9786002)(8936002)(6666004)(107886003)(4326008)(70586007)(70206006)(5660300002)(316002)(36756003)(7416002)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY5PR02MB6353; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9ec6f9eb-8ee9-4c0e-c22d-08d7c228cc7a X-MS-TrafficTypeDiagnostic: BY5PR02MB6353: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:1091; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lEKYSlb6n4GksizgMHxqvonzDDt0KieQjmp/xczYNT7Uc/OHa7SW3aZCHVixtrwZ5Q5F1JqQ4tDZ27xkBCOclyfkJxICbdeLT/I8i4gLFfR+zkSJ39bxiSCD8t3dtTTOUxLd3OrVey8alN1ERcddwiBco0oX3lPYbwrsl/tJE78R902piMOyv3wHDxA8Q5k5aIvgC181OhVMtQLB+YdD1aMyBdEXRHWqgp7tsTF+O1dnS2IPIpqFM9lBYv0pSyUzoJw+3z2BtSC8jY612mn/CZdJMTa8nbkVDmKDxf/1WpFmAm5gr5/58AtSdsRydqpvgFlz+hUEov9kcDmkPZr9REf4cO1Oe5Eh6G6XH4Auxkvv2jWpB053tLmijHb7cb3qIkn5XfMpuaGqGig5MHGq2is95vYAUty073CIRGqV68sAi2ghjoCWUtdSY/WpB02p X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:57.9810 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9ec6f9eb-8ee9-4c0e-c22d-08d7c228cc7a 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: BY5PR02MB6353 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154801_614748_FFD93C8B X-CRM114-Status: UNSURE ( 8.92 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.243.49 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , Rajan Vaja , rajanv@xilinx.com, linux-kernel@vger.kernel.org, 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 From: Rajan Vaja Add APIs to read/write PGGS and GGS registers. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/zynqmp.c | 66 ++++++++++++++++++++++++++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 8 +++++ 2 files changed, 74 insertions(+) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 36d5a3e..de99613 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -601,6 +601,72 @@ int zynqmp_pm_set_sd_tapdelay(u32 node_id, u32 type, u32 value) EXPORT_SYMBOL_GPL(zynqmp_pm_set_sd_tapdelay); /** + * zynqmp_pm_write_ggs() - PM API for writing global general storage (ggs) + * @index GGS register index + * @value Register value to be written + * + * This function writes value to GGS register. + * + * @return Returns status, either success or error+reason + */ +int zynqmp_pm_write_ggs(u32 index, u32 value) +{ + return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_WRITE_GGS, + index, value, NULL); +} +EXPORT_SYMBOL_GPL(zynqmp_pm_write_ggs); + +/** + * zynqmp_pm_write_ggs() - PM API for reading global general storage (ggs) + * @index GGS register index + * @value Register value to be written + * + * This function returns GGS register value. + * + * @return Returns status, either success or error+reason + */ +int zynqmp_pm_read_ggs(u32 index, u32 *value) +{ + return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_READ_GGS, + index, 0, value); +} +EXPORT_SYMBOL_GPL(zynqmp_pm_read_ggs); + +/** + * zynqmp_pm_write_pggs() - PM API for writing persistent global general + * storage (pggs) + * @index PGGS register index + * @value Register value to be written + * + * This function writes value to PGGS register. + * + * @return Returns status, either success or error+reason + */ +int zynqmp_pm_write_pggs(u32 index, u32 value) +{ + return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_WRITE_PGGS, index, value, + NULL); +} +EXPORT_SYMBOL_GPL(zynqmp_pm_write_pggs); + +/** + * zynqmp_pm_write_pggs() - PM API for reading persistent global general + * storage (pggs) + * @index PGGS register index + * @value Register value to be written + * + * This function returns PGGS register value. + * + * @return Returns status, either success or error+reason + */ +int zynqmp_pm_read_pggs(u32 index, u32 *value) +{ + return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_READ_PGGS, index, 0, + value); +} +EXPORT_SYMBOL_GPL(zynqmp_pm_read_pggs); + +/** * zynqmp_pm_reset_assert - Request setting of reset (1 - assert, 0 - release) * @reset: Reset to be configured * @assert_flag: Flag stating should reset be asserted (1) or diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 1734d12..725dccf 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -105,6 +105,10 @@ enum pm_ioctl_id { IOCTL_GET_PLL_FRAC_MODE, IOCTL_SET_PLL_FRAC_DATA, IOCTL_GET_PLL_FRAC_DATA, + IOCTL_WRITE_GGS, + IOCTL_READ_GGS, + IOCTL_WRITE_PGGS, + IOCTL_READ_PGGS, }; enum pm_query_id { @@ -315,6 +319,10 @@ int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, const enum zynqmp_pm_request_ack ack); int zynqmp_pm_fpga_load(const u64 address, const u32 size, const u32 flags); int zynqmp_pm_fpga_get_status(u32 *value); +int zynqmp_pm_write_ggs(u32 index, u32 value); +int zynqmp_pm_read_ggs(u32 index, u32 *value); +int zynqmp_pm_write_pggs(u32 index, u32 value); +int zynqmp_pm_read_pggs(u32 index, u32 *value); int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 *ret_payload); From patchwork Fri Mar 6 23:47:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424817 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1CCEC174A for ; Fri, 6 Mar 2020 23:51:22 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CDF80206D5 for ; Fri, 6 Mar 2020 23:51:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cBXOCSLf"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="PiOWT47y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CDF80206D5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=0vT3R1ZmaJixvN0oFtXDv42XfeqeRczCA5TtLZzvS8Y=; b=cBXOCSLfzNlS8g y6XZ1P0YQ8qbZlbZAUo0rkC7+uBYrCsC4kMaE/TOBjryhJzLOqL+h3zvzyFUNe/d0Rjn4ktkLvdzq M/2qB4mSchSb8QmtmHekrSa52i/QqdMGAla/FdU6bcMERpwehNKGNxIaBZJ2D3TLsh+fsfxmXr9DB MAawBdHGa3Yw0tHSpzu3pY9q4uUvGrqNwTLfpl23JPGw/Yd5cU4KPbtLM5uTijTNLt8DXTsE1wVIO haSOKZ+VplTq7gMKxdwdfVzBpphU2RJGeZ/Mjwy8Agwq+hMjttbZo1c58fZfayzXaXCblS7d06dPc NBm4YHFtOrb6SauShV5w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMkP-0001T0-Lk; Fri, 06 Mar 2020 23:51:17 +0000 Received: from mail-bn7nam10on2089.outbound.protection.outlook.com ([40.107.92.89] helo=NAM10-BN7-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhF-0005zQ-FU for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JOOSUcPDBsoLzqdisvm35p500w0YBTMyGyViuxcOdl2B5bU7hBlyV82FoZ+IxJcG2kafr7g7gd3V9hky7YIFltx9EBZd3jScXzqdrpgJNGcVFVJTYxykdO0pVoAOV2qKY56NkcNYbEYORn4sEpAE/YgT0pDq1RQYEWIY++NFsTqxMv3ikJWZ0F3JFHwpMxdpHR7ZYo5R2D5XohzNYV1vkIvALEM5Ytu+Ob13JQCsRhLqO013AKNEY6TgxqmCofifTrxGmJrswPJY6kGT+bg0vNxf9v/d94yb97CKMGQKnGrF9ZS7J+5FqZyYt3leawcT5ROgkSXe/SCS5jGSGEkJVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/ARfBCYbaIkACVcxwYHH6q85GhI6mU0qHdEfiyx8T5o=; b=NpgpUynT6N3IJDYIfZr0+jx/4YjXvg4klVoYrLuMTkjhDexEG7qoQcuJlTyLmGXBz/Qf5JGKsM5EM2SQXsOoXRnsSmkwLHmeb4uyxnzA23YgHbvB85P6JiRnyLwwXg0ESweW9SLQuNstOUxJtH2IARR0HY96v5aSTfesGO4HDQoAqGRU97qugOISzB+9NzcyKQGOamCr/0aSrr7ud+LBiSpIKR0iEUN6G4ChoTXb8F4FHnAvIaqgFOwS5e3w66sI+GcIk6ev9qwmKFX7IUc9pZXJgk198QhU5qewbP0drC9pV98zPYJyfBBkcrZsFTbbJwf8e3N3QwfVNQX5FL71xQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/ARfBCYbaIkACVcxwYHH6q85GhI6mU0qHdEfiyx8T5o=; b=PiOWT47yR7mL4QVmloixvbF5Oj0KnHiUJbJYRBh78zb+ABmSau/5Nit8+5tGtUl4hGxFVw4/wGzDdmzhY1V82Vs+hHRTjujbw0T5wv51SjdLLdlm/65qoeWiyU08gM24bJUkony6sgJUm98zC6Z7Pm9hujCZdhibtYvA+ko+azE= Received: from SN4PR0501CA0012.namprd05.prod.outlook.com (2603:10b6:803:40::25) by BL0PR02MB4546.namprd02.prod.outlook.com (2603:10b6:208:26::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.18; Fri, 6 Mar 2020 23:47:58 +0000 Received: from SN1NAM02FT008.eop-nam02.prod.protection.outlook.com (2603:10b6:803:40:cafe::7f) by SN4PR0501CA0012.outlook.office365.com (2603:10b6:803:40::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.7 via Frontend Transport; Fri, 6 Mar 2020 23:47:58 +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 SN1NAM02FT008.mail.protection.outlook.com (10.152.72.119) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:57 +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 1jAMhB-0003Q3-81; Fri, 06 Mar 2020 15:47:57 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh6-0002g8-4W; Fri, 06 Mar 2020 15:47:52 -0800 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 026Nlkav001021; Fri, 6 Mar 2020 15:47:47 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMh0-0002eg-SK; Fri, 06 Mar 2020 15:47:46 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 21/24] firmware: xilinx: Add sysfs interface Date: Fri, 6 Mar 2020 15:47:29 -0800 Message-Id: <1583538452-1992-22-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(396003)(136003)(376002)(39860400002)(346002)(199004)(189003)(478600001)(70206006)(2906002)(54906003)(2616005)(6636002)(9786002)(70586007)(426003)(107886003)(8936002)(7696005)(30864003)(44832011)(6666004)(336012)(81156014)(7416002)(356004)(81166006)(4326008)(8676002)(36756003)(26005)(316002)(5660300002)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:BL0PR02MB4546; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6b784a20-3aea-418f-5b4e-08d7c228cc53 X-MS-TrafficTypeDiagnostic: BL0PR02MB4546: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YYmeK0aU6RvrZHpreDIs8r3gFAvlxFVjtpFH5O72arbu3Oda4vCI+pBJUwlYC67NCHfmoOn3Z/PVgq5t38W/LFEn3r64s1wGgzN/zop2OQ6I4vBwgzRi0YIKhGpNcgDzTr+Cz4fVIAhYJMdsBelF4DvzL7UP9UZ3UJa51jzfRphvEjHA6Ih4zMy5jHVaGyATCBGmsOJmtCOgBxQG9scVYPBJ/MK0ScQLWt4A08GCr9aozgMhufZi9xp7NrBNZmTnO18Q0r52eW1HTOpn9gLujAtCSpV0kasQpsgf09u/5q0wONSTfiLIi5nxlmKaVHoZHemcdf/woQ/5YZtE/2zA81GKsgl+7Uz3nJOmbPkPlXF/Yi/sDEUvpakmEV5CENKgzcK6Epq6D82fVRiF4frRmGN4nj2CT7OFGrWUurQ+nv+v79wddYxZwRE3FoBLjLXY X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:57.6878 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6b784a20-3aea-418f-5b4e-08d7c228cc53 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: BL0PR02MB4546 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154801_583378_26CD3040 X-CRM114-Status: GOOD ( 16.44 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.92.89 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tejas Patel , Rajan Vaja , linux-kernel@vger.kernel.org, Jolly Shah , rajanv@xilinx.com, Jolly Shah , 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 From: Rajan Vaja Add firmware-ggs sysfs interface which provides read/write interface to global storage registers. Signed-off-by: Rajan Vaja Signed-off-by: Michal Simek Signed-off-by: Jolly Shah Signed-off-by: Tejas Patel Signed-off-by: Jolly Shah --- .../ABI/stable/sysfs-driver-firmware-zynqmp | 50 ++++ drivers/firmware/xilinx/zynqmp.c | 319 ++++++++++++++++++++- include/linux/firmware/xlnx-zynqmp.h | 4 + 3 files changed, 372 insertions(+), 1 deletion(-) create mode 100644 Documentation/ABI/stable/sysfs-driver-firmware-zynqmp diff --git a/Documentation/ABI/stable/sysfs-driver-firmware-zynqmp b/Documentation/ABI/stable/sysfs-driver-firmware-zynqmp new file mode 100644 index 0000000..7fd6e70 --- /dev/null +++ b/Documentation/ABI/stable/sysfs-driver-firmware-zynqmp @@ -0,0 +1,50 @@ +What: /sys/devices/platform/firmware\:zynqmp-firmware/ggs* +Date: March 2020 +KernelVersion: 5.6 +Contact: "Jolly Shah" +Description: + Read/Write PMU global general storage register value, + GLOBAL_GEN_STORAGE{0:3}. + Global general storage register that can be used + by system to pass information between masters. + + The register is reset during system or power-on + resets. Three registers are used by the FSBL and + other Xilinx software products: GLOBAL_GEN_STORAGE{4:6}. + + Usage: + # cat /sys/devices/platform/firmware\:zynqmp-firmware/ggs0 + # echo > /sys/devices/platform/firmware\:zynqmp-firmware/ggs0 + + Example: + # cat /sys/devices/platform/firmware\:zynqmp-firmware/ggs0 + # echo 0xFFFFFFFF 0x1234ABCD > /sys/devices/platform/firmware\:zynqmp-firmware/ggs0 + +Users: Xilinx + +What: /sys/devices/platform/firmware\:zynqmp-firmware/pggs* +Date: March 2020 +KernelVersion: 5.6 +Contact: "Jolly Shah" +Description: + Read/Write PMU persistent global general storage register + value, PERS_GLOB_GEN_STORAGE{0:3}. + Persistent global general storage register that + can be used by system to pass information between + masters. + + This register is only reset by the power-on reset + and maintains its value through a system reset. + Four registers are used by the FSBL and other Xilinx + software products: PERS_GLOB_GEN_STORAGE{4:7}. + Register is reset only by a POR reset. + + Usage: + # cat /sys/devices/platform/firmware\:zynqmp-firmware/pggs0 + # echo > /sys/devices/platform/firmware\:zynqmp-firmware/pggs0 + + Example: + # cat /sys/devices/platform/firmware\:zynqmp-firmware/pggs0 + # echo 0xFFFFFFFF 0x1234ABCD > /sys/devices/platform/firmware\:zynqmp-firmware/pggs0 + +Users: Xilinx diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index de99613..f671b6b 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -2,7 +2,7 @@ /* * Xilinx Zynq MPSoC Firmware layer * - * Copyright (C) 2014-2018 Xilinx, Inc. + * Copyright (C) 2014-2020 Xilinx, Inc. * * Michal Simek * Davorin Mista @@ -833,6 +833,322 @@ int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, } EXPORT_SYMBOL_GPL(zynqmp_pm_set_requirement); +/** + * ggs_show - Show global general storage (ggs) sysfs attribute + * @device: Device structure + * @attr: Device attribute structure + * @buf: Requested available shutdown_scope attributes string + * @reg: Register number + * + * Return:Number of bytes printed into the buffer. + * + * Helper function for viewing a ggs register value. + * + * User-space interface for viewing the content of the ggs0 register. + * cat /sys/devices/platform/firmware\:zynqmp-firmware/ggs0 + */ +static ssize_t ggs_show(struct device *device, + struct device_attribute *attr, + char *buf, + u32 reg) +{ + int ret; + u32 ret_payload[PAYLOAD_ARG_CNT]; + + ret = zynqmp_pm_read_ggs(reg, ret_payload); + if (ret) + return ret; + + return sprintf(buf, "0x%x\n", ret_payload[1]); +} + +/** + * ggs_store - Store global general storage (ggs) sysfs attribute + * @device: Device structure + * @attr: Device attribute structure + * @buf: User entered shutdown_scope attribute string + * @count: Size of buf + * @reg: Register number + * + * Return: count argument if request succeeds, the corresponding + * error code otherwise + * + * Helper function for storing a ggs register value. + * + * For example, the user-space interface for storing a value to the + * ggs0 register: + * echo 0xFFFFFFFF 0x1234ABCD > /sys/devices/platform/firmware\:zynqmp-firmware/ggs0 + */ +static ssize_t ggs_store(struct device *device, + struct device_attribute *attr, + const char *buf, size_t count, + u32 reg) +{ + char *kern_buff, *inbuf, *tok; + long mask, value; + int ret; + u32 ret_payload[PAYLOAD_ARG_CNT]; + + if (!device || !attr || !buf || !count || reg >= GSS_NUM_REGS) + return -EINVAL; + + kern_buff = kzalloc(count, GFP_KERNEL); + if (!kern_buff) + return -ENOMEM; + + ret = strlcpy(kern_buff, buf, count); + if (ret < 0) { + count = -EFAULT; + goto err; + } + + inbuf = kern_buff; + + /* Read the write mask */ + tok = strsep(&inbuf, " "); + if (!tok) { + count = -EFAULT; + goto err; + } + + ret = kstrtol(tok, 16, &mask); + if (ret) { + count = -EFAULT; + goto err; + } + + /* Read the write value */ + tok = strsep(&inbuf, " "); + if (!tok) { + count = -EFAULT; + goto err; + } + + ret = kstrtol(tok, 16, &value); + if (ret) { + count = -EFAULT; + goto err; + } + + ret = zynqmp_pm_read_ggs(reg, ret_payload); + if (ret) { + count = -EFAULT; + goto err; + } + ret_payload[1] &= ~mask; + value &= mask; + value |= ret_payload[1]; + + ret = zynqmp_pm_write_ggs(reg, value); + if (ret) + count = -EFAULT; + +err: + kfree(kern_buff); + + return count; +} + +/* GGS register show functions */ +#define GGS0_SHOW(N) \ + ssize_t ggs##N##_show(struct device *device, \ + struct device_attribute *attr, \ + char *buf) \ + { \ + return ggs_show(device, attr, buf, N); \ + } + +static GGS0_SHOW(0); +static GGS0_SHOW(1); +static GGS0_SHOW(2); +static GGS0_SHOW(3); + +/* GGS register store function */ +#define GGS0_STORE(N) \ + ssize_t ggs##N##_store(struct device *device, \ + struct device_attribute *attr, \ + const char *buf, \ + size_t count) \ + { \ + return ggs_store(device, attr, buf, count, N); \ + } + +static GGS0_STORE(0); +static GGS0_STORE(1); +static GGS0_STORE(2); +static GGS0_STORE(3); + +/** + * pggs_show - Show persistent global general storage (pggs) sysfs attribute + * @device: Device structure + * @attr: Device attribute structure + * @buf: Requested available shutdown_scope attributes string + * @reg: Register number + * + * Return:Number of bytes printed into the buffer. + * + * Helper function for viewing a pggs register value. + */ +static ssize_t pggs_show(struct device *device, + struct device_attribute *attr, + char *buf, + u32 reg) +{ + int ret; + u32 ret_payload[PAYLOAD_ARG_CNT]; + + ret = zynqmp_pm_read_pggs(reg, ret_payload); + if (ret) + return ret; + + return sprintf(buf, "0x%x\n", ret_payload[1]); +} + +/** + * pggs_store - Store persistent global general storage (pggs) sysfs attribute + * @device: Device structure + * @attr: Device attribute structure + * @buf: User entered shutdown_scope attribute string + * @count: Size of buf + * @reg: Register number + * + * Return: count argument if request succeeds, the corresponding + * error code otherwise + * + * Helper function for storing a pggs register value. + */ +static ssize_t pggs_store(struct device *device, + struct device_attribute *attr, + const char *buf, size_t count, + u32 reg) +{ + char *kern_buff, *inbuf, *tok; + long mask, value; + int ret; + u32 ret_payload[PAYLOAD_ARG_CNT]; + + if (!device || !attr || !buf || !count || reg >= GSS_NUM_REGS) + return -EINVAL; + + kern_buff = kzalloc(count, GFP_KERNEL); + if (!kern_buff) + return -ENOMEM; + + ret = strlcpy(kern_buff, buf, count); + if (ret < 0) { + count = -EFAULT; + goto err; + } + + inbuf = kern_buff; + + /* Read the write mask */ + tok = strsep(&inbuf, " "); + if (!tok) { + count = -EFAULT; + goto err; + } + + ret = kstrtol(tok, 16, &mask); + if (ret) { + count = -EFAULT; + goto err; + } + + /* Read the write value */ + tok = strsep(&inbuf, " "); + if (!tok) { + count = -EFAULT; + goto err; + } + + ret = kstrtol(tok, 16, &value); + if (ret) { + count = -EFAULT; + goto err; + } + + ret = zynqmp_pm_read_pggs(reg, ret_payload); + if (ret) { + count = -EFAULT; + goto err; + } + ret_payload[1] &= ~mask; + value &= mask; + value |= ret_payload[1]; + + ret = zynqmp_pm_write_pggs(reg, value); + if (ret) + count = -EFAULT; + +err: + kfree(kern_buff); + + return count; +} + +#define PGGS0_SHOW(N) \ + ssize_t pggs##N##_show(struct device *device, \ + struct device_attribute *attr, \ + char *buf) \ + { \ + return pggs_show(device, attr, buf, N); \ + } + +#define PGGS0_STORE(N) \ + ssize_t pggs##N##_store(struct device *device, \ + struct device_attribute *attr, \ + const char *buf, \ + size_t count) \ + { \ + return pggs_store(device, attr, buf, count, N); \ + } + +/* PGGS register show functions */ +static PGGS0_SHOW(0); +static PGGS0_SHOW(1); +static PGGS0_SHOW(2); +static PGGS0_SHOW(3); + +/* PGGS register store functions */ +static PGGS0_STORE(0); +static PGGS0_STORE(1); +static PGGS0_STORE(2); +static PGGS0_STORE(3); + +/* GGS register attributes */ +static DEVICE_ATTR_RW(ggs0); +static DEVICE_ATTR_RW(ggs1); +static DEVICE_ATTR_RW(ggs2); +static DEVICE_ATTR_RW(ggs3); + +/* PGGS register attributes */ +static DEVICE_ATTR_RW(pggs0); +static DEVICE_ATTR_RW(pggs1); +static DEVICE_ATTR_RW(pggs2); +static DEVICE_ATTR_RW(pggs3); + +static struct attribute *zynqmp_ggs_attrs[] = { + &dev_attr_ggs0.attr, + &dev_attr_ggs1.attr, + &dev_attr_ggs2.attr, + &dev_attr_ggs3.attr, + &dev_attr_pggs0.attr, + &dev_attr_pggs1.attr, + &dev_attr_pggs2.attr, + &dev_attr_pggs3.attr, + NULL, +}; + +static const struct attribute_group ggs_attribute_group = { + .attrs = zynqmp_ggs_attrs, +}; + +const struct attribute_group *firmware_attribute_groups[] = { + &ggs_attribute_group, + NULL, +}; + static int zynqmp_firmware_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -910,6 +1226,7 @@ static struct platform_driver zynqmp_firmware_driver = { .driver = { .name = "zynqmp_firmware", .of_match_table = zynqmp_firmware_of_match, + .dev_groups = firmware_attribute_groups, }, .probe = zynqmp_firmware_probe, .remove = zynqmp_firmware_remove, diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 725dccf..8ccaa39 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -13,6 +13,8 @@ #ifndef __FIRMWARE_ZYNQMP_H__ #define __FIRMWARE_ZYNQMP_H__ +#include + #define ZYNQMP_PM_VERSION_MAJOR 1 #define ZYNQMP_PM_VERSION_MINOR 0 @@ -42,6 +44,8 @@ #define ZYNQMP_PM_MAX_QOS 100U +#define GSS_NUM_REGS (4) + /* Node capabilities */ #define ZYNQMP_PM_CAPABILITY_ACCESS 0x1U #define ZYNQMP_PM_CAPABILITY_CONTEXT 0x2U From patchwork Fri Mar 6 23:47:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424819 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7F1C5174A for ; Fri, 6 Mar 2020 23:51:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5CB5B20658 for ; Fri, 6 Mar 2020 23:51:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="T8wu+aTn"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="Lyl8oWNC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5CB5B20658 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=7eMBRfijv2Wrwt8miWd9gMfNPn2vSVz/8R1MBqAnyHo=; b=T8wu+aTntVXDY2 X83l5aN0m0ybPZXCu6FkmVqUtxC3ddkOaJrOZMxBGwppAHtpaNhh2qX8KEidq7u6YWkfZ646Yqrjn D1OfTU7/Nkm7PsOyupt3FuSFFXylX1iGHy8zuxY0UJH3ExGPEliihUH+JGkyq0EYME8/E3fs1GmBu 9V6ZG/IBUkL9Dn24uvY/2xXEnj4Ev7LKoQpiY9Mks/6qL8hCM/fWYDTTZ6ZgaCSMNq6+jfnqvLD6c woElNerJ3JLEPTp4s4+0ScHQSApjmOwq8M2uV194xfWjt7TcIbBnp2sEHhd0bGQVu7C6N5hz1bh6E l2Ke1r8scZJkW1ZuSDug==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMkl-0001k2-HM; Fri, 06 Mar 2020 23:51:39 +0000 Received: from mail-eopbgr760049.outbound.protection.outlook.com ([40.107.76.49] helo=NAM02-CY1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhF-000603-JK for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ktnPhPWWSBd49TSf0LLXTkf1KPOAdNX1DuGEyFk6e3tuiMgeSCuJAe0PtjdsqH9Y4nMm+nuQ+/hPpMlA3+4+X9nyqVBbgxYILBFQPX+ZetRQWt1+VIYkO6QIsE8V9cNryj+FhalUpyaar3d4ObQHFp4Ee12tS7FETGZ3dzSo1D/ECvS8Qh3ei9laAw2S5SrISimhY8PHQZ+DBbncWj8nw46Zd1FEyHui3/SgeJAvXhtVWShzseoaT5NEfqGaZpw+C+ajoqOrJM9SttkcUcAD9tNFXp/UVJa7ssQ0ph/TT/pBMfDy6RtNyqAZMOHFkVNhwifBGQfbwe5uAo6bp+5uUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eUQD+tVNM9/V+kSwZK0vxdBl2Ob+4YuCk29XxL+gH5g=; b=TR5vcAvJpUeLvLgGVEdKXeWsg0wo+6RFuwEP3WJBYCo/ZDeVkteBpYs2cPR7PYI7tBUXJRddnEB6QJNYwULhiGa7+qNrLSdU+n7uNcBzk3t1IkPuKcD1PyDrIiWrid6VT6OX6oUVF4QOZo5s8fQyS1CWGF44P4Z+6FmwXEl9+IMcDXhhpDwnGcr5oPzhJKbPuBMjSs86N8kHc5U2gTUCA6DbU/5HE3JT0HWMaQagscby5whaytcsRK0XYXjHYg7nANHOKY2WLTCxxbCv5dtggkedflOAsjHgvfhKaPI2ENOPGZwLomcTybaxpYtJWQWRFtvaf0hIVf7AbeKhfmIzmA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eUQD+tVNM9/V+kSwZK0vxdBl2Ob+4YuCk29XxL+gH5g=; b=Lyl8oWNCF3lSI5uM8x5j0PmcXnvrn4hs1rIPnVH9fr3KYG9YGs68eRSRVXNbdVqE8whRG8arupYOqOnhFlY2qDK9LUDnChpoUTPUwDNnRV2Y3522aBezFSJYzidUAEIRXvXeJ75vW/TKoXK6PC3IEWFvk3/kktv9nDAwGfmul4Y= Received: from SN4PR0601CA0018.namprd06.prod.outlook.com (2603:10b6:803:2f::28) by DM6PR02MB4777.namprd02.prod.outlook.com (2603:10b6:5:17::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.14; Fri, 6 Mar 2020 23:47:59 +0000 Received: from SN1NAM02FT028.eop-nam02.prod.protection.outlook.com (2603:10b6:803:2f:cafe::39) by SN4PR0601CA0018.outlook.office365.com (2603:10b6:803:2f::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.16 via Frontend Transport; Fri, 6 Mar 2020 23:47:59 +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 SN1NAM02FT028.mail.protection.outlook.com (10.152.72.105) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:59 +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 1jAMhC-0003QM-TZ; Fri, 06 Mar 2020 15:47:58 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh7-0002g8-QU; Fri, 06 Mar 2020 15:47:53 -0800 Received: from xsj-pvapsmtp01 (smtp3.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 026NllQT002428; Fri, 6 Mar 2020 15:47:47 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMh0-0002eg-Ul; Fri, 06 Mar 2020 15:47:46 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 22/24] firmware: xilinx: Add system shutdown API interface Date: Fri, 6 Mar 2020 15:47:30 -0800 Message-Id: <1583538452-1992-23-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(376002)(396003)(346002)(39860400002)(136003)(199004)(189003)(186003)(5660300002)(70206006)(26005)(478600001)(336012)(70586007)(107886003)(7696005)(6636002)(2616005)(8676002)(8936002)(9786002)(81156014)(81166006)(54906003)(316002)(426003)(6666004)(4326008)(356004)(2906002)(36756003)(44832011)(7416002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR02MB4777; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3998ec2a-080c-44d1-5967-08d7c228cd45 X-MS-TrafficTypeDiagnostic: DM6PR02MB4777: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:556; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TkeylbjyAkkrsvozIPOyRNvFJlu0XoHZ7Tu4UqsqY/2ngCGwbHJif/+gJcYJcbid4jBPKe/06TuRGdoKUvRYdAhix7lJLPNEX5V8qdl5/aCEdEOVUXALcm5pYEa2UEX4FOngK7BpwV4jRv5Bo9XdWFb3ArQxzHwjyV+DnTR5e49VPMQq3wurBbQFgNlc6/s6HZt54AkST3+plmrf3goS32OCLHXGQbuqjNpamOYcwEEFvUQEW3pdKvLyk2DxWxPGXxAp9zgO/Yn/oFOGe0yvMquNSV0kz09SzlmiC8DW1F8DXySXKxTONnGdW3FKW0bNCcXz1GgfxRMw5LZ0vgL6s7RLKeHtSqRdn6SKmy0h9cF9D7lVtIGb4sSWLrpKd4rQs7cpXOuIeqTzwaw5+7mwlGlXS8fEYcDd5K+Ave8hMSRNmhlDGdRUes5aJ9zARYer X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:59.3448 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3998ec2a-080c-44d1-5967-08d7c228cd45 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: DM6PR02MB4777 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154801_636280_87A3441C X-CRM114-Status: UNSURE ( 9.87 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.76.49 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rajan Vaja , linux-kernel@vger.kernel.org, Jolly Shah , rajanv@xilinx.com, Jolly Shah , 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 From: Rajan Vaja Add system shutdown API interface which asks firmware to perform system shutdown/restart. Signed-off-by: Rajan Vaja Signed-off-by: Michal Simek Signed-off-by: Jolly Shah Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/zynqmp.c | 13 +++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index f671b6b..d3f637b 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -834,6 +834,19 @@ int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, EXPORT_SYMBOL_GPL(zynqmp_pm_set_requirement); /** + * zynqmp_pm_system_shutdown - PM call to request a system shutdown or restart + * @type: Shutdown or restart? 0 for shutdown, 1 for restart + * @subtype: Specifies which system should be restarted or shut down + * + * Return: Returns status, either success or error+reason + */ +int zynqmp_pm_system_shutdown(const u32 type, const u32 subtype) +{ + return zynqmp_pm_invoke_fn(PM_SYSTEM_SHUTDOWN, type, subtype, + 0, 0, NULL); +} + +/** * ggs_show - Show global general storage (ggs) sysfs attribute * @device: Device structure * @attr: Device attribute structure diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 8ccaa39..13b9fdb 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -66,7 +66,8 @@ enum pm_api_id { PM_GET_API_VERSION = 1, - PM_REQUEST_NODE = 13, + PM_SYSTEM_SHUTDOWN = 12, + PM_REQUEST_NODE, PM_RELEASE_NODE, PM_SET_REQUIREMENT, PM_RESET_ASSERT = 17, @@ -327,6 +328,7 @@ int zynqmp_pm_write_ggs(u32 index, u32 value); int zynqmp_pm_read_ggs(u32 index, u32 *value); int zynqmp_pm_write_pggs(u32 index, u32 value); int zynqmp_pm_read_pggs(u32 index, u32 *value); +int zynqmp_pm_system_shutdown(const u32 type, const u32 subtype); int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 *ret_payload); From patchwork Fri Mar 6 23:47:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424809 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C0D50174A for ; Fri, 6 Mar 2020 23:49:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8F7092070E for ; Fri, 6 Mar 2020 23:49:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DynR+Nsq"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="i/eFrLI9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F7092070E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=PW9w/3ykVHQs+4X1kmKiR1lnq8P66WFP4RDhfXDdOww=; b=DynR+NsqFWDNtH Xl4houTn9ga2gIxL+ALMrvFjPsEuJgrD5kiME82zujW+0Zim7YiGwbcH+pJjmh8BCTiSCQ9FM+q+F 3Fw0H7EZ6AoXTVtIYiWo+Sa/ykIi0jDDD0AkahqZitK9oxb7j/ZYyS4Q9P2pcVebD3QCl6MSveRQO pdrpnIkFmNoSct8BcZhXN/zSHRBpXmj7IvGqAS5f12gVHy9JFAG25j+DmFmozgoyTvlLciYSoILV8 OnqsW6KIKly00C4Ax1Cm3aA+yRN+80hGHC2AOnF3McXS4dPhbsyv9LG+i1B/y6mkgtGdZmMNzvh3j WHXt8Qx1YOApKB5P3dvw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMix-0007RH-Su; Fri, 06 Mar 2020 23:49:48 +0000 Received: from mail-dm6nam10on2041.outbound.protection.outlook.com ([40.107.93.41] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhE-0005yZ-Fv for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dADUdlZDFnfM57UPKmt8fQNjOMXI88XW6n5wsW2Gb6bEjeB9AXepTbApQJ5TztxeAl29OtWytXQP1cjjaS7+ZxAz0zk5Aq82qt5Ln0yIjr8McRO3zMLJd0Evkn5+cpfRpPN22e/D+NWTA9SunTi6ap1yRvAbWjl2x9F0e5kVmaGA2SB6xU4vqJOz6XWbMyYNhjQKWgj/nZ/9Fx/HEcMKWPNpXQVs3y9k09akqxYM0BoRGKx3issG3YCZWUG4P4soc2AGYIMktJoKFF9mlKgrag2ZuQxKW8BdphMQJ9NBwCkH7iv4JOOm8p3I9EMB3Pcm09MyXRw1C7vxehSCHueCyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bRGEhLru2qbJkPaZbYnydkIWA9EZTA0fNm6DB8AvTsQ=; b=klsH74nTzvgumnWKXySmP0dANt81qCrnZ/Gkne7eMwTRd/+FXE50+btv/uKZUxG6GUSkpIHGXuySZ8KK0GiwuLpulPCirjR6lWouuqzdj7Imllcu//05MK9k2qnRMXgNKQy+E3I8r4xeTOZE7X1LNn2qVcKiNe33IfAW/satoGHInLErcTQYZXDLjufSO3tWHXa0xBtCrmswyEZyDBvesPeQcJqQ0F6itdfSDBRtwZ4REqEtZ6adxq3o4O6AZVLy3tPRcfhxXNRjZiSz3zsAbdI4TQv/uNkk4cPwlSvfWSTjg931HP4ec3q7V2Gs2Wuqtto3IB6Lq8y9yTKVuyBEdg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=aggios.com smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bRGEhLru2qbJkPaZbYnydkIWA9EZTA0fNm6DB8AvTsQ=; b=i/eFrLI9nSDIrIQHxJiE6pw9HKcQuF33UkANi5SXmZ8/SFHf/BhZQg7OmnSrCpDa+amULNo5H/FiDWwStEm1Kuks569WxenyyL6aMbGid0HMn6nZe+GFR/vjfWmGYAY+R7ECzRlBV1R8zuiHswIlBRpkFf3/Q+S/fxgsPX64aY0= Received: from BL0PR02CA0008.namprd02.prod.outlook.com (2603:10b6:207:3c::21) by CH2PR02MB6919.namprd02.prod.outlook.com (2603:10b6:610:82::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.16; Fri, 6 Mar 2020 23:47:57 +0000 Received: from BL2NAM02FT040.eop-nam02.prod.protection.outlook.com (2603:10b6:207:3c:cafe::a1) by BL0PR02CA0008.outlook.office365.com (2603:10b6:207:3c::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2772.18 via Frontend Transport; Fri, 6 Mar 2020 23:47:57 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; aggios.com; dkim=none (message not signed) header.d=none;aggios.com; 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 BL2NAM02FT040.mail.protection.outlook.com (10.152.77.193) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:57 +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 1jAMhA-0003Pz-Rv; Fri, 06 Mar 2020 15:47:56 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh5-0002g8-Ov; Fri, 06 Mar 2020 15:47:51 -0800 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id 026NlloY002432; Fri, 6 Mar 2020 15:47:47 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMh1-0002eg-0g; Fri, 06 Mar 2020 15:47:47 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 23/24] firmware: xilinx: Add sysfs to set shutdown scope Date: Fri, 6 Mar 2020 15:47:31 -0800 Message-Id: <1583538452-1992-24-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(136003)(39860400002)(396003)(376002)(346002)(189003)(199004)(4326008)(5660300002)(2906002)(107886003)(36756003)(478600001)(316002)(6666004)(356004)(54906003)(81166006)(81156014)(8676002)(9786002)(6636002)(7696005)(70586007)(2616005)(70206006)(7416002)(8936002)(336012)(426003)(186003)(26005)(44832011); DIR:OUT; SFP:1101; SCL:1; SRVR:CH2PR02MB6919; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3a1c622f-d939-4980-1633-08d7c228cc39 X-MS-TrafficTypeDiagnostic: CH2PR02MB6919: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4lasrMdreFeckn6udklNUg4UzyIu9Uw8la6bbpfT4ngDKIWM1IR67mqn2Y/uy1lHCtTYJtcYzFTcbD8PXcHk/DtIGH3aYcocpbAQEoTTo92e2lUDnI56cxKGVyBXbJZj8jiAKr/HoBZoyS+iH8KXYOff49CkwN2Eg2mie9fivVgnqsvI8NgyjgsONw0mYAQo9k3QruXsoajM1XoUBVLODTYPjYBNiHCz5NNLFtMJfEMo5pPm6K59xk3DXrJFkKbdoPY5DwbG/VyRFXCooGs9YO5qFrVBVCyQ0U7EwyYUg30a+SO36p1Xg6aUx/Ihgn6YChYATpESVK7cuCdjDAbklyhfHOCtpNGUkHp0q2wKEioVbxt30D8lhAwywGGZ76eEGyv0v+i+paruH/B8NIMaJPFZ8TS4+R2L7NxGJWeirtAJ+bfVTJ/fa78ztmAOH9Ze X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:57.4186 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3a1c622f-d939-4980-1633-08d7c228cc39 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: CH2PR02MB6919 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154800_595902_A9BED7DF X-CRM114-Status: GOOD ( 19.90 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.93.41 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tejas Patel , Stefan Krsmanovic , Rajan Vaja , linux-kernel@vger.kernel.org, Jolly Shah , rajanv@xilinx.com, Jolly Shah , 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 From: Rajan Vaja The Linux shutdown functionality implemented via PSCI system_off does not include an option to set a scope, i.e. which parts of the system to shut down. This patch creates sysfs that allows to set the shutdown scope for the next shutdown request. When the next shutdown is performed, the platform specific portion of PSCI-system_off can use the chosen shutdown scope. Signed-off-by: Rajan Vaja Signed-off-by: Stefan Krsmanovic Signed-off-by: Michal Simek Signed-off-by: Jolly Shah Signed-off-by: Tejas Patel Signed-off-by: Jolly Shah --- .../ABI/stable/sysfs-driver-firmware-zynqmp | 32 +++++ drivers/firmware/xilinx/zynqmp.c | 150 ++++++++++++++++++++- include/linux/firmware/xlnx-zynqmp.h | 12 ++ 3 files changed, 193 insertions(+), 1 deletion(-) diff --git a/Documentation/ABI/stable/sysfs-driver-firmware-zynqmp b/Documentation/ABI/stable/sysfs-driver-firmware-zynqmp index 7fd6e70..b46ec0c 100644 --- a/Documentation/ABI/stable/sysfs-driver-firmware-zynqmp +++ b/Documentation/ABI/stable/sysfs-driver-firmware-zynqmp @@ -48,3 +48,35 @@ Description: # echo 0xFFFFFFFF 0x1234ABCD > /sys/devices/platform/firmware\:zynqmp-firmware/pggs0 Users: Xilinx + +What: /sys/devices/platform/firmware\:zynqmp-firmware/shutdown_scope +Date: March 2020 +KernelVersion: 5.6 +Contact: "Jolly Shah" +Description: + This sysfs interface allows to set the shutdown scope for the + next shutdown request. When the next shutdown is performed, the + platform specific portion of PSCI-system_off can use the chosen + shutdown scope. + + Following are available shutdown scopes(subtypes): + + subsystem: Only the APU along with all of its peripherals + not used by other processing units will be + shut down. This may result in the FPD power + domain being shut down provided that no other + processing unit uses FPD peripherals or DRAM. + ps_only: The complete PS will be shut down, including the + RPU, PMU, etc. Only the PL domain (FPGA) + remains untouched. + system: The complete system/device is shut down. + + Usage: + # cat /sys/devices/platform/firmware\:zynqmp-firmware/shutdown_scope + # echo > /sys/devices/platform/firmware\:zynqmp-firmware/shutdown_scope + + Example: + # cat /sys/devices/platform/firmware\:zynqmp-firmware/shutdown_scope + # echo "subsystem" > /sys/devices/platform/firmware\:zynqmp-firmware/shutdown_scope + +Users: Xilinx diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index d3f637b..9caf1cf 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -847,6 +847,154 @@ int zynqmp_pm_system_shutdown(const u32 type, const u32 subtype) } /** + * struct zynqmp_pm_shutdown_scope - Struct for shutdown scope + * @subtype: Shutdown subtype + * @name: Matching string for scope argument + * + * This struct encapsulates mapping between shutdown scope ID and string. + */ +struct zynqmp_pm_shutdown_scope { + const enum zynqmp_pm_shutdown_subtype subtype; + const char *name; +}; + +static struct zynqmp_pm_shutdown_scope shutdown_scopes[] = { + [ZYNQMP_PM_SHUTDOWN_SUBTYPE_SUBSYSTEM] = { + .subtype = ZYNQMP_PM_SHUTDOWN_SUBTYPE_SUBSYSTEM, + .name = "subsystem", + }, + [ZYNQMP_PM_SHUTDOWN_SUBTYPE_PS_ONLY] = { + .subtype = ZYNQMP_PM_SHUTDOWN_SUBTYPE_PS_ONLY, + .name = "ps_only", + }, + [ZYNQMP_PM_SHUTDOWN_SUBTYPE_SYSTEM] = { + .subtype = ZYNQMP_PM_SHUTDOWN_SUBTYPE_SYSTEM, + .name = "system", + }, +}; + +static struct zynqmp_pm_shutdown_scope *selected_scope = + &shutdown_scopes[ZYNQMP_PM_SHUTDOWN_SUBTYPE_SYSTEM]; + +/** + * zynqmp_pm_is_shutdown_scope_valid - Check if shutdown scope string is valid + * @scope_string: Shutdown scope string + * + * Return: Return pointer to matching shutdown scope struct from + * array of available options in system if string is valid, + * otherwise returns NULL. + */ +static struct zynqmp_pm_shutdown_scope* + zynqmp_pm_is_shutdown_scope_valid(const char *scope_string) +{ + int count; + + for (count = 0; count < ARRAY_SIZE(shutdown_scopes); count++) + if (sysfs_streq(scope_string, shutdown_scopes[count].name)) + return &shutdown_scopes[count]; + + return NULL; +} + +/** + * shutdown_scope_show - Show shutdown_scope sysfs attribute + * @device: Device structure + * @attr: Device attribute structure + * @buf: Requested available shutdown_scope attributes string + * + * User-space interface for viewing the available scope options for system + * shutdown. Scope option for next shutdown call is marked with []. + * + * Usage: cat /sys/devices/platform/firmware\:zynqmp-firmware/shutdown_scope + * + * Return: Number of bytes printed into the buffer. + */ +static ssize_t shutdown_scope_show(struct device *device, + struct device_attribute *attr, + char *buf) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(shutdown_scopes); i++) { + if (&shutdown_scopes[i] == selected_scope) { + strcat(buf, "["); + strcat(buf, shutdown_scopes[i].name); + strcat(buf, "]"); + } else { + strcat(buf, shutdown_scopes[i].name); + } + strcat(buf, " "); + } + strcat(buf, "\n"); + + return strlen(buf); +} + +/** + * shutdown_scope_store - Store shutdown_scope sysfs attribute + * @device: Device structure + * @attr: Device attribute structure + * @buf: User entered shutdown_scope attribute string + * @count: Buffer size + * + * User-space interface for setting the scope for the next system shutdown. + * Usage: echo > /sys/devices/platform/firmware\:zynqmp-firmware/shutdown_scope + * + * The Linux shutdown functionality implemented via PSCI system_off does not + * include an option to set a scope, i.e. which parts of the system to shut + * down. + * + * This API function allows to set the shutdown scope for the next shutdown + * request by passing it to the ATF running in EL3. When the next shutdown + * is performed, the platform specific portion of PSCI-system_off can use + * the chosen shutdown scope. + * + * subsystem: Only the APU along with all of its peripherals not used by other + * processing units will be shut down. This may result in the FPD + * power domain being shut down provided that no other processing + * unit uses FPD peripherals or DRAM. + * ps_only: The complete PS will be shut down, including the RPU, PMU, etc. + * Only the PL domain (FPGA) remains untouched. + * system: The complete system/device is shut down. + * + * Return: count argument if request succeeds, the corresponding error + * code otherwise + */ +static ssize_t shutdown_scope_store(struct device *device, + struct device_attribute *attr, + const char *buf, size_t count) +{ + int ret; + struct zynqmp_pm_shutdown_scope *scope; + + scope = zynqmp_pm_is_shutdown_scope_valid(buf); + if (!scope) + return -EINVAL; + + ret = zynqmp_pm_system_shutdown(ZYNQMP_PM_SHUTDOWN_TYPE_SETSCOPE_ONLY, + scope->subtype); + if (ret) { + pr_err("unable to set shutdown scope %s\n", buf); + return ret; + } + + selected_scope = scope; + + return count; +} + +static DEVICE_ATTR_RW(shutdown_scope); + +static struct attribute *zynqmp_shutdown_scope_attrs[] = { + &dev_attr_shutdown_scope.attr, + NULL, +}; + +static const struct attribute_group shutdown_scope_attribute_group = { + .attrs = zynqmp_shutdown_scope_attrs, +}; + +/** * ggs_show - Show global general storage (ggs) sysfs attribute * @device: Device structure * @attr: Device attribute structure @@ -955,7 +1103,6 @@ static ssize_t ggs_store(struct device *device, ret = zynqmp_pm_write_ggs(reg, value); if (ret) count = -EFAULT; - err: kfree(kern_buff); @@ -1159,6 +1306,7 @@ static const struct attribute_group ggs_attribute_group = { const struct attribute_group *firmware_attribute_groups[] = { &ggs_attribute_group, + &shutdown_scope_attribute_group, NULL, }; diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 13b9fdb..31ed58c 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -280,6 +280,18 @@ enum tap_delay_type { PM_TAPDELAY_OUTPUT, }; +enum zynqmp_pm_shutdown_type { + ZYNQMP_PM_SHUTDOWN_TYPE_SHUTDOWN, + ZYNQMP_PM_SHUTDOWN_TYPE_RESET, + ZYNQMP_PM_SHUTDOWN_TYPE_SETSCOPE_ONLY, +}; + +enum zynqmp_pm_shutdown_subtype { + ZYNQMP_PM_SHUTDOWN_SUBTYPE_SUBSYSTEM, + ZYNQMP_PM_SHUTDOWN_SUBTYPE_PS_ONLY, + ZYNQMP_PM_SHUTDOWN_SUBTYPE_SYSTEM, +}; + /** * struct zynqmp_pm_query_data - PM query data * @qid: query ID From patchwork Fri Mar 6 23:47:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 11424811 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 452E1921 for ; Fri, 6 Mar 2020 23:50:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1FB1E206D5 for ; Fri, 6 Mar 2020 23:50:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WhzW3qdR"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="hmSBVJlW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1FB1E206D5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xilinx.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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=fUtuRgGDEMIwMqf8hvKWheo4su6QJ0R1bISj8hx22Cg=; b=WhzW3qdR+V9bQw ANfH69YUDyW3VfVdBSHe+IYrz2aLP5euDn7v0YbjEwgXhgTkvIzsghqMKqCuVtJUdxAyAP35CinME CzKBCriDlHPuyxFnDvEz0ib8gPgSDbMzdmYQdDDe4/uJahxxueqoYqFJz7SZEfYoMg/1sszf1LaeD njAOY3FylZT7ZuxAezEnJ4spoDLKyEdXv6hcWio6rK0cdLN0vAYe8qJ8L0q2g4KTf2fxPNRCo/R9j UkclGLvQbqtcubV4Yo+5NLluEXW11PctHubtYvk5A/SUe/b2j6ReONEzmKpvsnRTzlMuLN0YZ6BWw KI/sz3RtqUhk4N2h0j4A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMjJ-0007j5-19; Fri, 06 Mar 2020 23:50:09 +0000 Received: from mail-dm6nam10on2046.outbound.protection.outlook.com ([40.107.93.46] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jAMhF-0005z9-4f for linux-arm-kernel@lists.infradead.org; Fri, 06 Mar 2020 23:48:07 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GrCqjEwl8rsWuGhPikC3SbGxOZbLSKdDam4VxmKemU9OBJbVkYjjPdfOaB3TKwArIPBaNwz7D/q9fh8PGiIgllGuURYrRfeHsewO7ilRxfgy0LbTNMsWdsenfrXDRwNxEhd5KQTo63FC5bL+ikcmJNjG0kPNnYAc2AzZxnL+DSjGxs3cQ108WtqMeHb5SzjJjbMD8C5s8ufGZ5PHPGxZ4OhRoaGHKf2ozaoEPkyXPM8IiByWKRvU7BTTMqnBiuZSE0bXI+fzEsityJt0VrkvYI+V6PXEE6waCDOFHZ1n6VtlciLl2P7PfApU8ecR1AgwjP8Y8RB5PSNdKtFb0I+dyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GuSJkdmvGBpRYlYRfNsJM3AZ/6KMAauY9hBgSSjJpWs=; b=VAHSF+iqAQnOxbpdZE5K7Z/6cdbmyhsqqvg7eN/8nOZ3bggbZ5VMlxP/qgNhI9urM11syuU+sngEGT1azjFDT4rnHGhgFmBzDaDsFVRhkVhtIPZULMIl2VM+WTNfahNoTaYyBlRSNm68zx52k90Y1jT9QbnbT7qV39EyD1vGncFlN2uQwSF7HvQKGJqrO/AtLaxI4H6WaZWrBCmVKNgtOLn2+VvWZdtVEJKVLsz+PtDecfBiMxByijIaqS0v5Nh6KnSSY5v72LD7bnB4gMQCeLLYvPRK3TpsD17T+Du29reHx+hV9IKNVFFkvx/OQJCUWuo3BSr0LJBT+wxkjP84KQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.60.83) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=xilinx.com; dmarc=bestguesspass action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GuSJkdmvGBpRYlYRfNsJM3AZ/6KMAauY9hBgSSjJpWs=; b=hmSBVJlW6D3V3flynU61Mw6P6B3LczshKDY44rkCwReGcHFELmsagBQKXilivZygFd3N98D9++lc3dvEoarVFDWxw7X9kTc4cbZhlZz/x0pgE0SnY72y4twhi2hX6WbTmwu8STS59pZXf1wmbT+U29HDkle3cYC5Kn8gsB2Lfsg= Received: from BL0PR0102CA0019.prod.exchangelabs.com (2603:10b6:207:18::32) by SN6PR02MB4557.namprd02.prod.outlook.com (2603:10b6:805:b4::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.14; Fri, 6 Mar 2020 23:47:58 +0000 Received: from BL2NAM02FT015.eop-nam02.prod.protection.outlook.com (2603:10b6:207:18:cafe::35) by BL0PR0102CA0019.outlook.office365.com (2603:10b6:207:18::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.16 via Frontend Transport; Fri, 6 Mar 2020 23:47:58 +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 BL2NAM02FT015.mail.protection.outlook.com (10.152.77.167) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.2793.11 via Frontend Transport; Fri, 6 Mar 2020 23:47:57 +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 1jAMhB-0003Q5-CZ; Fri, 06 Mar 2020 15:47:57 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1jAMh6-0002g8-94; Fri, 06 Mar 2020 15:47:52 -0800 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 026NllXW001025; Fri, 6 Mar 2020 15:47:47 -0800 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1jAMh1-0002eg-3A; Fri, 06 Mar 2020 15:47:47 -0800 From: Jolly Shah To: ard.biesheuvel@linaro.org, mingo@kernel.org, gregkh@linuxfoundation.org, matt@codeblueprint.co.uk, sudeep.holla@arm.com, hkallweit1@gmail.com, keescook@chromium.org, dmitry.torokhov@gmail.com, michal.simek@xilinx.com Subject: [PATCH v3 24/24] firmware: xilinx: Add sysfs and API to set boot health status Date: Fri, 6 Mar 2020 15:47:32 -0800 Message-Id: <1583538452-1992-25-git-send-email-jolly.shah@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1583538452-1992-1-git-send-email-jolly.shah@xilinx.com> References: <1583538452-1992-1-git-send-email-jolly.shah@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:; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(4636009)(346002)(376002)(396003)(136003)(39860400002)(189003)(199004)(336012)(107886003)(36756003)(54906003)(7416002)(478600001)(426003)(44832011)(2616005)(2906002)(316002)(5660300002)(8676002)(9786002)(26005)(4326008)(6666004)(356004)(6636002)(7696005)(81166006)(70586007)(81156014)(70206006)(186003)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR02MB4557; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8e15b597-9ae3-4d21-aca4-08d7c228cc83 X-MS-TrafficTypeDiagnostic: SN6PR02MB4557: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 0334223192 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NuKpZbQyXIL7DRcEMxPzTB4LuUiScC51zYnj6FJWLbpHAPN4tth0P+RHC9HuUJlbq+pwmY8XWV7CIaB0trqjSuKhRv1WhQGGDtsyRYZBVubcY0bDvRqj2gmm/t/bRTKLkCkjRq9XfCVGGlTSeYl0t2KZLviEpG3B4s487u+tc24AJOwf/2m4mALs0CmPIJM9YxEHntfjieF484MpaQcFa8CxDE+JAAPGloeZ6k8/zbRvsnUcw91pGotZSyXV6RyCXYkwTSfcq0cdn9Zxrh56LqNrVHhh2eJj9LENBQK+3OmbgHt2zONA/JNP7UiDIq5HpwxV3aai0RuqG6EG2+RD1FN0UgNBRuweAjWKiViOxVKC/8dwgCMl/DU7hGwoE5+8oUZ1aSHww1zugV6+5BZESfL/aSDxcvOM/TW6f+2q2HJJZhZ3CnDlC7jNo6C2z4ce X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2020 23:47:57.9474 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8e15b597-9ae3-4d21-aca4-08d7c228cc83 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: SN6PR02MB4557 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200306_154801_180571_070C3AA9 X-CRM114-Status: GOOD ( 15.42 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.93.46 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tejas Patel , Rajan Vaja , linux-kernel@vger.kernel.org, Jolly Shah , rajanv@xilinx.com, Jolly Shah , 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 From: Rajan Vaja Add sysfs interface to set boot health status from user space. Add API used by this interface to communicate with firmware. If PMUFW is compiled with CHECK_HEALTHY_BOOT, it will check the healthy bit on FPD WDT expiration. If healthy bit is set by a user application running in Linux, PMUFW will do APU only restart. If healthy bit is not set during FPD WDT expiration, PMUFW will do system restart. Signed-off-by: Rajan Vaja Signed-off-by: Michal Simek Signed-off-by: Jolly Shah Signed-off-by: Tejas Patel Signed-off-by: Jolly Shah --- .../ABI/stable/sysfs-driver-firmware-zynqmp | 21 ++++++++ drivers/firmware/xilinx/zynqmp.c | 63 ++++++++++++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 3 ++ 3 files changed, 87 insertions(+) diff --git a/Documentation/ABI/stable/sysfs-driver-firmware-zynqmp b/Documentation/ABI/stable/sysfs-driver-firmware-zynqmp index b46ec0c..a37b408 100644 --- a/Documentation/ABI/stable/sysfs-driver-firmware-zynqmp +++ b/Documentation/ABI/stable/sysfs-driver-firmware-zynqmp @@ -80,3 +80,24 @@ Description: # echo "subsystem" > /sys/devices/platform/firmware\:zynqmp-firmware/shutdown_scope Users: Xilinx + +What: /sys/devices/platform/firmware\:zynqmp-firmware/health_status +Date: March 2020 +KernelVersion: 5.6 +Contact: "Jolly Shah" +Description: + This sysfs interface allows to set the health status. If PMUFW + is compiled with CHECK_HEALTHY_BOOT, it will check the healthy + bit on FPD WDT expiration. If healthy bit is set by a user + application running in Linux, PMUFW will do APU only restart. If + healthy bit is not set during FPD WDT expiration, PMUFW will do + system restart. + + Usage: + Set healthy bit + # echo 1 > /sys/devices/platform/firmware\:zynqmp-firmware/health_status + + Unset healthy bit + # echo 0 > /sys/devices/platform/firmware\:zynqmp-firmware/health_status + +Users: Xilinx diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 9caf1cf..fc3aa4e 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -667,6 +667,21 @@ int zynqmp_pm_read_pggs(u32 index, u32 *value) EXPORT_SYMBOL_GPL(zynqmp_pm_read_pggs); /** + * zynqmp_pm_set_boot_health_status() - PM API for setting healthy boot status + * @value Status value to be written + * + * This function sets healthy bit value to indicate boot health status + * to firmware. + * + * @return Returns status, either success or error+reason + */ +int zynqmp_pm_set_boot_health_status(u32 value) +{ + return zynqmp_pm_invoke_fn(PM_IOCTL, 0, IOCTL_SET_BOOT_HEALTH_STATUS, + value, 0, NULL); +} + +/** * zynqmp_pm_reset_assert - Request setting of reset (1 - assert, 0 - release) * @reset: Reset to be configured * @assert_flag: Flag stating should reset be asserted (1) or @@ -995,6 +1010,53 @@ static const struct attribute_group shutdown_scope_attribute_group = { }; /** + * health_status_store - Store health_status sysfs attribute + * @device: Device structure + * @attr: Device attribute structure + * @buf: User entered health_status attribute string + * @count: Buffer size + * + * User-space interface for setting the boot health status. + * Usage: echo > /sys/devices/platform/firmware\:zynqmp-firmware/health_status + * + * Value: + * 1 - Set healthy bit to 1 + * 0 - Unset healthy bit + * + * Return: count argument if request succeeds, the corresponding error + * code otherwise + */ +static ssize_t health_status_store(struct device *device, + struct device_attribute *attr, + const char *buf, size_t count) +{ + int ret; + unsigned int value; + + ret = kstrtouint(buf, 10, &value); + if (ret) + return ret; + + ret = zynqmp_pm_set_boot_health_status(value); + if (ret) { + pr_err("unable to set healthy bit value to %u\n", value); + return ret; + } + + return count; +} + +static DEVICE_ATTR_WO(health_status); + +static struct attribute *zynqmp_health_status_attrs[] = { + &dev_attr_health_status.attr, + NULL, +}; +static const struct attribute_group health_status_attribute_group = { + .attrs = zynqmp_health_status_attrs, +}; + +/** * ggs_show - Show global general storage (ggs) sysfs attribute * @device: Device structure * @attr: Device attribute structure @@ -1307,6 +1369,7 @@ static const struct attribute_group ggs_attribute_group = { const struct attribute_group *firmware_attribute_groups[] = { &ggs_attribute_group, &shutdown_scope_attribute_group, + &health_status_attribute_group, NULL, }; diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 31ed58c..1900349 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -114,6 +114,8 @@ enum pm_ioctl_id { IOCTL_READ_GGS, IOCTL_WRITE_PGGS, IOCTL_READ_PGGS, + /* Set healthy bit value */ + IOCTL_SET_BOOT_HEALTH_STATUS = 17, }; enum pm_query_id { @@ -341,6 +343,7 @@ int zynqmp_pm_read_ggs(u32 index, u32 *value); int zynqmp_pm_write_pggs(u32 index, u32 value); int zynqmp_pm_read_pggs(u32 index, u32 *value); int zynqmp_pm_system_shutdown(const u32 type, const u32 subtype); +int zynqmp_pm_set_boot_health_status(u32 value); int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 *ret_payload);