summaryrefslogtreecommitdiff
path: root/drivers/mmc/mmc_legacy.c
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut@gmail.com>2018-04-15 01:37:11 +0300
committerTom Rini <trini@konsulko.com>2018-05-13 14:57:32 +0300
commit62d77cea31216cad526e5f45c88e8377efc6fcae (patch)
tree1a58e37a02b40d04b4a917ae78068dd74e5d6ffd /drivers/mmc/mmc_legacy.c
parent9a66328a37e3b31dbe646ef3668b60466e8abd9a (diff)
downloadu-boot-62d77cea31216cad526e5f45c88e8377efc6fcae.tar.xz
mmc: Improve tinification
Drop all the extra content from the MMC core, so that tiny MMC support is really tiny, no fancy anything. That means the tiny MMC support does only 1-bit transfers at default speed settings. Moreover, this patch drops duplicate instance of struct mmc mmc_static, which wasted about 360 bytes. Furthermore, since MMC tiny supports only one controller at all times, get rid of mallocating the ext csd backup and replace it with static array. All in all, this patch saves ~4 kiB of bloat from the MMC core, which on platforms with severe limitations can be beneficial. Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Cc: Jaehoon Chung <jh80.chung@samsung.com> [trini: Fixup checkpatch.pl style warnings] Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'drivers/mmc/mmc_legacy.c')
-rw-r--r--drivers/mmc/mmc_legacy.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/mmc/mmc_legacy.c b/drivers/mmc/mmc_legacy.c
index 6c8b50830f..66a7cda440 100644
--- a/drivers/mmc/mmc_legacy.c
+++ b/drivers/mmc/mmc_legacy.c
@@ -12,7 +12,28 @@
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;