SlotDataUpdateDxe.c 3.0 KB

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