pci.h 1.0 KB

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