fixup-ocelot3.c 1003 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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) 2004 Montavista Software Inc.
  7. * Author: Manish Lachwani (mlachwani@mvista.com)
  8. *
  9. * Looking at the schematics for the Ocelot-3 board, there are
  10. * two PCI busses and each bus has two PCI slots.
  11. */
  12. #include <linux/kernel.h>
  13. #include <linux/init.h>
  14. #include <linux/pci.h>
  15. #include <asm/mipsregs.h>
  16. /*
  17. * Do platform specific device initialization at
  18. * pci_enable_device() time
  19. */
  20. int pcibios_plat_dev_init(struct pci_dev *dev)
  21. {
  22. return 0;
  23. }
  24. int __init pcibios_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
  25. {
  26. int bus = dev->bus->number;
  27. if (bus == 0 && slot == 1)
  28. return 2; /* PCI-X A */
  29. if (bus == 0 && slot == 2)
  30. return 3; /* PCI-X B */
  31. if (bus == 1 && slot == 1)
  32. return 4; /* PCI A */
  33. if (bus == 1 && slot == 2)
  34. return 5; /* PCI B */
  35. return 0;
  36. panic("Whooops in pcibios_map_irq");
  37. }