summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDiego Santa Cruz <Diego.SantaCruz@spinetix.com>2014-12-23 10:50:29 +0100
committerPantelis Antoniou <pantelis.antoniou@konsulko.com>2015-01-19 17:41:45 +0200
commitac9da0e08c01e3addc55241ffc09db29aa800473 (patch)
tree913a952f42afe8aa21b69ce5d179eefb915fa486 /include
parent9cf199ebcff13f8d98b31ab48e3bcce37ed8925d (diff)
downloadu-boot-imx-ac9da0e08c01e3addc55241ffc09db29aa800473.zip
u-boot-imx-ac9da0e08c01e3addc55241ffc09db29aa800473.tar.gz
u-boot-imx-ac9da0e08c01e3addc55241ffc09db29aa800473.tar.bz2
mmc: add API to do eMMC hardware partitioning
This adds an API to do hardware partitioning on eMMC devices. The new mmc_hwpart_config() function does the partitioning in one go. As the different attributes and partitioning options on eMMC may be interdependent validation has to be done based on the complete partitioning configuration. The function accepts three modes: - MMC_HWPART_CONF_CHECK: just validates that the configuration is valid. - MMC_HWPART_CONF_SET: validates and sets all the fields in EXT_CSD but without setting the "partitioning completed" bit, and thus is reversible. - MMC_HWPART_CONF_COMPLETE: does everything and is thus not reversible. Signed-off-by: Diego Santa Cruz <Diego.SantaCruz@spinetix.com>
Diffstat (limited to 'include')
-rw-r--r--include/mmc.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/mmc.h b/include/mmc.h
index bcaf9f0..aacf820 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -152,6 +152,7 @@
#define EXT_CSD_GP_SIZE_MULT 143 /* R/W */
#define EXT_CSD_PARTITION_SETTING 155 /* R/W */
#define EXT_CSD_PARTITIONS_ATTRIBUTE 156 /* R/W */
+#define EXT_CSD_MAX_ENH_SIZE_MULT 157 /* R */
#define EXT_CSD_PARTITIONING_SUPPORT 160 /* RO */
#define EXT_CSD_RST_N_FUNCTION 162 /* R/W */
#define EXT_CSD_RPMB_MULT 168 /* RO */
@@ -332,6 +333,23 @@ struct mmc {
int ddr_mode;
};
+struct mmc_hwpart_conf {
+ struct {
+ uint enh_start; /* in 512-byte sectors */
+ uint enh_size; /* in 512-byte sectors, if 0 no enh area */
+ } user;
+ struct {
+ uint size; /* in 512-byte sectors */
+ int enhanced;
+ } gp_part[4];
+};
+
+enum mmc_hwpart_conf_mode {
+ MMC_HWPART_CONF_CHECK,
+ MMC_HWPART_CONF_SET,
+ MMC_HWPART_CONF_COMPLETE,
+};
+
int mmc_register(struct mmc *mmc);
struct mmc *mmc_create(const struct mmc_config *cfg, void *priv);
void mmc_destroy(struct mmc *mmc);
@@ -344,6 +362,8 @@ 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);
int board_mmc_getcd(struct mmc *mmc);
int mmc_getwp(struct mmc *mmc);