blob: c30dd4c218a43d2968b3210d8c828c3bb6cc0c57 [file] [log] [blame]
wdenk591dda52002-11-18 00:14:45 +00001
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 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
wdenk591dda52002-11-18 00:14:45 +00007 */
8
9#ifndef _PCI_I386_H_
Gabe Black67bb7b02012-10-10 13:12:57 +000010#define _PCI_I386_H_
wdenk591dda52002-11-18 00:14:45 +000011
Graeme Russ883c6032011-11-08 02:33:15 +000012#define DEFINE_PCI_DEVICE_TABLE(_table) \
13 const struct pci_device_id _table[]
14
Simon Glass76805502014-11-12 22:42:11 -070015struct pci_controller;
16
Graeme Russ703ede52011-11-08 02:33:22 +000017void pci_setup_type1(struct pci_controller *hose);
Simon Glass76805502014-11-12 22:42:11 -070018
19/**
20 * board_pci_setup_hose() - Set up the PCI hose
21 *
22 * This is called by the common x86 PCI code to set up the PCI controller
23 * hose. It may be called when no memory/BSS is available so should just
24 * store things in 'hose' and not in BSS variables.
25 */
26void board_pci_setup_hose(struct pci_controller *hose);
Simon Glassa54d9812014-11-12 22:42:12 -070027
28/**
29 * pci_early_init_hose() - Set up PCI host before relocation
30 *
31 * This allocates memory for, sets up and returns the PCI hose. It can be
Bin Mengf1b81fc2014-12-30 22:53:21 +080032 * called before relocation. The hose will be stored in gd->hose for
Simon Glassa54d9812014-11-12 22:42:12 -070033 * later use, but will become invalid one DRAM is available.
34 */
35int pci_early_init_hose(struct pci_controller **hosep);
Simon Glassa205b1d2014-11-12 22:42:14 -070036
Simon Glass75a042b2014-11-14 18:18:28 -070037int board_pci_pre_scan(struct pci_controller *hose);
38int board_pci_post_scan(struct pci_controller *hose);
39
Simon Glassa205b1d2014-11-12 22:42:14 -070040/*
41 * Simple PCI access routines - these work from either the early PCI hose
42 * or the 'real' one, created after U-Boot has memory available
43 */
44unsigned int pci_read_config8(pci_dev_t dev, unsigned where);
45unsigned int pci_read_config16(pci_dev_t dev, unsigned where);
46unsigned int pci_read_config32(pci_dev_t dev, unsigned where);
47
48void pci_write_config8(pci_dev_t dev, unsigned where, unsigned value);
49void pci_write_config16(pci_dev_t dev, unsigned where, unsigned value);
50void pci_write_config32(pci_dev_t dev, unsigned where, unsigned value);
51
wdenk591dda52002-11-18 00:14:45 +000052#endif