Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6322926ybx; Mon, 11 Nov 2019 07:25:18 -0800 (PST) X-Google-Smtp-Source: APXvYqyTKaJr6lCR7QuHW20gT+tNTYkng4YxqG3UhDxNneMA0bzo5cGkBoYDYaG5ayeJKWCwVhv7 X-Received: by 2002:a05:6402:213:: with SMTP id t19mr27338598edv.7.1573485917897; Mon, 11 Nov 2019 07:25:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573485917; cv=none; d=google.com; s=arc-20160816; b=smtTCrDK9xHR7O2H/psijBhOtCDwmbVgGYRd5CPNSGut06DRyA9cBItyN0/mzpk29J AAjq4lx92+oGw/WSMU1pbLfaSe0+MPAXfAlr2KXKMhtKPaVNtYI9PLSdZBtJCPIpcPQs 9wxPtahi6RoVMP4XUB1i1yaMO9FjhpD3YlEk/Ihh2Kmhc79pJzPw7J7xz9sdC7Tbm76o UB8eU5t04j0SbnHlgL0VuIW8sCKROkTl31T7nN1iSUI7MbgZ8GxJR7tJWLl314l8qRb9 w5YElnSxNud81BiW3HNSPvJU5hZ2iXf5X1p1cl0RBcdHNW0qi0zQe5+EHp94LL7jjy/U F3Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject:dkim-signature; bh=CS+i48le/nixyfp28KvB8emlqsL8zLIaTpD4UiUPBgg=; b=YU3VP4Il+1sqb88I1QuIcKJIM6A5Uf1ZEE5AhprBaCNSJPn5nvaWnfl29d1ok3iZQQ x0tZ0GxyHGK5kBr1eLRZBJ36Y9yOLvJL7ySC4w1xP0yEJfB491kqT6Egd3N7DVAOolgv IeQ2V3Ma++nb/IXfRegxY6Ps43OvuuW7b8fWrIb7c2Xt8hFEmsiUkD4sypqy7ztgHuYe x3NXdFYH6p7gvYfHyDEmfq5cezeWs4i4rBi/IO4AOK+Q7iQ2Pp4G4P2ftC+/DTqpfJ63 8nv14y1JKtJtN4p0KuS9/Gvy7Vi53Q5bEWHUWJqgzGRW65ZOoryFQpzuv9VXZ7hfBTYB bDHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=EFxfIiWF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6si9379368ejj.375.2019.11.11.07.24.53; Mon, 11 Nov 2019 07:25:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=EFxfIiWF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726902AbfKKPYS (ORCPT + 99 others); Mon, 11 Nov 2019 10:24:18 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:44024 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726811AbfKKPYS (ORCPT ); Mon, 11 Nov 2019 10:24:18 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id xABFO7G0123167; Mon, 11 Nov 2019 09:24:07 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1573485847; bh=CS+i48le/nixyfp28KvB8emlqsL8zLIaTpD4UiUPBgg=; h=Subject:From:To:CC:References:Date:In-Reply-To; b=EFxfIiWFMAuTURTKB1Nqf1eArMcjvwoTQtrncyqluxEXYyeL9EX1bIRk4TKehpxHC vWhrB04F3pd6z97BEeGNblTbLXPidgZlnObE6Oqi3rJcnG1G/EdVBqIij3czCePGwc bmTxhAVGtgOxmrzho+ffLh0BGuw+SpobEDOq6sdM= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xABFO7Qr002743 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 11 Nov 2019 09:24:07 -0600 Received: from DFLE106.ent.ti.com (10.64.6.27) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Mon, 11 Nov 2019 09:23:49 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Mon, 11 Nov 2019 09:23:49 -0600 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id xABFO2lD094280; Mon, 11 Nov 2019 09:24:03 -0600 Subject: Re: [PATCH v5 09/15] dmaengine: ti: New driver for K3 UDMA - split#1: defines, structs, io func From: Peter Ujfalusi To: , , , CC: , , , , , , , , , References: <20191111135330.8235-1-peter.ujfalusi@ti.com> <20191111135330.8235-10-peter.ujfalusi@ti.com> Message-ID: Date: Mon, 11 Nov 2019 17:25:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191111135330.8235-10-peter.ujfalusi@ti.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 11/11/2019 15.53, Peter Ujfalusi wrote: > Split patch for review containing: defines, structs, io and low level > functions and interrupt callbacks. > > DMA driver for > Texas Instruments K3 NAVSS Unified DMA – Peripheral Root Complex (UDMA-P) > > The UDMA-P is intended to perform similar (but significantly upgraded) functions > as the packet-oriented DMA used on previous SoC devices. The UDMA-P module > supports the transmission and reception of various packet types. The UDMA-P is > architected to facilitate the segmentation and reassembly of SoC DMA data > structure compliant packets to/from smaller data blocks that are natively > compatible with the specific requirements of each connected peripheral. Multiple > Tx and Rx channels are provided within the DMA which allow multiple segmentation > or reassembly operations to be ongoing. The DMA controller maintains state > information for each of the channels which allows packet segmentation and > reassembly operations to be time division multiplexed between channels in order > to share the underlying DMA hardware. An external DMA scheduler is used to > control the ordering and rate at which this multiplexing occurs for Transmit > operations. The ordering and rate of Receive operations is indirectly controlled > by the order in which blocks are pushed into the DMA on the Rx PSI-L interface. > > The UDMA-P also supports acting as both a UTC and UDMA-C for its internal > channels. Channels in the UDMA-P can be configured to be either Packet-Based or > Third-Party channels on a channel by channel basis. > > The initial driver supports: > - MEM_TO_MEM (TR mode) > - DEV_TO_MEM (Packet / TR mode) > - MEM_TO_DEV (Packet / TR mode) > - Cyclic (Packet / TR mode) > - Metadata for descriptors > > Signed-off-by: Peter Ujfalusi > --- > drivers/dma/ti/k3-udma.c | 1047 ++++++++++++++++++++++++++++++++++++++ > drivers/dma/ti/k3-udma.h | 120 +++++ > 2 files changed, 1167 insertions(+) > create mode 100644 drivers/dma/ti/k3-udma.c > create mode 100644 drivers/dma/ti/k3-udma.h > > diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c > new file mode 100644 > index 000000000000..c6f94d79388c > --- /dev/null > +++ b/drivers/dma/ti/k3-udma.c ... > +static bool udma_is_chan_running(struct udma_chan *uc) > +{ > + u32 trt_ctl = 0; > + u32 rrt_ctl = 0; > + > + if (uc->tchan) > + trt_ctl = udma_tchanrt_read(uc->tchan, UDMA_TCHAN_RT_CTL_REG); > + if (uc->rchan) > + rrt_ctl = udma_rchanrt_read(uc->rchan, UDMA_RCHAN_RT_CTL_REG); > + > + if (trt_ctl & (UDMA_CHAN_RT_CTL_EN || rrt_ctl & UDMA_CHAN_RT_CTL_EN)) Gash: if (trt_ctl & UDMA_CHAN_RT_CTL_EN || rrt_ctl & UDMA_CHAN_RT_CTL_EN) > + return true; > + > + return false; > +} - Péter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki