diff options
Diffstat (limited to 'include/linux/mmc')
| -rw-r--r-- | include/linux/mmc/card.h | 58 | ||||
| -rw-r--r-- | include/linux/mmc/core.h | 9 | ||||
| -rw-r--r-- | include/linux/mmc/dw_mmc.h | 4 | ||||
| -rw-r--r-- | include/linux/mmc/host.h | 29 | ||||
| -rw-r--r-- | include/linux/mmc/mmc.h | 38 | ||||
| -rw-r--r-- | include/linux/mmc/sdhci.h | 8 | ||||
| -rw-r--r-- | include/linux/mmc/sdio.h | 2 | ||||
| -rw-r--r-- | include/linux/mmc/sh_mmcif.h | 4 | ||||
| -rw-r--r-- | include/linux/mmc/sh_mobile_sdhi.h | 4 |
9 files changed, 153 insertions, 3 deletions
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index b460fc2af8a1..415f2db414e1 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
| @@ -50,8 +50,12 @@ 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 cache_ctrl; | ||
| 54 | u8 rst_n_function; | ||
| 53 | unsigned int part_time; /* Units: ms */ | 55 | unsigned int part_time; /* Units: ms */ |
| 54 | unsigned int sa_timeout; /* Units: 100ns */ | 56 | unsigned int sa_timeout; /* Units: 100ns */ |
| 57 | unsigned int generic_cmd6_time; /* Units: 10ms */ | ||
| 58 | unsigned int power_off_longtime; /* Units: ms */ | ||
| 55 | unsigned int hs_max_dtr; | 59 | unsigned int hs_max_dtr; |
| 56 | unsigned int sectors; | 60 | unsigned int sectors; |
| 57 | unsigned int card_type; | 61 | unsigned int card_type; |
| @@ -63,11 +67,15 @@ struct mmc_ext_csd { | |||
| 63 | bool enhanced_area_en; /* enable bit */ | 67 | bool enhanced_area_en; /* enable bit */ |
| 64 | unsigned long long enhanced_area_offset; /* Units: Byte */ | 68 | unsigned long long enhanced_area_offset; /* Units: Byte */ |
| 65 | unsigned int enhanced_area_size; /* Units: KB */ | 69 | unsigned int enhanced_area_size; /* Units: KB */ |
| 66 | unsigned int boot_size; /* in bytes */ | 70 | unsigned int cache_size; /* Units: KB */ |
| 71 | bool hpi_en; /* HPI enablebit */ | ||
| 72 | bool hpi; /* HPI support bit */ | ||
| 73 | unsigned int hpi_cmd; /* cmd used as HPI */ | ||
| 67 | u8 raw_partition_support; /* 160 */ | 74 | u8 raw_partition_support; /* 160 */ |
| 68 | u8 raw_erased_mem_count; /* 181 */ | 75 | u8 raw_erased_mem_count; /* 181 */ |
| 69 | u8 raw_ext_csd_structure; /* 194 */ | 76 | u8 raw_ext_csd_structure; /* 194 */ |
| 70 | u8 raw_card_type; /* 196 */ | 77 | u8 raw_card_type; /* 196 */ |
| 78 | u8 out_of_int_time; /* 198 */ | ||
| 71 | u8 raw_s_a_timeout; /* 217 */ | 79 | u8 raw_s_a_timeout; /* 217 */ |
| 72 | u8 raw_hc_erase_gap_size; /* 221 */ | 80 | u8 raw_hc_erase_gap_size; /* 221 */ |
| 73 | u8 raw_erase_timeout_mult; /* 223 */ | 81 | u8 raw_erase_timeout_mult; /* 223 */ |
| @@ -77,6 +85,9 @@ struct mmc_ext_csd { | |||
| 77 | u8 raw_sec_feature_support;/* 231 */ | 85 | u8 raw_sec_feature_support;/* 231 */ |
| 78 | u8 raw_trim_mult; /* 232 */ | 86 | u8 raw_trim_mult; /* 232 */ |
| 79 | u8 raw_sectors[4]; /* 212 - 4 bytes */ | 87 | u8 raw_sectors[4]; /* 212 - 4 bytes */ |
| 88 | |||
| 89 | unsigned int feature_support; | ||
| 90 | #define MMC_DISCARD_FEATURE BIT(0) /* CMD38 feature */ | ||
| 80 | }; | 91 | }; |
| 81 | 92 | ||
| 82 | struct sd_scr { | 93 | struct sd_scr { |
| @@ -157,6 +168,24 @@ struct sdio_func_tuple; | |||
| 157 | 168 | ||
| 158 | #define SDIO_MAX_FUNCS 7 | 169 | #define SDIO_MAX_FUNCS 7 |
| 159 | 170 | ||
| 171 | /* The number of MMC physical partitions. These consist of: | ||
| 172 | * boot partitions (2), general purpose partitions (4) in MMC v4.4. | ||
| 173 | */ | ||
| 174 | #define MMC_NUM_BOOT_PARTITION 2 | ||
| 175 | #define MMC_NUM_GP_PARTITION 4 | ||
| 176 | #define MMC_NUM_PHY_PARTITION 6 | ||
| 177 | #define MAX_MMC_PART_NAME_LEN 20 | ||
| 178 | |||
| 179 | /* | ||
| 180 | * MMC Physical partitions | ||
| 181 | */ | ||
| 182 | struct mmc_part { | ||
| 183 | unsigned int size; /* partition size (in bytes) */ | ||
| 184 | unsigned int part_cfg; /* partition type */ | ||
| 185 | char name[MAX_MMC_PART_NAME_LEN]; | ||
| 186 | bool force_ro; /* to make boot parts RO by default */ | ||
| 187 | }; | ||
| 188 | |||
| 160 | /* | 189 | /* |
| 161 | * MMC device | 190 | * MMC device |
| 162 | */ | 191 | */ |
| @@ -188,6 +217,13 @@ struct mmc_card { | |||
| 188 | #define MMC_QUIRK_DISABLE_CD (1<<5) /* disconnect CD/DAT[3] resistor */ | 217 | #define MMC_QUIRK_DISABLE_CD (1<<5) /* disconnect CD/DAT[3] resistor */ |
| 189 | #define MMC_QUIRK_INAND_CMD38 (1<<6) /* iNAND devices have broken CMD38 */ | 218 | #define MMC_QUIRK_INAND_CMD38 (1<<6) /* iNAND devices have broken CMD38 */ |
| 190 | #define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */ | 219 | #define MMC_QUIRK_BLK_NO_CMD23 (1<<7) /* Avoid CMD23 for regular multiblock */ |
| 220 | #define MMC_QUIRK_BROKEN_BYTE_MODE_512 (1<<8) /* Avoid sending 512 bytes in */ | ||
| 221 | /* byte mode */ | ||
| 222 | unsigned int poweroff_notify_state; /* eMMC4.5 notify feature */ | ||
| 223 | #define MMC_NO_POWER_NOTIFICATION 0 | ||
| 224 | #define MMC_POWERED_ON 1 | ||
| 225 | #define MMC_POWEROFF_SHORT 2 | ||
| 226 | #define MMC_POWEROFF_LONG 3 | ||
| 191 | 227 | ||
| 192 | unsigned int erase_size; /* erase size in sectors */ | 228 | unsigned int erase_size; /* erase size in sectors */ |
| 193 | unsigned int erase_shift; /* if erase unit is power 2 */ | 229 | unsigned int erase_shift; /* if erase unit is power 2 */ |
| @@ -216,9 +252,24 @@ struct mmc_card { | |||
| 216 | unsigned int sd_bus_speed; /* Bus Speed Mode set for the card */ | 252 | unsigned int sd_bus_speed; /* Bus Speed Mode set for the card */ |
| 217 | 253 | ||
| 218 | struct dentry *debugfs_root; | 254 | struct dentry *debugfs_root; |
| 255 | struct mmc_part part[MMC_NUM_PHY_PARTITION]; /* physical partitions */ | ||
| 256 | unsigned int nr_parts; | ||
| 219 | }; | 257 | }; |
| 220 | 258 | ||
| 221 | /* | 259 | /* |
| 260 | * This function fill contents in mmc_part. | ||
| 261 | */ | ||
| 262 | static inline void mmc_part_add(struct mmc_card *card, unsigned int size, | ||
| 263 | unsigned int part_cfg, char *name, int idx, bool ro) | ||
| 264 | { | ||
| 265 | card->part[card->nr_parts].size = size; | ||
| 266 | card->part[card->nr_parts].part_cfg = part_cfg; | ||
| 267 | sprintf(card->part[card->nr_parts].name, name, idx); | ||
| 268 | card->part[card->nr_parts].force_ro = ro; | ||
| 269 | card->nr_parts++; | ||
| 270 | } | ||
| 271 | |||
| 272 | /* | ||
| 222 | * The world is not perfect and supplies us with broken mmc/sdio devices. | 273 | * The world is not perfect and supplies us with broken mmc/sdio devices. |
| 223 | * For at least some of these bugs we need a work-around. | 274 | * For at least some of these bugs we need a work-around. |
| 224 | */ | 275 | */ |
| @@ -377,6 +428,11 @@ static inline int mmc_card_nonstd_func_interface(const struct mmc_card *c) | |||
| 377 | return c->quirks & MMC_QUIRK_NONSTD_FUNC_IF; | 428 | return c->quirks & MMC_QUIRK_NONSTD_FUNC_IF; |
| 378 | } | 429 | } |
| 379 | 430 | ||
| 431 | static inline int mmc_card_broken_byte_mode_512(const struct mmc_card *c) | ||
| 432 | { | ||
| 433 | return c->quirks & MMC_QUIRK_BROKEN_BYTE_MODE_512; | ||
| 434 | } | ||
| 435 | |||
| 380 | #define mmc_card_name(c) ((c)->cid.prod_name) | 436 | #define mmc_card_name(c) ((c)->cid.prod_name) |
| 381 | #define mmc_card_id(c) (dev_name(&(c)->dev)) | 437 | #define mmc_card_id(c) (dev_name(&(c)->dev)) |
| 382 | 438 | ||
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index b8b1b7a311f1..174a844a5dda 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h | |||
| @@ -136,6 +136,7 @@ struct mmc_async_req; | |||
| 136 | 136 | ||
| 137 | extern struct mmc_async_req *mmc_start_req(struct mmc_host *, | 137 | extern struct mmc_async_req *mmc_start_req(struct mmc_host *, |
| 138 | struct mmc_async_req *, int *); | 138 | struct mmc_async_req *, int *); |
| 139 | extern int mmc_interrupt_hpi(struct mmc_card *); | ||
| 139 | extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *); | 140 | extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *); |
| 140 | extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); | 141 | extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); |
| 141 | extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *); | 142 | extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *); |
| @@ -146,6 +147,7 @@ extern int mmc_switch(struct mmc_card *, u8, u8, u8, unsigned int); | |||
| 146 | #define MMC_ERASE_ARG 0x00000000 | 147 | #define MMC_ERASE_ARG 0x00000000 |
| 147 | #define MMC_SECURE_ERASE_ARG 0x80000000 | 148 | #define MMC_SECURE_ERASE_ARG 0x80000000 |
| 148 | #define MMC_TRIM_ARG 0x00000001 | 149 | #define MMC_TRIM_ARG 0x00000001 |
| 150 | #define MMC_DISCARD_ARG 0x00000003 | ||
| 149 | #define MMC_SECURE_TRIM1_ARG 0x80000001 | 151 | #define MMC_SECURE_TRIM1_ARG 0x80000001 |
| 150 | #define MMC_SECURE_TRIM2_ARG 0x80008000 | 152 | #define MMC_SECURE_TRIM2_ARG 0x80008000 |
| 151 | 153 | ||
| @@ -156,12 +158,17 @@ extern int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr, | |||
| 156 | unsigned int arg); | 158 | unsigned int arg); |
| 157 | extern int mmc_can_erase(struct mmc_card *card); | 159 | extern int mmc_can_erase(struct mmc_card *card); |
| 158 | extern int mmc_can_trim(struct mmc_card *card); | 160 | extern int mmc_can_trim(struct mmc_card *card); |
| 161 | extern int mmc_can_discard(struct mmc_card *card); | ||
| 162 | extern int mmc_can_sanitize(struct mmc_card *card); | ||
| 159 | extern int mmc_can_secure_erase_trim(struct mmc_card *card); | 163 | extern int mmc_can_secure_erase_trim(struct mmc_card *card); |
| 160 | extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from, | 164 | extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from, |
| 161 | unsigned int nr); | 165 | unsigned int nr); |
| 162 | extern unsigned int mmc_calc_max_discard(struct mmc_card *card); | 166 | extern unsigned int mmc_calc_max_discard(struct mmc_card *card); |
| 163 | 167 | ||
| 164 | extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); | 168 | extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); |
| 169 | extern int mmc_hw_reset(struct mmc_host *host); | ||
| 170 | extern int mmc_hw_reset_check(struct mmc_host *host); | ||
| 171 | extern int mmc_can_reset(struct mmc_card *card); | ||
| 165 | 172 | ||
| 166 | extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *); | 173 | extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *); |
| 167 | extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int); | 174 | extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int); |
| @@ -171,6 +178,8 @@ extern void mmc_release_host(struct mmc_host *host); | |||
| 171 | extern void mmc_do_release_host(struct mmc_host *host); | 178 | extern void mmc_do_release_host(struct mmc_host *host); |
| 172 | extern int mmc_try_claim_host(struct mmc_host *host); | 179 | extern int mmc_try_claim_host(struct mmc_host *host); |
| 173 | 180 | ||
| 181 | extern int mmc_flush_cache(struct mmc_card *); | ||
| 182 | |||
| 174 | /** | 183 | /** |
| 175 | * mmc_claim_host - exclusively claim a host | 184 | * mmc_claim_host - exclusively claim a host |
| 176 | * @host: mmc host to claim | 185 | * @host: mmc host to claim |
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h index 6b46819705d1..6dc9b80568a0 100644 --- a/include/linux/mmc/dw_mmc.h +++ b/include/linux/mmc/dw_mmc.h | |||
| @@ -72,6 +72,8 @@ struct mmc_data; | |||
| 72 | * rate and timeout calculations. | 72 | * rate and timeout calculations. |
| 73 | * @current_speed: Configured rate of the controller. | 73 | * @current_speed: Configured rate of the controller. |
| 74 | * @num_slots: Number of slots available. | 74 | * @num_slots: Number of slots available. |
| 75 | * @verid: Denote Version ID. | ||
| 76 | * @data_offset: Set the offset of DATA register according to VERID. | ||
| 75 | * @pdev: Platform device associated with the MMC controller. | 77 | * @pdev: Platform device associated with the MMC controller. |
| 76 | * @pdata: Platform data associated with the MMC controller. | 78 | * @pdata: Platform data associated with the MMC controller. |
| 77 | * @slot: Slots sharing this MMC controller. | 79 | * @slot: Slots sharing this MMC controller. |
| @@ -147,6 +149,8 @@ struct dw_mci { | |||
| 147 | u32 current_speed; | 149 | u32 current_speed; |
| 148 | u32 num_slots; | 150 | u32 num_slots; |
| 149 | u32 fifoth_val; | 151 | u32 fifoth_val; |
| 152 | u16 verid; | ||
| 153 | u16 data_offset; | ||
| 150 | struct platform_device *pdev; | 154 | struct platform_device *pdev; |
| 151 | struct dw_mci_board *pdata; | 155 | struct dw_mci_board *pdata; |
| 152 | struct dw_mci_slot *slot[MAX_MCI_SLOTS]; | 156 | struct dw_mci_slot *slot[MAX_MCI_SLOTS]; |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 1d09562ccf73..a3ac9c48e5de 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | #include <linux/leds.h> | 13 | #include <linux/leds.h> |
| 14 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
| 15 | #include <linux/fault-inject.h> | ||
| 15 | 16 | ||
| 16 | #include <linux/mmc/core.h> | 17 | #include <linux/mmc/core.h> |
| 17 | #include <linux/mmc/pm.h> | 18 | #include <linux/mmc/pm.h> |
| @@ -108,6 +109,9 @@ struct mmc_host_ops { | |||
| 108 | * It is optional for the host to implement pre_req and post_req in | 109 | * It is optional for the host to implement pre_req and post_req in |
| 109 | * order to support double buffering of requests (prepare one | 110 | * order to support double buffering of requests (prepare one |
| 110 | * request while another request is active). | 111 | * request while another request is active). |
| 112 | * pre_req() must always be followed by a post_req(). | ||
| 113 | * To undo a call made to pre_req(), call post_req() with | ||
| 114 | * a nonzero err condition. | ||
| 111 | */ | 115 | */ |
| 112 | void (*post_req)(struct mmc_host *host, struct mmc_request *req, | 116 | void (*post_req)(struct mmc_host *host, struct mmc_request *req, |
| 113 | int err); | 117 | int err); |
| @@ -147,6 +151,7 @@ struct mmc_host_ops { | |||
| 147 | int (*execute_tuning)(struct mmc_host *host); | 151 | int (*execute_tuning)(struct mmc_host *host); |
| 148 | void (*enable_preset_value)(struct mmc_host *host, bool enable); | 152 | void (*enable_preset_value)(struct mmc_host *host, bool enable); |
| 149 | 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); | ||
| 150 | }; | 155 | }; |
| 151 | 156 | ||
| 152 | struct mmc_card; | 157 | struct mmc_card; |
| @@ -229,8 +234,20 @@ struct mmc_host { | |||
| 229 | #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 */ |
| 230 | #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 */ |
| 231 | #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 */ | ||
| 238 | |||
| 239 | unsigned int caps2; /* More host capabilities */ | ||
| 240 | |||
| 241 | #define MMC_CAP2_BOOTPART_NOACC (1 << 0) /* Boot partition no access */ | ||
| 242 | #define MMC_CAP2_CACHE_CTRL (1 << 1) /* Allow cache control */ | ||
| 243 | #define MMC_CAP2_POWEROFF_NOTIFY (1 << 2) /* Notify poweroff supported */ | ||
| 244 | #define MMC_CAP2_NO_MULTI_READ (1 << 3) /* Multiblock reads don't work */ | ||
| 232 | 245 | ||
| 233 | mmc_pm_flag_t pm_caps; /* supported pm features */ | 246 | mmc_pm_flag_t pm_caps; /* supported pm features */ |
| 247 | unsigned int power_notify_type; | ||
| 248 | #define MMC_HOST_PW_NOTIFY_NONE 0 | ||
| 249 | #define MMC_HOST_PW_NOTIFY_SHORT 1 | ||
| 250 | #define MMC_HOST_PW_NOTIFY_LONG 2 | ||
| 234 | 251 | ||
| 235 | #ifdef CONFIG_MMC_CLKGATE | 252 | #ifdef CONFIG_MMC_CLKGATE |
| 236 | int clk_requests; /* internal reference counter */ | 253 | int clk_requests; /* internal reference counter */ |
| @@ -302,6 +319,10 @@ struct mmc_host { | |||
| 302 | 319 | ||
| 303 | struct mmc_async_req *areq; /* active async req */ | 320 | struct mmc_async_req *areq; /* active async req */ |
| 304 | 321 | ||
| 322 | #ifdef CONFIG_FAIL_MMC_REQUEST | ||
| 323 | struct fault_attr fail_mmc_request; | ||
| 324 | #endif | ||
| 325 | |||
| 305 | unsigned long private[0] ____cacheline_aligned; | 326 | unsigned long private[0] ____cacheline_aligned; |
| 306 | }; | 327 | }; |
| 307 | 328 | ||
| @@ -330,6 +351,8 @@ extern int mmc_power_restore_host(struct mmc_host *host); | |||
| 330 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); | 351 | extern void mmc_detect_change(struct mmc_host *, unsigned long delay); |
| 331 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); | 352 | extern void mmc_request_done(struct mmc_host *, struct mmc_request *); |
| 332 | 353 | ||
| 354 | extern int mmc_cache_ctrl(struct mmc_host *, u8); | ||
| 355 | |||
| 333 | static inline void mmc_signal_sdio_irq(struct mmc_host *host) | 356 | static inline void mmc_signal_sdio_irq(struct mmc_host *host) |
| 334 | { | 357 | { |
| 335 | host->ops->enable_sdio_irq(host, 0); | 358 | host->ops->enable_sdio_irq(host, 0); |
| @@ -394,4 +417,10 @@ static inline int mmc_host_cmd23(struct mmc_host *host) | |||
| 394 | { | 417 | { |
| 395 | return host->caps & MMC_CAP_CMD23; | 418 | return host->caps & MMC_CAP_CMD23; |
| 396 | } | 419 | } |
| 420 | |||
| 421 | static inline int mmc_boot_partition_access(struct mmc_host *host) | ||
| 422 | { | ||
| 423 | return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC); | ||
| 424 | } | ||
| 425 | |||
| 397 | #endif /* LINUX_MMC_HOST_H */ | 426 | #endif /* LINUX_MMC_HOST_H */ |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 5a794cb503ea..0e7135697d11 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
| @@ -270,18 +270,31 @@ 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 */ | ||
| 275 | #define EXT_CSD_POWER_OFF_NOTIFICATION 34 /* R/W */ | ||
| 276 | #define EXT_CSD_GP_SIZE_MULT 143 /* R/W */ | ||
| 273 | #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ | 277 | #define EXT_CSD_PARTITION_ATTRIBUTE 156 /* R/W */ |
| 274 | #define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ | 278 | #define EXT_CSD_PARTITION_SUPPORT 160 /* RO */ |
| 279 | #define EXT_CSD_HPI_MGMT 161 /* R/W */ | ||
| 280 | #define EXT_CSD_RST_N_FUNCTION 162 /* R/W */ | ||
| 281 | #define EXT_CSD_SANITIZE_START 165 /* W */ | ||
| 275 | #define EXT_CSD_WR_REL_PARAM 166 /* RO */ | 282 | #define EXT_CSD_WR_REL_PARAM 166 /* RO */ |
| 276 | #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ | 283 | #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ |
| 277 | #define EXT_CSD_PART_CONFIG 179 /* R/W */ | 284 | #define EXT_CSD_PART_CONFIG 179 /* R/W */ |
| 278 | #define EXT_CSD_ERASED_MEM_CONT 181 /* RO */ | 285 | #define EXT_CSD_ERASED_MEM_CONT 181 /* RO */ |
| 279 | #define EXT_CSD_BUS_WIDTH 183 /* R/W */ | 286 | #define EXT_CSD_BUS_WIDTH 183 /* R/W */ |
| 280 | #define EXT_CSD_HS_TIMING 185 /* R/W */ | 287 | #define EXT_CSD_HS_TIMING 185 /* R/W */ |
| 288 | #define EXT_CSD_POWER_CLASS 187 /* R/W */ | ||
| 281 | #define EXT_CSD_REV 192 /* RO */ | 289 | #define EXT_CSD_REV 192 /* RO */ |
| 282 | #define EXT_CSD_STRUCTURE 194 /* RO */ | 290 | #define EXT_CSD_STRUCTURE 194 /* RO */ |
| 283 | #define EXT_CSD_CARD_TYPE 196 /* RO */ | 291 | #define EXT_CSD_CARD_TYPE 196 /* RO */ |
| 292 | #define EXT_CSD_OUT_OF_INTERRUPT_TIME 198 /* RO */ | ||
| 284 | #define EXT_CSD_PART_SWITCH_TIME 199 /* RO */ | 293 | #define EXT_CSD_PART_SWITCH_TIME 199 /* RO */ |
| 294 | #define EXT_CSD_PWR_CL_52_195 200 /* RO */ | ||
| 295 | #define EXT_CSD_PWR_CL_26_195 201 /* RO */ | ||
| 296 | #define EXT_CSD_PWR_CL_52_360 202 /* RO */ | ||
| 297 | #define EXT_CSD_PWR_CL_26_360 203 /* RO */ | ||
| 285 | #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ | 298 | #define EXT_CSD_SEC_CNT 212 /* RO, 4 bytes */ |
| 286 | #define EXT_CSD_S_A_TIMEOUT 217 /* RO */ | 299 | #define EXT_CSD_S_A_TIMEOUT 217 /* RO */ |
| 287 | #define EXT_CSD_REL_WR_SEC_C 222 /* RO */ | 300 | #define EXT_CSD_REL_WR_SEC_C 222 /* RO */ |
| @@ -293,6 +306,14 @@ struct _mmc_csd { | |||
| 293 | #define EXT_CSD_SEC_ERASE_MULT 230 /* RO */ | 306 | #define EXT_CSD_SEC_ERASE_MULT 230 /* RO */ |
| 294 | #define EXT_CSD_SEC_FEATURE_SUPPORT 231 /* RO */ | 307 | #define EXT_CSD_SEC_FEATURE_SUPPORT 231 /* RO */ |
| 295 | #define EXT_CSD_TRIM_MULT 232 /* RO */ | 308 | #define EXT_CSD_TRIM_MULT 232 /* RO */ |
| 309 | #define EXT_CSD_PWR_CL_200_195 236 /* RO */ | ||
| 310 | #define EXT_CSD_PWR_CL_200_360 237 /* RO */ | ||
| 311 | #define EXT_CSD_PWR_CL_DDR_52_195 238 /* RO */ | ||
| 312 | #define EXT_CSD_PWR_CL_DDR_52_360 239 /* RO */ | ||
| 313 | #define EXT_CSD_POWER_OFF_LONG_TIME 247 /* RO */ | ||
| 314 | #define EXT_CSD_GENERIC_CMD6_TIME 248 /* RO */ | ||
| 315 | #define EXT_CSD_CACHE_SIZE 249 /* RO, 4 bytes */ | ||
| 316 | #define EXT_CSD_HPI_FEATURES 503 /* RO */ | ||
| 296 | 317 | ||
| 297 | /* | 318 | /* |
| 298 | * EXT_CSD field definitions | 319 | * EXT_CSD field definitions |
| @@ -302,7 +323,9 @@ struct _mmc_csd { | |||
| 302 | 323 | ||
| 303 | #define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) | 324 | #define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) |
| 304 | #define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) | 325 | #define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) |
| 305 | #define EXT_CSD_PART_CONFIG_ACC_BOOT1 (0x2) | 326 | #define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4) |
| 327 | |||
| 328 | #define EXT_CSD_PART_SUPPORT_PART_EN (0x1) | ||
| 306 | 329 | ||
| 307 | #define EXT_CSD_CMD_SET_NORMAL (1<<0) | 330 | #define EXT_CSD_CMD_SET_NORMAL (1<<0) |
| 308 | #define EXT_CSD_CMD_SET_SECURE (1<<1) | 331 | #define EXT_CSD_CMD_SET_SECURE (1<<1) |
| @@ -327,7 +350,20 @@ struct _mmc_csd { | |||
| 327 | #define EXT_CSD_SEC_ER_EN BIT(0) | 350 | #define EXT_CSD_SEC_ER_EN BIT(0) |
| 328 | #define EXT_CSD_SEC_BD_BLK_EN BIT(2) | 351 | #define EXT_CSD_SEC_BD_BLK_EN BIT(2) |
| 329 | #define EXT_CSD_SEC_GB_CL_EN BIT(4) | 352 | #define EXT_CSD_SEC_GB_CL_EN BIT(4) |
| 353 | #define EXT_CSD_SEC_SANITIZE BIT(6) /* v4.5 only */ | ||
| 354 | |||
| 355 | #define EXT_CSD_RST_N_EN_MASK 0x3 | ||
| 356 | #define EXT_CSD_RST_N_ENABLED 1 /* RST_n is enabled on card */ | ||
| 357 | |||
| 358 | #define EXT_CSD_NO_POWER_NOTIFICATION 0 | ||
| 359 | #define EXT_CSD_POWER_ON 1 | ||
| 360 | #define EXT_CSD_POWER_OFF_SHORT 2 | ||
| 361 | #define EXT_CSD_POWER_OFF_LONG 3 | ||
| 330 | 362 | ||
| 363 | #define EXT_CSD_PWR_CL_8BIT_MASK 0xF0 /* 8 bit PWR CLS */ | ||
| 364 | #define EXT_CSD_PWR_CL_4BIT_MASK 0x0F /* 8 bit PWR CLS */ | ||
| 365 | #define EXT_CSD_PWR_CL_8BIT_SHIFT 4 | ||
| 366 | #define EXT_CSD_PWR_CL_4BIT_SHIFT 0 | ||
| 331 | /* | 367 | /* |
| 332 | * MMC_SWITCH access modes | 368 | * MMC_SWITCH access modes |
| 333 | */ | 369 | */ |
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index 5666f3abfab7..e4b69353678d 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h | |||
| @@ -88,6 +88,10 @@ struct sdhci_host { | |||
| 88 | /* The read-only detection via SDHCI_PRESENT_STATE register is unstable */ | 88 | /* The read-only detection via SDHCI_PRESENT_STATE register is unstable */ |
| 89 | #define SDHCI_QUIRK_UNSTABLE_RO_DETECT (1<<31) | 89 | #define SDHCI_QUIRK_UNSTABLE_RO_DETECT (1<<31) |
| 90 | 90 | ||
| 91 | unsigned int quirks2; /* More deviations from spec. */ | ||
| 92 | |||
| 93 | #define SDHCI_QUIRK2_OWN_CARD_DETECTION (1<<0) | ||
| 94 | |||
| 91 | int irq; /* Device IRQ */ | 95 | int irq; /* Device IRQ */ |
| 92 | void __iomem *ioaddr; /* Mapped address */ | 96 | void __iomem *ioaddr; /* Mapped address */ |
| 93 | 97 | ||
| @@ -115,6 +119,8 @@ struct sdhci_host { | |||
| 115 | #define SDHCI_NEEDS_RETUNING (1<<5) /* Host needs retuning */ | 119 | #define SDHCI_NEEDS_RETUNING (1<<5) /* Host needs retuning */ |
| 116 | #define SDHCI_AUTO_CMD12 (1<<6) /* Auto CMD12 support */ | 120 | #define SDHCI_AUTO_CMD12 (1<<6) /* Auto CMD12 support */ |
| 117 | #define SDHCI_AUTO_CMD23 (1<<7) /* Auto CMD23 support */ | 121 | #define SDHCI_AUTO_CMD23 (1<<7) /* Auto CMD23 support */ |
| 122 | #define SDHCI_PV_ENABLED (1<<8) /* Preset value enabled */ | ||
| 123 | #define SDHCI_SDIO_IRQ_ENABLED (1<<9) /* SDIO irq enabled */ | ||
| 118 | 124 | ||
| 119 | unsigned int version; /* SDHCI spec. version */ | 125 | unsigned int version; /* SDHCI spec. version */ |
| 120 | 126 | ||
| @@ -125,6 +131,8 @@ struct sdhci_host { | |||
| 125 | unsigned int clock; /* Current clock (MHz) */ | 131 | unsigned int clock; /* Current clock (MHz) */ |
| 126 | u8 pwr; /* Current voltage */ | 132 | u8 pwr; /* Current voltage */ |
| 127 | 133 | ||
| 134 | bool runtime_suspended; /* Host is runtime suspended */ | ||
| 135 | |||
| 128 | struct mmc_request *mrq; /* Current request */ | 136 | struct mmc_request *mrq; /* Current request */ |
| 129 | struct mmc_command *cmd; /* Current command */ | 137 | struct mmc_command *cmd; /* Current command */ |
| 130 | struct mmc_data *data; /* Current data request */ | 138 | struct mmc_data *data; /* Current data request */ |
diff --git a/include/linux/mmc/sdio.h b/include/linux/mmc/sdio.h index 2a2e9905a247..e0b1123497b9 100644 --- a/include/linux/mmc/sdio.h +++ b/include/linux/mmc/sdio.h | |||
| @@ -72,11 +72,13 @@ | |||
| 72 | #define SDIO_CCCR_REV_1_00 0 /* CCCR/FBR Version 1.00 */ | 72 | #define SDIO_CCCR_REV_1_00 0 /* CCCR/FBR Version 1.00 */ |
| 73 | #define SDIO_CCCR_REV_1_10 1 /* CCCR/FBR Version 1.10 */ | 73 | #define SDIO_CCCR_REV_1_10 1 /* CCCR/FBR Version 1.10 */ |
| 74 | #define SDIO_CCCR_REV_1_20 2 /* CCCR/FBR Version 1.20 */ | 74 | #define SDIO_CCCR_REV_1_20 2 /* CCCR/FBR Version 1.20 */ |
| 75 | #define SDIO_CCCR_REV_3_00 3 /* CCCR/FBR Version 3.00 */ | ||
| 75 | 76 | ||
| 76 | #define SDIO_SDIO_REV_1_00 0 /* SDIO Spec Version 1.00 */ | 77 | #define SDIO_SDIO_REV_1_00 0 /* SDIO Spec Version 1.00 */ |
| 77 | #define SDIO_SDIO_REV_1_10 1 /* SDIO Spec Version 1.10 */ | 78 | #define SDIO_SDIO_REV_1_10 1 /* SDIO Spec Version 1.10 */ |
| 78 | #define SDIO_SDIO_REV_1_20 2 /* SDIO Spec Version 1.20 */ | 79 | #define SDIO_SDIO_REV_1_20 2 /* SDIO Spec Version 1.20 */ |
| 79 | #define SDIO_SDIO_REV_2_00 3 /* SDIO Spec Version 2.00 */ | 80 | #define SDIO_SDIO_REV_2_00 3 /* SDIO Spec Version 2.00 */ |
| 81 | #define SDIO_SDIO_REV_3_00 4 /* SDIO Spec Version 3.00 */ | ||
| 80 | 82 | ||
| 81 | #define SDIO_CCCR_SD 0x01 | 83 | #define SDIO_CCCR_SD 0x01 |
| 82 | 84 | ||
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h index 0222cd8ebe76..04ff452bf5c3 100644 --- a/include/linux/mmc/sh_mmcif.h +++ b/include/linux/mmc/sh_mmcif.h | |||
| @@ -41,7 +41,9 @@ struct sh_mmcif_plat_data { | |||
| 41 | void (*set_pwr)(struct platform_device *pdev, int state); | 41 | void (*set_pwr)(struct platform_device *pdev, int state); |
| 42 | void (*down_pwr)(struct platform_device *pdev); | 42 | void (*down_pwr)(struct platform_device *pdev); |
| 43 | int (*get_cd)(struct platform_device *pdef); | 43 | int (*get_cd)(struct platform_device *pdef); |
| 44 | struct sh_mmcif_dma *dma; | 44 | struct sh_mmcif_dma *dma; /* Deprecated. Instead */ |
| 45 | unsigned int slave_id_tx; /* use embedded slave_id_[tr]x */ | ||
| 46 | unsigned int slave_id_rx; | ||
| 45 | u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ | 47 | u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */ |
| 46 | unsigned long caps; | 48 | unsigned long caps; |
| 47 | u32 ocr; | 49 | u32 ocr; |
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h index bd50b365167f..71b805451bd8 100644 --- a/include/linux/mmc/sh_mobile_sdhi.h +++ b/include/linux/mmc/sh_mobile_sdhi.h | |||
| @@ -6,6 +6,10 @@ | |||
| 6 | struct platform_device; | 6 | struct platform_device; |
| 7 | struct tmio_mmc_data; | 7 | struct tmio_mmc_data; |
| 8 | 8 | ||
| 9 | #define SH_MOBILE_SDHI_IRQ_CARD_DETECT "card_detect" | ||
| 10 | #define SH_MOBILE_SDHI_IRQ_SDCARD "sdcard" | ||
| 11 | #define SH_MOBILE_SDHI_IRQ_SDIO "sdio" | ||
| 12 | |||
| 9 | struct sh_mobile_sdhi_info { | 13 | struct sh_mobile_sdhi_info { |
| 10 | int dma_slave_tx; | 14 | int dma_slave_tx; |
| 11 | int dma_slave_rx; | 15 | int dma_slave_rx; |
