Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

Commit

Permalink
WhitleyOpenBoardPkg: Add definitions needed for AcpiPlatform driver
Browse files Browse the repository at this point in the history
Adds various definitions needed to move the AcpiPlatform driver from
FvLateOpenBoard binary to open source.

Cc: Nate DeSimone <[email protected]>
Cc: Chasel Chiu <[email protected]>
Signed-off-by: Isaac Oram <[email protected]>
Reviewed-by: Nate DeSimone <[email protected]>
  • Loading branch information
iworam committed Mar 11, 2022
1 parent 3c40bdd commit e04fc0b
Show file tree
Hide file tree
Showing 12 changed files with 1,597 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
WhitleySiliconPkg/CpRcPkg.dec
WhitleySiliconPkg/Cpu/CpuRcPkg.dec
WhitleyOpenBoardPkg/PlatformPkg.dec
UefiCpuPkg/UefiCpuPkg.dec

[LibraryClasses]
UefiDriverEntryPoint
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
WhitleySiliconPkg/CpRcPkg.dec
WhitleySiliconPkg/Cpu/CpuRcPkg.dec
WhitleyOpenBoardPkg/PlatformPkg.dec
UefiCpuPkg/UefiCpuPkg.dec

[LibraryClasses]
UefiDriverEntryPoint
Expand Down
118 changes: 118 additions & 0 deletions Platform/Intel/WhitleyOpenBoardPkg/Include/Acpi/Madt.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
/** @file
This file describes the contents of the ACPI Multiple APIC Description
Table (MADT). Some additional ACPI values are defined in Acpi1_0.h and
Acpi2_0.h.
To make changes to the MADT, it is necessary to update the count for the
APIC structure being updated, and to modify table found in Madt.c.
@copyright
Copyright 1996 - 2014 Intel Corporation. <BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#ifndef _MADT_H
#define _MADT_H

//
// Statements that include other files
//
#include <IndustryStandard/Acpi.h>
#include "Platform.h"

//
// MADT Definitions
//
#define EFI_ACPI_OEM_MADT_REVISION 0x00000000
//
// Multiple APIC Flags are defined in AcpiX.0.h
//
#define EFI_ACPI_6_2_MULTIPLE_APIC_FLAGS (EFI_ACPI_6_2_PCAT_COMPAT)

//
// Local APIC address
//
#define EFI_ACPI_LOCAL_APIC_ADDRESS 0xFEE00000
//
// Define the number of each table type.
// This is where the table layout is modified.
//
#define EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT MAX_CPU_NUM
#define EFI_ACPI_LOCAL_APIC_NMI_COUNT MAX_CPU_NUM
#define EFI_ACPI_PROCESSOR_LOCAL_X2APIC_COUNT MAX_CPU_NUM
#define EFI_ACPI_LOCAL_X2APIC_NMI_COUNT MAX_CPU_NUM
#define EFI_ACPI_IO_APIC_COUNT 32 + 1 // IIO I/O APIC (PCH) + I/O APIC (PC00-PC31)
#define EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT 2
#define EFI_ACPI_NON_MASKABLE_INTERRUPT_SOURCE_COUNT 0
#define EFI_ACPI_LOCAL_APIC_ADDRESS_OVERRIDE_COUNT 0
#define EFI_ACPI_IO_SAPIC_COUNT 0
#define EFI_ACPI_PROCESSOR_LOCAL_SAPIC_COUNT 0
#define EFI_ACPI_PLATFORM_INTERRUPT_SOURCES_COUNT 0

//
// MADT structure
//
//
// Ensure proper structure formats
//
#pragma pack(1)
//
// ACPI 4.0 Table structure
//
typedef struct {
EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER Header;

#if EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT > 0 // Type 0x00
EFI_ACPI_6_2_PROCESSOR_LOCAL_APIC_STRUCTURE LocalApic[EFI_ACPI_PROCESSOR_LOCAL_APIC_COUNT];
#endif

#if EFI_ACPI_IO_APIC_COUNT > 0 // Type 0x01
EFI_ACPI_6_2_IO_APIC_STRUCTURE IoApic[EFI_ACPI_IO_APIC_COUNT];
#endif

#if EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT > 0 // Type 0x02
EFI_ACPI_6_2_INTERRUPT_SOURCE_OVERRIDE_STRUCTURE Iso[EFI_ACPI_INTERRUPT_SOURCE_OVERRIDE_COUNT];
#endif

#if EFI_ACPI_NON_MASKABLE_INTERRUPT_SOURCE_COUNT > 0 // Type 0x03
EFI_ACPI_6_2_NON_MASKABLE_INTERRUPT_SOURCE_STRUCTURE NmiSource[EFI_ACPI_NON_MASKABLE_INTERRUPT_SOURCE_COUNT];
#endif

#if EFI_ACPI_LOCAL_APIC_NMI_COUNT > 0 // Type 0x04
EFI_ACPI_6_2_LOCAL_APIC_NMI_STRUCTURE LocalApicNmi;
#endif

#if EFI_ACPI_LOCAL_APIC_ADDRESS_OVERRIDE_COUNT > 0 // Type 0x05
EFI_ACPI_6_2_LOCAL_APIC_ADDRESS_OVERRIDE_STRUCTURE LocalApicOverride[EFI_ACPI_LOCAL_APIC_OVERRIDE_COUNT];
#endif

#if EFI_ACPI_IO_SAPIC_COUNT > 0 // Type 0x06
EFI_ACPI_6_2_IO_SAPIC_STRUCTURE IoSapic[EFI_ACPI_IO_SAPIC_COUNT];
#endif

#if EFI_ACPI_PROCESSOR_LOCAL_SAPIC_COUNT > 0 // Type 0x07 : This table changes in madt 2.0
EFI_ACPI_6_2_PROCESSOR_LOCAL_SAPIC_STRUCTURE LocalSapic[EFI_ACPI_PROCESSOR_LOCAL_SAPIC_COUNT];
#endif

#if EFI_ACPI_PLATFORM_INTERRUPT_SOURCES_COUNT > 0 // Type 0x08
EFI_ACPI_6_2_PLATFORM_INTERRUPT_SOURCES_STRUCTURE PlatformInterruptSources[
EFI_ACPI_PLATFORM_INTERRUPT_SOURCES_COUNT];
#endif

#if EFI_ACPI_PROCESSOR_LOCAL_X2APIC_COUNT > 0 //Type 0x09
EFI_ACPI_6_2_PROCESSOR_LOCAL_X2APIC_STRUCTURE LocalX2Apic[EFI_ACPI_PROCESSOR_LOCAL_X2APIC_COUNT];
#endif

#if EFI_ACPI_LOCAL_X2APIC_NMI_COUNT > 0 //Type 0x0A
EFI_ACPI_6_2_LOCAL_X2APIC_NMI_STRUCTURE X2ApicNmi;
#endif


} EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE;




#pragma pack()

#endif
75 changes: 75 additions & 0 deletions Platform/Intel/WhitleyOpenBoardPkg/Include/Acpi/Slit.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/** @file
This file describes the contents of the ACPI System Locality Information
Table (SLIT). Some additional ACPI 3.0 values are defined in Acpi3_0.h.
All changes to the Slit contents should be done in this file.
@copyright
Copyright 1999 - 2019 Intel Corporation. <BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#ifndef _SLIT_H_
#define _SLIT_H_

#include "MaxSocket.h"

//
// SLIT Definitions, see TBD specification for details.
//

#define EFI_ACPI_OEM_SLIT_REVISION 0x00000001
//
// SLIT Revision (defined in spec)
//
#define EFI_ACPI_SLIT_PMEM_NODES_SOCKET_MAX_CNT 8 // Max number of PMEM nodes per socket
#define EFI_ACPI_SLIT_NODES_SOCKET_MAX_CNT 4 // Max number of SNC nodes
#define EFI_ACPI_SLIT_DOMAINS_NODES_MAX_CNT 2 // Max number of Domins per SNC node (1LM domain and 2LM domain)

#define EFI_ACPI_SLIT_NODES_MAX_CNT \
(MAX_SOCKET * ((EFI_ACPI_SLIT_NODES_SOCKET_MAX_CNT * EFI_ACPI_SLIT_DOMAINS_NODES_MAX_CNT) \
+ EFI_ACPI_SLIT_PMEM_NODES_SOCKET_MAX_CNT))

#define EFI_ACPI_SYSTEM_LOCALITIES_ENTRY_COUNT \
(EFI_ACPI_SLIT_NODES_MAX_CNT * EFI_ACPI_SLIT_NODES_MAX_CNT)

#define EFI_ACPI_SLIT_PMEM_INFO_CNT \
(MAX_SOCKET * EFI_ACPI_SLIT_PMEM_NODES_SOCKET_MAX_CNT)

#define PMEM_INVALID_SOCKET 0xFF

#define PMEM_ZERO_HOP 10
#define PMEM_ONE_ONE 17
#define PMEM_ONE_HOP 28
#define PMEM_TWO_HOP 38

#define ZERO_HOP 10
#define ZERO_ONE 11
#define ZERO_TWO 12
#define ZERO_THREE 13
#define ONE_HOP 20
#define ONE_ONE 21
#define ONE_TWO 22
#define TWO_HOP 30
#define THREE_HOP 40
#define DISTANT_NODE_4S_EP 2
#define DISTANT_NODE_4S_EP_COD (DISTANT_NODE_4S_EP * 2)

typedef struct {
UINT8 Socket;
UINT8 Pmem;
UINT8 Valid;
} EFI_ACPI_SYSTEM_LOCALITY_INFORMATION_TABLE_PMEM_INFO;

typedef struct {
UINT8 Entry;
} ACPI_SYSTEM_LOCALITIES_STRUCTURE;

typedef struct {
EFI_ACPI_6_2_SYSTEM_LOCALITY_DISTANCE_INFORMATION_TABLE_HEADER Header;
ACPI_SYSTEM_LOCALITIES_STRUCTURE NumSlit[0];

} ACPI_SYSTEM_LOCALITY_INFORMATION_TABLE;


#endif
53 changes: 53 additions & 0 deletions Platform/Intel/WhitleyOpenBoardPkg/Include/Acpi/Srat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/** @file
ACPI Static resource definition table implementation, defined at
http://microsoft.com/hwdev/design/srat.htm.
@copyright
Copyright 1999 - 2019 Intel Corporation. <BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#ifndef _SRAT_H_
#define _SRAT_H_

//
// Statements that include other files
//
#include <IndustryStandard/Acpi.h>

//
#define EFI_ACPI_OEM_SRAT_REVISION 0x00000002 //

//
// TBD :Backward Compatibility per ACPI 3.0. Required by Hyper-V. OS's ok so far as of 5/27/09
//
#define EFI_ACPI_SRAT_RESERVED_FOR_BACKWARD_COMPATIBILITY 0x00000001
//
// Define the number of each table type.
// This is where the table layout is modified.
//
#define PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE_COUNT MAX_CPU_NUM
#define MEMORY_AFFINITY_STRUCTURE_COUNT MC_MAX_NODE*MAX_CRS_ENTRIES_PER_NODE
#define X2APIC_AFFINITY_STRUCTURE_COUNT MAX_CPU_NUM
//
// Statis Resource Affinity Table header definition. The table
// must be defined in a platform specific manner.
//
//
// Ensure proper structure formats
//
#pragma pack(1)

typedef struct {
EFI_ACPI_6_2_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER *SratHeader;

EFI_ACPI_6_2_PROCESSOR_LOCAL_APIC_SAPIC_AFFINITY_STRUCTURE *Apic;
EFI_ACPI_6_2_MEMORY_AFFINITY_STRUCTURE *Memory;
EFI_ACPI_6_2_PROCESSOR_LOCAL_X2APIC_AFFINITY_STRUCTURE *x2Apic;

} STATIC_RESOURCE_AFFINITY_TABLE;

#pragma pack()

#endif
Loading

0 comments on commit e04fc0b

Please sign in to comment.