* [RFC 5/5] MMC/SD Controller driver for OMAP2430
@ 2007-07-26 0:19 Syed Mohammed, Khasim
2007-08-16 2:24 ` David Brownell
0 siblings, 1 reply; 2+ messages in thread
From: Syed Mohammed, Khasim @ 2007-07-26 0:19 UTC (permalink / raw)
To: linux-omap-open-source
plat-omap/device.c updated to support OMAP2430 MMC controller.
Regards,
Khasim
===========================================================================
diff -purN linux-omap/arch/arm/plat-omap/devices.c lin_for_mmc/arch/arm/plat-omap/devices.c
--- linux-omap/arch/arm/plat-omap/devices.c 2007-07-11 09:55:17.000000000 -0500
+++ lin_for_mmc/arch/arm/plat-omap/devices.c 2007-07-24 00:59:14.000000000 -0500
@@ -19,6 +19,7 @@
#include <asm/mach-types.h>
#include <asm/mach/map.h>
+#include <asm/arch/mmc.h>
#include <asm/arch/tc.h>
#include <asm/arch/board.h>
#include <asm/arch/mux.h>
@@ -231,7 +232,11 @@ static inline void omap_init_kp(void) {}
#endif
#define OMAP_MMC2_BASE 0xfffb7c00 /* omap16xx only */
+#if defined(CONFIG_ARCH_OMAP2430)
+static struct omap_mmc_platform_data mmc1_conf;
+#else
static struct omap_mmc_conf mmc1_conf;
+#endif
static u64 mmc1_dmamask = 0xffffffff;
@@ -294,10 +299,18 @@ static void __init omap_init_mmc(void)
const struct omap_mmc_config *mmc_conf;
const struct omap_mmc_conf *mmc;
- /* REVISIT: 2430 has HS MMC */
- if (cpu_is_omap2430() || cpu_is_omap34xx())
+ /* REVISIT: 3430 HS MMC is TBD */
+ if (cpu_is_omap34xx())
return;
+#if defined(CONFIG_ARCH_OMAP2430)
+ if (cpu_is_omap243x()) {
+ if (mmc1_conf.enabled){
+ (void) platform_device_register(&mmc_omap_device1);
+ }
+ return;
+ }
+#else
/* NOTE: assumes MMC was never (wrongly) enabled */
mmc_conf = omap_get_config(OMAP_TAG_MMC, struct omap_mmc_config);
if (!mmc_conf)
@@ -306,7 +319,7 @@ static void __init omap_init_mmc(void)
/* block 1 is always available and has just one pinout option */
mmc = &mmc_conf->mmc[0];
if (mmc->enabled) {
- if (cpu_is_omap24xx()) {
+ if (cpu_is_omap242x()) {
omap_cfg_reg(H18_24XX_MMC_CMD);
omap_cfg_reg(H15_24XX_MMC_CLKI);
omap_cfg_reg(G19_24XX_MMC_CLKO);
@@ -324,7 +337,7 @@ static void __init omap_init_mmc(void)
}
}
if (mmc->wire4) {
- if (cpu_is_omap24xx()) {
+ if (cpu_is_omap242x()) {
omap_cfg_reg(H14_24XX_MMC_DAT1);
omap_cfg_reg(E19_24XX_MMC_DAT2);
omap_cfg_reg(D19_24XX_MMC_DAT3);
@@ -344,7 +357,7 @@ static void __init omap_init_mmc(void)
* Use internal loop-back in MMC/SDIO
* Module Input Clock selection
*/
- if (cpu_is_omap24xx()) {
+ if (cpu_is_omap242x()) {
u32 v = omap_readl(OMAP24XX_CONTROL_DEVCONF);
v |= (1 << 24);
omap_writel(v, OMAP24XX_CONTROL_DEVCONF);
@@ -353,6 +366,7 @@ static void __init omap_init_mmc(void)
mmc1_conf = *mmc;
(void) platform_device_register(&mmc_omap_device1);
}
+#endif
#ifdef CONFIG_ARCH_OMAP16XX
/* block 2 is on newer chips, and has many pinout options */
@@ -385,8 +399,27 @@ static void __init omap_init_mmc(void)
#endif
return;
}
+
+void omap_set_mmc_info(int host, const struct omap_mmc_platform_data *info)
+{
+ switch (host) {
+ case 1:
+ mmc1_conf = *info;
+ break;
+#ifdef CONFIG_ARCH_OMAP16XX
+ case 2:
+ mmc2_conf = *info;
+ break;
+#endif
+ default:
+ BUG();
+ }
+}
#else
static inline void omap_init_mmc(void) {}
+void omap_set_mmc_info(int host, const struct omap_mmc_platform_data *info)
+{
+}
#endif
/*-------------------------------------------------------------------------*/
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [RFC 5/5] MMC/SD Controller driver for OMAP2430
2007-07-26 0:19 [RFC 5/5] MMC/SD Controller driver for OMAP2430 Syed Mohammed, Khasim
@ 2007-08-16 2:24 ` David Brownell
0 siblings, 0 replies; 2+ messages in thread
From: David Brownell @ 2007-08-16 2:24 UTC (permalink / raw)
To: Syed Mohammed, Khasim; +Cc: linux-omap-open-source
On Wednesday 25 July 2007, Syed Mohammed, Khasim wrote:
> +void omap_set_mmc_info(int host, const struct omap_mmc_platform_data *info)
This should already have been merged into the tree, right?
The N800 board support needs it. And it's impossible to
configure e.g. an H4/2420 with complete MMC support without
extensions like those in "struct omap_mmc_platform_data" ...
although even then, that struct doesn't seem to directly
accomodate things like card detect IRQs through menelaus.
- Dave
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-08-16 2:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-26 0:19 [RFC 5/5] MMC/SD Controller driver for OMAP2430 Syed Mohammed, Khasim
2007-08-16 2:24 ` David Brownell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox