m54xxpci.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /****************************************************************************/
  2. /*
  3. * m54xxpci.h -- ColdFire 547x and 548x PCI bus support
  4. *
  5. * (C) Copyright 2011, Greg Ungerer <gerg@uclinux.org>
  6. *
  7. * This file is subject to the terms and conditions of the GNU General Public
  8. * License. See the file COPYING in the main directory of this archive
  9. * for more details.
  10. */
  11. /****************************************************************************/
  12. #ifndef M54XXPCI_H
  13. #define M54XXPCI_H
  14. /****************************************************************************/
  15. /*
  16. * The core set of PCI support registers are mapped into the MBAR region.
  17. */
  18. #define PCIIDR (CONFIG_MBAR + 0xb00) /* PCI device/vendor ID */
  19. #define PCISCR (CONFIG_MBAR + 0xb04) /* PCI status/command */
  20. #define PCICCRIR (CONFIG_MBAR + 0xb08) /* PCI class/revision */
  21. #define PCICR1 (CONFIG_MBAR + 0xb0c) /* PCI configuration 1 */
  22. #define PCIBAR0 (CONFIG_MBAR + 0xb10) /* PCI base address 0 */
  23. #define PCIBAR1 (CONFIG_MBAR + 0xb14) /* PCI base address 1 */
  24. #define PCICCPR (CONFIG_MBAR + 0xb28) /* PCI cardbus CIS pointer */
  25. #define PCISID (CONFIG_MBAR + 0xb2c) /* PCI subsystem IDs */
  26. #define PCIERBAR (CONFIG_MBAR + 0xb30) /* PCI expansion ROM */
  27. #define PCICPR (CONFIG_MBAR + 0xb34) /* PCI capabilities pointer */
  28. #define PCICR2 (CONFIG_MBAR + 0xb3c) /* PCI configuration 2 */
  29. #define PCIGSCR (CONFIG_MBAR + 0xb60) /* Global status/control */
  30. #define PCITBATR0 (CONFIG_MBAR + 0xb64) /* Target base translation 0 */
  31. #define PCITBATR1 (CONFIG_MBAR + 0xb68) /* Target base translation 1 */
  32. #define PCITCR (CONFIG_MBAR + 0xb6c) /* Target control */
  33. #define PCIIW0BTAR (CONFIG_MBAR + 0xb70) /* Initiator window 0 */
  34. #define PCIIW1BTAR (CONFIG_MBAR + 0xb74) /* Initiator window 1 */
  35. #define PCIIW2BTAR (CONFIG_MBAR + 0xb78) /* Initiator window 2 */
  36. #define PCIIWCR (CONFIG_MBAR + 0xb80) /* Initiator window config */
  37. #define PCIICR (CONFIG_MBAR + 0xb84) /* Initiator control */
  38. #define PCIISR (CONFIG_MBAR + 0xb88) /* Initiator status */
  39. #define PCICAR (CONFIG_MBAR + 0xbf8) /* Configuration address */
  40. #define PCITPSR (CONFIG_MBAR + 0x8400) /* TX packet size */
  41. #define PCITSAR (CONFIG_MBAR + 0x8404) /* TX start address */
  42. #define PCITTCR (CONFIG_MBAR + 0x8408) /* TX transaction control */
  43. #define PCITER (CONFIG_MBAR + 0x840c) /* TX enables */
  44. #define PCITNAR (CONFIG_MBAR + 0x8410) /* TX next address */
  45. #define PCITLWR (CONFIG_MBAR + 0x8414) /* TX last word */
  46. #define PCITDCR (CONFIG_MBAR + 0x8418) /* TX done counts */
  47. #define PCITSR (CONFIG_MBAR + 0x841c) /* TX status */
  48. #define PCITFDR (CONFIG_MBAR + 0x8440) /* TX FIFO data */
  49. #define PCITFSR (CONFIG_MBAR + 0x8444) /* TX FIFO status */
  50. #define PCITFCR (CONFIG_MBAR + 0x8448) /* TX FIFO control */
  51. #define PCITFAR (CONFIG_MBAR + 0x844c) /* TX FIFO alarm */
  52. #define PCITFRPR (CONFIG_MBAR + 0x8450) /* TX FIFO read pointer */
  53. #define PCITFWPR (CONFIG_MBAR + 0x8454) /* TX FIFO write pointer */
  54. #define PCIRPSR (CONFIG_MBAR + 0x8480) /* RX packet size */
  55. #define PCIRSAR (CONFIG_MBAR + 0x8484) /* RX start address */
  56. #define PCIRTCR (CONFIG_MBAR + 0x8488) /* RX transaction control */
  57. #define PCIRER (CONFIG_MBAR + 0x848c) /* RX enables */
  58. #define PCIRNAR (CONFIG_MBAR + 0x8490) /* RX next address */
  59. #define PCIRDCR (CONFIG_MBAR + 0x8498) /* RX done counts */
  60. #define PCIRSR (CONFIG_MBAR + 0x849c) /* RX status */
  61. #define PCIRFDR (CONFIG_MBAR + 0x84c0) /* RX FIFO data */
  62. #define PCIRFSR (CONFIG_MBAR + 0x84c4) /* RX FIFO status */
  63. #define PCIRFCR (CONFIG_MBAR + 0x84c8) /* RX FIFO control */
  64. #define PCIRFAR (CONFIG_MBAR + 0x84cc) /* RX FIFO alarm */
  65. #define PCIRFRPR (CONFIG_MBAR + 0x84d0) /* RX FIFO read pointer */
  66. #define PCIRFWPR (CONFIG_MBAR + 0x84d4) /* RX FIFO write pointer */
  67. #define PACR (CONFIG_MBAR + 0xc00) /* PCI arbiter control */
  68. #define PASR (CONFIG_MBAR + 0xc04) /* PCI arbiter status */
  69. /*
  70. * Definitions for the Global status and control register.
  71. */
  72. #define PCIGSCR_PE 0x20000000 /* Parity error detected */
  73. #define PCIGSCR_SE 0x10000000 /* System error detected */
  74. #define PCIGSCR_XCLKBIN 0x07000000 /* XLB2CLKIN mask */
  75. #define PCIGSCR_PEE 0x00002000 /* Parity error intr enable */
  76. #define PCIGSCR_SEE 0x00001000 /* System error intr enable */
  77. #define PCIGSCR_RESET 0x00000001 /* Reset bit */
  78. /*
  79. * Bit definitions for the PCICAR configuration address register.
  80. */
  81. #define PCICAR_E 0x80000000 /* Enable config space */
  82. #define PCICAR_BUSN 16 /* Move bus bits */
  83. #define PCICAR_DEVFNN 8 /* Move devfn bits */
  84. #define PCICAR_DWORDN 0 /* Move dword bits */
  85. /*
  86. * The initiator windows hold the memory and IO mapping information.
  87. * This macro creates the register values from the desired addresses.
  88. */
  89. #define WXBTAR(hostaddr, pciaddr, size) \
  90. (((hostaddr) & 0xff000000) | \
  91. ((((size) - 1) & 0xff000000) >> 8) | \
  92. (((pciaddr) & 0xff000000) >> 16))
  93. #define PCIIWCR_W0_MEM 0x00000000 /* Window 0 is memory */
  94. #define PCIIWCR_W0_IO 0x08000000 /* Window 0 is IO */
  95. #define PCIIWCR_W0_MRD 0x00000000 /* Window 0 memory read */
  96. #define PCIIWCR_W0_MRDL 0x02000000 /* Window 0 memory read line */
  97. #define PCIIWCR_W0_MRDM 0x04000000 /* Window 0 memory read mult */
  98. #define PCIIWCR_W0_E 0x01000000 /* Window 0 enable */
  99. #define PCIIWCR_W1_MEM 0x00000000 /* Window 0 is memory */
  100. #define PCIIWCR_W1_IO 0x00080000 /* Window 0 is IO */
  101. #define PCIIWCR_W1_MRD 0x00000000 /* Window 0 memory read */
  102. #define PCIIWCR_W1_MRDL 0x00020000 /* Window 0 memory read line */
  103. #define PCIIWCR_W1_MRDM 0x00040000 /* Window 0 memory read mult */
  104. #define PCIIWCR_W1_E 0x00010000 /* Window 0 enable */
  105. /*
  106. * Bit definitions for the PCIBATR registers.
  107. */
  108. #define PCITBATR0_E 0x00000001 /* Enable window 0 */
  109. #define PCITBATR1_E 0x00000001 /* Enable window 1 */
  110. /*
  111. * PCI arbiter support definitions and macros.
  112. */
  113. #define PACR_INTMPRI 0x00000001
  114. #define PACR_EXTMPRI(x) (((x) & 0x1f) << 1)
  115. #define PACR_INTMINTE 0x00010000
  116. #define PACR_EXTMINTE(x) (((x) & 0x1f) << 17)
  117. #define PACR_PKMD 0x40000000
  118. #define PACR_DS 0x80000000
  119. #define PCICR1_CL(x) ((x) & 0xf) /* Cacheline size field */
  120. #define PCICR1_LT(x) (((x) & 0xff) << 8) /* Latency timer field */
  121. /****************************************************************************/
  122. #endif /* M54XXPCI_H */