Browse Source

mmc: make optional the support for eMMC hardware partitioning

Not all boards have an eMMC and not all users have a need for this.
Allow to compile it out. By default it is still included.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Jean-Jacques Hiblot 7 years ago
parent
commit
cf17789e07
3 changed files with 13 additions and 0 deletions
  1. 4 0
      cmd/mmc.c
  2. 7 0
      drivers/mmc/Kconfig
  3. 2 0
      drivers/mmc/mmc.c

+ 4 - 0
cmd/mmc.c

@@ -438,6 +438,7 @@ static int do_mmc_list(cmd_tbl_t *cmdtp, int flag,
 	return CMD_RET_SUCCESS;
 	return CMD_RET_SUCCESS;
 }
 }
 
 
+#if CONFIG_IS_ENABLED(MMC_HW_PARTITIONING)
 static int parse_hwpart_user(struct mmc_hwpart_conf *pconf,
 static int parse_hwpart_user(struct mmc_hwpart_conf *pconf,
 			     int argc, char * const argv[])
 			     int argc, char * const argv[])
 {
 {
@@ -587,6 +588,7 @@ static int do_mmc_hwpartition(cmd_tbl_t *cmdtp, int flag,
 		return CMD_RET_FAILURE;
 		return CMD_RET_FAILURE;
 	}
 	}
 }
 }
+#endif
 
 
 #ifdef CONFIG_SUPPORT_EMMC_BOOT
 #ifdef CONFIG_SUPPORT_EMMC_BOOT
 static int do_mmc_bootbus(cmd_tbl_t *cmdtp, int flag,
 static int do_mmc_bootbus(cmd_tbl_t *cmdtp, int flag,
@@ -796,7 +798,9 @@ static cmd_tbl_t cmd_mmc[] = {
 	U_BOOT_CMD_MKENT(part, 1, 1, do_mmc_part, "", ""),
 	U_BOOT_CMD_MKENT(part, 1, 1, do_mmc_part, "", ""),
 	U_BOOT_CMD_MKENT(dev, 3, 0, do_mmc_dev, "", ""),
 	U_BOOT_CMD_MKENT(dev, 3, 0, do_mmc_dev, "", ""),
 	U_BOOT_CMD_MKENT(list, 1, 1, do_mmc_list, "", ""),
 	U_BOOT_CMD_MKENT(list, 1, 1, do_mmc_list, "", ""),
+#if CONFIG_IS_ENABLED(MMC_HW_PARTITIONING)
 	U_BOOT_CMD_MKENT(hwpartition, 28, 0, do_mmc_hwpartition, "", ""),
 	U_BOOT_CMD_MKENT(hwpartition, 28, 0, do_mmc_hwpartition, "", ""),
+#endif
 #ifdef CONFIG_SUPPORT_EMMC_BOOT
 #ifdef CONFIG_SUPPORT_EMMC_BOOT
 	U_BOOT_CMD_MKENT(bootbus, 5, 0, do_mmc_bootbus, "", ""),
 	U_BOOT_CMD_MKENT(bootbus, 5, 0, do_mmc_bootbus, "", ""),
 	U_BOOT_CMD_MKENT(bootpart-resize, 4, 0, do_mmc_boot_resize, "", ""),
 	U_BOOT_CMD_MKENT(bootpart-resize, 4, 0, do_mmc_boot_resize, "", ""),

+ 7 - 0
drivers/mmc/Kconfig

@@ -51,6 +51,13 @@ config MMC_QUIRKS
 	  are enabled by default, other may require additionnal flags or are
 	  are enabled by default, other may require additionnal flags or are
 	  enabled by the host driver.
 	  enabled by the host driver.
 
 
+config MMC_HW_PARTITIONING
+	bool "Support for HW partitioning command(eMMC)"
+	default y
+	help
+	  This adds a command and an API to do hardware partitioning on eMMC
+	  devices.
+
 config MMC_IO_VOLTAGE
 config MMC_IO_VOLTAGE
 	bool "Support IO voltage configuration"
 	bool "Support IO voltage configuration"
 	help
 	help

+ 2 - 0
drivers/mmc/mmc.c

@@ -950,6 +950,7 @@ int mmc_switch_part(struct mmc *mmc, unsigned int part_num)
 	return ret;
 	return ret;
 }
 }
 
 
+#if CONFIG_IS_ENABLED(MMC_HW_PARTITIONING)
 int mmc_hwpart_config(struct mmc *mmc,
 int mmc_hwpart_config(struct mmc *mmc,
 		      const struct mmc_hwpart_conf *conf,
 		      const struct mmc_hwpart_conf *conf,
 		      enum mmc_hwpart_conf_mode mode)
 		      enum mmc_hwpart_conf_mode mode)
@@ -1143,6 +1144,7 @@ int mmc_hwpart_config(struct mmc *mmc,
 
 
 	return 0;
 	return 0;
 }
 }
+#endif
 
 
 #if !CONFIG_IS_ENABLED(DM_MMC)
 #if !CONFIG_IS_ENABLED(DM_MMC)
 int mmc_getcd(struct mmc *mmc)
 int mmc_getcd(struct mmc *mmc)