diff options
Diffstat (limited to 'include/linux/mmc')
-rw-r--r-- | include/linux/mmc/boot.h | 7 | ||||
-rw-r--r-- | include/linux/mmc/card.h | 6 | ||||
-rw-r--r-- | include/linux/mmc/core.h | 1 | ||||
-rw-r--r-- | include/linux/mmc/dw_mmc.h | 19 | ||||
-rw-r--r-- | include/linux/mmc/host.h | 1 | ||||
-rw-r--r-- | include/linux/mmc/mmc.h | 3 | ||||
-rw-r--r-- | include/linux/mmc/sh_mmcif.h | 3 | ||||
-rw-r--r-- | include/linux/mmc/sh_mobile_sdhi.h | 16 | ||||
-rw-r--r-- | include/linux/mmc/tmio.h | 63 |
9 files changed, 108 insertions, 11 deletions
diff --git a/include/linux/mmc/boot.h b/include/linux/mmc/boot.h new file mode 100644 index 000000000000..39d787c229cb --- /dev/null +++ b/include/linux/mmc/boot.h | |||
@@ -0,0 +1,7 @@ | |||
1 | #ifndef MMC_BOOT_H | ||
2 | #define MMC_BOOT_H | ||
3 | |||
4 | enum { MMC_PROGRESS_ENTER, MMC_PROGRESS_INIT, | ||
5 | MMC_PROGRESS_LOAD, MMC_PROGRESS_DONE }; | ||
6 | |||
7 | #endif | ||
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 8ce082781ccb..adb4888248be 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -54,6 +54,9 @@ struct mmc_ext_csd { | |||
54 | unsigned int sec_trim_mult; /* Secure trim multiplier */ | 54 | unsigned int sec_trim_mult; /* Secure trim multiplier */ |
55 | unsigned int sec_erase_mult; /* Secure erase multiplier */ | 55 | unsigned int sec_erase_mult; /* Secure erase multiplier */ |
56 | unsigned int trim_timeout; /* In milliseconds */ | 56 | unsigned int trim_timeout; /* In milliseconds */ |
57 | bool enhanced_area_en; /* enable bit */ | ||
58 | unsigned long long enhanced_area_offset; /* Units: Byte */ | ||
59 | unsigned int enhanced_area_size; /* Units: KB */ | ||
57 | }; | 60 | }; |
58 | 61 | ||
59 | struct sd_scr { | 62 | struct sd_scr { |
@@ -121,6 +124,7 @@ struct mmc_card { | |||
121 | /* for byte mode */ | 124 | /* for byte mode */ |
122 | #define MMC_QUIRK_NONSTD_SDIO (1<<2) /* non-standard SDIO card attached */ | 125 | #define MMC_QUIRK_NONSTD_SDIO (1<<2) /* non-standard SDIO card attached */ |
123 | /* (missing CIA registers) */ | 126 | /* (missing CIA registers) */ |
127 | #define MMC_QUIRK_BROKEN_CLK_GATING (1<<3) /* clock gating the sdio bus will make card fail */ | ||
124 | 128 | ||
125 | unsigned int erase_size; /* erase size in sectors */ | 129 | unsigned int erase_size; /* erase size in sectors */ |
126 | unsigned int erase_shift; /* if erase unit is power 2 */ | 130 | unsigned int erase_shift; /* if erase unit is power 2 */ |
@@ -148,6 +152,8 @@ struct mmc_card { | |||
148 | struct dentry *debugfs_root; | 152 | struct dentry *debugfs_root; |
149 | }; | 153 | }; |
150 | 154 | ||
155 | void mmc_fixup_device(struct mmc_card *dev); | ||
156 | |||
151 | #define mmc_card_mmc(c) ((c)->type == MMC_TYPE_MMC) | 157 | #define mmc_card_mmc(c) ((c)->type == MMC_TYPE_MMC) |
152 | #define mmc_card_sd(c) ((c)->type == MMC_TYPE_SD) | 158 | #define mmc_card_sd(c) ((c)->type == MMC_TYPE_SD) |
153 | #define mmc_card_sdio(c) ((c)->type == MMC_TYPE_SDIO) | 159 | #define mmc_card_sdio(c) ((c)->type == MMC_TYPE_SDIO) |
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 64e013f1cfb8..07f27af4dba5 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
@@ -160,6 +160,7 @@ extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int); | |||
160 | 160 | ||
161 | extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort); | 161 | extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort); |
162 | extern void mmc_release_host(struct mmc_host *host); | 162 | extern void mmc_release_host(struct mmc_host *host); |
163 | extern void mmc_do_release_host(struct mmc_host *host); | ||
163 | extern int mmc_try_claim_host(struct mmc_host *host); | 164 | extern int mmc_try_claim_host(struct mmc_host *host); |
164 | 165 | ||
165 | /** | 166 | /** |
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index 16b0261763ed..bdd7ceeb99e4 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h | |||
@@ -98,7 +98,7 @@ struct mmc_data; | |||
98 | * EVENT_DATA_COMPLETE is set in @pending_events, all data-related | 98 | * EVENT_DATA_COMPLETE is set in @pending_events, all data-related |
99 | * interrupts must be disabled and @data_status updated with a | 99 | * interrupts must be disabled and @data_status updated with a |
100 | * snapshot of SR. Similarly, before EVENT_CMD_COMPLETE is set, the | 100 | * snapshot of SR. Similarly, before EVENT_CMD_COMPLETE is set, the |
101 | * CMDRDY interupt must be disabled and @cmd_status updated with a | 101 | * CMDRDY interrupt must be disabled and @cmd_status updated with a |
102 | * snapshot of SR, and before EVENT_XFER_COMPLETE can be set, the | 102 | * snapshot of SR, and before EVENT_XFER_COMPLETE can be set, the |
103 | * bytes_xfered field of @data must be written. This is ensured by | 103 | * bytes_xfered field of @data must be written. This is ensured by |
104 | * using barriers. | 104 | * using barriers. |
@@ -140,6 +140,7 @@ struct dw_mci { | |||
140 | u32 bus_hz; | 140 | u32 bus_hz; |
141 | u32 current_speed; | 141 | u32 current_speed; |
142 | u32 num_slots; | 142 | u32 num_slots; |
143 | u32 fifoth_val; | ||
143 | struct platform_device *pdev; | 144 | struct platform_device *pdev; |
144 | struct dw_mci_board *pdata; | 145 | struct dw_mci_board *pdata; |
145 | struct dw_mci_slot *slot[MAX_MCI_SLOTS]; | 146 | struct dw_mci_slot *slot[MAX_MCI_SLOTS]; |
@@ -151,6 +152,8 @@ struct dw_mci { | |||
151 | 152 | ||
152 | /* Workaround flags */ | 153 | /* Workaround flags */ |
153 | u32 quirks; | 154 | u32 quirks; |
155 | |||
156 | struct regulator *vmmc; /* Power regulator */ | ||
154 | }; | 157 | }; |
155 | 158 | ||
156 | /* DMA ops for Internal/External DMAC interface */ | 159 | /* DMA ops for Internal/External DMAC interface */ |
@@ -165,14 +168,14 @@ struct dw_mci_dma_ops { | |||
165 | }; | 168 | }; |
166 | 169 | ||
167 | /* IP Quirks/flags. */ | 170 | /* IP Quirks/flags. */ |
168 | /* No special quirks or flags to cater for */ | ||
169 | #define DW_MCI_QUIRK_NONE 0 | ||
170 | /* DTO fix for command transmission with IDMAC configured */ | 171 | /* DTO fix for command transmission with IDMAC configured */ |
171 | #define DW_MCI_QUIRK_IDMAC_DTO 1 | 172 | #define DW_MCI_QUIRK_IDMAC_DTO BIT(0) |
172 | /* delay needed between retries on some 2.11a implementations */ | 173 | /* delay needed between retries on some 2.11a implementations */ |
173 | #define DW_MCI_QUIRK_RETRY_DELAY 2 | 174 | #define DW_MCI_QUIRK_RETRY_DELAY BIT(1) |
174 | /* High Speed Capable - Supports HS cards (upto 50MHz) */ | 175 | /* High Speed Capable - Supports HS cards (up to 50MHz) */ |
175 | #define DW_MCI_QUIRK_HIGHSPEED 4 | 176 | #define DW_MCI_QUIRK_HIGHSPEED BIT(2) |
177 | /* Unreliable card detection */ | ||
178 | #define DW_MCI_QUIRK_BROKEN_CARD_DETECTION BIT(3) | ||
176 | 179 | ||
177 | 180 | ||
178 | struct dma_pdata; | 181 | struct dma_pdata; |
@@ -192,6 +195,8 @@ struct dw_mci_board { | |||
192 | u32 quirks; /* Workaround / Quirk flags */ | 195 | u32 quirks; /* Workaround / Quirk flags */ |
193 | unsigned int bus_hz; /* Bus speed */ | 196 | unsigned int bus_hz; /* Bus speed */ |
194 | 197 | ||
198 | unsigned int caps; /* Capabilities */ | ||
199 | |||
195 | /* delay in mS before detecting cards after interrupt */ | 200 | /* delay in mS before detecting cards after interrupt */ |
196 | u32 detect_delay_ms; | 201 | u32 detect_delay_ms; |
197 | 202 | ||
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index bcb793ec7374..eb792cb6d745 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -183,7 +183,6 @@ struct mmc_host { | |||
183 | struct work_struct clk_gate_work; /* delayed clock gate */ | 183 | struct work_struct clk_gate_work; /* delayed clock gate */ |
184 | unsigned int clk_old; /* old clock value cache */ | 184 | unsigned int clk_old; /* old clock value cache */ |
185 | spinlock_t clk_lock; /* lock for clk fields */ | 185 | spinlock_t clk_lock; /* lock for clk fields */ |
186 | struct mutex clk_gate_mutex; /* mutex for clock gating */ | ||
187 | #endif | 186 | #endif |
188 | 187 | ||
189 | /* host specific block data */ | 188 | /* host specific block data */ |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 612301f85d14..264ba5451e3b 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -253,6 +253,8 @@ struct _mmc_csd { | |||
253 | * EXT_CSD fields | 253 | * EXT_CSD fields |
254 | */ | 254 | */ |
255 | 255 | ||
256 | #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ | ||
257 | #define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ | ||
256 | #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ | 258 | #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ |
257 | #define EXT_CSD_ERASED_MEM_CONT 181 /* RO */ | 259 | #define EXT_CSD_ERASED_MEM_CONT 181 /* RO */ |
258 | #define EXT_CSD_BUS_WIDTH 183 /* R/W */ | 260 | #define EXT_CSD_BUS_WIDTH 183 /* R/W */ |
@@ -262,6 +264,7 @@ struct _mmc_csd { | |||
262 | #define EXT_CSD_CARD_TYPE 196 /* RO */ | 264 | #define EXT_CSD_CARD_TYPE 196 /* RO */ |
263 | #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ | 265 | #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ |
264 | #define EXT_CSD_S_A_TIMEOUT 217 /* RO */ | 266 | #define EXT_CSD_S_A_TIMEOUT 217 /* RO */ |
267 | #define EXT_CSD_HC_WP_GRP_SIZE 221 /* RO */ | ||
265 | #define EXT_CSD_ERASE_TIMEOUT_MULT 223 /* RO */ | 268 | #define EXT_CSD_ERASE_TIMEOUT_MULT 223 /* RO */ |
266 | #define EXT_CSD_HC_ERASE_GRP_SIZE 224 /* RO */ | 269 | #define EXT_CSD_HC_ERASE_GRP_SIZE 224 /* RO */ |
267 | #define EXT_CSD_SEC_TRIM_MULT 229 /* RO */ | 270 | #define EXT_CSD_SEC_TRIM_MULT 229 /* RO */ |
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h index 38d393092812..9eb9b4b96f55 100644 --- a/include/linux/mmc/sh_mmcif.h +++ b/include/linux/mmc/sh_mmcif.h | |||
@@ -104,9 +104,6 @@ static inline void sh_mmcif_writel(void __iomem *addr, int reg, u32 val) | |||
104 | 104 | ||
105 | #define SH_MMCIF_BBS 512 /* boot block size */ | 105 | #define SH_MMCIF_BBS 512 /* boot block size */ |
106 | 106 | ||
107 | enum { MMCIF_PROGRESS_ENTER, MMCIF_PROGRESS_INIT, | ||
108 | MMCIF_PROGRESS_LOAD, MMCIF_PROGRESS_DONE }; | ||
109 | |||
110 | static inline void sh_mmcif_boot_cmd_send(void __iomem *base, | 107 | static inline void sh_mmcif_boot_cmd_send(void __iomem *base, |
111 | unsigned long cmd, unsigned long arg) | 108 | unsigned long cmd, unsigned long arg) |
112 | { | 109 | { |
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h new file mode 100644 index 000000000000..c981b959760f --- /dev/null +++ b/include/linux/mmc/sh_mobile_sdhi.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef __SH_MOBILE_SDHI_H__ | ||
2 | #define __SH_MOBILE_SDHI_H__ | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct sh_mobile_sdhi_info { | ||
7 | int dma_slave_tx; | ||
8 | int dma_slave_rx; | ||
9 | unsigned long tmio_flags; | ||
10 | unsigned long tmio_caps; | ||
11 | u32 tmio_ocr_mask; /* available MMC voltages */ | ||
12 | void (*set_pwr)(struct platform_device *pdev, int state); | ||
13 | int (*get_cd)(struct platform_device *pdev); | ||
14 | }; | ||
15 | |||
16 | #endif /* __SH_MOBILE_SDHI_H__ */ | ||
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_ */ | ||