]> git.sur5r.net Git - u-boot/blobdiff - drivers/mmc/mmc_legacy.c
Merge branch 'master' of git://git.denx.de/u-boot-spi
[u-boot] / drivers / mmc / mmc_legacy.c
index bdf9d984ddfb643022d2032e574d04297922b26a..66a7cda440cd9f1dec0530f8bc58a5af616610e0 100644 (file)
@@ -1,8 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2016 Google, Inc
  * Written by Simon Glass <sjg@chromium.org>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
 static struct list_head mmc_devices;
 static int cur_dev_num = -1;
 
-#if !CONFIG_IS_ENABLED(MMC_TINY)
+#if CONFIG_IS_ENABLED(MMC_TINY)
+static struct mmc mmc_static;
+struct mmc *find_mmc_device(int dev_num)
+{
+       return &mmc_static;
+}
+
+void mmc_do_preinit(void)
+{
+       struct mmc *m = &mmc_static;
+#ifdef CONFIG_FSL_ESDHC_ADAPTER_IDENT
+       mmc_set_preinit(m, 1);
+#endif
+       if (m->preinit)
+               mmc_start_init(m);
+}
+
+struct blk_desc *mmc_get_blk_desc(struct mmc *mmc)
+{
+       return &mmc->block_dev;
+}
+#else
 struct mmc *find_mmc_device(int dev_num)
 {
        struct mmc *m;
@@ -150,7 +170,7 @@ struct mmc *mmc_create(const struct mmc_config *cfg, void *priv)
            cfg->f_max == 0 || cfg->b_max == 0)
                return NULL;
 
-#ifndef CONFIG_DM_MMC_OPS
+#if !CONFIG_IS_ENABLED(DM_MMC)
        if (cfg->ops == NULL || cfg->ops->send_cmd == NULL)
                return NULL;
 #endif