Commit adebb98ba12008021e75a2881deb424db0184770
Committed by
Pantelis Antoniou
1 parent
4520a2f28e
Exists in
master
and in
50 other branches
mmc: add Faraday FTSDC021 SDHCI controller support
Faraday FTSDC021 is a controller which is compliant with SDHCI v3.0, SDIO v2.0 and MMC v4.3. However this driver is only verified with SD memory cards. Signed-off-by: Kuo-Jung Su <dantesu@faraday-tech.com> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com> CC: Andy Fleming <afleming@gmail.com>
Showing 3 changed files with 47 additions and 0 deletions Side-by-side Diff
drivers/mmc/Makefile
... | ... | @@ -9,6 +9,7 @@ |
9 | 9 | obj-$(CONFIG_DAVINCI_MMC) += davinci_mmc.o |
10 | 10 | obj-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o |
11 | 11 | obj-$(CONFIG_FTSDC010) += ftsdc010_mci.o |
12 | +obj-$(CONFIG_FTSDC021) += ftsdc021_sdhci.o | |
12 | 13 | obj-$(CONFIG_GENERIC_MMC) += mmc.o |
13 | 14 | obj-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o |
14 | 15 | obj-$(CONFIG_MMC_SPI) += mmc_spi.o |
drivers/mmc/ftsdc021_sdhci.c
1 | +/* | |
2 | + * (C) Copyright 2013 Faraday Technology | |
3 | + * Kuo-Jung Su <dantesu@faraday-tech.com> | |
4 | + * | |
5 | + * SPDX-License-Identifier: GPL-2.0+ | |
6 | + */ | |
7 | + | |
8 | +#include <common.h> | |
9 | +#include <malloc.h> | |
10 | +#include <sdhci.h> | |
11 | + | |
12 | +#ifndef CONFIG_FTSDC021_CLOCK | |
13 | +#define CONFIG_FTSDC021_CLOCK clk_get_rate("MMC") | |
14 | +#endif | |
15 | + | |
16 | +int ftsdc021_sdhci_init(u32 regbase) | |
17 | +{ | |
18 | + struct sdhci_host *host = NULL; | |
19 | + uint32_t freq = CONFIG_FTSDC021_CLOCK; | |
20 | + | |
21 | + host = calloc(1, sizeof(struct sdhci_host)); | |
22 | + if (!host) { | |
23 | + puts("sdh_host malloc fail!\n"); | |
24 | + return 1; | |
25 | + } | |
26 | + | |
27 | + host->name = "FTSDC021"; | |
28 | + host->ioaddr = (void __iomem *)regbase; | |
29 | + host->quirks = 0; | |
30 | + add_sdhci(host, freq, 0); | |
31 | + | |
32 | + return 0; | |
33 | +} |
include/faraday/ftsdc021.h