@@ -23,11 +23,13 @@
#define MMC_CARD_SDXC (1<<3) /* card is SDXC */
#define MMC_CARD_REMOVED (1<<4) /* card has been removed */
#define MMC_STATE_SUSPENDED (1<<5) /* card is suspended */
+#define MMC_CARD_SDUC (1<<6) /* card is SDUC */
#define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT)
#define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY)
#define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR)
#define mmc_card_ext_capacity(c) ((c)->state & MMC_CARD_SDXC)
+#define mmc_card_ultra_capacity(c) ((c)->state & MMC_CARD_SDUC)
#define mmc_card_removed(c) ((c) && ((c)->state & MMC_CARD_REMOVED))
#define mmc_card_suspended(c) ((c)->state & MMC_STATE_SUSPENDED)
@@ -35,6 +37,7 @@
#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
#define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR)
#define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC)
+#define mmc_card_set_ultra_capacity(c) ((c)->state |= MMC_CARD_SDUC)
#define mmc_card_set_removed(c) ((c)->state |= MMC_CARD_REMOVED)
#define mmc_card_set_suspended(c) ((c)->state |= MMC_STATE_SUSPENDED)
#define mmc_card_clr_suspended(c) ((c)->state &= ~MMC_STATE_SUSPENDED)
@@ -116,15 +116,15 @@ bool mmc_is_req_done(struct mmc_host *host, struct mmc_request *mrq);
int mmc_start_request(struct mmc_host *host, struct mmc_request *mrq);
-int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr,
+int mmc_erase(struct mmc_card *card, unsigned long long from, unsigned long long nr,
unsigned int arg);
int mmc_can_erase(struct mmc_card *card);
int mmc_can_trim(struct mmc_card *card);
int mmc_can_discard(struct mmc_card *card);
int mmc_can_sanitize(struct mmc_card *card);
int mmc_can_secure_erase_trim(struct mmc_card *card);
-int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
- unsigned int nr);
+int mmc_erase_group_aligned(struct mmc_card *card, unsigned long long from,
+ unsigned long long nr);
unsigned int mmc_calc_max_discard(struct mmc_card *card);
int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen);
@@ -89,5 +89,10 @@ static inline bool mmc_card_sd_express(struct mmc_host *host)
host->ios.timing == MMC_TIMING_SD_EXP_1_2V;
}
+static inline bool mmc_host_sduc(struct mmc_host *host)
+{
+ return host->caps2 & MMC_CAP2_SDUC;
+}
+
#endif
@@ -40,6 +40,7 @@ struct mmc_blk_ioc_data;
struct mmc_blk_request {
struct mmc_request mrq;
struct mmc_command sbc;
+ struct mmc_command ae;
struct mmc_command cmd;
struct mmc_command stop;
struct mmc_data data;
@@ -35,7 +35,7 @@ struct mmc_csd {
unsigned int wp_grp_size;
unsigned int read_blkbits;
unsigned int write_blkbits;
- unsigned int capacity;
+ unsigned long long capacity;
unsigned int read_partial:1,
read_misalign:1,
write_partial:1,
@@ -142,6 +142,7 @@ struct mmc_data {
struct mmc_host;
struct mmc_request {
struct mmc_command *sbc; /* SET_BLOCK_COUNT for multiblock */
+ struct mmc_command *ae; /* ADDR_EXT for SDUC */
struct mmc_command *cmd;
struct mmc_data *data;
struct mmc_command *stop;
@@ -427,6 +427,7 @@ struct mmc_host {
#define MMC_CAP2_CRYPTO 0
#endif
#define MMC_CAP2_ALT_GPT_TEGRA (1 << 28) /* Host with eMMC that has GPT entry at a non-standard location */
+#define MMC_CAP2_SDUC (1 << 29)
int fixed_drv_type; /* fixed driver type for non-removable media */
@@ -15,6 +15,9 @@
#define SD_SEND_IF_COND 8 /* bcr [11:0] See below R7 */
#define SD_SWITCH_VOLTAGE 11 /* ac R1 */
+ /* class 2 */
+#define SD_ADDR_EXT 22 /* ac [5:0] extended addr R1 */
+
/* class 10 */
#define SD_SWITCH 6 /* adtc [31:0] See below R1 */
@@ -36,6 +39,8 @@
/* OCR bit definitions */
#define SD_OCR_S18R (1 << 24) /* 1.8V switching request */
#define SD_ROCR_S18A SD_OCR_S18R /* 1.8V switching accepted by card */
+#define SD_OCR_HO2T (1 << 27) /* Over 2TB Supported Host */
+#define SD_ROCR_CO2T SD_OCR_HO2T /* Over 2TB Card */
#define SD_OCR_XPC (1 << 28) /* SDXC power control */
#define SD_OCR_CCS (1 << 30) /* Card Capacity Status */
Modified some type from "unsigned int" to "unsigned long long" because SDUC need more bits address Add some definitions for support SDUC Add pointer ae(Address extension) to know support SDUC or not Signed-off-by: Ricky Wu <ricky_wu@realtek.com> --- drivers/mmc/core/card.h | 3 +++ drivers/mmc/core/core.h | 6 +++--- drivers/mmc/core/host.h | 5 +++++ drivers/mmc/core/queue.h | 1 + include/linux/mmc/card.h | 2 +- include/linux/mmc/core.h | 1 + include/linux/mmc/host.h | 1 + include/linux/mmc/sd.h | 5 +++++ 8 files changed, 20 insertions(+), 4 deletions(-)