am35x.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23. */
  24. #ifndef __AM35X_USB_H__
  25. #define __AM35X_USB_H__
  26. #include <asm/arch/am35x_def.h>
  27. #include "musb_core.h"
  28. /* Base address of musb wrapper */
  29. #define AM35X_USB_OTG_BASE 0x5C040000
  30. /* Base address of musb core */
  31. #define AM35X_USB_OTG_CORE_BASE (AM35X_USB_OTG_BASE + 0x400)
  32. /* Timeout for AM35x usb module */
  33. #define AM35X_USB_OTG_TIMEOUT 0x3FFFFFF
  34. /*
  35. * AM35x platform USB wrapper register overlay.
  36. */
  37. struct am35x_usb_regs {
  38. u32 revision;
  39. u32 control;
  40. u32 status;
  41. u32 emulation;
  42. u32 reserved0[1];
  43. u32 autoreq;
  44. u32 srpfixtime;
  45. u32 ep_intsrc;
  46. u32 ep_intsrcset;
  47. u32 ep_intsrcclr;
  48. u32 ep_intmsk;
  49. u32 ep_intmskset;
  50. u32 ep_intmskclr;
  51. u32 ep_intsrcmsked;
  52. u32 reserved1[1];
  53. u32 core_intsrc;
  54. u32 core_intsrcset;
  55. u32 core_intsrcclr;
  56. u32 core_intmsk;
  57. u32 core_intmskset;
  58. u32 core_intmskclr;
  59. u32 core_intsrcmsked;
  60. u32 reserved2[1];
  61. u32 eoi;
  62. u32 mop_sop_en;
  63. u32 reserved3[2];
  64. u32 txmode;
  65. u32 rxmode;
  66. u32 epcount_mode;
  67. };
  68. #define am35x_usb_regs ((struct am35x_usb_regs *)AM35X_USB_OTG_BASE)
  69. /* USB 2.0 PHY Control */
  70. #define DEVCONF2_PHY_GPIOMODE (1 << 23)
  71. #define DEVCONF2_OTGMODE (3 << 14)
  72. #define DEVCONF2_SESENDEN (1 << 13) /* Vsess_end comparator */
  73. #define DEVCONF2_VBDTCTEN (1 << 12) /* Vbus comparator */
  74. #define DEVCONF2_REFFREQ_24MHZ (2 << 8)
  75. #define DEVCONF2_REFFREQ_26MHZ (7 << 8)
  76. #define DEVCONF2_REFFREQ_13MHZ (6 << 8)
  77. #define DEVCONF2_REFFREQ (0xf << 8)
  78. #define DEVCONF2_PHYCKGD (1 << 7)
  79. #define DEVCONF2_VBUSSENSE (1 << 6)
  80. #define DEVCONF2_PHY_PLLON (1 << 5) /* override PLL suspend */
  81. #define DEVCONF2_RESET (1 << 4)
  82. #define DEVCONF2_PHYPWRDN (1 << 3)
  83. #define DEVCONF2_OTGPWRDN (1 << 2)
  84. #define DEVCONF2_DATPOL (1 << 1)
  85. #endif /* __AM35X_USB_H__ */