From 4c7db25c2548fa34fd2458bc9f8b20db09ea2ad9 Mon Sep 17 00:00:00 2001 From: Kyungmin Park Date: Tue, 5 Jun 2007 03:25:32 -0700 Subject: [PATCH] ARM: OMAP: Define use internal clock field in MMCconfiguration With the recent omap24xx register cleanup, the CONTROL_DEVCONF is only defined at arch/arm/mach-omap2/pm.c. So define 24XX_CONTROL_DEVCONF and use internal clock field in MMC configuration. I think it's the proper place to set mmc clock instead of board-specific one. Signed-off-by: Kyungmin Park -- b/arch/arm/mach-omap2/board-apollon.c Signed-off-by: Tony Lindgren --- arch/arm/mach-omap2/board-apollon.c | 5 ++--- arch/arm/plat-omap/devices.c | 11 +++++++++++ include/asm-arm/arch-omap/board.h | 2 ++ include/asm-arm/arch-omap/omap24xx.h | 1 + 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index 1276f1f4473..16428f62902 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c @@ -251,6 +251,8 @@ static struct omap_mmc_config apollon_mmc_config __initdata = { .mmc [0] = { .enabled = 1, .wire4 = 1, + /* Use internal loop-back in MMC/SDIO Module Input Clock selection */ + .internal_clock = 1, .wp_pin = -1, .power_pin = -1, /* Note: If you want to detect card feature, please assign 37 */ @@ -311,9 +313,6 @@ static void __init omap_apollon_init(void) apollon_flash_init(); apollon_usb_init(); - /* Use Interal loop-back in MMC/SDIO Module Input Clock selection */ - CONTROL_DEVCONF |= (1 << 24); - /* * Make sure the serial ports are muxed on at this point. * You have to mux them off in device drivers later on diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c index f8a341bdb9d..ba55f4f449c 100644 --- a/arch/arm/plat-omap/devices.c +++ b/arch/arm/plat-omap/devices.c @@ -339,6 +339,17 @@ static void __init omap_init_mmc(void) omap_cfg_reg(MMC_DAT3); } } + if (mmc->internal_clock) { + /* + * Use internal loop-back in MMC/SDIO + * Module Input Clock selection + */ + if (cpu_is_omap24xx()) { + u32 v = omap_readl(OMAP24XX_CONTROL_DEVCONF); + v |= (1 << 24); + omap_writel(v, OMAP24XX_CONTROL_DEVCONF); + } + } mmc1_conf = *mmc; (void) platform_device_register(&mmc_omap_device1); } diff --git a/include/asm-arm/arch-omap/board.h b/include/asm-arm/arch-omap/board.h index dccd62bb5e1..acc168fede2 100644 --- a/include/asm-arm/arch-omap/board.h +++ b/include/asm-arm/arch-omap/board.h @@ -48,6 +48,8 @@ struct omap_mmc_conf { unsigned cover:1; /* 4 wire signaling is optional, and is only used for SD/SDIO */ unsigned wire4:1; + /* use the internal clock */ + unsigned internal_clock:1; s16 power_pin; s16 switch_pin; s16 wp_pin; diff --git a/include/asm-arm/arch-omap/omap24xx.h b/include/asm-arm/arch-omap/omap24xx.h index 19b93efae93..d78de98e0d9 100644 --- a/include/asm-arm/arch-omap/omap24xx.h +++ b/include/asm-arm/arch-omap/omap24xx.h @@ -16,6 +16,7 @@ #define OMAP24XX_IVA_INTC_BASE 0x40000000 #define IRQ_SIR_IRQ 0x0040 +#define OMAP24XX_CONTROL_DEVCONF (L4_24XX_BASE + 0x274) #define OMAP24XX_CONTROL_STATUS (L4_24XX_BASE + 0x2f8) #define OMAP2420_CTRL_BASE L4_24XX_BASE -- 2.41.1