fsp_api.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* SPDX-License-Identifier: Intel */
  2. /*
  3. * Copyright (C) 2013, Intel Corporation
  4. * Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
  5. */
  6. #ifndef __FSP_API_H__
  7. #define __FSP_API_H__
  8. #include <linux/linkage.h>
  9. /*
  10. * FSP common configuration structure.
  11. * This needs to be included in the platform-specific struct fsp_config_data.
  12. */
  13. struct fsp_cfg_common {
  14. struct fsp_header *fsp_hdr;
  15. u32 stack_top;
  16. u32 boot_mode;
  17. };
  18. /*
  19. * FspInit continuation function prototype.
  20. * Control will be returned to this callback function after FspInit API call.
  21. */
  22. typedef void (*fsp_continuation_f)(u32 status, void *hob_list);
  23. struct fsp_init_params {
  24. /* Non-volatile storage buffer pointer */
  25. void *nvs_buf;
  26. /* Runtime buffer pointer */
  27. void *rt_buf;
  28. /* Continuation function address */
  29. fsp_continuation_f continuation;
  30. };
  31. struct common_buf {
  32. /*
  33. * Stack top pointer used by the bootloader. The new stack frame will be
  34. * set up at this location after FspInit API call.
  35. */
  36. u32 stack_top;
  37. u32 boot_mode; /* Current system boot mode */
  38. void *upd_data; /* User platform configuraiton data region */
  39. u32 tolum_size; /* Top of low usable memory size (FSP 1.1) */
  40. u32 reserved[6]; /* Reserved */
  41. };
  42. enum fsp_phase {
  43. /* Notification code for post PCI enuermation */
  44. INIT_PHASE_PCI = 0x20,
  45. /* Notification code before transfering control to the payload */
  46. INIT_PHASE_BOOT = 0x40
  47. };
  48. struct fsp_notify_params {
  49. /* Notification phase used for NotifyPhase API */
  50. enum fsp_phase phase;
  51. };
  52. /* FspInit API function prototype */
  53. typedef asmlinkage u32 (*fsp_init_f)(struct fsp_init_params *params);
  54. /* FspNotify API function prototype */
  55. typedef asmlinkage u32 (*fsp_notify_f)(struct fsp_notify_params *params);
  56. #endif