SlotDataUpdateDxe.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. GetTypeCooperCityRPIOU0Setting (
  10. UINT8 IOU0Data
  11. )
  12. {
  13. //
  14. // Change bifurcation of Port1A-1B as x4x4 when QATGpio enabled.
  15. //
  16. IOU0Data = IIO_BIFURCATE_xxx8x4x4;
  17. return IOU0Data;
  18. }
  19. UINT8
  20. GetTypeCooperCityRPIOU2Setting (
  21. UINT8 SkuPersonalityType,
  22. UINT8 IOU2Data
  23. )
  24. {
  25. return IOU2Data;
  26. }
  27. PLATFORM_SLOT_UPDATE_TABLE TypeCooperCityRPSlotTable =
  28. {
  29. PLATFORM_SLOT_UPDATE_SIGNATURE,
  30. PLATFORM_SLOT_UPDATE_VERSION,
  31. NULL,
  32. GetTypeCooperCityRPIOU0Setting,
  33. 1
  34. };
  35. PLATFORM_SLOT_UPDATE_TABLE2 TypeCooperCityRPSlotTable2 =
  36. {
  37. PLATFORM_SLOT_UPDATE_SIGNATURE,
  38. PLATFORM_SLOT_UPDATE_VERSION,
  39. NULL,
  40. GetTypeCooperCityRPIOU0Setting,
  41. 1,
  42. GetTypeCooperCityRPIOU2Setting
  43. };
  44. /**
  45. The Driver Entry Point.
  46. The function is the driver Entry point.
  47. @param ImageHandle A handle for the image that is initializing this driver
  48. @param SystemTable A pointer to the EFI system table
  49. @retval EFI_SUCCESS: Driver initialized successfully
  50. @retval EFI_LOAD_ERROR: Failed to Initialize or has been loaded
  51. @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources
  52. **/
  53. EFI_STATUS
  54. EFIAPI
  55. SlotDataUpdateEntry (
  56. IN EFI_HANDLE ImageHandle,
  57. IN EFI_SYSTEM_TABLE *SystemTable
  58. )
  59. {
  60. EFI_STATUS Status;
  61. UBA_CONFIG_DATABASE_PROTOCOL *UbaConfigProtocol = NULL;
  62. DEBUG((DEBUG_INFO, "UBA:SlotDataUpdate-TypeCooperCityRP\n"));
  63. Status = gBS->LocateProtocol (
  64. &gUbaConfigDatabaseProtocolGuid,
  65. NULL,
  66. (VOID **) &UbaConfigProtocol
  67. );
  68. if (EFI_ERROR(Status)) {
  69. return Status;
  70. }
  71. Status = UbaConfigProtocol->AddData (
  72. UbaConfigProtocol,
  73. &gPlatformSlotDataDxeGuid,
  74. &TypeCooperCityRPSlotTable,
  75. sizeof(TypeCooperCityRPSlotTable)
  76. );
  77. if (EFI_ERROR(Status)) {
  78. return Status;
  79. }
  80. Status = UbaConfigProtocol->AddData (
  81. UbaConfigProtocol,
  82. &gPlatformSlotDataGuid2,
  83. &TypeCooperCityRPSlotTable2,
  84. sizeof(TypeCooperCityRPSlotTable2)
  85. );
  86. if (EFI_ERROR(Status)) {
  87. return Status;
  88. }
  89. return Status;
  90. }