pci-bridge.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * include/asm-xtensa/pci-bridge.h
  3. *
  4. * This file is subject to the terms and conditions of the GNU General
  5. * Public License. See the file "COPYING" in the main directory of
  6. * this archive for more details.
  7. *
  8. * Copyright (C) 2005 Tensilica Inc.
  9. */
  10. #ifndef _XTENSA_PCI_BRIDGE_H
  11. #define _XTENSA_PCI_BRIDGE_H
  12. struct device_node;
  13. struct pci_controller;
  14. /*
  15. * pciauto_bus_scan() enumerates the pci space.
  16. */
  17. extern int pciauto_bus_scan(struct pci_controller *, int);
  18. struct pci_space {
  19. unsigned long start;
  20. unsigned long end;
  21. unsigned long base;
  22. };
  23. /*
  24. * Structure of a PCI controller (host bridge)
  25. */
  26. struct pci_controller {
  27. int index; /* used for pci_controller_num */
  28. struct pci_controller *next;
  29. struct pci_bus *bus;
  30. void *arch_data;
  31. int first_busno;
  32. int last_busno;
  33. struct pci_ops *ops;
  34. volatile unsigned int *cfg_addr;
  35. volatile unsigned char *cfg_data;
  36. /* Currently, we limit ourselves to 1 IO range and 3 mem
  37. * ranges since the common pci_bus structure can't handle more
  38. */
  39. struct resource io_resource;
  40. struct resource mem_resources[3];
  41. int mem_resource_count;
  42. /* Host bridge I/O and Memory space
  43. * Used for BAR placement algorithms
  44. */
  45. struct pci_space io_space;
  46. struct pci_space mem_space;
  47. /* Return the interrupt number fo a device. */
  48. int (*map_irq)(struct pci_dev*, u8, u8);
  49. };
  50. static inline void pcibios_init_resource(struct resource *res,
  51. unsigned long start, unsigned long end, int flags, char *name)
  52. {
  53. res->start = start;
  54. res->end = end;
  55. res->flags = flags;
  56. res->name = name;
  57. res->parent = NULL;
  58. res->sibling = NULL;
  59. res->child = NULL;
  60. }
  61. #endif /* _XTENSA_PCI_BRIDGE_H */