blob: f93c840244a11da7eace75411b4b2a2f116cd7c2 [file] [log] [blame]
wdenk591dda52002-11-18 00:14:45 +00001/*
2 * (C) Copyright 2002
Albert ARIBAUD60fbc8d2011-08-04 18:45:45 +02003 * Daniel Engström, Omicron Ceti AB, daniel@omicron.se
wdenk591dda52002-11-18 00:14:45 +00004 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
wdenk591dda52002-11-18 00:14:45 +00006 */
7
8#ifndef _PCI_I386_H_
Gabe Black67bb7b02012-10-10 13:12:57 +00009#define _PCI_I386_H_
wdenk591dda52002-11-18 00:14:45 +000010
Simon Glass4e037812015-03-05 12:25:31 -070011#include <pci.h>
12
Bin Meng39620f62015-02-02 22:35:25 +080013/* 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
Simon Glass4e037812015-03-05 12:25:31 -070021int pci_x86_read_config(struct udevice *bus, pci_dev_t bdf, uint offset,
22 ulong *valuep, enum pci_size_t size);
23
24int pci_x86_write_config(struct udevice *bus, pci_dev_t bdf, uint offset,
25 ulong value, enum pci_size_t size);
26
Bin Meng363849b2015-04-24 18:10:03 +080027/**
28 * Assign IRQ number to a PCI device
29 *
30 * This function assigns IRQ for a PCI device. If the device does not exist
31 * or does not require interrupts then this function has no effect.
32 *
33 * @bus: PCI bus number
34 * @device: PCI device number
Bin Meng363849b2015-04-24 18:10:03 +080035 * @irq: An array of IRQ numbers that are assigned to INTA through
36 * INTD of this PCI device.
37 */
Bin Mengda5d4632015-07-15 16:23:40 +080038void pci_assign_irqs(int bus, int device, u8 irq[4]);
Bin Meng363849b2015-04-24 18:10:03 +080039
Bin Meng39620f62015-02-02 22:35:25 +080040#endif /* __ASSEMBLY__ */
41
42#endif /* _PCI_I386_H_ */