pci-vr41xx.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /*
  2. * pci-vr41xx.h, Include file for PCI Control Unit of the NEC VR4100 series.
  3. *
  4. * Copyright (C) 2002 MontaVista Software Inc.
  5. * Author: Yoichi Yuasa <source@mvista.com>
  6. * Copyright (C) 2004-2005 Yoichi Yuasa <yuasa@linux-mips.org>
  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 as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. */
  22. #ifndef __PCI_VR41XX_H
  23. #define __PCI_VR41XX_H
  24. #define PCIU_BASE 0x0f000c00UL
  25. #define PCIU_SIZE 0x200UL
  26. #define PCIMMAW1REG 0x00
  27. #define PCIMMAW2REG 0x04
  28. #define PCITAW1REG 0x08
  29. #define PCITAW2REG 0x0c
  30. #define PCIMIOAWREG 0x10
  31. #define IBA(addr) ((addr) & 0xff000000U)
  32. #define MASTER_MSK(mask) (((mask) >> 11) & 0x000fe000U)
  33. #define PCIA(addr) (((addr) >> 24) & 0x000000ffU)
  34. #define TARGET_MSK(mask) (((mask) >> 8) & 0x000fe000U)
  35. #define ITA(addr) (((addr) >> 24) & 0x000000ffU)
  36. #define PCIIA(addr) (((addr) >> 24) & 0x000000ffU)
  37. #define WINEN 0x1000U
  38. #define PCICONFDREG 0x14
  39. #define PCICONFAREG 0x18
  40. #define PCIMAILREG 0x1c
  41. #define BUSERRADREG 0x24
  42. #define EA(reg) ((reg) &0xfffffffc)
  43. #define INTCNTSTAREG 0x28
  44. #define MABTCLR 0x80000000U
  45. #define TRDYCLR 0x40000000U
  46. #define PARCLR 0x20000000U
  47. #define MBCLR 0x10000000U
  48. #define SERRCLR 0x08000000U
  49. #define RTYCLR 0x04000000U
  50. #define MABCLR 0x02000000U
  51. #define TABCLR 0x01000000U
  52. /* RFU */
  53. #define MABTMSK 0x00008000U
  54. #define TRDYMSK 0x00004000U
  55. #define PARMSK 0x00002000U
  56. #define MBMSK 0x00001000U
  57. #define SERRMSK 0x00000800U
  58. #define RTYMSK 0x00000400U
  59. #define MABMSK 0x00000200U
  60. #define TABMSK 0x00000100U
  61. #define IBAMABT 0x00000080U
  62. #define TRDYRCH 0x00000040U
  63. #define PAR 0x00000020U
  64. #define MB 0x00000010U
  65. #define PCISERR 0x00000008U
  66. #define RTYRCH 0x00000004U
  67. #define MABORT 0x00000002U
  68. #define TABORT 0x00000001U
  69. #define PCIEXACCREG 0x2c
  70. #define UNLOCK 0x2U
  71. #define EAREQ 0x1U
  72. #define PCIRECONTREG 0x30
  73. #define RTRYCNT(reg) ((reg) & 0x000000ffU)
  74. #define PCIENREG 0x34
  75. #define PCIU_CONFIG_DONE 0x4U
  76. #define PCICLKSELREG 0x38
  77. #define EQUAL_VTCLOCK 0x2U
  78. #define HALF_VTCLOCK 0x0U
  79. #define ONE_THIRD_VTCLOCK 0x3U
  80. #define QUARTER_VTCLOCK 0x1U
  81. #define PCITRDYVREG 0x3c
  82. #define TRDYV(val) ((uint32_t)(val) & 0xffU)
  83. #define PCICLKRUNREG 0x60
  84. #define VENDORIDREG 0x100
  85. #define DEVICEIDREG 0x100
  86. #define COMMANDREG 0x104
  87. #define STATUSREG 0x104
  88. #define REVIDREG 0x108
  89. #define CLASSREG 0x108
  90. #define CACHELSREG 0x10c
  91. #define LATTIMEREG 0x10c
  92. #define MLTIM(val) (((uint32_t)(val) << 7) & 0xff00U)
  93. #define MAILBAREG 0x110
  94. #define PCIMBA1REG 0x114
  95. #define PCIMBA2REG 0x118
  96. #define MBADD(base) ((base) & 0xfffff800U)
  97. #define PMBA(base) ((base) & 0xffe00000U)
  98. #define PREF 0x8U
  99. #define PREF_APPROVAL 0x8U
  100. #define PREF_DISAPPROVAL 0x0U
  101. #define TYPE 0x6U
  102. #define TYPE_32BITSPACE 0x0U
  103. #define MSI 0x1U
  104. #define MSI_MEMORY 0x0U
  105. #define INTLINEREG 0x13c
  106. #define INTPINREG 0x13c
  107. #define RETVALREG 0x140
  108. #define PCIAPCNTREG 0x140
  109. #define TKYGNT 0x04000000U
  110. #define TKYGNT_ENABLE 0x04000000U
  111. #define TKYGNT_DISABLE 0x00000000U
  112. #define PAPC 0x03000000U
  113. #define PAPC_ALTERNATE_B 0x02000000U
  114. #define PAPC_ALTERNATE_0 0x01000000U
  115. #define PAPC_FAIR 0x00000000U
  116. #define RTYVAL(val) (((uint32_t)(val) << 7) & 0xff00U)
  117. #define RTYVAL_MASK 0xff00U
  118. #define PCI_CLOCK_MAX 33333333U
  119. /*
  120. * Default setup
  121. */
  122. #define PCI_MASTER_MEM1_BUS_BASE_ADDRESS 0x10000000U
  123. #define PCI_MASTER_MEM1_ADDRESS_MASK 0x7c000000U
  124. #define PCI_MASTER_MEM1_PCI_BASE_ADDRESS 0x10000000U
  125. #define PCI_TARGET_MEM1_ADDRESS_MASK 0x08000000U
  126. #define PCI_TARGET_MEM1_BUS_BASE_ADDRESS 0x00000000U
  127. #define PCI_MASTER_IO_BUS_BASE_ADDRESS 0x16000000U
  128. #define PCI_MASTER_IO_ADDRESS_MASK 0x7e000000U
  129. #define PCI_MASTER_IO_PCI_BASE_ADDRESS 0x00000000U
  130. #define PCI_MAILBOX_BASE_ADDRESS 0x00000000U
  131. #define PCI_TARGET_WINDOW1_BASE_ADDRESS 0x00000000U
  132. #define IO_PORT_BASE KSEG1ADDR(PCI_MASTER_IO_BUS_BASE_ADDRESS)
  133. #define IO_PORT_RESOURCE_START PCI_MASTER_IO_PCI_BASE_ADDRESS
  134. #define IO_PORT_RESOURCE_END (~PCI_MASTER_IO_ADDRESS_MASK & PCI_MASTER_ADDRESS_MASK)
  135. #define PCI_IO_RESOURCE_START 0x01000000UL
  136. #define PCI_IO_RESOURCE_END 0x01ffffffUL
  137. #define PCI_MEM_RESOURCE_START 0x11000000UL
  138. #define PCI_MEM_RESOURCE_END 0x13ffffffUL
  139. #endif /* __PCI_VR41XX_H */