bits.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * bits.h - register bits of the ChipIdea USB IP core
  3. *
  4. * Copyright (C) 2008 Chipidea - MIPS Technologies, Inc. All rights reserved.
  5. *
  6. * Author: David Lopo
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #ifndef __DRIVERS_USB_CHIPIDEA_BITS_H
  13. #define __DRIVERS_USB_CHIPIDEA_BITS_H
  14. /* HCCPARAMS */
  15. #define HCCPARAMS_LEN BIT(17)
  16. /* DCCPARAMS */
  17. #define DCCPARAMS_DEN (0x1F << 0)
  18. #define DCCPARAMS_DC BIT(7)
  19. /* TESTMODE */
  20. #define TESTMODE_FORCE BIT(0)
  21. /* USBCMD */
  22. #define USBCMD_RS BIT(0)
  23. #define USBCMD_RST BIT(1)
  24. #define USBCMD_SUTW BIT(13)
  25. #define USBCMD_ATDTW BIT(14)
  26. /* USBSTS & USBINTR */
  27. #define USBi_UI BIT(0)
  28. #define USBi_UEI BIT(1)
  29. #define USBi_PCI BIT(2)
  30. #define USBi_URI BIT(6)
  31. #define USBi_SLI BIT(8)
  32. /* DEVICEADDR */
  33. #define DEVICEADDR_USBADRA BIT(24)
  34. #define DEVICEADDR_USBADR (0x7FUL << 25)
  35. /* PORTSC */
  36. #define PORTSC_FPR BIT(6)
  37. #define PORTSC_SUSP BIT(7)
  38. #define PORTSC_HSP BIT(9)
  39. #define PORTSC_PTC (0x0FUL << 16)
  40. /* DEVLC */
  41. #define DEVLC_PSPD (0x03UL << 25)
  42. #define DEVLC_PSPD_HS (0x02UL << 25)
  43. /* OTGSC */
  44. #define OTGSC_IDPU BIT(5)
  45. #define OTGSC_ID BIT(8)
  46. #define OTGSC_AVV BIT(9)
  47. #define OTGSC_ASV BIT(10)
  48. #define OTGSC_BSV BIT(11)
  49. #define OTGSC_BSE BIT(12)
  50. #define OTGSC_IDIS BIT(16)
  51. #define OTGSC_AVVIS BIT(17)
  52. #define OTGSC_ASVIS BIT(18)
  53. #define OTGSC_BSVIS BIT(19)
  54. #define OTGSC_BSEIS BIT(20)
  55. #define OTGSC_IDIE BIT(24)
  56. #define OTGSC_AVVIE BIT(25)
  57. #define OTGSC_ASVIE BIT(26)
  58. #define OTGSC_BSVIE BIT(27)
  59. #define OTGSC_BSEIE BIT(28)
  60. /* USBMODE */
  61. #define USBMODE_CM (0x03UL << 0)
  62. #define USBMODE_CM_IDLE (0x00UL << 0)
  63. #define USBMODE_CM_DEVICE (0x02UL << 0)
  64. #define USBMODE_CM_HOST (0x03UL << 0)
  65. #define USBMODE_SLOM BIT(3)
  66. #define USBMODE_SDIS BIT(4)
  67. /* ENDPTCTRL */
  68. #define ENDPTCTRL_RXS BIT(0)
  69. #define ENDPTCTRL_RXT (0x03UL << 2)
  70. #define ENDPTCTRL_RXR BIT(6) /* reserved for port 0 */
  71. #define ENDPTCTRL_RXE BIT(7)
  72. #define ENDPTCTRL_TXS BIT(16)
  73. #define ENDPTCTRL_TXT (0x03UL << 18)
  74. #define ENDPTCTRL_TXR BIT(22) /* reserved for port 0 */
  75. #define ENDPTCTRL_TXE BIT(23)
  76. #endif /* __DRIVERS_USB_CHIPIDEA_BITS_H */