pci.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef _PLATFORMS_ISERIES_PCI_H
  2. #define _PLATFORMS_ISERIES_PCI_H
  3. /*
  4. * Created by Allan Trautman on Tue Feb 20, 2001.
  5. *
  6. * Define some useful macros for the iSeries pci routines.
  7. * Copyright (C) 2001 Allan H Trautman, IBM Corporation
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the:
  21. * Free Software Foundation, Inc.,
  22. * 59 Temple Place, Suite 330,
  23. * Boston, MA 02111-1307 USA
  24. *
  25. * Change Activity:
  26. * Created Feb 20, 2001
  27. * Added device reset, March 22, 2001
  28. * Ported to ppc64, May 25, 2001
  29. * End Change Activity
  30. */
  31. /*
  32. * Decodes Linux DevFn to iSeries DevFn, bridge device, or function.
  33. * For Linux, see PCI_SLOT and PCI_FUNC in include/linux/pci.h
  34. */
  35. #define ISERIES_PCI_AGENTID(idsel, func) \
  36. (((idsel & 0x0F) << 4) | (func & 0x07))
  37. #define ISERIES_ENCODE_DEVICE(agentid) \
  38. ((0x10) | ((agentid & 0x20) >> 2) | (agentid & 0x07))
  39. #define ISERIES_GET_DEVICE_FROM_SUBBUS(subbus) ((subbus >> 5) & 0x7)
  40. #define ISERIES_GET_FUNCTION_FROM_SUBBUS(subbus) ((subbus >> 2) & 0x7)
  41. struct pci_dev;
  42. #ifdef CONFIG_PCI
  43. extern void iSeries_pcibios_init(void);
  44. extern void iSeries_pci_final_fixup(void);
  45. extern void iSeries_pcibios_fixup_resources(struct pci_dev *dev);
  46. #else
  47. static inline void iSeries_pcibios_init(void) { }
  48. static inline void iSeries_pci_final_fixup(void) { }
  49. static inline void iSeries_pcibios_fixup_resources(struct pci_dev *dev) {}
  50. #endif
  51. #endif /* _PLATFORMS_ISERIES_PCI_H */