From: Ravi B Date: Mon, 6 Dec 2010 13:01:08 +0000 (+0530) Subject: musb: select fifo_mode at runtime X-Git-Url: https://git.ti.com/gitweb?p=sitara-epos%2Fsitara-epos-kernel.git;a=commitdiff_plain;h=1f93f2761ea4564c7a562db37436fd210595f2dd musb: select fifo_mode at runtime OMAP35x han an errata restricting active endpoints to use either first 8K or next 8K of FIFO space while this issue has been fixed in OMAP3630. This issue requires the OMAP35x platform to use fifo_mode=5 but OMAP3630 and AM35x can use fifo_mode=4 which utilises entire 16K of FIFO. Signed-off-by: Ajay Kumar Gupta Signed-off-by: Sriramakrishnan A G Signed-off-by: Vaibhav Hiremath --- diff --git a/arch/arm/mach-omap2/usb-musb.c b/arch/arm/mach-omap2/usb-musb.c index 8d5ed775dd56..8387501c1406 100644 --- a/arch/arm/mach-omap2/usb-musb.c +++ b/arch/arm/mach-omap2/usb-musb.c @@ -34,6 +34,7 @@ #include "mux.h" static struct musb_hdrc_config musb_config = { + .fifo_mode = 4, .multipoint = 1, .dyn_fifo = 1, .num_eps = 16, @@ -90,6 +91,14 @@ void __init usb_musb_init(struct omap_musb_board_data *musb_board_data) musb_plat.mode = board_data->mode; musb_plat.extvbus = board_data->extvbus; + /* + * OMAP3630/AM35x platform has MUSB RTL-1.8 which has the fix for the + * issue restricting active endpoints to use first 8K of FIFO space. + * This issue restricts OMAP35x platform to use fifo_mode '5'. + */ + if (cpu_is_omap3430()) + musb_config.fifo_mode = 5; + if (cpu_is_omap3517() || cpu_is_omap3505()) { oh_name = "am35x_otg_hs"; name = "musb-am35x"; diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 754cf1192c3b..88e661ef4e69 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1235,7 +1235,9 @@ static int __devinit ep_config_from_table(struct musb *musb) int offset; struct musb_hw_ep *hw_ep = musb->endpoints; - if (musb->config->fifo_cfg) { + if (musb->config->fifo_mode) { + fifo_mode = musb->config->fifo_mode; + } else if (musb->config->fifo_cfg) { cfg = musb->config->fifo_cfg; n = musb->config->fifo_cfg_size; goto done; diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index eb505250940a..2c59816c56c5 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h @@ -62,6 +62,7 @@ struct musb_hdrc_eps_bits { struct musb_hdrc_config { struct musb_fifo_cfg *fifo_cfg; /* board fifo configuration */ unsigned fifo_cfg_size; /* size of the fifo configuration */ + unsigned short fifo_mode; /* fifo mode to be selected */ /* MUSB configuration-specific details */ unsigned multipoint:1; /* multipoint device */