aboutsummaryrefslogtreecommitdiffstats
path: root/roms/u-boot/drivers/mmc/spear_sdhci.c
diff options
context:
space:
mode:
Diffstat (limited to 'roms/u-boot/drivers/mmc/spear_sdhci.c')
-rw-r--r--roms/u-boot/drivers/mmc/spear_sdhci.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/roms/u-boot/drivers/mmc/spear_sdhci.c b/roms/u-boot/drivers/mmc/spear_sdhci.c
new file mode 100644
index 00000000..6ca96a2d
--- /dev/null
+++ b/roms/u-boot/drivers/mmc/spear_sdhci.c
@@ -0,0 +1,32 @@
+/*
+ * (C) Copyright 2012
+ * Vipin Kumar, ST Micoelectronics, vipin.kumar@st.com.
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+#include <malloc.h>
+#include <sdhci.h>
+
+int spear_sdhci_init(u32 regbase, u32 max_clk, u32 min_clk, u32 quirks)
+{
+ struct sdhci_host *host = NULL;
+ host = (struct sdhci_host *)malloc(sizeof(struct sdhci_host));
+ if (!host) {
+ printf("sdhci host malloc fail!\n");
+ return 1;
+ }
+
+ host->name = "sdhci";
+ host->ioaddr = (void *)regbase;
+ host->quirks = quirks;
+
+ if (quirks & SDHCI_QUIRK_REG32_RW)
+ host->version = sdhci_readl(host, SDHCI_HOST_VERSION - 2) >> 16;
+ else
+ host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
+
+ add_sdhci(host, max_clk, min_clk);
+ return 0;
+}