SlotTable.c 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /** @file
  2. Slot Table Update.
  3. @copyright
  4. Copyright 2018 - 2021 Intel Corporation. <BR>
  5. Copyright (c) 2021 - 2022, American Megatrends International LLC. <BR>
  6. SPDX-License-Identifier: BSD-2-Clause-Patent
  7. **/
  8. #include "PeiBoardInit.h"
  9. #include <Library/UbaSlotUpdateLib.h>
  10. #include <IioPlatformData.h>
  11. #define PCI_DEVICE_ON_BOARD_TRUE 0
  12. #define PCI_DEVICE_ON_BOARD_FALSE 1
  13. typedef enum {
  14. Iio_Socket0 = 0,
  15. Iio_Socket1,
  16. Iio_Socket2,
  17. Iio_Socket3,
  18. Iio_Socket4,
  19. Iio_Socket5,
  20. Iio_Socket6,
  21. Iio_Socket7
  22. } IIO_SOCKETS;
  23. typedef enum {
  24. Iio_Iou0 = 0,
  25. Iio_Iou1,
  26. Iio_Iou2,
  27. Iio_Iou3,
  28. Iio_Iou4,
  29. Iio_IouMax
  30. } IIO_IOUS;
  31. typedef enum {
  32. Bw5_Addr_0 = 0,
  33. Bw5_Addr_1,
  34. Bw5_Addr_2,
  35. Bw5_Addr_3,
  36. Bw5_Addr_Max
  37. } BW5_ADDRESS;
  38. static UINT8 TypeAowandaPchPciSlotImpementedTableData[] = {
  39. PCI_DEVICE_ON_BOARD_TRUE, // Root Port 0 I210
  40. PCI_DEVICE_ON_BOARD_FALSE, // Root Port 1
  41. PCI_DEVICE_ON_BOARD_FALSE, // Root Port 2
  42. PCI_DEVICE_ON_BOARD_TRUE, // Root Port 3 BMC Video
  43. PCI_DEVICE_ON_BOARD_FALSE, // Root Port 4
  44. PCI_DEVICE_ON_BOARD_FALSE, // Root Port 5
  45. PCI_DEVICE_ON_BOARD_FALSE, // Root Port 6
  46. PCI_DEVICE_ON_BOARD_FALSE, // Root Port 7
  47. PCI_DEVICE_ON_BOARD_FALSE, // Root Port 8
  48. PCI_DEVICE_ON_BOARD_FALSE, // Root Port 9
  49. PCI_DEVICE_ON_BOARD_FALSE, // Root Port 10
  50. PCI_DEVICE_ON_BOARD_FALSE, // Root Port 11
  51. PCI_DEVICE_ON_BOARD_FALSE, // Root Port 12
  52. PCI_DEVICE_ON_BOARD_FALSE, // Root Port 13
  53. PCI_DEVICE_ON_BOARD_FALSE, // Root Port 14
  54. PCI_DEVICE_ON_BOARD_FALSE, // Root Port 15
  55. PCI_DEVICE_ON_BOARD_FALSE, // Root Port 16
  56. PCI_DEVICE_ON_BOARD_FALSE, // Root Port 17
  57. PCI_DEVICE_ON_BOARD_FALSE, // Root Port 18
  58. PCI_DEVICE_ON_BOARD_FALSE // Root Port 19
  59. };
  60. UINT8
  61. GetTypeAowandaIOU0Setting (
  62. UINT8 IOU0Data
  63. )
  64. {
  65. return IOU0Data;
  66. }
  67. UINT8
  68. GetTypeAowandaIOU2Setting (
  69. UINT8 SkuPersonalityType,
  70. UINT8 IOU2Data
  71. )
  72. {
  73. return IOU2Data;
  74. }
  75. static IIO_BROADWAY_ADDRESS_DATA_ENTRY SlotTypeAowandaBroadwayTable[] = {
  76. { Iio_Socket0, Iio_Iou2, Bw5_Addr_0 },
  77. { Iio_Socket1, Iio_Iou1, Bw5_Addr_2 },
  78. { Iio_Socket1, Iio_Iou0, Bw5_Addr_1 },
  79. };
  80. PLATFORM_SLOT_UPDATE_TABLE TypeAowandaSlotTable =
  81. {
  82. PLATFORM_SLOT_UPDATE_SIGNATURE,
  83. PLATFORM_SLOT_UPDATE_VERSION,
  84. SlotTypeAowandaBroadwayTable,
  85. GetTypeAowandaIOU0Setting,
  86. 0
  87. };
  88. PLATFORM_SLOT_UPDATE_TABLE2 TypeAowandaSlotTable2 =
  89. {
  90. PLATFORM_SLOT_UPDATE_SIGNATURE,
  91. PLATFORM_SLOT_UPDATE_VERSION,
  92. SlotTypeAowandaBroadwayTable,
  93. GetTypeAowandaIOU0Setting,
  94. 0,
  95. GetTypeAowandaIOU2Setting
  96. };
  97. PLATFORM_PCH_PCI_SLOT_IMPLEMENTED_UPDATE_TABLE TypeAowandaPchPciSlotImplementedTable = {
  98. PLATFORM_SLOT_UPDATE_SIGNATURE,
  99. PLATFORM_SLOT_UPDATE_VERSION,
  100. TypeAowandaPchPciSlotImpementedTableData
  101. };
  102. /**
  103. Entry point function for the PEIM
  104. @param FileHandle Handle of the file being invoked.
  105. @param PeiServices Describes the list of possible PEI Services.
  106. @return EFI_SUCCESS If we installed our PPI
  107. **/
  108. EFI_STATUS
  109. TypeAowandaInstallSlotTableData (
  110. IN UBA_CONFIG_DATABASE_PPI *UbaConfigPpi
  111. )
  112. {
  113. EFI_STATUS Status;
  114. Status = UbaConfigPpi->AddData (
  115. UbaConfigPpi,
  116. &gPlatformSlotDataGuid,
  117. &TypeAowandaSlotTable,
  118. sizeof (TypeAowandaSlotTable)
  119. );
  120. if (EFI_ERROR (Status)) {
  121. return Status;
  122. }
  123. Status = UbaConfigPpi->AddData (
  124. UbaConfigPpi,
  125. &gPlatformSlotDataGuid2,
  126. &TypeAowandaSlotTable2,
  127. sizeof (TypeAowandaSlotTable2)
  128. );
  129. if (EFI_ERROR (Status)) {
  130. return Status;
  131. }
  132. Status = UbaConfigPpi->AddData (
  133. UbaConfigPpi,
  134. &gPlatformPciSlotImplementedGuid,
  135. &TypeAowandaPchPciSlotImplementedTable,
  136. sizeof (TypeAowandaPchPciSlotImplementedTable)
  137. );
  138. if (EFI_ERROR (Status)) {
  139. return Status;
  140. }
  141. return Status;
  142. }