# Texas Instruments DMA Crossbar (DMA request router)

_Peios Kernel / Hardware and drivers / Device tree / bindings/dma_

> Device-tree binding reference for Texas Instruments DMA Crossbar (DMA request router).

## Required properties:

- compatible:	"ti,dra7-dma-crossbar" for DRA7xx DMA crossbar
  "ti,am335x-edma-crossbar" for AM335x and AM437x
- reg:		Memory map for accessing module
- #dma-cells:	Should be set to match with the DMA controller's dma-cells
  for ti,dra7-dma-crossbar and &lt;3&gt; for ti,am335x-edma-crossbar.
- dma-requests:	Number of DMA requests the crossbar can receive
- dma-masters:	phandle pointing to the DMA controller

The DMA controller node need to have the following poroperties:

- dma-requests:	Number of DMA requests the controller can handle

## Optional properties:

- ti,dma-safe-map: Safe routing value for unused request lines
- ti,reserved-dma-request-ranges: DMA request ranges which should not be used
  when mapping xbar input to DMA request, they are either
  allocated to be used by for example the DSP or they are used as
  memcpy channels in eDMA.

## Notes:

When requesting channel via ti,dra7-dma-crossbar, the DMA client must request
the DMA event number as crossbar ID (input to the DMA crossbar).

For ti,am335x-edma-crossbar: the meaning of parameters of dmas for clients:

```dts
dmas = <&edma_xbar 12 0 1>; where <12> is the DMA request number, <0> is the TC
```

the event should be assigned and &lt;1&gt; is the mux selection for in the crossbar.
When mux 0 is used the DMA channel can be requested directly from edma node.

## Example:

/\* DMA controller \*/

```dts
sdma: dma-controller@4a056000 {
	compatible = "ti,omap4430-sdma";
	reg = <0x4a056000 0x1000>;
	interrupts =	<GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>,
			<GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>,
			<GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>,
			<GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
	#dma-cells = <1>;
	dma-channels = <32>;
	dma-requests = <127>;
};
```

/\* DMA crossbar \*/

```dts
sdma_xbar: dma-router@4a002b78 {
	compatible = "ti,dra7-dma-crossbar";
	reg = <0x4a002b78 0xfc>;
	#dma-cells = <1>;
	dma-requests = <205>;
	ti,dma-safe-map = <0>;
	/* Protect the sDMA request ranges: 10-14 and 100-126 */
	ti,reserved-dma-request-ranges = <10 5>, <100 27>;
	dma-masters = <&sdma>;
};
```

/\* DMA client \*/

```dts
uart1: serial@4806a000 {
	compatible = "ti,omap4-uart";
	reg = <0x4806a000 0x100>;
	interrupts-extended = <&gic GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>;
	ti,hwmods = "uart1";
	clock-frequency = <48000000>;
	/* Requesting crossbar input 49 and 50 */
	dmas = <&sdma_xbar 49>, <&sdma_xbar 50>;
	dma-names = "tx", "rx";
};
```
