Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
mxcmmc.c File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/blkdev.h>
#include <linux/dma-mapping.h>
#include <linux/mmc/host.h>
#include <linux/mmc/card.h>
#include <linux/delay.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/gpio.h>
#include <linux/regulator/consumer.h>
#include <linux/dmaengine.h>
#include <linux/types.h>
#include <asm/dma.h>
#include <asm/irq.h>
#include <asm/sizes.h>
#include <linux/platform_data/mmc-mxcmmc.h>
#include <linux/platform_data/dma-imx.h>
#include <mach/hardware.h>

Go to the source code of this file.

Data Structures

struct  mxcmci_host
 

Macros

#define DRIVER_NAME   "mxc-mmc"
 
#define MXCMCI_TIMEOUT_MS   10000
 
#define MMC_REG_STR_STP_CLK   0x00
 
#define MMC_REG_STATUS   0x04
 
#define MMC_REG_CLK_RATE   0x08
 
#define MMC_REG_CMD_DAT_CONT   0x0C
 
#define MMC_REG_RES_TO   0x10
 
#define MMC_REG_READ_TO   0x14
 
#define MMC_REG_BLK_LEN   0x18
 
#define MMC_REG_NOB   0x1C
 
#define MMC_REG_REV_NO   0x20
 
#define MMC_REG_INT_CNTR   0x24
 
#define MMC_REG_CMD   0x28
 
#define MMC_REG_ARG   0x2C
 
#define MMC_REG_RES_FIFO   0x34
 
#define MMC_REG_BUFFER_ACCESS   0x38
 
#define STR_STP_CLK_RESET   (1 << 3)
 
#define STR_STP_CLK_START_CLK   (1 << 1)
 
#define STR_STP_CLK_STOP_CLK   (1 << 0)
 
#define STATUS_CARD_INSERTION   (1 << 31)
 
#define STATUS_CARD_REMOVAL   (1 << 30)
 
#define STATUS_YBUF_EMPTY   (1 << 29)
 
#define STATUS_XBUF_EMPTY   (1 << 28)
 
#define STATUS_YBUF_FULL   (1 << 27)
 
#define STATUS_XBUF_FULL   (1 << 26)
 
#define STATUS_BUF_UND_RUN   (1 << 25)
 
#define STATUS_BUF_OVFL   (1 << 24)
 
#define STATUS_SDIO_INT_ACTIVE   (1 << 14)
 
#define STATUS_END_CMD_RESP   (1 << 13)
 
#define STATUS_WRITE_OP_DONE   (1 << 12)
 
#define STATUS_DATA_TRANS_DONE   (1 << 11)
 
#define STATUS_READ_OP_DONE   (1 << 11)
 
#define STATUS_WR_CRC_ERROR_CODE_MASK   (3 << 10)
 
#define STATUS_CARD_BUS_CLK_RUN   (1 << 8)
 
#define STATUS_BUF_READ_RDY   (1 << 7)
 
#define STATUS_BUF_WRITE_RDY   (1 << 6)
 
#define STATUS_RESP_CRC_ERR   (1 << 5)
 
#define STATUS_CRC_READ_ERR   (1 << 3)
 
#define STATUS_CRC_WRITE_ERR   (1 << 2)
 
#define STATUS_TIME_OUT_RESP   (1 << 1)
 
#define STATUS_TIME_OUT_READ   (1 << 0)
 
#define STATUS_ERR_MASK   0x2f
 
#define CMD_DAT_CONT_CMD_RESP_LONG_OFF   (1 << 12)
 
#define CMD_DAT_CONT_STOP_READWAIT   (1 << 11)
 
#define CMD_DAT_CONT_START_READWAIT   (1 << 10)
 
#define CMD_DAT_CONT_BUS_WIDTH_4   (2 << 8)
 
#define CMD_DAT_CONT_INIT   (1 << 7)
 
#define CMD_DAT_CONT_WRITE   (1 << 4)
 
#define CMD_DAT_CONT_DATA_ENABLE   (1 << 3)
 
#define CMD_DAT_CONT_RESPONSE_48BIT_CRC   (1 << 0)
 
#define CMD_DAT_CONT_RESPONSE_136BIT   (2 << 0)
 
#define CMD_DAT_CONT_RESPONSE_48BIT   (3 << 0)
 
#define INT_SDIO_INT_WKP_EN   (1 << 18)
 
#define INT_CARD_INSERTION_WKP_EN   (1 << 17)
 
#define INT_CARD_REMOVAL_WKP_EN   (1 << 16)
 
#define INT_CARD_INSERTION_EN   (1 << 15)
 
#define INT_CARD_REMOVAL_EN   (1 << 14)
 
#define INT_SDIO_IRQ_EN   (1 << 13)
 
#define INT_DAT0_EN   (1 << 12)
 
#define INT_BUF_READ_EN   (1 << 4)
 
#define INT_BUF_WRITE_EN   (1 << 3)
 
#define INT_END_CMD_RES_EN   (1 << 2)
 
#define INT_WRITE_OP_DONE_EN   (1 << 1)
 
#define INT_READ_OP_EN   (1 << 0)
 

Functions

 module_platform_driver (mxcmci_driver)
 
 MODULE_DESCRIPTION ("i.MX Multimedia Card Interface Driver")
 
 MODULE_AUTHOR ("Sascha Hauer, Pengutronix")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS ("platform:mxc-mmc")
 

Macro Definition Documentation

#define CMD_DAT_CONT_BUS_WIDTH_4   (2 << 8)

Definition at line 95 of file mxcmmc.c.

#define CMD_DAT_CONT_CMD_RESP_LONG_OFF   (1 << 12)

Definition at line 92 of file mxcmmc.c.

#define CMD_DAT_CONT_DATA_ENABLE   (1 << 3)

Definition at line 98 of file mxcmmc.c.

#define CMD_DAT_CONT_INIT   (1 << 7)

Definition at line 96 of file mxcmmc.c.

#define CMD_DAT_CONT_RESPONSE_136BIT   (2 << 0)

Definition at line 100 of file mxcmmc.c.

#define CMD_DAT_CONT_RESPONSE_48BIT   (3 << 0)

Definition at line 101 of file mxcmmc.c.

#define CMD_DAT_CONT_RESPONSE_48BIT_CRC   (1 << 0)

Definition at line 99 of file mxcmmc.c.

#define CMD_DAT_CONT_START_READWAIT   (1 << 10)

Definition at line 94 of file mxcmmc.c.

#define CMD_DAT_CONT_STOP_READWAIT   (1 << 11)

Definition at line 93 of file mxcmmc.c.

#define CMD_DAT_CONT_WRITE   (1 << 4)

Definition at line 97 of file mxcmmc.c.

#define DRIVER_NAME   "mxc-mmc"

Definition at line 46 of file mxcmmc.c.

#define INT_BUF_READ_EN   (1 << 4)

Definition at line 110 of file mxcmmc.c.

#define INT_BUF_WRITE_EN   (1 << 3)

Definition at line 111 of file mxcmmc.c.

#define INT_CARD_INSERTION_EN   (1 << 15)

Definition at line 106 of file mxcmmc.c.

#define INT_CARD_INSERTION_WKP_EN   (1 << 17)

Definition at line 104 of file mxcmmc.c.

#define INT_CARD_REMOVAL_EN   (1 << 14)

Definition at line 107 of file mxcmmc.c.

#define INT_CARD_REMOVAL_WKP_EN   (1 << 16)

Definition at line 105 of file mxcmmc.c.

#define INT_DAT0_EN   (1 << 12)

Definition at line 109 of file mxcmmc.c.

#define INT_END_CMD_RES_EN   (1 << 2)

Definition at line 112 of file mxcmmc.c.

#define INT_READ_OP_EN   (1 << 0)

Definition at line 114 of file mxcmmc.c.

#define INT_SDIO_INT_WKP_EN   (1 << 18)

Definition at line 103 of file mxcmmc.c.

#define INT_SDIO_IRQ_EN   (1 << 13)

Definition at line 108 of file mxcmmc.c.

#define INT_WRITE_OP_DONE_EN   (1 << 1)

Definition at line 113 of file mxcmmc.c.

#define MMC_REG_ARG   0x2C

Definition at line 60 of file mxcmmc.c.

#define MMC_REG_BLK_LEN   0x18

Definition at line 55 of file mxcmmc.c.

#define MMC_REG_BUFFER_ACCESS   0x38

Definition at line 62 of file mxcmmc.c.

#define MMC_REG_CLK_RATE   0x08

Definition at line 51 of file mxcmmc.c.

#define MMC_REG_CMD   0x28

Definition at line 59 of file mxcmmc.c.

#define MMC_REG_CMD_DAT_CONT   0x0C

Definition at line 52 of file mxcmmc.c.

#define MMC_REG_INT_CNTR   0x24

Definition at line 58 of file mxcmmc.c.

#define MMC_REG_NOB   0x1C

Definition at line 56 of file mxcmmc.c.

#define MMC_REG_READ_TO   0x14

Definition at line 54 of file mxcmmc.c.

#define MMC_REG_RES_FIFO   0x34

Definition at line 61 of file mxcmmc.c.

#define MMC_REG_RES_TO   0x10

Definition at line 53 of file mxcmmc.c.

#define MMC_REG_REV_NO   0x20

Definition at line 57 of file mxcmmc.c.

#define MMC_REG_STATUS   0x04

Definition at line 50 of file mxcmmc.c.

#define MMC_REG_STR_STP_CLK   0x00

Definition at line 49 of file mxcmmc.c.

#define MXCMCI_TIMEOUT_MS   10000

Definition at line 47 of file mxcmmc.c.

#define STATUS_BUF_OVFL   (1 << 24)

Definition at line 75 of file mxcmmc.c.

#define STATUS_BUF_READ_RDY   (1 << 7)

Definition at line 83 of file mxcmmc.c.

#define STATUS_BUF_UND_RUN   (1 << 25)

Definition at line 74 of file mxcmmc.c.

#define STATUS_BUF_WRITE_RDY   (1 << 6)

Definition at line 84 of file mxcmmc.c.

#define STATUS_CARD_BUS_CLK_RUN   (1 << 8)

Definition at line 82 of file mxcmmc.c.

#define STATUS_CARD_INSERTION   (1 << 31)

Definition at line 68 of file mxcmmc.c.

#define STATUS_CARD_REMOVAL   (1 << 30)

Definition at line 69 of file mxcmmc.c.

#define STATUS_CRC_READ_ERR   (1 << 3)

Definition at line 86 of file mxcmmc.c.

#define STATUS_CRC_WRITE_ERR   (1 << 2)

Definition at line 87 of file mxcmmc.c.

#define STATUS_DATA_TRANS_DONE   (1 << 11)

Definition at line 79 of file mxcmmc.c.

#define STATUS_END_CMD_RESP   (1 << 13)

Definition at line 77 of file mxcmmc.c.

#define STATUS_ERR_MASK   0x2f

Definition at line 90 of file mxcmmc.c.

#define STATUS_READ_OP_DONE   (1 << 11)

Definition at line 80 of file mxcmmc.c.

#define STATUS_RESP_CRC_ERR   (1 << 5)

Definition at line 85 of file mxcmmc.c.

#define STATUS_SDIO_INT_ACTIVE   (1 << 14)

Definition at line 76 of file mxcmmc.c.

#define STATUS_TIME_OUT_READ   (1 << 0)

Definition at line 89 of file mxcmmc.c.

#define STATUS_TIME_OUT_RESP   (1 << 1)

Definition at line 88 of file mxcmmc.c.

#define STATUS_WR_CRC_ERROR_CODE_MASK   (3 << 10)

Definition at line 81 of file mxcmmc.c.

#define STATUS_WRITE_OP_DONE   (1 << 12)

Definition at line 78 of file mxcmmc.c.

#define STATUS_XBUF_EMPTY   (1 << 28)

Definition at line 71 of file mxcmmc.c.

#define STATUS_XBUF_FULL   (1 << 26)

Definition at line 73 of file mxcmmc.c.

#define STATUS_YBUF_EMPTY   (1 << 29)

Definition at line 70 of file mxcmmc.c.

#define STATUS_YBUF_FULL   (1 << 27)

Definition at line 72 of file mxcmmc.c.

#define STR_STP_CLK_RESET   (1 << 3)

Definition at line 64 of file mxcmmc.c.

#define STR_STP_CLK_START_CLK   (1 << 1)

Definition at line 65 of file mxcmmc.c.

#define STR_STP_CLK_STOP_CLK   (1 << 0)

Definition at line 66 of file mxcmmc.c.

Function Documentation

MODULE_ALIAS ( "platform:mxc-mmc"  )
MODULE_AUTHOR ( "Sascha  Hauer,
Pengutronix"   
)
MODULE_DESCRIPTION ( "i.MX Multimedia Card Interface Driver"  )
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( mxcmci_driver  )