From patchwork Wed May 12 12:50:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nava kishore Manne X-Patchwork-Id: 12253453 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4873AC433B4 for ; Wed, 12 May 2021 12:51:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1606C613CD for ; Wed, 12 May 2021 12:51:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230385AbhELMwd (ORCPT ); Wed, 12 May 2021 08:52:33 -0400 Received: from mail-bn8nam11on2088.outbound.protection.outlook.com ([40.107.236.88]:4960 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230280AbhELMwb (ORCPT ); Wed, 12 May 2021 08:52:31 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iG7wb4xiw/AcnBaTMXEwvXZlgqmEcH8Kvaiv/BkTYvqgH4UbDkXYUtapikzQEfmXQAW3YEVD0L/BbHJbVV8cOeRpUku5MGAz0thXaQjjatx6bLr677v01bUxBi7YemW889JtIcQKkxQkcM5ha1F7obIo+JoBFX030GharwESeqnxj8aD+BxvERPmx3EnDaIq0xerKQitriaT0Ahld3UVCAuKQj1Bxf+KTtmpBAToy1dqVg/YLJxK+SeJ8UbW7LQ0y//BKqaS4lkkaasvBGaUdWFqd15J0pRG0X6z2MzBnCFJ3LchNAw1CWn9Evq2NKRglBIZZFICsxxNSdWnnW9AVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6sIi3VBY9hxWN6y3jxgDEtwodJc6hAtpWU2YiJ+BxT4=; b=h6DJ6qpqcbHQxppvezqZIUEVyX6Txizx5ZUbgIMs8Q9m9arnMhVWYD1SzesJ2jS8PfA2Cq6TLM5USeKTAuXQRb7Z744Rj7SHO5rlP9WFXKtDLILoEf+SxqEooFXxZQ7QngdIV3vvqII1uDWlJ2MoWa2dnGIrL0xntqG/jsmA766gBdndJUv0vIUi/T/GbPTAHz/pGaxlm8XfcEA/uqWKwl5YwW3dP8em5d3Mb0GqFCvBpQq1rAx2tur5bYke+pKytWXyDLwxmiTTodqgQ7q7T72LcSSlq/sDIILoeF1IAYmg7C9WXM7Afb+iAaD3DQ/8ey1ZUvabZM0WG30Niz2Q4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6sIi3VBY9hxWN6y3jxgDEtwodJc6hAtpWU2YiJ+BxT4=; b=RnD/S5LUdTQWKJQ5sWz99Mo6YQQpQEaPowri54RZw2rTVfQQY62nnei9qWlkpCJOOh73lcWBnJ0WzT6LppN5xMIrttbOv1h2DOSCVGOmuJiK2wO6/1So8ZusJryCn3OJMEfLMPjyCL4XoRQtAIrI2GjMPRBP8aoo+LBj2fneF/E= Received: from DM6PR13CA0004.namprd13.prod.outlook.com (2603:10b6:5:bc::17) by DM6PR02MB6252.namprd02.prod.outlook.com (2603:10b6:5:1d2::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.27; Wed, 12 May 2021 12:51:22 +0000 Received: from DM3NAM02FT041.eop-nam02.prod.protection.outlook.com (2603:10b6:5:bc:cafe::96) by DM6PR13CA0004.outlook.office365.com (2603:10b6:5:bc::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.11 via Frontend Transport; Wed, 12 May 2021 12:51:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT041.mail.protection.outlook.com (10.13.5.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4065.21 via Frontend Transport; Wed, 12 May 2021 12:51:22 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 12 May 2021 05:51:01 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Wed, 12 May 2021 05:51:01 -0700 Envelope-to: git@xilinx.com, robh+dt@kernel.org, mdf@kernel.org, trix@redhat.com, arnd@arndb.de, gregkh@linuxfoundation.org, zou_wei@huawei.com, iwamatsu@nigauri.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org, chinnikishore369@gmail.com Received: from [10.140.6.60] (port=37340 helo=xhdnavam40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lgoKJ-0002rt-Do; Wed, 12 May 2021 05:50:59 -0700 From: Nava kishore Manne To: , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v5 1/4] drivers: firmware: Add PDI load API support Date: Wed, 12 May 2021 18:20:39 +0530 Message-ID: <20210512125042.30973-2-nava.manne@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210512125042.30973-1-nava.manne@xilinx.com> References: <20210512125042.30973-1-nava.manne@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 20c7cec3-df7c-4b2b-a116-08d91544a511 X-MS-TrafficTypeDiagnostic: DM6PR02MB6252: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:644; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rMHgWvlzB/v0pfYfLWAKfQ8BnuWDZ/lXh+beRXauZZp8bH43BOqCMhrFYTMRV4E20vsfDvEeMcAj1smPKRKZHAhPDi5jdScFS7XxFP7DzG2+h8OlVA9KqLmY0hmsqxhUV8BqICmh1KxqMPrTACnIu31GaP7ERlhj52WaCDt75WzYnzTqOvgAc7Er//Nu0bWquV3YOt/QiEzC37GP/RDG6TPBh+kqRbeqRemZZlikUIcO3pekm31OtS8QnZZuAC4PXFDc8evXnTA3No553hFbr5p4Bd7+F7ayfSiipDjhCJAN/HxwOC2HRxWceMlF7ZS8TmZ9SmCszyyIveco9AqPvfvKdZrcavTB0WnhW4wWJsZJqTjdVzk/OE2JtZ9QrzNKHOwxmDEbXO87JnLe1LWqpUY/E32Kl2w5pmJn/ZKvdpPIi1AfxTMm9VtRI6fneiPmiQFMkhr5ubGBRqQbeALChvA7ZhG0MVcvVZrHzU6JEl+B44QCg/P1wYkMYAFWc9oFFhRSEPtJOgeNSE/kQXtuHzXgYbFr54c5fMJaIgJJR2zvS5ODUeJ1osCpt9dxCJI7EQ6VtBreoPuH1SG9LiU4+9p3c4gClzDMLQHFzZ8aZr0hWb7PqpHjyezr5G93o+rO9mqkTMJE3tC6CyMLI2YccEY4sIzSN/nljF1UA3N7kkgmZCeFIoLM0jY8P3z3yfJGEMesRdGo7cgEWDNEux+iUrG3MwgFF0EHJFXFCYFt21AVulgH3r6Tm/XlJVRht56+ X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch01.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(4636009)(39860400002)(396003)(346002)(376002)(136003)(36840700001)(46966006)(8676002)(8936002)(5660300002)(82310400003)(478600001)(7696005)(110136005)(70206006)(921005)(26005)(70586007)(36906005)(316002)(7636003)(2906002)(426003)(7416002)(1076003)(6666004)(83380400001)(336012)(2616005)(36860700001)(9786002)(47076005)(36756003)(82740400003)(356005)(186003)(102446001)(83996005)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2021 12:51:22.0101 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 20c7cec3-df7c-4b2b-a116-08d91544a511 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT041.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB6252 Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org This patch adds load PDI API support to enable full/partial PDI loading from linux. Programmable Device Image (PDI) is combination of headers, images and bitstream files to be loaded. Signed-off-by: Nava kishore Manne --- Changes for v2: -Updated API Doc and commit msg. No functional changes. Changes for v3: -None. Changes for v4: -Rebased the changes on linux-next. No functional changes Changes for v5: -None. drivers/firmware/xilinx/zynqmp.c | 17 +++++++++++++++++ include/linux/firmware/xlnx-zynqmp.h | 10 ++++++++++ 2 files changed, 27 insertions(+) diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c index 15b138326ecc..2db571da9ad8 100644 --- a/drivers/firmware/xilinx/zynqmp.c +++ b/drivers/firmware/xilinx/zynqmp.c @@ -1011,6 +1011,23 @@ int zynqmp_pm_set_requirement(const u32 node, const u32 capabilities, } EXPORT_SYMBOL_GPL(zynqmp_pm_set_requirement); +/** + * zynqmp_pm_load_pdi - Load and process PDI + * @src: Source device where PDI is located + * @address: PDI src address + * + * This function provides support to load PDI from linux + * + * Return: Returns status, either success or error+reason + */ +int zynqmp_pm_load_pdi(const u32 src, const u64 address) +{ + return zynqmp_pm_invoke_fn(PM_LOAD_PDI, src, + lower_32_bits(address), + upper_32_bits(address), 0, NULL); +} +EXPORT_SYMBOL_GPL(zynqmp_pm_load_pdi); + /** * zynqmp_pm_aes - Access AES hardware to encrypt/decrypt the data using * AES-GCM core. diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h index 9d1a5c175065..56b426fe020c 100644 --- a/include/linux/firmware/xlnx-zynqmp.h +++ b/include/linux/firmware/xlnx-zynqmp.h @@ -52,6 +52,10 @@ #define ZYNQMP_PM_CAPABILITY_WAKEUP 0x4U #define ZYNQMP_PM_CAPABILITY_UNUSABLE 0x8U +/* Loader commands */ +#define PM_LOAD_PDI 0x701 +#define PDI_SRC_DDR 0xF + /* * Firmware FPGA Manager flags * XILINX_ZYNQMP_PM_FPGA_FULL: FPGA full reconfiguration @@ -411,6 +415,7 @@ int zynqmp_pm_pinctrl_get_config(const u32 pin, const u32 param, u32 *value); int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param, u32 value); +int zynqmp_pm_load_pdi(const u32 src, const u64 address); #else static inline int zynqmp_pm_get_api_version(u32 *version) { @@ -622,6 +627,11 @@ static inline int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param, { return -ENODEV; } + +static inline int zynqmp_pm_load_pdi(const u32 src, const u64 address) +{ + return -ENODEV; +} #endif #endif /* __FIRMWARE_ZYNQMP_H__ */ From patchwork Wed May 12 12:50:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nava kishore Manne X-Patchwork-Id: 12253455 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82177C433B4 for ; Wed, 12 May 2021 12:51:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4EAB16109F for ; Wed, 12 May 2021 12:51:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230418AbhELMwj (ORCPT ); Wed, 12 May 2021 08:52:39 -0400 Received: from mail-bn8nam12on2082.outbound.protection.outlook.com ([40.107.237.82]:48863 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230455AbhELMwj (ORCPT ); Wed, 12 May 2021 08:52:39 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W7RSE0X7fuam3mgKVylnM+tZfTBqH39np5+5w8JKlVA6XpXelzAS9d12xWg4BO1Zr89WJ0D501n7bw9It5W4KS+KvTZQZQhgkjATKiji2SqqUlzhAaLmBjTLlHNtkVKhkp70hYusk/N+3094y3ajs/RJUU9PyJBX4FVJP5iZ10GiO0aKNYCTdAbYhKKsonS4fZt+B2ZuIFBbFf1DPwwI9hGCgTK6Bbdf0OEVUWTSDz+5bCwr0MR3YX/S0v0zu8OLXog1Oo7KR49p+8Ybu5Rl1vE9uDzcQYfcYYUmEMxABh+coOurEut3tRsRcUIBpy48lK62c7Bp9PRagXgWoGo4hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XFB3f0MazmdoYTmpb5sJCoEtD7F6hZVXCuXNmLTIszA=; b=QHh5bwIifSDl/bQZEJEtcr0K15iKfjr2G/3wIPooHPD5rzd+A+XRSJkeXOZsHiwuhY7QFlfGzmC5wlAMxG8fo9eJCfULSM7h4Apr85Xz819t3T9H/VKKYu0Zu3CY/d+jB16ILOLRfwM4gYTfuBDk0Xhqwp6BruOluxqmst8ajLGs9cPUNFdrdR3TipWUSCxuusHSj4cnVPDy8XEQxD9FV55cYY7lapNTbkKTwaWRlMittwoBVoH1oSJMuwXZAlYOUfTMOL0n14blDODifQqaHL8ZERd9FNTb75467fzFF+orQOvWZjVDyDG2t4y9mYhaMIlJ9V/EZRK0d/UWbrjiHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XFB3f0MazmdoYTmpb5sJCoEtD7F6hZVXCuXNmLTIszA=; b=VTOEvYGqMEI1bF5FYQS0kk0sT51I37HyYhx6oZedFvhgv8YbQGsJiJBzTFdy7Uf4mAG8rdZKje8t0mcz4xfMEpR1Mp7nxmRkUwYVI97/pd4xNIYmhSXO6UCMNwbQysUYaJgggdGUSoGEVdlmns3O+Ts/WcxddeFbyIobFdVihQ8= Received: from DM3PR12CA0125.namprd12.prod.outlook.com (2603:10b6:0:51::21) by BN8PR02MB5809.namprd02.prod.outlook.com (2603:10b6:408:b6::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Wed, 12 May 2021 12:51:28 +0000 Received: from DM3NAM02FT053.eop-nam02.prod.protection.outlook.com (2603:10b6:0:51:cafe::f8) by DM3PR12CA0125.outlook.office365.com (2603:10b6:0:51::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Wed, 12 May 2021 12:51:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT053.mail.protection.outlook.com (10.13.5.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4065.21 via Frontend Transport; Wed, 12 May 2021 12:51:28 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 12 May 2021 05:51:14 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Wed, 12 May 2021 05:51:14 -0700 Envelope-to: git@xilinx.com, robh+dt@kernel.org, mdf@kernel.org, trix@redhat.com, arnd@arndb.de, gregkh@linuxfoundation.org, zou_wei@huawei.com, iwamatsu@nigauri.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org, chinnikishore369@gmail.com Received: from [10.140.6.60] (port=37340 helo=xhdnavam40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lgoKO-0002rt-Tb; Wed, 12 May 2021 05:51:05 -0700 From: Nava kishore Manne To: , , , , , , , , , , , , , , , , , , , , CC: Appana Durga Kedareswara rao Subject: [PATCH v5 2/4] dt-bindings: fpga: Add binding doc for versal fpga manager Date: Wed, 12 May 2021 18:20:40 +0530 Message-ID: <20210512125042.30973-3-nava.manne@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210512125042.30973-1-nava.manne@xilinx.com> References: <20210512125042.30973-1-nava.manne@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd1c033b-a481-4690-8f93-08d91544a8c2 X-MS-TrafficTypeDiagnostic: BN8PR02MB5809: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J0IvsVk+UfqVfktEWs4kBAdrwtScHTI92CER3PMAPW2XTJyJL057+aE44mimQJtXDkttgvOUfor4qf01lFqhbMUqUR3rIiggCQoNKptmK93A+/RzNLzDsm3wf+tdU49zLr27BM1ad8D4eEfrIHB6j47/fv2reE2SX2PCfT/DnNOSSO8WNyw4M3p7dMXy78tVLekOjnTB4AKpKjtlpuJ4SB6rj0oAtLCYXlKDgXuo5ZV3Ao3+OsuD7VevIZpov8Genay1aOg0KTQ91CnWPsEr5bGCHaa8tb+osgMYJMcnWWjDaTYBbK2rmqtq9tzJCFzYJsYPgvWwzF0G0UkBRL/hYgjGYlqBVkS6c+rrt3uL8HcaLJcyt0wsk6M02snKZ94c+NHmkUc1CInR3Z33SNz1CuK2Rs288IpZhL4eNOqKznOI0eqIibaQMkDEP/JfF55l4clwFoJ4WQS1A34RjyTMWht3VRq/Byh72NPFN+kabYjbZ9fRnhvinY2j9MbWvgP2iYxmtp2BF1jWQXITxiq+AimrASnKkrN/WyZypMBYGErr4URaTaONiw+Be1s5Hotruuh0g9j0I2UtzUFuoxrJ6PwFXE46qP9uhLvpWeMytsDH3/N6uIAix9Mw3kBKaI8PFQUBpLKGAMyNc+l3gmC2PwPeZZI94C9JBWJs2Q7DKJhEUjR6WUv334FjSJefo/EEWyam0F8uWeHjjRosgc/uGFJzamSHGLaGHwHBMirhGCH8aSGzxZcUC6N38/Vpa4xMq5neQTIO/XFuhxKxasq5e2AsqLMBDg8CXqCJJF1ED4iUKbS9DiZ+3Azp/ljwVhZPQrWXOJJGx8w2PNJa8Z4i0oFXno8UqpznERVNPQ8qlfI= X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch02.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(4636009)(136003)(396003)(39830400003)(346002)(376002)(46966006)(36840700001)(478600001)(26005)(9786002)(47076005)(36860700001)(1076003)(2616005)(107886003)(426003)(4326008)(921005)(70206006)(8676002)(110136005)(8936002)(6666004)(336012)(7636003)(356005)(82310400003)(2906002)(70586007)(83380400001)(36906005)(7416002)(7696005)(316002)(36756003)(5660300002)(186003)(966005)(102446001)(2101003)(83996005);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2021 12:51:28.2028 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dd1c033b-a481-4690-8f93-08d91544a8c2 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT053.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR02MB5809 Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org From: Appana Durga Kedareswara rao This patch adds binding doc for versal fpga manager driver. Signed-off-by: Nava kishore Manne Signed-off-by: Appana Durga Kedareswara rao --- Changes for v2: -Fixed file format and syntax issues. Changes for v3: -Removed unwated extra spaces. Changes for v4: -Rebased the changes on linux-next. No functional changes Changes for v5: -Updated fpga node name to versal_fpga. .../bindings/fpga/xlnx,versal-fpga.yaml | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Documentation/devicetree/bindings/fpga/xlnx,versal-fpga.yaml diff --git a/Documentation/devicetree/bindings/fpga/xlnx,versal-fpga.yaml b/Documentation/devicetree/bindings/fpga/xlnx,versal-fpga.yaml new file mode 100644 index 000000000000..ac6a207278d5 --- /dev/null +++ b/Documentation/devicetree/bindings/fpga/xlnx,versal-fpga.yaml @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/fpga/xlnx,versal-fpga.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Xilinx Versal FPGA driver. + +maintainers: + - Nava kishore Manne + +description: | + Device Tree Versal FPGA bindings for the Versal SoC, controlled + using firmware interface. + +properties: + compatible: + items: + - enum: + - xlnx,versal-fpga + +required: + - compatible + +additionalProperties: false + +examples: + - | + versal_fpga: versal_fpga { + compatible = "xlnx,versal-fpga"; + }; + +... From patchwork Wed May 12 12:50:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nava kishore Manne X-Patchwork-Id: 12253459 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5DBA1C433ED for ; Wed, 12 May 2021 12:51:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 29EE7613FE for ; Wed, 12 May 2021 12:51:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231186AbhELMwm (ORCPT ); Wed, 12 May 2021 08:52:42 -0400 Received: from mail-co1nam11on2050.outbound.protection.outlook.com ([40.107.220.50]:7923 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230492AbhELMwl (ORCPT ); Wed, 12 May 2021 08:52:41 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SzUWaf7R5MyzDcIzTZIXXpKSc56vgR5dtIMTWGWzNtgnMvdDBTnvhXns4rcdmIoQK33V/xRql14k1NOSut1/zS7EJ8GmgdCAVFkZQ0Cujru4q6vzTwiAzqEYcXiLd7a44Gb9eKogxqJ2+58qRaNjpBcuewozBJqo205V+wu3Sj9JcryRmvT5CQ2HZNiiMUQd+1M8cuguRPdUeBfRSQQclaSgKIDcWglXNpqzaUPBTMP4JaSqYzTj59Oan/KPkDsh62Wc6k+O1c1fV8eYt8sr0g8mX9oDun9mfh61xolHMY09AL9qd8vru6xFlZ63FLaOsHRJYnchSfEVK+Y6rvbK2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u9VH/BFszZUq0u9jF5SIZBEBLW01IzBUL2lsYsLoiVQ=; b=JXEQUGeSsUNq8kdgerD0IDRf+JUlWmVA6oJEttaJLKBu0isdcYEOQxmVWt+feJA8QncKFFx+mB/LHF0xKMvWvr4pbrtbzSHAw5DNUh8p77aiS/KT0zQYG4lNfh09mE02N5O8FX/yEelzQKkLN8WeYjh5Mm1C0E0WtdHzKg45SqJ9kN703JzYg1gjXmwDBlHT2zKzAnFEirLeScjHTtD6cda0jE1jc8zczJ+htTtuoKTeEC7I0jjV5QP+QiHdlX2bySTJLwbhVvBSvJ8llcpyUCNrdnO8JjIBdk4V6JNWoUdJhVGLL+OmzaNlIFF4WoLeg4NEU7dagjQfAyyEAUzlDw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u9VH/BFszZUq0u9jF5SIZBEBLW01IzBUL2lsYsLoiVQ=; b=Aj9jKvsas9ScVhjtQGGqZ0kegbNsZHk1Xs1zm9o7alVS05Fx4RY1OBazDerQggxdB4vevKYoN/8i+pMsfuX/eYDEeIOnEAzMVVusHh2hDL1u8W/7A/JqTONddIIvttdab7AyV54zCumeFOH4EjF2gtEv0GLftvwOw086UYMFUTY= Received: from DM5PR07CA0166.namprd07.prod.outlook.com (2603:10b6:3:ee::32) by SN6PR02MB5661.namprd02.prod.outlook.com (2603:10b6:805:ed::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.30; Wed, 12 May 2021 12:51:31 +0000 Received: from DM3NAM02FT015.eop-nam02.prod.protection.outlook.com (2603:10b6:3:ee:cafe::d) by DM5PR07CA0166.outlook.office365.com (2603:10b6:3:ee::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.24 via Frontend Transport; Wed, 12 May 2021 12:51:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT015.mail.protection.outlook.com (10.13.5.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4065.21 via Frontend Transport; Wed, 12 May 2021 12:51:31 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 12 May 2021 05:51:12 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Wed, 12 May 2021 05:51:12 -0700 Envelope-to: git@xilinx.com, robh+dt@kernel.org, mdf@kernel.org, trix@redhat.com, arnd@arndb.de, gregkh@linuxfoundation.org, zou_wei@huawei.com, iwamatsu@nigauri.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org, chinnikishore369@gmail.com Received: from [10.140.6.60] (port=37340 helo=xhdnavam40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lgoKU-0002rt-6P; Wed, 12 May 2021 05:51:10 -0700 From: Nava kishore Manne To: , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v5 3/4] dt-bindings: firmware: Add bindings for xilinx firmware Date: Wed, 12 May 2021 18:20:41 +0530 Message-ID: <20210512125042.30973-4-nava.manne@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210512125042.30973-1-nava.manne@xilinx.com> References: <20210512125042.30973-1-nava.manne@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ae5678bb-1f9c-42e4-753c-08d91544aa94 X-MS-TrafficTypeDiagnostic: SN6PR02MB5661: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Hq5TdgtUetwbDT7QzNcGcvsImI/opUh+K1lCuUcizY+gR0yfZrWP1f9u9dYGWCcw437cQHAVLN8ndNX9sntwkTaxt4CVjzkgOyH+6CoUNB543f9qKfKp+P/lcAqQrxJhtH2O4ALafk/56W5ZuHRrpbOwGcwssDDUU/ONP/yFtRBdVtdIByevDrO0QYspUmC6k/idAmev51wa+++7anqU5L5wNjgLMO3H1JHL5d59lrIVZDpYOLJ3mFd8HoEImYjZmL65rseCaRmqyhU5BUhFgCuq6XtqNyaMt6is2E09mx74FlV1A0/z97U4fOcrYYWgqfxMfX1SsnWDs+cKzAwAngzkR4xZGkXOULlQj8H9SKHJ8RBgKHQEpDf6cMUn/xz4PcEmixkM7M8sU9kXKeJeLWE8fJwS43G4Fba43zOirhZv5ZiQeWZYP087t2Dvgq7IxaSj2hfxPmO1V+muJwNU9WJX/H4EyfMMT9/1YBX6mk+fMsGZtRMT30zOM+RLjds7oB0j3n4gkdHzjRbRWXrSnm0BGTrk+wi9zxegDJ5rUzzIEWFYX9Y63P72gK4CNL9rYtx55jW3BHOn1sFs0rAlaAZ6bttPU7yCofLEm0p2viAhkfflhEcqOEw/NFdGgZw9glpk6xvYp2eE2+TJtgBjCdWkrp/z+9jjb4YJSMWIqtOd0AwkSd4QgsqE27Mtlz5q5Y3riya2mdNcnFL2wRhfMDx4VkPyivAdk4OrVWbrmMSd83N+wkj/S9xi88KxsbADttwmzyI3g4NUz7o9TduWrs2Y0Yv31EsanBkvJUNjRULCGSAQUwQw9OVWrMpFzu7DnpTi5Ryz71ID2yCQXn2yazdRUirZDy5WBwKUxzB1UxQ= X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch01.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(4636009)(136003)(39830400003)(346002)(376002)(396003)(36840700001)(46966006)(1076003)(26005)(2906002)(7416002)(7696005)(316002)(70206006)(70586007)(966005)(186003)(478600001)(336012)(36756003)(36860700001)(110136005)(47076005)(7636003)(82310400003)(426003)(8936002)(2616005)(356005)(8676002)(36906005)(9786002)(83380400001)(5660300002)(6666004)(921005)(102446001)(83996005)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2021 12:51:31.2551 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ae5678bb-1f9c-42e4-753c-08d91544aa94 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT015.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB5661 Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org Add documentation to describe Xilinx firmware driver bindings. Firmware driver provides an interface to firmware APIs. Interface APIs can be used by any driver to communicate to Platform Management Unit. Signed-off-by: Nava kishore Manne --- Changes for v4: -Added new yaml file for xilinx firmware as suggested by Rob. Changes for v5: -Fixed some minor issues and updated the fpga node name to versal_fpga. .../firmware/xilinx/xlnx,zynqmp-firmware.yaml | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml diff --git a/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml b/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml new file mode 100644 index 000000000000..e6848c2dfb67 --- /dev/null +++ b/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml @@ -0,0 +1,66 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/firmware/xilinx/xlnx,zynqmp-firmware.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Xilinx firmware driver + +maintainers: + - Nava kishore Manne + +description: + The zynqmp-firmware node describes the interface to platform firmware. + ZynqMP has an interface to communicate with secure firmware. Firmware + driver provides an interface to firmware APIs. Interface APIs can be + used by any driver to communicate to PMUFW(Platform Management Unit). + These requests include clock management, pin control, device control, + power management service, FPGA service and other platform management + services. + +properties: + compatible: + oneOf: + - description: + For implementations complying for Zynq Ultrascale+ MPSoC. + const: xlnx,zynqmp-firmware + + - description: + For implementations complying for Versal. + const: xlnx,versal-firmware + + method: + description: | + The method of calling the PM-API firmware layer. + Permitted values are. + - "smc" : SMC #0, following the SMCCC + - "hvc" : HVC #0, following the SMCCC + + $ref: /schemas/types.yaml#/definitions/string-array + enum: + - smc + - hvc + +patternProperties: + "versal_fpga": + $ref: "../../fpga/xlnx,versal-fpga.yaml#" + description: Compatible of the FPGA device. + type: object + + required: + - compatible + +required: + - compatible + +examples: + - | + versal-firmware { + compatible = "xlnx,versal-firmware"; + method = "smc"; + versal_fpga: versal_fpga { + compatible = "xlnx,versal-fpga"; + }; + }; + +additionalProperties: false From patchwork Wed May 12 12:50:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nava kishore Manne X-Patchwork-Id: 12253457 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29021C43460 for ; Wed, 12 May 2021 12:51:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E81D861175 for ; Wed, 12 May 2021 12:51:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231143AbhELMwm (ORCPT ); Wed, 12 May 2021 08:52:42 -0400 Received: from mail-bn8nam11on2043.outbound.protection.outlook.com ([40.107.236.43]:47285 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230474AbhELMwl (ORCPT ); Wed, 12 May 2021 08:52:41 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cSfUgaboLkwnRXPjJx8vsmx8BwkesGXDxwr2zGy2kAgUpwOFDIWLr0DRCmcUT9tSDr2L3USwxfbsgUT95LVuE7GWxFkpagupdOKPLxmWCIwaQcw1cmFCXWDS9EICneIkUvzPkUHFiSCUkoYvWqcT5Ylhba2e8bu+F//gQnu7SvAxpf2ZLwwXyZ9NMr/oUglTN0zvlD5BwtPUnptISZFR1h+GxHRuvH+l51i0Enmt2oohkioe+7ZlxgG8IuDb3dCq6c5pBedQIH8xVsg8useqQDpTKHkGdqh84zuFSUH7ZQgfPKC55QQ+wzeangKs1p4pn2ob3mnjIKLLtNaN+nviDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Oo1a6VSOPOUWjopaFmkIlEs/+Pa3Lh3TD8eQa3oOMSk=; b=myxJf8eCY0C1JAGwlG+rHaOJXnyzK7b8A2oOQcmTHRXjt4Rtl8kFkEQiznbw5YNj+VT8kX+SdM6RXnKgJ5/ROWG9S3cb8lRjijnXe9YPps6KCVCxfUmm++tMhY71V31jlU79QcmUn0HF7aLdRNPONuIM+ydb3+d0JWgwbAeK1LfsWxl8O1YEze0L8nkWroLf6YqWYZ9wuNKJLX56pM6CON/H0L6Xe29tcx2dilgdb73jSkPpIrf9XPzrdcqwDf2UL4aZaLRJw6Aj/PrqeGz0WYPrRtWqCgMAyr2SRxwyRfRAyd9SauUuIpSvbl1rrYmnETXYtUP9e0dhAGCArIvZDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Oo1a6VSOPOUWjopaFmkIlEs/+Pa3Lh3TD8eQa3oOMSk=; b=WJz/DS9RmYlkSdg4wEO1YegBktJeEf07fLe1WlcFyGu5iEx6tnr50ToaFO8oO5YztubTb5q0dzh8uVPm0b0Bw1WXgw77FjxdexIazwiQz7VRJpseOYTUx7u6ZaqgrBQ2TL1/mTAd8pmWWegH/TytRRrz2oDUK5rs19NiXBzjgto= Received: from DM6PR04CA0015.namprd04.prod.outlook.com (2603:10b6:5:334::20) by BN6PR02MB2772.namprd02.prod.outlook.com (2603:10b6:404:fc::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.26; Wed, 12 May 2021 12:51:31 +0000 Received: from DM3NAM02FT028.eop-nam02.prod.protection.outlook.com (2603:10b6:5:334:cafe::a2) by DM6PR04CA0015.outlook.office365.com (2603:10b6:5:334::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Wed, 12 May 2021 12:51:31 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch02.xlnx.xilinx.com; Received: from xsj-pvapexch02.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT028.mail.protection.outlook.com (10.13.4.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4065.21 via Frontend Transport; Wed, 12 May 2021 12:51:31 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 12 May 2021 05:51:17 -0700 Received: from smtp.xilinx.com (172.19.127.95) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Wed, 12 May 2021 05:51:17 -0700 Envelope-to: git@xilinx.com, robh+dt@kernel.org, mdf@kernel.org, trix@redhat.com, arnd@arndb.de, gregkh@linuxfoundation.org, zou_wei@huawei.com, iwamatsu@nigauri.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-fpga@vger.kernel.org, chinnikishore369@gmail.com Received: from [10.140.6.60] (port=37340 helo=xhdnavam40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lgoKZ-0002rt-MH; Wed, 12 May 2021 05:51:16 -0700 From: Nava kishore Manne To: , , , , , , , , , , , , , , , , , , , , CC: Appana Durga Kedareswara rao Subject: [PATCH v5 4/4] fpga: versal-fpga: Add versal fpga manager driver Date: Wed, 12 May 2021 18:20:42 +0530 Message-ID: <20210512125042.30973-5-nava.manne@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210512125042.30973-1-nava.manne@xilinx.com> References: <20210512125042.30973-1-nava.manne@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 61169f0b-341c-4736-e879-08d91544aa83 X-MS-TrafficTypeDiagnostic: BN6PR02MB2772: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5MQuhMgtiQc8ur/4VtaCpo8M8wOgU1+b/qr73QnsDPY0Sqn9hI5Wbeg7vIS7FyovZNBpAXYCmmlpRkJYeFGe8QobBfAK0kR2A06e/UK4YynZpq/NPEht/kTiY/4onU2tlFxN4hRryRbBGVY77B+4shWZfUdhiCzWTrFGOl69gcWzyZU83m36pIs8CM0o9j5N1FS6ObHwUJGlTThUBG+6gcrsKgFXkcIlLnEpvxaBZi7k0f6y9VFDn6lzVb6EeZpE2SoQWVqm5AsYhZFDqKhwKT1sYuI9dBoYNzqoElhGVfzBdl7UmcHYUfrMGVSIY9YSX2QmIPmuGrjOkcy5VapxWAw2MoLZstJOeyxhaGO6aE6Ae2khERKecudFiUNdN9WkuzITSpuqelVa+1Xrptm030oYGJOmPlusALVy7ew0ozKLhbQ5rQfbiAsZqUS/eGJRQNQS88IU9P4e8TrI4j3mj8wV/uOzuDJAyqY910ZloDvPTTnd4BfnytxM3PzW+hkMqBCO8aQPeNSmiugZHm9F27TSeh+8Is94KE6ryvOYMo7rIKXELzrna6jWLmJpNQW3H7QLW0s0y4I7zxoD9BCT1yIU8/+z3A64eT340jOuRHuG7CvpLF/lVCECK/gzveDcY2ryyCLIrFRHoT+dwD8W/4CuZpNVK2OE3cnvec3lpAZZJz6DS93+GQRosEZAwEj0YIWgtNHixXf8Tw0TNprRaUOgxZThATbJKatee8f6Vt+43hwJ6nLehwQ0wlrnYLRj X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch02.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(4636009)(346002)(39860400002)(376002)(136003)(396003)(36840700001)(46966006)(7636003)(356005)(336012)(82310400003)(83380400001)(70586007)(2906002)(8676002)(70206006)(6666004)(8936002)(110136005)(36756003)(186003)(5660300002)(82740400003)(316002)(7696005)(36906005)(7416002)(478600001)(26005)(426003)(4326008)(921005)(107886003)(9786002)(2616005)(1076003)(36860700001)(47076005)(102446001)(2101003)(83996005);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2021 12:51:31.1467 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 61169f0b-341c-4736-e879-08d91544aa83 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT028.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR02MB2772 Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org Add support for Xilinx Versal FPGA manager. PDI source type can be DDR, OCM, QSPI flash etc.. But driver allocates memory always from DDR, Since driver supports only DDR source type. Signed-off-by: Appana Durga Kedareswara rao Signed-off-by: Nava kishore Manne --- Changes for v2: -Updated the Fpga Mgr registrations call's to 5.11 -Fixed some minor coding issues as suggested by Moritz. Changes for v3: -Rewritten the Versal fpga Kconfig contents. Changes for v4: -Rebased the changes on linux-next. No functional changes. Changes for v5: -None. drivers/fpga/Kconfig | 9 +++ drivers/fpga/Makefile | 1 + drivers/fpga/versal-fpga.c | 117 +++++++++++++++++++++++++++++++++++++ 3 files changed, 127 insertions(+) create mode 100644 drivers/fpga/versal-fpga.c diff --git a/drivers/fpga/Kconfig b/drivers/fpga/Kconfig index 33e15058d0dc..92c20b92357a 100644 --- a/drivers/fpga/Kconfig +++ b/drivers/fpga/Kconfig @@ -234,4 +234,13 @@ config FPGA_MGR_ZYNQMP_FPGA to configure the programmable logic(PL) through PS on ZynqMP SoC. +config FPGA_MGR_VERSAL_FPGA + tristate "Xilinx Versal FPGA" + depends on ARCH_ZYNQMP || COMPILE_TEST + help + Select this option to enable FPGA manager driver support for + Xilinx Versal SoC. This driver uses the firmware interface to + configure the programmable logic(PL). + + To compile this as a module, choose M here. endif # FPGA diff --git a/drivers/fpga/Makefile b/drivers/fpga/Makefile index 18dc9885883a..0bff783d1b61 100644 --- a/drivers/fpga/Makefile +++ b/drivers/fpga/Makefile @@ -18,6 +18,7 @@ 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_FPGA_MGR_VERSAL_FPGA) += versal-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/versal-fpga.c b/drivers/fpga/versal-fpga.c new file mode 100644 index 000000000000..5744e44f981d --- /dev/null +++ b/drivers/fpga/versal-fpga.c @@ -0,0 +1,117 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2019-2021 Xilinx, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/** + * struct versal_fpga_priv - Private data structure + * @dev: Device data structure + */ +struct versal_fpga_priv { + struct device *dev; +}; + +static int versal_fpga_ops_write_init(struct fpga_manager *mgr, + struct fpga_image_info *info, + const char *buf, size_t size) +{ + return 0; +} + +static int versal_fpga_ops_write(struct fpga_manager *mgr, + const char *buf, size_t size) +{ + struct versal_fpga_priv *priv; + dma_addr_t dma_addr = 0; + char *kbuf; + int ret; + + 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 */ + + ret = zynqmp_pm_load_pdi(PDI_SRC_DDR, dma_addr); + + dma_free_coherent(priv->dev, size, kbuf, dma_addr); + + return ret; +} + +static int versal_fpga_ops_write_complete(struct fpga_manager *mgr, + struct fpga_image_info *info) +{ + return 0; +} + +static enum fpga_mgr_states versal_fpga_ops_state(struct fpga_manager *mgr) +{ + return FPGA_MGR_STATE_UNKNOWN; +} + +static const struct fpga_manager_ops versal_fpga_ops = { + .state = versal_fpga_ops_state, + .write_init = versal_fpga_ops_write_init, + .write = versal_fpga_ops_write, + .write_complete = versal_fpga_ops_write_complete, +}; + +static int versal_fpga_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct versal_fpga_priv *priv; + struct fpga_manager *mgr; + int 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(32)); + if (ret < 0) { + dev_err(dev, "no usable DMA configuration\n"); + return ret; + } + + mgr = devm_fpga_mgr_create(dev, "Xilinx Versal FPGA Manager", + &versal_fpga_ops, priv); + if (!mgr) + return -ENOMEM; + + return devm_fpga_mgr_register(dev, mgr); +} + +static const struct of_device_id versal_fpga_of_match[] = { + { .compatible = "xlnx,versal-fpga", }, + {}, +}; +MODULE_DEVICE_TABLE(of, versal_fpga_of_match); + +static struct platform_driver versal_fpga_driver = { + .probe = versal_fpga_probe, + .driver = { + .name = "versal_fpga_manager", + .of_match_table = of_match_ptr(versal_fpga_of_match), + }, +}; +module_platform_driver(versal_fpga_driver); + +MODULE_AUTHOR("Nava kishore Manne "); +MODULE_AUTHOR("Appana Durga Kedareswara rao "); +MODULE_DESCRIPTION("Xilinx Versal FPGA Manager"); +MODULE_LICENSE("GPL");