linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/83xx: Do not configure or probe disabled FSL DR USB controllers
@ 2009-02-19 16:02 Anton Vorontsov
  2009-02-19 16:19 ` Kumar Gala
  2009-02-19 16:43 ` Kumar Gala
  0 siblings, 2 replies; 4+ messages in thread
From: Anton Vorontsov @ 2009-02-19 16:02 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Liu Dave, Andy Fleming, linuxppc-dev

On MPC837X CPUs Dual-Role USB isn't always available (for example DR
USB pins can be muxed away to eSDHC).

U-Boot adds status = "disabled" property into the DR USB nodes to
indicate that we must not try to configure or probe Dual-Role USB,
otherwise we'll break eSDHC support on targets with MPC837X CPUs.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 arch/powerpc/platforms/83xx/usb.c |    3 ++-
 arch/powerpc/sysdev/fsl_soc.c     |    4 ++++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c
index cc99c28..11e1fac 100644
--- a/arch/powerpc/platforms/83xx/usb.c
+++ b/arch/powerpc/platforms/83xx/usb.c
@@ -14,6 +14,7 @@
 #include <linux/stddef.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
+#include <linux/of.h>
 
 #include <asm/io.h>
 #include <asm/prom.h>
@@ -210,7 +211,7 @@ int mpc837x_usb_cfg(void)
 	int ret = 0;
 
 	np = of_find_compatible_node(NULL, NULL, "fsl-usb2-dr");
-	if (!np)
+	if (!np || !of_device_is_available(np))
 		return -ENODEV;
 	prop = of_get_property(np, "phy_type", NULL);
 
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index 18e49ef..afe8dbc 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -22,6 +22,7 @@
 #include <linux/module.h>
 #include <linux/device.h>
 #include <linux/platform_device.h>
+#include <linux/of.h>
 #include <linux/of_platform.h>
 #include <linux/phy.h>
 #include <linux/phy_fixed.h>
@@ -328,6 +329,9 @@ static int __init fsl_usb_of_init(void)
 		struct fsl_usb2_platform_data usb_data;
 		const unsigned char *prop = NULL;
 
+		if (!of_device_is_available(np))
+			continue;
+
 		memset(&r, 0, sizeof(r));
 		memset(&usb_data, 0, sizeof(usb_data));
 
-- 
1.5.6.5

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

* Re: [PATCH] powerpc/83xx: Do not configure or probe disabled FSL DR USB controllers
  2009-02-19 16:02 [PATCH] powerpc/83xx: Do not configure or probe disabled FSL DR USB controllers Anton Vorontsov
@ 2009-02-19 16:19 ` Kumar Gala
  2009-02-19 17:29   ` Anton Vorontsov
  2009-02-19 16:43 ` Kumar Gala
  1 sibling, 1 reply; 4+ messages in thread
From: Kumar Gala @ 2009-02-19 16:19 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: Liu Dave, Andy Fleming, linuxppc-dev


On Feb 19, 2009, at 10:02 AM, Anton Vorontsov wrote:

> On MPC837X CPUs Dual-Role USB isn't always available (for example DR
> USB pins can be muxed away to eSDHC).
>
> U-Boot adds status = "disabled" property into the DR USB nodes to
> indicate that we must not try to configure or probe Dual-Role USB,
> otherwise we'll break eSDHC support on targets with MPC837X CPUs.
>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
> arch/powerpc/platforms/83xx/usb.c |    3 ++-
> arch/powerpc/sysdev/fsl_soc.c     |    4 ++++
> 2 files changed, 6 insertions(+), 1 deletions(-)

Mind looking at possibly killing the fsl_soc.c  usb code and making  
the usb a real of-platform driver?

- k

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

* Re: [PATCH] powerpc/83xx: Do not configure or probe disabled FSL DR USB controllers
  2009-02-19 16:02 [PATCH] powerpc/83xx: Do not configure or probe disabled FSL DR USB controllers Anton Vorontsov
  2009-02-19 16:19 ` Kumar Gala
@ 2009-02-19 16:43 ` Kumar Gala
  1 sibling, 0 replies; 4+ messages in thread
From: Kumar Gala @ 2009-02-19 16:43 UTC (permalink / raw)
  To: Anton Vorontsov; +Cc: Liu Dave, Andy Fleming, linuxppc-dev


On Feb 19, 2009, at 10:02 AM, Anton Vorontsov wrote:

> On MPC837X CPUs Dual-Role USB isn't always available (for example DR
> USB pins can be muxed away to eSDHC).
>
> U-Boot adds status = "disabled" property into the DR USB nodes to
> indicate that we must not try to configure or probe Dual-Role USB,
> otherwise we'll break eSDHC support on targets with MPC837X CPUs.
>
> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
> ---
> arch/powerpc/platforms/83xx/usb.c |    3 ++-
> arch/powerpc/sysdev/fsl_soc.c     |    4 ++++
> 2 files changed, 6 insertions(+), 1 deletions(-)


applied to next

- k

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

* Re: [PATCH] powerpc/83xx: Do not configure or probe disabled FSL DR USB controllers
  2009-02-19 16:19 ` Kumar Gala
@ 2009-02-19 17:29   ` Anton Vorontsov
  0 siblings, 0 replies; 4+ messages in thread
From: Anton Vorontsov @ 2009-02-19 17:29 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Liu Dave, Andy Fleming, linuxppc-dev

On Thu, Feb 19, 2009 at 10:19:05AM -0600, Kumar Gala wrote:
>
> On Feb 19, 2009, at 10:02 AM, Anton Vorontsov wrote:
>
>> On MPC837X CPUs Dual-Role USB isn't always available (for example DR
>> USB pins can be muxed away to eSDHC).
>>
>> U-Boot adds status = "disabled" property into the DR USB nodes to
>> indicate that we must not try to configure or probe Dual-Role USB,
>> otherwise we'll break eSDHC support on targets with MPC837X CPUs.
>>
>> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
>> ---
>> arch/powerpc/platforms/83xx/usb.c |    3 ++-
>> arch/powerpc/sysdev/fsl_soc.c     |    4 ++++
>> 2 files changed, 6 insertions(+), 1 deletions(-)
>
> Mind looking at possibly killing the fsl_soc.c  usb code and making the 
> usb a real of-platform driver?

Sure, but it's a bit complicated because of OTG support (which
doesn't currently work, btw).

Just need to think about whether we want to leave UDC and HOST
drivers as pure platform drivers, and implement an of platform
driver as a proxy for Host/UDC/OTG...

Thanks,

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

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

end of thread, other threads:[~2009-02-19 17:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-19 16:02 [PATCH] powerpc/83xx: Do not configure or probe disabled FSL DR USB controllers Anton Vorontsov
2009-02-19 16:19 ` Kumar Gala
2009-02-19 17:29   ` Anton Vorontsov
2009-02-19 16:43 ` Kumar Gala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).