2008-07-24 17:27:36 +08:00
|
|
|
/*
|
|
|
|
* This is used to for host and peripheral modes of the driver for
|
|
|
|
* Inventra (Multidrop) Highspeed Dual-Role Controllers: (M)HDRC.
|
|
|
|
*
|
|
|
|
* Board initialization should put one of these into dev->platform_data,
|
|
|
|
* probably on some platform_device named "musb_hdrc". It encapsulates
|
|
|
|
* key configuration differences between boards.
|
|
|
|
*/
|
|
|
|
|
2009-04-22 11:52:54 +08:00
|
|
|
#ifndef __LINUX_USB_MUSB_H
|
|
|
|
#define __LINUX_USB_MUSB_H
|
|
|
|
|
2008-07-24 17:27:36 +08:00
|
|
|
/* The USB role is defined by the connector used on the board, so long as
|
|
|
|
* standards are being followed. (Developer boards sometimes won't.)
|
|
|
|
*/
|
|
|
|
enum musb_mode {
|
|
|
|
MUSB_UNDEFINED = 0,
|
|
|
|
MUSB_HOST, /* A or Mini-A connector */
|
|
|
|
MUSB_PERIPHERAL, /* B or Mini-B connector */
|
|
|
|
MUSB_OTG /* Mini-AB connector */
|
|
|
|
};
|
|
|
|
|
|
|
|
struct clk;
|
|
|
|
|
2010-03-12 16:29:06 +08:00
|
|
|
enum musb_fifo_style {
|
|
|
|
FIFO_RXTX,
|
|
|
|
FIFO_TX,
|
|
|
|
FIFO_RX
|
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
|
|
|
enum musb_buf_mode {
|
|
|
|
BUF_SINGLE,
|
|
|
|
BUF_DOUBLE
|
|
|
|
} __attribute__ ((packed));
|
|
|
|
|
|
|
|
struct musb_fifo_cfg {
|
|
|
|
u8 hw_ep_num;
|
|
|
|
enum musb_fifo_style style;
|
|
|
|
enum musb_buf_mode mode;
|
|
|
|
u16 maxpacket;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define MUSB_EP_FIFO(ep, st, m, pkt) \
|
|
|
|
{ \
|
|
|
|
.hw_ep_num = ep, \
|
|
|
|
.style = st, \
|
|
|
|
.mode = m, \
|
|
|
|
.maxpacket = pkt, \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define MUSB_EP_FIFO_SINGLE(ep, st, pkt) \
|
|
|
|
MUSB_EP_FIFO(ep, st, BUF_SINGLE, pkt)
|
|
|
|
|
|
|
|
#define MUSB_EP_FIFO_DOUBLE(ep, st, pkt) \
|
|
|
|
MUSB_EP_FIFO(ep, st, BUF_DOUBLE, pkt)
|
|
|
|
|
2008-08-08 17:40:54 +08:00
|
|
|
struct musb_hdrc_eps_bits {
|
|
|
|
const char name[16];
|
|
|
|
u8 bits;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct musb_hdrc_config {
|
2010-03-12 16:29:06 +08:00
|
|
|
struct musb_fifo_cfg *fifo_cfg; /* board fifo configuration */
|
|
|
|
unsigned fifo_cfg_size; /* size of the fifo configuration */
|
|
|
|
|
2008-08-08 17:40:54 +08:00
|
|
|
/* MUSB configuration-specific details */
|
|
|
|
unsigned multipoint:1; /* multipoint device */
|
2010-01-21 21:33:55 +08:00
|
|
|
unsigned dyn_fifo:1 __deprecated; /* supports dynamic fifo sizing */
|
|
|
|
unsigned soft_con:1 __deprecated; /* soft connect required */
|
|
|
|
unsigned utm_16:1 __deprecated; /* utm data witdh is 16 bits */
|
2008-08-08 17:40:54 +08:00
|
|
|
unsigned big_endian:1; /* true if CPU uses big-endian */
|
|
|
|
unsigned mult_bulk_tx:1; /* Tx ep required for multbulk pkts */
|
|
|
|
unsigned mult_bulk_rx:1; /* Rx ep required for multbulk pkts */
|
|
|
|
unsigned high_iso_tx:1; /* Tx ep required for HB iso */
|
|
|
|
unsigned high_iso_rx:1; /* Rx ep required for HD iso */
|
2010-01-21 21:33:55 +08:00
|
|
|
unsigned dma:1 __deprecated; /* supports DMA */
|
|
|
|
unsigned vendor_req:1 __deprecated; /* vendor registers required */
|
2008-08-08 17:40:54 +08:00
|
|
|
|
|
|
|
u8 num_eps; /* number of endpoints _with_ ep0 */
|
2010-01-21 21:33:55 +08:00
|
|
|
u8 dma_channels __deprecated; /* number of dma channels */
|
2008-08-08 17:40:54 +08:00
|
|
|
u8 dyn_fifo_size; /* dynamic size in bytes */
|
2010-01-21 21:33:55 +08:00
|
|
|
u8 vendor_ctrl __deprecated; /* vendor control reg width */
|
|
|
|
u8 vendor_stat __deprecated; /* vendor status reg witdh */
|
|
|
|
u8 dma_req_chan __deprecated; /* bitmask for required dma channels */
|
2008-08-08 17:40:54 +08:00
|
|
|
u8 ram_bits; /* ram address size */
|
|
|
|
|
2010-01-21 21:33:55 +08:00
|
|
|
struct musb_hdrc_eps_bits *eps_bits __deprecated;
|
2008-12-03 03:33:43 +08:00
|
|
|
#ifdef CONFIG_BLACKFIN
|
2010-05-18 01:58:12 +08:00
|
|
|
/* A GPIO controlling VRSEL in Blackfin */
|
|
|
|
unsigned int gpio_vrsel;
|
2010-03-12 16:29:10 +08:00
|
|
|
unsigned int gpio_vrsel_active;
|
2008-12-03 03:33:43 +08:00
|
|
|
#endif
|
|
|
|
|
2008-08-08 17:40:54 +08:00
|
|
|
};
|
|
|
|
|
2008-07-24 17:27:36 +08:00
|
|
|
struct musb_hdrc_platform_data {
|
|
|
|
/* MUSB_HOST, MUSB_PERIPHERAL, or MUSB_OTG */
|
|
|
|
u8 mode;
|
|
|
|
|
|
|
|
/* for clk_get() */
|
|
|
|
const char *clock;
|
|
|
|
|
|
|
|
/* (HOST or OTG) switch VBUS on/off */
|
|
|
|
int (*set_vbus)(struct device *dev, int is_on);
|
|
|
|
|
|
|
|
/* (HOST or OTG) mA/2 power supplied on (default = 8mA) */
|
|
|
|
u8 power;
|
|
|
|
|
|
|
|
/* (PERIPHERAL) mA/2 max power consumed (default = 100mA) */
|
|
|
|
u8 min_power;
|
|
|
|
|
|
|
|
/* (HOST or OTG) msec/2 after VBUS on till power good */
|
|
|
|
u8 potpgt;
|
|
|
|
|
2009-12-28 19:40:42 +08:00
|
|
|
/* (HOST or OTG) program PHY for external Vbus */
|
|
|
|
unsigned extvbus:1;
|
|
|
|
|
2008-07-24 17:27:36 +08:00
|
|
|
/* Power the device on or off */
|
|
|
|
int (*set_power)(int state);
|
|
|
|
|
|
|
|
/* Turn device clock on or off */
|
|
|
|
int (*set_clock)(struct clk *clock, int is_on);
|
2008-08-08 17:40:54 +08:00
|
|
|
|
|
|
|
/* MUSB configuration-specific details */
|
|
|
|
struct musb_hdrc_config *config;
|
2010-02-18 06:09:30 +08:00
|
|
|
|
|
|
|
/* Architecture specific board data */
|
|
|
|
void *board_data;
|
2008-07-24 17:27:36 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* TUSB 6010 support */
|
|
|
|
|
|
|
|
#define TUSB6010_OSCCLK_60 16667 /* psec/clk @ 60.0 MHz */
|
|
|
|
#define TUSB6010_REFCLK_24 41667 /* psec/clk @ 24.0 MHz XI */
|
|
|
|
#define TUSB6010_REFCLK_19 52083 /* psec/clk @ 19.2 MHz CLKIN */
|
|
|
|
|
|
|
|
#ifdef CONFIG_ARCH_OMAP2
|
|
|
|
|
|
|
|
extern int __init tusb6010_setup_interface(
|
|
|
|
struct musb_hdrc_platform_data *data,
|
|
|
|
unsigned ps_refclk, unsigned waitpin,
|
|
|
|
unsigned async_cs, unsigned sync_cs,
|
|
|
|
unsigned irq, unsigned dmachan);
|
|
|
|
|
|
|
|
extern int tusb6010_platform_retime(unsigned is_refclk);
|
|
|
|
|
|
|
|
#endif /* OMAP2 */
|
2009-04-22 11:52:54 +08:00
|
|
|
|
|
|
|
#endif /* __LINUX_USB_MUSB_H */
|