- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

# drivers/sdmmc/mci_regs.h

Go to the documentation of this file.

    00001
    00041 #ifndef SDMMC_MCI_REGS_H_INCLUDED
    00042 #define SDMMC_MCI_REGS_H_INCLUDED
    00043
    00044 /*
    00045  * MCI Register Definitions. Registers and bitfields marked with [2]
    00046  * are only available in MCI2.
    00047  */
    00048 #define MCI_CR                  0x0000  /* Control */
    00049 # define MCI_CR_MCIEN           (  1 <<  0)     /* MCI Enable */
    00050 # define MCI_CR_MCIDIS          (  1 <<  1)     /* MCI Disable */
    00051 # define MCI_CR_PWSEN           (  1 <<  2)     /* Powersave Enable[2] */
    00052 # define MCI_CR_PWSDIS          (  1 <<  3)     /* Powersave Disable[2] */
    00053 # define MCI_CR_IOWAITEN        (  1 <<  4)     /* SDIO Read Wait Enable[2] */
    00054 # define MCI_CR_IOWAITDIS       (  1 <<  5)     /* SDIO Read Wait Disable[2] */
    00055 # define MCI_CR_SWRST           (  1 <<  7)     /* Software Reset */
    00056 #define MCI_MR                  0x0004  /* Mode */
    00057 # define MCI_MR_CLKDIV(x)       ((x) <<  0)     /* Clock Divider */
    00058 # define MCI_MR_PWSDIV(x)       ((x) <<  8)     /* Powersave Divider[2] */
    00059 # define MCI_MR_RDPROOF         (  1 << 11)     /* Read Proof */
    00060 # define MCI_MR_WRPROOF         (  1 << 12)     /* Write Proof */
    00061 #define MCI_DTOR                0x0008  /* Data Timeout */
    00062 # define MCI_DTOCYC(x)          ((x) <<  0)     /* Data Timeout Cycles */
    00063 # define MCI_DTOMUL(x)          ((x) <<  4)     /* Data Timeout Multiplier */
    00064 #define MCI_SDCR                0x000c  /* SD Card / SDIO */
    00065 # define MCI_SDCSEL_SLOT_A      (  0 <<  0)     /* Select SD slot A */
    00066 # define MCI_SDCSEL_SLOT_B      (  1 <<  0)     /* Select SD slot A */
    00067 # define MCI_SDCSEL_MASK        (  3 <<  0)
    00068 # define MCI_SDCBUS_1BIT        (  0 <<  6)     /* 1-bit data bus */
    00069 # define MCI_SDCBUS_4BIT        (  2 <<  6)     /* 4-bit data bus */
    00070 # define MCI_SDCBUS_8BIT        (  3 <<  6)     /* 8-bit data bus[2] */
    00071 # define MCI_SDCBUS_MASK        (  3 <<  6)
    00072 #define MCI_ARGR                0x0010  /* Command Argument */
    00073 #define MCI_CMDR                0x0014  /* Command */
    00074 # define MCI_CMDR_CMDNB(x)      ((x) <<  0)     /* Command Opcode */
    00075 # define MCI_CMDR_RSPTYP_NONE   (  0 <<  6)     /* No response */
    00076 # define MCI_CMDR_RSPTYP_48BIT  (  1 <<  6)     /* 48-bit response */
    00077 # define MCI_CMDR_RSPTYP_136BIT (  2 <<  6)     /* 136-bit response */
    00078 # define MCI_CMDR_RSPTYP_R1B    (  3 <<  6)     /* 48-bit response w/busy[2] */
    00079 # define MCI_CMDR_SPCMD_INIT    (  1 <<  8)     /* Initialization command */
    00080 # define MCI_CMDR_SPCMD_SYNC    (  2 <<  8)     /* Synchronized command */
    00081 # define MCI_CMDR_SPCMD_INT     (  4 <<  8)     /* Interrupt command */
    00082 # define MCI_CMDR_SPCMD_INTRESP (  5 <<  8)     /* Interrupt response */
    00083 # define MCI_CMDR_OPDCMD        (  1 << 11)     /* Open Drain */
    00084 # define MCI_CMDR_MAXLAT_5CYC   (  0 << 12)     /* Max latency 5 cycles */
    00085 # define MCI_CMDR_MAXLAT_64CYC  (  1 << 12)     /* Max latency 64 cycles */
    00086 # define MCI_CMDR_START_XFER    (  1 << 16)     /* Start data transfer */
    00087 # define MCI_CMDR_STOP_XFER     (  2 << 16)     /* Stop data transfer */
    00088 # define MCI_CMDR_TRDIR_WRITE   (  0 << 18)     /* Write data */
    00089 # define MCI_CMDR_TRDIR_READ    (  1 << 18)     /* Read data */
    00090 # define MCI_CMDR_BLOCK         (  0 << 19)     /* Single-block transfer */
    00091 # define MCI_CMDR_MULTI_BLOCK   (  1 << 19)     /* Multi-block transfer */
    00092 # define MCI_CMDR_STREAM        (  2 << 19)     /* MMC Stream transfer */
    00093 # define MCI_CMDR_SDIO_BYTE     (  4 << 19)     /* SDIO Byte transfer */
    00094 # define MCI_CMDR_SDIO_BLOCK    (  5 << 19)     /* SDIO Block transfer */
    00095 # define MCI_CMDR_SDIO_SUSPEND  (  1 << 24)     /* SDIO Suspend Command */
    00096 # define MCI_CMDR_SDIO_RESUME   (  2 << 24)     /* SDIO Resume Command */
    00097 #define MCI_BLKR                0x0018  /* Block */
    00098 # define MCI_BCNT(x)            ((x) <<  0)     /* Data Block Count */
    00099 # define MCI_BLKLEN(x)          ((x) << 16)     /* Data Block Length */
    00100 #define MCI_CSTOR               0x001c  /* Completion Signal Timeout[2] */
    00101 # define MCI_CSTOCYC(x)         ((x) <<  0)     /* CST cycles */
    00102 # define MCI_CSTOMUL(x)         ((x) <<  4)     /* CST multiplier */
    00103 #define MCI_RSPR                0x0020  /* Response 0 */
    00104 #define MCI_RSPR1               0x0024  /* Response 1 */
    00105 #define MCI_RSPR2               0x0028  /* Response 2 */
    00106 #define MCI_RSPR3               0x002c  /* Response 3 */
    00107 #define MCI_RDR                 0x0030  /* Receive Data */
    00108 #define MCI_TDR                 0x0034  /* Transmit Data */
    00109 #define MCI_SR                  0x0040  /* Status */
    00110 #define MCI_IER                 0x0044  /* Interrupt Enable */
    00111 #define MCI_IDR                 0x0048  /* Interrupt Disable */
    00112 #define MCI_IMR                 0x004c  /* Interrupt Mask */
    00113 # define MCI_CMDRDY             (  1 <<  0)     /* Command Ready */
    00114 # define MCI_RXRDY              (  1 <<  1)     /* Receiver Ready */
    00115 # define MCI_TXRDY              (  1 <<  2)     /* Transmitter Ready */
    00116 # define MCI_BLKE               (  1 <<  3)     /* Data Block Ended */
    00117 # define MCI_DTIP               (  1 <<  4)     /* Data Transfer In Progress */
    00118 # define MCI_NOTBUSY            (  1 <<  5)     /* Data Not Busy */
    00119 # define MCI_SDIOIRQA           (  1 <<  8)     /* SDIO IRQ in slot A */
    00120 # define MCI_SDIOIRQB           (  1 <<  9)     /* SDIO IRQ in slot B */
    00121 # define MCI_RINDE              (  1 << 16)     /* Response Index Error */
    00122 # define MCI_RDIRE              (  1 << 17)     /* Response Direction Error */
    00123 # define MCI_RCRCE              (  1 << 18)     /* Response CRC Error */
    00124 # define MCI_RENDE              (  1 << 19)     /* Response End Bit Error */
    00125 # define MCI_RTOE               (  1 << 20)     /* Response Time-Out Error */
    00126 # define MCI_DCRCE              (  1 << 21)     /* Data CRC Error */
    00127 # define MCI_DTOE               (  1 << 22)     /* Data Time-Out Error */
    00128 # define MCI_CSTOE              (  1 << 23)     /* Completion Signal Time-Out */
    00129 # define MCI_BLKOVRE            (  1 << 24)     /* DMA Block Overrun */
    00130 # define MCI_DMADONE            (  1 << 25)     /* DMA Transfer Done */
    00131 # define MCI_FIFOEMPTY          (  1 << 26)     /* The FIFO is empty */
    00132 # define MCI_XFRDONE            (  1 << 27)     /* Data Transfer Done */
    00133 # define MCI_OVRE               (  1 << 30)     /* RX Overrun Error */
    00134 # define MCI_UNRE               (  1 << 31)     /* TX Underrun Error */
    00135 #define MCI_DMA                 0x0050  /* DMA Configuration[2] */
    00136 # define MCI_DMA_OFFSET(x)      ((x) <<  0)     /* DMA write buffer offset */
    00137 # define MCI_DMA_CHKSIZE_1      (  0 <<  5)     /* DMA chunk size */
    00138 # define MCI_DMA_CHKSIZE_4      (  1 <<  5)     /* DMA chunk size */
    00139 # define MCI_DMA_CHKSIZE_8      (  2 <<  5)     /* DMA chunk size */
    00140 # define MCI_DMA_CHKSIZE_16     (  3 <<  5)     /* DMA chunk size */
    00141 # define MCI_DMAEN              (  1 <<  8)     /* DMA HW handshake enable */
    00142 #define MCI_CFG                 0x0054  /* Configuration[2] */
    00143 # define MCI_CFG_FIFOMODE       (  1 <<  0)     /* Start transfer ASAP */
    00144 # define MCI_CFG_FERRCTRL       (  1 <<  4)     /* xrun flags clear-on-read */
    00145 # define MCI_CFG_HSMODE         (  1 <<  8)     /* Use high-speed signaling */
    00146 # define MCI_CFG_LSYNC          (  1 << 12)     /* Synchronize on last block */
    00147 #define MCI_WPMR                0x00e4  /* Write Protect Mode[2] */
    00148 # define MCI_WP_EN              (  1 <<  0)     /* WP Enable */
    00149 # define MCI_WP_KEY             (0x4d4349 << 8) /* WP Key */
    00150 #define MCI_WPSR                0x00e8  /* Write Protect Status[2] */
    00151 # define MCI_GET_WP_VS(x)       ((x) & 0x0f)
    00152 # define MCI_GET_WP_VSRC(x)     (((x) >> 8) & 0xffff)
    00153 #define MCI_VERSION             0x00fc  /* MCI Core Version[2] */
    00154 #define MCI_FIFO_APERTURE       0x0200  /* FIFO Aperture[2] */
    00155
    00156 /* This is not including the FIFO Aperture on MCI2 */
    00157 #define MCI_REGS_SIZE           0x100
    00158
    00159 /* Register access macros */
    00160 #define mci_readl(reg)                          \
    00161         mmio_read32((void *)MCI_BASE + MCI_##reg)
    00162 #define mci_writel(reg,value)                   \
    00163         mmio_write32((void *)MCI_BASE + MCI_##reg, value)
    00164
    00165 #endif /* SDMMC_MCI_REGS_H_INCLUDED */