pal4_pci.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * arch/ppc/platforms/pal4_pci.c
  3. *
  4. * PCI support for SBS Palomar IV
  5. *
  6. * Author: Dan Cox
  7. *
  8. * 2002 (c) MontaVista, Software, Inc. This file is licensed under
  9. * the terms of the GNU General Public License version 2. This program
  10. * is licensed "as is" without any warranty of any kind, whether express
  11. * or implied.
  12. */
  13. #include <linux/kernel.h>
  14. #include <linux/init.h>
  15. #include <linux/pci.h>
  16. #include <asm/byteorder.h>
  17. #include <asm/machdep.h>
  18. #include <asm/io.h>
  19. #include <asm/pci-bridge.h>
  20. #include <asm/uaccess.h>
  21. #include <syslib/cpc700.h>
  22. #include "pal4.h"
  23. /* not much to this.... */
  24. static inline int __init
  25. pal4_map_irq(struct pci_dev *dev, unsigned char idsel, unsigned char pin)
  26. {
  27. if (idsel == 9)
  28. return PAL4_ETH;
  29. else
  30. return PAL4_INTA + (idsel - 3);
  31. }
  32. void __init
  33. pal4_find_bridges(void)
  34. {
  35. struct pci_controller *hose;
  36. hose = pcibios_alloc_controller();
  37. if (!hose)
  38. return;
  39. hose->first_busno = 0;
  40. hose->last_busno = 0xff;
  41. hose->pci_mem_offset = 0;
  42. /* Could snatch these from the CPC700.... */
  43. pci_init_resource(&hose->io_resource,
  44. 0x0,
  45. 0x03ffffff,
  46. IORESOURCE_IO,
  47. "PCI host bridge");
  48. pci_init_resource(&hose->mem_resources[0],
  49. 0x90000000,
  50. 0x9fffffff,
  51. IORESOURCE_MEM,
  52. "PCI host bridge");
  53. hose->io_space.start = 0x00800000;
  54. hose->io_space.end = 0x03ffffff;
  55. hose->mem_space.start = 0x90000000;
  56. hose->mem_space.end = 0x9fffffff;
  57. hose->io_base_virt = (void *) 0xf8000000;
  58. setup_indirect_pci(hose, CPC700_PCI_CONFIG_ADDR,
  59. CPC700_PCI_CONFIG_DATA);
  60. hose->last_busno = pciauto_bus_scan(hose, hose->first_busno);
  61. ppc_md.pci_swizzle = common_swizzle;
  62. ppc_md.pci_map_irq = pal4_map_irq;
  63. }