Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
dw_mmc.h File Reference

Go to the source code of this file.

Data Structures

struct  dw_mci_drv_data
 

Macros

#define DW_MMC_240A   0x240a
 
#define SDMMC_CTRL   0x000
 
#define SDMMC_PWREN   0x004
 
#define SDMMC_CLKDIV   0x008
 
#define SDMMC_CLKSRC   0x00c
 
#define SDMMC_CLKENA   0x010
 
#define SDMMC_TMOUT   0x014
 
#define SDMMC_CTYPE   0x018
 
#define SDMMC_BLKSIZ   0x01c
 
#define SDMMC_BYTCNT   0x020
 
#define SDMMC_INTMASK   0x024
 
#define SDMMC_CMDARG   0x028
 
#define SDMMC_CMD   0x02c
 
#define SDMMC_RESP0   0x030
 
#define SDMMC_RESP1   0x034
 
#define SDMMC_RESP2   0x038
 
#define SDMMC_RESP3   0x03c
 
#define SDMMC_MINTSTS   0x040
 
#define SDMMC_RINTSTS   0x044
 
#define SDMMC_STATUS   0x048
 
#define SDMMC_FIFOTH   0x04c
 
#define SDMMC_CDETECT   0x050
 
#define SDMMC_WRTPRT   0x054
 
#define SDMMC_GPIO   0x058
 
#define SDMMC_TCBCNT   0x05c
 
#define SDMMC_TBBCNT   0x060
 
#define SDMMC_DEBNCE   0x064
 
#define SDMMC_USRID   0x068
 
#define SDMMC_VERID   0x06c
 
#define SDMMC_HCON   0x070
 
#define SDMMC_UHS_REG   0x074
 
#define SDMMC_BMOD   0x080
 
#define SDMMC_PLDMND   0x084
 
#define SDMMC_DBADDR   0x088
 
#define SDMMC_IDSTS   0x08c
 
#define SDMMC_IDINTEN   0x090
 
#define SDMMC_DSCADDR   0x094
 
#define SDMMC_BUFADDR   0x098
 
#define SDMMC_DATA(x)   (x)
 
#define DATA_OFFSET   0x100
 
#define DATA_240A_OFFSET   0x200
 
#define _SBF(f, v)   ((v) << (f))
 
#define SDMMC_CTRL_USE_IDMAC   BIT(25)
 
#define SDMMC_CTRL_CEATA_INT_EN   BIT(11)
 
#define SDMMC_CTRL_SEND_AS_CCSD   BIT(10)
 
#define SDMMC_CTRL_SEND_CCSD   BIT(9)
 
#define SDMMC_CTRL_ABRT_READ_DATA   BIT(8)
 
#define SDMMC_CTRL_SEND_IRQ_RESP   BIT(7)
 
#define SDMMC_CTRL_READ_WAIT   BIT(6)
 
#define SDMMC_CTRL_DMA_ENABLE   BIT(5)
 
#define SDMMC_CTRL_INT_ENABLE   BIT(4)
 
#define SDMMC_CTRL_DMA_RESET   BIT(2)
 
#define SDMMC_CTRL_FIFO_RESET   BIT(1)
 
#define SDMMC_CTRL_RESET   BIT(0)
 
#define SDMMC_CLKEN_LOW_PWR   BIT(16)
 
#define SDMMC_CLKEN_ENABLE   BIT(0)
 
#define SDMMC_TMOUT_DATA(n)   _SBF(8, (n))
 
#define SDMMC_TMOUT_DATA_MSK   0xFFFFFF00
 
#define SDMMC_TMOUT_RESP(n)   ((n) & 0xFF)
 
#define SDMMC_TMOUT_RESP_MSK   0xFF
 
#define SDMMC_CTYPE_8BIT   BIT(16)
 
#define SDMMC_CTYPE_4BIT   BIT(0)
 
#define SDMMC_CTYPE_1BIT   0
 
#define SDMMC_INT_SDIO(n)   BIT(16 + (n))
 
#define SDMMC_INT_EBE   BIT(15)
 
#define SDMMC_INT_ACD   BIT(14)
 
#define SDMMC_INT_SBE   BIT(13)
 
#define SDMMC_INT_HLE   BIT(12)
 
#define SDMMC_INT_FRUN   BIT(11)
 
#define SDMMC_INT_HTO   BIT(10)
 
#define SDMMC_INT_DTO   BIT(9)
 
#define SDMMC_INT_RTO   BIT(8)
 
#define SDMMC_INT_DCRC   BIT(7)
 
#define SDMMC_INT_RCRC   BIT(6)
 
#define SDMMC_INT_RXDR   BIT(5)
 
#define SDMMC_INT_TXDR   BIT(4)
 
#define SDMMC_INT_DATA_OVER   BIT(3)
 
#define SDMMC_INT_CMD_DONE   BIT(2)
 
#define SDMMC_INT_RESP_ERR   BIT(1)
 
#define SDMMC_INT_CD   BIT(0)
 
#define SDMMC_INT_ERROR   0xbfc2
 
#define SDMMC_CMD_START   BIT(31)
 
#define SDMMC_CMD_CCS_EXP   BIT(23)
 
#define SDMMC_CMD_CEATA_RD   BIT(22)
 
#define SDMMC_CMD_UPD_CLK   BIT(21)
 
#define SDMMC_CMD_INIT   BIT(15)
 
#define SDMMC_CMD_STOP   BIT(14)
 
#define SDMMC_CMD_PRV_DAT_WAIT   BIT(13)
 
#define SDMMC_CMD_SEND_STOP   BIT(12)
 
#define SDMMC_CMD_STRM_MODE   BIT(11)
 
#define SDMMC_CMD_DAT_WR   BIT(10)
 
#define SDMMC_CMD_DAT_EXP   BIT(9)
 
#define SDMMC_CMD_RESP_CRC   BIT(8)
 
#define SDMMC_CMD_RESP_LONG   BIT(7)
 
#define SDMMC_CMD_RESP_EXP   BIT(6)
 
#define SDMMC_CMD_INDX(n)   ((n) & 0x1F)
 
#define SDMMC_GET_FCNT(x)   (((x)>>17) & 0x1FFF)
 
#define SDMMC_IDMAC_INT_AI   BIT(9)
 
#define SDMMC_IDMAC_INT_NI   BIT(8)
 
#define SDMMC_IDMAC_INT_CES   BIT(5)
 
#define SDMMC_IDMAC_INT_DU   BIT(4)
 
#define SDMMC_IDMAC_INT_FBE   BIT(2)
 
#define SDMMC_IDMAC_INT_RI   BIT(1)
 
#define SDMMC_IDMAC_INT_TI   BIT(0)
 
#define SDMMC_IDMAC_ENABLE   BIT(7)
 
#define SDMMC_IDMAC_FB   BIT(1)
 
#define SDMMC_IDMAC_SWRESET   BIT(0)
 
#define SDMMC_GET_VERID(x)   ((x) & 0xFFFF)
 
#define mci_readl(dev, reg)   __raw_readl((dev)->regs + SDMMC_##reg)
 
#define mci_writel(dev, reg, value)   __raw_writel((value), (dev)->regs + SDMMC_##reg)
 
#define mci_readw(dev, reg)   __raw_readw((dev)->regs + SDMMC_##reg)
 
#define mci_writew(dev, reg, value)   __raw_writew((value), (dev)->regs + SDMMC_##reg)
 
#define mci_readq(dev, reg)   (*(volatile u64 __force *)((dev)->regs + SDMMC_##reg))
 
#define mci_writeq(dev, reg, value)   (*(volatile u64 __force *)((dev)->regs + SDMMC_##reg) = (value))
 

Functions

int dw_mci_probe (struct dw_mci *host)
 
void dw_mci_remove (struct dw_mci *host)
 

Macro Definition Documentation

#define _SBF (   f,
  v 
)    ((v) << (f))

Definition at line 66 of file dw_mmc.h.

#define DATA_240A_OFFSET   0x200

Definition at line 63 of file dw_mmc.h.

#define DATA_OFFSET   0x100

Definition at line 62 of file dw_mmc.h.

#define DW_MMC_240A   0x240a

Definition at line 17 of file dw_mmc.h.

#define mci_readl (   dev,
  reg 
)    __raw_readl((dev)->regs + SDMMC_##reg)

Definition at line 146 of file dw_mmc.h.

#define mci_readq (   dev,
  reg 
)    (*(volatile u64 __force *)((dev)->regs + SDMMC_##reg))

Definition at line 172 of file dw_mmc.h.

#define mci_readw (   dev,
  reg 
)    __raw_readw((dev)->regs + SDMMC_##reg)

Definition at line 152 of file dw_mmc.h.

#define mci_writel (   dev,
  reg,
  value 
)    __raw_writel((value), (dev)->regs + SDMMC_##reg)

Definition at line 148 of file dw_mmc.h.

#define mci_writeq (   dev,
  reg,
  value 
)    (*(volatile u64 __force *)((dev)->regs + SDMMC_##reg) = (value))

Definition at line 174 of file dw_mmc.h.

#define mci_writew (   dev,
  reg,
  value 
)    __raw_writew((value), (dev)->regs + SDMMC_##reg)

Definition at line 154 of file dw_mmc.h.

#define SDMMC_BLKSIZ   0x01c

Definition at line 26 of file dw_mmc.h.

#define SDMMC_BMOD   0x080

Definition at line 49 of file dw_mmc.h.

#define SDMMC_BUFADDR   0x098

Definition at line 55 of file dw_mmc.h.

#define SDMMC_BYTCNT   0x020

Definition at line 27 of file dw_mmc.h.

#define SDMMC_CDETECT   0x050

Definition at line 39 of file dw_mmc.h.

#define SDMMC_CLKDIV   0x008

Definition at line 21 of file dw_mmc.h.

#define SDMMC_CLKEN_ENABLE   BIT(0)

Definition at line 83 of file dw_mmc.h.

#define SDMMC_CLKEN_LOW_PWR   BIT(16)

Definition at line 82 of file dw_mmc.h.

#define SDMMC_CLKENA   0x010

Definition at line 23 of file dw_mmc.h.

#define SDMMC_CLKSRC   0x00c

Definition at line 22 of file dw_mmc.h.

#define SDMMC_CMD   0x02c

Definition at line 30 of file dw_mmc.h.

#define SDMMC_CMD_CCS_EXP   BIT(23)

Definition at line 114 of file dw_mmc.h.

#define SDMMC_CMD_CEATA_RD   BIT(22)

Definition at line 115 of file dw_mmc.h.

#define SDMMC_CMD_DAT_EXP   BIT(9)

Definition at line 123 of file dw_mmc.h.

#define SDMMC_CMD_DAT_WR   BIT(10)

Definition at line 122 of file dw_mmc.h.

#define SDMMC_CMD_INDX (   n)    ((n) & 0x1F)

Definition at line 127 of file dw_mmc.h.

#define SDMMC_CMD_INIT   BIT(15)

Definition at line 117 of file dw_mmc.h.

#define SDMMC_CMD_PRV_DAT_WAIT   BIT(13)

Definition at line 119 of file dw_mmc.h.

#define SDMMC_CMD_RESP_CRC   BIT(8)

Definition at line 124 of file dw_mmc.h.

#define SDMMC_CMD_RESP_EXP   BIT(6)

Definition at line 126 of file dw_mmc.h.

#define SDMMC_CMD_RESP_LONG   BIT(7)

Definition at line 125 of file dw_mmc.h.

#define SDMMC_CMD_SEND_STOP   BIT(12)

Definition at line 120 of file dw_mmc.h.

#define SDMMC_CMD_START   BIT(31)

Definition at line 113 of file dw_mmc.h.

#define SDMMC_CMD_STOP   BIT(14)

Definition at line 118 of file dw_mmc.h.

#define SDMMC_CMD_STRM_MODE   BIT(11)

Definition at line 121 of file dw_mmc.h.

#define SDMMC_CMD_UPD_CLK   BIT(21)

Definition at line 116 of file dw_mmc.h.

#define SDMMC_CMDARG   0x028

Definition at line 29 of file dw_mmc.h.

#define SDMMC_CTRL   0x000

Definition at line 19 of file dw_mmc.h.

#define SDMMC_CTRL_ABRT_READ_DATA   BIT(8)

Definition at line 73 of file dw_mmc.h.

#define SDMMC_CTRL_CEATA_INT_EN   BIT(11)

Definition at line 70 of file dw_mmc.h.

#define SDMMC_CTRL_DMA_ENABLE   BIT(5)

Definition at line 76 of file dw_mmc.h.

#define SDMMC_CTRL_DMA_RESET   BIT(2)

Definition at line 78 of file dw_mmc.h.

#define SDMMC_CTRL_FIFO_RESET   BIT(1)

Definition at line 79 of file dw_mmc.h.

#define SDMMC_CTRL_INT_ENABLE   BIT(4)

Definition at line 77 of file dw_mmc.h.

#define SDMMC_CTRL_READ_WAIT   BIT(6)

Definition at line 75 of file dw_mmc.h.

#define SDMMC_CTRL_RESET   BIT(0)

Definition at line 80 of file dw_mmc.h.

#define SDMMC_CTRL_SEND_AS_CCSD   BIT(10)

Definition at line 71 of file dw_mmc.h.

#define SDMMC_CTRL_SEND_CCSD   BIT(9)

Definition at line 72 of file dw_mmc.h.

#define SDMMC_CTRL_SEND_IRQ_RESP   BIT(7)

Definition at line 74 of file dw_mmc.h.

#define SDMMC_CTRL_USE_IDMAC   BIT(25)

Definition at line 69 of file dw_mmc.h.

#define SDMMC_CTYPE   0x018

Definition at line 25 of file dw_mmc.h.

#define SDMMC_CTYPE_1BIT   0

Definition at line 92 of file dw_mmc.h.

#define SDMMC_CTYPE_4BIT   BIT(0)

Definition at line 91 of file dw_mmc.h.

#define SDMMC_CTYPE_8BIT   BIT(16)

Definition at line 90 of file dw_mmc.h.

#define SDMMC_DATA (   x)    (x)

Definition at line 56 of file dw_mmc.h.

#define SDMMC_DBADDR   0x088

Definition at line 51 of file dw_mmc.h.

#define SDMMC_DEBNCE   0x064

Definition at line 44 of file dw_mmc.h.

#define SDMMC_DSCADDR   0x094

Definition at line 54 of file dw_mmc.h.

#define SDMMC_FIFOTH   0x04c

Definition at line 38 of file dw_mmc.h.

#define SDMMC_GET_FCNT (   x)    (((x)>>17) & 0x1FFF)

Definition at line 129 of file dw_mmc.h.

#define SDMMC_GET_VERID (   x)    ((x) & 0xFFFF)

Definition at line 143 of file dw_mmc.h.

#define SDMMC_GPIO   0x058

Definition at line 41 of file dw_mmc.h.

#define SDMMC_HCON   0x070

Definition at line 47 of file dw_mmc.h.

#define SDMMC_IDINTEN   0x090

Definition at line 53 of file dw_mmc.h.

#define SDMMC_IDMAC_ENABLE   BIT(7)

Definition at line 139 of file dw_mmc.h.

#define SDMMC_IDMAC_FB   BIT(1)

Definition at line 140 of file dw_mmc.h.

#define SDMMC_IDMAC_INT_AI   BIT(9)

Definition at line 131 of file dw_mmc.h.

#define SDMMC_IDMAC_INT_CES   BIT(5)

Definition at line 133 of file dw_mmc.h.

#define SDMMC_IDMAC_INT_DU   BIT(4)

Definition at line 134 of file dw_mmc.h.

#define SDMMC_IDMAC_INT_FBE   BIT(2)

Definition at line 135 of file dw_mmc.h.

#define SDMMC_IDMAC_INT_NI   BIT(8)

Definition at line 132 of file dw_mmc.h.

#define SDMMC_IDMAC_INT_RI   BIT(1)

Definition at line 136 of file dw_mmc.h.

#define SDMMC_IDMAC_INT_TI   BIT(0)

Definition at line 137 of file dw_mmc.h.

#define SDMMC_IDMAC_SWRESET   BIT(0)

Definition at line 141 of file dw_mmc.h.

#define SDMMC_IDSTS   0x08c

Definition at line 52 of file dw_mmc.h.

#define SDMMC_INT_ACD   BIT(14)

Definition at line 96 of file dw_mmc.h.

#define SDMMC_INT_CD   BIT(0)

Definition at line 110 of file dw_mmc.h.

#define SDMMC_INT_CMD_DONE   BIT(2)

Definition at line 108 of file dw_mmc.h.

#define SDMMC_INT_DATA_OVER   BIT(3)

Definition at line 107 of file dw_mmc.h.

#define SDMMC_INT_DCRC   BIT(7)

Definition at line 103 of file dw_mmc.h.

#define SDMMC_INT_DTO   BIT(9)

Definition at line 101 of file dw_mmc.h.

#define SDMMC_INT_EBE   BIT(15)

Definition at line 95 of file dw_mmc.h.

#define SDMMC_INT_ERROR   0xbfc2

Definition at line 111 of file dw_mmc.h.

#define SDMMC_INT_FRUN   BIT(11)

Definition at line 99 of file dw_mmc.h.

#define SDMMC_INT_HLE   BIT(12)

Definition at line 98 of file dw_mmc.h.

#define SDMMC_INT_HTO   BIT(10)

Definition at line 100 of file dw_mmc.h.

#define SDMMC_INT_RCRC   BIT(6)

Definition at line 104 of file dw_mmc.h.

#define SDMMC_INT_RESP_ERR   BIT(1)

Definition at line 109 of file dw_mmc.h.

#define SDMMC_INT_RTO   BIT(8)

Definition at line 102 of file dw_mmc.h.

#define SDMMC_INT_RXDR   BIT(5)

Definition at line 105 of file dw_mmc.h.

#define SDMMC_INT_SBE   BIT(13)

Definition at line 97 of file dw_mmc.h.

#define SDMMC_INT_SDIO (   n)    BIT(16 + (n))

Definition at line 94 of file dw_mmc.h.

#define SDMMC_INT_TXDR   BIT(4)

Definition at line 106 of file dw_mmc.h.

#define SDMMC_INTMASK   0x024

Definition at line 28 of file dw_mmc.h.

#define SDMMC_MINTSTS   0x040

Definition at line 35 of file dw_mmc.h.

#define SDMMC_PLDMND   0x084

Definition at line 50 of file dw_mmc.h.

#define SDMMC_PWREN   0x004

Definition at line 20 of file dw_mmc.h.

#define SDMMC_RESP0   0x030

Definition at line 31 of file dw_mmc.h.

#define SDMMC_RESP1   0x034

Definition at line 32 of file dw_mmc.h.

#define SDMMC_RESP2   0x038

Definition at line 33 of file dw_mmc.h.

#define SDMMC_RESP3   0x03c

Definition at line 34 of file dw_mmc.h.

#define SDMMC_RINTSTS   0x044

Definition at line 36 of file dw_mmc.h.

#define SDMMC_STATUS   0x048

Definition at line 37 of file dw_mmc.h.

#define SDMMC_TBBCNT   0x060

Definition at line 43 of file dw_mmc.h.

#define SDMMC_TCBCNT   0x05c

Definition at line 42 of file dw_mmc.h.

#define SDMMC_TMOUT   0x014

Definition at line 24 of file dw_mmc.h.

#define SDMMC_TMOUT_DATA (   n)    _SBF(8, (n))

Definition at line 85 of file dw_mmc.h.

#define SDMMC_TMOUT_DATA_MSK   0xFFFFFF00

Definition at line 86 of file dw_mmc.h.

#define SDMMC_TMOUT_RESP (   n)    ((n) & 0xFF)

Definition at line 87 of file dw_mmc.h.

#define SDMMC_TMOUT_RESP_MSK   0xFF

Definition at line 88 of file dw_mmc.h.

#define SDMMC_UHS_REG   0x074

Definition at line 48 of file dw_mmc.h.

#define SDMMC_USRID   0x068

Definition at line 45 of file dw_mmc.h.

#define SDMMC_VERID   0x06c

Definition at line 46 of file dw_mmc.h.

#define SDMMC_WRTPRT   0x054

Definition at line 40 of file dw_mmc.h.

Function Documentation

int dw_mci_probe ( struct dw_mci host)

Definition at line 2085 of file dw_mmc.c.

void dw_mci_remove ( struct dw_mci host)

Definition at line 2316 of file dw_mmc.c.