pci.c 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. #include <pci.h>
  8. #include <asm/pci.h>
  9. #include <asm/fsp/fsp_support.h>
  10. DECLARE_GLOBAL_DATA_PTR;
  11. void board_pci_setup_hose(struct pci_controller *hose)
  12. {
  13. hose->first_busno = 0;
  14. hose->last_busno = 0;
  15. /* PCI memory space */
  16. pci_set_region(hose->regions + 0,
  17. CONFIG_PCI_MEM_BUS,
  18. CONFIG_PCI_MEM_PHYS,
  19. CONFIG_PCI_MEM_SIZE,
  20. PCI_REGION_MEM);
  21. /* PCI IO space */
  22. pci_set_region(hose->regions + 1,
  23. CONFIG_PCI_IO_BUS,
  24. CONFIG_PCI_IO_PHYS,
  25. CONFIG_PCI_IO_SIZE,
  26. PCI_REGION_IO);
  27. pci_set_region(hose->regions + 2,
  28. CONFIG_PCI_PREF_BUS,
  29. CONFIG_PCI_PREF_PHYS,
  30. CONFIG_PCI_PREF_SIZE,
  31. PCI_REGION_PREFETCH);
  32. pci_set_region(hose->regions + 3,
  33. 0,
  34. 0,
  35. gd->ram_size < 0x80000000 ? gd->ram_size : 0x80000000,
  36. PCI_REGION_MEM | PCI_REGION_SYS_MEMORY);
  37. hose->region_count = 4;
  38. }