ARM: OMAP: Implement support for two MMC slots
Subsystems (3)
PATCH 1/1 ARM: OMAP: Implement support for two MMC slots
Hi,
Here's a patch for review. It is by no means complete yet, but at least supporting two slots connected to Menelaus does work.
I'd also appreciate patches implementing support for omap_mmc_platform_data for the various board-*.c files
Cheers,
Juha
diff-tree 464698d02cea1aae47d88a4fd99fa45f090473f9 (from 6ec81c783e6fe46d02ab2b6d9924ab0788a55e26)
Author: Juha Yrjola <[email protected]> Date: Mon Jun 19 19:52:52 2006 +0300
ARM: OMAP: Implement support for two MMC slots
On OMAP2 boards that use Menelaus, two MMC/SD cards can be connected through one set of pins from OMAP to two different slots behind Menelaus. Switching which slot is to be accessed is done using a GPIO line.
The MMC driver is now also closer to the way other ARM platforms (e.g. PXA) handles board-specific MMC data. It uses function pointers for powering the card and checking the state of the SD read-only switch, among other things.
arch/arm/plat-omap/devices.c +33 -19
@@ -25,6 +25,7 @@ #include <asm/arch/board.h>#include <asm/arch/mux.h> #include <asm/arch/gpio.h> #include <asm/arch/menelaus.h> +#include <asm/arch/mmc.h> #if defined(CONFIG_I2C_OMAP ) || defined(CONFIG_I2C_OMAP_MODULE )
@@ -156,7 +157,7 @@ #define OMAP_MMC1_INT INT_MMC#endif #define OMAP_MMC2_BASE 0xfffb7c00/* omap16xx only */ -static struct omap_mmc_conf mmc1_conf; +static struct omap_mmc_platform_data mmc1_conf;static u64 mmc1_dmamask =0xffffffff ;
@@ -185,7 +186,7 @@ static struct platform_device mmc_omap_d#ifdef CONFIG_ARCH_OMAP16XX -static struct omap_mmc_conf mmc2_conf; +static struct omap_mmc_platform_data mmc2_conf;static u64 mmc2_dmamask =0xffffffff ;
@@ -211,21 +212,16 @@ static struct platform_device mmc_omap_d .num_resources = ARRAY_SIZE(mmc2_resources), .resource = mmc2_resources, }; +#endif static void __init omap_init_mmc (void ) { -const struct omap_mmc_config *mmc_conf; -const struct omap_mmc_conf *mmc; - -/* NOTE: assumes MMC was never (wrongly) enabled */ - mmc_conf = omap_get_config(OMAP_TAG_MMC, struct omap_mmc_config); -if (!mmc_conf) -return ; +struct omap_mmc_platform_data *conf;/* block 1 is always available and has just one pinout option */ - mmc = &mmc_conf->mmc[0 ]; -if (mmc->enabled) { + conf = &mmc1_conf; +if (conf->enabled) {if (!cpu_is_omap24xx ()) {omap_cfg_reg (MMC_CMD );omap_cfg_reg (MMC_CLK );
@@ -236,29 +232,28 @@ static void __init omap_init_mmc(void)omap_cfg_reg (P20_1710_MMC_DATDIR0 ); } } -if (mmc->wire4) { +if (conf->wire4) {if (!cpu_is_omap24xx ()) {omap_cfg_reg (MMC_DAT1 );/* NOTE: DAT2 can be on W10 (here) or M15 */ -if (!mmc->nomux) +if (!conf->nomux)omap_cfg_reg (MMC_DAT2 );omap_cfg_reg (MMC_DAT3 ); } } - mmc1_conf = *mmc; (void )platform_device_register (&mmc_omap_device1); }#ifdef CONFIG_ARCH_OMAP16XX /* block 2 is on newer chips, and has many pinout options */ - mmc = &mmc_conf->mmc[1 ]; -if (mmc->enabled) { -if (!mmc->nomux) { + conf = &mmc2_conf; +if (conf->enabled) { +if (!conf->nomux) {omap_cfg_reg (Y8_1610_MMC2_CMD );omap_cfg_reg (Y10_1610_MMC2_CLK );omap_cfg_reg (R18_1610_MMC2_CLKIN );omap_cfg_reg (W8_1610_MMC2_DAT0 ); -if (mmc->wire4) { +if (conf->wire4) {omap_cfg_reg (V8_1610_MMC2_DAT1 );omap_cfg_reg (W15_1610_MMC2_DAT2 );omap_cfg_reg (R10_1610_MMC2_DAT3 );
@@ -274,14 +269,33 @@ #ifdef CONFIG_ARCH_OMAP16XXif (cpu_is_omap1710 ())omap_writel (omap_readl (MOD_CONF_CTRL_1 ) | (1 <<24 ),MOD_CONF_CTRL_1 ); - mmc2_conf = *mmc; (void )platform_device_register (&mmc_omap_device2); }#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 /*-------------------------------------------------------------------------*/
drivers/mmc/omap.c +287 -230
738 lines not on this page · raw message
include/asm-arm/arch-omap/mmc.h new file +65 -0
65 lines not on this page · raw message
Hi,
Quoted 4 lines · Juha Yrjölä
Hi,
Here's a patch for review. It is by no means complete yet, but at least supporting two slots connected to Menelaus does work.
Nice to have the board-*.c MMC power clean-up done!
Quoted 2 lines
I'd also appreciate patches implementing support for
omap_mmc_platform_datafor the various board-*.c files
Let's wait until we have 2.6.17-omap1 ready and tagged before pushing this.
Tony