* [PATCH] ARM: OMAP: Fix board data to support device only, host only and OTG roles.
@ 2010-05-20 13:09 Maulik Mankad
2010-05-20 14:00 ` Gupta, Ajay Kumar
[not found] ` <1274360966-9974-1-git-send-email-x0082077-l0cyMroinI0@public.gmane.org>
0 siblings, 2 replies; 20+ messages in thread
From: Maulik Mankad @ 2010-05-20 13:09 UTC (permalink / raw)
To: linux-omap-u79uwXL29TY76Z2rM5mHXA
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Maulik Mankad, Felipe Balbi,
Tony Lindgren
Fix board data to support device only, host only and OTG roles.
The board data hardcodes the mode to OTG or Peripheral.
This fix will allow to use Peripheral, Host and OTG
roles independently.
Signed-off-by: Maulik Mankad <x0082077-l0cyMroinI0@public.gmane.org>
Cc: Felipe Balbi <felipe.balbi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
Cc: Tony Lindgren <tony-4v6yS6AI5VpBDgjK7y7TUQ@public.gmane.org>
---
Based on top of today's mainline.
Applies cleanly on linux-omap master also.
arch/arm/mach-omap2/board-2430sdp.c | 6 ++++++
arch/arm/mach-omap2/board-3430sdp.c | 6 ++++++
arch/arm/mach-omap2/board-4430sdp.c | 6 ++++++
arch/arm/mach-omap2/board-cm-t35.c | 6 ++++++
arch/arm/mach-omap2/board-devkit8000.c | 6 ++++++
arch/arm/mach-omap2/board-igep0020.c | 6 ++++++
arch/arm/mach-omap2/board-ldp.c | 6 ++++++
arch/arm/mach-omap2/board-omap3beagle.c | 6 ++++++
arch/arm/mach-omap2/board-omap3evm.c | 6 ++++++
arch/arm/mach-omap2/board-omap3pandora.c | 6 ++++++
arch/arm/mach-omap2/board-omap3touchbook.c | 6 ++++++
arch/arm/mach-omap2/board-overo.c | 6 ++++++
arch/arm/mach-omap2/board-rx51.c | 6 ++++++
arch/arm/mach-omap2/board-zoom-peripherals.c | 6 ++++++
14 files changed, 84 insertions(+)
Index: mainline/arch/arm/mach-omap2/board-2430sdp.c
===================================================================
--- mainline.orig/arch/arm/mach-omap2/board-2430sdp.c
+++ mainline/arch/arm/mach-omap2/board-2430sdp.c
@@ -195,7 +195,13 @@ static struct omap2_hsmmc_info mmc[] __i
static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
+#ifdef CONFIG_USB_MUSB_OTG
.mode = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+ .mode = MUSB_HOST,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
+ .mode = MUSB_PERIPHERAL,
+#endif
.power = 100,
};
Index: mainline/arch/arm/mach-omap2/board-ldp.c
===================================================================
--- mainline.orig/arch/arm/mach-omap2/board-ldp.c
+++ mainline/arch/arm/mach-omap2/board-ldp.c
@@ -385,7 +385,13 @@ static struct omap_board_mux board_mux[]
static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
+#ifdef CONFIG_USB_MUSB_OTG
.mode = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+ .mode = MUSB_HOST,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
+ .mode = MUSB_PERIPHERAL,
+#endif
.power = 100,
};
Index: mainline/arch/arm/mach-omap2/board-omap3beagle.c
===================================================================
--- mainline.orig/arch/arm/mach-omap2/board-omap3beagle.c
+++ mainline/arch/arm/mach-omap2/board-omap3beagle.c
@@ -432,7 +432,13 @@ static struct omap_board_mux board_mux[]
static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
+#ifdef CONFIG_USB_MUSB_OTG
.mode = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+ .mode = MUSB_HOST,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
+ .mode = MUSB_PERIPHERAL,
+#endif
.power = 100,
};
Index: mainline/arch/arm/mach-omap2/board-overo.c
===================================================================
--- mainline.orig/arch/arm/mach-omap2/board-overo.c
+++ mainline/arch/arm/mach-omap2/board-overo.c
@@ -415,7 +415,13 @@ static struct omap_board_mux board_mux[]
static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
+#ifdef CONFIG_USB_MUSB_OTG
.mode = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+ .mode = MUSB_HOST,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
+ .mode = MUSB_PERIPHERAL,
+#endif
.power = 100,
};
Index: mainline/arch/arm/mach-omap2/board-3430sdp.c
===================================================================
--- mainline.orig/arch/arm/mach-omap2/board-3430sdp.c
+++ mainline/arch/arm/mach-omap2/board-3430sdp.c
@@ -778,7 +778,13 @@ static struct flash_partitions sdp_flash
static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
+#ifdef CONFIG_USB_MUSB_OTG
.mode = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+ .mode = MUSB_HOST,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
+ .mode = MUSB_PERIPHERAL,
+#endif
.power = 100,
};
Index: mainline/arch/arm/mach-omap2/board-omap3pandora.c
===================================================================
--- mainline.orig/arch/arm/mach-omap2/board-omap3pandora.c
+++ mainline/arch/arm/mach-omap2/board-omap3pandora.c
@@ -567,7 +567,13 @@ static struct omap_board_mux board_mux[]
static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
+#ifdef CONFIG_USB_MUSB_OTG
.mode = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+ .mode = MUSB_HOST,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
+ .mode = MUSB_PERIPHERAL,
+#endif
.power = 100,
};
Index: mainline/arch/arm/mach-omap2/board-4430sdp.c
===================================================================
--- mainline.orig/arch/arm/mach-omap2/board-4430sdp.c
+++ mainline/arch/arm/mach-omap2/board-4430sdp.c
@@ -107,7 +107,13 @@ static void __init omap_4430sdp_init_irq
static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_UTMI,
+#ifdef CONFIG_USB_MUSB_OTG
+ .mode = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+ .mode = MUSB_HOST,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
.mode = MUSB_PERIPHERAL,
+#endif
.power = 100,
};
Index: mainline/arch/arm/mach-omap2/board-cm-t35.c
===================================================================
--- mainline.orig/arch/arm/mach-omap2/board-cm-t35.c
+++ mainline/arch/arm/mach-omap2/board-cm-t35.c
@@ -813,7 +813,13 @@ static struct omap_board_mux board_mux[]
static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
+#ifdef CONFIG_USB_MUSB_OTG
.mode = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+ .mode = MUSB_HOST,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
+ .mode = MUSB_PERIPHERAL,
+#endif
.power = 100,
};
Index: mainline/arch/arm/mach-omap2/board-omap3evm.c
===================================================================
--- mainline.orig/arch/arm/mach-omap2/board-omap3evm.c
+++ mainline/arch/arm/mach-omap2/board-omap3evm.c
@@ -664,7 +664,13 @@ static struct omap_board_mux board_mux[]
static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
+#ifdef CONFIG_USB_MUSB_OTG
.mode = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+ .mode = MUSB_HOST,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
+ .mode = MUSB_PERIPHERAL,
+#endif
.power = 100,
};
Index: mainline/arch/arm/mach-omap2/board-rx51.c
===================================================================
--- mainline.orig/arch/arm/mach-omap2/board-rx51.c
+++ mainline/arch/arm/mach-omap2/board-rx51.c
@@ -122,7 +122,13 @@ static struct omap_board_mux board_mux[]
static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
+#ifdef CONFIG_USB_MUSB_OTG
+ .mode = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+ .mode = MUSB_HOST,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
.mode = MUSB_PERIPHERAL,
+#endif
.power = 0,
};
Index: mainline/arch/arm/mach-omap2/board-devkit8000.c
===================================================================
--- mainline.orig/arch/arm/mach-omap2/board-devkit8000.c
+++ mainline/arch/arm/mach-omap2/board-devkit8000.c
@@ -617,7 +617,13 @@ static void __init devkit8000_flash_init
static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
+#ifdef CONFIG_USB_MUSB_OTG
.mode = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+ .mode = MUSB_HOST,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
+ .mode = MUSB_PERIPHERAL,
+#endif
.power = 100,
};
Index: mainline/arch/arm/mach-omap2/board-igep0020.c
===================================================================
--- mainline.orig/arch/arm/mach-omap2/board-igep0020.c
+++ mainline/arch/arm/mach-omap2/board-igep0020.c
@@ -453,7 +453,13 @@ static int __init igep2_i2c_init(void)
static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
+#ifdef CONFIG_USB_MUSB_OTG
.mode = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+ .mode = MUSB_HOST,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
+ .mode = MUSB_PERIPHERAL,
+#endif
.power = 100,
};
Index: mainline/arch/arm/mach-omap2/board-omap3touchbook.c
===================================================================
--- mainline.orig/arch/arm/mach-omap2/board-omap3touchbook.c
+++ mainline/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -529,7 +529,13 @@ early_param("tbr", early_touchbook_revis
static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
+#ifdef CONFIG_USB_MUSB_OTG
.mode = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+ .mode = MUSB_HOST,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
+ .mode = MUSB_PERIPHERAL,
+#endif
.power = 100,
};
Index: mainline/arch/arm/mach-omap2/board-zoom-peripherals.c
===================================================================
--- mainline.orig/arch/arm/mach-omap2/board-zoom-peripherals.c
+++ mainline/arch/arm/mach-omap2/board-zoom-peripherals.c
@@ -266,7 +266,13 @@ static int __init omap_i2c_init(void)
static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
+#ifdef CONFIG_USB_MUSB_OTG
.mode = MUSB_OTG,
+#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
+ .mode = MUSB_HOST,
+#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
+ .mode = MUSB_PERIPHERAL,
+#endif
.power = 100,
};
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 20+ messages in thread* RE: [PATCH] ARM: OMAP: Fix board data to support device only, host only and OTG roles.
2010-05-20 13:09 [PATCH] ARM: OMAP: Fix board data to support device only, host only and OTG roles Maulik Mankad
@ 2010-05-20 14:00 ` Gupta, Ajay Kumar
2010-05-20 15:15 ` David Brownell
2010-05-20 15:40 ` David Brownell
[not found] ` <1274360966-9974-1-git-send-email-x0082077-l0cyMroinI0@public.gmane.org>
1 sibling, 2 replies; 20+ messages in thread
From: Gupta, Ajay Kumar @ 2010-05-20 14:00 UTC (permalink / raw)
To: Mankad, Maulik Ojas, linux-omap@vger.kernel.org
Cc: linux-usb@vger.kernel.org, Felipe Balbi, Tony Lindgren
Hi,
> Subject: [PATCH] ARM: OMAP: Fix board data to support device only, host only and OTG roles.
> Fix board data to support device only, host only and OTG roles.
>The board data hardcodes the mode to OTG or Peripheral.
>This fix will allow to use Peripheral, Host and OTG
>roles independently.
>Signed-off-by: Maulik Mankad <x0082077@ti.com>
Same set of code snippet getting repeated across the files. Isn't it good to have
them at same commom file usb-musb.c ?
I think better remove .mode parameter from board_data if its not needed anyways if some board
supports only some specific mode they can select those specifc config only.
-Ajay
^ permalink raw reply [flat|nested] 20+ messages in thread* RE: [PATCH] ARM: OMAP: Fix board data to support device only, host only and OTG roles.
2010-05-20 14:00 ` Gupta, Ajay Kumar
@ 2010-05-20 15:15 ` David Brownell
[not found] ` <304844.15257.qm-4JhmkcZgSkkHBU+L9ui1Svu2YVrzzGjVVpNB7YpNyf8@public.gmane.org>
2010-05-20 15:40 ` David Brownell
1 sibling, 1 reply; 20+ messages in thread
From: David Brownell @ 2010-05-20 15:15 UTC (permalink / raw)
To: Maulik OjasMankad, linux-omap@vger.kernel.org, Ajay KumarGupta
Cc: linux-usb@vger.kernel.org, Felipe Balbi, Tony Lindgren
> I think better remove .mode parameter from board_data if
> its not needed anyways
But it *IS* needed, as I explained before...
> if some board
> supports only some specific mode they can select those
> specifc config only.
No they can't. Recall that kernels are expected to run on
multiple boards. Which means that the same kernel should be
able to work correctly on a board with a peripheral-only USB
connector ... and on a board with an OTG connector. The way
to pass that information to the MUSB driver is through the
platform data. On the peripheral-only config the host code
won't kick in. On the OTG-enabled config, it will kick in
as needed (as will the peripheral mode). And so on.
If you were to rely on Kconfig options, then at least one of
those boards would work incorrectly. So that's not an option.
^ permalink raw reply [flat|nested] 20+ messages in thread* RE: [PATCH] ARM: OMAP: Fix board data to support device only, host only and OTG roles.
2010-05-20 14:00 ` Gupta, Ajay Kumar
2010-05-20 15:15 ` David Brownell
@ 2010-05-20 15:40 ` David Brownell
1 sibling, 0 replies; 20+ messages in thread
From: David Brownell @ 2010-05-20 15:40 UTC (permalink / raw)
To: Maulik OjasMankad, linux-omap@vger.kernel.org, Ajay KumarGupta
Cc: linux-usb@vger.kernel.org, Felipe Balbi, Tony Lindgren
> > Subject: [PATCH] ARM: OMAP: Fix board data to support
> device only, host only and OTG roles.
>
> > Fix board data to support device only, host only and
> OTG roles.
>
> >The board data hardcodes the mode to OTG or
> Peripheral.
Or host. That's correct... because the *BOARD* is hard-wired
that way. Based on what connector is present, the driver uses
that board-specific data to ensure it's exposing the right
capabilities. (Example, a host-only board won't expose either
OTG or peripheral capabilities, etc.)
> >This fix will allow to use Peripheral, Host and OTG
> >roles independently.
The driver has had that capability almost forever...
If you're saying that somebody broke the mode setup logic in the
driver, which originally tested the board capabilities before it
enabled the relevant driver capabilities, then the solution is to
un-break that code ... not to further break it.
ISTR it was pretty straightforward: boards with a host or peripheral
connector could only enter that driver mode, but boards with an OTG
connector could enter either driver mode. This affected initialization
(one or both sides of the USB stack needed initialization before the
driver could properly start) as well as role switching at runtime
(either based on ID-sensing in the connector, or HNP).
As of something like a year and a half ago, the cable based role switching worked pretty well (ID sensing) and HNP behaved at least
partially, although there were some OTG conformance test failures
(timing etc, but the roles did switch correctly via HNP, verified
with both OMAP3 and DaVinci boards).
Now the PITA was that the Mentor IP doesn't clearly document some of
the key initialization or role switching steps. I recall losing over
a month trying to make sense of what they wanted, since their state
machine didn't match the OTG spec. I could easily believe that some
patch broke that again. Which means someone might need to bisect
things to fix a bug they inserted... Peripheral mode init was fragile to an extreme; changing the sequence was almost guaranteed to break
something.
^ permalink raw reply [flat|nested] 20+ messages in thread
[parent not found: <1274360966-9974-1-git-send-email-x0082077-l0cyMroinI0@public.gmane.org>]
* Re: [PATCH] ARM: OMAP: Fix board data to support device only, host only and OTG roles.
[not found] ` <1274360966-9974-1-git-send-email-x0082077-l0cyMroinI0@public.gmane.org>
@ 2010-05-20 15:48 ` David Brownell
2010-05-21 5:15 ` Gupta, Ajay Kumar
2010-05-28 18:27 ` Steve Sakoman
0 siblings, 2 replies; 20+ messages in thread
From: David Brownell @ 2010-05-20 15:48 UTC (permalink / raw)
To: linux-omap-u79uwXL29TY76Z2rM5mHXA
Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, Maulik Mankad, Felipe Balbi,
Tony Lindgren
> +#ifdef CONFIG_USB_MUSB_OTG
> + .mode
> = MUSB_OTG,
> +#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
> + .mode
> = MUSB_HOST,
> +#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
> .mode
> = MUSB_PERIPHERAL,
> +#endif
> = MUSB_PERIPHERAL,
> +#endif
By the way ... the #ifdeffery should indeed vanish from all board
configs except the Davinci DM6446 EVM. That board is kind of quirky
in terms of USB support, and needs jumpering to get host or peripheral
mode (and can't do OTG). I suspect some of the other boards did a bad
thing and tried emulating what that board did.
But the description for such a patch would emphasize removing bogus
ifdeffery, to match the board hardware (which is not conditional but
is instead fixed).
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 20+ messages in thread* RE: [PATCH] ARM: OMAP: Fix board data to support device only, host only and OTG roles.
2010-05-20 15:48 ` David Brownell
@ 2010-05-21 5:15 ` Gupta, Ajay Kumar
2010-05-21 6:52 ` Felipe Balbi
2010-05-28 18:27 ` Steve Sakoman
1 sibling, 1 reply; 20+ messages in thread
From: Gupta, Ajay Kumar @ 2010-05-21 5:15 UTC (permalink / raw)
To: David Brownell, linux-omap@vger.kernel.org
Cc: linux-usb@vger.kernel.org, Mankad, Maulik Ojas, Felipe Balbi,
Tony Lindgren
Hi,
> > +#ifdef CONFIG_USB_MUSB_OTG
> > + .mode
> > = MUSB_OTG,
> > +#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
> > + .mode
> > = MUSB_HOST,
> > +#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
> > .mode
> > = MUSB_PERIPHERAL,
> > +#endif
>
> > = MUSB_PERIPHERAL,
> > +#endif
>
> By the way ... the #ifdeffery should indeed vanish from all board
> configs except the Davinci DM6446 EVM.
If we are claiming to support:
A. Same kernel would work on multiple boards
B. Single kernel for one single board
Then I think these #ifdefferys are required in all the board files.
Let's consider the OMAP3EVM which supports all the three modes and
If these #ifdefferys are not present and .mode is set to OTG.
Then if I choose to compile the Kernel only for peripheral mode
(Case-B above) then I would get below error from musb_core.c.
"incompatible Kconfig role setting"
-Ajay
> That board is kind of quirky
> in terms of USB support, and needs jumpering to get host or peripheral
> mode (and can't do OTG). I suspect some of the other boards did a bad
> thing and tried emulating what that board did.
>
> But the description for such a patch would emphasize removing bogus
> ifdeffery, to match the board hardware (which is not conditional but
> is instead fixed).
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] ARM: OMAP: Fix board data to support device only, host only and OTG roles.
2010-05-21 5:15 ` Gupta, Ajay Kumar
@ 2010-05-21 6:52 ` Felipe Balbi
[not found] ` <20100521065218.GG925-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2010-05-23 16:33 ` David Brownell
0 siblings, 2 replies; 20+ messages in thread
From: Felipe Balbi @ 2010-05-21 6:52 UTC (permalink / raw)
To: ext Gupta, Ajay Kumar
Cc: David Brownell, linux-omap@vger.kernel.org, Mankad, Maulik Ojas,
linux-usb@vger.kernel.org, Balbi Felipe (Nokia-D/Helsinki),
Tony Lindgren
On Fri, May 21, 2010 at 07:15:37AM +0200, ext Gupta, Ajay Kumar wrote:
>Hi,
>> > +#ifdef CONFIG_USB_MUSB_OTG
>> > + .mode
>> > = MUSB_OTG,
>> > +#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
>> > + .mode
>> > = MUSB_HOST,
>> > +#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
>> > .mode
>> > = MUSB_PERIPHERAL,
>> > +#endif
>>
>> > = MUSB_PERIPHERAL,
>> > +#endif
>>
>> By the way ... the #ifdeffery should indeed vanish from all board
>> configs except the Davinci DM6446 EVM.
>
>If we are claiming to support:
> A. Same kernel would work on multiple boards
> B. Single kernel for one single board
>
>Then I think these #ifdefferys are required in all the board files.
>
>Let's consider the OMAP3EVM which supports all the three modes and
you don't support "all three modes" you support OTG. If you want to
build for peripheral only, that's your choice, but the board is wired so
that it has OTG support.
>If these #ifdefferys are not present and .mode is set to OTG.
>Then if I choose to compile the Kernel only for peripheral mode
>(Case-B above) then I would get below error from musb_core.c.
>
>"incompatible Kconfig role setting"
there's a patch making that a warning instead of an #error if I'm not
wrong.
--
balbi
DefectiveByDesign.org
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 20+ messages in thread[parent not found: <20100521065218.GG925-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>]
* RE: [PATCH] ARM: OMAP: Fix board data to support device only, host only and OTG roles.
[not found] ` <20100521065218.GG925-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
@ 2010-05-21 7:43 ` Gupta, Ajay Kumar
[not found] ` <19F8576C6E063C45BE387C64729E7394044E535F3E-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2010-05-23 16:21 ` David Brownell
0 siblings, 2 replies; 20+ messages in thread
From: Gupta, Ajay Kumar @ 2010-05-21 7:43 UTC (permalink / raw)
To: felipe.balbi-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org
Cc: David Brownell,
linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Mankad, Maulik Ojas,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Tony Lindgren
Hi,
> On Fri, May 21, 2010 at 07:15:37AM +0200, ext Gupta, Ajay Kumar wrote:
> >Hi,
> >> > +#ifdef CONFIG_USB_MUSB_OTG
> >> > + .mode
> >> > = MUSB_OTG,
> >> > +#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
> >> > + .mode
> >> > = MUSB_HOST,
> >> > +#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
> >> > .mode
> >> > = MUSB_PERIPHERAL,
> >> > +#endif
> >>
> >> > = MUSB_PERIPHERAL,
> >> > +#endif
> >>
> >> By the way ... the #ifdeffery should indeed vanish from all board
> >> configs except the Davinci DM6446 EVM.
> >
> >If we are claiming to support:
> > A. Same kernel would work on multiple boards
> > B. Single kernel for one single board
> >
> >Then I think these #ifdefferys are required in all the board files.
> >
> >Let's consider the OMAP3EVM which supports all the three modes and
>
> you don't support "all three modes" you support OTG. If you want to
> build for peripheral only, that's your choice, but the board is wired so
> that it has OTG support.
I meant OTG with ID pin based role.
>
> >If these #ifdefferys are not present and .mode is set to OTG.
> >Then if I choose to compile the Kernel only for peripheral mode
> >(Case-B above) then I would get below error from musb_core.c.
> >
> >"incompatible Kconfig role setting"
>
> there's a patch making that a warning instead of an #error if I'm not
> wrong.
If that patch ([1] below) is taken then we can avoid all these #ifdefs.
[1] http://marc.info/?l=linux-usb&m=127367875600618&w=2
But I see comment from David on above patch [1] to fix board data
Instead which means using #ifdefs again in board files...
With all these discussion it's best to accept the above [1] patch and
Avoid having ugly #ifdefs from board files.
-Ajay
>
> --
> balbi
>
> DefectiveByDesign.org
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 20+ messages in thread[parent not found: <19F8576C6E063C45BE387C64729E7394044E535F3E-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>]
* Re: [PATCH] ARM: OMAP: Fix board data to support device only, host only and OTG roles.
[not found] ` <19F8576C6E063C45BE387C64729E7394044E535F3E-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
@ 2010-05-21 8:48 ` Felipe Balbi
0 siblings, 0 replies; 20+ messages in thread
From: Felipe Balbi @ 2010-05-21 8:48 UTC (permalink / raw)
To: ext Gupta, Ajay Kumar
Cc: Balbi Felipe (Nokia-D/Helsinki), David Brownell,
linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Mankad, Maulik Ojas,
linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Tony Lindgren
Hi,
On Fri, May 21, 2010 at 09:43:29AM +0200, ext Gupta, Ajay Kumar wrote:
>I meant OTG with ID pin based role.
that's the only OTG mode. If your board has OTG support, it will have to
act on ID pin.
--
balbi
DefectiveByDesign.org
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 20+ messages in thread
* RE: [PATCH] ARM: OMAP: Fix board data to support device only, host only and OTG roles.
2010-05-21 7:43 ` Gupta, Ajay Kumar
[not found] ` <19F8576C6E063C45BE387C64729E7394044E535F3E-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
@ 2010-05-23 16:21 ` David Brownell
1 sibling, 0 replies; 20+ messages in thread
From: David Brownell @ 2010-05-23 16:21 UTC (permalink / raw)
To: felipe.balbi@nokia.com, Ajay KumarGupta
Cc: linux-omap@vger.kernel.org, Maulik OjasMankad,
linux-usb@vger.kernel.org, Tony Lindgren
--- On Fri, 5/21/10, Gupta, Ajay Kumar <ajay.gupta@ti.com> wrote:
> > >Then I think these #ifdefferys are required in all
> the board files.
As I already explained: *NO*.
Unless the board has been designed in a flakey
manner (like the DM6446 EVM) it should
have no #ifdeffery in the MUSB configuration.
> > >Then if I choose to compile the Kernel only for
> peripheral mode
> > >(Case-B above) then I would get below error from
> musb_core.c.
> > >
> > >"incompatible Kconfig role setting"
That's a *correct* report that your config is broken.
The hardware has an OTG connector, so the kernel should
be supporting OTG mode. If it's not, that's an error;
don't try to hide such errors.
- Dave
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] ARM: OMAP: Fix board data to support device only, host only and OTG roles.
2010-05-21 6:52 ` Felipe Balbi
[not found] ` <20100521065218.GG925-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
@ 2010-05-23 16:33 ` David Brownell
[not found] ` <420791.3389.qm-g47maUHHHF8HBU+L9ui1Svu2YVrzzGjVVpNB7YpNyf8@public.gmane.org>
1 sibling, 1 reply; 20+ messages in thread
From: David Brownell @ 2010-05-23 16:33 UTC (permalink / raw)
To: Ajay Kumarext Gupta
Cc: linux-omap@vger.kernel.org, Maulik OjasMankad,
linux-usb@vger.kernel.org, Balbi Felipe (Nokia-D/Helsinki),
Tony Lindgren
>
> >"incompatible Kconfig role setting"
>
> there's a patch making that a warning instead of an #error
> if I'm not wrong.
It's not an #error, it's a dev_err().
But more to the point, it's reporting a real error. As
the comment in the code explains:
/* The driver might handle more features than
* the board; OK.
* Fail when the board needs a feature that's
* not enabled.
*/
Ut;s simple: OTG connectors require OTG support. Host
connectors require host support. Peripheral connectors require peripheral support. Why is anyone confused??
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] ARM: OMAP: Fix board data to support device only, host only and OTG roles.
2010-05-20 15:48 ` David Brownell
2010-05-21 5:15 ` Gupta, Ajay Kumar
@ 2010-05-28 18:27 ` Steve Sakoman
2010-05-28 18:32 ` David Brownell
1 sibling, 1 reply; 20+ messages in thread
From: Steve Sakoman @ 2010-05-28 18:27 UTC (permalink / raw)
To: David Brownell
Cc: linux-omap, Maulik Mankad, linux-usb, Felipe Balbi, Tony Lindgren
On Thu, May 20, 2010 at 8:48 AM, David Brownell <david-b@pacbell.net> wrote:
>
>> +#ifdef CONFIG_USB_MUSB_OTG
>> + .mode
>> = MUSB_OTG,
>> +#elif defined(CONFIG_USB_MUSB_HDRC_HCD)
>> + .mode
>> = MUSB_HOST,
>> +#elif defined(CONFIG_USB_GADGET_MUSB_HDRC)
>> .mode
>> = MUSB_PERIPHERAL,
>> +#endif
>
>> = MUSB_PERIPHERAL,
>> +#endif
>
> By the way ... the #ifdeffery should indeed vanish from all board
> configs except the Davinci DM6446 EVM. That board is kind of quirky
> in terms of USB support, and needs jumpering to get host or peripheral
> mode (and can't do OTG). I suspect some of the other boards did a bad
> thing and tried emulating what that board did.
For Overo this patch actually makes quite a bit of sense (and I have
been using something similar for quite some time).
The Overo COM itself has no USB connector -- the customer can choose
or create a daughter card with the type of USB connector appropriate
to their application, be it host, peripheral, or OTG. Having the mode
easily settable via a config option allows them to use the standard
board file without modification.
Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PATCH] ARM: OMAP: Fix board data to support device only, host only and OTG roles.
2010-05-28 18:27 ` Steve Sakoman
@ 2010-05-28 18:32 ` David Brownell
[not found] ` <987022.25256.qm-g47maUHHHF/6X00i2u5GFvu2YVrzzGjVVpNB7YpNyf8@public.gmane.org>
0 siblings, 1 reply; 20+ messages in thread
From: David Brownell @ 2010-05-28 18:32 UTC (permalink / raw)
To: Steve Sakoman
Cc: linux-omap, Maulik Mankad, linux-usb, Felipe Balbi, Tony Lindgren
--- On Fri, 5/28/10, Steve Sakoman <sakoman@gmail.com> wrote:
> > By the way ... the #ifdeffery should indeed vanish
> from all board
> > configs except the Davinci DM6446 EVM. That board is
> kind of quirky
> > in terms of USB support, and needs jumpering to get
> host or peripheral mode (and can't do OTG).
> For Overo this patch actually makes quite a bit of sense
> (and I have
> been using something similar for quite some time).
>
> The Overo COM itself has no USB connector -- the customer
> can choose
> or create a daughter card with the type of USB connector
> appropriate> to their application,
So that would be another exception ... because it doesn't
have a fixed USB connector (and thus does not convey to
users any specific details about what modes it supports).
- Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2010-05-31 12:53 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-20 13:09 [PATCH] ARM: OMAP: Fix board data to support device only, host only and OTG roles Maulik Mankad
2010-05-20 14:00 ` Gupta, Ajay Kumar
2010-05-20 15:15 ` David Brownell
[not found] ` <304844.15257.qm-4JhmkcZgSkkHBU+L9ui1Svu2YVrzzGjVVpNB7YpNyf8@public.gmane.org>
2010-05-20 15:16 ` Felipe Balbi
2010-05-20 15:40 ` David Brownell
[not found] ` <1274360966-9974-1-git-send-email-x0082077-l0cyMroinI0@public.gmane.org>
2010-05-20 15:48 ` David Brownell
2010-05-21 5:15 ` Gupta, Ajay Kumar
2010-05-21 6:52 ` Felipe Balbi
[not found] ` <20100521065218.GG925-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2010-05-21 7:43 ` Gupta, Ajay Kumar
[not found] ` <19F8576C6E063C45BE387C64729E7394044E535F3E-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2010-05-21 8:48 ` Felipe Balbi
2010-05-23 16:21 ` David Brownell
2010-05-23 16:33 ` David Brownell
[not found] ` <420791.3389.qm-g47maUHHHF8HBU+L9ui1Svu2YVrzzGjVVpNB7YpNyf8@public.gmane.org>
2010-05-28 15:36 ` Gadiyar, Anand
2010-05-28 15:48 ` Ming Lei
2010-05-28 15:55 ` Ming Lei
2010-05-28 18:27 ` Steve Sakoman
2010-05-28 18:32 ` David Brownell
[not found] ` <987022.25256.qm-g47maUHHHF/6X00i2u5GFvu2YVrzzGjVVpNB7YpNyf8@public.gmane.org>
2010-05-31 9:44 ` Grazvydas Ignotas
2010-05-31 9:56 ` Felipe Balbi
[not found] ` <AANLkTin-Ud-BdQ3lcydqZx7Tb1YoBq05XCONeYqxWhZm-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-05-31 12:53 ` David Brownell
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).