aboutsummaryrefslogtreecommitdiff
path: root/include/mmc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/mmc.h')
-rw-r--r--include/mmc.h38
1 files changed, 37 insertions, 1 deletions
diff --git a/include/mmc.h b/include/mmc.h
index cdb56e7ac14..a5c6573ddd6 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -344,7 +344,9 @@ struct mmc_config {
/* TODO struct mmc should be in mmc_private but it's hard to fix right now */
struct mmc {
+#ifndef CONFIG_BLK
struct list_head link;
+#endif
const struct mmc_config *cfg; /* provided configuration */
uint version;
void *priv;
@@ -376,11 +378,16 @@ struct mmc {
u64 capacity_gp[4];
u64 enh_user_start;
u64 enh_user_size;
+#ifndef CONFIG_BLK
struct blk_desc block_dev;
+#endif
char op_cond_pending; /* 1 if we are waiting on an op_cond command */
char init_in_progress; /* 1 if we have done mmc_start_init() */
char preinit; /* start init as early as possible */
int ddr_mode;
+#ifdef CONFIG_DM_MMC
+ struct udevice *dev; /* Device for this MMC controller */
+#endif
};
struct mmc_hwpart_conf {
@@ -406,7 +413,29 @@ enum mmc_hwpart_conf_mode {
int mmc_register(struct mmc *mmc);
struct mmc *mmc_create(const struct mmc_config *cfg, void *priv);
+
+/**
+ * mmc_bind() - Set up a new MMC device ready for probing
+ *
+ * A child block device is bound with the IF_TYPE_MMC interface type. This
+ * allows the device to be used with CONFIG_BLK
+ *
+ * @dev: MMC device to set up
+ * @mmc: MMC struct
+ * @cfg: MMC configuration
+ * @return 0 if OK, -ve on error
+ */
+int mmc_bind(struct udevice *dev, struct mmc *mmc,
+ const struct mmc_config *cfg);
void mmc_destroy(struct mmc *mmc);
+
+/**
+ * mmc_unbind() - Unbind a MMC device's child block device
+ *
+ * @dev: MMC device
+ * @return 0 if OK, -ve on error
+ */
+int mmc_unbind(struct udevice *dev);
int mmc_initialize(bd_t *bis);
int mmc_init(struct mmc *mmc);
int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size);
@@ -415,7 +444,6 @@ struct mmc *find_mmc_device(int dev_num);
int mmc_set_dev(int dev_num);
void print_mmc_devices(char separator);
int get_mmc_num(void);
-int mmc_switch_part(int dev_num, unsigned int part_num);
int mmc_hwpart_config(struct mmc *mmc, const struct mmc_hwpart_conf *conf,
enum mmc_hwpart_conf_mode mode);
int mmc_getcd(struct mmc *mmc);
@@ -498,4 +526,12 @@ int pci_mmc_init(const char *name, struct pci_device_id *mmc_supported);
#define CONFIG_SYS_MMC_MAX_BLK_COUNT 65535
#endif
+/**
+ * mmc_get_blk_desc() - Get the block descriptor for an MMC device
+ *
+ * @mmc: MMC device
+ * @return block device if found, else NULL
+ */
+struct blk_desc *mmc_get_blk_desc(struct mmc *mmc);
+
#endif /* _MMC_H_ */