3 * Daniel Engström, Omicron Ceti AB, daniel@omicron.se
5 * SPDX-License-Identifier: GPL-2.0+
13 /* bus mapping constants (used for PCI core initialization) */
14 #define PCI_REG_ADDR 0xcf8
15 #define PCI_REG_DATA 0xcfc
17 #define PCI_CFG_EN 0x80000000
21 #define DEFINE_PCI_DEVICE_TABLE(_table) \
22 const struct pci_device_id _table[]
24 struct pci_controller;
26 void pci_setup_type1(struct pci_controller *hose);
29 * board_pci_setup_hose() - Set up the PCI hose
31 * This is called by the common x86 PCI code to set up the PCI controller
32 * hose. It may be called when no memory/BSS is available so should just
33 * store things in 'hose' and not in BSS variables.
35 void board_pci_setup_hose(struct pci_controller *hose);
38 * pci_early_init_hose() - Set up PCI host before relocation
40 * This allocates memory for, sets up and returns the PCI hose. It can be
41 * called before relocation. The hose will be stored in gd->hose for
42 * later use, but will become invalid one DRAM is available.
44 int pci_early_init_hose(struct pci_controller **hosep);
46 int board_pci_pre_scan(struct pci_controller *hose);
47 int board_pci_post_scan(struct pci_controller *hose);
50 * Simple PCI access routines - these work from either the early PCI hose
51 * or the 'real' one, created after U-Boot has memory available
53 unsigned int x86_pci_read_config8(pci_dev_t dev, unsigned where);
54 unsigned int x86_pci_read_config16(pci_dev_t dev, unsigned where);
55 unsigned int x86_pci_read_config32(pci_dev_t dev, unsigned where);
57 void x86_pci_write_config8(pci_dev_t dev, unsigned where, unsigned value);
58 void x86_pci_write_config16(pci_dev_t dev, unsigned where, unsigned value);
59 void x86_pci_write_config32(pci_dev_t dev, unsigned where, unsigned value);
61 int pci_x86_read_config(struct udevice *bus, pci_dev_t bdf, uint offset,
62 ulong *valuep, enum pci_size_t size);
64 int pci_x86_write_config(struct udevice *bus, pci_dev_t bdf, uint offset,
65 ulong value, enum pci_size_t size);
68 * Assign IRQ number to a PCI device
70 * This function assigns IRQ for a PCI device. If the device does not exist
71 * or does not require interrupts then this function has no effect.
73 * @bus: PCI bus number
74 * @device: PCI device number
75 * @irq: An array of IRQ numbers that are assigned to INTA through
76 * INTD of this PCI device.
78 void pci_assign_irqs(int bus, int device, u8 irq[4]);
80 #endif /* __ASSEMBLY__ */
82 #endif /* _PCI_I386_H_ */