/** Main entry for the Coreboot Support DXE module. @param[in] ImageHandle The firmware allocated handle for the EFI image. @param[in] SystemTable A pointer to the EFI System Table. @retval EFI_SUCCESS The entry point is executed successfully. @retval other Some error occurs when executing this entry point. **/ EFI_STATUS EFIAPI CbDxeEntryPoint ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) { EFI_STATUS Status; EFI_HOB_GUID_TYPE *GuidHob; SYSTEM_TABLE_INFO *pSystemTableInfo; FRAME_BUFFER_INFO *FbInfo; Status = EFI_SUCCESS; // // Report MMIO/IO Resources // Status = CbReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0xFEC00000, SIZE_4KB, 0, SystemTable); // IOAPIC ASSERT_EFI_ERROR (Status); Status = CbReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0xFED00000, SIZE_1KB, 0, SystemTable); // HPET ASSERT_EFI_ERROR (Status); // // Find the system table information guid hob // GuidHob = GetFirstGuidHob (&gUefiSystemTableInfoGuid); ASSERT (GuidHob != NULL); pSystemTableInfo = (SYSTEM_TABLE_INFO *)GET_GUID_HOB_DATA (GuidHob); // // Install Acpi Table // if (pSystemTableInfo->AcpiTableBase != 0 && pSystemTableInfo->AcpiTableSize != 0) { DEBUG ((EFI_D_ERROR, "Install Acpi Table at 0x%lx, length 0x%x\n", pSystemTableInfo->AcpiTableBase, pSystemTableInfo->AcpiTableSize)); Status = gBS->InstallConfigurationTable (&gEfiAcpiTableGuid, (VOID *)(UINTN)pSystemTableInfo->AcpiTableBase); ASSERT_EFI_ERROR (Status); } // // Install Smbios Table // if (pSystemTableInfo->SmbiosTableBase != 0 && pSystemTableInfo->SmbiosTableSize != 0) { DEBUG ((EFI_D_ERROR, "Install Smbios Table at 0x%lx, length 0x%x\n", pSystemTableInfo->SmbiosTableBase, pSystemTableInfo->SmbiosTableSize)); Status = gBS->InstallConfigurationTable (&gEfiSmbiosTableGuid, (VOID *)(UINTN)pSystemTableInfo->SmbiosTableBase); ASSERT_EFI_ERROR (Status); } // // Find the frame buffer information and update PCDs // 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; }
/** Main entry for the Coreboot Support DXE module. @param[in] ImageHandle The firmware allocated handle for the EFI image. @param[in] SystemTable A pointer to the EFI System Table. @retval EFI_SUCCESS The entry point is executed successfully. @retval other Some error occurs when executing this entry point. **/ EFI_STATUS CbDxeEntryPoint ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) { EFI_STATUS Status; EFI_EVENT ReadyToBootEvent; EFI_HOB_GUID_TYPE *GuidHob; SYSTEM_TABLE_INFO *pSystemTableInfo; ACPI_BOARD_INFO *pAcpiBoardInfo; 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); Status = CbReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo, 0xFED00000, SIZE_1KB, 0, SystemTable); // HPET ASSERT_EFI_ERROR (Status); // // Find the system table information guid hob // GuidHob = GetFirstGuidHob (&gUefiSystemTableInfoGuid); ASSERT (GuidHob != NULL); pSystemTableInfo = (SYSTEM_TABLE_INFO *)GET_GUID_HOB_DATA (GuidHob); // // Install Acpi Table // if (pSystemTableInfo->AcpiTableBase != 0 && pSystemTableInfo->AcpiTableSize != 0) { DEBUG ((EFI_D_ERROR, "Install Acpi Table at 0x%x, length 0x%x\n", (UINTN)pSystemTableInfo->AcpiTableBase, pSystemTableInfo->AcpiTableSize)); Status = gBS->InstallConfigurationTable (&gEfiAcpiTableGuid, (VOID *)(UINTN)pSystemTableInfo->AcpiTableBase); ASSERT_EFI_ERROR (Status); } // // Install Smbios Table // if (pSystemTableInfo->SmbiosTableBase != 0 && pSystemTableInfo->SmbiosTableSize != 0) { DEBUG ((EFI_D_ERROR, "Install Smbios Table at 0x%x, length 0x%x\n", (UINTN)pSystemTableInfo->SmbiosTableBase, pSystemTableInfo->SmbiosTableSize)); Status = gBS->InstallConfigurationTable (&gEfiSmbiosTableGuid, (VOID *)(UINTN)pSystemTableInfo->SmbiosTableBase); ASSERT_EFI_ERROR (Status); } // // Find the acpi board information guid hob // 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%x\n", 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); return EFI_SUCCESS; }