bits.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. /* USBMODE */
  44. #define USBMODE_CM (0x03UL << 0)
  45. #define USBMODE_CM_IDLE (0x00UL << 0)
  46. #define USBMODE_CM_DEVICE (0x02UL << 0)
  47. #define USBMODE_CM_HOST (0x03UL << 0)
  48. #define USBMODE_SLOM BIT(3)
  49. #define USBMODE_SDIS BIT(4)
  50. /* ENDPTCTRL */
  51. #define ENDPTCTRL_RXS BIT(0)
  52. #define ENDPTCTRL_RXT (0x03UL << 2)
  53. #define ENDPTCTRL_RXR BIT(6) /* reserved for port 0 */
  54. #define ENDPTCTRL_RXE BIT(7)
  55. #define ENDPTCTRL_TXS BIT(16)
  56. #define ENDPTCTRL_TXT (0x03UL << 18)
  57. #define ENDPTCTRL_TXR BIT(22) /* reserved for port 0 */
  58. #define ENDPTCTRL_TXE BIT(23)
  59. #endif /* __DRIVERS_USB_CHIPIDEA_BITS_H */