pci.README 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. Pete Popov, ppopov@pacbell.net
  2. 07/11/2001
  3. This README briefly explains how to use the pci and pci_auto
  4. code in arch/mips/kernel. The code was ported from PowerPC and
  5. modified slightly. It has been tested pretty well on PPC on some
  6. rather complex systems with multiple bridges and devices behind
  7. each bridge. However, at the time this README was written, the
  8. mips port was tested only on boards with a single pci bus and
  9. no P2P bridges. It's very possible that on boards with P2P
  10. bridges some modifications have to be made. The code will
  11. evolve, no doubt, but currently every single mips board
  12. is doing its own pcibios thing and it has become a big
  13. mess. This generic pci code is meant to clean up the mips
  14. pci mess and make it easier to add pci support to new boards.
  15. inside the define for your board in arch/mips/config.in.
  16. For example, the Galileo EV96100 board looks like this:
  17. if [ "$CONFIG_MIPS_EV96100" = "y" ]; then
  18. define_bool CONFIG_PCI y
  19. define_bool CONFIG_MIPS_GT96100 y
  20. define_bool CONFIG_NEW_PCI y
  21. define_bool CONFIG_SWAP_IO_SPACE y
  22. fi
  23. Next, if you want to use the arch/mips/kernel/pci code, which has the
  24. pcibios_init() function, add
  25. define_bool CONFIG_NEW_PCI y
  26. inside the define for your board. Again, the EV96100 example above
  27. show NEW_PCI turned on.
  28. Now you need to add your files to hook in your pci configuration
  29. cycles. Usually you'll need only a couple of files named something
  30. like pci_fixups.c and pci_ops.c. You can copy the templates
  31. provided and fill in the code.
  32. The file pci_ops.c should contain the pci configuration cycles routines.
  33. It also has the mips_pci_channels[] array which contains the descriptors
  34. of each pci controller.
  35. The file pci_fixups.c contains a few routines to do interrupt fixups,
  36. resources fixups, and, if needed, pci bios fixups.
  37. Usually you'll put your pci_fixups.c file in your board specific directory,
  38. since the functions in that file are board specific. The functions in
  39. pci_ops.c, on the other hand, are usually pci controller specific so that
  40. file could be shared among a few different boards using the same
  41. pci controller.