xref: /openbmc/u-boot/arch/x86/include/asm/pci.h (revision 3857ed01)
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 
8 #ifndef _PCI_I386_H_
9 #define _PCI_I386_H_
10 
11 #include <pci.h>
12 
13 /* bus mapping constants (used for PCI core initialization) */
14 #define PCI_REG_ADDR	0xcf8
15 #define PCI_REG_DATA	0xcfc
16 
17 #define PCI_CFG_EN	0x80000000
18 
19 #ifndef __ASSEMBLY__
20 
21 #define DEFINE_PCI_DEVICE_TABLE(_table) \
22 	const struct pci_device_id _table[]
23 
24 struct pci_controller;
25 
26 void pci_setup_type1(struct pci_controller *hose);
27 
28 int pci_x86_read_config(struct udevice *bus, pci_dev_t bdf, uint offset,
29 			ulong *valuep, enum pci_size_t size);
30 
31 int pci_x86_write_config(struct udevice *bus, pci_dev_t bdf, uint offset,
32 			 ulong value, enum pci_size_t size);
33 
34 /**
35  * Assign IRQ number to a PCI device
36  *
37  * This function assigns IRQ for a PCI device. If the device does not exist
38  * or does not require interrupts then this function has no effect.
39  *
40  * @bus:	PCI bus number
41  * @device:	PCI device number
42  * @irq:	An array of IRQ numbers that are assigned to INTA through
43  *		INTD of this PCI device.
44  */
45 void pci_assign_irqs(int bus, int device, u8 irq[4]);
46 
47 #endif /* __ASSEMBLY__ */
48 
49 #endif /* _PCI_I386_H_ */
50