[U-Boot] [PATCH v2 3/9] mmc: compile out more code if support for UHS and HS200 is not enabled

Jean-Jacques Hiblot jjhiblot at ti.com
Thu Jan 4 14:23:30 UTC 2018


Signed-off-by: Jean-Jacques Hiblot <jjhiblot at ti.com>

---

Changes in v2:
- compile out code for HS200 in mmc_get_capabilities()

 drivers/mmc/mmc.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 67d05c5..18d202d 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -799,9 +799,11 @@ static int mmc_set_card_speed(struct mmc *mmc, enum bus_mode mode)
 	case MMC_DDR_52:
 		speed_bits = EXT_CSD_TIMING_HS;
 		break;
+#if CONFIG_IS_ENABLED(MMC_HS200_SUPPORT)
 	case MMC_HS_200:
 		speed_bits = EXT_CSD_TIMING_HS200;
 		break;
+#endif
 	case MMC_LEGACY:
 		speed_bits = EXT_CSD_TIMING_LEGACY;
 		break;
@@ -851,10 +853,12 @@ static int mmc_get_capabilities(struct mmc *mmc)
 	cardtype = ext_csd[EXT_CSD_CARD_TYPE] & 0x3f;
 	mmc->cardtype = cardtype;
 
+#if CONFIG_IS_ENABLED(MMC_HS200_SUPPORT)
 	if (cardtype & (EXT_CSD_CARD_TYPE_HS200_1_2V |
 			EXT_CSD_CARD_TYPE_HS200_1_8V)) {
 		mmc->card_caps |= MMC_MODE_HS200;
 	}
+#endif
 	if (cardtype & EXT_CSD_CARD_TYPE_52) {
 		if (cardtype & EXT_CSD_CARD_TYPE_DDR_52)
 			mmc->card_caps |= MMC_MODE_DDR_52MHz;
@@ -1307,10 +1311,15 @@ static int sd_set_card_speed(struct mmc *mmc, enum bus_mode mode)
 
 	switch (mode) {
 	case SD_LEGACY:
-	case UHS_SDR12:
 		speed = UHS_SDR12_BUS_SPEED;
 		break;
 	case SD_HS:
+		speed = HIGH_SPEED_BUS_SPEED;
+		break;
+#if CONFIG_IS_ENABLED(MMC_UHS_SUPPORT)
+	case UHS_SDR12:
+		speed = UHS_SDR12_BUS_SPEED;
+		break;
 	case UHS_SDR25:
 		speed = UHS_SDR25_BUS_SPEED;
 		break;
@@ -1323,6 +1332,7 @@ static int sd_set_card_speed(struct mmc *mmc, enum bus_mode mode)
 	case UHS_SDR104:
 		speed = UHS_SDR104_BUS_SPEED;
 		break;
+#endif
 	default:
 		return -EINVAL;
 	}
-- 
1.9.1



More information about the U-Boot mailing list