Letux 400 Hardware

DMA

You are looking at an old revision of the page DMA. This revision was created by Paul Boddie.

Table of Content

The direct memory access peripheral

DMA

The JZ4730 has a slightly different memory layout for DMA registers compared to the JZ4740 and related SoCs. However, the general base location for the DMA peripheral remains at 0x10020000.

There are two kinds of registers: global and channel. The global registers appear in one location relative to the DMA base address and control the peripheral generally.

Register Offset Purpose
IRQP 0xf8 IRQ pending
DMAC 0xfc Control

Note that the order of these is reversed from the JZ4740 which also exposes more global registers.

Meanwhile, channel registers appear in as many locations as there are distinct channels, starting at 0x10020000. There are 6 channels in the JZ4730 peripheral.

Banks of channel registers occur at intervals of 0x20, with the registers being defined relative to the base of each bank as follows:

Register Offset Purpose
DSA 0x00 Source address
DDA 0x04 Descriptor address (JZ4740: target address)
DTC 0x08 Transfer count
DRT/DRS 0x0c Request type/source
DCS/DCCSR 0x10 Control/status

Other registers provided by the JZ4740 do not appear to be supported.

DMAC

Bit Purpose
0 Enable
2 Test for address error
3 Test for halt error
8..9 Channel priorities

Channel priorities are indicated in the above field using the following values:

Value Policy
0 01234567
1 02314675
2 20136457
3 Round robin

The above policies are taken from the legacy JZ4730 definitions. It is not clear whether there really are channels 6 and 7.

IRQP

Bit Purpose
15..8 IRQ pending for channels

Following the hints in the JZ4740 definitions, it seems likely that bits 13..8 are used to indicate interrupt conditions for channels 5..0.

DSA

DDA

DRT/DRS

According to the legacy JZ4730 kernel definitions, request sources/types are associated with bits in the DRT register as follows:

Bit Request Type/Source
0 EXTREXTR
4 PCMCIAOUT
5 PCMCIAIN
8 AUTO
10 DESOUT
11 DESIN
14 UART3OUT
15 UART3IN
16 UART2OUT
17 UART2IN
18 UART1OUT
19 UART1IN
20 UART0OUT
21 UART0IN
22 SSIOUT
23 SSIIN
24 AICOUT
25 AICIN
26 MSCOUT
27 MSCIN
28 OST2

DCS/DCCSR

Interrupts

The DMA controller interrupt number applicable to the interrupt controller (INTC) registers is 21. However, there are also channel-level interrupts from 31 to 36.

Resources

In recent kernels, the DMA support has been located in the following file:

  • drivers/dma/dma-jz4780.c