pci-lasat.c 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2000, 2001, 04 Keith M Wesolowski
  7. */
  8. #include <linux/kernel.h>
  9. #include <linux/init.h>
  10. #include <linux/interrupt.h>
  11. #include <linux/pci.h>
  12. #include <linux/types.h>
  13. #include <linux/delay.h>
  14. #include <asm/bootinfo.h>
  15. extern struct pci_ops nile4_pci_ops;
  16. extern struct pci_ops gt64120_pci_ops;
  17. static struct resource lasat_pci_mem_resource = {
  18. .name = "LASAT PCI MEM",
  19. .start = 0x18000000,
  20. .end = 0x19FFFFFF,
  21. .flags = IORESOURCE_MEM,
  22. };
  23. static struct resource lasat_pci_io_resource = {
  24. .name = "LASAT PCI IO",
  25. .start = 0x1a000000,
  26. .end = 0x1bFFFFFF,
  27. .flags = IORESOURCE_IO,
  28. };
  29. static struct pci_controller lasat_pci_controller = {
  30. .mem_resource = &lasat_pci_mem_resource,
  31. .io_resource = &lasat_pci_io_resource,
  32. };
  33. static int __init lasat_pci_setup(void)
  34. {
  35. printk("PCI: starting\n");
  36. switch (mips_machtype) {
  37. case MACH_LASAT_100:
  38. lasat_pci_controller.pci_ops = &gt64120_pci_ops;
  39. break;
  40. case MACH_LASAT_200:
  41. lasat_pci_controller.pci_ops = &nile4_pci_ops;
  42. break;
  43. default:
  44. panic("pcibios_init: mips_machtype incorrect");
  45. }
  46. register_pci_controller(&lasat_pci_controller);
  47. return 0;
  48. }
  49. arch_initcall(lasat_pci_setup);
  50. #define LASATINT_ETH1 0
  51. #define LASATINT_ETH0 1
  52. #define LASATINT_HDC 2
  53. #define LASATINT_COMP 3
  54. #define LASATINT_HDLC 4
  55. #define LASATINT_PCIA 5
  56. #define LASATINT_PCIB 6
  57. #define LASATINT_PCIC 7
  58. #define LASATINT_PCID 8
  59. int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
  60. {
  61. switch (slot) {
  62. case 1:
  63. return LASATINT_PCIA; /* Expansion Module 0 */
  64. case 2:
  65. return LASATINT_PCIB; /* Expansion Module 1 */
  66. case 3:
  67. return LASATINT_PCIC; /* Expansion Module 2 */
  68. case 4:
  69. return LASATINT_ETH1; /* Ethernet 1 (LAN 2) */
  70. case 5:
  71. return LASATINT_ETH0; /* Ethernet 0 (LAN 1) */
  72. case 6:
  73. return LASATINT_HDC; /* IDE controller */
  74. default:
  75. return 0xff; /* Illegal */
  76. }
  77. return -1;
  78. }
  79. /* Do platform specific device initialization at pci_enable_device() time */
  80. int pcibios_plat_dev_init(struct pci_dev *dev)
  81. {
  82. return 0;
  83. }