public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: OMAP: Define use internal clock field in MMC configuration
@ 2007-05-28  1:01 Kyungmin Park
  2007-05-28  8:24 ` Trilok Soni
  0 siblings, 1 reply; 6+ messages in thread
From: Kyungmin Park @ 2007-05-28  1:01 UTC (permalink / raw)
  To: linux-omap-open-source

Hi,

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 <kyungmin.park@samsung.com>
--
diff --git a/arch/arm/mach-omap2/board-apollon.c
b/arch/arm/mach-omap2/board-apollon.c
index 1276f1f..75c9f3e 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 Interal 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 f8a341b..80d03e2 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 Interal 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 dccd62b..acc168f 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 19b93ef..d78de98 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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ARM: OMAP: Define use internal clock field in MMC configuration
  2007-05-28  1:01 [PATCH] ARM: OMAP: Define use internal clock field in MMC configuration Kyungmin Park
@ 2007-05-28  8:24 ` Trilok Soni
  2007-05-28  8:39   ` [PATCH] ARM: OMAP: Define use internal clock field in MMCconfiguration Kyungmin Park
  0 siblings, 1 reply; 6+ messages in thread
From: Trilok Soni @ 2007-05-28  8:24 UTC (permalink / raw)
  To: kmpark; +Cc: linux-omap-open-source

On 5/28/07, Kyungmin Park <kmpark@infradead.org> wrote:
> Hi,
>
> 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 <kyungmin.park@samsung.com>
> --
> diff --git a/arch/arm/mach-omap2/board-apollon.c
> b/arch/arm/mach-omap2/board-apollon.c
> index 1276f1f..75c9f3e 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 Interal loop-back in MMC/SDIO Module Input Clock selection */

Typo. s/Interal/Internal

> +               .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 f8a341b..80d03e2 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 Interal loop-back in MMC/SDIO
> +                        * Module Input Clock selection
> +                        */

Typo. s/Interal/Internal


> +                       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);
>        }


-- 
--Trilok Soni

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] ARM: OMAP: Define use internal clock field in MMCconfiguration
  2007-05-28  8:24 ` Trilok Soni
@ 2007-05-28  8:39   ` Kyungmin Park
  2007-06-05 10:26     ` Tony Lindgren
  0 siblings, 1 reply; 6+ messages in thread
From: Kyungmin Park @ 2007-05-28  8:39 UTC (permalink / raw)
  To: 'Trilok Soni'; +Cc: linux-omap-open-source

Thank you for review.
It's old typo. :)
Here's updated patch. 

Thank you,
Kyungmin Park


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 <kyungmin.park@samsung.com>
--
diff --git a/arch/arm/mach-omap2/board-apollon.c
b/arch/arm/mach-omap2/board-apollon.c
index 1276f1f..16428f6 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/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
diff --git a/arch/arm/mach-omap2/prcm_common.h
b/arch/arm/mach-omap2/prcm_common.h
diff --git a/arch/arm/plat-omap/devices.c b/arch/arm/plat-omap/devices.c
index f8a341b..ba55f4f 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 dccd62b..acc168f 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 19b93ef..d78de98 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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] ARM: OMAP: Define use internal clock field in MMCconfiguration
  2007-05-28  8:39   ` [PATCH] ARM: OMAP: Define use internal clock field in MMCconfiguration Kyungmin Park
@ 2007-06-05 10:26     ` Tony Lindgren
  2007-06-07  0:12       ` [PATCH] ARM: OMAP: Define use internal clock field inMMCconfiguration Kyungmin Park
  0 siblings, 1 reply; 6+ messages in thread
From: Tony Lindgren @ 2007-06-05 10:26 UTC (permalink / raw)
  To: Kyungmin Park; +Cc: linux-omap-open-source

* Kyungmin Park <kmpark@infradead.org> [070528 01:44]:
> Thank you for review.
> It's old typo. :)
> Here's updated patch. 

Pushing today.

> diff --git a/arch/arm/mach-omap2/board-apollon.c
> b/arch/arm/mach-omap2/board-apollon.c
> index 1276f1f..16428f6 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
> = {

Your patch was wrapped again...

Tony

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] ARM: OMAP: Define use internal clock field inMMCconfiguration
  2007-06-05 10:26     ` Tony Lindgren
@ 2007-06-07  0:12       ` Kyungmin Park
  2007-06-08 10:28         ` Tony Lindgren
  0 siblings, 1 reply; 6+ messages in thread
From: Kyungmin Park @ 2007-06-07  0:12 UTC (permalink / raw)
  To: 'Tony Lindgren'; +Cc: linux-omap-open-source

Hi, Tony

> > diff --git a/arch/arm/mach-omap2/board-apollon.c
> > b/arch/arm/mach-omap2/board-apollon.c
> > index 1276f1f..16428f6 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
> > = {
> 
> Your patch was wrapped again...

Umm, I set the Outlook configuration as suggested one.
Next time, I try to use another mail client to send the patch.

Thank you,
Kyungmin Park

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] ARM: OMAP: Define use internal clock field inMMCconfiguration
  2007-06-07  0:12       ` [PATCH] ARM: OMAP: Define use internal clock field inMMCconfiguration Kyungmin Park
@ 2007-06-08 10:28         ` Tony Lindgren
  0 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2007-06-08 10:28 UTC (permalink / raw)
  To: Kyungmin Park; +Cc: linux-omap-open-source

* Kyungmin Park <kmpark@infradead.org> [070606 17:13]:
> Hi, Tony
> 
> > > diff --git a/arch/arm/mach-omap2/board-apollon.c
> > > b/arch/arm/mach-omap2/board-apollon.c
> > > index 1276f1f..16428f6 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
> > > = {
> > 
> > Your patch was wrapped again...
> 
> Umm, I set the Outlook configuration as suggested one.
> Next time, I try to use another mail client to send the patch.

Great, it's nice to apply patches directly without any editing with
git-am :)

Tony

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-06-08 10:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-28  1:01 [PATCH] ARM: OMAP: Define use internal clock field in MMC configuration Kyungmin Park
2007-05-28  8:24 ` Trilok Soni
2007-05-28  8:39   ` [PATCH] ARM: OMAP: Define use internal clock field in MMCconfiguration Kyungmin Park
2007-06-05 10:26     ` Tony Lindgren
2007-06-07  0:12       ` [PATCH] ARM: OMAP: Define use internal clock field inMMCconfiguration Kyungmin Park
2007-06-08 10:28         ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox