pci.h
上传用户:szlgq88
上传日期:2009-04-28
资源大小:48287k
文件大小:2k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /*
  2.  *  linux/include/asm-arm/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. struct pci_sys_data;
  11. struct pci_bus;
  12. struct hw_pci {
  13. struct list_head buses;
  14. int nr_controllers;
  15. int (*setup)(int nr, struct pci_sys_data *);
  16. struct pci_bus *(*scan)(int nr, struct pci_sys_data *);
  17. void (*preinit)(void);
  18. void (*postinit)(void);
  19. u8 (*swizzle)(struct pci_dev *dev, u8 *pin);
  20. int (*map_irq)(struct pci_dev *dev, u8 slot, u8 pin);
  21. };
  22. /*
  23.  * Per-controller structure
  24.  */
  25. struct pci_sys_data {
  26. struct list_head node;
  27. int busnr; /* primary bus number */
  28. unsigned long mem_offset; /* bus->cpu memory mapping offset */
  29. unsigned long io_offset; /* bus->cpu IO mapping offset */
  30. struct pci_bus *bus; /* PCI bus */
  31. struct resource *resource[3]; /* Primary PCI bus resources */
  32. /* Bridge swizzling */
  33. u8 (*swizzle)(struct pci_dev *, u8 *);
  34. /* IRQ mapping */
  35. int (*map_irq)(struct pci_dev *, u8, u8);
  36. struct hw_pci *hw;
  37. };
  38. /*
  39.  * This is the standard PCI-PCI bridge swizzling algorithm.
  40.  */
  41. u8 pci_std_swizzle(struct pci_dev *dev, u8 *pinp);
  42. /*
  43.  * Call this with your hw_pci struct to initialise the PCI system.
  44.  */
  45. void pci_common_init(struct hw_pci *);
  46. /*
  47.  * PCI controllers
  48.  */
  49. extern int iop321_setup(int nr, struct pci_sys_data *);
  50. extern struct pci_bus *iop321_scan_bus(int nr, struct pci_sys_data *);
  51. extern void iop321_init(void);
  52. extern int iop331_setup(int nr, struct pci_sys_data *);
  53. extern struct pci_bus *iop331_scan_bus(int nr, struct pci_sys_data *);
  54. extern void iop331_init(void);
  55. extern int dc21285_setup(int nr, struct pci_sys_data *);
  56. extern struct pci_bus *dc21285_scan_bus(int nr, struct pci_sys_data *);
  57. extern void dc21285_preinit(void);
  58. extern void dc21285_postinit(void);
  59. extern int via82c505_setup(int nr, struct pci_sys_data *);
  60. extern struct pci_bus *via82c505_scan_bus(int nr, struct pci_sys_data *);
  61. extern void via82c505_init(void *sysdata);
  62. extern int pci_v3_setup(int nr, struct pci_sys_data *);
  63. extern struct pci_bus *pci_v3_scan_bus(int nr, struct pci_sys_data *);
  64. extern void pci_v3_preinit(void);
  65. extern void pci_v3_postinit(void);