SecFsp.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /** @file
  2. Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.<BR>
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. **/
  5. #ifndef _SEC_FSP_H_
  6. #define _SEC_FSPE_H_
  7. #include <PiPei.h>
  8. #include <FspApi.h>
  9. #include <Library/PcdLib.h>
  10. #include <Library/BaseLib.h>
  11. #include <Library/DebugLib.h>
  12. #include <Library/SerialPortLib.h>
  13. #include <Library/BaseMemoryLib.h>
  14. #include <Library/FspCommonLib.h>
  15. #include <Library/FspSecPlatformLib.h>
  16. #define FSP_MCUD_SIGNATURE SIGNATURE_32 ('M', 'C', 'U', 'D')
  17. #define FSP_PER0_SIGNATURE SIGNATURE_32 ('P', 'E', 'R', '0')
  18. /**
  19. Calculate the FSP IDT gate descriptor.
  20. @param[in] IdtEntryTemplate IDT gate descriptor template.
  21. @return FSP specific IDT gate descriptor.
  22. **/
  23. UINT64
  24. FspGetExceptionHandler(
  25. IN UINT64 IdtEntryTemplate
  26. );
  27. /**
  28. Initialize the FSP global data region.
  29. It needs to be done as soon as possible after the stack is setup.
  30. @param[in,out] PeiFspData Pointer of the FSP global data.
  31. @param[in] BootLoaderStack BootLoader stack.
  32. @param[in] ApiIdx The index of the FSP API.
  33. **/
  34. VOID
  35. FspGlobalDataInit (
  36. IN OUT FSP_GLOBAL_DATA *PeiFspData,
  37. IN UINT32 BootLoaderStack,
  38. IN UINT8 ApiIdx
  39. );
  40. /**
  41. Adjust the FSP data pointers after the stack is migrated to memory.
  42. @param[in] OffsetGap The offset gap between the old stack and the new stack.
  43. **/
  44. VOID
  45. FspDataPointerFixUp (
  46. IN UINT32 OffsetGap
  47. );
  48. /**
  49. This interface returns the base address of FSP binary.
  50. @return FSP binary base address.
  51. **/
  52. UINT32
  53. EFIAPI
  54. AsmGetFspBaseAddress (
  55. VOID
  56. );
  57. /**
  58. This interface gets FspInfoHeader pointer
  59. @return FSP binary base address.
  60. **/
  61. UINT32
  62. EFIAPI
  63. AsmGetFspInfoHeader (
  64. VOID
  65. );
  66. /**
  67. This function gets the FSP UPD region offset in flash.
  68. @return the offset of the UPD region.
  69. **/
  70. UINT32
  71. EFIAPI
  72. GetFspUpdRegionOffset (
  73. VOID
  74. );
  75. #endif