From nobody Fri May 3 09:56:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+40145+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+40145+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1557268053; cv=none; d=zoho.com; s=zohoarc; b=KhHS+66yh4EldLZdR7H/d4W48+5TAdbffjoQg3yP2jqh1V3yysVzxU8HK4k3PI+B88CB7Q47V9bIdYtE/kAX84EsoxthHXEEVa5mPenreeG/cCJJCDn1nQlgWmvO67s5R92IPy7wBBw3JTE+k8G9sxGa7HuMdddOVFypuHy6k0w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557268053; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=g8MF19kDNJFEoLyhbKDG1ESK2l1Zlz3i7NQIKgFkgnM=; b=bRGIkoyvBLxm+vLHVbYHENYkOEXuao4Fj68l12NDFh85yh88oOAZn+d1vfyqhSAZ9QUks4oO2uI3L9aZlJ9kcA17ZmG8FfivQ8sSSt2w9mpswoEew+vd+dxhYBga0QQIKSzvd+bQ9SIVp1FxwTGRAFPev0yUzkgwJjNWHOKodz4= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+40145+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1557268053465404.00484603928805; Tue, 7 May 2019 15:27:33 -0700 (PDT) Return-Path: X-Received: from mga06.intel.com (mga06.intel.com []) by groups.io with SMTP; Tue, 07 May 2019 15:27:32 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 May 2019 15:27:31 -0700 X-ExtLoop1: 1 X-Received: from gdong1-mobl.amr.corp.intel.com ([10.78.24.216]) by orsmga003.jf.intel.com with ESMTP; 07 May 2019 15:27:31 -0700 From: "Guo Dong" To: devel@edk2.groups.io Cc: maurice.ma@intel.com, prince.agyeman@intel.com, benjamin.you@intel.com, guo.dong@intel.com Subject: [edk2-devel] [PATCH 1/2] Retire CorebootModulePkg from EDK2 Date: Tue, 7 May 2019 15:27:27 -0700 Message-Id: <20190507222728.28296-2-guo.dong@intel.com> In-Reply-To: <20190507222728.28296-1-guo.dong@intel.com> References: <20190507222728.28296-1-guo.dong@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,guo.dong@intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1557268052; bh=Dgyye79LiJ9nrsL+r9g8T8Bz6oG57eOKV0bfBC2cVAg=; h=Cc:Date:From:Reply-To:Subject:To; b=uEG7Mj1wXpewF4C8RBTGD/rDhw/90uGUAZtFWN3Jcr6WpvaTrbDzh3myhJJ45oV5x85 z5fmxvD401PewAeTFGuy/1sbYFzsUCcgE5e8MuMGlHetF91IksenjLEWSVnbMzoIZArSj F6gN9KL/Ek2ADf2MHEmtaiOVBCKnXIYHMS8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Since UefiPayloadPkg in EDK2 supports Coreboot and Slim Bootloader, and I d= on't receive any concerns for the RFC to remove CorebootModulePkg and CorebootPayloadPkg from EDK2 (https://edk2.groups.io/g/devel/message/39126), here is the action patch to remove CorebootModulePkg. Signed-off-by: Guo Dong Reviewed-by: Maurice Ma --- CorebootModulePkg/CbSupportDxe/CbSupportDxe.c | 158 --- CorebootModulePkg/CbSupportDxe/CbSupportDxe.h | 30 - CorebootModulePkg/CbSupportDxe/CbSupportDxe.inf | 60 -- CorebootModulePkg/CbSupportPei/CbSupportPei.c | 440 -------- CorebootModulePkg/CbSupportPei/CbSupportPei.h | 42 - CorebootModulePkg/CbSupportPei/CbSupportPei.inf | 74 -- CorebootModulePkg/CorebootModulePkg.dec | 59 -- CorebootModulePkg/Include/Coreboot.h | 249 ----- CorebootModulePkg/Include/Guid/AcpiBoardInfoGuid.h | 26 - .../Include/Guid/FrameBufferInfoGuid.h | 34 - .../Include/Guid/SystemTableInfoGuid.h | 24 - CorebootModulePkg/Include/Library/CbParseLib.h | 186 ---- .../Include/Library/CbPlatformSupportLib.h | 28 - .../BaseSerialPortLib16550.c | 1089 ----------------= ---- .../BaseSerialPortLib16550.inf | 42 - .../BaseSerialPortLib16550.uni | 16 - CorebootModulePkg/Library/CbParseLib/CbParseLib.c | 721 ------------- .../Library/CbParseLib/CbParseLib.inf | 39 - .../CbPlatformSupportLibNull.c | 29 - .../CbPlatformSupportLibNull.inf | 29 - .../CbPlatformSupportLibNull.uni | 14 - .../SataControllerDxe/ComponentName.c | 170 --- .../SataControllerDxe/SataController.c | 1043 ----------------= --- .../SataControllerDxe/SataController.h | 536 ---------- .../SataControllerDxe/SataControllerDxe.inf | 43 - CorebootModulePkg/SecCore/FindPeiCore.c | 193 ---- CorebootModulePkg/SecCore/Ia32/SecEntry.asm | 72 -- CorebootModulePkg/SecCore/Ia32/SecEntry.nasm | 66 -- CorebootModulePkg/SecCore/Ia32/Stack.asm | 76 -- CorebootModulePkg/SecCore/Ia32/Stack.nasm | 72 -- CorebootModulePkg/SecCore/SecCore.inf | 57 - CorebootModulePkg/SecCore/SecMain.c | 285 ----- CorebootModulePkg/SecCore/SecMain.h | 128 --- 33 files changed, 6130 deletions(-) delete mode 100755 CorebootModulePkg/CbSupportDxe/CbSupportDxe.c delete mode 100644 CorebootModulePkg/CbSupportDxe/CbSupportDxe.h delete mode 100644 CorebootModulePkg/CbSupportDxe/CbSupportDxe.inf delete mode 100755 CorebootModulePkg/CbSupportPei/CbSupportPei.c delete mode 100644 CorebootModulePkg/CbSupportPei/CbSupportPei.h delete mode 100644 CorebootModulePkg/CbSupportPei/CbSupportPei.inf delete mode 100644 CorebootModulePkg/CorebootModulePkg.dec delete mode 100644 CorebootModulePkg/Include/Coreboot.h delete mode 100644 CorebootModulePkg/Include/Guid/AcpiBoardInfoGuid.h delete mode 100644 CorebootModulePkg/Include/Guid/FrameBufferInfoGuid.h delete mode 100644 CorebootModulePkg/Include/Guid/SystemTableInfoGuid.h delete mode 100644 CorebootModulePkg/Include/Library/CbParseLib.h delete mode 100644 CorebootModulePkg/Include/Library/CbPlatformSupportLib.h delete mode 100644 CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSe= rialPortLib16550.c delete mode 100644 CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSe= rialPortLib16550.inf delete mode 100644 CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSe= rialPortLib16550.uni delete mode 100644 CorebootModulePkg/Library/CbParseLib/CbParseLib.c delete mode 100644 CorebootModulePkg/Library/CbParseLib/CbParseLib.inf delete mode 100644 CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPl= atformSupportLibNull.c delete mode 100644 CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPl= atformSupportLibNull.inf delete mode 100644 CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPl= atformSupportLibNull.uni delete mode 100644 CorebootModulePkg/SataControllerDxe/ComponentName.c delete mode 100644 CorebootModulePkg/SataControllerDxe/SataController.c delete mode 100644 CorebootModulePkg/SataControllerDxe/SataController.h delete mode 100644 CorebootModulePkg/SataControllerDxe/SataControllerDxe.i= nf delete mode 100644 CorebootModulePkg/SecCore/FindPeiCore.c delete mode 100644 CorebootModulePkg/SecCore/Ia32/SecEntry.asm delete mode 100644 CorebootModulePkg/SecCore/Ia32/SecEntry.nasm delete mode 100644 CorebootModulePkg/SecCore/Ia32/Stack.asm delete mode 100644 CorebootModulePkg/SecCore/Ia32/Stack.nasm delete mode 100644 CorebootModulePkg/SecCore/SecCore.inf delete mode 100644 CorebootModulePkg/SecCore/SecMain.c delete mode 100644 CorebootModulePkg/SecCore/SecMain.h diff --git a/CorebootModulePkg/CbSupportDxe/CbSupportDxe.c b/CorebootModule= Pkg/CbSupportDxe/CbSupportDxe.c deleted file mode 100755 index e559e74307..0000000000 --- a/CorebootModulePkg/CbSupportDxe/CbSupportDxe.c +++ /dev/null @@ -1,158 +0,0 @@ -/** @file - This driver will report some MMIO/IO resources to dxe core, extract smbi= os and acpi - tables from coreboot and install. - - Copyright (c) 2014, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ -#include "CbSupportDxe.h" - -/** - Reserve MMIO/IO resource in GCD - - @param IsMMIO Flag of whether it is mmio resource or io resource. - @param GcdType Type of the space. - @param BaseAddress Base address of the space. - @param Length Length of the space. - @param Alignment Align with 2^Alignment - @param ImageHandle Handle for the image of this driver. - - @retval EFI_SUCCESS Reserve successful -**/ -EFI_STATUS -CbReserveResourceInGcd ( - IN BOOLEAN IsMMIO, - IN UINTN GcdType, - IN EFI_PHYSICAL_ADDRESS BaseAddress, - IN UINT64 Length, - IN UINTN Alignment, - IN EFI_HANDLE ImageHandle - ) -{ - EFI_STATUS Status; - - if (IsMMIO) { - Status =3D gDS->AddMemorySpace ( - GcdType, - BaseAddress, - Length, - EFI_MEMORY_UC - ); - if (EFI_ERROR (Status)) { - DEBUG (( - EFI_D_ERROR, - "Failed to add memory space :0x%lx 0x%lx\n", - BaseAddress, - Length - )); - } - ASSERT_EFI_ERROR (Status); - Status =3D gDS->AllocateMemorySpace ( - EfiGcdAllocateAddress, - GcdType, - Alignment, - Length, - &BaseAddress, - ImageHandle, - NULL - ); - ASSERT_EFI_ERROR (Status); - } else { - Status =3D gDS->AddIoSpace ( - GcdType, - BaseAddress, - Length - ); - ASSERT_EFI_ERROR (Status); - Status =3D gDS->AllocateIoSpace ( - EfiGcdAllocateAddress, - GcdType, - Alignment, - Length, - &BaseAddress, - ImageHandle, - NULL - ); - ASSERT_EFI_ERROR (Status); - } - return Status; -} - - -/** - Main entry for the Coreboot Support DXE module. - - @param[in] ImageHandle The firmware allocated handle for the EFI imag= e. - @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 po= int. - -**/ -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 =3D EFI_SUCCESS; - // - // Report MMIO/IO Resources - // - Status =3D CbReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo,= 0xFEC00000, SIZE_4KB, 0, SystemTable); // IOAPIC - ASSERT_EFI_ERROR (Status); - - Status =3D CbReserveResourceInGcd (TRUE, EfiGcdMemoryTypeMemoryMappedIo,= 0xFED00000, SIZE_1KB, 0, SystemTable); // HPET - ASSERT_EFI_ERROR (Status); - - // - // Find the system table information guid hob - // - GuidHob =3D GetFirstGuidHob (&gUefiSystemTableInfoGuid); - ASSERT (GuidHob !=3D NULL); - pSystemTableInfo =3D (SYSTEM_TABLE_INFO *)GET_GUID_HOB_DATA (GuidHob); - - // - // Install Acpi Table - // - if (pSystemTableInfo->AcpiTableBase !=3D 0 && pSystemTableInfo->AcpiTabl= eSize !=3D 0) { - DEBUG ((EFI_D_ERROR, "Install Acpi Table at 0x%lx, length 0x%x\n", pSy= stemTableInfo->AcpiTableBase, pSystemTableInfo->AcpiTableSize)); - Status =3D gBS->InstallConfigurationTable (&gEfiAcpiTableGuid, (VOID *= )(UINTN)pSystemTableInfo->AcpiTableBase); - ASSERT_EFI_ERROR (Status); - } - - // - // Install Smbios Table - // - if (pSystemTableInfo->SmbiosTableBase !=3D 0 && pSystemTableInfo->Smbios= TableSize !=3D 0) { - DEBUG ((EFI_D_ERROR, "Install Smbios Table at 0x%lx, length 0x%x\n", p= SystemTableInfo->SmbiosTableBase, pSystemTableInfo->SmbiosTableSize)); - Status =3D gBS->InstallConfigurationTable (&gEfiSmbiosTableGuid, (VOID= *)(UINTN)pSystemTableInfo->SmbiosTableBase); - ASSERT_EFI_ERROR (Status); - } - - // - // Find the frame buffer information and update PCDs - // - GuidHob =3D GetFirstGuidHob (&gUefiFrameBufferInfoGuid); - if (GuidHob !=3D NULL) { - FbInfo =3D (FRAME_BUFFER_INFO *)GET_GUID_HOB_DATA (GuidHob); - Status =3D PcdSet32S (PcdVideoHorizontalResolution, FbInfo->Horizontal= Resolution); - ASSERT_EFI_ERROR (Status); - Status =3D PcdSet32S (PcdVideoVerticalResolution, FbInfo->VerticalReso= lution); - ASSERT_EFI_ERROR (Status); - Status =3D PcdSet32S (PcdSetupVideoHorizontalResolution, FbInfo->Horiz= ontalResolution); - ASSERT_EFI_ERROR (Status); - Status =3D PcdSet32S (PcdSetupVideoVerticalResolution, FbInfo->Vertica= lResolution); - ASSERT_EFI_ERROR (Status); - } - - return EFI_SUCCESS; -} - diff --git a/CorebootModulePkg/CbSupportDxe/CbSupportDxe.h b/CorebootModule= Pkg/CbSupportDxe/CbSupportDxe.h deleted file mode 100644 index 5548331391..0000000000 --- a/CorebootModulePkg/CbSupportDxe/CbSupportDxe.h +++ /dev/null @@ -1,30 +0,0 @@ -/** @file - The header file of Coreboot Support DXE. - -Copyright (c) 2014, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ -#ifndef __DXE_COREBOOT_SUPPORT_H__ -#define __DXE_COREBOOT_SUPPORT_H__ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#endif diff --git a/CorebootModulePkg/CbSupportDxe/CbSupportDxe.inf b/CorebootModu= lePkg/CbSupportDxe/CbSupportDxe.inf deleted file mode 100644 index 751832f3b6..0000000000 --- a/CorebootModulePkg/CbSupportDxe/CbSupportDxe.inf +++ /dev/null @@ -1,60 +0,0 @@ -## @file -# Coreboot Support DXE Module -# -# Report some MMIO/IO resources to dxe core, extract smbios and acpi table= s from coreboot and install. -# -# Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
-# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D CbSupportDxe - FILE_GUID =3D C68DAA4E-7AB5-41e8-A91D-5954421053F3 - MODULE_TYPE =3D DXE_DRIVER - VERSION_STRING =3D 1.0 - ENTRY_POINT =3D CbDxeEntryPoint - -# -# The following information is for reference only and not required by the = build tools. -# -# VALID_ARCHITECTURES =3D IA32 X64 EBC -# - -[Sources] - CbSupportDxe.c - CbSupportDxe.h - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - IntelFrameworkPkg/IntelFrameworkPkg.dec - IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - CorebootModulePkg/CorebootModulePkg.dec - -[LibraryClasses] - UefiDriverEntryPoint - UefiBootServicesTableLib - DxeServicesTableLib - DebugLib - BaseMemoryLib - UefiLib - HobLib - -[Guids] - gEfiAcpiTableGuid - gEfiSmbiosTableGuid - gUefiSystemTableInfoGuid - gUefiAcpiBoardInfoGuid - gUefiFrameBufferInfoGuid - -[Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution - gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution - gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution - gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution - -[Depex] - TRUE diff --git a/CorebootModulePkg/CbSupportPei/CbSupportPei.c b/CorebootModule= Pkg/CbSupportPei/CbSupportPei.c deleted file mode 100755 index bdb2faa0b6..0000000000 --- a/CorebootModulePkg/CbSupportPei/CbSupportPei.c +++ /dev/null @@ -1,440 +0,0 @@ -/** @file - This PEIM will parse coreboot table in memory and report resource inform= ation into pei core. - This file contains the main entrypoint of the PEIM. - -Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ -#include "CbSupportPei.h" - -#define LEGACY_8259_MASK_REGISTER_MASTER 0x21 -#define LEGACY_8259_MASK_REGISTER_SLAVE 0xA1 - -EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] =3D { - { EfiACPIReclaimMemory, FixedPcdGet32 (PcdMemoryTypeEfiACPIReclaimMemo= ry) }, - { EfiACPIMemoryNVS, FixedPcdGet32 (PcdMemoryTypeEfiACPIMemoryNVS) = }, - { EfiReservedMemoryType, FixedPcdGet32 (PcdMemoryTypeEfiReservedMemoryT= ype) }, - { EfiRuntimeServicesData, FixedPcdGet32 (PcdMemoryTypeEfiRuntimeServices= Data) }, - { EfiRuntimeServicesCode, FixedPcdGet32 (PcdMemoryTypeEfiRuntimeServices= Code) }, - { EfiMaxMemoryType, 0 } -}; - -EFI_PEI_PPI_DESCRIPTOR mPpiBootMode[] =3D { - { - EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST, - &gEfiPeiMasterBootModePpiGuid, - NULL - } -}; - -/** - Create memory mapped io resource hob. - - @param MmioBase Base address of the memory mapped io range - @param MmioSize Length of the memory mapped io range - -**/ -VOID -BuildMemoryMappedIoRangeHob ( - EFI_PHYSICAL_ADDRESS MmioBase, - UINT64 MmioSize - ) -{ - BuildResourceDescriptorHob ( - EFI_RESOURCE_MEMORY_MAPPED_IO, - (EFI_RESOURCE_ATTRIBUTE_PRESENT | - EFI_RESOURCE_ATTRIBUTE_INITIALIZED | - EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | - EFI_RESOURCE_ATTRIBUTE_TESTED), - MmioBase, - MmioSize - ); - - BuildMemoryAllocationHob ( - MmioBase, - MmioSize, - EfiMemoryMappedIO - ); -} - -/** - Check the integrity of firmware volume header - - @param[in] FwVolHeader A pointer to a firmware volume header - - @retval TRUE The firmware volume is consistent - @retval FALSE The firmware volume has corrupted. - -**/ -STATIC -BOOLEAN -IsFvHeaderValid ( - IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader - ) -{ - UINT16 Checksum; - - // Skip nv storage fv - if (CompareMem (&FwVolHeader->FileSystemGuid, &gEfiFirmwareFileSystem2Gu= id, sizeof(EFI_GUID)) !=3D 0 ) { - return FALSE; - } - - if ( (FwVolHeader->Revision !=3D EFI_FVH_REVISION) || - (FwVolHeader->Signature !=3D EFI_FVH_SIGNATURE) || - (FwVolHeader->FvLength =3D=3D ((UINTN) -1)) || - ((FwVolHeader->HeaderLength & 0x01 ) !=3D0) ) { - return FALSE; - } - - Checksum =3D CalculateCheckSum16 ((UINT16 *) FwVolHeader, FwVolHeader->H= eaderLength); - if (Checksum !=3D 0) { - DEBUG (( DEBUG_ERROR, - "ERROR - Invalid Firmware Volume Header Checksum, change 0x%= 04x to 0x%04x\r\n", - FwVolHeader->Checksum, - (UINT16)( Checksum + FwVolHeader->Checksum ))); - return FALSE; - } - - return TRUE; -} - -/** - Install FvInfo PPI and create fv hobs for remained fvs - -**/ -VOID -CbPeiReportRemainedFvs ( - VOID - ) -{ - UINT8* TempPtr; - UINT8* EndPtr; - - TempPtr =3D (UINT8* )(UINTN) PcdGet32 (PcdPayloadFdMemBase); - EndPtr =3D (UINT8* )(UINTN) (PcdGet32 (PcdPayloadFdMemBase) + PcdGet32 (= PcdPayloadFdMemSize)); - - for (;TempPtr < EndPtr;) { - if (IsFvHeaderValid ((EFI_FIRMWARE_VOLUME_HEADER* )TempPtr)) { - if (TempPtr !=3D (UINT8* )(UINTN) PcdGet32 (PcdPayloadFdMemBase)) { - // Skip the PEI FV - DEBUG((EFI_D_ERROR, "Found one valid fv : 0x%lx.\n", TempPtr, ((EF= I_FIRMWARE_VOLUME_HEADER* )TempPtr)->FvLength)); - - PeiServicesInstallFvInfoPpi ( - NULL, - (VOID *) (UINTN) TempPtr, - (UINT32) (UINTN) ((EFI_FIRMWARE_VOLUME_HEADER* )TempPtr)->FvLeng= th, - NULL, - NULL - ); - BuildFvHob ((EFI_PHYSICAL_ADDRESS)(UINTN) TempPtr, ((EFI_FIRMWARE_= VOLUME_HEADER* )TempPtr)->FvLength); - } - } - TempPtr +=3D ((EFI_FIRMWARE_VOLUME_HEADER* )TempPtr)->FvLength; - } -} - -/** - Based on memory base, size and type, build resource descripter HOB. - - @param Base Memory base address. - @param Size Memory size. - @param Type Memory type. - @param Param A pointer to CB_MEM_INFO. - - @retval EFI_SUCCESS if it completed successfully. -**/ -EFI_STATUS -CbMemInfoCallback ( - UINT64 Base, - UINT64 Size, - UINT32 Type, - VOID *Param - ) -{ - CB_MEM_INFO *MemInfo; - UINTN Attribue; - - Attribue =3D EFI_RESOURCE_ATTRIBUTE_PRESENT | - EFI_RESOURCE_ATTRIBUTE_INITIALIZED | - EFI_RESOURCE_ATTRIBUTE_TESTED | - EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | - EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE | - EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE | - EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE; - - if ((Base < 0x100000) && ((Base + Size) > 0x100000)) { - Size -=3D (0x100000 - Base); - Base =3D 0x100000; - } - - MemInfo =3D (CB_MEM_INFO *)Param; - if (Base >=3D 0x100000) { - if (Type =3D=3D CB_MEM_RAM) { - if (Base < 0x100000000ULL) { - MemInfo->UsableLowMemTop =3D (UINT32)(Base + Size); - } else { - Attribue &=3D ~EFI_RESOURCE_ATTRIBUTE_TESTED; - } - BuildResourceDescriptorHob ( - EFI_RESOURCE_SYSTEM_MEMORY, - Attribue, - (EFI_PHYSICAL_ADDRESS)Base, - Size - ); - } else if (Type =3D=3D CB_MEM_TABLE) { - BuildResourceDescriptorHob ( - EFI_RESOURCE_MEMORY_RESERVED, - Attribue, - (EFI_PHYSICAL_ADDRESS)Base, - Size - ); - MemInfo->SystemLowMemTop =3D ((UINT32)(Base + Size) + 0x0FFFFFFF) & = 0xF0000000; - } else if (Type =3D=3D CB_MEM_RESERVED) { - if ((MemInfo->SystemLowMemTop =3D=3D 0) || (Base < MemInfo->SystemLo= wMemTop)) { - BuildResourceDescriptorHob ( - EFI_RESOURCE_MEMORY_RESERVED, - Attribue, - (EFI_PHYSICAL_ADDRESS)Base, - Size - );=20 - } - } - } - =20 - return EFI_SUCCESS; -} - -/** - This is the entrypoint of PEIM - - @param FileHandle Handle of the file being invoked. - @param PeiServices Describes the list of possible PEI Services. - - @retval EFI_SUCCESS if it completed successfully. -**/ -EFI_STATUS -EFIAPI -CbPeiEntryPoint ( - IN EFI_PEI_FILE_HANDLE FileHandle, - IN CONST EFI_PEI_SERVICES **PeiServices - ) -{ - EFI_STATUS Status; - UINT64 LowMemorySize; - UINT64 PeiMemSize =3D SIZE_64MB; // 64 MB - EFI_PHYSICAL_ADDRESS PeiMemBase =3D 0; - UINT32 RegEax; - UINT8 PhysicalAddressBits; - VOID* pCbHeader; - VOID* pAcpiTable; - UINT32 AcpiTableSize; - VOID* pSmbiosTable; - UINT32 SmbiosTableSize; - SYSTEM_TABLE_INFO* pSystemTableInfo; - FRAME_BUFFER_INFO FbInfo; - FRAME_BUFFER_INFO* pFbInfo; - ACPI_BOARD_INFO* pAcpiBoardInfo; - UINTN PmCtrlRegBase, PmTimerRegBase, ResetRegAddress, Res= etValue; - UINTN PmEvtBase; - UINTN PmGpeEnBase; - CB_MEM_INFO CbMemInfo; - - // - // Report lower 640KB of RAM. Attribute EFI_RESOURCE_ATTRIBUTE_TESTED =20 - // is intentionally omitted to prevent erasing of the coreboot header =20 - // record before it is processed by CbParseMemoryInfo. - // - BuildResourceDescriptorHob ( - EFI_RESOURCE_SYSTEM_MEMORY, - ( - EFI_RESOURCE_ATTRIBUTE_PRESENT | - EFI_RESOURCE_ATTRIBUTE_INITIALIZED | - EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | - EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE | - EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE | - EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE - ), - (EFI_PHYSICAL_ADDRESS)(0), - (UINT64)(0xA0000) - ); - - - BuildResourceDescriptorHob ( - EFI_RESOURCE_MEMORY_RESERVED, - ( - EFI_RESOURCE_ATTRIBUTE_PRESENT | - EFI_RESOURCE_ATTRIBUTE_INITIALIZED | - EFI_RESOURCE_ATTRIBUTE_TESTED | - EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | - EFI_RESOURCE_ATTRIBUTE_WRITE_COMBINEABLE | - EFI_RESOURCE_ATTRIBUTE_WRITE_THROUGH_CACHEABLE | - EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE - ), - (EFI_PHYSICAL_ADDRESS)(0xA0000), - (UINT64)(0x60000) - ); - - ZeroMem (&CbMemInfo, sizeof(CbMemInfo)); - Status =3D CbParseMemoryInfo (CbMemInfoCallback, (VOID *)&CbMemInfo); - if (EFI_ERROR(Status)) { - return Status; - } - - LowMemorySize =3D CbMemInfo.UsableLowMemTop; - DEBUG ((EFI_D_INFO, "Low memory 0x%lx\n", LowMemorySize)); - DEBUG ((EFI_D_INFO, "SystemLowMemTop 0x%x\n", CbMemInfo.SystemLowMemTop)= ); - - // - // Should be 64k aligned - // - PeiMemBase =3D (LowMemorySize - PeiMemSize) & (~(BASE_64KB - 1)); - - DEBUG((EFI_D_ERROR, "PeiMemBase: 0x%lx.\n", PeiMemBase)); - DEBUG((EFI_D_ERROR, "PeiMemSize: 0x%lx.\n", PeiMemSize)); - - Status =3D PeiServicesInstallPeiMemory ( - PeiMemBase, - PeiMemSize - ); - ASSERT_EFI_ERROR (Status); - - // - // Set cache on the physical memory - // - MtrrSetMemoryAttribute (BASE_1MB, LowMemorySize - BASE_1MB, CacheWriteBa= ck); - MtrrSetMemoryAttribute (0, 0xA0000, CacheWriteBack); - - // - // Create Memory Type Information HOB - // - BuildGuidDataHob ( - &gEfiMemoryTypeInformationGuid, - mDefaultMemoryTypeInformation, - sizeof(mDefaultMemoryTypeInformation) - ); - - // - // Create Fv hob - // - CbPeiReportRemainedFvs (); - - BuildMemoryAllocationHob ( - PcdGet32 (PcdPayloadFdMemBase), - PcdGet32 (PcdPayloadFdMemSize), - EfiBootServicesData - ); - - // - // Build CPU memory space and IO space hob - // - AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL); - if (RegEax >=3D 0x80000008) { - AsmCpuid (0x80000008, &RegEax, NULL, NULL, NULL); - PhysicalAddressBits =3D (UINT8) RegEax; - } else { - PhysicalAddressBits =3D 36; - } - // - // Create a CPU hand-off information - // - BuildCpuHob (PhysicalAddressBits, 16); - - // - // Report Local APIC range - // - BuildMemoryMappedIoRangeHob (0xFEC80000, SIZE_512KB); - - // - // Boot mode - // - Status =3D PeiServicesSetBootMode (BOOT_WITH_FULL_CONFIGURATION); - ASSERT_EFI_ERROR (Status); - - Status =3D PeiServicesInstallPpi (mPpiBootMode); - ASSERT_EFI_ERROR (Status); - - // - // Set pcd to save the upper coreboot header in case the dxecore will - // erase 0~4k memory - // - pCbHeader =3D NULL; - if ((CbParseGetCbHeader (1, &pCbHeader) =3D=3D RETURN_SUCCESS) - && ((UINTN)pCbHeader > BASE_4KB)) { - DEBUG((EFI_D_ERROR, "Actual Coreboot header: %p.\n", pCbHeader)); - Status =3D PcdSet32S (PcdCbHeaderPointer, (UINT32)(UINTN)pCbHeader); - ASSERT_EFI_ERROR (Status); - } - - // - // Create guid hob for system tables like acpi table and smbios table - // - pAcpiTable =3D NULL; - AcpiTableSize =3D 0; - pSmbiosTable =3D NULL; - SmbiosTableSize =3D 0; - Status =3D CbParseAcpiTable (&pAcpiTable, &AcpiTableSize); - if (EFI_ERROR (Status)) { - // ACPI table is oblidgible - DEBUG ((EFI_D_ERROR, "Failed to find the required acpi table\n")); - ASSERT (FALSE); - } - CbParseSmbiosTable (&pSmbiosTable, &SmbiosTableSize); - - pSystemTableInfo =3D NULL; - pSystemTableInfo =3D BuildGuidHob (&gUefiSystemTableInfoGuid, sizeof (SY= STEM_TABLE_INFO)); - ASSERT (pSystemTableInfo !=3D NULL); - pSystemTableInfo->AcpiTableBase =3D (UINT64) (UINTN)pAcpiTable; - pSystemTableInfo->AcpiTableSize =3D AcpiTableSize; - pSystemTableInfo->SmbiosTableBase =3D (UINT64) (UINTN)pSmbiosTable; - pSystemTableInfo->SmbiosTableSize =3D SmbiosTableSize; - DEBUG ((EFI_D_ERROR, "Detected Acpi Table at 0x%lx, length 0x%x\n", pSys= temTableInfo->AcpiTableBase, pSystemTableInfo->AcpiTableSize)); - DEBUG ((EFI_D_ERROR, "Detected Smbios Table at 0x%lx, length 0x%x\n", pS= ystemTableInfo->SmbiosTableBase, pSystemTableInfo->SmbiosTableSize)); - DEBUG ((EFI_D_ERROR, "Create system table info guid hob\n")); - - // - // Create guid hob for acpi board information - // - Status =3D CbParseFadtInfo (&PmCtrlRegBase, &PmTimerRegBase, &ResetRegAd= dress, &ResetValue, &PmEvtBase, &PmGpeEnBase); - ASSERT_EFI_ERROR (Status); - pAcpiBoardInfo =3D NULL; - pAcpiBoardInfo =3D BuildGuidHob (&gUefiAcpiBoardInfoGuid, sizeof (ACPI_B= OARD_INFO)); - ASSERT (pAcpiBoardInfo !=3D NULL); - pAcpiBoardInfo->PmCtrlRegBase =3D (UINT64)PmCtrlRegBase; - pAcpiBoardInfo->PmTimerRegBase =3D (UINT64)PmTimerRegBase; - pAcpiBoardInfo->ResetRegAddress =3D (UINT64)ResetRegAddress; - pAcpiBoardInfo->ResetValue =3D (UINT8)ResetValue; - pAcpiBoardInfo->PmEvtBase =3D (UINT64)PmEvtBase; - pAcpiBoardInfo->PmGpeEnBase =3D (UINT64)PmGpeEnBase; - DEBUG ((EFI_D_ERROR, "Create acpi board info guid hob\n")); - - // - // Create guid hob for frame buffer information - // - ZeroMem (&FbInfo, sizeof (FRAME_BUFFER_INFO)); - Status =3D CbParseFbInfo (&FbInfo); - if (!EFI_ERROR (Status)) { - pFbInfo =3D BuildGuidHob (&gUefiFrameBufferInfoGuid, sizeof (FRAME_BUF= FER_INFO)); - ASSERT (pSystemTableInfo !=3D NULL); - CopyMem (pFbInfo, &FbInfo, sizeof (FRAME_BUFFER_INFO)); - DEBUG ((EFI_D_ERROR, "Create frame buffer info guid hob\n")); - } - - // - // Parse platform specific information from coreboot.=20 - // - Status =3D CbParsePlatformInfo (); - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Error when parsing platform info, Status =3D %r\= n", Status)); - return Status; - } - - // - // Mask off all legacy 8259 interrupt sources - // - IoWrite8 (LEGACY_8259_MASK_REGISTER_MASTER, 0xFF); - IoWrite8 (LEGACY_8259_MASK_REGISTER_SLAVE, 0xFF); - - return EFI_SUCCESS; -} - diff --git a/CorebootModulePkg/CbSupportPei/CbSupportPei.h b/CorebootModule= Pkg/CbSupportPei/CbSupportPei.h deleted file mode 100644 index 2a0e897387..0000000000 --- a/CorebootModulePkg/CbSupportPei/CbSupportPei.h +++ /dev/null @@ -1,42 +0,0 @@ -/** @file - The header file of Coreboot Support PEIM. - -Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - - -#ifndef __PEI_COREBOOT_SUPPORT_H__ -#define __PEI_COREBOOT_SUPPORT_H__ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include "Coreboot.h" - -typedef struct { - UINT32 UsableLowMemTop; - UINT32 SystemLowMemTop; -} CB_MEM_INFO; - -#endif diff --git a/CorebootModulePkg/CbSupportPei/CbSupportPei.inf b/CorebootModu= lePkg/CbSupportPei/CbSupportPei.inf deleted file mode 100644 index 4cf6f70ead..0000000000 --- a/CorebootModulePkg/CbSupportPei/CbSupportPei.inf +++ /dev/null @@ -1,74 +0,0 @@ -## @file -# Coreboot Support PEI Module -# -# Parses coreboot table in memory and report resource information into pei= core. It will install -# the memory as required. -# -# Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
-# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D CbSupportPeim - FILE_GUID =3D 352C6AF8-315B-4bd6-B04F-31D4ED1EBE57 - MODULE_TYPE =3D PEIM - VERSION_STRING =3D 1.0 - ENTRY_POINT =3D CbPeiEntryPoint - -# -# The following information is for reference only and not required by the = build tools. -# -# VALID_ARCHITECTURES =3D IA32 X64 -# - -[Sources] - CbSupportPei.c - CbSupportPei.h - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - IntelFrameworkPkg/IntelFrameworkPkg.dec - IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - CorebootModulePkg/CorebootModulePkg.dec - UefiCpuPkg/UefiCpuPkg.dec - -[LibraryClasses] - PeimEntryPoint - PeiServicesLib - BaseLib - BaseMemoryLib - DebugLib - HobLib - PcdLib - CbParseLib - MtrrLib - IoLib - CbPlatformSupportLib - -[Guids] - gEfiSmmPeiSmramMemoryReserveGuid - gEfiMemoryTypeInformationGuid - gEfiFirmwareFileSystem2Guid - gUefiSystemTableInfoGuid - gUefiFrameBufferInfoGuid - gUefiAcpiBoardInfoGuid - -[Ppis] - gEfiPeiMasterBootModePpiGuid - -[Pcd] - gUefiCorebootModulePkgTokenSpaceGuid.PcdPayloadFdMemBase - gUefiCorebootModulePkgTokenSpaceGuid.PcdPayloadFdMemSize - gUefiCorebootModulePkgTokenSpaceGuid.PcdCbHeaderPointer - gUefiCorebootModulePkgTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory - gUefiCorebootModulePkgTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS - gUefiCorebootModulePkgTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType - gUefiCorebootModulePkgTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData - gUefiCorebootModulePkgTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode - -[Depex] - TRUE \ No newline at end of file diff --git a/CorebootModulePkg/CorebootModulePkg.dec b/CorebootModulePkg/Co= rebootModulePkg.dec deleted file mode 100644 index 79661f1da5..0000000000 --- a/CorebootModulePkg/CorebootModulePkg.dec +++ /dev/null @@ -1,59 +0,0 @@ -## @file -# Coreboot Support Package -# -# Provides drivers and definitions to support coreboot in EDKII bios. -# -# Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - DEC_SPECIFICATION =3D 0x00010005 - PACKAGE_NAME =3D CorebootModulePkg - PACKAGE_GUID =3D DE1750CE-FEE7-4dd1-8E9C-B7B8BAEBCF4F - PACKAGE_VERSION =3D 0.1 - -[Includes] - Include - -[LibraryClasses] - CbParseLib|Include/Library/CbParseLib.h - -[Guids] - # - ## Defines the token space for the Coreboot Module Package PCDs. - # - gUefiCorebootModulePkgTokenSpaceGuid =3D {0xe6ff49a0, 0x15df, 0x48fd, {= 0x9a, 0xcf, 0xd7, 0xdc, 0x27, 0x1b, 0x39, 0xd5}} - gUefiSystemTableInfoGuid =3D {0x16c8a6d0, 0xfe8a, 0x4082, {0xa2, 0x8, 0x= cf, 0x89, 0xc4, 0x29, 0x4, 0x33}} - gUefiFrameBufferInfoGuid =3D {0xdc2cd8bd, 0x402c, 0x4dc4, {0x9b, 0xe0, 0= xc, 0x43, 0x2b, 0x7, 0xfa, 0x34}} - gUefiAcpiBoardInfoGuid =3D {0xad3d31b, 0xb3d8, 0x4506, {0xae, 0x71, 0x= 2e, 0xf1, 0x10, 0x6, 0xd9, 0xf}} - - -[Ppis] - -[Protocols] - - -##########################################################################= ###### -# -# PCD Declarations section - list of all PCDs Declared by this Package -# Only this package should be providing the -# declaration, other packages should not. -# -##########################################################################= ###### -[PcdsFixedAtBuild, PcdsPatchableInModule] -## Indicates the base address of the payload binary in memory -gUefiCorebootModulePkgTokenSpaceGuid.PcdPayloadFdMemBase|0|UINT32|0x100000= 01 -## Provides the size of the payload binary in memory -gUefiCorebootModulePkgTokenSpaceGuid.PcdPayloadFdMemSize|0|UINT32|0x100000= 02 -## Used to help reduce fragmentation in the EFI memory map -gUefiCorebootModulePkgTokenSpaceGuid.PcdMemoryTypeEfiACPIReclaimMemory|0x0= 8|UINT32|0x10000012 -gUefiCorebootModulePkgTokenSpaceGuid.PcdMemoryTypeEfiACPIMemoryNVS|0x04|UI= NT32|0x10000013 -gUefiCorebootModulePkgTokenSpaceGuid.PcdMemoryTypeEfiReservedMemoryType|0x= 04|UINT32|0x00000014 -gUefiCorebootModulePkgTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesData|0= xC0|UINT32|0x00000015 -gUefiCorebootModulePkgTokenSpaceGuid.PcdMemoryTypeEfiRuntimeServicesCode|0= x80|UINT32|0x00000016 - -[PcdsDynamicEx] -gUefiCorebootModulePkgTokenSpaceGuid.PcdCbHeaderPointer|0|UINT32|0x10000003 - diff --git a/CorebootModulePkg/Include/Coreboot.h b/CorebootModulePkg/Inclu= de/Coreboot.h deleted file mode 100644 index ff384321db..0000000000 --- a/CorebootModulePkg/Include/Coreboot.h +++ /dev/null @@ -1,249 +0,0 @@ -/** @file - Coreboot PEI module include file. - - Copyright (c) 2014 - 2015, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -/* - * This file is part of the libpayload project. - * - * Copyright (C) 2008 Advanced Micro Devices, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURP= OSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENT= IAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STR= ICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY W= AY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - - -#ifndef _COREBOOT_PEI_H_INCLUDED_ -#define _COREBOOT_PEI_H_INCLUDED_ - -#if defined(_MSC_VER) -#pragma warning( disable : 4200 ) -#endif - -#define DYN_CBMEM_ALIGN_SIZE (4096) - -#define IMD_ENTRY_MAGIC (~0xC0389481) -#define CBMEM_ENTRY_MAGIC (~0xC0389479) - -struct cbmem_entry { - UINT32 magic; - UINT32 start; - UINT32 size; - UINT32 id; -}; - -struct cbmem_root { - UINT32 max_entries; - UINT32 num_entries; - UINT32 locked; - UINT32 size; - struct cbmem_entry entries[0]; -}; - -struct imd_entry { - UINT32 magic; - UINT32 start_offset; - UINT32 size; - UINT32 id; -}; - -struct imd_root { - UINT32 max_entries; - UINT32 num_entries; - UINT32 flags; - UINT32 entry_align; - UINT32 max_offset; - struct imd_entry entries[0]; -}; - -struct cbuint64 { - UINT32 lo; - UINT32 hi; -}; - -#define CB_HEADER_SIGNATURE 0x4F49424C - -struct cb_header { - UINT32 signature; - UINT32 header_bytes; - UINT32 header_checksum; - UINT32 table_bytes; - UINT32 table_checksum; - UINT32 table_entries; -}; - -struct cb_record { - UINT32 tag; - UINT32 size; -}; - -#define CB_TAG_UNUSED 0x0000 -#define CB_TAG_MEMORY 0x0001 - -struct cb_memory_range { - struct cbuint64 start; - struct cbuint64 size; - UINT32 type; -}; - -#define CB_MEM_RAM 1 -#define CB_MEM_RESERVED 2 -#define CB_MEM_ACPI 3 -#define CB_MEM_NVS 4 -#define CB_MEM_UNUSABLE 5 -#define CB_MEM_VENDOR_RSVD 6 -#define CB_MEM_TABLE 16 - -struct cb_memory { - UINT32 tag; - UINT32 size; - struct cb_memory_range map[0]; -}; - -#define CB_TAG_MAINBOARD 0x0003 - -struct cb_mainboard { - UINT32 tag; - UINT32 size; - UINT8 vendor_idx; - UINT8 part_number_idx; - UINT8 strings[0]; -}; -#define CB_TAG_VERSION 0x0004 -#define CB_TAG_EXTRA_VERSION 0x0005 -#define CB_TAG_BUILD 0x0006 -#define CB_TAG_COMPILE_TIME 0x0007 -#define CB_TAG_COMPILE_BY 0x0008 -#define CB_TAG_COMPILE_HOST 0x0009 -#define CB_TAG_COMPILE_DOMAIN 0x000a -#define CB_TAG_COMPILER 0x000b -#define CB_TAG_LINKER 0x000c -#define CB_TAG_ASSEMBLER 0x000d - -struct cb_string { - UINT32 tag; - UINT32 size; - UINT8 string[0]; -}; - -#define CB_TAG_SERIAL 0x000f - -struct cb_serial { - UINT32 tag; - UINT32 size; -#define CB_SERIAL_TYPE_IO_MAPPED 1 -#define CB_SERIAL_TYPE_MEMORY_MAPPED 2 - UINT32 type; - UINT32 baseaddr; - UINT32 baud; - UINT32 regwidth; - - // Crystal or input frequency to the chip containing the UART. - // Provide the board specific details to allow the payload to - // initialize the chip containing the UART and make independent - // decisions as to which dividers to select and their values - // to eventually arrive at the desired console baud-rate. - UINT32 input_hertz; - - // UART PCI address: bus, device, function - // 1 << 31 - Valid bit, PCI UART in use - // Bus << 20 - // Device << 15 - // Function << 12 - UINT32 uart_pci_addr; -}; - -#define CB_TAG_CONSOLE 0x00010 - -struct cb_console { - UINT32 tag; - UINT32 size; - UINT16 type; -}; - -#define CB_TAG_CONSOLE_SERIAL8250 0 -#define CB_TAG_CONSOLE_VGA 1 // OBSOLETE -#define CB_TAG_CONSOLE_BTEXT 2 // OBSOLETE -#define CB_TAG_CONSOLE_LOGBUF 3 -#define CB_TAG_CONSOLE_SROM 4 // OBSOLETE -#define CB_TAG_CONSOLE_EHCI 5 - -#define CB_TAG_FORWARD 0x00011 - -struct cb_forward { - UINT32 tag; - UINT32 size; - UINT64 forward; -}; - -#define CB_TAG_FRAMEBUFFER 0x0012 -struct cb_framebuffer { - UINT32 tag; - UINT32 size; - - UINT64 physical_address; - UINT32 x_resolution; - UINT32 y_resolution; - UINT32 bytes_per_line; - UINT8 bits_per_pixel; - UINT8 red_mask_pos; - UINT8 red_mask_size; - UINT8 green_mask_pos; - UINT8 green_mask_size; - UINT8 blue_mask_pos; - UINT8 blue_mask_size; - UINT8 reserved_mask_pos; - UINT8 reserved_mask_size; -}; - -#define CB_TAG_VDAT 0x0015 -struct cb_vdat { - UINT32 tag; - UINT32 size; /* size of the entire entry */ - UINT64 vdat_addr; - UINT32 vdat_size; -}; - -#define CB_TAG_TIMESTAMPS 0x0016 -#define CB_TAG_CBMEM_CONSOLE 0x0017 -#define CB_TAG_MRC_CACHE 0x0018 -struct cb_cbmem_tab { - UINT32 tag; - UINT32 size; - UINT64 cbmem_tab; -}; - -/* Helpful macros */ - -#define MEM_RANGE_COUNT(_rec) \ - (((_rec)->size - sizeof(*(_rec))) / sizeof((_rec)->map[0])) - -#define MEM_RANGE_PTR(_rec, _idx) \ - (void *)(((UINT8 *) (_rec)) + sizeof(*(_rec)) \ - + (sizeof((_rec)->map[0]) * (_idx))) - - -#endif // _COREBOOT_PEI_H_INCLUDED_ diff --git a/CorebootModulePkg/Include/Guid/AcpiBoardInfoGuid.h b/CorebootM= odulePkg/Include/Guid/AcpiBoardInfoGuid.h deleted file mode 100644 index b40cf9529d..0000000000 --- a/CorebootModulePkg/Include/Guid/AcpiBoardInfoGuid.h +++ /dev/null @@ -1,26 +0,0 @@ -/** @file - This file defines the hob structure for board related information from a= cpi table - =20 - Copyright (c) 2014, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#ifndef __ACPI_BOARD_INFO_GUID_H__ -#define __ACPI_BOARD_INFO_GUID_H__ - -/// -/// Board information GUID -/// -extern EFI_GUID gUefiAcpiBoardInfoGuid; - -typedef struct { - UINT64 PmEvtBase; - UINT64 PmGpeEnBase; - UINT64 PmCtrlRegBase; - UINT64 PmTimerRegBase; - UINT64 ResetRegAddress; - UINT8 ResetValue; =20 -} ACPI_BOARD_INFO; - =20 -#endif diff --git a/CorebootModulePkg/Include/Guid/FrameBufferInfoGuid.h b/Coreboo= tModulePkg/Include/Guid/FrameBufferInfoGuid.h deleted file mode 100644 index 772f0c0508..0000000000 --- a/CorebootModulePkg/Include/Guid/FrameBufferInfoGuid.h +++ /dev/null @@ -1,34 +0,0 @@ -/** @file - This file defines the hob structure for frame buffer device. - =20 - Copyright (c) 2014, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#ifndef __FRAME_BUFFER_INFO_GUID_H__ -#define __FRAME_BUFFER_INFO_GUID_H__ - -/// -/// Frame Buffer Information GUID -/// -extern EFI_GUID gUefiFrameBufferInfoGuid; - -typedef struct { - UINT8 Position; // Position of the color - UINT8 Mask; // The number of bits expressed as a mask -} COLOR_PLACEMENT; - -typedef struct { =20 - UINT64 LinearFrameBuffer; =20 - UINT32 HorizontalResolution; - UINT32 VerticalResolution; - UINT32 BitsPerPixel; - UINT16 BytesPerScanLine; - COLOR_PLACEMENT Red; - COLOR_PLACEMENT Green; - COLOR_PLACEMENT Blue; - COLOR_PLACEMENT Reserved; -} FRAME_BUFFER_INFO; =20 - =20 -#endif diff --git a/CorebootModulePkg/Include/Guid/SystemTableInfoGuid.h b/Coreboo= tModulePkg/Include/Guid/SystemTableInfoGuid.h deleted file mode 100644 index 8c47db429a..0000000000 --- a/CorebootModulePkg/Include/Guid/SystemTableInfoGuid.h +++ /dev/null @@ -1,24 +0,0 @@ -/** @file - This file defines the hob structure for system tables like ACPI, SMBIOS = tables. - =20 - Copyright (c) 2014, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#ifndef __SYSTEM_TABLE_INFO_GUID_H__ -#define __SYSTEM_TABLE_INFO_GUID_H__ - -/// -/// System Table Information GUID -/// -extern EFI_GUID gUefiSystemTableInfoGuid; - -typedef struct { =20 - UINT64 AcpiTableBase; - UINT32 AcpiTableSize; =20 - UINT64 SmbiosTableBase; =20 - UINT32 SmbiosTableSize; =20 -} SYSTEM_TABLE_INFO; =20 - =20 -#endif diff --git a/CorebootModulePkg/Include/Library/CbParseLib.h b/CorebootModul= ePkg/Include/Library/CbParseLib.h deleted file mode 100644 index 1312410ccc..0000000000 --- a/CorebootModulePkg/Include/Library/CbParseLib.h +++ /dev/null @@ -1,186 +0,0 @@ -/** @file - This library will parse the coreboot table in memory and extract those r= equired - information. - - Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ -#include - -typedef RETURN_STATUS \ - (*CB_MEM_INFO_CALLBACK) (UINT64 Base, UINT64 Size, UINT32 Type, VO= ID *Param); - -/** - Find coreboot record with given Tag from the memory Start in 4096 - bytes range. - - @param Start The start memory to be searched in - @param Tag The tag id to be found - - @retval NULL The Tag is not found. - @retval Others The pointer to the record found. - -**/ -VOID * -EFIAPI -FindCbTag ( - IN VOID *Start, - IN UINT32 Tag - ); - -/** - Acquire the memory information from the coreboot table in memory. - - @param MemInfoCallback The callback routine - @param pParam Pointer to the callback routine parameter - - @retval RETURN_SUCCESS Successfully find out the memory information. - @retval RETURN_NOT_FOUND Failed to find the memory information. - -**/ -RETURN_STATUS -EFIAPI -CbParseMemoryInfo ( - IN CB_MEM_INFO_CALLBACK MemInfoCallback, - IN VOID *pParam - ); - -/** - Acquire the coreboot memory table with the given table id - - @param TableId Table id to be searched - @param pMemTable Pointer to the base address of the memory tab= le - @param pMemTableSize Pointer to the size of the memory table - - @retval RETURN_SUCCESS Successfully find out the memory table. - @retval RETURN_INVALID_PARAMETER Invalid input parameters. - @retval RETURN_NOT_FOUND Failed to find the memory table. - -**/ -RETURN_STATUS -EFIAPI -CbParseCbMemTable ( - IN UINT32 TableId, - IN VOID** pMemTable, - IN UINT32* pMemTableSize - ); - -/** - Acquire the acpi table from coreboot - - @param pMemTable Pointer to the base address of the memory tab= le - @param pMemTableSize Pointer to the size of the memory table - - @retval RETURN_SUCCESS Successfully find out the memory table. - @retval RETURN_INVALID_PARAMETER Invalid input parameters. - @retval RETURN_NOT_FOUND Failed to find the memory table. - -**/ -RETURN_STATUS -EFIAPI -CbParseAcpiTable ( - IN VOID** pMemTable, - IN UINT32* pMemTableSize - ); - -/** - Acquire the smbios table from coreboot - - @param pMemTable Pointer to the base address of the memory tab= le - @param pMemTableSize Pointer to the size of the memory table - - @retval RETURN_SUCCESS Successfully find out the memory table. - @retval RETURN_INVALID_PARAMETER Invalid input parameters. - @retval RETURN_NOT_FOUND Failed to find the memory table. - -**/ -RETURN_STATUS -EFIAPI -CbParseSmbiosTable ( - IN VOID** pMemTable, - IN UINT32* pMemTableSize - ); - -/** - Find the required fadt information - - @param pPmCtrlReg Pointer to the address of power management co= ntrol register - @param pPmTimerReg Pointer to the address of power management ti= mer register - @param pResetReg Pointer to the address of system reset regist= er - @param pResetValue Pointer to the value to be written to the sys= tem reset register - @param pPmEvtReg Pointer to the address of power management ev= ent register - @param pPmGpeEnReg Pointer to the address of power management GP= E enable register - - @retval RETURN_SUCCESS Successfully find out all the required fadt i= nformation. - @retval RETURN_NOT_FOUND Failed to find the fadt table. - -**/ -RETURN_STATUS -EFIAPI -CbParseFadtInfo ( - IN UINTN* pPmCtrlReg, - IN UINTN* pPmTimerReg, - IN UINTN* pResetReg, - IN UINTN* pResetValue, - IN UINTN* pPmEvtReg, - IN UINTN* pPmGpeEnReg - ); - -/** - Find the serial port information - - @param pRegBase Pointer to the base address of serial port re= gisters - @param pRegAccessType Pointer to the access type of serial port reg= isters - @param pRegWidth Pointer to the register width in bytes - @param pBaudrate Pointer to the serial port baudrate - @param pInputHertz Pointer to the input clock frequency - @param pUartPciAddr Pointer to the UART PCI bus, dev and func add= ress - - @retval RETURN_SUCCESS Successfully find the serial port information. - @retval RETURN_NOT_FOUND Failed to find the serial port information . - -**/ -RETURN_STATUS -EFIAPI -CbParseSerialInfo ( - OUT UINT32 *pRegBase, - OUT UINT32 *pRegAccessType, - OUT UINT32 *pRegWidth, - OUT UINT32 *pBaudrate, - OUT UINT32 *pInputHertz, - OUT UINT32 *pUartPciAddr - ); - -/** - Search for the coreboot table header - - @param Level Level of the search depth - @param HeaderPtr Pointer to the pointer of coreboot table head= er - - @retval RETURN_SUCCESS Successfully find the coreboot table header . - @retval RETURN_NOT_FOUND Failed to find the coreboot table header . - -**/ -RETURN_STATUS -EFIAPI -CbParseGetCbHeader ( - IN UINTN Level, - IN VOID** HeaderPtr - ); - -/** - Find the video frame buffer information - - @param pFbInfo Pointer to the FRAME_BUFFER_INFO structure - - @retval RETURN_SUCCESS Successfully find the video frame buffer info= rmation. - @retval RETURN_NOT_FOUND Failed to find the video frame buffer informa= tion . - -**/ -RETURN_STATUS -EFIAPI -CbParseFbInfo ( - IN FRAME_BUFFER_INFO* pFbInfo - ); - diff --git a/CorebootModulePkg/Include/Library/CbPlatformSupportLib.h b/Cor= ebootModulePkg/Include/Library/CbPlatformSupportLib.h deleted file mode 100644 index fc8c5c9dc9..0000000000 --- a/CorebootModulePkg/Include/Library/CbPlatformSupportLib.h +++ /dev/null @@ -1,28 +0,0 @@ -/** @file - Coreboot Platform Support library. Platform can provide an implementatio= n of this - library class to provide hooks that may be required for some type of=20 - platform features. - -Copyright (c) 2016, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#ifndef __CB_PLATFORM_SUPPORT_LIB__ -#define __CB_PLATFORM_SUPPORT_LIB__ - -/** - Parse platform specific information from coreboot.=20 - - @retval RETURN_SUCCESS The platform specific coreboot support succ= eeded. - @retval RETURN_DEVICE_ERROR The platform specific coreboot support coul= d not be completed. -=20 -**/ -EFI_STATUS -EFIAPI -CbParsePlatformInfo ( - VOID - ); - -#endif // __CB_PLATFORM_SUPPORT_LIB__ - diff --git a/CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSerialPor= tLib16550.c b/CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSerialPo= rtLib16550.c deleted file mode 100644 index 0717ffc279..0000000000 --- a/CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib165= 50.c +++ /dev/null @@ -1,1089 +0,0 @@ -/** @file - 16550 UART Serial Port library functions - - (C) Copyright 2014 Hewlett-Packard Development Company, L.P.
- Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include -#include -#include -#include -#include -#include -#include -#include - -// -// PCI Definitions. -// -#define PCI_BRIDGE_32_BIT_IO_SPACE 0x01 - -// -// 16550 UART register offsets and bitfields -// -#define R_UART_RXBUF 0 -#define R_UART_TXBUF 0 -#define R_UART_BAUD_LOW 0 -#define R_UART_BAUD_HIGH 1 -#define R_UART_FCR 2 -#define B_UART_FCR_FIFOE BIT0 -#define B_UART_FCR_FIFO64 BIT5 -#define R_UART_LCR 3 -#define B_UART_LCR_DLAB BIT7 -#define R_UART_MCR 4 -#define B_UART_MCR_DTRC BIT0 -#define B_UART_MCR_RTS BIT1 -#define R_UART_LSR 5 -#define B_UART_LSR_RXRDY BIT0 -#define B_UART_LSR_TXRDY BIT5 -#define B_UART_LSR_TEMT BIT6 -#define R_UART_MSR 6 -#define B_UART_MSR_CTS BIT4 -#define B_UART_MSR_DSR BIT5 -#define B_UART_MSR_RI BIT6 -#define B_UART_MSR_DCD BIT7 - -// -// 4-byte structure for each PCI node in PcdSerialPciDeviceInfo -// -typedef struct { - UINT8 Device; - UINT8 Function; - UINT16 PowerManagementStatusAndControlRegister; -} PCI_UART_DEVICE_INFO; - -/** - Read an 8-bit 16550 register. If PcdSerialUseMmio is TRUE, then the val= ue is read from - MMIO space. If PcdSerialUseMmio is FALSE, then the value is read from I= /O space. The - parameter Offset is added to the base address of the 16550 registers tha= t is specified - by PcdSerialRegisterBase. - - @param Base The base address register of UART device. - @param Offset The offset of the 16550 register to read. - - @return The value read from the 16550 register. - -**/ -UINT8 -SerialPortReadRegister ( - UINTN Base, - UINTN Offset - ) -{ - if (PcdGetBool (PcdSerialUseMmio)) { - return MmioRead8 (Base + Offset * PcdGet32 (PcdSerialRegisterStride)); - } else { - return IoRead8 (Base + Offset * PcdGet32 (PcdSerialRegisterStride)); - } -} - -/** - Write an 8-bit 16550 register. If PcdSerialUseMmio is TRUE, then the va= lue is written to - MMIO space. If PcdSerialUseMmio is FALSE, then the value is written to = I/O space. The - parameter Offset is added to the base address of the 16550 registers tha= t is specified - by PcdSerialRegisterBase. - - @param Base The base address register of UART device. - @param Offset The offset of the 16550 register to write. - @param Value The value to write to the 16550 register specified by Of= fset. - - @return The value written to the 16550 register. - -**/ -UINT8 -SerialPortWriteRegister ( - UINTN Base, - UINTN Offset, - UINT8 Value - ) -{ - if (PcdGetBool (PcdSerialUseMmio)) { - return MmioWrite8 (Base + Offset * PcdGet32 (PcdSerialRegisterStride),= Value); - } else { - return IoWrite8 (Base + Offset * PcdGet32 (PcdSerialRegisterStride), V= alue); - } -} - -/** - Update the value of an 16-bit PCI configuration register in a PCI device= . If the - PCI Configuration register specified by PciAddress is already programmed= with a - non-zero value, then return the current value. Otherwise update the PCI= configuration - register specified by PciAddress with the value specified by Value and r= eturn the - value programmed into the PCI configuration register. All values must b= e masked - using the bitmask specified by Mask. - - @param PciAddress PCI Library address of the PCI Configuration registe= r to update. - @param Value The value to program into the PCI Configuration Regi= ster. - @param Mask Bitmask of the bits to check and update in the PCI c= onfiguration register. - -**/ -UINT16 -SerialPortLibUpdatePciRegister16 ( - UINTN PciAddress, - UINT16 Value, - UINT16 Mask - ) -{ - UINT16 CurrentValue; - - CurrentValue =3D PciRead16 (PciAddress) & Mask; - if (CurrentValue !=3D 0) { - return CurrentValue; - } - return PciWrite16 (PciAddress, Value & Mask); -} - -/** - Update the value of an 32-bit PCI configuration register in a PCI device= . If the - PCI Configuration register specified by PciAddress is already programmed= with a - non-zero value, then return the current value. Otherwise update the PCI= configuration - register specified by PciAddress with the value specified by Value and r= eturn the - value programmed into the PCI configuration register. All values must b= e masked - using the bitmask specified by Mask. - - @param PciAddress PCI Library address of the PCI Configuration registe= r to update. - @param Value The value to program into the PCI Configuration Regi= ster. - @param Mask Bitmask of the bits to check and update in the PCI c= onfiguration register. - - @return The Secondary bus number that is actually programed into the PC= I to PCI Bridge device. - -**/ -UINT32 -SerialPortLibUpdatePciRegister32 ( - UINTN PciAddress, - UINT32 Value, - UINT32 Mask - ) -{ - UINT32 CurrentValue; - - CurrentValue =3D PciRead32 (PciAddress) & Mask; - if (CurrentValue !=3D 0) { - return CurrentValue; - } - return PciWrite32 (PciAddress, Value & Mask); -} - -/** - Retrieve the I/O or MMIO base address register for the PCI UART device. - - This function assumes Root Bus Numer is Zero, and enables I/O and MMIO i= n PCI UART - Device if they are not already enabled. - - @return The base address register of the UART device. - -**/ -UINTN -GetSerialRegisterBase ( - VOID - ) -{ - UINTN PciLibAddress; - UINTN BusNumber; - UINTN SubordinateBusNumber; - UINT32 ParentIoBase; - UINT32 ParentIoLimit; - UINT16 ParentMemoryBase; - UINT16 ParentMemoryLimit; - UINT32 IoBase; - UINT32 IoLimit; - UINT16 MemoryBase; - UINT16 MemoryLimit; - UINTN SerialRegisterBase; - UINTN BarIndex; - UINT32 RegisterBaseMask; - PCI_UART_DEVICE_INFO *DeviceInfo; - - // - // Get PCI Device Info - // - DeviceInfo =3D (PCI_UART_DEVICE_INFO *) PcdGetPtr (PcdSerialPciDeviceInf= o); - - // - // If PCI Device Info is empty, then assume fixed address UART and retur= n PcdSerialRegisterBase - // - if (DeviceInfo->Device =3D=3D 0xff) { - return (UINTN)PcdGet64 (PcdSerialRegisterBase); - } - - // - // Assume PCI Bus 0 I/O window is 0-64KB and MMIO windows is 0-4GB - // - ParentMemoryBase =3D 0 >> 16; - ParentMemoryLimit =3D 0xfff00000 >> 16; - ParentIoBase =3D 0 >> 12; - ParentIoLimit =3D 0xf000 >> 12; - - // - // Enable I/O and MMIO in PCI Bridge - // Assume Root Bus Numer is Zero. - // - for (BusNumber =3D 0; (DeviceInfo + 1)->Device !=3D 0xff; DeviceInfo++) { - // - // Compute PCI Lib Address to PCI to PCI Bridge - // - PciLibAddress =3D PCI_LIB_ADDRESS (BusNumber, DeviceInfo->Device, Devi= ceInfo->Function, 0); - - // - // Retrieve and verify the bus numbers in the PCI to PCI Bridge - // - BusNumber =3D PciRead8 (PciLibAddress + PCI_BRIDGE_SECONDAR= Y_BUS_REGISTER_OFFSET); - SubordinateBusNumber =3D PciRead8 (PciLibAddress + PCI_BRIDGE_SUBORDIN= ATE_BUS_REGISTER_OFFSET); - if (BusNumber =3D=3D 0 || BusNumber > SubordinateBusNumber) { - return 0; - } - - // - // Retrieve and verify the I/O or MMIO decode window in the PCI to PCI= Bridge - // - if (PcdGetBool (PcdSerialUseMmio)) { - MemoryLimit =3D PciRead16 (PciLibAddress + OFFSET_OF (PCI_TYPE01, Br= idge.MemoryLimit)) & 0xfff0; - MemoryBase =3D PciRead16 (PciLibAddress + OFFSET_OF (PCI_TYPE01, Br= idge.MemoryBase)) & 0xfff0; - - // - // If PCI Bridge MMIO window is disabled, then return 0 - // - if (MemoryLimit < MemoryBase) { - return 0; - } - - // - // If PCI Bridge MMIO window is not in the address range decoded by = the parent PCI Bridge, then return 0 - // - if (MemoryBase < ParentMemoryBase || MemoryBase > ParentMemoryLimit = || MemoryLimit > ParentMemoryLimit) { - return 0; - } - ParentMemoryBase =3D MemoryBase; - ParentMemoryLimit =3D MemoryLimit; - } else { - IoLimit =3D PciRead8 (PciLibAddress + OFFSET_OF (PCI_TYPE01, Bridge.= IoLimit)); - if ((IoLimit & PCI_BRIDGE_32_BIT_IO_SPACE ) =3D=3D 0) { - IoLimit =3D IoLimit >> 4; - } else { - IoLimit =3D (PciRead16 (PciLibAddress + OFFSET_OF (PCI_TYPE01, Bri= dge.IoLimitUpper16)) << 4) | (IoLimit >> 4); - } - IoBase =3D PciRead8 (PciLibAddress + OFFSET_OF (PCI_TYPE01, Bridge.I= oBase)); - if ((IoBase & PCI_BRIDGE_32_BIT_IO_SPACE ) =3D=3D 0) { - IoBase =3D IoBase >> 4; - } else { - IoBase =3D (PciRead16 (PciLibAddress + OFFSET_OF (PCI_TYPE01, Brid= ge.IoBaseUpper16)) << 4) | (IoBase >> 4); - } - - // - // If PCI Bridge I/O window is disabled, then return 0 - // - if (IoLimit < IoBase) { - return 0; - } - - // - // If PCI Bridge I/O window is not in the address range decoded by t= he parent PCI Bridge, then return 0 - // - if (IoBase < ParentIoBase || IoBase > ParentIoLimit || IoLimit > Par= entIoLimit) { - return 0; - } - ParentIoBase =3D IoBase; - ParentIoLimit =3D IoLimit; - } - } - - // - // Compute PCI Lib Address to PCI UART - // - PciLibAddress =3D PCI_LIB_ADDRESS (BusNumber, DeviceInfo->Device, Device= Info->Function, 0); - - // - // Find the first IO or MMIO BAR - // - RegisterBaseMask =3D 0xFFFFFFF0; - for (BarIndex =3D 0; BarIndex < PCI_MAX_BAR; BarIndex ++) { - SerialRegisterBase =3D PciRead32 (PciLibAddress + PCI_BASE_ADDRESSREG_= OFFSET + BarIndex * 4); - if (PcdGetBool (PcdSerialUseMmio) && ((SerialRegisterBase & BIT0) =3D= =3D 0)) { - // - // MMIO BAR is found - // - RegisterBaseMask =3D 0xFFFFFFF0; - break; - } - - if ((!PcdGetBool (PcdSerialUseMmio)) && ((SerialRegisterBase & BIT0) != =3D 0)) { - // - // IO BAR is found - // - RegisterBaseMask =3D 0xFFFFFFF8; - break; - } - } - - // - // MMIO or IO BAR is not found. - // - if (BarIndex =3D=3D PCI_MAX_BAR) { - return 0; - } - - // - // Program UART BAR - // - SerialRegisterBase =3D SerialPortLibUpdatePciRegister32 ( - PciLibAddress + PCI_BASE_ADDRESSREG_OFFSET + BarI= ndex * 4, - (UINT32)PcdGet64 (PcdSerialRegisterBase), - RegisterBaseMask - ); - - // - // Verify that the UART BAR is in the address range decoded by the paren= t PCI Bridge - // - if (PcdGetBool (PcdSerialUseMmio)) { - if (((SerialRegisterBase >> 16) & 0xfff0) < ParentMemoryBase || ((Seri= alRegisterBase >> 16) & 0xfff0) > ParentMemoryLimit) { - return 0; - } - } else { - if ((SerialRegisterBase >> 12) < ParentIoBase || (SerialRegisterBase >= > 12) > ParentIoLimit) { - return 0; - } - } - - // - // Enable I/O and MMIO in PCI UART Device if they are not already enabled - // - PciOr16 ( - PciLibAddress + PCI_COMMAND_OFFSET, - PcdGetBool (PcdSerialUseMmio) ? EFI_PCI_COMMAND_MEMORY_SPACE : EFI_PCI= _COMMAND_IO_SPACE - ); - - // - // Force D0 state if a Power Management and Status Register is specified - // - if (DeviceInfo->PowerManagementStatusAndControlRegister !=3D 0x00) { - if ((PciRead16 (PciLibAddress + DeviceInfo->PowerManagementStatusAndCo= ntrolRegister) & (BIT0 | BIT1)) !=3D 0x00) { - PciAnd16 (PciLibAddress + DeviceInfo->PowerManagementStatusAndContro= lRegister, (UINT16)~(BIT0 | BIT1)); - // - // If PCI UART was not in D0, then make sure FIFOs are enabled, but = do not reset FIFOs - // - SerialPortWriteRegister (SerialRegisterBase, R_UART_FCR, (UINT8)(Pcd= Get8 (PcdSerialFifoControl) & (B_UART_FCR_FIFOE | B_UART_FCR_FIFO64))); - } - } - - // - // Get PCI Device Info - // - DeviceInfo =3D (PCI_UART_DEVICE_INFO *) PcdGetPtr (PcdSerialPciDeviceInf= o); - - // - // Enable I/O or MMIO in PCI Bridge - // Assume Root Bus Numer is Zero. - // - for (BusNumber =3D 0; (DeviceInfo + 1)->Device !=3D 0xff; DeviceInfo++) { - // - // Compute PCI Lib Address to PCI to PCI Bridge - // - PciLibAddress =3D PCI_LIB_ADDRESS (BusNumber, DeviceInfo->Device, Devi= ceInfo->Function, 0); - - // - // Enable the I/O or MMIO decode windows in the PCI to PCI Bridge - // - PciOr16 ( - PciLibAddress + PCI_COMMAND_OFFSET, - PcdGetBool (PcdSerialUseMmio) ? EFI_PCI_COMMAND_MEMORY_SPACE : EFI_P= CI_COMMAND_IO_SPACE - ); - - // - // Force D0 state if a Power Management and Status Register is specifi= ed - // - if (DeviceInfo->PowerManagementStatusAndControlRegister !=3D 0x00) { - if ((PciRead16 (PciLibAddress + DeviceInfo->PowerManagementStatusAnd= ControlRegister) & (BIT0 | BIT1)) !=3D 0x00) { - PciAnd16 (PciLibAddress + DeviceInfo->PowerManagementStatusAndCont= rolRegister, (UINT16)~(BIT0 | BIT1)); - } - } - - BusNumber =3D PciRead8 (PciLibAddress + PCI_BRIDGE_SECONDARY_BUS_REGIS= TER_OFFSET); - } - - return SerialRegisterBase; -} - -/** - Return whether the hardware flow control signal allows writing. - - @param SerialRegisterBase The base address register of UART device. - - @retval TRUE The serial port is writable. - @retval FALSE The serial port is not writable. -**/ -BOOLEAN -SerialPortWritable ( - UINTN SerialRegisterBase - ) -{ - if (PcdGetBool (PcdSerialUseHardwareFlowControl)) { - if (PcdGetBool (PcdSerialDetectCable)) { - // - // Wait for both DSR and CTS to be set - // DSR is set if a cable is connected. - // CTS is set if it is ok to transmit data - // - // DSR CTS Description Action - // =3D=3D=3D =3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D =3D=3D=3D=3D=3D=3D=3D=3D - // 0 0 No cable connected. Wait - // 0 1 No cable connected. Wait - // 1 0 Cable connected, but not clear to send. Wait - // 1 1 Cable connected, and clear to send. Transmit - // - return (BOOLEAN) ((SerialPortReadRegister (SerialRegisterBase, R_UAR= T_MSR) & (B_UART_MSR_DSR | B_UART_MSR_CTS)) =3D=3D (B_UART_MSR_DSR | B_UART= _MSR_CTS)); - } else { - // - // Wait for both DSR and CTS to be set OR for DSR to be clear. - // DSR is set if a cable is connected. - // CTS is set if it is ok to transmit data - // - // DSR CTS Description Action - // =3D=3D=3D =3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D =3D=3D=3D=3D=3D=3D=3D=3D - // 0 0 No cable connected. Transmit - // 0 1 No cable connected. Transmit - // 1 0 Cable connected, but not clear to send. Wait - // 1 1 Cable connected, and clear to send. Transmit - // - return (BOOLEAN) ((SerialPortReadRegister (SerialRegisterBase, R_UAR= T_MSR) & (B_UART_MSR_DSR | B_UART_MSR_CTS)) !=3D (B_UART_MSR_DSR)); - } - } - - return TRUE; -} - -/** - Initialize the serial device hardware. - - If no initialization is required, then return RETURN_SUCCESS. - If the serial device was successfully initialized, then return RETURN_SU= CCESS. - If the serial device could not be initialized, then return RETURN_DEVICE= _ERROR. - - @retval RETURN_SUCCESS The serial device was initialized. - @retval RETURN_DEVICE_ERROR The serial device could not be initialized. - -**/ -RETURN_STATUS -EFIAPI -SerialPortInitialize ( - VOID - ) -{ - RETURN_STATUS Status; - UINTN SerialRegisterBase; - UINT32 Divisor; - UINT32 CurrentDivisor; - BOOLEAN Initialized; - - // - // Perform platform specific initialization required to enable use of th= e 16550 device - // at the location specified by PcdSerialUseMmio and PcdSerialRegisterBa= se. - // - Status =3D PlatformHookSerialPortInitialize (); - if (RETURN_ERROR (Status)) { - return Status; - } - - // - // Calculate divisor for baud generator - // Ref_Clk_Rate / Baud_Rate / 16 - // - Divisor =3D PcdGet32 (PcdSerialClockRate) / (PcdGet32 (PcdSerialBaudRate= ) * 16); - if ((PcdGet32 (PcdSerialClockRate) % (PcdGet32 (PcdSerialBaudRate) * 16)= ) >=3D PcdGet32 (PcdSerialBaudRate) * 8) { - Divisor++; - } - - // - // Get the base address of the serial port in either I/O or MMIO space - // - SerialRegisterBase =3D GetSerialRegisterBase (); - if (SerialRegisterBase =3D=3D0) { - return RETURN_DEVICE_ERROR; - } - - // - // See if the serial port is already initialized - // - Initialized =3D TRUE; - if ((SerialPortReadRegister (SerialRegisterBase, R_UART_LCR) & 0x3F) != =3D (PcdGet8 (PcdSerialLineControl) & 0x3F)) { - Initialized =3D FALSE; - } - SerialPortWriteRegister (SerialRegisterBase, R_UART_LCR, (UINT8)(SerialP= ortReadRegister (SerialRegisterBase, R_UART_LCR) | B_UART_LCR_DLAB)); - CurrentDivisor =3D SerialPortReadRegister (SerialRegisterBase, R_UART_B= AUD_HIGH) << 8; - CurrentDivisor |=3D (UINT32) SerialPortReadRegister (SerialRegisterBase,= R_UART_BAUD_LOW); - SerialPortWriteRegister (SerialRegisterBase, R_UART_LCR, (UINT8)(SerialP= ortReadRegister (SerialRegisterBase, R_UART_LCR) & ~B_UART_LCR_DLAB)); - if (CurrentDivisor !=3D Divisor) { - Initialized =3D FALSE; - } - if (Initialized) { - return RETURN_SUCCESS; - } - - // - // Wait for the serial port to be ready. - // Verify that both the transmit FIFO and the shift register are empty. - // - while ((SerialPortReadRegister (SerialRegisterBase, R_UART_LSR) & (B_UAR= T_LSR_TEMT | B_UART_LSR_TXRDY)) !=3D (B_UART_LSR_TEMT | B_UART_LSR_TXRDY)); - - // - // Configure baud rate - // - SerialPortWriteRegister (SerialRegisterBase, R_UART_LCR, B_UART_LCR_DLAB= ); - SerialPortWriteRegister (SerialRegisterBase, R_UART_BAUD_HIGH, (UINT8) (= Divisor >> 8)); - SerialPortWriteRegister (SerialRegisterBase, R_UART_BAUD_LOW, (UINT8) (D= ivisor & 0xff)); - - // - // Clear DLAB and configure Data Bits, Parity, and Stop Bits. - // Strip reserved bits from PcdSerialLineControl - // - SerialPortWriteRegister (SerialRegisterBase, R_UART_LCR, (UINT8)(PcdGet8= (PcdSerialLineControl) & 0x3F)); - - // - // Enable and reset FIFOs - // Strip reserved bits from PcdSerialFifoControl - // - SerialPortWriteRegister (SerialRegisterBase, R_UART_FCR, 0x00); - SerialPortWriteRegister (SerialRegisterBase, R_UART_FCR, (UINT8)(PcdGet8= (PcdSerialFifoControl) & (B_UART_FCR_FIFOE | B_UART_FCR_FIFO64))); - - // - // Set RTS and DTR in Modem Control Register(MCR) - // - SerialPortWriteRegister (SerialRegisterBase, R_UART_MCR, - EFI_SERIAL_REQUEST_TO_SEND | EFI_SERIAL_DATA_TERMINAL_R= EADY); - - return RETURN_SUCCESS; -} - -/** - Write data from buffer to serial device. - - Writes NumberOfBytes data bytes from Buffer to the serial device. - The number of bytes actually written to the serial device is returned. - If the return value is less than NumberOfBytes, then the write operation= failed. - - If Buffer is NULL, then ASSERT(). - - If NumberOfBytes is zero, then return 0. - - @param Buffer Pointer to the data buffer to be written. - @param NumberOfBytes Number of bytes to written to the serial device. - - @retval 0 NumberOfBytes is 0. - @retval >0 The number of bytes written to the serial devic= e. - If this value is less than NumberOfBytes, then = the write operation failed. - -**/ -UINTN -EFIAPI -SerialPortWrite ( - IN UINT8 *Buffer, - IN UINTN NumberOfBytes - ) -{ - UINTN SerialRegisterBase; - UINTN Result; - UINTN Index; - UINTN FifoSize; - - if (Buffer =3D=3D NULL) { - return 0; - } - - SerialRegisterBase =3D GetSerialRegisterBase (); - if (SerialRegisterBase =3D=3D0) { - return 0; - } - - if (NumberOfBytes =3D=3D 0) { - // - // Flush the hardware - // - - // - // Wait for both the transmit FIFO and shift register empty. - // - while ((SerialPortReadRegister (SerialRegisterBase, R_UART_LSR) & (B_U= ART_LSR_TEMT | B_UART_LSR_TXRDY)) !=3D (B_UART_LSR_TEMT | B_UART_LSR_TXRDY)= ); - - // - // Wait for the hardware flow control signal - // - while (!SerialPortWritable (SerialRegisterBase)); - return 0; - } - - // - // Compute the maximum size of the Tx FIFO - // - FifoSize =3D 1; - if ((PcdGet8 (PcdSerialFifoControl) & B_UART_FCR_FIFOE) !=3D 0) { - if ((PcdGet8 (PcdSerialFifoControl) & B_UART_FCR_FIFO64) =3D=3D 0) { - FifoSize =3D 16; - } else { - FifoSize =3D PcdGet32 (PcdSerialExtendedTxFifoSize); - } - } - - Result =3D NumberOfBytes; - while (NumberOfBytes !=3D 0) { - // - // Wait for the serial port to be ready, to make sure both the transmi= t FIFO - // and shift register empty. - // - while ((SerialPortReadRegister (SerialRegisterBase, R_UART_LSR) & B_UA= RT_LSR_TEMT) =3D=3D 0); - - // - // Fill then entire Tx FIFO - // - for (Index =3D 0; Index < FifoSize && NumberOfBytes !=3D 0; Index++, N= umberOfBytes--, Buffer++) { - // - // Wait for the hardware flow control signal - // - while (!SerialPortWritable (SerialRegisterBase)); - - // - // Write byte to the transmit buffer. - // - SerialPortWriteRegister (SerialRegisterBase, R_UART_TXBUF, *Buffer); - } - } - return Result; -} - -/** - Reads data from a serial device into a buffer. - - @param Buffer Pointer to the data buffer to store the data re= ad from the serial device. - @param NumberOfBytes Number of bytes to read from the serial device. - - @retval 0 NumberOfBytes is 0. - @retval >0 The number of bytes read from the serial device. - If this value is less than NumberOfBytes, then = the read operation failed. - -**/ -UINTN -EFIAPI -SerialPortRead ( - OUT UINT8 *Buffer, - IN UINTN NumberOfBytes - ) -{ - UINTN SerialRegisterBase; - UINTN Result; - UINT8 Mcr; - - if (NULL =3D=3D Buffer) { - return 0; - } - - SerialRegisterBase =3D GetSerialRegisterBase (); - if (SerialRegisterBase =3D=3D0) { - return 0; - } - - Mcr =3D (UINT8)(SerialPortReadRegister (SerialRegisterBase, R_UART_MCR) = & ~B_UART_MCR_RTS); - - for (Result =3D 0; NumberOfBytes-- !=3D 0; Result++, Buffer++) { - // - // Wait for the serial port to have some data. - // - while ((SerialPortReadRegister (SerialRegisterBase, R_UART_LSR) & B_UA= RT_LSR_RXRDY) =3D=3D 0) { - if (PcdGetBool (PcdSerialUseHardwareFlowControl)) { - // - // Set RTS to let the peer send some data - // - SerialPortWriteRegister (SerialRegisterBase, R_UART_MCR, (UINT8)(M= cr | B_UART_MCR_RTS)); - } - } - if (PcdGetBool (PcdSerialUseHardwareFlowControl)) { - // - // Clear RTS to prevent peer from sending data - // - SerialPortWriteRegister (SerialRegisterBase, R_UART_MCR, Mcr); - } - - // - // Read byte from the receive buffer. - // - *Buffer =3D SerialPortReadRegister (SerialRegisterBase, R_UART_RXBUF); - } - - return Result; -} - - -/** - Polls a serial device to see if there is any data waiting to be read. - - Polls a serial device to see if there is any data waiting to be read. - If there is data waiting to be read from the serial device, then TRUE is= returned. - If there is no data waiting to be read from the serial device, then FALS= E is returned. - - @retval TRUE Data is waiting to be read from the serial devi= ce. - @retval FALSE There is no data waiting to be read from the se= rial device. - -**/ -BOOLEAN -EFIAPI -SerialPortPoll ( - VOID - ) -{ - UINTN SerialRegisterBase; - - SerialRegisterBase =3D GetSerialRegisterBase (); - if (SerialRegisterBase =3D=3D0) { - return FALSE; - } - - // - // Read the serial port status - // - if ((SerialPortReadRegister (SerialRegisterBase, R_UART_LSR) & B_UART_LS= R_RXRDY) !=3D 0) { - if (PcdGetBool (PcdSerialUseHardwareFlowControl)) { - // - // Clear RTS to prevent peer from sending data - // - SerialPortWriteRegister (SerialRegisterBase, R_UART_MCR, (UINT8)(Ser= ialPortReadRegister (SerialRegisterBase, R_UART_MCR) & ~B_UART_MCR_RTS)); - } - return TRUE; - } - - if (PcdGetBool (PcdSerialUseHardwareFlowControl)) { - // - // Set RTS to let the peer send some data - // - SerialPortWriteRegister (SerialRegisterBase, R_UART_MCR, (UINT8)(Seria= lPortReadRegister (SerialRegisterBase, R_UART_MCR) | B_UART_MCR_RTS)); - } - - return FALSE; -} - -/** - Sets the control bits on a serial device. - - @param Control Sets the bits of Control that are settable. - - @retval RETURN_SUCCESS The new control bits were set on the seria= l device. - @retval RETURN_UNSUPPORTED The serial device does not support this op= eration. - @retval RETURN_DEVICE_ERROR The serial device is not functioning corre= ctly. - -**/ -RETURN_STATUS -EFIAPI -SerialPortSetControl ( - IN UINT32 Control - ) -{ - UINTN SerialRegisterBase; - UINT8 Mcr; - - // - // First determine the parameter is invalid. - // - if ((Control & (~(EFI_SERIAL_REQUEST_TO_SEND | EFI_SERIAL_DATA_TERMINAL_= READY | - EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE))) !=3D 0) { - return RETURN_UNSUPPORTED; - } - - SerialRegisterBase =3D GetSerialRegisterBase (); - if (SerialRegisterBase =3D=3D0) { - return RETURN_UNSUPPORTED; - } - - // - // Read the Modem Control Register. - // - Mcr =3D SerialPortReadRegister (SerialRegisterBase, R_UART_MCR); - Mcr &=3D (~(B_UART_MCR_DTRC | B_UART_MCR_RTS)); - - if ((Control & EFI_SERIAL_DATA_TERMINAL_READY) =3D=3D EFI_SERIAL_DATA_TE= RMINAL_READY) { - Mcr |=3D B_UART_MCR_DTRC; - } - - if ((Control & EFI_SERIAL_REQUEST_TO_SEND) =3D=3D EFI_SERIAL_REQUEST_TO_= SEND) { - Mcr |=3D B_UART_MCR_RTS; - } - - // - // Write the Modem Control Register. - // - SerialPortWriteRegister (SerialRegisterBase, R_UART_MCR, Mcr); - - return RETURN_SUCCESS; -} - -/** - Retrieve the status of the control bits on a serial device. - - @param Control A pointer to return the current control si= gnals from the serial device. - - @retval RETURN_SUCCESS The control bits were read from the serial= device. - @retval RETURN_UNSUPPORTED The serial device does not support this op= eration. - @retval RETURN_DEVICE_ERROR The serial device is not functioning corre= ctly. - -**/ -RETURN_STATUS -EFIAPI -SerialPortGetControl ( - OUT UINT32 *Control - ) -{ - UINTN SerialRegisterBase; - UINT8 Msr; - UINT8 Mcr; - UINT8 Lsr; - - SerialRegisterBase =3D GetSerialRegisterBase (); - if (SerialRegisterBase =3D=3D0) { - return RETURN_UNSUPPORTED; - } - - *Control =3D 0; - - // - // Read the Modem Status Register. - // - Msr =3D SerialPortReadRegister (SerialRegisterBase, R_UART_MSR); - - if ((Msr & B_UART_MSR_CTS) =3D=3D B_UART_MSR_CTS) { - *Control |=3D EFI_SERIAL_CLEAR_TO_SEND; - } - - if ((Msr & B_UART_MSR_DSR) =3D=3D B_UART_MSR_DSR) { - *Control |=3D EFI_SERIAL_DATA_SET_READY; - } - - if ((Msr & B_UART_MSR_RI) =3D=3D B_UART_MSR_RI) { - *Control |=3D EFI_SERIAL_RING_INDICATE; - } - - if ((Msr & B_UART_MSR_DCD) =3D=3D B_UART_MSR_DCD) { - *Control |=3D EFI_SERIAL_CARRIER_DETECT; - } - - // - // Read the Modem Control Register. - // - Mcr =3D SerialPortReadRegister (SerialRegisterBase, R_UART_MCR); - - if ((Mcr & B_UART_MCR_DTRC) =3D=3D B_UART_MCR_DTRC) { - *Control |=3D EFI_SERIAL_DATA_TERMINAL_READY; - } - - if ((Mcr & B_UART_MCR_RTS) =3D=3D B_UART_MCR_RTS) { - *Control |=3D EFI_SERIAL_REQUEST_TO_SEND; - } - - if (PcdGetBool (PcdSerialUseHardwareFlowControl)) { - *Control |=3D EFI_SERIAL_HARDWARE_FLOW_CONTROL_ENABLE; - } - - // - // Read the Line Status Register. - // - Lsr =3D SerialPortReadRegister (SerialRegisterBase, R_UART_LSR); - - if ((Lsr & (B_UART_LSR_TEMT | B_UART_LSR_TXRDY)) =3D=3D (B_UART_LSR_TEMT= | B_UART_LSR_TXRDY)) { - *Control |=3D EFI_SERIAL_OUTPUT_BUFFER_EMPTY; - } - - if ((Lsr & B_UART_LSR_RXRDY) =3D=3D 0) { - *Control |=3D EFI_SERIAL_INPUT_BUFFER_EMPTY; - } - - return RETURN_SUCCESS; -} - -/** - Sets the baud rate, receive FIFO depth, transmit/receive time out, parit= y, - data bits, and stop bits on a serial device. - - @param BaudRate The requested baud rate. A BaudRate value of 0= will use the - device's default interface speed. - On output, the value actually set. - @param ReceiveFifoDepth The requested depth of the FIFO on the receive= side of the - serial interface. A ReceiveFifoDepth value of = 0 will use - the device's default FIFO depth. - On output, the value actually set. - @param Timeout The requested time out for a single character = in microseconds. - This timeout applies to both the transmit and = receive side of the - interface. A Timeout value of 0 will use the d= evice's default time - out value. - On output, the value actually set. - @param Parity The type of parity to use on this serial devic= e. A Parity value of - DefaultParity will use the device's default pa= rity value. - On output, the value actually set. - @param DataBits The number of data bits to use on the serial d= evice. A DataBits - value of 0 will use the device's default data = bit setting. - On output, the value actually set. - @param StopBits The number of stop bits to use on this serial = device. A StopBits - value of DefaultStopBits will use the device's= default number of - stop bits. - On output, the value actually set. - - @retval RETURN_SUCCESS The new attributes were set on the ser= ial device. - @retval RETURN_UNSUPPORTED The serial device does not support thi= s operation. - @retval RETURN_INVALID_PARAMETER One or more of the attributes has an u= nsupported value. - @retval RETURN_DEVICE_ERROR The serial device is not functioning c= orrectly. - -**/ -RETURN_STATUS -EFIAPI -SerialPortSetAttributes ( - IN OUT UINT64 *BaudRate, - IN OUT UINT32 *ReceiveFifoDepth, - IN OUT UINT32 *Timeout, - IN OUT EFI_PARITY_TYPE *Parity, - IN OUT UINT8 *DataBits, - IN OUT EFI_STOP_BITS_TYPE *StopBits - ) -{ - UINTN SerialRegisterBase; - UINT32 SerialBaudRate; - UINTN Divisor; - UINT8 Lcr; - UINT8 LcrData; - UINT8 LcrParity; - UINT8 LcrStop; - - SerialRegisterBase =3D GetSerialRegisterBase (); - if (SerialRegisterBase =3D=3D0) { - return RETURN_UNSUPPORTED; - } - - // - // Check for default settings and fill in actual values. - // - if (*BaudRate =3D=3D 0) { - *BaudRate =3D PcdGet32 (PcdSerialBaudRate); - } - SerialBaudRate =3D (UINT32) *BaudRate; - - if (*DataBits =3D=3D 0) { - LcrData =3D (UINT8) (PcdGet8 (PcdSerialLineControl) & 0x3); - *DataBits =3D LcrData + 5; - } else { - if ((*DataBits < 5) || (*DataBits > 8)) { - return RETURN_INVALID_PARAMETER; - } - // - // Map 5..8 to 0..3 - // - LcrData =3D (UINT8) (*DataBits - (UINT8) 5); - } - - if (*Parity =3D=3D DefaultParity) { - LcrParity =3D (UINT8) ((PcdGet8 (PcdSerialLineControl) >> 3) & 0x7); - switch (LcrParity) { - case 0: - *Parity =3D NoParity; - break; - - case 3: - *Parity =3D EvenParity; - break; - - case 1: - *Parity =3D OddParity; - break; - - case 7: - *Parity =3D SpaceParity; - break; - - case 5: - *Parity =3D MarkParity; - break; - - default: - break; - } - } else { - switch (*Parity) { - case NoParity: - LcrParity =3D 0; - break; - - case EvenParity: - LcrParity =3D 3; - break; - - case OddParity: - LcrParity =3D 1; - break; - - case SpaceParity: - LcrParity =3D 7; - break; - - case MarkParity: - LcrParity =3D 5; - break; - - default: - return RETURN_INVALID_PARAMETER; - } - } - - if (*StopBits =3D=3D DefaultStopBits) { - LcrStop =3D (UINT8) ((PcdGet8 (PcdSerialLineControl) >> 2) & 0x1); - switch (LcrStop) { - case 0: - *StopBits =3D OneStopBit; - break; - - case 1: - if (*DataBits =3D=3D 5) { - *StopBits =3D OneFiveStopBits; - } else { - *StopBits =3D TwoStopBits; - } - break; - - default: - break; - } - } else { - switch (*StopBits) { - case OneStopBit: - LcrStop =3D 0; - break; - - case OneFiveStopBits: - case TwoStopBits: - LcrStop =3D 1; - break; - - default: - return RETURN_INVALID_PARAMETER; - } - } - - // - // Calculate divisor for baud generator - // Ref_Clk_Rate / Baud_Rate / 16 - // - Divisor =3D PcdGet32 (PcdSerialClockRate) / (SerialBaudRate * 16); - if ((PcdGet32 (PcdSerialClockRate) % (SerialBaudRate * 16)) >=3D SerialB= audRate * 8) { - Divisor++; - } - - // - // Configure baud rate - // - SerialPortWriteRegister (SerialRegisterBase, R_UART_LCR, B_UART_LCR_DLAB= ); - SerialPortWriteRegister (SerialRegisterBase, R_UART_BAUD_HIGH, (UINT8) (= Divisor >> 8)); - SerialPortWriteRegister (SerialRegisterBase, R_UART_BAUD_LOW, (UINT8) (D= ivisor & 0xff)); - - // - // Clear DLAB and configure Data Bits, Parity, and Stop Bits. - // Strip reserved bits from line control value - // - Lcr =3D (UINT8) ((LcrParity << 3) | (LcrStop << 2) | LcrData); - SerialPortWriteRegister (SerialRegisterBase, R_UART_LCR, (UINT8) (Lcr & = 0x3F)); - - return RETURN_SUCCESS; -} - diff --git a/CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSerialPor= tLib16550.inf b/CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSerial= PortLib16550.inf deleted file mode 100644 index 5dd9518d55..0000000000 --- a/CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib165= 50.inf +++ /dev/null @@ -1,42 +0,0 @@ -## @file -# SerialPortLib instance for 16550 UART. -# -# Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D BaseSerialPortLib16550 - MODULE_UNI_FILE =3D BaseSerialPortLib16550.uni - FILE_GUID =3D 9E7C00CF-355A-4d4e-BF60-0428CFF95540 - MODULE_TYPE =3D BASE - VERSION_STRING =3D 1.1 - LIBRARY_CLASS =3D SerialPortLib - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - -[LibraryClasses] - PcdLib - IoLib - PlatformHookLib - PciLib - -[Sources] - BaseSerialPortLib16550.c - -[Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio ## CONSU= MES - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl ## CONSU= MES - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialDetectCable ## SOMET= IMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase ## CONSU= MES - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate ## CONSU= MES - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialLineControl ## CONSU= MES - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialFifoControl ## CONSU= MES - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate ## CONSU= MES - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialPciDeviceInfo ## CONSU= MES - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialExtendedTxFifoSize ## CONSU= MES - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride ## CONSU= MES diff --git a/CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSerialPor= tLib16550.uni b/CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSerial= PortLib16550.uni deleted file mode 100644 index e8b178d71a..0000000000 --- a/CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib165= 50.uni +++ /dev/null @@ -1,16 +0,0 @@ -// /** @file -// SerialPortLib instance for 16550 UART. -// -// SerialPortLib instance for 16550 UART. -// -// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
-// -// SPDX-License-Identifier: BSD-2-Clause-Patent -// -// **/ - - -#string STR_MODULE_ABSTRACT #language en-US "SerialPortLib ins= tance for 16550 UART" - -#string STR_MODULE_DESCRIPTION #language en-US "SerialPortLib ins= tance for 16550 UART." - diff --git a/CorebootModulePkg/Library/CbParseLib/CbParseLib.c b/CorebootMo= dulePkg/Library/CbParseLib/CbParseLib.c deleted file mode 100644 index 38f31bd975..0000000000 --- a/CorebootModulePkg/Library/CbParseLib/CbParseLib.c +++ /dev/null @@ -1,721 +0,0 @@ -/** @file - This library will parse the coreboot table in memory and extract those r= equired - information. - - Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "Coreboot.h" - - -/** - Convert a packed value from cbuint64 to a UINT64 value. - - @param val The pointer to packed data. - - @return the UNIT64 value after conversion. - -**/ -UINT64 -cb_unpack64 ( - IN struct cbuint64 val - ) -{ - return LShiftU64 (val.hi, 32) | val.lo; -} - - -/** - Returns the sum of all elements in a buffer of 16-bit values. During - calculation, the carry bits are also been added. - - @param Buffer The pointer to the buffer to carry out the sum opera= tion. - @param Length The size, in bytes, of Buffer. - - @return Sum The sum of Buffer with carry bits included during ad= ditions. - -**/ -UINT16 -CbCheckSum16 ( - IN UINT16 *Buffer, - IN UINTN Length - ) -{ - UINT32 Sum, TmpValue; - UINTN Idx; - UINT8 *TmpPtr; - - Sum =3D 0; - TmpPtr =3D (UINT8 *)Buffer; - for(Idx =3D 0; Idx < Length; Idx++) { - TmpValue =3D TmpPtr[Idx]; - if (Idx % 2 =3D=3D 1) { - TmpValue <<=3D 8; - } - - Sum +=3D TmpValue; - - // Wrap - if (Sum >=3D 0x10000) { - Sum =3D (Sum + (Sum >> 16)) & 0xFFFF; - } - } - - return (UINT16)((~Sum) & 0xFFFF); -} - - -/** - Find coreboot record with given Tag from the memory Start in 4096 - bytes range. - - @param Start The start memory to be searched in - @param Tag The tag id to be found - - @retval NULL The Tag is not found. - @retval Others The pointer to the record found. - -**/ -VOID * -EFIAPI -FindCbTag ( - IN VOID *Start, - IN UINT32 Tag - ) -{ - struct cb_header *Header; - struct cb_record *Record; - UINT8 *TmpPtr; - UINT8 *TagPtr; - UINTN Idx; - UINT16 CheckSum; - - Header =3D NULL; - TmpPtr =3D (UINT8 *)Start; - for (Idx =3D 0; Idx < 4096; Idx +=3D 16, TmpPtr +=3D 16) { - Header =3D (struct cb_header *)TmpPtr; - if (Header->signature =3D=3D CB_HEADER_SIGNATURE) { - break; - } - } - - if (Idx >=3D 4096) { - return NULL; - } - - if ((Header =3D=3D NULL) || (Header->table_bytes =3D=3D 0)) { - return NULL; - } - - // - // Check the checksum of the coreboot table header - // - CheckSum =3D CbCheckSum16 ((UINT16 *)Header, sizeof (*Header)); - if (CheckSum !=3D 0) { - DEBUG ((EFI_D_ERROR, "Invalid coreboot table header checksum\n")); - return NULL; - } - - CheckSum =3D CbCheckSum16 ((UINT16 *)(TmpPtr + sizeof (*Header)), Header= ->table_bytes); - if (CheckSum !=3D Header->table_checksum) { - DEBUG ((EFI_D_ERROR, "Incorrect checksum of all the coreboot table ent= ries\n")); - return NULL; - } - - TagPtr =3D NULL; - TmpPtr +=3D Header->header_bytes; - for (Idx =3D 0; Idx < Header->table_entries; Idx++) { - Record =3D (struct cb_record *)TmpPtr; - if (Record->tag =3D=3D CB_TAG_FORWARD) { - TmpPtr =3D (VOID *)(UINTN)((struct cb_forward *)(UINTN)Record)->forw= ard; - if (Tag =3D=3D CB_TAG_FORWARD) { - return TmpPtr; - } else { - return FindCbTag (TmpPtr, Tag); - } - } - if (Record->tag =3D=3D Tag) { - TagPtr =3D TmpPtr; - break; - } - TmpPtr +=3D Record->size; - } - - return TagPtr; -} - - -/** - Find the given table with TableId from the given coreboot memory Root. - - @param Root The coreboot memory table to be searched in - @param TableId Table id to be found - @param pMemTable To save the base address of the memory table = found - @param pMemTableSize To save the size of memory table found - - @retval RETURN_SUCCESS Successfully find out the memory table. - @retval RETURN_INVALID_PARAMETER Invalid input parameters. - @retval RETURN_NOT_FOUND Failed to find the memory table. - -**/ -RETURN_STATUS -EFIAPI -FindCbMemTable ( - IN struct cbmem_root *Root, - IN UINT32 TableId, - OUT VOID **pMemTable, - OUT UINT32 *pMemTableSize - ) -{ - UINTN Idx; - BOOLEAN IsImdEntry; - struct cbmem_entry *Entries; - - if ((Root =3D=3D NULL) || (pMemTable =3D=3D NULL)) { - return RETURN_INVALID_PARAMETER; - } - // - // Check if the entry is CBMEM or IMD - // and handle them separately - // - Entries =3D Root->entries; - if (Entries[0].magic =3D=3D CBMEM_ENTRY_MAGIC) { - IsImdEntry =3D FALSE; - } else { - Entries =3D (struct cbmem_entry *)((struct imd_root *)Root)->entries; - if (Entries[0].magic =3D=3D IMD_ENTRY_MAGIC) { - IsImdEntry =3D TRUE; - } else { - return RETURN_NOT_FOUND; - } - } - - for (Idx =3D 0; Idx < Root->num_entries; Idx++) { - if (Entries[Idx].id =3D=3D TableId) { - if (IsImdEntry) { - *pMemTable =3D (VOID *) ((UINTN)Entries[Idx].start + (UINTN)Root); - } else { - *pMemTable =3D (VOID *) (UINTN)Entries[Idx].start; - } - if (pMemTableSize !=3D NULL) { - *pMemTableSize =3D Entries[Idx].size; - } - - DEBUG ((EFI_D_INFO, "Find CbMemTable Id 0x%x, base %p, size 0x%x\n", - TableId, *pMemTable, Entries[Idx].size)); - return RETURN_SUCCESS; - } - } - - return RETURN_NOT_FOUND; -} - - -/** - Acquire the memory information from the coreboot table in memory. - - @param MemInfoCallback The callback routine - @param pParam Pointer to the callback routine parameter - - @retval RETURN_SUCCESS Successfully find out the memory information. - @retval RETURN_NOT_FOUND Failed to find the memory information. - -**/ -RETURN_STATUS -EFIAPI -CbParseMemoryInfo ( - IN CB_MEM_INFO_CALLBACK MemInfoCallback, - IN VOID *pParam - ) -{ - struct cb_memory *rec; - struct cb_memory_range *Range; - UINT64 Start; - UINT64 Size; - UINTN Index; - - // - // Get the coreboot memory table - // - rec =3D (struct cb_memory *)FindCbTag (0, CB_TAG_MEMORY); - if (rec =3D=3D NULL) { - rec =3D (struct cb_memory *)FindCbTag ((VOID *)(UINTN)PcdGet32 (PcdCbH= eaderPointer), CB_TAG_MEMORY); - } - - if (rec =3D=3D NULL) { - return RETURN_NOT_FOUND; - } - - for (Index =3D 0; Index < MEM_RANGE_COUNT(rec); Index++) { - Range =3D MEM_RANGE_PTR(rec, Index); - Start =3D cb_unpack64(Range->start); - Size =3D cb_unpack64(Range->size); - DEBUG ((EFI_D_INFO, "%d. %016lx - %016lx [%02x]\n", - Index, Start, Start + Size - 1, Range->type)); - - MemInfoCallback (Start, Size, Range->type, pParam); - } - - return RETURN_SUCCESS; -} - - -/** - Acquire the coreboot memory table with the given table id - - @param TableId Table id to be searched - @param pMemTable Pointer to the base address of the memory tab= le - @param pMemTableSize Pointer to the size of the memory table - - @retval RETURN_SUCCESS Successfully find out the memory table. - @retval RETURN_INVALID_PARAMETER Invalid input parameters. - @retval RETURN_NOT_FOUND Failed to find the memory table. - -**/ -RETURN_STATUS -EFIAPI -CbParseCbMemTable ( - IN UINT32 TableId, - OUT VOID **pMemTable, - OUT UINT32 *pMemTableSize - ) -{ - struct cb_memory *rec; - struct cb_memory_range *Range; - UINT64 Start; - UINT64 Size; - UINTN Index; - - if (pMemTable =3D=3D NULL) { - return RETURN_INVALID_PARAMETER; - } - *pMemTable =3D NULL; - - // - // Get the coreboot memory table - // - rec =3D (struct cb_memory *)FindCbTag (0, CB_TAG_MEMORY); - if (rec =3D=3D NULL) { - rec =3D (struct cb_memory *)FindCbTag ((VOID *)(UINTN)PcdGet32 (PcdCbH= eaderPointer), CB_TAG_MEMORY); - } - - if (rec =3D=3D NULL) { - return RETURN_NOT_FOUND; - } - - for (Index =3D 0; Index < MEM_RANGE_COUNT(rec); Index++) { - Range =3D MEM_RANGE_PTR(rec, Index); - Start =3D cb_unpack64(Range->start); - Size =3D cb_unpack64(Range->size); - - if ((Range->type =3D=3D CB_MEM_TABLE) && (Start > 0x1000)) { - if (FindCbMemTable ((struct cbmem_root *)(UINTN)(Start + Size - DYN= _CBMEM_ALIGN_SIZE), TableId, pMemTable, pMemTableSize) =3D=3D RETURN_SUCCES= S) - return RETURN_SUCCESS; - } - } - - return RETURN_NOT_FOUND; -} - - -/** - Acquire the acpi table from coreboot - - @param pMemTable Pointer to the base address of the memory tab= le - @param pMemTableSize Pointer to the size of the memory table - - @retval RETURN_SUCCESS Successfully find out the memory table. - @retval RETURN_INVALID_PARAMETER Invalid input parameters. - @retval RETURN_NOT_FOUND Failed to find the memory table. - -**/ -RETURN_STATUS -EFIAPI -CbParseAcpiTable ( - OUT VOID **pMemTable, - OUT UINT32 *pMemTableSize - ) -{ - return CbParseCbMemTable (SIGNATURE_32 ('I', 'P', 'C', 'A'), pMemTable, = pMemTableSize); -} - -/** - Acquire the smbios table from coreboot - - @param pMemTable Pointer to the base address of the memory tab= le - @param pMemTableSize Pointer to the size of the memory table - - @retval RETURN_SUCCESS Successfully find out the memory table. - @retval RETURN_INVALID_PARAMETER Invalid input parameters. - @retval RETURN_NOT_FOUND Failed to find the memory table. - -**/ -RETURN_STATUS -EFIAPI -CbParseSmbiosTable ( - OUT VOID **pMemTable, - OUT UINT32 *pMemTableSize - ) -{ - return CbParseCbMemTable (SIGNATURE_32 ('T', 'B', 'M', 'S'), pMemTable, = pMemTableSize); -} - -/** - Find the required fadt information - - @param pPmCtrlReg Pointer to the address of power management co= ntrol register - @param pPmTimerReg Pointer to the address of power management ti= mer register - @param pResetReg Pointer to the address of system reset regist= er - @param pResetValue Pointer to the value to be written to the sys= tem reset register - @param pPmEvtReg Pointer to the address of power management ev= ent register - @param pPmGpeEnReg Pointer to the address of power management GP= E enable register - - @retval RETURN_SUCCESS Successfully find out all the required fadt i= nformation. - @retval RETURN_NOT_FOUND Failed to find the fadt table. - -**/ -RETURN_STATUS -EFIAPI -CbParseFadtInfo ( - OUT UINTN *pPmCtrlReg, - OUT UINTN *pPmTimerReg, - OUT UINTN *pResetReg, - OUT UINTN *pResetValue, - OUT UINTN *pPmEvtReg, - OUT UINTN *pPmGpeEnReg - ) -{ - EFI_ACPI_3_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp; - EFI_ACPI_DESCRIPTION_HEADER *Rsdt; - UINT32 *Entry32; - UINTN Entry32Num; - EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt; - EFI_ACPI_DESCRIPTION_HEADER *Xsdt; - UINT64 *Entry64; - UINTN Entry64Num; - UINTN Idx; - RETURN_STATUS Status; - - Rsdp =3D NULL; - Status =3D RETURN_SUCCESS; - - Status =3D CbParseAcpiTable ((VOID **)&Rsdp, NULL); - if (RETURN_ERROR(Status)) { - return Status; - } - - if (Rsdp =3D=3D NULL) { - return RETURN_NOT_FOUND; - } - - DEBUG ((EFI_D_INFO, "Find Rsdp at %p\n", Rsdp)); - DEBUG ((EFI_D_INFO, "Find Rsdt 0x%x, Xsdt 0x%lx\n", Rsdp->RsdtAddress, R= sdp->XsdtAddress)); - - // - // Search Rsdt First - // - Rsdt =3D (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)(Rsdp->RsdtAddress); - if (Rsdt !=3D NULL) { - Entry32 =3D (UINT32 *)(Rsdt + 1); - Entry32Num =3D (Rsdt->Length - sizeof(EFI_ACPI_DESCRIPTION_HEADER)) >>= 2; - for (Idx =3D 0; Idx < Entry32Num; Idx++) { - if (*(UINT32 *)(UINTN)(Entry32[Idx]) =3D=3D EFI_ACPI_3_0_FIXED_ACPI_= DESCRIPTION_TABLE_SIGNATURE) { - Fadt =3D (EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)(UINTN)(Entr= y32[Idx]); - if (pPmCtrlReg !=3D NULL) { - *pPmCtrlReg =3D Fadt->Pm1aCntBlk; - } - DEBUG ((EFI_D_INFO, "PmCtrl Reg 0x%x\n", Fadt->Pm1aCntBlk)); - - if (pPmTimerReg !=3D NULL) { - *pPmTimerReg =3D Fadt->PmTmrBlk; - } - DEBUG ((EFI_D_INFO, "PmTimer Reg 0x%x\n", Fadt->PmTmrBlk)); - - if (pResetReg !=3D NULL) { - *pResetReg =3D (UINTN)Fadt->ResetReg.Address; - } - DEBUG ((EFI_D_INFO, "Reset Reg 0x%lx\n", Fadt->ResetReg.Address)); - - if (pResetValue !=3D NULL) { - *pResetValue =3D Fadt->ResetValue; - } - DEBUG ((EFI_D_INFO, "Reset Value 0x%x\n", Fadt->ResetValue)); - - if (pPmEvtReg !=3D NULL) { - *pPmEvtReg =3D Fadt->Pm1aEvtBlk; - DEBUG ((EFI_D_INFO, "PmEvt Reg 0x%x\n", Fadt->Pm1aEvtBlk)); - } - - if (pPmGpeEnReg !=3D NULL) { - *pPmGpeEnReg =3D Fadt->Gpe0Blk + Fadt->Gpe0BlkLen / 2; - DEBUG ((EFI_D_INFO, "PmGpeEn Reg 0x%x\n", *pPmGpeEnReg)); - } - - // - // Verify values for proper operation - // - ASSERT(Fadt->Pm1aCntBlk !=3D 0); - ASSERT(Fadt->PmTmrBlk !=3D 0); - ASSERT(Fadt->ResetReg.Address !=3D 0); - ASSERT(Fadt->Pm1aEvtBlk !=3D 0); - ASSERT(Fadt->Gpe0Blk !=3D 0); - - DEBUG_CODE_BEGIN (); - BOOLEAN SciEnabled; - - // - // Check the consistency of SCI enabling - // - - // - // Get SCI_EN value - // - if (Fadt->Pm1CntLen =3D=3D 4) { - SciEnabled =3D (IoRead32 (Fadt->Pm1aCntBlk) & BIT0)? TRUE : FA= LSE; - } else { - // - // if (Pm1CntLen =3D=3D 2), use 16 bit IO read; - // if (Pm1CntLen !=3D 2 && Pm1CntLen !=3D 4), use 16 bit IO re= ad as a fallback - // - SciEnabled =3D (IoRead16 (Fadt->Pm1aCntBlk) & BIT0)? TRUE : FA= LSE; - } - - if (!(Fadt->Flags & EFI_ACPI_5_0_HW_REDUCED_ACPI) && - (Fadt->SmiCmd =3D=3D 0) && - !SciEnabled) { - // - // The ACPI enabling status is inconsistent: SCI is not enable= d but ACPI - // table does not provide a means to enable it through FADT->S= miCmd - // - DEBUG ((DEBUG_ERROR, "ERROR: The ACPI enabling status is incon= sistent: SCI is not" - " enabled but the ACPI table does not provide a means to ena= ble it through FADT->SmiCmd." - " This may cause issues in OS.\n")); - ASSERT (FALSE); - } - DEBUG_CODE_END (); - return RETURN_SUCCESS; - } - } - } - - // - // Search Xsdt Second - // - Xsdt =3D (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)(Rsdp->XsdtAddress); - if (Xsdt !=3D NULL) { - Entry64 =3D (UINT64 *)(Xsdt + 1); - Entry64Num =3D (Xsdt->Length - sizeof(EFI_ACPI_DESCRIPTION_HEADER)) >>= 3; - for (Idx =3D 0; Idx < Entry64Num; Idx++) { - if (*(UINT32 *)(UINTN)(Entry64[Idx]) =3D=3D EFI_ACPI_3_0_FIXED_ACPI_= DESCRIPTION_TABLE_SIGNATURE) { - Fadt =3D (EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)(UINTN)(Entr= y64[Idx]); - if (pPmCtrlReg) - *pPmCtrlReg =3D Fadt->Pm1aCntBlk; - DEBUG ((EFI_D_ERROR, "PmCtrl Reg 0x%x\n", Fadt->Pm1aCntBlk)); - - if (pPmTimerReg) - *pPmTimerReg =3D Fadt->PmTmrBlk; - DEBUG ((EFI_D_ERROR, "PmTimer Reg 0x%x\n", Fadt->PmTmrBlk)); - - if (pResetReg) - *pResetReg =3D (UINTN)Fadt->ResetReg.Address; - DEBUG ((EFI_D_ERROR, "Reset Reg 0x%lx\n", Fadt->ResetReg.Address)); - - if (pResetValue) - *pResetValue =3D Fadt->ResetValue; - DEBUG ((EFI_D_ERROR, "Reset Value 0x%x\n", Fadt->ResetValue)); - - if (pPmEvtReg !=3D NULL) { - *pPmEvtReg =3D Fadt->Pm1aEvtBlk; - DEBUG ((EFI_D_INFO, "PmEvt Reg 0x%x\n", Fadt->Pm1aEvtBlk)); - } - - if (pPmGpeEnReg !=3D NULL) { - *pPmGpeEnReg =3D Fadt->Gpe0Blk + Fadt->Gpe0BlkLen / 2; - DEBUG ((EFI_D_INFO, "PmGpeEn Reg 0x%x\n", *pPmGpeEnReg)); - } - return RETURN_SUCCESS; - } - } - } - - return RETURN_NOT_FOUND; -} - -/** - Find the serial port information - - @param pRegBase Pointer to the base address of serial port re= gisters - @param pRegAccessType Pointer to the access type of serial port reg= isters - @param pRegWidth Pointer to the register width in bytes - @param pBaudrate Pointer to the serial port baudrate - @param pInputHertz Pointer to the input clock frequency - @param pUartPciAddr Pointer to the UART PCI bus, dev and func add= ress - - @retval RETURN_SUCCESS Successfully find the serial port information. - @retval RETURN_NOT_FOUND Failed to find the serial port information . - -**/ -RETURN_STATUS -EFIAPI -CbParseSerialInfo ( - OUT UINT32 *pRegBase, - OUT UINT32 *pRegAccessType, - OUT UINT32 *pRegWidth, - OUT UINT32 *pBaudrate, - OUT UINT32 *pInputHertz, - OUT UINT32 *pUartPciAddr - ) -{ - struct cb_serial *CbSerial; - - CbSerial =3D FindCbTag (0, CB_TAG_SERIAL); - if (CbSerial =3D=3D NULL) { - CbSerial =3D FindCbTag ((VOID *)(UINTN)PcdGet32 (PcdCbHeaderPointer), = CB_TAG_SERIAL); - } - - if (CbSerial =3D=3D NULL) { - return RETURN_NOT_FOUND; - } - - if (pRegBase !=3D NULL) { - *pRegBase =3D CbSerial->baseaddr; - } - - if (pRegWidth !=3D NULL) { - *pRegWidth =3D CbSerial->regwidth; - } - - if (pRegAccessType !=3D NULL) { - *pRegAccessType =3D CbSerial->type; - } - - if (pBaudrate !=3D NULL) { - *pBaudrate =3D CbSerial->baud; - } - - if (pInputHertz !=3D NULL) { - *pInputHertz =3D CbSerial->input_hertz; - } - - if (pUartPciAddr !=3D NULL) { - *pUartPciAddr =3D CbSerial->uart_pci_addr; - } - - return RETURN_SUCCESS; -} - -/** - Search for the coreboot table header - - @param Level Level of the search depth - @param HeaderPtr Pointer to the pointer of coreboot table head= er - - @retval RETURN_SUCCESS Successfully find the coreboot table header . - @retval RETURN_NOT_FOUND Failed to find the coreboot table header . - -**/ -RETURN_STATUS -EFIAPI -CbParseGetCbHeader ( - IN UINTN Level, - OUT VOID **HeaderPtr - ) -{ - UINTN Index; - VOID *TempPtr; - - if (HeaderPtr =3D=3D NULL) { - return RETURN_NOT_FOUND; - } - - TempPtr =3D NULL; - for (Index =3D 0; Index < Level; Index++) { - TempPtr =3D FindCbTag (TempPtr, CB_TAG_FORWARD); - if (TempPtr =3D=3D NULL) { - break; - } - } - - if ((Index >=3D Level) && (TempPtr !=3D NULL)) { - *HeaderPtr =3D TempPtr; - return RETURN_SUCCESS; - } - - return RETURN_NOT_FOUND; -} - -/** - Find the video frame buffer information - - @param pFbInfo Pointer to the FRAME_BUFFER_INFO structure - - @retval RETURN_SUCCESS Successfully find the video frame buffer info= rmation. - @retval RETURN_NOT_FOUND Failed to find the video frame buffer informa= tion . - -**/ -RETURN_STATUS -EFIAPI -CbParseFbInfo ( - OUT FRAME_BUFFER_INFO *pFbInfo - ) -{ - struct cb_framebuffer *CbFbRec; - - if (pFbInfo =3D=3D NULL) { - return RETURN_INVALID_PARAMETER; - } - - CbFbRec =3D FindCbTag (0, CB_TAG_FRAMEBUFFER); - if (CbFbRec =3D=3D NULL) { - CbFbRec =3D FindCbTag ((VOID *)(UINTN)PcdGet32 (PcdCbHeaderPointer), C= B_TAG_FRAMEBUFFER); - } - - if (CbFbRec =3D=3D NULL) { - return RETURN_NOT_FOUND; - } - - DEBUG ((EFI_D_INFO, "Found coreboot video frame buffer information\n")); - DEBUG ((EFI_D_INFO, "physical_address: 0x%lx\n", CbFbRec->physical_addre= ss)); - DEBUG ((EFI_D_INFO, "x_resolution: 0x%x\n", CbFbRec->x_resolution)); - DEBUG ((EFI_D_INFO, "y_resolution: 0x%x\n", CbFbRec->y_resolution)); - DEBUG ((EFI_D_INFO, "bits_per_pixel: 0x%x\n", CbFbRec->bits_per_pixel)); - DEBUG ((EFI_D_INFO, "bytes_per_line: 0x%x\n", CbFbRec->bytes_per_line)); - - DEBUG ((EFI_D_INFO, "red_mask_size: 0x%x\n", CbFbRec->red_mask_size)); - DEBUG ((EFI_D_INFO, "red_mask_pos: 0x%x\n", CbFbRec->red_mask_pos)); - DEBUG ((EFI_D_INFO, "green_mask_size: 0x%x\n", CbFbRec->green_mask_size)= ); - DEBUG ((EFI_D_INFO, "green_mask_pos: 0x%x\n", CbFbRec->green_mask_pos)); - DEBUG ((EFI_D_INFO, "blue_mask_size: 0x%x\n", CbFbRec->blue_mask_size)); - DEBUG ((EFI_D_INFO, "blue_mask_pos: 0x%x\n", CbFbRec->blue_mask_pos)); - DEBUG ((EFI_D_INFO, "reserved_mask_size: 0x%x\n", CbFbRec->reserved_mask= _size)); - DEBUG ((EFI_D_INFO, "reserved_mask_pos: 0x%x\n", CbFbRec->reserved_mask_= pos)); - - pFbInfo->LinearFrameBuffer =3D CbFbRec->physical_address; - pFbInfo->HorizontalResolution =3D CbFbRec->x_resolution; - pFbInfo->VerticalResolution =3D CbFbRec->y_resolution; - pFbInfo->BitsPerPixel =3D CbFbRec->bits_per_pixel; - pFbInfo->BytesPerScanLine =3D (UINT16)CbFbRec->bytes_per_line; - pFbInfo->Red.Mask =3D (1 << CbFbRec->red_mask_size) - 1; - pFbInfo->Red.Position =3D CbFbRec->red_mask_pos; - pFbInfo->Green.Mask =3D (1 << CbFbRec->green_mask_size) - 1; - pFbInfo->Green.Position =3D CbFbRec->green_mask_pos; - pFbInfo->Blue.Mask =3D (1 << CbFbRec->blue_mask_size) - 1; - pFbInfo->Blue.Position =3D CbFbRec->blue_mask_pos; - pFbInfo->Reserved.Mask =3D (1 << CbFbRec->reserved_mask_size) - 1; - pFbInfo->Reserved.Position =3D CbFbRec->reserved_mask_pos; - - return RETURN_SUCCESS; -} - diff --git a/CorebootModulePkg/Library/CbParseLib/CbParseLib.inf b/Coreboot= ModulePkg/Library/CbParseLib/CbParseLib.inf deleted file mode 100644 index d31fc7bc61..0000000000 --- a/CorebootModulePkg/Library/CbParseLib/CbParseLib.inf +++ /dev/null @@ -1,39 +0,0 @@ -## @file -# Coreboot Table Parse Library. -# -# Copyright (c) 2014, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent -# =20 -## - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D CbParseLib - FILE_GUID =3D 49EDFC9E-5945-4386-9C0B-C9B60CD45BB1 - MODULE_TYPE =3D BASE - VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D CbParseLib - -# -# The following information is for reference only and not required by the = build tools. -# -# VALID_ARCHITECTURES =3D IA32 X64 -# - -[Sources] - CbParseLib.c - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - CorebootModulePkg/CorebootModulePkg.dec =20 - -[LibraryClasses] - BaseLib - BaseMemoryLib - IoLib - DebugLib - PcdLib - -[Pcd] =20 - gUefiCorebootModulePkgTokenSpaceGuid.PcdCbHeaderPointer=20 \ No newline at end of file diff --git a/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformS= upportLibNull.c b/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlat= formSupportLibNull.c deleted file mode 100644 index b2db9dc9c3..0000000000 --- a/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSupportL= ibNull.c +++ /dev/null @@ -1,29 +0,0 @@ -/** @file - Include all platform specific features which can be customized by IBV/OE= M. - -Copyright (c) 2016, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include -#include -#include -#include - -/** - Parse platform specific information from coreboot. - - @retval RETURN_SUCCESS The platform specific coreboot support succ= eeded. - @retval RETURN_DEVICE_ERROR The platform specific coreboot support coul= d not be completed. - -**/ -EFI_STATUS -EFIAPI -CbParsePlatformInfo ( - VOID - ) -{ - return EFI_SUCCESS; -} - diff --git a/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformS= upportLibNull.inf b/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPl= atformSupportLibNull.inf deleted file mode 100644 index 91c5f1d71b..0000000000 --- a/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSupportL= ibNull.inf +++ /dev/null @@ -1,29 +0,0 @@ -## @file -# Include all platform specific features which can be customized by IBV/O= EM. -# -# Copyright (c) 2016, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D CbPlatformSupportLib - MODULE_UNI_FILE =3D CbPlatformSupportLibNull.uni - FILE_GUID =3D B42AA265-00CA-4d4b-AC14-DBD5268E1BC7 - MODULE_TYPE =3D BASE - VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D CbPlatformSupportLib - -# -# The following information is for reference only and not required by the = build tools. -# -# VALID_ARCHITECTURES =3D IA32 X64 EBC -# - -[Sources] - CbPlatformSupportLibNull.c - -[Packages] - MdePkg/MdePkg.dec - CorebootModulePkg/CorebootModulePkg.dec diff --git a/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformS= upportLibNull.uni b/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPl= atformSupportLibNull.uni deleted file mode 100644 index c1f5aa3a7f..0000000000 --- a/CorebootModulePkg/Library/CbPlatformSupportLibNull/CbPlatformSupportL= ibNull.uni +++ /dev/null @@ -1,14 +0,0 @@ -// /** @file -// NULL implementation for CbPlatformSupportLib library class interfaces. -// -// Copyright (c) 2016, Intel Corporation. All rights reserved.
-// -// SPDX-License-Identifier: BSD-2-Clause-Patent -// -// **/ - - -#string STR_MODULE_ABSTRACT #language en-US "NULL implementati= on for CbPlatformSupportLib library class interfaces" - -#string STR_MODULE_DESCRIPTION #language en-US "NULL implementati= on for CbPlatformSupportLib library class interfaces." - diff --git a/CorebootModulePkg/SataControllerDxe/ComponentName.c b/Coreboot= ModulePkg/SataControllerDxe/ComponentName.c deleted file mode 100644 index 4556d70bf3..0000000000 --- a/CorebootModulePkg/SataControllerDxe/ComponentName.c +++ /dev/null @@ -1,170 +0,0 @@ -/** @file - UEFI Component Name(2) protocol implementation for Sata Controller drive= r. - - Copyright (c) 2011, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include "SataController.h" - -// -/// EFI Component Name Protocol -/// -GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gSataController= ComponentName =3D { - SataControllerComponentNameGetDriverName, - SataControllerComponentNameGetControllerName, - "eng" -}; - -// -/// EFI Component Name 2 Protocol -/// -GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gSataController= ComponentName2 =3D { - (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) SataControllerComponentNameGetDriv= erName, - (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) SataControllerComponentNameGet= ControllerName, - "en" -}; - -// -/// Driver Name Strings -/// -GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mSataControllerDriv= erNameTable[] =3D { - { - "eng;en", - (CHAR16 *)L"Sata Controller Init Driver" - }, - { - NULL, - NULL - } -}; - -/// -/// Controller Name Strings -/// -GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mSataControllerCont= rollerNameTable[] =3D { - { - "eng;en", - (CHAR16 *)L"Sata Controller" - }, - { - NULL, - NULL - } -}; - -/** - Retrieves a Unicode string that is the user readable name of the UEFI Dr= iver. - - @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL insta= nce. - @param Language A pointer to a three character ISO 639-2 language = identifier. - This is the language of the driver name that that = the caller - is requesting, and it must match one of the langua= ges specified - in SupportedLanguages. The number of languages su= pported by a - driver is up to the driver writer. - @param DriverName A pointer to the Unicode string to return. This U= nicode string - is the name of the driver specified by This in the= language - specified by Language. - =20 - @retval EFI_SUCCESS The Unicode string for the Driver specifie= d by This - and the language specified by Language was= returned - in DriverName. - @retval EFI_INVALID_PARAMETER Language is NULL. - @retval EFI_INVALID_PARAMETER DriverName is NULL. - @retval EFI_UNSUPPORTED The driver specified by This does not supp= ort the - language specified by Language. -**/ -EFI_STATUS -EFIAPI -SataControllerComponentNameGetDriverName ( - IN EFI_COMPONENT_NAME_PROTOCOL *This, - IN CHAR8 *Language, - OUT CHAR16 **DriverName - ) -{ - return LookupUnicodeString2 ( - Language, - This->SupportedLanguages, - mSataControllerDriverNameTable, - DriverName, - (BOOLEAN)(This =3D=3D &gSataControllerComponentName) - ); -} - -/** - Retrieves a Unicode string that is the user readable name of the control= ler - that is being managed by an UEFI Driver. =20 - - @param This A pointer to the EFI_COMPONENT_NAME_PROTOC= OL instance. - @param ControllerHandle The handle of a controller that the driver= specified by - This is managing. This handle specifies t= he controller - whose name is to be returned. - @param ChildHandle OPTIONAL The handle of the child controller to retr= ieve the name - of. This is an optional parameter that ma= y be NULL. It - will be NULL for device drivers. It will = also be NULL - for a bus drivers that wish to retrieve th= e name of the - bus controller. It will not be NULL for a= bus driver - that wishes to retrieve the name of a chil= d controller. - @param Language A pointer to a three character ISO 639-2 l= anguage - identifier. This is the language of the c= ontroller name - that that the caller is requesting, and it= must match one - of the languages specified in SupportedLan= guages. The - number of languages supported by a driver = is up to the - driver writer. - @param ControllerName A pointer to the Unicode string to return.= This Unicode - string is the name of the controller speci= fied by - ControllerHandle and ChildHandle in the la= nguage - specified by Language from the point of vi= ew of the - driver specified by This. - =20 - @retval EFI_SUCCESS The Unicode string for the user readable n= ame in the - language specified by Language for the dri= ver - specified by This was returned in DriverNa= me. - @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. - @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a va= lid - EFI_HANDLE. - @retval EFI_INVALID_PARAMETER Language is NULL. - @retval EFI_INVALID_PARAMETER ControllerName is NULL. - @retval EFI_UNSUPPORTED The driver specified by This is not curren= tly - managing the controller specified by - ControllerHandle and ChildHandle. - @retval EFI_UNSUPPORTED The driver specified by This does not supp= ort the - language specified by Language. -**/ -EFI_STATUS -EFIAPI -SataControllerComponentNameGetControllerName ( - IN EFI_COMPONENT_NAME_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN EFI_HANDLE ChildHandle OPTIONAL, - IN CHAR8 *Language, - OUT CHAR16 **ControllerName - ) -{ - EFI_STATUS Status; - - // - // Make sure this driver is currently managing ControllHandle - // - Status =3D EfiTestManagedDevice ( - ControllerHandle, - gSataControllerDriverBinding.DriverBindingHandle, - &gEfiPciIoProtocolGuid - ); - if (EFI_ERROR (Status)) { - return Status; - } - - if (ChildHandle !=3D NULL) { - return EFI_UNSUPPORTED; - } - - return LookupUnicodeString2 ( - Language, - This->SupportedLanguages, - mSataControllerControllerNameTable, - ControllerName, - (BOOLEAN)(This =3D=3D &gSataControllerComponentName) - ); -} diff --git a/CorebootModulePkg/SataControllerDxe/SataController.c b/Coreboo= tModulePkg/SataControllerDxe/SataController.c deleted file mode 100644 index 77efbb0817..0000000000 --- a/CorebootModulePkg/SataControllerDxe/SataController.c +++ /dev/null @@ -1,1043 +0,0 @@ -/** @file - This driver module produces IDE_CONTROLLER_INIT protocol for Sata Contro= llers. - - Copyright (c) 2011, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include "SataController.h" - -/// -/// EFI_DRIVER_BINDING_PROTOCOL instance -/// -EFI_DRIVER_BINDING_PROTOCOL gSataControllerDriverBinding =3D { - SataControllerSupported, - SataControllerStart, - SataControllerStop, - 0xa, - NULL, - NULL -}; - -/** - Read AHCI Operation register. - - @param PciIo The PCI IO protocol instance. - @param Offset The operation register offset. - - @return The register content read. - -**/ -UINT32 -EFIAPI -AhciReadReg ( - IN EFI_PCI_IO_PROTOCOL *PciIo, - IN UINT32 Offset - ) -{ - UINT32 Data; - - ASSERT (PciIo !=3D NULL); - =20 - Data =3D 0; - - PciIo->Mem.Read ( - PciIo, - EfiPciIoWidthUint32, - AHCI_BAR_INDEX, - (UINT64) Offset, - 1, - &Data - ); - - return Data; -} - -/** - Write AHCI Operation register. - - @param PciIo The PCI IO protocol instance. - @param Offset The operation register offset. - @param Data The data used to write down. - -**/ -VOID -EFIAPI -AhciWriteReg ( - IN EFI_PCI_IO_PROTOCOL *PciIo, - IN UINT32 Offset, - IN UINT32 Data - ) -{ - ASSERT (PciIo !=3D NULL); - - PciIo->Mem.Write ( - PciIo, - EfiPciIoWidthUint32, - AHCI_BAR_INDEX, - (UINT64) Offset, - 1, - &Data - ); - - return; -} - -/** - This function is used to calculate the best PIO mode supported by specif= ic IDE device - - @param IdentifyData The identify data of specific IDE device. - @param DisPioMode Disqualified PIO modes collection. - @param SelectedMode Available PIO modes collection. - - @retval EFI_SUCCESS Best PIO modes are returned. - @retval EFI_UNSUPPORTED The device doesn't support PIO mode, - or all supported modes have been disqualified. -**/ -EFI_STATUS -CalculateBestPioMode ( - IN EFI_IDENTIFY_DATA *IdentifyData, - IN UINT16 *DisPioMode OPTIONAL, - OUT UINT16 *SelectedMode - ) -{ - UINT16 PioMode; - UINT16 AdvancedPioMode; - UINT16 Temp; - UINT16 Index; - UINT16 MinimumPioCycleTime; - - Temp =3D 0xff; - - PioMode =3D (UINT8) (((ATA5_IDENTIFY_DATA *) (&(IdentifyData->AtaData)))= ->pio_cycle_timing >> 8); - - // - // See whether Identify Data word 64 - 70 are valid - // - if ((IdentifyData->AtaData.field_validity & 0x02) =3D=3D 0x02) { - - AdvancedPioMode =3D IdentifyData->AtaData.advanced_pio_modes; - DEBUG ((EFI_D_INFO, "CalculateBestPioMode: AdvancedPioMode =3D %x\n", = AdvancedPioMode)); - - for (Index =3D 0; Index < 8; Index++) { - if ((AdvancedPioMode & 0x01) !=3D 0) { - Temp =3D Index; - } - - AdvancedPioMode >>=3D 1; - } - - // - // If Temp is modified, mean the advanced_pio_modes is not zero; - // if Temp is not modified, mean there is no advanced PIO mode support= ed, - // the best PIO Mode is the value in pio_cycle_timing. - // - if (Temp !=3D 0xff) { - AdvancedPioMode =3D (UINT16) (Temp + 3); - } else { - AdvancedPioMode =3D PioMode; - } - - // - // Limit the PIO mode to at most PIO4. - // - PioMode =3D (UINT16) MIN (AdvancedPioMode, 4); - - MinimumPioCycleTime =3D IdentifyData->AtaData.min_pio_cycle_time_with_= flow_control; - - if (MinimumPioCycleTime <=3D 120) { - PioMode =3D (UINT16) MIN (4, PioMode); - } else if (MinimumPioCycleTime <=3D 180) { - PioMode =3D (UINT16) MIN (3, PioMode); - } else if (MinimumPioCycleTime <=3D 240) { - PioMode =3D (UINT16) MIN (2, PioMode); - } else { - PioMode =3D 0; - } - - // - // Degrade the PIO mode if the mode has been disqualified - // - if (DisPioMode !=3D NULL) { - if (*DisPioMode < 2) { - return EFI_UNSUPPORTED; // no mode below ATA_PIO_MODE_BELOW_2 - } - - if (PioMode >=3D *DisPioMode) { - PioMode =3D (UINT16) (*DisPioMode - 1); - } - } - - if (PioMode < 2) { - *SelectedMode =3D 1; // ATA_PIO_MODE_BELOW_2; - } else { - *SelectedMode =3D PioMode; // ATA_PIO_MODE_2 to ATA_PIO_MODE_4; - } - - } else { - // - // Identify Data word 64 - 70 are not valid - // Degrade the PIO mode if the mode has been disqualified - // - if (DisPioMode !=3D NULL) { - if (*DisPioMode < 2) { - return EFI_UNSUPPORTED; // no mode below ATA_PIO_MODE_BELOW_2 - } - - if (PioMode =3D=3D *DisPioMode) { - PioMode--; - } - } - - if (PioMode < 2) { - *SelectedMode =3D 1; // ATA_PIO_MODE_BELOW_2; - } else { - *SelectedMode =3D 2; // ATA_PIO_MODE_2; - } - - } - - return EFI_SUCCESS; -} - -/** - This function is used to calculate the best UDMA mode supported by speci= fic IDE device - - @param IdentifyData The identify data of specific IDE device. - @param DisUDmaMode Disqualified UDMA modes collection. - @param SelectedMode Available UDMA modes collection. - - @retval EFI_SUCCESS Best UDMA modes are returned. - @retval EFI_UNSUPPORTED The device doesn't support UDMA mode, - or all supported modes have been disqualified. -**/ -EFI_STATUS -CalculateBestUdmaMode ( - IN EFI_IDENTIFY_DATA *IdentifyData, - IN UINT16 *DisUDmaMode OPTIONAL, - OUT UINT16 *SelectedMode - ) -{ - UINT16 TempMode; - UINT16 DeviceUDmaMode; - - DeviceUDmaMode =3D 0; - - // - // Check whether the WORD 88 (supported UltraDMA by drive) is valid - // - if ((IdentifyData->AtaData.field_validity & 0x04) =3D=3D 0x00) { - return EFI_UNSUPPORTED; - } - - DeviceUDmaMode =3D IdentifyData->AtaData.ultra_dma_mode; - DEBUG ((EFI_D_INFO, "CalculateBestUdmaMode: DeviceUDmaMode =3D %x\n", De= viceUDmaMode)); - DeviceUDmaMode &=3D 0x3f; - TempMode =3D 0; // initialize it to UDMA-0 - - while ((DeviceUDmaMode >>=3D 1) !=3D 0) { - TempMode++; - } - - // - // Degrade the UDMA mode if the mode has been disqualified - // - if (DisUDmaMode !=3D NULL) { - if (*DisUDmaMode =3D=3D 0) { - *SelectedMode =3D 0; - return EFI_UNSUPPORTED; // no mode below ATA_UDMA_MODE_0 - } - - if (TempMode >=3D *DisUDmaMode) { - TempMode =3D (UINT16) (*DisUDmaMode - 1); - } - } - - // - // Possible returned mode is between ATA_UDMA_MODE_0 and ATA_UDMA_MODE_5 - // - *SelectedMode =3D TempMode; - - return EFI_SUCCESS; -} - -/** - The Entry Point of module. It follows the standard UEFI driver model. - - @param[in] ImageHandle The firmware allocated handle for the EFI imag= e. =20 - @param[in] SystemTable A pointer to the EFI System Table. - =20 - @retval EFI_SUCCESS The entry point is executed successfully. - @retval other Some error occurs when executing this entry point. - -**/ -EFI_STATUS -EFIAPI -InitializeSataControllerDriver ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - - // - // Install driver model protocol(s). - // - Status =3D EfiLibInstallDriverBindingComponentName2 ( - ImageHandle, - SystemTable, - &gSataControllerDriverBinding, - ImageHandle, - &gSataControllerComponentName, - &gSataControllerComponentName2 - ); - ASSERT_EFI_ERROR (Status); - - return Status; -} - -/** - Supported function of Driver Binding protocol for this driver. - Test to see if this driver supports ControllerHandle. - - @param This Protocol instance pointer. - @param Controller Handle of device to test. - @param RemainingDevicePath A pointer to the device path. - it should be ignored by device driver. - - @retval EFI_SUCCESS This driver supports this device. - @retval EFI_ALREADY_STARTED This driver is already running on this dev= ice. - @retval other This driver does not support this device. - -**/ -EFI_STATUS -EFIAPI -SataControllerSupported ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Controller, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath - ) -{ - EFI_STATUS Status; - EFI_PCI_IO_PROTOCOL *PciIo; - PCI_TYPE00 PciData; - - // - // Attempt to open PCI I/O Protocol - // - Status =3D gBS->OpenProtocol ( - Controller, - &gEfiPciIoProtocolGuid, - (VOID **) &PciIo, - This->DriverBindingHandle, - Controller, - EFI_OPEN_PROTOCOL_GET_PROTOCOL - ); - if (EFI_ERROR (Status)) { - return Status; - } - - // - // Now further check the PCI header: Base Class (offset 0x0B) and - // Sub Class (offset 0x0A). This controller should be an SATA controller - // - Status =3D PciIo->Pci.Read ( - PciIo, - EfiPciIoWidthUint8, - PCI_CLASSCODE_OFFSET, - sizeof (PciData.Hdr.ClassCode), - PciData.Hdr.ClassCode - ); - if (EFI_ERROR (Status)) { - return EFI_UNSUPPORTED; - } - - if (IS_PCI_IDE (&PciData) || IS_PCI_SATADPA (&PciData)) { - return EFI_SUCCESS; - } - - return EFI_UNSUPPORTED; -} - -/** - This routine is called right after the .Supported() called and=20 - Start this driver on ControllerHandle. - - @param This Protocol instance pointer. - @param Controller Handle of device to bind driver to. - @param RemainingDevicePath A pointer to the device path. - it should be ignored by device driver. - - @retval EFI_SUCCESS This driver is added to this device. - @retval EFI_ALREADY_STARTED This driver is already running on this dev= ice. - @retval other Some error occurs when binding this driver= to this device. - -**/ -EFI_STATUS -EFIAPI -SataControllerStart ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Controller, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath - ) -{ - EFI_STATUS Status; - EFI_PCI_IO_PROTOCOL *PciIo; - PCI_TYPE00 PciData; - EFI_SATA_CONTROLLER_PRIVATE_DATA *SataPrivateData; - UINT32 Data32; - UINTN ChannelDeviceCount; - - DEBUG ((EFI_D_INFO, "SataControllerStart START\n")); - - SataPrivateData =3D NULL; - - // - // Now test and open PCI I/O Protocol - // - Status =3D gBS->OpenProtocol ( - Controller, - &gEfiPciIoProtocolGuid, - (VOID **) &PciIo, - This->DriverBindingHandle, - Controller, - EFI_OPEN_PROTOCOL_BY_DRIVER - ); - if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "SataControllerStart error return status =3D %r\n= ", Status)); - return Status; - } - - // - // Allocate Sata Private Data structure - // - SataPrivateData =3D AllocateZeroPool (sizeof (EFI_SATA_CONTROLLER_PRIVAT= E_DATA)); - if (SataPrivateData =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - goto Done; - } - - // - // Initialize Sata Private Data - // - SataPrivateData->Signature =3D SATA_CONTROLLER_SIGNATURE; - SataPrivateData->PciIo =3D PciIo; - SataPrivateData->IdeInit.GetChannelInfo =3D IdeInitGetChannelInfo; - SataPrivateData->IdeInit.NotifyPhase =3D IdeInitNotifyPhase; - SataPrivateData->IdeInit.SubmitData =3D IdeInitSubmitData; - SataPrivateData->IdeInit.DisqualifyMode =3D IdeInitDisqualifyMode; - SataPrivateData->IdeInit.CalculateMode =3D IdeInitCalculateMode; - SataPrivateData->IdeInit.SetTiming =3D IdeInitSetTiming; - SataPrivateData->IdeInit.EnumAll =3D SATA_ENUMER_ALL; - - Status =3D PciIo->Pci.Read ( - PciIo, - EfiPciIoWidthUint8, - PCI_CLASSCODE_OFFSET, - sizeof (PciData.Hdr.ClassCode), - PciData.Hdr.ClassCode - ); - ASSERT_EFI_ERROR (Status); - - if (IS_PCI_IDE (&PciData)) { - SataPrivateData->IdeInit.ChannelCount =3D IDE_MAX_CHANNEL; - SataPrivateData->DeviceCount =3D IDE_MAX_DEVICES; - } else if (IS_PCI_SATADPA (&PciData)) { - // - // Read Host Capability Register(CAP) to get Number of Ports(NPS) and = Supports Port Multiplier(SPM) - // NPS is 0's based value indicating the maximum number of ports sup= ported by the HBA silicon. - // A maximum of 32 ports can be supported. A value of '0h', indicati= ng one port, is the minimum requirement. - // - Data32 =3D AhciReadReg (PciIo, R_AHCI_CAP); - SataPrivateData->IdeInit.ChannelCount =3D (UINT8) ((Data32 & B_AHCI_CA= P_NPS) + 1); - SataPrivateData->DeviceCount =3D AHCI_MAX_DEVICES; - if ((Data32 & B_AHCI_CAP_SPM) =3D=3D B_AHCI_CAP_SPM) { - SataPrivateData->DeviceCount =3D AHCI_MULTI_MAX_DEVICES; - } - } - - ChannelDeviceCount =3D (UINTN) (SataPrivateData->IdeInit.ChannelCount) *= (UINTN) (SataPrivateData->DeviceCount); - SataPrivateData->DisqualifiedModes =3D AllocateZeroPool ((sizeof (EFI_AT= A_COLLECTIVE_MODE)) * ChannelDeviceCount); - if (SataPrivateData->DisqualifiedModes =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - goto Done; - } - - SataPrivateData->IdentifyData =3D AllocateZeroPool ((sizeof (EFI_IDENTIF= Y_DATA)) * ChannelDeviceCount); - if (SataPrivateData->IdentifyData =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - goto Done; - } - - SataPrivateData->IdentifyValid =3D AllocateZeroPool ((sizeof (BOOLEAN)) = * ChannelDeviceCount); - if (SataPrivateData->IdentifyValid =3D=3D NULL) { - Status =3D EFI_OUT_OF_RESOURCES; - goto Done; - } - - // - // Install IDE Controller Init Protocol to this instance - // - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &Controller, - &gEfiIdeControllerInitProtocolGuid, - &(SataPrivateData->IdeInit), - NULL - ); - -Done: - if (EFI_ERROR (Status)) { - - gBS->CloseProtocol ( - Controller, - &gEfiPciIoProtocolGuid, - This->DriverBindingHandle, - Controller - ); - if (SataPrivateData !=3D NULL) { - if (SataPrivateData->DisqualifiedModes !=3D NULL) { - FreePool (SataPrivateData->DisqualifiedModes); - } - if (SataPrivateData->IdentifyData !=3D NULL) { - FreePool (SataPrivateData->IdentifyData); - } - if (SataPrivateData->IdentifyValid !=3D NULL) { - FreePool (SataPrivateData->IdentifyValid); - } - FreePool (SataPrivateData); - } - } - - DEBUG ((EFI_D_INFO, "SataControllerStart END status =3D %r\n", Status)); - - return Status; -} - -/** - Stop this driver on ControllerHandle. - - @param This Protocol instance pointer. - @param Controller Handle of device to stop driver on. - @param NumberOfChildren Not used. - @param ChildHandleBuffer Not used. - - @retval EFI_SUCCESS This driver is removed from this device. - @retval other Some error occurs when removing this driver from t= his device. - -**/ -EFI_STATUS -EFIAPI -SataControllerStop ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Controller, - IN UINTN NumberOfChildren, - IN EFI_HANDLE *ChildHandleBuffer - ) -{ - EFI_STATUS Status; - EFI_IDE_CONTROLLER_INIT_PROTOCOL *IdeInit; - EFI_SATA_CONTROLLER_PRIVATE_DATA *SataPrivateData; - - // - // Open the produced protocol - // - Status =3D gBS->OpenProtocol ( - Controller, - &gEfiIdeControllerInitProtocolGuid, - (VOID **) &IdeInit, - This->DriverBindingHandle, - Controller, - EFI_OPEN_PROTOCOL_GET_PROTOCOL - ); - if (EFI_ERROR (Status)) { - return EFI_UNSUPPORTED; - } - - SataPrivateData =3D SATA_CONTROLLER_PRIVATE_DATA_FROM_THIS (IdeInit); - ASSERT (SataPrivateData !=3D NULL); - - // - // Uninstall the IDE Controller Init Protocol from this instance - // - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - Controller, - &gEfiIdeControllerInitProtocolGuid, - &(SataPrivateData->IdeInit), - NULL - ); - if (EFI_ERROR (Status)) { - return Status; - } - - if (SataPrivateData !=3D NULL) { - if (SataPrivateData->DisqualifiedModes !=3D NULL) { - FreePool (SataPrivateData->DisqualifiedModes); - } - if (SataPrivateData->IdentifyData !=3D NULL) { - FreePool (SataPrivateData->IdentifyData); - } - if (SataPrivateData->IdentifyValid !=3D NULL) { - FreePool (SataPrivateData->IdentifyValid); - } - FreePool (SataPrivateData); - } - - // - // Close protocols opened by Sata Controller driver - // - return gBS->CloseProtocol ( - Controller, - &gEfiPciIoProtocolGuid, - This->DriverBindingHandle, - Controller - ); -} - -/** - Calculate the flat array subscript of a (Channel, Device) pair. - - @param[in] SataPrivateData The private data structure corresponding to = the - SATA controller that attaches the device for - which the flat array subscript is being - calculated. - - @param[in] Channel The channel (ie. port) number on the SATA - controller that the device is attached to. - - @param[in] Device The device number on the channel. - - @return The flat array subscript suitable for indexing DisqualifiedMode= s, - IdentifyData, and IdentifyValid. -**/ -STATIC -UINTN -FlatDeviceIndex ( - IN CONST EFI_SATA_CONTROLLER_PRIVATE_DATA *SataPrivateData, - IN UINTN Channel, - IN UINTN Device - ) -{ - ASSERT (SataPrivateData !=3D NULL); - ASSERT (Channel < SataPrivateData->IdeInit.ChannelCount); - ASSERT (Device < SataPrivateData->DeviceCount); - - return Channel * SataPrivateData->DeviceCount + Device; -} - -// -// Interface functions of IDE_CONTROLLER_INIT protocol -// -/** - Returns the information about the specified IDE channel. - =20 - This function can be used to obtain information about a particular IDE c= hannel. - The driver entity uses this information during the enumeration process.=20 - =20 - If Enabled is set to FALSE, the driver entity will not scan the channel.= Note=20 - that it will not prevent an operating system driver from scanning the ch= annel. - =20 - For most of today's controllers, MaxDevices will either be 1 or 2. For S= ATA=20 - controllers, this value will always be 1. SATA configurations can contai= n SATA=20 - port multipliers. SATA port multipliers behave like SATA bridges and can= support - up to 16 devices on the other side. If a SATA port out of the IDE contro= ller=20 - is connected to a port multiplier, MaxDevices will be set to the number = of SATA=20 - devices that the port multiplier supports. Because today's port multipli= ers=20 - support up to fifteen SATA devices, this number can be as large as fifte= en. The IDE =20 - bus driver is required to scan for the presence of port multipliers behi= nd an SATA=20 - controller and enumerate up to MaxDevices number of devices behind the p= ort=20 - multiplier. =20 - =20 - In this context, the devices behind a port multiplier constitute a chann= el. =20 - =20 - @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROT= OCOL instance. - @param[in] Channel Zero-based channel number. - @param[out] Enabled TRUE if this channel is enabled. Disabled chan= nels=20 - are not scanned to see if any devices are prese= nt. - @param[out] MaxDevices The maximum number of IDE devices that the bus = driver - can expect on this channel. For the ATA/ATAPI=20 - specification, version 6, this number will eith= er be=20 - one or two. For Serial ATA (SATA) configuration= s with a=20 - port multiplier, this number can be as large as= fifteen. - - @retval EFI_SUCCESS Information was returned without any err= ors. - @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >=3D Channel= Count). - -**/ -EFI_STATUS -EFIAPI -IdeInitGetChannelInfo ( - IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This, - IN UINT8 Channel, - OUT BOOLEAN *Enabled, - OUT UINT8 *MaxDevices - ) -{ - EFI_SATA_CONTROLLER_PRIVATE_DATA *SataPrivateData; - SataPrivateData =3D SATA_CONTROLLER_PRIVATE_DATA_FROM_THIS (This); - ASSERT (SataPrivateData !=3D NULL); - - if (Channel < This->ChannelCount) { - *Enabled =3D TRUE; - *MaxDevices =3D SataPrivateData->DeviceCount; - return EFI_SUCCESS; - } - - *Enabled =3D FALSE; - return EFI_INVALID_PARAMETER; -} - -/** - The notifications from the driver entity that it is about to enter a cer= tain - phase of the IDE channel enumeration process. - =20 - This function can be used to notify the IDE controller driver to perform=20 - specific actions, including any chipset-specific initialization, so that= the=20 - chipset is ready to enter the next phase. Seven notification points are = defined=20 - at this time.=20 - =20 - More synchronization points may be added as required in the future. =20 - - @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL= instance. - @param[in] Phase The phase during enumeration. - @param[in] Channel Zero-based channel number. - - @retval EFI_SUCCESS The notification was accepted without an= y errors. - @retval EFI_UNSUPPORTED Phase is not supported. - @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >=3D Channel= Count). - @retval EFI_NOT_READY This phase cannot be entered at this tim= e; for=20 - example, an attempt was made to enter a = Phase=20 - without having entered one or more previ= ous=20 - Phase. - -**/ -EFI_STATUS -EFIAPI -IdeInitNotifyPhase ( - IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This, - IN EFI_IDE_CONTROLLER_ENUM_PHASE Phase, - IN UINT8 Channel - ) -{ - return EFI_SUCCESS; -} - -/** - Submits the device information to the IDE controller driver. - - This function is used by the driver entity to pass detailed information = about=20 - a particular device to the IDE controller driver. The driver entity obta= ins=20 - this information by issuing an ATA or ATAPI IDENTIFY_DEVICE command. Ide= ntifyData - is the pointer to the response data buffer. The IdentifyData buffer is o= wned=20 - by the driver entity, and the IDE controller driver must make a local co= py=20 - of the entire buffer or parts of the buffer as needed. The original Iden= tifyData=20 - buffer pointer may not be valid when - =20 - - EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() or - - EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() is called at a lat= er point. - =20 - The IDE controller driver may consult various fields of EFI_IDENTIFY_DAT= A to=20 - compute the optimum mode for the device. These fields are not limited to= the=20 - timing information. For example, an implementation of the IDE controller= driver=20 - may examine the vendor and type/mode field to match known bad drives. =20 - =20 - The driver entity may submit drive information in any order, as long as = it=20 - submits information for all the devices belonging to the enumeration gro= up=20 - before EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() is called for an= y device - in that enumeration group. If a device is absent, EFI_IDE_CONTROLLER_INI= T_PROTOCOL.SubmitData() - should be called with IdentifyData set to NULL. The IDE controller driv= er may=20 - not have any other mechanism to know whether a device is present or not.= Therefore,=20 - setting IdentifyData to NULL does not constitute an error condition.=20 - EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData() can be called only once fo= r a=20 - given (Channel, Device) pair. =20 - =20 - @param[in] This A pointer to the EFI_IDE_CONTROLLER_INIT_PROTO= COL instance. - @param[in] Channel Zero-based channel number. - @param[in] Device Zero-based device number on the Channel. - @param[in] IdentifyData The device's response to the ATA IDENTIFY_DEVI= CE command. - - @retval EFI_SUCCESS The information was accepted without any= errors. - @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >=3D Channel= Count). - @retval EFI_INVALID_PARAMETER Device is invalid. - -**/ -EFI_STATUS -EFIAPI -IdeInitSubmitData ( - IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This, - IN UINT8 Channel, - IN UINT8 Device, - IN EFI_IDENTIFY_DATA *IdentifyData - ) -{ - EFI_SATA_CONTROLLER_PRIVATE_DATA *SataPrivateData; - UINTN DeviceIndex; - - SataPrivateData =3D SATA_CONTROLLER_PRIVATE_DATA_FROM_THIS (This); - ASSERT (SataPrivateData !=3D NULL); - - if ((Channel >=3D This->ChannelCount) || (Device >=3D SataPrivateData->D= eviceCount)) { - return EFI_INVALID_PARAMETER; - } - - DeviceIndex =3D FlatDeviceIndex (SataPrivateData, Channel, Device); - - // - // Make a local copy of device's IdentifyData and mark the valid flag - // - if (IdentifyData !=3D NULL) { - CopyMem ( - &(SataPrivateData->IdentifyData[DeviceIndex]), - IdentifyData, - sizeof (EFI_IDENTIFY_DATA) - ); - - SataPrivateData->IdentifyValid[DeviceIndex] =3D TRUE; - } else { - SataPrivateData->IdentifyValid[DeviceIndex] =3D FALSE; - } - - return EFI_SUCCESS; -} - -/** - Disqualifies specific modes for an IDE device. - - This function allows the driver entity or other drivers (such as platfor= m=20 - drivers) to reject certain timing modes and request the IDE controller d= river - to recalculate modes. This function allows the driver entity and the IDE=20 - controller driver to negotiate the timings on a per-device basis. This f= unction=20 - is useful in the case of drives that lie about their capabilities. An ex= ample=20 - is when the IDE device fails to accept the timing modes that are calcula= ted=20 - by the IDE controller driver based on the response to the Identify Drive= command. - - If the driver entity does not want to limit the ATA timing modes and lea= ve that=20 - decision to the IDE controller driver, it can either not call this funct= ion for=20 - the given device or call this function and set the Valid flag to FALSE f= or all=20 - modes that are listed in EFI_ATA_COLLECTIVE_MODE. - =20 - The driver entity may disqualify modes for a device in any order and any= number=20 - of times. - =20 - This function can be called multiple times to invalidate multiple modes = of the=20 - same type (e.g., Programmed Input/Output [PIO] modes 3 and 4). See the A= TA/ATAPI=20 - specification for more information on PIO modes. =20 - =20 - For Serial ATA (SATA) controllers, this member function can be used to d= isqualify - a higher transfer rate mode on a given channel. For example, a platform = driver - may inform the IDE controller driver to not use second-generation (Gen2)= speeds=20 - for a certain SATA drive. - =20 - @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCO= L instance. - @param[in] Channel The zero-based channel number. - @param[in] Device The zero-based device number on the Channel. - @param[in] BadModes The modes that the device does not support and that - should be disqualified. - - @retval EFI_SUCCESS The modes were accepted without any erro= rs. - @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >=3D Channel= Count). - @retval EFI_INVALID_PARAMETER Device is invalid. - @retval EFI_INVALID_PARAMETER IdentifyData is NULL. - =20 -**/ -EFI_STATUS -EFIAPI -IdeInitDisqualifyMode ( - IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This, - IN UINT8 Channel, - IN UINT8 Device, - IN EFI_ATA_COLLECTIVE_MODE *BadModes - ) -{ - EFI_SATA_CONTROLLER_PRIVATE_DATA *SataPrivateData; - UINTN DeviceIndex; - - SataPrivateData =3D SATA_CONTROLLER_PRIVATE_DATA_FROM_THIS (This); - ASSERT (SataPrivateData !=3D NULL); - - if ((Channel >=3D This->ChannelCount) || (BadModes =3D=3D NULL) || (Devi= ce >=3D SataPrivateData->DeviceCount)) { - return EFI_INVALID_PARAMETER; - } - - DeviceIndex =3D FlatDeviceIndex (SataPrivateData, Channel, Device); - - // - // Record the disqualified modes per channel per device. From ATA/ATAPI = spec, - // if a mode is not supported, the modes higher than it is also not supp= orted. - // - CopyMem ( - &(SataPrivateData->DisqualifiedModes[DeviceIndex]), - BadModes, - sizeof (EFI_ATA_COLLECTIVE_MODE) - ); - - return EFI_SUCCESS; -} - -/** - Returns the information about the optimum modes for the specified IDE de= vice. - - This function is used by the driver entity to obtain the optimum ATA mod= es for - a specific device. The IDE controller driver takes into account the fol= lowing=20 - while calculating the mode: - - The IdentifyData inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitDa= ta() - - The BadModes inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMo= de() - - The driver entity is required to call EFI_IDE_CONTROLLER_INIT_PROTOCOL.S= ubmitData()=20 - for all the devices that belong to an enumeration group before calling=20 - EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() for any device in the s= ame group. =20 - =20 - The IDE controller driver will use controller- and possibly platform-spe= cific=20 - algorithms to arrive at SupportedModes. The IDE controller may base its=20 - decision on user preferences and other considerations as well. This func= tion=20 - may be called multiple times because the driver entity may renegotiate t= he mode=20 - with the IDE controller driver using EFI_IDE_CONTROLLER_INIT_PROTOCOL.Di= squalifyMode(). - =20 - The driver entity may collect timing information for various devices in = any=20 - order. The driver entity is responsible for making sure that all the dep= endencies - are satisfied. For example, the SupportedModes information for device A = that=20 - was previously returned may become stale after a call to=20 - EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() for device B. - =20 - The buffer SupportedModes is allocated by the callee because the caller = does=20 - not necessarily know the size of the buffer. The type EFI_ATA_COLLECTIVE= _MODE=20 - is defined in a way that allows for future extensibility and can be of v= ariable=20 - length. This memory pool should be deallocated by the caller when it is = no=20 - longer necessary. =20 - =20 - The IDE controller driver for a Serial ATA (SATA) controller can use thi= s=20 - member function to force a lower speed (first-generation [Gen1] speeds o= n a=20 - second-generation [Gen2]-capable hardware). The IDE controller driver c= an=20 - also allow the driver entity to stay with the speed that has been negoti= ated=20 - by the physical layer. - =20 - @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_= PROTOCOL instance. - @param[in] Channel A zero-based channel number. - @param[in] Device A zero-based device number on the Channel. - @param[out] SupportedModes The optimum modes for the device. - - @retval EFI_SUCCESS SupportedModes was returned. - @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >=3D Channel= Count). - @retval EFI_INVALID_PARAMETER Device is invalid.=20 - @retval EFI_INVALID_PARAMETER SupportedModes is NULL. - @retval EFI_NOT_READY Modes cannot be calculated due to a lack= of=20 - data. This error may happen if=20 - EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitD= ata()=20 - and EFI_IDE_CONTROLLER_INIT_PROTOCOL.Dis= qualifyData()=20 - were not called for at least one drive i= n the=20 - same enumeration group. - -**/ -EFI_STATUS -EFIAPI -IdeInitCalculateMode ( - IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This, - IN UINT8 Channel, - IN UINT8 Device, - OUT EFI_ATA_COLLECTIVE_MODE **SupportedModes - ) -{ - EFI_SATA_CONTROLLER_PRIVATE_DATA *SataPrivateData; - EFI_IDENTIFY_DATA *IdentifyData; - BOOLEAN IdentifyValid; - EFI_ATA_COLLECTIVE_MODE *DisqualifiedModes; - UINT16 SelectedMode; - EFI_STATUS Status; - UINTN DeviceIndex; - - SataPrivateData =3D SATA_CONTROLLER_PRIVATE_DATA_FROM_THIS (This); - ASSERT (SataPrivateData !=3D NULL); - - if ((Channel >=3D This->ChannelCount) || (SupportedModes =3D=3D NULL) ||= (Device >=3D SataPrivateData->DeviceCount)) { - return EFI_INVALID_PARAMETER; - } - - *SupportedModes =3D AllocateZeroPool (sizeof (EFI_ATA_COLLECTIVE_MODE)); - if (*SupportedModes =3D=3D NULL) { - ASSERT (*SupportedModes !=3D NULL); - return EFI_OUT_OF_RESOURCES; - } - - DeviceIndex =3D FlatDeviceIndex (SataPrivateData, Channel, Device); - - IdentifyData =3D &(SataPrivateData->IdentifyData[DeviceIndex]); - IdentifyValid =3D SataPrivateData->IdentifyValid[DeviceIndex]; - DisqualifiedModes =3D &(SataPrivateData->DisqualifiedModes[DeviceIndex]); - - // - // Make sure we've got the valid identify data of the device from Submit= Data() - // - if (!IdentifyValid) { - FreePool (*SupportedModes); - return EFI_NOT_READY; - } - - Status =3D CalculateBestPioMode ( - IdentifyData, - (DisqualifiedModes->PioMode.Valid ? ((UINT16 *) &(Disqualified= Modes->PioMode.Mode)) : NULL), - &SelectedMode - ); - if (!EFI_ERROR (Status)) { - (*SupportedModes)->PioMode.Valid =3D TRUE; - (*SupportedModes)->PioMode.Mode =3D SelectedMode; - - } else { - (*SupportedModes)->PioMode.Valid =3D FALSE; - } - DEBUG ((EFI_D_INFO, "IdeInitCalculateMode: PioMode =3D %x\n", (*Supporte= dModes)->PioMode.Mode)); - - Status =3D CalculateBestUdmaMode ( - IdentifyData, - (DisqualifiedModes->UdmaMode.Valid ? ((UINT16 *) &(Disqualifie= dModes->UdmaMode.Mode)) : NULL), - &SelectedMode - ); - - if (!EFI_ERROR (Status)) { - (*SupportedModes)->UdmaMode.Valid =3D TRUE; - (*SupportedModes)->UdmaMode.Mode =3D SelectedMode; - - } else { - (*SupportedModes)->UdmaMode.Valid =3D FALSE; - } - DEBUG ((EFI_D_INFO, "IdeInitCalculateMode: UdmaMode =3D %x\n", (*Support= edModes)->UdmaMode.Mode)); - - // - // The modes other than PIO and UDMA are not supported - // - return EFI_SUCCESS; -} - -/** - Commands the IDE controller driver to program the IDE controller hardware - so that the specified device can operate at the specified mode. - - This function is used by the driver entity to instruct the IDE controlle= r=20 - driver to program the IDE controller hardware to the specified modes. Th= is=20 - function can be called only once for a particular device. For a Serial A= TA=20 - (SATA) Advanced Host Controller Interface (AHCI) controller, no controll= er- - specific programming may be required. - - @param[in] This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL ins= tance. - @param[in] Channel Zero-based channel number. - @param[in] Device Zero-based device number on the Channel. - @param[in] Modes The modes to set. - - @retval EFI_SUCCESS The command was accepted without any err= ors. - @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >=3D Channel= Count). - @retval EFI_INVALID_PARAMETER Device is invalid. - @retval EFI_NOT_READY Modes cannot be set at this time due to = lack of data. - @retval EFI_DEVICE_ERROR Modes cannot be set due to hardware fail= ure. - The driver entity should not use this de= vice. - -**/ -EFI_STATUS -EFIAPI -IdeInitSetTiming ( - IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This, - IN UINT8 Channel, - IN UINT8 Device, - IN EFI_ATA_COLLECTIVE_MODE *Modes - ) -{ - return EFI_SUCCESS; -} diff --git a/CorebootModulePkg/SataControllerDxe/SataController.h b/Coreboo= tModulePkg/SataControllerDxe/SataController.h deleted file mode 100644 index 284e605337..0000000000 --- a/CorebootModulePkg/SataControllerDxe/SataController.h +++ /dev/null @@ -1,536 +0,0 @@ -/** @file - Header file for Sata Controller driver. - - Copyright (c) 2011, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#ifndef _SATA_CONTROLLER_H_ -#define _SATA_CONTROLLER_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// -// Global Variables definitions -// -extern EFI_DRIVER_BINDING_PROTOCOL gSataControllerDriverBinding; -extern EFI_COMPONENT_NAME_PROTOCOL gSataControllerComponentName; -extern EFI_COMPONENT_NAME2_PROTOCOL gSataControllerComponentName2; - -#define AHCI_BAR_INDEX 0x05 -#define R_AHCI_CAP 0x0 -#define B_AHCI_CAP_NPS (BIT4 | BIT3 | BIT2 | BIT1 | BIT0) // Number of P= orts -#define B_AHCI_CAP_SPM BIT17 // Supports Port Multiplier - -/// -/// AHCI each channel can have up to 1 device -/// -#define AHCI_MAX_DEVICES 0x01 - -/// -/// AHCI each channel can have 15 devices in the presence of a multiplier -/// -#define AHCI_MULTI_MAX_DEVICES 0x0F - -/// -/// IDE supports 2 channel max -/// -#define IDE_MAX_CHANNEL 0x02 - -/// -/// IDE supports 2 devices max -/// -#define IDE_MAX_DEVICES 0x02 - -#define SATA_ENUMER_ALL FALSE - -// -// Sata Controller driver private data structure -// - -#define SATA_CONTROLLER_SIGNATURE SIGNATURE_32('S','A','T','A') - -typedef struct _EFI_SATA_CONTROLLER_PRIVATE_DATA { - // - // Standard signature used to identify Sata Controller private data - // - UINT32 Signature; - - // - // Protocol instance of IDE_CONTROLLER_INIT produced by this driver - // - EFI_IDE_CONTROLLER_INIT_PROTOCOL IdeInit; - - // - // Copy of protocol pointers used by this driver - // - EFI_PCI_IO_PROTOCOL *PciIo; - - // - // The number of devices that are supported by this channel - // - UINT8 DeviceCount; - - // - // The highest disqualified mode for each attached device, - // From ATA/ATAPI spec, if a mode is not supported, - // the modes higher than it is also not supported - // - EFI_ATA_COLLECTIVE_MODE *DisqualifiedModes; - - // - // A copy of EFI_IDENTIFY_DATA data for each attached SATA device and it= s flag - // - EFI_IDENTIFY_DATA *IdentifyData; - BOOLEAN *IdentifyValid; -} EFI_SATA_CONTROLLER_PRIVATE_DATA; - -#define SATA_CONTROLLER_PRIVATE_DATA_FROM_THIS(a) CR(a, EFI_SATA_CONTROLLE= R_PRIVATE_DATA, IdeInit, SATA_CONTROLLER_SIGNATURE) - -// -// Driver binding functions declaration -// -/** - Supported function of Driver Binding protocol for this driver. - Test to see if this driver supports ControllerHandle. - - @param This Protocol instance pointer. - @param Controller Handle of device to test. - @param RemainingDevicePath A pointer to the device path. Should be ig= nored by - device driver. - - @retval EFI_SUCCESS This driver supports this device. - @retval EFI_ALREADY_STARTED This driver is already running on this dev= ice. - @retval other This driver does not support this device. - -**/ -EFI_STATUS -EFIAPI -SataControllerSupported ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Controller, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath - ) -; - -/** - This routine is called right after the .Supported() called and=20 - Start this driver on ControllerHandle. - - @param This Protocol instance pointer. - @param Controller Handle of device to bind driver to. - @param RemainingDevicePath A pointer to the device path. Should be ig= nored by - device driver. - - @retval EFI_SUCCESS This driver is added to this device. - @retval EFI_ALREADY_STARTED This driver is already running on this dev= ice. - @retval other Some error occurs when binding this driver= to this device. - -**/ -EFI_STATUS -EFIAPI -SataControllerStart ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Controller, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath - ) -; - -/** - Stop this driver on ControllerHandle. - - @param This Protocol instance pointer. - @param Controller Handle of device to stop driver on. - @param NumberOfChildren Not used. - @param ChildHandleBuffer Not used. - - @retval EFI_SUCCESS This driver is removed from this device. - @retval other Some error occurs when removing this driver from t= his device. - -**/ -EFI_STATUS -EFIAPI -SataControllerStop ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Controller, - IN UINTN NumberOfChildren, - IN EFI_HANDLE *ChildHandleBuffer - ) -; - -// -// IDE controller init functions declaration -// -/** - Returns the information about the specified IDE channel. - =20 - This function can be used to obtain information about a particular IDE c= hannel. - The driver entity uses this information during the enumeration process.=20 - =20 - If Enabled is set to FALSE, the driver entity will not scan the channel.= Note=20 - that it will not prevent an operating system driver from scanning the ch= annel. - =20 - For most of today's controllers, MaxDevices will either be 1 or 2. For S= ATA=20 - controllers, this value will always be 1. SATA configurations can contai= n SATA=20 - port multipliers. SATA port multipliers behave like SATA bridges and can= support - up to 16 devices on the other side. If a SATA port out of the IDE contro= ller=20 - is connected to a port multiplier, MaxDevices will be set to the number = of SATA=20 - devices that the port multiplier supports. Because today's port multipli= ers=20 - support up to fifteen SATA devices, this number can be as large as fifte= en. The IDE =20 - bus driver is required to scan for the presence of port multipliers behi= nd an SATA=20 - controller and enumerate up to MaxDevices number of devices behind the p= ort=20 - multiplier. =20 - =20 - In this context, the devices behind a port multiplier constitute a chann= el. =20 - =20 - @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROT= OCOL instance. - @param[in] Channel Zero-based channel number. - @param[out] Enabled TRUE if this channel is enabled. Disabled chan= nels=20 - are not scanned to see if any devices are prese= nt. - @param[out] MaxDevices The maximum number of IDE devices that the bus = driver - can expect on this channel. For the ATA/ATAPI=20 - specification, version 6, this number will eith= er be=20 - one or two. For Serial ATA (SATA) configuration= s with a=20 - port multiplier, this number can be as large as= fifteen. - - @retval EFI_SUCCESS Information was returned without any err= ors. - @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >=3D Channel= Count). - -**/ -EFI_STATUS -EFIAPI -IdeInitGetChannelInfo ( - IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This, - IN UINT8 Channel, - OUT BOOLEAN *Enabled, - OUT UINT8 *MaxDevices - ) -; - -/** - The notifications from the driver entity that it is about to enter a cer= tain - phase of the IDE channel enumeration process. - =20 - This function can be used to notify the IDE controller driver to perform=20 - specific actions, including any chipset-specific initialization, so that= the=20 - chipset is ready to enter the next phase. Seven notification points are = defined=20 - at this time.=20 - =20 - More synchronization points may be added as required in the future. =20 - - @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL= instance. - @param[in] Phase The phase during enumeration. - @param[in] Channel Zero-based channel number. - - @retval EFI_SUCCESS The notification was accepted without an= y errors. - @retval EFI_UNSUPPORTED Phase is not supported. - @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >=3D Channel= Count). - @retval EFI_NOT_READY This phase cannot be entered at this tim= e; for=20 - example, an attempt was made to enter a = Phase=20 - without having entered one or more previ= ous=20 - Phase. - -**/ -EFI_STATUS -EFIAPI -IdeInitNotifyPhase ( - IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This, - IN EFI_IDE_CONTROLLER_ENUM_PHASE Phase, - IN UINT8 Channel - ) -; - -/** - Submits the device information to the IDE controller driver. - - This function is used by the driver entity to pass detailed information = about=20 - a particular device to the IDE controller driver. The driver entity obta= ins=20 - this information by issuing an ATA or ATAPI IDENTIFY_DEVICE command. Ide= ntifyData - is the pointer to the response data buffer. The IdentifyData buffer is o= wned=20 - by the driver entity, and the IDE controller driver must make a local co= py=20 - of the entire buffer or parts of the buffer as needed. The original Iden= tifyData=20 - buffer pointer may not be valid when - =20 - - EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() or - - EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() is called at a lat= er point. - =20 - The IDE controller driver may consult various fields of EFI_IDENTIFY_DAT= A to=20 - compute the optimum mode for the device. These fields are not limited to= the=20 - timing information. For example, an implementation of the IDE controller= driver=20 - may examine the vendor and type/mode field to match known bad drives. =20 - =20 - The driver entity may submit drive information in any order, as long as = it=20 - submits information for all the devices belonging to the enumeration gro= up=20 - before EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() is called for an= y device - in that enumeration group. If a device is absent, EFI_IDE_CONTROLLER_INI= T_PROTOCOL.SubmitData() - should be called with IdentifyData set to NULL. The IDE controller driv= er may=20 - not have any other mechanism to know whether a device is present or not.= Therefore,=20 - setting IdentifyData to NULL does not constitute an error condition.=20 - EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitData() can be called only once fo= r a=20 - given (Channel, Device) pair. =20 - =20 - @param[in] This A pointer to the EFI_IDE_CONTROLLER_INIT_PROTO= COL instance. - @param[in] Channel Zero-based channel number. - @param[in] Device Zero-based device number on the Channel. - @param[in] IdentifyData The device's response to the ATA IDENTIFY_DEVI= CE command. - - @retval EFI_SUCCESS The information was accepted without any= errors. - @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >=3D Channel= Count). - @retval EFI_INVALID_PARAMETER Device is invalid. - -**/ -EFI_STATUS -EFIAPI -IdeInitSubmitData ( - IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This, - IN UINT8 Channel, - IN UINT8 Device, - IN EFI_IDENTIFY_DATA *IdentifyData - ) -; - -/** - Disqualifies specific modes for an IDE device. - - This function allows the driver entity or other drivers (such as platfor= m=20 - drivers) to reject certain timing modes and request the IDE controller d= river - to recalculate modes. This function allows the driver entity and the IDE=20 - controller driver to negotiate the timings on a per-device basis. This f= unction=20 - is useful in the case of drives that lie about their capabilities. An ex= ample=20 - is when the IDE device fails to accept the timing modes that are calcula= ted=20 - by the IDE controller driver based on the response to the Identify Drive= command. - - If the driver entity does not want to limit the ATA timing modes and lea= ve that=20 - decision to the IDE controller driver, it can either not call this funct= ion for=20 - the given device or call this function and set the Valid flag to FALSE f= or all=20 - modes that are listed in EFI_ATA_COLLECTIVE_MODE. - =20 - The driver entity may disqualify modes for a device in any order and any= number=20 - of times. - =20 - This function can be called multiple times to invalidate multiple modes = of the=20 - same type (e.g., Programmed Input/Output [PIO] modes 3 and 4). See the A= TA/ATAPI=20 - specification for more information on PIO modes. =20 - =20 - For Serial ATA (SATA) controllers, this member function can be used to d= isqualify - a higher transfer rate mode on a given channel. For example, a platform = driver - may inform the IDE controller driver to not use second-generation (Gen2)= speeds=20 - for a certain SATA drive. - =20 - @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCO= L instance. - @param[in] Channel The zero-based channel number. - @param[in] Device The zero-based device number on the Channel. - @param[in] BadModes The modes that the device does not support and that - should be disqualified. - - @retval EFI_SUCCESS The modes were accepted without any erro= rs. - @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >=3D Channel= Count). - @retval EFI_INVALID_PARAMETER Device is invalid. - @retval EFI_INVALID_PARAMETER IdentifyData is NULL. - =20 -**/ -EFI_STATUS -EFIAPI -IdeInitDisqualifyMode ( - IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This, - IN UINT8 Channel, - IN UINT8 Device, - IN EFI_ATA_COLLECTIVE_MODE *BadModes - ) -; - -/** - Returns the information about the optimum modes for the specified IDE de= vice. - - This function is used by the driver entity to obtain the optimum ATA mod= es for - a specific device. The IDE controller driver takes into account the fol= lowing=20 - while calculating the mode: - - The IdentifyData inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitDa= ta() - - The BadModes inputs to EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMo= de() - - The driver entity is required to call EFI_IDE_CONTROLLER_INIT_PROTOCOL.S= ubmitData()=20 - for all the devices that belong to an enumeration group before calling=20 - EFI_IDE_CONTROLLER_INIT_PROTOCOL.CalculateMode() for any device in the s= ame group. =20 - =20 - The IDE controller driver will use controller- and possibly platform-spe= cific=20 - algorithms to arrive at SupportedModes. The IDE controller may base its=20 - decision on user preferences and other considerations as well. This func= tion=20 - may be called multiple times because the driver entity may renegotiate t= he mode=20 - with the IDE controller driver using EFI_IDE_CONTROLLER_INIT_PROTOCOL.Di= squalifyMode(). - =20 - The driver entity may collect timing information for various devices in = any=20 - order. The driver entity is responsible for making sure that all the dep= endencies - are satisfied. For example, the SupportedModes information for device A = that=20 - was previously returned may become stale after a call to=20 - EFI_IDE_CONTROLLER_INIT_PROTOCOL.DisqualifyMode() for device B. - =20 - The buffer SupportedModes is allocated by the callee because the caller = does=20 - not necessarily know the size of the buffer. The type EFI_ATA_COLLECTIVE= _MODE=20 - is defined in a way that allows for future extensibility and can be of v= ariable=20 - length. This memory pool should be deallocated by the caller when it is = no=20 - longer necessary. =20 - =20 - The IDE controller driver for a Serial ATA (SATA) controller can use thi= s=20 - member function to force a lower speed (first-generation [Gen1] speeds o= n a=20 - second-generation [Gen2]-capable hardware). The IDE controller driver c= an=20 - also allow the driver entity to stay with the speed that has been negoti= ated=20 - by the physical layer. - =20 - @param[in] This The pointer to the EFI_IDE_CONTROLLER_INIT_= PROTOCOL instance. - @param[in] Channel A zero-based channel number. - @param[in] Device A zero-based device number on the Channel. - @param[out] SupportedModes The optimum modes for the device. - - @retval EFI_SUCCESS SupportedModes was returned. - @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >=3D Channel= Count). - @retval EFI_INVALID_PARAMETER Device is invalid.=20 - @retval EFI_INVALID_PARAMETER SupportedModes is NULL. - @retval EFI_NOT_READY Modes cannot be calculated due to a lack= of=20 - data. This error may happen if=20 - EFI_IDE_CONTROLLER_INIT_PROTOCOL.SubmitD= ata()=20 - and EFI_IDE_CONTROLLER_INIT_PROTOCOL.Dis= qualifyData()=20 - were not called for at least one drive i= n the=20 - same enumeration group. - -**/ -EFI_STATUS -EFIAPI -IdeInitCalculateMode ( - IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This, - IN UINT8 Channel, - IN UINT8 Device, - OUT EFI_ATA_COLLECTIVE_MODE **SupportedModes - ) -; - -/** - Commands the IDE controller driver to program the IDE controller hardware - so that the specified device can operate at the specified mode. - - This function is used by the driver entity to instruct the IDE controlle= r=20 - driver to program the IDE controller hardware to the specified modes. Th= is=20 - function can be called only once for a particular device. For a Serial A= TA=20 - (SATA) Advanced Host Controller Interface (AHCI) controller, no controll= er- - specific programming may be required. - - @param[in] This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL ins= tance. - @param[in] Channel Zero-based channel number. - @param[in] Device Zero-based device number on the Channel. - @param[in] Modes The modes to set. - - @retval EFI_SUCCESS The command was accepted without any err= ors. - @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >=3D Channel= Count). - @retval EFI_INVALID_PARAMETER Device is invalid. - @retval EFI_NOT_READY Modes cannot be set at this time due to = lack of data. - @retval EFI_DEVICE_ERROR Modes cannot be set due to hardware fail= ure. - The driver entity should not use this de= vice. - -**/ -EFI_STATUS -EFIAPI -IdeInitSetTiming ( - IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This, - IN UINT8 Channel, - IN UINT8 Device, - IN EFI_ATA_COLLECTIVE_MODE *Modes - ) -; - -// -// Forward reference declaration -// -/** - Retrieves a Unicode string that is the user readable name of the UEFI Dr= iver. - - @param This A pointer to the EFI_COMPONENT_NAME_PROTOCOL insta= nce. - @param Language A pointer to a three character ISO 639-2 language = identifier. - This is the language of the driver name that that = the caller - is requesting, and it must match one of the langua= ges specified - in SupportedLanguages. The number of languages su= pported by a - driver is up to the driver writer. - @param DriverName A pointer to the Unicode string to return. This U= nicode string - is the name of the driver specified by This in the= language - specified by Language. - - @retval EFI_SUCCESS The Unicode string for the Driver specifie= d by This - and the language specified by Language was= returned - in DriverName. - @retval EFI_INVALID_PARAMETER Language is NULL. - @retval EFI_INVALID_PARAMETER DriverName is NULL. - @retval EFI_UNSUPPORTED The driver specified by This does not supp= ort the - language specified by Language. -**/ -EFI_STATUS -EFIAPI -SataControllerComponentNameGetDriverName ( - IN EFI_COMPONENT_NAME_PROTOCOL *This, - IN CHAR8 *Language, - OUT CHAR16 **DriverName - ) -; - -/** - Retrieves a Unicode string that is the user readable name of the control= ler - that is being managed by an UEFI Driver. - - @param This A pointer to the EFI_COMPONENT_NAME_PROTOC= OL instance. - @param ControllerHandle The handle of a controller that the driver= specified by - This is managing. This handle specifies t= he controller - whose name is to be returned. - @param OPTIONAL ChildHandle The handle of the child controller to retr= ieve the name - of. This is an optional parameter that ma= y be NULL. It - will be NULL for device drivers. It will = also be NULL - for a bus drivers that wish to retrieve th= e name of the - bus controller. It will not be NULL for a= bus driver - that wishes to retrieve the name of a chil= d controller. - @param Language A pointer to a three character ISO 639-2 l= anguage - identifier. This is the language of the c= ontroller name - that that the caller is requesting, and it= must match one - of the languages specified in SupportedLan= guages. The - number of languages supported by a driver = is up to the - driver writer. - @param ControllerName A pointer to the Unicode string to return.= This Unicode - string is the name of the controller speci= fied by - ControllerHandle and ChildHandle in the la= nguage - specified by Language from the point of vi= ew of the - driver specified by This. - - @retval EFI_SUCCESS The Unicode string for the user readable n= ame in the - language specified by Language for the dri= ver - specified by This was returned in DriverNa= me. - @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE. - @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a va= lid - EFI_HANDLE. - @retval EFI_INVALID_PARAMETER Language is NULL. - @retval EFI_INVALID_PARAMETER ControllerName is NULL. - @retval EFI_UNSUPPORTED The driver specified by This is not curren= tly - managing the controller specified by - ControllerHandle and ChildHandle. - @retval EFI_UNSUPPORTED The driver specified by This does not supp= ort the - language specified by Language. -**/ -EFI_STATUS -EFIAPI -SataControllerComponentNameGetControllerName ( - IN EFI_COMPONENT_NAME_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN EFI_HANDLE ChildHandle OPTIONAL, - IN CHAR8 *Language, - OUT CHAR16 **ControllerName - ) -; - -#endif diff --git a/CorebootModulePkg/SataControllerDxe/SataControllerDxe.inf b/Co= rebootModulePkg/SataControllerDxe/SataControllerDxe.inf deleted file mode 100644 index 33d97a3a29..0000000000 --- a/CorebootModulePkg/SataControllerDxe/SataControllerDxe.inf +++ /dev/null @@ -1,43 +0,0 @@ -## @file -# =20 -# Component description file for the Sata Controller driver. -# -# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent -# =20 -## - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D SataController - FILE_GUID =3D 8F4CD826-A5A0-4e93-9522-CFB0AB72926C - MODULE_TYPE =3D UEFI_DRIVER - VERSION_STRING =3D 1.0 - ENTRY_POINT =3D InitializeSataControllerDriver - -# -# The following information is for reference only and not required by the = build tools. -# -# VALID_ARCHITECTURES =3D IA32 X64 EBC -# - -[Sources] - ComponentName.c - SataController.c - SataController.h - -[Packages] - MdePkg/MdePkg.dec - -[LibraryClasses] - UefiDriverEntryPoint - DebugLib - UefiLib - BaseLib - BaseMemoryLib - MemoryAllocationLib - UefiBootServicesTableLib - -[Protocols] - gEfiPciIoProtocolGuid =20 - gEfiIdeControllerInitProtocolGuid diff --git a/CorebootModulePkg/SecCore/FindPeiCore.c b/CorebootModulePkg/Se= cCore/FindPeiCore.c deleted file mode 100644 index ff07bc24cc..0000000000 --- a/CorebootModulePkg/SecCore/FindPeiCore.c +++ /dev/null @@ -1,193 +0,0 @@ -/** @file - Locate the entry point for the PEI Core - -Copyright (c) 2013, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include -#include -#include - -#include "SecMain.h" - -/** - Find core image base. - =20 - @param BootFirmwareVolumePtr Point to the boot firmware volume. - @param SecCoreImageBase The base address of the SEC core image. - @param PeiCoreImageBase The base address of the PEI core image. - -**/ -EFI_STATUS -EFIAPI -FindImageBase ( - IN EFI_FIRMWARE_VOLUME_HEADER *BootFirmwareVolumePtr, - OUT EFI_PHYSICAL_ADDRESS *SecCoreImageBase, - OUT EFI_PHYSICAL_ADDRESS *PeiCoreImageBase - ) -{ - EFI_PHYSICAL_ADDRESS CurrentAddress; - EFI_PHYSICAL_ADDRESS EndOfFirmwareVolume; - EFI_FFS_FILE_HEADER *File; - UINT32 Size; - EFI_PHYSICAL_ADDRESS EndOfFile; - EFI_COMMON_SECTION_HEADER *Section; - EFI_PHYSICAL_ADDRESS EndOfSection; - - *SecCoreImageBase =3D 0; - *PeiCoreImageBase =3D 0; - - CurrentAddress =3D (EFI_PHYSICAL_ADDRESS)(UINTN) BootFirmwareVolumePtr; - EndOfFirmwareVolume =3D CurrentAddress + BootFirmwareVolumePtr->FvLength; - - // - // Loop through the FFS files in the Boot Firmware Volume - // - for (EndOfFile =3D CurrentAddress + BootFirmwareVolumePtr->HeaderLength;= ; ) { - - CurrentAddress =3D (EndOfFile + 7) & 0xfffffffffffffff8ULL; - if (CurrentAddress > EndOfFirmwareVolume) { - return EFI_NOT_FOUND; - } - - File =3D (EFI_FFS_FILE_HEADER*)(UINTN) CurrentAddress; - if (IS_FFS_FILE2 (File)) { - Size =3D FFS_FILE2_SIZE (File); - if (Size <=3D 0x00FFFFFF) { - return EFI_NOT_FOUND; - } - } else { - Size =3D FFS_FILE_SIZE (File); - if (Size < sizeof (EFI_FFS_FILE_HEADER)) { - return EFI_NOT_FOUND; - } - } - - EndOfFile =3D CurrentAddress + Size; - if (EndOfFile > EndOfFirmwareVolume) { - return EFI_NOT_FOUND; - } - - // - // Look for SEC Core / PEI Core files - // - if (File->Type !=3D EFI_FV_FILETYPE_SECURITY_CORE && - File->Type !=3D EFI_FV_FILETYPE_PEI_CORE) { - continue; - } - - // - // Loop through the FFS file sections within the FFS file - // - if (IS_FFS_FILE2 (File)) { - EndOfSection =3D (EFI_PHYSICAL_ADDRESS) (UINTN) ((UINT8 *) File + si= zeof (EFI_FFS_FILE_HEADER2)); - } else { - EndOfSection =3D (EFI_PHYSICAL_ADDRESS) (UINTN) ((UINT8 *) File + si= zeof (EFI_FFS_FILE_HEADER)); - } - for (;;) { - CurrentAddress =3D (EndOfSection + 3) & 0xfffffffffffffffcULL; - Section =3D (EFI_COMMON_SECTION_HEADER*)(UINTN) CurrentAddress; - - if (IS_SECTION2 (Section)) { - Size =3D SECTION2_SIZE (Section); - if (Size <=3D 0x00FFFFFF) { - return EFI_NOT_FOUND; - } - } else { - Size =3D SECTION_SIZE (Section); - if (Size < sizeof (EFI_COMMON_SECTION_HEADER)) { - return EFI_NOT_FOUND; - } - } - - EndOfSection =3D CurrentAddress + Size; - if (EndOfSection > EndOfFile) { - return EFI_NOT_FOUND; - } - - // - // Look for executable sections - // - if (Section->Type =3D=3D EFI_SECTION_PE32 || Section->Type =3D=3D EF= I_SECTION_TE) { - if (File->Type =3D=3D EFI_FV_FILETYPE_SECURITY_CORE) { - if (IS_SECTION2 (Section)) { - *SecCoreImageBase =3D (PHYSICAL_ADDRESS) (UINTN) ((UINT8 *) Se= ction + sizeof (EFI_COMMON_SECTION_HEADER2)); - } else { - *SecCoreImageBase =3D (PHYSICAL_ADDRESS) (UINTN) ((UINT8 *) Se= ction + sizeof (EFI_COMMON_SECTION_HEADER)); - } - } else { - if (IS_SECTION2 (Section)) { - *PeiCoreImageBase =3D (PHYSICAL_ADDRESS) (UINTN) ((UINT8 *) Se= ction + sizeof (EFI_COMMON_SECTION_HEADER2)); - } else { - *PeiCoreImageBase =3D (PHYSICAL_ADDRESS) (UINTN) ((UINT8 *) Se= ction + sizeof (EFI_COMMON_SECTION_HEADER)); - } - } - break; - } - } - - // - // Both SEC Core and PEI Core images found - // - if (*SecCoreImageBase !=3D 0 && *PeiCoreImageBase !=3D 0) { - return EFI_SUCCESS; - } - } -} - -/** - Find and return Pei Core entry point. - - It also find SEC and PEI Core file debug information. It will report the= m if - remote debug is enabled. - =20 - @param BootFirmwareVolumePtr Point to the boot firmware volume. - @param PeiCoreEntryPoint The entry point of the PEI core. - -**/ -VOID -EFIAPI -FindAndReportEntryPoints ( - IN EFI_FIRMWARE_VOLUME_HEADER *BootFirmwareVolumePtr, - OUT EFI_PEI_CORE_ENTRY_POINT *PeiCoreEntryPoint - ) -{ - EFI_STATUS Status; - EFI_PHYSICAL_ADDRESS SecCoreImageBase; - EFI_PHYSICAL_ADDRESS PeiCoreImageBase; - PE_COFF_LOADER_IMAGE_CONTEXT ImageContext; - - // - // Find SEC Core and PEI Core image base - // - Status =3D FindImageBase (BootFirmwareVolumePtr, &SecCoreImageBase, &Pei= CoreImageBase); - ASSERT_EFI_ERROR (Status); - - ZeroMem ((VOID *) &ImageContext, sizeof (PE_COFF_LOADER_IMAGE_CONTEXT)); - // - // Report SEC Core debug information when remote debug is enabled - // - ImageContext.ImageAddress =3D SecCoreImageBase; - ImageContext.PdbPointer =3D PeCoffLoaderGetPdbPointer ((VOID*) (UINTN) I= mageContext.ImageAddress); - PeCoffLoaderRelocateImageExtraAction (&ImageContext); - - // - // Report PEI Core debug information when remote debug is enabled - // - ImageContext.ImageAddress =3D PeiCoreImageBase; - ImageContext.PdbPointer =3D PeCoffLoaderGetPdbPointer ((VOID*) (UINTN) I= mageContext.ImageAddress); - PeCoffLoaderRelocateImageExtraAction (&ImageContext); - - // - // Find PEI Core entry point - // - Status =3D PeCoffLoaderGetEntryPoint ((VOID *) (UINTN) PeiCoreImageBase,= (VOID**) PeiCoreEntryPoint); - if (EFI_ERROR (Status)) { - *PeiCoreEntryPoint =3D 0; - } - - return; -} - diff --git a/CorebootModulePkg/SecCore/Ia32/SecEntry.asm b/CorebootModulePk= g/SecCore/Ia32/SecEntry.asm deleted file mode 100644 index ca6aea04b9..0000000000 --- a/CorebootModulePkg/SecCore/Ia32/SecEntry.asm +++ /dev/null @@ -1,72 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2013, Intel Corporation. All rights reserved.
-; SPDX-License-Identifier: BSD-2-Clause-Patent -; -; Module Name: -; -; SecEntry.asm -; -; Abstract: -; -; This is the code that begins in protected mode. -; It will transfer the control to pei core. -; -;-------------------------------------------------------------------------= ----- -#include - -.686p -.xmm -.model small, c - -EXTRN SecStartup:NEAR - -; Pcds -EXTRN PcdGet32 (PcdPayloadFdMemBase):DWORD - - .code - -; -; SecCore Entry Point -; -; Processor is in flat protected mode -; -; @param[in] EAX Initial value of the EAX register (BIST: Built-in Self= Test) -; @param[in] DI 'BP': boot-strap processor, or 'AP': application proce= ssor -; @param[in] EBP Pointer to the start of the Boot Firmware Volume -; -; @return None This routine does not return -; - -_ModuleEntryPoint PROC PUBLIC=20 - ; - ; Disable all the interrupts - ; =20 - cli - ; - ; Construct the temporary memory at 0x80000, length 0x10000 - ; - mov esp, (BASE_512KB + SIZE_64KB) - =20 - ; - ; Pass BFV into the PEI Core - ; - push PcdGet32 (PcdPayloadFdMemBase) - - ; - ; Pass stack base into the PEI Core - ; - push BASE_512KB - - ; - ; Pass stack size into the PEI Core - ; - push SIZE_64KB - - ; - ; Pass Control into the PEI Core - ; - call SecStartup -_ModuleEntryPoint ENDP - -END diff --git a/CorebootModulePkg/SecCore/Ia32/SecEntry.nasm b/CorebootModuleP= kg/SecCore/Ia32/SecEntry.nasm deleted file mode 100644 index 0a55a65e96..0000000000 --- a/CorebootModulePkg/SecCore/Ia32/SecEntry.nasm +++ /dev/null @@ -1,66 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
-; SPDX-License-Identifier: BSD-2-Clause-Patent -; -; Abstract: -; -; Entry point for the coreboot UEFI payload. -; -;-------------------------------------------------------------------------= ----- - -SECTION .text - -; C Functions -extern ASM_PFX(SecStartup) - -; Pcds -extern ASM_PFX(PcdGet32 (PcdPayloadFdMemBase)) - -; -; SecCore Entry Point -; -; Processor is in flat protected mode -; -; @param[in] EAX Initial value of the EAX register (BIST: Built-in Self= Test) -; @param[in] DI 'BP': boot-strap processor, or 'AP': application proce= ssor -; @param[in] EBP Pointer to the start of the Boot Firmware Volume -; -; @return None This routine does not return -; -global ASM_PFX(_ModuleEntryPoint) -ASM_PFX(_ModuleEntryPoint): - ; - ; Disable all the interrupts - ; - cli - ; - ; Construct the temporary memory at 0x80000, length 0x10000 - ; - mov esp, (BASE_512KB + SIZE_64KB) - - ; - ; Pass BFV into the PEI Core - ; - push DWORD [ASM_PFX(PcdGet32 (PcdPayloadFdMemBase))] - - ; - ; Pass stack base into the PEI Core - ; - push BASE_512KB - - ; - ; Pass stack size into the PEI Core - ; - push SIZE_64KB - - ; - ; Pass Control into the PEI Core - ; - call ASM_PFX(SecStartup) - - ; - ; Should never return - ; - jmp $ - diff --git a/CorebootModulePkg/SecCore/Ia32/Stack.asm b/CorebootModulePkg/S= ecCore/Ia32/Stack.asm deleted file mode 100644 index 76e1d4cd9f..0000000000 --- a/CorebootModulePkg/SecCore/Ia32/Stack.asm +++ /dev/null @@ -1,76 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2013, Intel Corporation. All rights reserved.
-; SPDX-License-Identifier: BSD-2-Clause-Patent -; -; Abstract: -; -; Switch the stack from temporary memory to permanent memory. -; -;-------------------------------------------------------------------------= ----- - - .586p - .model flat,C - .code - =20 -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; SecSwitchStack ( -; UINT32 TemporaryMemoryBase, -; UINT32 PermenentMemoryBase -; ); -;-------------------------------------------------------------------------= ----- =20 -SecSwitchStack PROC - ; - ; Save three register: eax, ebx, ecx - ; - push eax - push ebx - push ecx - push edx - =20 - ; - ; !!CAUTION!! this function address's is pushed into stack after - ; migration of whole temporary memory, so need save it to permanent - ; memory at first! - ; - =20 - mov ebx, [esp + 20] ; Save the first parameter - mov ecx, [esp + 24] ; Save the second parameter - =20 - ; - ; Save this function's return address into permanent memory at first. - ; Then, Fixup the esp point to permanent memory - ; - mov eax, esp - sub eax, ebx - add eax, ecx - mov edx, dword ptr [esp] ; copy pushed register's value to p= ermanent memory - mov dword ptr [eax], edx =20 - mov edx, dword ptr [esp + 4] - mov dword ptr [eax + 4], edx =20 - mov edx, dword ptr [esp + 8] - mov dword ptr [eax + 8], edx =20 - mov edx, dword ptr [esp + 12] - mov dword ptr [eax + 12], edx =20 - mov edx, dword ptr [esp + 16] ; Update this function's return add= ress into permanent memory - mov dword ptr [eax + 16], edx =20 - mov esp, eax ; From now, esp is pointed to perma= nent memory - =20 - ; - ; Fixup the ebp point to permanent memory - ; - mov eax, ebp - sub eax, ebx - add eax, ecx - mov ebp, eax ; From now, ebp is pointed to permanent = memory - =20 - pop edx - pop ecx - pop ebx - pop eax - ret -SecSwitchStack ENDP - - END diff --git a/CorebootModulePkg/SecCore/Ia32/Stack.nasm b/CorebootModulePkg/= SecCore/Ia32/Stack.nasm deleted file mode 100644 index 55fd2243c8..0000000000 --- a/CorebootModulePkg/SecCore/Ia32/Stack.nasm +++ /dev/null @@ -1,72 +0,0 @@ -;-------------------------------------------------------------------------= ----- -; -; Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
-; SPDX-License-Identifier: BSD-2-Clause-Patent -; -; Abstract: -; -; Switch the stack from temporary memory to permanent memory. -; -;-------------------------------------------------------------------------= ----- - -SECTION .text - -;-------------------------------------------------------------------------= ----- -; VOID -; EFIAPI -; SecSwitchStack ( -; UINT32 TemporaryMemoryBase, -; UINT32 PermenentMemoryBase -; ); -;-------------------------------------------------------------------------= ----- -global ASM_PFX(SecSwitchStack) -ASM_PFX(SecSwitchStack): - ; - ; Save three register: eax, ebx, ecx - ; - push eax - push ebx - push ecx - push edx - - ; - ; !!CAUTION!! this function address's is pushed into stack after - ; migration of whole temporary memory, so need save it to permanent - ; memory at first! - ; - - mov ebx, [esp + 20] ; Save the first parameter - mov ecx, [esp + 24] ; Save the second parameter - - ; - ; Save this function's return address into permanent memory at first. - ; Then, Fixup the esp point to permanent memory - ; - mov eax, esp - sub eax, ebx - add eax, ecx - mov edx, [esp] ; copy pushed register's value to perm= anent memory - mov [eax], edx - mov edx, [esp + 4] - mov [eax + 4], edx - mov edx, [esp + 8] - mov [eax + 8], edx - mov edx, [esp + 12] - mov [eax + 12], edx - mov edx, [esp + 16] ; Update return address into permanent= memory - mov [eax + 16], edx - mov esp, eax ; From now, esp is pointed to permanen= t memory - - ; - ; Fixup the ebp point to permanent memory - ; - mov eax, ebp - sub eax, ebx - add eax, ecx - mov ebp, eax ; From now, ebp is pointed to permanen= t memory - - pop edx - pop ecx - pop ebx - pop eax - ret diff --git a/CorebootModulePkg/SecCore/SecCore.inf b/CorebootModulePkg/SecC= ore/SecCore.inf deleted file mode 100644 index 900d9273a0..0000000000 --- a/CorebootModulePkg/SecCore/SecCore.inf +++ /dev/null @@ -1,57 +0,0 @@ -## @file -# This is the first module taking control from the coreboot. -# -# Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
-# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -# -## - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D SecCore - FILE_GUID =3D BA7BE337-6CFB-4dbb-B26C-21EC2FC16073 - MODULE_TYPE =3D SEC - VERSION_STRING =3D 1.0 - - -# -# The following information is for reference only and not required by the = build tools. -# -# VALID_ARCHITECTURES =3D IA32 X64 EBC -# - -[Sources] - SecMain.c - SecMain.h - FindPeiCore.c - -[Sources.IA32] - Ia32/Stack.nasm - Ia32/SecEntry.nasm - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - UefiCpuPkg/UefiCpuPkg.dec - CorebootModulePkg/CorebootModulePkg.dec - -[LibraryClasses] - BaseMemoryLib - DebugLib - BaseLib - PcdLib - DebugAgentLib - UefiCpuLib - PeCoffGetEntryPointLib - PeCoffExtraActionLib - -[Ppis] - gEfiSecPlatformInformationPpiGuid # PPI ALWAYS_PRODUCED - gEfiTemporaryRamSupportPpiGuid # PPI ALWAYS_PRODUCED - -[Pcd] - gUefiCorebootModulePkgTokenSpaceGuid.PcdPayloadFdMemBase - gUefiCorebootModulePkgTokenSpaceGuid.PcdPayloadFdMemSize - diff --git a/CorebootModulePkg/SecCore/SecMain.c b/CorebootModulePkg/SecCor= e/SecMain.c deleted file mode 100644 index 9095c90a84..0000000000 --- a/CorebootModulePkg/SecCore/SecMain.c +++ /dev/null @@ -1,285 +0,0 @@ -/** @file - C functions in SEC - -Copyright (c) 2013, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - - -#include "SecMain.h" - -EFI_PEI_TEMPORARY_RAM_SUPPORT_PPI gSecTemporaryRamSupportPpi =3D { - SecTemporaryRamSupport -}; - -EFI_PEI_PPI_DESCRIPTOR mPeiSecPlatformInformationPpi[] =3D { - { - (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), - &gEfiTemporaryRamSupportPpiGuid, - &gSecTemporaryRamSupportPpi - } -}; - -// -// These are IDT entries pointing to 10:FFFFFFE4h. -// -UINT64 mIdtEntryTemplate =3D 0xffff8e000010ffe4ULL; - -/** - Caller provided function to be invoked at the end of InitializeDebugAgen= t(). - - Entry point to the C language phase of SEC. After the SEC assembly - code has initialized some temporary memory and set up the stack, - the control is transferred to this function. - - @param[in] Context The first input parameter of InitializeDebugAgent(= ). - -**/ -VOID -EFIAPI -SecStartupPhase2( - IN VOID *Context - ); - - -/** - - Entry point to the C language phase of SEC. After the SEC assembly - code has initialized some temporary memory and set up the stack, - the control is transferred to this function. - - - @param SizeOfRam Size of the temporary memory available for us= e. - @param TempRamBase Base address of temporary ram - @param BootFirmwareVolume Base address of the Boot Firmware Volume. -**/ -VOID -EFIAPI -SecStartup ( - IN UINT32 SizeOfRam, - IN UINT32 TempRamBase, - IN VOID *BootFirmwareVolume - ) -{ - EFI_SEC_PEI_HAND_OFF SecCoreData; - IA32_DESCRIPTOR IdtDescriptor; - SEC_IDT_TABLE IdtTableInStack; - UINT32 Index; - UINT32 PeiStackSize; - - PeiStackSize =3D (SizeOfRam >> 1); - - ASSERT (PeiStackSize < SizeOfRam); - - // - // Process all libraries constructor function linked to SecCore. - // - ProcessLibraryConstructorList (); - - // - // Initialize floating point operating environment - // to be compliant with UEFI spec. - // - InitializeFloatingPointUnits (); - - - // |-------------------|----> - // |Idt Table | - // |-------------------| - // |PeiService Pointer | PeiStackSize - // |-------------------| - // | | - // | Stack | - // |-------------------|----> - // | | - // | | - // | Heap | PeiTemporaryRamSize - // | | - // | | - // |-------------------|----> TempRamBase - - IdtTableInStack.PeiService =3D 0; - for (Index =3D 0; Index < SEC_IDT_ENTRY_COUNT; Index ++) { - CopyMem ((VOID*)&IdtTableInStack.IdtTable[Index], (VOID*)&mIdtEntryTem= plate, sizeof (UINT64)); - } - - IdtDescriptor.Base =3D (UINTN) &IdtTableInStack.IdtTable; - IdtDescriptor.Limit =3D (UINT16)(sizeof (IdtTableInStack.IdtTable) - 1); - - AsmWriteIdtr (&IdtDescriptor); - - // - // Update the base address and length of Pei temporary memory - // - SecCoreData.DataSize =3D (UINT16) sizeof (EFI_SEC_PEI_HAND= _OFF); - SecCoreData.BootFirmwareVolumeBase =3D BootFirmwareVolume; - SecCoreData.BootFirmwareVolumeSize =3D (UINTN)(0x100000000ULL - (UINTN) = BootFirmwareVolume); - SecCoreData.TemporaryRamBase =3D (VOID*)(UINTN) TempRamBase; - SecCoreData.TemporaryRamSize =3D SizeOfRam; - SecCoreData.PeiTemporaryRamBase =3D SecCoreData.TemporaryRamBase; - SecCoreData.PeiTemporaryRamSize =3D SizeOfRam - PeiStackSize; - SecCoreData.StackBase =3D (VOID*)(UINTN)(TempRamBase + SecC= oreData.PeiTemporaryRamSize); - SecCoreData.StackSize =3D PeiStackSize; - - // - // Initialize Debug Agent to support source level debug in SEC/PEI phase= s before memory ready. - // - InitializeDebugAgent (DEBUG_AGENT_INIT_PREMEM_SEC, &SecCoreData, SecStar= tupPhase2); - -} - -/** - Caller provided function to be invoked at the end of InitializeDebugAgen= t(). - - Entry point to the C language phase of SEC. After the SEC assembly - code has initialized some temporary memory and set up the stack, - the control is transferred to this function. - - @param[in] Context The first input parameter of InitializeDebugAgent(= ). - -**/ -VOID -EFIAPI -SecStartupPhase2( - IN VOID *Context - ) -{ - EFI_SEC_PEI_HAND_OFF *SecCoreData; - EFI_PEI_CORE_ENTRY_POINT PeiCoreEntryPoint; - - SecCoreData =3D (EFI_SEC_PEI_HAND_OFF *) Context; - // - // Find Pei Core entry point. It will report SEC and Pei Core debug info= rmation if remote debug - // is enabled. - // - FindAndReportEntryPoints ((EFI_FIRMWARE_VOLUME_HEADER *) SecCoreData->Bo= otFirmwareVolumeBase, &PeiCoreEntryPoint); - if (PeiCoreEntryPoint =3D=3D NULL) - { - CpuDeadLoop (); - } - - // - // Transfer the control to the PEI core - // - ASSERT (PeiCoreEntryPoint !=3D NULL); - (*PeiCoreEntryPoint) (SecCoreData, (EFI_PEI_PPI_DESCRIPTOR *)&mPeiSecPla= tformInformationPpi); - - // - // Should not come here. - // - return ; -} - -/** - This service of the TEMPORARY_RAM_SUPPORT_PPI that migrates temporary RA= M into - permanent memory. - - @param PeiServices Pointer to the PEI Services Table. - @param TemporaryMemoryBase Source Address in temporary memory from wh= ich the SEC or PEIM will copy the - Temporary RAM contents. - @param PermanentMemoryBase Destination Address in permanent memory in= to which the SEC or PEIM will copy the - Temporary RAM contents. - @param CopySize Amount of memory to migrate from temporary= to permanent memory. - - @retval EFI_SUCCESS The data was successfully returned. - @retval EFI_INVALID_PARAMETER PermanentMemoryBase + CopySize > Temporary= MemoryBase when - TemporaryMemoryBase > PermanentMemoryBase. - -**/ -EFI_STATUS -EFIAPI -SecTemporaryRamSupport ( - IN CONST EFI_PEI_SERVICES **PeiServices, - IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase, - IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase, - IN UINTN CopySize - ) -{ - IA32_DESCRIPTOR IdtDescriptor; - VOID* OldHeap; - VOID* NewHeap; - VOID* OldStack; - VOID* NewStack; - DEBUG_AGENT_CONTEXT_POSTMEM_SEC DebugAgentContext; - BOOLEAN OldStatus; - UINTN PeiStackSize; - - PeiStackSize =3D (CopySize >> 1); - - ASSERT (PeiStackSize < CopySize); - - // - // |-------------------|----> - // | Stack | PeiStackSize - // |-------------------|----> - // | Heap | PeiTemporaryRamSize - // |-------------------|----> TempRamBase - // - // |-------------------|----> - // | Heap | PeiTemporaryRamSize - // |-------------------|----> - // | Stack | PeiStackSize - // |-------------------|----> PermanentMemoryBase - // - - OldHeap =3D (VOID*)(UINTN)TemporaryMemoryBase; - NewHeap =3D (VOID*)((UINTN)PermanentMemoryBase + PeiStackSize); - =20 - OldStack =3D (VOID*)((UINTN)TemporaryMemoryBase + CopySize - PeiStackSiz= e); - NewStack =3D (VOID*)(UINTN)PermanentMemoryBase; - - DebugAgentContext.HeapMigrateOffset =3D (UINTN)NewHeap - (UINTN)OldHeap; - DebugAgentContext.StackMigrateOffset =3D (UINTN)NewStack - (UINTN)OldSta= ck; - =20 - OldStatus =3D SaveAndSetDebugTimerInterrupt (FALSE); - // - // Initialize Debug Agent to support source level debug in PEI phase aft= er memory ready. - // It will build HOB and fix up the pointer in IDT table. - // - InitializeDebugAgent (DEBUG_AGENT_INIT_POSTMEM_SEC, (VOID *) &DebugAgent= Context, NULL); - - // - // Migrate Heap - // - CopyMem (NewHeap, OldHeap, CopySize - PeiStackSize); - - // - // Migrate Stack - // - CopyMem (NewStack, OldStack, PeiStackSize); - - - // - // We need *not* fix the return address because currently, - // The PeiCore is executed in flash. - // - - // - // Rebase IDT table in permanent memory - // - AsmReadIdtr (&IdtDescriptor); - IdtDescriptor.Base =3D IdtDescriptor.Base - (UINTN)OldStack + (UINTN)New= Stack; - - AsmWriteIdtr (&IdtDescriptor); - - - // - // Program MTRR - // - - // - // SecSwitchStack function must be invoked after the memory migration - // immediately, also we need fixup the stack change caused by new call i= nto - // permanent memory. - // - SecSwitchStack ( - (UINT32) (UINTN) OldStack, - (UINT32) (UINTN) NewStack - ); - - SaveAndSetDebugTimerInterrupt (OldStatus); - =20 - return EFI_SUCCESS; -} - diff --git a/CorebootModulePkg/SecCore/SecMain.h b/CorebootModulePkg/SecCor= e/SecMain.h deleted file mode 100644 index 624f967fec..0000000000 --- a/CorebootModulePkg/SecCore/SecMain.h +++ /dev/null @@ -1,128 +0,0 @@ -/** @file - Master header file for SecCore. - -Copyright (c) 2013, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#ifndef _SEC_CORE_H_ -#define _SEC_CORE_H_ - - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - - -#define SEC_IDT_ENTRY_COUNT 34 - -typedef struct _SEC_IDT_TABLE { - // - // Reserved 8 bytes preceding IDT to store EFI_PEI_SERVICES**, since IDT= base - // address should be 8-byte alignment. - // Note: For IA32, only the 4 bytes immediately preceding IDT is used to= store - // EFI_PEI_SERVICES** - // - UINT64 PeiService; =20 - UINT64 IdtTable[SEC_IDT_ENTRY_COUNT]; -} SEC_IDT_TABLE; - -/** - Switch the stack in the temporary memory to the one in the permanent mem= ory. - - This function must be invoked after the memory migration immediately. Th= e relative - position of the stack in the temporary and permanent memory is same. - - @param TemporaryMemoryBase Base address of the temporary memory. - @param PermenentMemoryBase Base address of the permanent memory. -**/ -VOID -EFIAPI -SecSwitchStack ( - UINT32 TemporaryMemoryBase, - UINT32 PermenentMemoryBase - ); - -/** - This service of the TEMPORARY_RAM_SUPPORT_PPI that migrates temporary RA= M into - permanent memory. - - @param PeiServices Pointer to the PEI Services Table. - @param TemporaryMemoryBase Source Address in temporary memory from wh= ich the SEC or PEIM will copy the - Temporary RAM contents. - @param PermanentMemoryBase Destination Address in permanent memory in= to which the SEC or PEIM will copy the - Temporary RAM contents. - @param CopySize Amount of memory to migrate from temporary= to permanent memory. - - @retval EFI_SUCCESS The data was successfully returned. - @retval EFI_INVALID_PARAMETER PermanentMemoryBase + CopySize > Temporary= MemoryBase when - TemporaryMemoryBase > PermanentMemoryBase. - -**/ -EFI_STATUS -EFIAPI -SecTemporaryRamSupport ( - IN CONST EFI_PEI_SERVICES **PeiServices, - IN EFI_PHYSICAL_ADDRESS TemporaryMemoryBase, - IN EFI_PHYSICAL_ADDRESS PermanentMemoryBase, - IN UINTN CopySize - ); - -/** - Entry point to the C language phase of SEC. After the SEC assembly - code has initialized some temporary memory and set up the stack, - the control is transferred to this function. - - @param SizeOfRam Size of the temporary memory available for us= e. - @param TempRamBase Base address of temporary ram - @param BootFirmwareVolume Base address of the Boot Firmware Volume. -**/ -VOID -EFIAPI -SecStartup ( - IN UINT32 SizeOfRam, - IN UINT32 TempRamBase, - IN VOID *BootFirmwareVolume - ); - -/** - Find and return Pei Core entry point. - - It also find SEC and PEI Core file debug information. It will report the= m if - remote debug is enabled. - - @param BootFirmwareVolumePtr Point to the boot firmware volume. - @param PeiCoreEntryPoint Point to the PEI core entry point. - -**/ -VOID -EFIAPI -FindAndReportEntryPoints ( - IN EFI_FIRMWARE_VOLUME_HEADER *BootFirmwareVolumePtr, - OUT EFI_PEI_CORE_ENTRY_POINT *PeiCoreEntryPoint - ); - -/** - Autogenerated function that calls the library constructors for all of th= e module's - dependent libraries. This function must be called by the SEC Core once = a stack has - been established. - -**/ -VOID -EFIAPI -ProcessLibraryConstructorList ( - VOID - ); - =20 -#endif --=20 2.16.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#40145): https://edk2.groups.io/g/devel/message/40145 Mute This Topic: https://groups.io/mt/31537332/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Fri May 3 09:56:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+40146+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+40146+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1557268054; cv=none; d=zoho.com; s=zohoarc; b=UtCF9TPfbaF6bspnXmLOBHW5fw1SbTyuZDLNuqkUEoBm2XB+S9fQeR9KPSuUGEB0pqaQWC60XNLQ9E+Xk0SoSp+yCIbGfxJ3XsP5XD5mrd3KFvxxU0GKAp5MQgALfjEW+XlfqJyi9IR1E7E5dlY5QWOLEJe0rykTwIY6hWYyo4s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1557268054; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=7ckOFjD9fTWkaxPVZBi6hA2Dirt5/q7Oidy+uHugLmg=; b=RL7r10Rab2o3eB9LLmiZOaVVbLhOO7eFeTghugLVud9Y7K9IDYMNghJDMRXQKqEIzfv8r859hF0f9pbjiEWqgpNNvp+bv1WkklkY17aM9R+0JqFfvjS4FkaSfU/zTyZk9z3oVXrk6+6pCMAYIokLhNX+2A8NmClnDJYE/4aRO08= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+40146+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1557268054635428.7414439644307; Tue, 7 May 2019 15:27:34 -0700 (PDT) Return-Path: X-Received: from mga06.intel.com (mga06.intel.com []) by groups.io with SMTP; Tue, 07 May 2019 15:27:33 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 May 2019 15:27:32 -0700 X-ExtLoop1: 1 X-Received: from gdong1-mobl.amr.corp.intel.com ([10.78.24.216]) by orsmga003.jf.intel.com with ESMTP; 07 May 2019 15:27:31 -0700 From: "Guo Dong" To: devel@edk2.groups.io Cc: maurice.ma@intel.com, prince.agyeman@intel.com, benjamin.you@intel.com, guo.dong@intel.com Subject: [edk2-devel] [PATCH 2/2] Retire CorebootPayloadPkg from EDK2 Date: Tue, 7 May 2019 15:27:28 -0700 Message-Id: <20190507222728.28296-3-guo.dong@intel.com> In-Reply-To: <20190507222728.28296-1-guo.dong@intel.com> References: <20190507222728.28296-1-guo.dong@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,guo.dong@intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1557268054; bh=3lFFogbbG7JTFK20rFc1S/ieNYbcARhwTrZeaFIIbI8=; h=Cc:Date:From:Reply-To:Subject:To; b=fzjx37CffVxSBBKrYPGg45yNQzBY25X6E0lmkgnk2XaT5WPk8Zc6WlCYgEHT4H1j6Vp jlOjt43LMFheIzrHDMICSoW5AGjLi5UfZ1so1GOhzI9ZOYCYxG2pLhE/P+TZhDdHcmjqS gTE9fsbAj6VOFNimNT/F9ek0xz1npKBJ5Zw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Since UefiPayloadPkg in EDK2 supports Coreboot and Slim Bootloader, and I d= on't receive any concerns for the RFC to remove CorebootModulePkg and CorebootPayloadPkg from EDK2 (https://edk2.groups.io/g/devel/message/39126), here is the action patch to remove CorebootPayloadPkg. Signed-off-by: Guo Dong Reviewed-by: Maurice Ma --- .../BuildAndIntegrationInstructions.txt | 82 -- CorebootPayloadPkg/CorebootPayloadPkg.dec | 48 - CorebootPayloadPkg/CorebootPayloadPkg.fdf | 285 ---- CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc | 574 -------- CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc | 575 -------- CorebootPayloadPkg/FbGop/ComponentName.c | 306 ---- CorebootPayloadPkg/FbGop/FbGop.c | 1536 ----------------= ---- CorebootPayloadPkg/FbGop/FbGop.h | 413 ------ CorebootPayloadPkg/FbGop/FbGop.inf | 63 - .../Library/AcpiTimerLib/AcpiTimerLib.c | 270 ---- .../Library/AcpiTimerLib/AcpiTimerLib.inf | 40 - .../Library/PciHostBridgeLib/PciHostBridge.h | 80 - .../Library/PciHostBridgeLib/PciHostBridgeLib.c | 222 --- .../Library/PciHostBridgeLib/PciHostBridgeLib.inf | 41 - .../PciHostBridgeLib/PciHostBridgeSupport.c | 584 -------- .../PlatformBootManagerLib/PlatformBootManager.c | 265 ---- .../PlatformBootManagerLib/PlatformBootManager.h | 121 -- .../PlatformBootManagerLib.inf | 74 - .../PlatformBootManagerLib/PlatformConsole.c | 611 -------- .../PlatformBootManagerLib/PlatformConsole.h | 70 - .../Library/PlatformBootManagerLib/PlatformData.c | 19 - .../Library/PlatformHookLib/PlatformHookLib.c | 105 -- .../Library/PlatformHookLib/PlatformHookLib.inf | 39 - .../Library/ResetSystemLib/ResetSystemLib.c | 221 --- .../Library/ResetSystemLib/ResetSystemLib.inf | 38 - 25 files changed, 6682 deletions(-) delete mode 100644 CorebootPayloadPkg/BuildAndIntegrationInstructions.txt delete mode 100644 CorebootPayloadPkg/CorebootPayloadPkg.dec delete mode 100644 CorebootPayloadPkg/CorebootPayloadPkg.fdf delete mode 100644 CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc delete mode 100644 CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc delete mode 100644 CorebootPayloadPkg/FbGop/ComponentName.c delete mode 100644 CorebootPayloadPkg/FbGop/FbGop.c delete mode 100644 CorebootPayloadPkg/FbGop/FbGop.h delete mode 100644 CorebootPayloadPkg/FbGop/FbGop.inf delete mode 100644 CorebootPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.c delete mode 100644 CorebootPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf delete mode 100644 CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBrid= ge.h delete mode 100644 CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBrid= geLib.c delete mode 100644 CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBrid= geLib.inf delete mode 100644 CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBrid= geSupport.c delete mode 100644 CorebootPayloadPkg/Library/PlatformBootManagerLib/Platf= ormBootManager.c delete mode 100644 CorebootPayloadPkg/Library/PlatformBootManagerLib/Platf= ormBootManager.h delete mode 100644 CorebootPayloadPkg/Library/PlatformBootManagerLib/Platf= ormBootManagerLib.inf delete mode 100644 CorebootPayloadPkg/Library/PlatformBootManagerLib/Platf= ormConsole.c delete mode 100644 CorebootPayloadPkg/Library/PlatformBootManagerLib/Platf= ormConsole.h delete mode 100644 CorebootPayloadPkg/Library/PlatformBootManagerLib/Platf= ormData.c delete mode 100644 CorebootPayloadPkg/Library/PlatformHookLib/PlatformHook= Lib.c delete mode 100644 CorebootPayloadPkg/Library/PlatformHookLib/PlatformHook= Lib.inf delete mode 100644 CorebootPayloadPkg/Library/ResetSystemLib/ResetSystemLi= b.c delete mode 100644 CorebootPayloadPkg/Library/ResetSystemLib/ResetSystemLi= b.inf diff --git a/CorebootPayloadPkg/BuildAndIntegrationInstructions.txt b/Coreb= ootPayloadPkg/BuildAndIntegrationInstructions.txt deleted file mode 100644 index 6cc3d95827..0000000000 --- a/CorebootPayloadPkg/BuildAndIntegrationInstructions.txt +++ /dev/null @@ -1,82 +0,0 @@ -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D -Build And Integration Instructions -2014 June 24th -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D - -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D -DISCLAIMER -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D -This release note as well as the software described in it is furnished und= er license -and may only be used or copied in accordance with the terms of the license= . The -information in this manual is furnished for informational use only, is sub= ject to -change without notice, and should not be construed as a commitment by Inte= l Corporation. -Intel Corporation assumes no responsibility or liability for any errors or= inaccuracies -that may appear in this document or any software that may be provided in a= ssociation -with this document. -Except as permitted by such license, no part of this document may be repro= duced, -stored in a retrieval system, or transmitted in any form or by any means w= ithout -the express written consent of Intel Corporation. - -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D - INDEX -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D -A. INTRODUCTION -B. HOW TO BUILD -C. HOW TO INTEGRATE=20 - -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D -A. INTRODUCTION -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D -This document provides instructions on how to build Coreboot Uefi Payload = and=20 -how to integrate it into coreboot firmware. - -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D -B. HOW TO BUILD=20 -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D -1. Run the below two commands in windows command prompt window: - edksetup.bat - =20 - For debug ia32 build: - build -a IA32 -p CorebootPayloadPkg\CorebootPayloadPkgIa32.dsc -b DEBUG= -t - =20 - For release ia32 build: - build -a IA32 -p CorebootPayloadPkg\CorebootPayloadPkgIa32.dsc -b RELEA= SE -t - =20 - For debug X64 build: - build -a IA32 -a X64 -p CorebootPayloadPkg\CorebootPayloadPkgIa32X64.ds= c -b DEBUG -t - =20 - For release X64 build: - build -a IA32 -a X64 -p CorebootPayloadPkg\CorebootPayloadPkgIa32X64.ds= c -b RELEASE -t - =20 - is the EDK II build environment on your host. Currently it = was tested with VS2008x64 toolchain. - - For details about EDK II build steps, refer to http://svn.code.sf.net/p= /edk2/code/branches/UDK2014/BuildNotes2.txt - =20 -2. If build is successfully, the payload image (UEFIPAYLOAD.fd) will be ge= nerated inside the folder of Build\CorebootPayloadPkg. - -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D -C. HOW TO INTEGRATE -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D -1. Copy the payload image (UEFIPAYLOAD.fd) into the top-level directory of= Coreboot source tree. -2. Run "make menuconfig" in linux console to start Coreboot configuration = surface. -3. In the Payload section, - 1) Choose "An ELF executable payload" for the option of "Add a payload". - 2) Type the path of payload image for the option of "Payload path and f= ilename". - 3) Select the option of "Use LZMA compression for payloads". - =20 -4. If the graphics console is required in Coreboot UEFI payload, running V= GA option rom should be enabled. - For details: - 1) In the Device section, select the option of "Run VGA Option ROMs". - 2) In the VGA BIOS section, select the option of "Add a VGA BIOS Image"= , Input the path of vga bios image=20 - for the option of VGA BIOS path and filename, give the values of vendor= id and device id for the option=20 - of "VGA device PCI IDs". - 3) In the Display section, - Select the option of "Set framebuffer graphics resolution" - Choose a right display mode for the option of "framebuffer graphics = resolution". - Note: If the boot OS is windows, please choose the display mode supp= orting 32 bit color. - Select the option of "Keep VESA framebuffer" - =20 -5. Press ESC key to exit the Coreboot configuration surface. If there is a= question prompted like "Do you wish to save your new configuration?", - choose Yes. - =20 -6. Run "make" to build the coreboot firmware image. diff --git a/CorebootPayloadPkg/CorebootPayloadPkg.dec b/CorebootPayloadPkg= /CorebootPayloadPkg.dec deleted file mode 100644 index 5fe4cb637f..0000000000 --- a/CorebootPayloadPkg/CorebootPayloadPkg.dec +++ /dev/null @@ -1,48 +0,0 @@ -## @file -# Coreboot Payload Package -# -# Provides drivers and definitions to create uefi payload for coreboot. -# -# Copyright (c) 2014, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - DEC_SPECIFICATION =3D 0x00010005 - PACKAGE_NAME =3D CorebootPayloadPkg - PACKAGE_GUID =3D 58ABC905-951E-472e-8590-77BA8A50BE63 - PACKAGE_VERSION =3D 0.1 - -[LibraryClasses] - -[Guids] - # - ## Defines the token space for the Coreboot Payload Package PCDs. - # - gUEfiCorebootPayloadPkgTokenSpaceGuid =3D {0x1d127ea, 0xf6f1, 0x4ef6, {= 0x94, 0x15, 0x8a, 0x0, 0x0, 0x93, 0xf8, 0x9d}} - - # - # Gop Temp - # - gBmpImageGuid =3D { 0x878AC2CC, 0x5343, 0x46F2= , { 0xB5, 0x63, 0x51, 0xF8, 0x9D, 0xAF, 0x56, 0xBA } } - -[Ppis] - -[Protocols] - # - # Gop Temp - # - gPlatformGOPPolicyGuid =3D { 0xec2e931b, 0x3281, 0x48a5= , { 0x81, 0x07, 0xdf, 0x8a, 0x8b, 0xed, 0x3c, 0x5d } } - -##########################################################################= ###### -# -# PCD Declarations section - list of all PCDs Declared by this Package -# Only this package should be providing the -# declaration, other packages should not. -# -##########################################################################= ###### -[PcdsFixedAtBuild, PcdsPatchableInModule] - -[PcdsDynamic, PcdsDynamicEx] - diff --git a/CorebootPayloadPkg/CorebootPayloadPkg.fdf b/CorebootPayloadPkg= /CorebootPayloadPkg.fdf deleted file mode 100644 index 4e669ae887..0000000000 --- a/CorebootPayloadPkg/CorebootPayloadPkg.fdf +++ /dev/null @@ -1,285 +0,0 @@ -## @file -# Coreboot Payload Package -# -# Provides drivers and definitions to create uefi payload for coreboot. -# -# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -##########################################################################= ###### -[FD.UefiPayload] -BaseAddress =3D 0x800000|gUefiCorebootModulePkgTokenSpaceGuid.PcdPayload= FdMemBase -Size =3D 0x410000|gUefiCorebootModulePkgTokenSpaceGuid.PcdPayload= FdMemSize -ErasePolarity =3D 1 -BlockSize =3D 0x1000 -NumBlocks =3D 0x410 - -0x00000000|0x030000 -FV =3D PEIFV - -0x00030000|0x3E0000 -FV =3D DXEFV - -##########################################################################= ###### -[FV.PEIFV] -BlockSize =3D 0x1000 -FvAlignment =3D 16 -ERASE_POLARITY =3D 1 -MEMORY_MAPPED =3D TRUE -STICKY_WRITE =3D TRUE -LOCK_CAP =3D TRUE -LOCK_STATUS =3D TRUE -WRITE_DISABLED_CAP =3D TRUE -WRITE_ENABLED_CAP =3D TRUE -WRITE_STATUS =3D TRUE -WRITE_LOCK_CAP =3D TRUE -WRITE_LOCK_STATUS =3D TRUE -READ_DISABLED_CAP =3D TRUE -READ_ENABLED_CAP =3D TRUE -READ_STATUS =3D TRUE -READ_LOCK_CAP =3D TRUE -READ_LOCK_STATUS =3D TRUE - -INF CorebootModulePkg/SecCore/SecCore.inf - -INF MdeModulePkg/Core/Pei/PeiMain.inf -INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf -INF MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRout= erPei.inf -INF MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf -INF CorebootModulePkg/CbSupportPei/CbSupportPei.inf -INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf - -##########################################################################= ###### - -[FV.DXEFV] -BlockSize =3D 0x1000 -FvForceRebase =3D FALSE -FvAlignment =3D 16 -ERASE_POLARITY =3D 1 -MEMORY_MAPPED =3D TRUE -STICKY_WRITE =3D TRUE -LOCK_CAP =3D TRUE -LOCK_STATUS =3D TRUE -WRITE_DISABLED_CAP =3D TRUE -WRITE_ENABLED_CAP =3D TRUE -WRITE_STATUS =3D TRUE -WRITE_LOCK_CAP =3D TRUE -WRITE_LOCK_STATUS =3D TRUE -READ_DISABLED_CAP =3D TRUE -READ_ENABLED_CAP =3D TRUE -READ_STATUS =3D TRUE -READ_LOCK_CAP =3D TRUE -READ_LOCK_STATUS =3D TRUE - -APRIORI DXE { - INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf - INF MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStat= usCodeRouterRuntimeDxe.inf - INF MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandl= erRuntimeDxe.inf -} - -# -# DXE Phase modules -# -INF MdeModulePkg/Core/Dxe/DxeMain.inf -INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf -INF MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusC= odeRouterRuntimeDxe.inf -INF MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerR= untimeDxe.inf - -INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf -INF UefiCpuPkg/CpuDxe/CpuDxe.inf -INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf -INF MdeModulePkg/Application/UiApp/UiApp.inf -!if $(USE_HPET_TIMER) =3D=3D TRUE -INF PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf -!else -INF PcAtChipsetPkg/8254TimerDxe/8254Timer.inf -!endif -INF MdeModulePkg/Universal/Metronome/Metronome.inf -INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf -INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf -INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf -INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRunt= imeDxe.inf -INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf -INF PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe= .inf -INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf - -INF UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf -INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf -INF MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.= inf -INF PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf -INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf -INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf -INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf -INF CorebootModulePkg/CbSupportDxe/CbSupportDxe.inf - -INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf -# -# PCI Support -# -INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf -INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf - -# -# ISA Support -# -INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf - -# -# Console Support -# -INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf -INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf -INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.i= nf -INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf - -# -# SCSI/ATA/IDE/DISK Support -# -INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf -INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf -INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf -INF CorebootModulePkg/SataControllerDxe/SataControllerDxe.inf -INF MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf -INF MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf -INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf -INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf - -INF FatPkg/EnhancedFatDxe/Fat.inf - -# -# SD/eMMC Support -# -INF MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.inf -INF MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.inf -INF MdeModulePkg/Bus/Sd/SdDxe/SdDxe.inf - -# -# Usb Support -# -INF MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf -INF MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf -INF MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf -INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf -INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf -INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf - -# -# OHCI Support -# -INF QuarkSocPkg/QuarkSouthCluster/Usb/Ohci/Dxe/OhciDxe.inf - -# -# Shell -# -INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf -INF ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf -INF ShellPkg/Application/Shell/Shell.inf - -FILE FREEFORM =3D PCD(gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogo= File) { - SECTION RAW =3D MdeModulePkg/Logo/Logo.bmp -} - -# -# Framebuffer Gop -# -INF CorebootPayloadPkg/FbGop/FbGop.inf - -##########################################################################= ###### -# -# Rules are use with the [FV] section's module INF type to define -# how an FFS file is created for a given INF file. The following Rule are = the default -# rules for the different module type. User can add the customized rules t= o define the -# content of the FFS file. -# -##########################################################################= ###### - -[Rule.Common.SEC] - FILE SEC =3D $(NAMED_GUID) { - PE32 PE32 Align=3D32 $(INF_OUTPUT)/$(MODULE_NAME).efi - } - -[Rule.Common.PEI_CORE] - FILE PEI_CORE =3D $(NAMED_GUID) { - PE32 PE32 Align=3DAuto $(INF_OUTPUT)/$(MODULE_NAME).efi - UI STRING =3D"$(MODULE_NAME)" Optional - VERSION STRING =3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_NUMBE= R) - } - -[Rule.Common.PEIM] - FILE PEIM =3D $(NAMED_GUID) { - PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex - PE32 PE32 Align=3DAuto $(INF_OUTPUT)/$(MODULE_NAME).= efi - UI STRING=3D"$(MODULE_NAME)" Optional - VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_NUMBE= R) - } - -[Rule.Common.DXE_CORE] - FILE DXE_CORE =3D $(NAMED_GUID) { - PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi - UI STRING=3D"$(MODULE_NAME)" Optional - VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_NUMBER) - } - -[Rule.Common.DXE_DRIVER] - FILE DRIVER =3D $(NAMED_GUID) { - DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex - PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi - UI STRING=3D"$(MODULE_NAME)" Optional - VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_NUMBER) - } - -[Rule.Common.DXE_RUNTIME_DRIVER] - FILE DRIVER =3D $(NAMED_GUID) { - DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex - PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi - UI STRING=3D"$(MODULE_NAME)" Optional - VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_NUMBER) - } - -[Rule.Common.UEFI_DRIVER] - FILE DRIVER =3D $(NAMED_GUID) { - DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex - PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi - UI STRING=3D"$(MODULE_NAME)" Optional - VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_NUMBER) - } - -[Rule.Common.UEFI_DRIVER.BINARY] - FILE DRIVER =3D $(NAMED_GUID) { - DXE_DEPEX DXE_DEPEX Optional |.depex - PE32 PE32 |.efi - UI STRING=3D"$(MODULE_NAME)" Optional - VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_NUMBE= R) - } - -[Rule.Common.UEFI_APPLICATION] - FILE APPLICATION =3D $(NAMED_GUID) { - PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi - UI STRING=3D"$(MODULE_NAME)" Optional - VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_NUMBER) - } - -[Rule.Common.UEFI_APPLICATION.BINARY] - FILE APPLICATION =3D $(NAMED_GUID) { - PE32 PE32 |.efi - UI STRING=3D"$(MODULE_NAME)" Optional - VERSION STRING=3D"$(INF_VERSION)" Optional BUILD_NUM=3D$(BUILD_NUMBE= R) - } - -[Rule.Common.USER_DEFINED.ACPITABLE] - FILE FREEFORM =3D $(NAMED_GUID) { - RAW ACPI |.acpi - RAW ASL |.aml - } - -[Rule.Common.USER_DEFINED.CSM] - FILE FREEFORM =3D $(NAMED_GUID) { - RAW BIN |.bin - } - -[Rule.Common.SEC.RESET_VECTOR] - FILE RAW =3D $(NAMED_GUID) { - RAW RAW |.raw - } diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc b/CorebootPayloa= dPkg/CorebootPayloadPkgIa32.dsc deleted file mode 100644 index 57a5508c95..0000000000 --- a/CorebootPayloadPkg/CorebootPayloadPkgIa32.dsc +++ /dev/null @@ -1,574 +0,0 @@ -## @file -# Coreboot Payload Package -# -# Provides drivers and definitions to create uefi payload for coreboot. -# -# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -##########################################################################= ###### -# -# Defines Section - statements that will be processed to create a Makefile. -# -##########################################################################= ###### -[Defines] - PLATFORM_NAME =3D CorebootPayloadPkg - PLATFORM_GUID =3D F71608AB-D63D-4491-B744-A99998C8= CD96 - PLATFORM_VERSION =3D 0.1 - DSC_SPECIFICATION =3D 0x00010005 - SUPPORTED_ARCHITECTURES =3D IA32 - BUILD_TARGETS =3D DEBUG|RELEASE|NOOPT - SKUID_IDENTIFIER =3D DEFAULT - OUTPUT_DIRECTORY =3D Build/CorebootPayloadPkgIA32 - FLASH_DEFINITION =3D CorebootPayloadPkg/CorebootPaylo= adPkg.fdf - - DEFINE SECURE_BOOT_ENABLE =3D FALSE - DEFINE SOURCE_DEBUG_ENABLE =3D FALSE - - # - # CPU options - # - DEFINE MAX_LOGICAL_PROCESSORS =3D 64 - - # - # PCI options - # - DEFINE PCIE_BASE =3D 0xE0000000 - - # - # Serial port set up - # - DEFINE BAUD_RATE =3D 115200 - DEFINE SERIAL_CLOCK_RATE =3D 1843200 - DEFINE SERIAL_LINE_CONTROL =3D 3 # 8-bits, no parity - DEFINE SERIAL_HARDWARE_FLOW_CONTROL =3D FALSE - DEFINE SERIAL_DETECT_CABLE =3D FALSE - DEFINE SERIAL_FIFO_CONTROL =3D 7 # Enable FIFO - DEFINE SERIAL_EXTENDED_TX_FIFO_SIZE =3D 16 - DEFINE UART_DEFAULT_BAUD_RATE =3D $(BAUD_RATE) - DEFINE UART_DEFAULT_DATA_BITS =3D 8 - DEFINE UART_DEFAULT_PARITY =3D 1 - DEFINE UART_DEFAULT_STOP_BITS =3D 1 - DEFINE DEFAULT_TERMINAL_TYPE =3D 0 - - # - # typedef struct { - # UINT16 VendorId; ///< Vendor ID to match the PCI device. = The value 0xFFFF terminates the list of entries. - # UINT16 DeviceId; ///< Device ID to match the PCI device - # UINT32 ClockRate; ///< UART clock rate. Set to 0 for defa= ult clock rate of 1843200 Hz - # UINT64 Offset; ///< The byte offset into to the BAR - # UINT8 BarIndex; ///< Which BAR to get the UART base addr= ess - # UINT8 RegisterStride; ///< UART register stride in bytes. Set= to 0 for default register stride of 1 byte. - # UINT16 ReceiveFifoDepth; ///< UART receive FIFO depth in bytes. S= et to 0 for a default FIFO depth of 16 bytes. - # UINT16 TransmitFifoDepth; ///< UART transmit FIFO depth in bytes. = Set to 0 for a default FIFO depth of 16 bytes. - # UINT8 Reserved[2]; - # } PCI_SERIAL_PARAMETER; - # - # Vendor FFFF Device 0000 Prog Interface 1, BAR #0, Offset 0, Stride =3D= 1, Clock 1843200 (0x1c2000) - # - # [Vendor] [Device] [----Cl= ockRate---] [------------Offset-----------] [Bar] [Stride] [RxFifo] [TxFif= o] [Rsvd] [Vendor] - DEFINE PCI_SERIAL_PARAMETERS =3D {0xff,0xff, 0x00,0x00, 0x0,0= x20,0x1c,0x00, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x00, 0x01, 0x0,0x0, 0x0= ,0x0, 0x0,0x0, 0xff,0xff} - - # - # Chipset options - # - DEFINE USE_HPET_TIMER =3D FALSE - -[BuildOptions] - *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES - GCC:*_UNIXGCC_*_CC_FLAGS =3D -DMDEPKG_NDEBUG - GCC:RELEASE_*_*_CC_FLAGS =3D -DMDEPKG_NDEBUG - INTEL:RELEASE_*_*_CC_FLAGS =3D /D MDEPKG_NDEBUG - MSFT:RELEASE_*_*_CC_FLAGS =3D /D MDEPKG_NDEBUG - -[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER] - MSFT:*_*_*_DLINK_FLAGS =3D /ALIGN:4096 - -##########################################################################= ###### -# -# SKU Identification section - list of all SKU IDs supported by this Platf= orm. -# -##########################################################################= ###### -[SkuIds] - 0|DEFAULT - -##########################################################################= ###### -# -# Library Class section - list of all Library Classes needed by this Platf= orm. -# -##########################################################################= ###### -[LibraryClasses] - # - # Entry point - # - PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf - PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf - DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf - UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntry= Point.inf - UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiA= pplicationEntryPoint.inf - - # - # Basic - # - BaseLib|MdePkg/Library/BaseLib/BaseLib.inf - BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf - SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchroniza= tionLib.inf - PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf - CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf -!if $(PCIE_BASE) =3D=3D 0 - PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf - PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf -!else - PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf - PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf -!endif - PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.i= nf - PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf - PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeC= offGetEntryPointLib.inf - CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMain= tenanceLib.inf - - # - # UEFI & PI - # - UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBoo= tServicesTableLib.inf - UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/U= efiRuntimeServicesTableLib.inf - UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf - UefiLib|MdePkg/Library/UefiLib/UefiLib.inf - UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServic= esLib.inf - HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf - UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompres= sLib.inf - PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/= PeiServicesTablePointerLibIdt.inf - PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf - DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf - DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableL= ib.inf - UefiCpuLib|UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf - SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf - - # - # Generic Modules - # - UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf - UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf - OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHo= okStatusCodeLibNull.inf - CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf - SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeS= ecurityManagementLib.inf - UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManag= erLib.inf - CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/Customize= dDisplayLib.inf - - # - # CPU - # - MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf - LocalApicLib|UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf - - # - # Platform - # - TimerLib|CorebootPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf - ResetSystemLib|CorebootPayloadPkg/Library/ResetSystemLib/ResetSystemLib.= inf - SerialPortLib|CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSeria= lPortLib16550.inf - PlatformHookLib|CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookL= ib.inf - PlatformBootManagerLib|CorebootPayloadPkg/Library/PlatformBootManagerLib= /PlatformBootManagerLib.inf - IoApicLib|PcAtChipsetPkg/Library/BaseIoApicLib/BaseIoApicLib.inf - CbPlatformSupportLib|CorebootModulePkg/Library/CbPlatformSupportLibNull/= CbPlatformSupportLibNull.inf - - # - # Misc - # - DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseD= ebugPrintErrorLevelLib.inf - PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibN= ull.inf -!if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE - PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibDeb= ug/PeCoffExtraActionLibDebug.inf - DebugCommunicationLib|SourceLevelDebugPkg/Library/DebugCommunicationLibS= erialPort/DebugCommunicationLibSerialPort.inf -!else - PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeC= offExtraActionLibNull.inf - DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.i= nf -!endif - CbParseLib|CorebootModulePkg/Library/CbParseLib/CbParseLib.inf - DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebug= LibReportStatusCode.inf - LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf - FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf - AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLib= Null.inf - TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurem= entLibNull.inf - VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf - -[LibraryClasses.IA32.SEC] - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf - MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAlloc= ationLib.inf - DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.i= nf - ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseRepor= tStatusCodeLibNull.inf - -[LibraryClasses.IA32.PEI_CORE, LibraryClasses.IA32.PEIM] - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf - MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAlloc= ationLib.inf - ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf - ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExt= ractGuidedSectionLib.inf -!if $(SOURCE_DEBUG_ENABLE) - DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib= .inf -!endif - -[LibraryClasses.common.DXE_CORE] - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf - MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeC= oreMemoryAllocationLib.inf - ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExt= ractGuidedSectionLib.inf - ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf -!if $(SOURCE_DEBUG_ENABLE) - DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf -!endif - CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuE= xceptionHandlerLib.inf - -[LibraryClasses.common.DXE_DRIVER] - PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf - ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExt= ractGuidedSectionLib.inf - ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf -!if $(SOURCE_DEBUG_ENABLE) - DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf -!endif - CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuE= xceptionHandlerLib.inf - MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf - -[LibraryClasses.common.DXE_RUNTIME_DRIVER] - PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf - ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/R= untimeDxeReportStatusCodeLib.inf - -[LibraryClasses.common.UEFI_DRIVER,LibraryClasses.common.UEFI_APPLICATION] - PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf - ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - -##########################################################################= ###### -# -# Pcd Section - list of all EDK II PCD Entries defined by this Platform. -# -##########################################################################= ###### -[PcdsFeatureFlag] -!if $(TARGET) =3D=3D DEBUG - gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|TRUE -!else - gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|FALSE -!endif - gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE - gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|FALSE - gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE - gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE - -[PcdsFixedAtBuild] - gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x10000 - gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize|0x8000 - gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0x10000 - # - # Make VariableRuntimeDxe work at emulated non-volatile variable mode. - # - gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE - - gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0 - gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c= , 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0= x31 } - - gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|$(PCIE_BASE) - -!if $(SOURCE_DEBUG_ENABLE) - gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2 -!endif - -[PcdsPatchableInModule.common] - gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x7 - gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000004F -!if $(SOURCE_DEBUG_ENABLE) - gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x17 -!else - gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F -!endif - - # - # The following parameters are set by Library/PlatformHookLib - # - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|FALSE - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x3f8 - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|$(BAUD_RATE) - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride|1 - - # - # Enable these parameters to be set on the command line - # - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate|$(SERIAL_CLOCK_RATE) - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialLineControl|$(SERIAL_LINE_CONTRO= L) - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|$(SERIAL_= HARDWARE_FLOW_CONTROL) - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialDetectCable|$(SERIAL_DETECT_CABL= E) - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialFifoControl|$(SERIAL_FIFO_CONTRO= L) - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialExtendedTxFifoSize|$(SERIAL_EXTE= NDED_TX_FIFO_SIZE) - - gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|TRUE - gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|$(UART_DEFAULT_BAUD_RATE) - gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|$(UART_DEFAULT_DATA_BITS) - gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|$(UART_DEFAULT_PARITY) - gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits|$(UART_DEFAULT_STOP_BITS) - gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|$(DEFAULT_TERMINAL_TYPE) - gEfiMdeModulePkgTokenSpaceGuid.PcdPciSerialParameters|$(PCI_SERIAL_PARAM= ETERS) - - gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|$(MAX_LOGICAL_= PROCESSORS) - - # - # Set the proper Shell file GUID - # - # 7C04A583-9E3E-4f1c-AD65-E05268D0B4D1 - gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x0= 4, 0x7C, 0x3E, 0x9E, 0x1c, 0x4f, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, = 0xD1 } - -##########################################################################= ###### -# -# Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Pla= tform -# -##########################################################################= ###### - -[PcdsDynamicDefault] - gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0 - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 - gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3 - - ## This PCD defines the video horizontal resolution. - # This PCD could be set to 0 then video resolution could be at highest = resolution. - gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|0 - ## This PCD defines the video vertical resolution. - # This PCD could be set to 0 then video resolution could be at highest = resolution. - gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|0 - - ## The PCD is used to specify the video horizontal resolution of text se= tup. - gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution|0 - ## The PCD is used to specify the video vertical resolution of text setu= p. - gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|0 - -##########################################################################= ###### -# -# Components Section - list of all EDK II Modules needed by this Platform. -# -##########################################################################= ###### -[Components.IA32] - # - # SEC Core - # - CorebootModulePkg/SecCore/SecCore.inf - - # - # PEI Core - # - MdeModulePkg/Core/Pei/PeiMain.inf - - # - # PEIM - # - MdeModulePkg/Universal/PCD/Pei/Pcd.inf { - - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - } - MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouter= Pei.inf - MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf - - CorebootModulePkg/CbSupportPei/CbSupportPei.inf - MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf - -[Components.IA32] - # - # DXE Core - # - MdeModulePkg/Core/Dxe/DxeMain.inf { - - NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompre= ssLib.inf - } - - # - # Components that produce the architectural protocols - # - MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf - UefiCpuPkg/CpuDxe/CpuDxe.inf - MdeModulePkg/Universal/BdsDxe/BdsDxe.inf - MdeModulePkg/Application/UiApp/UiApp.inf { - - NULL|MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf - NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf - NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc= eManagerUiLib.inf - } -!if $(USE_HPET_TIMER) =3D=3D TRUE - PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf -!else - PcAtChipsetPkg/8254TimerDxe/8254Timer.inf -!endif - MdeModulePkg/Universal/Metronome/Metronome.inf - MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf - MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf - MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntim= eDxe.inf - MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf - PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.i= nf - MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf - - # - # Following are the DXE drivers - # - MdeModulePkg/Universal/PCD/Dxe/Pcd.inf { - - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - } - - MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCod= eRouterRuntimeDxe.inf - MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRun= timeDxe.inf - UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf - MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf - MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf - PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf - MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf - MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf - MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf - - CorebootModulePkg/CbSupportDxe/CbSupportDxe.inf - - # - # SMBIOS Support - # - MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf - - # - # ACPI Support - # - MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf - - # - # PCI Support - # - MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf - MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf { - - PciHostBridgeLib|CorebootPayloadPkg/Library/PciHostBridgeLib/PciHost= BridgeLib.inf - } - - # - # SCSI/ATA/IDE/DISK Support - # - MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf - MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf - MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf - FatPkg/EnhancedFatDxe/Fat.inf - CorebootModulePkg/SataControllerDxe/SataControllerDxe.inf - MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf - MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf - MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf - MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf - - # - # SD/eMMC Support - # - MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.inf - MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.inf - MdeModulePkg/Bus/Sd/SdDxe/SdDxe.inf - - # - # Usb Support - # - MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf - MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf - MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf - MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf - MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf - MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf - - # - # OHCI support - # - QuarkSocPkg/QuarkSouthCluster/Usb/Ohci/Dxe/OhciDxe.inf - - # - # ISA Support - # - MdeModulePkg/Universal/SerialDxe/SerialDxe.inf - - # - # Console Support - # - MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf - MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf - MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf - MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf - - # - # Framebuffer Gop - # - CorebootPayloadPkg/FbGop/FbGop.inf - - #------------------------------ - # Build the shell - #------------------------------ - - # - # Shell Lib - # -[LibraryClasses] - BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCom= mandLib.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf - FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf - ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf - NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf - -[Components.IA32] - ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf { - - ## This flag is used to control initialization of the shell library - # This should be FALSE for compiling the dynamic command. - gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE - } - ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf { - - ## This flag is used to control initialization of the shell library - # This should be FALSE for compiling the dynamic command. - gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE - } - ShellPkg/Application/Shell/Shell.inf { - - ## This flag is used to control initialization of the shell library - # This should be FALSE for compiling the shell application itself o= nly. - gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE - - #------------------------------ - # Basic commands - #------------------------------ - - - NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1Comm= andsLib.inf - NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2Comm= andsLib.inf - NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3Comm= andsLib.inf - NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1Co= mmandsLib.inf - NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1= CommandsLib.inf - NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comm= andsLib.inf - - #------------------------------ - # Networking commands - #------------------------------ - - - NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1= CommandsLib.inf - - #------------------------------ - # Support libraries - #------------------------------ - - - DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf - HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandlePar= singLib.inf - PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf - ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLi= b.inf - ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellComman= dLib.inf - SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf - } diff --git a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc b/CorebootPay= loadPkg/CorebootPayloadPkgIa32X64.dsc deleted file mode 100644 index 84f59e9119..0000000000 --- a/CorebootPayloadPkg/CorebootPayloadPkgIa32X64.dsc +++ /dev/null @@ -1,575 +0,0 @@ -## @file -# Coreboot Payload Package -# -# Provides drivers and definitions to create uefi payload for coreboot. -# -# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -##########################################################################= ###### -# -# Defines Section - statements that will be processed to create a Makefile. -# -##########################################################################= ###### -[Defines] - PLATFORM_NAME =3D CorebootPayloadPkg - PLATFORM_GUID =3D F71608AB-D63D-4491-B744-A99998C8= CD96 - PLATFORM_VERSION =3D 0.1 - DSC_SPECIFICATION =3D 0x00010005 - SUPPORTED_ARCHITECTURES =3D IA32|X64 - BUILD_TARGETS =3D DEBUG|RELEASE|NOOPT - SKUID_IDENTIFIER =3D DEFAULT - OUTPUT_DIRECTORY =3D Build/CorebootPayloadPkgX64 - FLASH_DEFINITION =3D CorebootPayloadPkg/CorebootPaylo= adPkg.fdf - - DEFINE SECURE_BOOT_ENABLE =3D FALSE - DEFINE SOURCE_DEBUG_ENABLE =3D FALSE - - # - # CPU options - # - DEFINE MAX_LOGICAL_PROCESSORS =3D 64 - - # - # PCI options - # - DEFINE PCIE_BASE =3D 0xE0000000 - - # - # Serial port set up - # - DEFINE BAUD_RATE =3D 115200 - DEFINE SERIAL_CLOCK_RATE =3D 1843200 - DEFINE SERIAL_LINE_CONTROL =3D 3 # 8-bits, no parity - DEFINE SERIAL_HARDWARE_FLOW_CONTROL =3D FALSE - DEFINE SERIAL_DETECT_CABLE =3D FALSE - DEFINE SERIAL_FIFO_CONTROL =3D 7 # Enable FIFO - DEFINE SERIAL_EXTENDED_TX_FIFO_SIZE =3D 16 - DEFINE UART_DEFAULT_BAUD_RATE =3D $(BAUD_RATE) - DEFINE UART_DEFAULT_DATA_BITS =3D 8 - DEFINE UART_DEFAULT_PARITY =3D 1 - DEFINE UART_DEFAULT_STOP_BITS =3D 1 - DEFINE DEFAULT_TERMINAL_TYPE =3D 0 - - # - # typedef struct { - # UINT16 VendorId; ///< Vendor ID to match the PCI device. = The value 0xFFFF terminates the list of entries. - # UINT16 DeviceId; ///< Device ID to match the PCI device - # UINT32 ClockRate; ///< UART clock rate. Set to 0 for defa= ult clock rate of 1843200 Hz - # UINT64 Offset; ///< The byte offset into to the BAR - # UINT8 BarIndex; ///< Which BAR to get the UART base addr= ess - # UINT8 RegisterStride; ///< UART register stride in bytes. Set= to 0 for default register stride of 1 byte. - # UINT16 ReceiveFifoDepth; ///< UART receive FIFO depth in bytes. S= et to 0 for a default FIFO depth of 16 bytes. - # UINT16 TransmitFifoDepth; ///< UART transmit FIFO depth in bytes. = Set to 0 for a default FIFO depth of 16 bytes. - # UINT8 Reserved[2]; - # } PCI_SERIAL_PARAMETER; - # - # Vendor FFFF Device 0000 Prog Interface 1, BAR #0, Offset 0, Stride =3D= 1, Clock 1843200 (0x1c2000) - # - # [Vendor] [Device] [----Cl= ockRate---] [------------Offset-----------] [Bar] [Stride] [RxFifo] [TxFif= o] [Rsvd] [Vendor] - DEFINE PCI_SERIAL_PARAMETERS =3D {0xff,0xff, 0x00,0x00, 0x0,0= x20,0x1c,0x00, 0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0, 0x00, 0x01, 0x0,0x0, 0x0= ,0x0, 0x0,0x0, 0xff,0xff} - - # - # Chipset options - # - DEFINE USE_HPET_TIMER =3D FALSE - -[BuildOptions] - *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES - GCC:*_UNIXGCC_*_CC_FLAGS =3D -DMDEPKG_NDEBUG - GCC:RELEASE_*_*_CC_FLAGS =3D -DMDEPKG_NDEBUG - INTEL:RELEASE_*_*_CC_FLAGS =3D /D MDEPKG_NDEBUG - MSFT:RELEASE_*_*_CC_FLAGS =3D /D MDEPKG_NDEBUG - -[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER] - MSFT:*_*_*_DLINK_FLAGS =3D /ALIGN:4096 - -##########################################################################= ###### -# -# SKU Identification section - list of all SKU IDs supported by this Platf= orm. -# -##########################################################################= ###### -[SkuIds] - 0|DEFAULT - -##########################################################################= ###### -# -# Library Class section - list of all Library Classes needed by this Platf= orm. -# -##########################################################################= ###### -[LibraryClasses] - # - # Entry point - # - PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf - PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf - DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf - UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntry= Point.inf - UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiA= pplicationEntryPoint.inf - - # - # Basic - # - BaseLib|MdePkg/Library/BaseLib/BaseLib.inf - BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf - SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchroniza= tionLib.inf - PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf - CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf - IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf -!if $(PCIE_BASE) =3D=3D 0 - PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf - PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf -!else - PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf - PciExpressLib|MdePkg/Library/BasePciExpressLib/BasePciExpressLib.inf -!endif - PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.i= nf - PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf - PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeC= offGetEntryPointLib.inf - CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMain= tenanceLib.inf - - # - # UEFI & PI - # - UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBoo= tServicesTableLib.inf - UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/U= efiRuntimeServicesTableLib.inf - UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf - UefiLib|MdePkg/Library/UefiLib/UefiLib.inf - UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServic= esLib.inf - HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf - UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompres= sLib.inf - PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLibIdt/= PeiServicesTablePointerLibIdt.inf - PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf - DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf - DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableL= ib.inf - UefiCpuLib|UefiCpuPkg/Library/BaseUefiCpuLib/BaseUefiCpuLib.inf - SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf - - # - # Generic Modules - # - UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf - UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf - OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHo= okStatusCodeLibNull.inf - CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf - SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeS= ecurityManagementLib.inf - UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManag= erLib.inf - CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/Customize= dDisplayLib.inf - - # - # CPU - # - MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf - LocalApicLib|UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.inf - - # - # Platform - # - TimerLib|CorebootPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf - ResetSystemLib|CorebootPayloadPkg/Library/ResetSystemLib/ResetSystemLib.= inf - SerialPortLib|CorebootModulePkg/Library/BaseSerialPortLib16550/BaseSeria= lPortLib16550.inf - PlatformHookLib|CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookL= ib.inf - PlatformBootManagerLib|CorebootPayloadPkg/Library/PlatformBootManagerLib= /PlatformBootManagerLib.inf - IoApicLib|PcAtChipsetPkg/Library/BaseIoApicLib/BaseIoApicLib.inf - CbPlatformSupportLib|CorebootModulePkg/Library/CbPlatformSupportLibNull/= CbPlatformSupportLibNull.inf - - # - # Misc - # - DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseD= ebugPrintErrorLevelLib.inf - PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibN= ull.inf -!if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE - PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibDeb= ug/PeCoffExtraActionLibDebug.inf - DebugCommunicationLib|SourceLevelDebugPkg/Library/DebugCommunicationLibS= erialPort/DebugCommunicationLibSerialPort.inf -!else - PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeC= offExtraActionLibNull.inf - DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.i= nf -!endif - CbParseLib|CorebootModulePkg/Library/CbParseLib/CbParseLib.inf - DebugLib|MdeModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebug= LibReportStatusCode.inf - LockBoxLib|MdeModulePkg/Library/LockBoxNullLib/LockBoxNullLib.inf - FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf - AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLib= Null.inf - TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurem= entLibNull.inf - VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf - -[LibraryClasses.IA32.SEC] - DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf - MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAlloc= ationLib.inf - DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.i= nf - ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseRepor= tStatusCodeLibNull.inf - -[LibraryClasses.IA32.PEI_CORE, LibraryClasses.IA32.PEIM] - PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf - HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf - MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAlloc= ationLib.inf - ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf - ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExt= ractGuidedSectionLib.inf -!if $(SOURCE_DEBUG_ENABLE) - DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib= .inf -!endif - -[LibraryClasses.common.DXE_CORE] - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf - MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeC= oreMemoryAllocationLib.inf - ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExt= ractGuidedSectionLib.inf - ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf -!if $(SOURCE_DEBUG_ENABLE) - DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf -!endif - CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuE= xceptionHandlerLib.inf - -[LibraryClasses.common.DXE_DRIVER] - PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf - ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExt= ractGuidedSectionLib.inf - ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf -!if $(SOURCE_DEBUG_ENABLE) - DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf -!endif - CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuE= xceptionHandlerLib.inf - MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf - -[LibraryClasses.common.DXE_RUNTIME_DRIVER] - PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf - ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/R= untimeDxeReportStatusCodeLib.inf - -[LibraryClasses.common.UEFI_DRIVER,LibraryClasses.common.UEFI_APPLICATION] - PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf - MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf - ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf - HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf - -##########################################################################= ###### -# -# Pcd Section - list of all EDK II PCD Entries defined by this Platform. -# -##########################################################################= ###### -[PcdsFeatureFlag] -!if $(TARGET) =3D=3D DEBUG - gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|TRUE -!else - gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|FALSE -!endif - gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE - gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE - gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE - gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE - -[PcdsFixedAtBuild] - gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x10000 - gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize|0x8000 - gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0x10000 - # - # Make VariableRuntimeDxe work at emulated non-volatile variable mode. - # - gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvModeEnable|TRUE - - gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0 - gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable|TRUE - gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c= , 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0= x31 } - - gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|$(PCIE_BASE) - -!if $(SOURCE_DEBUG_ENABLE) - gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2 -!endif - -[PcdsPatchableInModule.common] - gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x7 - gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000004F -!if $(SOURCE_DEBUG_ENABLE) - gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x17 -!else - gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F -!endif - - # - # The following parameters are set by Library/PlatformHookLib - # - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio|FALSE - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase|0x3f8 - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate|$(BAUD_RATE) - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride|1 - - # - # Enable these parameters to be set on the command line - # - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate|$(SERIAL_CLOCK_RATE) - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialLineControl|$(SERIAL_LINE_CONTRO= L) - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|$(SERIAL_= HARDWARE_FLOW_CONTROL) - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialDetectCable|$(SERIAL_DETECT_CABL= E) - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialFifoControl|$(SERIAL_FIFO_CONTRO= L) - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialExtendedTxFifoSize|$(SERIAL_EXTE= NDED_TX_FIFO_SIZE) - - gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|TRUE - gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|$(UART_DEFAULT_BAUD_RATE) - gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits|$(UART_DEFAULT_DATA_BITS) - gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity|$(UART_DEFAULT_PARITY) - gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits|$(UART_DEFAULT_STOP_BITS) - gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|$(DEFAULT_TERMINAL_TYPE) - gEfiMdeModulePkgTokenSpaceGuid.PcdPciSerialParameters|$(PCI_SERIAL_PARAM= ETERS) - - gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|$(MAX_LOGICAL_= PROCESSORS) - - # - # Set the proper Shell file GUID - # - # 7C04A583-9E3E-4f1c-AD65-E05268D0B4D1 - gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x0= 4, 0x7C, 0x3E, 0x9E, 0x1c, 0x4f, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, = 0xD1 } - -##########################################################################= ###### -# -# Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Pla= tform -# -##########################################################################= ###### - -[PcdsDynamicDefault] - gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0 - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 - gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 - gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3 - - ## This PCD defines the video horizontal resolution. - # This PCD could be set to 0 then video resolution could be at highest = resolution. - gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|0 - ## This PCD defines the video vertical resolution. - # This PCD could be set to 0 then video resolution could be at highest = resolution. - gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|0 - - ## The PCD is used to specify the video horizontal resolution of text se= tup. - gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution|0 - ## The PCD is used to specify the video vertical resolution of text setu= p. - gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|0 - -##########################################################################= ###### -# -# Components Section - list of all EDK II Modules needed by this Platform. -# -##########################################################################= ###### -[Components.IA32] - # - # SEC Core - # - CorebootModulePkg/SecCore/SecCore.inf - - # - # PEI Core - # - MdeModulePkg/Core/Pei/PeiMain.inf - - # - # PEIM - # - MdeModulePkg/Universal/PCD/Pei/Pcd.inf { - - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - } - MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouter= Pei.inf - MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf - - CorebootModulePkg/CbSupportPei/CbSupportPei.inf - MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf - -[Components.X64] - # - # DXE Core - # - MdeModulePkg/Core/Dxe/DxeMain.inf { - - NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompre= ssLib.inf - } - - # - # Components that produce the architectural protocols - # - MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf - UefiCpuPkg/CpuDxe/CpuDxe.inf - MdeModulePkg/Universal/BdsDxe/BdsDxe.inf - MdeModulePkg/Application/UiApp/UiApp.inf { - - NULL|MdeModulePkg/Library/DeviceManagerUiLib/DeviceManagerUiLib.inf - NULL|MdeModulePkg/Library/BootManagerUiLib/BootManagerUiLib.inf - NULL|MdeModulePkg/Library/BootMaintenanceManagerUiLib/BootMaintenanc= eManagerUiLib.inf - } -!if $(USE_HPET_TIMER) =3D=3D TRUE - PcAtChipsetPkg/HpetTimerDxe/HpetTimerDxe.inf -!else - PcAtChipsetPkg/8254TimerDxe/8254Timer.inf -!endif - MdeModulePkg/Universal/Metronome/Metronome.inf - MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf - MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf - MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf - MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntim= eDxe.inf - MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf - PcAtChipsetPkg/PcatRealTimeClockRuntimeDxe/PcatRealTimeClockRuntimeDxe.i= nf - MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf - - # - # Following are the DXE drivers - # - MdeModulePkg/Universal/PCD/Dxe/Pcd.inf { - - PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf - } - - MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCod= eRouterRuntimeDxe.inf - MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRun= timeDxe.inf - UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf - MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf - MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf - PcAtChipsetPkg/8259InterruptControllerDxe/8259.inf - MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf - MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf - MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf - - CorebootModulePkg/CbSupportDxe/CbSupportDxe.inf - - # - # SMBIOS Support - # - MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf - - # - # ACPI Support - # - MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf - - # - # PCI Support - # - MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf - MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf { - - PciHostBridgeLib|CorebootPayloadPkg/Library/PciHostBridgeLib/PciHost= BridgeLib.inf - } - - # - # SCSI/ATA/IDE/DISK Support - # - MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf - MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf - MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf - FatPkg/EnhancedFatDxe/Fat.inf - CorebootModulePkg/SataControllerDxe/SataControllerDxe.inf - MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf - MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf - MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf - MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf - - # - # SD/eMMC Support - # - MdeModulePkg/Bus/Pci/SdMmcPciHcDxe/SdMmcPciHcDxe.inf - MdeModulePkg/Bus/Sd/EmmcDxe/EmmcDxe.inf - MdeModulePkg/Bus/Sd/SdDxe/SdDxe.inf - - # - # Usb Support - # - MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf - MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf - MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf - MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf - MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf - MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf - - # - # OHCI support - # - QuarkSocPkg/QuarkSouthCluster/Usb/Ohci/Dxe/OhciDxe.inf - - # - # ISA Support - # - MdeModulePkg/Universal/SerialDxe/SerialDxe.inf - - # - # Console Support - # - MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf - MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf - MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf - MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf - - # - # Framebuffer Gop - # - CorebootPayloadPkg/FbGop/FbGop.inf - - #------------------------------ - # Build the shell - #------------------------------ - - # - # Shell Lib - # -[LibraryClasses] - BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCom= mandLib.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf - FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf - ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf - NetLib|MdeModulePkg/Library/DxeNetLib/DxeNetLib.inf - -[Components.X64] - ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf { - - ## This flag is used to control initialization of the shell library - # This should be FALSE for compiling the dynamic command. - gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE - } - ShellPkg/DynamicCommand/DpDynamicCommand/DpDynamicCommand.inf { - - ## This flag is used to control initialization of the shell library - # This should be FALSE for compiling the dynamic command. - gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE - } - ShellPkg/Application/Shell/Shell.inf { - - ## This flag is used to control initialization of the shell library - # This should be FALSE for compiling the shell application itself o= nly. - gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE - - #------------------------------ - # Basic commands - #------------------------------ - - - NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1Comm= andsLib.inf - NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2Comm= andsLib.inf - NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3Comm= andsLib.inf - NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1Co= mmandsLib.inf - NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1= CommandsLib.inf - NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Comm= andsLib.inf - - #------------------------------ - # Networking commands - #------------------------------ - - - NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1= CommandsLib.inf - - #------------------------------ - # Support libraries - #------------------------------ - - - DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf - DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf - HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandlePar= singLib.inf - PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf - ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLi= b.inf - ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellComman= dLib.inf - SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf - } diff --git a/CorebootPayloadPkg/FbGop/ComponentName.c b/CorebootPayloadPkg/= FbGop/ComponentName.c deleted file mode 100644 index 1d28b427eb..0000000000 --- a/CorebootPayloadPkg/FbGop/ComponentName.c +++ /dev/null @@ -1,306 +0,0 @@ -/** @file - -Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
- -SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include "FbGop.h" - -// -// EFI Component Name Functions -// -/** - Retrieves a Unicode string that is the user readable name of the driver. - - This function retrieves the user readable name of a driver in the form o= f a - Unicode string. If the driver specified by This has a user readable name= in - the language specified by Language, then a pointer to the driver name is - returned in DriverName, and EFI_SUCCESS is returned. If the driver speci= fied - by This does not support the language specified by Language, - then EFI_UNSUPPORTED is returned. - - @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTO= COL or - EFI_COMPONENT_NAME_PROTOCOL instance. - - @param Language[in] A pointer to a Null-terminated ASCII string - array indicating the language. This is the - language of the driver name that the calle= r is - requesting, and it must match one of the - languages specified in SupportedLanguages.= The - number of languages supported by a driver = is up - to the driver writer. Language is specified - in RFC 4646 or ISO 639-2 language code for= mat. - - @param DriverName[out] A pointer to the Unicode string to return. - This Unicode string is the name of the - driver specified by This in the language - specified by Language. - - @retval EFI_SUCCESS The Unicode string for the Driver specifie= d by - This and the language specified by Languag= e was - returned in DriverName. - - @retval EFI_INVALID_PARAMETER Language is NULL. - - @retval EFI_INVALID_PARAMETER DriverName is NULL. - - @retval EFI_UNSUPPORTED The driver specified by This does not supp= ort - the language specified by Language. - -**/ -EFI_STATUS -EFIAPI -FbGopComponentNameGetDriverName ( - IN EFI_COMPONENT_NAME_PROTOCOL *This, - IN CHAR8 *Language, - OUT CHAR16 **DriverName - ); - - -/** - Retrieves a Unicode string that is the user readable name of the control= ler - that is being managed by a driver. - - This function retrieves the user readable name of the controller specifi= ed by - ControllerHandle and ChildHandle in the form of a Unicode string. If the - driver specified by This has a user readable name in the language specif= ied by - Language, then a pointer to the controller name is returned in Controlle= rName, - and EFI_SUCCESS is returned. If the driver specified by This is not cur= rently - managing the controller specified by ControllerHandle and ChildHandle, - then EFI_UNSUPPORTED is returned. If the driver specified by This does = not - support the language specified by Language, then EFI_UNSUPPORTED is retu= rned. - - @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTO= COL or - EFI_COMPONENT_NAME_PROTOCOL instance. - - @param ControllerHandle[in] The handle of a controller that the driver - specified by This is managing. This handle - specifies the controller whose name is to = be - returned. - - @param ChildHandle[in] The handle of the child controller to retr= ieve - the name of. This is an optional paramete= r that - may be NULL. It will be NULL for device - drivers. It will also be NULL for a bus d= rivers - that wish to retrieve the name of the bus - controller. It will not be NULL for a bus - driver that wishes to retrieve the name of= a - child controller. - - @param Language[in] A pointer to a Null-terminated ASCII string - array indicating the language. This is the - language of the driver name that the calle= r is - requesting, and it must match one of the - languages specified in SupportedLanguages.= The - number of languages supported by a driver = is up - to the driver writer. Language is specifie= d in - RFC 4646 or ISO 639-2 language code format. - - @param ControllerName[out] A pointer to the Unicode string to return. - This Unicode string is the name of the - controller specified by ControllerHandle a= nd - ChildHandle in the language specified by - Language from the point of view of the dri= ver - specified by This. - - @retval EFI_SUCCESS The Unicode string for the user readable n= ame in - the language specified by Language for the - driver specified by This was returned in - DriverName. - - @retval EFI_INVALID_PARAMETER ControllerHandle is NULL. - - @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a va= lid - EFI_HANDLE. - - @retval EFI_INVALID_PARAMETER Language is NULL. - - @retval EFI_INVALID_PARAMETER ControllerName is NULL. - - @retval EFI_UNSUPPORTED The driver specified by This is not curren= tly - managing the controller specified by - ControllerHandle and ChildHandle. - - @retval EFI_UNSUPPORTED The driver specified by This does not supp= ort - the language specified by Language. - -**/ -EFI_STATUS -EFIAPI -FbGopComponentNameGetControllerName ( - IN EFI_COMPONENT_NAME_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN EFI_HANDLE ChildHandle O= PTIONAL, - IN CHAR8 *Language, - OUT CHAR16 **ControllerName - ); - - -// -// EFI Component Name Protocol -// -GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL gFbGopComponent= Name =3D { - FbGopComponentNameGetDriverName, - FbGopComponentNameGetControllerName, - "eng" -}; - -// -// EFI Component Name 2 Protocol -// -GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gFbGopComponent= Name2 =3D { - (EFI_COMPONENT_NAME2_GET_DRIVER_NAME) FbGopComponentNameGetDriverName, - (EFI_COMPONENT_NAME2_GET_CONTROLLER_NAME) FbGopComponentNameGetControlle= rName, - "en" -}; - - -GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mFbGopDriverNameTab= le[] =3D { - { - "eng;en", - L"FB GOP Video Driver" - }, - { - NULL, - NULL - } -}; - -/** - Retrieves a Unicode string that is the user readable name of the driver. - - This function retrieves the user readable name of a driver in the form o= f a - Unicode string. If the driver specified by This has a user readable name= in - the language specified by Language, then a pointer to the driver name is - returned in DriverName, and EFI_SUCCESS is returned. If the driver speci= fied - by This does not support the language specified by Language, - then EFI_UNSUPPORTED is returned. - - @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTO= COL or - EFI_COMPONENT_NAME_PROTOCOL instance. - - @param Language[in] A pointer to a Null-terminated ASCII string - array indicating the language. This is the - language of the driver name that the calle= r is - requesting, and it must match one of the - languages specified in SupportedLanguages.= The - number of languages supported by a driver = is up - to the driver writer. Language is specified - in RFC 4646 or ISO 639-2 language code for= mat. - - @param DriverName[out] A pointer to the Unicode string to return. - This Unicode string is the name of the - driver specified by This in the language - specified by Language. - - @retval EFI_SUCCESS The Unicode string for the Driver specifie= d by - This and the language specified by Languag= e was - returned in DriverName. - - @retval EFI_INVALID_PARAMETER Language is NULL. - - @retval EFI_INVALID_PARAMETER DriverName is NULL. - - @retval EFI_UNSUPPORTED The driver specified by This does not supp= ort - the language specified by Language. - -**/ -EFI_STATUS -EFIAPI -FbGopComponentNameGetDriverName ( - IN EFI_COMPONENT_NAME_PROTOCOL *This, - IN CHAR8 *Language, - OUT CHAR16 **DriverName - ) -{ - return LookupUnicodeString2 ( - Language, - This->SupportedLanguages, - mFbGopDriverNameTable, - DriverName, - (BOOLEAN)(This =3D=3D &gFbGopComponentName) - ); -} - -/** - Retrieves a Unicode string that is the user readable name of the control= ler - that is being managed by a driver. - - This function retrieves the user readable name of the controller specifi= ed by - ControllerHandle and ChildHandle in the form of a Unicode string. If the - driver specified by This has a user readable name in the language specif= ied by - Language, then a pointer to the controller name is returned in Controlle= rName, - and EFI_SUCCESS is returned. If the driver specified by This is not cur= rently - managing the controller specified by ControllerHandle and ChildHandle, - then EFI_UNSUPPORTED is returned. If the driver specified by This does = not - support the language specified by Language, then EFI_UNSUPPORTED is retu= rned. - - @param This[in] A pointer to the EFI_COMPONENT_NAME2_PROTO= COL or - EFI_COMPONENT_NAME_PROTOCOL instance. - - @param ControllerHandle[in] The handle of a controller that the driver - specified by This is managing. This handle - specifies the controller whose name is to = be - returned. - - @param ChildHandle[in] The handle of the child controller to retr= ieve - the name of. This is an optional paramete= r that - may be NULL. It will be NULL for device - drivers. It will also be NULL for a bus d= rivers - that wish to retrieve the name of the bus - controller. It will not be NULL for a bus - driver that wishes to retrieve the name of= a - child controller. - - @param Language[in] A pointer to a Null-terminated ASCII string - array indicating the language. This is the - language of the driver name that the calle= r is - requesting, and it must match one of the - languages specified in SupportedLanguages.= The - number of languages supported by a driver = is up - to the driver writer. Language is specifie= d in - RFC 4646 or ISO 639-2 language code format. - - @param ControllerName[out] A pointer to the Unicode string to return. - This Unicode string is the name of the - controller specified by ControllerHandle a= nd - ChildHandle in the language specified by - Language from the point of view of the dri= ver - specified by This. - - @retval EFI_SUCCESS The Unicode string for the user readable n= ame in - the language specified by Language for the - driver specified by This was returned in - DriverName. - - @retval EFI_INVALID_PARAMETER ControllerHandle is NULL. - - @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a va= lid - EFI_HANDLE. - - @retval EFI_INVALID_PARAMETER Language is NULL. - - @retval EFI_INVALID_PARAMETER ControllerName is NULL. - - @retval EFI_UNSUPPORTED The driver specified by This is not curren= tly - managing the controller specified by - ControllerHandle and ChildHandle. - - @retval EFI_UNSUPPORTED The driver specified by This does not supp= ort - the language specified by Language. - -**/ -EFI_STATUS -EFIAPI -FbGopComponentNameGetControllerName ( - IN EFI_COMPONENT_NAME_PROTOCOL *This, - IN EFI_HANDLE ControllerHandle, - IN EFI_HANDLE ChildHandle O= PTIONAL, - IN CHAR8 *Language, - OUT CHAR16 **ControllerName - ) -{ - return EFI_UNSUPPORTED; -} diff --git a/CorebootPayloadPkg/FbGop/FbGop.c b/CorebootPayloadPkg/FbGop/Fb= Gop.c deleted file mode 100644 index e46f53426e..0000000000 --- a/CorebootPayloadPkg/FbGop/FbGop.c +++ /dev/null @@ -1,1536 +0,0 @@ -/** @file - ConsoleOut Routines that speak VGA. - -Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.
- -SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include "FbGop.h" - -EFI_PIXEL_BITMASK mPixelBitMask =3D {0x0000FF, 0x00FF00, 0xFF0000, 0x0000= 00}; - -// -// Save controller attributes during first start -// -UINT64 mOriginalPciAttributes; -BOOLEAN mPciAttributesSaved =3D FALSE; -FRAME_BUFFER_INFO *mFrameBufferInfo; - -// -// EFI Driver Binding Protocol Instance -// -EFI_DRIVER_BINDING_PROTOCOL gFbGopDriverBinding =3D { - FbGopDriverBindingSupported, - FbGopDriverBindingStart, - FbGopDriverBindingStop, - 0x3, - NULL, - NULL -}; - -// -// Native resolution in EDID DetailedTiming[0] -// -UINT32 mNativeModeHorizontal; -UINT32 mNativeModeVertical; - -/** - Supported. - - @param This Pointer to driver binding protocol - @param Controller Controller handle to connect - @param RemainingDevicePath A pointer to the remaining portion of a d= evice - path - - @retval EFI_STATUS EFI_SUCCESS:This controller can be manage= d by this - driver, Otherwise, this controller cannot= be - managed by this driver - -**/ -EFI_STATUS -EFIAPI -FbGopDriverBindingSupported ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Controller, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath - ) -{ - EFI_STATUS Status; - EFI_PCI_IO_PROTOCOL *PciIo; - PCI_TYPE00 Pci; - EFI_DEV_PATH *Node; - UINT8 Index; - EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Resources; - - // - // Open the IO Abstraction(s) needed to perform the supported test - // - Status =3D gBS->OpenProtocol ( - Controller, - &gEfiPciIoProtocolGuid, - (VOID **) &PciIo, - This->DriverBindingHandle, - Controller, - EFI_OPEN_PROTOCOL_BY_DRIVER - ); - if (EFI_ERROR (Status)) { - return Status; - } - - // - // See if this is a PCI Graphics Controller by looking at the Command re= gister and - // Class Code Register - // - Status =3D PciIo->Pci.Read ( - PciIo, - EfiPciIoWidthUint32, - 0, - sizeof (Pci) / sizeof (UINT32), - &Pci - ); - if (EFI_ERROR (Status)) { - Status =3D EFI_UNSUPPORTED; - goto Done; - } - - Status =3D EFI_UNSUPPORTED; - if (IS_PCI_DISPLAY (&Pci) || IS_PCI_OLD_VGA (&Pci)) { - // - // Check if PCI BAR matches the framebuffer base - // - Status =3D EFI_UNSUPPORTED; - for (Index =3D 0; Index < PCI_MAX_BAR; Index++) { - Status =3D PciIo->GetBarAttributes (PciIo, Index, NULL, (VOID**) &Re= sources); - if (!EFI_ERROR (Status)) { - if ((Resources->Desc =3D=3D ACPI_ADDRESS_SPACE_DESCRIPTOR) && - (Resources->Len =3D=3D (UINT16) (sizeof (EFI_ACPI_ADDRESS_SPAC= E_DESCRIPTOR) - 3)) && - (Resources->ResType =3D=3D ACPI_ADDRESS_SPACE_TYPE_MEM) && - (Resources->AddrRangeMin =3D=3D mFrameBufferInfo->LinearFrameB= uffer)) { - DEBUG ((DEBUG_INFO, "Found matched framebuffer PCI BAR !\n")); - Status =3D EFI_SUCCESS; - break; - } - } - } - - if (!EFI_ERROR (Status)) { - // - // If this is a graphics controller, - // go further check RemainingDevicePath - // - if (RemainingDevicePath !=3D NULL) { - Node =3D (EFI_DEV_PATH *) RemainingDevicePath; - // - // Check if RemainingDevicePath is the End of Device Path Node, - // if yes, return EFI_SUCCESS - // - if (!IsDevicePathEnd (Node)) { - // - // Verify RemainingDevicePath - // - if (Node->DevPath.Type !=3D ACPI_DEVICE_PATH || - Node->DevPath.SubType !=3D ACPI_ADR_DP || - DevicePathNodeLength(&Node->DevPath) < sizeof(ACPI_ADR_DEVIC= E_PATH)) { - Status =3D EFI_UNSUPPORTED; - } - } - } - } - } - -Done: - gBS->CloseProtocol ( - Controller, - &gEfiPciIoProtocolGuid, - This->DriverBindingHandle, - Controller - ); - - return Status; -} - - -/** - Install Graphics Output Protocol onto VGA device handles. - - @param This Pointer to driver binding protocol - @param Controller Controller handle to connect - @param RemainingDevicePath A pointer to the remaining portion of a d= evice - path - - @return EFI_STATUS - -**/ -EFI_STATUS -EFIAPI -FbGopDriverBindingStart ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Controller, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath - ) -{ - EFI_STATUS Status; - EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath; - EFI_PCI_IO_PROTOCOL *PciIo; - UINT64 Supports; - - DEBUG ((DEBUG_INFO, "GOP START\n")); - - // - // Initialize local variables - // - PciIo =3D NULL; - ParentDevicePath =3D NULL; - - // - // Prepare for status code - // - Status =3D gBS->HandleProtocol ( - Controller, - &gEfiDevicePathProtocolGuid, - (VOID **) &ParentDevicePath - ); - if (EFI_ERROR (Status)) { - return Status; - } - - // - // Open the IO Abstraction(s) needed - // - Status =3D gBS->OpenProtocol ( - Controller, - &gEfiPciIoProtocolGuid, - (VOID **) &PciIo, - This->DriverBindingHandle, - Controller, - EFI_OPEN_PROTOCOL_BY_DRIVER - ); - if (EFI_ERROR (Status) && (Status !=3D EFI_ALREADY_STARTED)) { - return Status; - } - - // - // Save original PCI attributes - // - if (!mPciAttributesSaved) { - Status =3D PciIo->Attributes ( - PciIo, - EfiPciIoAttributeOperationGet, - 0, - &mOriginalPciAttributes - ); - - if (EFI_ERROR (Status)) { - goto Done; - } - mPciAttributesSaved =3D TRUE; - } - - // - // Get supported PCI attributes - // - Status =3D PciIo->Attributes ( - PciIo, - EfiPciIoAttributeOperationSupported, - 0, - &Supports - ); - if (EFI_ERROR (Status)) { - goto Done; - } - - Supports &=3D (EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_VGA_IO= _16); - if (Supports =3D=3D 0 || Supports =3D=3D (EFI_PCI_IO_ATTRIBUTE_VGA_IO | = EFI_PCI_IO_ATTRIBUTE_VGA_IO_16)) { - Status =3D EFI_UNSUPPORTED; - goto Done; - } - - REPORT_STATUS_CODE_WITH_DEVICE_PATH ( - EFI_PROGRESS_CODE, - EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_PC_ENABLE, - ParentDevicePath - ); - // - // Enable the device and make sure VGA cycles are being forwarded to thi= s VGA device - // - Status =3D PciIo->Attributes ( - PciIo, - EfiPciIoAttributeOperationEnable, - EFI_PCI_DEVICE_ENABLE, - NULL - ); - if (EFI_ERROR (Status)) { - REPORT_STATUS_CODE_WITH_DEVICE_PATH ( - EFI_ERROR_CODE | EFI_ERROR_MINOR, - EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_EC_RESOURCE_CONFLICT, - ParentDevicePath - ); - goto Done; - } - - if (RemainingDevicePath !=3D NULL) { - if (IsDevicePathEnd (RemainingDevicePath)) { - // - // If RemainingDevicePath is the End of Device Path Node, - // don't create any child device and return EFI_SUCCESS - Status =3D EFI_SUCCESS; - goto Done; - } - } - - // - // Create child handle and install GraphicsOutputProtocol on it - // - Status =3D FbGopChildHandleInstall ( - This, - Controller, - PciIo, - NULL, - ParentDevicePath, - RemainingDevicePath - ); - -Done: - if ((EFI_ERROR (Status)) && (Status !=3D EFI_ALREADY_STARTED)) { - - REPORT_STATUS_CODE_WITH_DEVICE_PATH ( - EFI_PROGRESS_CODE, - EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_PC_DISABLE, - ParentDevicePath - ); - - REPORT_STATUS_CODE_WITH_DEVICE_PATH ( - EFI_PROGRESS_CODE, - EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_EC_NOT_DETECTED, - ParentDevicePath - ); - if (!HasChildHandle (Controller)) { - if (mPciAttributesSaved) { - // - // Restore original PCI attributes - // - PciIo->Attributes ( - PciIo, - EfiPciIoAttributeOperationSet, - mOriginalPciAttributes, - NULL - ); - } - } - // - // Release PCI I/O Protocols on the controller handle. - // - gBS->CloseProtocol ( - Controller, - &gEfiPciIoProtocolGuid, - This->DriverBindingHandle, - Controller - ); - } - - return Status; -} - - -/** - Stop. - - @param This Pointer to driver binding protocol - @param Controller Controller handle to connect - @param NumberOfChildren Number of children handle created by this= driver - @param ChildHandleBuffer Buffer containing child handle created - - @retval EFI_SUCCESS Driver disconnected successfully from con= troller - @retval EFI_UNSUPPORTED Cannot find FB_VIDEO_DEV structure - -**/ -EFI_STATUS -EFIAPI -FbGopDriverBindingStop ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Controller, - IN UINTN NumberOfChildren, - IN EFI_HANDLE *ChildHandleBuffer - ) -{ - EFI_STATUS Status; - BOOLEAN AllChildrenStopped; - UINTN Index; - EFI_PCI_IO_PROTOCOL *PciIo; - - AllChildrenStopped =3D TRUE; - - if (NumberOfChildren =3D=3D 0) { - // - // Close PCI I/O protocol on the controller handle - // - gBS->CloseProtocol ( - Controller, - &gEfiPciIoProtocolGuid, - This->DriverBindingHandle, - Controller - ); - - return EFI_SUCCESS; - } - - for (Index =3D 0; Index < NumberOfChildren; Index++) { - - Status =3D EFI_SUCCESS; - - FbGopChildHandleUninstall (This, Controller, ChildHandleBuffer[Index]); - - if (EFI_ERROR (Status)) { - AllChildrenStopped =3D FALSE; - } - } - - if (!AllChildrenStopped) { - return EFI_DEVICE_ERROR; - } - - if (!HasChildHandle (Controller)) { - if (mPciAttributesSaved) { - Status =3D gBS->HandleProtocol ( - Controller, - &gEfiPciIoProtocolGuid, - (VOID **) &PciIo - ); - ASSERT_EFI_ERROR (Status); - - // - // Restore original PCI attributes - // - Status =3D PciIo->Attributes ( - PciIo, - EfiPciIoAttributeOperationSet, - mOriginalPciAttributes, - NULL - ); - ASSERT_EFI_ERROR (Status); - } - } - - - return EFI_SUCCESS; -} - - -/** - Install child handles if the Handle supports MBR format. - - @param This Calling context. - @param ParentHandle Parent Handle - @param ParentPciIo Parent PciIo interface - @param ParentLegacyBios Parent LegacyBios interface - @param ParentDevicePath Parent Device Path - @param RemainingDevicePath Remaining Device Path - - @retval EFI_SUCCESS If a child handle was added - @retval other A child handle was not added - -**/ -EFI_STATUS -FbGopChildHandleInstall ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE ParentHandle, - IN EFI_PCI_IO_PROTOCOL *ParentPciIo, - IN VOID *ParentLegacyBios, - IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath - ) -{ - EFI_STATUS Status; - FB_VIDEO_DEV *FbGopPrivate; - PCI_TYPE00 Pci; - ACPI_ADR_DEVICE_PATH AcpiDeviceNode; - - // - // Allocate the private device structure for video device - // - FbGopPrivate =3D (FB_VIDEO_DEV *) AllocateZeroPool ( - sizeof (FB_VIDEO_DEV) - ); - if (NULL =3D=3D FbGopPrivate) { - Status =3D EFI_OUT_OF_RESOURCES; - goto Done; - } - - // - // See if this is a VGA compatible controller or not - // - Status =3D ParentPciIo->Pci.Read ( - ParentPciIo, - EfiPciIoWidthUint32, - 0, - sizeof (Pci) / sizeof (UINT32), - &Pci - ); - if (EFI_ERROR (Status)) { - REPORT_STATUS_CODE_WITH_DEVICE_PATH ( - EFI_ERROR_CODE | EFI_ERROR_MINOR, - EFI_PERIPHERAL_LOCAL_CONSOLE | EFI_P_EC_CONTROLLER_ERROR, - ParentDevicePath - ); - goto Done; - } - - // - // Initialize the child private structure - // - FbGopPrivate->Signature =3D FB_VIDEO_DEV_SIGNATURE; - - // - // Fill in Graphics Output specific mode structures - // - FbGopPrivate->ModeData =3D NULL; - - FbGopPrivate->VbeFrameBuffer =3D NULL; - - FbGopPrivate->EdidDiscovered.SizeOfEdid =3D 0; - FbGopPrivate->EdidDiscovered.Edid =3D NULL; - FbGopPrivate->EdidActive.SizeOfEdid =3D 0; - FbGopPrivate->EdidActive.Edid =3D NULL; - - // - // Fill in the Graphics Output Protocol - // - FbGopPrivate->GraphicsOutput.QueryMode =3D FbGopGraphicsOutputQueryMode; - FbGopPrivate->GraphicsOutput.SetMode =3D FbGopGraphicsOutputSetMode; - - - // - // Allocate buffer for Graphics Output Protocol mode information - // - FbGopPrivate->GraphicsOutput.Mode =3D (EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE= *) AllocatePool ( - sizeof (EFI_GRAPHICS_OUTPUT_P= ROTOCOL_MODE) - ); - if (NULL =3D=3D FbGopPrivate->GraphicsOutput.Mode) { - Status =3D EFI_OUT_OF_RESOURCES; - goto Done; - } - - FbGopPrivate->GraphicsOutput.Mode->Info =3D (EFI_GRAPHICS_OUTPUT_MODE_IN= FORMATION *) AllocatePool ( - sizeof (EFI_GRAPHICS_OUTPUT_M= ODE_INFORMATION) - ); - if (NULL =3D=3D FbGopPrivate->GraphicsOutput.Mode->Info) { - Status =3D EFI_OUT_OF_RESOURCES; - goto Done; - } - - // - // Set Gop Device Path, here RemainingDevicePath will not be one End of = Device Path Node. - // - if ((RemainingDevicePath =3D=3D NULL) || (!IsDevicePathEnd (RemainingDev= icePath))) { - if (RemainingDevicePath =3D=3D NULL) { - ZeroMem (&AcpiDeviceNode, sizeof (ACPI_ADR_DEVICE_PATH)); - AcpiDeviceNode.Header.Type =3D ACPI_DEVICE_PATH; - AcpiDeviceNode.Header.SubType =3D ACPI_ADR_DP; - AcpiDeviceNode.ADR =3D ACPI_DISPLAY_ADR (1, 0, 0, 1, 0, ACPI_ADR_DIS= PLAY_TYPE_VGA, 0, 0); - SetDevicePathNodeLength (&AcpiDeviceNode.Header, sizeof (ACPI_ADR_DE= VICE_PATH)); - - FbGopPrivate->GopDevicePath =3D AppendDevicePathNode ( - ParentDevicePath, - (EFI_DEVICE_PATH_PROTOCOL *) &Ac= piDeviceNode - ); - } else { - FbGopPrivate->GopDevicePath =3D AppendDevicePathNode (ParentDevicePa= th, RemainingDevicePath); - } - - // - // Creat child handle and device path protocol firstly - // - FbGopPrivate->Handle =3D NULL; - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &FbGopPrivate->Handle, - &gEfiDevicePathProtocolGuid, - FbGopPrivate->GopDevicePath, - NULL - ); - if (EFI_ERROR (Status)) { - goto Done; - } - } - - // - // When check for VBE, PCI I/O protocol is needed, so use parent's proto= col interface temporally - // - FbGopPrivate->PciIo =3D ParentPciIo; - - // - // Check for VESA BIOS Extensions for modes that are compatible with Gra= phics Output - // - Status =3D FbGopCheckForVbe (FbGopPrivate); - DEBUG ((DEBUG_INFO, "FbGopCheckForVbe - %r\n", Status)); - - if (EFI_ERROR (Status)) { - Status =3D EFI_UNSUPPORTED; - //goto Done; - } - - // - // Creat child handle and install Graphics Output Protocol,EDID Discover= ed/Active Protocol - // - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &FbGopPrivate->Handle, - &gEfiGraphicsOutputProtocolGuid, - &FbGopPrivate->GraphicsOutput, - &gEfiEdidDiscoveredProtocolGuid, - &FbGopPrivate->EdidDiscovered, - &gEfiEdidActiveProtocolGuid, - &FbGopPrivate->EdidActive, - NULL - ); - - if (!EFI_ERROR (Status)) { - // - // Open the Parent Handle for the child - // - Status =3D gBS->OpenProtocol ( - ParentHandle, - &gEfiPciIoProtocolGuid, - (VOID **) &FbGopPrivate->PciIo, - This->DriverBindingHandle, - FbGopPrivate->Handle, - EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER - ); - if (EFI_ERROR (Status)) { - goto Done; - } - } - -Done: - if (EFI_ERROR (Status)) { - // - // Free private data structure - // - FbGopDeviceReleaseResource (FbGopPrivate); - } - - return Status; -} - - -/** - Deregister an video child handle and free resources. - - @param This Protocol instance pointer. - @param Controller Video controller handle - @param Handle Video child handle - - @return EFI_STATUS - -**/ -EFI_STATUS -FbGopChildHandleUninstall ( - EFI_DRIVER_BINDING_PROTOCOL *This, - EFI_HANDLE Controller, - EFI_HANDLE Handle - ) -{ - EFI_STATUS Status; - EFI_GRAPHICS_OUTPUT_PROTOCOL *GraphicsOutput; - FB_VIDEO_DEV *FbGopPrivate; - EFI_PCI_IO_PROTOCOL *PciIo; - - FbGopPrivate =3D NULL; - GraphicsOutput =3D NULL; - PciIo =3D NULL; - Status =3D EFI_UNSUPPORTED; - - Status =3D gBS->OpenProtocol ( - Handle, - &gEfiGraphicsOutputProtocolGuid, - (VOID **) &GraphicsOutput, - This->DriverBindingHandle, - Handle, - EFI_OPEN_PROTOCOL_GET_PROTOCOL - ); - if (!EFI_ERROR (Status)) { - FbGopPrivate =3D FB_VIDEO_DEV_FROM_GRAPHICS_OUTPUT_THIS (GraphicsOut= put); - } - - if (FbGopPrivate =3D=3D NULL) { - return EFI_UNSUPPORTED; - } - - // - // Close PCI I/O protocol that opened by child handle - // - Status =3D gBS->CloseProtocol ( - Controller, - &gEfiPciIoProtocolGuid, - This->DriverBindingHandle, - Handle - ); - - // - // Uninstall protocols on child handle - // - Status =3D gBS->UninstallMultipleProtocolInterfaces ( - FbGopPrivate->Handle, - &gEfiDevicePathProtocolGuid, - FbGopPrivate->GopDevicePath, - &gEfiGraphicsOutputProtocolGuid, - &FbGopPrivate->GraphicsOutput, - NULL - ); - - if (EFI_ERROR (Status)) { - gBS->OpenProtocol ( - Controller, - &gEfiPciIoProtocolGuid, - (VOID **) &PciIo, - This->DriverBindingHandle, - Handle, - EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER - ); - return Status; - } - - // - // Release all allocated resources - // - FbGopDeviceReleaseResource (FbGopPrivate); - - return EFI_SUCCESS; -} - - -/** - Release resource for bios video instance. - - @param FbGopPrivate Video child device private data structure - -**/ -VOID -FbGopDeviceReleaseResource ( - FB_VIDEO_DEV *FbGopPrivate - ) -{ - if (FbGopPrivate =3D=3D NULL) { - return ; - } - - // - // Release all the resources occupied by the FB_VIDEO_DEV - // - - // - // Free VBE Frame Buffer - // - if (FbGopPrivate->VbeFrameBuffer !=3D NULL) { - FreePool (FbGopPrivate->VbeFrameBuffer); - } - - // - // Free mode data - // - if (FbGopPrivate->ModeData !=3D NULL) { - FreePool (FbGopPrivate->ModeData); - } - - // - // Free graphics output protocol occupied resource - // - if (FbGopPrivate->GraphicsOutput.Mode !=3D NULL) { - if (FbGopPrivate->GraphicsOutput.Mode->Info !=3D NULL) { - FreePool (FbGopPrivate->GraphicsOutput.Mode->Info); - FbGopPrivate->GraphicsOutput.Mode->Info =3D NULL; - } - FreePool (FbGopPrivate->GraphicsOutput.Mode); - FbGopPrivate->GraphicsOutput.Mode =3D NULL; - } - - if (FbGopPrivate->GopDevicePath!=3D NULL) { - FreePool (FbGopPrivate->GopDevicePath); - } - - FreePool (FbGopPrivate); - - return ; -} - - - -/** - Check if all video child handles have been uninstalled. - - @param Controller Video controller handle - - @return TRUE Child handles exist. - @return FALSE All video child handles have been uninsta= lled. - -**/ -BOOLEAN -HasChildHandle ( - IN EFI_HANDLE Controller - ) -{ - UINTN Index; - EFI_OPEN_PROTOCOL_INFORMATION_ENTRY *OpenInfoBuffer; - UINTN EntryCount; - BOOLEAN HasChild; - - EntryCount =3D 0; - HasChild =3D FALSE; - gBS->OpenProtocolInformation ( - Controller, - &gEfiPciIoProtocolGuid, - &OpenInfoBuffer, - &EntryCount - ); - for (Index =3D 0; Index < EntryCount; Index++) { - if ((OpenInfoBuffer[Index].Attributes & EFI_OPEN_PROTOCOL_BY_CHILD_CON= TROLLER) !=3D 0) { - HasChild =3D TRUE; - } - } - - return HasChild; -} - -/** - Check for VBE device. - - @param FbGopPrivate Pointer to FB_VIDEO_DEV structure - - @retval EFI_SUCCESS VBE device found - -**/ -EFI_STATUS -FbGopCheckForVbe ( - IN OUT FB_VIDEO_DEV *FbGopPrivate - ) -{ - EFI_STATUS Status; - FB_VIDEO_MODE_DATA *ModeBuffer; - FB_VIDEO_MODE_DATA *CurrentModeData; - UINTN ModeNumber; - UINTN BitsPerPixel; - UINTN BytesPerScanLine; - UINT32 HorizontalResolution; - UINT32 VerticalResolution; - EFI_GRAPHICS_OUTPUT_BLT_PIXEL *VbeFrameBuffer; - FRAME_BUFFER_INFO *FbInfo; - - Status =3D EFI_SUCCESS; - - FbInfo =3D mFrameBufferInfo; - - // - // Add mode to the list of available modes - // - VbeFrameBuffer =3D NULL; - ModeBuffer =3D NULL; - - ModeNumber =3D 1; - BitsPerPixel =3D FbInfo->BitsPerPixel; - HorizontalResolution =3D FbInfo->HorizontalResolution; - VerticalResolution =3D FbInfo->VerticalResolution; - BytesPerScanLine =3D FbInfo->BytesPerScanLine; - - ModeBuffer =3D (FB_VIDEO_MODE_DATA *) AllocatePool ( - ModeNumber * sizeof (FB_VIDEO_MODE_DATA) - ); - if (NULL =3D=3D ModeBuffer) { - Status =3D EFI_OUT_OF_RESOURCES; - goto Done; - } - - VbeFrameBuffer =3D - (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) AllocatePool ( - BytesPerScanLine * VerticalResolution - ); - if (NULL =3D=3D VbeFrameBuffer) { - Status =3D EFI_OUT_OF_RESOURCES; - goto Done; - } - - if (FbGopPrivate->ModeData !=3D NULL) { - FreePool (FbGopPrivate->ModeData); - } - - if (FbGopPrivate->VbeFrameBuffer !=3D NULL) { - FreePool (FbGopPrivate->VbeFrameBuffer); - } - - CurrentModeData =3D &ModeBuffer[ModeNumber - 1]; - CurrentModeData->BytesPerScanLine =3D (UINT16)BytesPerScanLine; - - CurrentModeData->Red =3D *(FB_VIDEO_COLOR_PLACEMENT *)&(FbInfo->Red= ); - CurrentModeData->Blue =3D *(FB_VIDEO_COLOR_PLACEMENT *)&(FbInfo->Blu= e); - CurrentModeData->Green =3D *(FB_VIDEO_COLOR_PLACEMENT *)&(FbInfo->Gre= en); - CurrentModeData->Reserved =3D *(FB_VIDEO_COLOR_PLACEMENT *)&(FbInfo->Res= erved); - - CurrentModeData->BitsPerPixel =3D (UINT32)BitsPerPixel; - CurrentModeData->HorizontalResolution =3D HorizontalResolution; - CurrentModeData->VerticalResolution =3D VerticalResolution; - CurrentModeData->FrameBufferSize =3D CurrentModeData->BytesPerScanLine *= CurrentModeData->VerticalResolution; - CurrentModeData->LinearFrameBuffer =3D (VOID *) (UINTN) FbInfo->LinearFr= ameBuffer; - CurrentModeData->VbeModeNumber =3D 0; - CurrentModeData->ColorDepth =3D 32; - CurrentModeData->RefreshRate =3D 60; - - CurrentModeData->PixelFormat =3D PixelBitMask; - if ((CurrentModeData->BitsPerPixel =3D=3D 32) && - (CurrentModeData->Red.Mask =3D=3D 0xff) && (CurrentModeData->Green.M= ask =3D=3D 0xff) && (CurrentModeData->Blue.Mask =3D=3D 0xff)) { - if ((CurrentModeData->Red.Position =3D=3D 0) && (CurrentModeData->Gree= n.Position =3D=3D 8) && (CurrentModeData->Blue.Position =3D=3D 16)) { - CurrentModeData->PixelFormat =3D PixelRedGreenBlueReserved8BitPerCol= or; - } else if ((CurrentModeData->Blue.Position =3D=3D 0) && (CurrentModeDa= ta->Green.Position =3D=3D 8) && (CurrentModeData->Red.Position =3D=3D 16)) { - CurrentModeData->PixelFormat =3D PixelBlueGreenRedReserved8BitPerCol= or; - } - } - - CopyMem (&(CurrentModeData->PixelBitMask), &mPixelBitMask, sizeof (EFI_P= IXEL_BITMASK)); - - FbGopPrivate->ModeData =3D ModeBuffer; - FbGopPrivate->VbeFrameBuffer =3D VbeFrameBuffer; - - // - // Assign Gop's Blt function - // - FbGopPrivate->GraphicsOutput.Blt =3D FbGopGraphicsOutputVbeBlt; - - FbGopPrivate->GraphicsOutput.Mode->MaxMode =3D 1; - FbGopPrivate->GraphicsOutput.Mode->Mode =3D 0; - FbGopPrivate->GraphicsOutput.Mode->Info->Version =3D 0; - FbGopPrivate->GraphicsOutput.Mode->Info->HorizontalResolution =3D Horizo= ntalResolution; - FbGopPrivate->GraphicsOutput.Mode->Info->VerticalResolution =3D Vertic= alResolution; - FbGopPrivate->GraphicsOutput.Mode->Info->PixelFormat =3D CurrentModeData= ->PixelFormat; - CopyMem (&(FbGopPrivate->GraphicsOutput.Mode->Info->PixelInformation), &= mPixelBitMask, sizeof (EFI_PIXEL_BITMASK)); - FbGopPrivate->GraphicsOutput.Mode->Info->PixelsPerScanLine =3D (UINT32)(= BytesPerScanLine * 8 / BitsPerPixel); - FbGopPrivate->GraphicsOutput.Mode->SizeOfInfo =3D sizeof(EFI_GRAPHICS_OU= TPUT_MODE_INFORMATION); - FbGopPrivate->GraphicsOutput.Mode->FrameBufferBase =3D (EFI_PHYSICAL_ADD= RESS) (UINTN) CurrentModeData->LinearFrameBuffer; - FbGopPrivate->GraphicsOutput.Mode->FrameBufferSize =3D CurrentModeData-= >FrameBufferSize; - - // - // Find the best mode to initialize - // - -Done: - // - // If there was an error, then free the mode structure - // - if (EFI_ERROR (Status)) { - - if (VbeFrameBuffer !=3D NULL) { - FreePool (VbeFrameBuffer); - } - - if (ModeBuffer !=3D NULL) { - FreePool (ModeBuffer); - } - } - - return Status; -} - - -// -// Graphics Output Protocol Member Functions for VESA BIOS Extensions -// - -/** - Graphics Output protocol interface to get video mode. - - @param This Protocol instance pointer. - @param ModeNumber The mode number to return information on. - @param SizeOfInfo A pointer to the size, in bytes, of the I= nfo - buffer. - @param Info Caller allocated buffer that returns info= rmation - about ModeNumber. - - @retval EFI_SUCCESS Mode information returned. - @retval EFI_DEVICE_ERROR A hardware error occurred trying to retri= eve the - video mode. - @retval EFI_NOT_STARTED Video display is not initialized. Call Se= tMode () - @retval EFI_INVALID_PARAMETER One of the input args was NULL. - -**/ -EFI_STATUS -EFIAPI -FbGopGraphicsOutputQueryMode ( - IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, - IN UINT32 ModeNumber, - OUT UINTN *SizeOfInfo, - OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info - ) -{ - FB_VIDEO_DEV *FbGopPrivate; - FB_VIDEO_MODE_DATA *ModeData; - - FbGopPrivate =3D FB_VIDEO_DEV_FROM_GRAPHICS_OUTPUT_THIS (This); - - if (This =3D=3D NULL || Info =3D=3D NULL || SizeOfInfo =3D=3D NULL || Mo= deNumber >=3D This->Mode->MaxMode) { - return EFI_INVALID_PARAMETER; - } - - *Info =3D (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *) AllocatePool ( - sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION) - ); - if (NULL =3D=3D *Info) { - return EFI_OUT_OF_RESOURCES; - } - - *SizeOfInfo =3D sizeof (EFI_GRAPHICS_OUTPUT_MODE_INFORMATION); - - ModeData =3D &FbGopPrivate->ModeData[ModeNumber]; - (*Info)->Version =3D 0; - (*Info)->HorizontalResolution =3D ModeData->HorizontalResolution; - (*Info)->VerticalResolution =3D ModeData->VerticalResolution; - (*Info)->PixelFormat =3D ModeData->PixelFormat; - CopyMem (&((*Info)->PixelInformation), &(ModeData->PixelBitMask), sizeof= (ModeData->PixelBitMask)); - - (*Info)->PixelsPerScanLine =3D (ModeData->BytesPerScanLine * 8) / ModeD= ata->BitsPerPixel; - - return EFI_SUCCESS; -} - -/** - Graphics Output protocol interface to set video mode. - - @param This Protocol instance pointer. - @param ModeNumber The mode number to be set. - - @retval EFI_SUCCESS Graphics mode was changed. - @retval EFI_DEVICE_ERROR The device had an error and could not com= plete the - request. - @retval EFI_UNSUPPORTED ModeNumber is not supported by this devic= e. - -**/ -EFI_STATUS -EFIAPI -FbGopGraphicsOutputSetMode ( - IN EFI_GRAPHICS_OUTPUT_PROTOCOL * This, - IN UINT32 ModeNumber - ) -{ - FB_VIDEO_DEV *FbGopPrivate; - FB_VIDEO_MODE_DATA *ModeData; - EFI_GRAPHICS_OUTPUT_BLT_PIXEL Background; - - if (This =3D=3D NULL) { - return EFI_INVALID_PARAMETER; - } - - FbGopPrivate =3D FB_VIDEO_DEV_FROM_GRAPHICS_OUTPUT_THIS (This); - - ModeData =3D &FbGopPrivate->ModeData[ModeNumber]; - - if (ModeNumber >=3D This->Mode->MaxMode) { - return EFI_UNSUPPORTED; - } - - if (ModeNumber =3D=3D This->Mode->Mode) { - // - // Clear screen to black - // - ZeroMem (&Background, sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); - FbGopGraphicsOutputVbeBlt ( - This, - &Background, - EfiBltVideoFill, - 0, - 0, - 0, - 0, - ModeData->HorizontalResolution, - ModeData->VerticalResolution, - 0 - ); - return EFI_SUCCESS; - } else { - return EFI_UNSUPPORTED; - } - -} - -/** - Update physical frame buffer, copy 4 bytes block, then copy remaining by= tes. - - @param PciIo The pointer of EFI_PCI_IO_PROTOCOL - @param VbeBuffer The data to transfer to screen - @param MemAddress Physical frame buffer base address - @param DestinationX The X coordinate of the destination for BltO= peration - @param DestinationY The Y coordinate of the destination for BltO= peration - @param TotalBytes The total bytes of copy - @param VbePixelWidth Bytes per pixel - @param BytesPerScanLine Bytes per scan line - -**/ -VOID -CopyVideoBuffer ( - IN EFI_PCI_IO_PROTOCOL *PciIo, - IN UINT8 *VbeBuffer, - IN VOID *MemAddress, - IN UINTN DestinationX, - IN UINTN DestinationY, - IN UINTN TotalBytes, - IN UINT32 VbePixelWidth, - IN UINTN BytesPerScanLine - ) -{ - UINTN FrameBufferAddr; - UINTN CopyBlockNum; - UINTN RemainingBytes; - UINTN UnalignedBytes; - EFI_STATUS Status; - - FrameBufferAddr =3D (UINTN) MemAddress + (DestinationY * BytesPerScanLin= e) + DestinationX * VbePixelWidth; - - // - // If TotalBytes is less than 4 bytes, only start byte copy. - // - if (TotalBytes < 4) { - Status =3D PciIo->Mem.Write ( - PciIo, - EfiPciIoWidthUint8, - EFI_PCI_IO_PASS_THROUGH_BAR, - (UINT64) FrameBufferAddr, - TotalBytes, - VbeBuffer - ); - ASSERT_EFI_ERROR (Status); - return; - } - - // - // If VbeBuffer is not 4-byte aligned, start byte copy. - // - UnalignedBytes =3D (4 - ((UINTN) VbeBuffer & 0x3)) & 0x3; - - if (UnalignedBytes !=3D 0) { - Status =3D PciIo->Mem.Write ( - PciIo, - EfiPciIoWidthUint8, - EFI_PCI_IO_PASS_THROUGH_BAR, - (UINT64) FrameBufferAddr, - UnalignedBytes, - VbeBuffer - ); - ASSERT_EFI_ERROR (Status); - FrameBufferAddr +=3D UnalignedBytes; - VbeBuffer +=3D UnalignedBytes; - } - - // - // Calculate 4-byte block count and remaining bytes. - // - CopyBlockNum =3D (TotalBytes - UnalignedBytes) >> 2; - RemainingBytes =3D (TotalBytes - UnalignedBytes) & 3; - - // - // Copy 4-byte block and remaining bytes to physical frame buffer. - // - if (CopyBlockNum !=3D 0) { - Status =3D PciIo->Mem.Write ( - PciIo, - EfiPciIoWidthUint32, - EFI_PCI_IO_PASS_THROUGH_BAR, - (UINT64) FrameBufferAddr, - CopyBlockNum, - VbeBuffer - ); - ASSERT_EFI_ERROR (Status); - } - - if (RemainingBytes !=3D 0) { - FrameBufferAddr +=3D (CopyBlockNum << 2); - VbeBuffer +=3D (CopyBlockNum << 2); - Status =3D PciIo->Mem.Write ( - PciIo, - EfiPciIoWidthUint8, - EFI_PCI_IO_PASS_THROUGH_BAR, - (UINT64) FrameBufferAddr, - RemainingBytes, - VbeBuffer - ); - ASSERT_EFI_ERROR (Status); - } -} - -/** - Worker function to block transfer for VBE device. - - @param FbGopPrivate Instance of FB_VIDEO_DEV - @param BltBuffer The data to transfer to screen - @param BltOperation The operation to perform - @param SourceX The X coordinate of the source for BltOpe= ration - @param SourceY The Y coordinate of the source for BltOpe= ration - @param DestinationX The X coordinate of the destination for - BltOperation - @param DestinationY The Y coordinate of the destination for - BltOperation - @param Width The width of a rectangle in the blt recta= ngle in - pixels - @param Height The height of a rectangle in the blt rect= angle in - pixels - @param Delta Not used for EfiBltVideoFill and - EfiBltVideoToVideo operation. If a Delta = of 0 is - used, the entire BltBuffer will be operat= ed on. If - a subrectangle of the BltBuffer is used, = then - Delta represents the number of bytes in a= row of - the BltBuffer. - @param Mode Mode data. - - @retval EFI_INVALID_PARAMETER Invalid parameter passed in - @retval EFI_SUCCESS Blt operation success - -**/ -EFI_STATUS -FbGopVbeBltWorker ( - IN FB_VIDEO_DEV *FbGopPrivate, - IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL - IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation, - IN UINTN SourceX, - IN UINTN SourceY, - IN UINTN DestinationX, - IN UINTN DestinationY, - IN UINTN Width, - IN UINTN Height, - IN UINTN Delta, - IN FB_VIDEO_MODE_DATA *Mode - ) -{ - EFI_PCI_IO_PROTOCOL *PciIo; - EFI_TPL OriginalTPL; - UINTN DstY; - UINTN SrcY; - UINTN DstX; - EFI_GRAPHICS_OUTPUT_BLT_PIXEL *Blt; - VOID *MemAddress; - EFI_GRAPHICS_OUTPUT_BLT_PIXEL *VbeFrameBuffer; - UINTN BytesPerScanLine; - UINTN Index; - UINT8 *VbeBuffer; - UINT8 *VbeBuffer1; - UINT8 *BltUint8; - UINT32 VbePixelWidth; - UINT32 Pixel; - UINTN TotalBytes; - - PciIo =3D FbGopPrivate->PciIo; - - VbeFrameBuffer =3D FbGopPrivate->VbeFrameBuffer; - MemAddress =3D Mode->LinearFrameBuffer; - BytesPerScanLine =3D Mode->BytesPerScanLine; - VbePixelWidth =3D Mode->BitsPerPixel / 8; - BltUint8 =3D (UINT8 *) BltBuffer; - TotalBytes =3D Width * VbePixelWidth; - - if (((UINTN) BltOperation) >=3D EfiGraphicsOutputBltOperationMax) { - return EFI_INVALID_PARAMETER; - } - - if (Width =3D=3D 0 || Height =3D=3D 0) { - return EFI_INVALID_PARAMETER; - } - // - // We need to fill the Virtual Screen buffer with the blt data. - // The virtual screen is upside down, as the first row is the bottom row= of - // the image. - // - if (BltOperation =3D=3D EfiBltVideoToBltBuffer) { - // - // Video to BltBuffer: Source is Video, destination is BltBuffer - // - if (SourceY + Height > Mode->VerticalResolution) { - return EFI_INVALID_PARAMETER; - } - - if (SourceX + Width > Mode->HorizontalResolution) { - return EFI_INVALID_PARAMETER; - } - } else { - // - // BltBuffer to Video: Source is BltBuffer, destination is Video - // - if (DestinationY + Height > Mode->VerticalResolution) { - return EFI_INVALID_PARAMETER; - } - - if (DestinationX + Width > Mode->HorizontalResolution) { - return EFI_INVALID_PARAMETER; - } - } - // - // If Delta is zero, then the entire BltBuffer is being used, so Delta - // is the number of bytes in each row of BltBuffer. Since BltBuffer is = Width pixels size, - // the number of bytes in each row can be computed. - // - if (Delta =3D=3D 0) { - Delta =3D Width * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL); - } - // - // We have to raise to TPL Notify, so we make an atomic write the frame = buffer. - // We would not want a timer based event (Cursor, ...) to come in while = we are - // doing this operation. - // - OriginalTPL =3D gBS->RaiseTPL (TPL_NOTIFY); - - switch (BltOperation) { - case EfiBltVideoToBltBuffer: - for (SrcY =3D SourceY, DstY =3D DestinationY; DstY < (Height + Destina= tionY); SrcY++, DstY++) { - Blt =3D (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) (BltUint8 + DstY * Delta += DestinationX * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); - // - // Shuffle the packed bytes in the hardware buffer to match EFI_GRAP= HICS_OUTPUT_BLT_PIXEL - // - VbeBuffer =3D ((UINT8 *) VbeFrameBuffer + (SrcY * BytesPerScanLine += SourceX * VbePixelWidth)); - for (DstX =3D DestinationX; DstX < (Width + DestinationX); DstX++) { - Pixel =3D VbeBuffer[0] | VbeBuffer[1] << 8 | VbeBuffer[2] = << 16 | VbeBuffer[3] << 24; - Blt->Red =3D (UINT8) ((Pixel >> Mode->Red.Position) & Mode->R= ed.Mask); - Blt->Blue =3D (UINT8) ((Pixel >> Mode->Blue.Position) & Mode->= Blue.Mask); - Blt->Green =3D (UINT8) ((Pixel >> Mode->Green.Position) & Mode-= >Green.Mask); - Blt->Reserved =3D 0; - Blt++; - VbeBuffer +=3D VbePixelWidth; - } - - } - break; - - case EfiBltVideoToVideo: - for (Index =3D 0; Index < Height; Index++) { - if (DestinationY <=3D SourceY) { - SrcY =3D SourceY + Index; - DstY =3D DestinationY + Index; - } else { - SrcY =3D SourceY + Height - Index - 1; - DstY =3D DestinationY + Height - Index - 1; - } - - VbeBuffer =3D ((UINT8 *) VbeFrameBuffer + DstY * BytesPerScanLine = + DestinationX * VbePixelWidth); - VbeBuffer1 =3D ((UINT8 *) VbeFrameBuffer + SrcY * BytesPerScanLine = + SourceX * VbePixelWidth); - - gBS->CopyMem ( - VbeBuffer, - VbeBuffer1, - TotalBytes - ); - - // - // Update physical frame buffer. - // - CopyVideoBuffer ( - PciIo, - VbeBuffer, - MemAddress, - DestinationX, - DstY, - TotalBytes, - VbePixelWidth, - BytesPerScanLine - ); - } - break; - - case EfiBltVideoFill: - VbeBuffer =3D (UINT8 *) ((UINTN) VbeFrameBuffer + (DestinationY * Byte= sPerScanLine) + DestinationX * VbePixelWidth); - Blt =3D (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) BltUint8; - // - // Shuffle the RGB fields in EFI_GRAPHICS_OUTPUT_BLT_PIXEL to match th= e hardware buffer - // - Pixel =3D ((Blt->Red & Mode->Red.Mask) << Mode->Red.Position) | - ( - (Blt->Green & Mode->Green.Mask) << - Mode->Green.Position - ) | - ((Blt->Blue & Mode->Blue.Mask) << Mode->Blue.Position); - - for (Index =3D 0; Index < Width; Index++) { - gBS->CopyMem ( - VbeBuffer, - &Pixel, - VbePixelWidth - ); - VbeBuffer +=3D VbePixelWidth; - } - - VbeBuffer =3D (UINT8 *) ((UINTN) VbeFrameBuffer + (DestinationY * Byte= sPerScanLine) + DestinationX * VbePixelWidth); - for (DstY =3D DestinationY + 1; DstY < (Height + DestinationY); DstY++= ) { - gBS->CopyMem ( - (VOID *) ((UINTN) VbeFrameBuffer + (DstY * BytesPerScanLine) += DestinationX * VbePixelWidth), - VbeBuffer, - TotalBytes - ); - } - - for (DstY =3D DestinationY; DstY < (Height + DestinationY); DstY++) { - // - // Update physical frame buffer. - // - CopyVideoBuffer ( - PciIo, - VbeBuffer, - MemAddress, - DestinationX, - DstY, - TotalBytes, - VbePixelWidth, - BytesPerScanLine - ); - } - break; - - case EfiBltBufferToVideo: - for (SrcY =3D SourceY, DstY =3D DestinationY; SrcY < (Height + SourceY= ); SrcY++, DstY++) { - Blt =3D (EFI_GRAPHICS_OUTPUT_BLT_PIXEL *) (BltUint8 + (SrcY * = Delta) + (SourceX) * sizeof (EFI_GRAPHICS_OUTPUT_BLT_PIXEL)); - VbeBuffer =3D ((UINT8 *) VbeFrameBuffer + (DstY * BytesPerScanLine += DestinationX * VbePixelWidth)); - for (DstX =3D DestinationX; DstX < (Width + DestinationX); DstX++) { - // - // Shuffle the RGB fields in EFI_GRAPHICS_OUTPUT_BLT_PIXEL to matc= h the hardware buffer - // - Pixel =3D ((Blt->Red & Mode->Red.Mask) << Mode->Red.Position) | - ((Blt->Green & Mode->Green.Mask) << Mode->Green.Position) | - ((Blt->Blue & Mode->Blue.Mask) << Mode->Blue.Position); - gBS->CopyMem ( - VbeBuffer, - &Pixel, - VbePixelWidth - ); - Blt++; - VbeBuffer +=3D VbePixelWidth; - } - - VbeBuffer =3D ((UINT8 *) VbeFrameBuffer + (DstY * BytesPerScanLine += DestinationX * VbePixelWidth)); - - // - // Update physical frame buffer. - // - CopyVideoBuffer ( - PciIo, - VbeBuffer, - MemAddress, - DestinationX, - DstY, - TotalBytes, - VbePixelWidth, - BytesPerScanLine - ); - } - break; - - default: ; - } - - gBS->RestoreTPL (OriginalTPL); - - return EFI_SUCCESS; -} - -/** - Graphics Output protocol instance to block transfer for VBE device. - - @param This Pointer to Graphics Output protocol insta= nce - @param BltBuffer The data to transfer to screen - @param BltOperation The operation to perform - @param SourceX The X coordinate of the source for BltOpe= ration - @param SourceY The Y coordinate of the source for BltOpe= ration - @param DestinationX The X coordinate of the destination for - BltOperation - @param DestinationY The Y coordinate of the destination for - BltOperation - @param Width The width of a rectangle in the blt recta= ngle in - pixels - @param Height The height of a rectangle in the blt rect= angle in - pixels - @param Delta Not used for EfiBltVideoFill and - EfiBltVideoToVideo operation. If a Delta = of 0 is - used, the entire BltBuffer will be operat= ed on. If - a subrectangle of the BltBuffer is used, = then - Delta represents the number of bytes in a= row of - the BltBuffer. - - @retval EFI_INVALID_PARAMETER Invalid parameter passed in - @retval EFI_SUCCESS Blt operation success - -**/ -EFI_STATUS -EFIAPI -FbGopGraphicsOutputVbeBlt ( - IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, - IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL - IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation, - IN UINTN SourceX, - IN UINTN SourceY, - IN UINTN DestinationX, - IN UINTN DestinationY, - IN UINTN Width, - IN UINTN Height, - IN UINTN Delta - ) -{ - FB_VIDEO_DEV *FbGopPrivate; - FB_VIDEO_MODE_DATA *Mode; - - if (This =3D=3D NULL) { - return EFI_INVALID_PARAMETER; - } - - FbGopPrivate =3D FB_VIDEO_DEV_FROM_GRAPHICS_OUTPUT_THIS (This); - Mode =3D &FbGopPrivate->ModeData[This->Mode->Mode]; - - return FbGopVbeBltWorker ( - FbGopPrivate, - BltBuffer, - BltOperation, - SourceX, - SourceY, - DestinationX, - DestinationY, - Width, - Height, - Delta, - Mode - ); -} - - -/** - The user Entry Point for module UefiFbGop. The user code starts with thi= s function. - - @param[in] ImageHandle The firmware allocated handle for the EFI imag= e. - @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 po= int. - -**/ -EFI_STATUS -EFIAPI -FbGopEntryPoint( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - EFI_HOB_GUID_TYPE *GuidHob; - - // - // Find the frame buffer information guid hob - // - GuidHob =3D GetFirstGuidHob (&gUefiFrameBufferInfoGuid); - if (GuidHob !=3D NULL) { - mFrameBufferInfo =3D (FRAME_BUFFER_INFO *)GET_GUID_HOB_DATA (GuidHob); - - // - // Install driver model protocol(s). - // - Status =3D EfiLibInstallDriverBindingComponentName2 ( - ImageHandle, - SystemTable, - &gFbGopDriverBinding, - ImageHandle, - &gFbGopComponentName, - &gFbGopComponentName2 - ); - ASSERT_EFI_ERROR (Status); - } else { - DEBUG ((DEBUG_ERROR, "No FrameBuffer information from coreboot. NO GO= P driver !!!\n")); - Status =3D EFI_ABORTED; - } - return Status; -} - diff --git a/CorebootPayloadPkg/FbGop/FbGop.h b/CorebootPayloadPkg/FbGop/Fb= Gop.h deleted file mode 100644 index 037976eae8..0000000000 --- a/CorebootPayloadPkg/FbGop/FbGop.h +++ /dev/null @@ -1,413 +0,0 @@ -/** @file - -Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
- -SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#ifndef _FB_GOP_H_ -#define _FB_GOP_H_ - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -// -// Packed format support: The number of bits reserved for each of the colo= rs and the actual -// position of RGB in the frame buffer is specified in the VBE Mode inform= ation -// -typedef struct { - UINT8 Position; // Position of the color - UINT8 Mask; // The number of bits expressed as a mask -} FB_VIDEO_COLOR_PLACEMENT; - -// -// BIOS Graphics Output Graphical Mode Data -// -typedef struct { - UINT16 VbeModeNumber; - UINT16 BytesPerScanLine; - VOID *LinearFrameBuffer; - UINTN FrameBufferSize; - UINT32 HorizontalResolution; - UINT32 VerticalResolution; - UINT32 ColorDepth; - UINT32 RefreshRate; - UINT32 BitsPerPixel; - FB_VIDEO_COLOR_PLACEMENT Red; - FB_VIDEO_COLOR_PLACEMENT Green; - FB_VIDEO_COLOR_PLACEMENT Blue; - FB_VIDEO_COLOR_PLACEMENT Reserved; - EFI_GRAPHICS_PIXEL_FORMAT PixelFormat; - EFI_PIXEL_BITMASK PixelBitMask; -} FB_VIDEO_MODE_DATA; - -// -// BIOS video child handle private data Structure -// -#define FB_VIDEO_DEV_SIGNATURE SIGNATURE_32 ('B', 'V', 'M', 'p') - -typedef struct { - UINTN Signature; - EFI_HANDLE Handle; - - // - // Consumed Protocols - // - EFI_PCI_IO_PROTOCOL *PciIo; =20 - - // - // Produced Protocols - // - EFI_GRAPHICS_OUTPUT_PROTOCOL GraphicsOutput; - EFI_EDID_DISCOVERED_PROTOCOL EdidDiscovered; - EFI_EDID_ACTIVE_PROTOCOL EdidActive; - - // - // Graphics Output Protocol related fields - // - UINTN CurrentMode; - UINTN MaxMode; - FB_VIDEO_MODE_DATA *ModeData; - =20 - EFI_GRAPHICS_OUTPUT_BLT_PIXEL *VbeFrameBuffer; - =20 - // - // Status code - // - EFI_DEVICE_PATH_PROTOCOL *GopDevicePath; - =20 -} FB_VIDEO_DEV; - -#define FB_VIDEO_DEV_FROM_PCI_IO_THIS(a) CR (a, FB_VIDEO_DEV, Pc= iIo, FB_VIDEO_DEV_SIGNATURE) -#define FB_VIDEO_DEV_FROM_GRAPHICS_OUTPUT_THIS(a) CR (a, FB_VIDEO_DEV, Gr= aphicsOutput, FB_VIDEO_DEV_SIGNATURE) - -#define GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER 0xffff - -// -// Global Variables -// -extern EFI_DRIVER_BINDING_PROTOCOL gFbGopDriverBinding; -extern EFI_COMPONENT_NAME_PROTOCOL gFbGopComponentName; -extern EFI_COMPONENT_NAME2_PROTOCOL gFbGopComponentName2; - -// -// Driver Binding Protocol functions -// - -/** - Supported. - - @param This Pointer to driver binding protocol - @param Controller Controller handle to connect - @param RemainingDevicePath A pointer to the remaining portion of a d= evice - path - - @retval EFI_STATUS EFI_SUCCESS:This controller can be manage= d by this - driver, Otherwise, this controller cannot= be - managed by this driver - -**/ -EFI_STATUS -EFIAPI -FbGopDriverBindingSupported ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Controller, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath - ); - - -/** - Install Graphics Output Protocol onto VGA device handles. - - @param This Pointer to driver binding protocol - @param Controller Controller handle to connect - @param RemainingDevicePath A pointer to the remaining portion of a d= evice - path - - @return EFI_STATUS - -**/ -EFI_STATUS -EFIAPI -FbGopDriverBindingStart ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Controller, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath - ); - - -/** - Stop. - - @param This Pointer to driver binding protocol - @param Controller Controller handle to connect - @param NumberOfChildren Number of children handle created by this= driver - @param ChildHandleBuffer Buffer containing child handle created - - @retval EFI_SUCCESS Driver disconnected successfully from con= troller - @retval EFI_UNSUPPORTED Cannot find FB_VIDEO_DEV structure - -**/ -EFI_STATUS -EFIAPI -FbGopDriverBindingStop ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE Controller, - IN UINTN NumberOfChildren, - IN EFI_HANDLE *ChildHandleBuffer - ); - -// -// Private worker functions -// - -/** - Check for VBE device. - - @param FbGopPrivate Pointer to FB_VIDEO_DEV structure - - @retval EFI_SUCCESS VBE device found - -**/ -EFI_STATUS -FbGopCheckForVbe ( - IN OUT FB_VIDEO_DEV *FbGopPrivate - ); - - - -/** - Release resource for bios video instance. - - @param FbGopPrivate Video child device private data structure - -**/ -VOID -FbGopDeviceReleaseResource ( - FB_VIDEO_DEV *FbGopPrivate - ); - -// -// BIOS Graphics Output Protocol functions -// - -/** - Graphics Output protocol interface to get video mode. - - @param This Protocol instance pointer. - @param ModeNumber The mode number to return information on. - @param SizeOfInfo A pointer to the size, in bytes, of the I= nfo - buffer. - @param Info Caller allocated buffer that returns info= rmation - about ModeNumber. - - @retval EFI_SUCCESS Mode information returned. - @retval EFI_BUFFER_TOO_SMALL The Info buffer was too small. - @retval EFI_DEVICE_ERROR A hardware error occurred trying to retri= eve the - video mode. - @retval EFI_NOT_STARTED Video display is not initialized. Call Se= tMode () - @retval EFI_INVALID_PARAMETER One of the input args was NULL. - -**/ -EFI_STATUS -EFIAPI -FbGopGraphicsOutputQueryMode ( - IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, - IN UINT32 ModeNumber, - OUT UINTN *SizeOfInfo, - OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info - ); - - -/** - Graphics Output protocol interface to set video mode. - - @param This Protocol instance pointer. - @param ModeNumber The mode number to be set. - - @retval EFI_SUCCESS Graphics mode was changed. - @retval EFI_DEVICE_ERROR The device had an error and could not com= plete the - request. - @retval EFI_UNSUPPORTED ModeNumber is not supported by this devic= e. - -**/ -EFI_STATUS -EFIAPI -FbGopGraphicsOutputSetMode ( - IN EFI_GRAPHICS_OUTPUT_PROTOCOL * This, - IN UINT32 ModeNumber - ); - - -/** - Graphics Output protocol instance to block transfer for VBE device. - - @param This Pointer to Graphics Output protocol insta= nce - @param BltBuffer The data to transfer to screen - @param BltOperation The operation to perform - @param SourceX The X coordinate of the source for BltOpe= ration - @param SourceY The Y coordinate of the source for BltOpe= ration - @param DestinationX The X coordinate of the destination for - BltOperation - @param DestinationY The Y coordinate of the destination for - BltOperation - @param Width The width of a rectangle in the blt recta= ngle in - pixels - @param Height The height of a rectangle in the blt rect= angle in - pixels - @param Delta Not used for EfiBltVideoFill and - EfiBltVideoToVideo operation. If a Delta = of 0 is - used, the entire BltBuffer will be operat= ed on. If - a subrectangle of the BltBuffer is used, = then - Delta represents the number of bytes in a= row of - the BltBuffer. - - @retval EFI_INVALID_PARAMETER Invalid parameter passed in - @retval EFI_SUCCESS Blt operation success - -**/ -EFI_STATUS -EFIAPI -FbGopGraphicsOutputVbeBlt ( - IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, - IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL - IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation, - IN UINTN SourceX, - IN UINTN SourceY, - IN UINTN DestinationX, - IN UINTN DestinationY, - IN UINTN Width, - IN UINTN Height, - IN UINTN Delta - ); - - -/** - Graphics Output protocol instance to block transfer for VGA device. - - @param This Pointer to Graphics Output protocol insta= nce - @param BltBuffer The data to transfer to screen - @param BltOperation The operation to perform - @param SourceX The X coordinate of the source for BltOpe= ration - @param SourceY The Y coordinate of the source for BltOpe= ration - @param DestinationX The X coordinate of the destination for - BltOperation - @param DestinationY The Y coordinate of the destination for - BltOperation - @param Width The width of a rectangle in the blt recta= ngle in - pixels - @param Height The height of a rectangle in the blt rect= angle in - pixels - @param Delta Not used for EfiBltVideoFill and - EfiBltVideoToVideo operation. If a Delta = of 0 is - used, the entire BltBuffer will be operat= ed on. If - a subrectangle of the BltBuffer is used, = then - Delta represents the number of bytes in a= row of - the BltBuffer. - - @retval EFI_INVALID_PARAMETER Invalid parameter passed in - @retval EFI_SUCCESS Blt operation success - -**/ -EFI_STATUS -EFIAPI -FbGopGraphicsOutputVgaBlt ( - IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This, - IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL - IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation, - IN UINTN SourceX, - IN UINTN SourceY, - IN UINTN DestinationX, - IN UINTN DestinationY, - IN UINTN Width, - IN UINTN Height, - IN UINTN Delta - ); - -/** - Install child handles if the Handle supports MBR format. - - @param This Calling context. - @param ParentHandle Parent Handle - @param ParentPciIo Parent PciIo interface - @param ParentLegacyBios Parent LegacyBios interface - @param ParentDevicePath Parent Device Path - @param RemainingDevicePath Remaining Device Path - - @retval EFI_SUCCESS If a child handle was added - @retval other A child handle was not added - -**/ -EFI_STATUS -FbGopChildHandleInstall ( - IN EFI_DRIVER_BINDING_PROTOCOL *This, - IN EFI_HANDLE ParentHandle, - IN EFI_PCI_IO_PROTOCOL *ParentPciIo, - IN VOID *ParentLegacyBios, - IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath, - IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath - ); - -/** - Deregister an video child handle and free resources. - - @param This Protocol instance pointer. - @param Controller Video controller handle - @param Handle Video child handle - - @return EFI_STATUS - -**/ -EFI_STATUS -FbGopChildHandleUninstall ( - EFI_DRIVER_BINDING_PROTOCOL *This, - EFI_HANDLE Controller, - EFI_HANDLE Handle - ); - -/** - Release resource for bios video instance. - - @param FbGopPrivate Video child device private data structure - -**/ -VOID -FbGopDeviceReleaseResource ( - FB_VIDEO_DEV *FbGopPrivate - ); - -/** - Check if all video child handles have been uninstalled. - - @param Controller Video controller handle - - @return TRUE Child handles exist. - @return FALSE All video child handles have been uninsta= lled. - -**/ -BOOLEAN -HasChildHandle ( - IN EFI_HANDLE Controller - ); -#endif diff --git a/CorebootPayloadPkg/FbGop/FbGop.inf b/CorebootPayloadPkg/FbGop/= FbGop.inf deleted file mode 100644 index 64d83e96e8..0000000000 --- a/CorebootPayloadPkg/FbGop/FbGop.inf +++ /dev/null @@ -1,63 +0,0 @@ -## @file -# Video driver based on legacy bios. -# -# This driver by using Legacy Bios protocol service to support csm Video -# and produce Graphics Output Protocol. -# -# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
-# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D FbGop - FILE_GUID =3D 0B04B2ED-861C-42cd-A22F-C3AAFACCB896 - MODULE_TYPE =3D UEFI_DRIVER - VERSION_STRING =3D 1.0 - - ENTRY_POINT =3D FbGopEntryPoint - -# -# The following information is for reference only and not required by the = build tools. -# -# VALID_ARCHITECTURES =3D IA32 X64 EBC -# -# DRIVER_BINDING =3D gBiosVideoDriverBinding -# COMPONENT_NAME =3D gBiosVideoComponentName -# - -[Sources] - FbGop.c - FbGop.h - ComponentName.c - =20 - -[Packages] =20 - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - CorebootModulePkg/CorebootModulePkg.dec =20 - -[LibraryClasses] - MemoryAllocationLib - DevicePathLib - UefiLib - UefiBootServicesTableLib - UefiDriverEntryPoint - BaseMemoryLib - ReportStatusCodeLib - DebugLib - PcdLib - HobLib - =20 -[Guids] - gUefiFrameBufferInfoGuid - =20 -[Protocols] - gEfiGraphicsOutputProtocolGuid # PROTOCOL BY_START - gEfiPciIoProtocolGuid # PROTOCOL TO_START - gEfiDevicePathProtocolGuid # PROTOCOL TO_START - gEfiEdidDiscoveredProtocolGuid - gEfiEdidActiveProtocolGuid - =20 diff --git a/CorebootPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.c b/Coreb= ootPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.c deleted file mode 100644 index c0a97f263c..0000000000 --- a/CorebootPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.c +++ /dev/null @@ -1,270 +0,0 @@ -/** @file - ACPI Timer implements one instance of Timer Library. - - Copyright (c) 2014, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include -#include -#include -#include -#include -#include - -#include -#include - -#define ACPI_TIMER_COUNT_SIZE BIT24 - -UINTN mPmTimerReg =3D 0; - -/** - The constructor function enables ACPI IO space. - - If ACPI I/O space not enabled, this function will enable it. - It will always return RETURN_SUCCESS. - - @retval EFI_SUCCESS The constructor always returns RETURN_SUCCESS. - -**/ -RETURN_STATUS -EFIAPI -AcpiTimerLibConstructor ( - VOID - ) -{ - EFI_HOB_GUID_TYPE *GuidHob; - ACPI_BOARD_INFO *pAcpiBoardInfo;=09 -=09 - // - // Find the acpi board information guid hob - // - GuidHob =3D GetFirstGuidHob (&gUefiAcpiBoardInfoGuid); - ASSERT (GuidHob !=3D NULL); - =09 - pAcpiBoardInfo =3D (ACPI_BOARD_INFO *)GET_GUID_HOB_DATA (GuidHob);=20 - =20 - mPmTimerReg =3D (UINTN)pAcpiBoardInfo->PmTimerRegBase; - =20 - return EFI_SUCCESS; -} - -/** - Internal function to read the current tick counter of ACPI. - - Internal function to read the current tick counter of ACPI. - - @return The tick counter read. - -**/ -UINT32 -InternalAcpiGetTimerTick ( - VOID - ) -{ - if (mPmTimerReg =3D=3D 0) - AcpiTimerLibConstructor (); - =09 - return IoRead32 (mPmTimerReg); -} - -/** - Stalls the CPU for at least the given number of ticks. - - Stalls the CPU for at least the given number of ticks. It's invoked by - MicroSecondDelay() and NanoSecondDelay(). - - @param Delay A period of time to delay in ticks. - -**/ -VOID -InternalAcpiDelay ( - IN UINT32 Delay - ) -{ - UINT32 Ticks; - UINT32 Times; - - Times =3D Delay >> 22; - Delay &=3D BIT22 - 1; - do { - // - // The target timer count is calculated here - // - Ticks =3D InternalAcpiGetTimerTick () + Delay; - Delay =3D BIT22; - // - // Wait until time out - // Delay >=3D 2^23 could not be handled by this function - // Timer wrap-arounds are handled correctly by this function - // - while (((Ticks - InternalAcpiGetTimerTick ()) & BIT23) =3D=3D 0) { - CpuPause (); - } - } while (Times-- > 0); -} - -/** - Stalls the CPU for at least the given number of microseconds. - - Stalls the CPU for the number of microseconds specified by MicroSeconds. - - @param MicroSeconds The minimum number of microseconds to delay. - - @return MicroSeconds - -**/ -UINTN -EFIAPI -MicroSecondDelay ( - IN UINTN MicroSeconds - ) -{ - InternalAcpiDelay ( - (UINT32)DivU64x32 ( - MultU64x32 ( - MicroSeconds, - ACPI_TIMER_FREQUENCY - ), - 1000000u - ) - ); - return MicroSeconds; -} - -/** - Stalls the CPU for at least the given number of nanoseconds. - - Stalls the CPU for the number of nanoseconds specified by NanoSeconds. - - @param NanoSeconds The minimum number of nanoseconds to delay. - - @return NanoSeconds - -**/ -UINTN -EFIAPI -NanoSecondDelay ( - IN UINTN NanoSeconds - ) -{ - InternalAcpiDelay ( - (UINT32)DivU64x32 ( - MultU64x32 ( - NanoSeconds, - ACPI_TIMER_FREQUENCY - ), - 1000000000u - ) - ); - return NanoSeconds; -} - -/** - Retrieves the current value of a 64-bit free running performance counter. - - Retrieves the current value of a 64-bit free running performance counter= . The - counter can either count up by 1 or count down by 1. If the physical - performance counter counts by a larger increment, then the counter values - must be translated. The properties of the counter can be retrieved from - GetPerformanceCounterProperties(). - - @return The current value of the free running performance counter. - -**/ -UINT64 -EFIAPI -GetPerformanceCounter ( - VOID - ) -{ - return (UINT64)InternalAcpiGetTimerTick (); -} - -/** - Retrieves the 64-bit frequency in Hz and the range of performance counter - values. - - If StartValue is not NULL, then the value that the performance counter s= tarts - with immediately after is it rolls over is returned in StartValue. If - EndValue is not NULL, then the value that the performance counter end wi= th - immediately before it rolls over is returned in EndValue. The 64-bit - frequency of the performance counter in Hz is always returned. If StartV= alue - is less than EndValue, then the performance counter counts up. If StartV= alue - is greater than EndValue, then the performance counter counts down. For - example, a 64-bit free running counter that counts up would have a Start= Value - of 0 and an EndValue of 0xFFFFFFFFFFFFFFFF. A 24-bit free running counter - that counts down would have a StartValue of 0xFFFFFF and an EndValue of = 0. - - @param StartValue The value the performance counter starts with when it - rolls over. - @param EndValue The value that the performance counter ends with bef= ore - it rolls over. - - @return The frequency in Hz. - -**/ -UINT64 -EFIAPI -GetPerformanceCounterProperties ( - OUT UINT64 *StartValue, OPTIONAL - OUT UINT64 *EndValue OPTIONAL - ) -{ - if (StartValue !=3D NULL) { - *StartValue =3D 0; - } - - if (EndValue !=3D NULL) { - *EndValue =3D ACPI_TIMER_COUNT_SIZE - 1; - } - - return ACPI_TIMER_FREQUENCY; -} - -/** - Converts elapsed ticks of performance counter to time in nanoseconds. - - This function converts the elapsed ticks of running performance counter = to - time value in unit of nanoseconds. - - @param Ticks The number of elapsed ticks of running performance cou= nter. - - @return The elapsed time in nanoseconds. - -**/ -UINT64 -EFIAPI -GetTimeInNanoSecond ( - IN UINT64 Ticks - ) -{ - UINT64 Frequency; - UINT64 NanoSeconds; - UINT64 Remainder; - INTN Shift; - - Frequency =3D GetPerformanceCounterProperties (NULL, NULL); - - // - // Ticks - // Time =3D --------- x 1,000,000,000 - // Frequency - // - NanoSeconds =3D MultU64x32 (DivU64x64Remainder (Ticks, Frequency, &Remai= nder), 1000000000u); - - // - // Ensure (Remainder * 1,000,000,000) will not overflow 64-bit. - // Since 2^29 < 1,000,000,000 =3D 0x3B9ACA00 < 2^30, Remainder should < = 2^(64-30) =3D 2^34, - // i.e. highest bit set in Remainder should <=3D 33. - // - Shift =3D MAX (0, HighBitSet64 (Remainder) - 33); - Remainder =3D RShiftU64 (Remainder, (UINTN) Shift); - Frequency =3D RShiftU64 (Frequency, (UINTN) Shift); - NanoSeconds +=3D DivU64x64Remainder (MultU64x32 (Remainder, 1000000000u)= , Frequency, NULL); - - return NanoSeconds; -} - diff --git a/CorebootPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf b/Cor= ebootPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf deleted file mode 100644 index 81fa02e0ae..0000000000 --- a/CorebootPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf +++ /dev/null @@ -1,40 +0,0 @@ -## @file -# ACPI Timer Library Instance. -# -# Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D AcpiTimerLib - FILE_GUID =3D A41BF616-EF77-4658-9992-D813071C34CF - MODULE_TYPE =3D BASE - VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D TimerLib - - CONSTRUCTOR =3D AcpiTimerLibConstructor - -# -# The following information is for reference only and not required by the = build tools. -# -# VALID_ARCHITECTURES =3D IA32 X64 EBC -# - -[Sources] - AcpiTimerLib.c - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - CorebootModulePkg/CorebootModulePkg.dec - -[LibraryClasses] =20 - BaseLib - IoLib - HobLib - DebugLib - =20 -[Guids] =20 - gUefiAcpiBoardInfoGuid diff --git a/CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBridge.h b/= CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBridge.h deleted file mode 100644 index c2961b3bee..0000000000 --- a/CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBridge.h +++ /dev/null @@ -1,80 +0,0 @@ -/** @file - Header file of PciHostBridgeLib. - - Copyright (C) 2016, Red Hat, Inc. - Copyright (c) 2016, Intel Corporation. All rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#ifndef _PCI_HOST_BRIDGE_H -#define _PCI_HOST_BRIDGE_H - -typedef struct { - ACPI_HID_DEVICE_PATH AcpiDevicePath; - EFI_DEVICE_PATH_PROTOCOL EndDevicePath; -} CB_PCI_ROOT_BRIDGE_DEVICE_PATH; - -PCI_ROOT_BRIDGE * -ScanForRootBridges ( - UINTN *NumberOfRootBridges -); - -/** - Initialize a PCI_ROOT_BRIDGE structure. - - @param[in] Supports Supported attributes. - - @param[in] Attributes Initial attributes. - - @param[in] AllocAttributes Allocation attributes. - - @param[in] RootBusNumber The bus number to store in RootBus. - - @param[in] MaxSubBusNumber The inclusive maximum bus number that can be - assigned to any subordinate bus found behin= d any - PCI bridge hanging off this root bus. - - The caller is responsible for ensuring that - RootBusNumber <=3D MaxSubBusNumber. If - RootBusNumber equals MaxSubBusNumber, then = the - root bus has no room for subordinate buses. - - @param[in] Io IO aperture. - - @param[in] Mem MMIO aperture. - - @param[in] MemAbove4G MMIO aperture above 4G. - - @param[in] PMem Prefetchable MMIO aperture. - - @param[in] PMemAbove4G Prefetchable MMIO aperture above 4G. - - @param[out] RootBus The PCI_ROOT_BRIDGE structure (allocated by= the - caller) that should be filled in by this - function. - - @retval EFI_SUCCESS Initialization successful. A device path - consisting of an ACPI device path node, wi= th - UID =3D RootBusNumber, has been allocated = and - linked into RootBus. - - @retval EFI_OUT_OF_RESOURCES Memory allocation failed. -**/ -EFI_STATUS -InitRootBridge ( - IN UINT64 Supports, - IN UINT64 Attributes, - IN UINT64 AllocAttributes, - IN UINT8 RootBusNumber, - IN UINT8 MaxSubBusNumber, - IN PCI_ROOT_BRIDGE_APERTURE *Io, - IN PCI_ROOT_BRIDGE_APERTURE *Mem, - IN PCI_ROOT_BRIDGE_APERTURE *MemAbove4G, - IN PCI_ROOT_BRIDGE_APERTURE *PMem, - IN PCI_ROOT_BRIDGE_APERTURE *PMemAbove4G, - OUT PCI_ROOT_BRIDGE *RootBus -); - -#endif diff --git a/CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c= b/CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c deleted file mode 100644 index d42c246aeb..0000000000 --- a/CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c +++ /dev/null @@ -1,222 +0,0 @@ -/** @file - Library instance of PciHostBridgeLib library class for coreboot. - - Copyright (C) 2016, Red Hat, Inc. - Copyright (c) 2016, Intel Corporation. All rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "PciHostBridge.h" - -STATIC -CONST -CB_PCI_ROOT_BRIDGE_DEVICE_PATH mRootBridgeDevicePathTemplate =3D { - { - { - ACPI_DEVICE_PATH, - ACPI_DP, - { - (UINT8) (sizeof(ACPI_HID_DEVICE_PATH)), - (UINT8) ((sizeof(ACPI_HID_DEVICE_PATH)) >> 8) - } - }, - EISA_PNP_ID(0x0A03), // HID - 0 // UID - }, - - { - END_DEVICE_PATH_TYPE, - END_ENTIRE_DEVICE_PATH_SUBTYPE, - { - END_DEVICE_PATH_LENGTH, - 0 - } - } -}; - - -/** - Initialize a PCI_ROOT_BRIDGE structure. - - @param[in] Supports Supported attributes. - - @param[in] Attributes Initial attributes. - - @param[in] AllocAttributes Allocation attributes. - - @param[in] RootBusNumber The bus number to store in RootBus. - - @param[in] MaxSubBusNumber The inclusive maximum bus number that can be - assigned to any subordinate bus found behin= d any - PCI bridge hanging off this root bus. - - The caller is responsible for ensuring that - RootBusNumber <=3D MaxSubBusNumber. If - RootBusNumber equals MaxSubBusNumber, then = the - root bus has no room for subordinate buses. - - @param[in] Io IO aperture. - - @param[in] Mem MMIO aperture. - - @param[in] MemAbove4G MMIO aperture above 4G. - - @param[in] PMem Prefetchable MMIO aperture. - - @param[in] PMemAbove4G Prefetchable MMIO aperture above 4G. - - @param[out] RootBus The PCI_ROOT_BRIDGE structure (allocated by= the - caller) that should be filled in by this - function. - - @retval EFI_SUCCESS Initialization successful. A device path - consisting of an ACPI device path node, wi= th - UID =3D RootBusNumber, has been allocated = and - linked into RootBus. - - @retval EFI_OUT_OF_RESOURCES Memory allocation failed. -**/ -EFI_STATUS -InitRootBridge ( - IN UINT64 Supports, - IN UINT64 Attributes, - IN UINT64 AllocAttributes, - IN UINT8 RootBusNumber, - IN UINT8 MaxSubBusNumber, - IN PCI_ROOT_BRIDGE_APERTURE *Io, - IN PCI_ROOT_BRIDGE_APERTURE *Mem, - IN PCI_ROOT_BRIDGE_APERTURE *MemAbove4G, - IN PCI_ROOT_BRIDGE_APERTURE *PMem, - IN PCI_ROOT_BRIDGE_APERTURE *PMemAbove4G, - OUT PCI_ROOT_BRIDGE *RootBus -) -{ - CB_PCI_ROOT_BRIDGE_DEVICE_PATH *DevicePath; - - // - // Be safe if other fields are added to PCI_ROOT_BRIDGE later. - // - ZeroMem (RootBus, sizeof *RootBus); - - RootBus->Segment =3D 0; - - RootBus->Supports =3D Supports; - RootBus->Attributes =3D Attributes; - - RootBus->DmaAbove4G =3D FALSE; - - RootBus->AllocationAttributes =3D AllocAttributes; - RootBus->Bus.Base =3D RootBusNumber; - RootBus->Bus.Limit =3D MaxSubBusNumber; - CopyMem (&RootBus->Io, Io, sizeof (*Io)); - CopyMem (&RootBus->Mem, Mem, sizeof (*Mem)); - CopyMem (&RootBus->MemAbove4G, MemAbove4G, sizeof (*MemAbove4G)); - CopyMem (&RootBus->PMem, PMem, sizeof (*PMem)); - CopyMem (&RootBus->PMemAbove4G, PMemAbove4G, sizeof (*PMemAbove4G)); - - RootBus->NoExtendedConfigSpace =3D FALSE; - - DevicePath =3D AllocateCopyPool (sizeof (mRootBridgeDevicePathTemplate), - &mRootBridgeDevicePathTemplate); - if (DevicePath =3D=3D NULL) { - DEBUG ((EFI_D_ERROR, "%a: %r\n", __FUNCTION__, EFI_OUT_OF_RESOURCES)); - return EFI_OUT_OF_RESOURCES; - } - DevicePath->AcpiDevicePath.UID =3D RootBusNumber; - RootBus->DevicePath =3D (EFI_DEVICE_PATH_PROTOCOL *)DevicePath; - - DEBUG ((EFI_D_INFO, - "%a: populated root bus %d, with room for %d subordinate bus(es)= \n", - __FUNCTION__, RootBusNumber, MaxSubBusNumber - RootBusNumber)); - return EFI_SUCCESS; -} - - -/** - Return all the root bridge instances in an array. - - @param Count Return the count of root bridge instances. - - @return All the root bridge instances in an array. - The array should be passed into PciHostBridgeFreeRootBridges() - when it's not used. -**/ -PCI_ROOT_BRIDGE * -EFIAPI -PciHostBridgeGetRootBridges ( - UINTN *Count -) -{ - return ScanForRootBridges (Count); -} - - -/** - Free the root bridge instances array returned from - PciHostBridgeGetRootBridges(). - - @param The root bridge instances array. - @param The count of the array. -**/ -VOID -EFIAPI -PciHostBridgeFreeRootBridges ( - PCI_ROOT_BRIDGE *Bridges, - UINTN Count -) -{ - if (Bridges =3D=3D NULL && Count =3D=3D 0) { - return; - } - ASSERT (Bridges !=3D NULL && Count > 0); - - do { - --Count; - FreePool (Bridges[Count].DevicePath); - } while (Count > 0); - - FreePool (Bridges); -} - - -/** - Inform the platform that the resource conflict happens. - - @param HostBridgeHandle Handle of the Host Bridge. - @param Configuration Pointer to PCI I/O and PCI memory resource - descriptors. The Configuration contains the reso= urces - for all the root bridges. The resource for each = root - bridge is terminated with END descriptor and an - additional END is appended indicating the end of= the - entire resources. The resource descriptor field - values follow the description in - EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PROTOCOL - .SubmitResources(). -**/ -VOID -EFIAPI -PciHostBridgeResourceConflict ( - EFI_HANDLE HostBridgeHandle, - VOID *Configuration -) -{ - // - // coreboot UEFI Payload does not do PCI enumeration and should not call= this - // library interface. - // - ASSERT (FALSE); -} diff --git a/CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.i= nf b/CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf deleted file mode 100644 index 7896df2416..0000000000 --- a/CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf +++ /dev/null @@ -1,41 +0,0 @@ -## @file -# Library instance of PciHostBridgeLib library class for coreboot. -# -# Copyright (C) 2016, Red Hat, Inc. -# Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
-# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -# -## - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D PciHostBridgeLib - FILE_GUID =3D 62EE5269-CFFD-43a3-BE3F-622FC79F467E - MODULE_TYPE =3D BASE - VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D PciHostBridgeLib - -# -# The following information is for reference only and not required by the = build -# tools. -# -# VALID_ARCHITECTURES =3D IA32 X64 EBC -# - -[Sources] - PciHostBridge.h - PciHostBridgeLib.c - PciHostBridgeSupport.c - -[Packages] - MdeModulePkg/MdeModulePkg.dec - MdePkg/MdePkg.dec - -[LibraryClasses] - BaseMemoryLib - DebugLib - DevicePathLib - MemoryAllocationLib - PciLib diff --git a/CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSuppo= rt.c b/CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c deleted file mode 100644 index fffbf04cad..0000000000 --- a/CorebootPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeSupport.c +++ /dev/null @@ -1,584 +0,0 @@ -/** @file - Scan the entire PCI bus for root bridges to support coreboot UEFI payloa= d. - - Copyright (c) 2016, Intel Corporation. All rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "PciHostBridge.h" - -/** - Adjust the collected PCI resource. - - @param[in] Io IO aperture. - - @param[in] Mem MMIO aperture. - - @param[in] MemAbove4G MMIO aperture above 4G. - - @param[in] PMem Prefetchable MMIO aperture. - - @param[in] PMemAbove4G Prefetchable MMIO aperture above 4G. -**/ -VOID -AdjustRootBridgeResource ( - IN PCI_ROOT_BRIDGE_APERTURE *Io, - IN PCI_ROOT_BRIDGE_APERTURE *Mem, - IN PCI_ROOT_BRIDGE_APERTURE *MemAbove4G, - IN PCI_ROOT_BRIDGE_APERTURE *PMem, - IN PCI_ROOT_BRIDGE_APERTURE *PMemAbove4G -) -{ - UINT64 Mask; - - // - // For now try to downgrade everything into MEM32 since - // - coreboot does not assign resource above 4GB - // - coreboot might allocate interleaved MEM32 and PMEM32 resource - // in some cases - // - if (PMem->Base < Mem->Base) { - Mem->Base =3D PMem->Base; - } - - if (PMem->Limit > Mem->Limit) { - Mem->Limit =3D PMem->Limit; - } - - PMem->Base =3D MAX_UINT64; - PMem->Limit =3D 0; - - if (MemAbove4G->Base < 0x100000000ULL) { - if (MemAbove4G->Base < Mem->Base) { - Mem->Base =3D MemAbove4G->Base; - } - if (MemAbove4G->Limit > Mem->Limit) { - Mem->Limit =3D MemAbove4G->Limit; - } - MemAbove4G->Base =3D MAX_UINT64; - MemAbove4G->Limit =3D 0; - } - - if (PMemAbove4G->Base < 0x100000000ULL) { - if (PMemAbove4G->Base < Mem->Base) { - Mem->Base =3D PMemAbove4G->Base; - } - if (PMemAbove4G->Limit > Mem->Limit) { - Mem->Limit =3D PMemAbove4G->Limit; - } - PMemAbove4G->Base =3D MAX_UINT64; - PMemAbove4G->Limit =3D 0; - } - - // - // Align IO resource at 4K boundary - // - Mask =3D 0xFFFULL; - Io->Limit =3D ((Io->Limit + Mask) & ~Mask) - 1; - if (Io->Base !=3D MAX_UINT64) { - Io->Base &=3D ~Mask; - } - - // - // Align MEM resource at 1MB boundary - // - Mask =3D 0xFFFFFULL; - Mem->Limit =3D ((Mem->Limit + Mask) & ~Mask) - 1; - if (Mem->Base !=3D MAX_UINT64) { - Mem->Base &=3D ~Mask; - } -} - -/** - Probe a bar is existed or not. - - @param[in] Address PCI address for the BAR. - @param[out] OriginalValue The original bar value returned. - @param[out] Value The probed bar value returned. -**/ -STATIC -VOID -PcatPciRootBridgeBarExisted ( - IN UINT64 Address, - OUT UINT32 *OriginalValue, - OUT UINT32 *Value -) -{ - UINTN PciAddress; - - PciAddress =3D (UINTN)Address; - - // - // Preserve the original value - // - *OriginalValue =3D PciRead32 (PciAddress); - - // - // Disable timer interrupt while the BAR is probed - // - DisableInterrupts (); - - PciWrite32 (PciAddress, 0xFFFFFFFF); - *Value =3D PciRead32 (PciAddress); - PciWrite32 (PciAddress, *OriginalValue); - - // - // Enable interrupt - // - EnableInterrupts (); -} - -/** - Parse PCI bar and collect the assigned PCI resource information. - - @param[in] Command Supported attributes. - - @param[in] Bus PCI bus number. - - @param[in] Device PCI device number. - - @param[in] Function PCI function number. - - @param[in] BarOffsetBase PCI bar start offset. - - @param[in] BarOffsetEnd PCI bar end offset. - - @param[in] Io IO aperture. - - @param[in] Mem MMIO aperture. - - @param[in] MemAbove4G MMIO aperture above 4G. - - @param[in] PMem Prefetchable MMIO aperture. - - @param[in] PMemAbove4G Prefetchable MMIO aperture above 4G. -**/ -STATIC -VOID -PcatPciRootBridgeParseBars ( - IN UINT16 Command, - IN UINTN Bus, - IN UINTN Device, - IN UINTN Function, - IN UINTN BarOffsetBase, - IN UINTN BarOffsetEnd, - IN PCI_ROOT_BRIDGE_APERTURE *Io, - IN PCI_ROOT_BRIDGE_APERTURE *Mem, - IN PCI_ROOT_BRIDGE_APERTURE *MemAbove4G, - IN PCI_ROOT_BRIDGE_APERTURE *PMem, - IN PCI_ROOT_BRIDGE_APERTURE *PMemAbove4G - -) -{ - UINT32 OriginalValue; - UINT32 Value; - UINT32 OriginalUpperValue; - UINT32 UpperValue; - UINT64 Mask; - UINTN Offset; - UINTN LowBit; - UINT64 Base; - UINT64 Length; - UINT64 Limit; - PCI_ROOT_BRIDGE_APERTURE *MemAperture; - - for (Offset =3D BarOffsetBase; Offset < BarOffsetEnd; Offset +=3D sizeof= (UINT32)) { - PcatPciRootBridgeBarExisted ( - PCI_LIB_ADDRESS (Bus, Device, Function, Offset), - &OriginalValue, &Value - ); - if (Value =3D=3D 0) { - continue; - } - if ((Value & BIT0) =3D=3D BIT0) { - // - // IO Bar - // - if (Command & EFI_PCI_COMMAND_IO_SPACE) { - Mask =3D 0xfffffffc; - Base =3D OriginalValue & Mask; - Length =3D ((~(Value & Mask)) & Mask) + 0x04; - if (!(Value & 0xFFFF0000)) { - Length &=3D 0x0000FFFF; - } - Limit =3D Base + Length - 1; - - if ((Base > 0) && (Base < Limit)) { - if (Io->Base > Base) { - Io->Base =3D Base; - } - if (Io->Limit < Limit) { - Io->Limit =3D Limit; - } - } - } - } else { - // - // Mem Bar - // - if (Command & EFI_PCI_COMMAND_MEMORY_SPACE) { - - Mask =3D 0xfffffff0; - Base =3D OriginalValue & Mask; - Length =3D Value & Mask; - - if ((Value & (BIT1 | BIT2)) =3D=3D 0) { - // - // 32bit - // - Length =3D ((~Length) + 1) & 0xffffffff; - - if ((Value & BIT3) =3D=3D BIT3) { - MemAperture =3D PMem; - } else { - MemAperture =3D Mem; - } - } else { - // - // 64bit - // - Offset +=3D 4; - PcatPciRootBridgeBarExisted ( - PCI_LIB_ADDRESS (Bus, Device, Function, Offset), - &OriginalUpperValue, - &UpperValue - ); - - Base =3D Base | LShiftU64 ((UINT64) OriginalUpperValue, 32); - Length =3D Length | LShiftU64 ((UINT64) UpperValue, 32); - if (Length !=3D 0) { - LowBit =3D LowBitSet64 (Length); - Length =3D LShiftU64 (1ULL, LowBit); - } - - if ((Value & BIT3) =3D=3D BIT3) { - MemAperture =3D PMemAbove4G; - } else { - MemAperture =3D MemAbove4G; - } - } - - Limit =3D Base + Length - 1; - if ((Base > 0) && (Base < Limit)) { - if (MemAperture->Base > Base) { - MemAperture->Base =3D Base; - } - if (MemAperture->Limit < Limit) { - MemAperture->Limit =3D Limit; - } - } - } - } - } -} - -/** - Scan for all root bridges in platform. - - @param[out] NumberOfRootBridges Number of root bridges detected - - @retval Pointer to the allocated PCI_ROOT_BRIDGE structure array. -**/ -PCI_ROOT_BRIDGE * -ScanForRootBridges ( - OUT UINTN *NumberOfRootBridges -) -{ - UINTN PrimaryBus; - UINTN SubBus; - UINT8 Device; - UINT8 Function; - UINTN NumberOfDevices; - UINTN Address; - PCI_TYPE01 Pci; - UINT64 Attributes; - UINT64 Base; - UINT64 Limit; - UINT64 Value; - PCI_ROOT_BRIDGE_APERTURE Io, Mem, MemAbove4G, PMem, PMemAbove4G, *MemApe= rture; - PCI_ROOT_BRIDGE *RootBridges; - UINTN BarOffsetEnd; - - - *NumberOfRootBridges =3D 0; - RootBridges =3D NULL; - - // - // After scanning all the PCI devices on the PCI root bridge's primary b= us, - // update the Primary Bus Number for the next PCI root bridge to be this= PCI - // root bridge's subordinate bus number + 1. - // - for (PrimaryBus =3D 0; PrimaryBus <=3D PCI_MAX_BUS; PrimaryBus =3D SubBu= s + 1) { - SubBus =3D PrimaryBus; - Attributes =3D 0; - - ZeroMem (&Io, sizeof (Io)); - ZeroMem (&Mem, sizeof (Mem)); - ZeroMem (&MemAbove4G, sizeof (MemAbove4G)); - ZeroMem (&PMem, sizeof (PMem)); - ZeroMem (&PMemAbove4G, sizeof (PMemAbove4G)); - Io.Base =3D Mem.Base =3D MemAbove4G.Base =3D PMem.Base =3D PMemAbove4G= .Base =3D MAX_UINT64; - // - // Scan all the PCI devices on the primary bus of the PCI root bridge - // - for (Device =3D 0, NumberOfDevices =3D 0; Device <=3D PCI_MAX_DEVICE; = Device++) { - - for (Function =3D 0; Function <=3D PCI_MAX_FUNC; Function++) { - - // - // Compute the PCI configuration address of the PCI device to probe - // - Address =3D PCI_LIB_ADDRESS (PrimaryBus, Device, Function, 0); - - // - // Read the Vendor ID from the PCI Configuration Header - // - if (PciRead16 (Address) =3D=3D MAX_UINT16) { - if (Function =3D=3D 0) { - // - // If the PCI Configuration Read fails, or a PCI device does n= ot - // exist, then skip this entire PCI device - // - break; - } else { - // - // If PCI function !=3D 0, VendorId =3D=3D 0xFFFF, we continue= to search - // PCI function. - // - continue; - } - } - - // - // Read the entire PCI Configuration Header - // - PciReadBuffer (Address, sizeof (Pci), &Pci); - - // - // Increment the number of PCI device found on the primary bus of = the - // PCI root bridge - // - NumberOfDevices++; - - // - // Look for devices with the VGA Palette Snoop enabled in the COMM= AND - // register of the PCI Config Header - // - if ((Pci.Hdr.Command & EFI_PCI_COMMAND_VGA_PALETTE_SNOOP) !=3D 0) { - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO; - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16; - } - - BarOffsetEnd =3D 0; - - // - // PCI-PCI Bridge - // - if (IS_PCI_BRIDGE (&Pci)) { - // - // Get the Bus range that the PPB is decoding - // - if (Pci.Bridge.SubordinateBus > SubBus) { - // - // If the subordinate bus number of the PCI-PCI bridge is grea= ter - // than the PCI root bridge's current subordinate bus number, - // then update the PCI root bridge's subordinate bus number - // - SubBus =3D Pci.Bridge.SubordinateBus; - } - - // - // Get the I/O range that the PPB is decoding - // - Value =3D Pci.Bridge.IoBase & 0x0f; - Base =3D ((UINT32) Pci.Bridge.IoBase & 0xf0) << 8; - Limit =3D (((UINT32) Pci.Bridge.IoLimit & 0xf0) << 8) | 0x0fff; - if (Value =3D=3D BIT0) { - Base |=3D ((UINT32) Pci.Bridge.IoBaseUpper16 << 16); - Limit |=3D ((UINT32) Pci.Bridge.IoLimitUpper16 << 16); - } - if ((Base > 0) && (Base < Limit)) { - if (Io.Base > Base) { - Io.Base =3D Base; - } - if (Io.Limit < Limit) { - Io.Limit =3D Limit; - } - } - - // - // Get the Memory range that the PPB is decoding - // - Base =3D ((UINT32) Pci.Bridge.MemoryBase & 0xfff0) << 16; - Limit =3D (((UINT32) Pci.Bridge.MemoryLimit & 0xfff0) << 16) | 0= xfffff; - if ((Base > 0) && (Base < Limit)) { - if (Mem.Base > Base) { - Mem.Base =3D Base; - } - if (Mem.Limit < Limit) { - Mem.Limit =3D Limit; - } - } - - // - // Get the Prefetchable Memory range that the PPB is decoding - // - Value =3D Pci.Bridge.PrefetchableMemoryBase & 0x0f; - Base =3D ((UINT32) Pci.Bridge.PrefetchableMemoryBase & 0xfff0) <= < 16; - Limit =3D (((UINT32) Pci.Bridge.PrefetchableMemoryLimit & 0xfff0) - << 16) | 0xfffff; - MemAperture =3D &PMem; - if (Value =3D=3D BIT0) { - Base |=3D LShiftU64 (Pci.Bridge.PrefetchableBaseUpper32, 32); - Limit |=3D LShiftU64 (Pci.Bridge.PrefetchableLimitUpper32, 32); - MemAperture =3D &PMemAbove4G; - } - if ((Base > 0) && (Base < Limit)) { - if (MemAperture->Base > Base) { - MemAperture->Base =3D Base; - } - if (MemAperture->Limit < Limit) { - MemAperture->Limit =3D Limit; - } - } - - // - // Look at the PPB Configuration for legacy decoding attributes - // - if ((Pci.Bridge.BridgeControl & EFI_PCI_BRIDGE_CONTROL_ISA) - =3D=3D EFI_PCI_BRIDGE_CONTROL_ISA) { - Attributes |=3D EFI_PCI_ATTRIBUTE_ISA_IO; - Attributes |=3D EFI_PCI_ATTRIBUTE_ISA_IO_16; - Attributes |=3D EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO; - } - if ((Pci.Bridge.BridgeControl & EFI_PCI_BRIDGE_CONTROL_VGA) - =3D=3D EFI_PCI_BRIDGE_CONTROL_VGA) { - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO; - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_MEMORY; - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_IO; - if ((Pci.Bridge.BridgeControl & EFI_PCI_BRIDGE_CONTROL_VGA_16) - !=3D 0) { - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16; - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_IO_16; - } - } - - BarOffsetEnd =3D OFFSET_OF (PCI_TYPE01, Bridge.Bar[2]); - } else { - // - // Parse the BARs of the PCI device to get what I/O Ranges, Memo= ry - // Ranges, and Prefetchable Memory Ranges the device is decoding - // - if ((Pci.Hdr.HeaderType & HEADER_LAYOUT_CODE) =3D=3D HEADER_TYPE= _DEVICE) { - BarOffsetEnd =3D OFFSET_OF (PCI_TYPE00, Device.Bar[6]); - } - } - - PcatPciRootBridgeParseBars ( - Pci.Hdr.Command, - PrimaryBus, - Device, - Function, - OFFSET_OF (PCI_TYPE00, Device.Bar), - BarOffsetEnd, - &Io, - &Mem, &MemAbove4G, - &PMem, &PMemAbove4G - ); - - // - // See if the PCI device is an IDE controller - // - if (IS_CLASS2 (&Pci, PCI_CLASS_MASS_STORAGE, - PCI_CLASS_MASS_STORAGE_IDE)) { - if (Pci.Hdr.ClassCode[0] & 0x80) { - Attributes |=3D EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO; - Attributes |=3D EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO; - } - if (Pci.Hdr.ClassCode[0] & 0x01) { - Attributes |=3D EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO; - } - if (Pci.Hdr.ClassCode[0] & 0x04) { - Attributes |=3D EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO; - } - } - - // - // See if the PCI device is a legacy VGA controller or - // a standard VGA controller - // - if (IS_CLASS2 (&Pci, PCI_CLASS_OLD, PCI_CLASS_OLD_VGA) || - IS_CLASS2 (&Pci, PCI_CLASS_DISPLAY, PCI_CLASS_DISPLAY_VGA) - ) { - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO; - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_PALETTE_IO_16; - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_MEMORY; - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_IO; - Attributes |=3D EFI_PCI_ATTRIBUTE_VGA_IO_16; - } - - // - // See if the PCI Device is a PCI - ISA or PCI - EISA - // or ISA_POSITIVE_DECODE Bridge device - // - if (Pci.Hdr.ClassCode[2] =3D=3D PCI_CLASS_BRIDGE) { - if (Pci.Hdr.ClassCode[1] =3D=3D PCI_CLASS_BRIDGE_ISA || - Pci.Hdr.ClassCode[1] =3D=3D PCI_CLASS_BRIDGE_EISA || - Pci.Hdr.ClassCode[1] =3D=3D PCI_CLASS_BRIDGE_ISA_PDECODE) { - Attributes |=3D EFI_PCI_ATTRIBUTE_ISA_IO; - Attributes |=3D EFI_PCI_ATTRIBUTE_ISA_IO_16; - Attributes |=3D EFI_PCI_ATTRIBUTE_ISA_MOTHERBOARD_IO; - } - } - - // - // If this device is not a multi function device, then skip the re= st - // of this PCI device - // - if (Function =3D=3D 0 && !IS_PCI_MULTI_FUNC (&Pci)) { - break; - } - } - } - - // - // If at least one PCI device was found on the primary bus of this PCI - // root bridge, then the PCI root bridge exists. - // - if (NumberOfDevices > 0) { - RootBridges =3D ReallocatePool ( - (*NumberOfRootBridges) * sizeof (PCI_ROOT_BRIDGE), - (*NumberOfRootBridges + 1) * sizeof (PCI_ROOT_BRIDGE= ), - RootBridges - ); - ASSERT (RootBridges !=3D NULL); - - AdjustRootBridgeResource (&Io, &Mem, &MemAbove4G, &PMem, &PMemAbove4= G); - - InitRootBridge ( - Attributes, Attributes, 0, - (UINT8) PrimaryBus, (UINT8) SubBus, - &Io, &Mem, &MemAbove4G, &PMem, &PMemAbove4G, - &RootBridges[*NumberOfRootBridges] - ); - RootBridges[*NumberOfRootBridges].ResourceAssigned =3D TRUE; - // - // Increment the index for the next PCI Root Bridge - // - (*NumberOfRootBridges)++; - } - } - - return RootBridges; -} diff --git a/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBoot= Manager.c b/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBootM= anager.c deleted file mode 100644 index 11e03ca548..0000000000 --- a/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager= .c +++ /dev/null @@ -1,265 +0,0 @@ -/** @file - This file include all platform action which can be customized - by IBV/OEM. - -Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include "PlatformBootManager.h" -#include "PlatformConsole.h" - -VOID -InstallReadyToLock ( - VOID - ) -{ - EFI_STATUS Status; - EFI_HANDLE Handle; - EFI_SMM_ACCESS2_PROTOCOL *SmmAccess; - - DEBUG((DEBUG_INFO,"InstallReadyToLock entering......\n")); - // - // Inform the SMM infrastructure that we're entering BDS and may run 3rd= party code hereafter - // Since PI1.2.1, we need signal EndOfDxe as ExitPmAuth - // - EfiEventGroupSignal (&gEfiEndOfDxeEventGroupGuid); - DEBUG((DEBUG_INFO,"All EndOfDxe callbacks have returned successfully\n")= ); - - // - // Install DxeSmmReadyToLock protocol in order to lock SMM - // - Status =3D gBS->LocateProtocol (&gEfiSmmAccess2ProtocolGuid, NULL, (VOID= **) &SmmAccess); - if (!EFI_ERROR (Status)) { - Handle =3D NULL; - Status =3D gBS->InstallProtocolInterface ( - &Handle, - &gEfiDxeSmmReadyToLockProtocolGuid, - EFI_NATIVE_INTERFACE, - NULL - ); - ASSERT_EFI_ERROR (Status); - } - - DEBUG((DEBUG_INFO,"InstallReadyToLock end\n")); - return; -} - -/** - Return the index of the load option in the load option array. - - The function consider two load options are equal when the - OptionType, Attributes, Description, FilePath and OptionalData are equal. - - @param Key Pointer to the load option to be found. - @param Array Pointer to the array of load options to be found. - @param Count Number of entries in the Array. - - @retval -1 Key wasn't found in the Array. - @retval 0 ~ Count-1 The index of the Key in the Array. -**/ -INTN -PlatformFindLoadOption ( - IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Key, - IN CONST EFI_BOOT_MANAGER_LOAD_OPTION *Array, - IN UINTN Count -) -{ - UINTN Index; - - for (Index =3D 0; Index < Count; Index++) { - if ((Key->OptionType =3D=3D Array[Index].OptionType) && - (Key->Attributes =3D=3D Array[Index].Attributes) && - (StrCmp (Key->Description, Array[Index].Description) =3D=3D 0) && - (CompareMem (Key->FilePath, Array[Index].FilePath, GetDevicePathSi= ze (Key->FilePath)) =3D=3D 0) && - (Key->OptionalDataSize =3D=3D Array[Index].OptionalDataSize) && - (CompareMem (Key->OptionalData, Array[Index].OptionalData, Key->Op= tionalDataSize) =3D=3D 0)) { - return (INTN) Index; - } - } - - return -1; -} - -/** - Register a boot option using a file GUID in the FV. - - @param FileGuid The file GUID name in FV. - @param Description The boot option description. - @param Attributes The attributes used for the boot option loading. -**/ -VOID -PlatformRegisterFvBootOption ( - EFI_GUID *FileGuid, - CHAR16 *Description, - UINT32 Attributes -) -{ - EFI_STATUS Status; - UINTN OptionIndex; - EFI_BOOT_MANAGER_LOAD_OPTION NewOption; - EFI_BOOT_MANAGER_LOAD_OPTION *BootOptions; - UINTN BootOptionCount; - MEDIA_FW_VOL_FILEPATH_DEVICE_PATH FileNode; - EFI_LOADED_IMAGE_PROTOCOL *LoadedImage; - EFI_DEVICE_PATH_PROTOCOL *DevicePath; - - Status =3D gBS->HandleProtocol (gImageHandle, &gEfiLoadedImageProtocolGu= id, (VOID **) &LoadedImage); - ASSERT_EFI_ERROR (Status); - - EfiInitializeFwVolDevicepathNode (&FileNode, FileGuid); - DevicePath =3D AppendDevicePathNode ( - DevicePathFromHandle (LoadedImage->DeviceHandle), - (EFI_DEVICE_PATH_PROTOCOL *) &FileNode - ); - - Status =3D EfiBootManagerInitializeLoadOption ( - &NewOption, - LoadOptionNumberUnassigned, - LoadOptionTypeBoot, - Attributes, - Description, - DevicePath, - NULL, - 0 - ); - if (!EFI_ERROR (Status)) { - BootOptions =3D EfiBootManagerGetLoadOptions (&BootOptionCount, LoadOp= tionTypeBoot); - - OptionIndex =3D PlatformFindLoadOption (&NewOption, BootOptions, BootO= ptionCount); - - if (OptionIndex =3D=3D -1) { - Status =3D EfiBootManagerAddLoadOptionVariable (&NewOption, (UINTN) = -1); - ASSERT_EFI_ERROR (Status); - } - EfiBootManagerFreeLoadOption (&NewOption); - EfiBootManagerFreeLoadOptions (BootOptions, BootOptionCount); - } -} - -/** - Do the platform specific action before the console is connected. - - Such as: - Update console variable; - Register new Driver#### or Boot####; - Signal ReadyToLock event. -**/ -VOID -EFIAPI -PlatformBootManagerBeforeConsole ( - VOID -) -{ - EFI_INPUT_KEY Enter; - EFI_INPUT_KEY F2; - EFI_INPUT_KEY Down; - EFI_BOOT_MANAGER_LOAD_OPTION BootOption; - - PlatformConsoleInit (); - - // - // Register ENTER as CONTINUE key - // - Enter.ScanCode =3D SCAN_NULL; - Enter.UnicodeChar =3D CHAR_CARRIAGE_RETURN; - EfiBootManagerRegisterContinueKeyOption (0, &Enter, NULL); - - // - // Map F2 to Boot Manager Menu - // - F2.ScanCode =3D SCAN_F2; - F2.UnicodeChar =3D CHAR_NULL; - EfiBootManagerGetBootManagerMenu (&BootOption); - EfiBootManagerAddKeyOptionVariable (NULL, (UINT16) BootOption.OptionNumb= er, 0, &F2, NULL); - - // - // Also add Down key to Boot Manager Menu since some serial terminals do= n't support F2 key. - // - Down.ScanCode =3D SCAN_DOWN; - Down.UnicodeChar =3D CHAR_NULL; - EfiBootManagerGetBootManagerMenu (&BootOption); - EfiBootManagerAddKeyOptionVariable (NULL, (UINT16) BootOption.OptionNumb= er, 0, &Down, NULL); - - // - // Install ready to lock. - // This needs to be done before option rom dispatched. - // - InstallReadyToLock (); - - // - // Dispatch deferred images after EndOfDxe event and ReadyToLock install= ation. - // - EfiBootManagerDispatchDeferredImages (); -} - -/** - Do the platform specific action after the console is connected. - - Such as: - Dynamically switch output mode; - Signal console ready platform customized event; - Run diagnostics like memory testing; - Connect certain devices; - Dispatch additional option roms. -**/ -VOID -EFIAPI -PlatformBootManagerAfterConsole ( - VOID -) -{ - EFI_GRAPHICS_OUTPUT_BLT_PIXEL Black; - EFI_GRAPHICS_OUTPUT_BLT_PIXEL White; - - Black.Blue =3D Black.Green =3D Black.Red =3D Black.Reserved =3D 0; - White.Blue =3D White.Green =3D White.Red =3D White.Reserved =3D 0xFF; - - EfiBootManagerConnectAll (); - EfiBootManagerRefreshAllBootOption (); - - // - // Register UEFI Shell - // - PlatformRegisterFvBootOption (PcdGetPtr (PcdShellFile), L"UEFI Shell", L= OAD_OPTION_ACTIVE); - =20 - Print ( - L"\n" - L"F2 or Down to enter Boot Manager Menu.\n" - L"ENTER to boot directly.\n" - L"\n" - ); - -} - -/** - This function is called each second during the boot manager waits the ti= meout. - - @param TimeoutRemain The remaining timeout. -**/ -VOID -EFIAPI -PlatformBootManagerWaitCallback ( - UINT16 TimeoutRemain -) -{ - return; -} - -/** - The function is called when no boot option could be launched, - including platform recovery options and options pointing to applications - built into firmware volumes. - - If this function returns, BDS attempts to enter an infinite loop. -**/ -VOID -EFIAPI -PlatformBootManagerUnableToBoot ( - VOID - ) -{ - return; -} - diff --git a/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBoot= Manager.h b/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBootM= anager.h deleted file mode 100644 index a85585ca7c..0000000000 --- a/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager= .h +++ /dev/null @@ -1,121 +0,0 @@ -/**@file - Head file for BDS Platform specific code - -Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent -**/ - -#ifndef _PLATFORM_BOOT_MANAGER_H -#define _PLATFORM_BOOT_MANAGER_H - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -typedef struct { - EFI_DEVICE_PATH_PROTOCOL *DevicePath; - UINTN ConnectType; -} PLATFORM_CONSOLE_CONNECT_ENTRY; - -extern PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[]; - -#define gEndEntire \ - { \ - END_DEVICE_PATH_TYPE,\ - END_ENTIRE_DEVICE_PATH_SUBTYPE,\ - { END_DEVICE_PATH_LENGTH, 0 },\ - } - -#define CONSOLE_OUT BIT0 -#define CONSOLE_IN BIT1 -#define STD_ERROR BIT2 - -typedef struct { - VENDOR_DEVICE_PATH VendorDevicePath; - UINT32 Instance; -} WIN_NT_VENDOR_DEVICE_PATH_NODE; - -// -// Below is the platform console device path -// -typedef struct { - VENDOR_DEVICE_PATH NtBus; - WIN_NT_VENDOR_DEVICE_PATH_NODE SerialDevice; - UART_DEVICE_PATH Uart; - VENDOR_DEVICE_PATH TerminalType; - EFI_DEVICE_PATH_PROTOCOL End; -} NT_ISA_SERIAL_DEVICE_PATH; - -typedef struct { - VENDOR_DEVICE_PATH NtBus; - WIN_NT_VENDOR_DEVICE_PATH_NODE NtGopDevice; - EFI_DEVICE_PATH_PROTOCOL End; -} NT_PLATFORM_GOP_DEVICE_PATH; - -/** - Use SystemTable Conout to stop video based Simple Text Out consoles from= going - to the video device. Put up LogoFile on every video device that is a con= sole. - - @param[in] LogoFile File name of logo to display on the center of the= screen. - - @retval EFI_SUCCESS ConsoleControl has been flipped to graphics and = logo displayed. - @retval EFI_UNSUPPORTED Logo not found - -**/ -EFI_STATUS -PlatformBootManagerEnableQuietBoot ( - IN EFI_GUID *LogoFile -); - -/** - Use SystemTable Conout to turn on video based Simple Text Out consoles. = The - Simple Text Out screens will now be synced up with all non video output = devices - - @retval EFI_SUCCESS UGA devices are back in text mode and synced up. - -**/ -EFI_STATUS -PlatformBootManagerDisableQuietBoot ( - VOID -); - -/** - Show progress bar with title above it. It only works in Graphics mode. - - @param TitleForeground Foreground color for Title. - @param TitleBackground Background color for Title. - @param Title Title above progress bar. - @param ProgressColor Progress bar color. - @param Progress Progress (0-100) - @param PreviousValue The previous value of the progress. - - @retval EFI_STATUS Success update the progress bar - -**/ -EFI_STATUS -PlatformBootManagerShowProgress ( - IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleForeground, - IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleBackground, - IN CHAR16 *Title, - IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL ProgressColor, - IN UINTN Progress, - IN UINTN PreviousValue -); - -#endif // _PLATFORM_BOOT_MANAGER_H diff --git a/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBoot= ManagerLib.inf b/CorebootPayloadPkg/Library/PlatformBootManagerLib/Platform= BootManagerLib.inf deleted file mode 100644 index 75a88a5c83..0000000000 --- a/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformBootManager= Lib.inf +++ /dev/null @@ -1,74 +0,0 @@ -## @file -# Include all platform action which can be customized by IBV/OEM. -# -# Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D PlatformBootManagerLib - FILE_GUID =3D F0D9063A-DADB-4185-85E2-D7ACDA93F7A6 - MODULE_TYPE =3D DXE_DRIVER - VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D PlatformBootManagerLib|DXE_DRIVER - - -# -# The following information is for reference only and not required by the = build tools. -# -# VALID_ARCHITECTURES =3D IA32 X64 EBC -# - -[Sources] - PlatformData.c - PlatformConsole.c - PlatformConsole.h - PlatformBootManager.c - PlatformBootManager.h - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec - CorebootPayloadPkg/CorebootPayloadPkg.dec - -[LibraryClasses] - BaseLib - UefiBootServicesTableLib - UefiRuntimeServicesTableLib - UefiLib - UefiBootManagerLib - PcdLib - DxeServicesLib - MemoryAllocationLib - DevicePathLib - HiiLib - PrintLib - PlatformHookLib - -[Guids] - gEfiEndOfDxeEventGroupGuid - -[Protocols] - gEfiGenericMemTestProtocolGuid ## CONSUMES - gEfiGraphicsOutputProtocolGuid ## CONSUMES - gEfiUgaDrawProtocolGuid ## CONSUMES - gEfiBootLogoProtocolGuid ## CONSUMES - gEfiDxeSmmReadyToLockProtocolGuid - gEfiSmmAccess2ProtocolGuid - -[Pcd] - gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut - gEfiMdePkgTokenSpaceGuid.PcdUgaConsumeSupport - gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow - gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn - gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand - gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdBootlogoOnlyEnable - gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile - gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile - gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate - gEfiMdePkgTokenSpaceGuid.PcdUartDefaultDataBits - gEfiMdePkgTokenSpaceGuid.PcdUartDefaultParity - gEfiMdePkgTokenSpaceGuid.PcdUartDefaultStopBits diff --git a/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformCons= ole.c b/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c deleted file mode 100644 index cffd8e10ed..0000000000 --- a/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.c +++ /dev/null @@ -1,611 +0,0 @@ -/** @file -This file include all platform action which can be customized by IBV/OEM. - -Copyright (c) 2016, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include "PlatformBootManager.h" -#include "PlatformConsole.h" - -#define PCI_DEVICE_PATH_NODE(Func, Dev) \ - { \ - { \ - HARDWARE_DEVICE_PATH, \ - HW_PCI_DP, \ - { \ - (UINT8) (sizeof (PCI_DEVICE_PATH)), \ - (UINT8) ((sizeof (PCI_DEVICE_PATH)) >> 8) \ - } \ - }, \ - (Func), \ - (Dev) \ - } - -#define PNPID_DEVICE_PATH_NODE(PnpId) \ - { \ - { \ - ACPI_DEVICE_PATH, \ - ACPI_DP, \ - { \ - (UINT8) (sizeof (ACPI_HID_DEVICE_PATH)), \ - (UINT8) ((sizeof (ACPI_HID_DEVICE_PATH)) >> 8) \ - }, \ - }, \ - EISA_PNP_ID((PnpId)), \ - 0 \ - } - -#define gPciRootBridge \ - PNPID_DEVICE_PATH_NODE(0x0A03) - -#define gPnp16550ComPort \ - PNPID_DEVICE_PATH_NODE(0x0501) - -#define gUartVendor \ - { \ - { \ - HARDWARE_DEVICE_PATH, \ - HW_VENDOR_DP, \ - { \ - (UINT8) (sizeof (VENDOR_DEVICE_PATH)), \ - (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) \ - } \ - }, \ - {0xD3987D4B, 0x971A, 0x435F, {0x8C, 0xAF, 0x49, 0x67, 0xEB, 0x62, 0x72= , 0x41}} \ - } - -#define gUart \ - { \ - { \ - MESSAGING_DEVICE_PATH, \ - MSG_UART_DP, \ - { \ - (UINT8) (sizeof (UART_DEVICE_PATH)), \ - (UINT8) ((sizeof (UART_DEVICE_PATH)) >> 8) \ - } \ - }, \ - 0, \ - 115200, \ - 8, \ - 1, \ - 1 \ - } - -#define gPcAnsiTerminal \ - { \ - { \ - MESSAGING_DEVICE_PATH, \ - MSG_VENDOR_DP, \ - { \ - (UINT8) (sizeof (VENDOR_DEVICE_PATH)), \ - (UINT8) ((sizeof (VENDOR_DEVICE_PATH)) >> 8) \ - } \ - }, \ - DEVICE_PATH_MESSAGING_PC_ANSI \ - } - - -ACPI_HID_DEVICE_PATH gPnp16550ComPortDeviceNode =3D gPnp16550ComPort; -UART_DEVICE_PATH gUartDeviceNode =3D gUart; -VENDOR_DEVICE_PATH gTerminalTypeDeviceNode =3D gPcAnsiTerminal; -VENDOR_DEVICE_PATH gUartDeviceVendorNode =3D gUartVendor; - -// -// Predefined platform root bridge -// -PLATFORM_ROOT_BRIDGE_DEVICE_PATH gPlatformRootBridge0 =3D { - gPciRootBridge, - gEndEntire -}; - -EFI_DEVICE_PATH_PROTOCOL *gPlatformRootBridges[] =3D { - (EFI_DEVICE_PATH_PROTOCOL *) &gPlatformRootBridge0, - NULL -}; - -BOOLEAN mDetectVgaOnly; - -/** - Add UART to ConOut, ConIn, ErrOut. - - @param[in] DeviceHandle - LPC device path. - - @retval EFI_SUCCESS - Serial console is added to ConOut, ConIn, and Err= Out. - @retval EFI_STATUS - No serial console is added. -**/ -EFI_STATUS -PrepareLpcBridgeDevicePath ( - IN EFI_HANDLE DeviceHandle -) -{ - EFI_STATUS Status; - EFI_DEVICE_PATH_PROTOCOL *DevicePath; - - DevicePath =3D NULL; - Status =3D gBS->HandleProtocol ( - DeviceHandle, - &gEfiDevicePathProtocolGuid, - (VOID*)&DevicePath - ); - if (EFI_ERROR (Status)) { - return Status; - } - - // - // Register COM1 - // - DevicePath =3D AppendDevicePathNode ((EFI_DEVICE_PATH_PROTOCOL *)NULL, (= EFI_DEVICE_PATH_PROTOCOL *)&gUartDeviceVendorNode); - DevicePath =3D AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOC= OL *)&gUartDeviceNode); - DevicePath =3D AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOC= OL *)&gTerminalTypeDeviceNode); - - EfiBootManagerUpdateConsoleVariable (ConOut, DevicePath, NULL); - EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, NULL); - EfiBootManagerUpdateConsoleVariable (ErrOut, DevicePath, NULL); - - return EFI_SUCCESS; -} - -/** - Return the GOP device path in the platform. - - @param[in] PciDevicePath - Device path for the PCI graphics device. - @param[out] GopDevicePath - Return the device path with GOP installed. - - @retval EFI_SUCCESS - PCI VGA is added to ConOut. - @retval EFI_INVALID_PARAMETER - The device path parameter is invalid. - @retval EFI_STATUS - No GOP device found. -**/ -EFI_STATUS -GetGopDevicePath ( - IN EFI_DEVICE_PATH_PROTOCOL *PciDevicePath, - OUT EFI_DEVICE_PATH_PROTOCOL **GopDevicePath -) -{ - UINTN Index; - EFI_STATUS Status; - EFI_HANDLE PciDeviceHandle; - EFI_DEVICE_PATH_PROTOCOL *TempDevicePath; - EFI_DEVICE_PATH_PROTOCOL *TempPciDevicePath; - UINTN GopHandleCount; - EFI_HANDLE *GopHandleBuffer; - ACPI_ADR_DEVICE_PATH AcpiAdr; - EFI_DEVICE_PATH_PROTOCOL *MyDevicePath; - - if (PciDevicePath =3D=3D NULL || GopDevicePath =3D=3D NULL) { - return EFI_INVALID_PARAMETER; - } - - MyDevicePath =3D NULL; - - // - // Initialize the GopDevicePath to be PciDevicePath - // - *GopDevicePath =3D PciDevicePath; - TempPciDevicePath =3D PciDevicePath; - - Status =3D gBS->LocateDevicePath ( - &gEfiDevicePathProtocolGuid, - &TempPciDevicePath, - &PciDeviceHandle - ); - if (EFI_ERROR (Status)) { - return Status; - } - - // - // Try to connect this handle, so that GOP driver could start on this - // device and create child handles with GraphicsOutput Protocol installed - // on them, then we get device paths of these child handles and select - // them as possible console device. - // - AcpiAdr.Header.Type =3D ACPI_DEVICE_PATH; - AcpiAdr.Header.SubType =3D ACPI_ADR_DP; - AcpiAdr.ADR=3D ACPI_DISPLAY_ADR (1, 0, 0, 1, 0, ACPI_ADR_DISPLAY_TYPE_IN= TERNAL_DIGITAL, 8, 0); - - SetDevicePathNodeLength (&AcpiAdr.Header, sizeof (ACPI_ADR_DEVICE_PATH)); - - MyDevicePath =3D AppendDevicePathNode(MyDevicePath, (EFI_DEVICE_PATH_PRO= TOCOL*)&AcpiAdr); - - gBS->ConnectController (PciDeviceHandle, NULL, MyDevicePath, FALSE); - - FreePool(MyDevicePath); - - Status =3D gBS->LocateHandleBuffer ( - ByProtocol, - &gEfiGraphicsOutputProtocolGuid, - NULL, - &GopHandleCount, - &GopHandleBuffer - ); - if (!EFI_ERROR (Status)) { - // - // Add all the child handles as possible Console Device - // - for (Index =3D 0; Index < GopHandleCount; Index++) { - Status =3D gBS->HandleProtocol (GopHandleBuffer[Index], &gEfiDeviceP= athProtocolGuid, (VOID*)&TempDevicePath); - if (EFI_ERROR (Status)) { - continue; - } - if (CompareMem ( - PciDevicePath, - TempDevicePath, - GetDevicePathSize (PciDevicePath) - END_DEVICE_PATH_LENGTH - ) =3D=3D 0) { - // - // In current implementation, we only enable one of the child hand= les - // as console device, i.e. sotre one of the child handle's device - // path to variable "ConOut" - // In future, we could select all child handles to be console devi= ce - // - *GopDevicePath =3D TempDevicePath; - - // - // Delete the PCI device's path that added by GetPlugInPciVgaDevic= ePath() - // Add the integrity GOP device path. - // - EfiBootManagerUpdateConsoleVariable (ConOut, NULL, PciDevicePath); - EfiBootManagerUpdateConsoleVariable (ConOut, TempDevicePath, NULL); - } - } - gBS->FreePool (GopHandleBuffer); - } - - return EFI_SUCCESS; -} - -/** - Add PCI VGA to ConOut, ConIn, ErrOut. - - @param[in] DeviceHandle - Handle of PciIo protocol. - - @retval EFI_SUCCESS - PCI VGA is added to ConOut. - @retval EFI_STATUS - No PCI VGA device is added. - -**/ -EFI_STATUS -PreparePciVgaDevicePath ( - IN EFI_HANDLE DeviceHandle -) -{ - EFI_STATUS Status; - EFI_DEVICE_PATH_PROTOCOL *DevicePath; - EFI_DEVICE_PATH_PROTOCOL *GopDevicePath; - - DevicePath =3D NULL; - Status =3D gBS->HandleProtocol ( - DeviceHandle, - &gEfiDevicePathProtocolGuid, - (VOID*)&DevicePath - ); - if (EFI_ERROR (Status)) { - return Status; - } - - GetGopDevicePath (DevicePath, &GopDevicePath); - DevicePath =3D GopDevicePath; - - EfiBootManagerUpdateConsoleVariable (ConOut, DevicePath, NULL); - - return EFI_SUCCESS; -} - -/** - Add PCI Serial to ConOut, ConIn, ErrOut. - - @param[in] DeviceHandle - Handle of PciIo protocol. - - @retval EFI_SUCCESS - PCI Serial is added to ConOut, ConIn, and ErrOut. - @retval EFI_STATUS - No PCI Serial device is added. - -**/ -EFI_STATUS -PreparePciSerialDevicePath ( - IN EFI_HANDLE DeviceHandle -) -{ - EFI_STATUS Status; - EFI_DEVICE_PATH_PROTOCOL *DevicePath; - - DevicePath =3D NULL; - Status =3D gBS->HandleProtocol ( - DeviceHandle, - &gEfiDevicePathProtocolGuid, - (VOID*)&DevicePath - ); - if (EFI_ERROR (Status)) { - return Status; - } - - DevicePath =3D AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOC= OL *)&gUartDeviceNode); - DevicePath =3D AppendDevicePathNode (DevicePath, (EFI_DEVICE_PATH_PROTOC= OL *)&gTerminalTypeDeviceNode); - - EfiBootManagerUpdateConsoleVariable (ConOut, DevicePath, NULL); - EfiBootManagerUpdateConsoleVariable (ConIn, DevicePath, NULL); - EfiBootManagerUpdateConsoleVariable (ErrOut, DevicePath, NULL); - - return EFI_SUCCESS; -} - - -/** - For every PCI instance execute a callback function. - - @param[in] Id - The protocol GUID for callback - @param[in] CallBackFunction - The callback function - @param[in] Context - The context of the callback - - @retval EFI_STATUS - Callback function failed. - -**/ -EFI_STATUS -EFIAPI -VisitAllInstancesOfProtocol ( - IN EFI_GUID *Id, - IN PROTOCOL_INSTANCE_CALLBACK CallBackFunction, - IN VOID *Context -) -{ - EFI_STATUS Status; - UINTN HandleCount; - EFI_HANDLE *HandleBuffer; - UINTN Index; - VOID *Instance; - - // - // Start to check all the PciIo to find all possible device - // - HandleCount =3D 0; - HandleBuffer =3D NULL; - Status =3D gBS->LocateHandleBuffer ( - ByProtocol, - Id, - NULL, - &HandleCount, - &HandleBuffer - ); - if (EFI_ERROR (Status)) { - return Status; - } - - for (Index =3D 0; Index < HandleCount; Index++) { - Status =3D gBS->HandleProtocol (HandleBuffer[Index], Id, &Instance); - if (EFI_ERROR (Status)) { - continue; - } - - Status =3D (*CallBackFunction) ( - HandleBuffer[Index], - Instance, - Context - ); - } - - gBS->FreePool (HandleBuffer); - - return EFI_SUCCESS; -} - - -/** - For every PCI instance execute a callback function. - - @param[in] Handle - The PCI device handle - @param[in] Instance - The instance of the PciIo protocol - @param[in] Context - The context of the callback - - @retval EFI_STATUS - Callback function failed. - -**/ -EFI_STATUS -EFIAPI -VisitingAPciInstance ( - IN EFI_HANDLE Handle, - IN VOID *Instance, - IN VOID *Context -) -{ - EFI_STATUS Status; - EFI_PCI_IO_PROTOCOL *PciIo; - PCI_TYPE00 Pci; - - PciIo =3D (EFI_PCI_IO_PROTOCOL*) Instance; - - // - // Check for all PCI device - // - Status =3D PciIo->Pci.Read ( - PciIo, - EfiPciIoWidthUint32, - 0, - sizeof (Pci) / sizeof (UINT32), - &Pci - ); - if (EFI_ERROR (Status)) { - return Status; - } - - return (*(VISIT_PCI_INSTANCE_CALLBACK)(UINTN) Context) ( - Handle, - PciIo, - &Pci - ); - -} - - -/** - For every PCI instance execute a callback function. - - @param[in] CallBackFunction - Callback function pointer - - @retval EFI_STATUS - Callback function failed. - -**/ -EFI_STATUS -EFIAPI -VisitAllPciInstances ( - IN VISIT_PCI_INSTANCE_CALLBACK CallBackFunction -) -{ - return VisitAllInstancesOfProtocol ( - &gEfiPciIoProtocolGuid, - VisitingAPciInstance, - (VOID*)(UINTN) CallBackFunction - ); -} - - -/** - Do platform specific PCI Device check and add them to - ConOut, ConIn, ErrOut. - - @param[in] Handle - Handle of PCI device instance - @param[in] PciIo - PCI IO protocol instance - @param[in] Pci - PCI Header register block - - @retval EFI_SUCCESS - PCI Device check and Console variable update succe= ssfully. - @retval EFI_STATUS - PCI Device check or Console variable update fail. - -**/ -EFI_STATUS -EFIAPI -DetectAndPreparePlatformPciDevicePath ( - IN EFI_HANDLE Handle, - IN EFI_PCI_IO_PROTOCOL *PciIo, - IN PCI_TYPE00 *Pci -) -{ - EFI_STATUS Status; - - Status =3D PciIo->Attributes ( - PciIo, - EfiPciIoAttributeOperationEnable, - EFI_PCI_DEVICE_ENABLE, - NULL - ); - ASSERT_EFI_ERROR (Status); - - if (!mDetectVgaOnly) { - // - // Here we decide whether it is LPC Bridge - // - if ((IS_PCI_LPC (Pci)) || - ((IS_PCI_ISA_PDECODE (Pci)) && - (Pci->Hdr.VendorId =3D=3D 0x8086) - ) - ) { - // - // Add IsaKeyboard to ConIn, - // add IsaSerial to ConOut, ConIn, ErrOut - // - DEBUG ((EFI_D_INFO, "Found LPC Bridge device\n")); - PrepareLpcBridgeDevicePath (Handle); - return EFI_SUCCESS; - } - // - // Here we decide which Serial device to enable in PCI bus - // - if (IS_PCI_16550SERIAL (Pci)) { - // - // Add them to ConOut, ConIn, ErrOut. - // - DEBUG ((EFI_D_INFO, "Found PCI 16550 SERIAL device\n")); - PreparePciSerialDevicePath (Handle); - return EFI_SUCCESS; - } - } - - // - // Here we decide which VGA device to enable in PCI bus - // - if (IS_PCI_VGA (Pci)) { - // - // Add them to ConOut. - // - DEBUG ((EFI_D_INFO, "Found PCI VGA device\n")); - PreparePciVgaDevicePath (Handle); - return EFI_SUCCESS; - } - - return Status; -} - - -/** - Do platform specific PCI Device check and add them to ConOut, ConIn, Err= Out - - @param[in] DetectVgaOnly - Only detect VGA device if it's TRUE. - - @retval EFI_SUCCESS - PCI Device check and Console variable update succe= ssfully. - @retval EFI_STATUS - PCI Device check or Console variable update fail. - -**/ -EFI_STATUS -DetectAndPreparePlatformPciDevicePaths ( - BOOLEAN DetectVgaOnly -) -{ - mDetectVgaOnly =3D DetectVgaOnly; - return VisitAllPciInstances (DetectAndPreparePlatformPciDevicePath); -} - - -/** - The function will connect root bridge - - @return EFI_SUCCESS Connect RootBridge successfully. - -**/ -EFI_STATUS -ConnectRootBridge ( - VOID -) -{ - EFI_STATUS Status; - EFI_HANDLE RootHandle; - - // - // Make all the PCI_IO protocols on PCI Seg 0 show up - // - Status =3D gBS->LocateDevicePath ( - &gEfiDevicePathProtocolGuid, - &gPlatformRootBridges[0], - &RootHandle - ); - if (EFI_ERROR (Status)) { - return Status; - } - - Status =3D gBS->ConnectController (RootHandle, NULL, NULL, FALSE); - if (EFI_ERROR (Status)) { - return Status; - } - - return EFI_SUCCESS; -} - -/** - Platform console init. Include the platform firmware vendor, revision - and so crc check. - -**/ -VOID -EFIAPI -PlatformConsoleInit ( - VOID -) -{ - gUartDeviceNode.BaudRate =3D PcdGet64 (PcdUartDefaultBaudRate); - gUartDeviceNode.DataBits =3D PcdGet8 (PcdUartDefaultDataBits); - gUartDeviceNode.Parity =3D PcdGet8 (PcdUartDefaultParity); - gUartDeviceNode.StopBits =3D PcdGet8 (PcdUartDefaultStopBits); - - ConnectRootBridge (); - - // - // Do platform specific PCI Device check and add them to ConOut, ConIn, = ErrOut - // - DetectAndPreparePlatformPciDevicePaths (FALSE); -} diff --git a/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformCons= ole.h b/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.h deleted file mode 100644 index 68bdf5e555..0000000000 --- a/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformConsole.h +++ /dev/null @@ -1,70 +0,0 @@ -/** @file -Head file for BDS Platform specific code - -Copyright (c) 2016, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent -**/ - -#ifndef _PLATFORM_CONSOLE_H -#define _PLATFORM_CONSOLE_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define IS_PCI_ISA_PDECODE(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI= _CLASS_BRIDGE_ISA_PDECODE, 0) -#define IS_PCI_16550SERIAL(_p) IS_CLASS3 (_p, PCI_CLASS_SCC, PCI_SU= BCLASS_SERIAL, PCI_IF_16550) - -// -// Type definitions -// - -// -// Platform Root Bridge -// -typedef struct { - ACPI_HID_DEVICE_PATH PciRootBridge; - EFI_DEVICE_PATH_PROTOCOL End; -} PLATFORM_ROOT_BRIDGE_DEVICE_PATH; - -typedef -EFI_STATUS -(EFIAPI *PROTOCOL_INSTANCE_CALLBACK)( - IN EFI_HANDLE Handle, - IN VOID *Instance, - IN VOID *Context -); - -/** - @param[in] Handle - Handle of PCI device instance - @param[in] PciIo - PCI IO protocol instance - @param[in] Pci - PCI Header register block -**/ -typedef -EFI_STATUS -(EFIAPI *VISIT_PCI_INSTANCE_CALLBACK)( - IN EFI_HANDLE Handle, - IN EFI_PCI_IO_PROTOCOL *PciIo, - IN PCI_TYPE00 *Pci -); - -/** - Platform console init. Include the platform firmware vendor, revision - and so crc check. - -**/ -VOID -EFIAPI -PlatformConsoleInit ( - VOID -); - -#endif diff --git a/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformData= .c b/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformData.c deleted file mode 100644 index 56fe41afeb..0000000000 --- a/CorebootPayloadPkg/Library/PlatformBootManagerLib/PlatformData.c +++ /dev/null @@ -1,19 +0,0 @@ -/**@file - Defined the platform specific device path which will be filled to - ConIn/ConOut variables. - -Copyright (c) 2016, Intel Corporation. All rights reserved.
-SPDX-License-Identifier: BSD-2-Clause-Patent -**/ - -#include "PlatformBootManager.h" - -/// -/// Predefined platform default console device path -/// -PLATFORM_CONSOLE_CONNECT_ENTRY gPlatformConsole[] =3D { - { - NULL, - 0 - } -}; diff --git a/CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c b= /CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c deleted file mode 100644 index b2d4858f7b..0000000000 --- a/CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.c +++ /dev/null @@ -1,105 +0,0 @@ -/** @file - Platform Hook Library instance for UART device upon coreboot. - - Copyright (c) 2015, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include -#include -#include -#include -#include -#include - -typedef struct { - UINT16 VendorId; ///< Vendor ID to match the PCI device. The = value 0xFFFF terminates the list of entries. - UINT16 DeviceId; ///< Device ID to match the PCI device - UINT32 ClockRate; ///< UART clock rate. Set to 0 for default c= lock rate of 1843200 Hz - UINT64 Offset; ///< The byte offset into to the BAR - UINT8 BarIndex; ///< Which BAR to get the UART base address - UINT8 RegisterStride; ///< UART register stride in bytes. Set to 0= for default register stride of 1 byte. - UINT16 ReceiveFifoDepth; ///< UART receive FIFO depth in bytes. Set to= 0 for a default FIFO depth of 16 bytes. - UINT16 TransmitFifoDepth; ///< UART transmit FIFO depth in bytes. Set t= o 0 for a default FIFO depth of 16 bytes. - UINT8 Reserved[2]; -} PCI_SERIAL_PARAMETER; - -/** - Performs platform specific initialization required for the CPU to access - the hardware associated with a SerialPortLib instance. This function do= es - not initialize the serial port hardware itself. Instead, it initializes - hardware devices that are required for the CPU to access the serial port - hardware. This function may be called more than once. - - @retval RETURN_SUCCESS The platform specific initialization succee= ded. - @retval RETURN_DEVICE_ERROR The platform specific initialization could = not be completed. - -**/ -RETURN_STATUS -EFIAPI -PlatformHookSerialPortInitialize ( - VOID - ) -{ - RETURN_STATUS Status; - UINT32 SerialRegBase; - UINT32 SerialRegAccessType; - UINT32 BaudRate; - UINT32 RegWidth; - UINT32 InputHertz; - UINT32 PayloadParam; - UINT32 DeviceVendor; - PCI_SERIAL_PARAMETER *SerialParam; - - Status =3D CbParseSerialInfo (&SerialRegBase, &SerialRegAccessType, - &RegWidth, &BaudRate, &InputHertz, - &PayloadParam); - if (RETURN_ERROR (Status)) { - return Status; - } - - if (SerialRegAccessType =3D=3D 2) { //MMIO - Status =3D PcdSetBoolS (PcdSerialUseMmio, TRUE); - } else { //IO - Status =3D PcdSetBoolS (PcdSerialUseMmio, FALSE); - } - if (RETURN_ERROR (Status)) { - return Status; - } - Status =3D PcdSet64S (PcdSerialRegisterBase, (UINT64) SerialRegBase); - if (RETURN_ERROR (Status)) { - return Status; - } - - Status =3D PcdSet32S (PcdSerialRegisterStride, RegWidth); - if (RETURN_ERROR (Status)) { - return Status; - } - - Status =3D PcdSet32S (PcdSerialBaudRate, BaudRate); - if (RETURN_ERROR (Status)) { - return Status; - } - - Status =3D PcdSet64S (PcdUartDefaultBaudRate, BaudRate); - if (RETURN_ERROR (Status)) { - return Status; - } - - Status =3D PcdSet32S (PcdSerialClockRate, InputHertz); - if (RETURN_ERROR (Status)) { - return Status; - } - - if (PayloadParam >=3D 0x80000000) { - DeviceVendor =3D PciRead32 (PayloadParam & 0x0ffff000); - SerialParam =3D PcdGetPtr(PcdPciSerialParameters); - SerialParam->VendorId =3D (UINT16)DeviceVendor; - SerialParam->DeviceId =3D DeviceVendor >> 16; - SerialParam->ClockRate =3D InputHertz; - SerialParam->RegisterStride =3D (UINT8)RegWidth; - } - - return RETURN_SUCCESS; -} diff --git a/CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf= b/CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf deleted file mode 100644 index b3cda573fb..0000000000 --- a/CorebootPayloadPkg/Library/PlatformHookLib/PlatformHookLib.inf +++ /dev/null @@ -1,39 +0,0 @@ -## @file -# Platform Hook Library instance for UART device upon coreboot. -# -# Copyright (c) 2015, Intel Corporation. All rights reserved.
-# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D PlatformHookLib - FILE_GUID =3D 40A2CBC6-CFB8-447b-A90E-198E88FD345E - MODULE_TYPE =3D BASE - VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D PlatformHookLib - CONSTRUCTOR =3D PlatformHookSerialPortInitialize - -[Sources] - PlatformHookLib.c - -[LibraryClasses] - CbParseLib - PcdLib - PciLib - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - CorebootModulePkg/CorebootModulePkg.dec - -[Pcd] - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseMmio ## PRODUCES - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterBase ## PRODUCES - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialBaudRate ## PRODUCES - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialRegisterStride ## PRODUCES - gEfiMdeModulePkgTokenSpaceGuid.PcdSerialClockRate ## PRODUCES - gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate ## PRODUCES - gEfiMdeModulePkgTokenSpaceGuid.PcdPciSerialParameters ## PRODUCES diff --git a/CorebootPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c b/C= orebootPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c deleted file mode 100644 index 2a6abaf6ba..0000000000 --- a/CorebootPayloadPkg/Library/ResetSystemLib/ResetSystemLib.c +++ /dev/null @@ -1,221 +0,0 @@ -/** @file - Reset System Library functions for coreboot - - Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include -#include -#include -#include -#include - -#include - -VOID -AcpiPmControl ( - UINTN SuspendType - ) -{ - EFI_HOB_GUID_TYPE *GuidHob; - ACPI_BOARD_INFO *pAcpiBoardInfo;=09 - UINTN PmCtrlReg =3D 0; -=09 - ASSERT (SuspendType <=3D 7); =20 - // - // Find the acpi board information guid hob - // - GuidHob =3D GetFirstGuidHob (&gUefiAcpiBoardInfoGuid); - ASSERT (GuidHob !=3D NULL); - pAcpiBoardInfo =3D (ACPI_BOARD_INFO *)GET_GUID_HOB_DATA (GuidHob);=20 - =20 - PmCtrlReg =3D (UINTN)pAcpiBoardInfo->PmCtrlRegBase;=20 - IoAndThenOr16 (PmCtrlReg, (UINT16) ~0x3c00, (UINT16) (SuspendType << 10)= ); - IoOr16 (PmCtrlReg, BIT13); - CpuDeadLoop (); -} - -/** - Calling this function causes a system-wide reset. This sets - all circuitry within the system to its initial state. This type of reset - is asynchronous to system operation and operates without regard to - cycle boundaries. - - System reset should not return, if it returns, it means the system does - not support cold reset. -**/ -VOID -EFIAPI -ResetCold ( - VOID - ) -{ - EFI_HOB_GUID_TYPE *GuidHob; - ACPI_BOARD_INFO *pAcpiBoardInfo;=09 - =09 - // - // Find the acpi board information guid hob - // - GuidHob =3D GetFirstGuidHob (&gUefiAcpiBoardInfoGuid); - ASSERT (GuidHob !=3D NULL); - pAcpiBoardInfo =3D (ACPI_BOARD_INFO *)GET_GUID_HOB_DATA (GuidHob);=20 -=09 - IoWrite8 ((UINTN)pAcpiBoardInfo->ResetRegAddress, pAcpiBoardInfo->ResetV= alue); - CpuDeadLoop (); -} - -/** - Calling this function causes a system-wide initialization. The processors - are set to their initial state, and pending cycles are not corrupted. - - System reset should not return, if it returns, it means the system does - not support warm reset. -**/ -VOID -EFIAPI -ResetWarm ( - VOID - ) -{ - EFI_HOB_GUID_TYPE *GuidHob; - ACPI_BOARD_INFO *pAcpiBoardInfo;=09 - =09 - // - // Find the acpi board information guid hob - // - GuidHob =3D GetFirstGuidHob (&gUefiAcpiBoardInfoGuid); - ASSERT (GuidHob !=3D NULL); - pAcpiBoardInfo =3D (ACPI_BOARD_INFO *)GET_GUID_HOB_DATA (GuidHob);=20 -=09 - IoWrite8 ((UINTN)pAcpiBoardInfo->ResetRegAddress, pAcpiBoardInfo->ResetV= alue); - CpuDeadLoop (); -} - -/** - Calling this function causes the system to enter a power state equivalent - to the ACPI G2/S5 or G3 states. - - System shutdown should not return, if it returns, it means the system do= es - not support shut down reset. -**/ -VOID -EFIAPI -ResetShutdown ( - VOID - ) -{ - EFI_HOB_GUID_TYPE *GuidHob; - ACPI_BOARD_INFO *pAcpiBoardInfo; - UINTN PmCtrlReg; - - // - // Find the acpi board information guid hob - // - GuidHob =3D GetFirstGuidHob (&gUefiAcpiBoardInfoGuid); - ASSERT (GuidHob !=3D NULL); - pAcpiBoardInfo =3D (ACPI_BOARD_INFO *)GET_GUID_HOB_DATA (GuidHob);=20 - =20 - // - // GPE0_EN should be disabled to avoid any GPI waking up the system from= S5 - // - IoWrite16 ((UINTN)pAcpiBoardInfo->PmGpeEnBase, 0); - - // - // Clear Power Button Status - // - IoWrite16((UINTN) pAcpiBoardInfo->PmEvtBase, BIT8); - =20 - // - // Transform system into S5 sleep state - // - PmCtrlReg =3D (UINTN)pAcpiBoardInfo->PmCtrlRegBase;=20 - IoAndThenOr16 (PmCtrlReg, (UINT16) ~0x3c00, (UINT16) (7 << 10)); - IoOr16 (PmCtrlReg, BIT13); - CpuDeadLoop (); - - ASSERT (FALSE); -} - -/** - Calling this function causes the system to enter a power state for capsu= le - update. - - Reset update should not return, if it returns, it means the system does - not support capsule update. - -**/ -VOID -EFIAPI -EnterS3WithImmediateWake ( - VOID - ) -{ - AcpiPmControl (5); - ASSERT (FALSE); -} - -/** - This function causes a systemwide reset. The exact type of the reset is - defined by the EFI_GUID that follows the Null-terminated Unicode string = passed - into ResetData. If the platform does not recognize the EFI_GUID in Reset= Data - the platform must pick a supported reset type to perform.The platform may - optionally log the parameters from any non-normal reset that occurs. - - @param[in] DataSize The size, in bytes, of ResetData. - @param[in] ResetData The data buffer starts with a Null-terminated str= ing, - followed by the EFI_GUID. -**/ -VOID -EFIAPI -ResetPlatformSpecific ( - IN UINTN DataSize, - IN VOID *ResetData - ) -{ - ResetCold (); -} - -/** - The ResetSystem function resets the entire platform. - - @param[in] ResetType The type of reset to perform. - @param[in] ResetStatus The status code for the reset. - @param[in] DataSize The size, in bytes, of ResetData. - @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm,= or EfiResetShutdown - the data buffer starts with a Null-terminated = string, optionally - followed by additional binary data. The string= is a description - that the caller may use to further indicate th= e reason for the - system reset. -**/ -VOID -EFIAPI -ResetSystem ( - IN EFI_RESET_TYPE ResetType, - IN EFI_STATUS ResetStatus, - IN UINTN DataSize, - IN VOID *ResetData OPTIONAL - ) -{ - switch (ResetType) { - case EfiResetWarm: - ResetWarm (); - break; - - case EfiResetCold: - ResetCold (); - break; - - case EfiResetShutdown: - ResetShutdown (); - return; - - case EfiResetPlatformSpecific: - ResetPlatformSpecific (DataSize, ResetData); - return; - - default: - return; - } -} diff --git a/CorebootPayloadPkg/Library/ResetSystemLib/ResetSystemLib.inf b= /CorebootPayloadPkg/Library/ResetSystemLib/ResetSystemLib.inf deleted file mode 100644 index e0a92c00cf..0000000000 --- a/CorebootPayloadPkg/Library/ResetSystemLib/ResetSystemLib.inf +++ /dev/null @@ -1,38 +0,0 @@ -## @file -# Library instance for ResetSystem library class for coreboot -# -# Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - INF_VERSION =3D 0x00010005 - BASE_NAME =3D ResetSystemLib - FILE_GUID =3D C5CD4EEE-527F-47df-9C92-B41414AF7479 - MODULE_TYPE =3D BASE - VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D ResetSystemLib - -# -# The following information is for reference only and not required by the = build tools. -# -# VALID_ARCHITECTURES =3D IA32 X64 -# - -[Sources] - ResetSystemLib.c - -[Packages] - MdePkg/MdePkg.dec - MdeModulePkg/MdeModulePkg.dec - CorebootModulePkg/CorebootModulePkg.dec - =20 -[LibraryClasses] - DebugLib - IoLib - HobLib - =20 -[Guids] =20 - gUefiAcpiBoardInfoGuid - --=20 2.16.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#40146): https://edk2.groups.io/g/devel/message/40146 Mute This Topic: https://groups.io/mt/31537333/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-