fsp_api.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright (C) 2013, Intel Corporation
  3. * Copyright (C) 2014, Bin Meng <bmeng.cn@gmail.com>
  4. *
  5. * SPDX-License-Identifier: Intel
  6. */
  7. #ifndef __FSP_API_H__
  8. #define __FSP_API_H__
  9. #include <linux/linkage.h>
  10. /*
  11. * FSP common configuration structure.
  12. * This needs to be included in the platform-specific struct fsp_config_data.
  13. */
  14. struct fsp_cfg_common {
  15. struct fsp_header *fsp_hdr;
  16. u32 stack_top;
  17. u32 boot_mode;
  18. };
  19. /*
  20. * FspInit continuation function prototype.
  21. * Control will be returned to this callback function after FspInit API call.
  22. */
  23. typedef void (*fsp_continuation_f)(u32 status, void *hob_list);
  24. struct fsp_init_params {
  25. /* Non-volatile storage buffer pointer */
  26. void *nvs_buf;
  27. /* Runtime buffer pointer */
  28. void *rt_buf;
  29. /* Continuation function address */
  30. fsp_continuation_f continuation;
  31. };
  32. struct common_buf {
  33. /*
  34. * Stack top pointer used by the bootloader. The new stack frame will be
  35. * set up at this location after FspInit API call.
  36. */
  37. u32 stack_top;
  38. u32 boot_mode; /* Current system boot mode */
  39. void *upd_data; /* User platform configuraiton data region */
  40. u32 reserved[7]; /* 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