diff options
author | Simon Horman <horms@verge.net.au> | 2011-03-24 04:48:36 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-03-26 15:58:50 -0400 |
commit | cba179aec779b364a683906b99e23014c7652e8e (patch) | |
tree | f88c1be6d919591ab6ee41c736248437887a8963 | |
parent | 5fd0157901d5a8f497f3d3b95cb4beebf1641d1b (diff) |
mmc: tmio_mmc: Move some defines into a shared header
Also add TMIO_BBS.
This allows these defines to also be used by zboot.
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r-- | drivers/mmc/host/tmio_mmc.h | 30 | ||||
-rw-r--r-- | drivers/mmc/host/tmio_mmc_dma.c | 1 | ||||
-rw-r--r-- | drivers/mmc/host/tmio_mmc_pio.c | 21 | ||||
-rw-r--r-- | include/linux/mmc/tmio.h | 63 |
4 files changed, 69 insertions, 46 deletions
diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h index 7d79b14d56aa..099ed49a259b 100644 --- a/drivers/mmc/host/tmio_mmc.h +++ b/drivers/mmc/host/tmio_mmc.h | |||
@@ -17,36 +17,14 @@ | |||
17 | #define TMIO_MMC_H | 17 | #define TMIO_MMC_H |
18 | 18 | ||
19 | #include <linux/highmem.h> | 19 | #include <linux/highmem.h> |
20 | #include <linux/mmc/tmio.h> | ||
20 | #include <linux/pagemap.h> | 21 | #include <linux/pagemap.h> |
21 | 22 | ||
22 | /* Definitions for values the CTRL_STATUS register can take. */ | ||
23 | #define TMIO_STAT_CMDRESPEND 0x00000001 | ||
24 | #define TMIO_STAT_DATAEND 0x00000004 | ||
25 | #define TMIO_STAT_CARD_REMOVE 0x00000008 | ||
26 | #define TMIO_STAT_CARD_INSERT 0x00000010 | ||
27 | #define TMIO_STAT_SIGSTATE 0x00000020 | ||
28 | #define TMIO_STAT_WRPROTECT 0x00000080 | ||
29 | #define TMIO_STAT_CARD_REMOVE_A 0x00000100 | ||
30 | #define TMIO_STAT_CARD_INSERT_A 0x00000200 | ||
31 | #define TMIO_STAT_SIGSTATE_A 0x00000400 | ||
32 | #define TMIO_STAT_CMD_IDX_ERR 0x00010000 | ||
33 | #define TMIO_STAT_CRCFAIL 0x00020000 | ||
34 | #define TMIO_STAT_STOPBIT_ERR 0x00040000 | ||
35 | #define TMIO_STAT_DATATIMEOUT 0x00080000 | ||
36 | #define TMIO_STAT_RXOVERFLOW 0x00100000 | ||
37 | #define TMIO_STAT_TXUNDERRUN 0x00200000 | ||
38 | #define TMIO_STAT_CMDTIMEOUT 0x00400000 | ||
39 | #define TMIO_STAT_RXRDY 0x01000000 | ||
40 | #define TMIO_STAT_TXRQ 0x02000000 | ||
41 | #define TMIO_STAT_ILL_FUNC 0x20000000 | ||
42 | #define TMIO_STAT_CMD_BUSY 0x40000000 | ||
43 | #define TMIO_STAT_ILL_ACCESS 0x80000000 | ||
44 | |||
45 | /* Definitions for values the CTRL_SDIO_STATUS register can take. */ | 23 | /* Definitions for values the CTRL_SDIO_STATUS register can take. */ |
46 | #define TMIO_SDIO_STAT_IOIRQ 0x0001 | 24 | #define TMIO_SDIO_STAT_IOIRQ 0x0001 |
47 | #define TMIO_SDIO_STAT_EXPUB52 0x4000 | 25 | #define TMIO_SDIO_STAT_EXPUB52 0x4000 |
48 | #define TMIO_SDIO_STAT_EXWT 0x8000 | 26 | #define TMIO_SDIO_STAT_EXWT 0x8000 |
49 | #define TMIO_SDIO_MASK_ALL 0xc007 | 27 | #define TMIO_SDIO_MASK_ALL 0xc007 |
50 | 28 | ||
51 | /* Define some IRQ masks */ | 29 | /* Define some IRQ masks */ |
52 | /* This is the mask used at reset by the chip */ | 30 | /* This is the mask used at reset by the chip */ |
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c index c505278be43f..d3de74ab633e 100644 --- a/drivers/mmc/host/tmio_mmc_dma.c +++ b/drivers/mmc/host/tmio_mmc_dma.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/dmaengine.h> | 14 | #include <linux/dmaengine.h> |
15 | #include <linux/mfd/tmio.h> | 15 | #include <linux/mfd/tmio.h> |
16 | #include <linux/mmc/host.h> | 16 | #include <linux/mmc/host.h> |
17 | #include <linux/mmc/tmio.h> | ||
17 | #include <linux/pagemap.h> | 18 | #include <linux/pagemap.h> |
18 | #include <linux/scatterlist.h> | 19 | #include <linux/scatterlist.h> |
19 | 20 | ||
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index e35e17992e38..6ae8d2f00ec7 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/irq.h> | 35 | #include <linux/irq.h> |
36 | #include <linux/mfd/tmio.h> | 36 | #include <linux/mfd/tmio.h> |
37 | #include <linux/mmc/host.h> | 37 | #include <linux/mmc/host.h> |
38 | #include <linux/mmc/tmio.h> | ||
38 | #include <linux/module.h> | 39 | #include <linux/module.h> |
39 | #include <linux/pagemap.h> | 40 | #include <linux/pagemap.h> |
40 | #include <linux/platform_device.h> | 41 | #include <linux/platform_device.h> |
@@ -44,26 +45,6 @@ | |||
44 | 45 | ||
45 | #include "tmio_mmc.h" | 46 | #include "tmio_mmc.h" |
46 | 47 | ||
47 | #define CTL_SD_CMD 0x00 | ||
48 | #define CTL_ARG_REG 0x04 | ||
49 | #define CTL_STOP_INTERNAL_ACTION 0x08 | ||
50 | #define CTL_XFER_BLK_COUNT 0xa | ||
51 | #define CTL_RESPONSE 0x0c | ||
52 | #define CTL_STATUS 0x1c | ||
53 | #define CTL_IRQ_MASK 0x20 | ||
54 | #define CTL_SD_CARD_CLK_CTL 0x24 | ||
55 | #define CTL_SD_XFER_LEN 0x26 | ||
56 | #define CTL_SD_MEM_CARD_OPT 0x28 | ||
57 | #define CTL_SD_ERROR_DETAIL_STATUS 0x2c | ||
58 | #define CTL_SD_DATA_PORT 0x30 | ||
59 | #define CTL_TRANSACTION_CTL 0x34 | ||
60 | #define CTL_SDIO_STATUS 0x36 | ||
61 | #define CTL_SDIO_IRQ_MASK 0x38 | ||
62 | #define CTL_RESET_SD 0xe0 | ||
63 | #define CTL_SDIO_REGS 0x100 | ||
64 | #define CTL_CLK_AND_WAIT_CTL 0x138 | ||
65 | #define CTL_RESET_SDIO 0x1e0 | ||
66 | |||
67 | static u16 sd_ctrl_read16(struct tmio_mmc_host *host, int addr) | 48 | static u16 sd_ctrl_read16(struct tmio_mmc_host *host, int addr) |
68 | { | 49 | { |
69 | return readw(host->ctl + (addr << host->bus_shift)); | 50 | return readw(host->ctl + (addr << host->bus_shift)); |
diff --git a/include/linux/mmc/tmio.h b/include/linux/mmc/tmio.h new file mode 100644 index 000000000000..19490b942db0 --- /dev/null +++ b/include/linux/mmc/tmio.h | |||
@@ -0,0 +1,63 @@ | |||
1 | /* | ||
2 | * include/linux/mmc/tmio.h | ||
3 | * | ||
4 | * Copyright (C) 2007 Ian Molton | ||
5 | * Copyright (C) 2004 Ian Molton | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * Driver for the MMC / SD / SDIO cell found in: | ||
12 | * | ||
13 | * TC6393XB TC6391XB TC6387XB T7L66XB ASIC3 | ||
14 | */ | ||
15 | #ifndef _LINUX_MMC_TMIO_H_ | ||
16 | #define _LINUX_MMC_TMIO_H_ | ||
17 | |||
18 | #define CTL_SD_CMD 0x00 | ||
19 | #define CTL_ARG_REG 0x04 | ||
20 | #define CTL_STOP_INTERNAL_ACTION 0x08 | ||
21 | #define CTL_XFER_BLK_COUNT 0xa | ||
22 | #define CTL_RESPONSE 0x0c | ||
23 | #define CTL_STATUS 0x1c | ||
24 | #define CTL_IRQ_MASK 0x20 | ||
25 | #define CTL_SD_CARD_CLK_CTL 0x24 | ||
26 | #define CTL_SD_XFER_LEN 0x26 | ||
27 | #define CTL_SD_MEM_CARD_OPT 0x28 | ||
28 | #define CTL_SD_ERROR_DETAIL_STATUS 0x2c | ||
29 | #define CTL_SD_DATA_PORT 0x30 | ||
30 | #define CTL_TRANSACTION_CTL 0x34 | ||
31 | #define CTL_SDIO_STATUS 0x36 | ||
32 | #define CTL_SDIO_IRQ_MASK 0x38 | ||
33 | #define CTL_RESET_SD 0xe0 | ||
34 | #define CTL_SDIO_REGS 0x100 | ||
35 | #define CTL_CLK_AND_WAIT_CTL 0x138 | ||
36 | #define CTL_RESET_SDIO 0x1e0 | ||
37 | |||
38 | /* Definitions for values the CTRL_STATUS register can take. */ | ||
39 | #define TMIO_STAT_CMDRESPEND 0x00000001 | ||
40 | #define TMIO_STAT_DATAEND 0x00000004 | ||
41 | #define TMIO_STAT_CARD_REMOVE 0x00000008 | ||
42 | #define TMIO_STAT_CARD_INSERT 0x00000010 | ||
43 | #define TMIO_STAT_SIGSTATE 0x00000020 | ||
44 | #define TMIO_STAT_WRPROTECT 0x00000080 | ||
45 | #define TMIO_STAT_CARD_REMOVE_A 0x00000100 | ||
46 | #define TMIO_STAT_CARD_INSERT_A 0x00000200 | ||
47 | #define TMIO_STAT_SIGSTATE_A 0x00000400 | ||
48 | #define TMIO_STAT_CMD_IDX_ERR 0x00010000 | ||
49 | #define TMIO_STAT_CRCFAIL 0x00020000 | ||
50 | #define TMIO_STAT_STOPBIT_ERR 0x00040000 | ||
51 | #define TMIO_STAT_DATATIMEOUT 0x00080000 | ||
52 | #define TMIO_STAT_RXOVERFLOW 0x00100000 | ||
53 | #define TMIO_STAT_TXUNDERRUN 0x00200000 | ||
54 | #define TMIO_STAT_CMDTIMEOUT 0x00400000 | ||
55 | #define TMIO_STAT_RXRDY 0x01000000 | ||
56 | #define TMIO_STAT_TXRQ 0x02000000 | ||
57 | #define TMIO_STAT_ILL_FUNC 0x20000000 | ||
58 | #define TMIO_STAT_CMD_BUSY 0x40000000 | ||
59 | #define TMIO_STAT_ILL_ACCESS 0x80000000 | ||
60 | |||
61 | #define TMIO_BBS 512 /* Boot block size */ | ||
62 | |||
63 | #endif /* _LINUX_MMC_TMIO_H_ */ | ||