Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp418997yba; Thu, 18 Apr 2019 03:38:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYRsp7rqjRU4T0tSYhbnVGsnaU787reYt8QJXbnUU+6iAmEzJc6rPVclxyfuHQsuo/3aZD X-Received: by 2002:a17:902:848d:: with SMTP id c13mr94213477plo.279.1555583909036; Thu, 18 Apr 2019 03:38:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555583909; cv=none; d=google.com; s=arc-20160816; b=nH0nzJq7o77tBrsfs2MyS6HJn3rzRWU7W3ADBsXrznlTLRS8JRTpP3EpQ7DtKfGu08 BCiNly3v5RgBuWQ8b2VskCj9zTjjX0ArEb0EwkOj6v3LZKPcCZnwR8nf6o+aGqAybeyv 7c47oAiWIa7CmhdWon/Eky023xq8m5dnhHjGsKolx0P7zXrShKoAQkNOy7rsKIpATnKH 2lppdJBdVW13egDga6dpUOwnHdjqSMZ6CbUud7c/TY7kDdIbEQBArZAMoguocgUqoxsv Z34IVEVJLNwUTcDIYdVjkFqkbcNSxr5PMtNmNUQMFWLRVqywDAlcg0IFyJ9Gvh1gfhf9 9l/Q== 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:from:cc:references:to:subject; bh=TEg/WdRP3paNy490xQ9q/e2+GN04qRyg0YeJfwNm3Xw=; b=HJGWYbGhY3/IcUEv7MsnjSaT44MiOqPh1uUXdyhJ9plZapRvTKYCcWZNQOWdwAyusQ vP6QNTsu/utIwKrddTnt4wBSSS4RYQ9cCWR36SGQrRD/DV6o9uQq1lQpJyJ10RNAUIxp x4wo1uH8oKEQbLTaT86hWA20hJN0HGUaYo3dRdvKsQX8YPK7OMpfSElc1jwTzBDihCfA 19h4mwCLolimvsaF30WBPqHlo4sDoWii+SjBhbNLDu+BFwK32wu5Eai3/d7zBEBZHTjL +CXNdDuIshXxMf/GGejWu5czs96Kd+obczcBD7wPGZhyWh4ivzms44dbe8eJ9JzdcJY8 JLWA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d3si1940915pfc.278.2019.04.18.03.38.13; Thu, 18 Apr 2019 03:38:29 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388605AbfDRKf2 (ORCPT + 99 others); Thu, 18 Apr 2019 06:35:28 -0400 Received: from ns.iliad.fr ([212.27.33.1]:33184 "EHLO ns.iliad.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388369AbfDRKf1 (ORCPT ); Thu, 18 Apr 2019 06:35:27 -0400 Received: from ns.iliad.fr (localhost [127.0.0.1]) by ns.iliad.fr (Postfix) with ESMTP id 6B34720E2E; Thu, 18 Apr 2019 12:35:25 +0200 (CEST) Received: from [192.168.108.49] (freebox.vlq16.iliad.fr [213.36.7.13]) by ns.iliad.fr (Postfix) with ESMTP id 54A8D20D88; Thu, 18 Apr 2019 12:35:25 +0200 (CEST) Subject: Re: Issues with i.MX SPI DMA transfers To: Igor Plyatov References: <08fcbd65-510f-84f8-d6d6-ff56aa9ca9ad@gmail.com> <20190328065247.uz73lap7ljf5q3tb@pengutronix.de> <95df9334-3d0c-7d13-e431-5a4aa2b9907e@gmail.com> <197990d4-b1e2-8db9-0cb7-87b860f23bd7@gmail.com> Cc: LKML , Robin Gong , Uwe Kleine-Konig From: Marc Gonzalez Message-ID: Date: Thu, 18 Apr 2019 12:35:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP ; ns.iliad.fr ; Thu Apr 18 12:35:25 2019 +0200 (CEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Trimming recipients list ] On 03/04/2019 17:51, Igor Plyatov wrote: > 2) I want to improve description and replace magic numbers by constants > in Device Tree for SDMA. I mean strings like "dmas = <&sdma 11 7 1>, > <&sdma 12 7 2>;"? > > So, finally Device Tree will have strings like > > dmas = <&sdma SOME_DEF_A IMX_DMATYPE_.. DMA_PRIO_..>, <&sdma SOME_DEF_B > IMX_DMATYPE_.. DMA_PRIO_..>; > > I think, this will stop black magic manipulations for SDMA in Device > Tree, by various developers. > > Does first digit means "DMA request/event ID"? Where to find more info > about this? > > Does second digit means "enum sdma_peripheral_type"? > > Does third digit means "enum imx_dma_prio"? Start at Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/spi/fsl-imx-cspi.txt - dmas: DMA specifiers for tx and rx dma. See the DMA client binding, Documentation/devicetree/bindings/dma/dma.txt. - dma-names: DMA request names, if present, should include "tx" and "rx". Client drivers should specify the DMA property using a phandle to the controller followed by DMA controller specific data. Required property: - dmas: List of one or more DMA specifiers, each consisting of - A phandle pointing to DMA controller node - A number of integer cells, as determined by the #dma-cells property in the node referenced by phandle containing DMA controller specific information. This typically contains a DMA request line number or a channel number, but can contain any data that is required for configuring a channel. - dma-names: Contains one identifier string for each DMA specifier in the dmas property. The specific strings that can be used are defined in the binding of the DMA client device. Multiple DMA specifiers can be used to represent alternatives and in this case the dma-names for those DMA specifiers must be identical (see examples). Turning our attention to Documentation/devicetree/bindings/dma/fsl-imx-sdma.txt - #dma-cells : Must be <3>. The first cell specifies the DMA request/event ID. See details below about the second and third cell. The second cell of dma phandle specifies the peripheral type of DMA transfer. The full ID of peripheral types can be found below. ID transfer type --------------------- 0 MCU domain SSI 1 Shared SSI 2 MMC 3 SDHC 4 MCU domain UART 5 Shared UART 6 FIRI 7 MCU domain CSPI 8 Shared CSPI 9 SIM 10 ATA 11 CCM 12 External peripheral 13 Memory Stick Host Controller 14 Shared Memory Stick Host Controller 15 DSP 16 Memory 17 FIFO type Memory 18 SPDIF 19 IPU Memory 20 ASRC 21 ESAI 22 SSI Dual FIFO (needs firmware ver >= 2) 23 Shared ASRC 24 SAI The third cell specifies the transfer priority as below. ID transfer priority ------------------------- 0 High 1 Medium 2 Low