1fea25720SGraeme Russ 2fea25720SGraeme Russ /* 3fea25720SGraeme Russ * (C) Copyright 2002 4fa82f871SAlbert ARIBAUD * Daniel Engström, Omicron Ceti AB, daniel@omicron.se 5fea25720SGraeme Russ * 61a459660SWolfgang Denk * SPDX-License-Identifier: GPL-2.0+ 7fea25720SGraeme Russ */ 8fea25720SGraeme Russ 9fea25720SGraeme Russ #ifndef _PCI_I386_H_ 10452f50f7SGabe Black #define _PCI_I386_H_ 11fea25720SGraeme Russ 1283088afbSGraeme Russ #define DEFINE_PCI_DEVICE_TABLE(_table) \ 1383088afbSGraeme Russ const struct pci_device_id _table[] 1483088afbSGraeme Russ 15d188b18fSSimon Glass struct pci_controller; 16d188b18fSSimon Glass 171cfcf037SGraeme Russ void pci_setup_type1(struct pci_controller *hose); 18d188b18fSSimon Glass 19d188b18fSSimon Glass /** 20d188b18fSSimon Glass * board_pci_setup_hose() - Set up the PCI hose 21d188b18fSSimon Glass * 22d188b18fSSimon Glass * This is called by the common x86 PCI code to set up the PCI controller 23d188b18fSSimon Glass * hose. It may be called when no memory/BSS is available so should just 24d188b18fSSimon Glass * store things in 'hose' and not in BSS variables. 25d188b18fSSimon Glass */ 26d188b18fSSimon Glass void board_pci_setup_hose(struct pci_controller *hose); 277430f108SSimon Glass 287430f108SSimon Glass /** 297430f108SSimon Glass * pci_early_init_hose() - Set up PCI host before relocation 307430f108SSimon Glass * 317430f108SSimon Glass * This allocates memory for, sets up and returns the PCI hose. It can be 327430f108SSimon Glass * called before relocation. The hose will be stored in gd->arch.hose for 337430f108SSimon Glass * later use, but will become invalid one DRAM is available. 347430f108SSimon Glass */ 357430f108SSimon Glass int pci_early_init_hose(struct pci_controller **hosep); 36*6fb3b72eSSimon Glass 37*6fb3b72eSSimon Glass /* 38*6fb3b72eSSimon Glass * Simple PCI access routines - these work from either the early PCI hose 39*6fb3b72eSSimon Glass * or the 'real' one, created after U-Boot has memory available 40*6fb3b72eSSimon Glass */ 41*6fb3b72eSSimon Glass unsigned int pci_read_config8(pci_dev_t dev, unsigned where); 42*6fb3b72eSSimon Glass unsigned int pci_read_config16(pci_dev_t dev, unsigned where); 43*6fb3b72eSSimon Glass unsigned int pci_read_config32(pci_dev_t dev, unsigned where); 44*6fb3b72eSSimon Glass 45*6fb3b72eSSimon Glass void pci_write_config8(pci_dev_t dev, unsigned where, unsigned value); 46*6fb3b72eSSimon Glass void pci_write_config16(pci_dev_t dev, unsigned where, unsigned value); 47*6fb3b72eSSimon Glass void pci_write_config32(pci_dev_t dev, unsigned where, unsigned value); 48*6fb3b72eSSimon Glass 49fea25720SGraeme Russ #endif 50