FspSecPlatformLib.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /** @file
  2. Copyright (c) 2015 - 2020, Intel Corporation. All rights reserved.<BR>
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. **/
  5. #ifndef _FSP_SEC_PLATFORM_LIB_H_
  6. #define _FSP_SEC_PLATFORM_LIB_H_
  7. /**
  8. This function performs platform level initialization.
  9. This function must be in ASM file, because stack is not established yet.
  10. This function is optional. If a library instance does not provide this function, the default empty one will be used.
  11. The callee should not use XMM6/XMM7.
  12. The return address is saved in MM7.
  13. @retval in saved in EAX - 0 means platform initialization success.
  14. other means platform initialization fail.
  15. **/
  16. UINT32
  17. EFIAPI
  18. SecPlatformInit (
  19. VOID
  20. );
  21. /**
  22. This function loads Microcode.
  23. This function must be in ASM file, because stack is not established yet.
  24. This function is optional. If a library instance does not provide this function, the default one will be used.
  25. The callee should not use XMM6/XMM7.
  26. The return address is saved in MM7.
  27. @param[in] FsptUpdDataPtr Address pointer to the FSPT_UPD data structure. It is saved in ESP.
  28. @retval in saved in EAX - 0 means Microcode is loaded successfully.
  29. other means Microcode is not loaded successfully.
  30. **/
  31. UINT32
  32. EFIAPI
  33. LoadMicrocode (
  34. IN VOID *FsptUpdDataPtr
  35. );
  36. /**
  37. This function initializes the CAR.
  38. This function must be in ASM file, because stack is not established yet.
  39. The callee should not use XMM6/XMM7.
  40. The return address is saved in MM7.
  41. @param[in] FsptUpdDataPtr Address pointer to the FSPT_UPD data structure. It is saved in ESP.
  42. @retval in saved in EAX - 0 means CAR initialization success.
  43. other means CAR initialization fail.
  44. **/
  45. UINT32
  46. EFIAPI
  47. SecCarInit (
  48. IN VOID *FsptUpdDataPtr
  49. );
  50. /**
  51. This function check the signature of UPD.
  52. @param[in] ApiIdx Internal index of the FSP API.
  53. @param[in] ApiParam Parameter of the FSP API.
  54. **/
  55. EFI_STATUS
  56. EFIAPI
  57. FspUpdSignatureCheck (
  58. IN UINT32 ApiIdx,
  59. IN VOID *ApiParam
  60. );
  61. /**
  62. This function handles FspMultiPhaseSiInitApi.
  63. Starting from FSP 2.4 this function is obsolete and FspMultiPhaseSiInitApiHandlerV2 is the replacement.
  64. @param[in] ApiIdx Internal index of the FSP API.
  65. @param[in] ApiParam Parameter of the FSP API.
  66. **/
  67. EFI_STATUS
  68. EFIAPI
  69. FspMultiPhaseSiInitApiHandler (
  70. IN UINT32 ApiIdx,
  71. IN VOID *ApiParam
  72. );
  73. /**
  74. FSP MultiPhase Platform Get Number Of Phases Function.
  75. Allows an FSP binary to dynamically update the number of phases at runtime.
  76. For example, UPD settings could negate the need to enter the multi-phase flow
  77. in certain scenarios. If this function returns FALSE, the default number of phases
  78. provided by PcdMultiPhaseNumberOfPhases will be returned to the bootloader instead.
  79. @param[in] ApiIdx - Internal index of the FSP API.
  80. @param[in] NumberOfPhasesSupported - How many phases are supported by current FSP Component.
  81. @retval TRUE - NumberOfPhases are modified by Platform during runtime.
  82. @retval FALSE - The Default build time NumberOfPhases should be used.
  83. **/
  84. BOOLEAN
  85. EFIAPI
  86. FspMultiPhasePlatformGetNumberOfPhases (
  87. IN UINTN ApiIdx,
  88. IN OUT UINT32 *NumberOfPhasesSupported
  89. );
  90. #endif