mmc: pxamci: set proper buswidth capabilities according to PXA flavor
[cascardo/linux.git] / drivers / mmc / host / pxamci.h
1 #define MMC_STRPCL      0x0000
2 #define STOP_CLOCK              (1 << 0)
3 #define START_CLOCK             (2 << 0)
4
5 #define MMC_STAT        0x0004
6 #define STAT_END_CMD_RES                (1 << 13)
7 #define STAT_PRG_DONE                   (1 << 12)
8 #define STAT_DATA_TRAN_DONE             (1 << 11)
9 #define STAT_CLK_EN                     (1 << 8)
10 #define STAT_RECV_FIFO_FULL             (1 << 7)
11 #define STAT_XMIT_FIFO_EMPTY            (1 << 6)
12 #define STAT_RES_CRC_ERR                (1 << 5)
13 #define STAT_SPI_READ_ERROR_TOKEN       (1 << 4)
14 #define STAT_CRC_READ_ERROR             (1 << 3)
15 #define STAT_CRC_WRITE_ERROR            (1 << 2)
16 #define STAT_TIME_OUT_RESPONSE          (1 << 1)
17 #define STAT_READ_TIME_OUT              (1 << 0)
18
19 #define MMC_CLKRT       0x0008          /* 3 bit */
20
21 #define MMC_SPI         0x000c
22 #define SPI_CS_ADDRESS          (1 << 3)
23 #define SPI_CS_EN               (1 << 2)
24 #define CRC_ON                  (1 << 1)
25 #define SPI_EN                  (1 << 0)
26
27 #define MMC_CMDAT       0x0010
28 #define CMDAT_SD_4DAT           (1 << 8)
29 #define CMDAT_DMAEN             (1 << 7)
30 #define CMDAT_INIT              (1 << 6)
31 #define CMDAT_BUSY              (1 << 5)
32 #define CMDAT_STREAM            (1 << 4)        /* 1 = stream */
33 #define CMDAT_WRITE             (1 << 3)        /* 1 = write */
34 #define CMDAT_DATAEN            (1 << 2)
35 #define CMDAT_RESP_NONE         (0 << 0)
36 #define CMDAT_RESP_SHORT        (1 << 0)
37 #define CMDAT_RESP_R2           (2 << 0)
38 #define CMDAT_RESP_R3           (3 << 0)
39
40 #define MMC_RESTO       0x0014  /* 7 bit */
41
42 #define MMC_RDTO        0x0018  /* 16 bit */
43
44 #define MMC_BLKLEN      0x001c  /* 10 bit */
45
46 #define MMC_NOB         0x0020  /* 16 bit */
47
48 #define MMC_PRTBUF      0x0024
49 #define BUF_PART_FULL           (1 << 0)
50
51 #define MMC_I_MASK      0x0028
52
53 /*PXA27x MMC interrupts*/
54 #define SDIO_SUSPEND_ACK        (1 << 12)
55 #define SDIO_INT                (1 << 11)
56 #define RD_STALLED              (1 << 10)
57 #define RES_ERR                 (1 << 9)
58 #define DAT_ERR                 (1 << 8)
59 #define TINT                    (1 << 7)
60
61 /*PXA2xx MMC interrupts*/
62 #define TXFIFO_WR_REQ           (1 << 6)
63 #define RXFIFO_RD_REQ           (1 << 5)
64 #define CLK_IS_OFF              (1 << 4)
65 #define STOP_CMD                (1 << 3)
66 #define END_CMD_RES             (1 << 2)
67 #define PRG_DONE                (1 << 1)
68 #define DATA_TRAN_DONE          (1 << 0)
69
70 #ifdef CONFIG_PXA27x
71 #define MMC_I_MASK_ALL          0x00001fff
72 #else
73 #define MMC_I_MASK_ALL          0x0000007f
74 #endif
75
76 #define MMC_I_REG       0x002c
77 /* same as MMC_I_MASK */
78
79 #define MMC_CMD         0x0030
80
81 #define MMC_ARGH        0x0034  /* 16 bit */
82
83 #define MMC_ARGL        0x0038  /* 16 bit */
84
85 #define MMC_RES         0x003c  /* 16 bit */
86
87 #define MMC_RXFIFO      0x0040  /* 8 bit */
88
89 #define MMC_TXFIFO      0x0044  /* 8 bit */
90
91 /*
92  * The base MMC clock rate
93  */
94 #ifdef CONFIG_PXA27x
95 #define CLOCKRATE_MIN   304688
96 #define CLOCKRATE_MAX   19500000
97 #else
98 #define CLOCKRATE_MIN   312500
99 #define CLOCKRATE_MAX   20000000
100 #endif
101
102 #define CLOCKRATE       CLOCKRATE_MAX
103