am35x.h 1.9 KB

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