ArmPlatformLib.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /** @file
  2. *
  3. * Copyright (c) 2011-2013, ARM Limited. All rights reserved.
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause-Patent
  6. *
  7. **/
  8. #ifndef _ARMPLATFORMLIB_H_
  9. #define _ARMPLATFORMLIB_H_
  10. //
  11. // The package level header files this module uses
  12. //
  13. #include <PiPei.h>
  14. //
  15. // The protocols, PPI and GUID defintions for this module
  16. //
  17. #include <Ppi/MasterBootMode.h>
  18. #include <Ppi/BootInRecoveryMode.h>
  19. #include <Library/ArmLib.h>
  20. /**
  21. Return the core position from the value of its MpId register
  22. This function returns the core position from the position 0 in the processor.
  23. This function might be called from assembler before any stack is set.
  24. @return Return the core position
  25. **/
  26. UINTN
  27. ArmPlatformGetCorePosition (
  28. IN UINTN MpId
  29. );
  30. /**
  31. Return a non-zero value if the callee is the primary core
  32. This function returns a non-zero value if the callee is the primary core.
  33. The primary core is the core responsible to initialize the hardware and run UEFI.
  34. This function might be called from assembler before any stack is set.
  35. @return Return a non-zero value if the callee is the primary core.
  36. **/
  37. UINTN
  38. ArmPlatformIsPrimaryCore (
  39. IN UINTN MpId
  40. );
  41. /**
  42. Return the MpId of the primary core
  43. This function returns the MpId of the primary core.
  44. This function might be called from assembler before any stack is set.
  45. @return Return the MpId of the primary core
  46. **/
  47. UINTN
  48. ArmPlatformGetPrimaryCoreMpId (
  49. VOID
  50. );
  51. /**
  52. Return the current Boot Mode
  53. This function returns the boot reason on the platform
  54. @return Return the current Boot Mode of the platform
  55. **/
  56. EFI_BOOT_MODE
  57. ArmPlatformGetBootMode (
  58. VOID
  59. );
  60. /**
  61. First platform specific function to be called in the PEI phase
  62. This function is actually the first function called by the PrePi
  63. or PrePeiCore modules. It allows to retrieve arguments passed to
  64. the UEFI firmware through the CPU registers.
  65. This function might be written into assembler as no stack are set
  66. when the function is invoked.
  67. **/
  68. VOID
  69. ArmPlatformPeiBootAction (
  70. VOID
  71. );
  72. /**
  73. Initialize controllers that must setup in the normal world
  74. This function is called by the ArmPlatformPkg/PrePi or ArmPlatformPkg/PlatformPei
  75. in the PEI phase.
  76. **/
  77. RETURN_STATUS
  78. ArmPlatformInitialize (
  79. IN UINTN MpId
  80. );
  81. /**
  82. Return the Virtual Memory Map of your platform
  83. This Virtual Memory Map is used by MemoryInitPei Module to initialize the MMU on your platform.
  84. @param[out] VirtualMemoryMap Array of ARM_MEMORY_REGION_DESCRIPTOR describing a Physical-to-
  85. Virtual Memory mapping. This array must be ended by a zero-filled
  86. entry
  87. **/
  88. VOID
  89. ArmPlatformGetVirtualMemoryMap (
  90. OUT ARM_MEMORY_REGION_DESCRIPTOR** VirtualMemoryMap
  91. );
  92. /**
  93. Return the Platform specific PPIs
  94. This function exposes the Platform Specific PPIs. They can be used by any PrePi modules or passed
  95. to the PeiCore by PrePeiCore.
  96. @param[out] PpiListSize Size in Bytes of the Platform PPI List
  97. @param[out] PpiList Platform PPI List
  98. **/
  99. VOID
  100. ArmPlatformGetPlatformPpiList (
  101. OUT UINTN *PpiListSize,
  102. OUT EFI_PEI_PPI_DESCRIPTOR **PpiList
  103. );
  104. #endif