pci.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. };
  46. /*
  47. * This is the standard PCI-PCI bridge swizzling algorithm.
  48. */
  49. #define pci_std_swizzle pci_common_swizzle
  50. /*
  51. * Call this with your hw_pci struct to initialise the PCI system.
  52. */
  53. void pci_common_init(struct hw_pci *);
  54. /*
  55. * PCI controllers
  56. */
  57. extern int iop3xx_pci_setup(int nr, struct pci_sys_data *);
  58. extern struct pci_bus *iop3xx_pci_scan_bus(int nr, struct pci_sys_data *);
  59. extern void iop3xx_pci_preinit(void);
  60. extern void iop3xx_pci_preinit_cond(void);
  61. extern int dc21285_setup(int nr, struct pci_sys_data *);
  62. extern struct pci_bus *dc21285_scan_bus(int nr, struct pci_sys_data *);
  63. extern void dc21285_preinit(void);
  64. extern void dc21285_postinit(void);
  65. extern int via82c505_setup(int nr, struct pci_sys_data *);
  66. extern struct pci_bus *via82c505_scan_bus(int nr, struct pci_sys_data *);
  67. extern void via82c505_init(void *sysdata);
  68. extern int pci_v3_setup(int nr, struct pci_sys_data *);
  69. extern struct pci_bus *pci_v3_scan_bus(int nr, struct pci_sys_data *);
  70. extern void pci_v3_preinit(void);
  71. extern void pci_v3_postinit(void);
  72. #endif /* __ASM_MACH_PCI_H */