gemini_pci.c 886 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include <linux/kernel.h>
  2. #include <linux/init.h>
  3. #include <linux/pci.h>
  4. #include <linux/slab.h>
  5. #include <asm/machdep.h>
  6. #include <platforms/gemini.h>
  7. #include <asm/byteorder.h>
  8. #include <asm/io.h>
  9. #include <asm/uaccess.h>
  10. #include <asm/pci-bridge.h>
  11. void __init gemini_pcibios_fixup(void)
  12. {
  13. int i;
  14. struct pci_dev *dev = NULL;
  15. for_each_pci_dev(dev) {
  16. for(i = 0; i < 6; i++) {
  17. if (dev->resource[i].flags & IORESOURCE_IO) {
  18. dev->resource[i].start |= (0xfe << 24);
  19. dev->resource[i].end |= (0xfe << 24);
  20. }
  21. }
  22. }
  23. }
  24. /* The "bootloader" for Synergy boards does none of this for us, so we need to
  25. lay it all out ourselves... --Dan */
  26. void __init gemini_find_bridges(void)
  27. {
  28. struct pci_controller* hose;
  29. ppc_md.pcibios_fixup = gemini_pcibios_fixup;
  30. hose = pcibios_alloc_controller();
  31. if (!hose)
  32. return;
  33. setup_indirect_pci(hose, 0xfec00000, 0xfee00000);
  34. }