au1xmmc: remove db1200 board code, rewrite probe.
[linux-2.6/linux-loongson.git] / drivers / mmc / host / au1xmmc.h
blob3b400654e59c3f80975b6f203afc0cd5ad8d96ab
1 #ifndef _AU1XMMC_H_
2 #define _AU1XMMC_H_
4 /* Hardware definitions */
6 #define AU1XMMC_DESCRIPTOR_COUNT 1
7 #define AU1XMMC_DESCRIPTOR_SIZE 2048
9 #define AU1XMMC_OCR ( MMC_VDD_27_28 | MMC_VDD_28_29 | MMC_VDD_29_30 | \
10 MMC_VDD_30_31 | MMC_VDD_31_32 | MMC_VDD_32_33 | \
11 MMC_VDD_33_34 | MMC_VDD_34_35 | MMC_VDD_35_36)
13 /* Easy access macros */
15 #define HOST_STATUS(h) ((h)->iobase + SD_STATUS)
16 #define HOST_CONFIG(h) ((h)->iobase + SD_CONFIG)
17 #define HOST_ENABLE(h) ((h)->iobase + SD_ENABLE)
18 #define HOST_TXPORT(h) ((h)->iobase + SD_TXPORT)
19 #define HOST_RXPORT(h) ((h)->iobase + SD_RXPORT)
20 #define HOST_CMDARG(h) ((h)->iobase + SD_CMDARG)
21 #define HOST_BLKSIZE(h) ((h)->iobase + SD_BLKSIZE)
22 #define HOST_CMD(h) ((h)->iobase + SD_CMD)
23 #define HOST_CONFIG2(h) ((h)->iobase + SD_CONFIG2)
24 #define HOST_TIMEOUT(h) ((h)->iobase + SD_TIMEOUT)
25 #define HOST_DEBUG(h) ((h)->iobase + SD_DEBUG)
27 #define DMA_CHANNEL(h) \
28 ( ((h)->flags & HOST_F_XMIT) ? (h)->tx_chan : (h)->rx_chan)
30 /* This gives us a hard value for the stop command that we can write directly
31 * to the command register
34 #define STOP_CMD (SD_CMD_RT_1B|SD_CMD_CT_7|(0xC << SD_CMD_CI_SHIFT)|SD_CMD_GO)
36 /* This is the set of interrupts that we configure by default */
38 #if 0
39 #define AU1XMMC_INTERRUPTS (SD_CONFIG_SC | SD_CONFIG_DT | SD_CONFIG_DD | \
40 SD_CONFIG_RAT | SD_CONFIG_CR | SD_CONFIG_I)
41 #endif
43 #define AU1XMMC_INTERRUPTS (SD_CONFIG_SC | SD_CONFIG_DT | \
44 SD_CONFIG_RAT | SD_CONFIG_CR | SD_CONFIG_I)
45 /* The poll event (looking for insert/remove events runs twice a second */
46 #define AU1XMMC_DETECT_TIMEOUT (HZ/2)
48 struct au1xmmc_host {
49 struct mmc_host *mmc;
50 struct mmc_request *mrq;
52 u32 flags;
53 u32 iobase;
54 u32 clock;
55 u32 bus_width;
56 u32 power_mode;
58 int status;
60 struct {
61 int len;
62 int dir;
63 } dma;
65 struct {
66 int index;
67 int offset;
68 int len;
69 } pio;
71 u32 tx_chan;
72 u32 rx_chan;
74 int irq;
76 struct timer_list timer;
77 struct tasklet_struct finish_task;
78 struct tasklet_struct data_task;
79 struct au1xmmc_platform_data *platdata;
80 struct platform_device *pdev;
81 struct resource *ioarea;
84 /* Status flags used by the host structure */
86 #define HOST_F_XMIT 0x0001
87 #define HOST_F_RECV 0x0002
88 #define HOST_F_DMA 0x0010
89 #define HOST_F_ACTIVE 0x0100
90 #define HOST_F_STOP 0x1000
92 #define HOST_S_IDLE 0x0001
93 #define HOST_S_CMD 0x0002
94 #define HOST_S_DATA 0x0003
95 #define HOST_S_STOP 0x0004
97 #endif