Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4736808rdh; Wed, 29 Nov 2023 09:13:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IHe6I6dDWXXEvjfIMeJ8KTNMGP6E6Kp4jfZvfBc9zL+Rjxh+Az1Nirzhvc/CSQMXFxfxboy X-Received: by 2002:a05:6a00:1d23:b0:6be:b7c:f703 with SMTP id a35-20020a056a001d2300b006be0b7cf703mr19698508pfx.5.1701278021873; Wed, 29 Nov 2023 09:13:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701278021; cv=pass; d=google.com; s=arc-20160816; b=sV3M2xYCewiOQ/D5xbfkrtrOV7oOkcSUjINrbMVquD7OZ3ubje2eeV7VxkIbyNWWkZ Lzs8451ChkRMiD4QG0rt84oMDhAz72y53Pm4NHgRhh6WDZIHVHx2nrhDxVbC2Ua6laAv MQSzucGwAaf6rrvfijAPCJpVbHSA/1x6XhVgG3Df2RG/JPOG6Hur67CwCcNiLEoEU4zK FSxMGQp/KI8XVhQruAYwfv+BJH4v6K0oHw0PzlU0SkdM7iT2ISwcAMNV/KDvuQEDhgiq B3nAAU5Y1WCcyMPfFoVSPT6715Iu2CUMCvlBPBtkB2dZw0Csmwff5s3BISQvjmwuqiUx 99yw== 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 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id m21-20020a056a00081500b006cc0219fc85si11303979pfk.252.2023.11.29.09.13.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 09:13:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; 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 23.128.96.32 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 1773E803FC3F; Wed, 29 Nov 2023 09:13:39 -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 Content-Type: text/plain 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:39 -0800 (PST) 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 -- 2.34.1