]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - include/mmc.h
mmc: add API to do eMMC hardware partitioning
[karo-tx-uboot.git] / include / mmc.h
index bcaf9f012f0891d664eb7632a530b5c97c9760a4..aacf8201910a3d187478ecc919bbc360cf3bffb8 100644 (file)
 #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);