pci.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * (C) Copyright 2002
  3. * Daniel Engström, Omicron Ceti AB, daniel@omicron.se
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. #ifndef _PCI_I386_H_
  8. #define _PCI_I386_H_
  9. #define DEFINE_PCI_DEVICE_TABLE(_table) \
  10. const struct pci_device_id _table[]
  11. struct pci_controller;
  12. void pci_setup_type1(struct pci_controller *hose);
  13. /**
  14. * board_pci_setup_hose() - Set up the PCI hose
  15. *
  16. * This is called by the common x86 PCI code to set up the PCI controller
  17. * hose. It may be called when no memory/BSS is available so should just
  18. * store things in 'hose' and not in BSS variables.
  19. */
  20. void board_pci_setup_hose(struct pci_controller *hose);
  21. /**
  22. * pci_early_init_hose() - Set up PCI host before relocation
  23. *
  24. * This allocates memory for, sets up and returns the PCI hose. It can be
  25. * called before relocation. The hose will be stored in gd->hose for
  26. * later use, but will become invalid one DRAM is available.
  27. */
  28. int pci_early_init_hose(struct pci_controller **hosep);
  29. int board_pci_pre_scan(struct pci_controller *hose);
  30. int board_pci_post_scan(struct pci_controller *hose);
  31. /*
  32. * Simple PCI access routines - these work from either the early PCI hose
  33. * or the 'real' one, created after U-Boot has memory available
  34. */
  35. unsigned int pci_read_config8(pci_dev_t dev, unsigned where);
  36. unsigned int pci_read_config16(pci_dev_t dev, unsigned where);
  37. unsigned int pci_read_config32(pci_dev_t dev, unsigned where);
  38. void pci_write_config8(pci_dev_t dev, unsigned where, unsigned value);
  39. void pci_write_config16(pci_dev_t dev, unsigned where, unsigned value);
  40. void pci_write_config32(pci_dev_t dev, unsigned where, unsigned value);
  41. #endif