HiKey.c 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /** @file
  2. *
  3. * Copyright (c) 2014-2017, Linaro Limited. All rights reserved.
  4. *
  5. * This program and the accompanying materials
  6. * are licensed and made available under the terms and conditions of the BSD License
  7. * which accompanies this distribution. The full text of the license may be found at
  8. * http://opensource.org/licenses/bsd-license.php
  9. *
  10. * THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  11. * WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
  12. *
  13. **/
  14. #include <Library/ArmPlatformLib.h>
  15. #include <Library/DebugLib.h>
  16. #include <Library/IoLib.h>
  17. #include <Library/PcdLib.h>
  18. #include <Ppi/ArmMpCoreInfo.h>
  19. #include <Hi6220.h>
  20. ARM_CORE_INFO mHiKeyInfoTable[] = {
  21. {
  22. // Cluster 0, Core 0
  23. 0x0, 0x0,
  24. // MP Core MailBox Set/Get/Clear Addresses and Clear Value
  25. (UINT64)0xFFFFFFFF
  26. },
  27. {
  28. // Cluster 0, Core 1
  29. 0x0, 0x1,
  30. // MP Core MailBox Set/Get/Clear Addresses and Clear Value
  31. (UINT64)0xFFFFFFFF
  32. },
  33. {
  34. // Cluster 0, Core 2
  35. 0x0, 0x2,
  36. // MP Core MailBox Set/Get/Clear Addresses and Clear Value
  37. (UINT64)0xFFFFFFFF
  38. },
  39. {
  40. // Cluster 0, Core 3
  41. 0x0, 0x3,
  42. // MP Core MailBox Set/Get/Clear Addresses and Clear Value
  43. (UINT64)0xFFFFFFFF
  44. },
  45. {
  46. // Cluster 1, Core 0
  47. 0x1, 0x0,
  48. // MP Core MailBox Set/Get/Clear Addresses and Clear Value
  49. (UINT64)0xFFFFFFFF
  50. },
  51. {
  52. // Cluster 1, Core 1
  53. 0x1, 0x1,
  54. // MP Core MailBox Set/Get/Clear Addresses and Clear Value
  55. (UINT64)0xFFFFFFFF
  56. },
  57. {
  58. // Cluster 1, Core 2
  59. 0x1, 0x2,
  60. // MP Core MailBox Set/Get/Clear Addresses and Clear Value
  61. (UINT64)0xFFFFFFFF
  62. },
  63. {
  64. // Cluster 1, Core 3
  65. 0x1, 0x3,
  66. // MP Core MailBox Set/Get/Clear Addresses and Clear Value
  67. (UINT64)0xFFFFFFFF
  68. }
  69. };
  70. /**
  71. Return the current Boot Mode
  72. This function returns the boot reason on the platform
  73. @return Return the current Boot Mode of the platform
  74. **/
  75. EFI_BOOT_MODE
  76. ArmPlatformGetBootMode (
  77. VOID
  78. )
  79. {
  80. return BOOT_WITH_FULL_CONFIGURATION;
  81. }
  82. /**
  83. Initialize controllers that must setup in the normal world
  84. This function is called by the ArmPlatformPkg/Pei or ArmPlatformPkg/Pei/PlatformPeim
  85. in the PEI phase.
  86. **/
  87. RETURN_STATUS
  88. ArmPlatformInitialize (
  89. IN UINTN MpId
  90. )
  91. {
  92. return RETURN_SUCCESS;
  93. }
  94. /**
  95. Initialize the system (or sometimes called permanent) memory
  96. This memory is generally represented by the DRAM.
  97. **/
  98. VOID
  99. ArmPlatformInitializeSystemMemory (
  100. VOID
  101. )
  102. {
  103. }
  104. EFI_STATUS
  105. PrePeiCoreGetMpCoreInfo (
  106. OUT UINTN *CoreCount,
  107. OUT ARM_CORE_INFO **ArmCoreTable
  108. )
  109. {
  110. // Only support one cluster
  111. *CoreCount = sizeof(mHiKeyInfoTable) / sizeof(ARM_CORE_INFO);
  112. *ArmCoreTable = mHiKeyInfoTable;
  113. return EFI_SUCCESS;
  114. }
  115. // Needs to be declared in the file. Otherwise gArmMpCoreInfoPpiGuid is undefined in the contect of PrePeiCore
  116. EFI_GUID mArmMpCoreInfoPpiGuid = ARM_MP_CORE_INFO_PPI_GUID;
  117. ARM_MP_CORE_INFO_PPI mMpCoreInfoPpi = { PrePeiCoreGetMpCoreInfo };
  118. EFI_PEI_PPI_DESCRIPTOR gPlatformPpiTable[] = {
  119. {
  120. EFI_PEI_PPI_DESCRIPTOR_PPI,
  121. &mArmMpCoreInfoPpiGuid,
  122. &mMpCoreInfoPpi
  123. }
  124. };
  125. VOID
  126. ArmPlatformGetPlatformPpiList (
  127. OUT UINTN *PpiListSize,
  128. OUT EFI_PEI_PPI_DESCRIPTOR **PpiList
  129. )
  130. {
  131. *PpiListSize = sizeof(gPlatformPpiTable);
  132. *PpiList = gPlatformPpiTable;
  133. }