SDMMC:
authorxbw <xbw@rock-chips.com>
Thu, 27 Feb 2014 09:20:54 +0000 (17:20 +0800)
committerxbw <xbw@rock-chips.com>
Thu, 27 Feb 2014 09:20:54 +0000 (17:20 +0800)
1.exclude asynchronous transfer for special request.
2.fix async request mechanism for sequential read scenarios
3.don't start new request when the card is removed
4.support packed write command for eMMC4.5 devices
5.fix the host's claim-release in special request
6.Adding support for sanitize in eMMC 4.5
7.Handle card shutdown from mmc_bus
8.fix null pointer use in mmc_blk_remove_req
9.fix host release issue after discard operation
10.modify the switch voltage.
11.add some profile for sd-sdio3.0

17 files changed:
drivers/mmc/card/block.c [changed mode: 0644->0755]
drivers/mmc/card/mmc_test.c [changed mode: 0644->0755]
drivers/mmc/card/queue.c [changed mode: 0644->0755]
drivers/mmc/core/bus.c [changed mode: 0644->0755]
drivers/mmc/core/core.c [changed mode: 0644->0755]
drivers/mmc/core/core.h [changed mode: 0644->0755]
drivers/mmc/core/debugfs.c [changed mode: 0644->0755]
drivers/mmc/core/host.c [changed mode: 0644->0755]
drivers/mmc/core/mmc.c [changed mode: 0644->0755]
drivers/mmc/core/mmc_ops.c [changed mode: 0644->0755]
drivers/mmc/core/sd.c [changed mode: 0644->0755]
drivers/mmc/host/rk_sdmmc_of.c
include/linux/mmc/card.h [changed mode: 0644->0755]
include/linux/mmc/core.h [changed mode: 0644->0755]
include/linux/mmc/dw_mmc.h [changed mode: 0644->0755]
include/linux/mmc/host.h
include/linux/mmc/slot-gpio.h [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 4f98f8b..ec01697
@@ -34,7 +34,7 @@
 #include <linux/delay.h>
 #include <linux/capability.h>
 #include <linux/compat.h>
-
+#include <linux/pm_runtime.h>
 #define CREATE_TRACE_POINTS
 #include <trace/events/mmc.h>
 
@@ -61,6 +61,8 @@ MODULE_ALIAS("mmc:block");
 #define INAND_CMD38_ARG_SECTRIM1 0x81
 #define INAND_CMD38_ARG_SECTRIM2 0x88
 #define MMC_BLK_TIMEOUT_MS  (10 * 60 * 1000)        /* 10 minute timeout */
+#define MMC_SANITIZE_REQ_TIMEOUT 240000
+#define MMC_EXTRACT_INDEX_FROM_ARG(x) ((x & 0x00FF0000) >> 16)
 
 #define mmc_req_rel_wr(req)    (((req->cmd_flags & REQ_FUA) || \
                                  (req->cmd_flags & REQ_META)) && \
@@ -166,7 +168,11 @@ static struct mmc_blk_data *mmc_blk_get(struct gendisk *disk)
 
 static inline int mmc_get_devidx(struct gendisk *disk)
 {
-       int devidx = disk->first_minor / perdev_minors;
+       int devmaj = MAJOR(disk_devt(disk));
+       int devidx = MINOR(disk_devt(disk)) / perdev_minors;
+
+       if (!devmaj)
+               devidx = disk->first_minor / perdev_minors;
        return devidx;
 }
 
@@ -221,7 +227,7 @@ static ssize_t power_ro_lock_store(struct device *dev,
        md = mmc_blk_get(dev_to_disk(dev));
        card = md->queue.card;
 
-       mmc_claim_host(card->host);
+       mmc_get_card(card);
 
        ret = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BOOT_WP,
                                card->ext_csd.boot_ro_lock |
@@ -232,7 +238,7 @@ static ssize_t power_ro_lock_store(struct device *dev,
        else
                card->ext_csd.boot_ro_lock |= EXT_CSD_BOOT_WP_B_PWR_WP_EN;
 
-       mmc_release_host(card->host);
+       mmc_put_card(card);
 
        if (!ret) {
                pr_info("%s: Locking boot partition ro until next power on\n",
@@ -407,6 +413,35 @@ static int ioctl_rpmb_card_status_poll(struct mmc_card *card, u32 *status,
        return err;
 }
 
+static int ioctl_do_sanitize(struct mmc_card *card)
+{
+       int err;
+
+       if (!(mmc_can_sanitize(card) &&
+             (card->host->caps2 & MMC_CAP2_SANITIZE))) {
+                       pr_warn("%s: %s - SANITIZE is not supported\n",
+                               mmc_hostname(card->host), __func__);
+                       err = -EOPNOTSUPP;
+                       goto out;
+       }
+
+       pr_debug("%s: %s - SANITIZE IN PROGRESS...\n",
+               mmc_hostname(card->host), __func__);
+
+       err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
+                                       EXT_CSD_SANITIZE_START, 1,
+                                       MMC_SANITIZE_REQ_TIMEOUT);
+
+       if (err)
+               pr_err("%s: %s - EXT_CSD_SANITIZE_START failed. err=%d\n",
+                      mmc_hostname(card->host), __func__, err);
+
+       pr_debug("%s: %s - SANITIZE COMPLETED\n", mmc_hostname(card->host),
+                                            __func__);
+out:
+       return err;
+}
+
 static int mmc_blk_ioctl_cmd(struct block_device *bdev,
        struct mmc_ioc_cmd __user *ic_ptr)
 {
@@ -490,7 +525,7 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev,
 
        mrq.cmd = &cmd;
 
-       mmc_claim_host(card->host);
+       mmc_get_card(card);
 
        err = mmc_blk_part_switch(card, md);
        if (err)
@@ -509,6 +544,17 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev,
                        goto cmd_rel_host;
        }
 
+       if ((MMC_EXTRACT_INDEX_FROM_ARG(cmd.arg) == EXT_CSD_SANITIZE_START) &&
+           (cmd.opcode == MMC_SWITCH)) {
+               err = ioctl_do_sanitize(card);
+
+               if (err)
+                       pr_err("%s: ioctl_do_sanitize() failed. err = %d",
+                              __func__, err);
+
+               goto cmd_rel_host;
+       }
+
        mmc_wait_for_req(card->host, &mrq);
 
        if (cmd.error) {
@@ -557,7 +603,7 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev,
        }
 
 cmd_rel_host:
-       mmc_release_host(card->host);
+       mmc_put_card(card);
 
 cmd_done:
        mmc_blk_put(md);
@@ -959,10 +1005,10 @@ static int mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq,
 {
        struct mmc_blk_data *md = mq->data;
        struct mmc_card *card = md->queue.card;
-       unsigned int from, nr, arg, trim_arg, erase_arg;
+       unsigned int from, nr, arg;
        int err = 0, type = MMC_BLK_SECDISCARD;
 
-       if (!(mmc_can_secure_erase_trim(card) || mmc_can_sanitize(card))) {
+       if (!(mmc_can_secure_erase_trim(card))) {
                err = -EOPNOTSUPP;
                goto out;
        }
@@ -970,23 +1016,11 @@ static int mmc_blk_issue_secdiscard_rq(struct mmc_queue *mq,
        from = blk_rq_pos(req);
        nr = blk_rq_sectors(req);
 
-       /* The sanitize operation is supported at v4.5 only */
-       if (mmc_can_sanitize(card)) {
-               erase_arg = MMC_ERASE_ARG;
-               trim_arg = MMC_TRIM_ARG;
-       } else {
-               erase_arg = MMC_SECURE_ERASE_ARG;
-               trim_arg = MMC_SECURE_TRIM1_ARG;
-       }
+       if (mmc_can_trim(card) && !mmc_erase_group_aligned(card, from, nr))
+               arg = MMC_SECURE_TRIM1_ARG;
+       else
+               arg = MMC_SECURE_ERASE_ARG;
 
-       if (mmc_erase_group_aligned(card, from, nr))
-               arg = erase_arg;
-       else if (mmc_can_trim(card))
-               arg = trim_arg;
-       else {
-               err = -EINVAL;
-               goto out;
-       }
 retry:
        if (card->quirks & MMC_QUIRK_INAND_CMD38) {
                err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
@@ -1937,7 +1971,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
        struct mmc_card *card = md->queue.card;
        struct mmc_host *host = card->host;
        unsigned long flags;
-
+       unsigned int cmd_flags = req ? req->cmd_flags : 0;
 #ifdef CONFIG_MMC_BLOCK_DEFERRED_RESUME
        if (mmc_bus_needs_resume(card->host))
                mmc_resume_bus(card->host);
@@ -1945,7 +1979,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
 
        if (req && !mq->mqrq_prev->req)
                /* claim host only for the first request */
-               mmc_claim_host(card->host);
+               mmc_get_card(card);
 
        ret = mmc_blk_part_switch(card, md);
        if (ret) {
@@ -1957,7 +1991,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
        }
 
        mq->flags &= ~MMC_QUEUE_NEW_REQUEST;
-       if (req && req->cmd_flags & REQ_DISCARD) {
+       if (cmd_flags & REQ_DISCARD) {
                /* complete ongoing async transfer before issuing discard */
                if (card->host->areq)
                        mmc_blk_issue_rw_rq(mq, NULL);
@@ -1966,7 +2000,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
                        ret = mmc_blk_issue_secdiscard_rq(mq, req);
                else
                        ret = mmc_blk_issue_discard_rq(mq, req);
-       } else if (req && req->cmd_flags & REQ_FLUSH) {
+       } else if (cmd_flags & REQ_FLUSH) {
                /* complete ongoing async transfer before issuing flush */
                if (card->host->areq)
                        mmc_blk_issue_rw_rq(mq, NULL);
@@ -1982,14 +2016,14 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
 
 out:
        if ((!req && !(mq->flags & MMC_QUEUE_NEW_REQUEST)) ||
-            (req && (req->cmd_flags & MMC_REQ_SPECIAL_MASK)))
+            (cmd_flags & MMC_REQ_SPECIAL_MASK))
                /*
                 * Release host when there are no more requests
                 * and after special request(discard, flush) is done.
                 * In case sepecial request, there is no reentry to
                 * the 'mmc_blk_issue_rq' with 'mqrq_prev->req'.
                 */
-               mmc_release_host(card->host);
+               mmc_put_card(card);
        return ret;
 }
 
@@ -2209,7 +2243,15 @@ static void mmc_blk_remove_req(struct mmc_blk_data *md)
        struct mmc_card *card;
 
        if (md) {
+               /*
+                * Flush remaining requests and free queues. It
+                * is freeing the queue that stops new requests
+                * from being accepted.
+                */
                card = md->queue.card;
+               mmc_cleanup_queue(&md->queue);
+               if (md->flags & MMC_BLK_PACKED_CMD)
+                       mmc_packed_clean(&md->queue);
                if (md->disk->flags & GENHD_FL_UP) {
                        device_remove_file(disk_to_dev(md->disk), &md->force_ro);
                        if ((md->area_type & MMC_BLK_DATA_AREA_BOOT) &&
@@ -2220,11 +2262,6 @@ static void mmc_blk_remove_req(struct mmc_blk_data *md)
                        /* Stop new requests from getting into the queue */
                        del_gendisk(md->disk);
                }
-
-               /* Then flush out any already in there */
-               mmc_cleanup_queue(&md->queue);
-               if (md->flags & MMC_BLK_PACKED_CMD)
-                       mmc_packed_clean(&md->queue);
                mmc_blk_put(md);
        }
 }
@@ -2390,6 +2427,19 @@ static int mmc_blk_probe(struct mmc_card *card)
                if (mmc_add_disk(part_md))
                        goto out;
        }
+
+       pm_runtime_set_autosuspend_delay(&card->dev, 3000);
+       pm_runtime_use_autosuspend(&card->dev);
+
+       /*
+        * Don't enable runtime PM for SD-combo cards here. Leave that
+        * decision to be taken during the SDIO init sequence instead.
+        */
+       if (card->type != MMC_TYPE_SD_COMBO) {
+               pm_runtime_set_active(&card->dev);
+               pm_runtime_enable(&card->dev);
+       }
+
        return 0;
 
  out:
@@ -2403,9 +2453,13 @@ static void mmc_blk_remove(struct mmc_card *card)
        struct mmc_blk_data *md = mmc_get_drvdata(card);
 
        mmc_blk_remove_parts(card, md);
+       pm_runtime_get_sync(&card->dev);
        mmc_claim_host(card->host);
        mmc_blk_part_switch(card, md);
        mmc_release_host(card->host);
+       if (card->type != MMC_TYPE_SD_COMBO)
+               pm_runtime_disable(&card->dev);
+       pm_runtime_put_noidle(&card->dev);
        mmc_blk_remove_req(md);
        mmc_set_drvdata(card, NULL);
 #ifdef CONFIG_MMC_BLOCK_DEFERRED_RESUME
@@ -2413,8 +2467,7 @@ static void mmc_blk_remove(struct mmc_card *card)
 #endif
 }
 
-#ifdef CONFIG_PM
-static int mmc_blk_suspend(struct mmc_card *card)
+static int _mmc_blk_suspend(struct mmc_card *card)
 {
        struct mmc_blk_data *part_md;
        struct mmc_blk_data *md = mmc_get_drvdata(card);
@@ -2428,6 +2481,17 @@ static int mmc_blk_suspend(struct mmc_card *card)
        return 0;
 }
 
+static void mmc_blk_shutdown(struct mmc_card *card)
+{
+       _mmc_blk_suspend(card);
+}
+
+#ifdef CONFIG_PM
+static int mmc_blk_suspend(struct mmc_card *card)
+{
+       return _mmc_blk_suspend(card);
+}
+
 static int mmc_blk_resume(struct mmc_card *card)
 {
        struct mmc_blk_data *part_md;
@@ -2459,6 +2523,7 @@ static struct mmc_driver mmc_driver = {
        .remove         = mmc_blk_remove,
        .suspend        = mmc_blk_suspend,
        .resume         = mmc_blk_resume,
+       .shutdown       = mmc_blk_shutdown,
 };
 
 static int __init mmc_blk_init(void)
old mode 100644 (file)
new mode 100755 (executable)
index 759714e..0c0fc52
@@ -2849,18 +2849,12 @@ static ssize_t mtf_test_write(struct file *file, const char __user *buf,
        struct seq_file *sf = (struct seq_file *)file->private_data;
        struct mmc_card *card = (struct mmc_card *)sf->private;
        struct mmc_test_card *test;
-       char lbuf[12];
        long testcase;
+       int ret;
 
-       if (count >= sizeof(lbuf))
-               return -EINVAL;
-
-       if (copy_from_user(lbuf, buf, count))
-               return -EFAULT;
-       lbuf[count] = '\0';
-
-       if (strict_strtol(lbuf, 10, &testcase))
-               return -EINVAL;
+       ret = kstrtol_from_user(buf, count, 10, &testcase);
+       if (ret)
+               return ret;
 
        test = kzalloc(sizeof(struct mmc_test_card), GFP_KERNEL);
        if (!test)
@@ -3025,12 +3019,17 @@ static void mmc_test_remove(struct mmc_card *card)
        mmc_test_free_dbgfs_file(card);
 }
 
+static void mmc_test_shutdown(struct mmc_card *card)
+{
+}
+
 static struct mmc_driver mmc_driver = {
        .drv            = {
                .name   = "mmc_test",
        },
        .probe          = mmc_test_probe,
        .remove         = mmc_test_remove,
+       .shutdown       = mmc_test_shutdown,
 };
 
 static int __init mmc_test_init(void)
old mode 100644 (file)
new mode 100755 (executable)
index 9447a0e..70427e9
@@ -173,7 +173,7 @@ static void mmc_queue_setup_discard(struct request_queue *q,
        /* granularity must not be greater than max. discard */
        if (card->pref_erase > max_discard)
                q->limits.discard_granularity = 0;
-       if (mmc_can_secure_erase_trim(card) || mmc_can_sanitize(card))
+       if (mmc_can_secure_erase_trim(card))
                queue_flag_set_unlocked(QUEUE_FLAG_SECDISCARD, q);
 }
 
@@ -196,7 +196,8 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card,
        struct mmc_queue_req *mqrq_prev = &mq->mqrq[1];
 
        if (mmc_dev(host)->dma_mask && *mmc_dev(host)->dma_mask)
-               limit = *mmc_dev(host)->dma_mask;
+    limit = *mmc_dev(host)->dma_mask;
+    //limit = (u64)dma_max_pfn(mmc_dev(host)) << PAGE_SHIFT;
 
        mq->card = card;
        mq->queue = blk_init_queue(mmc_request_fn, lock);
old mode 100644 (file)
new mode 100755 (executable)
index e219c97..d0b980c
@@ -122,6 +122,24 @@ static int mmc_bus_remove(struct device *dev)
        return 0;
 }
 
+static void mmc_bus_shutdown(struct device *dev)
+{
+       struct mmc_driver *drv = to_mmc_driver(dev->driver);
+       struct mmc_card *card = mmc_dev_to_card(dev);
+       struct mmc_host *host = card->host;
+       int ret;
+
+       if (dev->driver && drv->shutdown)
+               drv->shutdown(card);
+
+       if (host->bus_ops->shutdown) {
+               ret = host->bus_ops->shutdown(host);
+               if (ret)
+                       pr_warn("%s: error %d during shutdown\n",
+                               mmc_hostname(host), ret);
+       }
+}
+
 #ifdef CONFIG_PM_SLEEP
 static int mmc_bus_suspend(struct device *dev)
 {
@@ -182,6 +200,7 @@ static struct bus_type mmc_bus_type = {
        .uevent         = mmc_bus_uevent,
        .probe          = mmc_bus_probe,
        .remove         = mmc_bus_remove,
+       .shutdown       = mmc_bus_shutdown,
        .pm             = &mmc_bus_pm_ops,
 };
 
old mode 100644 (file)
new mode 100755 (executable)
index 6a83f4c..050050d
@@ -440,6 +440,24 @@ static void mmc_wait_for_req_done(struct mmc_host *host,
                wait_for_completion(&mrq->completion);
 
                cmd = mrq->cmd;
+
+               /*
+                * If host has timed out waiting for the sanitize
+                * to complete, card might be still in programming state
+                * so let's try to bring the card out of programming
+                * state.
+                */
+               if (cmd->sanitize_busy && cmd->error == -ETIMEDOUT) {
+                       if (!mmc_interrupt_hpi(host->card)) {
+                               pr_warning("%s: %s: Interrupted sanitize\n",
+                                          mmc_hostname(host), __func__);
+                               cmd->error = 0;
+                               break;
+                       } else {
+                               pr_err("%s: %s: Failed to interrupt sanitize\n",
+                                      mmc_hostname(host), __func__);
+                       }
+               }
                if (!cmd->error || !cmd->retries ||
                    mmc_card_removed(host->card))
                        break;
@@ -959,6 +977,29 @@ void mmc_release_host(struct mmc_host *host)
 }
 EXPORT_SYMBOL(mmc_release_host);
 
+/*
+ * This is a helper function, which fetches a runtime pm reference for the
+ * card device and also claims the host.
+ */
+void mmc_get_card(struct mmc_card *card)
+{
+       pm_runtime_get_sync(&card->dev);
+       mmc_claim_host(card->host);
+}
+EXPORT_SYMBOL(mmc_get_card);
+
+/*
+ * This is a helper function, which releases the host and drops the runtime
+ * pm reference for the card device.
+ */
+void mmc_put_card(struct mmc_card *card)
+{
+       mmc_release_host(card->host);
+       pm_runtime_mark_last_busy(&card->dev);
+       pm_runtime_put_autosuspend(&card->dev);
+}
+EXPORT_SYMBOL(mmc_put_card);
+
 /*
  * Internal function that does the actual ios call to the host driver,
  * optionally printing some debug output.
old mode 100644 (file)
new mode 100755 (executable)
index b9f18a2..c9c2c2f
@@ -25,6 +25,7 @@ struct mmc_bus_ops {
        int (*power_save)(struct mmc_host *);
        int (*power_restore)(struct mmc_host *);
        int (*alive)(struct mmc_host *);
+       int (*shutdown)(struct mmc_host *);
 };
 
 void mmc_attach_bus(struct mmc_host *host, const struct mmc_bus_ops *ops);
old mode 100644 (file)
new mode 100755 (executable)
index 35c2f85..54829c0
@@ -258,13 +258,13 @@ static int mmc_dbg_card_status_get(void *data, u64 *val)
        u32             status;
        int             ret;
 
-       mmc_claim_host(card->host);
+       mmc_get_card(card);
 
        ret = mmc_send_status(data, &status);
        if (!ret)
                *val = status;
 
-       mmc_release_host(card->host);
+       mmc_put_card(card);
 
        return ret;
 }
@@ -291,9 +291,9 @@ static int mmc_ext_csd_open(struct inode *inode, struct file *filp)
                goto out_free;
        }
 
-       mmc_claim_host(card->host);
+       mmc_get_card(card);
        err = mmc_send_ext_csd(card, ext_csd);
-       mmc_release_host(card->host);
+       mmc_put_card(card);
        if (err)
                goto out_free;
 
old mode 100644 (file)
new mode 100755 (executable)
old mode 100644 (file)
new mode 100755 (executable)
index 0cbd1ef..09841b6
@@ -13,6 +13,7 @@
 #include <linux/err.h>
 #include <linux/slab.h>
 #include <linux/stat.h>
+#include <linux/pm_runtime.h>
 
 #include <linux/mmc/host.h>
 #include <linux/mmc/card.h>
@@ -293,7 +294,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
        }
 
        card->ext_csd.rev = ext_csd[EXT_CSD_REV];
-       if (card->ext_csd.rev > 6) {
+       if (card->ext_csd.rev > 7) {
                pr_err("%s: unrecognised EXT_CSD revision %d\n",
                        mmc_hostname(card->host), card->ext_csd.rev);
                err = -EINVAL;
@@ -1380,14 +1381,14 @@ static void mmc_detect(struct mmc_host *host)
        BUG_ON(!host);
        BUG_ON(!host->card);
 
-       mmc_claim_host(host);
+       mmc_get_card(host->card);
 
        /*
         * Just check if our card has been removed.
         */
        err = _mmc_detect_card_removed(host);
 
-       mmc_release_host(host);
+       mmc_put_card(host->card);
 
        if (err) {
                mmc_remove(host);
old mode 100644 (file)
new mode 100755 (executable)
index 49f04bc..124af52
@@ -431,6 +431,8 @@ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,
 
 
        cmd.cmd_timeout_ms = timeout_ms;
+       if (index == EXT_CSD_SANITIZE_START)
+               cmd.sanitize_busy = true;
 
        err = mmc_wait_for_cmd(card->host, &cmd, MMC_CMD_RETRIES);
        if (err)
old mode 100644 (file)
new mode 100755 (executable)
index f008318..4d92878
@@ -13,6 +13,7 @@
 #include <linux/err.h>
 #include <linux/slab.h>
 #include <linux/stat.h>
+#include <linux/pm_runtime.h>
 
 #include <linux/mmc/host.h>
 #include <linux/mmc/card.h>
@@ -1062,7 +1063,7 @@ static void mmc_sd_detect(struct mmc_host *host)
        BUG_ON(!host);
        BUG_ON(!host->card);
 
-       mmc_claim_host(host);
+       mmc_get_card(host->card);
 
        /*
         * Just check if our card has been removed.
@@ -1085,7 +1086,7 @@ static void mmc_sd_detect(struct mmc_host *host)
        err = _mmc_detect_card_removed(host);
 #endif
 
-       mmc_release_host(host);
+       mmc_put_card(host->card);
 
        if (err) {
                mmc_sd_remove(host);
index 0ea94619742bac38f10d309464b2ed9e5eef8b46..014641f5d6ad00c42f300f0068fa85b998fb661c 100755 (executable)
@@ -15,7 +15,7 @@ printk("%d..%s: =====test====\n", __LINE__, __FUNCTION__);
     mmc_debug(MMC_DBG_BOOT,"mmc,dma_ch: %d\n",rk_mmc_property->mmc_dma_chn);\r
     mmc_debug(MMC_DBG_BOOT,"=========rockchip mmc dts dump info end================\n");\r
     */\r
-      printk("=========rockchip mmc dts dump info start==============\n");\r
+      printk("=========rockchip mmc dts dump info start. 2014-02-27 V1.0==============\n");\r
     printk("mmc,caps: 0x%x\n",rk_mmc_property->mmc_caps);\r
     printk("mmc,ocr:  0x%x\n",rk_mmc_property->mmc_ocr);\r
     printk("mmc,int:  0x%x\n",rk_mmc_property->mmc_int_type);\r
old mode 100644 (file)
new mode 100755 (executable)
index f31725b..6a5c754
@@ -512,6 +512,7 @@ struct mmc_driver {
        void (*remove)(struct mmc_card *);
        int (*suspend)(struct mmc_card *);
        int (*resume)(struct mmc_card *);
+       void (*shutdown)(struct mmc_card *);
 };
 
 extern int mmc_register_driver(struct mmc_driver *);
old mode 100644 (file)
new mode 100755 (executable)
index 39613b9..02f22d1
@@ -96,6 +96,8 @@ struct mmc_command {
  */
 
        unsigned int            cmd_timeout_ms; /* in milliseconds */
+       /* Set this flag only for blocking sanitize request */
+       bool                    sanitize_busy;
 
        struct mmc_data         *data;          /* data segment associated with cmd */
        struct mmc_request      *mrq;           /* associated request */
@@ -187,6 +189,8 @@ extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int);
 extern int __mmc_claim_host(struct mmc_host *host, atomic_t *abort);
 extern void mmc_release_host(struct mmc_host *host);
 extern int mmc_try_claim_host(struct mmc_host *host);
+extern void mmc_get_card(struct mmc_card *card);
+extern void mmc_put_card(struct mmc_card *card);
 
 extern int mmc_flush_cache(struct mmc_card *);
 
old mode 100644 (file)
new mode 100755 (executable)
index 198f0fa..6ce7d2c
@@ -15,6 +15,7 @@
 #define LINUX_MMC_DW_MMC_H
 
 #include <linux/scatterlist.h>
+#include <linux/mmc/core.h>
 
 #define MAX_MCI_SLOTS  2
 
@@ -129,6 +130,9 @@ struct dw_mci {
        struct mmc_request      *mrq;
        struct mmc_command      *cmd;
        struct mmc_data         *data;
+       struct mmc_command      stop_abort;
+       unsigned int            prev_blksz;
+       unsigned char           timing;
        struct workqueue_struct *card_workqueue;
 
        /* DMA interface members*/
index 4b8771b788396f67f8af2982cee2514d098c69f1..faefc9e1eb361413933d1c75937733d89bfadf91 100755 (executable)
@@ -196,10 +196,6 @@ struct mmc_supply {
        struct regulator *vqmmc;        /* Optional Vccq supply */
 };
 
-#define HOST_IS_EMMC(host)  (host->unused)
-#define SDMMC_SUPPORT_EMMC(host)    (host->rk_sdmmc_emmc_used)
-
-
 struct mmc_host {
        struct device           *parent;
        struct device           class_dev;
@@ -286,6 +282,7 @@ struct mmc_host {
 #define MMC_CAP2_PACKED_CMD    (MMC_CAP2_PACKED_RD | \
                                 MMC_CAP2_PACKED_WR)
 #define MMC_CAP2_NO_PRESCAN_POWERUP (1 << 14)  /* Don't power up before scan */
+#define MMC_CAP2_SANITIZE      (1 << 15)               /* Support Sanitize */
 
        mmc_pm_flag_t           pm_caps;        /* supported pm features */
 
old mode 100644 (file)
new mode 100755 (executable)