pci.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. /*
  2. *
  3. * BRIEF MODULE DESCRIPTION
  4. * PCI specific definitions
  5. *
  6. * Author: source@mvista.com
  7. *
  8. * This program is free software; you can distribute it and/or modify it
  9. * under the terms of the GNU General Public License (Version 2) as
  10. * published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope it will be useful, but WITHOUT
  13. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  15. * for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along
  18. * with this program; if not, write to the Free Software Foundation, Inc.,
  19. * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
  20. */
  21. #ifndef __PNX8550_PCI_H
  22. #define __PNX8550_PCI_H
  23. #include <linux/types.h>
  24. #include <linux/pci.h>
  25. #include <linux/kernel.h>
  26. #include <linux/init.h>
  27. #define PCI_ACCESS_READ 0
  28. #define PCI_ACCESS_WRITE 1
  29. #define PCI_CMD_IOR 0x20
  30. #define PCI_CMD_IOW 0x30
  31. #define PCI_CMD_CONFIG_READ 0xa0
  32. #define PCI_CMD_CONFIG_WRITE 0xb0
  33. #define PCI_IO_TIMEOUT 1000
  34. #define PCI_IO_RETRY 5
  35. /* Timeout for IO and CFG accesses.
  36. This is in 1/1024 th of a jiffie(=10ms)
  37. i.e. approx 10us */
  38. #define PCI_IO_JIFFIES_TIMEOUT 40
  39. #define PCI_IO_JIFFIES_SHIFT 10
  40. #define PCI_BYTE_ENABLE_MASK 0x0000000f
  41. #define PCI_CFG_BUS_SHIFT 16
  42. #define PCI_CFG_FUNC_SHIFT 8
  43. #define PCI_CFG_REG_SHIFT 2
  44. #define PCI_BASE 0x1be00000
  45. #define PCI_SETUP 0x00040010
  46. #define PCI_DIS_REQGNT (1<<30)
  47. #define PCI_DIS_REQGNTA (1<<29)
  48. #define PCI_DIS_REQGNTB (1<<28)
  49. #define PCI_D2_SUPPORT (1<<27)
  50. #define PCI_D1_SUPPORT (1<<26)
  51. #define PCI_EN_TA (1<<24)
  52. #define PCI_EN_PCI2MMI (1<<23)
  53. #define PCI_EN_XIO (1<<22)
  54. #define PCI_BASE18_PREF (1<<21)
  55. #define SIZE_16M 0x3
  56. #define SIZE_32M 0x4
  57. #define SIZE_64M 0x5
  58. #define SIZE_128M 0x6
  59. #define PCI_SETUP_BASE18_SIZE(X) (X<<18)
  60. #define PCI_SETUP_BASE18_EN (1<<17)
  61. #define PCI_SETUP_BASE14_PREF (1<<16)
  62. #define PCI_SETUP_BASE14_SIZE(X) (X<<12)
  63. #define PCI_SETUP_BASE14_EN (1<<11)
  64. #define PCI_SETUP_BASE10_PREF (1<<10)
  65. #define PCI_SETUP_BASE10_SIZE(X) (X<<7)
  66. #define PCI_SETUP_CFGMANAGE_EN (1<<1)
  67. #define PCI_SETUP_PCIARB_EN (1<<0)
  68. #define PCI_CTRL 0x040014
  69. #define PCI_SWPB_DCS_PCI (1<<16)
  70. #define PCI_SWPB_PCI_PCI (1<<15)
  71. #define PCI_SWPB_PCI_DCS (1<<14)
  72. #define PCI_REG_WR_POST (1<<13)
  73. #define PCI_XIO_WR_POST (1<<12)
  74. #define PCI_PCI2_WR_POST (1<<13)
  75. #define PCI_PCI1_WR_POST (1<<12)
  76. #define PCI_SERR_SEEN (1<<11)
  77. #define PCI_B10_SPEC_RD (1<<6)
  78. #define PCI_B14_SPEC_RD (1<<5)
  79. #define PCI_B18_SPEC_RD (1<<4)
  80. #define PCI_B10_NOSUBWORD (1<<3)
  81. #define PCI_B14_NOSUBWORD (1<<2)
  82. #define PCI_B18_NOSUBWORD (1<<1)
  83. #define PCI_RETRY_TMREN (1<<0)
  84. #define PCI_BASE1_LO 0x040018
  85. #define PCI_BASE1_HI 0x04001C
  86. #define PCI_BASE2_LO 0x040020
  87. #define PCI_BASE2_HI 0x040024
  88. #define PCI_RDLIFETIM 0x040028
  89. #define PCI_GPPM_ADDR 0x04002C
  90. #define PCI_GPPM_WDAT 0x040030
  91. #define PCI_GPPM_RDAT 0x040034
  92. #define PCI_GPPM_CTRL 0x040038
  93. #define GPPM_DONE (1<<10)
  94. #define INIT_PCI_CYCLE (1<<9)
  95. #define GPPM_CMD(X) (((X)&0xf)<<4)
  96. #define GPPM_BYTEEN(X) ((X)&0xf)
  97. #define PCI_UNLOCKREG 0x04003C
  98. #define UNLOCK_SSID(X) (((X)&0xff)<<8)
  99. #define UNLOCK_SETUP(X) (((X)&0xff)<<0)
  100. #define UNLOCK_MAGIC 0xCA
  101. #define PCI_DEV_VEND_ID 0x040040
  102. #define DEVICE_ID(X) (((X)>>16)&0xffff)
  103. #define VENDOR_ID(X) (((X)&0xffff))
  104. #define PCI_CFG_CMDSTAT 0x040044
  105. #define PCI_CFG_STATUS(X) (((X)>>16)&0xffff)
  106. #define PCI_CFG_COMMAND(X) ((X)&0xffff)
  107. #define PCI_CLASS_REV 0x040048
  108. #define PCI_CLASSCODE(X) (((X)>>8)&0xffffff)
  109. #define PCI_REVID(X) ((X)&0xff)
  110. #define PCI_LAT_TMR 0x04004c
  111. #define PCI_BASE10 0x040050
  112. #define PCI_BASE14 0x040054
  113. #define PCI_BASE18 0x040058
  114. #define PCI_SUBSYS_ID 0x04006c
  115. #define PCI_CAP_PTR 0x040074
  116. #define PCI_CFG_MISC 0x04007c
  117. #define PCI_PMC 0x040080
  118. #define PCI_PWR_STATE 0x040084
  119. #define PCI_IO 0x040088
  120. #define PCI_SLVTUNING 0x04008C
  121. #define PCI_DMATUNING 0x040090
  122. #define PCI_DMAEADDR 0x040800
  123. #define PCI_DMAIADDR 0x040804
  124. #define PCI_DMALEN 0x040808
  125. #define PCI_DMACTRL 0x04080C
  126. #define PCI_XIOCTRL 0x040810
  127. #define PCI_SEL0PROF 0x040814
  128. #define PCI_SEL1PROF 0x040818
  129. #define PCI_SEL2PROF 0x04081C
  130. #define PCI_GPXIOADDR 0x040820
  131. #define PCI_NANDCTRLS 0x400830
  132. #define PCI_SEL3PROF 0x040834
  133. #define PCI_SEL4PROF 0x040838
  134. #define PCI_GPXIO_STAT 0x040FB0
  135. #define PCI_GPXIO_IMASK 0x040FB4
  136. #define PCI_GPXIO_ICLR 0x040FB8
  137. #define PCI_GPXIO_ISET 0x040FBC
  138. #define PCI_GPPM_STATUS 0x040FC0
  139. #define GPPM_DONE (1<<10)
  140. #define GPPM_ERR (1<<9)
  141. #define GPPM_MPAR_ERR (1<<8)
  142. #define GPPM_PAR_ERR (1<<7)
  143. #define GPPM_R_MABORT (1<<2)
  144. #define GPPM_R_TABORT (1<<1)
  145. #define PCI_GPPM_IMASK 0x040FC4
  146. #define PCI_GPPM_ICLR 0x040FC8
  147. #define PCI_GPPM_ISET 0x040FCC
  148. #define PCI_DMA_STATUS 0x040FD0
  149. #define PCI_DMA_IMASK 0x040FD4
  150. #define PCI_DMA_ICLR 0x040FD8
  151. #define PCI_DMA_ISET 0x040FDC
  152. #define PCI_ISTATUS 0x040FE0
  153. #define PCI_IMASK 0x040FE4
  154. #define PCI_ICLR 0x040FE8
  155. #define PCI_ISET 0x040FEC
  156. #define PCI_MOD_ID 0x040FFC
  157. /*
  158. * PCI configuration cycle AD bus definition
  159. */
  160. /* Type 0 */
  161. #define PCI_CFG_TYPE0_REG_SHF 0
  162. #define PCI_CFG_TYPE0_FUNC_SHF 8
  163. /* Type 1 */
  164. #define PCI_CFG_TYPE1_REG_SHF 0
  165. #define PCI_CFG_TYPE1_FUNC_SHF 8
  166. #define PCI_CFG_TYPE1_DEV_SHF 11
  167. #define PCI_CFG_TYPE1_BUS_SHF 16
  168. /*
  169. * Ethernet device DP83816 definition
  170. */
  171. #define DP83816_IRQ_ETHER 66
  172. #endif