bits.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. #include <linux/usb/ehci_def.h>
  15. /* HCCPARAMS */
  16. #define HCCPARAMS_LEN BIT(17)
  17. /* DCCPARAMS */
  18. #define DCCPARAMS_DEN (0x1F << 0)
  19. #define DCCPARAMS_DC BIT(7)
  20. #define DCCPARAMS_HC BIT(8)
  21. /* TESTMODE */
  22. #define TESTMODE_FORCE BIT(0)
  23. /* USBCMD */
  24. #define USBCMD_RS BIT(0)
  25. #define USBCMD_RST BIT(1)
  26. #define USBCMD_SUTW BIT(13)
  27. #define USBCMD_ATDTW BIT(14)
  28. /* USBSTS & USBINTR */
  29. #define USBi_UI BIT(0)
  30. #define USBi_UEI BIT(1)
  31. #define USBi_PCI BIT(2)
  32. #define USBi_URI BIT(6)
  33. #define USBi_SLI BIT(8)
  34. /* DEVICEADDR */
  35. #define DEVICEADDR_USBADRA BIT(24)
  36. #define DEVICEADDR_USBADR (0x7FUL << 25)
  37. /* PORTSC */
  38. #define PORTSC_FPR BIT(6)
  39. #define PORTSC_SUSP BIT(7)
  40. #define PORTSC_HSP BIT(9)
  41. #define PORTSC_PTC (0x0FUL << 16)
  42. /* DEVLC */
  43. #define DEVLC_PSPD (0x03UL << 25)
  44. #define DEVLC_PSPD_HS (0x02UL << 25)
  45. /* OTGSC */
  46. #define OTGSC_IDPU BIT(5)
  47. #define OTGSC_ID BIT(8)
  48. #define OTGSC_AVV BIT(9)
  49. #define OTGSC_ASV BIT(10)
  50. #define OTGSC_BSV BIT(11)
  51. #define OTGSC_BSE BIT(12)
  52. #define OTGSC_IDIS BIT(16)
  53. #define OTGSC_AVVIS BIT(17)
  54. #define OTGSC_ASVIS BIT(18)
  55. #define OTGSC_BSVIS BIT(19)
  56. #define OTGSC_BSEIS BIT(20)
  57. #define OTGSC_IDIE BIT(24)
  58. #define OTGSC_AVVIE BIT(25)
  59. #define OTGSC_ASVIE BIT(26)
  60. #define OTGSC_BSVIE BIT(27)
  61. #define OTGSC_BSEIE BIT(28)
  62. /* USBMODE */
  63. #define USBMODE_CM (0x03UL << 0)
  64. #define USBMODE_CM_DC (0x02UL << 0)
  65. #define USBMODE_SLOM BIT(3)
  66. #define USBMODE_CI_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 */