am35x.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * am35x.h - TI's AM35x platform specific usb wrapper definitions.
  3. *
  4. * Author: Ajay Kumar Gupta <ajay.gupta@ti.com>
  5. *
  6. * Based on drivers/usb/musb/da8xx.h
  7. *
  8. * Copyright (c) 2010 Texas Instruments Incorporated
  9. *
  10. * SPDX-License-Identifier: GPL-2.0+
  11. */
  12. #ifndef __AM35X_USB_H__
  13. #define __AM35X_USB_H__
  14. #include <asm/arch/am35x_def.h>
  15. #include "musb_core.h"
  16. /* Base address of musb wrapper */
  17. #define AM35X_USB_OTG_BASE 0x5C040000
  18. /* Base address of musb core */
  19. #define AM35X_USB_OTG_CORE_BASE (AM35X_USB_OTG_BASE + 0x400)
  20. /* Timeout for AM35x usb module */
  21. #define AM35X_USB_OTG_TIMEOUT 0x3FFFFFF
  22. /*
  23. * AM35x platform USB wrapper register overlay.
  24. */
  25. struct am35x_usb_regs {
  26. u32 revision;
  27. u32 control;
  28. u32 status;
  29. u32 emulation;
  30. u32 reserved0[1];
  31. u32 autoreq;
  32. u32 srpfixtime;
  33. u32 ep_intsrc;
  34. u32 ep_intsrcset;
  35. u32 ep_intsrcclr;
  36. u32 ep_intmsk;
  37. u32 ep_intmskset;
  38. u32 ep_intmskclr;
  39. u32 ep_intsrcmsked;
  40. u32 reserved1[1];
  41. u32 core_intsrc;
  42. u32 core_intsrcset;
  43. u32 core_intsrcclr;
  44. u32 core_intmsk;
  45. u32 core_intmskset;
  46. u32 core_intmskclr;
  47. u32 core_intsrcmsked;
  48. u32 reserved2[1];
  49. u32 eoi;
  50. u32 mop_sop_en;
  51. u32 reserved3[2];
  52. u32 txmode;
  53. u32 rxmode;
  54. u32 epcount_mode;
  55. };
  56. #define am35x_usb_regs ((struct am35x_usb_regs *)AM35X_USB_OTG_BASE)
  57. /* USB 2.0 PHY Control */
  58. #define DEVCONF2_PHY_GPIOMODE (1 << 23)
  59. #define DEVCONF2_OTGMODE (3 << 14)
  60. #define DEVCONF2_SESENDEN (1 << 13) /* Vsess_end comparator */
  61. #define DEVCONF2_VBDTCTEN (1 << 12) /* Vbus comparator */
  62. #define DEVCONF2_REFFREQ_24MHZ (2 << 8)
  63. #define DEVCONF2_REFFREQ_26MHZ (7 << 8)
  64. #define DEVCONF2_REFFREQ_13MHZ (6 << 8)
  65. #define DEVCONF2_REFFREQ (0xf << 8)
  66. #define DEVCONF2_PHYCKGD (1 << 7)
  67. #define DEVCONF2_VBUSSENSE (1 << 6)
  68. #define DEVCONF2_PHY_PLLON (1 << 5) /* override PLL suspend */
  69. #define DEVCONF2_RESET (1 << 4)
  70. #define DEVCONF2_PHYPWRDN (1 << 3)
  71. #define DEVCONF2_OTGPWRDN (1 << 2)
  72. #define DEVCONF2_DATPOL (1 << 1)
  73. #endif /* __AM35X_USB_H__ */