pci.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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_bus;
  14. struct hw_pci {
  15. #ifdef CONFIG_PCI_DOMAINS
  16. int domain;
  17. #endif
  18. struct list_head buses;
  19. int nr_controllers;
  20. int (*setup)(int nr, struct pci_sys_data *);
  21. struct pci_bus *(*scan)(int nr, struct pci_sys_data *);
  22. void (*preinit)(void);
  23. void (*postinit)(void);
  24. u8 (*swizzle)(struct pci_dev *dev, u8 *pin);
  25. int (*map_irq)(struct pci_dev *dev, u8 slot, u8 pin);
  26. };
  27. /*
  28. * Per-controller structure
  29. */
  30. struct pci_sys_data {
  31. #ifdef CONFIG_PCI_DOMAINS
  32. int domain;
  33. #endif
  34. struct list_head node;
  35. int busnr; /* primary bus number */
  36. u64 mem_offset; /* bus->cpu memory mapping offset */
  37. unsigned long io_offset; /* bus->cpu IO mapping offset */
  38. struct pci_bus *bus; /* PCI bus */
  39. struct resource *resource[3]; /* Primary PCI bus resources */
  40. /* Bridge swizzling */
  41. u8 (*swizzle)(struct pci_dev *, u8 *);
  42. /* IRQ mapping */
  43. int (*map_irq)(struct pci_dev *, u8, u8);
  44. struct hw_pci *hw;
  45. void *private_data; /* platform controller private data */
  46. };
  47. /*
  48. * This is the standard PCI-PCI bridge swizzling algorithm.
  49. */
  50. #define pci_std_swizzle pci_common_swizzle
  51. /*
  52. * Call this with your hw_pci struct to initialise the PCI system.
  53. */
  54. void pci_common_init(struct hw_pci *);
  55. /*
  56. * PCI controllers
  57. */
  58. extern int iop3xx_pci_setup(int nr, struct pci_sys_data *);
  59. extern struct pci_bus *iop3xx_pci_scan_bus(int nr, struct pci_sys_data *);
  60. extern void iop3xx_pci_preinit(void);
  61. extern void iop3xx_pci_preinit_cond(void);
  62. extern int dc21285_setup(int nr, struct pci_sys_data *);
  63. extern struct pci_bus *dc21285_scan_bus(int nr, struct pci_sys_data *);
  64. extern void dc21285_preinit(void);
  65. extern void dc21285_postinit(void);
  66. extern int via82c505_setup(int nr, struct pci_sys_data *);
  67. extern struct pci_bus *via82c505_scan_bus(int nr, struct pci_sys_data *);
  68. extern void via82c505_init(void *sysdata);
  69. extern int pci_v3_setup(int nr, struct pci_sys_data *);
  70. extern struct pci_bus *pci_v3_scan_bus(int nr, struct pci_sys_data *);
  71. extern void pci_v3_preinit(void);
  72. extern void pci_v3_postinit(void);
  73. #endif /* __ASM_MACH_PCI_H */