diff options
author | Simon Glass <sjg@chromium.org> | 2016-05-01 13:52:41 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-05-17 09:54:43 -0600 |
commit | 33fb211dd2706e666db4008801dc0d5903fd82f6 (patch) | |
tree | 5d29a3fea60d78047d2afa7b884c667ac84c35ad /include | |
parent | ad27dd5e13436b554f0f3cb9cd3e79634494072d (diff) | |
download | u-boot-imx-33fb211dd2706e666db4008801dc0d5903fd82f6.zip u-boot-imx-33fb211dd2706e666db4008801dc0d5903fd82f6.tar.gz u-boot-imx-33fb211dd2706e666db4008801dc0d5903fd82f6.tar.bz2 |
dm: mmc: Add support for driver-model block devices
Add support for enabling CONFIG_BLK with MMC. This involves changing a
few functions to use struct udevice and adding a MMC block device driver.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/mmc.h | 4 | ||||
-rw-r--r-- | include/part.h | 18 |
2 files changed, 4 insertions, 18 deletions
diff --git a/include/mmc.h b/include/mmc.h index fb8d9b2..a5c6573 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,7 +378,9 @@ 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 */ diff --git a/include/part.h b/include/part.h index bc9dc64..226b5be 100644 --- a/include/part.h +++ b/include/part.h @@ -73,23 +73,6 @@ typedef struct disk_partition { */ struct blk_desc *blk_get_dev(const char *ifname, int dev); -/** - * mmc_select_hwpart() - Select the MMC hardware partiion on an MMC device - * - * MMC devices can support partitioning at the hardware level. This is quite - * separate from the normal idea of software-based partitions. MMC hardware - * partitions must be explicitly selected. Once selected only the region of - * the device covered by that partition is accessible. - * - * The MMC standard provides for two boot partitions (numbered 1 and 2), - * rpmb (3), and up to 4 addition general-purpose partitions (4-7). - * - * @dev_num: Block device number (struct blk_desc->dev value) - * @hwpart: Hardware partition number to select. 0 means the raw device, - * 1 is the first partition, 2 is the second, etc. - * @return 0 if OK, other value for an error - */ -int mmc_select_hwpart(int dev_num, int hwpart); struct blk_desc *mg_disk_get_dev(int dev); int host_get_dev_err(int dev, struct blk_desc **blk_devp); @@ -167,7 +150,6 @@ extern const struct block_drvr block_drvr[]; #else static inline struct blk_desc *blk_get_dev(const char *ifname, int dev) { return NULL; } -static inline int mmc_select_hwpart(int dev_num, int hwpart) { return -1; } static inline struct blk_desc *mg_disk_get_dev(int dev) { return NULL; } static inline int part_get_info(struct blk_desc *dev_desc, int part, |