pci.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * arch/arm/include/asm/mach/pci.h
  3. *
  4. * Copyright (C) 2000 Russell King
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef __ASM_MACH_PCI_H
  11. #define __ASM_MACH_PCI_H
  12. struct pci_sys_data;
  13. struct pci_ops;
  14. struct pci_bus;
  15. struct hw_pci {
  16. #ifdef CONFIG_PCI_DOMAINS
  17. int domain;
  18. #endif
  19. struct pci_ops *ops;
  20. int nr_controllers;
  21. int (*setup)(int nr, struct pci_sys_data *);
  22. struct pci_bus *(*scan)(int nr, struct pci_sys_data *);
  23. void (*preinit)(void);
  24. void (*postinit)(void);
  25. u8 (*swizzle)(struct pci_dev *dev, u8 *pin);
  26. int (*map_irq)(const struct pci_dev *dev, u8 slot, u8 pin);
  27. };
  28. /*
  29. * Per-controller structure
  30. */
  31. struct pci_sys_data {
  32. #ifdef CONFIG_PCI_DOMAINS
  33. int domain;
  34. #endif
  35. struct list_head node;
  36. int busnr; /* primary bus number */
  37. u64 mem_offset; /* bus->cpu memory mapping offset */
  38. unsigned long io_offset; /* bus->cpu IO mapping offset */
  39. struct pci_bus *bus; /* PCI bus */
  40. struct list_head resources; /* root bus resources (apertures) */
  41. /* Bridge swizzling */
  42. u8 (*swizzle)(struct pci_dev *, u8 *);
  43. /* IRQ mapping */
  44. int (*map_irq)(const struct pci_dev *, u8, u8);
  45. void *private_data; /* platform controller private data */
  46. };
  47. /*
  48. * Call this with your hw_pci struct to initialise the PCI system.
  49. */
  50. void pci_common_init(struct hw_pci *);
  51. /*
  52. * PCI controllers
  53. */
  54. extern struct pci_ops iop3xx_ops;
  55. extern int iop3xx_pci_setup(int nr, struct pci_sys_data *);
  56. extern void iop3xx_pci_preinit(void);
  57. extern void iop3xx_pci_preinit_cond(void);
  58. extern struct pci_ops dc21285_ops;
  59. extern int dc21285_setup(int nr, struct pci_sys_data *);
  60. extern void dc21285_preinit(void);
  61. extern void dc21285_postinit(void);
  62. extern struct pci_ops via82c505_ops;
  63. extern int via82c505_setup(int nr, struct pci_sys_data *);
  64. extern void via82c505_init(void *sysdata);
  65. extern struct pci_ops pci_v3_ops;
  66. extern int pci_v3_setup(int nr, struct pci_sys_data *);
  67. extern void pci_v3_preinit(void);
  68. extern void pci_v3_postinit(void);
  69. #endif /* __ASM_MACH_PCI_H */