mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marc Gonzalez <marc.w.gonzalez@free.fr>
To: Igor Plyatov <plyatov@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Robin Gong <yibin.gong@nxp.com>,
	Uwe Kleine-Konig <u.kleine-koenig@pengutronix.de>
Subject: Re: Issues with i.MX SPI DMA transfers
Date: Thu, 18 Apr 2019 12:35:25 +0200	[thread overview]
Message-ID: <dca134ca-044e-fd67-6568-02932be209e0@free.fr> (raw)
In-Reply-To: <fbb4850d-f63f-d384-1a85-1f4c5c077af6@gmail.com>

[ 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


  parent reply	other threads:[~2019-04-18 10:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-27 17:40 Igor Plyatov
2019-03-28  2:37 ` Aisheng Dong
2019-03-28  6:58   ` Igor Plyatov
2019-03-28  6:52 ` Uwe Kleine-König
2019-03-28  7:04   ` Igor Plyatov
2019-03-28  7:21     ` Robin Gong
2019-03-28  8:22     ` Uwe Kleine-König
2019-03-29 11:57       ` Igor Plyatov
2019-03-28  9:23     ` Robin Gong
2019-03-28 11:05       ` Igor Plyatov
2019-04-01  7:35         ` Robin Gong
2019-04-02  7:20           ` Igor Plyatov
2019-04-02  8:32             ` Robin Gong
2019-04-02 12:15               ` Igor Plyatov
2019-04-03  7:38                 ` Robin Gong
2019-04-03 15:51                   ` Igor Plyatov
2019-04-08 10:18                     ` Robin Gong
2019-04-18 10:35                     ` Marc Gonzalez [this message]
2019-04-03 17:13                   ` Igor Plyatov
2019-04-09  3:26               ` Robin Gong
2019-04-18  1:19                 ` Robin Gong
2019-04-18  6:30                   ` Igor Plyatov
2019-04-18  8:05                     ` Robin Gong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dca134ca-044e-fd67-6568-02932be209e0@free.fr \
    --to=marc.w.gonzalez@free.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=plyatov@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=yibin.gong@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®