From patchwork Wed Sep 12 19:38:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 10598197 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6A659921 for ; Wed, 12 Sep 2018 19:41:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53B322A9F3 for ; Wed, 12 Sep 2018 19:41:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 460372AA23; Wed, 12 Sep 2018 19:41:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5A7052A9F3 for ; Wed, 12 Sep 2018 19:41:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=B1hjjA201jo1YdGbsOpjw0UiKXZd8LHCyv5gEinae3A=; b=hfYbwLKB68t4o0 82z15W6lvtV1a9Ne7hLjEkPI8htCdytoYe7/772dgZENoViaQt1TCJeTv0no2sllARubzXY7DcB+f D5W38mfbHNaw29Ze7Vg6grMU1T/pctXmD5SjLfTySp/ZologSzBWaiLGWCzDRPoRK/g+viG6q5Toy 9OdpNa/CO+fCWt2GLdLy3qxTVcxsJAAZZ309xqWRnd+zaKJiFTd8MnWrGvv+UU2aw3wnQ7QooF4/G BmQt3wrNGnwunm0+naHOsmBnXpTlFXw2BGBPifVT6UhwpVE04FFehzC32Felg4Ti6csARWGX4nhjk SUnygD0uiiAQv1GloPDQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0B0h-0006Ir-6T; Wed, 12 Sep 2018 19:41:11 +0000 Received: from mail-eopbgr680060.outbound.protection.outlook.com ([40.107.68.60] helo=NAM04-BN3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0Az4-00049N-7F for linux-arm-kernel@lists.infradead.org; Wed, 12 Sep 2018 19:39:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YJzB+KnyFKhLEmWrAsNYQ8EP3hzk/DxRcJ5zh/8+xcg=; b=qdkubO8sE65/TPM1WDJTkI2WF24nIO32ajawDOypfRFDLSOlav5HtnUBTdOGRfX8juFSuQA3JAB0OT7+vukA9dgNNP0RszjHEsDELflR7GB6y9zrv72T0Px42gMLsb23hMHTdTDOcdybzV+Cif/hibuBZm/NgJL73ztOPlkNIDI= Received: from MWHPR0201CA0100.namprd02.prod.outlook.com (2603:10b6:301:75::41) by BYAPR02MB5112.namprd02.prod.outlook.com (2603:10b6:a03:70::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.15; Wed, 12 Sep 2018 19:39:15 +0000 Received: from BL2NAM02FT047.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::206) by MWHPR0201CA0100.outlook.office365.com (2603:10b6:301:75::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1143.15 via Frontend Transport; Wed, 12 Sep 2018 19:39:15 +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 BL2NAM02FT047.mail.protection.outlook.com (10.152.77.9) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1143.14 via Frontend Transport; Wed, 12 Sep 2018 19:39:15 +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 1g0Ayo-0002SA-PJ; Wed, 12 Sep 2018 12:39:14 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g0Ayj-0001JA-La; Wed, 12 Sep 2018 12:39:09 -0700 Received: from xsj-pvapsmtp01 (mailhost.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w8CJcwr3003381; Wed, 12 Sep 2018 12:38:58 -0700 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g0AyY-0001Go-IY; Wed, 12 Sep 2018 12:38:58 -0700 From: Jolly Shah To: , , Subject: [PATCH v12 1/6] dt-bindings: firmware: Add bindings for ZynqMP firmware Date: Wed, 12 Sep 2018 12:38:35 -0700 Message-ID: <1536781120-22794-2-git-send-email-jollys@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536781120-22794-1-git-send-email-jollys@xilinx.com> References: <1536781120-22794-1-git-send-email-jollys@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(136003)(376002)(39860400002)(396003)(346002)(2980300002)(438002)(199004)(189003)(54906003)(9786002)(305945005)(5660300001)(16586007)(47776003)(2906002)(50466002)(81166006)(81156014)(106002)(110136005)(316002)(106466001)(356003)(336012)(48376002)(446003)(426003)(77096007)(107886003)(186003)(63266004)(36386004)(4326008)(478600001)(7696005)(486006)(2616005)(72206003)(6666003)(126002)(476003)(8936002)(26005)(8676002)(36756003)(11346002)(2201001)(50226002)(44832011)(76176011)(51416003)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR02MB5112; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT047; 1:g4jRqbCEa1GWugf9ipjoYViOBWtOmOHMh+Inevau7jBV1ESitNL4mf09LNvBFaUDKgsCuu9FV8aTnitQ64mh6B7cutfkUkduo0hjjK/TkrQWieE77TvGZeweUbrCr8aW MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 34635373-281a-4893-210c-08d618e76c6c X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060); SRVR:BYAPR02MB5112; X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB5112; 3:dgr6Her3c4+s3jrH+mfH6g4MGa5GOI0waAnP7FhqwYefZOYKjUpj3I57FHAnICPPQ9xWNg3THIfvr7OuQhvniE87U82ppBxRgqEGsSRb9a31wACxiooS5cZJj7jBJWoB6GiQC8CdRpWQoOkRPbDXhWXrDmhW8IDEekLLR+G61P4iaxseIl6ZLu3PYT8mY3HP2UmeSFm3fIR2WafoEGbp9Odb4qVPd0RGnrq76UtMTaDmPkjOZiuT0Uq142yROS6VwCGtBoIB2sqF+pSvPXRiJ5UzOyk1T6YjVbtlS+mHcNR9wHCgHQ7zsGfFT43AiSoyFuudT0kxphiwMXBeIT+i5PrGaIXUWaEZMSauYTxt8v0=; 25:gI1cQ5AOGgLqy2sPMTQ5Q258QRc80eqDFd+TIIp74Lk8xehstIC/yIdGnJA9aC0+4WqnaKn7dg5l8AHdM/Wkr0V6lGG22WDAdT5UoQJ4Lxd9m9kGZQLtGHdWq2igl/blYVwUnN1+CEpJx5ajYuxX5AB+yf3GrPB/aR/76TqM78IT4PdBPq1SOB/wWBFPfeciryFTk56cPmaILBhEdUDTlLhOszgsPNoTuaezTDjdIZh1fHGZUGoNrl0utW18wUaSMNnSsDkCfWif/o/ZgBLkmtcOX72vtX2rQKrOHJvJVhIifPSiLACJF3OyzaWwNwR4uNvV8MefGH8dGt0ctIIXrw== X-MS-TrafficTypeDiagnostic: BYAPR02MB5112: X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB5112; 31:5/hXjShkXeGaSuuSb3fr9qG+a004KhKoH9WGpUX/EvmxNOJtViNJbR3GQb0qzRhk23kpNlPkZE1USquTM6JeMfirpM0K4rDicyp7Pf9p5jp3jU6RIkS8Jk4AhH3150MD7s19/J0H9uJh9G4dHdQ3fV44x19ux8+ACt1vhyBzpWUPKCSnt8C/MXcmbEl61T9LtR4wGGFXjFruo2p6IID6VeanribawrJBsDPF8jkRQTE=; 20:AIn1M3lQiurTDj4a37mpiPhflDv8CBEYTWdokEcMKUK50kNoaFna3geNN+pQNjo/OFr97prQPO8q/epHjDpOIgw031fSa7ybv/QaYtn4aLOBiXQSk5SUU4HgQ9BD/F6STGJHThTcqz3/42LxFjOl6upOQMuXVNo195Rqi5VNHRCZ/f0sh4VyrosIvD3zRjwI/rmCxyWKEYFqAFmUj+msVAY2Pb4/5AWpJzZDE3ecKfAIqu1z64ClUB/+I6qlkDc8qW53SSUqq/0q4zKWgFS//oiR/Xdsx5EmXHFKuGoIjuoTa/ie5nvt7rWV3rFTeDlKW+ttVMKTBiGJ568hMeEWvIu1ZYLfbIlvDCHZfQouitowXUCU9L2mHP9eLS/Q0+QsoF5PTsa6n0TYvDDQymTDhnEHTm/iKVyK18DFqBn79pSOKAMH6VxoznRI5jqWqLfMcIVqFNmR/hp/lKTM1I9wS58YGwWan1YLlIyRvq8lFqWsJRTfXtWLPEoWvKoYTaCR X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93004095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(201708071742011)(7699050); SRVR:BYAPR02MB5112; BCL:0; PCL:0; RULEID:; SRVR:BYAPR02MB5112; X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB5112; 4:FSOud1zICseVrCbAfGYrTFfbhtkngCDOpR+jdtZDKDGIKbnQV0si2p3tAenjUZBrZfANIpfsnea//LVL4sIWPaA225ThM3CsEfASWGlZ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P62fYXKCZcvmMm1/ELivqMfUBNaIbcaslTM416iJRLIEYpckCgPOmb/iKuFUvSMAhwLWoZ3iH636mN1hG4jqt22s2pmZDyNE2ERCPVR/PM9aE4FeuC5c/MCvZb4UlmXvnXLi3yHmIcV5GI5CV9LQgYuHwntk03pR+tdYG5Ull9kOnvwR3GA9cAlzXK4JxFMe8xhuGg==; 5:trUNAIOKRdQPUdBIyYJMY8tMbwBPtI2qT6jHgBE8ySPhFQBgIBJmT4YO3G605519iw1IuwZPwGg7dMLt6unTobHP/Q6mIlqOElG2mHPADigLQRbeozmog6lH5NxxKwNufQeb46YahjYiH1VEBHjwCvR19evAsAyvCwjm2Tpk5ak=; 7:UIGxX2N6/MENo849bdhimfvHJwDzznKfmF3s5Oj0jsX4EUsRBKojCLgyIMX6KwEwCDmu2KlIAFhkwSrHAkYF3yelEiwJ/tTs8Q//9v8WdBc95gBA3M9EO4/8opISCor6sSYAyDGweKcmLs82HbKKXeedklCRgoY7Xg5XQwtifWhjxSJTPV8VD/2dh9VmNaXEXF1wh/R8AWXLWSujR1EWeAoLz5r50c+SUtyAi2lX47vbX18jbjiTKoLASxlsuZ8q SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2018 19:39:15.3166 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 34635373-281a-4893-210c-08d618e76c6c 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: BYAPR02MB5112 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180912_123930_395216_1313C826 X-CRM114-Status: GOOD ( 10.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , 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 X-Virus-Scanned: ClamAV using ClamSMTP From: Rajan Vaja Add documentation to describe Xilinx ZynqMP firmware driver bindings. Firmware driver provides an interface to firmware APIs. Interface APIs can be used by any driver to communicate to PMUFW (Platform Management Unit). Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah Reviewed-by: Rob Herring --- .../firmware/xilinx/xlnx,zynqmp-firmware.txt | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.txt diff --git a/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.txt b/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.txt new file mode 100644 index 0000000..1b431d9 --- /dev/null +++ b/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.txt @@ -0,0 +1,29 @@ +----------------------------------------------------------------- +Device Tree Bindings for the Xilinx Zynq MPSoC Firmware Interface +----------------------------------------------------------------- + +The zynqmp-firmware node describes the interface to platform firmware. +ZynqMP has an interface to communicate with secure firmware. Firmware +driver provides an interface to firmware APIs. Interface APIs can be +used by any driver to communicate to PMUFW(Platform Management Unit). +These requests include clock management, pin control, device control, +power management service, FPGA service and other platform management +services. + +Required properties: + - compatible: Must contain: "xlnx,zynqmp-firmware" + - method: The method of calling the PM-API firmware layer. + Permitted values are: + - "smc" : SMC #0, following the SMCCC + - "hvc" : HVC #0, following the SMCCC + +------- +Example +------- + +firmware { + zynqmp_firmware: zynqmp-firmware { + compatible = "xlnx,zynqmp-firmware"; + method = "smc"; + }; +}; From patchwork Wed Sep 12 19:38:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 10598221 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DA8E0921 for ; Wed, 12 Sep 2018 19:44:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C44702AA6E for ; Wed, 12 Sep 2018 19:44:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B43E12AA7C; Wed, 12 Sep 2018 19:44:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B2CA02AA6E for ; Wed, 12 Sep 2018 19:44:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lxlITm2sN5CrQfkScOX1BCOqYPK1A/1COV4SsdsRPb0=; b=ZRGCu6Ycke+qVj b7Wsn3VmmC9M+iiPm9/0xYpU18V6z85GU6CbruC5e2yzSiYPxfVlneT51PxuHutekXMnT7KMoOpQe tYtbFZOnGDM5tk2Rx2d38nn1Q9Nfkn9FUARLQChProl9iECBiu6Vjr39ttjUv+BIHbqh29MwCP2nS DDVaFMn0z9nOPsWKNrBwrri9I1KL9RfyTffVzq4zZjXTas0/+3yJWZgcLrrWjvO984ZKmHXtHJBFd 2oHOq94DcNLf7Z1ZJ3jsB3O9xkOQ1N3+M5wNpJbhk+yXBi1OvMnAfufma0ksqgJw6XviLdY+1X6Fd /v57KxRKHb4AVhdmn4rA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0B3o-0007XZ-1c; Wed, 12 Sep 2018 19:44:24 +0000 Received: from mail-eopbgr710040.outbound.protection.outlook.com ([40.107.71.40] helo=NAM05-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0Az5-0004AZ-11 for linux-arm-kernel@lists.infradead.org; Wed, 12 Sep 2018 19:39:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZHCYTuTsJ3Ql9+paE9tylv3rS0TTs7oWAWwvM7PxIrk=; b=Zl1TcSLgmzToazcjCHwIimj21hmdMhcUKAKx269+3xJd3P6xOcCzbuy1UYUT+iRLPb2AFoHnB9F8VlW4Oz7JxgBTDjbdx2ym6D5LJPKddPevlwJWVDaju282d6tZGeCQ/qKIVOqnfndbs+6TQNH3yb3w65XuXEtNR3hQ4FiF8Bw= Received: from BL0PR02CA0038.namprd02.prod.outlook.com (2603:10b6:207:3d::15) by BYAPR02MB4760.namprd02.prod.outlook.com (2603:10b6:a03:4e::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Wed, 12 Sep 2018 19:39:16 +0000 Received: from CY1NAM02FT049.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::205) by BL0PR02CA0038.outlook.office365.com (2603:10b6:207:3d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1143.15 via Frontend Transport; Wed, 12 Sep 2018 19:39:15 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT049.mail.protection.outlook.com (10.152.75.83) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1143.14 via Frontend Transport; Wed, 12 Sep 2018 19:39:15 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:36154 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1g0Ayo-0007VP-NY; Wed, 12 Sep 2018 12:39:14 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g0Ayj-0001JA-K7; Wed, 12 Sep 2018 12:39:09 -0700 Received: from xsj-pvapsmtp01 (mailhost.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w8CJcwA7003383; Wed, 12 Sep 2018 12:38:58 -0700 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g0AyY-0001Go-KQ; Wed, 12 Sep 2018 12:38:58 -0700 From: Jolly Shah To: , , Subject: [PATCH v12 2/6] firmware: xilinx: Add Zynqmp firmware driver Date: Wed, 12 Sep 2018 12:38:36 -0700 Message-ID: <1536781120-22794-3-git-send-email-jollys@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536781120-22794-1-git-send-email-jollys@xilinx.com> References: <1536781120-22794-1-git-send-email-jollys@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(346002)(136003)(396003)(376002)(2980300002)(438002)(199004)(189003)(5660300001)(110136005)(54906003)(336012)(426003)(106002)(26005)(77096007)(186003)(48376002)(9786002)(50466002)(36756003)(8676002)(50226002)(356003)(2906002)(305945005)(44832011)(2616005)(126002)(476003)(81166006)(446003)(16586007)(316002)(11346002)(575784001)(486006)(36386004)(106466001)(8936002)(63266004)(81156014)(14444005)(6666003)(76176011)(51416003)(478600001)(7696005)(72206003)(47776003)(107886003)(2201001)(4326008)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR02MB4760; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT049; 1:p42Bm+iD0F+sFdFFsPAdSbnoaY0CJmNTnDX/3O5s1Hr+Na0TkP/FOmXB13r9bX510kcccrZyuOaS6HkNsT3xfU5Ysnqy7CRkAvg/pkoOcnHJhVmxJGL4Yw0fVozzesiM MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8ee7c6c4-089e-487a-6989-08d618e76c65 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060); SRVR:BYAPR02MB4760; X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB4760; 3:brUOfjG30lNgBZq19KGXqNGWuL0i8ReEkTwbxY9g5ERW+VAJa1lhD51+bS9T2+U4Ji4i492mLzrNrSZzQ2Bn317I1ky56eBEdVZB52e8W4NLrzVHoc9KAoLvlF26rl26eCF7rmExYECECyp1I92sbpIFwaNlIzrZDlbsxKcL0+HCtynVWX2/68FcpjXhNCgWELGR8NFdqknDW/br/KojT3vyyNHcqK7kDRsF6e8Mh38tViHXmm+46Kc0sd+DhDZ2rE3o+NTlqluU2WPT85SefP3EMWOEupTP8DzkaSbHaE2rvZPH7Vfr2XID4mryTir+MSaQ3O4aeSP3BdXRfxiCCaWfWDYHpeC7NlcpBWgh5/g=; 25:9/rCSeIky404/q3A5SwfSYBtNRSkfUTcbrvV8FLkw6cofcngoxDeuxAp+DPrm9FSOPZnqyLodHfYnk7/vOSyegZOocNT01k/gsouI2y4aRdOQlLig39niLAIHkQL6miHy9pHNXX3DeXHtGLOjkQ51JyQwYSEC2awnKKGpaXSq3w+rCLN2k+aaAidUO7BjcLvTtkvraSEVQVSvMgSzvEnkUa79nlaCGrv4c+mUKxZj920ZXwMzjeFx4/hB7pARxBikOBEUt4mZGYCTD5XBDhBFuJv/EIeqa8FBbn2c5XLmKB8DEp8gZkyCYNgButNeJV70dcFx/e3jRcHIwsJ8TCvCQ== X-MS-TrafficTypeDiagnostic: BYAPR02MB4760: X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB4760; 31:JhZHhLAhVzf5sg35OYDol1LzysQ2Twfqbr+/llGZq4Pi+3UEt8rOOzsLxyPpUbd2w3tQWXb0epyaMYX/FvHRzaYCnbDAJRgxISD+6/xjmmdIzX30R+LW4sMsjmchVGQpI2LcQNqGqQ+llRMwdTcHx3FFuY6cqOQE4ZxvGDQhnfLP3a+kiovqjOaOWWhuQTKvgygJ53MTIb/dEBCD80s+sQFHngYD37NTUStQVVaYogs=; 20:ti9igT/FDalemzXVJR7//pxQDkjVUVazeXbQJHcCue13QJ76yFqexqFsbkMOeBdOwTwB9mRxfRWvDnUywN1hqMOw8gj1GEGlA7RUw2L5SdcM6OOW7OVh0cHez9ix6vdqdgnkTqg4JpsNR+lydx1PR89VN21VqsuyvCjUtBJVLClPsXV4eXAd/Amqz7OnUP7baer2nEeIm2G6mpjOVeWYv2/bQYTKRhZ5QOecjJC15gRdyd3YaXgRR7hh2xundFfHE12j8sftMtb2bbeIbYuv5I1cFKRp/jfl3ygFtULclHLmSpTkBewynH706vgXJf5BWzj1+zkNcXXssSv7/xM+22WsT4ZaswvrUyuWd1v+TKe1sddx8C3LYMJBLeRLo3MomKX/QqkF9ju2UkqqW/K90kA+y8G7OCNpfCxv9iJ+4AaCMrkDZcJZ60qSZrW5bU4wFba5S0xHllbG0fLDGiXBrf8rrEyDstxMqrgCq9mRk2g/zESae6GTtA9NFftnS8cN X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93004095)(3231311)(944501410)(52105095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(201708071742011)(7699050); SRVR:BYAPR02MB4760; BCL:0; PCL:0; RULEID:; SRVR:BYAPR02MB4760; X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB4760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5mb71VEuzrAFR8zrkNvxneF763xqdkfOuJzP34BTj9b5BIq+wdF/qBIJTA6tejPp25prJ9HdvWbGBoKUnJwAGFRPmn1bIxCqKmYuzMe8jIm89+jP/stvBkU2c5MlP+ynsEHNNqksf7/71dvCQElbQoJao69gk2+gPj8FrhTlss46xdNKD6u1NDdzsqoD8NBhko+5DIs+btGYqtFOUidbb+ebf5qPWaJGGQeTvWs6oL3kVhhhC+k4bLzHk1sO/PNTqX3TWxgi+6cPYBqU3ldLQTpDGbI34WeFCkKaWgR5aXODkE+VVrEJK4RnpguaZzoe3lnzNo3gqB0LRmRjfn9qBihpspCACmPMp9gA+abKEkW4Q0kMtMsWFO1Coy6m8O6gQ==; 5:Q0/mIfEw79nflphLzxLkre4gwNzcARg4CS4c0/ag5nMtmpQfMQbRNROzkyFeMo8o0GyOIDhau8/g7rBcQXVQNtA8ce6uB8LpeZsnYNZRd4HdFYhf12JTMWZ/xBq1dRKUR2iIe6/xMwgRy21cvcgEqozd3Fzktz58a4gRM3ogc6k=; 7:WBQDDsO6XWiX0oATYoQBIph9rKfgtIbKwZwngxKKQjjYDNTxurWpRlv/+1kduqFebRTWJdrYwH3r0kNbeqY0D+pTV2w6L6KnwsEZqqx96cgaKwrE1efX7h9qMk0EGnWWHlvL4KthEU6eIR+H9eFHY+WWGZNlkcehVYoYOPFkIBfIFBm2d5WWG6u7hjuFb3SzRjIlyArxfkN9yNgSIHOe+TV8jMBV+qcpnoJ4NKqjV5PpEc16SVithuAd3J1TxjKx SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2018 19:39:15.0851 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8ee7c6c4-089e-487a-6989-08d618e76c65 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR02MB4760 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180912_123931_194749_A585E7EA X-CRM114-Status: GOOD ( 14.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , 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 X-Virus-Scanned: ClamAV using ClamSMTP From: Rajan Vaja This patch is adding communication layer with firmware. Firmware driver provides an interface to firmware APIs. Interface APIs can be used by any driver to communicate to PMUFW(Platform Management Unit). All requests go through ATF. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- arch/arm64/Kconfig.platforms | 1 + drivers/firmware/Kconfig | 1 + drivers/firmware/Makefile | 1 + drivers/firmware/xilinx/Kconfig | 16 ++ drivers/firmware/xilinx/Makefile | 4 + drivers/firmware/xilinx/zynqmp.c | 322 +++++++++++++++++++++++++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 63 +++++++ 7 files changed, 408 insertions(+) create mode 100644 drivers/firmware/xilinx/Kconfig create mode 100644 drivers/firmware/xilinx/Makefile create mode 100644 drivers/firmware/xilinx/zynqmp.c create mode 100644 include/linux/firmware/xlnx-zynqmp.h diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms index fbedbd8..6454458 100644 --- a/arch/arm64/Kconfig.platforms +++ b/arch/arm64/Kconfig.platforms @@ -274,6 +274,7 @@ config ARCH_ZX config ARCH_ZYNQMP bool "Xilinx ZynqMP Family" + select ZYNQMP_FIRMWARE help This enables support for Xilinx ZynqMP Family diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index b7c7482..f41eb0d 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig @@ -257,5 +257,6 @@ source "drivers/firmware/google/Kconfig" source "drivers/firmware/efi/Kconfig" source "drivers/firmware/meson/Kconfig" source "drivers/firmware/tegra/Kconfig" +source "drivers/firmware/xilinx/Kconfig" endmenu diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile index b248238..f90363e 100644 --- a/drivers/firmware/Makefile +++ b/drivers/firmware/Makefile @@ -31,3 +31,4 @@ obj-$(CONFIG_GOOGLE_FIRMWARE) += google/ obj-$(CONFIG_EFI) += efi/ obj-$(CONFIG_UEFI_CPER) += efi/ obj-y += tegra/ +obj-y += xilinx/ diff --git a/drivers/firmware/xilinx/Kconfig b/drivers/firmware/xilinx/Kconfig new file mode 100644 index 0000000..64d976e --- /dev/null +++ b/drivers/firmware/xilinx/Kconfig @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: GPL-2.0 +# Kconfig for Xilinx firmwares + +menu "Zynq MPSoC Firmware Drivers" + depends on ARCH_ZYNQMP + +config ZYNQMP_FIRMWARE + bool "Enable Xilinx Zynq MPSoC firmware interface" + help + Firmware interface driver is used by different + drivers to communicate with the firmware for + various platform management services. + Say yes to enable ZynqMP firmware interface driver. + If in doubt, say N. + +endmenu diff --git a/drivers/firmware/xilinx/Makefile b/drivers/firmware/xilinx/Makefile new file mode 100644 index 0000000..29f7bf2 --- /dev/null +++ b/drivers/firmware/xilinx/Makefile @@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0 +# Makefile for Xilinx firmwares + +obj-$(CONFIG_ZYNQMP_FIRMWARE) += zynqmp.o diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c new file mode 100644 index 0000000..5bf64ac --- /dev/null +++ b/drivers/firmware/xilinx/zynqmp.c @@ -0,0 +1,322 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Xilinx Zynq MPSoC Firmware layer + * + * Copyright (C) 2014-2018 Xilinx, Inc. + * + * Michal Simek + * Davorin Mista + * Jolly Shah + * Rajan Vaja + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/** + * zynqmp_pm_ret_code() - Convert PMU-FW error codes to Linux error codes + * @ret_status: PMUFW return code + * + * Return: corresponding Linux error code + */ +static int zynqmp_pm_ret_code(u32 ret_status) +{ + switch (ret_status) { + case XST_PM_SUCCESS: + case XST_PM_DOUBLE_REQ: + return 0; + case XST_PM_NO_ACCESS: + return -EACCES; + case XST_PM_ABORT_SUSPEND: + return -ECANCELED; + case XST_PM_INTERNAL: + case XST_PM_CONFLICT: + case XST_PM_INVALID_NODE: + default: + return -EINVAL; + } +} + +static noinline int do_fw_call_fail(u64 arg0, u64 arg1, u64 arg2, + u32 *ret_payload) +{ + return -ENODEV; +} + +/* + * PM function call wrapper + * Invoke do_fw_call_smc or do_fw_call_hvc, depending on the configuration + */ +static int (*do_fw_call)(u64, u64, u64, u32 *ret_payload) = do_fw_call_fail; + +/** + * do_fw_call_smc() - Call system-level platform management layer (SMC) + * @arg0: Argument 0 to SMC call + * @arg1: Argument 1 to SMC call + * @arg2: Argument 2 to SMC call + * @ret_payload: Returned value array + * + * Invoke platform management function via SMC call (no hypervisor present). + * + * Return: Returns status, either success or error+reason + */ +static noinline int do_fw_call_smc(u64 arg0, u64 arg1, u64 arg2, + u32 *ret_payload) +{ + struct arm_smccc_res res; + + arm_smccc_smc(arg0, arg1, arg2, 0, 0, 0, 0, 0, &res); + + if (ret_payload) { + ret_payload[0] = lower_32_bits(res.a0); + ret_payload[1] = upper_32_bits(res.a0); + ret_payload[2] = lower_32_bits(res.a1); + ret_payload[3] = upper_32_bits(res.a1); + } + + return zynqmp_pm_ret_code((enum pm_ret_status)res.a0); +} + +/** + * do_fw_call_hvc() - Call system-level platform management layer (HVC) + * @arg0: Argument 0 to HVC call + * @arg1: Argument 1 to HVC call + * @arg2: Argument 2 to HVC call + * @ret_payload: Returned value array + * + * Invoke platform management function via HVC + * HVC-based for communication through hypervisor + * (no direct communication with ATF). + * + * Return: Returns status, either success or error+reason + */ +static noinline int do_fw_call_hvc(u64 arg0, u64 arg1, u64 arg2, + u32 *ret_payload) +{ + struct arm_smccc_res res; + + arm_smccc_hvc(arg0, arg1, arg2, 0, 0, 0, 0, 0, &res); + + if (ret_payload) { + ret_payload[0] = lower_32_bits(res.a0); + ret_payload[1] = upper_32_bits(res.a0); + ret_payload[2] = lower_32_bits(res.a1); + ret_payload[3] = upper_32_bits(res.a1); + } + + return zynqmp_pm_ret_code((enum pm_ret_status)res.a0); +} + +/** + * zynqmp_pm_invoke_fn() - Invoke the system-level platform management layer + * caller function depending on the configuration + * @pm_api_id: Requested PM-API call + * @arg0: Argument 0 to requested PM-API call + * @arg1: Argument 1 to requested PM-API call + * @arg2: Argument 2 to requested PM-API call + * @arg3: Argument 3 to requested PM-API call + * @ret_payload: Returned value array + * + * Invoke platform management function for SMC or HVC call, depending on + * configuration. + * Following SMC Calling Convention (SMCCC) for SMC64: + * Pm Function Identifier, + * PM_SIP_SVC + PM_API_ID = + * ((SMC_TYPE_FAST << FUNCID_TYPE_SHIFT) + * ((SMC_64) << FUNCID_CC_SHIFT) + * ((SIP_START) << FUNCID_OEN_SHIFT) + * ((PM_API_ID) & FUNCID_NUM_MASK)) + * + * PM_SIP_SVC - Registered ZynqMP SIP Service Call. + * PM_API_ID - Platform Management API ID. + * + * Return: Returns status, either success or error+reason + */ +int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1, + u32 arg2, u32 arg3, u32 *ret_payload) +{ + /* + * Added SIP service call Function Identifier + * Make sure to stay in x0 register + */ + u64 smc_arg[4]; + + smc_arg[0] = PM_SIP_SVC | pm_api_id; + smc_arg[1] = ((u64)arg1 << 32) | arg0; + smc_arg[2] = ((u64)arg3 << 32) | arg2; + + return do_fw_call(smc_arg[0], smc_arg[1], smc_arg[2], ret_payload); +} + +static u32 pm_api_version; +static u32 pm_tz_version; + +/** + * zynqmp_pm_get_api_version() - Get version number of PMU PM firmware + * @version: Returned version value + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_get_api_version(u32 *version) +{ + u32 ret_payload[PAYLOAD_ARG_CNT]; + int ret; + + if (!version) + return -EINVAL; + + /* Check is PM API version already verified */ + if (pm_api_version > 0) { + *version = pm_api_version; + return 0; + } + ret = zynqmp_pm_invoke_fn(PM_GET_API_VERSION, 0, 0, 0, 0, ret_payload); + *version = ret_payload[1]; + + return ret; +} + +/** + * zynqmp_pm_get_trustzone_version() - Get secure trustzone firmware version + * @version: Returned version value + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_get_trustzone_version(u32 *version) +{ + u32 ret_payload[PAYLOAD_ARG_CNT]; + int ret; + + if (!version) + return -EINVAL; + + /* Check is PM trustzone version already verified */ + if (pm_tz_version > 0) { + *version = pm_tz_version; + return 0; + } + ret = zynqmp_pm_invoke_fn(PM_GET_TRUSTZONE_VERSION, 0, 0, + 0, 0, ret_payload); + *version = ret_payload[1]; + + return ret; +} + +/** + * get_set_conduit_method() - Choose SMC or HVC based communication + * @np: Pointer to the device_node structure + * + * Use SMC or HVC-based functions to communicate with EL2/EL3. + * + * Return: Returns 0 on success or error code + */ +static int get_set_conduit_method(struct device_node *np) +{ + const char *method; + + if (of_property_read_string(np, "method", &method)) { + pr_warn("%s missing \"method\" property\n", __func__); + return -ENXIO; + } + + if (!strcmp("hvc", method)) { + do_fw_call = do_fw_call_hvc; + } else if (!strcmp("smc", method)) { + do_fw_call = do_fw_call_smc; + } else { + pr_warn("%s Invalid \"method\" property: %s\n", + __func__, method); + return -EINVAL; + } + + return 0; +} + +static const struct zynqmp_eemi_ops eemi_ops = { + .get_api_version = zynqmp_pm_get_api_version, +}; + +/** + * 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) +{ + return &eemi_ops; +} +EXPORT_SYMBOL_GPL(zynqmp_pm_get_eemi_ops); + +static int zynqmp_firmware_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct device_node *np; + int ret; + + np = of_find_compatible_node(NULL, NULL, "xlnx,zynqmp"); + if (!np) + return 0; + of_node_put(np); + + ret = get_set_conduit_method(dev->of_node); + if (ret) + return ret; + + /* Check PM API version number */ + zynqmp_pm_get_api_version(&pm_api_version); + if (pm_api_version < ZYNQMP_PM_VERSION) { + panic("%s Platform Management API version error. Expected: v%d.%d - Found: v%d.%d\n", + __func__, + ZYNQMP_PM_VERSION_MAJOR, ZYNQMP_PM_VERSION_MINOR, + pm_api_version >> 16, pm_api_version & 0xFFFF); + } + + pr_info("%s Platform Management API v%d.%d\n", __func__, + pm_api_version >> 16, pm_api_version & 0xFFFF); + + /* Check trustzone version number */ + ret = zynqmp_pm_get_trustzone_version(&pm_tz_version); + if (ret) + panic("Legacy trustzone found without version support\n"); + + if (pm_tz_version < ZYNQMP_TZ_VERSION) + panic("%s Trustzone version error. Expected: v%d.%d - Found: v%d.%d\n", + __func__, + ZYNQMP_TZ_VERSION_MAJOR, ZYNQMP_TZ_VERSION_MINOR, + pm_tz_version >> 16, pm_tz_version & 0xFFFF); + + pr_info("%s Trustzone version v%d.%d\n", __func__, + pm_tz_version >> 16, pm_tz_version & 0xFFFF); + + return of_platform_populate(dev->of_node, NULL, NULL, dev); +} + +static int zynqmp_firmware_remove(struct platform_device *pdev) +{ + return 0; +} + +static const struct of_device_id zynqmp_firmware_of_match[] = { + {.compatible = "xlnx,zynqmp-firmware"}, + {}, +}; +MODULE_DEVICE_TABLE(of, zynqmp_firmware_of_match); + +static struct platform_driver zynqmp_firmware_driver = { + .driver = { + .name = "zynqmp_firmware", + .of_match_table = zynqmp_firmware_of_match, + }, + .probe = zynqmp_firmware_probe, + .remove = zynqmp_firmware_remove, +}; +module_platform_driver(zynqmp_firmware_driver); diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h new file mode 100644 index 0000000..cb63bed --- /dev/null +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -0,0 +1,63 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Xilinx Zynq MPSoC Firmware layer + * + * Copyright (C) 2014-2018 Xilinx + * + * Michal Simek + * Davorin Mista + * Jolly Shah + * Rajan Vaja + */ + +#ifndef __FIRMWARE_ZYNQMP_H__ +#define __FIRMWARE_ZYNQMP_H__ + +#define ZYNQMP_PM_VERSION_MAJOR 1 +#define ZYNQMP_PM_VERSION_MINOR 0 + +#define ZYNQMP_PM_VERSION ((ZYNQMP_PM_VERSION_MAJOR << 16) | \ + ZYNQMP_PM_VERSION_MINOR) + +#define ZYNQMP_TZ_VERSION_MAJOR 1 +#define ZYNQMP_TZ_VERSION_MINOR 0 + +#define ZYNQMP_TZ_VERSION ((ZYNQMP_TZ_VERSION_MAJOR << 16) | \ + ZYNQMP_TZ_VERSION_MINOR) + +/* SMC SIP service Call Function Identifier Prefix */ +#define PM_SIP_SVC 0xC2000000 +#define PM_GET_TRUSTZONE_VERSION 0xa03 + +/* Number of 32bits values in payload */ +#define PAYLOAD_ARG_CNT 4U + +enum pm_api_id { + PM_GET_API_VERSION = 1, +}; + +/* PMU-FW return status codes */ +enum pm_ret_status { + XST_PM_SUCCESS = 0, + XST_PM_INTERNAL = 2000, + XST_PM_CONFLICT, + XST_PM_NO_ACCESS, + XST_PM_INVALID_NODE, + XST_PM_DOUBLE_REQ, + XST_PM_ABORT_SUSPEND, +}; + +struct zynqmp_eemi_ops { + int (*get_api_version)(u32 *version); +}; + +#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 NULL; +} +#endif + +#endif /* __FIRMWARE_ZYNQMP_H__ */ From patchwork Wed Sep 12 19:38:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 10598205 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5919F15E2 for ; Wed, 12 Sep 2018 19:43:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4618B2AA7C for ; Wed, 12 Sep 2018 19:43:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 398AE2AA99; Wed, 12 Sep 2018 19:43:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 89FAA2AA7C for ; Wed, 12 Sep 2018 19:43:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TsgPfwe/Ljsd4Swm0Me4rc0b/sUjEbjjyJRkslHIeCo=; b=Pz6kI15X+CbVDq msyFzb0bQGaYBaEwf71iEWq8X2Y84kBP8YoUj4n5bsw2+k8w9jD8qor2gMD49wDnFZUPxjfiPZN4e T30Clgzg1ICTwvvMQdYa4A/RD7mkg30SR9fvkCgvA0UI0l8AN0zVtJeBV8+irIC5yfnMfgb47v5HA tG/QGq9ZzKuzngxoUsjYNC3PF+bN0tvYxNSiQ2UsOAiY5AXw9UTSR3Q+Olrh2gRf3y1nmCNG6QlPs eGrKbRv7kZDMmPu0OTlmu39oyM/gZvevI2M1eQF4i/7bjOu6PTcygk7XBWswlarWxAgT/lgfLGY/c Tmvpv3Od2cJfOflYgyWA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0B33-0007Dm-2X; Wed, 12 Sep 2018 19:43:37 +0000 Received: from mail-dm3nam03on061e.outbound.protection.outlook.com ([2a01:111:f400:fe49::61e] helo=NAM03-DM3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0Az5-00049S-57 for linux-arm-kernel@lists.infradead.org; Wed, 12 Sep 2018 19:39:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=priKkztjrpjFLOKv4LnjLVrwKzMjFsQtifYDQFa1OkU=; b=b5Yxdsy/MAb72EpwNBgQa2fgoGE7J8c8ZYHTXOBHE3n3aIUd0QGNIaVM5NKRoUET67Xd+hWBQTpDul1P5ETIh59ImFA7MhSwClVLblLq7Ol+Re0l/PIi39AIY92c2bqBx5IC50S+pXwTli+RYPCWGoaCQIVOvRbmr7ePDmA1i7M= Received: from SN4PR0201CA0045.namprd02.prod.outlook.com (2603:10b6:803:2e::31) by BL0PR02MB4756.namprd02.prod.outlook.com (2603:10b6:208:5d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.15; Wed, 12 Sep 2018 19:39:15 +0000 Received: from SN1NAM02FT018.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::207) by SN4PR0201CA0045.outlook.office365.com (2603:10b6:803:2e::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1122.17 via Frontend Transport; Wed, 12 Sep 2018 19:39:15 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by SN1NAM02FT018.mail.protection.outlook.com (10.152.72.122) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1143.14 via Frontend Transport; Wed, 12 Sep 2018 19:39:15 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:36147 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1g0Ayo-0007VN-KZ; Wed, 12 Sep 2018 12:39:14 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g0Ayj-0001JA-H0; Wed, 12 Sep 2018 12:39:09 -0700 Received: from xsj-pvapsmtp01 (smtp3.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w8CJcwDE027618; Wed, 12 Sep 2018 12:38:58 -0700 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g0AyY-0001Go-Me; Wed, 12 Sep 2018 12:38:58 -0700 From: Jolly Shah To: , , Subject: [PATCH v12 3/6] firmware: xilinx: Add query data API Date: Wed, 12 Sep 2018 12:38:37 -0700 Message-ID: <1536781120-22794-4-git-send-email-jollys@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536781120-22794-1-git-send-email-jollys@xilinx.com> References: <1536781120-22794-1-git-send-email-jollys@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39860400002)(136003)(376002)(396003)(346002)(2980300002)(438002)(199004)(189003)(11346002)(26005)(446003)(426003)(186003)(336012)(77096007)(476003)(2616005)(486006)(72206003)(126002)(54906003)(106466001)(47776003)(478600001)(9786002)(110136005)(44832011)(2906002)(36756003)(63266004)(81156014)(316002)(6666003)(305945005)(50466002)(8936002)(51416003)(356003)(2201001)(4326008)(81166006)(5660300001)(106002)(14444005)(48376002)(8676002)(16586007)(7696005)(76176011)(50226002)(36386004)(107886003)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BL0PR02MB4756; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT018; 1:SphgYn8PEKebp4p2w/YBEhhsMJa07Be+jd486rGC/1Io9XBo+ArFl8EVdzWmDF0n2RkOF50T3m8l+m6brxRHZt002APJDRQSxCk1K9vH8Zh2qeToIYTCFZ/xI+0imYq+ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3cd55b27-4714-4d38-76d5-08d618e76c41 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060); SRVR:BL0PR02MB4756; X-Microsoft-Exchange-Diagnostics: 1; BL0PR02MB4756; 3:Gc0wkfwaGpkgxlrS0hENWuORKMj5pdA/6ujufDt01msSl6OfO8c0oWw6atWEp9UilAMBscB/90zQQvtpgeSZYsls4TOu6UGx3mg+VfWDXBbT69nX43bXOAIJZjbk2eEfg+XPnT+XTmTtEHjOLruTAhl9IiXEXsC4N4xp3ic1AlRNNVe+UjVyXMJvw8YhsexzirUMGJrxlwKXxhcULYA9E3kue6sJW/0SP2odoUqw4W9YZN3dmw4r+ifYmrOD4aTgWY5LSG5L4qiF50ME6jRj44J0eagfyMjd/oRqHqfq3nAq3En/ldQKD8myPkIwkmJApQq2ouqdTYOYmLV0L5UZC4mezwLTfHwsAtIOJyNVdJM=; 25:4Xa+YqhBUKytH/6XCmTyToQKS/v6vtOB9zy+bOfhahYEb/djzcpl0ELwMDrA1ZwNsn60RnFn5vLhB5iNXFiYMpUtl5a6AY0XZNI9OxP+L3Stl+NWZQ2AVBxInIRXTnuo1xsNmXCfLrLFdBkhyOjiiPXEUcAgurtMY89+XZldA8/m065CdFG8UYQ/mnifi8pV5zBJbEmCeA1+oEnwMk9bmOQW/o4QvQKKkgjBzB0tPH/7XWhIwIHlB8tRKpCMDV3T6RW1COMlelhMz5aXvQJHZ13ZCm0Ch6ajrKiGLy9aK/gVOhJNWNFP7w8aV8s9U6Moo5PGLNgFa6WPYj8hV3T3dQ== X-MS-TrafficTypeDiagnostic: BL0PR02MB4756: X-Microsoft-Exchange-Diagnostics: 1; BL0PR02MB4756; 31:TctqQehw2IdoR/KpEUJvRd/0V1BcNC4Q6SQR9BWMsAOCM0Xdcu095wg/eVP4peln74RbrMzxAHny9nGtal3Pj/1XIp/gHcNCgiXQMpFTv723EHNCkm3z6Ut1/RlXbDZw2oSwJut+UqWkssWPG0rZodzOjM5cRPK+ObMwcCHiVZKEpg8D0MOskvi7XmeGRZAnFaQP7vPUoIhj4EVKq96HUpwW2zeeHVNmS3pt5D0MuQg=; 20:ush2X6tCVt6onZtT3V81BT8QsYg1pIV1Xl+oN/1nLtfbpHZ+VUzSI+NGwNPdo0xxLUnkT1X3s92oVag6rXjzTSTimJJj1In2gUop9W/iQoN1l00LQZJy8NGB7259j7lwrgdxUuyaLOkUGG5/rrfOikEhiIiaoy/7v1UMzMw2iXKwk9cSoeJNlCD/pxIGQ+uTH4Kq6e0wAJYRLNHpkwDjuOhSqZg86/Hcg8810u+k6xvYN54Yn9BP79um3dgqbVWx8OdbzH4GjLuVVodk3dKKpeeoqwyfkQpnC7JrXbzsLwHR5Iy1+eRe+WgJtb0mj7QR7T1gQ+4PdNs6s/vJP0IZd3nN/G9jBmLi78qxEfv0iN6VrlHeIFQnnZB2g2vqM+gJC5zB8ac6OaygMZYjTxwzuzbggM+9QUgcPWOV0Y/DK+QmOjwv/3ATX9o5q6iLZ3T81IfGfRkF60lN1zL4KPynSjB9Ix/YnmPMz2zw0mkedOmIsJJ1i3IvYHZEs2bMQXzL X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231311)(944501410)(52105095)(93006095)(93004095)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(201708071742011)(7699050); SRVR:BL0PR02MB4756; BCL:0; PCL:0; RULEID:; SRVR:BL0PR02MB4756; X-Microsoft-Exchange-Diagnostics: 1; BL0PR02M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RTkFIN0HqeScCetAlJ5/gjtxd7El4aUm28DDNzk/vpgn7+jYlgXA1XIT/ltLozKzTeTEbfQYRx43+BCU0bAQJM0xQffRbXOJYoefPxnetBxcArZW+4RLZCeQqyYbui3ojn5S6EDeJQ4tdLnPQAaMNDkmYosVpKRXcRE9Nt8svj/Sq+c43EmJfuEe4vPKz6FahXIOAUP8EdXtk3b+omVOGHZmcWTWVUMdWYzH6G9z26g9CmV7PRvAk3Ll+UqxDhRDlsKKAxBK5Iks6Kz9YG+DoGXNmNNkjNRpHfzJQ8A3ri8Zyf6yVFGh8YTFTOy2TQK9HwBRmSxEpL0AKicHq5nIK2P/Ssm7CuGBp/Ik5eFiwdEwljQO2I1ng7ow==; 5:f2QGv3hIgPDjw2MPoeKeJnUzi9Wcvu1UgzW+wuCQmDiKd4aBFiHlaMypdif9XbJ+1NhVIx8P5GYGX+l9e/+ddhCPbw8cWo9rlUTiuM9JyMHb6CaEY48jwBkiLvIUpI5Ps3BEG/pLwDjgV+ZfX3LIPTRe4PWFaHx83CoKuoUxDmc=; 7:BAVDlPZkpS0ZcLW6r23TgDWo2JTUcLPz4A9LkwQ7tdMr5akHOIdC1phgb9jkC8XcJkd8bIiya5oT4f0tDZdlVxDzfNNNxixYlh0POs75CP2+xjkv1NbbCzoDqrJvuKxcEGd4Dwxt4imCe04qelIIOKyL1gXNVBqHwOwJo0tXx245INcn93BC7GsL7ykZ8rZs4mon/Aqod80H6Qc7NZE6tl0dXEAXsKxMufjRDMFQz//KZ168ajboJxO3k8JC3+n+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2018 19:39:15.0214 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3cd55b27-4714-4d38-76d5-08d618e76c41 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR02MB4756 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180912_123931_511568_81325B51 X-CRM114-Status: GOOD ( 10.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , 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 X-Virus-Scanned: ClamAV using ClamSMTP From: Rajan Vaja Add ZynqMP firmware query data API to query platform specific information(clocks, pins) from firmware. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/zynqmp.c | 14 ++++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 20 ++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 5bf64ac..2a333c0 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -241,8 +241,22 @@ static int get_set_conduit_method(struct device_node *np) return 0; } +/** + * zynqmp_pm_query_data() - Get query data from firmware + * @qdata: Variable to the zynqmp_pm_query_data structure + * @out: Returned output value + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out) +{ + return zynqmp_pm_invoke_fn(PM_QUERY_DATA, qdata.qid, qdata.arg1, + qdata.arg2, qdata.arg3, out); +} + static const struct zynqmp_eemi_ops eemi_ops = { .get_api_version = zynqmp_pm_get_api_version, + .query_data = zynqmp_pm_query_data, }; /** diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index cb63bed..287f42c 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -34,6 +34,7 @@ enum pm_api_id { PM_GET_API_VERSION = 1, + PM_QUERY_DATA = 35, }; /* PMU-FW return status codes */ @@ -47,8 +48,27 @@ enum pm_ret_status { XST_PM_ABORT_SUSPEND, }; +enum pm_query_id { + PM_QID_INVALID, +}; + +/** + * struct zynqmp_pm_query_data - PM query data + * @qid: query ID + * @arg1: Argument 1 of query data + * @arg2: Argument 2 of query data + * @arg3: Argument 3 of query data + */ +struct zynqmp_pm_query_data { + u32 qid; + u32 arg1; + u32 arg2; + u32 arg3; +}; + struct zynqmp_eemi_ops { int (*get_api_version)(u32 *version); + int (*query_data)(struct zynqmp_pm_query_data qdata, u32 *out); }; #if IS_REACHABLE(CONFIG_ARCH_ZYNQMP) From patchwork Wed Sep 12 19:38:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 10598201 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C747A921 for ; Wed, 12 Sep 2018 19:42:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1C8F2AA23 for ; Wed, 12 Sep 2018 19:42:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A34F02AA54; Wed, 12 Sep 2018 19:42:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CBC2F2AA23 for ; Wed, 12 Sep 2018 19:42:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=bIfel0m08X4/cr5L4yJSNgNh7TtSQV41LwbaB1lQsrw=; b=SWob9QhoRPJMdF lFYcy7hh7KRdgzIpUkr1EKoeAJVzOTj/NtZb3uMZq1EIq8z/8/TADCambUaavcxJFZDo6Es6FAUyJ ZECYKPUMPiKUtEnNPz9MIdrLVGro2kJUa788Q+4Ymk3tf3QUDiZoNXlrUI4vgvr/kmCvsXBC4Sb1X RyL60jE/7TsSz7JrMNMvHeTk6bt44Rqc2WNv96UR/8E0HzniKrBXmnDJTRBOSImd8pRFpoX2wx8fk G5Xf7DQl/SscAgRAE+wySbyXd99BkuuPj7Tl+bu4tqWD57GgJLzApz7RC06ve/RJZLne6+xevDNPq Pf8mN2vI7/mh1QCdym6A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0B27-0006sQ-QP; Wed, 12 Sep 2018 19:42:39 +0000 Received: from mail-by2nam03on0609.outbound.protection.outlook.com ([2a01:111:f400:fe4a::609] helo=NAM03-BY2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0Az4-00049P-Bv for linux-arm-kernel@lists.infradead.org; Wed, 12 Sep 2018 19:39:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4N/RXQt4pqBadGTRK/wZH83Q0bP12sILNZCnlWFzEEM=; b=vxF1mpFhBYv2pddu3vCaDk55rFa8lCcuo92jyesM8SpRauP7j0ea12OCF2TBM+5pp7rMxSL1jJefZfI9JztRgVUdEsadk0saYGGfz+c7eajYu8vFm7gqVqvAWGL4uO03rx7kt1BGtaMLEhI3Wtr7hqFxckgtJqfQkFHYStRM+Xg= Received: from SN4PR0201CA0050.namprd02.prod.outlook.com (2603:10b6:803:20::12) by BYAPR02MB4472.namprd02.prod.outlook.com (2603:10b6:a03:10::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.15; Wed, 12 Sep 2018 19:39:15 +0000 Received: from BL2NAM02FT010.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::200) by SN4PR0201CA0050.outlook.office365.com (2603:10b6:803:20::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1122.16 via Frontend Transport; Wed, 12 Sep 2018 19:39:15 +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 BL2NAM02FT010.mail.protection.outlook.com (10.152.77.53) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1143.14 via Frontend Transport; Wed, 12 Sep 2018 19:39:14 +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 1g0Ayo-0002S9-BJ; Wed, 12 Sep 2018 12:39:14 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g0Ayj-0001JA-7l; Wed, 12 Sep 2018 12:39:09 -0700 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 w8CJcwm2003385; Wed, 12 Sep 2018 12:38:59 -0700 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g0AyY-0001Go-OX; Wed, 12 Sep 2018 12:38:58 -0700 From: Jolly Shah To: , , Subject: [PATCH v12 4/6] firmware: xilinx: Add clock APIs Date: Wed, 12 Sep 2018 12:38:38 -0700 Message-ID: <1536781120-22794-5-git-send-email-jollys@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536781120-22794-1-git-send-email-jollys@xilinx.com> References: <1536781120-22794-1-git-send-email-jollys@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(346002)(376002)(2980300002)(438002)(189003)(199004)(336012)(305945005)(6666003)(76176011)(8936002)(7696005)(106002)(8676002)(26005)(50466002)(106466001)(51416003)(50226002)(110136005)(54906003)(186003)(47776003)(77096007)(48376002)(63266004)(36386004)(81166006)(36756003)(2906002)(4326008)(316002)(107886003)(81156014)(446003)(16586007)(2616005)(9786002)(5660300001)(476003)(426003)(11346002)(478600001)(44832011)(356003)(72206003)(126002)(486006)(2201001)(14444005)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR02MB4472; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT010; 1:MigewVT5LOozU1wOEuyJrkfH8i3BKIIGw/PNhGuxzDosA6wPAK59QNBTB2J1g+IoJsRSUTs0+xV47T73frzLHUs7L/MJrZxtliLDVXAN1RX29julD82dX/Q5d8Ql9YO6 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1e3374f2-44e6-4620-4390-08d618e76c3c X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060); SRVR:BYAPR02MB4472; X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB4472; 3:g77OE/xULxCNdkMspXdvBmHMAH+3QwYiONmGlcSKuL1AgaMYBb/MPPEh85yRit0TIoXTZqbC8+u0zNQR785XCiNANFhzVp5e9NUgdeo96iSLWl9FdpvnnPKtVwfjytJppUXSZGh5rl5kJD1uHe07Mn18xZVtzYaefm80CbyQ+lX3ffIhs3JrriW8+TgifdS9dFQPvdGBQZymr+OHpfemv1AOnLOKu3nip/Hfv2q2pVReEx4IxZlkxD5adk1e7u6cgTGsAMeJyqKDn3J94ralGnmvl8B3uJBzqM8W6AurooCe5ig/Dxs/CdOGc8ObmLR3ZpIhYKoN6d8T45WXiSO4ftwASQzmR50qMp0Ci3AfKuI=; 25:8U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EN0X9pk1c1DrFOnFwuV+8er8ZWx857qrpFnRcJIVOd5qZZrxq9xhO5sn/RgrhokmY8+gihQu9r2Hr7pNO47RF X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93004095)(3002001)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(201708071742011)(7699050); SRVR:BYAPR02MB4472; BCL:0; PCL:0; RULEID:; SRVR:BYAPR02MB4472; X-Microsoft-Exchange-Diagnostics: 1; BYAPR02MB4472; 4:Ki3JtH10o5V/7ptzc79H1jFNgwOgNDD1K9kSbPq6uEte8ddBWXJwH9spZKp1Ojf3jCpZ2GB0eEeKqGm+BS/JTVkoeb/YXENNP4OTdeADbf+HP1O7Eh/w2vw6xSpAWCgmj0Y2Iz5G/ctlL+ozfGkyqvzRH/JunKM+k7Aw4RXgiNy4P74lttuLEuQXunUusF7oFazy6fp9otEUF6mU0k0vHBweJ9UP8S5RzrSRrZ6T3un3L1oSvigrxnNESX7MYecWdmvYsLblE4xsZyOYc9d9DvEC1O4C6WvdQ5oh1PGZ6+WOHBzi7tWfnlhYm5beH7yh X-Forefront-PRVS: 07935ACF08 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BYAPR02MB4472; 23:fr9ATjmPAbhGuqGhAmj9lBRN1OUX1E0DsUkkYnVc1?= cVWNbvRlG0K/yy13hJ3hAJopTRrMyKa7canIs28M7Z50L10bfzA0QQTL3jNLlnginJoL8FnzQxUJv3NIW+Zo66HugVfHNIws76c0fDphZCKxkRBpyQCSp4IMNg9/uyIgROcF5kdfAl13jsKaC5ZBlG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joEggRkdHkbpfZx30cqdLzZnu20o1W+rp5RRXZOzqiKSzIUsUlp0DNPVuqxz4wuxzp+aP0UfpIpnEvyQxHaf+7RtNcvDLx9kYeXJv12tGWPTaQ8YRTl+lVSqlQ3sVhcyROWTBH8PmV8xUTjVnUTV2nNS8GxBK5MpXUGSosQ7JDdRtoWWr/MBpV SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2018 19:39:14.9092 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1e3374f2-44e6-4620-4390-08d618e76c3c 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: BYAPR02MB4472 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180912_123930_730782_B8FE9FAE X-CRM114-Status: GOOD ( 11.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , 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 X-Virus-Scanned: ClamAV using ClamSMTP From: Rajan Vaja Add clock APIs to control clocks through firmware interface. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/zynqmp.c | 186 ++++++++++++++++++++++++++++++++++- include/linux/firmware/xlnx-zynqmp.h | 30 ++++++ 2 files changed, 214 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 2a333c0..697f4fa 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -250,13 +250,195 @@ static int get_set_conduit_method(struct device_node *np) */ static int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out) { - return zynqmp_pm_invoke_fn(PM_QUERY_DATA, qdata.qid, qdata.arg1, - qdata.arg2, qdata.arg3, out); + int ret; + + ret = zynqmp_pm_invoke_fn(PM_QUERY_DATA, qdata.qid, qdata.arg1, + qdata.arg2, qdata.arg3, out); + + /* + * For clock name query, all bytes in SMC response are clock name + * characters and return code is always success. For invalid clocks, + * clock name bytes would be zeros. + */ + return qdata.qid == PM_QID_CLOCK_GET_NAME ? 0 : ret; +} + +/** + * zynqmp_pm_clock_enable() - Enable the clock for given id + * @clock_id: ID of the clock to be enabled + * + * This function is used by master to enable the clock + * including peripherals and PLL clocks. + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_clock_enable(u32 clock_id) +{ + return zynqmp_pm_invoke_fn(PM_CLOCK_ENABLE, clock_id, 0, 0, 0, NULL); +} + +/** + * zynqmp_pm_clock_disable() - Disable the clock for given id + * @clock_id: ID of the clock to be disable + * + * This function is used by master to disable the clock + * including peripherals and PLL clocks. + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_clock_disable(u32 clock_id) +{ + return zynqmp_pm_invoke_fn(PM_CLOCK_DISABLE, clock_id, 0, 0, 0, NULL); +} + +/** + * zynqmp_pm_clock_getstate() - Get the clock state for given id + * @clock_id: ID of the clock to be queried + * @state: 1/0 (Enabled/Disabled) + * + * This function is used by master to get the state of clock + * including peripherals and PLL clocks. + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state) +{ + u32 ret_payload[PAYLOAD_ARG_CNT]; + int ret; + + ret = zynqmp_pm_invoke_fn(PM_CLOCK_GETSTATE, clock_id, 0, + 0, 0, ret_payload); + *state = ret_payload[1]; + + return ret; +} + +/** + * zynqmp_pm_clock_setdivider() - Set the clock divider for given id + * @clock_id: ID of the clock + * @divider: divider value + * + * This function is used by master to set divider for any clock + * to achieve desired rate. + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_clock_setdivider(u32 clock_id, u32 divider) +{ + return zynqmp_pm_invoke_fn(PM_CLOCK_SETDIVIDER, clock_id, divider, + 0, 0, NULL); +} + +/** + * zynqmp_pm_clock_getdivider() - Get the clock divider for given id + * @clock_id: ID of the clock + * @divider: divider value + * + * This function is used by master to get divider values + * for any clock. + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider) +{ + u32 ret_payload[PAYLOAD_ARG_CNT]; + int ret; + + ret = zynqmp_pm_invoke_fn(PM_CLOCK_GETDIVIDER, clock_id, 0, + 0, 0, ret_payload); + *divider = ret_payload[1]; + + return ret; +} + +/** + * zynqmp_pm_clock_setrate() - Set the clock rate for given id + * @clock_id: ID of the clock + * @rate: rate value in hz + * + * This function is used by master to set rate for any clock. + * + * Return: Returns status, either success or error+reason + */ +static 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); +} + +/** + * zynqmp_pm_clock_getrate() - Get the clock rate for given id + * @clock_id: ID of the clock + * @rate: rate value in hz + * + * This function is used by master to get rate + * for any clock. + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_clock_getrate(u32 clock_id, u64 *rate) +{ + u32 ret_payload[PAYLOAD_ARG_CNT]; + int ret; + + ret = zynqmp_pm_invoke_fn(PM_CLOCK_GETRATE, clock_id, 0, + 0, 0, ret_payload); + *rate = ((u64)ret_payload[2] << 32) | ret_payload[1]; + + return ret; +} + +/** + * zynqmp_pm_clock_setparent() - Set the clock parent for given id + * @clock_id: ID of the clock + * @parent_id: parent id + * + * This function is used by master to set parent for any clock. + * + * Return: Returns status, either success or error+reason + */ +static 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); +} + +/** + * zynqmp_pm_clock_getparent() - Get the clock parent for given id + * @clock_id: ID of the clock + * @parent_id: parent id + * + * This function is used by master to get parent index + * for any clock. + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id) +{ + u32 ret_payload[PAYLOAD_ARG_CNT]; + int ret; + + ret = zynqmp_pm_invoke_fn(PM_CLOCK_GETPARENT, clock_id, 0, + 0, 0, ret_payload); + *parent_id = ret_payload[1]; + + return ret; } static const struct zynqmp_eemi_ops eemi_ops = { .get_api_version = zynqmp_pm_get_api_version, .query_data = zynqmp_pm_query_data, + .clock_enable = zynqmp_pm_clock_enable, + .clock_disable = zynqmp_pm_clock_disable, + .clock_getstate = zynqmp_pm_clock_getstate, + .clock_setdivider = zynqmp_pm_clock_setdivider, + .clock_getdivider = zynqmp_pm_clock_getdivider, + .clock_setrate = zynqmp_pm_clock_setrate, + .clock_getrate = zynqmp_pm_clock_getrate, + .clock_setparent = zynqmp_pm_clock_setparent, + .clock_getparent = zynqmp_pm_clock_getparent, }; /** diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 287f42c..015e130 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -35,6 +35,15 @@ enum pm_api_id { PM_GET_API_VERSION = 1, PM_QUERY_DATA = 35, + PM_CLOCK_ENABLE, + PM_CLOCK_DISABLE, + PM_CLOCK_GETSTATE, + PM_CLOCK_SETDIVIDER, + PM_CLOCK_GETDIVIDER, + PM_CLOCK_SETRATE, + PM_CLOCK_GETRATE, + PM_CLOCK_SETPARENT, + PM_CLOCK_GETPARENT, }; /* PMU-FW return status codes */ @@ -48,8 +57,20 @@ enum pm_ret_status { XST_PM_ABORT_SUSPEND, }; +enum pm_ioctl_id { + IOCTL_SET_PLL_FRAC_MODE = 8, + IOCTL_GET_PLL_FRAC_MODE, + IOCTL_SET_PLL_FRAC_DATA, + IOCTL_GET_PLL_FRAC_DATA, +}; + enum pm_query_id { PM_QID_INVALID, + PM_QID_CLOCK_GET_NAME, + PM_QID_CLOCK_GET_TOPOLOGY, + PM_QID_CLOCK_GET_FIXEDFACTOR_PARAMS, + PM_QID_CLOCK_GET_PARENTS, + PM_QID_CLOCK_GET_ATTRIBUTES, }; /** @@ -69,6 +90,15 @@ struct zynqmp_pm_query_data { struct zynqmp_eemi_ops { int (*get_api_version)(u32 *version); 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); + 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); + int (*clock_setparent)(u32 clock_id, u32 parent_id); + int (*clock_getparent)(u32 clock_id, u32 *parent_id); }; #if IS_REACHABLE(CONFIG_ARCH_ZYNQMP) From patchwork Wed Sep 12 19:38:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 10598239 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CB01014BD for ; Wed, 12 Sep 2018 19:45:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B5DF22AA7C for ; Wed, 12 Sep 2018 19:45:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9FC92AA99; Wed, 12 Sep 2018 19:45:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8E1E82AA88 for ; Wed, 12 Sep 2018 19:45:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JdLL9Exnmas5hMziyOaggYI6jh1Et08F6xywtTSMb9c=; b=mPhvvinpMFjuN5 CG/9BGXsuOVHCq66SePYAHktfQA+cgGQjTKsn1q0yD+r5nON50wr/92B0HaiUInvG1LaqqN5u0Qqi i191Yqd/Z+CmyitK5923RaNVcJ0oXotiIdhdYPe8Ow0B2YwXjURkRHR5wwVSk70xJmXjjVXXiJQgR zqP730pg+Q+436/dKOO+CrpV3y9JrBWHPivm0RIrImB4+9ttWCdv7nRGIv+tSvwE5+CqabbZk6dF2 WJ/mp0XhZarCsNRyh3lp3g1mPmbtBy/cW1tliKg90VRIKb2inIY1wpXrGdj9/+Z6Qp4o1mUZ0Q+Xn omsKlCEwcqwCa79lR2qQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0B4Z-0007ti-9O; Wed, 12 Sep 2018 19:45:11 +0000 Received: from mail-sn1nam04on0619.outbound.protection.outlook.com ([2a01:111:f400:fe4c::619] helo=NAM04-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0AzB-00049E-RQ for linux-arm-kernel@lists.infradead.org; Wed, 12 Sep 2018 19:39:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mXpnrGnim5InV89BSoJZhSpBah3sYxg5WMt3C4OkFW4=; b=zynxL1DYurjOUNQHgTr/ug7pjpzz7kHcx4PMIej9WNey4Q3qq4ScpOxRxGAgVGC2Jo9jJslxJxpEBCBN5LB/Dx9Y1/7Bsst77JVwsL1k1WevvxJo2v2u91wdfo8ppygnzP6QsndUUsZUS14AYPSvxoYUx24XvMO7CyekuLFw0rg= Received: from BN7PR02CA0008.namprd02.prod.outlook.com (2603:10b6:408:20::21) by BN7PR02MB5107.namprd02.prod.outlook.com (2603:10b6:408:22::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.17; Wed, 12 Sep 2018 19:39:15 +0000 Received: from BL2NAM02FT009.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::209) by BN7PR02CA0008.outlook.office365.com (2603:10b6:408:20::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1122.15 via Frontend Transport; Wed, 12 Sep 2018 19:39:15 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by BL2NAM02FT009.mail.protection.outlook.com (10.152.77.68) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1143.14 via Frontend Transport; Wed, 12 Sep 2018 19:39:15 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:36150 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1g0Ayo-0007VO-M1; Wed, 12 Sep 2018 12:39:14 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g0Ayj-0001JA-IT; Wed, 12 Sep 2018 12:39:09 -0700 Received: from xsj-pvapsmtp01 (mailman.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w8CJcwwI027620; Wed, 12 Sep 2018 12:38:59 -0700 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g0AyY-0001Go-Qa; Wed, 12 Sep 2018 12:38:58 -0700 From: Jolly Shah To: , , Subject: [PATCH v12 5/6] firmware: xilinx: Add debugfs interface Date: Wed, 12 Sep 2018 12:38:39 -0700 Message-ID: <1536781120-22794-6-git-send-email-jollys@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536781120-22794-1-git-send-email-jollys@xilinx.com> References: <1536781120-22794-1-git-send-email-jollys@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(376002)(136003)(39860400002)(396003)(2980300002)(438002)(189003)(199004)(106002)(316002)(16586007)(54906003)(110136005)(72206003)(76176011)(966005)(478600001)(7696005)(51416003)(63266004)(50226002)(106466001)(36756003)(8936002)(14444005)(9786002)(476003)(36386004)(44832011)(81156014)(305945005)(2906002)(2201001)(81166006)(446003)(11346002)(2616005)(50466002)(126002)(426003)(336012)(6666003)(5660300001)(486006)(48376002)(186003)(4326008)(107886003)(26005)(356003)(77096007)(8676002)(6306002)(47776003)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN7PR02MB5107; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; LANG:en; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT009; 1:yhqx/HO1F1V5D7AzGZpN7J3XcjiRQjToT6C7mzNIkheKSVgOKpTysQNwHStX5X8daVwfXPG/bbUqxBZVZKxZTDapv8KgsHozsqmOWQiVKNh6QmcL7tMzqnVEzQ0SPPYc MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 417a46a6-19f8-4c6a-6e24-08d618e76c6a X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060); SRVR:BN7PR02MB5107; X-Microsoft-Exchange-Diagnostics: 1; BN7PR02MB5107; 3:etVam2NCcPmBiHeHja18ae3azx6/Yh9gdbnQRsotARewcvZEgiTXyAd77TPA4lMySEMfLuZa/KKGS8Lf77h5c+ROYqs6kRgkfRc2gjmIfMaUlon5+X4ztLBkOcB24INNFeRLEDlXnLGZg7Js/Ksfi1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vyA6rf6Wc7sR5oBH9+F+WxjM4Ta/DwFoDLX2WlrfFxSGtcSwc+RpZ8B7ATopBw9BRJ+svcQPa7wEDGG0g1XrOj1S0r7A6ROYx5AEx3uovn7Nue2TMjTiAVRAg1ijxBBgY2rAcHdoHHjN0kFXGwV4qz70HJtUuWDIZgu4cZgXiB2hygrB7RoWurkqDcQO/B5KB/1aT+viQSC6IOM6tPu3IgZD5DCr3NKRgloxwZRMTRu7yFGPUWQomq1ZRN1etyAgrBYL1Smy/RLhLINuuvKUyZqwzN/0lcM+l X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592)(189271028609987); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(10201501046)(3002001)(93006095)(93004095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699050); SRVR:BN7PR02MB5107; BCL:0; PCL:0; RULEID:; SRVR:BN7PR02MB5107; X-Microsoft-Exchange-Diagnostics: 1; BN7PR02MB5107; 4:xzmLyPpbcpfcpQmlv42PaxwhbHpjWozCIw6LnHwHD+JQDv4jxPnYM7GV/wjmtrnjBbD8M7fJdgKPmC3dpAMe23FfjajLU7sZVIMq1iSEN6Oxb/pgc98gmpPtOXmmXCVWD3ewQ5iEnY3YbX0EuPTGHHZY8C85zRPqIY5MfcnYAzB4c+nI9OW7Vxr/jGmuAtsxBz8FxspQ8Kkiz2KLEyb7baZn8WEEZYOiRN7rXDgNBTdr0k6O6KCjeg8ZDlnOsA8wrX//4ssKypBQts+dJjLLAvqb6XpetCFi7xDw5HfmdI0b9r24pSFQ4JINtNCOmPL3jI3bdQN4QTFCajE3TRm7ncGhK0EhKGkKEwQdva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ySyhzEpFpmh68BAeyYGFuFrB1Sb6bOe3jZAgGfD1wmhUeNSYzYe5Rog1p5C6nw==; 5:4sVG8q+v326wG2aGocYjtH4OZgAnQtimPsrw9NMWvwH+BHTYTK4Mo1OZyjp0VNESE4ye3L33+orvUAyu+vf9zuykbVg5C5sxNzcU3jB9OobSgkRH1zh/PfWH/hdIa+QQMc0zXep6aA7HtAjVQj0emn9Vu/QrSwnU2SFBZdG+VtI=; 7:3qoNz9+vNJiWHwnrFayHteRB4F56H9I8Pla+n8VXYOHgaa8b8DGONYZkzuazNrlT3MSDTGqNRe8MhrSlgeCjwn/AKPl47wTIL4pNs2Y+kxYvtFQZOy/UkshYhFMBY1aShFZaS1AbQrd1pHaVkndEiU7Jf1XA3TSy8ZQ3AFKtgDq/+gxYYJJj9NyBfOs++o+D9X8zE4YN4j+5oByrRjJKcySc79toK9Q4NmRRtnZagimZdq24v70FSHR5HzAbIwkE SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2018 19:39:15.1961 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 417a46a6-19f8-4c6a-6e24-08d618e76c6a X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR02MB5107 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180912_123937_988599_B165C792 X-CRM114-Status: GOOD ( 16.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , 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 X-Virus-Scanned: ClamAV using ClamSMTP From: Rajan Vaja Firmware-debug provides debugfs interface to all APIs. Debugfs can be used to call firmware APIs with required parameters. Usage: * Calling firmware API through debugfs: # echo " .. " > /sys/.../zynqmp-firmware/pm * Read output of last called firmware API: # cat /sys/.../zynqmp-firmware/pm Refer ug1200 for more information on these APIs: * https://www.xilinx.com/support/documentation/user_guides/ug1200-eemi-api.pdf Add basic debugfs file to get API version. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/Kconfig | 7 ++ drivers/firmware/xilinx/Makefile | 1 + drivers/firmware/xilinx/zynqmp-debug.c | 222 +++++++++++++++++++++++++++++++++ drivers/firmware/xilinx/zynqmp-debug.h | 24 ++++ drivers/firmware/xilinx/zynqmp.c | 5 + 5 files changed, 259 insertions(+) create mode 100644 drivers/firmware/xilinx/zynqmp-debug.c create mode 100644 drivers/firmware/xilinx/zynqmp-debug.h diff --git a/drivers/firmware/xilinx/Kconfig b/drivers/firmware/xilinx/Kconfig index 64d976e..8f44b9c 100644 --- a/drivers/firmware/xilinx/Kconfig +++ b/drivers/firmware/xilinx/Kconfig @@ -13,4 +13,11 @@ config ZYNQMP_FIRMWARE Say yes to enable ZynqMP firmware interface driver. If in doubt, say N. +config ZYNQMP_FIRMWARE_DEBUG + bool "Enable Xilinx Zynq MPSoC firmware debug APIs" + depends on ZYNQMP_FIRMWARE && DEBUG_FS + help + Say yes to enable ZynqMP firmware interface debug APIs. + If in doubt, say N. + endmenu diff --git a/drivers/firmware/xilinx/Makefile b/drivers/firmware/xilinx/Makefile index 29f7bf2..875a537 100644 --- a/drivers/firmware/xilinx/Makefile +++ b/drivers/firmware/xilinx/Makefile @@ -2,3 +2,4 @@ # Makefile for Xilinx firmwares obj-$(CONFIG_ZYNQMP_FIRMWARE) += zynqmp.o +obj-$(CONFIG_ZYNQMP_FIRMWARE_DEBUG) += zynqmp-debug.o diff --git a/drivers/firmware/xilinx/zynqmp-debug.c b/drivers/firmware/xilinx/zynqmp-debug.c new file mode 100644 index 0000000..d65cfd2 --- /dev/null +++ b/drivers/firmware/xilinx/zynqmp-debug.c @@ -0,0 +1,222 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Xilinx Zynq MPSoC Firmware layer for debugfs APIs + * + * Copyright (C) 2014-2018 Xilinx, Inc. + * + * Michal Simek + * Davorin Mista + * Jolly Shah + * Rajan Vaja + */ + +#include +#include +#include +#include +#include + +#include +#include "zynqmp-debug.h" + +#define PM_API_NAME_LEN 50 + +struct pm_api_info { + u32 api_id; + char api_name[PM_API_NAME_LEN]; + char api_name_len; +}; + +static char debugfs_buf[PAGE_SIZE]; + +#define PM_API(id) {id, #id, strlen(#id)} +static struct pm_api_info pm_api_list[] = { + PM_API(PM_GET_API_VERSION), +}; + +struct dentry *firmware_debugfs_root; + +/** + * zynqmp_pm_argument_value() - Extract argument value from a PM-API request + * @arg: Entered PM-API argument in string format + * + * Return: Argument value in unsigned integer format on success + * 0 otherwise + */ +static u64 zynqmp_pm_argument_value(char *arg) +{ + u64 value; + + if (!arg) + return 0; + + if (!kstrtou64(arg, 0, &value)) + return value; + + return 0; +} + +/** + * get_pm_api_id() - Extract API-ID from a PM-API request + * @pm_api_req: Entered PM-API argument in string format + * @pm_id: API-ID + * + * Return: 0 on success else error code + */ +static int get_pm_api_id(char *pm_api_req, u32 *pm_id) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(pm_api_list) ; i++) { + if (!strncasecmp(pm_api_req, pm_api_list[i].api_name, + pm_api_list[i].api_name_len)) { + *pm_id = pm_api_list[i].api_id; + break; + } + } + + /* If no name was entered look for PM-API ID instead */ + if (i == ARRAY_SIZE(pm_api_list) && kstrtouint(pm_api_req, 10, pm_id)) + return -EINVAL; + + return 0; +} + +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; + + if (!eemi_ops) + return -ENXIO; + + switch (pm_id) { + case PM_GET_API_VERSION: + ret = eemi_ops->get_api_version(&pm_api_version); + sprintf(debugfs_buf, "PM-API Version = %d.%d\n", + pm_api_version >> 16, pm_api_version & 0xffff); + break; + default: + sprintf(debugfs_buf, "Unsupported PM-API request\n"); + ret = -EINVAL; + } + + return ret; +} + +/** + * zynqmp_pm_debugfs_api_write() - debugfs write function + * @file: User file + * @ptr: User entered PM-API string + * @len: Length of the userspace buffer + * @off: Offset within the file + * + * Used for triggering pm api functions by writing + * echo > /sys/kernel/debug/zynqmp_pm/power or + * echo > /sys/kernel/debug/zynqmp_pm/power + * + * Return: Number of bytes copied if PM-API request succeeds, + * the corresponding error code otherwise + */ +static ssize_t zynqmp_pm_debugfs_api_write(struct file *file, + const char __user *ptr, size_t len, + loff_t *off) +{ + char *kern_buff, *tmp_buff; + char *pm_api_req; + u32 pm_id = 0; + u64 pm_api_arg[4] = {0, 0, 0, 0}; + /* Return values from PM APIs calls */ + u32 pm_api_ret[4] = {0, 0, 0, 0}; + + int ret; + int i = 0; + + strcpy(debugfs_buf, ""); + + if (*off != 0 || len == 0) + return -EINVAL; + + kern_buff = kzalloc(len, GFP_KERNEL); + if (!kern_buff) + return -ENOMEM; + + tmp_buff = kern_buff; + + ret = strncpy_from_user(kern_buff, ptr, len); + if (ret < 0) { + ret = -EFAULT; + goto err; + } + + /* Read the API name from a user request */ + pm_api_req = strsep(&kern_buff, " "); + + ret = get_pm_api_id(pm_api_req, &pm_id); + if (ret < 0) + goto err; + + /* Read node_id and arguments from the PM-API request */ + pm_api_req = strsep(&kern_buff, " "); + while ((i < ARRAY_SIZE(pm_api_arg)) && pm_api_req) { + pm_api_arg[i++] = zynqmp_pm_argument_value(pm_api_req); + pm_api_req = strsep(&kern_buff, " "); + } + + ret = process_api_request(pm_id, pm_api_arg, pm_api_ret); + +err: + kfree(tmp_buff); + if (ret) + return ret; + + return len; +} + +/** + * zynqmp_pm_debugfs_api_read() - debugfs read function + * @file: User file + * @ptr: Requested pm_api_version string + * @len: Length of the userspace buffer + * @off: Offset within the file + * + * Return: Length of the version string on success + * else error code + */ +static ssize_t zynqmp_pm_debugfs_api_read(struct file *file, char __user *ptr, + size_t len, loff_t *off) +{ + return simple_read_from_buffer(ptr, len, off, debugfs_buf, + strlen(debugfs_buf)); +} + +/* Setup debugfs fops */ +static const struct file_operations fops_zynqmp_pm_dbgfs = { + .owner = THIS_MODULE, + .write = zynqmp_pm_debugfs_api_write, + .read = zynqmp_pm_debugfs_api_read, +}; + +/** + * zynqmp_pm_api_debugfs_init - Initialize debugfs interface + * + * Return: None + */ +void zynqmp_pm_api_debugfs_init(void) +{ + /* Initialize debugfs interface */ + firmware_debugfs_root = debugfs_create_dir("zynqmp-firmware", NULL); + debugfs_create_file("pm", 0660, firmware_debugfs_root, NULL, + &fops_zynqmp_pm_dbgfs); +} + +/** + * zynqmp_pm_api_debugfs_exit - Remove debugfs interface + * + * Return: None + */ +void zynqmp_pm_api_debugfs_exit(void) +{ + debugfs_remove_recursive(firmware_debugfs_root); +} diff --git a/drivers/firmware/xilinx/zynqmp-debug.h b/drivers/firmware/xilinx/zynqmp-debug.h new file mode 100644 index 0000000..9929f8b --- /dev/null +++ b/drivers/firmware/xilinx/zynqmp-debug.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Xilinx Zynq MPSoC Firmware layer + * + * Copyright (C) 2014-2018 Xilinx + * + * Michal Simek + * Davorin Mista + * Jolly Shah + * Rajan Vaja + */ + +#ifndef __FIRMWARE_ZYNQMP_DEBUG_H__ +#define __FIRMWARE_ZYNQMP_DEBUG_H__ + +#if IS_REACHABLE(CONFIG_ZYNQMP_FIRMWARE_DEBUG) +void zynqmp_pm_api_debugfs_init(void); +void zynqmp_pm_api_debugfs_exit(void); +#else +static inline void zynqmp_pm_api_debugfs_init(void) { } +static inline void zynqmp_pm_api_debugfs_exit(void) { } +#endif + +#endif /* __FIRMWARE_ZYNQMP_DEBUG_H__ */ diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 697f4fa..84b3fd2 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -21,6 +21,7 @@ #include #include +#include "zynqmp-debug.h" /** * zynqmp_pm_ret_code() - Convert PMU-FW error codes to Linux error codes @@ -493,11 +494,15 @@ 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); + zynqmp_pm_api_debugfs_init(); + return of_platform_populate(dev->of_node, NULL, NULL, dev); } static int zynqmp_firmware_remove(struct platform_device *pdev) { + zynqmp_pm_api_debugfs_exit(); + return 0; } From patchwork Wed Sep 12 19:38:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jolly Shah X-Patchwork-Id: 10598199 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A90F515E2 for ; Wed, 12 Sep 2018 19:42:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94F352AA23 for ; Wed, 12 Sep 2018 19:42:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 88C432AA54; Wed, 12 Sep 2018 19:42:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BDF4B2AA23 for ; Wed, 12 Sep 2018 19:42:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=B/6e28eQTL1SMbL0ocgv2PdgjcmAD0H+Sq4hVTYL+u8=; b=mCww/Ci0p+j/Cy Xw5eUGAK/p+skyuhra+Kixbsbqv5QB4rXKqoqk+My6yAXtNcNMP+r4DmJP/7BQt/IonaVxsQN16Q1 bx6O8+gXN+mDbeHI2lq0MjVeyn/ARh0mEatj1RvEE2vrsN2D4ahsPhcdF2KtFMOc+WlYIF9028ltg /dCEFhEY1JJu0sSGEOqFxtZeE+79D1R8tM2mhOvt0isV7WuMju8R/Fvb1DCG60l3P2xEmcNW0l6cA xhYfeB0gzlVZQ+Snox2a84BQHl6nxcS7SMjbITNJTT+oRAZBK6/ZPpSF+M3GLwr/uHdWOglXFnIIY fvfNn6Lyz/FZBoGhRFBg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0B1O-0006bv-QN; Wed, 12 Sep 2018 19:41:54 +0000 Received: from mail-bn3nam01on060b.outbound.protection.outlook.com ([2a01:111:f400:fe41::60b] helo=NAM01-BN3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0Az4-00049L-Al for linux-arm-kernel@lists.infradead.org; Wed, 12 Sep 2018 19:39:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9UNsEm6qWM+BLviGUoFqUWQWsLdlhA6BgENc7GMAhoA=; b=WZhJXY9ejzMQmSVyGrDCE7OmOxLQeE6tdKT+KRc8gkpTvh0JbEaYBnhIuHVJJ/y0g2ieCNujBsfkAnjm3EfuqVp9HVVH3Y2L/oDw2qdsaVnPoiu5iXVOvFxoDZvsohcnKay83TpwdO2VYBMxT6PpRw3qP66g1BH9R7TWuNlFJs8= Received: from MWHPR0201CA0079.namprd02.prod.outlook.com (2603:10b6:301:75::20) by DM6PR02MB4764.namprd02.prod.outlook.com (2603:10b6:5:18::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1122.18; Wed, 12 Sep 2018 19:39:16 +0000 Received: from BL2NAM02FT047.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::208) by MWHPR0201CA0079.outlook.office365.com (2603:10b6:301:75::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1143.14 via Frontend Transport; Wed, 12 Sep 2018 19:39:15 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by BL2NAM02FT047.mail.protection.outlook.com (10.152.77.9) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1143.14 via Frontend Transport; Wed, 12 Sep 2018 19:39:15 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:36133 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1g0Ayo-0007VM-EL; Wed, 12 Sep 2018 12:39:14 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1g0Ayj-0001JA-Ax; Wed, 12 Sep 2018 12:39:09 -0700 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 w8CJcx7c027622; Wed, 12 Sep 2018 12:38:59 -0700 Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1g0AyY-0001Go-Sh; Wed, 12 Sep 2018 12:38:58 -0700 From: Jolly Shah To: , , Subject: [PATCH v12 6/6] firmware: xilinx: Add debugfs for query data API Date: Wed, 12 Sep 2018 12:38:40 -0700 Message-ID: <1536781120-22794-7-git-send-email-jollys@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536781120-22794-1-git-send-email-jollys@xilinx.com> References: <1536781120-22794-1-git-send-email-jollys@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(376002)(136003)(396003)(39860400002)(2980300002)(438002)(199004)(189003)(478600001)(4326008)(476003)(76176011)(126002)(2616005)(7696005)(51416003)(446003)(47776003)(63266004)(11346002)(106466001)(77096007)(26005)(186003)(356003)(305945005)(48376002)(36756003)(107886003)(50466002)(426003)(336012)(110136005)(316002)(54906003)(16586007)(14444005)(2906002)(72206003)(36386004)(106002)(5660300001)(44832011)(81166006)(8936002)(8676002)(50226002)(81156014)(2201001)(9786002)(6666003)(486006)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR02MB4764; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT047; 1:6zurgu81BAhXs/P776F1aD4mnK5cD07FcwZOHvtiZYI7RRngx8kUCn3IwMR31FdkmCB1LzuIttxWEilPYNh31DhmDyeMr7p3ocIlwnPYyheqFO2y06+46GA2t1ayLn3C MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b5dc3503-8383-4f94-5d6d-08d618e76c48 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060); SRVR:DM6PR02MB4764; X-Microsoft-Exchange-Diagnostics: 1; DM6PR02MB4764; 3:jAH8xX9tOg6DbLAJkOjQDprHjiPJ+vdsut2ECrhzIPV2ODVq5CELhrmeAhRshp4ZeTSTGt1r3LwV/3+l7AnH8BA18SXtwHFZe6PRpgE1thKNJSP/BSMdJrB0UWjmkWIgGuIQMWSiTHroRbek3NgTFCI3kUgzDsLYDI+rtMW8SxYZ4ndB8RMA8xlGqsjfeA0VMsCcqscTlk0Dt9kxq5ElbOfjNNFdfdp9gmoISAHuA2aPF2GLZF6ieIhbKCFuBYb3KNDO1m8wgz4dks8Z0nUxUeM9GkZnQ6hReJ+jLlIyDo5HMgo8J+8ZfU/nq1CQxplGJ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k7q4qx7htKz9lKfywhcDrIe+2VV9xGTRMG6AUJAerqt/4xPrJqtRRFGH1M1eQixWHYHYUFJnedyb7qZ8n68lAXbo+9+P1nwgAb4rY74/ioI/gHkyTLTmPNuQHyR8vv5haFONe X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93004095)(3002001)(10201501046)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201708071742011)(7699050); SRVR:DM6PR02MB4764; BCL:0; PCL:0; RULEID:; SRVR:DM6PR02MB4764; X-Microsoft-Exchange-Diagnostics: 1; DM6PR02MB4764; 4:7O/2qksPgBsnKErs4zrenf13GCtYRkmpElPiwIM19a1GKn1nPlPB8EnEPgz3a821pqEf3tyIDVlnb762KQSy8ae+opzJGgF9kwt8AuTw1N+HJz+dapeaZpGY1IuK4+ixOB4z/9ZxfDaHUftZNk7nKh9i+LY/iZ5o/GKf0wfLOfHTCnk1ei7kmhwhdGp6bJIbLK7OJNORuJsTOJbYX8b5w1O+Et+Mh+G2fCIV5icYEqKNj19Kq2rX7CmC1NBDqnSKuR6SUvFcgPveSs16pDdlvu5m3vbRvJh+Aj/6nFlu32tHk8DiMw24D3zcodxE98/r X-Forefront-PRVS: 07935ACF08 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM6PR02MB4764; 23:rZ1J/c0UFaMjhNlsOhjjB2L4YnUgrfbYHiI24bCjB?= J5+/Qs/ZhI5G0PL6eVBOvfBAm3BkyMoF4L/xYdLC1QOJTZFBVSNDQpjG30W14ym8KApoROakE6qETFNqUWBgS4alxfz6aU0teyCY6cAdZ/r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GDh6A== X-Microsoft-Antispam-Message-Info: BbfHav9OSSSOHW7FT4mTmpv92U2vpzeXPg3Zh70JEMe4wEIcuyvaTMoQoFh9NIorcHhvtPvgNsJJu6cC5HIMqKcKgAO4GaNvDZxCXa8gubK5teAbAioAKY6YydJ932EISKVzvjTuDUaFTGwJckXnFRG3rkCiIpFs/fVzfc+DB1r0fIOInknCi7hxw6rOCb963mV7BVq7rs5df/VRGvSXUUHCLtomzWpHvSGJZpsXvbW319AR/f4OppKhPPWgn1bhXl/F+fO1VbhtEIM6Jjtrrdgfyf3hhx9Ul1PN7yRGGOmZJCibNlBgSYJBAy1kqvEqR5p2agN0Wp5tMNT2dZtIZTQy04mqKENzEKnzQcEiWsM= X-Microsoft-Exchange-Diagnostics: 1; DM6PR02MB4764; 6:dHdPPJHWiEAR7pvf996yAAMuNZzcEtEQgnq07gzkiJu7dTTsochAqVvg5w8oWru5ncYRTEThajJuVvxiW+Jd3eyRFD7hKVPMpfUjTztWtGDodPpO1OYidEVzmNs1cPGIn8gOYIYgIjrT+hFjcr074cW7tBduG3/FB4DmClWRPZAzGN7rRuqRuD471WLPMuYB6jTr5r1JzkE80w5iUjETQmd/MGGPysGojpr1Y5WBAdiZEcG8dhWPnzur8u5b7HW32RbgVhLaUzv6tUtcH7aXuLzaPwKiPIuhUE+m2XZgnaksiwYWw23Z1riXuRcTzMsyIuhpU6Xp/XlvDluC++/5+awus99EQFa2YKX7v6/CAqj+U6igogJPSxA+P86GcUzfafUC3bN6QyKW/uvaz4FK+6MP494HtgvmxDVw2fZFxrdWgI1Moim3ICO0PYVCztbH8/m/zV5+u5jACD85AszHaw==; 5:HdZmiFoioELwO1fmc7b4JwRCVatzRVazqgSWJyxk71iKaMgJKmfEnTti9iDDtsQrYXjCpBOSBcHEjmPTroEluklwoqp0rBohgOtPTc4CiuyEFIIb7Wxb4E9GE5wyePXSh8rGLcdoWjL4hUgOP28rIfgiwOdiSWzdKRk0HeZkXlc=; 7:eWJdBiym2cd7khsVGxXWiKsHSPa37Hxl51f3y2T8FUYcMNcytK6/Ixlj3tQMmmBSP9b/KQw8My1fAtsnV6re0PY+7/C4fGXBjxhk0WQStPMoX9am3BMqzto4eXUbaric20HfmHWNjqxAfSstLBejazH2u2W1Tuw0NKpyi6BCJIs3dQFCgsVopRlpyO66+sz7F6Mj9ZjDEhF0cCeSRFLjQBnPki7ia8HXijIqe5IDuhcXnrvhSJbNRnIryh5AVl+b SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Sep 2018 19:39:15.0822 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b5dc3503-8383-4f94-5d6d-08d618e76c48 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB4764 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180912_123930_559846_F31CFBC5 X-CRM114-Status: GOOD ( 10.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jolly Shah , 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 X-Virus-Scanned: ClamAV using ClamSMTP From: Rajan Vaja Add debugfs file to query platform specific data from firmware using debugfs interface. Signed-off-by: Rajan Vaja Signed-off-by: Jolly Shah --- drivers/firmware/xilinx/zynqmp-debug.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/firmware/xilinx/zynqmp-debug.c b/drivers/firmware/xilinx/zynqmp-debug.c index d65cfd2..2771df6 100644 --- a/drivers/firmware/xilinx/zynqmp-debug.c +++ b/drivers/firmware/xilinx/zynqmp-debug.c @@ -32,6 +32,7 @@ static char debugfs_buf[PAGE_SIZE]; #define PM_API(id) {id, #id, strlen(#id)} static struct pm_api_info pm_api_list[] = { PM_API(PM_GET_API_VERSION), + PM_API(PM_QUERY_DATA), }; struct dentry *firmware_debugfs_root; @@ -87,6 +88,7 @@ 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}; if (!eemi_ops) return -ENXIO; @@ -97,6 +99,32 @@ static int process_api_request(u32 pm_id, u64 *pm_api_arg, u32 *pm_api_ret) sprintf(debugfs_buf, "PM-API Version = %d.%d\n", pm_api_version >> 16, pm_api_version & 0xffff); break; + case PM_QUERY_DATA: + qdata.qid = pm_api_arg[0]; + qdata.arg1 = pm_api_arg[1]; + qdata.arg2 = pm_api_arg[2]; + qdata.arg3 = pm_api_arg[3]; + + ret = eemi_ops->query_data(qdata, pm_api_ret); + if (ret) + break; + + switch (qdata.qid) { + case PM_QID_CLOCK_GET_NAME: + sprintf(debugfs_buf, "Clock name = %s\n", + (char *)pm_api_ret); + break; + case PM_QID_CLOCK_GET_FIXEDFACTOR_PARAMS: + sprintf(debugfs_buf, "Multiplier = %d, Divider = %d\n", + pm_api_ret[1], pm_api_ret[2]); + break; + default: + sprintf(debugfs_buf, + "data[0] = 0x%08x\ndata[1] = 0x%08x\n data[2] = 0x%08x\ndata[3] = 0x%08x\n", + pm_api_ret[0], pm_api_ret[1], + pm_api_ret[2], pm_api_ret[3]); + } + break; default: sprintf(debugfs_buf, "Unsupported PM-API request\n"); ret = -EINVAL;