fsp_common.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 <errno.h>
  8. #include <asm/io.h>
  9. #include <asm/post.h>
  10. #include <asm/processor.h>
  11. #include <asm/fsp/fsp_support.h>
  12. DECLARE_GLOBAL_DATA_PTR;
  13. int print_cpuinfo(void)
  14. {
  15. post_code(POST_CPU_INFO);
  16. return default_print_cpuinfo();
  17. }
  18. int board_pci_post_scan(struct pci_controller *hose)
  19. {
  20. u32 status;
  21. /* call into FspNotify */
  22. debug("Calling into FSP (notify phase INIT_PHASE_PCI): ");
  23. status = fsp_notify(NULL, INIT_PHASE_PCI);
  24. if (status != FSP_SUCCESS)
  25. debug("fail, error code %x\n", status);
  26. else
  27. debug("OK\n");
  28. return 0;
  29. }
  30. void board_final_cleanup(void)
  31. {
  32. u32 status;
  33. /* call into FspNotify */
  34. debug("Calling into FSP (notify phase INIT_PHASE_BOOT): ");
  35. status = fsp_notify(NULL, INIT_PHASE_BOOT);
  36. if (status != FSP_SUCCESS)
  37. debug("fail, error code %x\n", status);
  38. else
  39. debug("OK\n");
  40. return;
  41. }
  42. int x86_fsp_init(void)
  43. {
  44. if (!gd->arch.hob_list)
  45. fsp_init(CONFIG_FSP_TEMP_RAM_ADDR, BOOT_FULL_CONFIG, NULL);
  46. return 0;
  47. }