From patchwork Thu May 20 08:09:51 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: 443494 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 C5605C433ED for ; Thu, 20 May 2021 08:10:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A0FDA610A2 for ; Thu, 20 May 2021 08:10:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230442AbhETILl (ORCPT ); Thu, 20 May 2021 04:11:41 -0400 Received: from mail-bn1nam07on2084.outbound.protection.outlook.com ([40.107.212.84]:45187 "EHLO NAM02-BN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230440AbhETILl (ORCPT ); Thu, 20 May 2021 04:11:41 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Y8xv8qpw60GrOGxHTe/kkuwi0g10/+KmNF1DyOSxVrRwhQQiUqf3B7H84CKs1tRzPdiBvLxb84sNi7+UGw5FBDHrQrtOArKkkiI5McZZgbB7FnXDhN/cOXdz+znfYMWjeaF7MAxkurIp1OX12ncOVXZf3WvEZ0rlWCOXIf0J5xmifOJ+XM9yFQNJHKfdT/hCiodHjLOrlvgNHhJofwrAvcGg41EQKxtD/Eq5+21CumQHRWUBziLVr5B7lz57fsBbFEi9PfPbNnBC78Edap453gwI9azMx73ED3+B+FI1HCFp5Zli+z9nVxVN1XAq4SqJ0BGp5Gk2ZPOH/p5ZJq9Mxg== 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=OXm2U9CL79e/31gvYG+DVVosvirA8jzcp39gEJ9Cd+A=; b=QUJ9QuhBtae4n2+BkEvbKQ4Z+sN0TC2gN2ENur0JMtSuxJuWn3YPdAfhV8W51x2CApSTO8m+B80vOJAqxk68xNe1f50ZIziwYxTz3xMEqVwCE2ghz4aJaldMOSnA2EHN7p3lNeaAY0n0vYH47u6UIsq7lSbZQZAwxM9YT63tjiyCRejHvxfukv/gUeueTlX7WtrWS8er3JTcgcNFYn9nj//7AdmHxh8d39o094lxWWEPPeoFCaDI2T4R9GqXazT5Tfb/kv/Rj0G98QynPtbKU7GL9HkkcUaK1CGUSGH7sJqtRTAEkC/kZh0/kvf5Akp5EsHplzbPLZcE6yjwr9Wqmg== 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=OXm2U9CL79e/31gvYG+DVVosvirA8jzcp39gEJ9Cd+A=; b=T/cV9xeDk75Lnvi10nTDovyQZ+XNayzOux93su7BuDDSv9XpMh3wqV3lGzpd10EGf1/lGBh1RfQ88tiyW4jLVpBRk+gKvlsokjxOrUYj/xwk1Eemfzhshlq0hx6R1mnS9bDIOXjux5AMoZR7BZSL7vuMHMLkgjy8UpXFvBlAjgo= Received: from SA9PR10CA0010.namprd10.prod.outlook.com (2603:10b6:806:a7::15) by MN2PR02MB6910.namprd02.prod.outlook.com (2603:10b6:208:20e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Thu, 20 May 2021 08:10:18 +0000 Received: from SN1NAM02FT0030.eop-nam02.prod.protection.outlook.com (2603:10b6:806:a7:cafe::5b) by SA9PR10CA0010.outlook.office365.com (2603:10b6:806:a7::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.33 via Frontend Transport; Thu, 20 May 2021 08:10:18 +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 SN1NAM02FT0030.mail.protection.outlook.com (10.97.5.194) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4129.27 via Frontend Transport; Thu, 20 May 2021 08:10:18 +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; Thu, 20 May 2021 01:10:09 -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; Thu, 20 May 2021 01:10:09 -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=42624 helo=xhdnavam40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1ljdkt-0007IV-MN; Thu, 20 May 2021 01:10:08 -0700 From: Nava kishore Manne To: , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v6 1/4] drivers: firmware: Add PDI load API support Date: Thu, 20 May 2021 13:39:51 +0530 Message-ID: <20210520080954.1393-2-nava.manne@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210520080954.1393-1-nava.manne@xilinx.com> References: <20210520080954.1393-1-nava.manne@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ac3674e7-02a6-4e25-1780-08d91b66b4a7 X-MS-TrafficTypeDiagnostic: MN2PR02MB6910: 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: qIxnJQsAOCeKJ6WN7jgj/Jj0Rl1O3ockvlVdfVWNoCXu920Qg8D4apOVKWEzivojkD5NvTwntO4IAfrVBZJeq0dB+dqbRmiNN9ATo8O6jvpAaYp57d5RMBu0F5Lxif9iWBeMtE8M6Vrg8IdGBkK9mU7dX3hVClxxyk2rIIouNlQybT7uvYD9SUnA8EP6b1L7IavFPDQ3lXLPN4Bmz3cNHMNnKClzul0HaXjdXrhtb+CEMiopAlrggenQanwi7avfAfVj5vNITyr4GrLV+nqBJcTY3psoyx0QMVzNwIgGN3Ky1AY6+10SbU9mdlddcUsTmVQfB7wW4oaC1XDy8/lhxPDckTpFcAVAQYc3HTHXxOTGUIKsz41akV5fINa1R343RjFAOnLmNbhAY6L+QUHcQBymXycQD1W1BJceeP7OuPs3g28RKldUSzELz+CNtKXxiBK77VZhqFombPkAtC9Z9LpyXI2wTGbk9oKklrfxhkmuqrJolL9U4H9TdgNBlqXlSjIXn66TR0YIRkDo3wL+RTDi4qfQDtnkjYfxw8x9qe1bG0pXP3kZPs8zmaqMFePPD23tpnmFJqDBr/yh8z+TOiJOQ4Y3M7MlPn6J+KDCB6+KisoloNtu/3UMjN1vCLbT5P58zbR+yAKDTFYo3Q+YkTjOyh7xBqEGaEQGKKMnZT4FGjWd5IwTP4vlvexI6TMWiJQURw0sux+/LD+m46XVWDXfPOszCPHp191Hskj0b17WxrsyPTmQ0DUyvkex5eW/ 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)(39850400004)(136003)(376002)(346002)(396003)(36840700001)(46966006)(70586007)(316002)(336012)(26005)(7696005)(9786002)(6666004)(2616005)(478600001)(8676002)(921005)(70206006)(7416002)(356005)(82310400003)(426003)(36906005)(5660300002)(110136005)(186003)(47076005)(83380400001)(1076003)(82740400003)(36756003)(8936002)(2906002)(36860700001)(7636003)(102446001)(83996005)(2101003); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 08:10:18.0299 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ac3674e7-02a6-4e25-1780-08d91b66b4a7 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: SN1NAM02FT0030.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6910 Precedence: bulk List-ID: X-Mailing-List: devicetree@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. 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 Thu May 20 08:09:52 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: 444886 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 188BDC43460 for ; Thu, 20 May 2021 08:11:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E670F61059 for ; Thu, 20 May 2021 08:11:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230339AbhETIMk (ORCPT ); Thu, 20 May 2021 04:12:40 -0400 Received: from mail-bn8nam11on2054.outbound.protection.outlook.com ([40.107.236.54]:3798 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229953AbhETIMk (ORCPT ); Thu, 20 May 2021 04:12:40 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dQOPTog2kIm2YhxBjMqYf+Mm1UjO9KY04f7+aG5Om6u0CNMCDNwF11KfwxlWNtYUB/CrvJk7u3aU+lRw+511QkLUyySR217T9ZBbOf2Qg6isb4179363Ah4NNhCMVyy3OxrJ7yIfhGZi6SlxS5/tdiH9BznfBEOvDP2jtdBD/lDxsg7xwGC3ZMpCJhbF/mSmyqReDk2lvg+7sb5TAOM5Bj4bHPyWhfETGmvzeJ3HUi6gVxs1TdEP335EbBi/KVbPM/7wiZHL6CI9gUqmxGyPrdKZwCoqMoQ6HoT/WeJCBjGP5GyWdS5r+ft0pDtQWDogZrg/FMP/s6oqjKY9OsLjHw== 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=7d9OPnim+dQ8PjkhePuL2xqi4lRmnMRAVgszwGm5eUM=; b=WKyItFfoG33A+zZrlFha3j1od4P7obeBiTjCspWl+1UiLT5MIQiZk9NnShhCx2GHehWJ8jbRWHrqf8vvDM8Zmf6mGKCTpCB7QqKmf1Pq1BgTfPp1GrsBwFAgSZlLaMJOAxjdZwCIH5IYEcLhzq3jFn1bYISNLHGWbivUT4CykT1evnR/lKPaN97gaNijnQ9POxa/MF6WN+S9FUfbbien8VU0O7tXcMWGNKoHfYqbCYQdtKOqp18mnpVmrvYGPthSx8NyyREycGQLZHCbv2Q1xheYkHTOR5/iepbfHe49zFKu6MIYE+83x9Aoq/BILdSGdIuzf0Wtj4dtncRmx6E99w== 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=7d9OPnim+dQ8PjkhePuL2xqi4lRmnMRAVgszwGm5eUM=; b=seJkMg7l+YswFfy+tnhcKhBCAdkiO2FrWY6/nvUIoWVqgEs1ZeF2T7vCGSEyNl3Kuns21XGWAdUq23h+vCHEM/wILkQbMbbsrVmqrT+nN8SeeQmW5SSP/6oB1lz96ZTRQ2DIJMLrsywKrsR0dFnHOm5bdcUjFfciVQp5vSo+vQI= Received: from SN6PR05CA0028.namprd05.prod.outlook.com (2603:10b6:805:de::41) by CH2PR02MB6294.namprd02.prod.outlook.com (2603:10b6:610:e::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.31; Thu, 20 May 2021 08:11:17 +0000 Received: from SN1NAM02FT0042.eop-nam02.prod.protection.outlook.com (2603:10b6:805:de:cafe::72) by SN6PR05CA0028.outlook.office365.com (2603:10b6:805:de::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.12 via Frontend Transport; Thu, 20 May 2021 08:11:16 +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 SN1NAM02FT0042.mail.protection.outlook.com (10.97.4.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4129.27 via Frontend Transport; Thu, 20 May 2021 08:11:16 +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; Thu, 20 May 2021 01:10:14 -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; Thu, 20 May 2021 01:10: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=42624 helo=xhdnavam40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1ljdkz-0007IV-8Z; Thu, 20 May 2021 01:10:13 -0700 From: Nava kishore Manne To: , , , , , , , , , , , , , , , , , , , , CC: Appana Durga Kedareswara rao Subject: [PATCH v6 2/4] dt-bindings: fpga: Add binding doc for versal fpga manager Date: Thu, 20 May 2021 13:39:52 +0530 Message-ID: <20210520080954.1393-3-nava.manne@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210520080954.1393-1-nava.manne@xilinx.com> References: <20210520080954.1393-1-nava.manne@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f1474629-b071-4e9d-1e55-08d91b66d7a3 X-MS-TrafficTypeDiagnostic: CH2PR02MB6294: 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: W+2zQNtXl+XJzNFPcJ8mX7bCTnKT98a6AondExH1HecyokcfeX0ZN3sDERuVygr3Uiuofx7VJbbzADOzZ0m+qENFXJjnOzLA5/C5QVdJYr601ta/MqDSWj9MnWz1sVJ6fCurKqaTCFu+4Z4whWuFtGWOarZALeyVQ1O0lF12h8H694GtMWCpZMatXmlh9rXUyxDiKyCYvavJhI/oHL0Tf4TpB1+OW+PTMp36fh+Xc/PDUTpOGjM4xUVZ0dBVqXxlBBimOFBUGlTNui9NYl/IyHZ6bg9t1xaZKxb4nOoXxRuckGOYzWUv8JrxMJLtZLNNp1pAb3rNejv37e26nsBG6HvrhEkXhxQp9ZoKeAFavsPSq0XsPw7PUZAz7stfS/TqnTdeZb2ll3nal+9PwrG3thiFU5z8ETHLOPD9aCwhQMtJkK8+BgebePzEJRsuGUTg2vaMr0iAEq1Hrn9WCD845rkuTsMmqCxwxA8YJal0YFtvuej5V4zklSIybXOtNQO+uoh2gkdAu7ri3OHGLCwGpRWCxTFH1JDIVfD1XE/7K5/2Gko3dtLowTqKYQkwC3azKGVe+oA54ZJ9GcwoOicDD3dXCWxuSBafHG7v0mYXrrv/48bHu36jzU+TFHw3q4xuGsHo3QnM7/5AZZTTTDbfB9l3GF4HavinuYZUb1djoHFZUWFQpohjgF/MllABvZF2CbuwfK/QmmbLwuRalyoJBVdTWyRpENtxpeBm3EjFHwpQky9vS0sRGe/acv5VPi6IoJXFPYPR7qxVHLKW1/03eG5kR92ZT1PoiilD+2BB4Ipw38lw4CUHxqfDgFQzChZB 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)(346002)(396003)(39850400004)(376002)(46966006)(36840700001)(47076005)(8936002)(2616005)(70586007)(478600001)(70206006)(336012)(316002)(36906005)(26005)(82310400003)(1076003)(110136005)(2906002)(966005)(107886003)(82740400003)(7696005)(4326008)(426003)(356005)(36756003)(7636003)(9786002)(5660300002)(36860700001)(83380400001)(8676002)(6666004)(7416002)(921005)(186003)(102446001)(2101003)(83996005); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 08:11:16.7241 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f1474629-b071-4e9d-1e55-08d91b66d7a3 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: SN1NAM02FT0042.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR02MB6294 Precedence: bulk List-ID: X-Mailing-List: devicetree@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. .../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 Thu May 20 08:09:53 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: 443493 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 EDF69C43460 for ; Thu, 20 May 2021 08:10:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D198F610A2 for ; Thu, 20 May 2021 08:10:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231184AbhETIL5 (ORCPT ); Thu, 20 May 2021 04:11:57 -0400 Received: from mail-mw2nam12on2045.outbound.protection.outlook.com ([40.107.244.45]:54049 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231211AbhETILz (ORCPT ); Thu, 20 May 2021 04:11:55 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hY6orsAWzG0Y9ZwWaO1cCvee0WRdDpM8XZN9O5zVSKoBgmuExNXyb0Him19Rd/PelSD98BCwXkNp1n1BESIM64O2qFxRuqLHyibBpVl+uZmZ8ulIZhJaMrXHWePlwGYRROtlO253TWE1fUFTo04rmRQqOrsXzY1P2ATKNwxeoC+n7zxINS7FH8bw6i87S3NND8DA4ZjMwe1JdHRhtqH0ExFNoWOuagusG77hf/mq3ibOef2HKmgPn23CHWtWWV0aONV98qjIJpjEWyZA+qZy0lXhxdtu+4Vn+LAZcHmlv6xYG7t0BwjDTs88UjUVJBqKjIXnpZw0zAxPg8iET9I6LQ== 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=YrIy+6hP3NQzquFEHYUWYM9ay1KssBxMmQ5PbZ/rZqU=; b=ANk3xRsPQO1atrPgGfp/vm6u7h1aqAgHViadkaNPHQjwR1hcRWAqFZa2BqpRJj5Nxp0sqdNmbDOFfehctSSasr2KqxAIwZ91ARyqsznevmN3qjz8D0Dqxi3ZAXTdVS6fT+mhNYYA2p2ndpcvwtDlK0NzdF2mgAU1y+E5Wr7/mRURc5+JI64qWibSBrY3I6xbBWnlQcrmefsxn9MqZft7bpk/F5vkH0XaVZszgKoMdwDfftv6hsYxHtNxhdS9j3XZEnVuLGwl4oyoQ23A6+BI0YNSFF0HhTY8v4FAla1HyX2Tc0bWXAQOvN4Hf0BEeJ+FTT0WRexxbliJ3pKsR7b/gQ== 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=YrIy+6hP3NQzquFEHYUWYM9ay1KssBxMmQ5PbZ/rZqU=; b=qL6SdCzx+g201WCsBdDeYPajfUD7vX9C8o7EPExqGTx2kkaYOU/AED6W4zvTiQplYeEAJcK0SxpdC6X2hn4jxvXgy6nkzTp2BvX/LzKj5mAV/yGic0DfFfieJh9QR+cOgn6mGohrYfrpu9FX0TpICpAmmmIpXpMsegjHjeWRZd8= Received: from SA0PR11CA0117.namprd11.prod.outlook.com (2603:10b6:806:d1::32) by MN2PR02MB6079.namprd02.prod.outlook.com (2603:10b6:208:185::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.28; Thu, 20 May 2021 08:10:31 +0000 Received: from SN1NAM02FT0047.eop-nam02.prod.protection.outlook.com (2603:10b6:806:d1:cafe::b0) by SA0PR11CA0117.outlook.office365.com (2603:10b6:806:d1::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.23 via Frontend Transport; Thu, 20 May 2021 08:10: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 SN1NAM02FT0047.mail.protection.outlook.com (10.97.5.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4129.27 via Frontend Transport; Thu, 20 May 2021 08:10: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; Thu, 20 May 2021 01:10:25 -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; Thu, 20 May 2021 01:10:25 -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=42624 helo=xhdnavam40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1ljdl4-0007IV-K3; Thu, 20 May 2021 01:10:19 -0700 From: Nava kishore Manne To: , , , , , , , , , , , , , , , , , , , , Subject: [PATCH v6 3/4] dt-bindings: firmware: Add bindings for xilinx firmware Date: Thu, 20 May 2021 13:39:53 +0530 Message-ID: <20210520080954.1393-4-nava.manne@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210520080954.1393-1-nava.manne@xilinx.com> References: <20210520080954.1393-1-nava.manne@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e58186c0-f4e2-4c4e-8729-08d91b66bc76 X-MS-TrafficTypeDiagnostic: MN2PR02MB6079: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mKteWy7vUy596WVHnpHfofERVTx0KzJl1kIDtyPID5+7Q/OnGAnvZN6lxQ7NO94ii2GxeS9iBiaY84H4wpxLcVxmiCXTxupRWKnW5qbWe/QS1d/5Q0sR2j5zb1gVatH846fd5khgJQIZjzPNZoyKromm1aQZ/2V7NwO22PdBIGc9JBXz6P+OSFY8uFXwp6k0nGxN41pUtCXOXikkpZrw+42HrERukemBk4toy0tMkKF0yHsbZCOO3n0J5m2D3/9qD0yAKO4t46udwTPdfVvnmpiXz5sEEDRGEHrHo27whysAiS7wdD4WbXFipGYgnuNA4yrXvIOP0WTlE7Eur21uqsr16Zkjv7+KRsIQ0rIxkogWXBi2RHO8CEZRaOSn6i9XkM/OJkZgBxIp7egaPVtOXLzGI+6iDOuIyp/iz9AA8xv5Bma1RySKaelbl9V01I01IRyPN3T+EBCASSaWeGsEFlm6OwNwPELpOQuOcwN16DmNMozeZDviQlLHN85lH+FNUrom8ff1uGtKm3a3ePigTv/+X9UsjRxf1nFkLlYbj6pkZEuLGx959Cvciy38jN9nmyGleIuEZGZ9cFcu+fgTZWvq4t4NqXtllUAiRYeRWXFqde/OYDUtISrcb/iv+5gAiiyz7EJbhEMb/H9Te9Ab5SN1rZT6QQZpEDnIUevBy+Icr+QRQa3xjEjJA5Oo478Nw9QShphk4cqgpZ3YO93sQe2tZ0pE1/GhAK47q9erOCd2jQziPJKL32Jw/HW0cc9m58m10ZbyylpoZpvfC+5dhj9Cd6X+LcAxysPd7rDfECZMKm04T+JQAqT61ctjvToKJnA6C8aPIQeXSTbcK21byw== 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)(39850400004)(136003)(376002)(36840700001)(46966006)(2906002)(36756003)(110136005)(478600001)(36906005)(316002)(966005)(1076003)(8936002)(70586007)(8676002)(921005)(5660300002)(70206006)(7696005)(47076005)(9786002)(7636003)(26005)(356005)(6666004)(82740400003)(7416002)(83380400001)(82310400003)(186003)(2616005)(426003)(336012)(36860700001)(102446001)(2101003)(83996005); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 08:10:31.1334 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e58186c0-f4e2-4c4e-8729-08d91b66bc76 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: SN1NAM02FT0047.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR02MB6079 Precedence: bulk List-ID: X-Mailing-List: devicetree@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. .../firmware/xilinx/xlnx,zynqmp-firmware.yaml | 102 ++++++++++++++++++ 1 file changed, 102 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..58016191e150 --- /dev/null +++ b/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml @@ -0,0 +1,102 @@ +# 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 + + "zynqmp-aes": + $ref: "../../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 + required: + - compatible + + "clock-controller": + $ref: "../../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 + - "#clock-cells" + - clocks + - clock-names + +required: + - compatible + +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"; + }; + }; + +additionalProperties: false From patchwork Thu May 20 08:09:54 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: 443492 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 7CDF3C433B4 for ; Thu, 20 May 2021 08:11:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 604DA610A2 for ; Thu, 20 May 2021 08:11:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231221AbhETIMp (ORCPT ); Thu, 20 May 2021 04:12:45 -0400 Received: from mail-bn8nam11on2068.outbound.protection.outlook.com ([40.107.236.68]:13537 "EHLO NAM11-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231204AbhETIMo (ORCPT ); Thu, 20 May 2021 04:12:44 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KvQc9yOtt599wyBS+mp/w3EUfnwORc93bGJG4x087vxEzn5fofzAeBC0daUq9TPw+YAuKBrVwVlHpjpK/8nbmvNLqTsVZ2ivONLi/GBdZY+UOJjDOVDcQCo9Cm76JpCvzW5ynZ4wqKZBXKXjyU8+pu9DUXwxP3X4MALrBrjMRL7v1Clp8aJc17Z+mGMJQwDHJcDEecLVfRCup4RHUgOPisp7YJ/Fe2SMIoNaHMV9Es5K8KGHad0d7zSU8N1DqgVF2EwpnNzvRaJtbN6HXHTK62rczF8yRg4XtRoFpAG2JpgbYkITvswMb4xo/Uj8g5uT+s6Ump7GBClRfPZQlItOGw== 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=OGmf7Hjv4PEWUEIi/BvW4WUXmx19aOWf7foHEJ/I7m4=; b=BxRR+njM+LJsfSaHw1Dsc4QuzUaH2+uVgc8nTxZL/t/sNB1cVcoh+e1EyG/E++20bSWyn7wNZKd1SECzwM+Es7twf0vQPnzdZ8n03016K9O2Jl1d/oVErgwDdRBSrojOAYEmX/eB6JYI5/4aNwtsGAGBQvEe0rARUdG9rdqd3NYAMXOo4iutjP/ryf6nExMGbERc0bD2Lebwb+RklB4RILRsO0MWw/2TsA4vHEB3by/oZTjxixRBCIzXX/0wbCj5gsgJnbFiHQYKxNQN2l76vu2eEAHWethg7sXdTz5BdotV0DJGRDUzsUzDBJmo/8KpAKmm7hrJf5jb3LI/JXnSXg== 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=OGmf7Hjv4PEWUEIi/BvW4WUXmx19aOWf7foHEJ/I7m4=; b=Wi9ajSU6Ch4AxuY8eknTlZGDgYnDRaEWUwRHPva9gxJi3sw/zqcDlxoSrYjDM86RGjw/6jdniIrzCCWQUUJpT1B0Go/eQkdG90tUPGm//pyJAQIS8AaIIA8tvABnQ844S41CnYDr80NavciZpOo1pcuxe5jLumAN3zE6ur2COaM= Received: from SN6PR05CA0020.namprd05.prod.outlook.com (2603:10b6:805:de::33) by CH2PR02MB6120.namprd02.prod.outlook.com (2603:10b6:610:8::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.29; Thu, 20 May 2021 08:11:21 +0000 Received: from SN1NAM02FT0042.eop-nam02.prod.protection.outlook.com (2603:10b6:805:de:cafe::ca) by SN6PR05CA0020.outlook.office365.com (2603:10b6:805:de::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.12 via Frontend Transport; Thu, 20 May 2021 08:11:21 +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 SN1NAM02FT0042.mail.protection.outlook.com (10.97.4.129) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4129.27 via Frontend Transport; Thu, 20 May 2021 08:11:20 +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; Thu, 20 May 2021 01:10:25 -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; Thu, 20 May 2021 01:10:25 -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=42624 helo=xhdnavam40.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1ljdlA-0007IV-61; Thu, 20 May 2021 01:10:24 -0700 From: Nava kishore Manne To: , , , , , , , , , , , , , , , , , , , , CC: Appana Durga Kedareswara rao Subject: [PATCH v6 4/4] fpga: versal-fpga: Add versal fpga manager driver Date: Thu, 20 May 2021 13:39:54 +0530 Message-ID: <20210520080954.1393-5-nava.manne@xilinx.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210520080954.1393-1-nava.manne@xilinx.com> References: <20210520080954.1393-1-nava.manne@xilinx.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fbe37197-b989-4eb4-e948-08d91b66da2d X-MS-TrafficTypeDiagnostic: CH2PR02MB6120: 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: U0jVl8kPXBTKnAjmxEgBjI/P01rtfLgvxTirzsDEuEhknU4VHZdO0t18PEaxxDpY3Ixw/uJf4JYl0nzMr8gu7Es5p7vH6NP1TssgX96WjEPIsLZkn2jHYFF6eIIwRGIG48MrVIQdaxuz7V4qf8oS/12H/4iqM0pEnjC/6UBrLV4q3RwviRgqmpDWTYArnDDkf0Q/X2AnmFLSlfqExpLl/QMQQ2WgB9rAooy9CcdusRrt0UUv7BiUcUwFmqh1XJqjhqytNif1iY+tQ3W6ESMQpp5j2wuCR8+RyCSSD3mNS0MdwpOQBv7x2N7nMksLECHe/FnJCS8cdbyCwXxAaI/BDt5fiVyfXR7/18rxOzfW6NlfzKtTzk4pF5y9VYblTJa7LuyPO1ghiM5OfacPoZZVAnm2+QUN+2hTVNn2pXxU53IL+CjExLwX9H/Bgyjw7nhptx4GLQDbJLsPOdxBwimxBu6TVvLHbSm0b0Lkrh83odUpL6DCDl31Mfw/j+usty2/lA0/lk3+UcYC/jcezeWdnMUGKJkx5Fx2WqY6CnfBX3QSnyLHqJRnqWc1L893zbRQvQtV7ZIi9jY1QS6akHooKQGEtcPC42fWsNGE3vrm9jQOiWoL1xYtv2F0rwMsA4zXIyTlJEVOvWCkCsiWPrVogaZfQHhOAzaF5ABDrr11JUthsgAMkCbZ58n0/sQFiiDaMADT4FRjypWOJKsFkz34nIjCt4LCLYkhRUw4Jk4KnEmTLcRt+hp1Qo3H9WJ9fg4H 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)(346002)(39850400004)(376002)(396003)(36840700001)(46966006)(186003)(82740400003)(8936002)(8676002)(83380400001)(26005)(356005)(336012)(7636003)(82310400003)(1076003)(921005)(9786002)(47076005)(7696005)(4326008)(6666004)(36756003)(36860700001)(426003)(110136005)(5660300002)(36906005)(7416002)(2906002)(2616005)(70206006)(107886003)(316002)(70586007)(478600001)(102446001)(83996005)(2101003); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2021 08:11:20.9912 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fbe37197-b989-4eb4-e948-08d91b66da2d 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: SN1NAM02FT0042.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR02MB6120 Precedence: bulk List-ID: X-Mailing-List: devicetree@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. 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");