bridge.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. /*
  2. * Copyright 2003-2011 NetLogic Microsystems, Inc. (NetLogic). All rights
  3. * reserved.
  4. *
  5. * This software is available to you under a choice of one of two
  6. * licenses. You may choose to be licensed under the terms of the GNU
  7. * General Public License (GPL) Version 2, available from the file
  8. * COPYING in the main directory of this source tree, or the NetLogic
  9. * license below:
  10. *
  11. * Redistribution and use in source and binary forms, with or without
  12. * modification, are permitted provided that the following conditions
  13. * are met:
  14. *
  15. * 1. Redistributions of source code must retain the above copyright
  16. * notice, this list of conditions and the following disclaimer.
  17. * 2. Redistributions in binary form must reproduce the above copyright
  18. * notice, this list of conditions and the following disclaimer in
  19. * the documentation and/or other materials provided with the
  20. * distribution.
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY NETLOGIC ``AS IS'' AND ANY EXPRESS OR
  23. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  24. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  25. * ARE DISCLAIMED. IN NO EVENT SHALL NETLOGIC OR CONTRIBUTORS BE LIABLE
  26. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  27. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  28. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  29. * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  30. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  31. * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  32. * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  33. */
  34. #ifndef __NLM_HAL_BRIDGE_H__
  35. #define __NLM_HAL_BRIDGE_H__
  36. /**
  37. * @file_name mio.h
  38. * @author Netlogic Microsystems
  39. * @brief Basic definitions of XLP memory and io subsystem
  40. */
  41. /*
  42. * BRIDGE specific registers
  43. *
  44. * These registers start after the PCIe header, which has 0x40
  45. * standard entries
  46. */
  47. #define BRIDGE_MODE 0x00
  48. #define BRIDGE_PCI_CFG_BASE 0x01
  49. #define BRIDGE_PCI_CFG_LIMIT 0x02
  50. #define BRIDGE_PCIE_CFG_BASE 0x03
  51. #define BRIDGE_PCIE_CFG_LIMIT 0x04
  52. #define BRIDGE_BUSNUM_BAR0 0x05
  53. #define BRIDGE_BUSNUM_BAR1 0x06
  54. #define BRIDGE_BUSNUM_BAR2 0x07
  55. #define BRIDGE_BUSNUM_BAR3 0x08
  56. #define BRIDGE_BUSNUM_BAR4 0x09
  57. #define BRIDGE_BUSNUM_BAR5 0x0a
  58. #define BRIDGE_BUSNUM_BAR6 0x0b
  59. #define BRIDGE_FLASH_BAR0 0x0c
  60. #define BRIDGE_FLASH_BAR1 0x0d
  61. #define BRIDGE_FLASH_BAR2 0x0e
  62. #define BRIDGE_FLASH_BAR3 0x0f
  63. #define BRIDGE_FLASH_LIMIT0 0x10
  64. #define BRIDGE_FLASH_LIMIT1 0x11
  65. #define BRIDGE_FLASH_LIMIT2 0x12
  66. #define BRIDGE_FLASH_LIMIT3 0x13
  67. #define BRIDGE_DRAM_BAR(i) (0x14 + (i))
  68. #define BRIDGE_DRAM_LIMIT(i) (0x1c + (i))
  69. #define BRIDGE_DRAM_NODE_TRANSLN(i) (0x24 + (i))
  70. #define BRIDGE_DRAM_CHNL_TRANSLN(i) (0x2c + (i))
  71. #define BRIDGE_PCIEMEM_BASE0 0x34
  72. #define BRIDGE_PCIEMEM_BASE1 0x35
  73. #define BRIDGE_PCIEMEM_BASE2 0x36
  74. #define BRIDGE_PCIEMEM_BASE3 0x37
  75. #define BRIDGE_PCIEMEM_LIMIT0 0x38
  76. #define BRIDGE_PCIEMEM_LIMIT1 0x39
  77. #define BRIDGE_PCIEMEM_LIMIT2 0x3a
  78. #define BRIDGE_PCIEMEM_LIMIT3 0x3b
  79. #define BRIDGE_PCIEIO_BASE0 0x3c
  80. #define BRIDGE_PCIEIO_BASE1 0x3d
  81. #define BRIDGE_PCIEIO_BASE2 0x3e
  82. #define BRIDGE_PCIEIO_BASE3 0x3f
  83. #define BRIDGE_PCIEIO_LIMIT0 0x40
  84. #define BRIDGE_PCIEIO_LIMIT1 0x41
  85. #define BRIDGE_PCIEIO_LIMIT2 0x42
  86. #define BRIDGE_PCIEIO_LIMIT3 0x43
  87. #define BRIDGE_PCIEMEM_BASE4 0x44
  88. #define BRIDGE_PCIEMEM_BASE5 0x45
  89. #define BRIDGE_PCIEMEM_BASE6 0x46
  90. #define BRIDGE_PCIEMEM_LIMIT4 0x47
  91. #define BRIDGE_PCIEMEM_LIMIT5 0x48
  92. #define BRIDGE_PCIEMEM_LIMIT6 0x49
  93. #define BRIDGE_PCIEIO_BASE4 0x4a
  94. #define BRIDGE_PCIEIO_BASE5 0x4b
  95. #define BRIDGE_PCIEIO_BASE6 0x4c
  96. #define BRIDGE_PCIEIO_LIMIT4 0x4d
  97. #define BRIDGE_PCIEIO_LIMIT5 0x4e
  98. #define BRIDGE_PCIEIO_LIMIT6 0x4f
  99. #define BRIDGE_NBU_EVENT_CNT_CTL 0x50
  100. #define BRIDGE_EVNTCTR1_LOW 0x51
  101. #define BRIDGE_EVNTCTR1_HI 0x52
  102. #define BRIDGE_EVNT_CNT_CTL2 0x53
  103. #define BRIDGE_EVNTCTR2_LOW 0x54
  104. #define BRIDGE_EVNTCTR2_HI 0x55
  105. #define BRIDGE_TRACEBUF_MATCH0 0x56
  106. #define BRIDGE_TRACEBUF_MATCH1 0x57
  107. #define BRIDGE_TRACEBUF_MATCH_LOW 0x58
  108. #define BRIDGE_TRACEBUF_MATCH_HI 0x59
  109. #define BRIDGE_TRACEBUF_CTRL 0x5a
  110. #define BRIDGE_TRACEBUF_INIT 0x5b
  111. #define BRIDGE_TRACEBUF_ACCESS 0x5c
  112. #define BRIDGE_TRACEBUF_READ_DATA0 0x5d
  113. #define BRIDGE_TRACEBUF_READ_DATA1 0x5d
  114. #define BRIDGE_TRACEBUF_READ_DATA2 0x5f
  115. #define BRIDGE_TRACEBUF_READ_DATA3 0x60
  116. #define BRIDGE_TRACEBUF_STATUS 0x61
  117. #define BRIDGE_ADDRESS_ERROR0 0x62
  118. #define BRIDGE_ADDRESS_ERROR1 0x63
  119. #define BRIDGE_ADDRESS_ERROR2 0x64
  120. #define BRIDGE_TAG_ECC_ADDR_ERROR0 0x65
  121. #define BRIDGE_TAG_ECC_ADDR_ERROR1 0x66
  122. #define BRIDGE_TAG_ECC_ADDR_ERROR2 0x67
  123. #define BRIDGE_LINE_FLUSH0 0x68
  124. #define BRIDGE_LINE_FLUSH1 0x69
  125. #define BRIDGE_NODE_ID 0x6a
  126. #define BRIDGE_ERROR_INTERRUPT_EN 0x6b
  127. #define BRIDGE_PCIE0_WEIGHT 0x2c0
  128. #define BRIDGE_PCIE1_WEIGHT 0x2c1
  129. #define BRIDGE_PCIE2_WEIGHT 0x2c2
  130. #define BRIDGE_PCIE3_WEIGHT 0x2c3
  131. #define BRIDGE_USB_WEIGHT 0x2c4
  132. #define BRIDGE_NET_WEIGHT 0x2c5
  133. #define BRIDGE_POE_WEIGHT 0x2c6
  134. #define BRIDGE_CMS_WEIGHT 0x2c7
  135. #define BRIDGE_DMAENG_WEIGHT 0x2c8
  136. #define BRIDGE_SEC_WEIGHT 0x2c9
  137. #define BRIDGE_COMP_WEIGHT 0x2ca
  138. #define BRIDGE_GIO_WEIGHT 0x2cb
  139. #define BRIDGE_FLASH_WEIGHT 0x2cc
  140. /* FIXME verify */
  141. #define BRIDGE_9XX_FLASH_BAR(i) (0x11 + (i))
  142. #define BRIDGE_9XX_FLASH_BAR_LIMIT(i) (0x15 + (i))
  143. #define BRIDGE_9XX_DRAM_BAR(i) (0x19 + (i))
  144. #define BRIDGE_9XX_DRAM_LIMIT(i) (0x29 + (i))
  145. #define BRIDGE_9XX_DRAM_NODE_TRANSLN(i) (0x39 + (i))
  146. #define BRIDGE_9XX_DRAM_CHNL_TRANSLN(i) (0x49 + (i))
  147. #define BRIDGE_9XX_ADDRESS_ERROR0 0x9d
  148. #define BRIDGE_9XX_ADDRESS_ERROR1 0x9e
  149. #define BRIDGE_9XX_ADDRESS_ERROR2 0x9f
  150. #define BRIDGE_9XX_PCIEMEM_BASE0 0x59
  151. #define BRIDGE_9XX_PCIEMEM_BASE1 0x5a
  152. #define BRIDGE_9XX_PCIEMEM_BASE2 0x5b
  153. #define BRIDGE_9XX_PCIEMEM_BASE3 0x5c
  154. #define BRIDGE_9XX_PCIEMEM_LIMIT0 0x5d
  155. #define BRIDGE_9XX_PCIEMEM_LIMIT1 0x5e
  156. #define BRIDGE_9XX_PCIEMEM_LIMIT2 0x5f
  157. #define BRIDGE_9XX_PCIEMEM_LIMIT3 0x60
  158. #define BRIDGE_9XX_PCIEIO_BASE0 0x61
  159. #define BRIDGE_9XX_PCIEIO_BASE1 0x62
  160. #define BRIDGE_9XX_PCIEIO_BASE2 0x63
  161. #define BRIDGE_9XX_PCIEIO_BASE3 0x64
  162. #define BRIDGE_9XX_PCIEIO_LIMIT0 0x65
  163. #define BRIDGE_9XX_PCIEIO_LIMIT1 0x66
  164. #define BRIDGE_9XX_PCIEIO_LIMIT2 0x67
  165. #define BRIDGE_9XX_PCIEIO_LIMIT3 0x68
  166. #ifndef __ASSEMBLY__
  167. #define nlm_read_bridge_reg(b, r) nlm_read_reg(b, r)
  168. #define nlm_write_bridge_reg(b, r, v) nlm_write_reg(b, r, v)
  169. #define nlm_get_bridge_pcibase(node) nlm_pcicfg_base(cpu_is_xlp9xx() ? \
  170. XLP9XX_IO_BRIDGE_OFFSET(node) : XLP_IO_BRIDGE_OFFSET(node))
  171. #define nlm_get_bridge_regbase(node) \
  172. (nlm_get_bridge_pcibase(node) + XLP_IO_PCI_HDRSZ)
  173. #endif /* __ASSEMBLY__ */
  174. #endif /* __NLM_HAL_BRIDGE_H__ */