Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
wdenk | 591dda5 | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2002 |
Albert ARIBAUD | 60fbc8d | 2011-08-04 18:45:45 +0200 | [diff] [blame] | 4 | * Daniel Engström, Omicron Ceti AB, daniel@omicron.se |
wdenk | 591dda5 | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #ifndef _PCI_I386_H_ |
Gabe Black | 67bb7b0 | 2012-10-10 13:12:57 +0000 | [diff] [blame] | 8 | #define _PCI_I386_H_ |
wdenk | 591dda5 | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 9 | |
Simon Glass | 4e03781 | 2015-03-05 12:25:31 -0700 | [diff] [blame] | 10 | #include <pci.h> |
| 11 | |
Bin Meng | 39620f6 | 2015-02-02 22:35:25 +0800 | [diff] [blame] | 12 | /* bus mapping constants (used for PCI core initialization) */ |
| 13 | #define PCI_REG_ADDR 0xcf8 |
| 14 | #define PCI_REG_DATA 0xcfc |
| 15 | |
| 16 | #define PCI_CFG_EN 0x80000000 |
| 17 | |
| 18 | #ifndef __ASSEMBLY__ |
| 19 | |
Simon Glass | 4e03781 | 2015-03-05 12:25:31 -0700 | [diff] [blame] | 20 | int pci_x86_read_config(struct udevice *bus, pci_dev_t bdf, uint offset, |
| 21 | ulong *valuep, enum pci_size_t size); |
| 22 | |
| 23 | int pci_x86_write_config(struct udevice *bus, pci_dev_t bdf, uint offset, |
| 24 | ulong value, enum pci_size_t size); |
| 25 | |
Bin Meng | 363849b | 2015-04-24 18:10:03 +0800 | [diff] [blame] | 26 | /** |
| 27 | * Assign IRQ number to a PCI device |
| 28 | * |
| 29 | * This function assigns IRQ for a PCI device. If the device does not exist |
| 30 | * or does not require interrupts then this function has no effect. |
| 31 | * |
| 32 | * @bus: PCI bus number |
| 33 | * @device: PCI device number |
Bin Meng | 363849b | 2015-04-24 18:10:03 +0800 | [diff] [blame] | 34 | * @irq: An array of IRQ numbers that are assigned to INTA through |
| 35 | * INTD of this PCI device. |
| 36 | */ |
Bin Meng | da5d463 | 2015-07-15 16:23:40 +0800 | [diff] [blame] | 37 | void pci_assign_irqs(int bus, int device, u8 irq[4]); |
Bin Meng | 363849b | 2015-04-24 18:10:03 +0800 | [diff] [blame] | 38 | |
Bin Meng | 39620f6 | 2015-02-02 22:35:25 +0800 | [diff] [blame] | 39 | #endif /* __ASSEMBLY__ */ |
| 40 | |
| 41 | #endif /* _PCI_I386_H_ */ |