aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mmc
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2011-08-29 09:42:11 -0400
committerChris Ball <cjb@laptop.org>2011-10-26 16:32:05 -0400
commitb2499518b5ad7e28bb3ed348fd3f370eeb1e36c0 (patch)
treec4c9597d0631554bffeecbcc6a2a7ec3037ea78c /include/linux/mmc
parent8e3336b1e4378f7d205af9b25dcc9e645c8a9609 (diff)
mmc: core: add eMMC hardware reset support
eMMC's may have a hardware reset line. This patch provides a host controller operation to implement hardware reset and a function to reset and reinitialize the card. Also, for MMC, the reset is always performed before initialization. The host must set the new host capability MMC_CAP_HW_RESET to enable hardware reset. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'include/linux/mmc')
-rw-r--r--include/linux/mmc/card.h1
-rw-r--r--include/linux/mmc/core.h3
-rw-r--r--include/linux/mmc/host.h2
-rw-r--r--include/linux/mmc/mmc.h4
4 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 6dfb293326e2..5294ddf382ae 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -50,6 +50,7 @@ struct mmc_ext_csd {
50 u8 rel_sectors; 50 u8 rel_sectors;
51 u8 rel_param; 51 u8 rel_param;
52 u8 part_config; 52 u8 part_config;
53 u8 rst_n_function;
53 unsigned int part_time; /* Units: ms */ 54 unsigned int part_time; /* Units: ms */
54 unsigned int sa_timeout; /* Units: 100ns */ 55 unsigned int sa_timeout; /* Units: 100ns */
55 unsigned int hs_max_dtr; 56 unsigned int hs_max_dtr;
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index b8b1b7a311f1..56e5625b6f41 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -162,6 +162,9 @@ extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
162extern unsigned int mmc_calc_max_discard(struct mmc_card *card); 162extern unsigned int mmc_calc_max_discard(struct mmc_card *card);
163 163
164extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); 164extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen);
165extern int mmc_hw_reset(struct mmc_host *host);
166extern int mmc_hw_reset_check(struct mmc_host *host);
167extern int mmc_can_reset(struct mmc_card *card);
165 168
166extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *); 169extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *);
167extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int); 170extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int);
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 340cc0c9409f..b2aefea97048 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -151,6 +151,7 @@ struct mmc_host_ops {
151 int (*execute_tuning)(struct mmc_host *host); 151 int (*execute_tuning)(struct mmc_host *host);
152 void (*enable_preset_value)(struct mmc_host *host, bool enable); 152 void (*enable_preset_value)(struct mmc_host *host, bool enable);
153 int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv); 153 int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv);
154 void (*hw_reset)(struct mmc_host *host);
154}; 155};
155 156
156struct mmc_card; 157struct mmc_card;
@@ -233,6 +234,7 @@ struct mmc_host {
233#define MMC_CAP_MAX_CURRENT_600 (1 << 28) /* Host max current limit is 600mA */ 234#define MMC_CAP_MAX_CURRENT_600 (1 << 28) /* Host max current limit is 600mA */
234#define MMC_CAP_MAX_CURRENT_800 (1 << 29) /* Host max current limit is 800mA */ 235#define MMC_CAP_MAX_CURRENT_800 (1 << 29) /* Host max current limit is 800mA */
235#define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */ 236#define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */
237#define MMC_CAP_HW_RESET (1 << 31) /* Hardware reset */
236 238
237 mmc_pm_flag_t pm_caps; /* supported pm features */ 239 mmc_pm_flag_t pm_caps; /* supported pm features */
238 240
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 5a794cb503ea..ed8fca890ee2 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -272,6 +272,7 @@ struct _mmc_csd {
272 272
273#define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ 273#define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */
274#define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ 274#define EXT_CSD_PARTITION_SUPPORT 160 /* RO */
275#define EXT_CSD_RST_N_FUNCTION 162 /* R/W */
275#define EXT_CSD_WR_REL_PARAM 166 /* RO */ 276#define EXT_CSD_WR_REL_PARAM 166 /* RO */
276#define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ 277#define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */
277#define EXT_CSD_PART_CONFIG 179 /* R/W */ 278#define EXT_CSD_PART_CONFIG 179 /* R/W */
@@ -328,6 +329,9 @@ struct _mmc_csd {
328#define EXT_CSD_SEC_BD_BLK_EN BIT(2) 329#define EXT_CSD_SEC_BD_BLK_EN BIT(2)
329#define EXT_CSD_SEC_GB_CL_EN BIT(4) 330#define EXT_CSD_SEC_GB_CL_EN BIT(4)
330 331
332#define EXT_CSD_RST_N_EN_MASK 0x3
333#define EXT_CSD_RST_N_ENABLED 1 /* RST_n is enabled on card */
334
331/* 335/*
332 * MMC_SWITCH access modes 336 * MMC_SWITCH access modes
333 */ 337 */