commit: http://blackfin.uclinux.org/git/?p=linux-kernel;a=commitdiff;h=6fc0b66afed084fa63ec9ff98d2cac518653398e branch: http://blackfin.uclinux.org/git/?p=linux-kernel;a=shortlog;h=refs/heads/trunk
Signed-off-by: Bob Liu <[email protected]> --- drivers/usb/musb/Kconfig | 3 ++- drivers/usb/musb/blackfin.c | 28 ++++++++++++++++++++++------ drivers/usb/musb/musb_core.c | 2 +- drivers/usb/musb/musb_core.h | 2 +- drivers/usb/musb/musb_io.h | 2 +- drivers/usb/musb/musb_regs.h | 2 +- 6 files changed, 28 insertions(+), 11 deletions(-) diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig index f70cab3..0fb1466 100644 --- a/drivers/usb/musb/Kconfig +++ b/drivers/usb/musb/Kconfig @@ -7,6 +7,7 @@ config USB_MUSB_HDRC tristate 'Inventra Highspeed Dual Role Controller (TI, ADI, ...)' depends on USB && USB_GADGET + depends on (ARM || (BF54x && !BF544) || (BF52x && !BF522 && !BF523) || (BF60x)) select NOP_USB_XCEIV if (ARCH_DAVINCI || MACH_OMAP3EVM || BLACKFIN) select TWL4030_USB if MACH_OMAP_3430SDP select TWL6030_USB if MACH_OMAP_4430SDP || MACH_OMAP4_PANDA @@ -56,7 +57,7 @@ config USB_MUSB_AM35X config USB_MUSB_BLACKFIN tristate "Blackfin" - depends on (BF54x && !BF544) || (BF52x && ! BF522 && !BF523) + depends on (BF54x && !BF544) || (BF52x && ! BF522 && !BF523) || (BF60x) config USB_MUSB_UX500 tristate "U8500 and U5500" diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index a052a85..3b2eeaa 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c @@ -34,6 +34,7 @@ struct bfin_glue { /* * Load an endpoint's FIFO */ +#ifndef CONFIG_BF60x void musb_write_fifo(struct musb_hw_ep *hw_ep, u16 len, const u8 *src) { struct musb *musb = hw_ep->musb; @@ -162,6 +163,7 @@ void musb_read_fifo(struct musb_hw_ep *hw_ep, u16 len, u8 *dst) dump_fifo_data(dst, len); } +#endif static irqreturn_t blackfin_interrupt(int irq, void *__hci) { @@ -174,7 +176,6 @@ static irqreturn_t blackfin_interrupt(int irq, void *__hci) musb->int_usb = musb_readb(musb->mregs, MUSB_INTRUSB); musb->int_tx = musb_readw(musb->mregs, MUSB_INTRTX); musb->int_rx = musb_readw(musb->mregs, MUSB_INTRRX); - if (musb->int_usb || musb->int_tx || musb->int_rx) { musb_writeb(musb->mregs, MUSB_INTRUSB, musb->int_usb); musb_writew(musb->mregs, MUSB_INTRTX, musb->int_tx); @@ -216,10 +217,14 @@ static void musb_conn_timer_handler(unsigned long _musb) val = musb_readw(musb->mregs, MUSB_DEVCTL); if (!(val & MUSB_DEVCTL_BDEVICE)) { +#ifndef CONFIG_BF60x gpio_set_value(musb->config->gpio_vrsel, 1); +#endif musb->xceiv->state = OTG_STATE_A_WAIT_BCON; } else { +#ifndef CONFIG_BF60x gpio_set_value(musb->config->gpio_vrsel, 0); +#endif /* Ignore VBUSERROR and SUSPEND IRQ */ val = musb_readb(musb->mregs, MUSB_INTRUSBE); val &= ~MUSB_INTR_VBUSERROR; @@ -247,11 +252,14 @@ static void musb_conn_timer_handler(unsigned long _musb) val = musb_readw(musb->mregs, MUSB_DEVCTL); if (!(val & MUSB_DEVCTL_BDEVICE)) { +#ifndef CONFIG_BF60x gpio_set_value(musb->config->gpio_vrsel, 1); +#endif musb->xceiv->state = OTG_STATE_A_WAIT_BCON; } else { +#ifndef CONFIG_BF60x gpio_set_value(musb->config->gpio_vrsel, 0); - +#endif /* Ignore VBUSERROR and SUSPEND IRQ */ val = musb_readb(musb->mregs, MUSB_INTRUSBE); val &= ~MUSB_INTR_VBUSERROR; @@ -361,6 +369,7 @@ static int bfin_musb_adjust_channel_params(struct dma_channel *channel, static void bfin_musb_reg_init(struct musb *musb) { +#ifndef CONFIG_BF60x if (ANOMALY_05000346) { bfin_write_USB_APHY_CALIB(ANOMALY_05000346_value); SSYNC(); @@ -395,11 +404,17 @@ static void bfin_musb_reg_init(struct musb *musb) EP2_RX_ENA | EP3_RX_ENA | EP4_RX_ENA | EP5_RX_ENA | EP6_RX_ENA | EP7_RX_ENA); SSYNC(); +#else + bfin_write_USB_VBUS_CTL(0x00); + bfin_write_USB_APHY_CNTRL(0x80); + SSYNC(); + musb->config->ram_bits = musb_readb(musb->mregs, MUSB_RAMINFO) & 0xf; +#endif } static int bfin_musb_init(struct musb *musb) { - +#ifndef CONFIG_BF60x /* * Rev 1.0 BF549 EZ-KITs require PE7 to be high for both DEVICE * and OTG HOST modes, while rev 1.1 and greater require PE7 to @@ -413,7 +428,7 @@ static int bfin_musb_init(struct musb *musb) return -ENODEV; } gpio_direction_output(musb->config->gpio_vrsel, 0); - +#endif usb_nop_xceiv_register(); musb->xceiv = otg_get_transceiver(); if (!musb->xceiv) { @@ -422,16 +437,17 @@ static int bfin_musb_init(struct musb *musb) } bfin_musb_reg_init(musb); - if (is_host_enabled(musb)) { setup_timer(&musb_conn_timer, musb_conn_timer_handler, (unsigned long) musb); } +#ifndef CONFIG_BF60x if (is_peripheral_enabled(musb)) musb->xceiv->set_power = bfin_musb_set_power; - musb->isr = blackfin_interrupt; musb->double_buffer_not_ok = true; +#endif + musb->isr = blackfin_interrupt; return 0; } diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index ec2c5b4..3a70cf3 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -207,7 +207,7 @@ static struct otg_io_access_ops musb_ulpi_access = { /*-------------------------------------------------------------------------*/ -#if !defined(CONFIG_USB_MUSB_TUSB6010) && !defined(CONFIG_USB_MUSB_BLACKFIN) +#if !defined(CONFIG_USB_MUSB_TUSB6010) && (!defined(CONFIG_USB_MUSB_BLACKFIN) || CONFIG_BF60x) /* * Load an endpoint's FIFO diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index 3d28fb8..f607405 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -463,7 +463,7 @@ static inline struct musb *gadget_to_musb(struct usb_gadget *g) return container_of(g, struct musb, g); } -#ifdef CONFIG_BLACKFIN +#if defined(CONFIG_BLACKFIN) && !defined(CONFIG_BF60x) static inline int musb_read_fifosize(struct musb *musb, struct musb_hw_ep *hw_ep, u8 epnum) { diff --git a/drivers/usb/musb/musb_io.h b/drivers/usb/musb/musb_io.h index 1d5eda2..d12874b 100644 --- a/drivers/usb/musb/musb_io.h +++ b/drivers/usb/musb/musb_io.h @@ -57,7 +57,7 @@ static inline void writesb(const void __iomem *addr, const void *buf, int len) #endif -#ifndef CONFIG_BLACKFIN +#if !defined(CONFIG_BLACKFIN) || defined(CONFIG_BF60x) /* NOTE: these offsets are all in bytes */ diff --git a/drivers/usb/musb/musb_regs.h b/drivers/usb/musb/musb_regs.h index 03f2655..bffa4a1 100644 --- a/drivers/usb/musb/musb_regs.h +++ b/drivers/usb/musb/musb_regs.h @@ -214,7 +214,7 @@ #define MUSB_HUBADDR_MULTI_TT 0x80 -#ifndef CONFIG_BLACKFIN +#if !defined(CONFIG_BLACKFIN) || defined(CONFIG_BF60x) /* * Common USB registers
_______________________________________________ Linux-kernel-commits mailing list [email protected] https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits
