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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 7B2EFC433F5 for ; Thu, 31 Mar 2022 07:59:36 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B8697186C; Thu, 31 Mar 2022 09:58:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B8697186C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1648713573; bh=FTfLRW31sCmsWFf+Ag4cFOe+7l0rk+hoXvffPPkpn+s=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=M1ibVUFDH29skZYZgD0nsRnwIKZLhjZSFu/NsRp9u2bdpkOyZF6cuvgUhgHmFCC4P S4YepYxqKbUZEB5J0OEh2d/eQKRIs3UdqVGjT/BKRTLmSxh5oXjlRgNjMinywWTzws +6dFWCVYxSlbxHL2WKZY+FfqGJvj7hZbQAQuP8Do= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4A9E1F8020D; Thu, 31 Mar 2022 09:58:43 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 4BE1FF80227; Thu, 31 Mar 2022 09:58:42 +0200 (CEST) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 6C3CFF80100 for ; Thu, 31 Mar 2022 09:58:31 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 6C3CFF80100 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nZphN-00023m-KG; Thu, 31 Mar 2022 09:58:29 +0200 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1nZphM-0005tY-Dr; Thu, 31 Mar 2022 09:58:28 +0200 Date: Thu, 31 Mar 2022 09:58:28 +0200 From: Sascha Hauer To: Vinod Koul Subject: Re: [PATCH v2 10/19] dma: imx-sdma: Add multi fifo support Message-ID: <20220331075828.GE4012@pengutronix.de> References: <20220328112744.1575631-1-s.hauer@pengutronix.de> <20220328112744.1575631-11-s.hauer@pengutronix.de> <20220331064903.GC4012@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 09:06:33 up 19:36, 39 users, load average: 0.28, 0.28, 0.24 User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: alsa-devel@alsa-project.org Cc: alsa-devel@alsa-project.org, Xiubo Li , Fabio Estevam , NXP Linux Team , kernel@pengutronix.de, dmaengine@vger.kernel.org, Shengjiu Wang X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Thu, Mar 31, 2022 at 12:24:46PM +0530, Vinod Koul wrote: > On 31-03-22, 08:49, Sascha Hauer wrote: > > On Thu, Mar 31, 2022 at 10:56:09AM +0530, Vinod Koul wrote: > > > On 28-03-22, 13:27, Sascha Hauer wrote: > > > > Signed-off-by: Sascha Hauer > > > > > > it is dmaengine: xxx > > > > Ok. > > > > > > > > Also is this patch dependent on rest of the series, if not consider > > > sending separately > > > > The rest of this series indeed depends on this patch. > > > > > > > > > diff --git a/include/linux/platform_data/dma-imx.h b/include/linux/platform_data/dma-imx.h > > > > index 281adbb26e6bd..4a43a048e1b4d 100644 > > > > --- a/include/linux/platform_data/dma-imx.h > > > > +++ b/include/linux/platform_data/dma-imx.h > > > > @@ -39,6 +39,7 @@ enum sdma_peripheral_type { > > > > IMX_DMATYPE_SSI_DUAL, /* SSI Dual FIFO */ > > > > IMX_DMATYPE_ASRC_SP, /* Shared ASRC */ > > > > IMX_DMATYPE_SAI, /* SAI */ > > > > + IMX_DMATYPE_MULTI_SAI, /* MULTI FIFOs For Audio */ > > > > }; > > > > > > > > enum imx_dma_prio { > > > > @@ -65,4 +66,10 @@ static inline int imx_dma_is_general_purpose(struct dma_chan *chan) > > > > !strcmp(chan->device->dev->driver->name, "imx-dma"); > > > > } > > > > > > > > +struct sdma_peripheral_config { > > > > + int n_fifos_src; > > > > + int n_fifos_dst; > > > > + bool sw_done; > > > > +}; > > > > > > Not more platform data :( > > > > I'm not sure what you are referring to as platform_data. This is not the > > classical platform_data that is attached to a platform_device to > > configure behaviour of that device. It is rather data that needs to be > > communicated from the clients of the SDMA engine to the SDMA engine. > > > > I have put this into include/linux/platform_data/dma-imx.h because > > that's the only existing include file that is available. I could move > > this to a new file if you like that better. > > Lets move to include/linux/dma/ Ok. > > > > > > > > > Can you explain this structure and why this is required? What do these > > > fields refer to..? > > > > The reasoning for this structure is described in the commit message that > > I have forgotten: > > > > The i.MX SDMA engine can read from / write to multiple successive > > hardware FIFO registers, referred to as "Multi FIFO support". This is > > needed for the micfil driver and certain configurations of the SAI > > driver. This patch adds support for this feature. > > > > The number of FIFOs to read from / write to must be communicated from > > the client driver to the SDMA engine. For this the struct > > dma_slave_config::peripheral_config field is used. > > > > I can describe the individual fields of struct sdma_peripheral_config in > > the header file if that's your point. > > So you need to know the number of fifo right, what does sw_done imply? Honestly I don't know. Setting sw_done results in the DONE_SEL0 bit in the SDMA engine being set. This is described in the reference manual as: DONE_SEL0 Select Done from SW or HW for channel 0 0 HW 1 SW I can only assume that the signaling when a channel has transferred enough data (the generation of the channel done interrupt?) can either be done in hardware or in software in the SDMA engine. What I can tell for sure is that I need this bit set ;) > > Also if this is hardware information, why not use dma-cells for this? The information is not static. For the micfil the number of fifos equals the number of channels that are recorded, see next patch: + micfil->dma_params_rx.peripheral_config = &micfil->sdmacfg; + micfil->dma_params_rx.peripheral_size = sizeof(micfil->sdmacfg); + micfil->sdmacfg.n_fifos_src = channels; + micfil->sdmacfg.sw_done = true; Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |