blob: 118ac937d93366a260be320a84b65200de259f50 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
wdenk591dda52002-11-18 00:14:45 +00002/*
3 * (C) Copyright 2002
Albert ARIBAUD60fbc8d2011-08-04 18:45:45 +02004 * Daniel Engström, Omicron Ceti AB, daniel@omicron.se
wdenk591dda52002-11-18 00:14:45 +00005 */
6
7#ifndef _PCI_I386_H_
Gabe Black67bb7b02012-10-10 13:12:57 +00008#define _PCI_I386_H_
wdenk591dda52002-11-18 00:14:45 +00009
Simon Glass4e037812015-03-05 12:25:31 -070010#include <pci.h>
11
Bin Meng39620f62015-02-02 22:35:25 +080012/* 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 Glass4e037812015-03-05 12:25:31 -070020int pci_x86_read_config(struct udevice *bus, pci_dev_t bdf, uint offset,
21 ulong *valuep, enum pci_size_t size);
22
23int pci_x86_write_config(struct udevice *bus, pci_dev_t bdf, uint offset,
24 ulong value, enum pci_size_t size);
25
Bin Meng363849b2015-04-24 18:10:03 +080026/**
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 Meng363849b2015-04-24 18:10:03 +080034 * @irq: An array of IRQ numbers that are assigned to INTA through
35 * INTD of this PCI device.
36 */
Bin Mengda5d4632015-07-15 16:23:40 +080037void pci_assign_irqs(int bus, int device, u8 irq[4]);
Bin Meng363849b2015-04-24 18:10:03 +080038
Bin Meng39620f62015-02-02 22:35:25 +080039#endif /* __ASSEMBLY__ */
40
41#endif /* _PCI_I386_H_ */