pengqianheng / rpms / kernel

Forked from rpms/kernel 2 years ago
Clone
e336be
From patchwork Fri Aug  3 17:53:18 2018
e336be
Content-Type: text/plain; charset="utf-8"
e336be
MIME-Version: 1.0
e336be
Content-Transfer-Encoding: 7bit
e336be
X-Patchwork-Submitter: Jolly Shah <jolly.shah@xilinx.com>
e336be
X-Patchwork-Id: 10555409
e336be
Return-Path: 
e336be
 <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org>
e336be
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
e336be
 [172.30.200.125])
e336be
	by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E37DA14E2
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:05:44 +0000 (UTC)
e336be
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCD992BF36
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:05:44 +0000 (UTC)
e336be
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
e336be
	id BCB7D2C983; Fri,  3 Aug 2018 18:05:44 +0000 (UTC)
e336be
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
e336be
	pdx-wl-mail.web.codeaurora.org
e336be
X-Spam-Level: 
e336be
X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00,
e336be
	DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1
e336be
Received: from bombadil.infradead.org (bombadil.infradead.org
e336be
 [198.137.202.133])
e336be
	(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))
e336be
	(No client certificate requested)
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4BEA42BF36
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:05:44 +0000 (UTC)
e336be
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
e336be
	d=lists.infradead.org; s=bombadil.20170209; h=Sender:
e336be
	Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:
e336be
	List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:
e336be
	Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:
e336be
	Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
e336be
	List-Owner; bh=B1hjjA201jo1YdGbsOpjw0UiKXZd8LHCyv5gEinae3A=; b=JzJJ0HtnIRF/NZ
e336be
	L6ZUpLud5rO+4LXDAKFBfxxZxIEx29Crcyf2rm5rZk39dlBtKcyRjFAl+h2s1YXO/RCMsD2EHTAaq
e336be
	rSd2WibM0kXaX5RUavH7s8nevfSMOOtI3eywfYv3xiwcyETOtyuZvL1SAbjvwXANU5Zthl9XhY/RH
e336be
	X7lmEz/2CPiZPmbTfF3ipFPz8XNYsOkkbJHxPUqENqKsvishGL9yjL2IcrbdLxtV/YziN3tgDOG1r
e336be
	pAUCA0lCAxd8lFYWWXeegSYudxCDbcJkWnCmVRRFTX1LgkyTxWYuHD4K1nChJmKL4d+eJICrpQ6Tz
e336be
	4VjXbIALS6c0/T7BVi/w==;
e336be
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
e336be
	by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))
e336be
	id 1fleSM-0001Wr-5a; Fri, 03 Aug 2018 18:05:42 +0000
e336be
Received: from mail-bn3nam01on0622.outbound.protection.outlook.com
e336be
 ([2a01:111:f400:fe41::622]
e336be
 helo=NAM01-BN3-obe.outbound.protection.outlook.com)
e336be
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
e336be
 id 1fleH9-0002l4-Rc
e336be
 for linux-arm-kernel@lists.infradead.org; Fri, 03 Aug 2018 17:54:09 +0000
e336be
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
e336be
 d=xilinx.onmicrosoft.com; s=selector1-xilinx-com;
e336be
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
e336be
 bh=YJzB+KnyFKhLEmWrAsNYQ8EP3hzk/DxRcJ5zh/8+xcg=;
e336be
 b=mXk+Td1iuOAk1N7atBo6MpYVk0W+0zueHhy8hrpuFqra38bJ07s0AqfBfUIiz0ewCxWrwcS7fxXPLQ0kM9e2zOoG6lADpTRjFPvI1dJGw/kFMKyzfwqqFECFDHirr1wdOKJLICE9vcBkSBtz0gJ3N3mzus7wLUvGI2ro2jGBRYU=
e336be
Received: from BL0PR02CA0041.namprd02.prod.outlook.com (2603:10b6:207:3d::18)
e336be
 by DM6PR02MB4460.namprd02.prod.outlook.com (2603:10b6:5:29::29) with
e336be
 Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.14; Fri, 3 Aug
e336be
 2018 17:53:54 +0000
e336be
Received: from CY1NAM02FT063.eop-nam02.prod.protection.outlook.com
e336be
 (2a01:111:f400:7e45::200) by BL0PR02CA0041.outlook.office365.com
e336be
 (2603:10b6:207:3d::18) with Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.14 via Frontend
e336be
 Transport; Fri, 3 Aug 2018 17:53:54 +0000
e336be
Authentication-Results: spf=pass (sender IP is 149.199.60.83)
e336be
 smtp.mailfrom=xilinx.com; linaro.org; dkim=none (message not signed)
e336be
 header.d=none;linaro.org; dmarc=bestguesspass action=none
e336be
 header.from=xilinx.com;
e336be
Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates
e336be
 149.199.60.83 as permitted sender) receiver=protection.outlook.com;
e336be
 client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01;
e336be
Received: from xsj-pvapsmtpgw01 (149.199.60.83) by
e336be
 CY1NAM02FT063.mail.protection.outlook.com (10.152.75.161) with Microsoft SMTP
e336be
 Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1038.3
e336be
 via Frontend Transport; Fri, 3 Aug 2018 17:53:52 +0000
e336be
Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01)
e336be
 by xsj-pvapsmtpgw01 with esmtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGu-0004fj-Fr; Fri, 03 Aug 2018 10:53:52 -0700
e336be
Received: from [127.0.0.1] (helo=localhost)
e336be
 by xsj-pvapsmtp01 with smtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGp-0007cn-CX; Fri, 03 Aug 2018 10:53:47 -0700
e336be
Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com)
e336be
 by xsj-pvapsmtp01 with esmtp (Exim 4.63)
e336be
 (envelope-from <jollys@xilinx.com>)
e336be
 id 1fleGl-0007bh-63; Fri, 03 Aug 2018 10:53:43 -0700
e336be
From: Jolly Shah <jolly.shah@xilinx.com>
e336be
To: <ard.biesheuvel@linaro.org>, <mingo@kernel.org>,
e336be
 <gregkh@linuxfoundation.org>, <matt@codeblueprint.co.uk>,
e336be
 <sudeep.holla@arm.com>, <hkallweit1@gmail.com>, <keescook@chromium.org>,
e336be
 <dmitry.torokhov@gmail.com>, <mturquette@baylibre.com>,
e336be
 <sboyd@codeaurora.org>, <michal.simek@xilinx.com>, <robh+dt@kernel.org>,
e336be
 <mark.rutland@arm.com>, <linux-clk@vger.kernel.org>
e336be
Subject: [PATCH v11 01/11] dt-bindings: firmware: Add bindings for ZynqMP
e336be
 firmware
e336be
Date: Fri, 3 Aug 2018 10:53:18 -0700
e336be
Message-ID: <1533318808-10781-2-git-send-email-jollys@xilinx.com>
e336be
X-Mailer: git-send-email 2.7.4
e336be
In-Reply-To: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
References: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005
e336be
X-TM-AS-User-Approved-Sender: Yes;Yes
e336be
X-EOPAttributedMessage: 0
e336be
X-MS-Office365-Filtering-HT: Tenant
e336be
X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI;
e336be
 SFV:NSPM;
e336be
 SFS:(10009020)(39860400002)(376002)(136003)(346002)(396003)(2980300002)(438002)(199004)(189003)(6666003)(7416002)(8936002)(9786002)(305945005)(50226002)(2906002)(5660300001)(478600001)(2201001)(8676002)(72206003)(47776003)(81166006)(106466001)(81156014)(63266004)(4326008)(39060400002)(446003)(476003)(36756003)(44832011)(186003)(11346002)(2616005)(16586007)(50466002)(316002)(126002)(76176011)(106002)(426003)(107886003)(51416003)(356003)(336012)(26005)(36386004)(7696005)(486006)(77096007)(54906003)(110136005)(48376002)(921003)(107986001)(1121003);
e336be
 DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR02MB4460; H:xsj-pvapsmtpgw01; FPR:;
e336be
 SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1;
e336be
X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT063;
e336be
 1:Vdzjpv2tvWIIUyrLnkjwnYINNMP3uv4BE92NdjxR4au3XiR+6v9YOb2cNSmKwFOfDlp44j7JAnh5gr2TNWQ3QWtw5LpTaNkvNDohFa1RJOin7FxPjQeoTftlCIfc+xem
e336be
MIME-Version: 1.0
e336be
X-MS-PublicTrafficType: Email
e336be
X-MS-Office365-Filtering-Correlation-Id: 55c5c80a-6d3d-40b7-469a-08d5f96a1405
e336be
X-Microsoft-Antispam: BCL:0; PCL:0;
e336be
 RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);
e336be
 SRVR:DM6PR02MB4460;
e336be
X-Microsoft-Exchange-Diagnostics: 1; DM6PR02MB4460;
e336be
 3:QVpC+lNzN99yobD9G43Mn0AfdB7Z+sXIy7KWpdgAjCNrVLU59aRaJ27u0IL4u/ob1tXeZ8Q6YDljvYJzZr/QB//DbqNHLzTIgrNk1foBZpm/BED03r1hL/qVbwSWDZSucI0B2YzZFZn9m7+6q7AlVNPhr/y+icReaa99F2VRBz5pjPl+FH5Wk8BK7/aIHcxs8fd37rXLtvvulKMFOGL+VJoAuAfIcSoT+HtLtxdXXfLK6c3SLw0NmYApKnsROCOgmqYmIqQztAE6tiTr1w2WpeW3gl6O0Uqa2HhXHSw5mdG/BwQpU2dVQb9nD6LkFp1jWg52tmlOM1yU+btrEki4AVAhg3fdXKSUCYL2RWamu88=;
e336be
 25:rgYpWX0/dSzVHZvKg140liiW4U+Qa+D2+xa0Jkl+PYHY5H9pcnMNhBWeok2iDPD8im8MuUj3z5e3yAVU9VwtlpWRC7fRZQLdBT+qVNwwdDgSW9QpUrNeRFmM2sqKhYgKnA7WmIGQvj3TkvJ0w93Jni2B9yC1mldxzLTUcIAhjPnz8nQ+TZzmqC2BOUe8OTvhCU2y3Pc/h9njzkfyL6D7Qsu14NH+JedjYopigSKS/xG0PyJQd7ZAn/1Ms7DTouzdvzXqheFZ+UctUpZ04nKHXVXmmjsMznrfH7xi5To7HEj31eQKcB49AfFuG0G//m7wYpphnO4Pe1bnfw13juDKOg==
e336be
X-MS-TrafficTypeDiagnostic: DM6PR02MB4460:
e336be
X-Microsoft-Exchange-Diagnostics: 1; DM6PR02MB4460;
e336be
 31:5QXyfZgC6dyPMbtX4xLjI5dg0arfqz7mDlfBTebhwECZdXkOoE9oz9ZFO8JNXPDtlWKP+E7zlrQ9QsO8Ix9OWawqeq1onbCOgxXFCGGEJ2jpuUNm3JYAcvQ8vRVCwvUOZ/w0KPNg/DQUyoqgFMj6OTqa2EtYAncZK4r2xM/Er3Kzwa4rubwAlTuFYgBFgLM+s/r4M8yvSFW02aCOrb5KrysxKRRJ9EF3k0hJ3kfjZwo=;
e336be
 20:MJre6KRcn3zdHeQc3u08Esx3Alc56RP2k+/eQaMhecAP0OPICJV1s73MfZS9uVFuohTbPoQ637Ut2ukGSi+m7FBl7PGZxp2XnIPVhWP+4kah5fzUNQ50NJkS6A6g/hIjRoPeTOW0TlT7K4qYykeqvU7TBJdE0X78R9xM3CFdI9kNs2ODCfeU+tA7XbHqZ2eoGLcloHkw8iRmAxBs8vxD3WjD+w3sO6gUCrj9IssoyTziQ4A90FvAjzCTKtDnmImSbUyMOBeM2GnGcdwnuHB7G1Etzk/P/OrHPnnDQYemRBtPUg8dzqLBkaakGjHnBxKYhgT2D2Uk3JuyS5Zh1fyMkJ+FlmnI9PRCcqX4TJytOevtE672HonWL2M6y0awpv6ly8Rg71adr1qYaaQlJYGxADxaE4d/9cksTLabmaL0Vo2whoudSEYOLKFRD653UtYflL6yk5qPWpRtjYc72oNMQN6E0efEQyCi08psk46fjV/RuVkJgV0Y62S5tFJ43vtQ
e336be
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
e336be
X-Microsoft-Antispam-PRVS: 
e336be
 <DM6PR02MB4460BA8A041C22C0F51BB5D5B8230@DM6PR02MB4460.namprd02.prod.outlook.com>
e336be
X-Exchange-Antispam-Report-Test: UriScan:(192813158149592);
e336be
X-MS-Exchange-SenderADCheck: 1
e336be
X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0;
e336be
 RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93004095)(10201501046)(3231311)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011)(7699016);
e336be
 SRVR:DM6PR02MB4460; BCL:0; PCL:0; RULEID:; SRVR:DM6PR02MB4460;
e336be
X-Microsoft-Exchange-Diagnostics: 1; DM6PR02MB4460;
e336be
 4:r2OWd2cou5EkPqEuZDe4080TVw361TX3MEsXCN8iixg8OEdN0F/J5W8b6P54ahgUgyqB3TIN7is2VLxmAGA6rTHnU7FBnTdEMGv6WcU6/GXk3/qZNNmiT+4UcE4woeghLYdPfEPi07t9E58S+RM7D2kIsb4Cllc/iSpxIglyADFUywSE4jpnUEFSY54mS9yymuvfhJL83R7/uPNzP5M+HPbrWrJ6dOH3un6W6eNi1zAnwWQdFpBg0O7LXR/AWmU8+3J6YRUO60L/frBjBkkrFHgi4h4zkQGCI615NBbiDsd/YGHy8SbnvpA1golBRbiU
e336be
X-Forefront-PRVS: 0753EA505A
e336be
X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM6PR02MB4460;
e336be
 23:RXKJvjhp8K5OZ1WAT+aHnT5SGHvqgBxUS9V94AdVC?=
e336be
 Nfjq5XJ6hDGFX3kstbveK0Beej+qmVhFVdwF0oPete6MDRjKQ36JPIT/AJo5XNw9EltFbg4GD0HELBNteV0/TOYKg9A3oGeJKh3pIQ/Q0caNb2lJ82oyILJ+6KBRtmqKYApp5Uhb0SgNFn17IgsA+FYBDTcYhv6dfvAi6F6cAjp/wHqjcBBNzkpWv/aMv6TmvQR4P11eFjiUXzN+IVB8aHcYOf6pLzEc+Qhxk8T0XecJ6uGU7BEniOTkFAXRZcXGVVY8g4jBWahCqSxzOUrzgOLh/d4UddgdM5U5K7HEximnWX0F6AS/x11iVC6HP4zmQBZWJBFzjougEnnaEJVXxZ/xUXPxM5prk6EJ6gc1OoCBJhTjorDx6dBv1Y/WdFAiNDcx8KXG+rIJPEcGPZHW9B63pWhzrfoQ9cVyFHlfj8OH7NKqmJiQUd1V7YAsIRdGwVSI2ou2mefBZ27nVd+ZQ8ezl5GQWf9BCwxo6INC4gZTtuVunVRup3pz/4hloa82gfmQ+IjlNgoNqR4JuOGvGpgIF5ocys3Mkj9XoWNf4afZJWlQq791/aC/tumlTBISQsnYR8lT9WlSxEAzWH5AoDa7oT7g0vEpj2MbgOOzHJNFh5NSEQqczobMZu0MYEjG5qwlmCIfNvA5E0nmad2A+axEfLJAkE50G+YjgaqfGKw40lPtlB20Ebkrv3F28sf/Kg/DH+rdqi7Gn9KZgnw5cSRhSK5RXE4iBYHz8LYooC5ts3hceC9hnQ/br3Qsp2HJBTPRKq+/gmEPIQjS0/te4omY/16hI5UfAK2Fwwsu9wOTXsA8b+3e7eUQwdPGH5rBFR5ie2iLP66lFv2kFe6cBa3BvAFA9tPztMUnPyGP1tYrkuG1vDe5dS2TLDC7TqqRN5EjGnxKHkHNWL1YCgRJPXBr++l94c/88N3i2Ebcllr6GC+FB+qtR6MeS67N54SSXt3OFxu8W76SmU/Fx3KWXrxuG//zYhepznTosMzFwsWrfKHXKXVKAZhNrrXmKs/MeOk2YT0S0wKhKTYmCjbF7tI9VK28y2b28VI9UgZHl2aoxJWA/gz4UByGwCvAacd6DOze3QxHVEA/GCY3pT/5CA6jin9CADfJ3pY9KTvMXntCp4oc3046LEFLJYGSl222SwkCEoVvnl8dmCmXgb+l1awpFfj4ty6s1M+7rmvbm2p+WzdgTycbTRS0XldYsKP560=
e336be
X-Microsoft-Antispam-Message-Info: 
e336be
 PWc+I1ZimgKrwPFXiHJa/fj+Fkwcsd457dSYLaqSVJ5svsHJBjDvDz5UD9RxUm1EajkLP1WWKszqeKX2oJqhSnybQyGptPSb9U2htHcKGUYT9ePgYE4G1BRyfvOBDU5CsydyeBmIDTwG2RMM7TIzdQF4cLJ0qO3yPfu73/b4jB4GrgnolannhDM9Zm20B6uy3NEXjDp6d5n8XNFg0k40ES/HfCtqx0CkC78ltS+jczOZDt7720OGFpxL7dMbitk85v/FzE7940+NhmEt1juUKcKJl7us1aYOLZunW2XATRmATPfvD9w8ogmJVsFcbzxmxm8nuPosP5Ntv/+qhJOCH8ZB8aVWSXBikKjvFNZQitY=
e336be
X-Microsoft-Exchange-Diagnostics: 1; DM6PR02MB4460;
e336be
 6:VHBxA6b+iPCQj7btQgmu88Ma0Rn/kRxYjXk8M6wv/oOJvVeOQynuZUZETv9i2KcHvc3wQA55q5BJNHNkkhcM1ro+RLKbmOsbvbL29MP4rk3AzaH3PjmGa/DzwT0v2lkiqjCo6S4p7ShvUsYfQQcWFAf1W7Xiy+gdKyTc5XINUR0b+plwabAV5FHB7Ff6nu8xOe7NPk/qyfcaoWlrY0De4HeyUrdJFqbQ0VisR7F9Ia7+APkA5vWL98yTa06Qb0jVBf6mYV0KVbOiYCH6XUFzOhbP+xmYW9aILzZkd9fuprFdNLOwp5A3Uq54GeNS1mSzGXzsctZXCTtBV+YybC5vfmSY7P6inExoalDN5mYqz/zuYq9ab2sfwSn9cJoPPOiLUsBI85+L28o2hCwWoGH9chclyA0fbJ651sICCODBSsNiAowo2dsO+m9qOk0x2KzSsq4Qn8iLP9OKekaFSfNvOg==;
e336be
 5:A4w4g/McXH1IK9/H+I+hFnPC7PqTWdIEYUKeeDqV8tdnS73RObxsTXsaQtb5sNbdq0+FymsmpMO+Dlj+KLuWk0hNWeccqH45coI+VCkimvrfoNr3tVNTW7YlNC68TKGVZv7icxewUd/RHIVVMxUtvTfzsMmGvUvo5I1leE1jIL4=;
e336be
 7:T1q2oGp7WDec0EgENmQP3yaoRg+mewYI2OUoWdFfY9DGXAGcK2+WjdxfKYcbAVKaJ2yVb1U5NACbS1jB5NOM9JxI78KDFR7UiDfow0UxxuCX9ku10OmuUHMWOUGOUxV1vYogQ5d592LSwcSgDwuTHVz8S+lri1MkxW0Zx4ZRzBgTOGKgBm4UQcddq4bqYI8zGNCOzXtcT82Ote3iVj0ARJbC1AMNgjLv6u6lInDb+2YYNREwCsOvQ8vTqHgaRpnS
e336be
SpamDiagnosticOutput: 1:99
e336be
SpamDiagnosticMetadata: NSPM
e336be
X-OriginatorOrg: xilinx.com
e336be
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2018 17:53:52.9907 (UTC)
e336be
X-MS-Exchange-CrossTenant-Network-Message-Id: 
e336be
 55c5c80a-6d3d-40b7-469a-08d5f96a1405
e336be
X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c
e336be
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: 
e336be
 TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83];
e336be
 Helo=[xsj-pvapsmtpgw01]
e336be
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
e336be
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB4460
e336be
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
e336be
X-CRM114-CacheID: sfid-20180803_105408_040914_83BEDE27 
e336be
X-CRM114-Status: GOOD (  10.27  )
e336be
X-BeenThere: linux-arm-kernel@lists.infradead.org
e336be
X-Mailman-Version: 2.1.21
e336be
Precedence: list
e336be
List-Id: <linux-arm-kernel.lists.infradead.org>
e336be
List-Unsubscribe: 
e336be
 <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
e336be
List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
e336be
List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
e336be
List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
e336be
List-Subscribe: 
e336be
 <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
e336be
Cc: devicetree@vger.kernel.org, rajanv@xilinx.com,
e336be
 linux-kernel@vger.kernel.org,
e336be
 linux-arm-kernel@lists.infradead.org, Jolly Shah <jollys@xilinx.com>
e336be
Content-Type: text/plain; charset="us-ascii"
e336be
Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
e336be
Errors-To: 
e336be
 linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
e336be
X-Virus-Scanned: ClamAV using ClamSMTP
e336be
e336be
From: Rajan Vaja <rajanv@xilinx.com>
e336be
e336be
Add documentation to describe Xilinx ZynqMP firmware driver
e336be
bindings. Firmware driver provides an interface to firmware
e336be
APIs. Interface APIs can be used by any driver to communicate
e336be
to PMUFW (Platform Management Unit).
e336be
e336be
Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
e336be
Signed-off-by: Jolly Shah <jollys@xilinx.com>
e336be
Reviewed-by: Rob Herring <robh@kernel.org>
e336be
---
e336be
 .../firmware/xilinx/xlnx,zynqmp-firmware.txt       | 29 ++++++++++++++++++++++
e336be
 1 file changed, 29 insertions(+)
e336be
 create mode 100644 Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.txt
e336be
e336be
diff --git a/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.txt b/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.txt
e336be
new file mode 100644
e336be
index 0000000..1b431d9
e336be
--- /dev/null
e336be
+++ b/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.txt
e336be
@@ -0,0 +1,29 @@
e336be
+-----------------------------------------------------------------
e336be
+Device Tree Bindings for the Xilinx Zynq MPSoC Firmware Interface
e336be
+-----------------------------------------------------------------
e336be
+
e336be
+The zynqmp-firmware node describes the interface to platform firmware.
e336be
+ZynqMP has an interface to communicate with secure firmware. Firmware
e336be
+driver provides an interface to firmware APIs. Interface APIs can be
e336be
+used by any driver to communicate to PMUFW(Platform Management Unit).
e336be
+These requests include clock management, pin control, device control,
e336be
+power management service, FPGA service and other platform management
e336be
+services.
e336be
+
e336be
+Required properties:
e336be
+ - compatible:	Must contain:	"xlnx,zynqmp-firmware"
e336be
+ - method:	The method of calling the PM-API firmware layer.
e336be
+		Permitted values are:
e336be
+		  - "smc" : SMC #0, following the SMCCC
e336be
+		  - "hvc" : HVC #0, following the SMCCC
e336be
+
e336be
+-------
e336be
+Example
e336be
+-------
e336be
+
e336be
+firmware {
e336be
+	zynqmp_firmware: zynqmp-firmware {
e336be
+		compatible = "xlnx,zynqmp-firmware";
e336be
+		method = "smc";
e336be
+	};
e336be
+};
e336be
e336be
From patchwork Fri Aug  3 17:53:19 2018
e336be
Content-Type: text/plain; charset="utf-8"
e336be
MIME-Version: 1.0
e336be
Content-Transfer-Encoding: 7bit
e336be
X-Patchwork-Submitter: Jolly Shah <jolly.shah@xilinx.com>
e336be
X-Patchwork-Id: 10555401
e336be
Return-Path: 
e336be
 <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org>
e336be
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
e336be
 [172.30.200.125])
e336be
	by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7750E15E9
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 17:55:17 +0000 (UTC)
e336be
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6163D2C91B
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 17:55:17 +0000 (UTC)
e336be
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
e336be
	id 553D32C92A; Fri,  3 Aug 2018 17:55:17 +0000 (UTC)
e336be
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
e336be
	pdx-wl-mail.web.codeaurora.org
e336be
X-Spam-Level: 
e336be
X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00,
e336be
	DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1
e336be
Received: from bombadil.infradead.org (bombadil.infradead.org
e336be
 [198.137.202.133])
e336be
	(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))
e336be
	(No client certificate requested)
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 766AA2C91B
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 17:55:16 +0000 (UTC)
e336be
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
e336be
	d=lists.infradead.org; s=bombadil.20170209; h=Sender:
e336be
	Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:
e336be
	List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:
e336be
	Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:
e336be
	Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
e336be
	List-Owner; bh=7mCjWnQwC2Z85YWVZkbTmPmS3NfnsqjkMkSNqvoFRSU=; b=XS5VQkVqSGz7ko
e336be
	o5vwgp6kjHfCbYwqJxwl91v0KTZ5RXJCKF2O7GiBX6fjnIiEUcexlA1x6Xgqj2NPeP/eN2wVyoZuL
e336be
	r/kSjecGWh5Htb3yNccczZW8q468o9835UaaVMG4PZsue4SdQhhZ9L+e6Uo/gn7clJbIW7Y12xQvd
e336be
	6LARryt/HldiegLIvlhCyDTTEmhzEu5iB28bm0K8tm91nsxfqO0qMPWpTE6hKK0Avi20uF8eFHJpA
e336be
	4+xywFxUhWeaIC3QKpXrgvIPpX3VISfaOm1rjBE8smraokQO+mLBtJWB/pnj4oByMkp0BGsSsytfK
e336be
	oUSBXc/6zamEiFxGMMNA==;
e336be
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
e336be
	by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))
e336be
	id 1fleIC-00045h-4B; Fri, 03 Aug 2018 17:55:12 +0000
e336be
Received: from mail-dm3nam03on0603.outbound.protection.outlook.com
e336be
 ([2a01:111:f400:fe49::603]
e336be
 helo=NAM03-DM3-obe.outbound.protection.outlook.com)
e336be
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
e336be
 id 1fleHB-0002lG-2q
e336be
 for linux-arm-kernel@lists.infradead.org; Fri, 03 Aug 2018 17:54:16 +0000
e336be
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
e336be
 d=xilinx.onmicrosoft.com; s=selector1-xilinx-com;
e336be
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
e336be
 bh=c6Tqd00q99GCo7Zqz6V0mcAdefcyuAndIi1uNYaDR7M=;
e336be
 b=thQ4eY3QXuVtmncr+GYIZmI4lOHnODT6naiqyNafFJmLDttEFLN62PlzG2b/YiKknIuUFE9wIE1+FdGbIJYn/WLxMg7HDo3IZi/q1VP4jScfx10CysvJTgnF0QQ/4BSK4G64gQLw0HCDs2YT2g9VfwNsuAQbLvhqmq+vHOZ+X/o=
e336be
Received: from MWHPR0201CA0053.namprd02.prod.outlook.com
e336be
 (2603:10b6:301:73::30) by BL0PR02MB4452.namprd02.prod.outlook.com
e336be
 (2603:10b6:208:45::29) with Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Fri, 3 Aug
e336be
 2018 17:53:54 +0000
e336be
Received: from CY1NAM02FT056.eop-nam02.prod.protection.outlook.com
e336be
 (2a01:111:f400:7e45::209) by MWHPR0201CA0053.outlook.office365.com
e336be
 (2603:10b6:301:73::30) with Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.15 via Frontend
e336be
 Transport; Fri, 3 Aug 2018 17:53:53 +0000
e336be
Authentication-Results: spf=pass (sender IP is 149.199.60.83)
e336be
 smtp.mailfrom=xilinx.com; linaro.org; dkim=none (message not signed)
e336be
 header.d=none;linaro.org; dmarc=bestguesspass action=none
e336be
 header.from=xilinx.com;
e336be
Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates
e336be
 149.199.60.83 as permitted sender) receiver=protection.outlook.com;
e336be
 client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01;
e336be
Received: from xsj-pvapsmtpgw01 (149.199.60.83) by
e336be
 CY1NAM02FT056.mail.protection.outlook.com (10.152.74.160) with Microsoft SMTP
e336be
 Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1038.3
e336be
 via Frontend Transport; Fri, 3 Aug 2018 17:53:52 +0000
e336be
Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01)
e336be
 by xsj-pvapsmtpgw01 with esmtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGt-0004fd-Vc; Fri, 03 Aug 2018 10:53:51 -0700
e336be
Received: from [127.0.0.1] (helo=localhost)
e336be
 by xsj-pvapsmtp01 with smtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGo-0007cn-SJ; Fri, 03 Aug 2018 10:53:46 -0700
e336be
Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com)
e336be
 by xsj-pvapsmtp01 with esmtp (Exim 4.63)
e336be
 (envelope-from <jollys@xilinx.com>)
e336be
 id 1fleGl-0007bh-8F; Fri, 03 Aug 2018 10:53:43 -0700
e336be
From: Jolly Shah <jolly.shah@xilinx.com>
e336be
To: <ard.biesheuvel@linaro.org>, <mingo@kernel.org>,
e336be
 <gregkh@linuxfoundation.org>, <matt@codeblueprint.co.uk>,
e336be
 <sudeep.holla@arm.com>, <hkallweit1@gmail.com>, <keescook@chromium.org>,
e336be
 <dmitry.torokhov@gmail.com>, <mturquette@baylibre.com>,
e336be
 <sboyd@codeaurora.org>, <michal.simek@xilinx.com>, <robh+dt@kernel.org>,
e336be
 <mark.rutland@arm.com>, <linux-clk@vger.kernel.org>
e336be
Subject: [PATCH v11 02/11] firmware: xilinx: Add Zynqmp firmware driver
e336be
Date: Fri, 3 Aug 2018 10:53:19 -0700
e336be
Message-ID: <1533318808-10781-3-git-send-email-jollys@xilinx.com>
e336be
X-Mailer: git-send-email 2.7.4
e336be
In-Reply-To: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
References: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005
e336be
X-TM-AS-User-Approved-Sender: Yes;Yes
e336be
X-EOPAttributedMessage: 0
e336be
X-MS-Office365-Filtering-HT: Tenant
e336be
X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI;
e336be
 SFV:NSPM;
e336be
 SFS:(10009020)(346002)(39860400002)(376002)(396003)(136003)(2980300002)(438002)(189003)(199004)(81156014)(8676002)(6666003)(50466002)(81166006)(5660300001)(2201001)(36386004)(575784001)(48376002)(39060400002)(356003)(4326008)(107886003)(305945005)(63266004)(7416002)(44832011)(106466001)(76176011)(106002)(9786002)(14444005)(16586007)(50226002)(36756003)(77096007)(47776003)(8936002)(316002)(2906002)(26005)(426003)(11346002)(446003)(478600001)(486006)(51416003)(7696005)(336012)(110136005)(54906003)(476003)(126002)(2616005)(72206003)(186003)(921003)(107986001)(1121003);
e336be
 DIR:OUT; SFP:1101; SCL:1; SRVR:BL0PR02MB4452; H:xsj-pvapsmtpgw01; FPR:;
e336be
 SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1;
e336be
X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT056;
e336be
 1:F4jMf6J/39XBmifXqxNtYOZTCZpcJZZ7MSycw/JSWOiK+Wtjsi2dwqcZqUV9h0aPg4Rki7CIrBTUcY0XwQVGuJEcx8xz9UWJN94nfuwCqdSEx6xfT071vWIxylTdBnj9
e336be
MIME-Version: 1.0
e336be
X-MS-PublicTrafficType: Email
e336be
X-MS-Office365-Filtering-Correlation-Id: df491755-30fb-454a-d0fa-08d5f96a13b2
e336be
X-Microsoft-Antispam: BCL:0; PCL:0;
e336be
 RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);
e336be
 SRVR:BL0PR02MB4452;
e336be
X-Microsoft-Exchange-Diagnostics: 1; BL0PR02MB4452;
e336be
 3:u3DQYeOwlKNEyTS7MxxHk3buRABhOUox/VC7HOVctIBNwPnMSAKIwXNqdNOoWo7uw/ekvkX/hze4JFl1xtvmtGg6BAg3dRo+HoC2CP0Fi2k6Aa5aur4STSN+iBc9pvTnhnixAX5gGxwuyAir3pVWw71c9sh2Cb+8Pyle9CeD8m4gtLpB6bNlZ/pSb8g4gioqVdRRa1mP78N5FxAJIE3Hix/L/N8hSO70ai+w6/sE61pIhy/wvw4zWdAVK/+/PXZIc2HwA4FvrnCuG+9oaMFyo7JAcs1QPss2r3qB2YnwVikz77yfJ9IJ/YWIiQzTLlF2KvhQhLsz1iv/zi1xiSbpSNKJFDBA4ZPduHmO+VHN5P8=;
e336be
 25:LXJ2Vp0S2PhNyuQpuooRWPDEQCDCFctChZ7NtQBffAH7j0HpBmn91ZJf/UvJGyN+WaoKdJaBpJOWInm/kLyzpa2/ra1jyqhBAn2fsPuzZ0Xh7c+5wDJ/qJoW/FedMTKQ7uWhGwb8HGxOavMr7R51Nud12+loQJyUCKrOCkAIcSv+1tA+QMSOEGkDzKsWkEA02WmnzFl7xqKwyMAqLwgw5TZdhL8Wp+EMs7tU5VkMqpxVRVb4/UD5Fy2lLoVZRQO9MY5MJeCv6WIvuA0V4ufw1GhFfJvLRSIVwHWONf9GjGuEmuWl9ho6Wv40bR+2smxGToxoH2xooQnhZxbkLbxVdw==
e336be
X-MS-TrafficTypeDiagnostic: BL0PR02MB4452:
e336be
X-Microsoft-Exchange-Diagnostics: 1; BL0PR02MB4452;
e336be
 31:gAD/0l4A22RMMz3cA77FGvYUYsqp7N985YvCQnxLWHoCHncGUMZL+KmuVQcYhKrluSa3gW0YAxB1QQk3b7NHltL454qdM5hlhADX+WeP/k8jkyahuhHWc278gplw74Zi6AiGSbTV9ybUcrYnyTst1AA6QgRd/gUAYLFQ9KhiZIOWfN+xjPjisNhmqjrx3fzaKZsQ2eGPWATXw/IgsnFG88uAapDzoNTzeKbn0H/ZHjw=;
e336be
 20:m6IjijVa+swdSqlECYcegH7AeaWGnFJZJ67tBzrbOBgVOBKKlXLmYQrIyVo3o8Y1iayTFD5fHw4+0xPN14S3QUR8Ie8m8slJvMTi3d6HAH+75z95ngoHvp40xGmnnLFGrahkxoP44ACWkEGr8Y14jyXjnEzZGxuRqD5ewoA84bsH2Ks8V3t1E9MId75x+x5YAk1ITtmvYDdlfkqp/R8V5BjLbVA4iNkpHft/9bYyxEiI7PUT39DpgHjvnHaHXxEj8PfjHHVMObDr0uciKD5EqhviW2GB/RKKnSxU6PHFj0ACl+j3L+NfBkHbaMD/Pc797Z4IV8ZhdJCbTK18Ka+UqIy7hHDDYI9mSMx8FtsMsCGGnTfoDrV6Muj6g66b91/d5CsHMpkFRREI7htfE+wTpB4pNSxnyF13T5iiIsdnxKFWJK4h/Ojoy8Gmh1MqKGguoKbGszzoKwgnWlKW0W9aFYYmZTb863zqWSTtrOwZqsGTls6RX2lXPuKMZtSkEoho
e336be
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
e336be
X-Microsoft-Antispam-PRVS: 
e336be
 <BL0PR02MB44522F11AC356B8A5A575B76B8230@BL0PR02MB4452.namprd02.prod.outlook.com>
e336be
X-Exchange-Antispam-Report-Test: UriScan:(192813158149592);
e336be
X-MS-Exchange-SenderADCheck: 1
e336be
X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0;
e336be
 RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231311)(944501410)(52105095)(3002001)(93006095)(93004095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(6072148)(201708071742011)(7699016);
e336be
 SRVR:BL0PR02MB4452; BCL:0; PCL:0; RULEID:; SRVR:BL0PR02MB4452;
e336be
X-Microsoft-Exchange-Diagnostics: 1; BL0PR02MB4452;
e336be
 4:S1wOMZKx46XEgQla1475Tc9TEw2kgWJkcVsL0CDFGaXSOMIIY736AjSmYireGlAatx9RbgpQFaPlM7TfODrR65ZHyghGtvEDcC/7CukUAsgmZqGxFZZMO83wP1xGYJNrT8L+VM0CtATBCVyiShDY/3nrQBh9CJq0zQpwengwEZLJgGrcLbEm4XbMkIXljMG92NM5qZwqgi14GWXuQL5irl54VviDeeH/in1QGc5GfwwXcpfTOPW5ayhm7NsHZx48kIP48arXJ5yCvptPDFOS8TeI65FU6nbGS8aPo8eh9q5UNCNJDwzXu9n0EE8KoES9
e336be
X-Forefront-PRVS: 0753EA505A
e336be
X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL0PR02MB4452;
e336be
 23:4SmKEBJfIiPDNKrH/YSFqfMAsxGv8UJjmXMIEw0O1?=
e336be
 WCrOK0AkD60wh1VrqwSP78kTCrAjLDvbbtFalM2I/LEYfqFfpJwIercxDOEtVgcedzlEIQqUtbC0J2HvDHHoPDsgcBrXIvoobF5RKReA35NCBIeoGiYIcOSNugKQ8FNtMiIZoHeMrDx6S7dkqOZKoheFUXw7KV5hyggAIw8aBqOcU9TfjSpVE1NcLHv3ZYER4p+lZOpzG3JCqZudgIrMMwyveYHy054HnHUFrSEZEsWhiGm95jxUEAy8r6Q7nwXTV5nHSRLEnLhzIHT4IgIVoTLjNKbx3uvEMiR08IOVEvPY5CdqIWTcRk7IqVlu+XL932/hKvLili2xCyHCgnCWJditDGrodQ9KZS/llESbsLq0tBAfjrME9ZDmwLkq/XftOthxOGGbvnD5FIObG3ZUGq9mFCAs+PHtAzXvZ58fBUyLtuewBVVhdJ+Zop2eluuScCthB8Vj/2Ck7l0W08AGUCf0hR6CzV0nLsB03rXYg9c+VgphTBp4dUfpGNPtuWUt/2vs6niIC3QzqjW9cdKbHewQxdSV1ydut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upGYvRiZ4OHz+IwtnPCvw=
e336be
X-Microsoft-Exchange-Diagnostics: 1; BL0PR02MB4452;
e336be
 6:XK81hQCF+KkaMNSs/mcaTYyR8PWkHLLrI2U4yLLW+SCAFOSUBl3V3qBHu1zpLC80CsqoYXS3ob7XU4T4Oxgk+zVO2MsF/jF0IItrehOOcpVPakCNUdAOuig0tGuWzQ9AusgGk6AnnZg6JisxKeWbLqR7SP7geIiiP7fPICdIJkCZJDiOpO8GKkQWM/1WgS0lZthwl3FuubAJVN9maCr26C42RkdqkrsjxK9MKsXB3bZreynylhxDt3KTtrMB457mWhR++1BQ8D1bX2GjMZcmgOAZWhTRd76e5AhO7jAksiNiboMsnPZwnIralVQTmhas8kbNrWhZ1/xrqwBd27+qz3kmO3Sp75KHpEc1nvXSg5mQjKqmKoq4od9YwzpB8s3SQTQHpkqf9rblumRDL9prSFWy5IU3rleCB+H9HP53PjPA/aIuCasb9/8whaOViYL+wz9dQP+3HqfrGmdW7RVWWw==;
e336be
 5:yJdTcKxVONzB436x1If5l2hQ7Z+9AKUQHyv16QL7ulayvFKr7VOxKbduzJBtAVRmtWSpE6pbGCf35GCfL+/e9KT6PhI2Ja8uuV0Sa3bcRXYU8806QDn8pLkBpb86MoeZO7CSdMuwYMvFMCQn6PUgi7w3lhNY/7knKeT9p3D8T7k=;
e336be
 7:SPj/T83HaBXHdxHbjZhXjfrIFad2yuqhsBePk5KeJyxCv0PRLpg+oMZS0AwhAAQjO13OLGmp2XyNUDEr/OlQUi09vpzUa8clZ3lglOUO73u+G1qVA/MxzAiVSTc7txwSzcrT6mZNnaeTlL5vXLL5MtcN9OlQ2Pu4ojyZZcNBk9x/vN5RrfZ5li5cJi8YgPagcQ8gIEV0lw/eLzJVAhOJqWpqJgC8LLnxKazmlgokh/icMYSTorj5Ubih7ge4gtUZ
e336be
SpamDiagnosticOutput: 1:99
e336be
SpamDiagnosticMetadata: NSPM
e336be
X-OriginatorOrg: xilinx.com
e336be
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2018 17:53:52.4503 (UTC)
e336be
X-MS-Exchange-CrossTenant-Network-Message-Id: 
e336be
 df491755-30fb-454a-d0fa-08d5f96a13b2
e336be
X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c
e336be
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: 
e336be
 TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83];
e336be
 Helo=[xsj-pvapsmtpgw01]
e336be
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
e336be
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR02MB4452
e336be
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
e336be
X-CRM114-CacheID: sfid-20180803_105409_719133_0B57AB3C 
e336be
X-CRM114-Status: GOOD (  14.32  )
e336be
X-BeenThere: linux-arm-kernel@lists.infradead.org
e336be
X-Mailman-Version: 2.1.21
e336be
Precedence: list
e336be
List-Id: <linux-arm-kernel.lists.infradead.org>
e336be
List-Unsubscribe: 
e336be
 <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
e336be
List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
e336be
List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
e336be
List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
e336be
List-Subscribe: 
e336be
 <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
e336be
Cc: devicetree@vger.kernel.org, rajanv@xilinx.com,
e336be
 linux-kernel@vger.kernel.org,
e336be
 linux-arm-kernel@lists.infradead.org, Jolly Shah <jollys@xilinx.com>
e336be
Content-Type: text/plain; charset="us-ascii"
e336be
Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
e336be
Errors-To: 
e336be
 linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
e336be
X-Virus-Scanned: ClamAV using ClamSMTP
e336be
e336be
From: Rajan Vaja <rajanv@xilinx.com>
e336be
e336be
This patch is adding communication layer with firmware.
e336be
Firmware driver provides an interface to firmware APIs.
e336be
Interface APIs can be used by any driver to communicate to
e336be
PMUFW(Platform Management Unit). All requests go through ATF.
e336be
e336be
Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
e336be
Signed-off-by: Jolly Shah <jollys@xilinx.com>
e336be
---
e336be
 arch/arm64/Kconfig.platforms         |   1 +
e336be
 drivers/firmware/Kconfig             |   1 +
e336be
 drivers/firmware/Makefile            |   1 +
e336be
 drivers/firmware/xilinx/Kconfig      |  16 ++
e336be
 drivers/firmware/xilinx/Makefile     |   4 +
e336be
 drivers/firmware/xilinx/zynqmp.c     | 337 +++++++++++++++++++++++++++++++++++
e336be
 include/linux/firmware/xlnx-zynqmp.h |  63 +++++++
e336be
 7 files changed, 423 insertions(+)
e336be
 create mode 100644 drivers/firmware/xilinx/Kconfig
e336be
 create mode 100644 drivers/firmware/xilinx/Makefile
e336be
 create mode 100644 drivers/firmware/xilinx/zynqmp.c
e336be
 create mode 100644 include/linux/firmware/xlnx-zynqmp.h
e336be
e336be
diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
e336be
index fbedbd8..6454458 100644
e336be
--- a/arch/arm64/Kconfig.platforms
e336be
+++ b/arch/arm64/Kconfig.platforms
e336be
@@ -274,6 +274,7 @@ config ARCH_ZX
e336be
 
e336be
 config ARCH_ZYNQMP
e336be
 	bool "Xilinx ZynqMP Family"
e336be
+	select ZYNQMP_FIRMWARE
e336be
 	help
e336be
 	  This enables support for Xilinx ZynqMP Family
e336be
 
e336be
diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig
e336be
index b7c7482..f41eb0d 100644
e336be
--- a/drivers/firmware/Kconfig
e336be
+++ b/drivers/firmware/Kconfig
e336be
@@ -257,5 +257,6 @@ source "drivers/firmware/google/Kconfig"
e336be
 source "drivers/firmware/efi/Kconfig"
e336be
 source "drivers/firmware/meson/Kconfig"
e336be
 source "drivers/firmware/tegra/Kconfig"
e336be
+source "drivers/firmware/xilinx/Kconfig"
e336be
 
e336be
 endmenu
e336be
diff --git a/drivers/firmware/Makefile b/drivers/firmware/Makefile
e336be
index b248238..f90363e 100644
e336be
--- a/drivers/firmware/Makefile
e336be
+++ b/drivers/firmware/Makefile
e336be
@@ -31,3 +31,4 @@ obj-$(CONFIG_GOOGLE_FIRMWARE)	+= google/
e336be
 obj-$(CONFIG_EFI)		+= efi/
e336be
 obj-$(CONFIG_UEFI_CPER)		+= efi/
e336be
 obj-y				+= tegra/
e336be
+obj-y				+= xilinx/
e336be
diff --git a/drivers/firmware/xilinx/Kconfig b/drivers/firmware/xilinx/Kconfig
e336be
new file mode 100644
e336be
index 0000000..64d976e
e336be
--- /dev/null
e336be
+++ b/drivers/firmware/xilinx/Kconfig
e336be
@@ -0,0 +1,16 @@
e336be
+# SPDX-License-Identifier: GPL-2.0
e336be
+# Kconfig for Xilinx firmwares
e336be
+
e336be
+menu "Zynq MPSoC Firmware Drivers"
e336be
+	depends on ARCH_ZYNQMP
e336be
+
e336be
+config ZYNQMP_FIRMWARE
e336be
+	bool "Enable Xilinx Zynq MPSoC firmware interface"
e336be
+	help
e336be
+	  Firmware interface driver is used by different
e336be
+	  drivers to communicate with the firmware for
e336be
+	  various platform management services.
e336be
+	  Say yes to enable ZynqMP firmware interface driver.
e336be
+	  If in doubt, say N.
e336be
+
e336be
+endmenu
e336be
diff --git a/drivers/firmware/xilinx/Makefile b/drivers/firmware/xilinx/Makefile
e336be
new file mode 100644
e336be
index 0000000..29f7bf2
e336be
--- /dev/null
e336be
+++ b/drivers/firmware/xilinx/Makefile
e336be
@@ -0,0 +1,4 @@
e336be
+# SPDX-License-Identifier: GPL-2.0
e336be
+# Makefile for Xilinx firmwares
e336be
+
e336be
+obj-$(CONFIG_ZYNQMP_FIRMWARE) += zynqmp.o
e336be
diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
e336be
new file mode 100644
e336be
index 0000000..edbb84e
e336be
--- /dev/null
e336be
+++ b/drivers/firmware/xilinx/zynqmp.c
e336be
@@ -0,0 +1,337 @@
e336be
+// SPDX-License-Identifier: GPL-2.0
e336be
+/*
e336be
+ * Xilinx Zynq MPSoC Firmware layer
e336be
+ *
e336be
+ *  Copyright (C) 2014-2018 Xilinx, Inc.
e336be
+ *
e336be
+ *  Michal Simek <michal.simek@xilinx.com>
e336be
+ *  Davorin Mista <davorin.mista@aggios.com>
e336be
+ *  Jolly Shah <jollys@xilinx.com>
e336be
+ *  Rajan Vaja <rajanv@xilinx.com>
e336be
+ */
e336be
+
e336be
+#include <linux/arm-smccc.h>
e336be
+#include <linux/compiler.h>
e336be
+#include <linux/device.h>
e336be
+#include <linux/init.h>
e336be
+#include <linux/module.h>
e336be
+#include <linux/of.h>
e336be
+#include <linux/of_platform.h>
e336be
+#include <linux/slab.h>
e336be
+#include <linux/uaccess.h>
e336be
+
e336be
+#include <linux/firmware/xlnx-zynqmp.h>
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_ret_code() - Convert PMU-FW error codes to Linux error codes
e336be
+ * @ret_status:		PMUFW return code
e336be
+ *
e336be
+ * Return: corresponding Linux error code
e336be
+ */
e336be
+static int zynqmp_pm_ret_code(u32 ret_status)
e336be
+{
e336be
+	switch (ret_status) {
e336be
+	case XST_PM_SUCCESS:
e336be
+	case XST_PM_DOUBLE_REQ:
e336be
+		return 0;
e336be
+	case XST_PM_NO_ACCESS:
e336be
+		return -EACCES;
e336be
+	case XST_PM_ABORT_SUSPEND:
e336be
+		return -ECANCELED;
e336be
+	case XST_PM_INTERNAL:
e336be
+	case XST_PM_CONFLICT:
e336be
+	case XST_PM_INVALID_NODE:
e336be
+	default:
e336be
+		return -EINVAL;
e336be
+	}
e336be
+}
e336be
+
e336be
+static noinline int do_fw_call_fail(u64 arg0, u64 arg1, u64 arg2,
e336be
+				    u32 *ret_payload)
e336be
+{
e336be
+	return -ENODEV;
e336be
+}
e336be
+
e336be
+/*
e336be
+ * PM function call wrapper
e336be
+ * Invoke do_fw_call_smc or do_fw_call_hvc, depending on the configuration
e336be
+ */
e336be
+static int (*do_fw_call)(u64, u64, u64, u32 *ret_payload) = do_fw_call_fail;
e336be
+
e336be
+/**
e336be
+ * do_fw_call_smc() - Call system-level platform management layer (SMC)
e336be
+ * @arg0:		Argument 0 to SMC call
e336be
+ * @arg1:		Argument 1 to SMC call
e336be
+ * @arg2:		Argument 2 to SMC call
e336be
+ * @ret_payload:	Returned value array
e336be
+ *
e336be
+ * Invoke platform management function via SMC call (no hypervisor present).
e336be
+ *
e336be
+ * Return: Returns status, either success or error+reason
e336be
+ */
e336be
+static noinline int do_fw_call_smc(u64 arg0, u64 arg1, u64 arg2,
e336be
+				   u32 *ret_payload)
e336be
+{
e336be
+	struct arm_smccc_res res;
e336be
+
e336be
+	arm_smccc_smc(arg0, arg1, arg2, 0, 0, 0, 0, 0, &res;;
e336be
+
e336be
+	if (ret_payload) {
e336be
+		ret_payload[0] = lower_32_bits(res.a0);
e336be
+		ret_payload[1] = upper_32_bits(res.a0);
e336be
+		ret_payload[2] = lower_32_bits(res.a1);
e336be
+		ret_payload[3] = upper_32_bits(res.a1);
e336be
+	}
e336be
+
e336be
+	return zynqmp_pm_ret_code((enum pm_ret_status)res.a0);
e336be
+}
e336be
+
e336be
+/**
e336be
+ * do_fw_call_hvc() - Call system-level platform management layer (HVC)
e336be
+ * @arg0:		Argument 0 to HVC call
e336be
+ * @arg1:		Argument 1 to HVC call
e336be
+ * @arg2:		Argument 2 to HVC call
e336be
+ * @ret_payload:	Returned value array
e336be
+ *
e336be
+ * Invoke platform management function via HVC
e336be
+ * HVC-based for communication through hypervisor
e336be
+ * (no direct communication with ATF).
e336be
+ *
e336be
+ * Return: Returns status, either success or error+reason
e336be
+ */
e336be
+static noinline int do_fw_call_hvc(u64 arg0, u64 arg1, u64 arg2,
e336be
+				   u32 *ret_payload)
e336be
+{
e336be
+	struct arm_smccc_res res;
e336be
+
e336be
+	arm_smccc_hvc(arg0, arg1, arg2, 0, 0, 0, 0, 0, &res;;
e336be
+
e336be
+	if (ret_payload) {
e336be
+		ret_payload[0] = lower_32_bits(res.a0);
e336be
+		ret_payload[1] = upper_32_bits(res.a0);
e336be
+		ret_payload[2] = lower_32_bits(res.a1);
e336be
+		ret_payload[3] = upper_32_bits(res.a1);
e336be
+	}
e336be
+
e336be
+	return zynqmp_pm_ret_code((enum pm_ret_status)res.a0);
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_invoke_fn() - Invoke the system-level platform management layer
e336be
+ *			   caller function depending on the configuration
e336be
+ * @pm_api_id:		Requested PM-API call
e336be
+ * @arg0:		Argument 0 to requested PM-API call
e336be
+ * @arg1:		Argument 1 to requested PM-API call
e336be
+ * @arg2:		Argument 2 to requested PM-API call
e336be
+ * @arg3:		Argument 3 to requested PM-API call
e336be
+ * @ret_payload:	Returned value array
e336be
+ *
e336be
+ * Invoke platform management function for SMC or HVC call, depending on
e336be
+ * configuration.
e336be
+ * Following SMC Calling Convention (SMCCC) for SMC64:
e336be
+ * Pm Function Identifier,
e336be
+ * PM_SIP_SVC + PM_API_ID =
e336be
+ *	((SMC_TYPE_FAST << FUNCID_TYPE_SHIFT)
e336be
+ *	((SMC_64) << FUNCID_CC_SHIFT)
e336be
+ *	((SIP_START) << FUNCID_OEN_SHIFT)
e336be
+ *	((PM_API_ID) & FUNCID_NUM_MASK))
e336be
+ *
e336be
+ * PM_SIP_SVC	- Registered ZynqMP SIP Service Call.
e336be
+ * PM_API_ID	- Platform Management API ID.
e336be
+ *
e336be
+ * Return: Returns status, either success or error+reason
e336be
+ */
e336be
+int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1,
e336be
+			u32 arg2, u32 arg3, u32 *ret_payload)
e336be
+{
e336be
+	/*
e336be
+	 * Added SIP service call Function Identifier
e336be
+	 * Make sure to stay in x0 register
e336be
+	 */
e336be
+	u64 smc_arg[4];
e336be
+
e336be
+	smc_arg[0] = PM_SIP_SVC | pm_api_id;
e336be
+	smc_arg[1] = ((u64)arg1 << 32) | arg0;
e336be
+	smc_arg[2] = ((u64)arg3 << 32) | arg2;
e336be
+
e336be
+	return do_fw_call(smc_arg[0], smc_arg[1], smc_arg[2], ret_payload);
e336be
+}
e336be
+
e336be
+static u32 pm_api_version;
e336be
+static u32 pm_tz_version;
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_get_api_version() - Get version number of PMU PM firmware
e336be
+ * @version:	Returned version value
e336be
+ *
e336be
+ * Return: Returns status, either success or error+reason
e336be
+ */
e336be
+static int zynqmp_pm_get_api_version(u32 *version)
e336be
+{
e336be
+	u32 ret_payload[PAYLOAD_ARG_CNT];
e336be
+	int ret;
e336be
+
e336be
+	if (!version)
e336be
+		return -EINVAL;
e336be
+
e336be
+	/* Check is PM API version already verified */
e336be
+	if (pm_api_version > 0) {
e336be
+		*version = pm_api_version;
e336be
+		return 0;
e336be
+	}
e336be
+	ret = zynqmp_pm_invoke_fn(PM_GET_API_VERSION, 0, 0, 0, 0, ret_payload);
e336be
+	*version = ret_payload[1];
e336be
+
e336be
+	return ret;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_get_trustzone_version() - Get secure trustzone firmware version
e336be
+ * @version:	Returned version value
e336be
+ *
e336be
+ * Return: Returns status, either success or error+reason
e336be
+ */
e336be
+static int zynqmp_pm_get_trustzone_version(u32 *version)
e336be
+{
e336be
+	u32 ret_payload[PAYLOAD_ARG_CNT];
e336be
+	int ret;
e336be
+
e336be
+	if (!version)
e336be
+		return -EINVAL;
e336be
+
e336be
+	/* Check is PM trustzone version already verified */
e336be
+	if (pm_tz_version > 0) {
e336be
+		*version = pm_tz_version;
e336be
+		return 0;
e336be
+	}
e336be
+	ret = zynqmp_pm_invoke_fn(PM_GET_TRUSTZONE_VERSION, 0, 0,
e336be
+				  0, 0, ret_payload);
e336be
+	*version = ret_payload[1];
e336be
+
e336be
+	return ret;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * get_set_conduit_method() - Choose SMC or HVC based communication
e336be
+ * @np:		Pointer to the device_node structure
e336be
+ *
e336be
+ * Use SMC or HVC-based functions to communicate with EL2/EL3.
e336be
+ *
e336be
+ * Return: Returns 0 on success or error code
e336be
+ */
e336be
+static int get_set_conduit_method(struct device_node *np)
e336be
+{
e336be
+	const char *method;
e336be
+
e336be
+	if (of_property_read_string(np, "method", &method)) {
e336be
+		pr_warn("%s missing \"method\" property\n", __func__);
e336be
+		return -ENXIO;
e336be
+	}
e336be
+
e336be
+	if (!strcmp("hvc", method)) {
e336be
+		do_fw_call = do_fw_call_hvc;
e336be
+	} else if (!strcmp("smc", method)) {
e336be
+		do_fw_call = do_fw_call_smc;
e336be
+	} else {
e336be
+		pr_warn("%s Invalid \"method\" property: %s\n",
e336be
+			__func__, method);
e336be
+		return -EINVAL;
e336be
+	}
e336be
+
e336be
+	return 0;
e336be
+}
e336be
+
e336be
+static const struct zynqmp_eemi_ops eemi_ops = {
e336be
+	.get_api_version = zynqmp_pm_get_api_version,
e336be
+};
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_get_eemi_ops - Get eemi ops functions
e336be
+ *
e336be
+ * Return: Pointer of eemi_ops structure
e336be
+ */
e336be
+const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
e336be
+{
e336be
+	return &eemi_ops;
e336be
+}
e336be
+EXPORT_SYMBOL_GPL(zynqmp_pm_get_eemi_ops);
e336be
+
e336be
+static int zynqmp_firmware_probe(struct platform_device *pdev)
e336be
+{
e336be
+	struct device *dev = &pdev->dev;
e336be
+
e336be
+	return of_platform_populate(dev->of_node, NULL, NULL, dev);
e336be
+}
e336be
+
e336be
+static const struct of_device_id zynqmp_firmware_of_match[] = {
e336be
+	{.compatible = "xlnx,zynqmp-firmware"},
e336be
+	{},
e336be
+};
e336be
+MODULE_DEVICE_TABLE(of, zynqmp_firmware_of_match);
e336be
+
e336be
+static struct platform_driver zynqmp_firmware_driver = {
e336be
+	.driver = {
e336be
+		.name = "zynqmp_firmware",
e336be
+		.of_match_table = zynqmp_firmware_of_match,
e336be
+	},
e336be
+	.probe = zynqmp_firmware_probe,
e336be
+};
e336be
+module_platform_driver(zynqmp_firmware_driver);
e336be
+
e336be
+static int __init zynqmp_plat_init(void)
e336be
+{
e336be
+	int ret;
e336be
+	struct device_node *np;
e336be
+
e336be
+	np = of_find_compatible_node(NULL, NULL, "xlnx,zynqmp");
e336be
+	if (!np)
e336be
+		return 0;
e336be
+	of_node_put(np);
e336be
+
e336be
+	/*
e336be
+	 * We're running on a ZynqMP machine,
e336be
+	 * the zynqmp-firmware node is mandatory.
e336be
+	 */
e336be
+	np = of_find_compatible_node(NULL, NULL, "xlnx,zynqmp-firmware");
e336be
+	if (!np) {
e336be
+		pr_warn("%s: zynqmp-firmware node not found\n", __func__);
e336be
+		return -ENXIO;
e336be
+	}
e336be
+
e336be
+	ret = get_set_conduit_method(np);
e336be
+	if (ret) {
e336be
+		of_node_put(np);
e336be
+		return ret;
e336be
+	}
e336be
+
e336be
+	/* Check PM API version number */
e336be
+	zynqmp_pm_get_api_version(&pm_api_version);
e336be
+	if (pm_api_version < ZYNQMP_PM_VERSION) {
e336be
+		panic("%s Platform Management API version error. Expected: v%d.%d - Found: v%d.%d\n",
e336be
+		      __func__,
e336be
+		      ZYNQMP_PM_VERSION_MAJOR, ZYNQMP_PM_VERSION_MINOR,
e336be
+		      pm_api_version >> 16, pm_api_version & 0xFFFF);
e336be
+	}
e336be
+
e336be
+	pr_info("%s Platform Management API v%d.%d\n", __func__,
e336be
+		pm_api_version >> 16, pm_api_version & 0xFFFF);
e336be
+
e336be
+	/* Check trustzone version number */
e336be
+	ret = zynqmp_pm_get_trustzone_version(&pm_tz_version);
e336be
+	if (ret)
e336be
+		panic("Legacy trustzone found without version support\n");
e336be
+
e336be
+	if (pm_tz_version < ZYNQMP_TZ_VERSION)
e336be
+		panic("%s Trustzone version error. Expected: v%d.%d - Found: v%d.%d\n",
e336be
+		      __func__,
e336be
+		      ZYNQMP_TZ_VERSION_MAJOR, ZYNQMP_TZ_VERSION_MINOR,
e336be
+		      pm_tz_version >> 16, pm_tz_version & 0xFFFF);
e336be
+
e336be
+	pr_info("%s Trustzone version v%d.%d\n", __func__,
e336be
+		pm_tz_version >> 16, pm_tz_version & 0xFFFF);
e336be
+
e336be
+	of_node_put(np);
e336be
+
e336be
+	return ret;
e336be
+}
e336be
+early_initcall(zynqmp_plat_init);
e336be
diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h
e336be
new file mode 100644
e336be
index 0000000..cb63bed
e336be
--- /dev/null
e336be
+++ b/include/linux/firmware/xlnx-zynqmp.h
e336be
@@ -0,0 +1,63 @@
e336be
+/* SPDX-License-Identifier: GPL-2.0 */
e336be
+/*
e336be
+ * Xilinx Zynq MPSoC Firmware layer
e336be
+ *
e336be
+ *  Copyright (C) 2014-2018 Xilinx
e336be
+ *
e336be
+ *  Michal Simek <michal.simek@xilinx.com>
e336be
+ *  Davorin Mista <davorin.mista@aggios.com>
e336be
+ *  Jolly Shah <jollys@xilinx.com>
e336be
+ *  Rajan Vaja <rajanv@xilinx.com>
e336be
+ */
e336be
+
e336be
+#ifndef __FIRMWARE_ZYNQMP_H__
e336be
+#define __FIRMWARE_ZYNQMP_H__
e336be
+
e336be
+#define ZYNQMP_PM_VERSION_MAJOR	1
e336be
+#define ZYNQMP_PM_VERSION_MINOR	0
e336be
+
e336be
+#define ZYNQMP_PM_VERSION	((ZYNQMP_PM_VERSION_MAJOR << 16) | \
e336be
+					ZYNQMP_PM_VERSION_MINOR)
e336be
+
e336be
+#define ZYNQMP_TZ_VERSION_MAJOR	1
e336be
+#define ZYNQMP_TZ_VERSION_MINOR	0
e336be
+
e336be
+#define ZYNQMP_TZ_VERSION	((ZYNQMP_TZ_VERSION_MAJOR << 16) | \
e336be
+					ZYNQMP_TZ_VERSION_MINOR)
e336be
+
e336be
+/* SMC SIP service Call Function Identifier Prefix */
e336be
+#define PM_SIP_SVC			0xC2000000
e336be
+#define PM_GET_TRUSTZONE_VERSION	0xa03
e336be
+
e336be
+/* Number of 32bits values in payload */
e336be
+#define PAYLOAD_ARG_CNT	4U
e336be
+
e336be
+enum pm_api_id {
e336be
+	PM_GET_API_VERSION = 1,
e336be
+};
e336be
+
e336be
+/* PMU-FW return status codes */
e336be
+enum pm_ret_status {
e336be
+	XST_PM_SUCCESS = 0,
e336be
+	XST_PM_INTERNAL = 2000,
e336be
+	XST_PM_CONFLICT,
e336be
+	XST_PM_NO_ACCESS,
e336be
+	XST_PM_INVALID_NODE,
e336be
+	XST_PM_DOUBLE_REQ,
e336be
+	XST_PM_ABORT_SUSPEND,
e336be
+};
e336be
+
e336be
+struct zynqmp_eemi_ops {
e336be
+	int (*get_api_version)(u32 *version);
e336be
+};
e336be
+
e336be
+#if IS_REACHABLE(CONFIG_ARCH_ZYNQMP)
e336be
+const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void);
e336be
+#else
e336be
+static inline struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void)
e336be
+{
e336be
+	return NULL;
e336be
+}
e336be
+#endif
e336be
+
e336be
+#endif /* __FIRMWARE_ZYNQMP_H__ */
e336be
e336be
From patchwork Fri Aug  3 17:53:20 2018
e336be
Content-Type: text/plain; charset="utf-8"
e336be
MIME-Version: 1.0
e336be
Content-Transfer-Encoding: 7bit
e336be
X-Patchwork-Submitter: Jolly Shah <jolly.shah@xilinx.com>
e336be
X-Patchwork-Id: 10555417
e336be
Return-Path: 
e336be
 <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org>
e336be
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
e336be
 [172.30.200.125])
e336be
	by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 91BF214E2
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:06:13 +0000 (UTC)
e336be
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7E6142C1AF
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:06:13 +0000 (UTC)
e336be
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
e336be
	id 70B232C984; Fri,  3 Aug 2018 18:06:13 +0000 (UTC)
e336be
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
e336be
	pdx-wl-mail.web.codeaurora.org
e336be
X-Spam-Level: 
e336be
X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00,
e336be
	DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1
e336be
Received: from bombadil.infradead.org (bombadil.infradead.org
e336be
 [198.137.202.133])
e336be
	(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))
e336be
	(No client certificate requested)
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 170142C1AF
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:06:13 +0000 (UTC)
e336be
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
e336be
	d=lists.infradead.org; s=bombadil.20170209; h=Sender:
e336be
	Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:
e336be
	List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:
e336be
	Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:
e336be
	Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
e336be
	List-Owner; bh=jz6LKO4I2dwn181XWtMCOq9Hd1kqEV1xqUWkQI6crAY=; b=kiVp7VRmI8zgnU
e336be
	r/5hK1KgczbBXgNRmIa3EnW+F2GkQ7e7Td/0zCAPNAlvAfqjGxmRZVMtojehW74wXU7sd9AgbFA4o
e336be
	RuKj9LeNGWmB3LAUtQDpkhE5U5xVRzUM/hdLx201nkxjqpETPtFGxLm/xrutjB7IdDDobZdFjRAJV
e336be
	KQyV1YrS4XKGi5scLkOqXGLj30C2KyGTUJv64IzqZunWuSaxln2Z23r+MPn4/2UrZD6KApsbgGKnt
e336be
	fihAeJG7kVT3m7XlB6xkMZ2LggL4X+MY41M8rx9Ziq4NUP6eBMK1M4ihlrlbpEBk+SUzWepAblugX
e336be
	UldLG5gfKjOen6V7UYSQ==;
e336be
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
e336be
	by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))
e336be
	id 1fleSl-00028q-LW; Fri, 03 Aug 2018 18:06:07 +0000
e336be
Received: from mail-bl2nam02on0609.outbound.protection.outlook.com
e336be
 ([2a01:111:f400:fe46::609]
e336be
 helo=NAM02-BL2-obe.outbound.protection.outlook.com)
e336be
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
e336be
 id 1fleHE-0002lN-SO
e336be
 for linux-arm-kernel@lists.infradead.org; Fri, 03 Aug 2018 17:54:17 +0000
e336be
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
e336be
 d=xilinx.onmicrosoft.com; s=selector1-xilinx-com;
e336be
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
e336be
 bh=iY9q6XzlDsriWHdrcuaPTnv10bXo5ZNfFWWu1fIDmys=;
e336be
 b=PyH+SKJTMqScUwv89VJ+MKfI5lraVw6m7ZZJaAjG+waZ90iLQ2qG0TK7i9aZO39UB23PVtQihAh79ZiFpveFAM+dYBAHo3S4z0lBh8Ni6RBC6wQ3a6p/6zuC4FHVNmIGo6J9Jo1w7ca0jrwyjLfGOs777eDyc/yEo4wjaRkM+Y4=
e336be
Received: from MWHPR02CA0012.namprd02.prod.outlook.com (2603:10b6:300:4b::22)
e336be
 by DM5PR0201MB3511.namprd02.prod.outlook.com (2603:10b6:4:77::11)
e336be
 with Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.20; Fri, 3 Aug
e336be
 2018 17:53:54 +0000
e336be
Received: from CY1NAM02FT044.eop-nam02.prod.protection.outlook.com
e336be
 (2a01:111:f400:7e45::207) by MWHPR02CA0012.outlook.office365.com
e336be
 (2603:10b6:300:4b::22) with Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.15 via Frontend
e336be
 Transport; Fri, 3 Aug 2018 17:53:53 +0000
e336be
Authentication-Results: spf=pass (sender IP is 149.199.60.83)
e336be
 smtp.mailfrom=xilinx.com; linaro.org; dkim=none (message not signed)
e336be
 header.d=none;linaro.org; dmarc=bestguesspass action=none
e336be
 header.from=xilinx.com;
e336be
Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates
e336be
 149.199.60.83 as permitted sender) receiver=protection.outlook.com;
e336be
 client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01;
e336be
Received: from xsj-pvapsmtpgw01 (149.199.60.83) by
e336be
 CY1NAM02FT044.mail.protection.outlook.com (10.152.75.137) with Microsoft SMTP
e336be
 Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1038.3
e336be
 via Frontend Transport; Fri, 3 Aug 2018 17:53:52 +0000
e336be
Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01)
e336be
 by xsj-pvapsmtpgw01 with esmtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGu-0004fh-7w; Fri, 03 Aug 2018 10:53:52 -0700
e336be
Received: from [127.0.0.1] (helo=localhost)
e336be
 by xsj-pvapsmtp01 with smtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGp-0007cn-47; Fri, 03 Aug 2018 10:53:47 -0700
e336be
Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com)
e336be
 by xsj-pvapsmtp01 with esmtp (Exim 4.63)
e336be
 (envelope-from <jollys@xilinx.com>)
e336be
 id 1fleGl-0007bh-9X; Fri, 03 Aug 2018 10:53:43 -0700
e336be
From: Jolly Shah <jolly.shah@xilinx.com>
e336be
To: <ard.biesheuvel@linaro.org>, <mingo@kernel.org>,
e336be
 <gregkh@linuxfoundation.org>, <matt@codeblueprint.co.uk>,
e336be
 <sudeep.holla@arm.com>, <hkallweit1@gmail.com>, <keescook@chromium.org>,
e336be
 <dmitry.torokhov@gmail.com>, <mturquette@baylibre.com>,
e336be
 <sboyd@codeaurora.org>, <michal.simek@xilinx.com>, <robh+dt@kernel.org>,
e336be
 <mark.rutland@arm.com>, <linux-clk@vger.kernel.org>
e336be
Subject: [PATCH v11 03/11] firmware: xilinx: Add zynqmp IOCTL API for device
e336be
 control
e336be
Date: Fri, 3 Aug 2018 10:53:20 -0700
e336be
Message-ID: <1533318808-10781-4-git-send-email-jollys@xilinx.com>
e336be
X-Mailer: git-send-email 2.7.4
e336be
In-Reply-To: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
References: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005
e336be
X-TM-AS-User-Approved-Sender: Yes;Yes
e336be
X-EOPAttributedMessage: 0
e336be
X-MS-Office365-Filtering-HT: Tenant
e336be
X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI;
e336be
 SFV:NSPM;
e336be
 SFS:(10009020)(346002)(376002)(396003)(136003)(39860400002)(2980300002)(438002)(199004)(189003)(107886003)(2201001)(39060400002)(106466001)(50226002)(217873002)(4326008)(9786002)(63266004)(77096007)(47776003)(5660300001)(26005)(110136005)(446003)(2906002)(426003)(50466002)(486006)(186003)(6666003)(305945005)(356003)(48376002)(336012)(316002)(81166006)(81156014)(76176011)(51416003)(106002)(8676002)(11346002)(2616005)(7696005)(476003)(126002)(72206003)(36386004)(36756003)(478600001)(16586007)(7416002)(44832011)(8936002)(54906003)(107986001)(921003)(1121003);
e336be
 DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR0201MB3511; H:xsj-pvapsmtpgw01; FPR:;
e336be
 SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1;
e336be
X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT044;
e336be
 1:gZGQQHUnCMARprb6H5I1+asn9Hsgw0Tnc287HYKOHfR5S/7U0ESoiGbRMZTznYI1DBXfcyO2cxS72IPUNBQGR1K2NyehQW9DMkwQObyeUsO50T0munQpAgbHuqKFiy3B
e336be
MIME-Version: 1.0
e336be
X-MS-PublicTrafficType: Email
e336be
X-MS-Office365-Filtering-Correlation-Id: 01c19963-0a15-47c4-31f0-08d5f96a13ca
e336be
X-Microsoft-Antispam: BCL:0; PCL:0;
e336be
 RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);
e336be
 SRVR:DM5PR0201MB3511;
e336be
X-Microsoft-Exchange-Diagnostics: 1; DM5PR0201MB3511;
e336be
 3:+ceyPEYBjP+JZt8oITNykf5abb8Ux+W3WBMnt4cjJfV/Gc2sIAD1tjtxO1S10Z1hs4B0J95XH2RFwsf80tyZzVGY+Km/vlAi18SyZsC8WqGhO7DJbUko9kKYmmebcalphvyjckHnt7iEEqWmRuDEIGmRj3/wrgX/K+B4YESCmXC95JP0qwcXjtH4oYi0MrGKBb4DND0q29uXRfxtDu3KozcVNgVPAFMLIKwcXD+fYVaSdYjpwHh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0IfFG2DXFarUwVN66AbR3hiTBckEHRBzs9ZwK2GPVUxdI75M0E/OYhfBpWGphWlHyC9rtlNZW7um07DaaZ7+5QOTbbWXzMdxb0dK+kgXFWnZoEZNbdyLqDq27/HQyuNgr78egpZfh/eKg6js50jVBSVaZJu2fPoLBG2fcOjGhDw+joAmphB4u+wbFuClZa9fMlk+0sY4YZg8gl/5bQT6Lsfa+MRLpo5eHqIW0wnpRNcuO6
e336be
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
e336be
X-Microsoft-Antispam-PRVS: 
e336be
 <DM5PR0201MB35113DCF800C8F51851C2010B8230@DM5PR0201MB3511.namprd02.prod.outlook.com>
e336be
X-Exchange-Antispam-Report-Test: UriScan:(192813158149592);
e336be
X-MS-Exchange-SenderADCheck: 1
e336be
X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0;
e336be
 RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93004095)(3231311)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016);
e336be
 SRVR:DM5PR0201MB3511; BCL:0; PCL:0; RULEID:; SRVR:DM5PR0201MB3511;
e336be
X-Microsoft-Exchange-Diagnostics: 1; DM5PR0201MB3511;
e336be
 4:eo5MTD3N7roBUHJvekYRU3IvNUurdAwzI4Fya7jPE/rp01CBkRdE/xNWJxKFRg0G+gtllCV6ShNqZ4719ZlBYrgME8tfezNcQn0x3/wLcp4NrN/AyLx5K55FuJFRtNOOM05OdrEViU9wm1rY/F8zc5/S6XZEM7cyXJR3G4b7JCUqRsv9ZXDW+qM6MUrhvTRdiOUo6gN0d+F2FsyGgqV6GFwsbRH9pJKBuIqlS5/E3iZqxJynkjcIxK5sb0ooo5h/ghexaSxtX0EwoBjaDkx8z1TUE9vuGo96/0IOHbTV9Mj5iyIzofXMdwes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QOkhMW5SFAHJvSUJQk9cgVRwGDAFOfyN9dClNtlO2NjdUts3oqJyQgYTzdtnodjDbiiYIFMTFIwsvBUqF1fqrrpvuyfovREm/CNq5Qa6bqYGEQ2N4GQbvW3ueRMomPMHb9frK77gRv85ksJAHxg==;
e336be
 5:Lp450hifZ/Nz7ZY/44/zL8XfBA6+yCopissF9iwagzjRuviDP6ENfU8WHJEuFEJvm17N5L2pRV37qzpfWakzkKlrQv3BME+CHHTAd80vqI9L3wJEmAYKDjwQOkuLt2Cu1r8X9tdbd9wsMTcCWcpVeCtUyB4YNPg1ZzcI+cAsSfk=;
e336be
 7:8cxczJaeYNhowMZfCrjvNeD+h4Q3sgGrLgQk/N/44XhFHYUEYQeL1O9WMRLvxgwyKcMuJylLfle2HlP+GAElAD+DD91Ec8SOfu3VphuaVYMl0tCKCi+vYpY8aLxBzRkY0lWJ6HG2Cscv0RCv+fOaiKbGQbAy7vJ6QdqjEbSMDP69U0Z3lY1uTVhLlFXhjzcqLGOFnjgthqa00FS1NeIkt0urZPaEqlomSJKBy4nLnSBwDZ+o0PnAAZdr2T7+gCgz
e336be
SpamDiagnosticOutput: 1:99
e336be
SpamDiagnosticMetadata: NSPM
e336be
X-OriginatorOrg: xilinx.com
e336be
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2018 17:53:52.7598 (UTC)
e336be
X-MS-Exchange-CrossTenant-Network-Message-Id: 
e336be
 01c19963-0a15-47c4-31f0-08d5f96a13ca
e336be
X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c
e336be
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: 
e336be
 TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83];
e336be
 Helo=[xsj-pvapsmtpgw01]
e336be
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
e336be
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR0201MB3511
e336be
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
e336be
X-CRM114-CacheID: sfid-20180803_105413_430833_66CD49D0 
e336be
X-CRM114-Status: GOOD (  10.11  )
e336be
X-BeenThere: linux-arm-kernel@lists.infradead.org
e336be
X-Mailman-Version: 2.1.21
e336be
Precedence: list
e336be
List-Id: <linux-arm-kernel.lists.infradead.org>
e336be
List-Unsubscribe: 
e336be
 <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
e336be
List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
e336be
List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
e336be
List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
e336be
List-Subscribe: 
e336be
 <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
e336be
Cc: devicetree@vger.kernel.org, rajanv@xilinx.com,
e336be
 linux-kernel@vger.kernel.org,
e336be
 linux-arm-kernel@lists.infradead.org, Jolly Shah <jollys@xilinx.com>
e336be
Content-Type: text/plain; charset="us-ascii"
e336be
Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
e336be
Errors-To: 
e336be
 linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
e336be
X-Virus-Scanned: ClamAV using ClamSMTP
e336be
e336be
From: Rajan Vaja <rajanv@xilinx.com>
e336be
e336be
Add ZynqMP firmware IOCTL API to control and configure
e336be
devices like PLLs, SD, Gem, etc.
e336be
e336be
Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
e336be
Signed-off-by: Jolly Shah <jollys@xilinx.com>
e336be
---
e336be
 drivers/firmware/xilinx/zynqmp.c     | 20 ++++++++++++++++++++
e336be
 include/linux/firmware/xlnx-zynqmp.h |  2 ++
e336be
 2 files changed, 22 insertions(+)
e336be
e336be
diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
e336be
index edbb84e..24cfd9e 100644
e336be
--- a/drivers/firmware/xilinx/zynqmp.c
e336be
+++ b/drivers/firmware/xilinx/zynqmp.c
e336be
@@ -241,8 +241,28 @@ static int get_set_conduit_method(struct device_node *np)
e336be
 	return 0;
e336be
 }
e336be
 
e336be
+/**
e336be
+ * zynqmp_pm_ioctl() - PM IOCTL API for device control and configs
e336be
+ * @node_id:	Node ID of the device
e336be
+ * @ioctl_id:	ID of the requested IOCTL
e336be
+ * @arg1:	Argument 1 to requested IOCTL call
e336be
+ * @arg2:	Argument 2 to requested IOCTL call
e336be
+ * @out:	Returned output value
e336be
+ *
e336be
+ * This function calls IOCTL to firmware for device control and configuration.
e336be
+ *
e336be
+ * Return: Returns status, either success or error+reason
e336be
+ */
e336be
+static int zynqmp_pm_ioctl(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2,
e336be
+			   u32 *out)
e336be
+{
e336be
+	return zynqmp_pm_invoke_fn(PM_IOCTL, node_id, ioctl_id,
e336be
+				   arg1, arg2, out);
e336be
+}
e336be
+
e336be
 static const struct zynqmp_eemi_ops eemi_ops = {
e336be
 	.get_api_version = zynqmp_pm_get_api_version,
e336be
+	.ioctl = zynqmp_pm_ioctl,
e336be
 };
e336be
 
e336be
 /**
e336be
diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h
e336be
index cb63bed..2eec6e7 100644
e336be
--- a/include/linux/firmware/xlnx-zynqmp.h
e336be
+++ b/include/linux/firmware/xlnx-zynqmp.h
e336be
@@ -34,6 +34,7 @@
e336be
 
e336be
 enum pm_api_id {
e336be
 	PM_GET_API_VERSION = 1,
e336be
+	PM_IOCTL = 34,
e336be
 };
e336be
 
e336be
 /* PMU-FW return status codes */
e336be
@@ -49,6 +50,7 @@ enum pm_ret_status {
e336be
 
e336be
 struct zynqmp_eemi_ops {
e336be
 	int (*get_api_version)(u32 *version);
e336be
+	int (*ioctl)(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2, u32 *out);
e336be
 };
e336be
 
e336be
 #if IS_REACHABLE(CONFIG_ARCH_ZYNQMP)
e336be
e336be
From patchwork Fri Aug  3 17:53:21 2018
e336be
Content-Type: text/plain; charset="utf-8"
e336be
MIME-Version: 1.0
e336be
Content-Transfer-Encoding: 7bit
e336be
X-Patchwork-Submitter: Jolly Shah <jolly.shah@xilinx.com>
e336be
X-Patchwork-Id: 10555421
e336be
Return-Path: 
e336be
 <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org>
e336be
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
e336be
 [172.30.200.125])
e336be
	by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E183E15E9
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:06:35 +0000 (UTC)
e336be
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDD572C983
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:06:35 +0000 (UTC)
e336be
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
e336be
	id C15B82C985; Fri,  3 Aug 2018 18:06:35 +0000 (UTC)
e336be
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
e336be
	pdx-wl-mail.web.codeaurora.org
e336be
X-Spam-Level: 
e336be
X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00,
e336be
	DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1
e336be
Received: from bombadil.infradead.org (bombadil.infradead.org
e336be
 [198.137.202.133])
e336be
	(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))
e336be
	(No client certificate requested)
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6A7402C983
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:06:35 +0000 (UTC)
e336be
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
e336be
	d=lists.infradead.org; s=bombadil.20170209; h=Sender:
e336be
	Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:
e336be
	List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:
e336be
	Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:
e336be
	Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
e336be
	List-Owner; bh=91//MvALW6sgI3tZTiqNtEggoAHmWLgPcy+WH96S//Y=; b=gnpme1Lvz+gnsb
e336be
	AbHfxKiAICf8kzeMoKBEYwsqRHtKs7qrDNklNtr7mxQbFyblZXxuwlwqiIEyaOTnHTjejfZmEX8qJ
e336be
	0oGGw9be9yBsaMAZGWoTNfOcUt/Hp/I7PmW/VaLkAI8uccS4ezP3Qxhq2XGX1CB8mQRHd1wxBKX4Y
e336be
	gyXGWaY6RBYYUt6R7a+XpZh6WMd6py++Bp+qufhAOvbtEv4IcTm95l3+battKvbDSWmUsjYZJAtnV
e336be
	hV1HnAy5wG2MvRSFBvkaiKBtnVQD2RFGq+6+SW2Ses/VYJS/ITDLDGCj5LeT2J6N9EDeQMmr0kkwM
e336be
	uhWG7uzjJQ3Jq6L+F4Eg==;
e336be
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
e336be
	by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))
e336be
	id 1fleT6-0002b2-Oj; Fri, 03 Aug 2018 18:06:28 +0000
e336be
Received: from mail-co1nam05on0624.outbound.protection.outlook.com
e336be
 ([2a01:111:f400:fe50::624]
e336be
 helo=NAM05-CO1-obe.outbound.protection.outlook.com)
e336be
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
e336be
 id 1fleHJ-0002lp-Q7
e336be
 for linux-arm-kernel@lists.infradead.org; Fri, 03 Aug 2018 17:54:23 +0000
e336be
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
e336be
 d=xilinx.onmicrosoft.com; s=selector1-xilinx-com;
e336be
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
e336be
 bh=HeHcqfhBmNmq3+qiRcWBF2dzjyZqhOAmxkz2chz3+sg=;
e336be
 b=em8vzxLpipjwDvV7ib9NoNojbhR+Y10UI/FtxNc/yXmmBHmcZUeAHgcQfqk1K4b7nuqdrTHD2lqq3w3ijlTqQALO6flKDnss8DqCVtja9OXb+PZ3RVsg8ovHgHphO/H0Uz6NqSl545Li5z+4ewrUDkdPmpPzxiCZX/8BXx8EL3Q=
e336be
Received: from MWHPR02CA0051.namprd02.prod.outlook.com (2603:10b6:301:60::40)
e336be
 by CY4PR0201MB3506.namprd02.prod.outlook.com (2603:10b6:910:95::12)
e336be
 with Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Fri, 3 Aug
e336be
 2018 17:53:54 +0000
e336be
Received: from CY1NAM02FT035.eop-nam02.prod.protection.outlook.com
e336be
 (2a01:111:f400:7e45::208) by MWHPR02CA0051.outlook.office365.com
e336be
 (2603:10b6:301:60::40) with Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.15 via Frontend
e336be
 Transport; Fri, 3 Aug 2018 17:53:54 +0000
e336be
Authentication-Results: spf=pass (sender IP is 149.199.60.83)
e336be
 smtp.mailfrom=xilinx.com; linaro.org; dkim=none (message not signed)
e336be
 header.d=none;linaro.org; dmarc=bestguesspass action=none
e336be
 header.from=xilinx.com;
e336be
Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates
e336be
 149.199.60.83 as permitted sender) receiver=protection.outlook.com;
e336be
 client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01;
e336be
Received: from xsj-pvapsmtpgw01 (149.199.60.83) by
e336be
 CY1NAM02FT035.mail.protection.outlook.com (10.152.75.186) with Microsoft SMTP
e336be
 Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1038.3
e336be
 via Frontend Transport; Fri, 3 Aug 2018 17:53:53 +0000
e336be
Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01)
e336be
 by xsj-pvapsmtpgw01 with esmtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGu-0004fk-MD; Fri, 03 Aug 2018 10:53:52 -0700
e336be
Received: from [127.0.0.1] (helo=localhost)
e336be
 by xsj-pvapsmtp01 with smtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGp-0007cn-IW; Fri, 03 Aug 2018 10:53:47 -0700
e336be
Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com)
e336be
 by xsj-pvapsmtp01 with esmtp (Exim 4.63)
e336be
 (envelope-from <jollys@xilinx.com>)
e336be
 id 1fleGl-0007bh-Bn; Fri, 03 Aug 2018 10:53:43 -0700
e336be
From: Jolly Shah <jolly.shah@xilinx.com>
e336be
To: <ard.biesheuvel@linaro.org>, <mingo@kernel.org>,
e336be
 <gregkh@linuxfoundation.org>, <matt@codeblueprint.co.uk>,
e336be
 <sudeep.holla@arm.com>, <hkallweit1@gmail.com>, <keescook@chromium.org>,
e336be
 <dmitry.torokhov@gmail.com>, <mturquette@baylibre.com>,
e336be
 <sboyd@codeaurora.org>, <michal.simek@xilinx.com>, <robh+dt@kernel.org>,
e336be
 <mark.rutland@arm.com>, <linux-clk@vger.kernel.org>
e336be
Subject: [PATCH v11 04/11] firmware: xilinx: Add query data API
e336be
Date: Fri, 3 Aug 2018 10:53:21 -0700
e336be
Message-ID: <1533318808-10781-5-git-send-email-jollys@xilinx.com>
e336be
X-Mailer: git-send-email 2.7.4
e336be
In-Reply-To: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
References: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005
e336be
X-TM-AS-User-Approved-Sender: Yes;Yes
e336be
X-EOPAttributedMessage: 0
e336be
X-MS-Office365-Filtering-HT: Tenant
e336be
X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI;
e336be
 SFV:NSPM;
e336be
 SFS:(10009020)(39860400002)(346002)(136003)(376002)(396003)(2980300002)(438002)(199004)(189003)(316002)(106466001)(63266004)(14444005)(106002)(54906003)(110136005)(186003)(48376002)(336012)(16586007)(50466002)(47776003)(107886003)(39060400002)(5660300001)(4326008)(76176011)(7416002)(6666003)(7696005)(51416003)(77096007)(26005)(2906002)(476003)(2616005)(356003)(126002)(305945005)(2201001)(446003)(81156014)(81166006)(11346002)(36386004)(8676002)(8936002)(50226002)(426003)(36756003)(486006)(72206003)(9786002)(478600001)(44832011)(107986001)(921003)(1121003);
e336be
 DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR0201MB3506; H:xsj-pvapsmtpgw01; FPR:;
e336be
 SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1;
e336be
X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT035;
e336be
 1:rHO0CWpu3BkBhjLm5sQEzS8kU4B8BzsZSNTyXn8pPVQZy6q6XTizv8x/hh1yu5wry1vGa936pLJ4AebHHKuktr1GwZURZV5Gtoa9EDRW2u6oEJPuparxwgagFnTk3e5k
e336be
MIME-Version: 1.0
e336be
X-MS-PublicTrafficType: Email
e336be
X-MS-Office365-Filtering-Correlation-Id: f96ba5b8-4c9b-40ac-b48f-08d5f96a140c
e336be
X-Microsoft-Antispam: BCL:0; PCL:0;
e336be
 RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);
e336be
 SRVR:CY4PR0201MB3506;
e336be
X-Microsoft-Exchange-Diagnostics: 1; CY4PR0201MB3506;
e336be
 3:icf20laLQcgZdqpqBhpbCkReu96OBDGu9KoOR5B3zstZU8lV4txOHYfzZJqka2HbTy3BO7I9Ls1KThGolH4ufqGhaV3UBXRt+nUGUs23bh2S16Osm3yr9IYeIBuEBHW5PiKhoGtHc6jV1J92b4wm3/pGSjPMkgv7C+M6qczYjpqkQ1ErM62iBAYaxG6kWM7zxqxHrByqIEGB42QEh/UUdVvNcEjGqAXyvafTXvUmjpxM82pq8mlBqS+ltvFaE516eVzL2y5PL2GP52FqaGPe0pQ2dXrG/REg8OxbiJ9InA03FatDQZFGyo0G6yA4DDWLTCHAKB6OlZF7kL0k/rOR7OU33SQu9COiqEBXvEl0g3M=;
e336be
 25:snIbKqkfJkhDyWf51lqz+kqNXcYoHqXKskJruUr1unSfP+rieYPSEwzJg+riTjFqnkHTVzJMDQWW9pOwzJvo1RTqWGHuqhs9+IcgPqhOsvg2xhAJOXd6o1XS6LuulnOMKCD0ECcrH7NGtWPBS8FWqfS6iv1nBaXre8fZAFipTsoDSeS4esL176RqefKrPnsOBDhCpbIvBXcXN4Gx4zkqEnPmkSOvbT1eoPBzaUQAacyV2y4Hh/q55AEY8hvvU6L9fKNaebKIqrG45QchzlAsXj+NZlDSDyCccnoXeVQMDUg10NC0O3M9cgUsRnL9hKMiG4sQWwfGDEobVo0NaXVmUw==
e336be
X-MS-TrafficTypeDiagnostic: CY4PR0201MB3506:
e336be
X-Microsoft-Exchange-Diagnostics: 1; CY4PR0201MB3506;
e336be
 31:84G5vx0+8ZAwby6IT9aNY8bGeCPuqtIE9Sx0ijSdqocBlbz2VYUIhBP/3IpX1RKMmfGZCGJEdHiSl8ft+q4gODlCVLtU14S3oacBfsotRdhaMBYmmmO/fsU+PTW4Sfpi8RcVAuEHZXqALm9q3LS5noD8ttxBQOkDwoebSZGTl1yVyKc6rGbzGcXvrQKz7d/QQj5pwq6cZNkSlEvCjBMRCkw4qOYtzAah4V1DLLVrhrk=;
e336be
 20:uHnibOv0p9c2GZhcNLdfOwE1EoMsGRtmkKhH0Qqqu5VgIEwx6iceOrpN/WFsJ7SCRDBu6pFY/dId99kb5Q5m7hTkW2ScXBwoOhxDAXDGSZ2ryp2DaiXJ6EJzGDrRgArfdy/Shbb+3BEmchdLVPGzfxoWQZr8VWdGIrrDuXzho/PNsQiWJywexO6Pm5i6H9OFB8tybqgpJcdUV8mSekXeX4MhQLgQ/wEyUeahhLMeIV33UzCkJG8dZ499/Q2/0WsaB1cQxy7w91DdbYqfjKEqD67yhrz6xjnRb2QAJTCXBVI3Q4X6ajQ8ryEPlSt6F/LoenF2IJVOuLTX+aDhkFEg2uToVnt2uLwF+AqA2s3Xkog+cg4BflpcnBfYVJiH0ey04nKKbZXUFjCDsmF6nV7SjriAcqmmiOxOrswQ5HFftKiYLmVJE/mAmkDWUhcBaGpD1/Iw8KwmoDnzZy1dHKZ0Dw2z29IQZja6uEqFZiVjeLxJ6m5HrYLjJ0GYWI+mTz+p
e336be
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
e336be
X-Microsoft-Antispam-PRVS: 
e336be
 <CY4PR0201MB350627A1558BE520E20DC02BB8230@CY4PR0201MB3506.namprd02.prod.outlook.com>
e336be
X-Exchange-Antispam-Report-Test: UriScan:(192813158149592);
e336be
X-MS-Exchange-SenderADCheck: 1
e336be
X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0;
e336be
 RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93004095)(10201501046)(3002001)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);
e336be
 SRVR:CY4PR0201MB3506; BCL:0; PCL:0; RULEID:; SRVR:CY4PR0201MB3506;
e336be
X-Microsoft-Exchange-Diagnostics: 1; CY4PR0201MB3506;
e336be
 4:f8yeNLyGBcVliADEJi6+6wv81pg1iumiVJILRGKC3y6qFaPNJLAww3Tj3K9JIR+yiMlIHFyv+0RCz9Ub9GyQZj6WkcJUYB+WjkYga9V2Z+twlECgaB3RBNoz/wppsudzTd9RYEuaf1KmEFYKQhzSWnaQXx5L+9lUi76OogHHJX+ZXLR/RL5T89h4P76C4BGGiFhzR4vU9dl/Ey2fU7VRnXrfKwS0LSgnKq7Sy7CdPt51IObIciOBWLFINbanIrN9fBcBMTArdZSuGkv1lR+mDucR1/fzj/vrFzTxihSKX6iCbT1fchDFfhj72uKSq8Ff
e336be
X-Forefront-PRVS: 0753EA505A
e336be
X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR0201MB3506;
e336be
 23:hhCwJI0woEpyaZpm9g72KxA7XZ8ta8no71Dnhjs?=
e336be
 Knczn3Rx9AGJ2FDCKhvKDXACej/b/eW/POMMmL+/3vuKbv3NlbLhac2kdzcNZC0xLQGfF5+DhQA7qxJvKqUq0lDWiiPLrrxwmn0AfJOniBhJXij38ezoAQopZPZoKRvTudGmmCDQKN8oulKLb+/iVxyj5a+KH5PGYGyAc7i1+YlYJ6LVfwgYu/FaqBLAqfuT2Th7oTA+ENbpzQKkQX6NObmKb+nHjeo0LdHCcNMI+fxJvZNLq3TTSPe5rgJagYbUkr8heoTd4fc1aXWhmtzf18xbz+tlMArrVT1598CDagk/FeZOCDsCHoqkqOa/4FBNkgeGOnMhKO5QHD3t1B1b+9ZggPwuSdGKGsOegJPndqqu4EbkqlzFBQELkKh2kCvVFPMkflKZLLyO1VbfaL45eERsGN+fbbI1k6805k2S3p8C4NvKw2pbqtM/aViP6TD+it3NayCky/lM454XyIhY0sK33ghyPuZOth18NrX4y/wzMGc8SVakrsOqBaake4xBT+X6fXqvN6W4jklq2IHRNrrh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/9o0ASpB6m0wCKEHFtGTjc=
e336be
X-Microsoft-Exchange-Diagnostics: 1; CY4PR0201MB3506;
e336be
 6:1VVkvCNT+b3g6vM3dm0htFRYcoKtBvvfYFnzOnhOhjPlAWtli0yFh5Gm878wViRY0RRnQJU8A2Sw4Xf8vLBOYJuzeQwxVgKzZ6RXKCOTP+vbUhPldnU+0wU6dv6RsdQaaITgPQFPnO9EuefOznd214T1m+4tIasVx3rNAubcAwr1LoYNwdu/8EkL9t7GvoVl6RtgrS0nSWTFfTTZicfeH4BJdHnbUTQBFyhC0aftzqn2Kor9bFPwHS4SCRD1tq6e37sKhmTX2xPUFBESHShvXhU/4o0ki/5+BNWldCkVEdBjqawKGCgA2PI64MJu/aig5P86rZV+KmCKJ+jxZLpHKXkqP51vLsqtdheMAlag4BJJSn8ojYt8NruvMeL27ipYenhBw3kCca/hMmfOosQiwsxlZmqellR4acW1MmSBj4tm/xzXJEkeoKyjXotL0e1wyhN18SkWLOjKK8Jt6l4vQg==;
e336be
 5:PZ908xNnr7uVYTc6nj6XU//v9+/Hr8e2pAI7LwX/9QaSdBkiPtT2bFlO5zZ0yTEtKUkPvklTGJbumeKxB3o8G/MDxZqLJ65Jhgv4+S6i44ujuX/n05SbuId07mxnjach4DhPPsNmh4FVTCalGm4HCDUScP/Tu1uRVVmqxkHaQFU=;
e336be
 7:/JWOKkUw8yvyz5ko4LBiuPNs0mZnQok8sHrZkTHBAHaZGSwLyO2mcu6qWnWT1+PcRv1xhppiLQfQm8h9khykQ6e7CJ678AFAvSGsBEUAarGnULzr2JCOps2lyNlPvLRvA/t1n9AH65U57bQrBB0FG/DXAV5aAOJswB6kDQ2UmckL9/+gULpDmArQ0hrrJDO0+fEMuARcg3IDmt33wALvjHRt2vnYuNUqcLXGj2HcHdonQIC+WYVrKzMPoY7EIEce
e336be
SpamDiagnosticOutput: 1:99
e336be
SpamDiagnosticMetadata: NSPM
e336be
X-OriginatorOrg: xilinx.com
e336be
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2018 17:53:53.1800 (UTC)
e336be
X-MS-Exchange-CrossTenant-Network-Message-Id: 
e336be
 f96ba5b8-4c9b-40ac-b48f-08d5f96a140c
e336be
X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c
e336be
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: 
e336be
 TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83];
e336be
 Helo=[xsj-pvapsmtpgw01]
e336be
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
e336be
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0201MB3506
e336be
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
e336be
X-CRM114-CacheID: sfid-20180803_105418_560981_AC19C490 
e336be
X-CRM114-Status: UNSURE (   9.67  )
e336be
X-CRM114-Notice: Please train this message.
e336be
X-BeenThere: linux-arm-kernel@lists.infradead.org
e336be
X-Mailman-Version: 2.1.21
e336be
Precedence: list
e336be
List-Id: <linux-arm-kernel.lists.infradead.org>
e336be
List-Unsubscribe: 
e336be
 <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
e336be
List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
e336be
List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
e336be
List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
e336be
List-Subscribe: 
e336be
 <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
e336be
Cc: devicetree@vger.kernel.org, rajanv@xilinx.com,
e336be
 linux-kernel@vger.kernel.org,
e336be
 linux-arm-kernel@lists.infradead.org, Jolly Shah <jollys@xilinx.com>
e336be
Content-Type: text/plain; charset="us-ascii"
e336be
Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
e336be
Errors-To: 
e336be
 linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
e336be
X-Virus-Scanned: ClamAV using ClamSMTP
e336be
e336be
From: Rajan Vaja <rajanv@xilinx.com>
e336be
e336be
Add ZynqMP firmware query data API to query platform
e336be
specific information(clocks, pins) from firmware.
e336be
e336be
Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
e336be
Signed-off-by: Jolly Shah <jollys@xilinx.com>
e336be
---
e336be
 drivers/firmware/xilinx/zynqmp.c     | 14 ++++++++++++++
e336be
 include/linux/firmware/xlnx-zynqmp.h | 20 ++++++++++++++++++++
e336be
 2 files changed, 34 insertions(+)
e336be
e336be
diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
e336be
index 24cfd9e..8ec5682 100644
e336be
--- a/drivers/firmware/xilinx/zynqmp.c
e336be
+++ b/drivers/firmware/xilinx/zynqmp.c
e336be
@@ -260,9 +260,23 @@ static int zynqmp_pm_ioctl(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2,
e336be
 				   arg1, arg2, out);
e336be
 }
e336be
 
e336be
+/**
e336be
+ * zynqmp_pm_query_data() - Get query data from firmware
e336be
+ * @qdata:	Variable to the zynqmp_pm_query_data structure
e336be
+ * @out:	Returned output value
e336be
+ *
e336be
+ * Return: Returns status, either success or error+reason
e336be
+ */
e336be
+static int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out)
e336be
+{
e336be
+	return zynqmp_pm_invoke_fn(PM_QUERY_DATA, qdata.qid, qdata.arg1,
e336be
+				   qdata.arg2, qdata.arg3, out);
e336be
+}
e336be
+
e336be
 static const struct zynqmp_eemi_ops eemi_ops = {
e336be
 	.get_api_version = zynqmp_pm_get_api_version,
e336be
 	.ioctl = zynqmp_pm_ioctl,
e336be
+	.query_data = zynqmp_pm_query_data,
e336be
 };
e336be
 
e336be
 /**
e336be
diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h
e336be
index 2eec6e7..55ed2ba 100644
e336be
--- a/include/linux/firmware/xlnx-zynqmp.h
e336be
+++ b/include/linux/firmware/xlnx-zynqmp.h
e336be
@@ -35,6 +35,7 @@
e336be
 enum pm_api_id {
e336be
 	PM_GET_API_VERSION = 1,
e336be
 	PM_IOCTL = 34,
e336be
+	PM_QUERY_DATA,
e336be
 };
e336be
 
e336be
 /* PMU-FW return status codes */
e336be
@@ -48,9 +49,28 @@ enum pm_ret_status {
e336be
 	XST_PM_ABORT_SUSPEND,
e336be
 };
e336be
 
e336be
+enum pm_query_id {
e336be
+	PM_QID_INVALID,
e336be
+};
e336be
+
e336be
+/**
e336be
+ * struct zynqmp_pm_query_data - PM query data
e336be
+ * @qid:	query ID
e336be
+ * @arg1:	Argument 1 of query data
e336be
+ * @arg2:	Argument 2 of query data
e336be
+ * @arg3:	Argument 3 of query data
e336be
+ */
e336be
+struct zynqmp_pm_query_data {
e336be
+	u32 qid;
e336be
+	u32 arg1;
e336be
+	u32 arg2;
e336be
+	u32 arg3;
e336be
+};
e336be
+
e336be
 struct zynqmp_eemi_ops {
e336be
 	int (*get_api_version)(u32 *version);
e336be
 	int (*ioctl)(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2, u32 *out);
e336be
+	int (*query_data)(struct zynqmp_pm_query_data qdata, u32 *out);
e336be
 };
e336be
 
e336be
 #if IS_REACHABLE(CONFIG_ARCH_ZYNQMP)
e336be
e336be
From patchwork Fri Aug  3 17:53:22 2018
e336be
Content-Type: text/plain; charset="utf-8"
e336be
MIME-Version: 1.0
e336be
Content-Transfer-Encoding: 7bit
e336be
X-Patchwork-Submitter: Jolly Shah <jolly.shah@xilinx.com>
e336be
X-Patchwork-Id: 10555399
e336be
Return-Path: 
e336be
 <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org>
e336be
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
e336be
 [172.30.200.125])
e336be
	by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EDAF61708
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 17:55:03 +0000 (UTC)
e336be
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7DC92C724
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 17:55:03 +0000 (UTC)
e336be
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
e336be
	id CAE462C921; Fri,  3 Aug 2018 17:55:03 +0000 (UTC)
e336be
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
e336be
	pdx-wl-mail.web.codeaurora.org
e336be
X-Spam-Level: 
e336be
X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00,
e336be
	DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1
e336be
Received: from bombadil.infradead.org (bombadil.infradead.org
e336be
 [198.137.202.133])
e336be
	(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))
e336be
	(No client certificate requested)
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3839B2C724
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 17:55:03 +0000 (UTC)
e336be
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
e336be
	d=lists.infradead.org; s=bombadil.20170209; h=Sender:
e336be
	Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:
e336be
	List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:
e336be
	Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:
e336be
	Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
e336be
	List-Owner; bh=qtQXRQrdifcWWnryriOs3rlmB/UcW6DJQNSBlqnranM=; b=lgwUgsqJd4e2rt
e336be
	nmuUR3VN+VDn+S7//ZatPEwIqaFWvyT4rFZfumsLxKarWBlf8xKEDjwktYRlwjWJP0Vk8OddyVCHa
e336be
	yx5lo+LnZ4Wv5saME6q5hqyvVTiZ2bwhDO9Ma9mbSUFdPtOWE62HQNtCvn203EXoldwnSsavTkkGE
e336be
	VJdPxa0coO6zzMO/s6iO8NgNG+Ku2QckATIFE4mZy9a7huHR3dAKMUlr1N4t8rQMwdaf+vnNRkavC
e336be
	BZu5/ZZjvSIh9HriUn0aDuhQ3+US/m5JuPKMfAZ+BuMiRgylWcmAd+c21xXbcc6OJSyehHDfvvD1u
e336be
	vpi8ViaXKGhJ771ddatg==;
e336be
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
e336be
	by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))
e336be
	id 1fleHw-0003kC-7F; Fri, 03 Aug 2018 17:54:56 +0000
e336be
Received: from mail-eopbgr710058.outbound.protection.outlook.com
e336be
 ([40.107.71.58] helo=NAM05-BY2-obe.outbound.protection.outlook.com)
e336be
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
e336be
 id 1fleHA-0002lM-Pc
e336be
 for linux-arm-kernel@lists.infradead.org; Fri, 03 Aug 2018 17:54:11 +0000
e336be
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
e336be
 d=xilinx.onmicrosoft.com; s=selector1-xilinx-com;
e336be
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
e336be
 bh=MCdLtrA1kN8/0je8FqQpiN8x3unLbKCW3xvP6auRcy0=;
e336be
 b=NbK5o18UsZ+yXgurW0cD8SnVUR3VyCCY0fcVnMfaJ0r5NR891G397FhoX7im+3MKhTpEgcyKxk6qwMETo435uEdN7yHwZuotVu5pxyIkx9MmvgAYyr3K3OTneiankyb63CggahlCCXuskq4Ra8SCvjzwzu4sqBzpCkDfbv9igX8=
e336be
Received: from MWHPR0201CA0027.namprd02.prod.outlook.com
e336be
 (2603:10b6:301:74::40) by BL0PR02MB4450.namprd02.prod.outlook.com
e336be
 (2603:10b6:208:45::27) with Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Fri, 3 Aug
e336be
 2018 17:53:54 +0000
e336be
Received: from SN1NAM02FT031.eop-nam02.prod.protection.outlook.com
e336be
 (2a01:111:f400:7e44::209) by MWHPR0201CA0027.outlook.office365.com
e336be
 (2603:10b6:301:74::40) with Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.15 via Frontend
e336be
 Transport; Fri, 3 Aug 2018 17:53:54 +0000
e336be
Authentication-Results: spf=pass (sender IP is 149.199.60.83)
e336be
 smtp.mailfrom=xilinx.com; linaro.org; dkim=none (message not signed)
e336be
 header.d=none;linaro.org; dmarc=bestguesspass action=none
e336be
 header.from=xilinx.com;
e336be
Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates
e336be
 149.199.60.83 as permitted sender) receiver=protection.outlook.com;
e336be
 client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01;
e336be
Received: from xsj-pvapsmtpgw01 (149.199.60.83) by
e336be
 SN1NAM02FT031.mail.protection.outlook.com (10.152.72.116) with Microsoft SMTP
e336be
 Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1038.3
e336be
 via Frontend Transport; Fri, 3 Aug 2018 17:53:53 +0000
e336be
Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01)
e336be
 by xsj-pvapsmtpgw01 with esmtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGu-0004fm-S0; Fri, 03 Aug 2018 10:53:52 -0700
e336be
Received: from [127.0.0.1] (helo=localhost)
e336be
 by xsj-pvapsmtp01 with smtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGp-0007cn-OV; Fri, 03 Aug 2018 10:53:47 -0700
e336be
Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com)
e336be
 by xsj-pvapsmtp01 with esmtp (Exim 4.63)
e336be
 (envelope-from <jollys@xilinx.com>)
e336be
 id 1fleGl-0007bh-E5; Fri, 03 Aug 2018 10:53:43 -0700
e336be
From: Jolly Shah <jolly.shah@xilinx.com>
e336be
To: <ard.biesheuvel@linaro.org>, <mingo@kernel.org>,
e336be
 <gregkh@linuxfoundation.org>, <matt@codeblueprint.co.uk>,
e336be
 <sudeep.holla@arm.com>, <hkallweit1@gmail.com>, <keescook@chromium.org>,
e336be
 <dmitry.torokhov@gmail.com>, <mturquette@baylibre.com>,
e336be
 <sboyd@codeaurora.org>, <michal.simek@xilinx.com>, <robh+dt@kernel.org>,
e336be
 <mark.rutland@arm.com>, <linux-clk@vger.kernel.org>
e336be
Subject: [PATCH v11 05/11] firmware: xilinx: Add clock APIs
e336be
Date: Fri, 3 Aug 2018 10:53:22 -0700
e336be
Message-ID: <1533318808-10781-6-git-send-email-jollys@xilinx.com>
e336be
X-Mailer: git-send-email 2.7.4
e336be
In-Reply-To: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
References: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005
e336be
X-TM-AS-User-Approved-Sender: Yes;Yes
e336be
X-EOPAttributedMessage: 0
e336be
X-MS-Office365-Filtering-HT: Tenant
e336be
X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI;
e336be
 SFV:NSPM;
e336be
 SFS:(10009020)(376002)(346002)(396003)(136003)(39860400002)(2980300002)(438002)(189003)(199004)(106002)(2906002)(36756003)(6666003)(356003)(107886003)(39060400002)(7416002)(81156014)(305945005)(81166006)(8676002)(54906003)(2201001)(110136005)(50466002)(48376002)(16586007)(478600001)(316002)(36386004)(72206003)(106466001)(7696005)(4326008)(8936002)(51416003)(47776003)(9786002)(76176011)(50226002)(476003)(126002)(486006)(2616005)(44832011)(426003)(11346002)(446003)(5660300001)(77096007)(14444005)(63266004)(336012)(26005)(186003)(921003)(107986001)(1121003);
e336be
 DIR:OUT; SFP:1101; SCL:1; SRVR:BL0PR02MB4450; H:xsj-pvapsmtpgw01; FPR:;
e336be
 SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1;
e336be
X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT031;
e336be
 1:3pze7uAvF87/xESxdQEo6sAKzLZVoTxZgoDo6QcLtiyMbVYsec9squw5C9h9aBOL9lTXH+5hdUDjYh08xRYa+fJRnVvxqjT+O4ZKSMHWt3R3u/fZ60qjG4nXYrK8Euut
e336be
MIME-Version: 1.0
e336be
X-MS-PublicTrafficType: Email
e336be
X-MS-Office365-Filtering-Correlation-Id: 49efa090-d193-41b4-7655-08d5f96a13f8
e336be
X-Microsoft-Antispam: BCL:0; PCL:0;
e336be
 RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);
e336be
 SRVR:BL0PR02MB4450;
e336be
X-Microsoft-Exchange-Diagnostics: 1; BL0PR02MB4450;
e336be
 3:3S06KZhJqmoOH7ZqOlk7Zoylmkbi/9DpWNSCXH8wEg2F1N1BH44dR5XD33C0gkmHCLjmz4cqPj4cQqtsou2Rnb3RuoSnWpM0KT+Or1L4SW0rQGQdFXN5GJY3SobytfFtYEVpG/+cQKKHM+j4PYW57MaPaRBg3ua52UVIMQiVEUIJwupIzdHsDkTD4e74CtuCIy1r9wgAnJLtgfPQ69QLabDSIslz85/WW0DFDc5ljbigmPQ6Ta4QDMvn+P90o0D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M9Kq5gS8Pfe6pIR7+PWcdRF85V7SY8a0uyibCpgW2FiWNe7UFlVC9WwqaUtrWroKUzFoXO92e4fGCqY1qnV9RqIEuLTE6aAf7z5n6TVTboFOnIYN0VNuQBsXnKprWe9kx8cMGpBpxkAbSLe7HaPpW28K8Kz3jFTX8eqeIJx7AIvq/C6RfoFbq6Hnkk0UTcgjTfQi0+30oWcB09zZNrGvgcp7QCwBb6hM7ML
e336be
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
e336be
X-Microsoft-Antispam-PRVS: 
e336be
 <BL0PR02MB445079201A0DFB581346501FB8230@BL0PR02MB4450.namprd02.prod.outlook.com>
e336be
X-Exchange-Antispam-Report-Test: UriScan:(192813158149592);
e336be
X-MS-Exchange-SenderADCheck: 1
e336be
X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0;
e336be
 RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93004095)(3002001)(10201501046)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(6072148)(201708071742011)(7699016);
e336be
 SRVR:BL0PR02MB4450; BCL:0; PCL:0; RULEID:; SRVR:BL0PR02MB4450;
e336be
X-Microsoft-Exchange-Diagnostics: 1; BL0PR02MB4450;
e336be
 4:dkMMUYg5ZqnEWIN+XwDwXuI+oZ/E3k0Iwn+LM/LoqUxRO2GCxe1IkgUncQL18NmRXAHyfuj8sXgQ8lsfc1Vr2aJQ8W19snpY2jbKMkoh993dgp2VG/sHq5TfHz1jRqK3WYRN0j23ctyfxrkR5WMgHnqpm/8bRM66N8fkV3RnAHs6q2Eq2+YPHcck+MfpveQyQKRfPtWK3B/geqbP6TFMZz9O0vjkJyVNrlPPO/VFKXf/gVqy/TWk3oE69SjzumOUr6xHTmPTy7BqxpaHP1/I7sJx2tpp5F6Zg4J6Gqm5rXn8AYFmCy50PmXdDFR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pd5aqvR5zkEeEGNaSi7hfyRUXO+fHvVF5BpMCY2DmICS7TicaUruDCbbjNDWrRn0zzW2tL05WHIqXKWcrM6nGnj4m19JN9kYqel68+TtkKPDX4aAH1VoWcHJgRWTl3GK6qwcFQV+B2YgSE4HmwMqROyNu91g==;
e336be
 5:ik7k1b0SC+lC1IqlVvUqUNVsdtURffSMW72ah6+D+vic9YGpycFTPI0IiVdbQ/X7ceqK/I57ZOjniZ4KAIYEwOL3a4V7Admq19G3zUj6OR6spakbtPuB+zqlZXtq0JpAsrZBQYY0U11KnYrlGUAfHF25RiCD2MaMlvGOBYdNhUA=;
e336be
 7:JBCZQ21PguVytYYJQvdyYWscwVWLl2rKhYniQA8blQmjyHuNxI1XkTsc/8JE/OXsecmB7dAZ40FkBshQdZkjzZaLoKEs94T/VDDouj7Cw1IoIq8ZUuw0HCmQtFt8TZbCy+F+r4u+iK6H1SQxdftLacGr1FfFEMcASq1EMv5RoxKMbd0mTmUbq7wmVF6MFkgzldfsAQ5F7GvWT328H7ljBuhfR6kaxenr6hHlkoYWDqP1xj5HtJfuY5nx9lJH4s6e
e336be
SpamDiagnosticOutput: 1:99
e336be
SpamDiagnosticMetadata: NSPM
e336be
X-OriginatorOrg: xilinx.com
e336be
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2018 17:53:53.3442 (UTC)
e336be
X-MS-Exchange-CrossTenant-Network-Message-Id: 
e336be
 49efa090-d193-41b4-7655-08d5f96a13f8
e336be
X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c
e336be
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: 
e336be
 TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83];
e336be
 Helo=[xsj-pvapsmtpgw01]
e336be
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
e336be
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR02MB4450
e336be
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
e336be
X-CRM114-CacheID: sfid-20180803_105408_896103_D3F4D1CB 
e336be
X-CRM114-Status: GOOD (  11.13  )
e336be
X-BeenThere: linux-arm-kernel@lists.infradead.org
e336be
X-Mailman-Version: 2.1.21
e336be
Precedence: list
e336be
List-Id: <linux-arm-kernel.lists.infradead.org>
e336be
List-Unsubscribe: 
e336be
 <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
e336be
List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
e336be
List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
e336be
List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
e336be
List-Subscribe: 
e336be
 <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
e336be
Cc: devicetree@vger.kernel.org, rajanv@xilinx.com,
e336be
 linux-kernel@vger.kernel.org,
e336be
 linux-arm-kernel@lists.infradead.org, Jolly Shah <jollys@xilinx.com>
e336be
Content-Type: text/plain; charset="us-ascii"
e336be
Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
e336be
Errors-To: 
e336be
 linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
e336be
X-Virus-Scanned: ClamAV using ClamSMTP
e336be
e336be
From: Rajan Vaja <rajanv@xilinx.com>
e336be
e336be
Add clock APIs to control clocks through firmware
e336be
interface.
e336be
e336be
Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
e336be
Signed-off-by: Jolly Shah <jollys@xilinx.com>
e336be
---
e336be
 drivers/firmware/xilinx/zynqmp.c     | 186 ++++++++++++++++++++++++++++++++++-
e336be
 include/linux/firmware/xlnx-zynqmp.h |  30 ++++++
e336be
 2 files changed, 214 insertions(+), 2 deletions(-)
e336be
e336be
diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
e336be
index 8ec5682..41ed800 100644
e336be
--- a/drivers/firmware/xilinx/zynqmp.c
e336be
+++ b/drivers/firmware/xilinx/zynqmp.c
e336be
@@ -269,14 +269,196 @@ static int zynqmp_pm_ioctl(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2,
e336be
  */
e336be
 static int zynqmp_pm_query_data(struct zynqmp_pm_query_data qdata, u32 *out)
e336be
 {
e336be
-	return zynqmp_pm_invoke_fn(PM_QUERY_DATA, qdata.qid, qdata.arg1,
e336be
-				   qdata.arg2, qdata.arg3, out);
e336be
+	int ret;
e336be
+
e336be
+	ret = zynqmp_pm_invoke_fn(PM_QUERY_DATA, qdata.qid, qdata.arg1,
e336be
+				  qdata.arg2, qdata.arg3, out);
e336be
+
e336be
+	/*
e336be
+	 * For clock name query, all bytes in SMC response are clock name
e336be
+	 * characters and return code is always success. For invalid clocks,
e336be
+	 * clock name bytes would be zeros.
e336be
+	 */
e336be
+	return qdata.qid == PM_QID_CLOCK_GET_NAME ? 0 : ret;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_clock_enable() - Enable the clock for given id
e336be
+ * @clock_id:	ID of the clock to be enabled
e336be
+ *
e336be
+ * This function is used by master to enable the clock
e336be
+ * including peripherals and PLL clocks.
e336be
+ *
e336be
+ * Return: Returns status, either success or error+reason
e336be
+ */
e336be
+static int zynqmp_pm_clock_enable(u32 clock_id)
e336be
+{
e336be
+	return zynqmp_pm_invoke_fn(PM_CLOCK_ENABLE, clock_id, 0, 0, 0, NULL);
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_clock_disable() - Disable the clock for given id
e336be
+ * @clock_id:	ID of the clock to be disable
e336be
+ *
e336be
+ * This function is used by master to disable the clock
e336be
+ * including peripherals and PLL clocks.
e336be
+ *
e336be
+ * Return: Returns status, either success or error+reason
e336be
+ */
e336be
+static int zynqmp_pm_clock_disable(u32 clock_id)
e336be
+{
e336be
+	return zynqmp_pm_invoke_fn(PM_CLOCK_DISABLE, clock_id, 0, 0, 0, NULL);
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_clock_getstate() - Get the clock state for given id
e336be
+ * @clock_id:	ID of the clock to be queried
e336be
+ * @state:	1/0 (Enabled/Disabled)
e336be
+ *
e336be
+ * This function is used by master to get the state of clock
e336be
+ * including peripherals and PLL clocks.
e336be
+ *
e336be
+ * Return: Returns status, either success or error+reason
e336be
+ */
e336be
+static int zynqmp_pm_clock_getstate(u32 clock_id, u32 *state)
e336be
+{
e336be
+	u32 ret_payload[PAYLOAD_ARG_CNT];
e336be
+	int ret;
e336be
+
e336be
+	ret = zynqmp_pm_invoke_fn(PM_CLOCK_GETSTATE, clock_id, 0,
e336be
+				  0, 0, ret_payload);
e336be
+	*state = ret_payload[1];
e336be
+
e336be
+	return ret;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_clock_setdivider() - Set the clock divider for given id
e336be
+ * @clock_id:	ID of the clock
e336be
+ * @divider:	divider value
e336be
+ *
e336be
+ * This function is used by master to set divider for any clock
e336be
+ * to achieve desired rate.
e336be
+ *
e336be
+ * Return: Returns status, either success or error+reason
e336be
+ */
e336be
+static int zynqmp_pm_clock_setdivider(u32 clock_id, u32 divider)
e336be
+{
e336be
+	return zynqmp_pm_invoke_fn(PM_CLOCK_SETDIVIDER, clock_id, divider,
e336be
+				   0, 0, NULL);
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_clock_getdivider() - Get the clock divider for given id
e336be
+ * @clock_id:	ID of the clock
e336be
+ * @divider:	divider value
e336be
+ *
e336be
+ * This function is used by master to get divider values
e336be
+ * for any clock.
e336be
+ *
e336be
+ * Return: Returns status, either success or error+reason
e336be
+ */
e336be
+static int zynqmp_pm_clock_getdivider(u32 clock_id, u32 *divider)
e336be
+{
e336be
+	u32 ret_payload[PAYLOAD_ARG_CNT];
e336be
+	int ret;
e336be
+
e336be
+	ret = zynqmp_pm_invoke_fn(PM_CLOCK_GETDIVIDER, clock_id, 0,
e336be
+				  0, 0, ret_payload);
e336be
+	*divider = ret_payload[1];
e336be
+
e336be
+	return ret;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_clock_setrate() - Set the clock rate for given id
e336be
+ * @clock_id:	ID of the clock
e336be
+ * @rate:	rate value in hz
e336be
+ *
e336be
+ * This function is used by master to set rate for any clock.
e336be
+ *
e336be
+ * Return: Returns status, either success or error+reason
e336be
+ */
e336be
+static int zynqmp_pm_clock_setrate(u32 clock_id, u64 rate)
e336be
+{
e336be
+	return zynqmp_pm_invoke_fn(PM_CLOCK_SETRATE, clock_id,
e336be
+				   lower_32_bits(rate),
e336be
+				   upper_32_bits(rate),
e336be
+				   0, NULL);
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_clock_getrate() - Get the clock rate for given id
e336be
+ * @clock_id:	ID of the clock
e336be
+ * @rate:	rate value in hz
e336be
+ *
e336be
+ * This function is used by master to get rate
e336be
+ * for any clock.
e336be
+ *
e336be
+ * Return: Returns status, either success or error+reason
e336be
+ */
e336be
+static int zynqmp_pm_clock_getrate(u32 clock_id, u64 *rate)
e336be
+{
e336be
+	u32 ret_payload[PAYLOAD_ARG_CNT];
e336be
+	int ret;
e336be
+
e336be
+	ret = zynqmp_pm_invoke_fn(PM_CLOCK_GETRATE, clock_id, 0,
e336be
+				  0, 0, ret_payload);
e336be
+	*rate = ((u64)ret_payload[2] << 32) | ret_payload[1];
e336be
+
e336be
+	return ret;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_clock_setparent() - Set the clock parent for given id
e336be
+ * @clock_id:	ID of the clock
e336be
+ * @parent_id:	parent id
e336be
+ *
e336be
+ * This function is used by master to set parent for any clock.
e336be
+ *
e336be
+ * Return: Returns status, either success or error+reason
e336be
+ */
e336be
+static int zynqmp_pm_clock_setparent(u32 clock_id, u32 parent_id)
e336be
+{
e336be
+	return zynqmp_pm_invoke_fn(PM_CLOCK_SETPARENT, clock_id,
e336be
+				   parent_id, 0, 0, NULL);
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_clock_getparent() - Get the clock parent for given id
e336be
+ * @clock_id:	ID of the clock
e336be
+ * @parent_id:	parent id
e336be
+ *
e336be
+ * This function is used by master to get parent index
e336be
+ * for any clock.
e336be
+ *
e336be
+ * Return: Returns status, either success or error+reason
e336be
+ */
e336be
+static int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id)
e336be
+{
e336be
+	u32 ret_payload[PAYLOAD_ARG_CNT];
e336be
+	int ret;
e336be
+
e336be
+	ret = zynqmp_pm_invoke_fn(PM_CLOCK_GETPARENT, clock_id, 0,
e336be
+				  0, 0, ret_payload);
e336be
+	*parent_id = ret_payload[1];
e336be
+
e336be
+	return ret;
e336be
 }
e336be
 
e336be
 static const struct zynqmp_eemi_ops eemi_ops = {
e336be
 	.get_api_version = zynqmp_pm_get_api_version,
e336be
 	.ioctl = zynqmp_pm_ioctl,
e336be
 	.query_data = zynqmp_pm_query_data,
e336be
+	.clock_enable = zynqmp_pm_clock_enable,
e336be
+	.clock_disable = zynqmp_pm_clock_disable,
e336be
+	.clock_getstate = zynqmp_pm_clock_getstate,
e336be
+	.clock_setdivider = zynqmp_pm_clock_setdivider,
e336be
+	.clock_getdivider = zynqmp_pm_clock_getdivider,
e336be
+	.clock_setrate = zynqmp_pm_clock_setrate,
e336be
+	.clock_getrate = zynqmp_pm_clock_getrate,
e336be
+	.clock_setparent = zynqmp_pm_clock_setparent,
e336be
+	.clock_getparent = zynqmp_pm_clock_getparent,
e336be
 };
e336be
 
e336be
 /**
e336be
diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h
e336be
index 55ed2ba..58a7478 100644
e336be
--- a/include/linux/firmware/xlnx-zynqmp.h
e336be
+++ b/include/linux/firmware/xlnx-zynqmp.h
e336be
@@ -36,6 +36,15 @@ enum pm_api_id {
e336be
 	PM_GET_API_VERSION = 1,
e336be
 	PM_IOCTL = 34,
e336be
 	PM_QUERY_DATA,
e336be
+	PM_CLOCK_ENABLE,
e336be
+	PM_CLOCK_DISABLE,
e336be
+	PM_CLOCK_GETSTATE,
e336be
+	PM_CLOCK_SETDIVIDER,
e336be
+	PM_CLOCK_GETDIVIDER,
e336be
+	PM_CLOCK_SETRATE,
e336be
+	PM_CLOCK_GETRATE,
e336be
+	PM_CLOCK_SETPARENT,
e336be
+	PM_CLOCK_GETPARENT,
e336be
 };
e336be
 
e336be
 /* PMU-FW return status codes */
e336be
@@ -49,8 +58,20 @@ enum pm_ret_status {
e336be
 	XST_PM_ABORT_SUSPEND,
e336be
 };
e336be
 
e336be
+enum pm_ioctl_id {
e336be
+	IOCTL_SET_PLL_FRAC_MODE = 8,
e336be
+	IOCTL_GET_PLL_FRAC_MODE,
e336be
+	IOCTL_SET_PLL_FRAC_DATA,
e336be
+	IOCTL_GET_PLL_FRAC_DATA,
e336be
+};
e336be
+
e336be
 enum pm_query_id {
e336be
 	PM_QID_INVALID,
e336be
+	PM_QID_CLOCK_GET_NAME,
e336be
+	PM_QID_CLOCK_GET_TOPOLOGY,
e336be
+	PM_QID_CLOCK_GET_FIXEDFACTOR_PARAMS,
e336be
+	PM_QID_CLOCK_GET_PARENTS,
e336be
+	PM_QID_CLOCK_GET_ATTRIBUTES,
e336be
 };
e336be
 
e336be
 /**
e336be
@@ -71,6 +92,15 @@ struct zynqmp_eemi_ops {
e336be
 	int (*get_api_version)(u32 *version);
e336be
 	int (*ioctl)(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2, u32 *out);
e336be
 	int (*query_data)(struct zynqmp_pm_query_data qdata, u32 *out);
e336be
+	int (*clock_enable)(u32 clock_id);
e336be
+	int (*clock_disable)(u32 clock_id);
e336be
+	int (*clock_getstate)(u32 clock_id, u32 *state);
e336be
+	int (*clock_setdivider)(u32 clock_id, u32 divider);
e336be
+	int (*clock_getdivider)(u32 clock_id, u32 *divider);
e336be
+	int (*clock_setrate)(u32 clock_id, u64 rate);
e336be
+	int (*clock_getrate)(u32 clock_id, u64 *rate);
e336be
+	int (*clock_setparent)(u32 clock_id, u32 parent_id);
e336be
+	int (*clock_getparent)(u32 clock_id, u32 *parent_id);
e336be
 };
e336be
 
e336be
 #if IS_REACHABLE(CONFIG_ARCH_ZYNQMP)
e336be
e336be
From patchwork Fri Aug  3 17:53:23 2018
e336be
Content-Type: text/plain; charset="utf-8"
e336be
MIME-Version: 1.0
e336be
Content-Transfer-Encoding: 7bit
e336be
X-Patchwork-Submitter: Jolly Shah <jolly.shah@xilinx.com>
e336be
X-Patchwork-Id: 10555411
e336be
Return-Path: 
e336be
 <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org>
e336be
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
e336be
 [172.30.200.125])
e336be
	by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 42CDE14E2
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:05:47 +0000 (UTC)
e336be
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DEAE2BF36
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:05:47 +0000 (UTC)
e336be
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
e336be
	id 218302C983; Fri,  3 Aug 2018 18:05:47 +0000 (UTC)
e336be
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
e336be
	pdx-wl-mail.web.codeaurora.org
e336be
X-Spam-Level: 
e336be
X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00,
e336be
	DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1
e336be
Received: from bombadil.infradead.org (bombadil.infradead.org
e336be
 [198.137.202.133])
e336be
	(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))
e336be
	(No client certificate requested)
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 55C962BF36
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:05:46 +0000 (UTC)
e336be
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
e336be
	d=lists.infradead.org; s=bombadil.20170209; h=Sender:
e336be
	Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:
e336be
	List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:
e336be
	Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:
e336be
	Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
e336be
	List-Owner; bh=SlaW7LMtEE/cr0hfSQZkJaC+lEL3gJLfwFZEnkwJH5M=; b=FF+yYiy+d6kVIY
e336be
	NPO8GugZSGK7/FfXWAnyKIzXDX4sfLdhp/xMTCgIoytzv+Wyp9ebZyPU+fFJRAYRw4ZgNVQ9QbTSw
e336be
	IDtNrqkTxlr+1cPaE1hD15KuN5Xa225kdNh30n5ukSkCOzflISqgvo0NvP2dQAiN2JkNVohH3eqsx
e336be
	7l+7aFORrBS81lQVczus4Zpny/dtPc5p7qFm6VVZXaMMuwiP7Rq7bqsbiW1AwlRQlzyojckKHxLVI
e336be
	9WrYobFEUCempK1hSL9BC/TpRZ4OiidHTFMEnIx7xX0vUJJbgwJoNKc12REazj7BOoefUvdc4iRR7
e336be
	OStU/IxPeB2DvffI49lQ==;
e336be
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
e336be
	by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))
e336be
	id 1fleSM-0001Xj-N0; Fri, 03 Aug 2018 18:05:42 +0000
e336be
Received: from mail-co1nam03on0073.outbound.protection.outlook.com
e336be
 ([104.47.40.73] helo=NAM03-CO1-obe.outbound.protection.outlook.com)
e336be
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
e336be
 id 1fleHA-0002lJ-1v
e336be
 for linux-arm-kernel@lists.infradead.org; Fri, 03 Aug 2018 17:54:10 +0000
e336be
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
e336be
 d=xilinx.onmicrosoft.com; s=selector1-xilinx-com;
e336be
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
e336be
 bh=VE114//YUPYxbjun3uPhuQH8U38wde77z/JGyfmsCXc=;
e336be
 b=dq4snkg/uWEhhWRPXKPKRnkIcixnBBHL/oVun5zYPSScd7KwwifYQYPfhcb5F8QGbTRW3YANoVjYtFcZam+jmRITITCMN6nixJSuGD58PO++dabE+ZO5nUDkzlcP5imKo5LzoqYenyl5ZeG8e7gWVpgcKDlzEgbFZEwG7ygB330=
e336be
Received: from CY4PR02CA0004.namprd02.prod.outlook.com (2603:10b6:903:18::14)
e336be
 by MWHPR0201MB3514.namprd02.prod.outlook.com (2603:10b6:301:77::11)
e336be
 with Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.14; Fri, 3 Aug
e336be
 2018 17:53:54 +0000
e336be
Received: from CY1NAM02FT024.eop-nam02.prod.protection.outlook.com
e336be
 (2a01:111:f400:7e45::207) by CY4PR02CA0004.outlook.office365.com
e336be
 (2603:10b6:903:18::14) with Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.15 via Frontend
e336be
 Transport; Fri, 3 Aug 2018 17:53:54 +0000
e336be
Authentication-Results: spf=pass (sender IP is 149.199.60.83)
e336be
 smtp.mailfrom=xilinx.com; linaro.org; dkim=none (message not signed)
e336be
 header.d=none;linaro.org; dmarc=bestguesspass action=none
e336be
 header.from=xilinx.com;
e336be
Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates
e336be
 149.199.60.83 as permitted sender) receiver=protection.outlook.com;
e336be
 client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01;
e336be
Received: from xsj-pvapsmtpgw01 (149.199.60.83) by
e336be
 CY1NAM02FT024.mail.protection.outlook.com (10.152.74.210) with Microsoft SMTP
e336be
 Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1038.3
e336be
 via Frontend Transport; Fri, 3 Aug 2018 17:53:53 +0000
e336be
Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01)
e336be
 by xsj-pvapsmtpgw01 with esmtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGu-0004fl-Qj; Fri, 03 Aug 2018 10:53:52 -0700
e336be
Received: from [127.0.0.1] (helo=localhost)
e336be
 by xsj-pvapsmtp01 with smtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGp-0007cn-N0; Fri, 03 Aug 2018 10:53:47 -0700
e336be
Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com)
e336be
 by xsj-pvapsmtp01 with esmtp (Exim 4.63)
e336be
 (envelope-from <jollys@xilinx.com>)
e336be
 id 1fleGl-0007bh-Gc; Fri, 03 Aug 2018 10:53:43 -0700
e336be
From: Jolly Shah <jolly.shah@xilinx.com>
e336be
To: <ard.biesheuvel@linaro.org>, <mingo@kernel.org>,
e336be
 <gregkh@linuxfoundation.org>, <matt@codeblueprint.co.uk>,
e336be
 <sudeep.holla@arm.com>, <hkallweit1@gmail.com>, <keescook@chromium.org>,
e336be
 <dmitry.torokhov@gmail.com>, <mturquette@baylibre.com>,
e336be
 <sboyd@codeaurora.org>, <michal.simek@xilinx.com>, <robh+dt@kernel.org>,
e336be
 <mark.rutland@arm.com>, <linux-clk@vger.kernel.org>
e336be
Subject: [PATCH v11 06/11] firmware: xilinx: Add debugfs interface
e336be
Date: Fri, 3 Aug 2018 10:53:23 -0700
e336be
Message-ID: <1533318808-10781-7-git-send-email-jollys@xilinx.com>
e336be
X-Mailer: git-send-email 2.7.4
e336be
In-Reply-To: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
References: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005
e336be
X-TM-AS-User-Approved-Sender: Yes;Yes
e336be
X-EOPAttributedMessage: 0
e336be
X-MS-Office365-Filtering-HT: Tenant
e336be
X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI;
e336be
 SFV:NSPM;
e336be
 SFS:(10009020)(39860400002)(346002)(376002)(136003)(396003)(2980300002)(438002)(189003)(199004)(63266004)(72206003)(16586007)(14444005)(54906003)(110136005)(2201001)(36386004)(9786002)(478600001)(50226002)(4326008)(316002)(47776003)(7416002)(966005)(6666003)(39060400002)(107886003)(6306002)(106002)(2906002)(186003)(336012)(126002)(26005)(44832011)(106466001)(36756003)(51416003)(476003)(426003)(77096007)(76176011)(11346002)(7696005)(446003)(5660300001)(356003)(305945005)(2616005)(486006)(8676002)(48376002)(50466002)(8936002)(81156014)(81166006)(107986001)(921003)(1121003);
e336be
 DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR0201MB3514; H:xsj-pvapsmtpgw01; FPR:;
e336be
 SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1;
e336be
X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT024;
e336be
 1:XJtp6mPeAEQzxSzqta74Rf02P94NT3NgcfhV+Ycor8oeXTmBrcMBNt3vLIuJw9viC1xla7+ljFaT82kV3FRpZm4WO8igxlIHKxyr/dbBx6sz5SFqITX4iUW9MbwzBzJG
e336be
MIME-Version: 1.0
e336be
X-MS-PublicTrafficType: Email
e336be
X-MS-Office365-Filtering-Correlation-Id: 7f1cf7f5-c927-43d7-edf8-08d5f96a1431
e336be
X-Microsoft-Antispam: BCL:0; PCL:0;
e336be
 RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060);
e336be
 SRVR:MWHPR0201MB3514;
e336be
X-Microsoft-Exchange-Diagnostics: 1; MWHPR0201MB3514;
e336be
 3:gWfRNCiVxx6krfkpYUQ4cnxzfyusc7U4ga1svGYbU6p696pzaZ1w5Uaxj3FieLruw17UnPwa/jwT2IHNz5rOSXNXgNMLzHBRtSMqPlX3Vn/WpUFkKOnTFiB5yAXfTfZNcET2O82CxdOsavOjI4kcvnlzClMvpJGUqQBXnlr0slClJyEbKg23qM+IypZJn6vQFt0orFmMeHWMeYF8zkh1HS3EXFg59u8QbhZwkvL4vwwfVtYAu5jcRienQ27qFRLrS7r+Mfu3A2Wzm1ACekZcJnAtFFICN/+jbN5lLRF4yXhZx7qru7v5eF5mrywSRogXrufB9/xQ3eR/P4aETYWdYFD2dN6K/BgKljvEEUs+pPo=;
e336be
 25:IkAkf+HiFbH4CNWRXZix02t8Pyr+ZRXgeOp7c0hj/pz0PlYENWYb0yxcWCik7aaZXWepn79QIU9K+qj8gUpB49dPpWws3Jp8hT+G+1rNJJUJMyyjLaVpwwxhFBvEgKsnNBIeNxlZbU0/QHGXorPPAZNWRPVFNPmOqgJwSE8Ye0j92tuEy8XRJtVA8irQ3arCYaVS1KxBTHSbMNWjDBMENVVZt6bz+nqLPXJjW1Q2dAKkxb0J+OmzuMIN5gfw3GsxbW+pyNKgG8meZrL9/ViAGGKDAyPkSjosMcRM0iIEV0IXvg9EmieBxFTJC6rtdMn3FJ8TdRQ6Y5me6Z2pKZrO0Q==
e336be
X-MS-TrafficTypeDiagnostic: MWHPR0201MB3514:
e336be
X-Microsoft-Exchange-Diagnostics: 1; MWHPR0201MB3514;
e336be
 31:Ox2hgllmWiSeAw49wA7h47mGeYvw0MsA9g08QTq7pSS4iCNYwf+l66ELs2n3aYAQAfqNVCeP4AF768gpjgqJrdoDeSSbjKWcUClmLzKEzUZJ2hMZ62gr1GsVnXK5FKY7q2zMcAJ1vNKwQWH4n6COaaJ6kw/MhiXF1qCcmDB0XEh5P3XYy51lH9+N8JSz6xo+Q4xt78m5mu/9cKJKbidMMaeeJYFQQfPtQvJeub0u8Gs=;
e336be
 20:ejEtRfxhPUE4SJRt/Qz4uOHchvN2NgqzC9tzRCcjwfUUALDDL+s+oys/PfqCkt7/4DPWJSUv6JVB8N4k2jUV9ZJgK31zgLbQ8562iPQsd3ZfLlztXQcczhddk9kD8RhfY5zcyhY+IdlSWYadc9U/gOWhks+IKlewxR7ETyOkYQq955zCzGisVbBUsNBLpRilzDOq9tRRaS+iLzckxPbAgPd8QPT7kEt7nK/HFXVtXSr7dEaTYUkzPxnq0UNJjK0bzMUVwdfN91dtjYLwDxNEjiFsWaAHz7kuOshfa0vfmWcwPnkcivtW5K0l2r/b2mcL//ZJ40VFzM/sA0CdR993knaX9IGzA+b7NxJWa6m8g4TEvLBGbfhsX99KiHAg+LYts2UJlnNcwa0K4aIjpXB0Dhkooqh5/JSTWOMyaQe3jn5wdIKQOHxCCgqK4QA/CgTjkwxrFfiMEahPzFFTv9LlIA1VjcuTEkkYCrkXsW1ghsK4o6ASAg/sc7Phlr85KqvR
e336be
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
e336be
X-Microsoft-Antispam-PRVS: 
e336be
 <MWHPR0201MB3514F1A156385FD474D4E190B8230@MWHPR0201MB3514.namprd02.prod.outlook.com>
e336be
X-Exchange-Antispam-Report-Test: UriScan:(192813158149592)(189271028609987);
e336be
X-MS-Exchange-SenderADCheck: 1
e336be
X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0;
e336be
 RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93004095)(3002001)(3231311)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011)(7699016);
e336be
 SRVR:MWHPR0201MB3514; BCL:0; PCL:0; RULEID:; SRVR:MWHPR0201MB3514;
e336be
X-Microsoft-Exchange-Diagnostics: 1; MWHPR0201MB3514;
e336be
 4:iv2luY/31yBDz008ORw8GHI2Vz7FdH6vSANVDPIycHRkJvz6usFK7+oXF5VhMfI7DyHY5nhm/IrAEr0+7I37TuUrjkdBFUHrYEMr6dS+RE55S2KlSCWmgQa5DKI5eZ71PX7M1fCx4FdQ46TL5Du0HbtPLyghKkdSUQJRh9n7q7FdLKNKZKQNICp6HBhWRiZCtXWiLexZ8KbngRyEBZCHQYj67yYW8G+Cv2NZ+vi4gU1x3b8kV5CLs23ntu1nyzMTrR0jZ3Lnf7Eut9UOE3ic66OyqMzaSHXAQCBbZgxBBMyC0urnxd6bTL9YjllkrcHoFIwe6RZWRQssuaN4V9Qn2A==
e336be
X-Forefront-PRVS: 0753EA505A
e336be
X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR0201MB3514;
e336be
 23:UT97DfX0QbKmM0nXFp8S2qrIykkIbib9Jknwhgm?=
e336be
 D93UQ7kEWyeUDp4Q0fjoD5xLKs0vCTqpuxKyoBvtBB5puXRHbEgMR5ShyphykZpJS+BA72QVEsddyB98r7sxEPS3xMJP7i6esgKNmrca8Q+odNj0qREFJtoTXunOSPZdlsrS7B5UoRVokNaKrnuRk7u/8kDZqFSA8TkvGXmUMCW+tFkpcvzjCzQlYmyugfmcwecmfHX1+MtKq66uNTm3xtPTx+KGeS85uLwMYLBn3Kb0f210HS0FscrvM+oJ4GerLTpjr48o5VULUxYYbqvr3zvLBEGVC2oPRh43fbWzL9zWRIr3DJyU5aQXb3fEQJTSsEOr7NTYCIaxBEn+eofxDmyDRQJMNwzKFNCEYU/amsIYB7Hx4DXFdbVO3TYJMLpqeD6BysQ23GwKHHjubAEkECeR+BUzYsMmIW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K+mXn0W9AVhjxDvzRMaWzMlk29IzMHzSjinQV5OpfpRCxnJl
e336be
SpamDiagnosticOutput: 1:99
e336be
SpamDiagnosticMetadata: NSPM
e336be
X-OriginatorOrg: xilinx.com
e336be
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2018 17:53:53.3302 (UTC)
e336be
X-MS-Exchange-CrossTenant-Network-Message-Id: 
e336be
 7f1cf7f5-c927-43d7-edf8-08d5f96a1431
e336be
X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c
e336be
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: 
e336be
 TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83];
e336be
 Helo=[xsj-pvapsmtpgw01]
e336be
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
e336be
X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0201MB3514
e336be
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
e336be
X-CRM114-CacheID: sfid-20180803_105408_216035_5379A60B 
e336be
X-CRM114-Status: GOOD (  14.88  )
e336be
X-BeenThere: linux-arm-kernel@lists.infradead.org
e336be
X-Mailman-Version: 2.1.21
e336be
Precedence: list
e336be
List-Id: <linux-arm-kernel.lists.infradead.org>
e336be
List-Unsubscribe: 
e336be
 <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
e336be
List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
e336be
List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
e336be
List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
e336be
List-Subscribe: 
e336be
 <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
e336be
Cc: devicetree@vger.kernel.org, rajanv@xilinx.com,
e336be
 linux-kernel@vger.kernel.org,
e336be
 linux-arm-kernel@lists.infradead.org, Jolly Shah <jollys@xilinx.com>
e336be
Content-Type: text/plain; charset="us-ascii"
e336be
Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
e336be
Errors-To: 
e336be
 linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
e336be
X-Virus-Scanned: ClamAV using ClamSMTP
e336be
e336be
From: Rajan Vaja <rajanv@xilinx.com>
e336be
e336be
Firmware-debug provides debugfs interface to all APIs.
e336be
Debugfs can be used to call firmware APIs with required
e336be
parameters.
e336be
e336be
Usage:
e336be
* Calling firmware API through debugfs:
e336be
  # echo "<api-name> <arg1> .. <argn>" > /sys/.../zynqmp-firmware/pm
e336be
e336be
* Read output of last called firmware API:
e336be
  # cat /sys/.../zynqmp-firmware/pm
e336be
e336be
Refer ug1200 for more information on these APIs:
e336be
  * https://www.xilinx.com/support/documentation/user_guides/ug1200-eemi-api.pdf
e336be
e336be
Add basic debugfs file to get API version.
e336be
e336be
Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
e336be
Signed-off-by: Jolly Shah <jollys@xilinx.com>
e336be
---
e336be
 drivers/firmware/xilinx/Kconfig        |   7 ++
e336be
 drivers/firmware/xilinx/Makefile       |   1 +
e336be
 drivers/firmware/xilinx/zynqmp-debug.c | 212 +++++++++++++++++++++++++++++++++
e336be
 drivers/firmware/xilinx/zynqmp-debug.h |  22 ++++
e336be
 drivers/firmware/xilinx/zynqmp.c       |   9 ++
e336be
 5 files changed, 251 insertions(+)
e336be
 create mode 100644 drivers/firmware/xilinx/zynqmp-debug.c
e336be
 create mode 100644 drivers/firmware/xilinx/zynqmp-debug.h
e336be
e336be
diff --git a/drivers/firmware/xilinx/Kconfig b/drivers/firmware/xilinx/Kconfig
e336be
index 64d976e..8f44b9c 100644
e336be
--- a/drivers/firmware/xilinx/Kconfig
e336be
+++ b/drivers/firmware/xilinx/Kconfig
e336be
@@ -13,4 +13,11 @@ config ZYNQMP_FIRMWARE
e336be
 	  Say yes to enable ZynqMP firmware interface driver.
e336be
 	  If in doubt, say N.
e336be
 
e336be
+config ZYNQMP_FIRMWARE_DEBUG
e336be
+	bool "Enable Xilinx Zynq MPSoC firmware debug APIs"
e336be
+	depends on ZYNQMP_FIRMWARE && DEBUG_FS
e336be
+	help
e336be
+	  Say yes to enable ZynqMP firmware interface debug APIs.
e336be
+	  If in doubt, say N.
e336be
+
e336be
 endmenu
e336be
diff --git a/drivers/firmware/xilinx/Makefile b/drivers/firmware/xilinx/Makefile
e336be
index 29f7bf2..875a537 100644
e336be
--- a/drivers/firmware/xilinx/Makefile
e336be
+++ b/drivers/firmware/xilinx/Makefile
e336be
@@ -2,3 +2,4 @@
e336be
 # Makefile for Xilinx firmwares
e336be
 
e336be
 obj-$(CONFIG_ZYNQMP_FIRMWARE) += zynqmp.o
e336be
+obj-$(CONFIG_ZYNQMP_FIRMWARE_DEBUG) += zynqmp-debug.o
e336be
diff --git a/drivers/firmware/xilinx/zynqmp-debug.c b/drivers/firmware/xilinx/zynqmp-debug.c
e336be
new file mode 100644
e336be
index 0000000..fcbdd6e
e336be
--- /dev/null
e336be
+++ b/drivers/firmware/xilinx/zynqmp-debug.c
e336be
@@ -0,0 +1,212 @@
e336be
+// SPDX-License-Identifier: GPL-2.0
e336be
+/*
e336be
+ * Xilinx Zynq MPSoC Firmware layer for debugfs APIs
e336be
+ *
e336be
+ *  Copyright (C) 2014-2018 Xilinx, Inc.
e336be
+ *
e336be
+ *  Michal Simek <michal.simek@xilinx.com>
e336be
+ *  Davorin Mista <davorin.mista@aggios.com>
e336be
+ *  Jolly Shah <jollys@xilinx.com>
e336be
+ *  Rajan Vaja <rajanv@xilinx.com>
e336be
+ */
e336be
+
e336be
+#include <linux/compiler.h>
e336be
+#include <linux/module.h>
e336be
+#include <linux/slab.h>
e336be
+#include <linux/debugfs.h>
e336be
+#include <linux/uaccess.h>
e336be
+
e336be
+#include <linux/firmware/xlnx-zynqmp.h>
e336be
+#include "zynqmp-debug.h"
e336be
+
e336be
+#define PM_API_NAME_LEN			50
e336be
+
e336be
+struct pm_api_info {
e336be
+	u32 api_id;
e336be
+	char api_name[PM_API_NAME_LEN];
e336be
+	char api_name_len;
e336be
+};
e336be
+
e336be
+static char debugfs_buf[PAGE_SIZE];
e336be
+
e336be
+#define PM_API(id)		 {id, #id, strlen(#id)}
e336be
+static struct pm_api_info pm_api_list[] = {
e336be
+	PM_API(PM_GET_API_VERSION),
e336be
+};
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_argument_value() - Extract argument value from a PM-API request
e336be
+ * @arg:	Entered PM-API argument in string format
e336be
+ *
e336be
+ * Return: Argument value in unsigned integer format on success
e336be
+ *	   0 otherwise
e336be
+ */
e336be
+static u64 zynqmp_pm_argument_value(char *arg)
e336be
+{
e336be
+	u64 value;
e336be
+
e336be
+	if (!arg)
e336be
+		return 0;
e336be
+
e336be
+	if (!kstrtou64(arg, 0, &value))
e336be
+		return value;
e336be
+
e336be
+	return 0;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * get_pm_api_id() - Extract API-ID from a PM-API request
e336be
+ * @pm_api_req:		Entered PM-API argument in string format
e336be
+ * @pm_id:		API-ID
e336be
+ *
e336be
+ * Return: 0 on success else error code
e336be
+ */
e336be
+static int get_pm_api_id(char *pm_api_req, u32 *pm_id)
e336be
+{
e336be
+	int i;
e336be
+
e336be
+	for (i = 0; i < ARRAY_SIZE(pm_api_list) ; i++) {
e336be
+		if (!strncasecmp(pm_api_req, pm_api_list[i].api_name,
e336be
+				 pm_api_list[i].api_name_len)) {
e336be
+			*pm_id = pm_api_list[i].api_id;
e336be
+			break;
e336be
+		}
e336be
+	}
e336be
+
e336be
+	/* If no name was entered look for PM-API ID instead */
e336be
+	if (i == ARRAY_SIZE(pm_api_list) && kstrtouint(pm_api_req, 10, pm_id))
e336be
+		return -EINVAL;
e336be
+
e336be
+	return 0;
e336be
+}
e336be
+
e336be
+static int process_api_request(u32 pm_id, u64 *pm_api_arg, u32 *pm_api_ret)
e336be
+{
e336be
+	const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
e336be
+	u32 pm_api_version;
e336be
+	int ret;
e336be
+
e336be
+	if (!eemi_ops)
e336be
+		return -ENXIO;
e336be
+
e336be
+	switch (pm_id) {
e336be
+	case PM_GET_API_VERSION:
e336be
+		ret = eemi_ops->get_api_version(&pm_api_version);
e336be
+		sprintf(debugfs_buf, "PM-API Version = %d.%d\n",
e336be
+			pm_api_version >> 16, pm_api_version & 0xffff);
e336be
+		break;
e336be
+	default:
e336be
+		sprintf(debugfs_buf, "Unsupported PM-API request\n");
e336be
+		ret = -EINVAL;
e336be
+	}
e336be
+
e336be
+	return ret;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_debugfs_api_write() - debugfs write function
e336be
+ * @file:	User file
e336be
+ * @ptr:	User entered PM-API string
e336be
+ * @len:	Length of the userspace buffer
e336be
+ * @off:	Offset within the file
e336be
+ *
e336be
+ * Used for triggering pm api functions by writing
e336be
+ * echo <pm_api_id>	> /sys/kernel/debug/zynqmp_pm/power or
e336be
+ * echo <pm_api_name>	> /sys/kernel/debug/zynqmp_pm/power
e336be
+ *
e336be
+ * Return: Number of bytes copied if PM-API request succeeds,
e336be
+ *	   the corresponding error code otherwise
e336be
+ */
e336be
+static ssize_t zynqmp_pm_debugfs_api_write(struct file *file,
e336be
+					   const char __user *ptr, size_t len,
e336be
+					   loff_t *off)
e336be
+{
e336be
+	char *kern_buff, *tmp_buff;
e336be
+	char *pm_api_req;
e336be
+	u32 pm_id = 0;
e336be
+	u64 pm_api_arg[4] = {0, 0, 0, 0};
e336be
+	/* Return values from PM APIs calls */
e336be
+	u32 pm_api_ret[4] = {0, 0, 0, 0};
e336be
+
e336be
+	int ret;
e336be
+	int i = 0;
e336be
+
e336be
+	strcpy(debugfs_buf, "");
e336be
+
e336be
+	if (*off != 0 || len == 0)
e336be
+		return -EINVAL;
e336be
+
e336be
+	kern_buff = kzalloc(len, GFP_KERNEL);
e336be
+	if (!kern_buff)
e336be
+		return -ENOMEM;
e336be
+
e336be
+	tmp_buff = kern_buff;
e336be
+
e336be
+	ret = strncpy_from_user(kern_buff, ptr, len);
e336be
+	if (ret < 0) {
e336be
+		ret = -EFAULT;
e336be
+		goto err;
e336be
+	}
e336be
+
e336be
+	/* Read the API name from a user request */
e336be
+	pm_api_req = strsep(&kern_buff, " ");
e336be
+
e336be
+	ret = get_pm_api_id(pm_api_req, &pm_id);
e336be
+	if (ret < 0)
e336be
+		goto err;
e336be
+
e336be
+	/* Read node_id and arguments from the PM-API request */
e336be
+	pm_api_req = strsep(&kern_buff, " ");
e336be
+	while ((i < ARRAY_SIZE(pm_api_arg)) && pm_api_req) {
e336be
+		pm_api_arg[i++] = zynqmp_pm_argument_value(pm_api_req);
e336be
+		pm_api_req = strsep(&kern_buff, " ");
e336be
+	}
e336be
+
e336be
+	ret = process_api_request(pm_id, pm_api_arg, pm_api_ret);
e336be
+
e336be
+err:
e336be
+	kfree(tmp_buff);
e336be
+	if (ret)
e336be
+		return ret;
e336be
+
e336be
+	return len;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_debugfs_api_read() - debugfs read function
e336be
+ * @file:	User file
e336be
+ * @ptr:	Requested pm_api_version string
e336be
+ * @len:	Length of the userspace buffer
e336be
+ * @off:	Offset within the file
e336be
+ *
e336be
+ * Return: Length of the version string on success
e336be
+ *	   else error code
e336be
+ */
e336be
+static ssize_t zynqmp_pm_debugfs_api_read(struct file *file, char __user *ptr,
e336be
+					  size_t len, loff_t *off)
e336be
+{
e336be
+	return simple_read_from_buffer(ptr, len, off, debugfs_buf,
e336be
+				       strlen(debugfs_buf));
e336be
+}
e336be
+
e336be
+/* Setup debugfs fops */
e336be
+static const struct file_operations fops_zynqmp_pm_dbgfs = {
e336be
+	.owner = THIS_MODULE,
e336be
+	.write = zynqmp_pm_debugfs_api_write,
e336be
+	.read = zynqmp_pm_debugfs_api_read,
e336be
+};
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_api_debugfs_init - Initialize debugfs interface
e336be
+ *
e336be
+ * Return:	None
e336be
+ */
e336be
+void zynqmp_pm_api_debugfs_init(void)
e336be
+{
e336be
+	struct dentry *root_dir;
e336be
+
e336be
+	/* Initialize debugfs interface */
e336be
+	root_dir = debugfs_create_dir("zynqmp-firmware", NULL);
e336be
+	debugfs_create_file("pm", 0660, root_dir, NULL,
e336be
+			    &fops_zynqmp_pm_dbgfs);
e336be
+}
e336be
diff --git a/drivers/firmware/xilinx/zynqmp-debug.h b/drivers/firmware/xilinx/zynqmp-debug.h
e336be
new file mode 100644
e336be
index 0000000..3303b37
e336be
--- /dev/null
e336be
+++ b/drivers/firmware/xilinx/zynqmp-debug.h
e336be
@@ -0,0 +1,22 @@
e336be
+/* SPDX-License-Identifier: GPL-2.0 */
e336be
+/*
e336be
+ * Xilinx Zynq MPSoC Firmware layer
e336be
+ *
e336be
+ *  Copyright (C) 2014-2018 Xilinx
e336be
+ *
e336be
+ *  Michal Simek <michal.simek@xilinx.com>
e336be
+ *  Davorin Mista <davorin.mista@aggios.com>
e336be
+ *  Jolly Shah <jollys@xilinx.com>
e336be
+ *  Rajan Vaja <rajanv@xilinx.com>
e336be
+ */
e336be
+
e336be
+#ifndef __FIRMWARE_ZYNQMP_DEBUG_H__
e336be
+#define __FIRMWARE_ZYNQMP_DEBUG_H__
e336be
+
e336be
+#if IS_REACHABLE(CONFIG_ZYNQMP_FIRMWARE_DEBUG)
e336be
+void zynqmp_pm_api_debugfs_init(void);
e336be
+#else
e336be
+static inline void zynqmp_pm_api_debugfs_init(void) { }
e336be
+#endif
e336be
+
e336be
+#endif /* __FIRMWARE_ZYNQMP_DEBUG_H__ */
e336be
diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
e336be
index 41ed800..7ccedf0 100644
e336be
--- a/drivers/firmware/xilinx/zynqmp.c
e336be
+++ b/drivers/firmware/xilinx/zynqmp.c
e336be
@@ -21,6 +21,7 @@
e336be
 #include <linux/uaccess.h>
e336be
 
e336be
 #include <linux/firmware/xlnx-zynqmp.h>
e336be
+#include "zynqmp-debug.h"
e336be
 
e336be
 /**
e336be
  * zynqmp_pm_ret_code() - Convert PMU-FW error codes to Linux error codes
e336be
@@ -551,3 +552,11 @@ static int __init zynqmp_plat_init(void)
e336be
 	return ret;
e336be
 }
e336be
 early_initcall(zynqmp_plat_init);
e336be
+
e336be
+static int zynqmp_firmware_init(void)
e336be
+{
e336be
+	zynqmp_pm_api_debugfs_init();
e336be
+
e336be
+	return 0;
e336be
+}
e336be
+device_initcall(zynqmp_firmware_init);
e336be
e336be
From patchwork Fri Aug  3 17:53:24 2018
e336be
Content-Type: text/plain; charset="utf-8"
e336be
MIME-Version: 1.0
e336be
Content-Transfer-Encoding: 7bit
e336be
X-Patchwork-Submitter: Jolly Shah <jolly.shah@xilinx.com>
e336be
X-Patchwork-Id: 10555373
e336be
Return-Path: 
e336be
 <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org>
e336be
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
e336be
 [172.30.200.125])
e336be
	by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0728E15E9
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 17:54:15 +0000 (UTC)
e336be
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E50BE2C91B
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 17:54:14 +0000 (UTC)
e336be
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
e336be
	id D82F42C92C; Fri,  3 Aug 2018 17:54:14 +0000 (UTC)
e336be
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
e336be
	pdx-wl-mail.web.codeaurora.org
e336be
X-Spam-Level: 
e336be
X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00,
e336be
	DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1
e336be
Received: from bombadil.infradead.org (bombadil.infradead.org
e336be
 [198.137.202.133])
e336be
	(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))
e336be
	(No client certificate requested)
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5BAE12C91B
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 17:54:14 +0000 (UTC)
e336be
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
e336be
	d=lists.infradead.org; s=bombadil.20170209; h=Sender:
e336be
	Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:
e336be
	List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:
e336be
	Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:
e336be
	Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
e336be
	List-Owner; bh=ce9N8qS1n2EpfOeno+i2a3LMyME6omtu8MHJyKnv2RE=; b=VbC0jj5XyhOiMf
e336be
	oif0P4bseb3ixymI6mjSu7OXKVV3NtUQMiIqBOO05ULnejAkpqQw6k+yoskdpoYbpeaPdFx1gHHfs
e336be
	ooY9iZW2n3JkuhcPfD9RU/2pcZ3uzNWA+HoCHwkUjP4tjcVBbQtWf0y2QvbRTiCHhm3Rr7RHwHusm
e336be
	AliL1P3mk8Vf7hj7902Zlv1Nsdl610wNfsS4HazVcZrMRydVx2ipm+9a8E3iXu4DbAfoKhLGwTy5y
e336be
	Vpn6ixDpLiz13ocXThkBDYx2YM3G/XPWJD0b/sag6o8JsCC/enTrvfR8EX/GyZllS8N5xzm6sudmt
e336be
	UtmP6Niiiq65j4GH70Cw==;
e336be
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
e336be
	by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))
e336be
	id 1fleHC-0002ok-EF; Fri, 03 Aug 2018 17:54:10 +0000
e336be
Received: from mail-co1nam03on0042.outbound.protection.outlook.com
e336be
 ([104.47.40.42] helo=NAM03-CO1-obe.outbound.protection.outlook.com)
e336be
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
e336be
 id 1fleH8-0002l3-8x
e336be
 for linux-arm-kernel@lists.infradead.org; Fri, 03 Aug 2018 17:54:08 +0000
e336be
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
e336be
 d=xilinx.onmicrosoft.com; s=selector1-xilinx-com;
e336be
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
e336be
 bh=KfW+TeHXf25KA6qOupiMQV9tPEEtp8syyNbbmMvNliw=;
e336be
 b=t0MYowi7lPBK6x2+g6Mdq8oGFmSACBNuqqmQAzWbQU9URrT8WULaxtOB+C0uR1P5oa6yxSmofIYryB3wJlV8Ee0exwgNMHgfY6X6u0KY00QfXNknDo7x1rkg3z3+DUgkHe68Ih2eDlMeE2Fodhjjho1kREWii951WIOjELL1zdg=
e336be
Received: from SN6PR02CA0013.namprd02.prod.outlook.com (2603:10b6:805:a2::26)
e336be
 by DM6PR02MB4332.namprd02.prod.outlook.com (2603:10b6:5:2a::29) with
e336be
 Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.14; Fri, 3 Aug
e336be
 2018 17:53:53 +0000
e336be
Received: from SN1NAM02FT020.eop-nam02.prod.protection.outlook.com
e336be
 (2a01:111:f400:7e44::201) by SN6PR02CA0013.outlook.office365.com
e336be
 (2603:10b6:805:a2::26) with Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.15 via Frontend
e336be
 Transport; Fri, 3 Aug 2018 17:53:53 +0000
e336be
Authentication-Results: spf=pass (sender IP is 149.199.60.100)
e336be
 smtp.mailfrom=xilinx.com; linaro.org; dkim=none (message not signed)
e336be
 header.d=none;linaro.org; dmarc=bestguesspass action=none
e336be
 header.from=xilinx.com;
e336be
Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates
e336be
 149.199.60.100 as permitted sender) receiver=protection.outlook.com;
e336be
 client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02;
e336be
Received: from xsj-pvapsmtpgw02 (149.199.60.100) by
e336be
 SN1NAM02FT020.mail.protection.outlook.com (10.152.72.139) with Microsoft SMTP
e336be
 Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1038.3
e336be
 via Frontend Transport; Fri, 3 Aug 2018 17:53:52 +0000
e336be
Received: from unknown-38-66.xilinx.com ([149.199.38.66]:50942
e336be
 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGu-0003jx-3y; Fri, 03 Aug 2018 10:53:52 -0700
e336be
Received: from [127.0.0.1] (helo=localhost)
e336be
 by xsj-pvapsmtp01 with smtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGp-0007cn-0U; Fri, 03 Aug 2018 10:53:47 -0700
e336be
Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com)
e336be
 by xsj-pvapsmtp01 with esmtp (Exim 4.63)
e336be
 (envelope-from <jollys@xilinx.com>)
e336be
 id 1fleGl-0007bh-JC; Fri, 03 Aug 2018 10:53:43 -0700
e336be
From: Jolly Shah <jolly.shah@xilinx.com>
e336be
To: <ard.biesheuvel@linaro.org>, <mingo@kernel.org>,
e336be
 <gregkh@linuxfoundation.org>, <matt@codeblueprint.co.uk>,
e336be
 <sudeep.holla@arm.com>, <hkallweit1@gmail.com>, <keescook@chromium.org>,
e336be
 <dmitry.torokhov@gmail.com>, <mturquette@baylibre.com>,
e336be
 <sboyd@codeaurora.org>, <michal.simek@xilinx.com>, <robh+dt@kernel.org>,
e336be
 <mark.rutland@arm.com>, <linux-clk@vger.kernel.org>
e336be
Subject: [PATCH v11 07/11] firmware: xilinx: Add debugfs for IOCTL API
e336be
Date: Fri, 3 Aug 2018 10:53:24 -0700
e336be
Message-ID: <1533318808-10781-8-git-send-email-jollys@xilinx.com>
e336be
X-Mailer: git-send-email 2.7.4
e336be
In-Reply-To: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
References: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005
e336be
X-TM-AS-User-Approved-Sender: Yes;Yes
e336be
X-EOPAttributedMessage: 0
e336be
X-MS-Office365-Filtering-HT: Tenant
e336be
X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI;
e336be
 SFV:NSPM;
e336be
 SFS:(10009020)(39860400002)(136003)(346002)(376002)(396003)(2980300002)(438002)(189003)(199004)(126002)(36756003)(2616005)(476003)(110136005)(48376002)(106002)(426003)(51416003)(7696005)(336012)(44832011)(54906003)(478600001)(186003)(446003)(11346002)(16586007)(26005)(36386004)(50466002)(76176011)(77096007)(39060400002)(486006)(4326008)(107886003)(8676002)(5660300001)(81166006)(72206003)(316002)(81156014)(305945005)(50226002)(356003)(47776003)(2906002)(9786002)(14444005)(2201001)(8936002)(106466001)(63266004)(6666003)(7416002)(107986001)(921003)(5001870100001)(1121003);
e336be
 DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR02MB4332; H:xsj-pvapsmtpgw02; FPR:;
e336be
 SPF:Pass; LANG:en; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; MX:1;
e336be
 A:1;
e336be
X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT020;
e336be
 1:zasqvSYhsWAhFR8BsQqznPhHZWutS5L27pZRAjx7WftXVjIUELTIoOJpSsSUD+f4Oswo5TGe0mt80EAOljtkOPkYcNn1HyH7b8CbpIqpyOSsOFvajgMgeslMpJUI8FCC
e336be
MIME-Version: 1.0
e336be
X-MS-PublicTrafficType: Email
e336be
X-MS-Office365-Filtering-Correlation-Id: d82c6346-76fc-439b-9dcf-08d5f96a1370
e336be
X-Microsoft-Antispam: BCL:0; PCL:0;
e336be
 RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);
e336be
 SRVR:DM6PR02MB4332;
e336be
X-Microsoft-Exchange-Diagnostics: 1; DM6PR02MB4332;
e336be
 3:rqNZDnzIT5q+FET8pFU3tZhPuEQSRuq3R66uNM3S/YQeizIkJUv1TzWFY/cnr16gynASpVkaHVu+NgEqmV99BWHuleFqGU/UausrCgPe5E5iSh6WWpHLt1u/DNN5il1GhmQdvq7PxWaFV/bQBkE4GlFBsxzfBd4N3FbTarL3iPWhYa9vbozJ0M/Nnml87GSgMAapIihLkI2bXcc3ZpBpNl8A9xUekGpdRbs+LqCkiHvyompxXT7o8r8n/FBCgp2mw70SpIe65sNlJFhRnpOdk4Lq+jgv2dAqVTM4/2U5vttyQ6+r2OOUmbtiyk0wYB+kVa6VBJnGimyXT0lhAQ9K5tR5Bi/6J/Kg5JwOaVPCGKk=;
e336be
 25:bB6qzDqu9+vrR++q12i4He5KMFbdkOATwFddZzgEEFaemA3sUuUP/09hiJ5tRK5TVTkFPvdrQA8BMeA/lfr7zfLMSQZxJFcMA/bQ3iHDkOanuBsL+0T+Bjl4msOkUyZgwUND/zZyvOqds/cBKHyASeWm+5bHLnQYAB41FIQR9xdzV0WHJn3kI/rmqpH6gHXCQ/ItMAJF2sjSoIKk7lD44cYZ+DN4EMs8+yvpVx5HJoy4uGe7SeilyHewvq0GYKJvdQAW2wA/NV/g7iqjkoao8nOXmyzngN/IpOyeQ4tOU5994VjHiI8GX/GJekbZhRa4qQqDW2/36ztKwOSMb47qeQ==
e336be
X-MS-TrafficTypeDiagnostic: DM6PR02MB4332:
e336be
X-Microsoft-Exchange-Diagnostics: 1; DM6PR02MB4332;
e336be
 31:qIs/qh8ANOYqDxK++Xh+tDxbNjl7bMZ/TxTYtgX8za/VfJ2Cufud4gdaHkzWzDj4vwEqjT4AxbNNxBGFMVryjkwPnjS7pPLnxv8DQPnwpMSaP3n1GeWzrbe1HlOtzVY91LHyKBaiLOkkHD145GrLYEJ1TuygVgK1mpYYbwPlJhPPBRW5kwWagNoR9qBuRwdUvoYyBDm2Y4QrYiWbY/siOAq4VsOKBeSDDpgCqN9zk20=;
e336be
 20:lD7XRVhyJr//IUUVdzyMpO05/HTB8vi75mkal0CDU77BsCQUX6q1zxJrrL1ia5oy58X5YW8ZSkr1TvSCIKuIdsvjh1Czgkwcd8S3TC+gfeNM8LAURdI4kvsKPdjMhNENp/fgHtZSf0GLg8jC9Z72RjSB4Oi9XiZs3kEABq61d2D1RWxrGxVGDoH/6K9jVNELXZ07EDb3K/mwu3PFJe+SYIgxAi+eVkiMqnkGOyW4tzFlYJM4laYuBIe7hIog00zDrofIBJV+bCTzxgpmOK08FoRoeIcwoNJF1n3D7wmnkeQWYf3/amxjspYW9badjBxnG4UpevdTjCJmbAcAlov2AHODAWwdrCx/Rsiaakn5vRe5eQIs6lrQHFbvG3yadfFv2ZguoGXKjknbiElxMscOIXgPzdEUanEUf4qcLsqvvaAYslAYERDIhsUzxQzsTbpPlWFpqKr4/RYZlhGwWelPGEBI0cMpuQCOG/39//ShWspUfdWuIMBuKU/WoRHVR8Wp
e336be
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
e336be
X-Microsoft-Antispam-PRVS: 
e336be
 <DM6PR02MB433255E3ED6901B2BF41F17FB8230@DM6PR02MB4332.namprd02.prod.outlook.com>
e336be
X-Exchange-Antispam-Report-Test: UriScan:(192813158149592);
e336be
X-MS-Exchange-SenderADCheck: 1
e336be
X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0;
e336be
 RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(10201501046)(3002001)(93006095)(93004095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011)(7699016);
e336be
 SRVR:DM6PR02MB4332; BCL:0; PCL:0; RULEID:; SRVR:DM6PR02MB4332;
e336be
X-Microsoft-Exchange-Diagnostics: 1; DM6PR02MB4332;
e336be
 4:r1bivONgYPOKb/p6qXDOPJBHzyosgdDYXJiNAopmRrSrT+J9jeJgDUCPVVVO3fO1iRcru7EsKw20JNH/de4DnwjPcaERa5BBQ5s+21hoQX1WUdtOAwRBXYVpHtIxcAl+q1Wqdy1wXQnOKyTFmYAfRvARB+ARy9E/xxPv0Ag6YBh86vBVKaLeTgzsrY326j9wAZO+5zfCmLZ/X29Jr6YrDQCIHE87NWE3DIePvOuWpfX+3ViMI9ij10zO17PA/d5Az3XsyJpJQCTByP1CwJYIjgJWu+oBxzOyQRa/Ukk4vtXWZ6CTxQG38q/Ih825CaKx
e336be
X-Forefront-PRVS: 0753EA505A
e336be
X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM6PR02MB4332;
e336be
 23:yjJEuHL1Zlm2Y6bhlYxp/+bQoRoza31Xn8Id0UIf+?=
e336be
 xZsru2y24PXjkYY9CFICMmincmPADnRcL4CBEQShGlwX3yCgMn6NHhjoJFabw5umqJ/+t4A360PUPD4WN1wi0cBe/V+rF4HT4jdfdqA/+cDFPqmQiuWiDeZbB0d6Mh8fmqAxB3cITyC9KSTTHHe5A/upmPSISNPpLA40ORXQhO2l6CZf813YOirXjIk9FxF0jfhmKQa9fI88iYgbpJQ7cMkQHGDwlNi0RQ5xQFjPc5QXSeUYKuUnpO3oF94rnTPJ7zT52I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1lrDxkMco4LpPC29tj17zbwET/LyzsMFpBb2dZJI+aSWg2fR31gB/Oblo9ltnzHHGRUqDU1A4gIptr13dRvPRVJNsg+gi7Uz2F7UJX/LnadCerbKbTaPwOQi7HXaLmHKhCRkWu6VOVf5ty6cNOyGEAdbcTwIDW/xC4M8pdjTVeXICN0fo3YoY3E6jwAdBAqq4hMGQRPoIs1FWoPoC0Kdxm3xdgshw
e336be
SpamDiagnosticOutput: 1:99
e336be
SpamDiagnosticMetadata: NSPM
e336be
X-OriginatorOrg: xilinx.com
e336be
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2018 17:53:52.5165 (UTC)
e336be
X-MS-Exchange-CrossTenant-Network-Message-Id: 
e336be
 d82c6346-76fc-439b-9dcf-08d5f96a1370
e336be
X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c
e336be
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: 
e336be
 TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100];
e336be
 Helo=[xsj-pvapsmtpgw02]
e336be
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
e336be
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB4332
e336be
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
e336be
X-CRM114-CacheID: sfid-20180803_105406_345529_D3BAF9EE 
e336be
X-CRM114-Status: GOOD (  10.02  )
e336be
X-BeenThere: linux-arm-kernel@lists.infradead.org
e336be
X-Mailman-Version: 2.1.21
e336be
Precedence: list
e336be
List-Id: <linux-arm-kernel.lists.infradead.org>
e336be
List-Unsubscribe: 
e336be
 <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
e336be
List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
e336be
List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
e336be
List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
e336be
List-Subscribe: 
e336be
 <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
e336be
Cc: devicetree@vger.kernel.org, rajanv@xilinx.com,
e336be
 linux-kernel@vger.kernel.org,
e336be
 linux-arm-kernel@lists.infradead.org, Jolly Shah <jollys@xilinx.com>
e336be
Content-Type: text/plain; charset="us-ascii"
e336be
Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
e336be
Errors-To: 
e336be
 linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
e336be
X-Virus-Scanned: ClamAV using ClamSMTP
e336be
e336be
From: Rajan Vaja <rajanv@xilinx.com>
e336be
e336be
Add debugfs file to set/get IOCTL using debugfs interface.
e336be
e336be
Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
e336be
Signed-off-by: Jolly Shah <jollys@xilinx.com>
e336be
---
e336be
 drivers/firmware/xilinx/zynqmp-debug.c | 10 ++++++++++
e336be
 1 file changed, 10 insertions(+)
e336be
e336be
diff --git a/drivers/firmware/xilinx/zynqmp-debug.c b/drivers/firmware/xilinx/zynqmp-debug.c
e336be
index fcbdd6e..fc11db9 100644
e336be
--- a/drivers/firmware/xilinx/zynqmp-debug.c
e336be
+++ b/drivers/firmware/xilinx/zynqmp-debug.c
e336be
@@ -32,6 +32,7 @@ static char debugfs_buf[PAGE_SIZE];
e336be
 #define PM_API(id)		 {id, #id, strlen(#id)}
e336be
 static struct pm_api_info pm_api_list[] = {
e336be
 	PM_API(PM_GET_API_VERSION),
e336be
+	PM_API(PM_IOCTL),
e336be
 };
e336be
 
e336be
 /**
e336be
@@ -95,6 +96,15 @@ static int process_api_request(u32 pm_id, u64 *pm_api_arg, u32 *pm_api_ret)
e336be
 		sprintf(debugfs_buf, "PM-API Version = %d.%d\n",
e336be
 			pm_api_version >> 16, pm_api_version & 0xffff);
e336be
 		break;
e336be
+	case PM_IOCTL:
e336be
+		ret = eemi_ops->ioctl(pm_api_arg[0], pm_api_arg[1],
e336be
+				      pm_api_arg[2], pm_api_arg[3],
e336be
+				      &pm_api_ret[0]);
e336be
+		if (!ret && (pm_api_arg[1] == IOCTL_GET_PLL_FRAC_MODE ||
e336be
+			     pm_api_arg[1] == IOCTL_GET_PLL_FRAC_DATA))
e336be
+			sprintf(debugfs_buf, "IOCTL return value: %u\n",
e336be
+				pm_api_ret[1]);
e336be
+		break;
e336be
 	default:
e336be
 		sprintf(debugfs_buf, "Unsupported PM-API request\n");
e336be
 		ret = -EINVAL;
e336be
e336be
From patchwork Fri Aug  3 17:53:25 2018
e336be
Content-Type: text/plain; charset="utf-8"
e336be
MIME-Version: 1.0
e336be
Content-Transfer-Encoding: 7bit
e336be
X-Patchwork-Submitter: Jolly Shah <jolly.shah@xilinx.com>
e336be
X-Patchwork-Id: 10555381
e336be
Return-Path: 
e336be
 <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org>
e336be
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
e336be
 [172.30.200.125])
e336be
	by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B086E15E9
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 17:54:25 +0000 (UTC)
e336be
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BB322C724
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 17:54:25 +0000 (UTC)
e336be
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
e336be
	id 8EAA52C921; Fri,  3 Aug 2018 17:54:25 +0000 (UTC)
e336be
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
e336be
	pdx-wl-mail.web.codeaurora.org
e336be
X-Spam-Level: 
e336be
X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00,
e336be
	DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1
e336be
Received: from bombadil.infradead.org (bombadil.infradead.org
e336be
 [198.137.202.133])
e336be
	(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))
e336be
	(No client certificate requested)
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 295112C724
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 17:54:25 +0000 (UTC)
e336be
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
e336be
	d=lists.infradead.org; s=bombadil.20170209; h=Sender:
e336be
	Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:
e336be
	List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:
e336be
	Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:
e336be
	Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
e336be
	List-Owner; bh=lnR2egzARcd3do1tohQ8crrngjS/FTt/ADqvx/FYX60=; b=RiDl2QxC7DAUYW
e336be
	v7BRJ71S0D53ilwoEJyjeanWkY0AarXbJWeNri9uXBvpTbNNA4oC0xl1CEKOCt7FSvMz4dk0gD3Ho
e336be
	Z3064GXcr76LndREQR2tY1uoRJW9DBt3Cg7rSS0/ZqHKCHaq7A31RX1vESG2jhJ6V2lGHu2E4Q1qD
e336be
	oYRmv0tyvFDIbmsgvG1T9yq6ivHrwqPL1MFZmb6O3Oa4i9iOQ4aQbJphwKp1niT0hgTqZTC/76Ipm
e336be
	gyP8R8CLL4gls6cffRMBdHnq2vslhXK0Ya4hqMKjaQPtO77h6VYGwJpJmPNj1yeCNk7wL4CouepJp
e336be
	1BCQjMivt5uKKY5mznzg==;
e336be
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
e336be
	by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))
e336be
	id 1fleHL-0002zp-QP; Fri, 03 Aug 2018 17:54:19 +0000
e336be
Received: from mail-by2nam03on0056.outbound.protection.outlook.com
e336be
 ([104.47.42.56] helo=NAM03-BY2-obe.outbound.protection.outlook.com)
e336be
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
e336be
 id 1fleH9-0002l6-88
e336be
 for linux-arm-kernel@lists.infradead.org; Fri, 03 Aug 2018 17:54:08 +0000
e336be
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
e336be
 d=xilinx.onmicrosoft.com; s=selector1-xilinx-com;
e336be
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
e336be
 bh=i0IgDLNWNv5gP6EXKCmjmOTwm0Q6U6uAi73B0G9dCkE=;
e336be
 b=1Zk3qfFsCgO9YbPuv0Y7o2FnuFRcjRqSj091uZbQr++yUbCmzPLaHAbty86zC4wKMTvFzPNzcC3HE85q0dL4w+S9zkVxXYBE0DclgEr500SnHCGR6gW4JopxbDEdNzX/INXyQY0GTC31M9CNwnYbK9/Y8VB62szPYcFX04i9fa8=
e336be
Received: from MWHPR0201CA0052.namprd02.prod.outlook.com
e336be
 (2603:10b6:301:73::29) by SN6PR02MB4464.namprd02.prod.outlook.com
e336be
 (2603:10b6:805:a8::14) with Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Fri, 3 Aug
e336be
 2018 17:53:53 +0000
e336be
Received: from CY1NAM02FT029.eop-nam02.prod.protection.outlook.com
e336be
 (2a01:111:f400:7e45::205) by MWHPR0201CA0052.outlook.office365.com
e336be
 (2603:10b6:301:73::29) with Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.15 via Frontend
e336be
 Transport; Fri, 3 Aug 2018 17:53:53 +0000
e336be
Authentication-Results: spf=pass (sender IP is 149.199.60.83)
e336be
 smtp.mailfrom=xilinx.com; linaro.org; dkim=none (message not signed)
e336be
 header.d=none;linaro.org; dmarc=bestguesspass action=none
e336be
 header.from=xilinx.com;
e336be
Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates
e336be
 149.199.60.83 as permitted sender) receiver=protection.outlook.com;
e336be
 client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01;
e336be
Received: from xsj-pvapsmtpgw01 (149.199.60.83) by
e336be
 CY1NAM02FT029.mail.protection.outlook.com (10.152.75.143) with Microsoft SMTP
e336be
 Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1038.3
e336be
 via Frontend Transport; Fri, 3 Aug 2018 17:53:52 +0000
e336be
Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01)
e336be
 by xsj-pvapsmtpgw01 with esmtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGu-0004ff-2J; Fri, 03 Aug 2018 10:53:52 -0700
e336be
Received: from [127.0.0.1] (helo=localhost)
e336be
 by xsj-pvapsmtp01 with smtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGo-0007cn-VI; Fri, 03 Aug 2018 10:53:47 -0700
e336be
Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com)
e336be
 by xsj-pvapsmtp01 with esmtp (Exim 4.63)
e336be
 (envelope-from <jollys@xilinx.com>)
e336be
 id 1fleGl-0007bh-LV; Fri, 03 Aug 2018 10:53:43 -0700
e336be
From: Jolly Shah <jolly.shah@xilinx.com>
e336be
To: <ard.biesheuvel@linaro.org>, <mingo@kernel.org>,
e336be
 <gregkh@linuxfoundation.org>, <matt@codeblueprint.co.uk>,
e336be
 <sudeep.holla@arm.com>, <hkallweit1@gmail.com>, <keescook@chromium.org>,
e336be
 <dmitry.torokhov@gmail.com>, <mturquette@baylibre.com>,
e336be
 <sboyd@codeaurora.org>, <michal.simek@xilinx.com>, <robh+dt@kernel.org>,
e336be
 <mark.rutland@arm.com>, <linux-clk@vger.kernel.org>
e336be
Subject: [PATCH v11 08/11] firmware: xilinx: Add debugfs for query data API
e336be
Date: Fri, 3 Aug 2018 10:53:25 -0700
e336be
Message-ID: <1533318808-10781-9-git-send-email-jollys@xilinx.com>
e336be
X-Mailer: git-send-email 2.7.4
e336be
In-Reply-To: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
References: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005
e336be
X-TM-AS-User-Approved-Sender: Yes;Yes
e336be
X-EOPAttributedMessage: 0
e336be
X-MS-Office365-Filtering-HT: Tenant
e336be
X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI;
e336be
 SFV:NSPM;
e336be
 SFS:(10009020)(136003)(376002)(396003)(39860400002)(346002)(2980300002)(438002)(199004)(189003)(7416002)(106466001)(76176011)(63266004)(26005)(8936002)(186003)(36386004)(77096007)(356003)(44832011)(51416003)(14444005)(478600001)(7696005)(16586007)(8676002)(81166006)(81156014)(486006)(476003)(2616005)(305945005)(5660300001)(126002)(11346002)(72206003)(50226002)(39060400002)(48376002)(54906003)(107886003)(2906002)(106002)(6666003)(110136005)(9786002)(36756003)(50466002)(4326008)(2201001)(47776003)(446003)(336012)(316002)(426003)(107986001)(921003)(1121003);
e336be
 DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR02MB4464; H:xsj-pvapsmtpgw01; FPR:;
e336be
 SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1;
e336be
X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT029;
e336be
 1:tlu558b3azl42+Zy2SjA5Z5SRTd2KPhEWI4kdsDAyBNVxcnxnPyBJ7aOgp7x8ZwBf9bO6jbSFGArDfnY3SRnZkcPOafmo38dlhoG8+CnhSQZY6c4lXkuv2adDiH0tvNk
e336be
MIME-Version: 1.0
e336be
X-MS-PublicTrafficType: Email
e336be
X-MS-Office365-Filtering-Correlation-Id: 3e9504cb-b74e-4886-28c0-08d5f96a13a8
e336be
X-Microsoft-Antispam: BCL:0; PCL:0;
e336be
 RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);
e336be
 SRVR:SN6PR02MB4464;
e336be
X-Microsoft-Exchange-Diagnostics: 1; SN6PR02MB4464;
e336be
 3:BVFZRR1SnMLKxNT+SdXRZlaNK6KP+fVbNjKRIBXuWDkRtU56EVpd00nuBcZEK3poMB3Dbh2qkMtsHCidJltSDyV69yvycQ8bgX20CimC0H2HrVIMYVwEa+DX2V1l3esZQDsVdvWJIPq/Wzfh6ZU3MHc7ePoIqetIXj0W80UI/6Zx9hYbOHb0NLlvZXNlZrwx16uwfYNHVNj2BkTuoGAisSSVwdX+FoXwZHKr1iiMx+VnUyUCk/UVnGzJNPfhcABCbLS+dgfiLwYLRR6oayE9JYGpieYAR1KJQCVDChsssQeEfC9Nx73SBiO8334OBkv5nfhZbUzFq4fxmgSFUZBAjp97Wllysx8rUaEjzVdBkQo=;
e336be
 25:P0Y4vUXVx8XBYqewFPdmE2fGmpBW3r0rzq6MXmR/XFUc0BSaqpl6YetHEqwzjZaqOKQta5Jk+wUuqANs3RH/70ThP/UOCJAoCjUSLtvyY4F9+Kk8PFe/cPfoSv7uf8Esqcu4Jl7MqZH4jrxdNacwmFKkuL72xXm7IfNo/HEb2YIFM+sjhoHZJTaioxPF23V6hhHFIMQr8gxuuQi9boVhutaCzWhbL/ptFvCpDvPeELj+hny0SNM5q+5tN5Fz2d9mGiWyRZp6VRcDDPHtzijJjKp2QA7phLJ9kSeLr9PNpl/59D/sXS6FtZmAgkPgTHM4UZ6soDr39u5j1vbmyEaTqA==
e336be
X-MS-TrafficTypeDiagnostic: SN6PR02MB4464:
e336be
X-Microsoft-Exchange-Diagnostics: 1; SN6PR02MB4464;
e336be
 31:oT00T/YmZ5EY+GRI+oHKEkzdju4DMXAZgJYQuu+6BI+YmscaVJEwOqimJAwiOnDHwrFuLqALQfsFrs2Q6Uu6XJADRYaHuVik7CMeRIz8b5dbdu00qw7PzsBZ+6JlW+hIABLnCz00Uxy1wH4FAT8SIMyVUagxsr3i29sn5l4xHBMsw5+zCXYSe3cUlsRD7IktGuPwOsan5w255pzI8dgQDb/+M6vMWBYD/ZGyuW5pBYU=;
e336be
 20:PRGLfqeUebhpU3eShXApfNuiBWdOqRB6/txgt9g32mr0iRP03COrXk6dAMiAB6nBgnbs2nT9kwa0WW7ofSNTMCDbyZ0picljMVwzetEMEZxsVojSbGvIGqYlgFFhkVLd7dIeloruXKX+9J+6AT+P3Ifkp6HPNT/YWBIpOq8+n/tVMyfgq1tINCOPrOC2KBu3vRQwXVe7iKMtVrO3DZJ74ZXWU8XoHUlabu20hoYT4xxgtnbl0loMMZZPbhWLVCP35kccsZgVO+MEjVNWzQVyVAHaDny+nK3/+nNQ8KrfCR+c+RHmjQ7hCIlPlD31uxKtlurE/pMPO8FjxIplw7mabHGY/XSdGFogwKJIbyFFqa5OPH0cnna9mYlgw1+nSlM0e5clG3alzoyX3zsBQbD2Xp2T22RkPcFuvUzgBpYxVASD4qrlbJ9ldCM8zEEk/PMI41nSGG7AhySBbpxygvbjnGR/0pmoUWgMiPh9WFJbRTjPvhYYPormij2mUBfRaUWv
e336be
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
e336be
X-Microsoft-Antispam-PRVS: 
e336be
 <SN6PR02MB4464FB98D94F90D655A85AC1B8230@SN6PR02MB4464.namprd02.prod.outlook.com>
e336be
X-Exchange-Antispam-Report-Test: UriScan:(192813158149592);
e336be
X-MS-Exchange-SenderADCheck: 1
e336be
X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0;
e336be
 RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93004095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011)(7699016);
e336be
 SRVR:SN6PR02MB4464; BCL:0; PCL:0; RULEID:; SRVR:SN6PR02MB4464;
e336be
X-Microsoft-Exchange-Diagnostics: 1; SN6PR02MB4464;
e336be
 4:Y+H7YhLr3I920ykuDHLeRh1sAoQGMP49ejmWMIGmJkMYHuGB7pFgIpnKVOZNUDN3FNaBZJEw6gnx83xbe/jLNoz63q1s8fnxrltLTAcdqL6tkVt8xcFfcr6xXWEdS/bcROPvsiS+znCrcLF7zxYpvuPmjmRZaDic0fHxtlFIY8j6Kfg9Lkh/j0ARRXtadVYl/JGQM5d0andJ0EswQbcDMsPnAMWHfOchs2l4rTyRpT4a6T+6O8VZFIYUH+uMCv+mYacjocE/TDC8drF+zipK3NoQh5LwLdN5UPGmsINrkYiI4ocAVSasxOk1G7JQJa8+
e336be
X-Forefront-PRVS: 0753EA505A
e336be
X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN6PR02MB4464;
e336be
 23:TEa1K9fyfzSmHdgGYe5+/dP0WaHySlm3R1xxhNBnK?=
e336be
 hYmMG6sHFCwZfkYsZhXoDcXoVdjpN6ElmC66pQneuuG6gbcumL0JmwLAYtptBig1/i1o3lGvFYPn/DBqnmJRMJOKDQX5q5A7OpKYqCp7IK2YYEJdvDecMkGnCDBuazdk5ok6+0fxL6ctgsnJAcQce60g0bmjW48KQ6EZCdoQyzrH19xvLk5gFKP1T9COaKNzR3Xp/OjlU0+QOv6mPVQM7m1u8ROBW1MnzNOu//qlWcozrxLqL6Bz99vVPnBE/Kk4FKOuIYrgY0TqvfIafVU46P33H1Xt8Pcyh2B2Xs7ugKqvURnwM+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ARkkZ4ju+VoTQOoWm0Wm3/gOJXGg1mBprjgXhA6fBhBCFNTgfuyFOo3ufOayoIctbhPRpy2wxEmFcqO67vefMbvYLW4dklrvfihwH4/40x3ll2wYwCj+dl0164xo8BRQ
e336be
SpamDiagnosticOutput: 1:99
e336be
SpamDiagnosticMetadata: NSPM
e336be
X-OriginatorOrg: xilinx.com
e336be
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2018 17:53:52.5358 (UTC)
e336be
X-MS-Exchange-CrossTenant-Network-Message-Id: 
e336be
 3e9504cb-b74e-4886-28c0-08d5f96a13a8
e336be
X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c
e336be
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: 
e336be
 TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83];
e336be
 Helo=[xsj-pvapsmtpgw01]
e336be
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
e336be
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB4464
e336be
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
e336be
X-CRM114-CacheID: sfid-20180803_105407_290790_57518988 
e336be
X-CRM114-Status: UNSURE (   9.52  )
e336be
X-CRM114-Notice: Please train this message.
e336be
X-BeenThere: linux-arm-kernel@lists.infradead.org
e336be
X-Mailman-Version: 2.1.21
e336be
Precedence: list
e336be
List-Id: <linux-arm-kernel.lists.infradead.org>
e336be
List-Unsubscribe: 
e336be
 <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
e336be
List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
e336be
List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
e336be
List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
e336be
List-Subscribe: 
e336be
 <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
e336be
Cc: devicetree@vger.kernel.org, rajanv@xilinx.com,
e336be
 linux-kernel@vger.kernel.org,
e336be
 linux-arm-kernel@lists.infradead.org, Jolly Shah <jollys@xilinx.com>
e336be
Content-Type: text/plain; charset="us-ascii"
e336be
Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
e336be
Errors-To: 
e336be
 linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
e336be
X-Virus-Scanned: ClamAV using ClamSMTP
e336be
e336be
From: Rajan Vaja <rajanv@xilinx.com>
e336be
e336be
Add debugfs file to query platform specific data from firmware
e336be
using debugfs interface.
e336be
e336be
Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
e336be
Signed-off-by: Jolly Shah <jollys@xilinx.com>
e336be
---
e336be
 drivers/firmware/xilinx/zynqmp-debug.c | 27 +++++++++++++++++++++++++++
e336be
 1 file changed, 27 insertions(+)
e336be
e336be
diff --git a/drivers/firmware/xilinx/zynqmp-debug.c b/drivers/firmware/xilinx/zynqmp-debug.c
e336be
index fc11db9..4532bd0 100644
e336be
--- a/drivers/firmware/xilinx/zynqmp-debug.c
e336be
+++ b/drivers/firmware/xilinx/zynqmp-debug.c
e336be
@@ -33,6 +33,7 @@ static char debugfs_buf[PAGE_SIZE];
e336be
 static struct pm_api_info pm_api_list[] = {
e336be
 	PM_API(PM_GET_API_VERSION),
e336be
 	PM_API(PM_IOCTL),
e336be
+	PM_API(PM_QUERY_DATA),
e336be
 };
e336be
 
e336be
 /**
e336be
@@ -105,6 +106,32 @@ static int process_api_request(u32 pm_id, u64 *pm_api_arg, u32 *pm_api_ret)
e336be
 			sprintf(debugfs_buf, "IOCTL return value: %u\n",
e336be
 				pm_api_ret[1]);
e336be
 		break;
e336be
+	case PM_QUERY_DATA:
e336be
+	{
e336be
+		struct zynqmp_pm_query_data qdata = {0};
e336be
+
e336be
+		qdata.qid = pm_api_arg[0];
e336be
+		qdata.arg1 = pm_api_arg[1];
e336be
+		qdata.arg2 = pm_api_arg[2];
e336be
+		qdata.arg3 = pm_api_arg[3];
e336be
+
e336be
+		ret = eemi_ops->query_data(qdata, pm_api_ret);
e336be
+		if (ret)
e336be
+			break;
e336be
+
e336be
+		if (qdata.qid == PM_QID_CLOCK_GET_NAME)
e336be
+			sprintf(debugfs_buf, "Clock name = %s\n",
e336be
+				(char *)pm_api_ret);
e336be
+		else if (qdata.qid == PM_QID_CLOCK_GET_FIXEDFACTOR_PARAMS)
e336be
+			sprintf(debugfs_buf, "Multiplier = %d, Divider = %d\n",
e336be
+				pm_api_ret[1], pm_api_ret[2]);
e336be
+		else
e336be
+			sprintf(debugfs_buf,
e336be
+				"data[0] = 0x%08x\ndata[1] = 0x%08x\n data[2] = 0x%08x\ndata[3] = 0x%08x\n",
e336be
+				pm_api_ret[0], pm_api_ret[1],
e336be
+				pm_api_ret[2], pm_api_ret[3]);
e336be
+		break;
e336be
+	}
e336be
 	default:
e336be
 		sprintf(debugfs_buf, "Unsupported PM-API request\n");
e336be
 		ret = -EINVAL;
e336be
e336be
From patchwork Fri Aug  3 17:53:26 2018
e336be
Content-Type: text/plain; charset="utf-8"
e336be
MIME-Version: 1.0
e336be
Content-Transfer-Encoding: 7bit
e336be
X-Patchwork-Submitter: Jolly Shah <jolly.shah@xilinx.com>
e336be
X-Patchwork-Id: 10555415
e336be
Return-Path: 
e336be
 <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org>
e336be
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
e336be
 [172.30.200.125])
e336be
	by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 161D715E9
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:06:08 +0000 (UTC)
e336be
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00D202C1AF
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:06:07 +0000 (UTC)
e336be
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
e336be
	id E7CA22C984; Fri,  3 Aug 2018 18:06:06 +0000 (UTC)
e336be
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
e336be
	pdx-wl-mail.web.codeaurora.org
e336be
X-Spam-Level: 
e336be
X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00,
e336be
	DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1
e336be
Received: from bombadil.infradead.org (bombadil.infradead.org
e336be
 [198.137.202.133])
e336be
	(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))
e336be
	(No client certificate requested)
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5E6DD2C1AF
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:06:06 +0000 (UTC)
e336be
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
e336be
	d=lists.infradead.org; s=bombadil.20170209; h=Sender:
e336be
	Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:
e336be
	List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:
e336be
	Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:
e336be
	Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
e336be
	List-Owner; bh=PXpZteDCUvUArIPwOWZhqWGd+7c52/jdjx3SEmepUnQ=; b=IivyP2jdiwZsb/
e336be
	yR0QYdIrU0FQ18U8SQGjwANxINvojGo98o+FL70gO0MHolUcMvIzInWHnV9MMtchAuFhCFPtHFqOG
e336be
	yRJHsMehaYrjOFFITzJTLIfgmlZbE81unY7hy4rqRMFEqDy6ipd1oWApiPIcWp8TENpGKFU//WVmW
e336be
	C46R5n8EFcgQjYvVQjvIfcxLvQbbzUrnY4dXgAAO4N9eLS2hr9K6i1PvD5sHQpq69ZuMHUpniKFin
e336be
	KAyW+5OGe/MIuV2NetpBYh1wuyTgtxGJ/YNGAIRgPL60DQtRcNiBc3vOhYnWpkbNwdf3RHPWfHQdS
e336be
	sPh+RhYJ4b16VaXyoW0g==;
e336be
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
e336be
	by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))
e336be
	id 1fleSi-00021X-E7; Fri, 03 Aug 2018 18:06:04 +0000
e336be
Received: from mail-cys01nam02on0057.outbound.protection.outlook.com
e336be
 ([104.47.37.57] helo=NAM02-CY1-obe.outbound.protection.outlook.com)
e336be
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
e336be
 id 1fleHA-0002lK-LN
e336be
 for linux-arm-kernel@lists.infradead.org; Fri, 03 Aug 2018 17:54:10 +0000
e336be
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
e336be
 d=xilinx.onmicrosoft.com; s=selector1-xilinx-com;
e336be
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
e336be
 bh=ae3uMsPM9qWtcPtZCcchHnnmLXzK+8XsulKYSv1xPnQ=;
e336be
 b=FI/EJwAjOiiTYfjgyU0qYCCdSqEqG5UboVtajbpJixXJo8HsUhCNSxSCP0ZXzojQTuZhJh1Mz3kEC9cRfsXv9CEVGXqS+K0R7dK0YDRijdee8CgdJH04tfjODtgceSDZMit6xrALZN/+baeW2l0rRShQyTUKV/rkzUYY4v2bWaE=
e336be
Received: from BN6PR02CA0088.namprd02.prod.outlook.com (2603:10b6:405:60::29)
e336be
 by DM6PR02MB4458.namprd02.prod.outlook.com (2603:10b6:5:29::27) with
e336be
 Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.14; Fri, 3 Aug
e336be
 2018 17:53:54 +0000
e336be
Received: from CY1NAM02FT051.eop-nam02.prod.protection.outlook.com
e336be
 (2a01:111:f400:7e45::202) by BN6PR02CA0088.outlook.office365.com
e336be
 (2603:10b6:405:60::29) with Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.14 via Frontend
e336be
 Transport; Fri, 3 Aug 2018 17:53:54 +0000
e336be
Authentication-Results: spf=pass (sender IP is 149.199.60.83)
e336be
 smtp.mailfrom=xilinx.com; linaro.org; dkim=none (message not signed)
e336be
 header.d=none;linaro.org; dmarc=bestguesspass action=none
e336be
 header.from=xilinx.com;
e336be
Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates
e336be
 149.199.60.83 as permitted sender) receiver=protection.outlook.com;
e336be
 client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01;
e336be
Received: from xsj-pvapsmtpgw01 (149.199.60.83) by
e336be
 CY1NAM02FT051.mail.protection.outlook.com (10.152.74.148) with Microsoft SMTP
e336be
 Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1038.3
e336be
 via Frontend Transport; Fri, 3 Aug 2018 17:53:52 +0000
e336be
Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01)
e336be
 by xsj-pvapsmtpgw01 with esmtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGu-0004fi-DG; Fri, 03 Aug 2018 10:53:52 -0700
e336be
Received: from [127.0.0.1] (helo=localhost)
e336be
 by xsj-pvapsmtp01 with smtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGp-0007cn-9X; Fri, 03 Aug 2018 10:53:47 -0700
e336be
Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com)
e336be
 by xsj-pvapsmtp01 with esmtp (Exim 4.63)
e336be
 (envelope-from <jollys@xilinx.com>)
e336be
 id 1fleGl-0007bh-No; Fri, 03 Aug 2018 10:53:43 -0700
e336be
From: Jolly Shah <jolly.shah@xilinx.com>
e336be
To: <ard.biesheuvel@linaro.org>, <mingo@kernel.org>,
e336be
 <gregkh@linuxfoundation.org>, <matt@codeblueprint.co.uk>,
e336be
 <sudeep.holla@arm.com>, <hkallweit1@gmail.com>, <keescook@chromium.org>,
e336be
 <dmitry.torokhov@gmail.com>, <mturquette@baylibre.com>,
e336be
 <sboyd@codeaurora.org>, <michal.simek@xilinx.com>, <robh+dt@kernel.org>,
e336be
 <mark.rutland@arm.com>, <linux-clk@vger.kernel.org>
e336be
Subject: [PATCH v11 09/11] dt-bindings: clock: Add bindings for ZynqMP clock
e336be
 driver
e336be
Date: Fri, 3 Aug 2018 10:53:26 -0700
e336be
Message-ID: <1533318808-10781-10-git-send-email-jollys@xilinx.com>
e336be
X-Mailer: git-send-email 2.7.4
e336be
In-Reply-To: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
References: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005
e336be
X-TM-AS-User-Approved-Sender: Yes;Yes
e336be
X-EOPAttributedMessage: 0
e336be
X-MS-Office365-Filtering-HT: Tenant
e336be
X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI;
e336be
 SFV:NSPM;
e336be
 SFS:(10009020)(39860400002)(376002)(136003)(396003)(346002)(2980300002)(438002)(199004)(189003)(110136005)(16586007)(6666003)(81166006)(50226002)(106002)(72206003)(9786002)(36386004)(316002)(8676002)(54906003)(8936002)(305945005)(478600001)(81156014)(7416002)(2906002)(14444005)(356003)(5660300001)(11346002)(51416003)(107886003)(36756003)(77096007)(26005)(426003)(446003)(76176011)(44832011)(4326008)(2616005)(476003)(106466001)(126002)(486006)(7696005)(336012)(186003)(47776003)(50466002)(39060400002)(2201001)(48376002)(63266004)(921003)(107986001)(1121003);
e336be
 DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR02MB4458; H:xsj-pvapsmtpgw01; FPR:;
e336be
 SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; A:1; MX:1;
e336be
X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT051;
e336be
 1:r2aaelOlGinHop5AwkglWkdQGiko7SdFguC1UTEs1ZMLw6EOu3O3TR/38D7r8d0yBGJlzhzQnxPuCf70DmEp4uoomt3QCEihRgMc83ykJDqA4j5H+3LV6MEFFZdwi7L/
e336be
MIME-Version: 1.0
e336be
X-MS-PublicTrafficType: Email
e336be
X-MS-Office365-Filtering-Correlation-Id: d3e901e9-096d-4104-a2f9-08d5f96a13ef
e336be
X-Microsoft-Antispam: BCL:0; PCL:0;
e336be
 RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);
e336be
 SRVR:DM6PR02MB4458;
e336be
X-Microsoft-Exchange-Diagnostics: 1; DM6PR02MB4458;
e336be
 3:PFwFIbFWgQNHpmBa7jNoZ0zs/Zf4zzFVT9ICaAHrSvZKtI2gWPdnExfaHWU/QtCrQTMNcR7l9kIk+DQVkCyZWNCdiGrPqDmUeVYB0mf2bSvDJtzU6rL6bgtSdE4oEYDf+Hn196zI5uZ0/DWq+on2XqgunWBX4F1bBSFVs1T0Di6r5AKZJxi/AxTgJppOi+/yncQ55Kx3TKDVUzesb0uFt6M5rR04lVto2hSRYZGzorgxqjxqjzYPNg6fZrcWJS9Cxi6e3pGvspF88Mn+aQpVDOPRtHT5VEDwYMygoVM4X5aDy7IVogJbw0GQIQyoDK37mIoNNHOEDClzi/Gh6NgH15sKOTi3FMlWZqIVSsDVdBc=;
e336be
 25:zig4Iv1wWNgO2YBS4QYVsKRamvs9x4tZ5gIPyW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MBxDRw3fXIFeuds1+LkEtQiqjT7YXOY2I5hXgzFYfSY+QWvVQl1TpNOU/JRXqDwepwR5l4E
e336be
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
e336be
X-Microsoft-Antispam-PRVS: 
e336be
 <DM6PR02MB445864027854CF1355F56F27B8230@DM6PR02MB4458.namprd02.prod.outlook.com>
e336be
X-Exchange-Antispam-Report-Test: UriScan:(192813158149592);
e336be
X-MS-Exchange-SenderADCheck: 1
e336be
X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0;
e336be
 RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231311)(944501410)(52105095)(10201501046)(93006095)(93004095)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123560045)(20161123558120)(6072148)(201708071742011)(7699016);
e336be
 SRVR:DM6PR02MB4458; BCL:0; PCL:0; RULEID:; SRVR:DM6PR02MB4458;
e336be
X-Microsoft-Exchange-Diagnostics: 1; DM6PR02MB4458;
e336be
 4:/mexK16c4/CPTktwuWtd7fSd04+/Md4/7N6DHUYdIxBprYYDQA30zlVjXjBilUnmIhOid1hVE0s00qJs6DHpNEr/u46rR302iB9yv0s7Q3AVV7QYOcBSmylWgfP17HMkLjvEH6+/Suj9R8KjSdpHp/ARtXUxEdIoLLRizSs141ulsPTsH2tv1wVD/MZepGaiRzzMf1uG4ii9I/lKFsbhw+VVXRFIjZzvB64kYiV4CouZqASeDzq9+1JANgXfrwfphr1HKDPlje1fQ2wHHsBXMT7yIG31GoU9VBYRQ6yRGY71NniMQCzsaS1/JZn+ybst
e336be
X-Forefront-PRVS: 0753EA505A
e336be
X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM6PR02MB4458;
e336be
 23:xwee+5SQDhefFzvX3mraisWTaB2oMx55mZqnSzcxY?=
e336be
 kGSa5qXC635bSJJoPBmXpDiBA6sB6L0NJToWD7bsSamKMZN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2qN2LqjHQ/pCb/ZS7vqVrUQmrcn5rRgsa4ohloleKoOKN6hLLwzH2pjsEMdryZTPRM70Z1dyRu1rfBqKlZS+1YisFtYK8ikc0dEonnjosiGwfYkQfLV6E0jr3rBzJw+muBwpA=;
e336be
 7:SWFVkAVa2OixXXyCLAb2sKQc+8x2cL97GXGkPGS/3oh9Bc4ZCYBB2EZsumpcSltzI2wTxXFq0+FmwJpP1PAIeV2TSc8nqIa1Pyn9hemb8TwbstcZeJKVSZqD23P17cm9x3NBdcjpwGEn27Al3xSSlmGwBIrrtZCscqA80PLwIlDzS8fSHLRRgPc2MrS0Eo1KqppT69Q43eLOR94i7eq9XdkEviwd3lcFzTMpwuGt109mYguNTnW9oBaBvdzsoS7E
e336be
SpamDiagnosticOutput: 1:99
e336be
SpamDiagnosticMetadata: NSPM
e336be
X-OriginatorOrg: xilinx.com
e336be
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2018 17:53:52.9427 (UTC)
e336be
X-MS-Exchange-CrossTenant-Network-Message-Id: 
e336be
 d3e901e9-096d-4104-a2f9-08d5f96a13ef
e336be
X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c
e336be
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: 
e336be
 TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83];
e336be
 Helo=[xsj-pvapsmtpgw01]
e336be
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
e336be
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB4458
e336be
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
e336be
X-CRM114-CacheID: sfid-20180803_105408_826047_EDA513C2 
e336be
X-CRM114-Status: GOOD (  12.62  )
e336be
X-BeenThere: linux-arm-kernel@lists.infradead.org
e336be
X-Mailman-Version: 2.1.21
e336be
Precedence: list
e336be
List-Id: <linux-arm-kernel.lists.infradead.org>
e336be
List-Unsubscribe: 
e336be
 <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
e336be
List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
e336be
List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
e336be
List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
e336be
List-Subscribe: 
e336be
 <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
e336be
Cc: devicetree@vger.kernel.org, rajanv@xilinx.com,
e336be
 linux-kernel@vger.kernel.org,
e336be
 linux-arm-kernel@lists.infradead.org, Jolly Shah <jollys@xilinx.com>
e336be
Content-Type: text/plain; charset="us-ascii"
e336be
Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
e336be
Errors-To: 
e336be
 linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
e336be
X-Virus-Scanned: ClamAV using ClamSMTP
e336be
e336be
From: Rajan Vaja <rajanv@xilinx.com>
e336be
e336be
Add documentation to describe Xilinx ZynqMP clock driver
e336be
bindings.
e336be
e336be
Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
e336be
Signed-off-by: Jolly Shah <jollys@xilinx.com>
e336be
Reviewed-by: Rob Herring <robh@kernel.org>
e336be
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
e336be
---
e336be
 .../firmware/xilinx/xlnx,zynqmp-firmware.txt       |  53 ++++++++++
e336be
 include/dt-bindings/clock/xlnx,zynqmp-clk.h        | 116 +++++++++++++++++++++
e336be
 2 files changed, 169 insertions(+)
e336be
 create mode 100644 include/dt-bindings/clock/xlnx,zynqmp-clk.h
e336be
e336be
diff --git a/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.txt b/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.txt
e336be
index 1b431d9..d215d15 100644
e336be
--- a/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.txt
e336be
+++ b/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.txt
e336be
@@ -17,6 +17,53 @@ Required properties:
e336be
 		  - "smc" : SMC #0, following the SMCCC
e336be
 		  - "hvc" : HVC #0, following the SMCCC
e336be
 
e336be
+--------------------------------------------------------------------------
e336be
+Device Tree Clock bindings for the Zynq Ultrascale+ MPSoC controlled using
e336be
+Zynq MPSoC firmware interface
e336be
+--------------------------------------------------------------------------
e336be
+The clock controller is a h/w block of Zynq Ultrascale+ MPSoC clock
e336be
+tree. It reads required input clock frequencies from the devicetree and acts
e336be
+as clock provider for all clock consumers of PS clocks.
e336be
+
e336be
+See clock_bindings.txt for more information on the generic clock bindings.
e336be
+
e336be
+Required properties:
e336be
+ - #clock-cells:	Must be 1
e336be
+ - compatible:		Must contain:	"xlnx,zynqmp-clk"
e336be
+ - clocks:		List of clock specifiers which are external input
e336be
+			clocks to the given clock controller. Please refer
e336be
+			the next section to find the input clocks for a
e336be
+			given controller.
e336be
+ - clock-names:		List of clock names which are exteral input clocks
e336be
+			to the given clock controller. Please refer to the
e336be
+			clock bindings for more details.
e336be
+
e336be
+Input clocks for zynqmp Ultrascale+ clock controller:
e336be
+
e336be
+The Zynq UltraScale+ MPSoC has one primary and four alternative reference clock
e336be
+inputs. These required clock inputs are:
e336be
+ - pss_ref_clk (PS reference clock)
e336be
+ - video_clk (reference clock for video system )
e336be
+ - pss_alt_ref_clk (alternative PS reference clock)
e336be
+ - aux_ref_clk
e336be
+ - gt_crx_ref_clk (transceiver reference clock)
e336be
+
e336be
+The following strings are optional parameters to the 'clock-names' property in
e336be
+order to provide an optional (E)MIO clock source:
e336be
+ - swdt0_ext_clk
e336be
+ - swdt1_ext_clk
e336be
+ - gem0_emio_clk
e336be
+ - gem1_emio_clk
e336be
+ - gem2_emio_clk
e336be
+ - gem3_emio_clk
e336be
+ - mio_clk_XX		# with XX = 00..77
e336be
+ - mio_clk_50_or_51	#for the mux clock to gem tsu from 50 or 51
e336be
+
e336be
+
e336be
+Output clocks are registered based on clock information received
e336be
+from firmware. Output clocks indexes are mentioned in
e336be
+include/dt-bindings/clock/xlnx,zynqmp-clk.h.
e336be
+
e336be
 -------
e336be
 Example
e336be
 -------
e336be
@@ -25,5 +72,11 @@ firmware {
e336be
 	zynqmp_firmware: zynqmp-firmware {
e336be
 		compatible = "xlnx,zynqmp-firmware";
e336be
 		method = "smc";
e336be
+		zynqmp_clk : clock-controller {
e336be
+			#clock-cells = <1>;
e336be
+			compatible = "xlnx,zynqmp-clk";
e336be
+			clocks = <&pss_ref_clk>, <&video_clk>, <&pss_alt_ref_clk>, <&aux_ref_clk>, <&gt_crx_ref_clk>;
e336be
+			clock-names = "pss_ref_clk", "video_clk", "pss_alt_ref_clk","aux_ref_clk", "gt_crx_ref_clk";
e336be
+		};
e336be
 	};
e336be
 };
e336be
diff --git a/include/dt-bindings/clock/xlnx,zynqmp-clk.h b/include/dt-bindings/clock/xlnx,zynqmp-clk.h
e336be
new file mode 100644
e336be
index 0000000..4aebe6e
e336be
--- /dev/null
e336be
+++ b/include/dt-bindings/clock/xlnx,zynqmp-clk.h
e336be
@@ -0,0 +1,116 @@
e336be
+/* SPDX-License-Identifier: GPL-2.0 */
e336be
+/*
e336be
+ * Xilinx Zynq MPSoC Firmware layer
e336be
+ *
e336be
+ *  Copyright (C) 2014-2018 Xilinx, Inc.
e336be
+ *
e336be
+ */
e336be
+
e336be
+#ifndef _DT_BINDINGS_CLK_ZYNQMP_H
e336be
+#define _DT_BINDINGS_CLK_ZYNQMP_H
e336be
+
e336be
+#define IOPLL			0
e336be
+#define RPLL			1
e336be
+#define APLL			2
e336be
+#define DPLL			3
e336be
+#define VPLL			4
e336be
+#define IOPLL_TO_FPD		5
e336be
+#define RPLL_TO_FPD		6
e336be
+#define APLL_TO_LPD		7
e336be
+#define DPLL_TO_LPD		8
e336be
+#define VPLL_TO_LPD		9
e336be
+#define ACPU			10
e336be
+#define ACPU_HALF		11
e336be
+#define DBF_FPD			12
e336be
+#define DBF_LPD			13
e336be
+#define DBG_TRACE		14
e336be
+#define DBG_TSTMP		15
e336be
+#define DP_VIDEO_REF		16
e336be
+#define DP_AUDIO_REF		17
e336be
+#define DP_STC_REF		18
e336be
+#define GDMA_REF		19
e336be
+#define DPDMA_REF		20
e336be
+#define DDR_REF			21
e336be
+#define SATA_REF		22
e336be
+#define PCIE_REF		23
e336be
+#define GPU_REF			24
e336be
+#define GPU_PP0_REF		25
e336be
+#define GPU_PP1_REF		26
e336be
+#define TOPSW_MAIN		27
e336be
+#define TOPSW_LSBUS		28
e336be
+#define GTGREF0_REF		29
e336be
+#define LPD_SWITCH		30
e336be
+#define LPD_LSBUS		31
e336be
+#define USB0_BUS_REF		32
e336be
+#define USB1_BUS_REF		33
e336be
+#define USB3_DUAL_REF		34
e336be
+#define USB0			35
e336be
+#define USB1			36
e336be
+#define CPU_R5			37
e336be
+#define CPU_R5_CORE		38
e336be
+#define CSU_SPB			39
e336be
+#define CSU_PLL			40
e336be
+#define PCAP			41
e336be
+#define IOU_SWITCH		42
e336be
+#define GEM_TSU_REF		43
e336be
+#define GEM_TSU			44
e336be
+#define GEM0_REF		45
e336be
+#define GEM1_REF		46
e336be
+#define GEM2_REF		47
e336be
+#define GEM3_REF		48
e336be
+#define GEM0_TX			49
e336be
+#define GEM1_TX			50
e336be
+#define GEM2_TX			51
e336be
+#define GEM3_TX			52
e336be
+#define QSPI_REF		53
e336be
+#define SDIO0_REF		54
e336be
+#define SDIO1_REF		55
e336be
+#define UART0_REF		56
e336be
+#define UART1_REF		57
e336be
+#define SPI0_REF		58
e336be
+#define SPI1_REF		59
e336be
+#define NAND_REF		60
e336be
+#define I2C0_REF		61
e336be
+#define I2C1_REF		62
e336be
+#define CAN0_REF		63
e336be
+#define CAN1_REF		64
e336be
+#define CAN0			65
e336be
+#define CAN1			66
e336be
+#define DLL_REF			67
e336be
+#define ADMA_REF		68
e336be
+#define TIMESTAMP_REF		69
e336be
+#define AMS_REF			70
e336be
+#define PL0_REF			71
e336be
+#define PL1_REF			72
e336be
+#define PL2_REF			73
e336be
+#define PL3_REF			74
e336be
+#define WDT			75
e336be
+#define IOPLL_INT		76
e336be
+#define IOPLL_PRE_SRC		77
e336be
+#define IOPLL_HALF		78
e336be
+#define IOPLL_INT_MUX		79
e336be
+#define IOPLL_POST_SRC		80
e336be
+#define RPLL_INT		81
e336be
+#define RPLL_PRE_SRC		82
e336be
+#define RPLL_HALF		83
e336be
+#define RPLL_INT_MUX		84
e336be
+#define RPLL_POST_SRC		85
e336be
+#define APLL_INT		86
e336be
+#define APLL_PRE_SRC		87
e336be
+#define APLL_HALF		88
e336be
+#define APLL_INT_MUX		89
e336be
+#define APLL_POST_SRC		90
e336be
+#define DPLL_INT		91
e336be
+#define DPLL_PRE_SRC		92
e336be
+#define DPLL_HALF		93
e336be
+#define DPLL_INT_MUX		94
e336be
+#define DPLL_POST_SRC		95
e336be
+#define VPLL_INT		96
e336be
+#define VPLL_PRE_SRC		97
e336be
+#define VPLL_HALF		98
e336be
+#define VPLL_INT_MUX		99
e336be
+#define VPLL_POST_SRC		100
e336be
+#define CAN0_MIO		101
e336be
+#define CAN1_MIO		102
e336be
+
e336be
+#endif
e336be
e336be
From patchwork Fri Aug  3 17:53:27 2018
e336be
Content-Type: text/plain; charset="utf-8"
e336be
MIME-Version: 1.0
e336be
Content-Transfer-Encoding: 7bit
e336be
X-Patchwork-Submitter: Jolly Shah <jolly.shah@xilinx.com>
e336be
X-Patchwork-Id: 10555423
e336be
Return-Path: 
e336be
 <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org>
e336be
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
e336be
 [172.30.200.125])
e336be
	by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4A23F15E9
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:06:45 +0000 (UTC)
e336be
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 305E12C1AF
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:06:45 +0000 (UTC)
e336be
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
e336be
	id 228642C984; Fri,  3 Aug 2018 18:06:45 +0000 (UTC)
e336be
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
e336be
	pdx-wl-mail.web.codeaurora.org
e336be
X-Spam-Level: 
e336be
X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00,
e336be
	DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1
e336be
Received: from bombadil.infradead.org (bombadil.infradead.org
e336be
 [198.137.202.133])
e336be
	(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))
e336be
	(No client certificate requested)
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E9FC62C1AF
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:06:42 +0000 (UTC)
e336be
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
e336be
	d=lists.infradead.org; s=bombadil.20170209; h=Sender:
e336be
	Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:
e336be
	List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:
e336be
	Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:
e336be
	Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
e336be
	List-Owner; bh=EHyZ0tIIXHyzRasyX+ZIIQRDjqWcdJsf1CDD9FGfe7c=; b=r08Jg48tDQK/cs
e336be
	m8LnDxCyC2g21fwAoLXYzcrwhnsW6acNKYsniDq677jXniva68BSd4ZzUp6rvo4MitppS5fgKlr9y
e336be
	z03fT7EIDbcz+kjU1fvaeApev8UC+bErlRh8Ty+KHTqsakLgczTzfTeniVJr8bMpH5HlolJ24u8cF
e336be
	QRq1kiwpUxOyuaNJbK0WgqsGnQFtzrEr6Tp8U7cg9sb4Tljg21s/L28dTm75H+NrXLm7t/VsvZiQ2
e336be
	xSbqkm9EZ4yLcyVdvLnfevBEaJ59YKGEXGIL6q3COz5YYgttTaWELvguDE19Nf5Zm3fCVOq1iuPTe
e336be
	EXzp0xAUB4hOd4pdg7nQ==;
e336be
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
e336be
	by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))
e336be
	id 1fleTJ-0002rB-GN; Fri, 03 Aug 2018 18:06:41 +0000
e336be
Received: from mail-co1nam03on0085.outbound.protection.outlook.com
e336be
 ([104.47.40.85] helo=NAM03-CO1-obe.outbound.protection.outlook.com)
e336be
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
e336be
 id 1fleHA-0002lL-Nj
e336be
 for linux-arm-kernel@lists.infradead.org; Fri, 03 Aug 2018 17:54:25 +0000
e336be
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
e336be
 d=xilinx.onmicrosoft.com; s=selector1-xilinx-com;
e336be
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
e336be
 bh=li3FRubunPLaA+VNvRYfjRDgPvfpqEwxNaGspuvg4xE=;
e336be
 b=1mcvAkuXSEgJko04h2nQRxP+U/C6kQPTYgU6LLJflwA3n/ItGO+zw5eLtN2ZfQun0OT1FdC3tsfj/B3W7mf/T0MEEtJd0Bj4YTSF1xWHcidFqCuIw2nsSLKKT85PbV/gudj69Y40O6fTe/eGQGwz1wgHLtW+j9aq9h+fDbyIodg=
e336be
Received: from BN6PR02CA0028.namprd02.prod.outlook.com (2603:10b6:404:5f::14)
e336be
 by SN6PR02MB4336.namprd02.prod.outlook.com (2603:10b6:805:a4::29)
e336be
 with Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Fri, 3 Aug
e336be
 2018 17:53:55 +0000
e336be
Received: from SN1NAM02FT061.eop-nam02.prod.protection.outlook.com
e336be
 (2a01:111:f400:7e44::200) by BN6PR02CA0028.outlook.office365.com
e336be
 (2603:10b6:404:5f::14) with Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.14 via Frontend
e336be
 Transport; Fri, 3 Aug 2018 17:53:54 +0000
e336be
Authentication-Results: spf=pass (sender IP is 149.199.60.100)
e336be
 smtp.mailfrom=xilinx.com; linaro.org; dkim=none (message not signed)
e336be
 header.d=none;linaro.org; dmarc=bestguesspass action=none
e336be
 header.from=xilinx.com;
e336be
Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates
e336be
 149.199.60.100 as permitted sender) receiver=protection.outlook.com;
e336be
 client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02;
e336be
Received: from xsj-pvapsmtpgw02 (149.199.60.100) by
e336be
 SN1NAM02FT061.mail.protection.outlook.com (10.152.72.196) with Microsoft SMTP
e336be
 Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1038.3
e336be
 via Frontend Transport; Fri, 3 Aug 2018 17:53:53 +0000
e336be
Received: from unknown-38-66.xilinx.com ([149.199.38.66]:51041
e336be
 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGv-0003jz-26; Fri, 03 Aug 2018 10:53:53 -0700
e336be
Received: from [127.0.0.1] (helo=localhost)
e336be
 by xsj-pvapsmtp01 with smtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGp-0007cn-W8; Fri, 03 Aug 2018 10:53:48 -0700
e336be
Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com)
e336be
 by xsj-pvapsmtp01 with esmtp (Exim 4.63)
e336be
 (envelope-from <jollys@xilinx.com>)
e336be
 id 1fleGl-0007bh-QS; Fri, 03 Aug 2018 10:53:43 -0700
e336be
From: Jolly Shah <jolly.shah@xilinx.com>
e336be
To: <ard.biesheuvel@linaro.org>, <mingo@kernel.org>,
e336be
 <gregkh@linuxfoundation.org>, <matt@codeblueprint.co.uk>,
e336be
 <sudeep.holla@arm.com>, <hkallweit1@gmail.com>, <keescook@chromium.org>,
e336be
 <dmitry.torokhov@gmail.com>, <mturquette@baylibre.com>,
e336be
 <sboyd@codeaurora.org>, <michal.simek@xilinx.com>, <robh+dt@kernel.org>,
e336be
 <mark.rutland@arm.com>, <linux-clk@vger.kernel.org>
e336be
Subject: [PATCH v11 10/11] drivers: clk: Add ZynqMP clock driver
e336be
Date: Fri, 3 Aug 2018 10:53:27 -0700
e336be
Message-ID: <1533318808-10781-11-git-send-email-jollys@xilinx.com>
e336be
X-Mailer: git-send-email 2.7.4
e336be
In-Reply-To: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
References: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005
e336be
X-TM-AS-User-Approved-Sender: Yes;Yes
e336be
X-EOPAttributedMessage: 0
e336be
X-MS-Office365-Filtering-HT: Tenant
e336be
X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI;
e336be
 SFV:NSPM;
e336be
 SFS:(10009020)(136003)(39860400002)(346002)(396003)(376002)(2980300002)(438002)(189003)(199004)(36756003)(110136005)(54906003)(5660300001)(316002)(4326008)(39060400002)(107886003)(14444005)(2201001)(2906002)(575784001)(478600001)(106002)(16586007)(63266004)(72206003)(305945005)(53946003)(77096007)(26005)(106466001)(47776003)(44832011)(186003)(51416003)(7696005)(76176011)(36386004)(9786002)(8676002)(48376002)(50466002)(50226002)(126002)(7416002)(81156014)(426003)(6666003)(476003)(81166006)(11346002)(8936002)(486006)(2616005)(446003)(356003)(336012)(107986001)(921003)(5001870100001)(1121003)(579004)(309714004);
e336be
 DIR:OUT; SFP:1101; SCL:1; SRVR:SN6PR02MB4336; H:xsj-pvapsmtpgw02; FPR:;
e336be
 SPF:Pass; LANG:en; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; MX:1;
e336be
 A:1;
e336be
X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT061;
e336be
 1:yFcUYWC4p7wLde1jYMZ2SqnERip37sYNeYVJP/Q/Ug4Dm2wOjhunw1VaHbXiNrwoPUQ5XIX6ExQcrLvBV9Xw46r0W/RkUEgRwLxzPnx88j0XXPRKTAZvTrnTLQujdpkR
e336be
MIME-Version: 1.0
e336be
X-MS-PublicTrafficType: Email
e336be
X-MS-Office365-Filtering-Correlation-Id: 3c0e7bcd-20e4-40b9-0265-08d5f96a1453
e336be
X-Microsoft-Antispam: BCL:0; PCL:0;
e336be
 RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);
e336be
 SRVR:SN6PR02MB4336;
e336be
X-Microsoft-Exchange-Diagnostics: 1; SN6PR02MB4336;
e336be
 3:8AAIVN4t4fuHGDyF/MhxgwHv9/actgz0qwVP37PuwNC9jdm4ynwn4qpfrJvysaRqT2R5mZOMaRziJ1XEi3A2KEiU7nhHivAkTB102CppKaJPmmyFGCQVHhWrWGaOAV91SUY/J+IkRNUrMcByK8zE0DhGuZKgW/XsUBtJmCGoAxqz5l3Yifr2t/kL3Y0zRhLg69LOynwIUTmukLqmwu3MIGUenw8y1DJM4pFymUT4tMUrKDpdRQxnV1l5X1uYgjItGw4gKTEbaz6wnjFUXqXofkjOQaCKz9YWeebjEDZ1hnIraEbgmrfOWY1DyKe2HS3RM1ZKG/cL5Yt/3d1nCFhi0cDtDEgwB9uvTFuqQh4O5DI=;
e336be
 25:eM7r5WKxUp4o1GqmX1iZvTg5D9hskkdbRnAQyIIbsKc0/6z4KubVHzX5xUVzz8f4mTl+xDGZz1O+duxldKSQsd7iQ1Dn3lnbKfXQ+KRymkIUPKM2Ixw3hcL1Cxu3dc0nJcSZkRAq/WJu7Jl74452HiMWCCMg/1ygFukG9JW/3n/od95DyK6wiYenVc34QjU2O3rFinv1rSLh06VxXvHunklZetm+pb46cfRZR9Jef8mjQ/Xa7vXTtorZToaMzZSQEKgfUoWzDD81eKWCTJ6Ii/fkT8S83nukc2SjOkR+C2kCTDaDorTrfICCWkJr4xjZe307WpzgZCvzO88Xluoi4Q==
e336be
X-MS-TrafficTypeDiagnostic: SN6PR02MB4336:
e336be
X-Microsoft-Exchange-Diagnostics: 1; SN6PR02MB4336;
e336be
 31:Ln7lxM3DMMBgjjMXTam15deXiasgXhOmP3l5t21pYSrEkrvip4aS8/S6pTZyuU7roQEc5cIE2zbwyZ5/+jLdPBdK9lcu3V3+9okGVnR5Dc8JvneJhX9e3v8JI33AVsxYql+c0ZGH3DYzO9surJtvoVLPsy35rVaIC6DNnLjB5dIY2hcasE+DmPRBheu7U6zacwPjomlNbrYzNWmkZeknB4TrOqphZaO9pe8NUpafxfU=;
e336be
 20:PG8a9WtraWs8Mv0yasKj+TSAUQkE7/g6CsBj4v62cxPwHHHd+DKydj30iijzoHnr0MhJysAe/opzwwQkHkQZJ1N9pMR/dBlbgWaY7p5/jja+hYngJIpdUMzD221eaE4OshC6k+4OMDYM0nauaw/DFJHyN57kdfeEzR+06wvH6XqgdDzInw1tb1rtXzjctKp0iI6PWxfWeB81JqAZFIb2PBEYAnEjvIF9Bi9JEqwnWaj6CFD80NYqCK0Y9QMcSaWffuYFpwddEHZXSPz989Se6x70nnz/gwTsBwkCqaM+rNd9THg86+6mzqcI81rT2nMQcK3NU7KAmeGZlxLNuLQR3aKcjhxQvqobaWFsaeSxaU2w1WWtYv5haiXdGTy4/p4IE3kuAgPbnMEgKhZ5eW9k4DTjHfKeodXZCy7mzQkaUGfIq5rZQ6JrhttKgwTCyQz7ZmiqOf67Vj3sAMls8MIGhNOyWTv8NR0bDj4pY8sC2ngN/ySEVqqsE5xWW84eO4Tl
e336be
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
e336be
X-Microsoft-Antispam-PRVS: 
e336be
 <SN6PR02MB433629B3837948901AD9BF78B8230@SN6PR02MB4336.namprd02.prod.outlook.com>
e336be
X-Exchange-Antispam-Report-Test: UriScan:(192813158149592);
e336be
X-MS-Exchange-SenderADCheck: 1
e336be
X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0;
e336be
 RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3231311)(944501410)(52105095)(93006095)(93004095)(3002001)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(6072148)(201708071742011)(7699016);
e336be
 SRVR:SN6PR02MB4336; BCL:0; PCL:0; RULEID:; SRVR:SN6PR02MB4336;
e336be
X-Microsoft-Exchange-Diagnostics: 1; SN6PR02MB4336;
e336be
 4:2aLwQJpDB+cTmAg78r0cP+SUQUlcOdcfOL2zgLM8vYmbh1wW0UolroF0RfRxR6KLbjh9iUF5sxeXA7epHywtqvvBbA/HBLUFs5CqTJK+3OJeUiWgpPrSL3a/VSosdmH05i+a4QdDrLMezYAibcU3EfWXs/M8Bky70CpP8AUWNotU2b/1AAUM9mkW8E/hIeMs9Mx+itiaMjBmNq8OA0gUZAn4l0GmyCeqq99fUVVJJavnX7X/5XhSHkuRikNZCZrAQQ7wKPjxIQUix91VuknqwTSSyR+PHIX7d78Yxf3EV0G1HpGV2d7mC5L0iielL72/
e336be
X-Forefront-PRVS: 0753EA505A
e336be
X-Microsoft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E/GoUss5rzR6+qwigkQOKywRvhNWrccx2Kdg87hr7tLeKbpfsfpKUqU23Eep00cGl0L53LmjyHbSIaw0eyUXiUEjeqMfZ57osAOimT3kmFueHA5PdaYD/vgkPg6y5TsaC+IuT4ND3oNHqz/X6tods1THckpt9l6qzl7BqtaHmiVN3LWkro+h4zqD6Ecs/y4N1zFBRihNm48sKqMHXoHB21HOZW/vZr+8zFB6jxvfeCCWZNgxqKpZQXKEfW747hoTSRgvDFn4BcCjvij8MjlRKDrXCVnr+9tSbsdf9l/5cj/0tLT6lgusRyUDvytRundHHoIVlhvoW19d8uyxd6B/LpgZJDBZs0ymUf7+g6tE097ws9h8=
e336be
X-Microsoft-Antispam-Message-Info: 
e336be
 kWVuUlkcwWjORVcqf8aWpgEa/C//K/qDToVy9eKyVLXbEG+gYviLN3jdk+RFKZZHdt9ccVCfs5J2MHxs3/Xrh16jToIImXbhTBPXH2JtorqVLEqlUxLYjseDhGHlLTYAb1Mhoc2udBoEK+pI9XIZ86ccPJipc9483Bdc3pnqrS8830Go+tCtvI5OHTb8RiC0U4bUbOqrBfNFMoPvlGnjpzQtIgszEj9UZbyUvhGHm8XJBgQJs9amFycWzsW5Tt+4aozsU93xEkrPbEGwwasJM/j38HYee8Lls8qMONqTBOMGzt/owpKCLw6gXTUv5J2duKD41uq4xu3VczKPsbTgts3koyt37RGsRrpelfWUAJs=
e336be
X-Microsoft-Exchange-Diagnostics: 1; SN6PR02MB4336;
e336be
 6:MZGV8MdBkOnxtfjk/VLatYtPDNX6+wiTHiJH5Dna25q+u/9q/A1x+cJsfNoDG+edJYqA7vNWoCC967QcojR7FFfRyzZt8mvAXtc92zKwsXDSpHOO9dvc2LdqzmK/Y6ywplrQpsHypqc651yu6hCxavV2hFWRSgREfLXGySyAoPxuVllkO4jHpiIlqRcffGIkyIJo1s6Nw8yhcHMK0l4nil2EENgPG1lkEH1tUWNMQMys1GeJ6ZbpXMNrCzQXTq3p1qow3hEARkqrM1FmDB2mBwyddmh+GyMZu0ytDGBmOUwwahzKZyCfQeIbqMbdTTM+YI6yyE9kIo2H5c4tNxltQAlFUo+ESZ9VNMVAzyyMyE6LXXZotXZPKy+asiOWx5dBiWcNYBsVFfhPgZb3Jf3hzSFfwE6fXkvKjLMjPhkagni+xlPrV9EPEy5QEpafgQaLQZKS8FFTjsQwubXM4M7Sag==;
e336be
 5:+N5o80jlNqqgy573HI70LVhrad0QmNGc4XsN6y7seQeZfUn4TlM/W+rSxJFoHeyerLbwO0Gmv8MWypESJiUTQ6065ZowUVo3sWvdEBUK/S/9V+sMb1ph4QoEXUrJJO+YVMsJEaobJ4U4joXG+eTYHemQU90BxnZtz6JtujGreew=;
e336be
 7:WMqeQpdpFiVmjgkZ9H6j6MpOx/YXWbyEPNF3Izy3TX8uGtC40G2m4qTeCfjN/ohmaXCcupo9++ELP6zNGGFe7PZtqcuQd6POt+BtmivRVdIIVRoyFGWPc1UhpIbaQeIk7oTpTlPud4qNCEzOojytR2a+E29DiupXWpXkqYhwNe6g+OKgDkxHSwl15olDQ5VRogGeyUtzHtgB8LGpoX2ZQu5WRy9+NWUehMlbSNuB4UAqNmuQnIASVI/YBchUVSR6
e336be
SpamDiagnosticOutput: 1:99
e336be
SpamDiagnosticMetadata: NSPM
e336be
X-OriginatorOrg: xilinx.com
e336be
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2018 17:53:53.5001 (UTC)
e336be
X-MS-Exchange-CrossTenant-Network-Message-Id: 
e336be
 3c0e7bcd-20e4-40b9-0265-08d5f96a1453
e336be
X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c
e336be
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: 
e336be
 TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100];
e336be
 Helo=[xsj-pvapsmtpgw02]
e336be
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
e336be
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB4336
e336be
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
e336be
X-CRM114-CacheID: sfid-20180803_105409_086029_029096A0 
e336be
X-CRM114-Status: GOOD (  13.30  )
e336be
X-BeenThere: linux-arm-kernel@lists.infradead.org
e336be
X-Mailman-Version: 2.1.21
e336be
Precedence: list
e336be
List-Id: <linux-arm-kernel.lists.infradead.org>
e336be
List-Unsubscribe: 
e336be
 <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
e336be
List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
e336be
List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
e336be
List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
e336be
List-Subscribe: 
e336be
 <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
e336be
Cc: devicetree@vger.kernel.org, Tejas Patel <tejasp@xilinx.com>,
e336be
 Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>,
e336be
 linux-kernel@vger.kernel.org, Jolly Shah <jollys@xilinx.com>,
e336be
 rajanv@xilinx.com, Jolly Shah <jolly.shah@xilinx.com>,
e336be
 linux-arm-kernel@lists.infradead.org
e336be
Content-Type: text/plain; charset="us-ascii"
e336be
Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
e336be
Errors-To: 
e336be
 linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
e336be
X-Virus-Scanned: ClamAV using ClamSMTP
e336be
e336be
From: Jolly Shah <jolly.shah@xilinx.com>
e336be
e336be
This patch adds CCF compliant clock driver for ZynqMP.
e336be
Clock driver queries supported clock information from
e336be
firmware and regiters pll and output clocks with CCF.
e336be
e336be
Signed-off-by: Rajan Vaja <rajanv@xilinx.com>
e336be
Signed-off-by: Tejas Patel <tejasp@xilinx.com>
e336be
Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
e336be
Signed-off-by: Jolly Shah <jollys@xilinx.com>
e336be
---
e336be
 drivers/clk/Kconfig                  |   1 +
e336be
 drivers/clk/Makefile                 |   1 +
e336be
 drivers/clk/zynqmp/Kconfig           |  10 +
e336be
 drivers/clk/zynqmp/Makefile          |   4 +
e336be
 drivers/clk/zynqmp/clk-gate-zynqmp.c | 144 +++++++
e336be
 drivers/clk/zynqmp/clk-mux-zynqmp.c  | 141 +++++++
e336be
 drivers/clk/zynqmp/clk-zynqmp.h      |  68 ++++
e336be
 drivers/clk/zynqmp/clkc.c            | 716 +++++++++++++++++++++++++++++++++++
e336be
 drivers/clk/zynqmp/divider.c         | 217 +++++++++++
e336be
 drivers/clk/zynqmp/pll.c             | 335 ++++++++++++++++
e336be
 include/linux/firmware/xlnx-zynqmp.h |   1 +
e336be
 11 files changed, 1638 insertions(+)
e336be
 create mode 100644 drivers/clk/zynqmp/Kconfig
e336be
 create mode 100644 drivers/clk/zynqmp/Makefile
e336be
 create mode 100644 drivers/clk/zynqmp/clk-gate-zynqmp.c
e336be
 create mode 100644 drivers/clk/zynqmp/clk-mux-zynqmp.c
e336be
 create mode 100644 drivers/clk/zynqmp/clk-zynqmp.h
e336be
 create mode 100644 drivers/clk/zynqmp/clkc.c
e336be
 create mode 100644 drivers/clk/zynqmp/divider.c
e336be
 create mode 100644 drivers/clk/zynqmp/pll.c
e336be
e336be
diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
e336be
index 98ce9fc..ab2ea76 100644
e336be
--- a/drivers/clk/Kconfig
e336be
+++ b/drivers/clk/Kconfig
e336be
@@ -253,5 +253,6 @@ source "drivers/clk/sunxi-ng/Kconfig"
e336be
 source "drivers/clk/tegra/Kconfig"
e336be
 source "drivers/clk/ti/Kconfig"
e336be
 source "drivers/clk/uniphier/Kconfig"
e336be
+source "drivers/clk/zynqmp/Kconfig"
e336be
 
e336be
 endmenu
e336be
diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile
e336be
index 71ec41e..b6ac0d2 100644
e336be
--- a/drivers/clk/Makefile
e336be
+++ b/drivers/clk/Makefile
e336be
@@ -100,3 +100,4 @@ obj-$(CONFIG_X86)			+= x86/
e336be
 endif
e336be
 obj-$(CONFIG_ARCH_ZX)			+= zte/
e336be
 obj-$(CONFIG_ARCH_ZYNQ)			+= zynq/
e336be
+obj-$(CONFIG_COMMON_CLK_ZYNQMP)         += zynqmp/
e336be
diff --git a/drivers/clk/zynqmp/Kconfig b/drivers/clk/zynqmp/Kconfig
e336be
new file mode 100644
e336be
index 0000000..1708605
e336be
--- /dev/null
e336be
+++ b/drivers/clk/zynqmp/Kconfig
e336be
@@ -0,0 +1,10 @@
e336be
+# SPDX-License-Identifier: GPL-2.0
e336be
+
e336be
+config COMMON_CLK_ZYNQMP
e336be
+	bool "Support for Xilinx ZynqMP Ultrascale+ clock controllers"
e336be
+	depends on ARCH_ZYNQMP || COMPILE_TEST
e336be
+	depends on ZYNQMP_FIRMWARE
e336be
+	help
e336be
+	  Support for the Zynqmp Ultrascale clock controller.
e336be
+	  It has a dependency on the PMU firmware.
e336be
+	  Say Y if you want to include clock support.
e336be
diff --git a/drivers/clk/zynqmp/Makefile b/drivers/clk/zynqmp/Makefile
e336be
new file mode 100644
e336be
index 0000000..0ec24bf
e336be
--- /dev/null
e336be
+++ b/drivers/clk/zynqmp/Makefile
e336be
@@ -0,0 +1,4 @@
e336be
+# SPDX-License-Identifier: GPL-2.0
e336be
+# Zynq Ultrascale+ MPSoC clock specific Makefile
e336be
+
e336be
+obj-$(CONFIG_ARCH_ZYNQMP)	+= pll.o clk-gate-zynqmp.o divider.o clk-mux-zynqmp.o clkc.o
e336be
diff --git a/drivers/clk/zynqmp/clk-gate-zynqmp.c b/drivers/clk/zynqmp/clk-gate-zynqmp.c
e336be
new file mode 100644
e336be
index 0000000..83b236f
e336be
--- /dev/null
e336be
+++ b/drivers/clk/zynqmp/clk-gate-zynqmp.c
e336be
@@ -0,0 +1,144 @@
e336be
+// SPDX-License-Identifier: GPL-2.0
e336be
+/*
e336be
+ * Zynq UltraScale+ MPSoC clock controller
e336be
+ *
e336be
+ *  Copyright (C) 2016-2018 Xilinx
e336be
+ *
e336be
+ * Gated clock implementation
e336be
+ */
e336be
+
e336be
+#include <linux/clk-provider.h>
e336be
+#include <linux/slab.h>
e336be
+#include "clk-zynqmp.h"
e336be
+
e336be
+/**
e336be
+ * struct clk_gate - gating clock
e336be
+ * @hw:		handle between common and hardware-specific interfaces
e336be
+ * @flags:	hardware-specific flags
e336be
+ * @clk_id:	Id of clock
e336be
+ */
e336be
+struct zynqmp_clk_gate {
e336be
+	struct clk_hw hw;
e336be
+	u8 flags;
e336be
+	u32 clk_id;
e336be
+};
e336be
+
e336be
+#define to_zynqmp_clk_gate(_hw) container_of(_hw, struct zynqmp_clk_gate, hw)
e336be
+
e336be
+/**
e336be
+ * zynqmp_clk_gate_enable() - Enable clock
e336be
+ * @hw:		handle between common and hardware-specific interfaces
e336be
+ *
e336be
+ * Return: 0 on success else error code
e336be
+ */
e336be
+static int zynqmp_clk_gate_enable(struct clk_hw *hw)
e336be
+{
e336be
+	struct zynqmp_clk_gate *gate = to_zynqmp_clk_gate(hw);
e336be
+	const char *clk_name = clk_hw_get_name(hw);
e336be
+	u32 clk_id = gate->clk_id;
e336be
+	int ret;
e336be
+	const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
e336be
+
e336be
+	ret = eemi_ops->clock_enable(clk_id);
e336be
+
e336be
+	if (ret)
e336be
+		pr_warn_once("%s() clock enabled failed for %s, ret = %d\n",
e336be
+			     __func__, clk_name, ret);
e336be
+
e336be
+	return ret;
e336be
+}
e336be
+
e336be
+/*
e336be
+ * zynqmp_clk_gate_disable() - Disable clock
e336be
+ * @hw:		handle between common and hardware-specific interfaces
e336be
+ */
e336be
+static void zynqmp_clk_gate_disable(struct clk_hw *hw)
e336be
+{
e336be
+	struct zynqmp_clk_gate *gate = to_zynqmp_clk_gate(hw);
e336be
+	const char *clk_name = clk_hw_get_name(hw);
e336be
+	u32 clk_id = gate->clk_id;
e336be
+	int ret;
e336be
+	const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
e336be
+
e336be
+	ret = eemi_ops->clock_disable(clk_id);
e336be
+
e336be
+	if (ret)
e336be
+		pr_warn_once("%s() clock disable failed for %s, ret = %d\n",
e336be
+			     __func__, clk_name, ret);
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_clk_gate_is_enable() - Check clock state
e336be
+ * @hw:		handle between common and hardware-specific interfaces
e336be
+ *
e336be
+ * Return: 1 if enabled, 0 if disabled else error code
e336be
+ */
e336be
+static int zynqmp_clk_gate_is_enabled(struct clk_hw *hw)
e336be
+{
e336be
+	struct zynqmp_clk_gate *gate = to_zynqmp_clk_gate(hw);
e336be
+	const char *clk_name = clk_hw_get_name(hw);
e336be
+	u32 clk_id = gate->clk_id;
e336be
+	int state, ret;
e336be
+	const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
e336be
+
e336be
+	ret = eemi_ops->clock_getstate(clk_id, &state);
e336be
+	if (ret) {
e336be
+		pr_warn_once("%s() clock get state failed for %s, ret = %d\n",
e336be
+			     __func__, clk_name, ret);
e336be
+		return -EIO;
e336be
+	}
e336be
+
e336be
+	return state ? 1 : 0;
e336be
+}
e336be
+
e336be
+static const struct clk_ops zynqmp_clk_gate_ops = {
e336be
+	.enable = zynqmp_clk_gate_enable,
e336be
+	.disable = zynqmp_clk_gate_disable,
e336be
+	.is_enabled = zynqmp_clk_gate_is_enabled,
e336be
+};
e336be
+
e336be
+/**
e336be
+ * zynqmp_clk_register_gate() - Register a gate clock with the clock framework
e336be
+ * @name:		Name of this clock
e336be
+ * @clk_id:		Id of this clock
e336be
+ * @parents:		Name of this clock's parents
e336be
+ * @num_parents:	Number of parents
e336be
+ * @nodes:		Clock topology node
e336be
+ *
e336be
+ * Return: clock hardware of the registered clock gate
e336be
+ */
e336be
+struct clk_hw *zynqmp_clk_register_gate(const char *name, u32 clk_id,
e336be
+					const char * const *parents,
e336be
+					u8 num_parents,
e336be
+					const struct clock_topology *nodes)
e336be
+{
e336be
+	struct zynqmp_clk_gate *gate;
e336be
+	struct clk_hw *hw;
e336be
+	int ret;
e336be
+	struct clk_init_data init;
e336be
+
e336be
+	/* allocate the gate */
e336be
+	gate = kzalloc(sizeof(*gate), GFP_KERNEL);
e336be
+	if (!gate)
e336be
+		return ERR_PTR(-ENOMEM);
e336be
+
e336be
+	init.name = name;
e336be
+	init.ops = &zynqmp_clk_gate_ops;
e336be
+	init.flags = nodes->flag;
e336be
+	init.parent_names = parents;
e336be
+	init.num_parents = 1;
e336be
+
e336be
+	/* struct clk_gate assignments */
e336be
+	gate->flags = nodes->type_flag;
e336be
+	gate->hw.init = &ini;;
e336be
+	gate->clk_id = clk_id;
e336be
+
e336be
+	hw = &gate->hw;
e336be
+	ret = clk_hw_register(NULL, hw);
e336be
+	if (ret) {
e336be
+		kfree(gate);
e336be
+		hw = ERR_PTR(ret);
e336be
+	}
e336be
+
e336be
+	return hw;
e336be
+}
e336be
diff --git a/drivers/clk/zynqmp/clk-mux-zynqmp.c b/drivers/clk/zynqmp/clk-mux-zynqmp.c
e336be
new file mode 100644
e336be
index 0000000..4143f56
e336be
--- /dev/null
e336be
+++ b/drivers/clk/zynqmp/clk-mux-zynqmp.c
e336be
@@ -0,0 +1,141 @@
e336be
+// SPDX-License-Identifier: GPL-2.0
e336be
+/*
e336be
+ * Zynq UltraScale+ MPSoC mux
e336be
+ *
e336be
+ *  Copyright (C) 2016-2018 Xilinx
e336be
+ */
e336be
+
e336be
+#include <linux/clk-provider.h>
e336be
+#include <linux/slab.h>
e336be
+#include "clk-zynqmp.h"
e336be
+
e336be
+/*
e336be
+ * DOC: basic adjustable multiplexer clock that cannot gate
e336be
+ *
e336be
+ * Traits of this clock:
e336be
+ * prepare - clk_prepare only ensures that parents are prepared
e336be
+ * enable - clk_enable only ensures that parents are enabled
e336be
+ * rate - rate is only affected by parent switching.  No clk_set_rate support
e336be
+ * parent - parent is adjustable through clk_set_parent
e336be
+ */
e336be
+
e336be
+/**
e336be
+ * struct zynqmp_clk_mux - multiplexer clock
e336be
+ *
e336be
+ * @hw:		handle between common and hardware-specific interfaces
e336be
+ * @flags:	hardware-specific flags
e336be
+ * @clk_id:	Id of clock
e336be
+ */
e336be
+struct zynqmp_clk_mux {
e336be
+	struct clk_hw hw;
e336be
+	u8 flags;
e336be
+	u32 clk_id;
e336be
+};
e336be
+
e336be
+#define to_zynqmp_clk_mux(_hw) container_of(_hw, struct zynqmp_clk_mux, hw)
e336be
+
e336be
+/**
e336be
+ * zynqmp_clk_mux_get_parent() - Get parent of clock
e336be
+ * @hw:		handle between common and hardware-specific interfaces
e336be
+ *
e336be
+ * Return: Parent index
e336be
+ */
e336be
+static u8 zynqmp_clk_mux_get_parent(struct clk_hw *hw)
e336be
+{
e336be
+	struct zynqmp_clk_mux *mux = to_zynqmp_clk_mux(hw);
e336be
+	const char *clk_name = clk_hw_get_name(hw);
e336be
+	u32 clk_id = mux->clk_id;
e336be
+	u32 val;
e336be
+	int ret;
e336be
+	const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
e336be
+
e336be
+	ret = eemi_ops->clock_getparent(clk_id, &val;;
e336be
+
e336be
+	if (ret)
e336be
+		pr_warn_once("%s() getparent failed for clock: %s, ret = %d\n",
e336be
+			     __func__, clk_name, ret);
e336be
+
e336be
+	return val;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_clk_mux_set_parent() - Set parent of clock
e336be
+ * @hw:		handle between common and hardware-specific interfaces
e336be
+ * @index:	Parent index
e336be
+ *
e336be
+ * Return: 0 on success else error+reason
e336be
+ */
e336be
+static int zynqmp_clk_mux_set_parent(struct clk_hw *hw, u8 index)
e336be
+{
e336be
+	struct zynqmp_clk_mux *mux = to_zynqmp_clk_mux(hw);
e336be
+	const char *clk_name = clk_hw_get_name(hw);
e336be
+	u32 clk_id = mux->clk_id;
e336be
+	int ret;
e336be
+	const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
e336be
+
e336be
+	ret = eemi_ops->clock_setparent(clk_id, index);
e336be
+
e336be
+	if (ret)
e336be
+		pr_warn_once("%s() set parent failed for clock: %s, ret = %d\n",
e336be
+			     __func__, clk_name, ret);
e336be
+
e336be
+	return ret;
e336be
+}
e336be
+
e336be
+static const struct clk_ops zynqmp_clk_mux_ops = {
e336be
+	.get_parent = zynqmp_clk_mux_get_parent,
e336be
+	.set_parent = zynqmp_clk_mux_set_parent,
e336be
+	.determine_rate = __clk_mux_determine_rate,
e336be
+};
e336be
+
e336be
+static const struct clk_ops zynqmp_clk_mux_ro_ops = {
e336be
+	.get_parent = zynqmp_clk_mux_get_parent,
e336be
+};
e336be
+
e336be
+/**
e336be
+ * zynqmp_clk_register_mux() - Register a mux table with the clock
e336be
+ *			       framework
e336be
+ * @name:		Name of this clock
e336be
+ * @clk_id:		Id of this clock
e336be
+ * @parents:		Name of this clock's parents
e336be
+ * @num_parents:	Number of parents
e336be
+ * @nodes:		Clock topology node
e336be
+ *
e336be
+ * Return: clock hardware of the registered clock mux
e336be
+ */
e336be
+struct clk_hw *zynqmp_clk_register_mux(const char *name, u32 clk_id,
e336be
+				       const char * const *parents,
e336be
+				       u8 num_parents,
e336be
+				       const struct clock_topology *nodes)
e336be
+{
e336be
+	struct zynqmp_clk_mux *mux;
e336be
+	struct clk_hw *hw;
e336be
+	struct clk_init_data init;
e336be
+	int ret;
e336be
+
e336be
+	mux = kzalloc(sizeof(*mux), GFP_KERNEL);
e336be
+	if (!mux)
e336be
+		return ERR_PTR(-ENOMEM);
e336be
+
e336be
+	init.name = name;
e336be
+	if (nodes->type_flag & CLK_MUX_READ_ONLY)
e336be
+		init.ops = &zynqmp_clk_mux_ro_ops;
e336be
+	else
e336be
+		init.ops = &zynqmp_clk_mux_ops;
e336be
+	init.flags = nodes->flag;
e336be
+	init.parent_names = parents;
e336be
+	init.num_parents = num_parents;
e336be
+	mux->flags = nodes->type_flag;
e336be
+	mux->hw.init = &ini;;
e336be
+	mux->clk_id = clk_id;
e336be
+
e336be
+	hw = &mux->hw;
e336be
+	ret = clk_hw_register(NULL, hw);
e336be
+	if (ret) {
e336be
+		kfree(hw);
e336be
+		hw = ERR_PTR(ret);
e336be
+	}
e336be
+
e336be
+	return hw;
e336be
+}
e336be
+EXPORT_SYMBOL_GPL(zynqmp_clk_register_mux);
e336be
diff --git a/drivers/clk/zynqmp/clk-zynqmp.h b/drivers/clk/zynqmp/clk-zynqmp.h
e336be
new file mode 100644
e336be
index 0000000..7ab163b
e336be
--- /dev/null
e336be
+++ b/drivers/clk/zynqmp/clk-zynqmp.h
e336be
@@ -0,0 +1,68 @@
e336be
+/* SPDX-License-Identifier: GPL-2.0 */
e336be
+/*
e336be
+ *  Copyright (C) 2016-2018 Xilinx
e336be
+ */
e336be
+
e336be
+#ifndef __LINUX_CLK_ZYNQMP_H_
e336be
+#define __LINUX_CLK_ZYNQMP_H_
e336be
+
e336be
+#include <linux/spinlock.h>
e336be
+
e336be
+#include <linux/firmware/xlnx-zynqmp.h>
e336be
+
e336be
+/* Clock APIs payload parameters */
e336be
+#define CLK_GET_NAME_RESP_LEN				16
e336be
+#define CLK_GET_TOPOLOGY_RESP_WORDS			3
e336be
+#define CLK_GET_PARENTS_RESP_WORDS			3
e336be
+#define CLK_GET_ATTR_RESP_WORDS				1
e336be
+
e336be
+enum topology_type {
e336be
+	TYPE_INVALID,
e336be
+	TYPE_MUX,
e336be
+	TYPE_PLL,
e336be
+	TYPE_FIXEDFACTOR,
e336be
+	TYPE_DIV1,
e336be
+	TYPE_DIV2,
e336be
+	TYPE_GATE,
e336be
+};
e336be
+
e336be
+/**
e336be
+ * struct clock_topology - Clock topology
e336be
+ * @type:	Type of topology
e336be
+ * @flag:	Topology flags
e336be
+ * @type_flag:	Topology type specific flag
e336be
+ */
e336be
+struct clock_topology {
e336be
+	u32 type;
e336be
+	u32 flag;
e336be
+	u32 type_flag;
e336be
+};
e336be
+
e336be
+struct clk_hw *zynqmp_clk_register_pll(const char *name, u32 clk_id,
e336be
+				       const char * const *parents,
e336be
+				       u8 num_parents,
e336be
+				       const struct clock_topology *nodes);
e336be
+
e336be
+struct clk_hw *zynqmp_clk_register_gate(const char *name, u32 clk_id,
e336be
+					const char * const *parents,
e336be
+					u8 num_parents,
e336be
+					const struct clock_topology *nodes);
e336be
+
e336be
+struct clk_hw *zynqmp_clk_register_divider(const char *name,
e336be
+					   u32 clk_id,
e336be
+					   const char * const *parents,
e336be
+					   u8 num_parents,
e336be
+					   const struct clock_topology *nodes);
e336be
+
e336be
+struct clk_hw *zynqmp_clk_register_mux(const char *name, u32 clk_id,
e336be
+				       const char * const *parents,
e336be
+				       u8 num_parents,
e336be
+				       const struct clock_topology *nodes);
e336be
+
e336be
+struct clk_hw *zynqmp_clk_register_fixed_factor(const char *name,
e336be
+					u32 clk_id,
e336be
+					const char * const *parents,
e336be
+					u8 num_parents,
e336be
+					const struct clock_topology *nodes);
e336be
+
e336be
+#endif
e336be
diff --git a/drivers/clk/zynqmp/clkc.c b/drivers/clk/zynqmp/clkc.c
e336be
new file mode 100644
e336be
index 0000000..1b07d77
e336be
--- /dev/null
e336be
+++ b/drivers/clk/zynqmp/clkc.c
e336be
@@ -0,0 +1,716 @@
e336be
+// SPDX-License-Identifier: GPL-2.0
e336be
+/*
e336be
+ * Zynq UltraScale+ MPSoC clock controller
e336be
+ *
e336be
+ *  Copyright (C) 2016-2018 Xilinx
e336be
+ *
e336be
+ * Based on drivers/clk/zynq/clkc.c
e336be
+ */
e336be
+
e336be
+#include <linux/bitfield.h>
e336be
+#include <linux/clk.h>
e336be
+#include <linux/clk-provider.h>
e336be
+#include <linux/module.h>
e336be
+#include <linux/of_platform.h>
e336be
+#include <linux/slab.h>
e336be
+#include <linux/string.h>
e336be
+
e336be
+#include "clk-zynqmp.h"
e336be
+
e336be
+#define MAX_PARENT			100
e336be
+#define MAX_NODES			6
e336be
+#define MAX_NAME_LEN			50
e336be
+
e336be
+#define CLK_TYPE_SHIFT			2
e336be
+
e336be
+#define PM_API_PAYLOAD_LEN		3
e336be
+
e336be
+#define NA_PARENT			0xFFFFFFFF
e336be
+#define DUMMY_PARENT			0xFFFFFFFE
e336be
+
e336be
+#define CLK_TYPE_FIELD_LEN		4
e336be
+#define CLK_TOPOLOGY_NODE_OFFSET	16
e336be
+#define NODES_PER_RESP			3
e336be
+
e336be
+#define CLK_TYPE_FIELD_MASK		0xF
e336be
+#define CLK_FLAG_FIELD_MASK		GENMASK(21, 8)
e336be
+#define CLK_TYPE_FLAG_FIELD_MASK	GENMASK(31, 24)
e336be
+
e336be
+#define CLK_PARENTS_ID_LEN		16
e336be
+#define CLK_PARENTS_ID_MASK		0xFFFF
e336be
+
e336be
+/* Flags for parents */
e336be
+#define PARENT_CLK_SELF			0
e336be
+#define PARENT_CLK_NODE1		1
e336be
+#define PARENT_CLK_NODE2		2
e336be
+#define PARENT_CLK_NODE3		3
e336be
+#define PARENT_CLK_NODE4		4
e336be
+#define PARENT_CLK_EXTERNAL		5
e336be
+
e336be
+#define END_OF_CLK_NAME			"END_OF_CLK"
e336be
+#define END_OF_TOPOLOGY_NODE		1
e336be
+#define END_OF_PARENTS			1
e336be
+#define RESERVED_CLK_NAME		""
e336be
+
e336be
+#define CLK_VALID_MASK			0x1
e336be
+
e336be
+enum clk_type {
e336be
+	CLK_TYPE_OUTPUT,
e336be
+	CLK_TYPE_EXTERNAL,
e336be
+};
e336be
+
e336be
+/**
e336be
+ * struct clock_parent - Clock parent
e336be
+ * @name:	Parent name
e336be
+ * @id:		Parent clock ID
e336be
+ * @flag:	Parent flags
e336be
+ */
e336be
+struct clock_parent {
e336be
+	char name[MAX_NAME_LEN];
e336be
+	int id;
e336be
+	u32 flag;
e336be
+};
e336be
+
e336be
+/**
e336be
+ * struct zynqmp_clock - Clock
e336be
+ * @clk_name:		Clock name
e336be
+ * @valid:		Validity flag of clock
e336be
+ * @type:		Clock type (Output/External)
e336be
+ * @node:		Clock topology nodes
e336be
+ * @num_nodes:		Number of nodes present in topology
e336be
+ * @parent:		Parent of clock
e336be
+ * @num_parents:	Number of parents of clock
e336be
+ */
e336be
+struct zynqmp_clock {
e336be
+	char clk_name[MAX_NAME_LEN];
e336be
+	u32 valid;
e336be
+	enum clk_type type;
e336be
+	struct clock_topology node[MAX_NODES];
e336be
+	u32 num_nodes;
e336be
+	struct clock_parent parent[MAX_PARENT];
e336be
+	u32 num_parents;
e336be
+};
e336be
+
e336be
+static const char clk_type_postfix[][10] = {
e336be
+	[TYPE_INVALID] = "",
e336be
+	[TYPE_MUX] = "_mux",
e336be
+	[TYPE_GATE] = "",
e336be
+	[TYPE_DIV1] = "_div1",
e336be
+	[TYPE_DIV2] = "_div2",
e336be
+	[TYPE_FIXEDFACTOR] = "_ff",
e336be
+	[TYPE_PLL] = ""
e336be
+};
e336be
+
e336be
+static struct clk_hw *(* const clk_topology[]) (const char *name, u32 clk_id,
e336be
+					const char * const *parents,
e336be
+					u8 num_parents,
e336be
+					const struct clock_topology *nodes)
e336be
+					= {
e336be
+	[TYPE_INVALID] = NULL,
e336be
+	[TYPE_MUX] = zynqmp_clk_register_mux,
e336be
+	[TYPE_PLL] = zynqmp_clk_register_pll,
e336be
+	[TYPE_FIXEDFACTOR] = zynqmp_clk_register_fixed_factor,
e336be
+	[TYPE_DIV1] = zynqmp_clk_register_divider,
e336be
+	[TYPE_DIV2] = zynqmp_clk_register_divider,
e336be
+	[TYPE_GATE] = zynqmp_clk_register_gate
e336be
+};
e336be
+
e336be
+static struct zynqmp_clock *clock;
e336be
+static struct clk_hw_onecell_data *zynqmp_data;
e336be
+static unsigned int clock_max_idx;
e336be
+static const struct zynqmp_eemi_ops *eemi_ops;
e336be
+
e336be
+/**
e336be
+ * zynqmp_is_valid_clock() - Check whether clock is valid or not
e336be
+ * @clk_id:	Clock index
e336be
+ *
e336be
+ * Return: 1 if clock is valid, 0 if clock is invalid else error code
e336be
+ */
e336be
+static inline int zynqmp_is_valid_clock(u32 clk_id)
e336be
+{
e336be
+	if (clk_id > clock_max_idx)
e336be
+		return -ENODEV;
e336be
+
e336be
+	return clock[clk_id].valid;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_get_clock_name() - Get name of clock from Clock index
e336be
+ * @clk_id:	Clock index
e336be
+ * @clk_name:	Name of clock
e336be
+ *
e336be
+ * Return: 0 on success else error code
e336be
+ */
e336be
+static int zynqmp_get_clock_name(u32 clk_id, char *clk_name)
e336be
+{
e336be
+	int ret;
e336be
+
e336be
+	ret = zynqmp_is_valid_clock(clk_id);
e336be
+	if (ret == 1) {
e336be
+		strncpy(clk_name, clock[clk_id].clk_name, MAX_NAME_LEN);
e336be
+		return 0;
e336be
+	}
e336be
+
e336be
+	return ret == 0 ? -EINVAL : ret;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_get_clock_type() - Get type of clock
e336be
+ * @clk_id:	Clock index
e336be
+ * @type:	Clock type: CLK_TYPE_OUTPUT or CLK_TYPE_EXTERNAL
e336be
+ *
e336be
+ * Return: 0 on success else error code
e336be
+ */
e336be
+static int zynqmp_get_clock_type(u32 clk_id, u32 *type)
e336be
+{
e336be
+	int ret;
e336be
+
e336be
+	ret = zynqmp_is_valid_clock(clk_id);
e336be
+	if (ret == 1) {
e336be
+		*type = clock[clk_id].type;
e336be
+		return 0;
e336be
+	}
e336be
+
e336be
+	return ret == 0 ? -EINVAL : ret;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_clock_get_num_clocks() - Get number of clocks in system
e336be
+ * @nclocks:	Number of clocks in system/board.
e336be
+ *
e336be
+ * Call firmware API to get number of clocks.
e336be
+ *
e336be
+ * Return: 0 on success else error code.
e336be
+ */
e336be
+static int zynqmp_pm_clock_get_num_clocks(u32 *nclocks)
e336be
+{
e336be
+	struct zynqmp_pm_query_data qdata = {0};
e336be
+	__le32 ret_payload[PAYLOAD_ARG_CNT];
e336be
+	int ret;
e336be
+
e336be
+	qdata.qid = PM_QID_CLOCK_GET_NUM_CLOCKS;
e336be
+
e336be
+	ret = eemi_ops->query_data(qdata, ret_payload);
e336be
+	*nclocks = ret_payload[1];
e336be
+
e336be
+	return ret;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_clock_get_name() - Get the name of clock for given id
e336be
+ * @clock_id:	ID of the clock to be queried
e336be
+ * @name:	Name of given clock
e336be
+ *
e336be
+ * This function is used to get name of clock specified by given
e336be
+ * clock ID.
e336be
+ *
e336be
+ * Return: Returns 0, in case of error name would be 0
e336be
+ */
e336be
+static int zynqmp_pm_clock_get_name(u32 clock_id, char *name)
e336be
+{
e336be
+	struct zynqmp_pm_query_data qdata = {0};
e336be
+	__le32 ret_payload[PAYLOAD_ARG_CNT];
e336be
+
e336be
+	qdata.qid = PM_QID_CLOCK_GET_NAME;
e336be
+	qdata.arg1 = clock_id;
e336be
+
e336be
+	eemi_ops->query_data(qdata, ret_payload);
e336be
+	memcpy(name, ret_payload, CLK_GET_NAME_RESP_LEN);
e336be
+
e336be
+	return 0;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_clock_get_topology() - Get the topology of clock for given id
e336be
+ * @clock_id:	ID of the clock to be queried
e336be
+ * @index:	Node index of clock topology
e336be
+ * @topology:	Buffer to store nodes in topology and flags
e336be
+ *
e336be
+ * This function is used to get topology information for the clock
e336be
+ * specified by given clock ID.
e336be
+ *
e336be
+ * This API will return 3 node of topology with a single response. To get
e336be
+ * other nodes, master should call same API in loop with new
e336be
+ * index till error is returned. E.g First call should have
e336be
+ * index 0 which will return nodes 0,1 and 2. Next call, index
e336be
+ * should be 3 which will return nodes 3,4 and 5 and so on.
e336be
+ *
e336be
+ * Return: 0 on success else error+reason
e336be
+ */
e336be
+static int zynqmp_pm_clock_get_topology(u32 clock_id, u32 index, u32 *topology)
e336be
+{
e336be
+	struct zynqmp_pm_query_data qdata = {0};
e336be
+	__le32 ret_payload[PAYLOAD_ARG_CNT];
e336be
+	int ret;
e336be
+
e336be
+	qdata.qid = PM_QID_CLOCK_GET_TOPOLOGY;
e336be
+	qdata.arg1 = clock_id;
e336be
+	qdata.arg2 = index;
e336be
+
e336be
+	ret = eemi_ops->query_data(qdata, ret_payload);
e336be
+	memcpy(topology, &ret_payload[1], CLK_GET_TOPOLOGY_RESP_WORDS * 4);
e336be
+
e336be
+	return ret;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_clk_register_fixed_factor() - Register fixed factor with the
e336be
+ *					clock framework
e336be
+ * @name:		Name of this clock
e336be
+ * @clk_id:		Clock ID
e336be
+ * @parents:		Name of this clock's parents
e336be
+ * @num_parents:	Number of parents
e336be
+ * @nodes:		Clock topology node
e336be
+ *
e336be
+ * Return: clock hardware to the registered clock
e336be
+ */
e336be
+struct clk_hw *zynqmp_clk_register_fixed_factor(const char *name, u32 clk_id,
e336be
+					const char * const *parents,
e336be
+					u8 num_parents,
e336be
+					const struct clock_topology *nodes)
e336be
+{
e336be
+	u32 mult, div;
e336be
+	struct clk_hw *hw;
e336be
+	struct zynqmp_pm_query_data qdata = {0};
e336be
+	__le32 ret_payload[PAYLOAD_ARG_CNT];
e336be
+	int ret;
e336be
+
e336be
+	qdata.qid = PM_QID_CLOCK_GET_FIXEDFACTOR_PARAMS;
e336be
+	qdata.arg1 = clk_id;
e336be
+
e336be
+	ret = eemi_ops->query_data(qdata, ret_payload);
e336be
+	mult = ret_payload[1];
e336be
+	div = ret_payload[2];
e336be
+
e336be
+	hw = clk_hw_register_fixed_factor(NULL, name,
e336be
+					  parents[0],
e336be
+					  nodes->flag, mult,
e336be
+					  div);
e336be
+
e336be
+	return hw;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_clock_get_parents() - Get the first 3 parents of clock for given id
e336be
+ * @clock_id:	Clock ID
e336be
+ * @index:	Parent index
e336be
+ * @parents:	3 parents of the given clock
e336be
+ *
e336be
+ * This function is used to get 3 parents for the clock specified by
e336be
+ * given clock ID.
e336be
+ *
e336be
+ * This API will return 3 parents with a single response. To get
e336be
+ * other parents, master should call same API in loop with new
e336be
+ * parent index till error is returned. E.g First call should have
e336be
+ * index 0 which will return parents 0,1 and 2. Next call, index
e336be
+ * should be 3 which will return parent 3,4 and 5 and so on.
e336be
+ *
e336be
+ * Return: 0 on success else error+reason
e336be
+ */
e336be
+static int zynqmp_pm_clock_get_parents(u32 clock_id, u32 index, u32 *parents)
e336be
+{
e336be
+	struct zynqmp_pm_query_data qdata = {0};
e336be
+	__le32 ret_payload[PAYLOAD_ARG_CNT];
e336be
+	int ret;
e336be
+
e336be
+	qdata.qid = PM_QID_CLOCK_GET_PARENTS;
e336be
+	qdata.arg1 = clock_id;
e336be
+	qdata.arg2 = index;
e336be
+
e336be
+	ret = eemi_ops->query_data(qdata, ret_payload);
e336be
+	memcpy(parents, &ret_payload[1], CLK_GET_PARENTS_RESP_WORDS * 4);
e336be
+
e336be
+	return ret;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pm_clock_get_attributes() - Get the attributes of clock for given id
e336be
+ * @clock_id:	Clock ID
e336be
+ * @attr:	Clock attributes
e336be
+ *
e336be
+ * This function is used to get clock's attributes(e.g. valid, clock type, etc).
e336be
+ *
e336be
+ * Return: 0 on success else error+reason
e336be
+ */
e336be
+static int zynqmp_pm_clock_get_attributes(u32 clock_id, u32 *attr)
e336be
+{
e336be
+	struct zynqmp_pm_query_data qdata = {0};
e336be
+	__le32 ret_payload[PAYLOAD_ARG_CNT];
e336be
+	int ret;
e336be
+
e336be
+	qdata.qid = PM_QID_CLOCK_GET_ATTRIBUTES;
e336be
+	qdata.arg1 = clock_id;
e336be
+
e336be
+	ret = eemi_ops->query_data(qdata, ret_payload);
e336be
+	memcpy(attr, &ret_payload[1], CLK_GET_ATTR_RESP_WORDS * 4);
e336be
+
e336be
+	return ret;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * __zynqmp_clock_get_topology() - Get topology data of clock from firmware
e336be
+ *				   response data
e336be
+ * @topology:		Clock topology
e336be
+ * @data:		Clock topology data received from firmware
e336be
+ * @nnodes:		Number of nodes
e336be
+ *
e336be
+ * Return: 0 on success else error+reason
e336be
+ */
e336be
+static int __zynqmp_clock_get_topology(struct clock_topology *topology,
e336be
+				       u32 *data, u32 *nnodes)
e336be
+{
e336be
+	int i;
e336be
+
e336be
+	for (i = 0; i < PM_API_PAYLOAD_LEN; i++) {
e336be
+		if (!(data[i] & CLK_TYPE_FIELD_MASK))
e336be
+			return END_OF_TOPOLOGY_NODE;
e336be
+		topology[*nnodes].type = data[i] & CLK_TYPE_FIELD_MASK;
e336be
+		topology[*nnodes].flag = FIELD_GET(CLK_FLAG_FIELD_MASK,
e336be
+						   data[i]);
e336be
+		topology[*nnodes].type_flag =
e336be
+				FIELD_GET(CLK_TYPE_FLAG_FIELD_MASK, data[i]);
e336be
+		(*nnodes)++;
e336be
+	}
e336be
+
e336be
+	return 0;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_clock_get_topology() - Get topology of clock from firmware using
e336be
+ *				 PM_API
e336be
+ * @clk_id:		Clock index
e336be
+ * @topology:		Clock topology
e336be
+ * @num_nodes:		Number of nodes
e336be
+ *
e336be
+ * Return: 0 on success else error+reason
e336be
+ */
e336be
+static int zynqmp_clock_get_topology(u32 clk_id,
e336be
+				     struct clock_topology *topology,
e336be
+				     u32 *num_nodes)
e336be
+{
e336be
+	int j, ret;
e336be
+	u32 pm_resp[PM_API_PAYLOAD_LEN] = {0};
e336be
+
e336be
+	*num_nodes = 0;
e336be
+	for (j = 0; j <= MAX_NODES; j += 3) {
e336be
+		ret = zynqmp_pm_clock_get_topology(clk_id, j, pm_resp);
e336be
+		if (ret)
e336be
+			return ret;
e336be
+		ret = __zynqmp_clock_get_topology(topology, pm_resp, num_nodes);
e336be
+		if (ret == END_OF_TOPOLOGY_NODE)
e336be
+			return 0;
e336be
+	}
e336be
+
e336be
+	return 0;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * __zynqmp_clock_get_topology() - Get parents info of clock from firmware
e336be
+ *				   response data
e336be
+ * @parents:		Clock parents
e336be
+ * @data:		Clock parents data received from firmware
e336be
+ * @nparent:		Number of parent
e336be
+ *
e336be
+ * Return: 0 on success else error+reason
e336be
+ */
e336be
+static int __zynqmp_clock_get_parents(struct clock_parent *parents, u32 *data,
e336be
+				      u32 *nparent)
e336be
+{
e336be
+	int i;
e336be
+	struct clock_parent *parent;
e336be
+
e336be
+	for (i = 0; i < PM_API_PAYLOAD_LEN; i++) {
e336be
+		if (data[i] == NA_PARENT)
e336be
+			return END_OF_PARENTS;
e336be
+
e336be
+		parent = &parents[i];
e336be
+		parent->id = data[i] & CLK_PARENTS_ID_MASK;
e336be
+		if (data[i] == DUMMY_PARENT) {
e336be
+			strcpy(parent->name, "dummy_name");
e336be
+			parent->flag = 0;
e336be
+		} else {
e336be
+			parent->flag = data[i] >> CLK_PARENTS_ID_LEN;
e336be
+			if (zynqmp_get_clock_name(parent->id, parent->name))
e336be
+				continue;
e336be
+		}
e336be
+		*nparent += 1;
e336be
+	}
e336be
+
e336be
+	return 0;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_clock_get_parents() - Get parents info from firmware using PM_API
e336be
+ * @clk_id:		Clock index
e336be
+ * @parents:		Clock parents
e336be
+ * @num_parents:	Total number of parents
e336be
+ *
e336be
+ * Return: 0 on success else error+reason
e336be
+ */
e336be
+static int zynqmp_clock_get_parents(u32 clk_id, struct clock_parent *parents,
e336be
+				    u32 *num_parents)
e336be
+{
e336be
+	int j = 0, ret;
e336be
+	u32 pm_resp[PM_API_PAYLOAD_LEN] = {0};
e336be
+
e336be
+	*num_parents = 0;
e336be
+	do {
e336be
+		/* Get parents from firmware */
e336be
+		ret = zynqmp_pm_clock_get_parents(clk_id, j, pm_resp);
e336be
+		if (ret)
e336be
+			return ret;
e336be
+
e336be
+		ret = __zynqmp_clock_get_parents(&parents[j], pm_resp,
e336be
+						 num_parents);
e336be
+		if (ret == END_OF_PARENTS)
e336be
+			return 0;
e336be
+		j += PM_API_PAYLOAD_LEN;
e336be
+	} while (*num_parents <= MAX_PARENT);
e336be
+
e336be
+	return 0;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_get_parent_list() - Create list of parents name
e336be
+ * @np:			Device node
e336be
+ * @clk_id:		Clock index
e336be
+ * @parent_list:	List of parent's name
e336be
+ * @num_parents:	Total number of parents
e336be
+ *
e336be
+ * Return: 0 on success else error+reason
e336be
+ */
e336be
+static int zynqmp_get_parent_list(struct device_node *np, u32 clk_id,
e336be
+				  const char **parent_list, u32 *num_parents)
e336be
+{
e336be
+	int i = 0, ret;
e336be
+	u32 total_parents = clock[clk_id].num_parents;
e336be
+	struct clock_topology *clk_nodes;
e336be
+	struct clock_parent *parents;
e336be
+
e336be
+	clk_nodes = clock[clk_id].node;
e336be
+	parents = clock[clk_id].parent;
e336be
+
e336be
+	for (i = 0; i < total_parents; i++) {
e336be
+		if (!parents[i].flag) {
e336be
+			parent_list[i] = parents[i].name;
e336be
+		} else if (parents[i].flag == PARENT_CLK_EXTERNAL) {
e336be
+			ret = of_property_match_string(np, "clock-names",
e336be
+						       parents[i].name);
e336be
+			if (ret < 0)
e336be
+				strcpy(parents[i].name, "dummy_name");
e336be
+			parent_list[i] = parents[i].name;
e336be
+		} else {
e336be
+			strcat(parents[i].name,
e336be
+			       clk_type_postfix[clk_nodes[parents[i].flag - 1].
e336be
+			       type]);
e336be
+			parent_list[i] = parents[i].name;
e336be
+		}
e336be
+	}
e336be
+
e336be
+	*num_parents = total_parents;
e336be
+	return 0;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_register_clk_topology() - Register clock topology
e336be
+ * @clk_id:		Clock index
e336be
+ * @clk_name:		Clock Name
e336be
+ * @num_parents:	Total number of parents
e336be
+ * @parent_names:	List of parents name
e336be
+ *
e336be
+ * Return: Returns either clock hardware or error+reason
e336be
+ */
e336be
+static struct clk_hw *zynqmp_register_clk_topology(int clk_id, char *clk_name,
e336be
+						   int num_parents,
e336be
+						   const char **parent_names)
e336be
+{
e336be
+	int j;
e336be
+	u32 num_nodes;
e336be
+	char *clk_out = NULL;
e336be
+	struct clock_topology *nodes;
e336be
+	struct clk_hw *hw = NULL;
e336be
+
e336be
+	nodes = clock[clk_id].node;
e336be
+	num_nodes = clock[clk_id].num_nodes;
e336be
+
e336be
+	for (j = 0; j < num_nodes; j++) {
e336be
+		/*
e336be
+		 * Clock name received from firmware is output clock name.
e336be
+		 * Intermediate clock names are postfixed with type of clock.
e336be
+		 */
e336be
+		if (j != (num_nodes - 1)) {
e336be
+			clk_out = kasprintf(GFP_KERNEL, "%s%s", clk_name,
e336be
+					    clk_type_postfix[nodes[j].type]);
e336be
+		} else {
e336be
+			clk_out = kasprintf(GFP_KERNEL, "%s", clk_name);
e336be
+		}
e336be
+
e336be
+		if (!clk_topology[nodes[j].type])
e336be
+			continue;
e336be
+
e336be
+		hw = (*clk_topology[nodes[j].type])(clk_out, clk_id,
e336be
+						    parent_names,
e336be
+						    num_parents,
e336be
+						    &nodes[j]);
e336be
+		if (IS_ERR(hw))
e336be
+			pr_warn_once("%s() %s register fail with %ld\n",
e336be
+				     __func__, clk_name, PTR_ERR(hw));
e336be
+
e336be
+		parent_names[0] = clk_out;
e336be
+	}
e336be
+	kfree(clk_out);
e336be
+	return hw;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_register_clocks() - Register clocks
e336be
+ * @np:		Device node
e336be
+ *
e336be
+ * Return: 0 on success else error code
e336be
+ */
e336be
+static int zynqmp_register_clocks(struct device_node *np)
e336be
+{
e336be
+	int ret;
e336be
+	u32 i, total_parents = 0, type = 0;
e336be
+	const char *parent_names[MAX_PARENT];
e336be
+
e336be
+	for (i = 0; i < clock_max_idx; i++) {
e336be
+		char clk_name[MAX_NAME_LEN];
e336be
+
e336be
+		/* get clock name, continue to next clock if name not found */
e336be
+		if (zynqmp_get_clock_name(i, clk_name))
e336be
+			continue;
e336be
+
e336be
+		/* Check if clock is valid and output clock.
e336be
+		 * Do not register invalid or external clock.
e336be
+		 */
e336be
+		ret = zynqmp_get_clock_type(i, &type);
e336be
+		if (ret || type != CLK_TYPE_OUTPUT)
e336be
+			continue;
e336be
+
e336be
+		/* Get parents of clock*/
e336be
+		if (zynqmp_get_parent_list(np, i, parent_names,
e336be
+					   &total_parents)) {
e336be
+			WARN_ONCE(1, "No parents found for %s\n",
e336be
+				  clock[i].clk_name);
e336be
+			continue;
e336be
+		}
e336be
+
e336be
+		zynqmp_data->hws[i] =
e336be
+			zynqmp_register_clk_topology(i, clk_name,
e336be
+						     total_parents,
e336be
+						     parent_names);
e336be
+	}
e336be
+
e336be
+	for (i = 0; i < clock_max_idx; i++) {
e336be
+		if (IS_ERR(zynqmp_data->hws[i])) {
e336be
+			pr_err("Zynq Ultrascale+ MPSoC clk %s: register failed with %ld\n",
e336be
+			       clock[i].clk_name, PTR_ERR(zynqmp_data->hws[i]));
e336be
+			WARN_ON(1);
e336be
+		}
e336be
+	}
e336be
+	return 0;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_get_clock_info() - Get clock information from firmware using PM_API
e336be
+ */
e336be
+static void zynqmp_get_clock_info(void)
e336be
+{
e336be
+	int i, ret;
e336be
+	u32 attr, type = 0;
e336be
+
e336be
+	for (i = 0; i < clock_max_idx; i++) {
e336be
+		zynqmp_pm_clock_get_name(i, clock[i].clk_name);
e336be
+		if (!strcmp(clock[i].clk_name, RESERVED_CLK_NAME))
e336be
+			continue;
e336be
+
e336be
+		ret = zynqmp_pm_clock_get_attributes(i, &attr);
e336be
+		if (ret)
e336be
+			continue;
e336be
+
e336be
+		clock[i].valid = attr & CLK_VALID_MASK;
e336be
+		clock[i].type = attr >> CLK_TYPE_SHIFT ? CLK_TYPE_EXTERNAL :
e336be
+							CLK_TYPE_OUTPUT;
e336be
+	}
e336be
+
e336be
+	/* Get topology of all clock */
e336be
+	for (i = 0; i < clock_max_idx; i++) {
e336be
+		ret = zynqmp_get_clock_type(i, &type);
e336be
+		if (ret || type != CLK_TYPE_OUTPUT)
e336be
+			continue;
e336be
+
e336be
+		ret = zynqmp_clock_get_topology(i, clock[i].node,
e336be
+						&clock[i].num_nodes);
e336be
+		if (ret)
e336be
+			continue;
e336be
+
e336be
+		ret = zynqmp_clock_get_parents(i, clock[i].parent,
e336be
+					       &clock[i].num_parents);
e336be
+		if (ret)
e336be
+			continue;
e336be
+	}
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_clk_setup() - Setup the clock framework and register clocks
e336be
+ * @np:		Device node
e336be
+ *
e336be
+ * Return: 0 on success else error code
e336be
+ */
e336be
+static int zynqmp_clk_setup(struct device_node *np)
e336be
+{
e336be
+	int ret;
e336be
+
e336be
+	ret = zynqmp_pm_clock_get_num_clocks(&clock_max_idx);
e336be
+	if (ret)
e336be
+		return ret;
e336be
+
e336be
+	zynqmp_data = kzalloc(sizeof(*zynqmp_data) + sizeof(*zynqmp_data) *
e336be
+						clock_max_idx, GFP_KERNEL);
e336be
+	if (!zynqmp_data)
e336be
+		return -ENOMEM;
e336be
+
e336be
+	clock = kcalloc(clock_max_idx, sizeof(*clock), GFP_KERNEL);
e336be
+	if (!clock) {
e336be
+		kfree(zynqmp_data);
e336be
+		return -ENOMEM;
e336be
+	}
e336be
+
e336be
+	zynqmp_get_clock_info();
e336be
+	zynqmp_register_clocks(np);
e336be
+
e336be
+	zynqmp_data->num = clock_max_idx;
e336be
+	of_clk_add_hw_provider(np, of_clk_hw_onecell_get, zynqmp_data);
e336be
+
e336be
+	return 0;
e336be
+}
e336be
+
e336be
+static int zynqmp_clock_probe(struct platform_device *pdev)
e336be
+{
e336be
+	int ret;
e336be
+	struct device *dev = &pdev->dev;
e336be
+
e336be
+	eemi_ops = zynqmp_pm_get_eemi_ops();
e336be
+	if (!eemi_ops)
e336be
+		return -ENXIO;
e336be
+
e336be
+	ret = zynqmp_clk_setup(dev->of_node);
e336be
+
e336be
+	return ret;
e336be
+}
e336be
+
e336be
+static const struct of_device_id zynqmp_clock_of_match[] = {
e336be
+	{.compatible = "xlnx,zynqmp-clk"},
e336be
+	{},
e336be
+};
e336be
+MODULE_DEVICE_TABLE(of, zynqmp_clock_of_match);
e336be
+
e336be
+static struct platform_driver zynqmp_clock_driver = {
e336be
+	.driver = {
e336be
+		.name = "zynqmp_clock",
e336be
+		.of_match_table = zynqmp_clock_of_match,
e336be
+	},
e336be
+	.probe = zynqmp_clock_probe,
e336be
+};
e336be
+module_platform_driver(zynqmp_clock_driver);
e336be
diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c
e336be
new file mode 100644
e336be
index 0000000..a371c66
e336be
--- /dev/null
e336be
+++ b/drivers/clk/zynqmp/divider.c
e336be
@@ -0,0 +1,217 @@
e336be
+// SPDX-License-Identifier: GPL-2.0
e336be
+/*
e336be
+ * Zynq UltraScale+ MPSoC Divider support
e336be
+ *
e336be
+ *  Copyright (C) 2016-2018 Xilinx
e336be
+ *
e336be
+ * Adjustable divider clock implementation
e336be
+ */
e336be
+
e336be
+#include <linux/clk.h>
e336be
+#include <linux/clk-provider.h>
e336be
+#include <linux/slab.h>
e336be
+#include "clk-zynqmp.h"
e336be
+
e336be
+/*
e336be
+ * DOC: basic adjustable divider clock that cannot gate
e336be
+ *
e336be
+ * Traits of this clock:
e336be
+ * prepare - clk_prepare only ensures that parents are prepared
e336be
+ * enable - clk_enable only ensures that parents are enabled
e336be
+ * rate - rate is adjustable.  clk->rate = ceiling(parent->rate / divisor)
e336be
+ * parent - fixed parent.  No clk_set_parent support
e336be
+ */
e336be
+
e336be
+#define to_zynqmp_clk_divider(_hw)		\
e336be
+	container_of(_hw, struct zynqmp_clk_divider, hw)
e336be
+
e336be
+#define CLK_FRAC	BIT(13) /* has a fractional parent */
e336be
+
e336be
+/**
e336be
+ * struct zynqmp_clk_divider - adjustable divider clock
e336be
+ * @hw:		handle between common and hardware-specific interfaces
e336be
+ * @flags:	Hardware specific flags
e336be
+ * @clk_id:	Id of clock
e336be
+ * @div_type:	divisor type (TYPE_DIV1 or TYPE_DIV2)
e336be
+ */
e336be
+struct zynqmp_clk_divider {
e336be
+	struct clk_hw hw;
e336be
+	u8 flags;
e336be
+	u32 clk_id;
e336be
+	u32 div_type;
e336be
+};
e336be
+
e336be
+static inline int zynqmp_divider_get_val(unsigned long parent_rate,
e336be
+					 unsigned long rate)
e336be
+{
e336be
+	return DIV_ROUND_CLOSEST(parent_rate, rate);
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_clk_divider_recalc_rate() - Recalc rate of divider clock
e336be
+ * @hw:			handle between common and hardware-specific interfaces
e336be
+ * @parent_rate:	rate of parent clock
e336be
+ *
e336be
+ * Return: 0 on success else error+reason
e336be
+ */
e336be
+static unsigned long zynqmp_clk_divider_recalc_rate(struct clk_hw *hw,
e336be
+						    unsigned long parent_rate)
e336be
+{
e336be
+	struct zynqmp_clk_divider *divider = to_zynqmp_clk_divider(hw);
e336be
+	const char *clk_name = clk_hw_get_name(hw);
e336be
+	u32 clk_id = divider->clk_id;
e336be
+	u32 div_type = divider->div_type;
e336be
+	u32 div, value;
e336be
+	int ret;
e336be
+	const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
e336be
+
e336be
+	ret = eemi_ops->clock_getdivider(clk_id, &div);
e336be
+
e336be
+	if (ret)
e336be
+		pr_warn_once("%s() get divider failed for %s, ret = %d\n",
e336be
+			     __func__, clk_name, ret);
e336be
+
e336be
+	if (div_type == TYPE_DIV1)
e336be
+		value = div & 0xFFFF;
e336be
+	else
e336be
+		value = div >> 16;
e336be
+
e336be
+	return DIV_ROUND_UP_ULL(parent_rate, value);
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_clk_divider_round_rate() - Round rate of divider clock
e336be
+ * @hw:			handle between common and hardware-specific interfaces
e336be
+ * @rate:		rate of clock to be set
e336be
+ * @prate:		rate of parent clock
e336be
+ *
e336be
+ * Return: 0 on success else error+reason
e336be
+ */
e336be
+static long zynqmp_clk_divider_round_rate(struct clk_hw *hw,
e336be
+					  unsigned long rate,
e336be
+					  unsigned long *prate)
e336be
+{
e336be
+	struct zynqmp_clk_divider *divider = to_zynqmp_clk_divider(hw);
e336be
+	const char *clk_name = clk_hw_get_name(hw);
e336be
+	u32 clk_id = divider->clk_id;
e336be
+	u32 div_type = divider->div_type;
e336be
+	u32 bestdiv;
e336be
+	int ret;
e336be
+	const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
e336be
+
e336be
+	/* if read only, just return current value */
e336be
+	if (divider->flags & CLK_DIVIDER_READ_ONLY) {
e336be
+		ret = eemi_ops->clock_getdivider(clk_id, &bestdiv);
e336be
+
e336be
+		if (ret)
e336be
+			pr_warn_once("%s() get divider failed for %s, ret = %d\n",
e336be
+				     __func__, clk_name, ret);
e336be
+		if (div_type == TYPE_DIV1)
e336be
+			bestdiv = bestdiv & 0xFFFF;
e336be
+		else
e336be
+			bestdiv  = bestdiv >> 16;
e336be
+
e336be
+		return DIV_ROUND_UP_ULL((u64)*prate, bestdiv);
e336be
+	}
e336be
+
e336be
+	bestdiv = zynqmp_divider_get_val(*prate, rate);
e336be
+
e336be
+	if ((clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT) &&
e336be
+	    (divider->flags & CLK_FRAC))
e336be
+		bestdiv = rate % *prate ? 1 : bestdiv;
e336be
+	*prate = rate * bestdiv;
e336be
+
e336be
+	return rate;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_clk_divider_set_rate() - Set rate of divider clock
e336be
+ * @hw:			handle between common and hardware-specific interfaces
e336be
+ * @rate:		rate of clock to be set
e336be
+ * @parent_rate:	rate of parent clock
e336be
+ *
e336be
+ * Return: 0 on success else error+reason
e336be
+ */
e336be
+static int zynqmp_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
e336be
+				       unsigned long parent_rate)
e336be
+{
e336be
+	struct zynqmp_clk_divider *divider = to_zynqmp_clk_divider(hw);
e336be
+	const char *clk_name = clk_hw_get_name(hw);
e336be
+	u32 clk_id = divider->clk_id;
e336be
+	u32 div_type = divider->div_type;
e336be
+	u32 value, div;
e336be
+	int ret;
e336be
+	const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
e336be
+
e336be
+	value = zynqmp_divider_get_val(parent_rate, rate);
e336be
+	if (div_type == TYPE_DIV1) {
e336be
+		div = value & 0xFFFF;
e336be
+		div |= 0xffff << 16;
e336be
+	} else {
e336be
+		div = 0xffff;
e336be
+		div |= value << 16;
e336be
+	}
e336be
+
e336be
+	ret = eemi_ops->clock_setdivider(clk_id, div);
e336be
+
e336be
+	if (ret)
e336be
+		pr_warn_once("%s() set divider failed for %s, ret = %d\n",
e336be
+			     __func__, clk_name, ret);
e336be
+
e336be
+	return ret;
e336be
+}
e336be
+
e336be
+static const struct clk_ops zynqmp_clk_divider_ops = {
e336be
+	.recalc_rate = zynqmp_clk_divider_recalc_rate,
e336be
+	.round_rate = zynqmp_clk_divider_round_rate,
e336be
+	.set_rate = zynqmp_clk_divider_set_rate,
e336be
+};
e336be
+
e336be
+/**
e336be
+ * zynqmp_clk_register_divider() - Register a divider clock
e336be
+ * @name:		Name of this clock
e336be
+ * @clk_id:		Id of clock
e336be
+ * @parents:		Name of this clock's parents
e336be
+ * @num_parents:	Number of parents
e336be
+ * @nodes:		Clock topology node
e336be
+ *
e336be
+ * Return: clock hardware to registered clock divider
e336be
+ */
e336be
+struct clk_hw *zynqmp_clk_register_divider(const char *name,
e336be
+					   u32 clk_id,
e336be
+					   const char * const *parents,
e336be
+					   u8 num_parents,
e336be
+					   const struct clock_topology *nodes)
e336be
+{
e336be
+	struct zynqmp_clk_divider *div;
e336be
+	struct clk_hw *hw;
e336be
+	struct clk_init_data init;
e336be
+	int ret;
e336be
+
e336be
+	/* allocate the divider */
e336be
+	div = kzalloc(sizeof(*div), GFP_KERNEL);
e336be
+	if (!div)
e336be
+		return ERR_PTR(-ENOMEM);
e336be
+
e336be
+	init.name = name;
e336be
+	init.ops = &zynqmp_clk_divider_ops;
e336be
+	init.flags = nodes->flag;
e336be
+	init.parent_names = parents;
e336be
+	init.num_parents = 1;
e336be
+
e336be
+	/* struct clk_divider assignments */
e336be
+	div->flags = nodes->type_flag;
e336be
+	div->hw.init = &ini;;
e336be
+	div->clk_id = clk_id;
e336be
+	div->div_type = nodes->type;
e336be
+
e336be
+	hw = &div->hw;
e336be
+	ret = clk_hw_register(NULL, hw);
e336be
+	if (ret) {
e336be
+		kfree(div);
e336be
+		hw = ERR_PTR(ret);
e336be
+	}
e336be
+
e336be
+	return hw;
e336be
+}
e336be
+EXPORT_SYMBOL_GPL(zynqmp_clk_register_divider);
e336be
diff --git a/drivers/clk/zynqmp/pll.c b/drivers/clk/zynqmp/pll.c
e336be
new file mode 100644
e336be
index 0000000..626bb5f
e336be
--- /dev/null
e336be
+++ b/drivers/clk/zynqmp/pll.c
e336be
@@ -0,0 +1,335 @@
e336be
+// SPDX-License-Identifier: GPL-2.0
e336be
+/*
e336be
+ * Zynq UltraScale+ MPSoC PLL driver
e336be
+ *
e336be
+ *  Copyright (C) 2016-2018 Xilinx
e336be
+ */
e336be
+
e336be
+#include <linux/clk.h>
e336be
+#include <linux/clk-provider.h>
e336be
+#include <linux/slab.h>
e336be
+#include "clk-zynqmp.h"
e336be
+
e336be
+/**
e336be
+ * struct zynqmp_pll - PLL clock
e336be
+ * @hw:		Handle between common and hardware-specific interfaces
e336be
+ * @clk_id:	PLL clock ID
e336be
+ */
e336be
+struct zynqmp_pll {
e336be
+	struct clk_hw hw;
e336be
+	u32 clk_id;
e336be
+};
e336be
+
e336be
+#define to_zynqmp_pll(_hw)	container_of(_hw, struct zynqmp_pll, hw)
e336be
+
e336be
+#define PLL_FBDIV_MIN	25
e336be
+#define PLL_FBDIV_MAX	125
e336be
+
e336be
+#define PS_PLL_VCO_MIN 1500000000
e336be
+#define PS_PLL_VCO_MAX 3000000000UL
e336be
+
e336be
+enum pll_mode {
e336be
+	PLL_MODE_INT,
e336be
+	PLL_MODE_FRAC,
e336be
+};
e336be
+
e336be
+#define FRAC_OFFSET 0x8
e336be
+#define PLLFCFG_FRAC_EN	BIT(31)
e336be
+#define FRAC_DIV  BIT(16)  /* 2^16 */
e336be
+
e336be
+/**
e336be
+ * zynqmp_pll_get_mode() - Get mode of PLL
e336be
+ * @hw:		Handle between common and hardware-specific interfaces
e336be
+ *
e336be
+ * Return: Mode of PLL
e336be
+ */
e336be
+static inline enum pll_mode zynqmp_pll_get_mode(struct clk_hw *hw)
e336be
+{
e336be
+	struct zynqmp_pll *clk = to_zynqmp_pll(hw);
e336be
+	u32 clk_id = clk->clk_id;
e336be
+	const char *clk_name = clk_hw_get_name(hw);
e336be
+	__le32 ret_payload[PAYLOAD_ARG_CNT];
e336be
+	int ret;
e336be
+	const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
e336be
+
e336be
+	ret = eemi_ops->ioctl(0, IOCTL_GET_PLL_FRAC_MODE, clk_id, 0,
e336be
+			      ret_payload);
e336be
+	if (ret)
e336be
+		pr_warn_once("%s() PLL get frac mode failed for %s, ret = %d\n",
e336be
+			     __func__, clk_name, ret);
e336be
+
e336be
+	return ret_payload[1];
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pll_set_mode() - Set the PLL mode
e336be
+ * @hw:		Handle between common and hardware-specific interfaces
e336be
+ * @on:		Flag to determine the mode
e336be
+ */
e336be
+static inline void zynqmp_pll_set_mode(struct clk_hw *hw, bool on)
e336be
+{
e336be
+	struct zynqmp_pll *clk = to_zynqmp_pll(hw);
e336be
+	u32 clk_id = clk->clk_id;
e336be
+	const char *clk_name = clk_hw_get_name(hw);
e336be
+	int ret;
e336be
+	u32 mode;
e336be
+	const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
e336be
+
e336be
+	if (on)
e336be
+		mode = PLL_MODE_FRAC;
e336be
+	else
e336be
+		mode = PLL_MODE_INT;
e336be
+
e336be
+	ret = eemi_ops->ioctl(0, IOCTL_SET_PLL_FRAC_MODE, clk_id, mode, NULL);
e336be
+	if (ret)
e336be
+		pr_warn_once("%s() PLL set frac mode failed for %s, ret = %d\n",
e336be
+			     __func__, clk_name, ret);
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pll_round_rate() - Round a clock frequency
e336be
+ * @hw:		Handle between common and hardware-specific interfaces
e336be
+ * @rate:	Desired clock frequency
e336be
+ * @prate:	Clock frequency of parent clock
e336be
+ *
e336be
+ * Return: Frequency closest to @rate the hardware can generate
e336be
+ */
e336be
+static long zynqmp_pll_round_rate(struct clk_hw *hw, unsigned long rate,
e336be
+				  unsigned long *prate)
e336be
+{
e336be
+	u32 fbdiv;
e336be
+	long rate_div, f;
e336be
+
e336be
+	/* Enable the fractional mode if needed */
e336be
+	rate_div = (rate * FRAC_DIV) / *prate;
e336be
+	f = rate_div % FRAC_DIV;
e336be
+	zynqmp_pll_set_mode(hw, !!f);
e336be
+
e336be
+	if (zynqmp_pll_get_mode(hw) == PLL_MODE_FRAC) {
e336be
+		if (rate > PS_PLL_VCO_MAX) {
e336be
+			fbdiv = rate / PS_PLL_VCO_MAX;
e336be
+			rate = rate / (fbdiv + 1);
e336be
+		}
e336be
+		if (rate < PS_PLL_VCO_MIN) {
e336be
+			fbdiv = DIV_ROUND_UP(PS_PLL_VCO_MIN, rate);
e336be
+			rate = rate * fbdiv;
e336be
+		}
e336be
+		return rate;
e336be
+	}
e336be
+
e336be
+	fbdiv = DIV_ROUND_CLOSEST(rate, *prate);
e336be
+	fbdiv = clamp_t(u32, fbdiv, PLL_FBDIV_MIN, PLL_FBDIV_MAX);
e336be
+	return *prate * fbdiv;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pll_recalc_rate() - Recalculate clock frequency
e336be
+ * @hw:			Handle between common and hardware-specific interfaces
e336be
+ * @parent_rate:	Clock frequency of parent clock
e336be
+ *
e336be
+ * Return: Current clock frequency
e336be
+ */
e336be
+static unsigned long zynqmp_pll_recalc_rate(struct clk_hw *hw,
e336be
+					    unsigned long parent_rate)
e336be
+{
e336be
+	struct zynqmp_pll *clk = to_zynqmp_pll(hw);
e336be
+	u32 clk_id = clk->clk_id;
e336be
+	const char *clk_name = clk_hw_get_name(hw);
e336be
+	u32 fbdiv, data;
e336be
+	unsigned long rate, frac;
e336be
+	__le32 ret_payload[PAYLOAD_ARG_CNT];
e336be
+	int ret;
e336be
+	const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
e336be
+
e336be
+	ret = eemi_ops->clock_getdivider(clk_id, &fbdiv);
e336be
+	if (ret)
e336be
+		pr_warn_once("%s() get divider failed for %s, ret = %d\n",
e336be
+			     __func__, clk_name, ret);
e336be
+
e336be
+	rate =  parent_rate * fbdiv;
e336be
+	if (zynqmp_pll_get_mode(hw) == PLL_MODE_FRAC) {
e336be
+		eemi_ops->ioctl(0, IOCTL_GET_PLL_FRAC_DATA, clk_id, 0,
e336be
+				ret_payload);
e336be
+		data = ret_payload[1];
e336be
+		frac = (parent_rate * data) / FRAC_DIV;
e336be
+		rate = rate + frac;
e336be
+	}
e336be
+
e336be
+	return rate;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pll_set_rate() - Set rate of PLL
e336be
+ * @hw:			Handle between common and hardware-specific interfaces
e336be
+ * @rate:		Frequency of clock to be set
e336be
+ * @parent_rate:	Clock frequency of parent clock
e336be
+ *
e336be
+ * Set PLL divider to set desired rate.
e336be
+ *
e336be
+ * Returns:            rate which is set on success else error code
e336be
+ */
e336be
+static int zynqmp_pll_set_rate(struct clk_hw *hw, unsigned long rate,
e336be
+			       unsigned long parent_rate)
e336be
+{
e336be
+	struct zynqmp_pll *clk = to_zynqmp_pll(hw);
e336be
+	u32 clk_id = clk->clk_id;
e336be
+	const char *clk_name = clk_hw_get_name(hw);
e336be
+	u32 fbdiv;
e336be
+	long rate_div, frac, m, f;
e336be
+	int ret;
e336be
+	const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
e336be
+
e336be
+	if (zynqmp_pll_get_mode(hw) == PLL_MODE_FRAC) {
e336be
+		rate_div = (rate * FRAC_DIV) / parent_rate;
e336be
+		m = rate_div / FRAC_DIV;
e336be
+		f = rate_div % FRAC_DIV;
e336be
+		m = clamp_t(u32, m, (PLL_FBDIV_MIN), (PLL_FBDIV_MAX));
e336be
+		rate = parent_rate * m;
e336be
+		frac = (parent_rate * f) / FRAC_DIV;
e336be
+
e336be
+		ret = eemi_ops->clock_setdivider(clk_id, m);
e336be
+		if (ret)
e336be
+			pr_warn_once("%s() set divider failed for %s, ret = %d\n",
e336be
+				     __func__, clk_name, ret);
e336be
+
e336be
+		eemi_ops->ioctl(0, IOCTL_SET_PLL_FRAC_DATA, clk_id, f, NULL);
e336be
+
e336be
+		return rate + frac;
e336be
+	}
e336be
+
e336be
+	fbdiv = DIV_ROUND_CLOSEST(rate, parent_rate);
e336be
+	fbdiv = clamp_t(u32, fbdiv, PLL_FBDIV_MIN, PLL_FBDIV_MAX);
e336be
+	ret = eemi_ops->clock_setdivider(clk_id, fbdiv);
e336be
+	if (ret)
e336be
+		pr_warn_once("%s() set divider failed for %s, ret = %d\n",
e336be
+			     __func__, clk_name, ret);
e336be
+
e336be
+	return parent_rate * fbdiv;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pll_is_enabled() - Check if a clock is enabled
e336be
+ * @hw:		Handle between common and hardware-specific interfaces
e336be
+ *
e336be
+ * Return: 1 if the clock is enabled, 0 otherwise
e336be
+ */
e336be
+static int zynqmp_pll_is_enabled(struct clk_hw *hw)
e336be
+{
e336be
+	struct zynqmp_pll *clk = to_zynqmp_pll(hw);
e336be
+	const char *clk_name = clk_hw_get_name(hw);
e336be
+	u32 clk_id = clk->clk_id;
e336be
+	unsigned int state;
e336be
+	int ret;
e336be
+	const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
e336be
+
e336be
+	ret = eemi_ops->clock_getstate(clk_id, &state);
e336be
+	if (ret) {
e336be
+		pr_warn_once("%s() clock get state failed for %s, ret = %d\n",
e336be
+			     __func__, clk_name, ret);
e336be
+		return -EIO;
e336be
+	}
e336be
+
e336be
+	return state ? 1 : 0;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pll_enable() - Enable clock
e336be
+ * @hw:		Handle between common and hardware-specific interfaces
e336be
+ *
e336be
+ * Return: 0 on success else error code
e336be
+ */
e336be
+static int zynqmp_pll_enable(struct clk_hw *hw)
e336be
+{
e336be
+	struct zynqmp_pll *clk = to_zynqmp_pll(hw);
e336be
+	const char *clk_name = clk_hw_get_name(hw);
e336be
+	u32 clk_id = clk->clk_id;
e336be
+	int ret;
e336be
+	const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
e336be
+
e336be
+	if (zynqmp_pll_is_enabled(hw))
e336be
+		return 0;
e336be
+
e336be
+	ret = eemi_ops->clock_enable(clk_id);
e336be
+	if (ret)
e336be
+		pr_warn_once("%s() clock enable failed for %s, ret = %d\n",
e336be
+			     __func__, clk_name, ret);
e336be
+
e336be
+	return ret;
e336be
+}
e336be
+
e336be
+/**
e336be
+ * zynqmp_pll_disable() - Disable clock
e336be
+ * @hw:		Handle between common and hardware-specific interfaces
e336be
+ */
e336be
+static void zynqmp_pll_disable(struct clk_hw *hw)
e336be
+{
e336be
+	struct zynqmp_pll *clk = to_zynqmp_pll(hw);
e336be
+	const char *clk_name = clk_hw_get_name(hw);
e336be
+	u32 clk_id = clk->clk_id;
e336be
+	int ret;
e336be
+	const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops();
e336be
+
e336be
+	if (!zynqmp_pll_is_enabled(hw))
e336be
+		return;
e336be
+
e336be
+	ret = eemi_ops->clock_disable(clk_id);
e336be
+	if (ret)
e336be
+		pr_warn_once("%s() clock disable failed for %s, ret = %d\n",
e336be
+			     __func__, clk_name, ret);
e336be
+}
e336be
+
e336be
+static const struct clk_ops zynqmp_pll_ops = {
e336be
+	.enable = zynqmp_pll_enable,
e336be
+	.disable = zynqmp_pll_disable,
e336be
+	.is_enabled = zynqmp_pll_is_enabled,
e336be
+	.round_rate = zynqmp_pll_round_rate,
e336be
+	.recalc_rate = zynqmp_pll_recalc_rate,
e336be
+	.set_rate = zynqmp_pll_set_rate,
e336be
+};
e336be
+
e336be
+/**
e336be
+ * zynqmp_clk_register_pll() - Register PLL with the clock framework
e336be
+ * @name:		PLL name
e336be
+ * @clk_id:		Clock ID
e336be
+ * @parents:		Name of this clock's parents
e336be
+ * @num_parents:	Number of parents
e336be
+ * @nodes:		Clock topology node
e336be
+ *
e336be
+ * Return: clock hardware to the registered clock
e336be
+ */
e336be
+struct clk_hw *zynqmp_clk_register_pll(const char *name, u32 clk_id,
e336be
+				       const char * const *parents,
e336be
+				       u8 num_parents,
e336be
+				       const struct clock_topology *nodes)
e336be
+{
e336be
+	struct zynqmp_pll *pll;
e336be
+	struct clk_hw *hw;
e336be
+	struct clk_init_data init;
e336be
+	int ret;
e336be
+
e336be
+	init.name = name;
e336be
+	init.ops = &zynqmp_pll_ops;
e336be
+	init.flags = nodes->flag;
e336be
+	init.parent_names = parents;
e336be
+	init.num_parents = 1;
e336be
+
e336be
+	pll = kzalloc(sizeof(*pll), GFP_KERNEL);
e336be
+	if (!pll)
e336be
+		return ERR_PTR(-ENOMEM);
e336be
+
e336be
+	pll->hw.init = &ini;;
e336be
+	pll->clk_id = clk_id;
e336be
+
e336be
+	hw = &pll->hw;
e336be
+	ret = clk_hw_register(NULL, hw);
e336be
+	if (ret) {
e336be
+		kfree(pll);
e336be
+		return ERR_PTR(ret);
e336be
+	}
e336be
+
e336be
+	clk_hw_set_rate_range(hw, PS_PLL_VCO_MIN, PS_PLL_VCO_MAX);
e336be
+	if (ret < 0)
e336be
+		pr_err("%s:ERROR clk_set_rate_range failed %d\n", name, ret);
e336be
+
e336be
+	return hw;
e336be
+}
e336be
diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h
e336be
index 58a7478..a3ef7d6 100644
e336be
--- a/include/linux/firmware/xlnx-zynqmp.h
e336be
+++ b/include/linux/firmware/xlnx-zynqmp.h
e336be
@@ -72,6 +72,7 @@ enum pm_query_id {
e336be
 	PM_QID_CLOCK_GET_FIXEDFACTOR_PARAMS,
e336be
 	PM_QID_CLOCK_GET_PARENTS,
e336be
 	PM_QID_CLOCK_GET_ATTRIBUTES,
e336be
+	PM_QID_CLOCK_GET_NUM_CLOCKS = 12,
e336be
 };
e336be
 
e336be
 /**
e336be
e336be
From patchwork Fri Aug  3 17:53:28 2018
e336be
Content-Type: text/plain; charset="utf-8"
e336be
MIME-Version: 1.0
e336be
Content-Transfer-Encoding: 7bit
e336be
X-Patchwork-Submitter: Jolly Shah <jolly.shah@xilinx.com>
e336be
X-Patchwork-Id: 10555419
e336be
Return-Path: 
e336be
 <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org>
e336be
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
e336be
 [172.30.200.125])
e336be
	by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7272614E2
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:06:24 +0000 (UTC)
e336be
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FB462C1AF
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:06:24 +0000 (UTC)
e336be
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
e336be
	id 5343D2C984; Fri,  3 Aug 2018 18:06:24 +0000 (UTC)
e336be
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
e336be
	pdx-wl-mail.web.codeaurora.org
e336be
X-Spam-Level: 
e336be
X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00,
e336be
	DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1
e336be
Received: from bombadil.infradead.org (bombadil.infradead.org
e336be
 [198.137.202.133])
e336be
	(using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits))
e336be
	(No client certificate requested)
e336be
	by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E68552C1AF
e336be
	for <patchwork-linux-arm@patchwork.kernel.org>;
e336be
 Fri,  3 Aug 2018 18:06:23 +0000 (UTC)
e336be
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
e336be
	d=lists.infradead.org; s=bombadil.20170209; h=Sender:
e336be
	Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post:
e336be
	List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:
e336be
	Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description:
e336be
	Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:
e336be
	List-Owner; bh=xBfAFqp/1JxfkxFiJoHW7UYhX0tK+Per5yoNCATaQtA=; b=J2isLgGjSuvqsX
e336be
	uge98kSY5X+9hEz5UYJtWrmPbJfeyJ+T9PGaLsaGTZdbDwGpooesaOzDsctJW9BMSYnYUIQjNqJ1d
e336be
	hpK/qUsGTY5yDITFNu0Vd0PRbnSLySJim+56rxFPoRe8U+PiiQrOKm9o65k1DERWKlNLZ/5RcRS0i
e336be
	uZG66/6x8LXoektXoXg4rG2lrYlUHlAxmf2vXMN7U9zLCEcrMezCoUW2mvEYuIRGs+bGbT9doKU2y
e336be
	0QGhgpBr1uHZCAkaE7q9bkVwQ6e1thPgcxmVFoYMduPwMWjKvARH8H6rtbzkofOTpn/nh6/jk2abF
e336be
	K/+eygvV0q16J+n6MP8A==;
e336be
Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org)
e336be
	by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux))
e336be
	id 1fleSu-0002Ls-PC; Fri, 03 Aug 2018 18:06:16 +0000
e336be
Received: from mail-by2nam03on0052.outbound.protection.outlook.com
e336be
 ([104.47.42.52] helo=NAM03-BY2-obe.outbound.protection.outlook.com)
e336be
 by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux))
e336be
 id 1fleHG-0002lU-An
e336be
 for linux-arm-kernel@lists.infradead.org; Fri, 03 Aug 2018 17:54:18 +0000
e336be
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
e336be
 d=xilinx.onmicrosoft.com; s=selector1-xilinx-com;
e336be
 h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
e336be
 bh=HocsRqPj2eQGjE2XVpEC9FN28XayA3mpJe4M6gte33A=;
e336be
 b=DVbqTpiA2yXpnQWWPpVJftOa3sDdxP2UsgIvh36sh/022OZPb/2EBvsnOiNqrkkzTEIizFi0jwUEOhnjZTn1QBRwplEsD2CJ8uXcok/IVmB41NKj7jm8hVYKn4MPSUVwh9E8E8QqFObEm4DtZTOnie0kisAvjy+z5odvapQNCuA=
e336be
Received: from DM6PR02CA0009.namprd02.prod.outlook.com (2603:10b6:5:1c::22) by
e336be
 DM5PR0201MB3512.namprd02.prod.outlook.com (2603:10b6:4:77::12) with
e336be
 Microsoft
e336be
 SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
e336be
 15.20.1017.15; Fri, 3 Aug 2018 17:53:53 +0000
e336be
Received: from CY1NAM02FT049.eop-nam02.prod.protection.outlook.com
e336be
 (2a01:111:f400:7e45::200) by DM6PR02CA0009.outlook.office365.com
e336be
 (2603:10b6:5:1c::22) with Microsoft SMTP Server (version=TLS1_2,
e336be
 cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1017.14 via Frontend
e336be
 Transport; Fri, 3 Aug 2018 17:53:53 +0000
e336be
Authentication-Results: spf=pass (sender IP is 149.199.60.83)
e336be
 smtp.mailfrom=xilinx.com; linaro.org; dkim=none (message not signed)
e336be
 header.d=none;linaro.org; dmarc=bestguesspass action=none
e336be
 header.from=xilinx.com;
e336be
Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates
e336be
 149.199.60.83 as permitted sender) receiver=protection.outlook.com;
e336be
 client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01;
e336be
Received: from xsj-pvapsmtpgw01 (149.199.60.83) by
e336be
 CY1NAM02FT049.mail.protection.outlook.com (10.152.75.83) with Microsoft SMTP
e336be
 Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1038.3
e336be
 via Frontend Transport; Fri, 3 Aug 2018 17:53:52 +0000
e336be
Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01)
e336be
 by xsj-pvapsmtpgw01 with esmtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGu-0004fe-0k; Fri, 03 Aug 2018 10:53:52 -0700
e336be
Received: from [127.0.0.1] (helo=localhost)
e336be
 by xsj-pvapsmtp01 with smtp (Exim 4.63)
e336be
 (envelope-from <jolly.shah@xilinx.com>)
e336be
 id 1fleGo-0007cn-Tn; Fri, 03 Aug 2018 10:53:46 -0700
e336be
Received: from [172.19.2.91] (helo=xsjjollys50.xilinx.com)
e336be
 by xsj-pvapsmtp01 with esmtp (Exim 4.63)
e336be
 (envelope-from <jollys@xilinx.com>)
e336be
 id 1fleGl-0007bh-UD; Fri, 03 Aug 2018 10:53:43 -0700
e336be
From: Jolly Shah <jolly.shah@xilinx.com>
e336be
To: <ard.biesheuvel@linaro.org>, <mingo@kernel.org>,
e336be
 <gregkh@linuxfoundation.org>, <matt@codeblueprint.co.uk>,
e336be
 <sudeep.holla@arm.com>, <hkallweit1@gmail.com>, <keescook@chromium.org>,
e336be
 <dmitry.torokhov@gmail.com>, <mturquette@baylibre.com>,
e336be
 <sboyd@codeaurora.org>, <michal.simek@xilinx.com>, <robh+dt@kernel.org>,
e336be
 <mark.rutland@arm.com>, <linux-clk@vger.kernel.org>
e336be
Subject: [PATCH v11 11/11] firmware: xilinx: Replace init call with probe
e336be
 method
e336be
Date: Fri, 3 Aug 2018 10:53:28 -0700
e336be
Message-ID: <1533318808-10781-12-git-send-email-jollys@xilinx.com>
e336be
X-Mailer: git-send-email 2.7.4
e336be
In-Reply-To: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
References: <1533318808-10781-1-git-send-email-jollys@xilinx.com>
e336be
X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005
e336be
X-TM-AS-User-Approved-Sender: Yes;Yes
e336be
X-EOPAttributedMessage: 0
e336be
X-MS-Office365-Filtering-HT: Tenant
e336be
X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI;
e336be
 SFV:NSPM;
e336be
 SFS:(10009020)(39860400002)(376002)(346002)(136003)(396003)(2980300002)(438002)(189003)(199004)(81156014)(48376002)(9786002)(5660300001)(107886003)(81166006)(50226002)(106002)(77096007)(16586007)(8676002)(186003)(110136005)(2906002)(6666003)(50466002)(316002)(44832011)(426003)(39060400002)(47776003)(8936002)(478600001)(4326008)(54906003)(486006)(7696005)(336012)(36386004)(11346002)(26005)(126002)(51416003)(476003)(63266004)(106466001)(356003)(76176011)(36756003)(72206003)(446003)(2201001)(305945005)(7416002)(2616005)(107986001)(921003)(1121003);
e336be
 DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR0201MB3512; H:xsj-pvapsmtpgw01; FPR:;
e336be
 SPF:Pass; LANG:en; PTR:unknown-60-83.xilinx.com; MX:1; A:1;
e336be
X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT049;
e336be
 1:Q3IxXRPxJrM39CbL4CERPcH1cxfk1IJkfmcqlkuiAYmyqmzmWXxBSOugUpiPScw3yqROTSsHMBCCLPu2aYih9HcwIVnE9dbiwZv5YTDUkJYU8+bzHCl3ZtAXvefIVJGw
e336be
MIME-Version: 1.0
e336be
X-MS-PublicTrafficType: Email
e336be
X-MS-Office365-Filtering-Correlation-Id: 0045d393-b7d0-410b-a885-08d5f96a13aa
e336be
X-Microsoft-Antispam: BCL:0; PCL:0;
e336be
 RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4608076)(2017052603328)(7153060);
e336be
 SRVR:DM5PR0201MB3512;
e336be
X-Microsoft-Exchange-Diagnostics: 1; DM5PR0201MB3512;
e336be
 3:XuI9a6OU+Wix++X/W4xHpGLHgfrayqtIftW9xwgVabOIZThZL3AJjSrhF8y3EzUe7yPqJVAVf5/1ibvprgN39lOTsOjRab4GJyn/7Z97ZzOjlYMfXcrSu251wFqIhZNFxprkY6nohxGbCqh7PKUq0Hs/1C00Z8XhLT9e03DJC3lYJt8yZV7xJQWsMrheCinyD7wwwswauzy7+DUdIOI6XVrJ0pavF4U9lr3EViPi9G0zq6rcJRLbS1WOOsMafeRsKx5ZFOk4KJxVyoIT+llGcCxEEmzaMAzsFcemh4O0A5HSUSsIefplelPhqq2z1YaRVoGSRr6/aB7SNfKS73qVtMr+DopKEOPgU5qsRlgb1sQ=;
e336be
 25:gysTljDxV5yUd4qWs+8GiPCacf+WxzTD0KkPv8TTXIkE7ENdj7dJZjZJBhUTj8AYYdnBNb+5WbViDUJZeY8ilJ3v5RpNNYmmHqhY3inMp405adRuhVLXPfwkRKzf7jhyagbj7rz7TZ1XXL5bV0epyg/rDKlHOtLXVni5tfzCu/WWdxNsp72B6BBbs/qRTTBA7aA5ucho/Pd0wFKxWO6wJ0OFlugwlcEvI3zHKL7a1/utFp+9UA0H7Ei0smzMOP3jocu6NfwOzWV34VNN7NOfP3xCMbIdv492RcYZXuRzYYNpUZn82+xVIhbj2y6FeyyxSfEpUEzg2/OBHTMREU226w==
e336be
X-MS-TrafficTypeDiagnostic: DM5PR0201MB3512:
e336be
X-Microsoft-Exchange-Diagnostics: 1; DM5PR0201MB3512;
e336be
 31:m+GVFACqJrapL5HOpRPocBLFk4ZbV5+J7il/XZiG+65XMR/Rtw3MZEM+SbgFRX484g5X5xpqQHIQIWEPye4HWKWN9hGB8Wq1J2Mgo27fBSMCLg/jns3IOQs29Ey1MyrBbEH84gv4FDRrYxY2gRrrWmlJyp2sGGGeNFY5bvW1IF6Xq//ZXgCV/D+EjKhIu+EJa17PSlyuKufhhGr9XJJ9jSU+/EG4CkcRVlEbPZOp/sM=;
e336be
 20:cL3VcjGdsjeFPiv/AalGXMQBhvGzW7f7pePV/oAYht9i2zTvTVGUMehKQUojvGmXd3c3IhRlaIVMwVWu669YzdEfaQbY0/VlNo4LEhZC2sDV3R4zXCCkPI5DnY+Okxf8xbrtvVsdmbf28ekzWC71QXKC5tMgecldR2biwrPxpkB9/MvWolJLcgep6v2waxW5E4XfsZCRZANWW9HjaScIBT/MGJqMzg4mUxuqmrRTlsv7xaMEAebxDDKT1thUAVR0WIfuhOOApMlZsNTKDgm5870gC8dS8swG4Fr9VYzApkYL6a50LxMhVVZkBXXJpmKwzYPYzV/ay7HAn6Em9uL7We7EQW/dEJHubnh4+j5zQYMlyNBU7ZI3gHPvV3SKBbSRlzeAOJosWvzQWVhhivYbGTWaHoTHP+JbVCGArx4d68zIG5DOBtPPIE4BZsKeaJ8U2xhohSCtyaZSMgh+OqQpD4WLzceDlvJW9A2LXUxQolDkem7TQC8p0I4DgEGMR0R6
e336be
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
e336be
X-Microsoft-Antispam-PRVS: 
e336be
 <DM5PR0201MB3512F241C094A9CBED8F2272B8230@DM5PR0201MB3512.namprd02.prod.outlook.com>
e336be
X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592);
e336be
X-MS-Exchange-SenderADCheck: 1
e336be
X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0;
e336be
 RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93004095)(10201501046)(3231311)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011)(7699016);
e336be
 SRVR:DM5PR0201MB3512; BCL:0; PCL:0; RULEID:; SRVR:DM5PR0201MB3512;
e336be
X-Microsoft-Exchange-Diagnostics: 1; DM5PR0201MB3512;
e336be
 4:0l/Jv9e1lvDhvWIGk/ia9KFrX1twnlhZ76AohX/jm3f6Xh9XFgZ2S7wMJt+nvRd/Ib5wPCNU/Qzz3nbyWCEUi/8bw3uJWshcREy2YMtOZNnN36vgS671yuWxEg1ACQnNfVlyJ+Qe4NXX+rXbEwOGiTsWdEKW+DND2tEvmsPYppLg+BS1j+2PmKZr9UAM2Dknm9gMq45UsN2bW9Tg1ARkd0sE0josKC+LmsRUwjkLuMf34CIshUL7/IV+xRrAEXBXgOgIh/+CVFCCqu4HGnZZPT0itExttJGvC9kUvXoMtjJTX9PoLd+IvrotXSa8glKK5YnIZ2RHLtVc2cz+tFNr3w==
e336be
X-Forefront-PRVS: 0753EA505A
e336be
X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR0201MB3512;
e336be
 23:omq/hhH3pNMVCBhAnCz9tF3e7JVKzbi18jEm/z8?=
e336be
 jIlLu6OT02UXNvQtzoR9LV7LHHvsEOjGFylznycJXeBY1UI7JqCJhWyR/s5yrVPPfHiNTEGq3El2JgFhnwy23zXyPabYWUQ6cQhu9bwc3rxGYpdF/PSbfIDLgxb1yce/Kt4G1GWIhPo5ag/87tDYzJBQz5FllJEm3aqIB87riGEjWMxR+5Uq2YXz8wBfb4R/6Ieu4JGmmB68MMYYUWkbLbcT8ntvMRaH/GJoJjvEnARtXiq+rK07a9aXF9ef5oSfxDTJ6t1ivD1n65ELnPN4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iHNAkFI+fm/5xu/lL5KiAVAY4N1EGCHwcDfh2nDcdX2BlZJ0HW6cyHbEKCeaEPwxm4p4lN6EFrDVIDcQLIanqJnMC79O+dPlAQlwQwpo8m6zq8fZuO3IppSFtaDd7E36BxkwQlFPz/mZbfwcjm2m4U2HROhb44cloqPMsKI
e336be
SpamDiagnosticOutput: 1:99
e336be
SpamDiagnosticMetadata: NSPM
e336be
X-OriginatorOrg: xilinx.com
e336be
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2018 17:53:52.5062 (UTC)
e336be
X-MS-Exchange-CrossTenant-Network-Message-Id: 
e336be
 0045d393-b7d0-410b-a885-08d5f96a13aa
e336be
X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c
e336be
X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: 
e336be
 TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83];
e336be
 Helo=[xsj-pvapsmtpgw01]
e336be
X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem
e336be
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR0201MB3512
e336be
X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 
e336be
X-CRM114-CacheID: sfid-20180803_105414_775993_0E20A85F 
e336be
X-CRM114-Status: GOOD (  12.18  )
e336be
X-BeenThere: linux-arm-kernel@lists.infradead.org
e336be
X-Mailman-Version: 2.1.21
e336be
Precedence: list
e336be
List-Id: <linux-arm-kernel.lists.infradead.org>
e336be
List-Unsubscribe: 
e336be
 <http://lists.infradead.org/mailman/options/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe>
e336be
List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/>
e336be
List-Post: <mailto:linux-arm-kernel@lists.infradead.org>
e336be
List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help>
e336be
List-Subscribe: 
e336be
 <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>,
e336be
 <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe>
e336be
Cc: devicetree@vger.kernel.org, Rajan Vaja <rajan.vaja@xilinx.com>,
e336be
 linux-kernel@vger.kernel.org, Jolly Shah <jollys@xilinx.com>,
e336be
 rajanv@xilinx.com, linux-arm-kernel@lists.infradead.org
e336be
Content-Type: text/plain; charset="us-ascii"
e336be
Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org>
e336be
Errors-To: 
e336be
 linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org
e336be
X-Virus-Scanned: ClamAV using ClamSMTP
e336be
e336be
From: Rajan Vaja <rajan.vaja@xilinx.com>
e336be
e336be
As of all of child of ZynqMP firmware are platform
e336be
driver, there is no need of init call in firmware
e336be
driver. Earlier clock driver was init method so
e336be
firmware driver had to use init call to make sure
e336be
firmware init is done in early stage.
e336be
e336be
Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
e336be
Signed-off-by: Jolly Shah <jollys@xilinx.com>
e336be
---
e336be
 drivers/firmware/xilinx/zynqmp.c | 63 ++++++++++++----------------------------
e336be
 1 file changed, 18 insertions(+), 45 deletions(-)
e336be
e336be
diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
e336be
index 7ccedf0..ce6c746 100644
e336be
--- a/drivers/firmware/xilinx/zynqmp.c
e336be
+++ b/drivers/firmware/xilinx/zynqmp.c
e336be
@@ -476,50 +476,17 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_get_eemi_ops);
e336be
 static int zynqmp_firmware_probe(struct platform_device *pdev)
e336be
 {
e336be
 	struct device *dev = &pdev->dev;
e336be
-
e336be
-	return of_platform_populate(dev->of_node, NULL, NULL, dev);
e336be
-}
e336be
-
e336be
-static const struct of_device_id zynqmp_firmware_of_match[] = {
e336be
-	{.compatible = "xlnx,zynqmp-firmware"},
e336be
-	{},
e336be
-};
e336be
-MODULE_DEVICE_TABLE(of, zynqmp_firmware_of_match);
e336be
-
e336be
-static struct platform_driver zynqmp_firmware_driver = {
e336be
-	.driver = {
e336be
-		.name = "zynqmp_firmware",
e336be
-		.of_match_table = zynqmp_firmware_of_match,
e336be
-	},
e336be
-	.probe = zynqmp_firmware_probe,
e336be
-};
e336be
-module_platform_driver(zynqmp_firmware_driver);
e336be
-
e336be
-static int __init zynqmp_plat_init(void)
e336be
-{
e336be
-	int ret;
e336be
 	struct device_node *np;
e336be
+	int ret;
e336be
 
e336be
 	np = of_find_compatible_node(NULL, NULL, "xlnx,zynqmp");
e336be
 	if (!np)
e336be
 		return 0;
e336be
 	of_node_put(np);
e336be
 
e336be
-	/*
e336be
-	 * We're running on a ZynqMP machine,
e336be
-	 * the zynqmp-firmware node is mandatory.
e336be
-	 */
e336be
-	np = of_find_compatible_node(NULL, NULL, "xlnx,zynqmp-firmware");
e336be
-	if (!np) {
e336be
-		pr_warn("%s: zynqmp-firmware node not found\n", __func__);
e336be
-		return -ENXIO;
e336be
-	}
e336be
-
e336be
-	ret = get_set_conduit_method(np);
e336be
-	if (ret) {
e336be
-		of_node_put(np);
e336be
+	ret = get_set_conduit_method(dev->of_node);
e336be
+	if (ret)
e336be
 		return ret;
e336be
-	}
e336be
 
e336be
 	/* Check PM API version number */
e336be
 	zynqmp_pm_get_api_version(&pm_api_version);
e336be
@@ -547,16 +514,22 @@ static int __init zynqmp_plat_init(void)
e336be
 	pr_info("%s Trustzone version v%d.%d\n", __func__,
e336be
 		pm_tz_version >> 16, pm_tz_version & 0xFFFF);
e336be
 
e336be
-	of_node_put(np);
e336be
+	zynqmp_pm_api_debugfs_init();
e336be
 
e336be
-	return ret;
e336be
+	return of_platform_populate(dev->of_node, NULL, NULL, dev);
e336be
 }
e336be
-early_initcall(zynqmp_plat_init);
e336be
 
e336be
-static int zynqmp_firmware_init(void)
e336be
-{
e336be
-	zynqmp_pm_api_debugfs_init();
e336be
+static const struct of_device_id zynqmp_firmware_of_match[] = {
e336be
+	{.compatible = "xlnx,zynqmp-firmware"},
e336be
+	{},
e336be
+};
e336be
+MODULE_DEVICE_TABLE(of, zynqmp_firmware_of_match);
e336be
 
e336be
-	return 0;
e336be
-}
e336be
-device_initcall(zynqmp_firmware_init);
e336be
+static struct platform_driver zynqmp_firmware_driver = {
e336be
+	.driver = {
e336be
+		.name = "zynqmp_firmware",
e336be
+		.of_match_table = zynqmp_firmware_of_match,
e336be
+	},
e336be
+	.probe = zynqmp_firmware_probe,
e336be
+};
e336be
+module_platform_driver(zynqmp_firmware_driver);