Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2246947rdb; Fri, 8 Dec 2023 02:39:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IHO3I4LJxn6N3o7YAoM7nFmKaxlu6o8VJ1YAOa65Y7uL/j4dN5x63ft3w8nArt1GzmnD5+m X-Received: by 2002:a05:6a21:1a9:b0:187:7678:f354 with SMTP id le41-20020a056a2101a900b001877678f354mr4283915pzb.6.1702031977275; Fri, 08 Dec 2023 02:39:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702031977; cv=none; d=google.com; s=arc-20160816; b=q4arQexEogNSr54KLkL+OdHUpeO3EJ92Q2t7Cl2G3EtEQ6dinj5AygStYZO1nas54t 6ZYgxMCWb5Z/bVy3bixUlck4DsQRsupb8KCEw2JIX8wCq6Rd8CQKVihFCFaz3ZMHdJa5 nz6m7SK8M8+sFd/JUf/qRTTkS8bMO8Y816zwPfIauplC9uVh3ns+ncTdTz3yXRZyRIkJ 4Vol2T7fYfb7DRfNx4b/dPUjbX7lQgPEYCEQzeblnBNslxWPbC6FNc9chZWZa9gsqPAK rhL39MklUs+tI67ojQt24lUUeRF35YV9kC0TKG5v3MHr9sj6TVPvqJXesYIQXJVoeKkL vn7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wUV4Z2L3eq2zGxzSp+oana3TYX+eCIBl6pOAU/h5J+4=; fh=YxJ3fTojnx6TEv5N/Qdt4q819eWuI9g0IhNjjJFQG8Q=; b=iOqXB72D8v9WxjkTnHqKiHRrdaUp4by4g00HVAzRKaNt57aa9GEv118AJPX/uZUT7d gTL+zohQPoavDoiyySbVQs22rflRJRLQMPHlZccSyyCJI1ClYeTRsyl7me4KBs6VZZeH nmgPuQ+2pSFYXLNLux0BsOP1Vo5K7q+5DKMZjMw1Ps0AAPNilbaEekGXhR6Qi1NQsAO9 K+9qI/+1G7ufrHyBnZyyRod3LOzPXFktn37LUSbY46HfsEPkKrvNZU8WZmD/ysns3AUn RZL3wfMU6is/sgRvI1ae0Vvvzi4gg/xheGTNDneL2hHDgayQhrJP8kO7/Li4XttpcJ0U mJkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=XjMLrnR1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id n2-20020a170902d2c200b001cfdfa28b70si1382901plc.469.2023.12.08.02.39.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 02:39:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=XjMLrnR1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 04149836E455; Fri, 8 Dec 2023 02:39:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1573643AbjLHKjW (ORCPT + 99 others); Fri, 8 Dec 2023 05:39:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573764AbjLHKjC (ORCPT ); Fri, 8 Dec 2023 05:39:02 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D6BD1BE3; Fri, 8 Dec 2023 02:38:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1702031921; x=1733567921; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2EQm1WbcHBB0qSzV6W9atlXp3QWQx/LQ8hNLQCOVPww=; b=XjMLrnR1BYOfqjIMufW5l5GNysiZ/p3l3qfCBzhheGmQQDKaZTid1kdl vQGPLV92AvzViZSt53UnpcaSkybXLtT08jsr0lcTZhs6G6B16i7wXPf+0 f9cviRjtNL1XyiJRUD248lHfCC3Ed3FzbVRyZ3pMZYdmryhL22EGszAL9 +AvbrT+Pakq+pjArkK4+Un3bJ8X2VWI7SHd+F1Nr2+5qAsvirrEVY3LQP bwDyO6FMH+I8iHC3BkPuTvSTvnWqcTgoMVUn2nJh4SBc3piSqoJN9A8MV 64SoeYeSXJKIYsqJ5gg0rjrFO99xx6/i77zJM7Ghq66pBh8QlbxEGE5+2 Q==; X-CSE-ConnectionGUID: Cvz3gSbpStiroKFn2Lwqew== X-CSE-MsgGUID: TlwQAlMGSYWg/x1j129+hg== X-ThreatScanner-Verdict: Negative X-IronPort-AV: E=Sophos;i="6.04,260,1695711600"; d="scan'208";a="13864089" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 08 Dec 2023 03:38:40 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 8 Dec 2023 03:38:04 -0700 Received: from microchip1-OptiPlex-9020.microchip.com (10.10.85.11) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Fri, 8 Dec 2023 03:37:59 -0700 From: shravan chippa To: , , , , , , CC: , , , , , , , Emil Renner Berthing Subject: [PATCH v5 3/4] dmaengine: sf-pdma: add mpfs-pdma compatible name Date: Fri, 8 Dec 2023 16:08:55 +0530 Message-ID: <20231208103856.3732998-4-shravan.chippa@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231208103856.3732998-1-shravan.chippa@microchip.com> References: <20231208103856.3732998-1-shravan.chippa@microchip.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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 morse.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 (morse.vger.email [0.0.0.0]); Fri, 08 Dec 2023 02:39:35 -0800 (PST) From: Shravan Chippa Sifive platform dma (sf-pdma) has both in-order and out-of-order configurations but sf-pdam driver configured to do in-order DMA transfers, with out-of-order configuration got better throughput in the PolarFire SoC platform. Add a PolarFire SoC specific compatible and code to support for out-of-order dma transfers Reviewed-by: Emil Renner Berthing Signed-off-by: Shravan Chippa --- drivers/dma/sf-pdma/sf-pdma.c | 27 ++++++++++++++++++++++++--- drivers/dma/sf-pdma/sf-pdma.h | 8 +++++++- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/drivers/dma/sf-pdma/sf-pdma.c b/drivers/dma/sf-pdma/sf-pdma.c index 6109e1c5a09e..428473611115 100644 --- a/drivers/dma/sf-pdma/sf-pdma.c +++ b/drivers/dma/sf-pdma/sf-pdma.c @@ -25,6 +25,8 @@ #include "sf-pdma.h" +#define PDMA_QUIRK_NO_STRICT_ORDERING BIT(0) + #ifndef readq static inline unsigned long long readq(void __iomem *addr) { @@ -66,7 +68,7 @@ static struct sf_pdma_desc *sf_pdma_alloc_desc(struct sf_pdma_chan *chan) static void sf_pdma_fill_desc(struct sf_pdma_desc *desc, u64 dst, u64 src, u64 size) { - desc->xfer_type = PDMA_FULL_SPEED; + desc->xfer_type = desc->chan->pdma->transfer_type; desc->xfer_size = size; desc->dst_addr = dst; desc->src_addr = src; @@ -493,6 +495,7 @@ static void sf_pdma_setup_chans(struct sf_pdma *pdma) static int sf_pdma_probe(struct platform_device *pdev) { + const struct sf_pdma_driver_platdata *ddata; struct sf_pdma *pdma; int ret, n_chans; const enum dma_slave_buswidth widths = @@ -518,6 +521,14 @@ static int sf_pdma_probe(struct platform_device *pdev) pdma->n_chans = n_chans; + pdma->transfer_type = PDMA_FULL_SPEED | PDMA_STRICT_ORDERING; + + ddata = device_get_match_data(&pdev->dev); + if (ddata) { + if (ddata->quirks & PDMA_QUIRK_NO_STRICT_ORDERING) + pdma->transfer_type &= ~PDMA_STRICT_ORDERING; + } + pdma->membase = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(pdma->membase)) return PTR_ERR(pdma->membase); @@ -603,9 +614,19 @@ static void sf_pdma_remove(struct platform_device *pdev) dma_async_device_unregister(&pdma->dma_dev); } +static const struct sf_pdma_driver_platdata mpfs_pdma = { + .quirks = PDMA_QUIRK_NO_STRICT_ORDERING, +}; + static const struct of_device_id sf_pdma_dt_ids[] = { - { .compatible = "sifive,fu540-c000-pdma" }, - { .compatible = "sifive,pdma0" }, + { + .compatible = "sifive,fu540-c000-pdma", + }, { + .compatible = "sifive,pdma0", + }, { + .compatible = "microchip,mpfs-pdma", + .data = &mpfs_pdma, + }, {}, }; MODULE_DEVICE_TABLE(of, sf_pdma_dt_ids); diff --git a/drivers/dma/sf-pdma/sf-pdma.h b/drivers/dma/sf-pdma/sf-pdma.h index d05772b5d8d3..215e07183d7e 100644 --- a/drivers/dma/sf-pdma/sf-pdma.h +++ b/drivers/dma/sf-pdma/sf-pdma.h @@ -48,7 +48,8 @@ #define PDMA_ERR_STATUS_MASK GENMASK(31, 31) /* Transfer Type */ -#define PDMA_FULL_SPEED 0xFF000008 +#define PDMA_FULL_SPEED 0xFF000000 +#define PDMA_STRICT_ORDERING BIT(3) /* Error Recovery */ #define MAX_RETRY 1 @@ -112,8 +113,13 @@ struct sf_pdma { struct dma_device dma_dev; void __iomem *membase; void __iomem *mappedbase; + u32 transfer_type; u32 n_chans; struct sf_pdma_chan chans[] __counted_by(n_chans); }; +struct sf_pdma_driver_platdata { + u32 quirks; +}; + #endif /* _SF_PDMA_H */ -- 2.34.1