summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2011-08-29 16:42:11 +0300
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2017-03-31 10:16:31 +0200
commite5ad0688a6b46f62664bdaad854311017bd039c4 (patch)
tree9e982ef690984ebd1d8709ef8b273794d7a4e0ec /include
parentb496d097ab8741678ae3027b8e5358a04fb5ea82 (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> (cherry picked from commit b2499518b5ad7e28bb3ed348fd3f370eeb1e36c0)
Diffstat (limited to 'include')
-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 9eb6c6babd13..d240274445b0 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -51,6 +51,7 @@ struct mmc_ext_csd {
u8 rel_sectors;
u8 rel_param;
u8 part_config;
+ u8 rst_n_function;
unsigned int part_time; /* Units: ms */
unsigned int sa_timeout; /* Units: 100ns */
unsigned int hs_max_dtr;
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 921c4f6a2e0e..88c1fd13ba0b 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -172,6 +172,9 @@ extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
extern unsigned int mmc_calc_max_discard(struct mmc_card *card);
extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen);
+extern int mmc_hw_reset(struct mmc_host *host);
+extern int mmc_hw_reset_check(struct mmc_host *host);
+extern int mmc_can_reset(struct mmc_card *card);
extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *);
extern 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 0441661ad59a..61dcb90536d7 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -148,6 +148,7 @@ struct mmc_host_ops {
int (*execute_tuning)(struct mmc_host *host);
void (*enable_preset_value)(struct mmc_host *host, bool enable);
int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv);
+ void (*hw_reset)(struct mmc_host *host);
};
struct mmc_card;
@@ -231,6 +232,7 @@ struct mmc_host {
#define MMC_CAP_MAX_CURRENT_800 (1 << 29) /* Host max current limit is 800mA */
#define MMC_CAP_CMD23 (1 << 30) /* CMD23 supported. */
#define MMC_CAP_BKOPS (1 << 31) /* Host supports BKOPS */
+#define MMC_CAP_HW_RESET (1 << 32) /* Hardware reset */
unsigned int caps2; /* More host capabilities */
#define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 2bb1dfd4cf12..b8e9076f3e0d 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -274,6 +274,7 @@ struct _mmc_csd {
#define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */
#define EXT_CSD_PARTITION_SUPPORT 160 /* RO */
#define EXT_CSD_HPI_MGMT 161 /* R/W */
+#define EXT_CSD_RST_N_FUNCTION 162 /* R/W */
#define EXT_CSD_BKOPS_EN 163 /* R/W */
#define EXT_CSD_BKOPS_START 164 /* R/W */
#define EXT_CSD_WR_REL_PARAM 166 /* RO */
@@ -336,6 +337,9 @@ struct _mmc_csd {
#define EXT_CSD_SEC_BD_BLK_EN BIT(2)
#define EXT_CSD_SEC_GB_CL_EN BIT(4)
+#define EXT_CSD_RST_N_EN_MASK 0x3
+#define EXT_CSD_RST_N_ENABLED 1 /* RST_n is enabled on card */
+
/*
* MMC_SWITCH access modes
*/