All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [RFC Patch] drivers: mmc: omap_hsmmc: Fix IO Buffer on OMAP36XX
@ 2017-01-09 18:12 ` aford173 at gmail.com
  2017-01-10 10:32   ` Jaehoon Chung
  2017-01-10 23:14   ` Tom Rini
  0 siblings, 2 replies; 6+ messages in thread
From: aford173 at gmail.com @ 2017-01-09 18:12 UTC (permalink / raw)
  To: u-boot

From: Adam Ford <aford173@gmail.com>

On the OMAP36xx (and 37xx) the CONTROL_WKUP_CTRL register has
a field (bit 6) named GPIO_IO_PWRDNZ.  If 0, the IO buffers which
are related to the MMC are disabled. After the PBIAS is configured,
this bit should be set high to enable the MMC port.

Signed-off-by: Adam Ford <aford173@gmail.com>

diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index 0a1ee40..069fd5a 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -38,6 +38,7 @@
 #include <asm/arch/sys_proto.h>
 #endif
 #include <dm.h>
+#include <asm/arch-omap3/mux.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -115,6 +116,11 @@ static unsigned char mmc_board_init(struct mmc *mmc)
 		PBIASSPEEDCTRL0 | PBIASLITEPWRDNZ0,
 		&t2_base->pbias_lite);
 
+	if (get_cpu_family() == CPU_OMAP36XX)
+		writel(readl(OMAP34XX_CTRL_WKUP_CTRL) |
+				OMAP34XX_CTRL_WKUP_CTRL_GPIO_IO_PWRDNZ,
+				OMAP34XX_CTRL_WKUP_CTRL);
+
 	writel(readl(&t2_base->devconf0) | MMCSDIO1ADPCLKISEL,
 		&t2_base->devconf0);
 
-- 
2.7.4

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

* [U-Boot] [RFC Patch] drivers: mmc: omap_hsmmc: Fix IO Buffer on OMAP36XX
  2017-01-09 18:12 ` [U-Boot] [RFC Patch] drivers: mmc: omap_hsmmc: Fix IO Buffer on OMAP36XX aford173 at gmail.com
@ 2017-01-10 10:32   ` Jaehoon Chung
  2017-01-10 14:59     ` Adam Ford
  2017-01-10 23:14   ` Tom Rini
  1 sibling, 1 reply; 6+ messages in thread
From: Jaehoon Chung @ 2017-01-10 10:32 UTC (permalink / raw)
  To: u-boot

Hi Adam,

On 01/10/2017 03:12 AM, aford173 at gmail.com wrote:
> From: Adam Ford <aford173@gmail.com>
> 
> On the OMAP36xx (and 37xx) the CONTROL_WKUP_CTRL register has
> a field (bit 6) named GPIO_IO_PWRDNZ.  If 0, the IO buffers which
> are related to the MMC are disabled. After the PBIAS is configured,
> this bit should be set high to enable the MMC port.
> 
> Signed-off-by: Adam Ford <aford173@gmail.com>
> 
> diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
> index 0a1ee40..069fd5a 100644
> --- a/drivers/mmc/omap_hsmmc.c
> +++ b/drivers/mmc/omap_hsmmc.c
> @@ -38,6 +38,7 @@
>  #include <asm/arch/sys_proto.h>
>  #endif
>  #include <dm.h>
> +#include <asm/arch-omap3/mux.h>
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> @@ -115,6 +116,11 @@ static unsigned char mmc_board_init(struct mmc *mmc)
>  		PBIASSPEEDCTRL0 | PBIASLITEPWRDNZ0,
>  		&t2_base->pbias_lite);
>  
> +	if (get_cpu_family() == CPU_OMAP36XX)
> +		writel(readl(OMAP34XX_CTRL_WKUP_CTRL) |
> +				OMAP34XX_CTRL_WKUP_CTRL_GPIO_IO_PWRDNZ,
> +				OMAP34XX_CTRL_WKUP_CTRL);

get_cpu_family() is defined in arch/arm/mach-omap2/omap3/sys_info.c
When i have checked it, it's compiled when CONFIG_OMAP34XX is enabled.
Doesn't it affect? just curious.

Best Regards,
Jaehoon Chung

> +
>  	writel(readl(&t2_base->devconf0) | MMCSDIO1ADPCLKISEL,
>  		&t2_base->devconf0);
>  
> 

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

* [U-Boot] [RFC Patch] drivers: mmc: omap_hsmmc: Fix IO Buffer on OMAP36XX
  2017-01-10 10:32   ` Jaehoon Chung
@ 2017-01-10 14:59     ` Adam Ford
  2017-01-11  2:10       ` Jaehoon Chung
  0 siblings, 1 reply; 6+ messages in thread
From: Adam Ford @ 2017-01-10 14:59 UTC (permalink / raw)
  To: u-boot

On Tue, Jan 10, 2017 at 4:32 AM, Jaehoon Chung <jh80.chung@samsung.com> wrote:
> Hi Adam,
>
> On 01/10/2017 03:12 AM, aford173 at gmail.com wrote:
>> From: Adam Ford <aford173@gmail.com>
>>
>> On the OMAP36xx (and 37xx) the CONTROL_WKUP_CTRL register has
>> a field (bit 6) named GPIO_IO_PWRDNZ.  If 0, the IO buffers which
>> are related to the MMC are disabled. After the PBIAS is configured,
>> this bit should be set high to enable the MMC port.
>>
>> Signed-off-by: Adam Ford <aford173@gmail.com>
>>
>> diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
>> index 0a1ee40..069fd5a 100644
>> --- a/drivers/mmc/omap_hsmmc.c
>> +++ b/drivers/mmc/omap_hsmmc.c
>> @@ -38,6 +38,7 @@
>>  #include <asm/arch/sys_proto.h>
>>  #endif
>>  #include <dm.h>
>> +#include <asm/arch-omap3/mux.h>
>>
>>  DECLARE_GLOBAL_DATA_PTR;
>>
>> @@ -115,6 +116,11 @@ static unsigned char mmc_board_init(struct mmc *mmc)
>>               PBIASSPEEDCTRL0 | PBIASLITEPWRDNZ0,
>>               &t2_base->pbias_lite);
>>
>> +     if (get_cpu_family() == CPU_OMAP36XX)
>> +             writel(readl(OMAP34XX_CTRL_WKUP_CTRL) |
>> +                             OMAP34XX_CTRL_WKUP_CTRL_GPIO_IO_PWRDNZ,
>> +                             OMAP34XX_CTRL_WKUP_CTRL);
>
> get_cpu_family() is defined in arch/arm/mach-omap2/omap3/sys_info.c
> When i have checked it, it's compiled when CONFIG_OMAP34XX is enabled.
> Doesn't it affect? just curious.
>

The 36XX is a superset of the 34XX and the entire chunck of code is
enclosed by and #if #endif that is only compiled in when
CONFIG_OMAP34XX is defined.  For OMAP36xx boards, they should have
CONFIG_OMAP34XX defined. If it's not an 34XX, it won't get included
and the check won't get run.  Do you disagree?


> Best Regards,
> Jaehoon Chung
>
>> +
>>       writel(readl(&t2_base->devconf0) | MMCSDIO1ADPCLKISEL,
>>               &t2_base->devconf0);
>>
>>
>

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

* [U-Boot] [RFC Patch] drivers: mmc: omap_hsmmc: Fix IO Buffer on OMAP36XX
  2017-01-09 18:12 ` [U-Boot] [RFC Patch] drivers: mmc: omap_hsmmc: Fix IO Buffer on OMAP36XX aford173 at gmail.com
  2017-01-10 10:32   ` Jaehoon Chung
@ 2017-01-10 23:14   ` Tom Rini
  2017-01-11 14:21     ` Adam Ford
  1 sibling, 1 reply; 6+ messages in thread
From: Tom Rini @ 2017-01-10 23:14 UTC (permalink / raw)
  To: u-boot

On Mon, Jan 09, 2017 at 12:12:09PM -0600, aford173 at gmail.com wrote:

> From: Adam Ford <aford173@gmail.com>
> 
> On the OMAP36xx (and 37xx) the CONTROL_WKUP_CTRL register has
> a field (bit 6) named GPIO_IO_PWRDNZ.  If 0, the IO buffers which
> are related to the MMC are disabled. After the PBIAS is configured,
> this bit should be set high to enable the MMC port.
> 
> Signed-off-by: Adam Ford <aford173@gmail.com>
> 
> diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
> index 0a1ee40..069fd5a 100644
> --- a/drivers/mmc/omap_hsmmc.c
> +++ b/drivers/mmc/omap_hsmmc.c
> @@ -38,6 +38,7 @@
>  #include <asm/arch/sys_proto.h>
>  #endif
>  #include <dm.h>
> +#include <asm/arch-omap3/mux.h>
>  
>  DECLARE_GLOBAL_DATA_PTR;
>  
> @@ -115,6 +116,11 @@ static unsigned char mmc_board_init(struct mmc *mmc)
>  		PBIASSPEEDCTRL0 | PBIASLITEPWRDNZ0,
>  		&t2_base->pbias_lite);
>  
> +	if (get_cpu_family() == CPU_OMAP36XX)
> +		writel(readl(OMAP34XX_CTRL_WKUP_CTRL) |
> +				OMAP34XX_CTRL_WKUP_CTRL_GPIO_IO_PWRDNZ,
> +				OMAP34XX_CTRL_WKUP_CTRL);
> +
>  	writel(readl(&t2_base->devconf0) | MMCSDIO1ADPCLKISEL,
>  		&t2_base->devconf0);

I think I'd like to see this with a build-time check to avoid bloating
all of the other families.  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170110/d970727a/attachment.sig>

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

* [U-Boot] [RFC Patch] drivers: mmc: omap_hsmmc: Fix IO Buffer on OMAP36XX
  2017-01-10 14:59     ` Adam Ford
@ 2017-01-11  2:10       ` Jaehoon Chung
  0 siblings, 0 replies; 6+ messages in thread
From: Jaehoon Chung @ 2017-01-11  2:10 UTC (permalink / raw)
  To: u-boot

On 01/10/2017 11:59 PM, Adam Ford wrote:
> On Tue, Jan 10, 2017 at 4:32 AM, Jaehoon Chung <jh80.chung@samsung.com> wrote:
>> Hi Adam,
>>
>> On 01/10/2017 03:12 AM, aford173 at gmail.com wrote:
>>> From: Adam Ford <aford173@gmail.com>
>>>
>>> On the OMAP36xx (and 37xx) the CONTROL_WKUP_CTRL register has
>>> a field (bit 6) named GPIO_IO_PWRDNZ.  If 0, the IO buffers which
>>> are related to the MMC are disabled. After the PBIAS is configured,
>>> this bit should be set high to enable the MMC port.
>>>
>>> Signed-off-by: Adam Ford <aford173@gmail.com>
>>>
>>> diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
>>> index 0a1ee40..069fd5a 100644
>>> --- a/drivers/mmc/omap_hsmmc.c
>>> +++ b/drivers/mmc/omap_hsmmc.c
>>> @@ -38,6 +38,7 @@
>>>  #include <asm/arch/sys_proto.h>
>>>  #endif
>>>  #include <dm.h>
>>> +#include <asm/arch-omap3/mux.h>
>>>
>>>  DECLARE_GLOBAL_DATA_PTR;
>>>
>>> @@ -115,6 +116,11 @@ static unsigned char mmc_board_init(struct mmc *mmc)
>>>               PBIASSPEEDCTRL0 | PBIASLITEPWRDNZ0,
>>>               &t2_base->pbias_lite);
>>>
>>> +     if (get_cpu_family() == CPU_OMAP36XX)
>>> +             writel(readl(OMAP34XX_CTRL_WKUP_CTRL) |
>>> +                             OMAP34XX_CTRL_WKUP_CTRL_GPIO_IO_PWRDNZ,
>>> +                             OMAP34XX_CTRL_WKUP_CTRL);
>>
>> get_cpu_family() is defined in arch/arm/mach-omap2/omap3/sys_info.c
>> When i have checked it, it's compiled when CONFIG_OMAP34XX is enabled.
>> Doesn't it affect? just curious.
>>
> 
> The 36XX is a superset of the 34XX and the entire chunck of code is
> enclosed by and #if #endif that is only compiled in when
> CONFIG_OMAP34XX is defined.  For OMAP36xx boards, they should have
> CONFIG_OMAP34XX defined. If it's not an 34XX, it won't get included
> and the check won't get run.  Do you disagree?

I'm just curious for it. because there is using the "ifdef" about "get_cpu_family()".

Best Regards,
Jaehoon Chung

> 
> 
>> Best Regards,
>> Jaehoon Chung
>>
>>> +
>>>       writel(readl(&t2_base->devconf0) | MMCSDIO1ADPCLKISEL,
>>>               &t2_base->devconf0);
>>>
>>>
>>
> 
> 
> 

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

* [U-Boot] [RFC Patch] drivers: mmc: omap_hsmmc: Fix IO Buffer on OMAP36XX
  2017-01-10 23:14   ` Tom Rini
@ 2017-01-11 14:21     ` Adam Ford
  0 siblings, 0 replies; 6+ messages in thread
From: Adam Ford @ 2017-01-11 14:21 UTC (permalink / raw)
  To: u-boot

On Tue, Jan 10, 2017 at 5:14 PM, Tom Rini <trini@konsulko.com> wrote:
> On Mon, Jan 09, 2017 at 12:12:09PM -0600, aford173 at gmail.com wrote:
>
>> From: Adam Ford <aford173@gmail.com>
>>
>> On the OMAP36xx (and 37xx) the CONTROL_WKUP_CTRL register has
>> a field (bit 6) named GPIO_IO_PWRDNZ.  If 0, the IO buffers which
>> are related to the MMC are disabled. After the PBIAS is configured,
>> this bit should be set high to enable the MMC port.
>>
>> Signed-off-by: Adam Ford <aford173@gmail.com>
>>
>> diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
>> index 0a1ee40..069fd5a 100644
>> --- a/drivers/mmc/omap_hsmmc.c
>> +++ b/drivers/mmc/omap_hsmmc.c
>> @@ -38,6 +38,7 @@
>>  #include <asm/arch/sys_proto.h>
>>  #endif
>>  #include <dm.h>
>> +#include <asm/arch-omap3/mux.h>
>>
>>  DECLARE_GLOBAL_DATA_PTR;
>>
>> @@ -115,6 +116,11 @@ static unsigned char mmc_board_init(struct mmc *mmc)
>>               PBIASSPEEDCTRL0 | PBIASLITEPWRDNZ0,
>>               &t2_base->pbias_lite);
>>
#ifdef OMAP36_MMC1_PINS
>> +     if (get_cpu_family() == CPU_OMAP36XX)
>> +             writel(readl(OMAP34XX_CTRL_WKUP_CTRL) |
>> +                             OMAP34XX_CTRL_WKUP_CTRL_GPIO_IO_PWRDNZ,
>> +                             OMAP34XX_CTRL_WKUP_CTRL);
>> +
#endif

>>       writel(readl(&t2_base->devconf0) | MMCSDIO1ADPCLKISEL,
>>               &t2_base->devconf0);
>
> I think I'd like to see this with a build-time check to avoid bloating
> all of the other families.  Thanks!

Since it's only on the OMAP36xx and 37xx (that I am aware) and it's
specific for a couple pins on the MMC1 bus using GPIO_126, 127, and
129.  If we encapsulated the update into and #ifdef, would that
satisfy you?

I added my proposed change above.  I would also add the define into
the omap3_logic_defconfig file.  Any other OMAP36/37 boards could add
it in.

Does that work for you?  If so, I'll submit an updated patch

>
> --
> Tom

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

end of thread, other threads:[~2017-01-11 14:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20170109181224epcas2p470f517508dde777573f07ab0ef41d8fe@epcas2p4.samsung.com>
2017-01-09 18:12 ` [U-Boot] [RFC Patch] drivers: mmc: omap_hsmmc: Fix IO Buffer on OMAP36XX aford173 at gmail.com
2017-01-10 10:32   ` Jaehoon Chung
2017-01-10 14:59     ` Adam Ford
2017-01-11  2:10       ` Jaehoon Chung
2017-01-10 23:14   ` Tom Rini
2017-01-11 14:21     ` Adam Ford

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.