From patchwork Thu May 4 14:57:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 90122 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp396754vqo; Thu, 4 May 2023 08:14:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6GUMyy5vDkJFLrN3RK9yHlG+DN7RuNMfaGPxkALZMdGnKAG8Vf6ZsMo3sIY9XQqU6cLa97 X-Received: by 2002:a17:90b:3101:b0:23f:962e:825d with SMTP id gc1-20020a17090b310100b0023f962e825dmr2720361pjb.1.1683213244066; Thu, 04 May 2023 08:14:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683213244; cv=none; d=google.com; s=arc-20160816; b=ej+OZfVvk7rJyUxYlQNNqQot6hcpOORwAp+Q0YtjidiXfIkrSezFhBN88Ql6Cwe3NR HoePCfR3tdInKtWs3F4DhtF1lNBsNJ5sfhm98zAmB32cJLub9YAUT77/iXhUNV/bzqAR BkElFZdt9LF7fhBNVDjYp2GjLEmNtND1WjauNOWii62uc3gNxBxwP4zrefhcuXlLwZHF h0ffbI1GBECWZEgy36nTr3kKOKVt4xY/L6P759ScUcPMIai2gg0pwX1oa0PialnJgs6y o17vedyw0Y5b4xvAqTMm61SDghn50B/7FAFMbfR4zuIU0a6if2uF5JOHtAl/16x98jsw KLrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=IBBR9Gpj6AENx07xObOvliG6DKbsyP8bVAT3ugF7Lw0=; b=KX+0+q3Th0kgsNwCLRUoVM2wKTapABeiIAdcaCFh8Wh2n/gYq0PC3LtkJDvOFhRpNK 76ptTGEO3O1etPO0asUP6FVEVD1EQkktpR5n2BfQvHSRvixqwv4bWumNLIXmxF989yBr pr/kF6DyXOoEHgTF/J7w9PY7TL9+7saIMM5pO2LPsAfBCjGkBdsQx/HNdQxPCGVkujLE OIBtEMfmLKbOY/BkH3ZKRlo4BMep0kvnY261QxjaGULXyrt+3JYk4KO/fUx9uxYaID19 wbF+MmPsgMv/SggJHzj9kG1zrtaZNlNRl8+4fBY8gBOUrmTEep4+KSuyeLwUvFL3Ehb2 PUPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=Bm+hotMw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 9-20020a17090a018900b0024e484c4071si4126454pjc.91.2023.05.04.08.13.26; Thu, 04 May 2023 08:14:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=Bm+hotMw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230389AbjEDO7G (ORCPT + 99 others); Thu, 4 May 2023 10:59:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230350AbjEDO67 (ORCPT ); Thu, 4 May 2023 10:58:59 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEC72527F for ; Thu, 4 May 2023 07:58:31 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-b9a7e3fc659so1331967276.1 for ; Thu, 04 May 2023 07:58:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683212285; x=1685804285; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=IBBR9Gpj6AENx07xObOvliG6DKbsyP8bVAT3ugF7Lw0=; b=Bm+hotMwTf3HmxBmAE5daNhihvDIBR6hTHsQD13iwNaFOBjVaTI+AwbBzFTHxfmDjS L9qr0x7GtBiXlzRprJjL9lPbhKPiTNgZRNqAVzlpB69tXujMAmuL2ooGL0Hj58gUgTz9 ttugCUEN/CMSwmfxNjycm7b0a74skHz4MJlFYORccprny/38mMSuE6kOOtEWSlhplbnw Yx/Wpq1rGI6do55XSfuyFmDVkH46p9+jpivruEX59DhlayUQ+ETdxyZAPrHT7lNmtAdI 8O5K+AzEA0nkN5J9MKx7h6ppG10WYH+eKCKmEjDim0EZ9khO6JRCLtT3mRpVgAXFVeig EUmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683212285; x=1685804285; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IBBR9Gpj6AENx07xObOvliG6DKbsyP8bVAT3ugF7Lw0=; b=LCmEnGYyHP0ZnxQh0v4bXDyzlWCocA5wzqc6a/YGfFIk3UOz/Ncdf+hLemhjPqe3Ns PCi0LomFToeGMqs7YT80pdjIvx7lGqHMJc0oC7FFl2VlLHQMzEXah9eiDzZVoGeQTWnm NP54wx7rPcA/V7h3LX6I9bJASPmHt5TzKNxIJC8cJz8jQ/anudq7JQMFvrUbyzo2VvdM HuD8aQKN39o40UzTyflqA9aysZPEM3KxyA0uLHlPY6oga+l7+iyk4mrE77w/dXhjMEhP b6XauomRbU/S9GsHEOwr43EKHZEG2L6zQ08jTeYsi7X2ICDGjpJcEYpZQKMq3Tvmlwhv QkLg== X-Gm-Message-State: AC+VfDxRV1ekwPOyFYZEvzFXGVlMgS8Dm0pa1344wUeMEdATSjzireTT r1SpWUQKRtGHvGrtNVW4NH7Dpz9PI17+yA== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a25:8490:0:b0:ba1:d0:7f7c with SMTP id v16-20020a258490000000b00ba100d07f7cmr76053ybk.2.1683212285420; Thu, 04 May 2023 07:58:05 -0700 (PDT) Date: Thu, 4 May 2023 14:57:31 +0000 In-Reply-To: <20230504145737.286444-1-joychakr@google.com> Mime-Version: 1.0 References: <20230504145737.286444-1-joychakr@google.com> X-Mailer: git-send-email 2.40.1.495.gc816e09b53d-goog Message-ID: <20230504145737.286444-2-joychakr@google.com> Subject: [PATCH 1/7] dmaengine: pl330: Separate SRC and DST burst size and len From: Joy Chakraborty To: Vinod Koul , Rob Herring , Krzysztof Kozlowski Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, manugautam@google.com, danielmentz@google.com, sjadavani@google.com, Joy Chakraborty X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764977010813992246?= X-GMAIL-MSGID: =?utf-8?q?1764977010813992246?= Add new variables in request configuration to handle source and destination AxSize and AxLen separately and allow them to have different values. This allows further patches to configure different AxSize and AxLen for optimum bus utilisation. Signed-off-by: Joy Chakraborty --- drivers/dma/pl330.c | 71 +++++++++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 25 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 0d9257fbdfb0..c006e481b4c5 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -240,6 +240,12 @@ enum pl330_byteswap { #define BYTE_TO_BURST(b, ccr) ((b) / BRST_SIZE(ccr) / BRST_LEN(ccr)) #define BURST_TO_BYTE(c, ccr) ((c) * BRST_SIZE(ccr) * BRST_LEN(ccr)) +#define SRC_BRST_SIZE(ccr) BRST_SIZE(ccr) +#define DST_BRST_SIZE(ccr) (1 << (((ccr) >> CC_DSTBRSTSIZE_SHFT) & 0x7)) + +#define SRC_BRST_LEN(ccr) BRST_LEN(ccr) +#define DST_BRST_LEN(ccr) ((((ccr) >> CC_DSTBRSTLEN_SHFT) & 0xf) + 1) + /* * With 256 bytes, we can do more than 2.5MB and 5MB xfers per req * at 1byte/burst for P<->M and M<->M respectively. @@ -305,8 +311,10 @@ struct pl330_reqcfg { bool nonsecure; bool privileged; bool insnaccess; - unsigned brst_len:5; - unsigned brst_size:3; /* in power of 2 */ + unsigned src_brst_size : 3; /* in power of 2 */ + unsigned src_brst_len:5; + unsigned dst_brst_size : 3; /* in power of 2 */ + unsigned dst_brst_len:5; enum pl330_cachectrl dcctl; enum pl330_cachectrl scctl; @@ -1204,7 +1212,10 @@ static int _bursts(struct pl330_dmac *pl330, unsigned dry_run, u8 buf[], const struct _xfer_spec *pxs, int cyc) { int off = 0; - enum pl330_cond cond = BRST_LEN(pxs->ccr) > 1 ? BURST : SINGLE; + enum pl330_cond cond = SINGLE; + + if (SRC_BRST_LEN(pxs->ccr) > 1 || DST_BRST_LEN(pxs->ccr) > 1) + cond = BURST; if (pl330->quirks & PL330_QUIRK_PERIPH_BURST) cond = BURST; @@ -1235,12 +1246,12 @@ static int _bursts(struct pl330_dmac *pl330, unsigned dry_run, u8 buf[], * for mem-to-mem, mem-to-dev or dev-to-mem. */ static int _dregs(struct pl330_dmac *pl330, unsigned int dry_run, u8 buf[], - const struct _xfer_spec *pxs, int transfer_length) + const struct _xfer_spec *pxs, int src_length, int dst_length) { int off = 0; int dregs_ccr; - if (transfer_length == 0) + if (src_length == 0 || dst_length == 0) return off; /* @@ -1253,9 +1264,9 @@ static int _dregs(struct pl330_dmac *pl330, unsigned int dry_run, u8 buf[], dregs_ccr = pxs->ccr; dregs_ccr &= ~((0xf << CC_SRCBRSTLEN_SHFT) | (0xf << CC_DSTBRSTLEN_SHFT)); - dregs_ccr |= (((transfer_length - 1) & 0xf) << + dregs_ccr |= (((src_length - 1) & 0xf) << CC_SRCBRSTLEN_SHFT); - dregs_ccr |= (((transfer_length - 1) & 0xf) << + dregs_ccr |= (((dst_length - 1) & 0xf) << CC_DSTBRSTLEN_SHFT); switch (pxs->desc->rqtype) { @@ -1369,16 +1380,18 @@ static inline int _setup_loops(struct pl330_dmac *pl330, struct pl330_xfer *x = &pxs->desc->px; u32 ccr = pxs->ccr; unsigned long c, bursts = BYTE_TO_BURST(x->bytes, ccr); - int num_dregs = (x->bytes - BURST_TO_BYTE(bursts, ccr)) / - BRST_SIZE(ccr); - int off = 0; + int num_dreg_bytes = x->bytes - BURST_TO_BYTE(bursts, ccr); + int num_src_dregs, num_dst_dregs, off = 0; + + num_src_dregs = num_dreg_bytes / SRC_BRST_SIZE(ccr); + num_dst_dregs = num_dreg_bytes / DST_BRST_SIZE(ccr); while (bursts) { c = bursts; off += _loop(pl330, dry_run, &buf[off], &c, pxs); bursts -= c; } - off += _dregs(pl330, dry_run, &buf[off], pxs, num_dregs); + off += _dregs(pl330, dry_run, &buf[off], pxs, num_src_dregs, num_dst_dregs); return off; } @@ -1446,11 +1459,11 @@ static inline u32 _prepare_ccr(const struct pl330_reqcfg *rqc) if (rqc->insnaccess) ccr |= CC_SRCIA | CC_DSTIA; - ccr |= (((rqc->brst_len - 1) & 0xf) << CC_SRCBRSTLEN_SHFT); - ccr |= (((rqc->brst_len - 1) & 0xf) << CC_DSTBRSTLEN_SHFT); + ccr |= (((rqc->src_brst_len - 1) & 0xf) << CC_SRCBRSTLEN_SHFT); + ccr |= (((rqc->dst_brst_len - 1) & 0xf) << CC_DSTBRSTLEN_SHFT); - ccr |= (rqc->brst_size << CC_SRCBRSTSIZE_SHFT); - ccr |= (rqc->brst_size << CC_DSTBRSTSIZE_SHFT); + ccr |= (rqc->src_brst_size << CC_SRCBRSTSIZE_SHFT); + ccr |= (rqc->dst_brst_size << CC_DSTBRSTSIZE_SHFT); ccr |= (rqc->scctl << CC_SRCCCTRL_SHFT); ccr |= (rqc->dcctl << CC_DSTCCTRL_SHFT); @@ -2656,7 +2669,7 @@ static inline int get_burst_len(struct dma_pl330_desc *desc, size_t len) burst_len = pl330->pcfg.data_bus_width / 8; burst_len *= pl330->pcfg.data_buf_dep / pl330->pcfg.num_chan; - burst_len >>= desc->rqcfg.brst_size; + burst_len >>= desc->rqcfg.src_brst_size; /* src/dst_burst_len can't be more than 16 */ if (burst_len > PL330_MAX_BURST) @@ -2735,8 +2748,10 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic( } desc->rqtype = direction; - desc->rqcfg.brst_size = pch->burst_sz; - desc->rqcfg.brst_len = pch->burst_len; + desc->rqcfg.src_brst_size = pch->burst_sz; + desc->rqcfg.src_brst_len = pch->burst_len; + desc->rqcfg.dst_brst_size = pch->burst_sz; + desc->rqcfg.dst_brst_len = pch->burst_len; desc->bytes_requested = period_len; fill_px(&desc->px, dst, src, period_len); @@ -2789,17 +2804,21 @@ pl330_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dst, while ((src | dst | len) & (burst - 1)) burst /= 2; - desc->rqcfg.brst_size = 0; - while (burst != (1 << desc->rqcfg.brst_size)) - desc->rqcfg.brst_size++; + desc->rqcfg.src_brst_size = 0; + while (burst != (1 << desc->rqcfg.src_brst_size)) + desc->rqcfg.src_brst_size++; - desc->rqcfg.brst_len = get_burst_len(desc, len); + desc->rqcfg.src_brst_len = get_burst_len(desc, len); /* * If burst size is smaller than bus width then make sure we only * transfer one at a time to avoid a burst stradling an MFIFO entry. */ if (burst * 8 < pl330->pcfg.data_bus_width) - desc->rqcfg.brst_len = 1; + desc->rqcfg.src_brst_len = 1; + + /* For Mem2Mem, set destination AxSize and AxLen same as source*/ + desc->rqcfg.dst_brst_len = desc->rqcfg.src_brst_len; + desc->rqcfg.dst_brst_size = desc->rqcfg.src_brst_size; desc->bytes_requested = len; @@ -2879,8 +2898,10 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, sg_dma_len(sg)); } - desc->rqcfg.brst_size = pch->burst_sz; - desc->rqcfg.brst_len = pch->burst_len; + desc->rqcfg.src_brst_size = pch->burst_sz; + desc->rqcfg.src_brst_len = pch->burst_len; + desc->rqcfg.dst_brst_size = pch->burst_sz; + desc->rqcfg.dst_brst_len = pch->burst_len; desc->rqtype = direction; desc->bytes_requested = sg_dma_len(sg); } From patchwork Thu May 4 14:57:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 90121 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp391534vqo; Thu, 4 May 2023 08:08:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ByIS3rWq4GW9zV+uj1cO/sQCOmNz+TYXse2x+spk+pLjL80z4hJ8xLG6nF8gzFqivQ0Vr X-Received: by 2002:a6b:6107:0:b0:769:82a4:4419 with SMTP id v7-20020a6b6107000000b0076982a44419mr9998617iob.14.1683212890589; Thu, 04 May 2023 08:08:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683212890; cv=none; d=google.com; s=arc-20160816; b=MwKN6Quh4p1yaRN5+VzvexH0aLtFjgvWhwZtnGk5D0lL9vjXDbzIr4DkV91uO2hEOj HnFc4Uy5CkHNWKVP6lcCTtoFUTVXQ21Z1xAhiluFuNLWTsr/BHW6aacbPHgGoq5gVsyL c3TnlNTMXk/3jKjdRXu8Grpinaj4O6H+sw1mW7BYDlECF/LFk0uCIA4QWEhvEWTYQ8ET PH5PFKmmS5El0xb/nPjPMjBuPICmrZ/9fwNNSWXnS82j+P/foaDfA30P2iseqhfKnnDV Gl3L2CGwKimXFc2CAAal7+g8o1s/h+lahplPiyObf5dOurmHEbxlvVVhcmrtTUd4aBZR 1j6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=FA/v04s+rMO6cV89w8yi7EFtwX7zbYFrIK72OYPFMEw=; b=ByTeGD9aBmzmqByTKze6TP3sZcXSx9eFFiZVNTqBzQVeE6Kb3XgMj6HhoGR+7afTG6 rUWbuU6+hPq7DBYSlVeUZMcbu4ad37ZPOoQ7lhQKWTRZTyjE24ojpFNPqWbCBV1+QE6a CsA3HyFFknkrUQ+dxITzocOfNgOM26mss4U28Vdao0I2XabCF02Dppy7XG8cp+LpPmAu OwDRP1+yicIhkec94h+Wnuuwum8x9gP4n33wJwvBVbm9E/ai59b40e21F6eRjnmbtchm 66B0zjtdWE25t24UYCTkKOUxk0OWOzHCDobz52NHmlIpNBEbzm5EJPFEohHynNXMexD2 IWJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=FMJmvHZO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i18-20020a05663813d200b0040faa822c8esi29692108jaj.39.2023.05.04.08.07.54; Thu, 04 May 2023 08:08:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=FMJmvHZO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231282AbjEDO7K (ORCPT + 99 others); Thu, 4 May 2023 10:59:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230211AbjEDO7D (ORCPT ); Thu, 4 May 2023 10:59:03 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F06683AA3 for ; Thu, 4 May 2023 07:58:36 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-55a7d1f6914so8438867b3.1 for ; Thu, 04 May 2023 07:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683212290; x=1685804290; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=FA/v04s+rMO6cV89w8yi7EFtwX7zbYFrIK72OYPFMEw=; b=FMJmvHZO0oQQ142FoQrFK15pvzpeXL1Lo2mjHlVRciBbfAk63P5FASSKbn0+TctAPZ 9WnMt+oGJjdflLbJEEShaU6sl2k2KcRxUM5D4yNimLQz+vAMsWCX1PSVlaxoIAkX9yen jw+7QzQyL8uQJwb6Cc8wkavUL9Y1N9OFgp2yMwDiBOXBVIp9M90E3G8P+2iGB9XHYJK/ mcrAQUTuRiiNbcgV4GuYDOpNbDdyANQxTJxpn+AVruKnn4/mG+Zrz6l+a0CKYzFjJVw1 R/F9OkCp0LXptXNjrM/2oSWTf6t1etVlMi4TtK9SsxiJd6gPu7Uglx7mJC72ZGft99P7 psPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683212290; x=1685804290; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FA/v04s+rMO6cV89w8yi7EFtwX7zbYFrIK72OYPFMEw=; b=RFwktXcNtOd5pOYDCNKfj4HaGWOUw1cOS/vLfUPrubhJowWR/uith/+5H99RF+r+xt 3Qxqh/xjatH7D1v2HAnB7SRr/Aj2oABICteOpEMMsgII09KJUZkukx7rP+Iii75p25g9 pDWoYiLnJpa2HopyorbW1QnRG0bsGTKd+7Rb1M2uA1z5aQOO+mxSECBy/PXtqWEVbWwQ WA4SDp7WAdMHKZ6KtAyI62Pwn7sObHp/vXpzxFkvxBJ1b2Prgq5xXAQkZKnkEseSGSYq 6yz7BZWRa9Pr4v038im2HamorrUPWt2hBZT8H4c9jcm4pUb9ajkBTW+G3mySJuS5kEmD 4UXw== X-Gm-Message-State: AC+VfDyZQ7vDMv6OFSVK+mh8CIO7hxRcTWfqRI7VswCSPk/fuJRvtjnF hJUJSqwp51VKB4kDNPts3QoQLtbW+j0NmQ== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a81:c148:0:b0:559:d8ad:560d with SMTP id e8-20020a81c148000000b00559d8ad560dmr1388760ywl.5.1683212290122; Thu, 04 May 2023 07:58:10 -0700 (PDT) Date: Thu, 4 May 2023 14:57:32 +0000 In-Reply-To: <20230504145737.286444-1-joychakr@google.com> Mime-Version: 1.0 References: <20230504145737.286444-1-joychakr@google.com> X-Mailer: git-send-email 2.40.1.495.gc816e09b53d-goog Message-ID: <20230504145737.286444-3-joychakr@google.com> Subject: [PATCH 2/7] dmaengine: pl330: Use FFS to calculate burst size From: Joy Chakraborty To: Vinod Koul , Rob Herring , Krzysztof Kozlowski Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, manugautam@google.com, danielmentz@google.com, sjadavani@google.com, Joy Chakraborty X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764976639571958846?= X-GMAIL-MSGID: =?utf-8?q?1764976639571958846?= Use __ffs to calculate burst size in pl330_prep_dma_memcpy() for consistency across the driver as other functions already use __ffs for the same functionality. Signed-off-by: Joy Chakraborty --- drivers/dma/pl330.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index c006e481b4c5..39a66ff29e27 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -2804,10 +2804,7 @@ pl330_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dst, while ((src | dst | len) & (burst - 1)) burst /= 2; - desc->rqcfg.src_brst_size = 0; - while (burst != (1 << desc->rqcfg.src_brst_size)) - desc->rqcfg.src_brst_size++; - + desc->rqcfg.src_brst_size = __ffs(burst); desc->rqcfg.src_brst_len = get_burst_len(desc, len); /* * If burst size is smaller than bus width then make sure we only From patchwork Thu May 4 14:57:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 90127 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp412670vqo; Thu, 4 May 2023 08:35:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ43WvjUYp4Ss6L6rkzjav1NT4OFkb+Bgg5ahLfnrHOBuVsi1j98zu5yDDNNVvH1ejnl8jqX X-Received: by 2002:a05:6a20:3d8c:b0:d9:6660:8746 with SMTP id s12-20020a056a203d8c00b000d966608746mr3173224pzi.18.1683214501342; Thu, 04 May 2023 08:35:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683214501; cv=none; d=google.com; s=arc-20160816; b=tAoyrtCsMv6N0PcxdttetsBpu7tU1KwKQUfoBVBOUIfGSYKIEDC0yvN2vegGussncF xSOFgiQZdF75fqU+Lh4qIkdn7FT2EYYyF+zDns1fbztHOCZKKAF7Y91qUB0KMzbdXQsF kwpmnZQWHBY7XxM6U9nEaSpmmBmulPuf/DtN17ClJNP3UG25fu+6PObIZD3+eurUTRuF b/ePQnpQsN87ZhtLiipgZ0N2w/zeNRWGl290ulk4LLeA4JMdZKj6eL/kyraj1T9xoEQ1 IkII2SN5lBvLbPYXbYt2uqydmviPWSRAI7WqxFGlnxf7CvVoQae8UGH9p283jcZrGfy1 36QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=ZW3YbnOWzAROANQ0CBt1Fwgra5x6iOOxVOyhCTd/l4A=; b=tphfCt7x1oTWoPLrS/WnvEoUSxfAPSQjXzunIJMm/e8Yy0FqKII8Ys1QfEHnUVofin 0J8OAIrOdiBW6lqGgi8DlSSVtxrV+4gh9N5ROD0Wr8V3fHFopA673kpE9J1TZIpMW0U4 dEOGTfSvjB2xW7YbrRie4BIvCW6ybYNhEIrxT8+twPL0OthTBaEWKBLIqF+VtKAJ0oev U0ZhR5TU31tdDC8w9100L0zD0QmCUCA9PECud9v9bW3TzW5lyKvbfYfrKLtcvKolUdqH +b3AaB2v35e7FLlQMIr+cQ7GpOS3M8e3X8XWiFuFQ0rhO/jCH/b47ioPILDQEURV7EZp hplw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=5s2YzHT1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k7-20020a6555c7000000b004f24be1c13csi35775774pgs.117.2023.05.04.08.34.47; Thu, 04 May 2023 08:35:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=5s2YzHT1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231200AbjEDO7R (ORCPT + 99 others); Thu, 4 May 2023 10:59:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231175AbjEDO7E (ORCPT ); Thu, 4 May 2023 10:59:04 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A471455A8 for ; Thu, 4 May 2023 07:58:38 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-b9a6f15287eso11745432276.1 for ; Thu, 04 May 2023 07:58:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683212294; x=1685804294; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=ZW3YbnOWzAROANQ0CBt1Fwgra5x6iOOxVOyhCTd/l4A=; b=5s2YzHT1XroaygOER5aXVBNbiAm4WFX/Ndy4UwMbss1mVh8cTf2unf4R4+e0d4uVb/ DckxyB7Hs1Zd5MMcaR93B6CdU2DzzPS5CBG/6x9Q7ocGJxJZgYxyKDiDZsLHeGjJVi4/ 36dQnJ2hDhP7aSu/exokzIMmcOyJYKcnLHTNAqgTtsmt4nKCDDW7SUsI7oFKEfn/onF5 o/YbzYvXxjfduWBsulERXdQDEgsuMTH3JrOWh9p/7jzRxPDCa/bteXRw563bEMPzIr7a aZaSYlihzs0DMnNmab5t2pNRTyqXJn7LjkxNHm1R/SQpvRIkl9Ww6qkgYlE8y7I0nsz/ hmzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683212294; x=1685804294; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZW3YbnOWzAROANQ0CBt1Fwgra5x6iOOxVOyhCTd/l4A=; b=Bd+/FcYctaQtSioBkyNakGs8CrQ6ij9fplUy8KIrO3V7Yv5E3zkQSw5YSC62ZWqG3F xrOfONgw8h2hoaJhzhcu/7XFgJZaWKfxx+Jg5avETwWQuUT59rmxNCL6wcK+Swshu4L9 Qx5a06CqlLCug0URA5ZwbeAB8japoUY1IwXwdLZqpFq2liyp4MaokJ9GslQje3FzxgAS BNPfwkSxEZX4hD3R6SQQRpPOxVVLRV96JsRmf0sGEQz7nKcPfwGW7XXwiFYDWTYtZJ4I 9zZJYY36Kb5JBJgviZOSH7p1lYbG/4QdldaBvLFYC+kkTrcIqur8mJCx/VQPALhZ4igw rCvQ== X-Gm-Message-State: AC+VfDw8d2piA0vY9tVbY6r/A4SotLxj/K5FsMMdSCsLPqYMF1prpHgI +3D7xxyzt8SB3XRhqgtcH1v3ioYbw4UA/g== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a05:6902:990:b0:b8f:5b11:6d6c with SMTP id bv16-20020a056902099000b00b8f5b116d6cmr13858ybb.1.1683212294723; Thu, 04 May 2023 07:58:14 -0700 (PDT) Date: Thu, 4 May 2023 14:57:33 +0000 In-Reply-To: <20230504145737.286444-1-joychakr@google.com> Mime-Version: 1.0 References: <20230504145737.286444-1-joychakr@google.com> X-Mailer: git-send-email 2.40.1.495.gc816e09b53d-goog Message-ID: <20230504145737.286444-4-joychakr@google.com> Subject: [PATCH 3/7] dmaengine: pl330: Change if-else to switch-case for consistency From: Joy Chakraborty To: Vinod Koul , Rob Herring , Krzysztof Kozlowski Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, manugautam@google.com, danielmentz@google.com, sjadavani@google.com, Joy Chakraborty X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764978328500116602?= X-GMAIL-MSGID: =?utf-8?q?1764978328500116602?= Change if-else to switch-case in pl330_prep_slave_sg() function for consistency with other peripheral transfer functions in the driver. Signed-off-by: Joy Chakraborty --- drivers/dma/pl330.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 39a66ff29e27..746da0bbea92 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -2883,16 +2883,21 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, else list_add_tail(&desc->node, &first->node); - if (direction == DMA_MEM_TO_DEV) { + switch (direction) { + case DMA_MEM_TO_DEV: desc->rqcfg.src_inc = 1; desc->rqcfg.dst_inc = 0; fill_px(&desc->px, pch->fifo_dma, sg_dma_address(sg), sg_dma_len(sg)); - } else { + break; + case DMA_DEV_TO_MEM: desc->rqcfg.src_inc = 0; desc->rqcfg.dst_inc = 1; fill_px(&desc->px, sg_dma_address(sg), pch->fifo_dma, sg_dma_len(sg)); + break; + default: + break; } desc->rqcfg.src_brst_size = pch->burst_sz; From patchwork Thu May 4 14:57:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 90126 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp411596vqo; Thu, 4 May 2023 08:33:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4kxVwfZnlC97EqpqyvrfE02fTo1EpbRNfWj3qNux0rr4rcMlgmm9QyZ7zW6Kyogol6WqaO X-Received: by 2002:a05:6a20:a226:b0:f2:bb3f:3b15 with SMTP id u38-20020a056a20a22600b000f2bb3f3b15mr2228397pzk.43.1683214419000; Thu, 04 May 2023 08:33:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683214418; cv=none; d=google.com; s=arc-20160816; b=LPLo0MHqKXb7FQpvb/Au8nvhmb5ZfAaPMbN/NRtpkPexXSlFt+XGcsygf/CHoi536O 0YhN4Z5zzQG/O3mE83Phfa3bt7P5z0xscGfoMnrBepZMoHU1u+ZtGo2Zg5NkEnkCD8gp IDQKTOR5uRRdYyflE7CG5RceLDSyRWGQYBIIEx9cMLvLLSAsb0gCY2BPYgW/xWbtAP35 g9M5uL779W+HhiL+o/SQavfgjPlqwr/PCnTDNE85W4F3ad6TzUfmMQ3/UFxztZTWqQV1 esFZF8l3jadTCBvSKje3qydx8YiIQebSXXyp0l/TQwu9VQ89zX/yoc32ZgKLyDDy8FAR sCGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=kh+X7l0wnMDvF/TGkOMQP9LlIOwSn6D59gdDRBtO04w=; b=xAbYX47WaPSDBG68sKY9qLl7k1GHpCMQwjPqqQWGxwQ7ceCApA0Ve4Bc2fnWKAvJt5 af8rNQxmsT3skIMbqjjmL8PQS83QL6ROLTSekkEyClDGGkRBDACtkasqF7L5DFJMixW/ 8+7Pj0mZVjbcxT3VjrrFmQgcA034vIBZxQfZFKT7tAS+7nB/kjmHUNqBmFct7ZnIEPTw Qlo7LZa83a/oP9QWlYGN1sbXgZ5L+rtwGXx6PHSrAqlHSNk1FF0DxJgRJ1eCLjtbnz9C UGkwko3jwgJv5B6zooN9CJVZJumvlE0E32Lxlph5IvyDCkV55c73SvBS+xtC6dtUYid2 QgXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=upwj98xD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n65-20020a634044000000b005030925d31asi35864984pga.203.2023.05.04.08.33.26; Thu, 04 May 2023 08:33:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=upwj98xD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231224AbjEDO7W (ORCPT + 99 others); Thu, 4 May 2023 10:59:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231193AbjEDO7E (ORCPT ); Thu, 4 May 2023 10:59:04 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 217DC2109 for ; Thu, 4 May 2023 07:58:41 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-b9e2b65f2eeso1068558276.2 for ; Thu, 04 May 2023 07:58:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683212299; x=1685804299; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=kh+X7l0wnMDvF/TGkOMQP9LlIOwSn6D59gdDRBtO04w=; b=upwj98xDSG+z3ZBTgmRf8JN4ctdhrE45ySX+bj2bF5e3geD1n0mXpnLvXXhUV1x/qS zdbY63BZlopO7XRlrJMsa4KiHebcz2SDaUEVIH2+MA821sARPBGoyAWwNDoLuysb6mXv POglCapWgsgi4/bkVKxs/FTjhDvdMlN66veGXP3Ky2AmxPfBQSlnM9hb062vlgFPSzel yaQLETIYln/oMt8Qley1yoq6VBzsxAnzbM9E+7QZcroJfmoM1VF2sDetNnnPwFBTvUgV OUtqrESKS2fF6FmBfwvCzm4aJBiGMCnC8IO5Su7vmKc5vBBedfeiHiSnyQ+mXAsPVlFs pAbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683212299; x=1685804299; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kh+X7l0wnMDvF/TGkOMQP9LlIOwSn6D59gdDRBtO04w=; b=bzjKmFOHIVfFBQVh7r3LSnCGid6vmMvA3RVq+qNl3Z2K/8vRnH4oQ4Xk4Bhn5GU0NA PYcBHqxwj2XKqD83ILCmIdSOoGeLV8UBRXjjHW7XTIrVBqOzi3zjQ27n9aaEB+ytgncT 3cxAcJNYvNX0cpnuSg2YrhvI2+xT0XwCt+JUhj4anZIFv/AiA/9/8Lezk5+c5T8fFtV/ Io9lunj4jrhbd9/c1tdiIB85Dptdt/Aak5zq1WiUFfbg3xNlypE2dSYfhA2TdQvxhpwT yMRXu9dHt5+9N//85jHYdw5/Foh7dv4OjDsOygseyGtttQ1L1/ZUBwX77aamTfK32sAQ YzuA== X-Gm-Message-State: AC+VfDytGy7OTdvIqEvo2hmi02vwpIcY4RMzWb2H6fsU9ePrNa5uYL1M FZLv2Il/AZae06+XMBNUQJ23o6tjEqEfaA== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a5b:cc3:0:b0:b9f:14a5:b3b5 with SMTP id e3-20020a5b0cc3000000b00b9f14a5b3b5mr68776ybr.6.1683212299226; Thu, 04 May 2023 07:58:19 -0700 (PDT) Date: Thu, 4 May 2023 14:57:34 +0000 In-Reply-To: <20230504145737.286444-1-joychakr@google.com> Mime-Version: 1.0 References: <20230504145737.286444-1-joychakr@google.com> X-Mailer: git-send-email 2.40.1.495.gc816e09b53d-goog Message-ID: <20230504145737.286444-5-joychakr@google.com> Subject: [PATCH 4/7] dmaengine: pl330: Change unused arg "len" from get_burst_len() From: Joy Chakraborty To: Vinod Koul , Rob Herring , Krzysztof Kozlowski Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, manugautam@google.com, danielmentz@google.com, sjadavani@google.com, Joy Chakraborty X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764978242883991876?= X-GMAIL-MSGID: =?utf-8?q?1764978242883991876?= Remove unused length argument from get_burst_len() and add burst size as an argument to allow usage of this function in other places as source and destination burst sizes are handled separately. Signed-off-by: Joy Chakraborty --- drivers/dma/pl330.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 746da0bbea92..e5e610c91f18 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -2660,8 +2660,7 @@ __pl330_prep_dma_memcpy(struct dma_pl330_chan *pch, dma_addr_t dst, return desc; } -/* Call after fixing burst size */ -static inline int get_burst_len(struct dma_pl330_desc *desc, size_t len) +static inline int get_burst_len(struct dma_pl330_desc *desc, unsigned int brst_size) { struct dma_pl330_chan *pch = desc->pchan; struct pl330_dmac *pl330 = pch->dmac; @@ -2669,7 +2668,7 @@ static inline int get_burst_len(struct dma_pl330_desc *desc, size_t len) burst_len = pl330->pcfg.data_bus_width / 8; burst_len *= pl330->pcfg.data_buf_dep / pl330->pcfg.num_chan; - burst_len >>= desc->rqcfg.src_brst_size; + burst_len >>= brst_size; /* src/dst_burst_len can't be more than 16 */ if (burst_len > PL330_MAX_BURST) @@ -2805,7 +2804,7 @@ pl330_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dst, burst /= 2; desc->rqcfg.src_brst_size = __ffs(burst); - desc->rqcfg.src_brst_len = get_burst_len(desc, len); + desc->rqcfg.src_brst_len = get_burst_len(desc, desc->rqcfg.src_brst_size); /* * If burst size is smaller than bus width then make sure we only * transfer one at a time to avoid a burst stradling an MFIFO entry. From patchwork Thu May 4 14:57:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 90124 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp407000vqo; Thu, 4 May 2023 08:27:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6AtI2W4pHkiQHToesN5Rox+hZNQd6RsRN3QvzctviltA9yKvvigaO/f85SxZKvRgi38k+v X-Received: by 2002:a17:902:9888:b0:1ab:1355:1a45 with SMTP id s8-20020a170902988800b001ab13551a45mr3975036plp.30.1683214063494; Thu, 04 May 2023 08:27:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683214063; cv=none; d=google.com; s=arc-20160816; b=RpuB714SPXSDOwSc6QYe0pcMOaOTiPWbqwBDVjZ0j+9FqQXhLj+DbLLiMRXoMiXrWk iiJDule0psO4S7amrNOoBEgYdyz3/BD1k5xOeK3PvZ5QJZXFp4g0qymtsMjtR9BSqitj NZTku6UxjWJxbWYImWa7pDIDnwjqpvxuoJaQ3/6BGOzzqY19irZZjvQ42FYXg8ZDtxTO F2xJPyrbc9t8gcx8lc4i69KnXTHPzSxZ55cA/ZQzJoeZzNmpGKJBbl0a3g+P6yO3u2XV Que3zDefd1xGisOLbftb6i2GjocSO+Y9H7StANj76dgcso0Bwh/U63KPmpprxCOsdZm+ S4ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=cmjaIRPyR5OKdf02GACB/fx4eJBLPx7/7rEGOj0i7h0=; b=VJJnjQTBKupBUoEKM7YKr3hpVC4+Ae+b0ax6TbJ2VA2tIrO/58a2paawt4PNAhkwnk +HbrYmnjScbaDVjR8w5BrfDvd+DA1EmNI87e15QhvbUPugl1cyIGYI+kfDB73GxmtF9R dgcRQFWpbllSGmM4FCLkrIsj2noKdMxFhi8JBkH8IjXW6noc11UxjPLYW9jCznfzxoL+ af8R4ZywrYDweYxU+ZR8CU9VIXCbNhvRI5elQNNirMfftlQI4MDi1emf3BnJvg0AXwGh 34T7SrQvoKzk6Trh02F3Wcp0WjnSZ4wjAYAcb52R/OJdWIRUi69w8988u8iON57GxBUb vqoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=Npa8tJhk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rm7-20020a17090b3ec700b0024673e20957si10394123pjb.35.2023.05.04.08.27.30; Thu, 04 May 2023 08:27:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=Npa8tJhk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231378AbjEDO7a (ORCPT + 99 others); Thu, 4 May 2023 10:59:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230427AbjEDO7G (ORCPT ); Thu, 4 May 2023 10:59:06 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 532D72D5D for ; Thu, 4 May 2023 07:58:44 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-b9a79db4e7fso769947276.0 for ; Thu, 04 May 2023 07:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683212304; x=1685804304; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=cmjaIRPyR5OKdf02GACB/fx4eJBLPx7/7rEGOj0i7h0=; b=Npa8tJhk/Rl57/4enBWz8lg2nvQDhdQTSnbVDFE2lgk2BLJxivKtPSY6hUFdn3wW6l v1REXZVoP5NsVUr0gD29PV9sRNxZnxP/CQptfuBxi+cjV+7YFDPjVBomfDNpvo1skWzP PtFEt9GOtleAd8qMiZmFL3/BnaGyZInLz7SjaJvEghEyiePkZYORM8TgpbRCru2WZVBB BpLgrQcZXXRuLhuylbktYv7D8qn/V79l2U6AZ4B+8k/XskfQ4zVdhSTblZ7/mNXS3qiu J0jwtX1DfmT6RtM9sTzA8GAO0zMmoXp75diF6r8cD0zh5KIAVC+F0Td4y/Cs3lFVqBFa qQGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683212304; x=1685804304; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cmjaIRPyR5OKdf02GACB/fx4eJBLPx7/7rEGOj0i7h0=; b=guOjT48mz0iLc4GArE8kSZyv1ZKBC0hJtiBgXkmNNfbueNpg3aOp5cKEHSu81tIO0Q DXodMY3VsKNujAYC20tkXfNipJXryyAkm/AuLLFHC1Y/yG7CMLKwItpQ12vLvwHhAcjw SfgsOaDfVVIBSCev5X8FfPpb0610AsBmPB/YDr9xUp4ZbhSD6ILirCdOYvBEU4N9Jgmb QG/NPiz179iceVFzJQyOISGOwZ9MipcqC1SUtEc8w0DjfTAXr1FszJurdPHmF0V60AMu whL9K7QWa/d1jcp1PnJPq6YlfUqUlO2y/Iwi+yC9ezQZbOFBaWuuGd7Z24WbqCc1Bgm/ 45BA== X-Gm-Message-State: AC+VfDwSx/dksydX73l1VRL/tEU7inkoyVQ27mJ1qIeBY7+BFkgg2sjd 3vWGnkg5SAqj9gyH8ylUJ3Hhu/emCPv4mA== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a05:6902:993:b0:b9d:fe66:a424 with SMTP id bv19-20020a056902099300b00b9dfe66a424mr125691ybb.2.1683212304642; Thu, 04 May 2023 07:58:24 -0700 (PDT) Date: Thu, 4 May 2023 14:57:35 +0000 In-Reply-To: <20230504145737.286444-1-joychakr@google.com> Mime-Version: 1.0 References: <20230504145737.286444-1-joychakr@google.com> X-Mailer: git-send-email 2.40.1.495.gc816e09b53d-goog Message-ID: <20230504145737.286444-6-joychakr@google.com> Subject: [PATCH 5/7] dmaengine: pl330: Quirk to optimize AxSize for peripheral usecases From: Joy Chakraborty To: Vinod Koul , Rob Herring , Krzysztof Kozlowski Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, manugautam@google.com, danielmentz@google.com, sjadavani@google.com, Joy Chakraborty X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764977869846843195?= X-GMAIL-MSGID: =?utf-8?q?1764977869846843195?= Add quirk "arm,pl330-optimize-dev2mem-axsize" to choose maximum possible AxSize for transactions towards memory during usecases which copy data between memory and peripherals. Currently PL330 driver chooses equal AxLen and AxSize for both loads and stores to/from memory and peripherals which is inefficient towards memory as the whole bus width is not used for transfers as a peripheral might be limited to use only a narrow size of the buswidth available. Example scenario: A peripheral might require data byte by byte which would make AxSize = 1 byte and AxLen = 16 for both load from memory and store to Peripheral. This can be optimized for memory by using maximum AxSize (say 16bytes) then load from memory can be done with AxSize = 16byte, AxLen = 1 and store to peripheral with AxSize = 1byte, AxLen = 16 beats. Instruction setup with quirk : 512bytes copy from Memory(16bytes * 4beats) to Peripheral(4bytes * 16 beats) --- DMAMOV CCR 0xbd0239 DMAMOV SAR 0xffffe000 DMAMOV DAR 0xffffc860 DMALP_1 7 DMAFLUSHP 0 DMAWFPB 0 DMALDB DMASTPB 0 DMALPENDA_1 bjmpto_7 DMASEV 3 DMAEND --- Signed-off-by: Joy Chakraborty --- drivers/dma/pl330.c | 105 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 89 insertions(+), 16 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index e5e610c91f18..b4933fab8a62 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -35,6 +35,7 @@ #define PL330_QUIRK_BROKEN_NO_FLUSHP BIT(0) #define PL330_QUIRK_PERIPH_BURST BIT(1) +#define PL330_QUIRK_OPTIMIZE_DEV2MEM_AXSIZE BIT(2) enum pl330_cachectrl { CCTRL0, /* Noncacheable and nonbufferable */ @@ -519,6 +520,10 @@ static struct pl330_of_quirks { { .quirk = "arm,pl330-periph-burst", .id = PL330_QUIRK_PERIPH_BURST, + }, + { + .quirk = "arm,pl330-optimize-dev2mem-axsize", + .id = PL330_QUIRK_OPTIMIZE_DEV2MEM_AXSIZE, } }; @@ -2677,6 +2682,56 @@ static inline int get_burst_len(struct dma_pl330_desc *desc, unsigned int brst_s return burst_len; } +/* + * Returns burst size to be used to copy data from/to memory during a + * peripheral transfer + */ +static unsigned int get_periph_mem_brst_sz(dma_addr_t addr, size_t len, + struct dma_pl330_chan *pch, int quirks) +{ + unsigned int burst, burst_size = pch->burst_sz; + + if (quirks & PL330_QUIRK_OPTIMIZE_DEV2MEM_AXSIZE) { + /* Select max possible burst size */ + burst = pch->dmac->pcfg.data_bus_width / 8; + + /* + * Make sure we use a burst size that aligns with the memory and length. + */ + while ((addr | len) & (burst - 1)) + burst /= 2; + + burst_size = __ffs(burst); + } + return burst_size; +} + +/* + * Returns burst length to be used to copy data from/to memory during a + * peripheral transfer + */ +static unsigned int get_periph_mem_brst_len(struct dma_pl330_desc *desc, + struct dma_pl330_chan *pch, + unsigned int burst_size, int quirks) +{ + unsigned int burst_len = pch->burst_len; + + if (quirks & PL330_QUIRK_OPTIMIZE_DEV2MEM_AXSIZE && + burst_size != pch->burst_sz) { + /* Select max possible burst len */ + burst_len = get_burst_len(desc, burst_size); + + /* + * Adjust AxLen to keep number of bytes same in Load/Store + */ + if (burst_size > pch->burst_sz) + burst_len = pch->burst_len >> (burst_size - pch->burst_sz); + else + pch->burst_len = burst_len >> (pch->burst_sz - burst_size); + } + return burst_len; +} + static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic( struct dma_chan *chan, dma_addr_t dma_addr, size_t len, size_t period_len, enum dma_transfer_direction direction, @@ -2684,8 +2739,8 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic( { struct dma_pl330_desc *desc = NULL, *first = NULL; struct dma_pl330_chan *pch = to_pchan(chan); + unsigned int i, burst_size, burst_len; struct pl330_dmac *pl330 = pch->dmac; - unsigned int i; dma_addr_t dst; dma_addr_t src; @@ -2729,28 +2784,35 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic( return NULL; } + burst_size = get_periph_mem_brst_sz(dma_addr, period_len, pch, pl330->quirks); + burst_len = get_periph_mem_brst_len(desc, pch, burst_size, pl330->quirks); + switch (direction) { case DMA_MEM_TO_DEV: desc->rqcfg.src_inc = 1; desc->rqcfg.dst_inc = 0; src = dma_addr; dst = pch->fifo_dma; + desc->rqcfg.src_brst_size = burst_size; + desc->rqcfg.src_brst_len = burst_len; + desc->rqcfg.dst_brst_size = pch->burst_sz; + desc->rqcfg.dst_brst_len = pch->burst_len; break; case DMA_DEV_TO_MEM: desc->rqcfg.src_inc = 0; desc->rqcfg.dst_inc = 1; src = pch->fifo_dma; dst = dma_addr; + desc->rqcfg.src_brst_size = pch->burst_sz; + desc->rqcfg.src_brst_len = pch->burst_len; + desc->rqcfg.dst_brst_size = burst_size; + desc->rqcfg.dst_brst_len = burst_len; break; default: break; } desc->rqtype = direction; - desc->rqcfg.src_brst_size = pch->burst_sz; - desc->rqcfg.src_brst_len = pch->burst_len; - desc->rqcfg.dst_brst_size = pch->burst_sz; - desc->rqcfg.dst_brst_len = pch->burst_len; desc->bytes_requested = period_len; fill_px(&desc->px, dst, src, period_len); @@ -2850,7 +2912,11 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, { struct dma_pl330_desc *first, *desc = NULL; struct dma_pl330_chan *pch = to_pchan(chan); + unsigned int burst_size, burst_len; + struct pl330_dmac *pl330; struct scatterlist *sg; + dma_addr_t mem_addr; + size_t len; int i; if (unlikely(!pch || !sgl || !sg_len)) @@ -2862,13 +2928,12 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, return NULL; first = NULL; + pl330 = pch->dmac; for_each_sg(sgl, sg, sg_len, i) { desc = pl330_get_desc(pch); if (!desc) { - struct pl330_dmac *pl330 = pch->dmac; - dev_err(pch->dmac->ddma.dev, "%s:%d Unable to fetch desc\n", __func__, __LINE__); @@ -2882,29 +2947,37 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, else list_add_tail(&desc->node, &first->node); + mem_addr = sg_dma_address(sg); + len = sg_dma_len(sg); + + burst_size = get_periph_mem_brst_sz(mem_addr, len, pch, pl330->quirks); + burst_len = get_periph_mem_brst_len(desc, pch, burst_size, pl330->quirks); + switch (direction) { case DMA_MEM_TO_DEV: desc->rqcfg.src_inc = 1; desc->rqcfg.dst_inc = 0; - fill_px(&desc->px, pch->fifo_dma, sg_dma_address(sg), - sg_dma_len(sg)); + desc->rqcfg.src_brst_size = burst_size; + desc->rqcfg.src_brst_len = burst_len; + desc->rqcfg.dst_brst_size = pch->burst_sz; + desc->rqcfg.dst_brst_len = pch->burst_len; + fill_px(&desc->px, pch->fifo_dma, mem_addr, len); break; case DMA_DEV_TO_MEM: desc->rqcfg.src_inc = 0; desc->rqcfg.dst_inc = 1; - fill_px(&desc->px, sg_dma_address(sg), pch->fifo_dma, - sg_dma_len(sg)); + desc->rqcfg.src_brst_size = pch->burst_sz; + desc->rqcfg.src_brst_len = pch->burst_len; + desc->rqcfg.dst_brst_size = burst_size; + desc->rqcfg.dst_brst_len = burst_len; + fill_px(&desc->px, mem_addr, pch->fifo_dma, len); break; default: break; } - desc->rqcfg.src_brst_size = pch->burst_sz; - desc->rqcfg.src_brst_len = pch->burst_len; - desc->rqcfg.dst_brst_size = pch->burst_sz; - desc->rqcfg.dst_brst_len = pch->burst_len; desc->rqtype = direction; - desc->bytes_requested = sg_dma_len(sg); + desc->bytes_requested = len; } /* Return the last desc in the chain */ From patchwork Thu May 4 14:57:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 90125 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp410840vqo; Thu, 4 May 2023 08:32:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ijhISgPUpnlJshnNmKoMHRyDD2Wl+Wk9XFUX34WgVxnXIGoYNyCQhKYKy3S1pvcgIk91I X-Received: by 2002:a05:6a21:594:b0:ef:e240:b559 with SMTP id lw20-20020a056a21059400b000efe240b559mr2693214pzb.46.1683214363307; Thu, 04 May 2023 08:32:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683214363; cv=none; d=google.com; s=arc-20160816; b=zTdinpE6FPVfqNwYO3BWohF06VjTjbksd+1NZD84YwSHOlJv5Er/6qIuw5bXBRYR2O c/qP4JC9uuOifXpXsRIKAe2jjK9Ot2uuxCsLRkUJMfTDjpcAxExoak6aXGPAg9Xgk7aa frZd/nbnn3LWVVlZxy/9GiVkPqm12A/ym+B9iJJZbgVSdS8dcFoArZTNxfrDl96KEJlS I/R2M7yv/nKBz5iCjTFPGGy2y2eEZ7WnJSXqpuCZftXmSROF3cKlrMUBmCnxNOOq+dsk NnTgC6cXDxUI2IwieaxNKQ55Raw3dIOD7FIJ8Hp5qoyTRLPAmvy4TMHVLr5U+Vcl3yp2 RHvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=FyjCHPBh44PN3ytyHlUnOM1ASgpqY1cxsBMty1tbu/M=; b=JIBiYffYn0uosiHGc3+Y9FJJy6p74VCmmHdyNMFj1uvGOcfAsJwBLudtdCPDu+YK8I uwPsovIed73mOuaPEFeehuB/yB0z3FXRHmHvFpvNTA6GOHfFid5qK44ui8taVBmsSkEG /rL55ShbMnmYILqDT/+hhKNH6C6v4euHOVhCdnc+AOW3vDKX3/bN1TnOaROXTlG9Fmqd ctVBAI+5p3y/fFyYzabmz0Ytvv+1N9uNwKIz1WeoUQOaSkI90L5vLJY3CBiXQI6uNw1E GzY0sZXXEN21KmzYPcWPclZpMh2Pt1q/oeDTO1AJNuhR6DTa0jj+PxSA7AM+RwxMBB4D GBoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=h2Q3dtiM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c1-20020a056a00008100b0063b1bfa94dasi35046448pfj.323.2023.05.04.08.32.29; Thu, 04 May 2023 08:32:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=h2Q3dtiM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229835AbjEDO7d (ORCPT + 99 others); Thu, 4 May 2023 10:59:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230519AbjEDO7H (ORCPT ); Thu, 4 May 2023 10:59:07 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08AEA49DA for ; Thu, 4 May 2023 07:58:45 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-556011695d1so7667127b3.1 for ; Thu, 04 May 2023 07:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683212309; x=1685804309; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=FyjCHPBh44PN3ytyHlUnOM1ASgpqY1cxsBMty1tbu/M=; b=h2Q3dtiMAz5jAvOjfEHVY9ZA7j1QyQ6803OyYx4Pu17ci2sEWteu8ncbtegLvhtM3z zyOk45a71QSLyNnKQBRHprHb1Rw2yijPAd2tX+coUVnx6V8L7uorPPpiAeEpgE98A+Ee 5PwjCttFi/znmNl1oOtlqvba5bv7IZRJ+4WBDirEtT5NCvZSA+kbf6z3fuG+jykVqSKD HbxYGUWJN5+PFHCdQoAJFjiw2njnbj/M3wglMj0/2MWH7CqQ2RlYoCKR8k+iWiGmNRvD PY9ry6L9MoT87ezIzwLA0UUivnN8NagCOnQOmTyiG5z1xM1Fzh+eaGCTe6laa5VQzCdd 3X6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683212309; x=1685804309; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=FyjCHPBh44PN3ytyHlUnOM1ASgpqY1cxsBMty1tbu/M=; b=Il63/eR3TEBhYY8b200mlOinDyDsDfc5mhP6kiLA6mJiPUhtUCl9hBl88OwaS39IAJ xmKccrM2p2TWUBNkvtCyN/Bup2+Vk4VxxmraWO0X9F2FdinaHAbb2HJfIiIjK87HA9mC yLqAKoCgIN4HW6cfE/skUCnXeUYWGEdNUNiwtRezLOoCcn4uwzRjhJL4NhyUbI3yrTvi vMBRoSh55EpIFwnu9MOi0EccP9tiRWDtRpjLnp2JETlaHXyG9R8vxiISrDBzFXQ65daA 3U4WV7W+fNmXXYZX0F5oAB45owFZjw1bjCdunc/AvppWERfrPsgdmLqDshGcuqI/ll/u bpaA== X-Gm-Message-State: AC+VfDyXcpBRcmj3RJ1DiNtCNJVWv4w2PYMmHmqljU9y/nAXeEk54m/y /lKyXfRqcASBFIVPKunwSjYKnbtD6BDTww== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a81:ad21:0:b0:54f:a60c:12eb with SMTP id l33-20020a81ad21000000b0054fa60c12ebmr1423741ywh.1.1683212309438; Thu, 04 May 2023 07:58:29 -0700 (PDT) Date: Thu, 4 May 2023 14:57:36 +0000 In-Reply-To: <20230504145737.286444-1-joychakr@google.com> Mime-Version: 1.0 References: <20230504145737.286444-1-joychakr@google.com> X-Mailer: git-send-email 2.40.1.495.gc816e09b53d-goog Message-ID: <20230504145737.286444-7-joychakr@google.com> Subject: [PATCH 6/7] dmaengine: pl330: Quirk to use DMA singles for peripheral _dregs From: Joy Chakraborty To: Vinod Koul , Rob Herring , Krzysztof Kozlowski Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, manugautam@google.com, danielmentz@google.com, sjadavani@google.com, Joy Chakraborty X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764978184279748903?= X-GMAIL-MSGID: =?utf-8?q?1764978184279748903?= Add quirk "arm,pl330-periph-single-dregs" to use DMA singles in a loop to load/store the remaining bytes left after chucks of bursts are done which is handled by the _dregs() function. If the transfer length is not a multiple of (AxLen*AxSize) then the _dregs function takes care of setting up CCR with residual burst required to complete the transaction. It does so by changing the AxLen in CCR and 1 burst of Load and Store. But some peripherals might not set the burst request signal to the DMA controller since the number of bytes to transfer is less then the initial size of burst requested i.e. AxLen*AxSize leading to a forever wait. Example of such a case : Considering a peripheral having an RX FIFO of n bytes and a sw configurable threshold level logic which drives the RX burst req signal to PL330 i.e. when data in the RX fifo crosses the threshold value the peripheral asserts the RX burst request to PL330 to copy data from the fifo in bursts. Taking an example say the Rx Fifo is 256 bytes in depth, the max AxLen is 16, max AxSize is 4bytes and 304 bytes had to copied from peripheral to memory. In this case the peripheral SW driver would configure the threshold to the maximum possible burst size (AxLen*AxSize) i.e. 64 bytes and pass the same to pl330 driver using src/dst_maxburst variable. PL330 would copy the first 256 bytes with 4 burst transactions and the 48 remaining bytes would be handled by _dregs(). Currently _dregs() would setup a burst for AxLen=3 and AxSize=16 to copy the 48bytes but since 48bytes is below the threshold configured at the peripheral the Rx burst request signal would not get set leading to a forever wait and timeout. This quirk will copy the remaining 48bytes using single transactions of 4bytes each which would not depend on the burst req signal from the peripheral. Instructions generated for above example with quirk set: DMAMOV CCR 0xbd0239 DMAMOV SAR 0xffffe000 DMAMOV DAR 0xffffc860 DMALP_1 3 DMAFLUSHP 0 DMAWFPB 0 DMALDB DMASTPB 0 DMALPENDA_1 bjmpto_7 DMAMOV CCR 0xad0229 DMALDA DMALP_0 11 DMAFLUSHP 0 DMAWFPS 0 DMASTPS 0 DMALPENDA_0 bjmpto_6 DMASEV 3 DMAEND Signed-off-by: Joy Chakraborty --- drivers/dma/pl330.c | 74 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 2 deletions(-) diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index b4933fab8a62..0b4e5390bace 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -36,6 +36,7 @@ #define PL330_QUIRK_BROKEN_NO_FLUSHP BIT(0) #define PL330_QUIRK_PERIPH_BURST BIT(1) #define PL330_QUIRK_OPTIMIZE_DEV2MEM_AXSIZE BIT(2) +#define PL330_QUIRK_PERIPH_SINGLE_DREGS BIT(3) enum pl330_cachectrl { CCTRL0, /* Noncacheable and nonbufferable */ @@ -524,6 +525,10 @@ static struct pl330_of_quirks { { .quirk = "arm,pl330-optimize-dev2mem-axsize", .id = PL330_QUIRK_OPTIMIZE_DEV2MEM_AXSIZE, + }, + { + .quirk = "arm,pl330-periph-single-dregs", + .id = PL330_QUIRK_PERIPH_SINGLE_DREGS, } }; @@ -1213,6 +1218,67 @@ static inline int _ldst_peripheral(struct pl330_dmac *pl330, return off; } +/* + * Sets up transfers to peripheral using DMA Singles instead of Bursts. + * Data is moved between fifo and memory in bursts following which it is + * loaded/stored to peripheral using Loops of DMA singles based on + * transfer direction. + */ +static inline int _ldst_periph_single_dregs(struct pl330_dmac *pl330, + unsigned int dry_run, u8 buf[], + const struct _xfer_spec *pxs, + int src_length, int dst_length) +{ + int off = 0; + unsigned int ljmp, lpcnt; + struct _arg_LPEND lpend; + enum dma_transfer_direction direction = pxs->desc->rqtype; + + if (direction == DMA_MEM_TO_DEV) { + off += _emit_load(dry_run, &buf[off], ALWAYS, direction, + pxs->desc->peri); + lpcnt = dst_length; + } else { + lpcnt = src_length; + } + + /* + * Use Loop Cnt 0 to load/store from/to peripheral in single transactions + * since Burst Req might not be set as pending transfer length maybe less + * size of bytes to burst (AxSize * AxLen). + */ + off += _emit_LP(dry_run, &buf[off], 0, lpcnt); + ljmp = off; + + /* + * do FLUSHP at beginning to clear any stale dma requests before the + * first WFP. + */ + if (!(pl330->quirks & PL330_QUIRK_BROKEN_NO_FLUSHP)) + off += _emit_FLUSHP(dry_run, &buf[off], pxs->desc->peri); + + off += _emit_WFP(dry_run, &buf[off], SINGLE, pxs->desc->peri); + + if (direction == DMA_MEM_TO_DEV) + off += _emit_store(dry_run, &buf[off], SINGLE, direction, + pxs->desc->peri); + else + off += _emit_load(dry_run, &buf[off], SINGLE, direction, + pxs->desc->peri); + + lpend.cond = ALWAYS; + lpend.forever = false; + lpend.loop = 0; + lpend.bjump = off - ljmp; + off += _emit_LPEND(dry_run, &buf[off], &lpend); + + if (direction == DMA_DEV_TO_MEM) + off += _emit_store(dry_run, &buf[off], ALWAYS, direction, + pxs->desc->peri); + + return off; +} + static int _bursts(struct pl330_dmac *pl330, unsigned dry_run, u8 buf[], const struct _xfer_spec *pxs, int cyc) { @@ -1278,8 +1344,12 @@ static int _dregs(struct pl330_dmac *pl330, unsigned int dry_run, u8 buf[], case DMA_MEM_TO_DEV: case DMA_DEV_TO_MEM: off += _emit_MOV(dry_run, &buf[off], CCR, dregs_ccr); - off += _ldst_peripheral(pl330, dry_run, &buf[off], pxs, 1, - BURST); + if (pl330->quirks & PL330_QUIRK_PERIPH_SINGLE_DREGS) + off += _ldst_periph_single_dregs(pl330, dry_run, &buf[off], + pxs, src_length, dst_length); + else + off += _ldst_peripheral(pl330, dry_run, &buf[off], pxs, 1, + BURST); break; case DMA_MEM_TO_MEM: From patchwork Thu May 4 14:57:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joy Chakraborty X-Patchwork-Id: 90123 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp404858vqo; Thu, 4 May 2023 08:24:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ77eGZe2JICd3VXbDk/a4sqIKNO2OFx/SldZ+FU49vfb/qmPCTDFIrP1FrlE2Sn5SiSVSqc X-Received: by 2002:a17:90a:6788:b0:250:1b4c:d861 with SMTP id o8-20020a17090a678800b002501b4cd861mr533967pjj.13.1683213875045; Thu, 04 May 2023 08:24:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683213875; cv=none; d=google.com; s=arc-20160816; b=Z7i+9wfaH2q6Zlz/r4mJHegA+XkXTUYmCcvN5kRcMZ0OK5+SLJehy2sZ3ostZsKvJm QzjkEd3GBuoSDUCuOMK5vYj1iDM04wEnxYxhZt5iEauT7UfFnVAWWE2m5sufUoc8E1FG 33fby13GMHqlMTnIxJ0UvsYZeStPWW5KpzPfmW+ewIZUrks8+cV/KNnylDUzsGIa9DDY eCe/xu1QND8luukWZEP4dQCIv8Qwnf9PHWPRnWkHtIQ4qb05BMPcEsOoGBgG+ulr2KMT nhbpgPWWSD5826LChUBVf16UQlOa6ZzVhJoksUhxWBv9BW9SiQ9GnYdMCpb/bceS4/60 lKew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=h8IvnB7h0HAb5+pIi9GxWOAfPdgUl4BJHVh6FYr/ed4=; b=G0IQXtvsh3a8zV9YEVwIGDxuzhXD5SqNcRO+Gd6lcWTU/fwPi/8KYcxcU+zOyhhgIY lfKph32ZJfghL1GV8D4PgK12/eAZp2bWQx7EYbY98KkBFtw0U+eaBN49NGgKz1EEL07p UI6LxnCIG3wVhWTCEg4FHcPRsKIrbAb3PWaa/+3gExt9DAemx2ZQqb89awOFjTsFFuNy J0jF0HEKFIWOXQaMnVFZX7mRmLpY+xi+CA2hTBUIr2U051JZZtP1ALyRMWSap3ybbVv7 mE27dhnewR/2EoZCHDHX9qNkBKS/QTkhdJ5dPwXJVwDWXa5sh2ZagXwTcUAGOKvFZ7FN +uHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=kuPcLL3Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j13-20020a63cf0d000000b0051f0bd40bb0si32665300pgg.779.2023.05.04.08.24.22; Thu, 04 May 2023 08:24:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=kuPcLL3Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231351AbjEDO7h (ORCPT + 99 others); Thu, 4 May 2023 10:59:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231246AbjEDO7H (ORCPT ); Thu, 4 May 2023 10:59:07 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 222A1359B for ; Thu, 4 May 2023 07:58:46 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-b9a79db4e7fso770190276.0 for ; Thu, 04 May 2023 07:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1683212314; x=1685804314; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=h8IvnB7h0HAb5+pIi9GxWOAfPdgUl4BJHVh6FYr/ed4=; b=kuPcLL3YoUQz+usR6xPzkJy7Qzr+xCOBwv6dT38Ejb2rkKMHl6Kndt9vgn2RH4iitP GJzORCEA21O3g7/+GS33g9uei5QHrpLimIHK6fsQUacmH2Ffj7SjKmI206Xa7q3FfAQi y0KxVKkNxuqVL/Y5uOl7Vn77LsMWYTuLC9BGNUjEoBMOCy3RNHDuPInha6yTRnHysOvv 87lKZJwjKlaTS/8g3dW2kRdfZ59pgJYwl/S5nwAj4svodlkgx0dFw2640Q/nGRWC7fPl qDXmBQWzRWA9JPZf/U42JKCVkiRpstLjCijuixLhhfkoz85C07G08kXg+HuqmmsDwhzu hgkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683212314; x=1685804314; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=h8IvnB7h0HAb5+pIi9GxWOAfPdgUl4BJHVh6FYr/ed4=; b=bcE3eZnONHKMbLxKybfYOhufMVElvVgiFQX0tUXGFiPyUvhEyCL/Q2EDIRbW6id42p qmrYed68rnfMVDjd/wRIdR8cmmMbje52RDRHGUIERh/61I9Q0o2s85YQk3q8TA+DA93W vVWuH9hqoCUswiyUNXhzaN7IDoBvqeoxqT5K7DCgpL5AVW/a+oQfvaqn+29+NLYmNd83 KNgOsX2V77JwhfGJ6JtBcGIDlYwt9tVWC32nJw52XorYVrLso5aT6fJecTrTbKGhVBp7 5J6KSfcAb4EjG67BpKb6BUuhkkaqciCjerwr1VvblgfT/W6a7p1FBUMgk19fB10HnJ6B /Jpg== X-Gm-Message-State: AC+VfDxlp9S1nxYSpwPy92U90Zp1RzpKArygO3vNI/8IsJa5oltmyhMs /1bm9S/YZioFJWuvtsv0l2Uv6l+3S/LD3g== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a05:6902:c2:b0:b96:7676:db4a with SMTP id i2-20020a05690200c200b00b967676db4amr152609ybs.0.1683212314520; Thu, 04 May 2023 07:58:34 -0700 (PDT) Date: Thu, 4 May 2023 14:57:37 +0000 In-Reply-To: <20230504145737.286444-1-joychakr@google.com> Mime-Version: 1.0 References: <20230504145737.286444-1-joychakr@google.com> X-Mailer: git-send-email 2.40.1.495.gc816e09b53d-goog Message-ID: <20230504145737.286444-8-joychakr@google.com> Subject: [PATCH 7/7] dt-bindings: dmaengine: pl330: Add new quirks From: Joy Chakraborty To: Vinod Koul , Rob Herring , Krzysztof Kozlowski Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, manugautam@google.com, danielmentz@google.com, sjadavani@google.com, Joy Chakraborty X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764977166444638634?= X-GMAIL-MSGID: =?utf-8?q?1764977671871672692?= Add 2 new quirks added to the driver "arm,pl330-optimize-dev2mem-axsize" and "arm,pl330-periph-single-dregs" Signed-off-by: Joy Chakraborty --- Documentation/devicetree/bindings/dma/arm,pl330.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/dma/arm,pl330.yaml b/Documentation/devicetree/bindings/dma/arm,pl330.yaml index 4a3dd6f5309b..0499a7fba88d 100644 --- a/Documentation/devicetree/bindings/dma/arm,pl330.yaml +++ b/Documentation/devicetree/bindings/dma/arm,pl330.yaml @@ -53,6 +53,14 @@ properties: type: boolean description: quirk for performing burst transfer only + arm,pl330-optimize-dev2mem-axsize: + type: boolean + description: quirk for optimizing AxSize used between dev<->mem + + arm,pl330-periph-single-dregs: + type: boolean + description: quirk for using dma-singles for peripherals in _dregs() + dma-coherent: true iommus: