From nobody Mon Sep 16 19:33:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+114500+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1706248938362788.6498179326412; Thu, 25 Jan 2024 22:02:18 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=pBroa/nsYIG+xU65scpaBrD2Z7CkaOCopqkN5TKB1E4=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:Received-SPF:From:To:CC:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1706248938; v=1; b=L43u2IGwJykeB+eEF6G1xUhr/cx8WOS4vV1uk+NePPy5rEgRYbrNKIJGEnZxa9ND8sD2P91R /Av/xw2+7KaDR0//CwSmbu1tK4i1o7mykhLJtFD9dC6bzIuY9/NqYlyI0j9AtOtJ/JBhPtZiaiE dO5e1AWiK3oDqAmGfMRRlCTA= X-Received: by 127.0.0.2 with SMTP id 0znSYY1788612xJgkFTErfGL; Thu, 25 Jan 2024 22:02:18 -0800 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.71]) by mx.groups.io with SMTP id smtpd.web10.9821.1706248937495731957 for ; Thu, 25 Jan 2024 22:02:17 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JZYKouh0I5SFOx+EW+0EUX3jWaTLgWnSY/Q9VMRT6Go2rbP0cokEEjr9SR72WW8zkGQTVCej7OK/M7t6gZQ84/UnQpiv9HTgMUHJ6VY1HfPypBd+KIcyasNFrKiSY7x7haKBKc4ZDtfKfRmi2DrG4NILUorLxhse5v1j91eRQDenikB8WIwzZkBM3miAuVcquPLV1KopEZ1DVyusPMvghjGM3SKqQ14UPFwNwWPecEqn0hhvEVqSMpkYglef0io43188/d/QTzRuBjTNpIbTYRKtfrcCofXmp26A5+Iw5Qc17jb42UH6cBx6P1zUfffGWWOKwgkFO7/yWrosruCSYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7njb+tMCxvc9DKbaHS9MGscmwP5P2LJwGgc0p7qY7nY=; b=M7iQS2iHdeGwKuRWWuXuXL8IK/i+YkTau8UKySNsSPSZ9uvZIqM2IQ5boM1RO8SOxsZ6nZBXhZfOpVQ66gVUv6+7u1rG+KOiN5QogD9wr8+aEF9suTSEinxr5uR6Utfwl3zSpDVx9yL2mtvCRkwTu/3n5zNJY0knlTXvkxGGP1Wmh/tVBYVTJCfMc+Mz46oemgxzAOyyxEAt8/CKj0vSOopY0Te7WFpmrRZDXx0v6clzlUOj1B4Wc7efTVlkuJ8uFXoYhcnW/v6xIPNdz0gLNsINFkI2FzbAX1JATnK43aCDRKlpYZhAZDhGlrEBMY6yzS4MGfOMqYz2XKeUaMUWJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) X-Received: from DS7PR03CA0337.namprd03.prod.outlook.com (2603:10b6:8:55::25) by CY8PR12MB8315.namprd12.prod.outlook.com (2603:10b6:930:7e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.26; Fri, 26 Jan 2024 06:02:14 +0000 X-Received: from DS2PEPF00003440.namprd02.prod.outlook.com (2603:10b6:8:55:cafe::98) by DS7PR03CA0337.outlook.office365.com (2603:10b6:8:55::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.27 via Frontend Transport; Fri, 26 Jan 2024 06:02:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+114500+1787277+3901457@groups.io; helo=mail02.groups.io; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C X-Received: from SATLEXMB04.amd.com (165.204.84.17) by DS2PEPF00003440.mail.protection.outlook.com (10.167.18.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7228.16 via Frontend Transport; Fri, 26 Jan 2024 06:02:14 +0000 X-Received: from SHA-LX-MINGXZHA.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 26 Jan 2024 00:02:12 -0600 From: "Zhai, MingXin (Duke) via groups.io" To: CC: Eric Xing , Ken Yao , Igniculus Fu , Abner Chang Subject: [edk2-devel] [PATCH V2 07/32] AMD/VanGoghBoard: Check in PciPlatform Date: Fri, 26 Jan 2024 14:00:25 +0800 Message-ID: <20240126060050.1725-8-duke.zhai@amd.com> In-Reply-To: <20240126060050.1725-1-duke.zhai@amd.com> References: <20240126060050.1725-1-duke.zhai@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS2PEPF00003440:EE_|CY8PR12MB8315:EE_ X-MS-Office365-Filtering-Correlation-Id: af3b0d74-7dad-4d61-f968-08dc1e34580e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: AQIy0G+QFTwnDyXUCX/m4fTBZc31UGVgzWaX4STcOtWEUy2XpmRcWOBjtT8P4aQYkljGil+OxVQg/AuGIki25bWM8RhhcEjqO5YZZfOUnAXyphnTGGZzsyQP607IS8rRxARh7uzVf9BGhcFBXkXnES7uGt4W/mr8MfdgUelhcYWdQWYGUeOXJpqBGh/WarrA65ORIEXFrMK34gtwLcwDqbzx5HOanerNb/m8FFrZNuQDrRj/MctjcqMsB1jUHQ3aZ4susTAjYe0SZfNjkbpDYpsMhvIFHJQyVxwzZCUTL7h723DyvihD2sHkRGNnPPBQdh5tsI/DxZuT8GkguSn9BK/338mVw4xM50p7oGL87RXjBXSbVEToE1P472PlrUJQM4FbdkRCbPQB1eRGfX4t0WOxFLPJvifHAq9I5qnqugs+oqdhVQNH5LZYM0ErR21vGUwNp0FGbC3vyjo/IpXwYgMjzG27dNGx1P0v3aiW35pi4MJnYl9Aj27RqexGchz4TnGY2b0dbTQ9muz59y+pHGTghvZGm89WExWmBcODIlLKkER4QO+c3Q/d8M7YAyhJoEhaYzHIjL8oExkGtEFA0QJ/VG5hIGZ/gghBYpwMBxiVxPdWhOR9khEOP4IaBQboCj5Xu6MiHNyJG95Tw7VEJBt84U3ah03Au2PVySi9dxWjcCTLEtmX+/MicPYWly7GK/fDIgZfhoIeFrP973HaGbnPvZ/sXH/UwBKPZ9tjti8uJlgB17I0zCnvHo19wut+7KtOkki8VvOYsLFgAU5TqA== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2024 06:02:14.3495 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af3b0d74-7dad-4d61-f968-08dc1e34580e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS2PEPF00003440.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB8315 Precedence: Bulk List-Subscribe: List-Help: 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,duke.zhai@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 4oGcHUtrhPK6F6kJfM33FuaYx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1706248939109100025 Content-Type: text/plain; charset="utf-8" From: Duke Zhai BZ #:4640 In V2: Improve coding style. 1.Remove the leading underscore and use double underscore at trailing in = C header files. 2.Remove old tianocore licenses and redundant license description. 3.Improve coding style. For example: remove space between @param. In V1: BIOS detects current IGPU device ID and install corresponding VBIOS. Inital PciPlatform module to load VBIOS and to provide interface for other option ROMs if necessary. Signed-off-by: Duke Zhai Cc: Eric Xing Cc: Ken Yao Cc: Igniculus Fu Cc: Abner Chang --- .../Include/Protocol/GlobalNvsArea.h | 63 ++++++ .../PciPlatform/CommonHeader.h | 27 +++ .../PciPlatform/PciPlatform.c | 183 ++++++++++++++++++ .../PciPlatform/PciPlatform.h | 89 +++++++++ .../PciPlatform/PciPlatform.inf | 51 +++++ 5 files changed, 413 insertions(+) create mode 100644 Platform/AMD/VanGoghBoard/ChachaniBoardPkg/Include/Prot= ocol/GlobalNvsArea.h create mode 100644 Platform/AMD/VanGoghBoard/ChachaniBoardPkg/PciPlatform/= CommonHeader.h create mode 100644 Platform/AMD/VanGoghBoard/ChachaniBoardPkg/PciPlatform/= PciPlatform.c create mode 100644 Platform/AMD/VanGoghBoard/ChachaniBoardPkg/PciPlatform/= PciPlatform.h create mode 100644 Platform/AMD/VanGoghBoard/ChachaniBoardPkg/PciPlatform/= PciPlatform.inf diff --git a/Platform/AMD/VanGoghBoard/ChachaniBoardPkg/Include/Protocol/Gl= obalNvsArea.h b/Platform/AMD/VanGoghBoard/ChachaniBoardPkg/Include/Protocol= /GlobalNvsArea.h new file mode 100644 index 0000000000..e844932cc0 --- /dev/null +++ b/Platform/AMD/VanGoghBoard/ChachaniBoardPkg/Include/Protocol/GlobalNvs= Area.h @@ -0,0 +1,63 @@ +/** @file +Definition of the global NVS area protocol. This protocol +publishes the address and format of a global ACPI NVS buffer +used as a communications buffer between SMM code and ASL code. +The format is derived from the ACPI reference code, version 0.95. +Note: Data structures defined in this protocol are not naturally aligned. + +Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+Copyright (c) 2013-2015 Intel Corporation. All rights reserved.
+ +SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef GLOBAL_NVS_AREA_H__ +#define GLOBAL_NVS_AREA_H__ + +// +// Includes +// +#define GLOBAL_NVS_DEVICE_ENABLE 1 +#define GLOBAL_NVS_DEVICE_DISABLE 0 + +// +// Global NVS Area Protocol GUID +// +#define EFI_GLOBAL_NVS_AREA_PROTOCOL_GUID \ +{ 0x74e1e48, 0x8132, 0x47a1, {0x8c, 0x2c, 0x3f, 0x14, 0xad, 0x9a, 0x66, 0x= dc} } + +// +// Revision id - Added TPM related fields +// +#define GLOBAL_NVS_AREA_RIVISION_1 1 + +// +// Extern the GUID for protocol users. +// +extern EFI_GUID gEfiGlobalNvsAreaProtocolGuid; + +// +// Global NVS Area definition +// +#pragma pack (1) +typedef struct { + // + // Miscellaneous Dynamic Values, the definitions below need to be matched + // GNVS definitions in Platform.ASL + // + UINT32 TopOfMem; // TOPM + UINT8 NbIoApic; // NAPC + UINT32 PcieBaseAddress; // PCBA + UINT32 PcieBaseLimit; // PCBL +} EFI_GLOBAL_NVS_AREA; +#pragma pack () + +// +// Global NVS Area Protocol +// +typedef struct _EFI_GLOBAL_NVS_AREA_PROTOCOL { + EFI_GLOBAL_NVS_AREA *Area; +} EFI_GLOBAL_NVS_AREA_PROTOCOL; + +#endif diff --git a/Platform/AMD/VanGoghBoard/ChachaniBoardPkg/PciPlatform/CommonH= eader.h b/Platform/AMD/VanGoghBoard/ChachaniBoardPkg/PciPlatform/CommonHead= er.h new file mode 100644 index 0000000000..f4e6461206 --- /dev/null +++ b/Platform/AMD/VanGoghBoard/ChachaniBoardPkg/PciPlatform/CommonHeader.h @@ -0,0 +1,27 @@ +/** @file + Implements CommonHeader.h + This file includes package header files, library classes and protocol, P= PI & GUID definitions. + + Copyright (c) 2013-2015 Intel Corporation. All rights reserved.
+ Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef COMMON_HEADER_H___ +#define COMMON_HEADER_H___ + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/Platform/AMD/VanGoghBoard/ChachaniBoardPkg/PciPlatform/PciPlat= form.c b/Platform/AMD/VanGoghBoard/ChachaniBoardPkg/PciPlatform/PciPlatform= .c new file mode 100644 index 0000000000..aa0a133b1f --- /dev/null +++ b/Platform/AMD/VanGoghBoard/ChachaniBoardPkg/PciPlatform/PciPlatform.c @@ -0,0 +1,183 @@ +/** @file + Implements PciPlatform.c + Registers onboard PCI ROMs with PCI.IO + + Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+ Copyright (c) 2013-2015 Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "CommonHeader.h" + +#include "PciPlatform.h" + +PCI_OPTION_ROM_TABLE mPciOptionRomTable[] =3D { + { ONBOARD_SPH_VIDEO_OPTION_ROM_FILE_GUID, 0x1002, 0x1435 }, + { NULL_ROM_FILE_GUID, 0xffff, 0xffff } +}; + +EFI_PCI_PLATFORM_PROTOCOL mPciPlatform =3D { + PhaseNotify, + PlatformPrepController, + GetPlatformPolicy, + GetPciRom +}; + +EFI_HANDLE mPciPlatformHandle =3D NULL; +EFI_HANDLE mImageHandle =3D NULL; + +EFI_STATUS +EFIAPI +PhaseNotify ( + IN EFI_PCI_PLATFORM_PROTOCOL *This, + IN EFI_HANDLE HostBridge, + IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE Phase, + IN EFI_PCI_CHIPSET_EXECUTION_PHASE ChipsetPhase + ) +{ + return EFI_UNSUPPORTED; +} + +EFI_STATUS +EFIAPI +PlatformPrepController ( + IN EFI_PCI_PLATFORM_PROTOCOL *This, + IN EFI_HANDLE HostBridge, + IN EFI_HANDLE RootBridge, + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS PciAddress, + IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE Phase, + IN EFI_PCI_CHIPSET_EXECUTION_PHASE ChipsetPhase + ) +{ + return EFI_UNSUPPORTED; +} + +/** + Get PlatformPolicy for VGA IO ALIAS + + @param This Protocol instance pointer. + @param PciPolicy PCI Platform Policy. + + @retval EFI_SUCCESS + +**/ +EFI_STATUS +EFIAPI +GetPlatformPolicy ( + IN CONST EFI_PCI_PLATFORM_PROTOCOL *This, + OUT EFI_PCI_PLATFORM_POLICY *PciPolicy + ) +{ + *PciPolicy |=3D EFI_RESERVE_VGA_IO_ALIAS; + return EFI_SUCCESS; +} + +/** + Return a PCI ROM image for the onboard device represented by PciHandle + + @param This Protocol instance pointer. + @param PciHandle PCI device to return the ROM image for. + @param RomImage PCI Rom Image for onboard device + @param RomSize Size of RomImage in bytes + + @retval EFI_SUCCESS - RomImage is valid + @retval EFI_NOT_FOUND - No RomImage + +**/ +EFI_STATUS +EFIAPI +GetPciRom ( + IN CONST EFI_PCI_PLATFORM_PROTOCOL *This, + IN EFI_HANDLE PciHandle, + OUT VOID **RomImage, + OUT UINTN *RomSize + ) +{ + EFI_STATUS Status; + EFI_PCI_IO_PROTOCOL *PciIo; + UINTN Segment; + UINTN Bus; + UINTN Device; + UINTN Function; + UINT16 VendorId; + UINT16 DeviceId; + UINTN TableIndex; + + Status =3D gBS->HandleProtocol ( + PciHandle, + &gEfiPciIoProtocolGuid, + (VOID **)&PciIo + ); + if (EFI_ERROR (Status)) { + return EFI_NOT_FOUND; + } + + PciIo->GetLocation (PciIo, &Segment, &Bus, &Device, &Function); + + PciIo->Pci.Read (PciIo, EfiPciIoWidthUint16, 0, 1, &VendorId); + + PciIo->Pci.Read (PciIo, EfiPciIoWidthUint16, 2, 1, &DeviceId); + + // + // Loop through table of video option rom descriptions + // + for (TableIndex =3D 0; mPciOptionRomTable[TableIndex].VendorId !=3D 0xff= ff; TableIndex++) { + // + // See if the PCI device specified by PciHandle matches at device in m= PciOptionRomTable + // + if ((VendorId !=3D mPciOptionRomTable[TableIndex].VendorId) || + (DeviceId !=3D mPciOptionRomTable[TableIndex].DeviceId)) + { + continue; + } + + Status =3D GetSectionFromAnyFv ( + &mPciOptionRomTable[TableIndex].FileName, + EFI_SECTION_RAW, + 0, + RomImage, + RomSize + ); + + if (EFI_ERROR (Status)) { + continue; + } + + return EFI_SUCCESS; + } + + return EFI_NOT_FOUND; +} + +/** + + @param ImageHandle Handle of driver image. + @param SystemTable Pointer to system table. + + @retval EFI_STATUS return status of InstallProtocolInterface. + +**/ +EFI_STATUS +EFIAPI +PciPlatformDriverEntry ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + + mImageHandle =3D ImageHandle; + + // + // Install on a new handle + // + Status =3D gBS->InstallProtocolInterface ( + &mPciPlatformHandle, + &gEfiPciPlatformProtocolGuid, + EFI_NATIVE_INTERFACE, + &mPciPlatform + ); + + return Status; +} diff --git a/Platform/AMD/VanGoghBoard/ChachaniBoardPkg/PciPlatform/PciPlat= form.h b/Platform/AMD/VanGoghBoard/ChachaniBoardPkg/PciPlatform/PciPlatform= .h new file mode 100644 index 0000000000..a0a4e01161 --- /dev/null +++ b/Platform/AMD/VanGoghBoard/ChachaniBoardPkg/PciPlatform/PciPlatform.h @@ -0,0 +1,89 @@ +/** @file + Implements PciPlatform.h + This code supports a the private implementation + of the Legacy BIOS Platform protocol + + Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+ Copyright (c) 2013-2015 Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef PCI_PLATFORM_H_ +#define PCI_PLATFORM_H_ + +#include +#include +// +// Global variables for Option ROMs +// +#define NULL_ROM_FILE_GUID \ +{ 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0= x00 }} + +#define ONBOARD_SPH_VIDEO_OPTION_ROM_FILE_GUID \ +{ 0xE7D31EB4, 0x90F3, 0x4A14, {0x8A, 0x28, 0x48, 0xD0, 0x47, 0x42, 0xF8, 0= xE1 }} + +typedef struct { + EFI_GUID FileName; + UINT16 VendorId; + UINT16 DeviceId; +} PCI_OPTION_ROM_TABLE; + +EFI_STATUS +EFIAPI +PhaseNotify ( + IN EFI_PCI_PLATFORM_PROTOCOL *This, + IN EFI_HANDLE HostBridge, + IN EFI_PCI_HOST_BRIDGE_RESOURCE_ALLOCATION_PHASE Phase, + IN EFI_PCI_CHIPSET_EXECUTION_PHASE ChipsetPhase + ); + +EFI_STATUS +EFIAPI +PlatformPrepController ( + IN EFI_PCI_PLATFORM_PROTOCOL *This, + IN EFI_HANDLE HostBridge, + IN EFI_HANDLE RootBridge, + IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS PciAddress, + IN EFI_PCI_CONTROLLER_RESOURCE_ALLOCATION_PHASE Phase, + IN EFI_PCI_CHIPSET_EXECUTION_PHASE ChipsetPhase + ); + +/** + Get PlatformPolicy for VGA IO ALIAS + + @param This Protocol instance pointer. + @param PciPolicy PCI Platform Policy. + + @retval EFI_SUCCESS + +**/ +EFI_STATUS +EFIAPI +GetPlatformPolicy ( + IN CONST EFI_PCI_PLATFORM_PROTOCOL *This, + OUT EFI_PCI_PLATFORM_POLICY *PciPolicy + ); + +/** + Return a PCI ROM image for the onboard device represented by PciHandle + + @param This Protocol instance pointer. + @param PciHandle PCI device to return the ROM image for. + @param RomImage PCI Rom Image for onboard device + @param RomSize Size of RomImage in bytes + + @retval EFI_SUCCESS - RomImage is valid + @retval EFI_NOT_FOUND - No RomImage + +**/ +EFI_STATUS +EFIAPI +GetPciRom ( + IN CONST EFI_PCI_PLATFORM_PROTOCOL *This, + IN EFI_HANDLE PciHandle, + OUT VOID **RomImage, + OUT UINTN *RomSize + ); + +#endif diff --git a/Platform/AMD/VanGoghBoard/ChachaniBoardPkg/PciPlatform/PciPlat= form.inf b/Platform/AMD/VanGoghBoard/ChachaniBoardPkg/PciPlatform/PciPlatfo= rm.inf new file mode 100644 index 0000000000..16028400ce --- /dev/null +++ b/Platform/AMD/VanGoghBoard/ChachaniBoardPkg/PciPlatform/PciPlatform.inf @@ -0,0 +1,51 @@ +## @file +# PCI Platform INF file +# This driver installs pciplatform protocol to provide access interfaces t= o the onboard pci roms. +# +# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
+# Copyright (c) 2013-2015 Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D PciPlatform + FILE_GUID =3D E78AE2BF-D5E8-4846-9B0A-2D54AEC3BAF9 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D PciPlatformDriverEntry + +# +# The following information is for reference only and not required by the = build tools. +# +# VALID_ARCHITECTURES =3D IA32 X64 IPF EBC +# + +[Sources] + PciPlatform.c + PciPlatform.h + CommonHeader.h + +[Packages] + MdePkg/MdePkg.dec + +[LibraryClasses] + PciLib + PcdLib + DebugLib + UefiRuntimeServicesTableLib + UefiBootServicesTableLib + UefiDriverEntryPoint + DxeServicesLib + +[Guids] + +[Protocols] + gEfiPciIoProtocolGuid # PROTOCOL ALWAYS_CONSUMED + gEfiPciPlatformProtocolGuid # PROTOCOL ALWAYS_PRODUCED + +[Pcd] + +[Depex] + TRUE -- 2.31.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 (#114500): https://edk2.groups.io/g/devel/message/114500 Mute This Topic: https://groups.io/mt/103971397/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-