From patchwork Tue Oct 31 05:27:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shravan chippa X-Patchwork-Id: 159957 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b90f:0:b0:403:3b70:6f57 with SMTP id t15csp24911vqg; Mon, 30 Oct 2023 22:27:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG+4GxsxNLuiNlbDUT4XcnRMnTvMMFTe7Ywt1dT3WV6cKjJYlxFkSGKFD0f+75/yh/Hzl3/ X-Received: by 2002:a17:902:cec4:b0:1cc:5c49:6af8 with SMTP id d4-20020a170902cec400b001cc5c496af8mr2447094plg.25.1698730040857; Mon, 30 Oct 2023 22:27:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698730040; cv=none; d=google.com; s=arc-20160816; b=g1zSzgDD2KCPJwy7Qc1kZex1NeNf+4H9Msa+CuGuGRrQ50Vaa3+VDCpEquOulEHDyp l7vigU4f8etUBJD/yYjJI7WPBBDhFSzvt7jKMYanzQI2Va0C3YtfTAPsg/rfYuWf9jOK xXlvw/wbf74pZlErbLHDHnLeGQZSGodX4oVThlKq/EhfloItqyaOgWNzr5rpBPKph3Uq Iz0PbbUhK59DlmbC4LfQt5gC2Rru/Xde33lvzghpFANjhn2qG45uKAIWn3kzq3Fjs8Qu sbnhRDoHiHljMtTf5bA2Au9Og2QnUTfFxDkVU+Z/JuCm4f1i9s97Ty75lYamK8wjKcgF f3vw== 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=VP1rvl/j5j5E4QXO+2ptxO026R2qrejyOjnPS2vbVQg=; fh=ShTRRczpu864z7u/uL8KOhQHPlzqNfTJPMMlbqeoRU0=; b=XfARBaQa2StX5o0WwnGJ+dgKNChz4Pg5YB/+lqzujn+rs9MR5mMwd/hj/AMSFNLvmP suGoZBJgqqsVSUyVNJFaYMYIAlfYB1RUvkowIvtc23rHl8rkckNpSH14BnRo8wsQPyPQ +iC7G19m/Wg+yVcdfKqGic7opG0L+DPcBKY3A3Zcuw+90WOqwvzjYRJzFuvK8cnHiaqF hPTWgLwPYeVHYb5U7ctZxoIk721/jTs9DdR+qvPq/llnq/C/Fct3PC5talt2Ycx8GCkf z0kHlqLlZObf6C2AgkwEiImJM2bQh24sY57+AamQweaeyjh2e7A0UNSGVZU0X1p4s+BA Ryxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=I0iwVpeq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id s18-20020a170903321200b001c413905d87si488956plh.49.2023.10.30.22.27.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 22:27:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=I0iwVpeq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 464638029AC0; Mon, 30 Oct 2023 22:27:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230409AbjJaF1P (ORCPT + 33 others); Tue, 31 Oct 2023 01:27:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230170AbjJaF1N (ORCPT ); Tue, 31 Oct 2023 01:27:13 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28041F3; Mon, 30 Oct 2023 22:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1698730031; x=1730266031; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zSkOZ12TKc1wwVLKvzsXxeC5tl7G/J3ooSzJ/My7COk=; b=I0iwVpeq/sEYsS8YRv41Hy3+VDNQTIeFfh6zjjFb8AlmAlVDK751VBoY EUBNyWu2HqSbOdanj7yAOsJTD6iPfyB38LJ3MVNwrpzCJQxvvdlcfOgXK qxbMX4kOX0E7kgRydc8PW0402phC8f/9eVXefXrqjdBBDWFdpVXH5n5mM EtFDLZh+MmNVFy6o4aFBPiMSLEska4hiBs1N4n7XrQ0w08k6tDT0OP6Bo +1YABoPHvQyNbKkItz4XjQOKo+Hk1D8BUz4EdpdMb0BhLn39SBQUwRhWF iXXTFBAfbMwcNS5VxOHaYbv/v69+dfJsHxP7TM1g2g4vhET1lODJQjpzT A==; X-CSE-ConnectionGUID: PIbu8/OSQLmLuwlEm2kgKw== X-CSE-MsgGUID: 4ywV+5BdQyKhiYDhnoDz9A== X-ThreatScanner-Verdict: Negative X-IronPort-AV: E=Sophos;i="6.03,265,1694761200"; d="scan'208";a="11483952" 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; 30 Oct 2023 22:27:10 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 30 Oct 2023 22:26:49 -0700 Received: from microchip1-OptiPlex-9020.microchip.com (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Mon, 30 Oct 2023 22:26:45 -0700 From: shravan chippa To: , , , , , , CC: , , , , , , Subject: [PATCH v4 1/4] dmaengine: sf-pdma: Support of_dma_controller_register() Date: Tue, 31 Oct 2023 10:57:50 +0530 Message-ID: <20231031052753.3430169-2-shravan.chippa@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231031052753.3430169-1-shravan.chippa@microchip.com> References: <20231031052753.3430169-1-shravan.chippa@microchip.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 30 Oct 2023 22:27:19 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781247551436937718 X-GMAIL-MSGID: 1781247551436937718 From: Shravan Chippa Update sf-pdma driver to adopt generic DMA device tree bindings. It calls of_dma_controller_register() with sf-pdma specific of_dma_xlate to get the generic DMA device tree helper support and the DMA clients can look up the sf-pdma controller using standard APIs. Signed-off-by: Shravan Chippa --- drivers/dma/sf-pdma/sf-pdma.c | 44 +++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/drivers/dma/sf-pdma/sf-pdma.c b/drivers/dma/sf-pdma/sf-pdma.c index d1c6956af452..4c456bdef882 100644 --- a/drivers/dma/sf-pdma/sf-pdma.c +++ b/drivers/dma/sf-pdma/sf-pdma.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include "sf-pdma.h" @@ -490,6 +491,33 @@ static void sf_pdma_setup_chans(struct sf_pdma *pdma) } } +static struct dma_chan *sf_pdma_of_xlate(struct of_phandle_args *dma_spec, + struct of_dma *ofdma) +{ + struct sf_pdma *pdma = ofdma->of_dma_data; + struct device *dev = pdma->dma_dev.dev; + struct sf_pdma_chan *chan; + struct dma_chan *c; + u32 channel_id; + + if (dma_spec->args_count != 1) { + dev_err(dev, "Bad number of cells\n"); + return NULL; + } + + channel_id = dma_spec->args[0]; + + chan = &pdma->chans[channel_id]; + + c = dma_get_slave_channel(&chan->vchan.chan); + if (!c) { + dev_err(dev, "No more channels available\n"); + return NULL; + } + + return c; +} + static int sf_pdma_probe(struct platform_device *pdev) { struct sf_pdma *pdma; @@ -563,7 +591,20 @@ static int sf_pdma_probe(struct platform_device *pdev) return ret; } + ret = of_dma_controller_register(pdev->dev.of_node, + sf_pdma_of_xlate, pdma); + if (ret < 0) { + dev_err(&pdev->dev, + "Can't register SiFive Platform OF_DMA. (%d)\n", ret); + goto err_unregister; + } + return 0; + +err_unregister: + dma_async_device_unregister(&pdma->dma_dev); + + return ret; } static int sf_pdma_remove(struct platform_device *pdev) @@ -583,6 +624,9 @@ static int sf_pdma_remove(struct platform_device *pdev) tasklet_kill(&ch->err_tasklet); } + if (pdev->dev.of_node) + of_dma_controller_free(pdev->dev.of_node); + dma_async_device_unregister(&pdma->dma_dev); return 0; From patchwork Tue Oct 31 05:27:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shravan chippa X-Patchwork-Id: 159956 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b90f:0:b0:403:3b70:6f57 with SMTP id t15csp24873vqg; Mon, 30 Oct 2023 22:27:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMbtPxRJaEosBVi+xZkAhd7EqGJOlS3CX2Q3t5VKzHSr8LXrbyVv46x6D8eBc+ckUOmXak X-Received: by 2002:a05:6a21:4995:b0:180:e069:57fd with SMTP id ax21-20020a056a21499500b00180e06957fdmr1949015pzc.36.1698730032102; Mon, 30 Oct 2023 22:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698730032; cv=none; d=google.com; s=arc-20160816; b=IIdG8Em/AclniIJB3nrJ48Kl2ul7qCyRt7f1zfiX/h+vNwf79fvVhBDiT+hFamHakF b/Se+13TbL6LB4JLuAKIF13ZVKv9Sg2mifiIkKPbTkAllkuIwCaOdFygNRih3e9Xacvs r7GeOzuIN9g487sGBQwnNk46yev9v/23AWLu/D6zbFvhj/ioZfpyvt/AqsI6Cvp3oec7 8PQOTCSmF0Sw6WBXych20w+sbwuF75Q9SauCVtXJ6sAJOk3+DnUNJgow82MINeNHd3cH +sWX1JrLUNE4XQzVXTrT9TCZwCLxtqVT8Bjk6+MDC70LBVsYbexeXjgOrtiaevxekYvV 6aBQ== 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=2AhRWMcEq8tmHBamltUSruil65DVvqAHbhJZ3g+WpCc=; fh=G3bdubTV0+o+8hUeMfd0vNMrcf0Z3JqHvJT+qGOcRCw=; b=AZanftkz0d2ZGZXYXkphu65kA4n9glgvNk6hKa9p0wlKOiWBskqcfEnx6Qprif/XiC kC6mgX59ePU8fxjwVW9BaqUyQ7OmBTte6zsQLE1+bQZ/ixfua8YVzge7uZU7onKE/BIH BGexynCPnpAPe8HW/7Y3TZI7c24l4RFy9x/kyyprDxIRRphqOVFZY/yIHJTsJfmwgY+p NaMIFJxXWUv97SrYHWYSXdPSbaqdaj2FcVcM+PTED0xPwTXN4idVTJHm+gm9KDv+7k6y M74KL5jdKU2XrDJ/IT0jN+cOatOW1B44HSSQerqgYdkvRKXRgxvkgWehWzZL1ILtz+wt FBUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=HiF1vWnO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id g4-20020a17090ae58400b002803426321asi435702pjz.175.2023.10.30.22.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 22:27:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=HiF1vWnO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 3BDDB802A6FA; Mon, 30 Oct 2023 22:27:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230210AbjJaF1H (ORCPT + 33 others); Tue, 31 Oct 2023 01:27:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229990AbjJaF1E (ORCPT ); Tue, 31 Oct 2023 01:27:04 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97805DD; Mon, 30 Oct 2023 22:27:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1698730022; x=1730266022; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GfT80d/okzC6viedL9X8itP99mbYjg+U5fLBnEZks9k=; b=HiF1vWnOrs+g69Ov1H4jAZC+al/iHp+Uenc3nG/f5LTNnsCJbelZJUH7 9OuDAx6QmKkMzg+08NLeMqFRU1pfU3oVEIknsi3l04lHEsouv0xelEEmG poSdyAk6IRFCJ7okdGYO5FNYLDMlxHs0YayIiiJHo/S2mu7sKOU+dvTE9 UGnGtYSwPXUvDOx5gGYXAGm0L28pTCClDSbn/Hn88J1uTo5rqxjYIVpMW 6Eayc4ME7byi3OdhhXRxCzgrdTcpATcBaSedowBAXvy9DoniwZMm+p5Xx lA9i80XHpzgq0pnTrTH0ZGgCN03diEzN8VW5Mz1tGWoHzbrysbquY4rWc w==; X-CSE-ConnectionGUID: chmGaGncRm67Nps8P+k0sw== X-CSE-MsgGUID: HNDa8IaYRmivNAZCf8863A== X-ThreatScanner-Verdict: Negative X-IronPort-AV: E=Sophos;i="6.03,265,1694761200"; d="scan'208";a="10872649" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Oct 2023 22:27:00 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) 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.21; Mon, 30 Oct 2023 22:26:56 -0700 Received: from microchip1-OptiPlex-9020.microchip.com (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Mon, 30 Oct 2023 22:26:51 -0700 From: shravan chippa To: , , , , , , CC: , , , , , , , Conor Dooley Subject: [PATCH v4 2/4] dt-bindings: dma: sf-pdma: add new compatible name Date: Tue, 31 Oct 2023 10:57:51 +0530 Message-ID: <20231031052753.3430169-3-shravan.chippa@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231031052753.3430169-1-shravan.chippa@microchip.com> References: <20231031052753.3430169-1-shravan.chippa@microchip.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 30 Oct 2023 22:27:11 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781247541889343900 X-GMAIL-MSGID: 1781247541889343900 From: Shravan Chippa Add new compatible name microchip,mpfs-pdma to support out of order dma transfers Reviewed-by: Conor Dooley Signed-off-by: Shravan Chippa --- .../devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml b/Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml index a1af0b906365..3b22183a1a37 100644 --- a/Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml +++ b/Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml @@ -29,6 +29,7 @@ properties: compatible: items: - enum: + - microchip,mpfs-pdma - sifive,fu540-c000-pdma - const: sifive,pdma0 description: From patchwork Tue Oct 31 05:27:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shravan chippa X-Patchwork-Id: 159958 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b90f:0:b0:403:3b70:6f57 with SMTP id t15csp25034vqg; Mon, 30 Oct 2023 22:27:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGuuFfDMOaHR99IC7JHkqSc0jW5gRIDN66KMDnK5GGXDCmhv5U3f07o9GbgweNkse07wPzx X-Received: by 2002:a05:6300:8005:b0:180:e4c1:3e88 with SMTP id an5-20020a056300800500b00180e4c13e88mr1787653pzc.53.1698730074008; Mon, 30 Oct 2023 22:27:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698730073; cv=none; d=google.com; s=arc-20160816; b=SzKFAT2OmTvKsShPxm4KtMyMU8ZhCjhMGi5iyjKkB0XquwCcZpOjtyNHPHeOB5SziJ hDZatwfnp2iPETlq44ypP2PcDOz1NWoWBV+NPj3p/DOSOQ0xCqXrkBjX6BeadRcu8iHN JqPtlmi9PQDewTMYxwphTO/2mIk2K9yyJFzuSn2cAF6EfxF/xH61M/Aa7/TBwMEZPadW 9VDg5RkZyMxsG39c4a5ymD9ewkHjF+/cEUGpbTNVAp1VtU7huqqxlGTutio+god/od4M XbI/PDEZS9iuG0MEPWAb0vrTEsnL5Ftu7BQzQAW+ltn+iPDTHw9VNxx1koIGrCiE4YCE ctwA== 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=pZM+ge74V8mWQnz4EMSzjMO8z4XiSKdQMqB0CI9kJC4=; fh=YxJ3fTojnx6TEv5N/Qdt4q819eWuI9g0IhNjjJFQG8Q=; b=QoEJyaRSDw5tty0EVLTLj680NMuPtxTo6ZfbO0YB1oTr0ZCD/vX80kELIf4ayg3Raj pzB1WV6KzAP3x7404PvkW3VNSEmVX2fNK6OZ4NHd7y5PrXyLBSnJJ2eMs4QFMe2NOoM0 2qMcl245/a588V/FEVOn+ZzlE42mlBo9HOUNY6dbuv7Y3WcARcBIhkQJRVlbbVz8tw1q uupk8o42dA3LI2J0SuzsHSsiq7AQlEqqV3w4zITSMfR6XoX99UtgzVAMlHcNTi3Mtgcp 8nYZnUJssXcE+SQNaHBXoibRegB65YS8mDnujMX8sGEiiyWWf9GKDt67EvB11wGQsxCx FuYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=DzNN6kKY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id k13-20020a170902f28d00b001cc3473657bsi494793plc.215.2023.10.30.22.27.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 22:27:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=DzNN6kKY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 32D798029C5B; Mon, 30 Oct 2023 22:27:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229456AbjJaF1u (ORCPT + 33 others); Tue, 31 Oct 2023 01:27:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230100AbjJaF1s (ORCPT ); Tue, 31 Oct 2023 01:27:48 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C880AFC; Mon, 30 Oct 2023 22:27:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1698730058; x=1730266058; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vJhEbYubpVGf21vpeHAIwxdulF7QvT8fhZVat8R+Pg0=; b=DzNN6kKYmFarxyO7Rkfx6W/7KoPUYJ49v0tpoGO+6NnnaJAuCex13Jp2 Zrnlkc/xLPJszCEXR9SRpfN2LFnSrTlulvu5F9Da15Y7zg49l7U1Am+2b 6MKSIizWv0/RKpYcO3smDg25Y166w4y2g+xkZ62DmyNZMO+xBDjLeCgnX 8Vs4YVa/C+yyQHa1epM1ovADCS28KgNqeB91+dysGkoLHRIF7VULkvV+5 JE0Cy27KGeqgKMKX0YTnt0CDMr41+Jfv4oD/sZSuSJa2gFhSHGgp1swjv KhtlJ29drU+rYzQh2vFT7/id6BNneO4CJGSASIo4koFUseYKJqfkbdK1l Q==; X-CSE-ConnectionGUID: r/YQwnBYQ0ihAZZkayWq2A== X-CSE-MsgGUID: wnCkYct9QTSxlNM17VuO5Q== X-ThreatScanner-Verdict: Negative X-IronPort-AV: E=Sophos;i="6.03,265,1694761200"; d="scan'208";a="11147693" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Oct 2023 22:27:37 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 30 Oct 2023 22:27:03 -0700 Received: from microchip1-OptiPlex-9020.microchip.com (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Mon, 30 Oct 2023 22:26:58 -0700 From: shravan chippa To: , , , , , , CC: , , , , , , , Emil Renner Berthing Subject: [PATCH v4 3/4] dmaengine: sf-pdma: add mpfs-pdma compatible name Date: Tue, 31 Oct 2023 10:57:52 +0530 Message-ID: <20231031052753.3430169-4-shravan.chippa@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231031052753.3430169-1-shravan.chippa@microchip.com> References: <20231031052753.3430169-1-shravan.chippa@microchip.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 30 Oct 2023 22:27:53 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781247586104607474 X-GMAIL-MSGID: 1781247586104607474 From: Shravan Chippa Sifive platform dma does not allow out-of-order transfers, 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 4c456bdef882..82ab12c40743 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; @@ -520,6 +522,7 @@ static struct dma_chan *sf_pdma_of_xlate(struct of_phandle_args *dma_spec, 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 = @@ -545,6 +548,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); @@ -632,9 +643,19 @@ static int sf_pdma_remove(struct platform_device *pdev) return 0; } +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 5c398a83b491..267e79a5e0a5 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[]; }; +struct sf_pdma_driver_platdata { + u32 quirks; +}; + #endif /* _SF_PDMA_H */ From patchwork Tue Oct 31 05:27:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shravan chippa X-Patchwork-Id: 159959 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b90f:0:b0:403:3b70:6f57 with SMTP id t15csp25080vqg; Mon, 30 Oct 2023 22:28:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHaR+azepW83Kl3my33/FBQwdjWZJ9f02p0mpNp3wwVBMo35vWmNFm3mPCmYDORsHMDqFWg X-Received: by 2002:a17:90b:1e42:b0:280:39f2:2f12 with SMTP id pi2-20020a17090b1e4200b0028039f22f12mr4746234pjb.26.1698730080178; Mon, 30 Oct 2023 22:28:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698730080; cv=none; d=google.com; s=arc-20160816; b=0GiWUs2XRBxFlvI0k3PHkUKE+JAwd8gaZ1CYCFCbHiqhftEeNdf1UL6OgYY0V+g9Md LTRBd5NB6Q/xBrFzql312BRBwqziExzTFpyr55h9Z6ZBuBkJlQe4mc9x7x6DBitaHPzB xVY/8m+cexOeTWHVKZ4qKwMd0jCL34F9Q61NbolBocZVr18ycY710UHuWkHUn2UU3euq SBogCWDNA+AJ+P0Um4hNq7YblFsUkAjF36HTMkS9BJ57aq1Kycoe3OntsWYIcj56MKeU zddajUZTQAICxnkayW5Sj4yUFFHHpo/GFABUgvLQOKvzg3MDqn9NUYIfkjKELST1Y9UP N1ow== 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=2hFOPyefzp0vy+HIFUHZ6EAzYORGpOeGTAT5an4gzoM=; fh=G3bdubTV0+o+8hUeMfd0vNMrcf0Z3JqHvJT+qGOcRCw=; b=akIHrQYl6sj45Py2oLaQdOFcaxKkbTi7ZgsXhdZxmS2l+6WX74ZknmZKKK5qed+a2q 4OkgQOj8/ZBkVZjTMagYa9nVZo9AhS14YPxOhmFAfYbXnnprR04M7ThTQaXpQAb5pVzI 2micSCp61LX1Tr7AlS2A69DEemf0HRlA0iAga0j2KVXII+O3B+HWRb+hrhTMeg1dgUBE 5pJKbASFBU9mVLHp7L/VHj+krcQSbKoOJS3ksj/31u0suCUQJPCrNZP0iiUrqd5n7pD9 H21whLru0hX0yEL26eA/vvuEmpJuI0Yo1kZ5UUCiGPSWbqHDTtaC3UxVNewtqE7Af2SD PJ8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=XMEkFqic; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id h18-20020a17090ac39200b00262f937bf93si451766pjt.77.2023.10.30.22.27.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 22:28:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=XMEkFqic; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 177D38029AC9; Mon, 30 Oct 2023 22:27:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230298AbjJaF1w (ORCPT + 33 others); Tue, 31 Oct 2023 01:27:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230458AbjJaF1t (ORCPT ); Tue, 31 Oct 2023 01:27:49 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEF13127; Mon, 30 Oct 2023 22:27:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1698730057; x=1730266057; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=C1uudXHVA96bE3M7IzGMDbFNA52Jp9HqO0R//AvJQXY=; b=XMEkFqiclX4//YGJSFwiloGSlQ4bcqtLddWWhhY/8JTJWdUsSS7rRoqf AxrxV4VRsD2iOKBEQGEcFNfPG/4Hmb03kcFL17XwpOd/u1LV0D9Doe8o+ xWsPcVE5R8MAVJ3XeTuzRVMWwDgyGPNAaHF2DazGHfiZXZuhZTzW/mqNa 0oEh5Kn0b7dWlnmUMdH6rSFxkCWI3Fxt1cky6LV9YEBzNyc2OuzBkcEnD Cx7bkkCaYo2xj4zQrqPpuPv8xWCiMhG9Sc4S04dri36wMTPtyVnJ5zDG+ qqM/RuNyKwjoUVwszgVauQRe7QOf9FOEUISZl7g8v301FLrhzyZo6q4II w==; X-CSE-ConnectionGUID: 7Mdkuys4ScWf0IbhX6cZYg== X-CSE-MsgGUID: BejErkrZQs2//qQqBo5PXQ== X-ThreatScanner-Verdict: Negative X-IronPort-AV: E=Sophos;i="6.03,265,1694761200"; d="scan'208";a="10872670" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 30 Oct 2023 22:27:36 -0700 Received: from chn-vm-ex04.mchp-main.com (10.10.85.152) 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.21; Mon, 30 Oct 2023 22:27:10 -0700 Received: from microchip1-OptiPlex-9020.microchip.com (10.10.85.11) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Mon, 30 Oct 2023 22:27:05 -0700 From: shravan chippa To: , , , , , , CC: , , , , , , , Conor Dooley Subject: [PATCH v4 4/4] riscv: dts: microchip: add specific compatible for mpfs' pdma Date: Tue, 31 Oct 2023 10:57:53 +0530 Message-ID: <20231031052753.3430169-5-shravan.chippa@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231031052753.3430169-1-shravan.chippa@microchip.com> References: <20231031052753.3430169-1-shravan.chippa@microchip.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 30 Oct 2023 22:27:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781247592520248165 X-GMAIL-MSGID: 1781247592520248165 From: Shravan Chippa Add specific compatible for PolarFire SoC for The SiFive PDMA driver Reviewed-by: Conor Dooley Signed-off-by: Shravan Chippa --- arch/riscv/boot/dts/microchip/mpfs.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/boot/dts/microchip/mpfs.dtsi b/arch/riscv/boot/dts/microchip/mpfs.dtsi index 104504352e99..f43486e9a090 100644 --- a/arch/riscv/boot/dts/microchip/mpfs.dtsi +++ b/arch/riscv/boot/dts/microchip/mpfs.dtsi @@ -221,7 +221,7 @@ plic: interrupt-controller@c000000 { }; pdma: dma-controller@3000000 { - compatible = "sifive,fu540-c000-pdma", "sifive,pdma0"; + compatible = "microchip,mpfs-pdma", "sifive,pdma0"; reg = <0x0 0x3000000 0x0 0x8000>; interrupt-parent = <&plic>; interrupts = <5 6>, <7 8>, <9 10>, <11 12>;