pci.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. int pci_x86_read_config(struct udevice *bus, pci_dev_t bdf, uint offset,
  16. ulong *valuep, enum pci_size_t size);
  17. int pci_x86_write_config(struct udevice *bus, pci_dev_t bdf, uint offset,
  18. ulong value, enum pci_size_t size);
  19. /**
  20. * Assign IRQ number to a PCI device
  21. *
  22. * This function assigns IRQ for a PCI device. If the device does not exist
  23. * or does not require interrupts then this function has no effect.
  24. *
  25. * @bus: PCI bus number
  26. * @device: PCI device number
  27. * @irq: An array of IRQ numbers that are assigned to INTA through
  28. * INTD of this PCI device.
  29. */
  30. void pci_assign_irqs(int bus, int device, u8 irq[4]);
  31. #endif /* __ASSEMBLY__ */
  32. #endif /* _PCI_I386_H_ */