From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D4422C4332F for ; Wed, 28 Dec 2022 11:01:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hVf9hBaCbzyP0fuuRazYqgEJW5omeHQrmYSwT4BLqBg=; b=jXc4MNESOH23Eg xTm5yl0plKZ5fp1JBMap5e4UpA0AYoWZDfUMbjBPEi91NcoMhGIq+PTsuMCDUGziq8jgszqeWscH2 y9C1f1gjqXusw7Btl7PE3iP/OTaFx/tpWmNZYCOArZ4PgdgV0INueKP/1Di9g0BI/ydn4Dxkj4UnL 30IK1quswrohDFBFdwr0EUTJ3/f7kQraUaw41SGRG8NrxwgOfyHhACv+akSpHt/dIEzBbRGmRZ3Sd s4zG7D+cv1akojKiqC9E2hl/JoTpsMpke65VJ6lOfVjKDinkgRJDtX2Vt6xjJaCiUsJBBxbh3cc2U SohpX99467h3sxAeDPLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pAUAj-004GlX-0J; Wed, 28 Dec 2022 11:00:33 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pAUAe-004Gju-I5 for linux-arm-kernel@lists.infradead.org; Wed, 28 Dec 2022 11:00:30 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E274860B83; Wed, 28 Dec 2022 11:00:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82EDEC433D2; Wed, 28 Dec 2022 11:00:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672225227; bh=jzevZx+qSV+yOu13jDzYW67NkOEMTPVP/kbAVMGqs1k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OpH1Biu/yj7QOaRwsUUK4iDVe2jXmQfOvTlAOCYFim5y912CuM7loWazDakwa4954 udaZgpZW/zia5pLDUZTxWuCBMeSU/OH+oCUXLsPCM0tlDDfDR7X7CEe/yw4AdIEmhV gIae7OfU2MQ/tVWCgKAp4LGhWwgq/zFA3MqKa01kSu750zZScPUAJRF7jQiyvw64xk l7NECXRsObO/QN/ZAhOWCtxFvZ2tBcWBLo14YrwAIucPtvLMsJQVVtkEKDzhiyhrgs 1xVOhxvRMi3rzVtAdbTHyD/yWE2cBkrBXaLsLEEC/VUFHQfeP+qneVIGShd5l73ied ZlvCTS+Oh0U6Q== Date: Wed, 28 Dec 2022 16:30:22 +0530 From: Vinod Koul To: Sarath Babu Naidu Gaddam Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, lars@metafoo.de, adrianml@alumnos.upm.es, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, michal.simek@amd.com, radhey.shyam.pandey@amd.com, anirudha.sarangi@amd.com, harini.katakam@amd.com, git@amd.com Subject: Re: [PATCH V2 3/6] dmaengine: xilinx_dma: Pass AXI4-Stream control words to dma client Message-ID: References: <20221124102745.2620370-1-sarath.babu.naidu.gaddam@amd.com> <20221124102745.2620370-4-sarath.babu.naidu.gaddam@amd.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221124102745.2620370-4-sarath.babu.naidu.gaddam@amd.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221228_030029_291407_C0D07E00 X-CRM114-Status: GOOD ( 22.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 24-11-22, 15:57, Sarath Babu Naidu Gaddam wrote: > From: Radhey Shyam Pandey > > Read DT property to check if AXI DMA is connected to streaming IP > i.e axiethernet. If connected pass AXI4-Stream control words to > dma client using metadata_ops dmaengine API. > > Signed-off-by: Radhey Shyam Pandey > --- > drivers/dma/xilinx/xilinx_dma.c | 37 +++++++++++++++++++++++++++++++++ > 1 file changed, 37 insertions(+) > > diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c > index 8cd4e69dc7b4..f783ba86cb09 100644 > --- a/drivers/dma/xilinx/xilinx_dma.c > +++ b/drivers/dma/xilinx/xilinx_dma.c > @@ -493,6 +493,7 @@ struct xilinx_dma_config { > * @s2mm_chan_id: DMA s2mm channel identifier > * @mm2s_chan_id: DMA mm2s channel identifier > * @max_buffer_len: Max buffer length > + * @has_axistream_connected: AXI DMA connected to AXI Stream IP > */ > struct xilinx_dma_device { > void __iomem *regs; > @@ -511,6 +512,7 @@ struct xilinx_dma_device { > u32 s2mm_chan_id; > u32 mm2s_chan_id; > u32 max_buffer_len; > + bool has_axistream_connected; > }; > > /* Macros */ > @@ -623,6 +625,29 @@ static inline void xilinx_aximcdma_buf(struct xilinx_dma_chan *chan, > } > } > > +/** > + * xilinx_dma_get_metadata_ptr- Populate metadata pointer and payload length > + * @tx: async transaction descriptor > + * @payload_len: metadata payload length > + * @max_len: metadata max length > + * Return: The app field pointer. > + */ > +static void *xilinx_dma_get_metadata_ptr(struct dma_async_tx_descriptor *tx, > + size_t *payload_len, size_t *max_len) > +{ > + struct xilinx_dma_tx_descriptor *desc = to_dma_tx_descriptor(tx); > + struct xilinx_axidma_tx_segment *seg; > + > + *max_len = *payload_len = sizeof(u32) * XILINX_DMA_NUM_APP_WORDS; > + seg = list_first_entry(&desc->segments, > + struct xilinx_axidma_tx_segment, node); > + return seg->hw.app; > +} > + > +static struct dma_descriptor_metadata_ops xilinx_dma_metadata_ops = { > + .get_ptr = xilinx_dma_get_metadata_ptr, > +}; > + > /* ----------------------------------------------------------------------------- > * Descriptors and segments alloc and free > */ > @@ -2219,6 +2244,9 @@ static struct dma_async_tx_descriptor *xilinx_dma_prep_slave_sg( > segment->hw.control |= XILINX_DMA_BD_EOP; > } > > + if (chan->xdev->has_axistream_connected) > + desc->async_tx.metadata_ops = &xilinx_dma_metadata_ops; This is an optional property which is added now, what will happen if you are on a system with older DT? This wont work there.. > + > return &desc->async_tx; > > error: > @@ -3065,6 +3093,11 @@ static int xilinx_dma_probe(struct platform_device *pdev) > } > } > > + if (xdev->dma_config->dmatype == XDMA_TYPE_AXIDMA) { > + xdev->has_axistream_connected = > + of_property_read_bool(node, "xlnx,axistream-connected"); > + } > + > if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) { > err = of_property_read_u32(node, "xlnx,num-fstores", > &num_frames); > @@ -3090,6 +3123,10 @@ static int xilinx_dma_probe(struct platform_device *pdev) > else > xdev->ext_addr = false; > > + /* Set metadata mode */ > + if (xdev->has_axistream_connected) > + xdev->common.desc_metadata_modes = DESC_METADATA_ENGINE; > + > /* Set the dma mask bits */ > err = dma_set_mask_and_coherent(xdev->dev, DMA_BIT_MASK(addr_width)); > if (err < 0) { > -- > 2.25.1 -- ~Vinod _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel