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 X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0346C433E0 for ; Mon, 29 Jun 2020 09:56:29 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BDA4523750 for ; Mon, 29 Jun 2020 09:56:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GWUvW5Od"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="rdiiVUtr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BDA4523750 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=Ww+Lup6HG4ZHLDRRumWrQZ5ggwuw8q5ntUk0jzVfSH8=; b=GWUvW5Odw6HDWHMIZPfJPaYsc dVy14OQsCg14ep0G128XcnpE+36u64Ta90NKccvWmFq+0YxWVSn8hBO0EkqbGSzsu61nuEcIfCDN5 9URi7Rb30RNo24xGzQ1EB4kOs3THTPYBZOLy/1Qg4Tl/n6Sm5msL7cSYrK2SY/wkZItfT1aSAAGFM xrFVdi3EDjFc1vTXb07+nPd3PACdGvEUooWwb6BcDOuSSwEttyFwSEGDfoGnA/ZuEn3nF1eEjpolm f9Zo31cbkxCK9Z1Os0nWLsdfX0poEpEf/x+lZbhTMvOQCzMyedQm9Cpz+1klg8a2UFmt2j8MHFIVp Wr66Y4lxA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpqV4-0002o7-5G; Mon, 29 Jun 2020 09:54:54 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpqV1-0002nl-2M; Mon, 29 Jun 2020 09:54:51 +0000 Received: from localhost (unknown [122.182.251.219]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5570023730; Mon, 29 Jun 2020 09:54:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593424490; bh=d9CswmNYtUVd7rQ5C33DkmLgs5/8ixaRznCpZfb770M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rdiiVUtr2B4Jn/9WPFpFAjzyjBo7eHShwryL9SW0kTb3828GO77StQ5Zi+Zm7eE3V kf8sKV1rJsy9nfLP6HOhMssH6ECWJxEaAJyaTyqhAVNiVq4YbMPrhqKE1ujbLkvV6n iA2v1je6E1s66VQQkcWcFy8DDb6uFDKPHRat6hc4= Date: Mon, 29 Jun 2020 15:24:46 +0530 From: Vinod Koul To: =?iso-8859-1?Q?Andr=E9?= Przywara Subject: Re: [PATCH v4 02/10] dmaengine: Actions: Add support for S700 DMA engine Message-ID: <20200629095446.GH2599@vkoul-mobl> References: <1591697830-16311-1-git-send-email-amittomer25@gmail.com> <1591697830-16311-3-git-send-email-amittomer25@gmail.com> <20200624061529.GF2324254@vkoul-mobl> <75d154d0-2962-99e6-a7c7-bf0928ec8b2a@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <75d154d0-2962-99e6-a7c7-bf0928ec8b2a@arm.com> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-actions@lists.infradead.org, linux-kernel@vger.kernel.org, cristian.ciocaltea@gmail.com, manivannan.sadhasivam@linaro.org, dmaengine@vger.kernel.org, dan.j.williams@intel.com, Amit Singh Tomar , afaerber@suse.de, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 24-06-20, 10:35, Andr=E9 Przywara wrote: > On 24/06/2020 07:15, Vinod Koul wrote: > > On 09-06-20, 15:47, Amit Singh Tomar wrote: > > = > >> @@ -372,6 +383,7 @@ static inline int owl_dma_cfg_lli(struct owl_dma_v= chan *vchan, > >> struct dma_slave_config *sconfig, > >> bool is_cyclic) > >> { > >> + struct owl_dma *od =3D to_owl_dma(vchan->vc.chan.device); > >> u32 mode, ctrlb; > >> = > >> mode =3D OWL_DMA_MODE_PW(0); > >> @@ -427,14 +439,26 @@ static inline int owl_dma_cfg_lli(struct owl_dma= _vchan *vchan, > >> lli->hw[OWL_DMADESC_DADDR] =3D dst; > >> lli->hw[OWL_DMADESC_SRC_STRIDE] =3D 0; > >> lli->hw[OWL_DMADESC_DST_STRIDE] =3D 0; > >> - /* > >> - * Word starts from offset 0xC is shared between frame length > >> - * (max frame length is 1MB) and frame count, where first 20 > >> - * bits are for frame length and rest of 12 bits are for frame > >> - * count. > >> - */ > >> - lli->hw[OWL_DMADESC_FLEN] =3D len | FCNT_VAL << 20; > >> - lli->hw[OWL_DMADESC_CTRLB] =3D ctrlb; > >> + > >> + if (od->devid =3D=3D S700_DMA) { > >> + /* Max frame length is 1MB */ > >> + lli->hw[OWL_DMADESC_FLEN] =3D len; > >> + /* > >> + * On S700, word starts from offset 0x1C is shared between > >> + * frame count and ctrlb, where first 12 bits are for frame > >> + * count and rest of 20 bits are for ctrlb. > >> + */ > >> + lli->hw[OWL_DMADESC_CTRLB] =3D FCNT_VAL | ctrlb; > >> + } else { > >> + /* > >> + * On S900, word starts from offset 0xC is shared between > >> + * frame length (max frame length is 1MB) and frame count, > >> + * where first 20 bits are for frame length and rest of > >> + * 12 bits are for frame count. > >> + */ > >> + lli->hw[OWL_DMADESC_FLEN] =3D len | FCNT_VAL << 20; > >> + lli->hw[OWL_DMADESC_CTRLB] =3D ctrlb; > > = > > Unfortunately this wont scale, we will keep adding new conditions for > > newer SoC's! So rather than this why not encode max frame length in > > driver_data rather than S900_DMA/S700_DMA.. In future one can add values > > for newer SoC and not code above logic again. > = > What newer SoCs? I don't think we should try to guess the future here. In a patch for adding new SoC, quite ironical I would say! > We can always introduce further abstractions later, once we actually > *know* what we are looking at. Rather if we know we are adding abstractions, why not add in a way that makes it scale better rather than rework again > Besides, I don't understand what you are after. The max frame length is > 1MB in both cases, it's just a matter of where to put FCNT_VAL, either > in FLEN or in CTRLB. And having an extra flag for that in driver data > sounds a bit over the top at the moment. Maybe, maybe not. I would rather make it support N SoC when adding support for second one rather than keep adding everytime a new SoC is added... -- = ~Vinod _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel