musb_hcd.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * Mentor USB OTG Core host controller driver.
  3. *
  4. * Copyright (c) 2008 Texas Instruments
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. *
  8. * Author: Thomas Abraham t-abraham@ti.com, Texas Instruments
  9. */
  10. #ifndef __MUSB_HCD_H__
  11. #define __MUSB_HCD_H__
  12. #include "musb_core.h"
  13. #ifdef CONFIG_USB_KEYBOARD
  14. #include <stdio_dev.h>
  15. extern unsigned char new[];
  16. #endif
  17. #ifndef CONFIG_USB_MUSB_TIMEOUT
  18. # define CONFIG_USB_MUSB_TIMEOUT 100000
  19. #endif
  20. /* This defines the endpoint number used for control transfers */
  21. #define MUSB_CONTROL_EP 0
  22. /* This defines the endpoint number used for bulk transfer */
  23. #ifndef MUSB_BULK_EP
  24. # define MUSB_BULK_EP 1
  25. #endif
  26. /* This defines the endpoint number used for interrupt transfer */
  27. #define MUSB_INTR_EP 2
  28. /* Determine the operating speed of MUSB core */
  29. #define musb_ishighspeed() \
  30. ((readb(&musbr->power) & MUSB_POWER_HSMODE) \
  31. >> MUSB_POWER_HSMODE_SHIFT)
  32. /* USB HUB CONSTANTS (not OHCI-specific; see hub.h) */
  33. /* destination of request */
  34. #define RH_INTERFACE 0x01
  35. #define RH_ENDPOINT 0x02
  36. #define RH_OTHER 0x03
  37. #define RH_CLASS 0x20
  38. #define RH_VENDOR 0x40
  39. /* Requests: bRequest << 8 | bmRequestType */
  40. #define RH_GET_STATUS 0x0080
  41. #define RH_CLEAR_FEATURE 0x0100
  42. #define RH_SET_FEATURE 0x0300
  43. #define RH_SET_ADDRESS 0x0500
  44. #define RH_GET_DESCRIPTOR 0x0680
  45. #define RH_SET_DESCRIPTOR 0x0700
  46. #define RH_GET_CONFIGURATION 0x0880
  47. #define RH_SET_CONFIGURATION 0x0900
  48. #define RH_GET_STATE 0x0280
  49. #define RH_GET_INTERFACE 0x0A80
  50. #define RH_SET_INTERFACE 0x0B00
  51. #define RH_SYNC_FRAME 0x0C80
  52. /* Our Vendor Specific Request */
  53. #define RH_SET_EP 0x2000
  54. /* Hub port features */
  55. #define RH_PORT_CONNECTION 0x00
  56. #define RH_PORT_ENABLE 0x01
  57. #define RH_PORT_SUSPEND 0x02
  58. #define RH_PORT_OVER_CURRENT 0x03
  59. #define RH_PORT_RESET 0x04
  60. #define RH_PORT_POWER 0x08
  61. #define RH_PORT_LOW_SPEED 0x09
  62. #define RH_C_PORT_CONNECTION 0x10
  63. #define RH_C_PORT_ENABLE 0x11
  64. #define RH_C_PORT_SUSPEND 0x12
  65. #define RH_C_PORT_OVER_CURRENT 0x13
  66. #define RH_C_PORT_RESET 0x14
  67. /* Hub features */
  68. #define RH_C_HUB_LOCAL_POWER 0x00
  69. #define RH_C_HUB_OVER_CURRENT 0x01
  70. #define RH_DEVICE_REMOTE_WAKEUP 0x00
  71. #define RH_ENDPOINT_STALL 0x01
  72. #define RH_ACK 0x01
  73. #define RH_REQ_ERR -1
  74. #define RH_NACK 0x00
  75. /* extern functions */
  76. extern int musb_platform_init(void);
  77. extern void musb_platform_deinit(void);
  78. #endif /* __MUSB_HCD_H__ */