pci_parts.h 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. /*
  2. * (C) Copyright 2001
  3. * Denis Peter, MPL AG Switzerland, d.peter@mpl.ch
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (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,
  21. * MA 02111-1307 USA
  22. *
  23. */
  24. #ifndef _PCI_PARTS_H_
  25. #define _PCI_PARTS_H_
  26. /* Board specific file containing:
  27. * - PCI Memory Mapping
  28. * - PCI IO Mapping
  29. * - PCI Interrupt Mapping
  30. */
  31. /* PIP405 PCI INT Routing:
  32. * IRQ0 VECTOR
  33. * PIXX4 IDSEL = AD16 INTA# 28 (Function 2 USB is INTD# = 31)
  34. * VGA IDSEL = AD17 INTB# 29
  35. * SCSI IDSEL = AD18 INTC# 30
  36. * PC104 IDSEL0 = AD20 INTA# 28
  37. * PC104 IDSEL1 = AD21 INTB# 29
  38. * PC104 IDSEL2 = AD22 INTC# 30
  39. * PC104 IDSEL3 = AD23 INTD# 31
  40. *
  41. * busdevfunc = EXXX XXXX BBBB BBBB DDDD DFFF RRRR RR00
  42. * ^ ^ ^ ^ ^
  43. * 31 23 15 10 7
  44. * E = Enabled
  45. * B = Bussnumber
  46. * D = Devicenumber (Device0 = AD10)
  47. * F = Functionnumber
  48. * R = Registernumber
  49. *
  50. * Device = (busdevfunc>>11) + 10
  51. * Vector = devicenumber % 4 + 28
  52. *
  53. */
  54. #define PCI_HIGHEST_ON_BOARD_ID 19
  55. /*#define PCI_DEV_NUMBER(x) (((x>>11) & 0x1f) + 10) */
  56. #define PCI_IRQ_VECTOR(x) ((PCI_DEV(x) + 10) % 4) + 28
  57. /* PCI Device List for PIP405 */
  58. /* Mapping:
  59. * +-------------+------------+------------+--------------------------------+
  60. * ¦ PCI MemAddr | PCI IOAddr | Local Addr | Device / Function |
  61. * +-------------+------------+------------+--------------------------------+
  62. * | 0x00000000 | | 0xA0000000 | ISA Memory (hard wired) |
  63. * | 0x00FFFFFF | | 0xA0FFFFFF | |
  64. * +-------------+------------+------------+--------------------------------+
  65. * | | 0x00000000 | 0xE8000000 | ISA IO (hard wired) |
  66. * | | 0x0000FFFF | 0xE800FFFF | |
  67. * +-------------+------------+------------+--------------------------------+
  68. * | 0x80000000 | | 0x80000000 | VGA Controller Memory |
  69. * | 0x80FFFFFF | | 0x80FFFFFF | |
  70. * +-------------+------------+------------+--------------------------------+
  71. * | 0x81000000 | | 0x81000000 | SCSI Controller Memory |
  72. * | 0x81FFFFFF | | 0x81FFFFFF | |
  73. * +-------------+------------+------------+--------------------------------+
  74. */
  75. struct pci_pip405_config_entry {
  76. int index; /* address */
  77. unsigned long val; /* value */
  78. int width; /* data size */
  79. };
  80. extern void pci_pip405_write_regs(struct pci_controller *,
  81. pci_dev_t,
  82. struct pci_config_table *);
  83. /* PIIX4 ISA Bridge Function 0 */
  84. static struct pci_pip405_config_entry piix4_isa_bridge_f0[] = {
  85. {PCI_CFG_PIIX4_SERIRQ, 0xD0, 1}, /* enable Continous SERIRQ Pin */
  86. {PCI_CFG_PIIX4_GENCFG, 0x00018041, 4}, /* enable SERIRQs, ISA, PNP, GPI11 */
  87. {PCI_CFG_PIIX4_TOM, 0xFE, 1}, /* Top of Memory */
  88. {PCI_CFG_PIIX4_XBCS, 0x02C4, 2}, /* disable all peri CS */
  89. {PCI_CFG_PIIX4_RTCCFG, 0x21, 1}, /* enable RTC */
  90. #if defined(CONFIG_PIP405)
  91. {PCI_CFG_PIIX4_MBDMA, 0x82, 1}, /* set MBDMA0 to DMA 2 */
  92. {PCI_CFG_PIIX4_MBDMA+1, 0x83, 1}, /* set MBDMA1 to DMA 3 */
  93. #endif
  94. {PCI_CFG_PIIX4_DLC, 0x0, 1}, /* disable passive release feature */
  95. { } /* end of device table */
  96. };
  97. /* PIIX4 IDE Controller Function 1 */
  98. static struct pci_pip405_config_entry piix4_ide_cntrl_f1[] = {
  99. {PCI_CFG_PIIX4_BMIBA, 0x0001000, 4}, /* set BMI to a valid address */
  100. {PCI_COMMAND, 0x0001, 2}, /* enable IO access */
  101. #if !defined(CONFIG_MIP405T)
  102. {PCI_CFG_PIIX4_IDETIM, 0x80008000, 4}, /* enable Both IDE channels */
  103. #else
  104. {PCI_CFG_PIIX4_IDETIM, 0x00008000, 4}, /* enable IDE channel0 */
  105. #endif
  106. { } /* end of device table */
  107. };
  108. /* PIIX4 USB Controller Function 2 */
  109. static struct pci_pip405_config_entry piix4_usb_cntrl_f2[] = {
  110. #if !defined(CONFIG_MIP405T)
  111. {PCI_INTERRUPT_LINE, 31, 1}, /* Int vector = 31 */
  112. {PCI_BASE_ADDRESS_4, 0x0000E001, 4}, /* Set IO Address to 0xe000 to 0xe01F */
  113. {PCI_LATENCY_TIMER, 0x80, 1}, /* Latency Timer 0x80 */
  114. {0xC0, 0x2000, 2}, /* Legacy support */
  115. {PCI_COMMAND, 0x0005, 2}, /* enable IO access and Master */
  116. #endif
  117. { } /* end of device table */
  118. };
  119. /* PIIX4 Power Management Function 3 */
  120. static struct pci_pip405_config_entry piix4_pmm_cntrl_f3[] = {
  121. {PCI_CFG_PIIX4_PMBA, 0x00004000, 4}, /* set PMBA to "valid" value */
  122. {PCI_CFG_PIIX4_SMBBA, 0x00005000, 4}, /* set SMBBA to "valid" value */
  123. {PCI_CFG_PIIX4_PMMISC, 0x01, 1}, /* enable PMBA IO access */
  124. {PCI_COMMAND, 0x0001, 2}, /* enable IO access */
  125. { } /* end of device table */
  126. };
  127. /* PPC405 Dummy only used to prevent autosetup on this host bridge */
  128. static struct pci_pip405_config_entry ppc405_dummy[] = {
  129. { } /* end of device table */
  130. };
  131. void pci_405gp_setup_vga(struct pci_controller *hose, pci_dev_t dev,
  132. struct pci_config_table *entry);
  133. static struct pci_config_table pci_pip405_config_table[]={
  134. {PCI_VENDOR_ID_IBM, /* 405 dummy */
  135. PCI_DEVICE_ID_IBM_405GP,
  136. PCI_ANY_ID,
  137. PCI_ANY_ID, PCI_ANY_ID, 0,
  138. pci_pip405_write_regs, {(unsigned long) ppc405_dummy}},
  139. {PCI_VENDOR_ID_INTEL, /* PIIX4 ISA Bridge Function 0 */
  140. PCI_DEVICE_ID_INTEL_82371AB_0,
  141. PCI_ANY_ID,
  142. PCI_ANY_ID, PCI_ANY_ID, 0,
  143. pci_pip405_write_regs, {(unsigned long) piix4_isa_bridge_f0}},
  144. {PCI_VENDOR_ID_INTEL, /* PIIX4 IDE Controller Function 1 */
  145. PCI_DEVICE_ID_INTEL_82371AB,
  146. PCI_ANY_ID,
  147. PCI_ANY_ID, PCI_ANY_ID, 1,
  148. pci_pip405_write_regs, {(unsigned long) piix4_ide_cntrl_f1}},
  149. {PCI_VENDOR_ID_INTEL, /* PIIX4 USB Controller Function 2 */
  150. PCI_DEVICE_ID_INTEL_82371AB_2,
  151. PCI_ANY_ID,
  152. PCI_ANY_ID, PCI_ANY_ID, 2,
  153. pci_pip405_write_regs, {(unsigned long) piix4_usb_cntrl_f2}},
  154. {PCI_VENDOR_ID_INTEL, /* PIIX4 USB Controller Function 3 */
  155. PCI_DEVICE_ID_INTEL_82371AB_3,
  156. PCI_ANY_ID,
  157. PCI_ANY_ID, PCI_ANY_ID, 3,
  158. pci_pip405_write_regs, {(unsigned long) piix4_pmm_cntrl_f3}},
  159. {PCI_ANY_ID,
  160. PCI_ANY_ID,
  161. PCI_CLASS_DISPLAY_VGA,
  162. PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
  163. pci_405gp_setup_vga},
  164. {PCI_ANY_ID,
  165. PCI_ANY_ID,
  166. PCI_CLASS_NOT_DEFINED_VGA,
  167. PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
  168. pci_405gp_setup_vga},
  169. { }
  170. };
  171. #endif /* _PCI_PARTS_H_ */