aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb
diff options
context:
space:
mode:
authorGiuseppe GORGOGLIONE <giuseppe.gorgoglione@st.com>2009-02-24 18:27:34 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2009-03-24 19:20:36 -0400
commit322337168f22e8245aae7f38e84c5711cd4c1265 (patch)
treea6212f86d555a538aae06d55f00043c43fe92dcd /drivers/usb/musb
parent1e0320f0d46022d12ddc84516cbdb8865e8cd744 (diff)
USB: musb: fix init oops crash with static FIFO config
Correct musb_read_fifosize() and musb_configure_ep0() functions for the #ifndef BLACKFIN branch when the silicon uses static FIFO configuration. (Most current silicon configures this controller to use dynamic FIFO configuration; some parts from ST don't, like the STM STA2062.) Signed-off-by: Giuseppe GORGOGLIONE <giuseppe.gorgoglione@st.com> Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r--drivers/usb/musb/musb_core.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index adf1806007ff..efb39b5e55b5 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -478,10 +478,11 @@ static inline void musb_configure_ep0(struct musb *musb)
478static inline int musb_read_fifosize(struct musb *musb, 478static inline int musb_read_fifosize(struct musb *musb,
479 struct musb_hw_ep *hw_ep, u8 epnum) 479 struct musb_hw_ep *hw_ep, u8 epnum)
480{ 480{
481 void *mbase = musb->mregs;
481 u8 reg = 0; 482 u8 reg = 0;
482 483
483 /* read from core using indexed model */ 484 /* read from core using indexed model */
484 reg = musb_readb(hw_ep->regs, 0x10 + MUSB_FIFOSIZE); 485 reg = musb_readb(mbase, MUSB_EP_OFFSET(epnum, MUSB_FIFOSIZE));
485 /* 0's returned when no more endpoints */ 486 /* 0's returned when no more endpoints */
486 if (!reg) 487 if (!reg)
487 return -ENODEV; 488 return -ENODEV;
@@ -508,6 +509,7 @@ static inline void musb_configure_ep0(struct musb *musb)
508{ 509{
509 musb->endpoints[0].max_packet_sz_tx = MUSB_EP0_FIFOSIZE; 510 musb->endpoints[0].max_packet_sz_tx = MUSB_EP0_FIFOSIZE;
510 musb->endpoints[0].max_packet_sz_rx = MUSB_EP0_FIFOSIZE; 511 musb->endpoints[0].max_packet_sz_rx = MUSB_EP0_FIFOSIZE;
512 musb->endpoints[0].is_shared_fifo = true;
511} 513}
512#endif /* CONFIG_BLACKFIN */ 514#endif /* CONFIG_BLACKFIN */
513 515