fsp_common.c 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 fsp_init_phase_pci(void)
  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)
  25. debug("fail, error code %x\n", status);
  26. else
  27. debug("OK\n");
  28. return status ? -EPERM : 0;
  29. }
  30. int board_pci_post_scan(struct pci_controller *hose)
  31. {
  32. return fsp_init_phase_pci();
  33. }
  34. void board_final_cleanup(void)
  35. {
  36. u32 status;
  37. /* call into FspNotify */
  38. debug("Calling into FSP (notify phase INIT_PHASE_BOOT): ");
  39. status = fsp_notify(NULL, INIT_PHASE_BOOT);
  40. if (status)
  41. debug("fail, error code %x\n", status);
  42. else
  43. debug("OK\n");
  44. return;
  45. }
  46. int x86_fsp_init(void)
  47. {
  48. if (!gd->arch.hob_list)
  49. fsp_init(CONFIG_FSP_TEMP_RAM_ADDR, BOOT_FULL_CONFIG, NULL);
  50. return 0;
  51. }