pci.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * (C) Copyright 2002
  3. * Daniel Engström, Omicron Ceti AB, daniel@omicron.se
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #ifndef _PCI_I386_H_
  8. #define _PCI_I386_H_
  9. #include <pci.h>
  10. /* bus mapping constants (used for PCI core initialization) */
  11. #define PCI_REG_ADDR 0xcf8
  12. #define PCI_REG_DATA 0xcfc
  13. #define PCI_CFG_EN 0x80000000
  14. #ifndef __ASSEMBLY__
  15. #define DEFINE_PCI_DEVICE_TABLE(_table) \
  16. const struct pci_device_id _table[]
  17. struct pci_controller;
  18. void pci_setup_type1(struct pci_controller *hose);
  19. int pci_x86_read_config(struct udevice *bus, pci_dev_t bdf, uint offset,
  20. ulong *valuep, enum pci_size_t size);
  21. int pci_x86_write_config(struct udevice *bus, pci_dev_t bdf, uint offset,
  22. ulong value, enum pci_size_t size);
  23. /**
  24. * Assign IRQ number to a PCI device
  25. *
  26. * This function assigns IRQ for a PCI device. If the device does not exist
  27. * or does not require interrupts then this function has no effect.
  28. *
  29. * @bus: PCI bus number
  30. * @device: PCI device number
  31. * @irq: An array of IRQ numbers that are assigned to INTA through
  32. * INTD of this PCI device.
  33. */
  34. void pci_assign_irqs(int bus, int device, u8 irq[4]);
  35. #endif /* __ASSEMBLY__ */
  36. #endif /* _PCI_I386_H_ */