summaryrefslogtreecommitdiff
path: root/drivers/mmc/spear_sdhci.c
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2013-05-07 10:09:00 -0400
committerTom Rini <trini@ti.com>2013-05-07 10:09:00 -0400
commit7e7501f4bb0d550fbc6960e7e2fb2bc84d9795cf (patch)
tree10ee78027dbf2d1e6e0d4d454c85d40ef6c7d73c /drivers/mmc/spear_sdhci.c
parent4f4eab4d14b181c3a9447c75fd2b41b9d0d761e4 (diff)
parent88227a1d8a734cfd09ac43609abec8b66c2d2610 (diff)
downloadu-boot-imx-7e7501f4bb0d550fbc6960e7e2fb2bc84d9795cf.zip
u-boot-imx-7e7501f4bb0d550fbc6960e7e2fb2bc84d9795cf.tar.gz
u-boot-imx-7e7501f4bb0d550fbc6960e7e2fb2bc84d9795cf.tar.bz2
Merge branch 'master' of git://www.denx.de/git/u-boot-mmc
Diffstat (limited to 'drivers/mmc/spear_sdhci.c')
-rw-r--r--drivers/mmc/spear_sdhci.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/mmc/spear_sdhci.c b/drivers/mmc/spear_sdhci.c
new file mode 100644
index 0000000..23f1f4b
--- /dev/null
+++ b/drivers/mmc/spear_sdhci.c
@@ -0,0 +1,44 @@
+/*
+ * (C) Copyright 2012
+ * Vipin Kumar, ST Micoelectronics, vipin.kumar@st.com.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#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;
+}