pci.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 list_head buses;
  20. struct pci_ops *ops;
  21. int nr_controllers;
  22. int (*setup)(int nr, struct pci_sys_data *);
  23. struct pci_bus *(*scan)(int nr, struct pci_sys_data *);
  24. void (*preinit)(void);
  25. void (*postinit)(void);
  26. u8 (*swizzle)(struct pci_dev *dev, u8 *pin);
  27. int (*map_irq)(const struct pci_dev *dev, u8 slot, u8 pin);
  28. };
  29. /*
  30. * Per-controller structure
  31. */
  32. struct pci_sys_data {
  33. #ifdef CONFIG_PCI_DOMAINS
  34. int domain;
  35. #endif
  36. struct list_head node;
  37. int busnr; /* primary bus number */
  38. u64 mem_offset; /* bus->cpu memory mapping offset */
  39. unsigned long io_offset; /* bus->cpu IO mapping offset */
  40. struct pci_bus *bus; /* PCI bus */
  41. struct list_head resources; /* root bus resources (apertures) */
  42. /* Bridge swizzling */
  43. u8 (*swizzle)(struct pci_dev *, u8 *);
  44. /* IRQ mapping */
  45. int (*map_irq)(const struct pci_dev *, u8, u8);
  46. void *private_data; /* platform controller private data */
  47. };
  48. /*
  49. * Call this with your hw_pci struct to initialise the PCI system.
  50. */
  51. void pci_common_init(struct hw_pci *);
  52. /*
  53. * PCI controllers
  54. */
  55. extern struct pci_ops iop3xx_ops;
  56. extern int iop3xx_pci_setup(int nr, struct pci_sys_data *);
  57. extern void iop3xx_pci_preinit(void);
  58. extern void iop3xx_pci_preinit_cond(void);
  59. extern struct pci_ops dc21285_ops;
  60. extern int dc21285_setup(int nr, struct pci_sys_data *);
  61. extern void dc21285_preinit(void);
  62. extern void dc21285_postinit(void);
  63. extern struct pci_ops via82c505_ops;
  64. extern int via82c505_setup(int nr, struct pci_sys_data *);
  65. extern void via82c505_init(void *sysdata);
  66. extern struct pci_ops pci_v3_ops;
  67. extern int pci_v3_setup(int nr, struct pci_sys_data *);
  68. extern void pci_v3_preinit(void);
  69. extern void pci_v3_postinit(void);
  70. #endif /* __ASM_MACH_PCI_H */