musb.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*
  2. * This is used to for host and peripheral modes of the driver for
  3. * Inventra (Multidrop) Highspeed Dual-Role Controllers: (M)HDRC.
  4. *
  5. * Board initialization should put one of these into dev->platform_data,
  6. * probably on some platform_device named "musb_hdrc". It encapsulates
  7. * key configuration differences between boards.
  8. */
  9. /* The USB role is defined by the connector used on the board, so long as
  10. * standards are being followed. (Developer boards sometimes won't.)
  11. */
  12. enum musb_mode {
  13. MUSB_UNDEFINED = 0,
  14. MUSB_HOST, /* A or Mini-A connector */
  15. MUSB_PERIPHERAL, /* B or Mini-B connector */
  16. MUSB_OTG /* Mini-AB connector */
  17. };
  18. struct clk;
  19. struct musb_hdrc_eps_bits {
  20. const char name[16];
  21. u8 bits;
  22. };
  23. struct musb_hdrc_config {
  24. /* MUSB configuration-specific details */
  25. unsigned multipoint:1; /* multipoint device */
  26. unsigned dyn_fifo:1; /* supports dynamic fifo sizing */
  27. unsigned soft_con:1; /* soft connect required */
  28. unsigned utm_16:1; /* utm data witdh is 16 bits */
  29. unsigned big_endian:1; /* true if CPU uses big-endian */
  30. unsigned mult_bulk_tx:1; /* Tx ep required for multbulk pkts */
  31. unsigned mult_bulk_rx:1; /* Rx ep required for multbulk pkts */
  32. unsigned high_iso_tx:1; /* Tx ep required for HB iso */
  33. unsigned high_iso_rx:1; /* Rx ep required for HD iso */
  34. unsigned dma:1; /* supports DMA */
  35. unsigned vendor_req:1; /* vendor registers required */
  36. u8 num_eps; /* number of endpoints _with_ ep0 */
  37. u8 dma_channels; /* number of dma channels */
  38. u8 dyn_fifo_size; /* dynamic size in bytes */
  39. u8 vendor_ctrl; /* vendor control reg width */
  40. u8 vendor_stat; /* vendor status reg witdh */
  41. u8 dma_req_chan; /* bitmask for required dma channels */
  42. u8 ram_bits; /* ram address size */
  43. struct musb_hdrc_eps_bits *eps_bits;
  44. #ifdef CONFIG_BLACKFIN
  45. /* A GPIO controlling VRSEL in Blackfin */
  46. unsigned int gpio_vrsel;
  47. #endif
  48. };
  49. struct musb_hdrc_platform_data {
  50. /* MUSB_HOST, MUSB_PERIPHERAL, or MUSB_OTG */
  51. u8 mode;
  52. /* for clk_get() */
  53. const char *clock;
  54. /* (HOST or OTG) switch VBUS on/off */
  55. int (*set_vbus)(struct device *dev, int is_on);
  56. /* (HOST or OTG) mA/2 power supplied on (default = 8mA) */
  57. u8 power;
  58. /* (PERIPHERAL) mA/2 max power consumed (default = 100mA) */
  59. u8 min_power;
  60. /* (HOST or OTG) msec/2 after VBUS on till power good */
  61. u8 potpgt;
  62. /* Power the device on or off */
  63. int (*set_power)(int state);
  64. /* Turn device clock on or off */
  65. int (*set_clock)(struct clk *clock, int is_on);
  66. /* MUSB configuration-specific details */
  67. struct musb_hdrc_config *config;
  68. };
  69. /* TUSB 6010 support */
  70. #define TUSB6010_OSCCLK_60 16667 /* psec/clk @ 60.0 MHz */
  71. #define TUSB6010_REFCLK_24 41667 /* psec/clk @ 24.0 MHz XI */
  72. #define TUSB6010_REFCLK_19 52083 /* psec/clk @ 19.2 MHz CLKIN */
  73. #ifdef CONFIG_ARCH_OMAP2
  74. extern int __init tusb6010_setup_interface(
  75. struct musb_hdrc_platform_data *data,
  76. unsigned ps_refclk, unsigned waitpin,
  77. unsigned async_cs, unsigned sync_cs,
  78. unsigned irq, unsigned dmachan);
  79. extern int tusb6010_platform_retime(unsigned is_refclk);
  80. #endif /* OMAP2 */