From patchwork Thu Oct 25 07:32:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nava kishore Manne X-Patchwork-Id: 10654281 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3667B13B5 for ; Wed, 24 Oct 2018 07:34:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1C5D429D24 for ; Wed, 24 Oct 2018 07:34:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 105EE2A6C0; Wed, 24 Oct 2018 07:34:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.7 required=2.0 tests=BAYES_00,DATE_IN_FUTURE_12_24, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7931A29D24 for ; Wed, 24 Oct 2018 07:34:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729343AbeJXQB2 (ORCPT ); Wed, 24 Oct 2018 12:01:28 -0400 Received: from mail-eopbgr700074.outbound.protection.outlook.com ([40.107.70.74]:60136 "EHLO NAM04-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729323AbeJXQB2 (ORCPT ); Wed, 24 Oct 2018 12:01:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=p8KLbxKIuDkbxFdNGxkvQE5ttGBQaL9mOkFhFsBaTdA=; b=GM4T7jbSzfC33lUt90bPpvRedmjb1VlCttArmXcwJGLdYQMJTKpQCCCfcgDopxubddqKtYSJakn/W88hIpThwBZbBSEXWKbjG3iyHu0P/mFQER8EdfLVuJel5pz8f8eEWeMcNKS0Syfa64jeqKGApGsch+PllS4l4ZHaxd0r4N8= Received: from CY4PR02CA0014.namprd02.prod.outlook.com (10.169.188.24) by DM5SPR01MB338.namprd02.prod.outlook.com (10.174.243.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.29; Wed, 24 Oct 2018 07:34:32 +0000 Received: from CY1NAM02FT038.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::204) by CY4PR02CA0014.outlook.office365.com (2603:10b6:903:18::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.29 via Frontend Transport; Wed, 24 Oct 2018 07:34:31 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT038.mail.protection.outlook.com (10.152.74.217) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1273.13 via Frontend Transport; Wed, 24 Oct 2018 07:34:30 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:56951 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1gFDgU-0004Oi-76; Wed, 24 Oct 2018 00:34:30 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1gFDgP-0005xY-2O; Wed, 24 Oct 2018 00:34:25 -0700 Received: from xsj-pvapsmtp01 (mailhost.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w9O7YJEu021799; Wed, 24 Oct 2018 00:34:19 -0700 Received: from [172.23.37.118] (helo=xhdnavam40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1gFDgI-0005vF-MP; Wed, 24 Oct 2018 00:34:19 -0700 From: Nava kishore Manne To: , , , , , , , , , , , , Subject: [PATCH v2 1/3] firmware: xilinx: Add fpga API's Date: Thu, 25 Oct 2018 13:02:04 +0530 Message-ID: <20181025073206.9264-2-nava.manne@xilinx.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181025073206.9264-1-nava.manne@xilinx.com> References: <20181025073206.9264-1-nava.manne@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(376002)(39860400002)(136003)(346002)(396003)(2980300002)(438002)(199004)(189003)(106466001)(14444005)(316002)(76176011)(8936002)(16586007)(478600001)(110136005)(9786002)(63266004)(36386004)(305945005)(50226002)(106002)(1076002)(966005)(486006)(26005)(81166006)(2906002)(8676002)(36756003)(48376002)(50466002)(446003)(2616005)(126002)(81156014)(47776003)(476003)(77096007)(6306002)(186003)(356004)(51416003)(7696005)(11346002)(5660300001)(39060400002)(6666004)(2201001)(426003)(336012)(921003)(107986001)(83996005)(2101003)(1121003)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5SPR01MB338;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;CY1NAM02FT038;1:vIX2a9NBtq32JoOCbfPAeQVnTpSf4XvKAe0uGUvBjCKiyXTbwvrADQ3NBSI0IAIDzog87Mb4XI+E9QZvJvWUjiw89t+nwDYsFzI5+Dfn0I7QwOzIA5ZMh/JbVHq/cqbU MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f5745d8d-4771-4065-0b0a-08d63983235a X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM5SPR01MB338; X-Microsoft-Exchange-Diagnostics: 1;DM5SPR01MB338;3:TVdszovouhtxSdaRMXr/j7RWfobuIlBm2V8wSzdBniWMLsPLNvGvYojPjb6KlHqHoOq+iJFkCgtLviHrtpDQrqvurE7tCBZaDCV+LCEOCQXngHATWukwCxRfUXMBBDQCYy9oXg8LaVSx1bw9+eTj+SZpSli6INqfhCDeeW3+9vYV7Fx0365Jz3zST26rN/2D6xfEwpoW79KcjxSH54pxkXAplKfamqadXGeTmUHx2NzmDI57YvQWU8eye0wGlX7EnOWjWWjdvk4XiZNyfYJzeInNGXWCUMZK7cLeBgfxuXgTBQiNiFw0qBgdsRpNGYK0JH1pccOznJql6b5QPX+kZz07ceBU+VMthHgZx1uJP94=;25:lSTGTzQDq+0vo1bBMyAsc2qe+30tcEyBU4L62NVj7LdaTw/L5cwBI0eXtD9sz9UNKEdvuexhFeoMR1D5PdorOzmq0UE0g6y/2651GeXUQZhdo3SEKy0lnplbn9bHtkrR6paDDjAgNxbw9g76vMVgx5u13oTPm8qprJJm135mIhP47tSRS7WZ5mvMMViKpJ0Ogac2sdVP4LqH0CtxDftuyDVLlBi4IwwYfdev+Pc8q9xjFxx2L7td0hI3iOM6M5mVVuWPwJ2PJ93ijktR6QpuSNsZtcIcSG5Huw+bgQrR3iuc88cWx/V7RaYVxj233r8yvfpSgl+Tp5AsuuVtJnV+FQ== X-MS-TrafficTypeDiagnostic: DM5SPR01MB338: X-Microsoft-Exchange-Diagnostics: 1;DM5SPR01MB338;31:H0HeJOYI3XCN+cUKz1F+m6SpULwjYPTT5PC40vtFlPRd9m9ojz72nzlun+wt2JGoitmxfXiReMWz0ct7p5qMMceiYxfrfIN8+0V5IMsGSQV7sdXbmtRYUrROMoSpxqprQEL7RWf0ZU2+gHijw6PpzUO6YpAegr0C0p42tswMZLQ52LHfBVgs7HzC+mZQsli2njRUoguLF+6OgyezH4ifvFtOXhHAH8iBfZK9r4qAq2o=;20:JoxxDUhHkRntYtAiWHJkUSl1C7zyPzwcckVlzqJ7Sh5RJVGT1pjpdX7F4AS0kAHJlNWXchZm5GhqjLcjUkA7RHf0wLT+C+nsgqTdlSA/P++0vBmUMOgI+Ndg48G7pJ2dtOCgL9+ZxLj7o+xvWpJNN8ky0wVjVvDSaImgkbc+JoKRhl8QnwgBcebsKD5FfG7hrQgXbwIX2Q4nXZ/LtNUAWRFfBNF/JSXGais2XbK0PzM36yHTOkyCDfwptX0Q6cTH/lJQ2ZNdZdON9jKNWZ7ZIzlSlA7gtuEmzn5Lw+EXg06Z8jee+Szvrbyy34MPW9lEXi+Jh9ZziXgGwrw+rziLk8539BxB7KiKQHSriD3rzvOgrnsUwX6uEONKm3slDLsLFSNXU4BFSHTC98RrKbs47cvn5HNqy1dDQnz/lVeDBgBvn/m5dcwA6z5l27cr6pTM8vOVTiobHxWrPc19x7PyiMWIwGXmIFrQg9ulzBsxaj+17Y2c5jEHowYqZ1Mb57c5 X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592)(84791874153150); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(93004095)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:DM5SPR01MB338;BCL:0;PCL:0;RULEID:;SRVR:DM5SPR01MB338; X-Microsoft-Exchange-Diagnostics: 1;DM5SPR01MB338;4:Ljk30I1PCFMAoMjO6YdwPDeo425ViVy1aqEnVsKwcSlmEGqJ5zaAakeuCrGVkES/NajxbxJCaVhF/72p+zqWjFKlNeJR0JQBaIDMmfFmDsRb+ZHKUMyF/s16FWCA/IOB2nAbbWjkfBeAcKPtMjGVAW7ZHgzSZhFY0ycl3hoOyrbYt/RI5tfpAdDcQGstoQt/bD5Zu84kEjU/RiMzbH/brIIkQXhJ/vvqavVvt0It44IgJv7Zor+dqJu+IPtQSH2YdEB8ce5woSd5qw2qLVnWQ3iWPKSjYx1ixmMYfmIMWOoF7Pv4BD9BOIsCQ9a28aOijyNm41eGmWHBCcg2yiWjo+RhWiEpsAuz7JBP+YTaBKE= X-Forefront-PRVS: 083526BF8A X-Microsoft-Exchange-Diagnostics: 1;DM5SPR01MB338;23:6jPh98Xkscm0XeISzdF0HNCfklUIGfxoyKGvTPuhGphYC6AIXOiGHQmKQNssDZgmr5diy/k46Q7TN1t4Yos4Rxd9UwE3Dbl1+O5J9ezxh4+kBPAOqsdEAjztXGvkG29jdflu8i2LtdxWVtsVNC5Ae8Nu4g+pCMqI40KzzIWA8HfyTzHvXcvKh6tmoZ4g3seKeZBNu8HySxYo4BuLoK27TAdBA4rACfe7l5iYzDAEBbfZ2sFO9ra+BW4A5KLYaeLO4i2rHfuV59QHFrudb/N+HWYiMl77U5XdRbdxbgJrs43K5gJ6WhKNE++LnYVdG0EztpD5vtuJPKUqsuramRu67a63H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UpnsNB/Rdt+9qF0PGFh2zBPbr0FchVSNFkn+etOsc32fohOuhzMYIrcQZKiwiH5AbHgy2CnEyZfw/9t4RuOn+Uiy5uCbgqod9diN+ij4vh SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2018 07:34:30.9231 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f5745d8d-4771-4065-0b0a-08d63983235a X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5SPR01MB338 Sender: linux-fpga-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This Patch Adds fpga API's to support the Bitstream loading by using firmware interface. Signed-off-by: Nava kishore Manne --- This patch depends on the below series of patches https://lkml.org/lkml/2018/9/12/983 Which is got integrated into the below upstream repo. https://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git/tree/drivers/firmware/xilinx?h=for-next Changes for v2: -Added Firmware FPGA Manager flags As suggested by Moritz. Changes for v1: -None. Changes for RFC-V2: -New Patch. drivers/firmware/xilinx/zynqmp.c | 46 ++++++++++++++++++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 12 ++++++++ 2 files changed, 58 insertions(+) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 84b3fd2eca8b..4a5919448198 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -428,6 +428,50 @@ static int zynqmp_pm_clock_getparent(u32 clock_id, u32 *parent_id) return ret; } +/** + * zynqmp_pm_fpga_load - Perform the fpga load + * @address: Address to write to + * @size: pl bitstream size + * @flags: + * BIT(0) - Bit-stream type. + * 0 - Full Bitstream. + * 1 - Partial Bitstream. + * + * This function provides access to pmufw. To transfer + * the required bitstream into PL. + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_fpga_load(const u64 address, const u32 size, + const u32 flags) +{ + return zynqmp_pm_invoke_fn(PM_FPGA_LOAD, lower_32_bits(address), + upper_32_bits(address), size, flags, NULL); +} + +/** + * zynqmp_pm_fpga_get_status - Read value from PCAP status register + * @value: Value to read + * + * This function provides access to the xilfpga library to get + * the PCAP status + * + * Return: Returns status, either success or error+reason + */ +static int zynqmp_pm_fpga_get_status(u32 *value) +{ + u32 ret_payload[PAYLOAD_ARG_CNT]; + int ret; + + if (!value) + return -EINVAL; + + ret = zynqmp_pm_invoke_fn(PM_FPGA_GET_STATUS, 0, 0, 0, 0, ret_payload); + *value = ret_payload[1]; + + return ret; +} + static const struct zynqmp_eemi_ops eemi_ops = { .get_api_version = zynqmp_pm_get_api_version, .query_data = zynqmp_pm_query_data, @@ -440,6 +484,8 @@ static const struct zynqmp_eemi_ops eemi_ops = { .clock_getrate = zynqmp_pm_clock_getrate, .clock_setparent = zynqmp_pm_clock_setparent, .clock_getparent = zynqmp_pm_clock_getparent, + .fpga_load = zynqmp_pm_fpga_load, + .fpga_get_status = zynqmp_pm_fpga_get_status, }; /** diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 015e130431e6..0f900b48e1be 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -32,8 +32,18 @@ /* Number of 32bits values in payload */ #define PAYLOAD_ARG_CNT 4U +/* + * Firmware FPGA Manager flags + * XILINX_ZYNQMP_PM_FPGA_PARTIAL: FPGA partial reconfiguration + */ +#define XILINX_ZYNQMP_PM_FPGA_PARTIAL BIT(0) + + + enum pm_api_id { PM_GET_API_VERSION = 1, + PM_FPGA_LOAD = 22, + PM_FPGA_GET_STATUS, PM_QUERY_DATA = 35, PM_CLOCK_ENABLE, PM_CLOCK_DISABLE, @@ -89,6 +99,8 @@ struct zynqmp_pm_query_data { struct zynqmp_eemi_ops { int (*get_api_version)(u32 *version); + int (*fpga_load)(const u64 address, const u32 size, const u32 flags); + int (*fpga_get_status)(u32 *value); int (*query_data)(struct zynqmp_pm_query_data qdata, u32 *out); int (*clock_enable)(u32 clock_id); int (*clock_disable)(u32 clock_id); From patchwork Thu Oct 25 07:32:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nava kishore Manne X-Patchwork-Id: 10654283 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8AD5114BB for ; Wed, 24 Oct 2018 07:34:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 701C22A6BD for ; Wed, 24 Oct 2018 07:34:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5E98329D24; Wed, 24 Oct 2018 07:34:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.7 required=2.0 tests=BAYES_00,DATE_IN_FUTURE_12_24, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDD0429D24 for ; Wed, 24 Oct 2018 07:34:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729404AbeJXQBo (ORCPT ); Wed, 24 Oct 2018 12:01:44 -0400 Received: from mail-cys01nam02on0087.outbound.protection.outlook.com ([104.47.37.87]:44064 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729394AbeJXQBn (ORCPT ); Wed, 24 Oct 2018 12:01:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aQjIxvU5oavkHjKt6+zhbdpEdMfLfESSegmi1vwdgdk=; b=zfZeV+p/YHmSkDsenxFpQP/PvTaDve7U4qN1USVdlN2ae0rls6AK23GHr2+mytXa01JzN/Qq9u+U20aT4+675fhJFKxNKs5CU0qxZI+E2lbrtCLyAAlVVwWXR5fkFo4Gs8CTsg7NfttKKQtfOPD1ULNEIOctinXHtEQdk6/2RXc= Received: from MWHPR0201CA0098.namprd02.prod.outlook.com (2603:10b6:301:75::39) by SN4PR0201MB3519.namprd02.prod.outlook.com (2603:10b6:803:44::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.30; Wed, 24 Oct 2018 07:34:45 +0000 Received: from BL2NAM02FT046.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::204) by MWHPR0201CA0098.outlook.office365.com (2603:10b6:301:75::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.18 via Frontend Transport; Wed, 24 Oct 2018 07:34:45 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by BL2NAM02FT046.mail.protection.outlook.com (10.152.76.118) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1273.13 via Frontend Transport; Wed, 24 Oct 2018 07:34:41 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:57066 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1gFDge-0004Op-CB; Wed, 24 Oct 2018 00:34:40 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1gFDgZ-0005zV-89; Wed, 24 Oct 2018 00:34:35 -0700 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w9O7YPF3009493; Wed, 24 Oct 2018 00:34:25 -0700 Received: from [172.23.37.118] (helo=xhdnavam40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1gFDgP-0005vF-2c; Wed, 24 Oct 2018 00:34:25 -0700 From: Nava kishore Manne To: , , , , , , , , , , , , Subject: [PATCH v2 2/3] dt-bindings: fpga: Add bindings for ZynqMP fpga driver Date: Thu, 25 Oct 2018 13:02:05 +0530 Message-ID: <20181025073206.9264-3-nava.manne@xilinx.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181025073206.9264-1-nava.manne@xilinx.com> References: <20181025073206.9264-1-nava.manne@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(396003)(346002)(39860400002)(136003)(376002)(2980300002)(438002)(189003)(199004)(39060400002)(47776003)(9786002)(478600001)(106002)(7696005)(356004)(36386004)(305945005)(106466001)(63266004)(50466002)(76176011)(476003)(51416003)(36756003)(126002)(11346002)(16586007)(316002)(77096007)(5660300001)(110136005)(446003)(2616005)(81156014)(186003)(426003)(336012)(8676002)(8936002)(81166006)(6666004)(486006)(1076002)(48376002)(2201001)(50226002)(2906002)(26005)(107986001)(921003)(5001870100001)(1121003)(83996005)(2101003);DIR:OUT;SFP:1101;SCL:1;SRVR:SN4PR0201MB3519;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BL2NAM02FT046;1:xVW6ZQTHOsxXvMBSXFb4sJbqJJeG8i09NwSZZYxf1tAkGkJVCfyfAv2WsVjCTAdf1Aaky1KA5PVcT3YN890a5/xt3dN5L8twqrTFr67jAGwADCi4bnnbM4ID4/Ivpf65 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f3479e28-2580-4dd3-e6af-08d639832b17 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4608076)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060);SRVR:SN4PR0201MB3519; X-Microsoft-Exchange-Diagnostics: 1;SN4PR0201MB3519;3:HQXCvNRDquQdCFUJK1721SqNCbw01n/SkyJ2E1C1Ydb61/xJc7xzx8qJEYjFt3IHBX1plv9nAK0svAjiHIrLB0rexlAIOBQwuOK4UWVzJJXhy8Bt2f4e/jJR4MoI7YqYShL8d8OnQGtqutqZoHHxuuQWZgI6/IfAoCE3nhNHEmeLSQQYVGu4+OeJ1JdP941OgbICczX1YzmBZBcYKzGwnS/vHEN9zLurQSlRyGMVkA5yrEljYpSJV/i6f8Blr0k+mYBiGhE2euHz6Sjeh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kyU+KLl6Uab/SC98ioAmDicFL7v2iSePp0EfkTXixcRC06oe/eAE6nt+JQqhHSRr9N8pGORE3wZ4mYHDaBFQoKvsrFHNqhWV2p2hOdoK4iYFKm8+ny/1IC/++ClgUAqUohjEH+ZAEISu2K39/CO4N7tcWxsfMhUEn06sH94o+L1lfOVFxKg+Awjkj X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93004095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123558120)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:SN4PR0201MB3519;BCL:0;PCL:0;RULEID:;SRVR:SN4PR0201MB3519; X-Microsoft-Exchange-Diagnostics: 1;SN4PR0201MB3519;4:C3GCc7IA5uAZfDHk9/GKlmz2xxyh1MFWn1KGuhFau3L3Yjdd5RpZXNW8q6q/n2IRCH1p+iWpTYW7KjnsrdBqzxOW1RUABN4YSY6GJKFwz7J+Ah02831q954Tsz1OsHeSFPtwzBbTlG0bmEskpjskMZqFmUsFXiJXQPP4C8bvF730UQ1aEnyRHmCR6wflevZFe2evfohxAcHsq9byHNSnToD7Lt+lIR+i3qZMpJGmD5QTKdbUnoTLy2spwnqLT4upK2xyy9cJYJt2mauzAlzpRvALDU4+CB2KrNDvHUXuaLR1ZJtCwrx578tt3W0WPHdT X-Forefront-PRVS: 083526BF8A X-Microsoft-Exchange-Diagnostics: 1;SN4PR0201MB3519;23:DYnaNEwj7o3NTyT4/RPYc+wdk6CgjhUViqAgJ1WwSg3v5fqW4MmDXTQU7BoDGi/TaOnQJIZZ1d9k1y+ju/EPxVQnq5mMS4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hjAfwZm1nQbw6arekzBOix+1eS66AJ8wVo7FVf21S/CY7HlidG6zNCU7EY=;7:lqkSYRBKiSPTGuGiDzJTYhdKGXrLg7kCn1EFJ5zglSm+AZad+WwFFFhDfF5DD668utsRU9bkCTAo72eaupOzao/8RQtuRzzm1deFGTKwhGntVp4GxhU3P1CyH7ht7riEZTHfeOgDyOcyGiJkVPuaMM47tnuIaZx4hSxJuDHbRdLE7l6j7hgwPkRdrHSRVqlVUCOf1WdloLPNxvsVoFi83fTn9D77CjWlTpVDx2eIV0Dq3+61oBCN6P40bU9Ixqsf SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2018 07:34:41.2238 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f3479e28-2580-4dd3-e6af-08d639832b17 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0201MB3519 Sender: linux-fpga-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add documentation to describe Xilinx ZynqMP fpga driver bindings. Signed-off-by: Nava kishore Manne --- Changes for v2: -Removed "----" separators. Changes for v1: -Created a Seperate(New) DT binding file as suggested by Rob. Changes for RFC-V2: -Moved pcap node as a child to firwmare node as suggested by Rob. .../bindings/fpga/xlnx,zynqmp-pcap-fpga.txt | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Documentation/devicetree/bindings/fpga/xlnx,zynqmp-pcap-fpga.txt diff --git a/Documentation/devicetree/bindings/fpga/xlnx,zynqmp-pcap-fpga.txt b/Documentation/devicetree/bindings/fpga/xlnx,zynqmp-pcap-fpga.txt new file mode 100644 index 000000000000..1f6f58872311 --- /dev/null +++ b/Documentation/devicetree/bindings/fpga/xlnx,zynqmp-pcap-fpga.txt @@ -0,0 +1,13 @@ +Device Tree zynqmp-fpga bindings for the Zynq Ultrascale+ MPSoC controlled +using ZynqMP SoC firmware interface +For Bitstream configuration on ZynqMp Soc uses processor configuration +port(PCAP) to configure the programmable logic(PL) through PS by using +FW interface. + +Required properties: +- compatible: should contain "xlnx,zynqmp-pcap-fpga" + +Example: + zynqmp_pcap: pcap { + compatible = "xlnx,zynqmp-pcap-fpga"; + }; From patchwork Thu Oct 25 07:32:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nava kishore Manne X-Patchwork-Id: 10654285 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DCCA513B5 for ; Wed, 24 Oct 2018 07:35:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2D752A6BD for ; Wed, 24 Oct 2018 07:35:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6C132A6C6; Wed, 24 Oct 2018 07:35:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.7 required=2.0 tests=BAYES_00,DATE_IN_FUTURE_12_24, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1FA42A6BD for ; Wed, 24 Oct 2018 07:34:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729427AbeJXQBq (ORCPT ); Wed, 24 Oct 2018 12:01:46 -0400 Received: from mail-eopbgr710061.outbound.protection.outlook.com ([40.107.71.61]:37683 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729390AbeJXQBp (ORCPT ); Wed, 24 Oct 2018 12:01:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=C+HJL9M9zfeZdH2J17YFpkrfwU5G+gLlhXS5AWmGOuY=; b=tpTe0/pvenvFFLwp5CK/BdnLn8qAshywjXhMOKjFhOk5Z9DpjWDAyJ9n9IE+Us3O1o+tDM0tdvFmzcncvlRBQvx/oDCwbfcc1IT9FMR1TpnomNkvBuTpkTzavXopveRFDAq6xNkqqXn1nhp7vn2u92i4zCfulKsexlIbtT5CyYM= Received: from MWHPR0201CA0045.namprd02.prod.outlook.com (2603:10b6:301:73::22) by DM6PR02MB4457.namprd02.prod.outlook.com (2603:10b6:5:29::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.24; Wed, 24 Oct 2018 07:34:44 +0000 Received: from BL2NAM02FT026.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::206) by MWHPR0201CA0045.outlook.office365.com (2603:10b6:301:73::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.18 via Frontend Transport; Wed, 24 Oct 2018 07:34:44 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by BL2NAM02FT026.mail.protection.outlook.com (10.152.77.156) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1273.13 via Frontend Transport; Wed, 24 Oct 2018 07:34:41 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:57074 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1gFDge-0004Oq-FI; Wed, 24 Oct 2018 00:34:40 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1gFDgZ-0005zV-BG; Wed, 24 Oct 2018 00:34:35 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w9O7YW0S009512; Wed, 24 Oct 2018 00:34:32 -0700 Received: from [172.23.37.118] (helo=xhdnavam40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1gFDgW-0005vF-01; Wed, 24 Oct 2018 00:34:32 -0700 From: Nava kishore Manne To: , , , , , , , , , , , , Subject: [PATCH v2 3/3] fpga manager: Adding FPGA Manager support for Xilinx zynqmp Date: Thu, 25 Oct 2018 13:02:06 +0530 Message-ID: <20181025073206.9264-4-nava.manne@xilinx.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181025073206.9264-1-nava.manne@xilinx.com> References: <20181025073206.9264-1-nava.manne@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(396003)(376002)(39860400002)(136003)(346002)(2980300002)(438002)(189003)(199004)(51416003)(16586007)(5660300001)(476003)(76176011)(478600001)(446003)(106466001)(106002)(1076002)(7696005)(6666004)(36756003)(110136005)(316002)(486006)(305945005)(47776003)(2616005)(77096007)(426003)(50466002)(8676002)(186003)(356004)(9786002)(2906002)(11346002)(48376002)(81166006)(39060400002)(126002)(8936002)(36386004)(26005)(81156014)(50226002)(336012)(63266004)(2201001)(921003)(107986001)(2101003)(1121003)(83996005)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR02MB4457;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;LANG:en;PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BL2NAM02FT026;1:0jgoAXtIjuvHyu6ZxHLuX8CtuiL3GgRqcVl7fvS6X5XJ3eOuuxImqZBiqX5OZsr8QHCtlRt350aMDtP/vncCvv8qfYpj1UMkaIYEMNw5mpGgHleWsGO4O/GUhEoekCTa MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3dff3600-0f83-41a3-cd6a-08d639832aa8 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4608076)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060);SRVR:DM6PR02MB4457; X-Microsoft-Exchange-Diagnostics: 1;DM6PR02MB4457;3:jKyBoj3UJCO1SR+wV5k3iubYdmRF3hcl6EmwObBKeg+olOglNTB3lD0V6Y2dAye4TBIiBAOheeeYwkCA1kC2fKrmQZVfnuB+YrP8R0RyuH8Mq0bL0ho/gTOb+UllUapcnevyCFXlMHiOektHX33McIqDEFukbTGz+7g4qC+0Z26g7dWypH1UvUqO9GdiBmzIxsm2hMY5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IdbH9oEGIUMZ3/SuyrgWYhrBPBeVCkeBwe5FQ+jepQJlBDrZQrvhwHyS6OaTTyCxiqwZbvwYdCd+HtFgFSkGpmvPOrOq3NOqU7CkJrJ49rhwqQgnC0HSvq18JFXaPTYeivQo6cWXY1n830YSKETfILk5NOzS+5byYgKYSiqLCw9tPJS3muqmUtF1m3c33p6wXohE7n7i525SxE7lu7E/t3qYZOVoKCVxWqWJMMKdM/JCMOvfsAiy1ZAwwmBJEfSQ X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93004095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(201708071742011)(7699051)(76991095);SRVR:DM6PR02MB4457;BCL:0;PCL:0;RULEID:;SRVR:DM6PR02MB4457; X-Microsoft-Exchange-Diagnostics: 1;DM6PR02MB4457;4:RFElxM56aGZM6LHdbxKw6nPzriRB7Wq9pjdwGH7Rwqlzvdhj6L4toCyiru8yP/1jBgaWQTLI/0drsr8JgBttjPjZp16l68L3pGaQiK5V43K9MO8G8jn3mNmWbkNVmJqBiMVarpJsFaNdEQNiquI5zKgYCftZvNg1L1Qy2Hp1ADCkakhzBYFWFlSS4wyFiT3MaHBiZS2KVz0H/gq/8Xy9vcoGAIlGDIjF/nEetR0w3Gf5b+3jlh8l1iKCZHTpv75ptV0qwdSOZQKanKcC5pRQ5+Kbh6v/y0eL9FZY6xQNJl9lLsjPiO1vcPnxymEWbIxH X-Forefront-PRVS: 083526BF8A X-Microsoft-Exchange-Diagnostics: 1;DM6PR02MB4457;23:aom9DiMQczjXapJnN0rkziA4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hh032Pe47wPyZFj1VU4xBkUCcGSfhVppyXOxcyKWfn5dmV+osvFPSKdnS54BdkrNtDMtl4WN6bdjG9CIM1n/BQ3wI9BHofHnEPDVnvpnFJOy7t1cqM7SWY6IUuXNxEa/1I=;7:wCW3nxge+Mig7z2HKqTA99ArlF1wOKDebkObBSS6od+D97DFh/7TIVAt/eC6QK49IMPiMsf0kZbwKNgaVjkpqBL12hIvlYdBn2YXVm+EA2BrlbNgk8giMkzisWThNg237vDMMa8H0LwsecbFjmBYrJbxWMo3Pw8ajmyT7g16/x3YdrF3pgDP4RFmLD0RKFt2EC3W4bK6PC8MLnLHyvVDnp3OW+XBFA4mKW2CHQuLdP57s8aQammjmvvgoifl5VeW SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2018 07:34:41.3395 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3dff3600-0f83-41a3-cd6a-08d639832aa8 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB4457 Sender: linux-fpga-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds FPGA Manager support for the Xilinx ZynqMP chip. Signed-off-by: Nava kishore Manne --- Changes for v2: -Fixed some minor coding issues as suggested by Moritz Changes for v1: -None. Changes for RFC-V2: -Updated the Fpga Mgr registrations call's to 4.18 drivers/fpga/Kconfig | 9 ++ drivers/fpga/Makefile | 1 + drivers/fpga/zynqmp-fpga.c | 165 +++++++++++++++++++++++++++++++++++++ 3 files changed, 175 insertions(+) create mode 100644 drivers/fpga/zynqmp-fpga.c diff --git a/drivers/fpga/Kconfig b/drivers/fpga/Kconfig index 1ebcef4bab5b..38eed4f9d6e9 100644 --- a/drivers/fpga/Kconfig +++ b/drivers/fpga/Kconfig @@ -56,6 +56,15 @@ config FPGA_MGR_ZYNQ_FPGA help FPGA manager driver support for Xilinx Zynq FPGAs. +config FPGA_MGR_ZYNQMP_FPGA + tristate "Xilinx Zynqmp FPGA" + depends on ARCH_ZYNQMP || COMPILE_TEST + help + FPGA manager driver support for Xilinx ZynqMP FPGAs. + This driver uses the processor configuration port(PCAP) + to configure the programmable logic(PL) through PS + on ZynqMP SoC. + config FPGA_MGR_XILINX_SPI tristate "Xilinx Configuration over Slave Serial (SPI)" depends on SPI diff --git a/drivers/fpga/Makefile b/drivers/fpga/Makefile index 7a2d73ba7122..3488ebbaee46 100644 --- a/drivers/fpga/Makefile +++ b/drivers/fpga/Makefile @@ -16,6 +16,7 @@ obj-$(CONFIG_FPGA_MGR_SOCFPGA_A10) += socfpga-a10.o obj-$(CONFIG_FPGA_MGR_TS73XX) += ts73xx-fpga.o obj-$(CONFIG_FPGA_MGR_XILINX_SPI) += xilinx-spi.o obj-$(CONFIG_FPGA_MGR_ZYNQ_FPGA) += zynq-fpga.o +obj-$(CONFIG_FPGA_MGR_ZYNQMP_FPGA) += zynqmp-fpga.o obj-$(CONFIG_ALTERA_PR_IP_CORE) += altera-pr-ip-core.o obj-$(CONFIG_ALTERA_PR_IP_CORE_PLAT) += altera-pr-ip-core-plat.o diff --git a/drivers/fpga/zynqmp-fpga.c b/drivers/fpga/zynqmp-fpga.c new file mode 100644 index 000000000000..3c8fb28ef4ce --- /dev/null +++ b/drivers/fpga/zynqmp-fpga.c @@ -0,0 +1,165 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2018 Xilinx, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/* Constant Definitions */ +#define IXR_FPGA_DONE_MASK 0X00000008U + +/** + * struct zynqmp_fpga_priv - Private data structure + * @dev: Device data structure + * @flags: flags which is used to identify the bitfile type + */ +struct zynqmp_fpga_priv { + struct device *dev; + u32 flags; +}; + +static int zynqmp_fpga_ops_write_init(struct fpga_manager *mgr, + struct fpga_image_info *info, + const char *buf, size_t size) +{ + struct zynqmp_fpga_priv *priv; + + priv = mgr->priv; + priv->flags = info->flags; + + return 0; +} + +static int zynqmp_fpga_ops_write(struct fpga_manager *mgr, + const char *buf, size_t size) +{ + const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); + struct zynqmp_fpga_priv *priv; + dma_addr_t dma_addr; + u32 eemi_flags = 0; + char *kbuf; + int ret; + + if (!eemi_ops || !eemi_ops->fpga_load) + return -ENXIO; + + priv = mgr->priv; + + kbuf = dma_alloc_coherent(priv->dev, size, &dma_addr, GFP_KERNEL); + if (!kbuf) + return -ENOMEM; + + memcpy(kbuf, buf, size); + + wmb(); /* ensure all writes are done before initiate FW call */ + + if (priv->flags & FPGA_MGR_PARTIAL_RECONFIG) + eemi_flags |= XILINX_ZYNQMP_PM_FPGA_PARTIAL; + + ret = eemi_ops->fpga_load(dma_addr, size, eemi_flags); + + dma_free_coherent(priv->dev, size, kbuf, dma_addr); + + return ret; +} + +static int zynqmp_fpga_ops_write_complete(struct fpga_manager *mgr, + struct fpga_image_info *info) +{ + return 0; +} + +static enum fpga_mgr_states zynqmp_fpga_ops_state(struct fpga_manager *mgr) +{ + const struct zynqmp_eemi_ops *eemi_ops = zynqmp_pm_get_eemi_ops(); + u32 status; + + if (!eemi_ops || !eemi_ops->fpga_get_status) + return FPGA_MGR_STATE_UNKNOWN; + + eemi_ops->fpga_get_status(&status); + if (status & IXR_FPGA_DONE_MASK) + return FPGA_MGR_STATE_OPERATING; + + return FPGA_MGR_STATE_UNKNOWN; +} + +static const struct fpga_manager_ops zynqmp_fpga_ops = { + .state = zynqmp_fpga_ops_state, + .write_init = zynqmp_fpga_ops_write_init, + .write = zynqmp_fpga_ops_write, + .write_complete = zynqmp_fpga_ops_write_complete, +}; + +static int zynqmp_fpga_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct zynqmp_fpga_priv *priv; + struct fpga_manager *mgr; + int err, ret; + + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->dev = dev; + ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(44)); + if (ret < 0) { + dev_err(dev, "no usable DMA configuration"); + return ret; + } + + mgr = fpga_mgr_create(dev, "Xilinx ZynqMP FPGA Manager", + &zynqmp_fpga_ops, priv); + if (!mgr) + return -ENOMEM; + + platform_set_drvdata(pdev, mgr); + + err = fpga_mgr_register(mgr); + if (err) { + dev_err(dev, "unable to register FPGA manager"); + fpga_mgr_free(mgr); + return err; + } + + return 0; +} + +static int zynqmp_fpga_remove(struct platform_device *pdev) +{ + struct fpga_manager *mgr = platform_get_drvdata(pdev); + + fpga_mgr_unregister(mgr); + + return 0; +} + +static const struct of_device_id zynqmp_fpga_of_match[] = { + { .compatible = "xlnx,zynqmp-pcap-fpga", }, + {}, +}; + +MODULE_DEVICE_TABLE(of, zynqmp_fpga_of_match); + +static struct platform_driver zynqmp_fpga_driver = { + .probe = zynqmp_fpga_probe, + .remove = zynqmp_fpga_remove, + .driver = { + .name = "zynqmp_fpga_manager", + .of_match_table = of_match_ptr(zynqmp_fpga_of_match), + }, +}; + +module_platform_driver(zynqmp_fpga_driver); + +MODULE_AUTHOR("Nava kishore Manne "); +MODULE_DESCRIPTION("Xilinx ZynqMp FPGA Manager"); +MODULE_LICENSE("GPL");