From patchwork Wed Nov 29 17:12:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lizhi Hou X-Patchwork-Id: 17288 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a5a7:0:b0:403:3b70:6f57 with SMTP id d7csp487543vqn; Wed, 29 Nov 2023 09:13:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IEz6+eQMMKlILUEYhKTaki0Hyk7SMgKmkG9gXBUMPScbchXbtMLtn0FLZ+ISdJnkHObXM7Q X-Received: by 2002:a92:c989:0:b0:35c:9098:9924 with SMTP id y9-20020a92c989000000b0035c90989924mr15611223iln.22.1701278011077; Wed, 29 Nov 2023 09:13:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701278011; cv=pass; d=google.com; s=arc-20160816; b=gtJzeYTbWm+3JeXJSsOjASj8vkocGCKIEWYssR7KzrbwlGGYdJsIV6AqV124XX358R emFVjuSK6Tnuhwhd94MIVpk9uN4uHS2Kpa1WI7OYn1K3kSpQ+dQ4Gthe3XxTOrcYiW6/ c08vnBTH44s/+LyApaR0sL29xSmA3FyyZU5ugkZ77EoBoAuQqbFvSzTaXDIzhInlQ9Ed rNJZNLmaZgeee0Tb70cUEDvm7jkjvxoH/gPK2AMek1PasR4r8rN2QxgAMr8DZOY3qp0G Gl7Ayffqeit3LUkBu4xPPk63EkfPOUz03y0i9foNvHpdir8nnk01nO584z0yhqm7j1WH gFdQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=qZnN9SNB4n7/VcY1jqeLLDYrEV1CGi1GOwI5nZNECkA=; fh=o92DHWzxf08ZDySemit1G8KY3BFL3+N5bgtlFUw4yTA=; b=nVewSLi96Nb8QuKxVSeohchVE10apfmo5ffyQGTRgcq3iJz3hrSq2iTMVIPxMnY9Yu Un8p0Bd+D3xuum7nOkCaWNH4mnxQMEaW+1Zy+0E6qrl/Uam/pBagD26Y0D+3fXNw/aNN mz1i6k1r5GHa09uzEnmyeP5nTn0xcYyHzdX8VqpsbJcZz6CzZVXd6nBlfbH6nGUeprK2 v/io91FA7YzmIM7xTouWgac98Sfd/QIDI04WeePt5osJMwJ9Uvj+666GSUKT7y0RFy2n qEiiS8Gk9DqAVvukQ6PLC3SqiYmQY5xUkpvIT4B0lmBqBElvEM434l79sgRUPCaVGmrv +PVg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=LXnuKl86; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id g3-20020a635203000000b005c5e24c7e8csi4833703pgb.414.2023.11.29.09.13.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 09:13:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=LXnuKl86; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id BFF92803F947; Wed, 29 Nov 2023 09:13:16 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231483AbjK2RM7 (ORCPT + 99 others); Wed, 29 Nov 2023 12:12:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229509AbjK2RM5 (ORCPT ); Wed, 29 Nov 2023 12:12:57 -0500 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2064.outbound.protection.outlook.com [40.107.243.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8BF0BE; Wed, 29 Nov 2023 09:13:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WBR7WY7MyaCJ8wGiLUr9EXOmne+7uSGfpg50V7I87IR5zwsa2Hd+fv8EwK1/MU9xyVTAPjetBOGHvq0BorblIx+cHS9t3C14EOGXCNwKdrFIJEnDIHR2yCg4D3yOeU9s/c0K1vbXIshziot10RDz65T26klzV6NUKfI9PwKvBAzkI3Ei3KcBuzmBzh0XIFlXO8h5yRl/+iTvwwVKbtV+6IFaTIO5jAaqZ5WrOhSK+ynXBKNNVZDK/QqyuRP7GP+/7gJ4zZIhpBe2deGUMBJaaVveqAE+tEdBtSU3GJbLmYEXM0tftQE0lVvm7oLt6XIvigh4w+e8lRQPSrdvRD24HA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qZnN9SNB4n7/VcY1jqeLLDYrEV1CGi1GOwI5nZNECkA=; b=SUxCsHxedZ8rjzb0CImggPFf9o8Bu6qbLEO6LOaAOzyCYupWEAg1A5vzgxEwpGW+/ZaqV+Z5jQMrfuURKOpdxOGDISpXZMZaxFiOp99dF0Ae39aCFst5Lo/RNDLMxvyjIgZxdiRg8rh7c3Xbf2MHb3Eo3o4jeP1bd764ChxcpCK8W9QjQIDO+htEJ6JT7HHdkUoeqrptYiTBoSSf6HQGmlqOu8Pmjiglp7fN8PMtie9d4C8CHe0ggf0Co/hGEkxk1TuJ+qK9BFyHNeiJ05KUeJVbA/KbEiu/+G3xLKB6aPWF3Xe5jPGhWYH9ge/YgAB5Vh/90RwpoGVqJ2FaJIBwRA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qZnN9SNB4n7/VcY1jqeLLDYrEV1CGi1GOwI5nZNECkA=; b=LXnuKl866btKOkE0su+BTEeoAnE2N0U4fPeImPFLbylGcvnQrfUAX/Yh3pAkhPySzybgS93Qt1piAG6ye7g7ziPunUpN9NYOWaiWKKxfKNyiViatdm86ZogQkWBFbDxnLU40U6w2hDeOna/EsSK/nQUAHaNXZzLnKlMF5ZTbI+0= Received: from CYZPR14CA0046.namprd14.prod.outlook.com (2603:10b6:930:a0::14) by BL1PR12MB5238.namprd12.prod.outlook.com (2603:10b6:208:31e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.23; Wed, 29 Nov 2023 17:12:57 +0000 Received: from CY4PEPF0000E9D4.namprd03.prod.outlook.com (2603:10b6:930:a0:cafe::3c) by CYZPR14CA0046.outlook.office365.com (2603:10b6:930:a0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7046.23 via Frontend Transport; Wed, 29 Nov 2023 17:12:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by CY4PEPF0000E9D4.mail.protection.outlook.com (10.167.241.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7046.17 via Frontend Transport; Wed, 29 Nov 2023 17:12:56 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Wed, 29 Nov 2023 11:12:54 -0600 Received: from xsjlizhih40.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.34 via Frontend Transport; Wed, 29 Nov 2023 11:12:54 -0600 From: Lizhi Hou To: , , CC: Lizhi Hou , , , Subject: [RESEND PATCH V7 0/2] AMD QDMA driver Date: Wed, 29 Nov 2023 09:12:18 -0800 Message-ID: <1701277940-25645-1-git-send-email-lizhi.hou@amd.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000E9D4:EE_|BL1PR12MB5238:EE_ X-MS-Office365-Filtering-Correlation-Id: f89f03b4-30b2-4ecb-a65e-08dbf0fe6e6b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: crdvj0VSZqG+NAYjufi2xxV14Pghl73DCnIucYyqLBggFL0p4PblEB1GDqH8qPX6Vxe9ISANVY2pfmfYyhZIu+KmOXweOkMkY6zfxTEbUGnaMr4Xuml1Vt0dlmfpyyqwQrScf2zC9H0NGpIeZecMY0XRg3s5lSrud96DKNSY4K9gAYkJpSPSS/yGplyUX/pgoXlpEybqshbe/oo10oYne6sbp+WhBql4MzNt5RUlADqi8w7jbuMHQ1KC5fn01HUOHBkiaj8HqVLG7TrLavDUTiWuHpJqjvkkTRf7QxmQMuCabucP/azeViXlN+817hub9T657F0fQi3Seq+WIT7idDctJ2jD+VjWE99e2DFgVYm9wBi9/KqTZevN2Fs9JJMe0LNYClwiiGEkHt1S3Ge6U98sCe50A3PQYqgh2tSyRaaECuHn1t3HB297JXCSWW43MNqn9iyfdyhLLlVvRil0/xpK+soBIBcsTu8PgTA6Y4Qyc2B/vxs+lppPjL/O3uPy7yKcYIlUYKpr3ziGgDPKNX2CCNoYT8mm7QZAR4ODD1lzDmBsIjqD5K+TbxFcJMYi0DLs0A8MH86aL91n/TN94+CP6seAQYwsQsKS8rhlytDiETkFS4FRBFa+uStkGsbPz1yBAIIj4RcW/jrOa9LRw363gg0jNwFro5AqbLIJhOdSMKu589Zkhofa6Ku1CMQSkK1FX2IISJty4SmJ7jpYnfIA05WW+mNL9o9CDBRe7ty+kWIt8dctMAd9xfkuuLoi86rlsdYHh09QyH+bjI1Ocvwz0o60+SPQ5FWUl1IDiQIJQ3V7N2F/x0ECdzvpwiXn9vIXl3Po4qU1bPtkOA2A0Q== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(346002)(396003)(136003)(39860400002)(376002)(230273577357003)(230173577357003)(230922051799003)(186009)(451199024)(64100799003)(1800799012)(82310400011)(36840700001)(46966006)(40470700004)(82740400003)(336012)(426003)(36860700001)(40480700001)(81166007)(40460700003)(83380400001)(47076005)(356005)(2906002)(110136005)(86362001)(44832011)(5660300002)(8936002)(8676002)(4326008)(316002)(70586007)(54906003)(70206006)(966005)(478600001)(6666004)(41300700001)(36756003)(26005)(2616005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2023 17:12:56.6871 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f89f03b4-30b2-4ecb-a65e-08dbf0fe6e6b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CY4PEPF0000E9D4.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5238 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 29 Nov 2023 09:13:17 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783919291538965262 X-GMAIL-MSGID: 1783919291538965262 Hello, The QDMA subsystem is used in conjunction with the PCI Express IP block to provide high performance data transfer between host memory and the card's DMA subsystem. +-------+ +-------+ +-----------+ PCIe | | | | | | Tx/Rx | | | | AXI | | <=======> | PCIE | <===> | QDMA | <====>| User Logic| | | | | | | +-------+ +-------+ +-----------+ Comparing to AMD/Xilinx XDMA subsystem, https://lore.kernel.org/lkml/Y+XeKt5yPr1nGGaq@matsya/ the QDMA subsystem is a queue based, configurable scatter-gather DMA implementation which provides thousands of queues, support for multiple physical/virtual functions with single-root I/O virtualization (SR-IOV), and advanced interrupt support. In this mode the IP provides AXI4-MM and AXI4-Stream user interfaces which may be configured on a per-queue basis. The QDMA has been used for Xilinx Alveo PCIe devices. https://www.xilinx.com/applications/data-center/v70.html This patch series is to provide the platform driver for AMD QDMA subsystem to support AXI4-MM DMA transfers. More functions, such as AXI4-Stream and SR-IOV, will be supported by future patches. The device driver for any FPGA based PCIe device which leverages QDMA can call the standard dmaengine APIs to discover and use the QDMA subsystem without duplicating the QDMA driver code in its own driver. Changes since v6: - Added a patch to create amd/ and empty Kconfig/Makefile for AMD drivers - Moved source code under amd/qdma/ - Minor changes for code review comments Changes since v5: - Add more in patch description. Changes since v4: - Convert to use platform driver callback .remove_new() Changes since v3: - Minor changes in Kconfig description. Changes since v2: - A minor change from code review comments. Changes since v1: - Minor changes from code review comments. - Fixed kernel robot warning. Lizhi Hou (2): dmaengine: amd: Add empty Kconfig and Makefile for AMD drivers dmaengine: amd: qdma: Add AMD QDMA driver MAINTAINERS | 8 + drivers/dma/Kconfig | 2 + drivers/dma/Makefile | 1 + drivers/dma/amd/Kconfig | 14 + drivers/dma/amd/Makefile | 6 + drivers/dma/amd/qdma/Makefile | 8 + drivers/dma/amd/qdma/qdma-comm-regs.c | 64 ++ drivers/dma/amd/qdma/qdma.c | 1185 ++++++++++++++++++++++++ drivers/dma/amd/qdma/qdma.h | 265 ++++++ include/linux/platform_data/amd_qdma.h | 36 + 10 files changed, 1589 insertions(+) create mode 100644 drivers/dma/amd/Kconfig create mode 100644 drivers/dma/amd/Makefile create mode 100644 drivers/dma/amd/qdma/Makefile create mode 100644 drivers/dma/amd/qdma/qdma-comm-regs.c create mode 100644 drivers/dma/amd/qdma/qdma.c create mode 100644 drivers/dma/amd/qdma/qdma.h create mode 100644 include/linux/platform_data/amd_qdma.h