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