GpioPlatformConfig.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /** @file
  2. @copyright
  3. Copyright 2013 - 2021 Intel Corporation. <BR>
  4. SPDX-License-Identifier: BSD-2-Clause-Patent
  5. **/
  6. #include "PeiCommonBoardInitLib.h"
  7. #include <GpioPinsSklH.h>
  8. #include <Library/GpioLib.h>
  9. #include <Library/UbaGpioPlatformConfig.h>
  10. #include <Library/PchInfoLib.h>
  11. #include <Ppi/DynamicSiLibraryPpi.h>
  12. STATIC PLATFORM_GPIO_CONFIG_TABLE mGpioPlatformConfig = {
  13. PLATFORM_GPIO_CONFIG_SIGNATURE,
  14. PLATFORM_GPIO_CONFIG_VERSION,
  15. //MFG pad
  16. {
  17. GPIO_SKL_H_GPP_C9, //To be verified with the Board schematics
  18. {GpioPadModeGpio, GpioHostOwnGpio, GpioDirIn, GpioOutDefault, GpioIntDis, GpioPlatformReset, GpioTermNone}
  19. },
  20. GPIO_SKL_H_GPP_A18,
  21. //Recovery jumper pad
  22. GPIO_SKL_H_GPP_B14,
  23. //FM ADR Trigger
  24. GPIO_SKL_H_GPP_E3,
  25. //ADR enable GPIO output
  26. GPIO_SKL_H_GPP_D4,
  27. // Force to S1 config mode pad
  28. GPIO_SKL_H_GPP_A17,
  29. //
  30. // Used by PC Platforms
  31. //
  32. GPIO_SKL_H_GPP_B3,
  33. //
  34. // Used by PC platforms. This is the first GPIO pad of the pad series to indicate Board ID
  35. //
  36. GPIO_SKL_H_GPP_G12,
  37. //
  38. // WHEA SCI generation pad
  39. //
  40. GPIO_SKL_H_GPP_A12,
  41. //
  42. // Used to generate CPU HP SMI
  43. //
  44. GPIO_SKL_H_GPP_E6,
  45. //
  46. // FPGA error indicator
  47. //
  48. GPIO_SKL_H_GPP_E4,
  49. //
  50. // FPGA error indicator
  51. //
  52. GPIO_SKL_H_GPP_E5,
  53. // Flash Security
  54. UNUSED_GPIO,
  55. };
  56. STATIC PLATFORM_GPIO_CONFIG_TABLE mGpioMiniPchPlatformConfig = {
  57. PLATFORM_GPIO_CONFIG_SIGNATURE,
  58. PLATFORM_GPIO_CONFIG_VERSION,
  59. //MFG pad
  60. {
  61. UNUSED_GPIO, //To be verified with the Board schematics
  62. {0, 0, 0, 0, 0, 0, 0}
  63. },
  64. UNUSED_GPIO,
  65. //Recovery jumper pad
  66. UNUSED_GPIO,
  67. //FM ADR Trigger
  68. UNUSED_GPIO,
  69. //ADR enable GPIO output
  70. UNUSED_GPIO,
  71. // Force to S1 config mode pad
  72. UNUSED_GPIO,
  73. //
  74. // Used by PC Platforms
  75. //
  76. UNUSED_GPIO,
  77. //
  78. // Used by PC platforms. This is the first GPIO pad of the pad series to indicate Board ID
  79. //
  80. UNUSED_GPIO,
  81. //
  82. // WHEA SCI generation pad
  83. //
  84. UNUSED_GPIO,
  85. //
  86. // Used to generate CPU HP SMI
  87. //
  88. UNUSED_GPIO,
  89. //
  90. // FPGA error indicator
  91. //
  92. UNUSED_GPIO,
  93. //
  94. // FPGA error indicator
  95. //
  96. UNUSED_GPIO,
  97. };
  98. EFI_STATUS
  99. InstallGpioPlatformData (
  100. IN UBA_CONFIG_DATABASE_PPI *UbaConfigPpi
  101. )
  102. {
  103. EFI_STATUS Status;
  104. DYNAMIC_SI_LIBARY_PPI *DynamicSiLibraryPpi = NULL;
  105. Status = PeiServicesLocatePpi (&gDynamicSiLibraryPpiGuid, 0, NULL, (VOID **) &DynamicSiLibraryPpi);
  106. if (EFI_ERROR (Status)) {
  107. ASSERT_EFI_ERROR (Status);
  108. return Status;
  109. }
  110. if (DynamicSiLibraryPpi->GetPchSeries () == PchMini) {
  111. return UbaConfigPpi->AddData (
  112. UbaConfigPpi,
  113. &gPlatformGpioPlatformConfigDataGuid,
  114. &mGpioMiniPchPlatformConfig,
  115. sizeof(mGpioMiniPchPlatformConfig)
  116. );
  117. }
  118. Status = UbaConfigPpi->AddData (
  119. UbaConfigPpi,
  120. &gPlatformGpioPlatformConfigDataGuid,
  121. &mGpioPlatformConfig,
  122. sizeof(mGpioPlatformConfig)
  123. );
  124. ASSERT_EFI_ERROR (Status);
  125. return Status;
  126. }