Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
imx-sdma.c File Reference
#include <linux/init.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/bitops.h>
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/semaphore.h>
#include <linux/spinlock.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/firmware.h>
#include <linux/slab.h>
#include <linux/platform_device.h>
#include <linux/dmaengine.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <asm/irq.h>
#include <linux/platform_data/dma-imx-sdma.h>
#include <linux/platform_data/dma-imx.h>
#include <mach/hardware.h>
#include "dmaengine.h"

Go to the source code of this file.

Data Structures

struct  sdma_mode_count
 
struct  sdma_buffer_descriptor
 
struct  sdma_channel_control
 
struct  sdma_state_registers
 
struct  sdma_context_data
 
struct  sdma_channel
 
struct  sdma_firmware_header
 
struct  sdma_engine
 

Macros

#define SDMA_H_C0PTR   0x000
 
#define SDMA_H_INTR   0x004
 
#define SDMA_H_STATSTOP   0x008
 
#define SDMA_H_START   0x00c
 
#define SDMA_H_EVTOVR   0x010
 
#define SDMA_H_DSPOVR   0x014
 
#define SDMA_H_HOSTOVR   0x018
 
#define SDMA_H_EVTPEND   0x01c
 
#define SDMA_H_DSPENBL   0x020
 
#define SDMA_H_RESET   0x024
 
#define SDMA_H_EVTERR   0x028
 
#define SDMA_H_INTRMSK   0x02c
 
#define SDMA_H_PSW   0x030
 
#define SDMA_H_EVTERRDBG   0x034
 
#define SDMA_H_CONFIG   0x038
 
#define SDMA_ONCE_ENB   0x040
 
#define SDMA_ONCE_DATA   0x044
 
#define SDMA_ONCE_INSTR   0x048
 
#define SDMA_ONCE_STAT   0x04c
 
#define SDMA_ONCE_CMD   0x050
 
#define SDMA_EVT_MIRROR   0x054
 
#define SDMA_ILLINSTADDR   0x058
 
#define SDMA_CHN0ADDR   0x05c
 
#define SDMA_ONCE_RTB   0x060
 
#define SDMA_XTRIG_CONF1   0x070
 
#define SDMA_XTRIG_CONF2   0x074
 
#define SDMA_CHNENBL0_IMX35   0x200
 
#define SDMA_CHNENBL0_IMX31   0x080
 
#define SDMA_CHNPRI_0   0x100
 
#define BD_DONE   0x01
 
#define BD_WRAP   0x02
 
#define BD_CONT   0x04
 
#define BD_INTR   0x08
 
#define BD_RROR   0x10
 
#define BD_LAST   0x20
 
#define BD_EXTD   0x80
 
#define DND_END_OF_FRAME   0x80
 
#define DND_END_OF_XFER   0x40
 
#define DND_DONE   0x20
 
#define DND_UNUSED   0x01
 
#define BD_IPCV2_END_OF_FRAME   0x40
 
#define IPCV2_MAX_NODES   50
 
#define DATA_ERROR   0x10000000
 
#define C0_ADDR   0x01
 
#define C0_LOAD   0x02
 
#define C0_DUMP   0x03
 
#define C0_SETCTX   0x07
 
#define C0_GETCTX   0x03
 
#define C0_SETDM   0x01
 
#define C0_SETPM   0x04
 
#define C0_GETDM   0x02
 
#define C0_GETPM   0x08
 
#define CHANGE_ENDIANNESS   0x80
 
#define NUM_BD   (int)(PAGE_SIZE / sizeof(struct sdma_buffer_descriptor))
 
#define IMX_DMA_SG_LOOP   BIT(0)
 
#define MAX_DMA_CHANNELS   32
 
#define MXC_SDMA_DEFAULT_PRIORITY   1
 
#define MXC_SDMA_MIN_PRIORITY   1
 
#define MXC_SDMA_MAX_PRIORITY   7
 
#define SDMA_FIRMWARE_MAGIC   0x414d4453
 
#define SDMA_H_CONFIG_DSPDMA   BIT(12) /* indicates if the DSPDMA is used */
 
#define SDMA_H_CONFIG_RTD_PINS   BIT(11) /* indicates if Real-Time Debug pins are enabled */
 
#define SDMA_H_CONFIG_ACR   BIT(4) /* indicates if AHB freq /core freq = 2 or 1 */
 
#define SDMA_H_CONFIG_CSM   (3) /* indicates which context switch mode is selected*/
 
#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1   34
 

Enumerations

enum  sdma_devtype { IMX31_SDMA, IMX35_SDMA }
 

Functions

struct sdma_buffer_descriptor __attribute__ ((packed))
 
 MODULE_DEVICE_TABLE (platform, sdma_devtypes)
 
 MODULE_DEVICE_TABLE (of, sdma_dt_ids)
 
 module_init (sdma_module_init)
 
 MODULE_AUTHOR ("Sascha Hauer, Pengutronix <[email protected]>")
 
 MODULE_DESCRIPTION ("i.MX SDMA driver")
 
 MODULE_LICENSE ("GPL")
 

Variables

struct sdma_mode_count mode
 
u32 buffer_addr
 
u32 ext_buffer_addr
 
u32 current_bd_ptr
 
u32 base_bd_ptr
 
u32 unused [2]
 
u32 pc
 
u32 unused1
 
u32 t
 
u32 rpc
 
u32 unused0
 
u32 sf
 
u32 spc
 
u32 unused2
 
u32 df
 
u32 epc
 
u32 lm
 
struct sdma_state_registers channel_state
 
u32 gReg [8]
 
u32 mda
 
u32 msa
 
u32 ms
 
u32 md
 
u32 pda
 
u32 psa
 
u32 ps
 
u32 pd
 
u32 ca
 
u32 cs
 
u32 dda
 
u32 dsa
 
u32 ds
 
u32 dd
 
u32 scratch0
 
u32 scratch1
 
u32 scratch2
 
u32 scratch3
 
u32 scratch4
 
u32 scratch5
 
u32 scratch6
 
u32 scratch7
 
struct sdma_channel __attribute__
 

Macro Definition Documentation

#define BD_CONT   0x04

Definition at line 83 of file imx-sdma.c.

#define BD_DONE   0x01

Definition at line 81 of file imx-sdma.c.

#define BD_EXTD   0x80

Definition at line 87 of file imx-sdma.c.

#define BD_INTR   0x08

Definition at line 84 of file imx-sdma.c.

#define BD_IPCV2_END_OF_FRAME   0x40

Definition at line 100 of file imx-sdma.c.

#define BD_LAST   0x20

Definition at line 86 of file imx-sdma.c.

#define BD_RROR   0x10

Definition at line 85 of file imx-sdma.c.

#define BD_WRAP   0x02

Definition at line 82 of file imx-sdma.c.

#define C0_ADDR   0x01

Definition at line 112 of file imx-sdma.c.

#define C0_DUMP   0x03

Definition at line 114 of file imx-sdma.c.

#define C0_GETCTX   0x03

Definition at line 116 of file imx-sdma.c.

#define C0_GETDM   0x02

Definition at line 119 of file imx-sdma.c.

#define C0_GETPM   0x08

Definition at line 120 of file imx-sdma.c.

#define C0_LOAD   0x02

Definition at line 113 of file imx-sdma.c.

#define C0_SETCTX   0x07

Definition at line 115 of file imx-sdma.c.

#define C0_SETDM   0x01

Definition at line 117 of file imx-sdma.c.

#define C0_SETPM   0x04

Definition at line 118 of file imx-sdma.c.

#define CHANGE_ENDIANNESS   0x80

Definition at line 124 of file imx-sdma.c.

#define DATA_ERROR   0x10000000

Definition at line 107 of file imx-sdma.c.

#define DND_DONE   0x20

Definition at line 94 of file imx-sdma.c.

#define DND_END_OF_FRAME   0x80

Definition at line 92 of file imx-sdma.c.

#define DND_END_OF_XFER   0x40

Definition at line 93 of file imx-sdma.c.

#define DND_UNUSED   0x01

Definition at line 95 of file imx-sdma.c.

#define IMX_DMA_SG_LOOP   BIT(0)

Definition at line 277 of file imx-sdma.c.

#define IPCV2_MAX_NODES   50

Definition at line 102 of file imx-sdma.c.

#define MAX_DMA_CHANNELS   32

Definition at line 279 of file imx-sdma.c.

#define MXC_SDMA_DEFAULT_PRIORITY   1

Definition at line 280 of file imx-sdma.c.

#define MXC_SDMA_MAX_PRIORITY   7

Definition at line 282 of file imx-sdma.c.

#define MXC_SDMA_MIN_PRIORITY   1

Definition at line 281 of file imx-sdma.c.

#define NUM_BD   (int)(PAGE_SIZE / sizeof(struct sdma_buffer_descriptor))

Definition at line 231 of file imx-sdma.c.

#define SDMA_CHN0ADDR   0x05c

Definition at line 70 of file imx-sdma.c.

#define SDMA_CHNENBL0_IMX31   0x080

Definition at line 75 of file imx-sdma.c.

#define SDMA_CHNENBL0_IMX35   0x200

Definition at line 74 of file imx-sdma.c.

#define SDMA_CHNPRI_0   0x100

Definition at line 76 of file imx-sdma.c.

#define SDMA_EVT_MIRROR   0x054

Definition at line 68 of file imx-sdma.c.

#define SDMA_FIRMWARE_MAGIC   0x414d4453

Definition at line 284 of file imx-sdma.c.

#define SDMA_H_C0PTR   0x000

Definition at line 48 of file imx-sdma.c.

#define SDMA_H_CONFIG   0x038

Definition at line 62 of file imx-sdma.c.

#define SDMA_H_CONFIG_ACR   BIT(4) /* indicates if AHB freq /core freq = 2 or 1 */

Definition at line 354 of file imx-sdma.c.

#define SDMA_H_CONFIG_CSM   (3) /* indicates which context switch mode is selected*/

Definition at line 355 of file imx-sdma.c.

#define SDMA_H_CONFIG_DSPDMA   BIT(12) /* indicates if the DSPDMA is used */

Definition at line 352 of file imx-sdma.c.

#define SDMA_H_CONFIG_RTD_PINS   BIT(11) /* indicates if Real-Time Debug pins are enabled */

Definition at line 353 of file imx-sdma.c.

#define SDMA_H_DSPENBL   0x020

Definition at line 56 of file imx-sdma.c.

#define SDMA_H_DSPOVR   0x014

Definition at line 53 of file imx-sdma.c.

#define SDMA_H_EVTERR   0x028

Definition at line 58 of file imx-sdma.c.

#define SDMA_H_EVTERRDBG   0x034

Definition at line 61 of file imx-sdma.c.

#define SDMA_H_EVTOVR   0x010

Definition at line 52 of file imx-sdma.c.

#define SDMA_H_EVTPEND   0x01c

Definition at line 55 of file imx-sdma.c.

#define SDMA_H_HOSTOVR   0x018

Definition at line 54 of file imx-sdma.c.

#define SDMA_H_INTR   0x004

Definition at line 49 of file imx-sdma.c.

#define SDMA_H_INTRMSK   0x02c

Definition at line 59 of file imx-sdma.c.

#define SDMA_H_PSW   0x030

Definition at line 60 of file imx-sdma.c.

#define SDMA_H_RESET   0x024

Definition at line 57 of file imx-sdma.c.

#define SDMA_H_START   0x00c

Definition at line 51 of file imx-sdma.c.

#define SDMA_H_STATSTOP   0x008

Definition at line 50 of file imx-sdma.c.

#define SDMA_ILLINSTADDR   0x058

Definition at line 69 of file imx-sdma.c.

#define SDMA_ONCE_CMD   0x050

Definition at line 67 of file imx-sdma.c.

#define SDMA_ONCE_DATA   0x044

Definition at line 64 of file imx-sdma.c.

#define SDMA_ONCE_ENB   0x040

Definition at line 63 of file imx-sdma.c.

#define SDMA_ONCE_INSTR   0x048

Definition at line 65 of file imx-sdma.c.

#define SDMA_ONCE_RTB   0x060

Definition at line 71 of file imx-sdma.c.

#define SDMA_ONCE_STAT   0x04c

Definition at line 66 of file imx-sdma.c.

#define SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1   34

Definition at line 1146 of file imx-sdma.c.

#define SDMA_XTRIG_CONF1   0x070

Definition at line 72 of file imx-sdma.c.

#define SDMA_XTRIG_CONF2   0x074

Definition at line 73 of file imx-sdma.c.

Enumeration Type Documentation

Enumerator:
IMX31_SDMA 
IMX35_SDMA 

Definition at line 310 of file imx-sdma.c.

Function Documentation

Definition at line 171 of file esd_usb2.c.

MODULE_AUTHOR ( "Sascha  Hauer,
Pengutronix< s.hauer @pengutronix.de >"   
)
MODULE_DESCRIPTION ( "i.MX SDMA driver )
MODULE_DEVICE_TABLE ( platform  ,
sdma_devtypes   
)
MODULE_DEVICE_TABLE ( of  ,
sdma_dt_ids   
)
module_init ( sdma_module_init  )
MODULE_LICENSE ( "GPL"  )

Variable Documentation

u32 base_bd_ptr

Definition at line 158 of file imx-sdma.c.

u32 buffer_addr

Definition at line 144 of file imx-sdma.c.

u32 ca

Definition at line 240 of file imx-sdma.c.

Definition at line 230 of file imx-sdma.c.

u32 cs

Definition at line 241 of file imx-sdma.c.

u32 current_bd_ptr

Definition at line 157 of file imx-sdma.c.

u32 dd

Definition at line 245 of file imx-sdma.c.

u32 dda

Definition at line 242 of file imx-sdma.c.

u32 df

Definition at line 191 of file imx-sdma.c.

u32 ds

Definition at line 244 of file imx-sdma.c.

u32 dsa

Definition at line 243 of file imx-sdma.c.

u32 epc

Definition at line 192 of file imx-sdma.c.

u32 ext_buffer_addr

Definition at line 145 of file imx-sdma.c.

u32 gReg[8]

Definition at line 231 of file imx-sdma.c.

u32 lm

Definition at line 193 of file imx-sdma.c.

u32 md

Definition at line 235 of file imx-sdma.c.

u32 mda

Definition at line 232 of file imx-sdma.c.

Definition at line 143 of file imx-sdma.c.

u32 ms

Definition at line 234 of file imx-sdma.c.

u32 msa

Definition at line 233 of file imx-sdma.c.

u32 pc

Definition at line 183 of file imx-sdma.c.

Definition at line 239 of file imx-sdma.c.

Definition at line 236 of file imx-sdma.c.

Definition at line 238 of file imx-sdma.c.

u32 psa

Definition at line 237 of file imx-sdma.c.

u32 rpc

Definition at line 186 of file imx-sdma.c.

u32 scratch0

Definition at line 246 of file imx-sdma.c.

u32 scratch1

Definition at line 247 of file imx-sdma.c.

u32 scratch2

Definition at line 248 of file imx-sdma.c.

u32 scratch3

Definition at line 249 of file imx-sdma.c.

u32 scratch4

Definition at line 250 of file imx-sdma.c.

u32 scratch5

Definition at line 251 of file imx-sdma.c.

u32 scratch6

Definition at line 252 of file imx-sdma.c.

u32 scratch7

Definition at line 253 of file imx-sdma.c.

u32 sf

Definition at line 188 of file imx-sdma.c.

u32 spc

Definition at line 189 of file imx-sdma.c.

u32 t

Definition at line 185 of file imx-sdma.c.

u32 unused[2]

Definition at line 159 of file imx-sdma.c.

u32 unused0

Definition at line 187 of file imx-sdma.c.

u32 unused1

Definition at line 184 of file imx-sdma.c.

u32 unused2

Definition at line 190 of file imx-sdma.c.