summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVenkat Gopalakrishnan <venkatg@codeaurora.org>2015-05-29 16:51:43 -0700
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-31 15:26:27 -0700
commitfc4b531dfdca023ac59389e7acf24f21aa6074ed (patch)
tree06f8b19248e723c4689d43aadfbbe517e9a927fe /include
parentee66ddaa077507729c911f8a9cad2b3376fe8284 (diff)
mmc: card: add read/write support in command queue mode
Command queueing is defined in eMMC-5.1. It is designed for higher performance by ensuring upto 32 requests to be serviced at a time. Adds read/write support for CMDQ enabled devices. Change-Id: I136ddea8e5ca57eb4f85ca6e72c60001a7e24f78 Signed-off-by: Sujit Reddy Thumma <sthumma@codeaurora.org> Signed-off-by: Asutosh Das <asutoshd@codeaurora.org> Signed-off-by: Konstantin Dorfman <kdorfman@codeaurora.org> Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org> [subhashj@codeaurora.org: fixed trivial merge conflicts] Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mmc/card.h2
-rw-r--r--include/linux/mmc/core.h7
-rw-r--r--include/linux/mmc/host.h22
3 files changed, 31 insertions, 0 deletions
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 9885e75d196b..e7fdaff68d7e 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -358,6 +358,7 @@ struct mmc_card {
struct notifier_block reboot_notify;
bool issue_long_pon;
u8 *cached_ext_csd;
+ bool cmdq_init;
};
/*
@@ -613,4 +614,5 @@ extern struct mmc_wr_pack_stats *mmc_blk_get_packed_statistics(
struct mmc_card *card);
extern void mmc_blk_init_packed_statistics(struct mmc_card *card);
extern int mmc_send_long_pon(struct mmc_card *card);
+extern void mmc_blk_cmdq_req_done(struct mmc_request *mrq);
#endif /* LINUX_MMC_CARD_H */
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index 07f96aa5ff6b..8139a58e6d8e 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -108,11 +108,18 @@ struct mmc_request {
struct completion completion;
void (*done)(struct mmc_request *);/* completion function */
struct mmc_host *host;
+ struct mmc_cmdq_req *cmdq_req;
struct request *req;
};
struct mmc_card;
struct mmc_async_req;
+struct mmc_cmdq_req;
+
+extern void mmc_cmdq_post_req(struct mmc_host *host, struct mmc_request *mrq,
+ int err);
+extern int mmc_cmdq_start_req(struct mmc_host *host,
+ struct mmc_cmdq_req *cmdq_req);
extern int mmc_stop_bkops(struct mmc_card *);
extern int mmc_read_bkops_status(struct mmc_card *);
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index a2fbb73996a7..12b8d5505985 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -91,6 +91,9 @@ enum mmc_load {
struct mmc_cmdq_host_ops {
int (*enable)(struct mmc_host *host);
void (*disable)(struct mmc_host *host, bool soft);
+ int (*request)(struct mmc_host *host, struct mmc_request *mrq);
+ void (*post_req)(struct mmc_host *host, struct mmc_request *mrq,
+ int err);
};
struct mmc_host_ops {
@@ -174,6 +177,25 @@ struct mmc_host_ops {
struct mmc_card;
struct device;
+struct mmc_cmdq_req {
+ unsigned int cmd_flags;
+ u32 blk_addr;
+ /* active mmc request */
+ struct mmc_request mrq;
+ struct mmc_data data;
+ struct mmc_command cmd;
+#define DCMD (1 << 0)
+#define QBR (1 << 1)
+#define DIR (1 << 2)
+#define PRIO (1 << 3)
+#define REL_WR (1 << 4)
+#define DAT_TAG (1 << 5)
+#define FORCED_PRG (1 << 6)
+ unsigned int cmdq_req_flags;
+ int tag; /* used for command queuing */
+ u8 ctx_id;
+};
+
struct mmc_async_req {
/* active mmc request */
struct mmc_request *mrq;