diff options
author | Seungwon Jeon <tgih.jun@samsung.com> | 2011-10-14 01:03:21 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-10-26 16:32:28 -0400 |
commit | 881d1c25f765938a95def5afe39486ce39f9fc96 (patch) | |
tree | 694d5ea1b3fba2c28cc110123f2ca50b4408f309 /include/linux/mmc | |
parent | 71fe3eb0d006861bdae57e93975b6ae3d9b55e99 (diff) |
mmc: core: Add cache control for eMMC4.5 device
This patch adds cache feature of eMMC4.5 Spec.
If device supports cache capability, host can utilize some specific
operations.
Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'include/linux/mmc')
-rw-r--r-- | include/linux/mmc/card.h | 2 | ||||
-rw-r--r-- | include/linux/mmc/core.h | 2 | ||||
-rw-r--r-- | include/linux/mmc/host.h | 3 | ||||
-rw-r--r-- | include/linux/mmc/mmc.h | 3 |
4 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 551378508784..32492b78aed6 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -51,6 +51,7 @@ struct mmc_ext_csd { | |||
51 | u8 rel_sectors; | 51 | u8 rel_sectors; |
52 | u8 rel_param; | 52 | u8 rel_param; |
53 | u8 part_config; | 53 | u8 part_config; |
54 | u8 cache_ctrl; | ||
54 | u8 rst_n_function; | 55 | u8 rst_n_function; |
55 | unsigned int part_time; /* Units: ms */ | 56 | unsigned int part_time; /* Units: ms */ |
56 | unsigned int sa_timeout; /* Units: 100ns */ | 57 | unsigned int sa_timeout; /* Units: 100ns */ |
@@ -67,6 +68,7 @@ struct mmc_ext_csd { | |||
67 | bool enhanced_area_en; /* enable bit */ | 68 | bool enhanced_area_en; /* enable bit */ |
68 | unsigned long long enhanced_area_offset; /* Units: Byte */ | 69 | unsigned long long enhanced_area_offset; /* Units: Byte */ |
69 | unsigned int enhanced_area_size; /* Units: KB */ | 70 | unsigned int enhanced_area_size; /* Units: KB */ |
71 | unsigned int cache_size; /* Units: KB */ | ||
70 | u8 raw_partition_support; /* 160 */ | 72 | u8 raw_partition_support; /* 160 */ |
71 | u8 raw_erased_mem_count; /* 181 */ | 73 | u8 raw_erased_mem_count; /* 181 */ |
72 | u8 raw_ext_csd_structure; /* 194 */ | 74 | u8 raw_ext_csd_structure; /* 194 */ |
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index e918120235bd..67bac374d122 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
@@ -177,6 +177,8 @@ extern void mmc_release_host(struct mmc_host *host); | |||
177 | extern void mmc_do_release_host(struct mmc_host *host); | 177 | extern void mmc_do_release_host(struct mmc_host *host); |
178 | extern int mmc_try_claim_host(struct mmc_host *host); | 178 | extern int mmc_try_claim_host(struct mmc_host *host); |
179 | 179 | ||
180 | extern int mmc_flush_cache(struct mmc_card *); | ||
181 | |||
180 | /** | 182 | /** |
181 | * mmc_claim_host - exclusively claim a host | 183 | * mmc_claim_host - exclusively claim a host |
182 | * @host: mmc host to claim | 184 | * @host: mmc host to claim |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index cd10208d9a06..16e9338944e8 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -239,6 +239,7 @@ struct mmc_host { | |||
239 | unsigned int caps2; /* More host capabilities */ | 239 | unsigned int caps2; /* More host capabilities */ |
240 | 240 | ||
241 | #define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */ | 241 | #define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */ |
242 | #define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */ | ||
242 | #define MMC_CAP2_POWEROFF_NOTIFY (1 << 2) /* Notify poweroff supported */ | 243 | #define MMC_CAP2_POWEROFF_NOTIFY (1 << 2) /* Notify poweroff supported */ |
243 | 244 | ||
244 | mmc_pm_flag_t pm_caps; /* supported pm features */ | 245 | mmc_pm_flag_t pm_caps; /* supported pm features */ |
@@ -349,6 +350,8 @@ extern int mmc_power_restore_host(struct mmc_host *host); | |||
349 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); | 350 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); |
350 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); | 351 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); |
351 | 352 | ||
353 | extern int mmc_cache_ctrl(struct mmc_host *, u8); | ||
354 | |||
352 | static inline void mmc_signal_sdio_irq(struct mmc_host *host) | 355 | static inline void mmc_signal_sdio_irq(struct mmc_host *host) |
353 | { | 356 | { |
354 | host->ops->enable_sdio_irq(host, 0); | 357 | host->ops->enable_sdio_irq(host, 0); |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 8a05a21fc7c3..160e4c5bdae0 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -270,6 +270,8 @@ struct _mmc_csd { | |||
270 | * EXT_CSD fields | 270 | * EXT_CSD fields |
271 | */ | 271 | */ |
272 | 272 | ||
273 | #define EXT_CSD_FLUSH_CACHE 32 /* W */ | ||
274 | #define EXT_CSD_CACHE_CTRL 33 /* R/W */ | ||
273 | #define EXT_CSD_POWER_OFF_NOTIFICATION 34 /* R/W */ | 275 | #define EXT_CSD_POWER_OFF_NOTIFICATION 34 /* R/W */ |
274 | #define EXT_CSD_GP_SIZE_MULT 143 /* R/W */ | 276 | #define EXT_CSD_GP_SIZE_MULT 143 /* R/W */ |
275 | #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ | 277 | #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ |
@@ -308,6 +310,7 @@ struct _mmc_csd { | |||
308 | #define EXT_CSD_PWR_CL_DDR_52_360 239 /* RO */ | 310 | #define EXT_CSD_PWR_CL_DDR_52_360 239 /* RO */ |
309 | #define EXT_CSD_POWER_OFF_LONG_TIME 247 /* RO */ | 311 | #define EXT_CSD_POWER_OFF_LONG_TIME 247 /* RO */ |
310 | #define EXT_CSD_GENERIC_CMD6_TIME 248 /* RO */ | 312 | #define EXT_CSD_GENERIC_CMD6_TIME 248 /* RO */ |
313 | #define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */ | ||
311 | 314 | ||
312 | /* | 315 | /* |
313 | * EXT_CSD field definitions | 316 | * EXT_CSD field definitions |