From patchwork Fri Jun 4 11:33:29 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: 12299597 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,URIBL_BLOCKED,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 16F03C07E94 for ; Fri, 4 Jun 2021 11:34:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E34BA61429 for ; Fri, 4 Jun 2021 11:34:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230008AbhFDLft (ORCPT ); Fri, 4 Jun 2021 07:35:49 -0400 Received: from mail-sn1anam02on2052.outbound.protection.outlook.com ([40.107.96.52]:23882 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229962AbhFDLfs (ORCPT ); Fri, 4 Jun 2021 07:35:48 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BBoYKsNmBqgTZJ27Y7sKppMGDGRrAK8AWBQNQRcVsasy+6/xyKCBtWJBkxcszTDW6/NjM2PmVMj2LbVSVHUta+7fMmvmBitKNZFfSbItiufncFF8iSpg60CQRighUfUVtcd0v+apv3gNzut5Zf6QjiguCOnDfMYTU/fE7TTiCmISoXavf2FwWUh3CO5ScSNegUejiBpFTlzrBe637vk8Z8jzqj311hJeQvbZ5G+BfViV0bITl1V3mGbeg/whyX8tEuxldfvGPPsy+VYhQ9k+PmIiZytP2gxKjlLPSH+PE/BEkuI6HpmPwE9sgqIP/Zym7p4fPwrxZeoEE/xKeKLP7Q== 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=/6M3AH8+0OkJrJ1tEatpCI7eEWjz/xiRoBiDefRxNEM=; b=RraabJP94lE4IdY656YO+HowsEY+BSz1AEGmTz7f4qosa5xseYfZB7zb668z+8UBhCrj0q9roVHfWVkdbFBfPImNjmV/QyKfvGywTShvKnUrc5BDFoNVy9rx2Yw48SFaVaGdfO2J19wShxTKmZqHx3kJpLpHZ8ByIzxhGebQV033cYoVFpbwa+WG+Ip2jfWTxaxoe8yZfdcErXBdleE8YBDTo1PMY73kfSRS6Ji9XN+jFv2fp75R7uYSool1Nnw5YwnpMCzdJwxpUKaOCZUUFv611a4r/FrDVu/SxaLku/q4PGk5BA1B+xUwdWGaUOfc+olKJZ3jQVPsemPD1wCjwA== 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=/6M3AH8+0OkJrJ1tEatpCI7eEWjz/xiRoBiDefRxNEM=; b=bxuEbUSarqYOSqVhOFjFOHhbIDI6mfpp9EtczNNv/wWEAluVgV2fkyTomxnDO63CXG8jDr5O/sRDeHLTljaNQbg5n6VN9w4jupGXVrt32a3vtlzdQaHWqg9aGBIbppjGvFqU43kEUIqsvCIxjRvBIZJOWVFfJWHemYqSuP4Ega8= Received: from SN6PR2101CA0016.namprd21.prod.outlook.com (2603:10b6:805:106::26) by SN6PR02MB4958.namprd02.prod.outlook.com (2603:10b6:805:99::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.23; Fri, 4 Jun 2021 11:34:00 +0000 Received: from SN1NAM02FT0010.eop-nam02.prod.protection.outlook.com (2603:10b6:805:106:cafe::52) by SN6PR2101CA0016.outlook.office365.com (2603:10b6:805:106::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.3 via Frontend Transport; Fri, 4 Jun 2021 11:34:00 +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 SN1NAM02FT0010.mail.protection.outlook.com (10.97.4.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4195.18 via Frontend Transport; Fri, 4 Jun 2021 11:34:00 +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; Fri, 4 Jun 2021 04:33:47 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Fri, 4 Jun 2021 04:33:47 -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=49944 helo=xhdnavam40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lp85C-0005PI-G2; Fri, 04 Jun 2021 04:33:46 -0700 From: Nava kishore Manne To: , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v7 1/4] drivers: firmware: Add PDI load API support Date: Fri, 4 Jun 2021 17:03:29 +0530 Message-ID: <20210604113332.1394-2-nava.manne@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210604113332.1394-1-nava.manne@xilinx.com> References: <20210604113332.1394-1-nava.manne@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4fa61ff2-758e-4d35-0296-08d9274ca624 X-MS-TrafficTypeDiagnostic: SN6PR02MB4958: 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: VYrj0qsi3dFU3CbZk0EuQafwV96/XTE+KrtJ1xrioHVWj9fp+RUcHNHCEdkm8il/MYYt+/Vfc6oxfn96aMY48wxOdl9XYZPRJ3yoPistD1FjSyG2jVboyQbnCZCWoeW/qc4GTIZsp1sAg1w11T4bi0vQ9nO3NQFTIEEnquo6tOuDrUuyDFao7jHnHCDvwD0bAvDwxuYwIlEtsRvaTimIAEy+ihSdH+LNttlfpKIbLz42T4Av/hGlCpVnyrAIy7myxk5alWvl9jjib9izg1CjItdYK3DEnMEUlpK3XO+zI21P9oNnd0HF6peGm2meIOhlQtkmlKXSaCR612ugPM84xoc5f5Z0QrUFJ5+FPQb99pjUyS01Ot1nrvH+R1jPMA75aH5dYrjvGbvBWsB53mGEssQO5kS1PpIlAoAH2Bt691auZV4E9/i2aFrbTqcPvRfrBb6fiKFmnOUU05xxNtSvaboWNRdtgfOpFsGDZCfhQSxmNv6xTk/CltMjbN+lHZAkM0Dqd+7Hfrh0w6f+x/0TYqxFZf5ZpLSTokOdjxfHRGhfo/XOEnbLl8wVtTH3T5ixBQL7pO+iS8FYIGqT5Ue9ESNzAnjzqm3Qe78TxSuSyqgPrAKjcdOC/xxeWUi9+8zT97W2Tfuf6BNvJWPmN5FZ6aVWZbqZDPWqBVcopVrwhKrU4TghDB1hq08i+iBULo/xE/WKeLhY7XyNIZ3/U2FdQ0xjMS60YY0NR8PzCjhFJ4WCsOzJ4bRF8fKkJpZXfWbi 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)(136003)(346002)(396003)(376002)(46966006)(36840700001)(36860700001)(316002)(36906005)(336012)(478600001)(7416002)(110136005)(8936002)(8676002)(1076003)(82740400003)(426003)(7696005)(2616005)(47076005)(83380400001)(2906002)(9786002)(7636003)(26005)(186003)(5660300002)(356005)(36756003)(6666004)(921005)(82310400003)(70586007)(70206006)(102446001)(2101003)(83996005);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2021 11:34:00.7171 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4fa61ff2-758e-4d35-0296-08d9274ca624 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: SN1NAM02FT0010.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR02MB4958 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 Reviewed-by: Moritz Fischer --- 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. Changes for v6: -None. Changes for v7: -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 Fri Jun 4 11:33:30 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: 12299599 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,URIBL_BLOCKED,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 3067BC47083 for ; Fri, 4 Jun 2021 11:34:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 19D5661434 for ; Fri, 4 Jun 2021 11:34:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230080AbhFDLgA (ORCPT ); Fri, 4 Jun 2021 07:36:00 -0400 Received: from mail-mw2nam12on2069.outbound.protection.outlook.com ([40.107.244.69]:60576 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229962AbhFDLf7 (ORCPT ); Fri, 4 Jun 2021 07:35:59 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FSTniVCsviUBspXntv14H47vD3D60gBymZ0YpPDXogsQqtcX4hOYCN7+BBcntO7xClAdIUGIP4gGNuu+hrittXklXc6sRQT3gpKocuTZImO/CxV6hUA9tgrKC0JixxcINlU04cavRAup9p8iawFOTyu29n10X7BGg5+93fY+upypzryGVUY3NGHAP61zyzMyLiOKENDEl41Owsa1bcOxa187DefWGRlHu5d/zkdeuf+qkSfktGJmCetKIHrV4Li9cOBHFv1vS5muPslJIQZghWTdH1kKK4SFlt8WpsRcTLof2pAzR8ZEsvmVsOPxcMQCHTxqrTPgxnPZgeHKJTwAFg== 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=kj6itWoH2DKTfNlx95DzU55pPWeaxCNEO6NzzlNdRVQ=; b=P7FFJJJuq2H0MgwTkO0EGB7m6tda+n64d89mr8X4Xxwy7uPFSknSjHmVW04YXs41JwN2s82mNr3w3PKr1DWlpDXHbig982axjlc6UCstUWkKqip1DUTzxJmG4omKQIorXZm5xxiLOrA9Up0C0iEDb9+wquQm+zaUs/ESdpfTD0SH6i3ji5B36zywIV71ykdtlLxnZs/nBNCnAUb/GI0HWHyi9Ub6mRO21rsxZSMpRGnZw5le0jksLTg/Gmixz9IF4hgwCj8yQ/IHMR5XvgwiBpZ51grbjiTT95CwEFAiDp2s+Oysw/B2gB6EZSTikCd0zuz3DEKAphfVX6DR4Vcdfg== 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=kj6itWoH2DKTfNlx95DzU55pPWeaxCNEO6NzzlNdRVQ=; b=OSDscCi42Jg/M76CPgcYZF4JT4wroZMRi17pV2dAj/4Lp20DCLGafCGZqZeNvzFpUNu1hocxSrLoltd3C8DPN0F1pOGdWD7dGh1EQ33s76lGr6sRvq9x9UkA6W/NUvLn15hRtXWV/IT4cPzHXJRAuEktW5HKX4XA0nwvKd3nT4U= Received: from SA0PR11CA0139.namprd11.prod.outlook.com (2603:10b6:806:131::24) by MN2PR02MB6654.namprd02.prod.outlook.com (2603:10b6:208:1de::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.23; Fri, 4 Jun 2021 11:34:11 +0000 Received: from SN1NAM02FT0006.eop-nam02.prod.protection.outlook.com (2603:10b6:806:131:cafe::78) by SA0PR11CA0139.outlook.office365.com (2603:10b6:806:131::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.21 via Frontend Transport; Fri, 4 Jun 2021 11:34:10 +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 SN1NAM02FT0006.mail.protection.outlook.com (10.97.5.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4195.18 via Frontend Transport; Fri, 4 Jun 2021 11:34:10 +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; Fri, 4 Jun 2021 04:33:54 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Fri, 4 Jun 2021 04:33:54 -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=49944 helo=xhdnavam40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lp85I-0005PI-NU; Fri, 04 Jun 2021 04:33:53 -0700 From: Nava kishore Manne To: , , , , , , , , , , , , , , , , , , , , CC: Appana Durga Kedareswara rao Subject: [PATCH v7 2/4] dt-bindings: fpga: Add binding doc for versal fpga manager Date: Fri, 4 Jun 2021 17:03:30 +0530 Message-ID: <20210604113332.1394-3-nava.manne@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210604113332.1394-1-nava.manne@xilinx.com> References: <20210604113332.1394-1-nava.manne@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ae66fedf-97f5-4cad-2f33-08d9274cabf5 X-MS-TrafficTypeDiagnostic: MN2PR02MB6654: 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: dVU2K1ScsSVLwr5JqgY4te/5z1J98IXK+G6KVjvwkcGngOSg1w1yyco0yuFkq3WWO6Rth7MNbioGygYN7HXMLgCqYKpyPUIE9AzJx0V4MYT/Dih/dWmOTi3JCPv1MPzOfDu24gEKUwTNar009Qp2nAXtc46wcRDhGWu2aH1Y3fwgdXATrMnltd4ChLPLCaMiiJ5NJmTDTNJAFW/xziR4dlbyqFRPUlOtriIpIoei4lS8xbQq6fzWlvOneXhpD22vVhhwtJ9KbrTowGFnuI5rmDPYPQ59ma/D+kSuTqXp2NaWl25aFdVEt0WwxJZ5Y6+3tCZGIvz85qUGbBgi1xd4wsrKqgEidbUo48mw0j05gcpn6f7JU4KNd0N2TDaQA7jxjNW4VZBGC0x3jZHXPOm3+xIULvNzf8S+jImjryQRADHPPcitJdA/p6Fk/5+plmn1YkKWoH6csCUv+knCP0TO042l3doRWIX1AmtBnLXJq+nqKOZxsQ1LN6z/V8mPFtWX+joEouF00MUhtPu79sE+rSCivES/9yS0kPqzW40ydUbWQIdPknCSbGyCHhfAB5FElnQqoMSt9sdNzRBTMTEt5juLOfjZvr6BOnmUxUSu8FSNOz4GfHYRlPS1H1VOY0ht595gggrMpcC113qN5BVLdXI4ucEPYB+OJLcrS/ZK1TkPh7PtpzUN6rKGOWXgEfRPwI1L5Rv/oD3rNF6jgNnlmluwBhWC+nHdVkwZd21zwoOwR1f2rKkCuQTT1AHaa3t67ddMTPxVfuuBhD1jDwUbO5JM+C52ZrbhVlcQbc2QMZOK24XUnqqJB7fFzMJscqTeMqTQJlsVNxDh8AHJgZNE/2poPKPZVWB8eoYIuckootZE6m3/dJ8V8SK6Zipia57+MyeON74qp+BnnaG94deBOw== 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)(346002)(396003)(136003)(376002)(39860400002)(36840700001)(46966006)(36906005)(316002)(47076005)(70586007)(110136005)(1076003)(9786002)(7416002)(921005)(8936002)(2906002)(8676002)(7636003)(36756003)(356005)(82740400003)(6666004)(5660300002)(26005)(82310400003)(336012)(426003)(2616005)(107886003)(83380400001)(36860700001)(70206006)(478600001)(7696005)(966005)(4326008)(186003)(102446001)(83996005)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2021 11:34:10.4806 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ae66fedf-97f5-4cad-2f33-08d9274cabf5 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: SN1NAM02FT0006.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6654 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 Reviewed-by: Rob Herring --- 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. Changes for v6: -None. Changes for v7: -None. .../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 Fri Jun 4 11:33:31 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: 12299601 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,URIBL_BLOCKED,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 8D3F4C07E94 for ; Fri, 4 Jun 2021 11:34:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6FF7861429 for ; Fri, 4 Jun 2021 11:34:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230302AbhFDLgF (ORCPT ); Fri, 4 Jun 2021 07:36:05 -0400 Received: from mail-mw2nam12on2051.outbound.protection.outlook.com ([40.107.244.51]:15073 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229962AbhFDLgF (ORCPT ); Fri, 4 Jun 2021 07:36:05 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nuSQuOro8hAbnWKbeXCjJMj1HCGdisIqpIVGqMLxoveT2Yuib9mS07YNFkeYXFJckZr6KgwqlVH+CB4XLDEOAHlviHX+IaCnxH8xEse9z3u/Y2RrjO7Zirb23RDZ+QiTnOLZOeD2gaFrpREuw/Ves+8BBWKdD7kJndBLbAdGMQx7liy+lSSzJNa92E0wXZ3ZzQqWzZ2Hg4/uqr8d+bh5Z/yGyiUx3s0+G2Zx7IaYcheCV9BP0Y88kw30xN3skTaEvtgMvREGWeDlP/80zGbhhmuKGpLuxLBILRCxqIFrDCKweVWX2p9FQUgXWKXLQUmEb4ETmWj611GE7FS2LbTzSg== 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=GGl4Z16v/obVHp99+OZhrcZPKWGkTqSsIlxvPF5wTQg=; b=LoEsOShxYp5z9XSnQ6svLQUMEs3dzaZq92SVwbu93I73cYKEoRuvizi17LAenWydwiw37Ri802n3l+6by4FSXbCCDyvQ9gcpdmvb0oqUIGCt/c7GyRApx5i9L2TbKF5MpxvYdH1MaW5smOk6dEvDI7xAIi//Lp6ficnHNBfBtVUu7hhOvns2oz5I35sKQwD3MmV4RT1/vyRkY0B6j9gRUx8HvhWyenhm6OLFtNOQTUTOBGUlu5lHABgJkLfyueFwiPyCb3TUxl+CPedi4to6lKNsm7yk3I66Q97Jeks6KCEGJf9ceukxWhvA8NkZiNNo5lQ+n7EQHOflT5ntdvZwmw== 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=GGl4Z16v/obVHp99+OZhrcZPKWGkTqSsIlxvPF5wTQg=; b=Y8z2wwHiZkGOxlnhl5CCpoxj7BteMQgWFPg2HG9uSKXsVAfnGC6MxXQgEKwLxwAQ4rNnHtIcf0C5JW27O8uH+O67SR5X83+M3Spwm8oBPUAjcXvJM16dSe2S1KWRo3LSawE4ctkgUtRzA3Y9fh8u7GET+/yYaDo4kGbvNefWk34= Received: from SA9PR13CA0064.namprd13.prod.outlook.com (2603:10b6:806:23::9) by MWHPR0201MB3577.namprd02.prod.outlook.com (2603:10b6:301:76::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.22; Fri, 4 Jun 2021 11:34:17 +0000 Received: from SN1NAM02FT0017.eop-nam02.prod.protection.outlook.com (2603:10b6:806:23:cafe::14) by SA9PR13CA0064.outlook.office365.com (2603:10b6:806:23::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.10 via Frontend Transport; Fri, 4 Jun 2021 11:34:17 +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 SN1NAM02FT0017.mail.protection.outlook.com (10.97.4.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4195.18 via Frontend Transport; Fri, 4 Jun 2021 11:34:17 +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; Fri, 4 Jun 2021 04:34:00 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Fri, 4 Jun 2021 04:34:00 -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=49944 helo=xhdnavam40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lp85O-0005PI-Mw; Fri, 04 Jun 2021 04:33:59 -0700 From: Nava kishore Manne To: , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v7 3/4] dt-bindings: firmware: Add bindings for xilinx firmware Date: Fri, 4 Jun 2021 17:03:31 +0530 Message-ID: <20210604113332.1394-4-nava.manne@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210604113332.1394-1-nava.manne@xilinx.com> References: <20210604113332.1394-1-nava.manne@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ff0eeb84-4180-4517-d554-08d9274cb01d X-MS-TrafficTypeDiagnostic: MWHPR0201MB3577: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: quIN6Hsgb8Vq+yO/w+EZerweM/vDw+OhYYy6X5y1TfTKOaTTFQx1A0Nv8O88QcmBh4rdDzQdmutU/GsqrlUXgJHe3qNvXVDnz+uXTEAA9gvvpf8kTeV4zHQTWJrUiP8LcKzUJinzG8Qt1G/ZCNWGG85vdCIDZneFVi5bj3MHoHPaOn3JezvihUg47XcyNaldr01VkRYBwH0Mz6wGXEqpUN/ssbipRDbEd8c98v9iZPg5d8SMzl087ThRICP0G1GYdZbkoyWnH+Y7RDmBQj2NloK22fgXL7MdzDXEcNLDaL/dqkQ6k5vtZds2HZBdvNkbeqniUCcI3zb8+O7F8FdCfifqX2ChJ46bjEzqnaQidWoUfSGhJWGbuUxZI7nJmzkZxOG1Vqitq+YDFjxDv2YMpzt4CerrDc0NTNoPhcLvJ4TCOWFvgzeez8UrJ58PedeaoWzfju3AXgyjWbAfsBckyvIcu5mrYsBIyaBkG2CNyuielkPMASacTZFASYAs4gO+dDH0arIs042Hli0dt/3OiU2NCTOOkMFtTL7TO6ItpkYGkLcBqzvsuMmrKcUhD/KJMQwetLhhA9QyUyHRquWFpLfbB/POAUu/yksUaytefOhG6xB7TaH9SokH5gYSTlzo66ATyoxLawgQevFf7oXv60Dlo6PdgG0VwXFBVfdzv5k/xt8ZSuz/2aNk1jI53WvJrVdb3+Crx3gbQnUqy4UB88bGLncI7OX7FprJ/th/ozbV6U6NMmBaNxN8CTXR4aC1IqEuTRwypY3OC0AoSYU15ZdFdmRLs8Ga+3ElMnnWzQwzh4pCQOguRSl9y9qg4fYQ5TZxPzJwgg8YXEropwv4Gqj4DOUHfO1VW8jlkNN8lya2t4t13BfjUAFp6zJuskI5IkrSAAxOZEYUqOe4W4IT1Q== 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)(346002)(376002)(136003)(396003)(46966006)(36840700001)(186003)(6666004)(966005)(7416002)(426003)(83380400001)(478600001)(70586007)(8676002)(2906002)(26005)(70206006)(336012)(8936002)(36906005)(9786002)(316002)(110136005)(7696005)(36756003)(921005)(356005)(47076005)(5660300002)(82740400003)(1076003)(2616005)(82310400003)(7636003)(36860700001)(102446001)(83996005)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2021 11:34:17.4579 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ff0eeb84-4180-4517-d554-08d9274cb01d 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: SN1NAM02FT0017.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0201MB3577 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. Changes for v6: -Added AES and Clk nodes as a sub nodes to the firmware node. Changes for v7: -Fixed child nodes format ssues. .../firmware/xilinx/xlnx,zynqmp-firmware.yaml | 94 +++++++++++++++++++ 1 file changed, 94 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..8e0241c4c137 --- /dev/null +++ b/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml @@ -0,0 +1,94 @@ +# 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 + + "versal_fpga": + $ref: /schemas/fpga/xlnx,versal-fpga.yaml# + description: Compatible of the FPGA device. + type: object + + "zynqmp-aes": + $ref: /schemas/crypto/xlnx,zynqmp-aes.yaml# + description: | + The ZynqMP AES-GCM hardened cryptographic accelerator is + used to encrypt or decrypt the data with provided key and + initialization vector. + type: object + + "clock-controller": + $ref: /schemas/clock/xlnx,versal-clk.yaml# + description: | + The clock controller is a hardware block of Xilinx versal + clock tree. It reads required input clock frequencies from + the devicetree and acts as clock provider for all clock + consumers of PS clocks.list of clock specifiers which are + external input clocks to the given clock controller. + type: object + +required: + - compatible + +additionalProperties: false + +examples: + - | + versal-firmware { + compatible = "xlnx,versal-firmware"; + method = "smc"; + + versal_fpga: versal_fpga { + compatible = "xlnx,versal-fpga"; + }; + + xlnx_aes: zynqmp-aes { + compatible = "xlnx,zynqmp-aes"; + }; + + versal_clk: clock-controller { + #clock-cells = <1>; + compatible = "xlnx,versal-clk"; + clocks = <&ref>, <&alt_ref>, <&pl_alt_ref>; + clock-names = "ref", "alt_ref", "pl_alt_ref"; + }; + }; + +... From patchwork Fri Jun 4 11:33:32 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: 12299603 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,URIBL_BLOCKED,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 69B8CC47098 for ; Fri, 4 Jun 2021 11:34:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5317A61428 for ; Fri, 4 Jun 2021 11:34:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230321AbhFDLgH (ORCPT ); Fri, 4 Jun 2021 07:36:07 -0400 Received: from mail-co1nam11on2070.outbound.protection.outlook.com ([40.107.220.70]:24865 "EHLO NAM11-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229962AbhFDLgH (ORCPT ); Fri, 4 Jun 2021 07:36:07 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XDJl9c3h2PiwCaP6ukgZ6RinwkcJGkZp4hJ+m0qYrpUWmTiRLEN8lR05BkpXN/ympHz437HiG/MMaBJCbOyVXrGDIsjxux0lXUnpc45skO0fQJG4A8a04202+ySWyf8cfQ8+fZCPPpwGpFGI6Hzn4ZoHJTSkIdxCChE/iqTFptT/e5AItQEPzOsz13H/rQMKgd3O34o8XRnhAjqdLzqG+LB03Si2MJtWdJFj9nlZR/UNa/ZszwS7Onyad9M5JLEJpI+Go6Z1EGrCL2zAzIR75ganPx0Gxn9YA6CCtOmb1FmOQGbty5K+RRK7vGHZbz34T8/rrEghGwdlhv3Meu3D5w== 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=jwKQiieLq1nb+uf0fI3SX4vQyLxuNz9QpSD6NVb0lQM=; b=C+qB8eROmhH454ZZEet8mq7QlNkhwJQp15JMZTzYPE0f9KeP0qTDSt1gkVH/X1BWRovAfQ/Z3fMFjdONtVhJlDSyvRwJ2STz1bMW1NyLsOq6pfxtnJ7bqbIbDvUdZccMgYbBJlqORghZGj0+mInX6EWNc08wlWeSUWZY/mrpXCXe3nD5cOzFniThpPG98PvWu2EJT1elqomHXXlT1EcjQCCEj1jDKd+rDHNI8R4sp9gUYKH3r2D8fN5K7IqyCVz70157FI91F/4idZ/X1ku8ARvPvco4DYSo+QdemWr0Ag/YQBLoNw7dkGr77oNC+0M+VjyYQbEHgxXFpzjStTT1iw== 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=jwKQiieLq1nb+uf0fI3SX4vQyLxuNz9QpSD6NVb0lQM=; b=duGKXb8VaPqalha6b+4I4Nbh3s+I/KAVFdwyAgupLLGh6yGOGEbwkA9O286skOenmKMSkh6gqW9CTVC0rhqgjpXJQ2rjB0vCP6YxfJWRe2TqStU9Sr7KKu0q3uMnbuwrLLMrZGVw5tomo9DexFcNxaYnr8mLisF4emNfkrtXkQ4= Received: from SA9PR13CA0083.namprd13.prod.outlook.com (2603:10b6:806:23::28) by DM5PR0201MB3528.namprd02.prod.outlook.com (2603:10b6:4:7e::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.27; Fri, 4 Jun 2021 11:34:19 +0000 Received: from SN1NAM02FT0017.eop-nam02.prod.protection.outlook.com (2603:10b6:806:23:cafe::42) by SA9PR13CA0083.outlook.office365.com (2603:10b6:806:23::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.9 via Frontend Transport; Fri, 4 Jun 2021 11:34:19 +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 SN1NAM02FT0017.mail.protection.outlook.com (10.97.4.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4195.18 via Frontend Transport; Fri, 4 Jun 2021 11:34:19 +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; Fri, 4 Jun 2021 04:34:06 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.2 via Frontend Transport; Fri, 4 Jun 2021 04:34:06 -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=49944 helo=xhdnavam40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1lp85U-0005PI-U7; Fri, 04 Jun 2021 04:34:05 -0700 From: Nava kishore Manne To: , , , , , , , , , , , , , , , , , , , , CC: Appana Durga Kedareswara rao Subject: [PATCH v7 4/4] fpga: versal-fpga: Add versal fpga manager driver Date: Fri, 4 Jun 2021 17:03:32 +0530 Message-ID: <20210604113332.1394-5-nava.manne@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210604113332.1394-1-nava.manne@xilinx.com> References: <20210604113332.1394-1-nava.manne@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b9729091-51eb-4181-fa83-08d9274cb14b X-MS-TrafficTypeDiagnostic: DM5PR0201MB3528: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: C4GyyK1x8uaqoNxjt5pvY9VgTPtfTOnsc0dKLftWizXMcBO8cuPND6cgW61o1qmpmFrMBcLqnnvioV3TiP74urpVKiX9gwlu/MqVP3G1O8t+SyFjfwaJsisQ82cJ0/Qh1A0aaVTsetvNzvGoXFEPbwlvdW/taP0E9XzU1SLhgLM26dJBHMmOv2Kz2MJ67aQoZ4rIXtbqErfMSdMkIYdWeZTNAQCD7hJtSz9wx1x3E/NAsrkSxLd32WDmxvSrK5ixVn3AWWmZfwvoKojQZIGGZtYlPR4Em8o8Jc/LPFDn3mT6vf7fTeteQQeQeutw1OsLRcWGrxJJowH4z+gDZTIprQUaZUER4/rgwRBOJX44f8teYrGA6XHlA1SEv0Ne3K4aK1OIpeMDBqdtJP7cfsHYH0G/4AYwhni8WhqAgcY5Lxg0aOihF1bd9EJ02L+DLniq5IyxBTyyiD/z11I98w1epAschkcDc3iskDvuSzg/wuF+VItxQCkL5Bo4T1cqO7fw/LoHzfxaHQxKAa3CTwTlVtgDKceLoJFxQmVAKxmxIx8FFk86YoaZZMZpxztuSboBRc7Ja/O++juNGIuN+rCFCqxA52KCy8zWsdNemMWQhlNNn73homdS8FjYa1nDYQr/hattEd6KMNRdo2XOxUb/6HRnBZtXXWeGJW33rJXd8RkmNPo5vcw2HAaeNKw0mLyUyXOUYjgP48GmimZ9WiOHFjJ0hSTm9i6N8pZ8YoH3PfY0fvFQS40qnwaxvatmbw0M 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)(346002)(376002)(396003)(39860400002)(136003)(36840700001)(46966006)(426003)(36860700001)(2616005)(83380400001)(5660300002)(110136005)(921005)(2906002)(4326008)(26005)(336012)(70206006)(36756003)(356005)(82740400003)(70586007)(1076003)(316002)(82310400003)(8936002)(36906005)(478600001)(7696005)(8676002)(107886003)(47076005)(7636003)(7416002)(186003)(6666004)(9786002)(102446001)(2101003)(83996005);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2021 11:34:19.4390 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b9729091-51eb-4181-fa83-08d9274cb14b 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: SN1NAM02FT0017.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR0201MB3528 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 Reviewed-by: Moritz Fischer --- 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. Changes for v6: -None. Changes for v7: -Updated driver to remove unwated priv struct dependency. drivers/fpga/Kconfig | 9 ++++ drivers/fpga/Makefile | 1 + drivers/fpga/versal-fpga.c | 96 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 106 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..1bd312a31b23 --- /dev/null +++ b/drivers/fpga/versal-fpga.c @@ -0,0 +1,96 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2019-2021 Xilinx, Inc. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +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) +{ + dma_addr_t dma_addr = 0; + char *kbuf; + int ret; + + kbuf = dma_alloc_coherent(mgr->dev.parent, size, &dma_addr, GFP_KERNEL); + if (!kbuf) + return -ENOMEM; + + memcpy(kbuf, buf, size); + ret = zynqmp_pm_load_pdi(PDI_SRC_DDR, dma_addr); + dma_free_coherent(mgr->dev.parent, 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 fpga_manager *mgr; + int ret; + + 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, NULL); + 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");