mmc: block: support no access to boot partitions
[pandora-kernel.git] / include / linux / mmc / host.h
index 1d09562..aed5bc7 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <linux/leds.h>
 #include <linux/sched.h>
+#include <linux/fault-inject.h>
 
 #include <linux/mmc/core.h>
 #include <linux/mmc/pm.h>
@@ -108,6 +109,9 @@ struct mmc_host_ops {
         * It is optional for the host to implement pre_req and post_req in
         * order to support double buffering of requests (prepare one
         * request while another request is active).
+        * pre_req() must always be followed by a post_req().
+        * To undo a call made to pre_req(), call post_req() with
+        * a nonzero err condition.
         */
        void    (*post_req)(struct mmc_host *host, struct mmc_request *req,
                            int err);
@@ -147,6 +151,7 @@ struct mmc_host_ops {
        int     (*execute_tuning)(struct mmc_host *host);
        void    (*enable_preset_value)(struct mmc_host *host, bool enable);
        int     (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv);
+       void    (*hw_reset)(struct mmc_host *host);
 };
 
 struct mmc_card;
@@ -229,6 +234,11 @@ struct mmc_host {
 #define MMC_CAP_MAX_CURRENT_600        (1 << 28)       /* Host max current limit is 600mA */
 #define MMC_CAP_MAX_CURRENT_800        (1 << 29)       /* Host max current limit is 800mA */
 #define MMC_CAP_CMD23          (1 << 30)       /* CMD23 supported. */
+#define MMC_CAP_HW_RESET       (1 << 31)       /* Hardware reset */
+
+       unsigned int            caps2;          /* More host capabilities */
+
+#define MMC_CAP2_BOOTPART_NOACC        (1 << 0)        /* Boot partition no access */
 
        mmc_pm_flag_t           pm_caps;        /* supported pm features */
 
@@ -302,6 +312,10 @@ struct mmc_host {
 
        struct mmc_async_req    *areq;          /* active async req */
 
+#ifdef CONFIG_FAIL_MMC_REQUEST
+       struct fault_attr       fail_mmc_request;
+#endif
+
        unsigned long           private[0] ____cacheline_aligned;
 };
 
@@ -394,4 +408,10 @@ static inline int mmc_host_cmd23(struct mmc_host *host)
 {
        return host->caps & MMC_CAP_CMD23;
 }
+
+static inline int mmc_boot_partition_access(struct mmc_host *host)
+{
+       return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC);
+}
+
 #endif /* LINUX_MMC_HOST_H */