fixup-au1000.c 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*
  2. * BRIEF MODULE DESCRIPTION
  3. * Board specific pci fixups.
  4. *
  5. * Copyright 2001-2003 MontaVista Software Inc.
  6. * Author: MontaVista Software, Inc.
  7. * ppopov@mvista.com or source@mvista.com
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public License as published by the
  11. * Free Software Foundation; either version 2 of the License, or (at your
  12. * option) any later version.
  13. *
  14. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  15. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  16. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  17. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  18. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  19. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  20. * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  21. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  23. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24. *
  25. * You should have received a copy of the GNU General Public License along
  26. * with this program; if not, write to the Free Software Foundation, Inc.,
  27. * 675 Mass Ave, Cambridge, MA 02139, USA.
  28. */
  29. #include <linux/config.h>
  30. #include <linux/types.h>
  31. #include <linux/pci.h>
  32. #include <linux/kernel.h>
  33. #include <linux/init.h>
  34. #include <asm/mach-au1x00/au1000.h>
  35. /*
  36. * Shortcut
  37. */
  38. #ifdef CONFIG_SOC_AU1500
  39. #define INTA AU1000_PCI_INTA
  40. #define INTB AU1000_PCI_INTB
  41. #define INTC AU1000_PCI_INTC
  42. #define INTD AU1000_PCI_INTD
  43. #endif
  44. #ifdef CONFIG_SOC_AU1550
  45. #define INTA AU1550_PCI_INTA
  46. #define INTB AU1550_PCI_INTB
  47. #define INTC AU1550_PCI_INTC
  48. #define INTD AU1550_PCI_INTD
  49. #endif
  50. #define INTX 0xFF /* not valid */
  51. #ifdef CONFIG_MIPS_DB1500
  52. static char irq_tab_alchemy[][5] __initdata = {
  53. [12] = { -1, INTA, INTX, INTX, INTX}, /* IDSEL 12 - HPT371 */
  54. [13] = { -1, INTA, INTB, INTC, INTD}, /* IDSEL 13 - PCI slot */
  55. };
  56. #endif
  57. #ifdef CONFIG_MIPS_BOSPORUS
  58. static char irq_tab_alchemy[][5] __initdata = {
  59. [11] = { -1, INTA, INTB, INTX, INTX}, /* IDSEL 11 - miniPCI */
  60. [12] = { -1, INTA, INTX, INTX, INTX}, /* IDSEL 12 - SN1741 */
  61. [13] = { -1, INTA, INTB, INTC, INTD}, /* IDSEL 13 - PCI slot */
  62. };
  63. #endif
  64. #ifdef CONFIG_MIPS_MIRAGE
  65. static char irq_tab_alchemy[][5] __initdata = {
  66. [11] = { -1, INTD, INTX, INTX, INTX}, /* IDSEL 11 - SMI VGX */
  67. [12] = { -1, INTX, INTX, INTC, INTX}, /* IDSEL 12 - PNX1300 */
  68. [13] = { -1, INTA, INTB, INTX, INTX}, /* IDSEL 13 - miniPCI */
  69. };
  70. #endif
  71. #ifdef CONFIG_MIPS_DB1550
  72. static char irq_tab_alchemy[][5] __initdata = {
  73. [11] = { -1, INTC, INTX, INTX, INTX}, /* IDSEL 11 - on-board HPT371 */
  74. [12] = { -1, INTB, INTC, INTD, INTA}, /* IDSEL 12 - PCI slot 2 (left) */
  75. [13] = { -1, INTA, INTB, INTC, INTD}, /* IDSEL 13 - PCI slot 1 (right) */
  76. };
  77. #endif
  78. #ifdef CONFIG_MIPS_PB1500
  79. static char irq_tab_alchemy[][5] __initdata = {
  80. [12] = { -1, INTA, INTX, INTX, INTX}, /* IDSEL 12 - HPT370 */
  81. [13] = { -1, INTA, INTB, INTC, INTD}, /* IDSEL 13 - PCI slot */
  82. };
  83. #endif
  84. #ifdef CONFIG_MIPS_PB1550
  85. static char irq_tab_alchemy[][5] __initdata = {
  86. [12] = { -1, INTB, INTC, INTD, INTA}, /* IDSEL 12 - PCI slot 2 (left) */
  87. [13] = { -1, INTA, INTB, INTC, INTD}, /* IDSEL 13 - PCI slot 1 (right) */
  88. };
  89. #endif
  90. #ifdef CONFIG_MIPS_MTX1
  91. static char irq_tab_alchemy[][5] __initdata = {
  92. [0] = { -1, INTA, INTB, INTX, INTX}, /* IDSEL 00 - AdapterA-Slot0 (top) */
  93. [1] = { -1, INTB, INTA, INTX, INTX}, /* IDSEL 01 - AdapterA-Slot1 (bottom) */
  94. [2] = { -1, INTC, INTD, INTX, INTX}, /* IDSEL 02 - AdapterB-Slot0 (top) */
  95. [3] = { -1, INTD, INTC, INTX, INTX}, /* IDSEL 03 - AdapterB-Slot1 (bottom) */
  96. [4] = { -1, INTA, INTB, INTX, INTX}, /* IDSEL 04 - AdapterC-Slot0 (top) */
  97. [5] = { -1, INTB, INTA, INTX, INTX}, /* IDSEL 05 - AdapterC-Slot1 (bottom) */
  98. [6] = { -1, INTC, INTD, INTX, INTX}, /* IDSEL 06 - AdapterD-Slot0 (top) */
  99. [7] = { -1, INTD, INTC, INTX, INTX}, /* IDSEL 07 - AdapterD-Slot1 (bottom) */
  100. };
  101. #endif
  102. int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
  103. {
  104. return irq_tab_alchemy[slot][pin];
  105. }
  106. /* Do platform specific device initialization at pci_enable_device() time */
  107. int pcibios_plat_dev_init(struct pci_dev *dev)
  108. {
  109. return 0;
  110. }