]> git.sur5r.net Git - u-boot/blobdiff - drivers/mmc/mmc-uclass.c
Merge git://git.denx.de/u-boot-socfpga
[u-boot] / drivers / mmc / mmc-uclass.c
index bfda942d46d4c3a22f1d1ebfe06f78e001196834..a3536b15ae677596c403b01e8a805d0f6df65061 100644 (file)
@@ -63,6 +63,7 @@ void mmc_send_init_stream(struct mmc *mmc)
        dm_mmc_send_init_stream(mmc->dev);
 }
 
+#if CONFIG_IS_ENABLED(MMC_UHS_SUPPORT)
 int dm_mmc_wait_dat0(struct udevice *dev, int state, int timeout)
 {
        struct dm_mmc_ops *ops = mmc_get_ops(dev);
@@ -76,6 +77,7 @@ int mmc_wait_dat0(struct mmc *mmc, int state, int timeout)
 {
        return dm_mmc_wait_dat0(mmc->dev, state, timeout);
 }
+#endif
 
 int dm_mmc_get_wp(struct udevice *dev)
 {
@@ -105,6 +107,7 @@ int mmc_getcd(struct mmc *mmc)
        return dm_mmc_get_cd(mmc->dev);
 }
 
+#ifdef MMC_SUPPORTS_TUNING
 int dm_mmc_execute_tuning(struct udevice *dev, uint opcode)
 {
        struct dm_mmc_ops *ops = mmc_get_ops(dev);
@@ -118,6 +121,7 @@ int mmc_execute_tuning(struct mmc *mmc, uint opcode)
 {
        return dm_mmc_execute_tuning(mmc->dev, opcode);
 }
+#endif
 
 int mmc_of_parse(struct udevice *dev, struct mmc_config *cfg)
 {
@@ -136,13 +140,12 @@ int mmc_of_parse(struct udevice *dev, struct mmc_config *cfg)
                cfg->host_caps |= MMC_MODE_1BIT;
                break;
        default:
-               debug("warning: %s invalid bus-width property. using 1-bit\n",
-                     dev_read_name(dev));
-               cfg->host_caps |= MMC_MODE_1BIT;
-               break;
+               dev_err(dev, "Invalid \"bus-width\" value %u!\n", val);
+               return -EINVAL;
        }
 
-       cfg->f_max = dev_read_u32_default(dev, "max-frequency", 52000000);
+       /* f_max is obtained from the optional "max-frequency" property */
+       dev_read_u32(dev, "max-frequency", &cfg->f_max);
 
        if (dev_read_bool(dev, "cap-sd-highspeed"))
                cfg->host_caps |= MMC_CAP(SD_HS);
@@ -366,7 +369,7 @@ static int mmc_blk_probe(struct udevice *dev)
 
 static const struct blk_ops mmc_blk_ops = {
        .read   = mmc_bread,
-#ifndef CONFIG_SPL_BUILD
+#if CONFIG_IS_ENABLED(MMC_WRITE)
        .write  = mmc_bwrite,
        .erase  = mmc_berase,
 #endif