Hi Andy, Constantine,
We're interested in this item too.
Is this Kconfig change sufficient for what we want? I'm not sure, but I
think there is more to be changed. It seems to me that Host/Peripheral
mode is selected by Kconfig and hardcoded in kernel image. See
arch/arm/mach-davinci/board-evm.c and drivers/usb/musb/davinci.c:
*board-evm.c:*
static struct musb_hdrc_platform_data usb_data = {
#if defined(CONFIG_USB_MUSB_OTG)
/* OTG requires a Mini-AB connector */
.mode = MUSB_OTG,
#elif defined(CONFIG_USB_MUSB_PERIPHERAL)
.mode = MUSB_PERIPHERAL,
#elif defined(CONFIG_USB_MUSB_HOST)
.mode = MUSB_HOST,
#endif
/* irlml6401 switches 5V */
.power = 255, /* sustains 3.0+ Amps (!) */
.potpgt = 4, /* ~8 msec */
/* REVISIT multipoint is a _chip_ capability; not board
specific */
.multipoint = 1,
};
*davinci.c:musb_init_controller()*
switch (plat->mode) {
case MUSB_HOST:
#ifdef CONFIG_USB_MUSB_HDRC_HCD
break;
#else
goto bad_config;
#endif
case MUSB_PERIPHERAL:
#ifdef CONFIG_USB_GADGET_MUSB_HDRC
break;
#else
goto bad_config;
#endif
case MUSB_OTG:
#ifdef CONFIG_USB_MUSB_OTG
break;
#else
bad_config:
#endif
default:
dev_dbg(dev, "incompatible Kconfig role
setting\n");
return -EINVAL;
}
Shouldn't this be fixed too?
BR,
Ivan
Constantine Shulyupin wrote:
Yes, it is possibe.
You need to make a trick:
alter file drivers/usb/musb/Kconfig
comment a line:
config USB_MUSB_HDRC
#depends on USB || USB_GADGET
(tested on v1.1)
Then configure, compile an use.
On Fri, 2007-03-23 at 18:18 -0700, Andy Ngo wrote:
Hi guys,
On a related USB item, can I built just "one" kernel image that can
support either host or peripheral modes? Our hardware
engineer is planning to use a Xilinx FPGA register to select the
termination for the USB host/client configuration. Hence
we can configure USB for host or client based on the value of the
register. We're not using OTG, but just either host or
peripheral; we don't want 2 separate kernel images one for each mode.
Is this possible? We're planning to compile the
USB-related drivers as modules and just load the ones we need to use
based on the mode.
Thanks.
Regards,
Andy
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source