12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- /** @file
- System Congfig Update.
- @copyright
- Copyright 2017 - 2021 Intel Corporation. <BR>
- SPDX-License-Identifier: BSD-2-Clause-Patent
- **/
- #include "SystemConfigUpdateDxe.h"
- #include <PlatformInfoTypes.h>
- EFI_PLATFORM_INFO *mPlatformInfo = NULL;
- /**
- Update the IioDefaults
- @param *SYSTEM_CONFIGURATION Pointer to the SystemConfiguration structure
- @retval None
- **/
- VOID
- IioDefaultConfigUpdateCallback (
- IN SYSTEM_CONFIGURATION *Default
- )
- {
- UINT8 BoardId;
- BoardId = mPlatformInfo->BoardId;
- Default->PlatformOCSupport = 0;
- if (BoardId == TypeHedtCRB) {
- Default->PlatformOCSupport = 1;
- }
- }
- SYSTEM_CONFIG_UPDATE_DATA SystemConfigUpdateTable = {
- SYSTEM_CONFIG_UPDATE_SIGNATURE,
- SYSTEM_CONFIG_UPDATE_VERSION,
- IioDefaultConfigUpdateCallback
- };
- /**
- The Driver Entry Point.
- The function is the driver Entry point.
- @param ImageHandle A handle for the image that is initializing this driver
- @param SystemTable A pointer to the EFI system table
- @retval EFI_SUCCESS: Driver initialized successfully
- @retval EFI_LOAD_ERROR: Failed to Initialize or has been loaded
- @retval EFI_OUT_OF_RESOURCES Could not allocate needed resources
- **/
- EFI_STATUS
- EFIAPI
- SystemConfigUpdateEntry (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
- {
- EFI_STATUS Status;
- UBA_CONFIG_DATABASE_PROTOCOL *UbaConfigProtocol = NULL;
- EFI_HOB_GUID_TYPE *GuidHob;
- GuidHob = GetFirstGuidHob (&gEfiPlatformInfoGuid);
- ASSERT (GuidHob != NULL);
- mPlatformInfo = GET_GUID_HOB_DATA(GuidHob);
- DEBUG((DEBUG_INFO, "UBA:System Config Update Table.\n"));
- Status = gBS->LocateProtocol (
- &gUbaConfigDatabaseProtocolGuid,
- NULL,
- (VOID **) &UbaConfigProtocol
- );
- if (EFI_ERROR(Status)) {
- return Status;
- }
- Status = UbaConfigProtocol->AddData (
- UbaConfigProtocol,
- &gSystemConfigUpdateDataGuid,
- &SystemConfigUpdateTable,
- sizeof(SystemConfigUpdateTable)
- );
- if (EFI_ERROR(Status)) {
- return Status;
- }
- return Status;
- }
|