SlotDataUpdateDxe.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /** @file
  2. Slot Data Update.
  3. @copyright
  4. Copyright 2018 - 2021 Intel Corporation. <BR>
  5. SPDX-License-Identifier: BSD-2-Clause-Patent
  6. **/
  7. #include "SlotDataUpdateDxe.h"
  8. UINT8
  9. GetTypeIOU0Setting (
  10. UINT8 IOU0Data
  11. )
  12. {
  13. //
  14. // Change bifurcation of Port1A-1B as xxx8 when QATGpio enabled.
  15. //
  16. IOU0Data = IIO_BIFURCATE_xxx8xxx8;
  17. return IOU0Data;
  18. }
  19. UINT8
  20. GetTypeIOU2Setting (
  21. UINT8 SkuPersonalityType,
  22. UINT8 IOU2Data
  23. )
  24. {
  25. return IOU2Data;
  26. }
  27. static IIO_BROADWAY_ADDRESS_DATA_ENTRY SlotTypeBroadwayTable[] = {
  28. {Iio_Socket0, Iio_Iou2, Bw5_Addr_0 },
  29. {Iio_Socket1, Iio_Iou1, Bw5_Addr_2},
  30. {Iio_Socket1, Iio_Iou0, Bw5_Addr_1 },
  31. };
  32. PLATFORM_SLOT_UPDATE_TABLE TypeSlotTable =
  33. {
  34. PLATFORM_SLOT_UPDATE_SIGNATURE,
  35. PLATFORM_SLOT_UPDATE_VERSION,
  36. SlotTypeBroadwayTable,
  37. GetTypeIOU0Setting,
  38. 0
  39. };
  40. PLATFORM_SLOT_UPDATE_TABLE2 TypeSlotTable2 =
  41. {
  42. PLATFORM_SLOT_UPDATE_SIGNATURE,
  43. PLATFORM_SLOT_UPDATE_VERSION,
  44. SlotTypeBroadwayTable,
  45. GetTypeIOU0Setting,
  46. 0,
  47. GetTypeIOU2Setting
  48. };
  49. /**
  50. The Driver Entry Point.
  51. The function is the driver Entry point.
  52. @param ImageHandle A handle for the image that is initializing this driver
  53. @param SystemTable A pointer to the EFI system table
  54. @retval EFI_SUCCESS: Driver initialized successfully
  55. @retval EFI_LOAD_ERROR: Failed to Initialize or has been loaded
  56. @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources
  57. **/
  58. EFI_STATUS
  59. EFIAPI
  60. SlotDataUpdateEntry (
  61. IN EFI_HANDLE ImageHandle,
  62. IN EFI_SYSTEM_TABLE *SystemTable
  63. )
  64. {
  65. EFI_STATUS Status;
  66. UBA_CONFIG_DATABASE_PROTOCOL *UbaConfigProtocol = NULL;
  67. DEBUG((DEBUG_INFO, "UBA:SlotDataUpdate-TypeBoardPortTemplate\n"));
  68. Status = gBS->LocateProtocol (
  69. &gUbaConfigDatabaseProtocolGuid,
  70. NULL,
  71. &UbaConfigProtocol
  72. );
  73. if (EFI_ERROR(Status)) {
  74. return Status;
  75. }
  76. Status = UbaConfigProtocol->AddData (
  77. UbaConfigProtocol,
  78. &gPlatformSlotDataDxeGuid,
  79. &TypeSlotTable,
  80. sizeof(TypeSlotTable)
  81. );
  82. if (EFI_ERROR(Status)) {
  83. return Status;
  84. }
  85. Status = UbaConfigProtocol->AddData (
  86. UbaConfigProtocol,
  87. &gPlatformSlotDataDxeGuid,
  88. &TypeSlotTable2,
  89. sizeof(TypeSlotTable2)
  90. );
  91. if (EFI_ERROR(Status)) {
  92. return Status;
  93. }
  94. return Status;
  95. }