musb_hcd.h 2.4 KB

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