Platform.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. /*++
  2. Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. **/
  5. #ifndef __PEI_PLATFORM_H__
  6. #define __PEI_PLATFORM_H__
  7. #define PEI_STALL_RESOLUTION 1
  8. #define STALL_PEIM_SIGNATURE SIGNATURE_32('p','p','u','s')
  9. typedef struct {
  10. UINT32 Signature;
  11. EFI_FFS_FILE_HEADER *FfsHeader;
  12. EFI_PEI_NOTIFY_DESCRIPTOR StallNotify;
  13. } STALL_CALLBACK_STATE_INFORMATION;
  14. #define STALL_PEIM_FROM_THIS(a) CR (a, STALL_CALLBACK_STATE_INFORMATION, StallNotify, STALL_PEIM_SIGNATURE)
  15. /**
  16. This function reset the entire platform, including all processor and devices, and
  17. reboots the system.
  18. Declaration of this function goes to MdeModulePkg/Include/Library/ResetSystemLib.h
  19. @param PeiServices General purpose services available to every PEIM.
  20. @retval EFI_SUCCESS if it completed successfully.
  21. **/
  22. // EFI_STATUS
  23. // EFIAPI
  24. // ResetSystem (
  25. // IN CONST EFI_PEI_SERVICES **PeiServices
  26. // );
  27. /**
  28. This function will be called when MRC is done.
  29. @param PeiServices General purpose services available to every PEIM.
  30. @param NotifyDescriptor Information about the notify event..
  31. @param Ppi The notify context.
  32. @retval EFI_SUCCESS If the function completed successfully.
  33. **/
  34. EFI_STATUS
  35. EFIAPI
  36. MemoryDiscoveredPpiNotifyCallback (
  37. IN EFI_PEI_SERVICES **PeiServices,
  38. IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
  39. IN VOID *Ppi
  40. );
  41. /**
  42. This is the callback function notified by FvFileLoader PPI, it depends on FvFileLoader PPI to load
  43. the PEIM into memory.
  44. @param PeiServices General purpose services available to every PEIM.
  45. @param NotifyDescriptor The context of notification.
  46. @param Ppi The notify PPI.
  47. @retval EFI_SUCCESS if it completed successfully.
  48. **/
  49. EFI_STATUS
  50. EFIAPI
  51. FvFileLoaderPpiNotifyCallback (
  52. IN EFI_PEI_SERVICES **PeiServices,
  53. IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
  54. IN VOID *Ppi
  55. );
  56. /**
  57. This function provides a blocking stall for reset at least the given number of microseconds
  58. stipulated in the final argument.
  59. @param PeiServices General purpose services available to every PEIM.
  60. @param this Pointer to the local data for the interface.
  61. @param Microseconds number of microseconds for which to stall.
  62. @retval EFI_SUCCESS the function provided at least the required stall.
  63. **/
  64. EFI_STATUS
  65. EFIAPI
  66. Stall (
  67. IN CONST EFI_PEI_SERVICES **PeiServices,
  68. IN CONST EFI_PEI_STALL_PPI *This,
  69. IN UINTN Microseconds
  70. );
  71. /**
  72. This function initialize recovery functionality by installing the recovery PPI.
  73. @param PeiServices General purpose services available to every PEIM.
  74. @retval EFI_SUCCESS If the interface could be successfully installed.
  75. **/
  76. EFI_STATUS
  77. EFIAPI
  78. InitializeRecovery (
  79. IN EFI_PEI_SERVICES **PeiServices
  80. );
  81. /**
  82. This function
  83. 1. Calling MRC to initialize memory.
  84. 2. Install EFI Memory.
  85. 3. Capsule coalesce if capsule boot mode.
  86. 4. Create HOB of system memory.
  87. @param PeiServices Pointer to the PEI Service Table
  88. @retval EFI_SUCCESS If it completes successfully.
  89. **/
  90. EFI_STATUS
  91. MemoryInit (
  92. IN EFI_PEI_SERVICES **PeiServices
  93. );
  94. /**
  95. This function provides the implementation of AtaController PPI Enable Channel function.
  96. @param PeiServices General purpose services available to every PEIM.
  97. @param this Pointer to the local data for the interface.
  98. @param ChannelMask This parameter is used to specify primary or slavery IDE channel.
  99. @retval EFI_SUCCESS Procedure returned successfully.
  100. **/
  101. EFI_STATUS
  102. EnableAtaChannel (
  103. IN EFI_PEI_SERVICES **PeiServices,
  104. IN PEI_ATA_CONTROLLER_PPI *This,
  105. IN UINT8 ChannelMask
  106. );
  107. /**
  108. This function provides the implementation of AtaController PPI Get IDE channel Register Base Address
  109. @param PeiServices General purpose services available to every PEIM.
  110. @param this Pointer to the local data for the interface.
  111. @param IdeRegsBaseAddr Pointer to IDE_REGS_BASE_ADDR struct, which is used to record
  112. IDE Command and Control regeisters Base Address.
  113. @retval EFI_SUCCESS Procedure returned successfully.
  114. **/
  115. EFI_STATUS
  116. GetIdeRegsBaseAddr (
  117. IN EFI_PEI_SERVICES **PeiServices,
  118. IN PEI_ATA_CONTROLLER_PPI *This,
  119. IN IDE_REGS_BASE_ADDR *IdeRegsBaseAddr
  120. );
  121. /**
  122. This function provides the implementation to properly setup both LM & PDM functionality.
  123. @param PeiServices General purpose services available to every PEIM.
  124. @retval EFI_SUCCESS Procedure returned successfully.
  125. **/
  126. EFI_STATUS
  127. ConfigureLM(
  128. IN EFI_PEI_SERVICES **PeiServices
  129. );
  130. #include <Ppi/VlvMmioPolicy.h>
  131. BOOLEAN
  132. EFIAPI
  133. IsFastBootEnabled (
  134. IN CONST EFI_PEI_SERVICES **PeiServices
  135. );
  136. EFI_STATUS
  137. PrioritizeBootMode (
  138. IN OUT EFI_BOOT_MODE *CurrentBootMode,
  139. IN EFI_BOOT_MODE NewBootMode
  140. );
  141. EFI_STATUS
  142. EFIAPI
  143. CapsulePpiNotifyCallback (
  144. IN EFI_PEI_SERVICES **PeiServices,
  145. IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
  146. IN VOID *Ppi
  147. );
  148. #endif