ehci-rmobile.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /*
  2. * Copyright (C) 2013,2014 Renesas Electronics Corporation
  3. * Copyright (C) 2014 Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
  4. *
  5. * SPDX-License-Identifier: GPL-2.0
  6. */
  7. #ifndef __EHCI_RMOBILE_H__
  8. #define __EHCI_RMOBILE_H__
  9. /* Register offset */
  10. #define OHCI_OFFSET 0x00
  11. #define OHCI_SIZE 0x1000
  12. #define EHCI_OFFSET 0x1000
  13. #define EHCI_SIZE 0x1000
  14. #define EHCI_USBCMD (EHCI_OFFSET + 0x0020)
  15. /* USBCTR */
  16. #define DIRPD (1 << 8)
  17. #define PLL_RST (1 << 2)
  18. #define PCICLK_MASK (1 << 1)
  19. #define USBH_RST (1 << 0)
  20. /* CMND_STS */
  21. #define SERREN (1 << 8)
  22. #define PERREN (1 << 6)
  23. #define MASTEREN (1 << 2)
  24. #define MEMEN (1 << 1)
  25. /* PCIAHB_WIN1_CTR and PCIAHB_WIN2_CTR */
  26. #define PCIAHB_WIN_PREFETCH ((1 << 1)|(1 << 0))
  27. /* AHBPCI_WIN1_CTR */
  28. #define PCIWIN1_PCICMD ((1 << 3)|(1 << 1))
  29. #define AHB_CFG_AHBPCI 0x40000000
  30. #define AHB_CFG_HOST 0x80000000
  31. /* AHBPCI_WIN2_CTR */
  32. #define PCIWIN2_PCICMD ((1 << 2)|(1 << 1))
  33. /* PCI_INT_ENABLE */
  34. #define USBH_PMEEN (1 << 19)
  35. #define USBH_INTBEN (1 << 17)
  36. #define USBH_INTAEN (1 << 16)
  37. /* AHB_BUS_CTR */
  38. #define SMODE_READY_CTR (1 << 17)
  39. #define SMODE_READ_BURST (1 << 16)
  40. #define MMODE_HBUSREQ (1 << 7)
  41. #define MMODE_BOUNDARY ((1 << 6)|(1 << 5))
  42. #define MMODE_BURST_WIDTH ((1 << 4)|(1 << 3))
  43. #define MMODE_SINGLE_MODE ((1 << 4)|(1 << 3))
  44. #define MMODE_WR_INCR (1 << 2)
  45. #define MMODE_BYTE_BURST (1 << 1)
  46. #define MMODE_HTRANS (1 << 0)
  47. /* PCI_ARBITER_CTR */
  48. #define PCIBUS_PARK_TIMER 0x00FF0000
  49. #define PCIBUS_PARK_TIMER_SET 0x00070000
  50. #define PCIBP_MODE (1 << 12)
  51. #define PCIREQ7 (1 << 7)
  52. #define PCIREQ6 (1 << 6)
  53. #define PCIREQ5 (1 << 5)
  54. #define PCIREQ4 (1 << 4)
  55. #define PCIREQ3 (1 << 3)
  56. #define PCIREQ2 (1 << 2)
  57. #define PCIREQ1 (1 << 1)
  58. #define PCIREQ0 (1 << 0)
  59. #define SMSTPCR7 0xE615014C
  60. #define SMSTPCR703 (1 << 3)
  61. /* Init AHB master and slave functions of the host logic */
  62. #define AHB_BUS_CTR_INIT \
  63. (SMODE_READY_CTR | MMODE_HBUSREQ | MMODE_WR_INCR | \
  64. MMODE_BYTE_BURST | MMODE_HTRANS)
  65. #define USBCTR_WIN_SIZE_1GB 0x800
  66. /* PCI Configuration Registers */
  67. #define PCI_CONF_OHCI_OFFSET 0x10000
  68. #define PCI_CONF_EHCI_OFFSET 0x10100
  69. struct ahb_pciconf {
  70. u32 vid_did;
  71. u32 cmnd_sts;
  72. u32 rev;
  73. u32 cache_line;
  74. u32 basead;
  75. };
  76. /* PCI Configuration Registers for AHB-PCI Bridge Registers */
  77. #define PCI_CONF_AHBPCI_OFFSET 0x10000
  78. struct ahbconf_pci_bridge {
  79. u32 vid_did; /* 0x00 */
  80. u32 cmnd_sts;
  81. u32 revid_cc;
  82. u32 cls_lt_ht_bist;
  83. u32 basead; /* 0x10 */
  84. u32 win1_basead;
  85. u32 win2_basead;
  86. u32 dummy0[5];
  87. u32 ssvdi_ssid; /* 0x2C */
  88. u32 dummy1[4];
  89. u32 intr_line_pin;
  90. };
  91. /* AHB-PCI Bridge PCI Communication Registers */
  92. #define AHBPCI_OFFSET 0x10800
  93. struct ahbcom_pci_bridge {
  94. u32 pciahb_win1_ctr; /* 0x00 */
  95. u32 pciahb_win2_ctr;
  96. u32 pciahb_dct_ctr;
  97. u32 dummy0;
  98. u32 ahbpci_win1_ctr; /* 0x10 */
  99. u32 ahbpci_win2_ctr;
  100. u32 dummy1;
  101. u32 ahbpci_dct_ctr;
  102. u32 pci_int_enable; /* 0x20 */
  103. u32 pci_int_status;
  104. u32 dummy2[2];
  105. u32 ahb_bus_ctr; /* 0x30 */
  106. u32 usbctr;
  107. u32 dummy3[2];
  108. u32 pci_arbiter_ctr; /* 0x40 */
  109. u32 dummy4;
  110. u32 pci_unit_rev; /* 0x48 */
  111. };
  112. struct rmobile_ehci_reg {
  113. u32 hciversion; /* hciversion/caplength */
  114. u32 hcsparams; /* hcsparams */
  115. u32 hccparams; /* hccparams */
  116. u32 hcsp_portroute; /* hcsp_portroute */
  117. u32 usbcmd; /* usbcmd */
  118. u32 usbsts; /* usbsts */
  119. u32 usbintr; /* usbintr */
  120. u32 frindex; /* frindex */
  121. u32 ctrldssegment; /* ctrldssegment */
  122. u32 periodiclistbase; /* periodiclistbase */
  123. u32 asynclistaddr; /* asynclistaddr */
  124. u32 dummy[9];
  125. u32 configflag; /* configflag */
  126. u32 portsc; /* portsc */
  127. };
  128. #endif /* __EHCI_RMOBILE_H__ */