All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [RFC] OMAP3: make TWL4030 optional for MMC driver
@ 2009-08-27 13:24 Matthias Ludwig
  2009-08-27 13:42 ` Tom
  0 siblings, 1 reply; 6+ messages in thread
From: Matthias Ludwig @ 2009-08-27 13:24 UTC (permalink / raw)
  To: u-boot

Upcoming boards may power MMC card themself without using
TWL4030, so make it optional by using define CONFIG_TWL4030_MMC.

Enable this for all existing OMAP3 boards.

Signed-off-by: Matthias Ludwig <mludwig@ultratronik.de>
---

Current OMAP3 MMC driver does require TWL4030 support to
be enabled as all OMAP3 boards are using this chip. I'd like
to push patches for a new board which does not has a TWL4030
and is caring about MMC power by itself.

So, my suggestion is to make the TWL4030 dependency optional.
Are there better ways to to this can using a new define
CONFIG_TWL4030_MMC?

 drivers/mmc/omap3_mmc.c         |    4 ++++
 include/configs/omap3_beagle.h  |    1 +
 include/configs/omap3_evm.h     |    1 +
 include/configs/omap3_overo.h   |    1 +
 include/configs/omap3_pandora.h |    1 +
 include/configs/omap3_zoom1.h   |    1 +
 include/configs/omap3_zoom2.h   |    1 +
 7 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/omap3_mmc.c b/drivers/mmc/omap3_mmc.c
index 9e09434..0ed88cb 100644
--- a/drivers/mmc/omap3_mmc.c
+++ b/drivers/mmc/omap3_mmc.c
@@ -27,8 +27,10 @@
 #include <fat.h>
 #include <mmc.h>
 #include <part.h>
+#ifdef CONFIG_TWL4030_MMC
 #include <i2c.h>
 #include <twl4030.h>
+#endif
 #include <asm/io.h>
 #include <asm/arch/mmc.h>
 
@@ -63,7 +65,9 @@ unsigned char mmc_board_init(void)
 {
 	t2_t *t2_base = (t2_t *)T2_BASE;
 
+#ifdef CONFIG_TWL4030_MMC
 	twl4030_power_mmc_init();
+#endif
 
 	writel(readl(&t2_base->pbias_lite) | PBIASLITEPWRDNZ1 |
 		PBIASSPEEDCTRL0 | PBIASLITEPWRDNZ0,
diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 61629f8..e1cb759 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -132,6 +132,7 @@
 /*
  * TWL4030
  */
+#define CONFIG_TWL4030_MMC		1
 #define CONFIG_TWL4030_POWER		1
 #define CONFIG_TWL4030_LED		1
 
diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
index 9f0f34b..b3c64a8 100644
--- a/include/configs/omap3_evm.h
+++ b/include/configs/omap3_evm.h
@@ -130,6 +130,7 @@
 /*
  * TWL4030
  */
+#define CONFIG_TWL4030_MMC		1
 #define CONFIG_TWL4030_POWER		1
 
 /*
diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h
index 07a031b..983832d 100644
--- a/include/configs/omap3_overo.h
+++ b/include/configs/omap3_overo.h
@@ -118,6 +118,7 @@
 /*
  * TWL4030
  */
+#define CONFIG_TWL4030_MMC		1
 #define CONFIG_TWL4030_POWER		1
 #define CONFIG_TWL4030_LED		1
 
diff --git a/include/configs/omap3_pandora.h b/include/configs/omap3_pandora.h
index 1cfd7e9..0d87c71 100644
--- a/include/configs/omap3_pandora.h
+++ b/include/configs/omap3_pandora.h
@@ -121,6 +121,7 @@
 /*
  * TWL4030
  */
+#define CONFIG_TWL4030_MMC		1
 #define CONFIG_TWL4030_POWER		1
 #define CONFIG_TWL4030_LED		1
 
diff --git a/include/configs/omap3_zoom1.h b/include/configs/omap3_zoom1.h
index 61a41e7..1140052 100644
--- a/include/configs/omap3_zoom1.h
+++ b/include/configs/omap3_zoom1.h
@@ -128,6 +128,7 @@
 /*
  * TWL4030
  */
+#define CONFIG_TWL4030_MMC		1
 #define CONFIG_TWL4030_POWER		1
 #define CONFIG_TWL4030_LED		1
 
diff --git a/include/configs/omap3_zoom2.h b/include/configs/omap3_zoom2.h
index 03f92f5..40add99 100644
--- a/include/configs/omap3_zoom2.h
+++ b/include/configs/omap3_zoom2.h
@@ -149,6 +149,7 @@
 /*
  * TWL4030
  */
+#define CONFIG_TWL4030_MMC		1
 #define CONFIG_TWL4030_POWER		1
 #define CONFIG_TWL4030_LED		1
 
-- 
1.6.2.5

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

* [U-Boot] [RFC] OMAP3: make TWL4030 optional for MMC driver
  2009-08-27 13:24 [U-Boot] [RFC] OMAP3: make TWL4030 optional for MMC driver Matthias Ludwig
@ 2009-08-27 13:42 ` Tom
  2009-08-27 14:07   ` Dirk Behme
  0 siblings, 1 reply; 6+ messages in thread
From: Tom @ 2009-08-27 13:42 UTC (permalink / raw)
  To: u-boot

Maybe it would be better if the power_init function was removed from the 
common file and moved to the individual board files.  What do you think ?
Tom


Matthias Ludwig wrote:
> Upcoming boards may power MMC card themself without using
> TWL4030, so make it optional by using define CONFIG_TWL4030_MMC.
>
> Enable this for all existing OMAP3 boards.
>
> Signed-off-by: Matthias Ludwig <mludwig@ultratronik.de>
> ---
>
> Current OMAP3 MMC driver does require TWL4030 support to
> be enabled as all OMAP3 boards are using this chip. I'd like
> to push patches for a new board which does not has a TWL4030
> and is caring about MMC power by itself.
>
> So, my suggestion is to make the TWL4030 dependency optional.
> Are there better ways to to this can using a new define
> CONFIG_TWL4030_MMC?
>
>  drivers/mmc/omap3_mmc.c         |    4 ++++
>  include/configs/omap3_beagle.h  |    1 +
>  include/configs/omap3_evm.h     |    1 +
>  include/configs/omap3_overo.h   |    1 +
>  include/configs/omap3_pandora.h |    1 +
>  include/configs/omap3_zoom1.h   |    1 +
>  include/configs/omap3_zoom2.h   |    1 +
>  7 files changed, 10 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mmc/omap3_mmc.c b/drivers/mmc/omap3_mmc.c
> index 9e09434..0ed88cb 100644
> --- a/drivers/mmc/omap3_mmc.c
> +++ b/drivers/mmc/omap3_mmc.c
> @@ -27,8 +27,10 @@
>  #include <fat.h>
>  #include <mmc.h>
>  #include <part.h>
> +#ifdef CONFIG_TWL4030_MMC
>  #include <i2c.h>
>  #include <twl4030.h>
> +#endif
>  #include <asm/io.h>
>  #include <asm/arch/mmc.h>
>  
> @@ -63,7 +65,9 @@ unsigned char mmc_board_init(void)
>  {
>  	t2_t *t2_base = (t2_t *)T2_BASE;
>  
> +#ifdef CONFIG_TWL4030_MMC
>  	twl4030_power_mmc_init();
> +#endif
>  
>  	writel(readl(&t2_base->pbias_lite) | PBIASLITEPWRDNZ1 |
>  		PBIASSPEEDCTRL0 | PBIASLITEPWRDNZ0,
> diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
> index 61629f8..e1cb759 100644
> --- a/include/configs/omap3_beagle.h
> +++ b/include/configs/omap3_beagle.h
> @@ -132,6 +132,7 @@
>  /*
>   * TWL4030
>   */
> +#define CONFIG_TWL4030_MMC		1
>  #define CONFIG_TWL4030_POWER		1
>  #define CONFIG_TWL4030_LED		1
>  
> diff --git a/include/configs/omap3_evm.h b/include/configs/omap3_evm.h
> index 9f0f34b..b3c64a8 100644
> --- a/include/configs/omap3_evm.h
> +++ b/include/configs/omap3_evm.h
> @@ -130,6 +130,7 @@
>  /*
>   * TWL4030
>   */
> +#define CONFIG_TWL4030_MMC		1
>  #define CONFIG_TWL4030_POWER		1
>  
>  /*
> diff --git a/include/configs/omap3_overo.h b/include/configs/omap3_overo.h
> index 07a031b..983832d 100644
> --- a/include/configs/omap3_overo.h
> +++ b/include/configs/omap3_overo.h
> @@ -118,6 +118,7 @@
>  /*
>   * TWL4030
>   */
> +#define CONFIG_TWL4030_MMC		1
>  #define CONFIG_TWL4030_POWER		1
>  #define CONFIG_TWL4030_LED		1
>  
> diff --git a/include/configs/omap3_pandora.h b/include/configs/omap3_pandora.h
> index 1cfd7e9..0d87c71 100644
> --- a/include/configs/omap3_pandora.h
> +++ b/include/configs/omap3_pandora.h
> @@ -121,6 +121,7 @@
>  /*
>   * TWL4030
>   */
> +#define CONFIG_TWL4030_MMC		1
>  #define CONFIG_TWL4030_POWER		1
>  #define CONFIG_TWL4030_LED		1
>  
> diff --git a/include/configs/omap3_zoom1.h b/include/configs/omap3_zoom1.h
> index 61a41e7..1140052 100644
> --- a/include/configs/omap3_zoom1.h
> +++ b/include/configs/omap3_zoom1.h
> @@ -128,6 +128,7 @@
>  /*
>   * TWL4030
>   */
> +#define CONFIG_TWL4030_MMC		1
>  #define CONFIG_TWL4030_POWER		1
>  #define CONFIG_TWL4030_LED		1
>  
> diff --git a/include/configs/omap3_zoom2.h b/include/configs/omap3_zoom2.h
> index 03f92f5..40add99 100644
> --- a/include/configs/omap3_zoom2.h
> +++ b/include/configs/omap3_zoom2.h
> @@ -149,6 +149,7 @@
>  /*
>   * TWL4030
>   */
> +#define CONFIG_TWL4030_MMC		1
>  #define CONFIG_TWL4030_POWER		1
>  #define CONFIG_TWL4030_LED		1
>  
>   

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

* [U-Boot] [RFC] OMAP3: make TWL4030 optional for MMC driver
  2009-08-27 13:42 ` Tom
@ 2009-08-27 14:07   ` Dirk Behme
  2009-08-27 14:31     ` Matthias Ludwig
  0 siblings, 1 reply; 6+ messages in thread
From: Dirk Behme @ 2009-08-27 14:07 UTC (permalink / raw)
  To: u-boot

Tom wrote:
> Maybe it would be better if the power_init function was removed from the 
> common file and moved to the individual board files.  What do you think ?
> Tom

Yes, sounds like a good idea.

Best regards

Dirk

> Matthias Ludwig wrote:
>> Upcoming boards may power MMC card themself without using
>> TWL4030, so make it optional by using define CONFIG_TWL4030_MMC.
>>
>> Enable this for all existing OMAP3 boards.
>>
>> Signed-off-by: Matthias Ludwig <mludwig@ultratronik.de>
>> ---
>>
>> Current OMAP3 MMC driver does require TWL4030 support to
>> be enabled as all OMAP3 boards are using this chip. I'd like
>> to push patches for a new board which does not has a TWL4030
>> and is caring about MMC power by itself.
>>
>> So, my suggestion is to make the TWL4030 dependency optional.
>> Are there better ways to to this can using a new define
>> CONFIG_TWL4030_MMC?
>>
>>  drivers/mmc/omap3_mmc.c         |    4 ++++
>>  include/configs/omap3_beagle.h  |    1 +
>>  include/configs/omap3_evm.h     |    1 +
>>  include/configs/omap3_overo.h   |    1 +
>>  include/configs/omap3_pandora.h |    1 +
>>  include/configs/omap3_zoom1.h   |    1 +
>>  include/configs/omap3_zoom2.h   |    1 +
>>  7 files changed, 10 insertions(+), 0 deletions(-)
....

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

* [U-Boot] [RFC] OMAP3: make TWL4030 optional for MMC driver
  2009-08-27 14:07   ` Dirk Behme
@ 2009-08-27 14:31     ` Matthias Ludwig
  2009-08-27 14:45       ` Tom
  0 siblings, 1 reply; 6+ messages in thread
From: Matthias Ludwig @ 2009-08-27 14:31 UTC (permalink / raw)
  To: u-boot

>> Maybe it would be better if the power_init function was removed from 
>> the common file and moved to the individual board files.  What do you 
>> think ?
>> Tom
>
> Yes, sounds like a good idea.

I also agree, looks like the more generic approach.

Do you expect any problem when moving the call to twl4030_power_mmc_init
into misc_init_r (in board/omap3/*/*.c) (of course bellow I2C init)?

In a quick test it seem to work (at least compiles fine), but i cannot
test it at the moment due to lack of hardware.

best regards,
Matthias

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

* [U-Boot] [RFC] OMAP3: make TWL4030 optional for MMC driver
  2009-08-27 14:31     ` Matthias Ludwig
@ 2009-08-27 14:45       ` Tom
  2009-08-27 14:51         ` Matthias Ludwig
  0 siblings, 1 reply; 6+ messages in thread
From: Tom @ 2009-08-27 14:45 UTC (permalink / raw)
  To: u-boot

Send me the patch, I will test it.
Tom

Matthias Ludwig wrote:
>>> Maybe it would be better if the power_init function was removed from 
>>> the common file and moved to the individual board files.  What do you 
>>> think ?
>>> Tom
>>>       
>> Yes, sounds like a good idea.
>>     
>
> I also agree, looks like the more generic approach.
>
> Do you expect any problem when moving the call to twl4030_power_mmc_init
> into misc_init_r (in board/omap3/*/*.c) (of course bellow I2C init)?
>
> In a quick test it seem to work (at least compiles fine), but i cannot
> test it at the moment due to lack of hardware.
>
> best regards,
> Matthias
>   

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

* [U-Boot] [RFC] OMAP3: make TWL4030 optional for MMC driver
  2009-08-27 14:45       ` Tom
@ 2009-08-27 14:51         ` Matthias Ludwig
  0 siblings, 0 replies; 6+ messages in thread
From: Matthias Ludwig @ 2009-08-27 14:51 UTC (permalink / raw)
  To: u-boot

Hmm, i recently notice, that only EVM (which i modified for testing)
initialize I2C in misc_init_r... Is there a cause why this is handled
different for evm than for beagle/overo/zoom[12]/,...

Matthias

On Thu, Aug 27, 2009 at 09:45:48AM -0500, Tom wrote:
> Send me the patch, I will test it.
> Tom
>
> Matthias Ludwig wrote:
>>>> Maybe it would be better if the power_init function was removed 
>>>> from the common file and moved to the individual board files.  What 
>>>> do you think ?
>>>> Tom
>>>>       
>>> Yes, sounds like a good idea.
>>>     
>>
>> I also agree, looks like the more generic approach.
>>
>> Do you expect any problem when moving the call to twl4030_power_mmc_init
>> into misc_init_r (in board/omap3/*/*.c) (of course bellow I2C init)?
>>
>> In a quick test it seem to work (at least compiles fine), but i cannot
>> test it at the moment due to lack of hardware.
>>
>> best regards,
>> Matthias
>>   
>

-- 
Matthias Ludwig, Software Development
Ultratronik Entwicklungs GmbH, Gewerbestrasse 52, 82211 Herrsching, Germany
http://www.ultratronik.de  Tel: +49 8152 3709-356  Fax: +49 8152 5183
Registergericht Muenchen, HRB 55584

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

end of thread, other threads:[~2009-08-27 14:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-27 13:24 [U-Boot] [RFC] OMAP3: make TWL4030 optional for MMC driver Matthias Ludwig
2009-08-27 13:42 ` Tom
2009-08-27 14:07   ` Dirk Behme
2009-08-27 14:31     ` Matthias Ludwig
2009-08-27 14:45       ` Tom
2009-08-27 14:51         ` Matthias Ludwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.