summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Kilb <J.Kilb@phytec.de>2011-09-09 14:10:54 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2011-09-12 12:31:08 +0200
commitb9126db43ffc30d86c53cb19c2f56920cd33f855 (patch)
treedeaa3a0b3a18329e5c9e5faaf18a1ace9928f54e
parent9c2a52539828710fa239b9d772c3d3538a87355d (diff)
downloadbarebox-b9126db43ffc30d86c53cb19c2f56920cd33f855.tar.gz
barebox-b9126db43ffc30d86c53cb19c2f56920cd33f855.tar.xz
Add omap_hsmmc platform data.
Add platform data to specify maximum frequency of hsmmc interface which can be restricted due to external level shifters. Signed-off-by: Juergen Kilb <J.Kilb@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/mach-omap/include/mach/omap_hsmmc.h28
-rw-r--r--drivers/mci/omap_hsmmc.c10
2 files changed, 37 insertions, 1 deletions
diff --git a/arch/arm/mach-omap/include/mach/omap_hsmmc.h b/arch/arm/mach-omap/include/mach/omap_hsmmc.h
new file mode 100644
index 0000000000..a15f8e62a2
--- /dev/null
+++ b/arch/arm/mach-omap/include/mach/omap_hsmmc.h
@@ -0,0 +1,28 @@
+/**
+ * @file
+ * @brief This file contains exported structure for OMAP hsmmc
+ *
+ * FileName: include/asm-arm/arch-omap/omap_hsmmc.h
+ *
+ * OMAP3 and OMAP4 has a MMC/SD controller embedded.
+ * This file provides the platform data structure required to
+ * addapt to platform specialities.
+ */
+/*
+ * (C) Copyright 2011
+ * Phytec Messtechnik GmbH, <www.phytec.de>
+ * Juergen Kilb <j.kilb@phytec.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __ASM_OMAP_HSMMC_H
+#define __ASM_OMAP_HSMMC_H
+
+/** omapmmc platform data structure */
+struct omap_hsmmc_platform_data {
+ unsigned f_max; /* host interface upper limit */
+};
+#endif /* __ASM_OMAP_HSMMC_H */
diff --git a/drivers/mci/omap_hsmmc.c b/drivers/mci/omap_hsmmc.c
index 5fdf445c70..bf8d4a9796 100644
--- a/drivers/mci/omap_hsmmc.c
+++ b/drivers/mci/omap_hsmmc.c
@@ -31,6 +31,8 @@
#include <errno.h>
#include <asm/io.h>
+#include <mach/omap_hsmmc.h>
+
struct hsmmc {
unsigned char res1[0x10];
unsigned int sysconfig; /* 0x10 */
@@ -549,6 +551,7 @@ static void mmc_set_ios(struct mci_host *mci, struct device_d *dev,
static int omap_mmc_probe(struct device_d *dev)
{
struct omap_hsmmc *hsmmc;
+ struct omap_hsmmc_platform_data *pdata;
hsmmc = xzalloc(sizeof(*hsmmc));
@@ -564,7 +567,12 @@ static int omap_mmc_probe(struct device_d *dev)
hsmmc->mci.voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
hsmmc->mci.f_min = 400000;
- hsmmc->mci.f_max = 52000000;
+
+ pdata = (struct omap_hsmmc_platform_data *)dev->platform_data;
+ if (pdata->f_max)
+ hsmmc->mci.f_max = pdata->f_max;
+ else
+ hsmmc->mci.f_max = 52000000;
mci_register(&hsmmc->mci);