X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=CorebootModulePkg%2FCbSupportDxe%2FCbSupportDxe.c;h=ec42f7ff3547a969a2a174a4b70fc1742f2b5360;hp=d81b7c23b71737aaa24ffc5f4b3eb8abf00f938d;hb=271d8cd7df0c346f19803938d98fe7cbb7b63be4;hpb=f3a90fbf8b8d816def4be94914295b479f218a1a diff --git a/CorebootModulePkg/CbSupportDxe/CbSupportDxe.c b/CorebootModulePkg/CbSupportDxe/CbSupportDxe.c index d81b7c23b7..ec42f7ff35 100755 --- a/CorebootModulePkg/CbSupportDxe/CbSupportDxe.c +++ b/CorebootModulePkg/CbSupportDxe/CbSupportDxe.c @@ -14,7 +14,6 @@ **/ #include "CbSupportDxe.h" -UINTN mPmCtrlReg = 0; /** Reserve MMIO/IO resource in GCD @@ -86,31 +85,6 @@ CbReserveResourceInGcd ( return Status; } -/** - Notification function of EVT_GROUP_READY_TO_BOOT event group. - - This is a notification function registered on EVT_GROUP_READY_TO_BOOT event group. - When the Boot Manager is about to load and execute a boot option, it reclaims variable - storage if free size is below the threshold. - - @param Event Event whose notification function is being invoked. - @param Context Pointer to the notification function's context. - -**/ -VOID -EFIAPI -OnReadyToBoot ( - IN EFI_EVENT Event, - IN VOID *Context - ) -{ - // - // Enable SCI - // - IoOr16 (mPmCtrlReg, BIT0); - - DEBUG ((EFI_D_ERROR, "Enable SCI bit at 0x%lx before boot\n", (UINT64)mPmCtrlReg)); -} /** Main entry for the Coreboot Support DXE module. @@ -130,18 +104,14 @@ CbDxeEntryPoint ( ) { EFI_STATUS Status; - EFI_EVENT ReadyToBootEvent; EFI_HOB_GUID_TYPE *GuidHob; SYSTEM_TABLE_INFO *pSystemTableInfo; - ACPI_BOARD_INFO *pAcpiBoardInfo; + FRAME_BUFFER_INFO *FbInfo; Status = EFI_SUCCESS; // // Report MMIO/IO Resources // - Status = CbReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0xFEE00000, SIZE_1MB, 0, SystemTable); // LAPIC - ASSERT_EFI_ERROR (Status); - Status = CbReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0xFEC00000, SIZE_4KB, 0, SystemTable); // IOAPIC ASSERT_EFI_ERROR (Status); @@ -174,27 +144,20 @@ CbDxeEntryPoint ( } // - // Find the acpi board information guid hob + // Find the frame buffer information and update PCDs // - GuidHob = GetFirstGuidHob (&gUefiAcpiBoardInfoGuid); - ASSERT (GuidHob != NULL); - pAcpiBoardInfo = (ACPI_BOARD_INFO *)GET_GUID_HOB_DATA (GuidHob); - - mPmCtrlReg = (UINTN)pAcpiBoardInfo->PmCtrlRegBase; - DEBUG ((EFI_D_ERROR, "PmCtrlReg at 0x%lx\n", (UINT64)mPmCtrlReg)); - - // - // Register callback on the ready to boot event - // in order to enable SCI - // - ReadyToBootEvent = NULL; - Status = EfiCreateEventReadyToBootEx ( - TPL_CALLBACK, - OnReadyToBoot, - NULL, - &ReadyToBootEvent - ); - ASSERT_EFI_ERROR (Status); + GuidHob = GetFirstGuidHob (&gUefiFrameBufferInfoGuid); + if (GuidHob != NULL) { + FbInfo = (FRAME_BUFFER_INFO *)GET_GUID_HOB_DATA (GuidHob); + Status = PcdSet32S (PcdVideoHorizontalResolution, FbInfo->HorizontalResolution); + ASSERT_EFI_ERROR (Status); + Status = PcdSet32S (PcdVideoVerticalResolution, FbInfo->VerticalResolution); + ASSERT_EFI_ERROR (Status); + Status = PcdSet32S (PcdSetupVideoHorizontalResolution, FbInfo->HorizontalResolution); + ASSERT_EFI_ERROR (Status); + Status = PcdSet32S (PcdSetupVideoVerticalResolution, FbInfo->VerticalResolution); + ASSERT_EFI_ERROR (Status); + } return EFI_SUCCESS; }