Skip to content

Commit

Permalink
Tables: Add HMAT table definitions
Browse files Browse the repository at this point in the history
This patch adds unified HMAT table structure definitions so that ACPICA
users can develop HMAT related OS features based on the ACPICA standard
structures. Lv Zheng.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
  • Loading branch information
Lv Zheng committed Mar 7, 2017
1 parent d2aa5f3 commit 3dae756
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 0 deletions.
133 changes: 133 additions & 0 deletions source/include/actbl1.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */
#define ACPI_SIG_EINJ "EINJ" /* Error Injection table */
#define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table */
#define ACPI_SIG_HMAT "HMAT" /* Heterogeneous Memory Attributes Table */
#define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */
#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
#define ACPI_SIG_MSCT "MSCT" /* Maximum System Characteristics Table */
Expand Down Expand Up @@ -899,6 +900,138 @@ typedef struct acpi_hest_generic_data_v300
#define ACPI_HEST_GEN_VALID_TIMESTAMP (1<<2)


/*******************************************************************************
*
* HMAT - Heterogeneous Memory Attributes Table (ACPI 6.2)
* Version 1
*
******************************************************************************/

typedef struct acpi_table_hmat
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
UINT32 Reserved;

} ACPI_TABLE_HMAT;


/* Values for HMAT structure types */

enum AcpiHmatType
{
ACPI_HMAT_TYPE_ADDRESS_RANGE = 0, /* Memory subystem address range */
ACPI_HMAT_TYPE_LOCALITY = 1, /* System locality latency and bandwidth information */
ACPI_HMAT_TYPE_CACHE = 2, /* Memory side cache information */
ACPI_HMAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
};

typedef struct acpi_hmat_structure
{
UINT16 Type;
UINT16 Reserved;
UINT32 Length;

} ACPI_HMAT_STRUCTURE;


/*
* HMAT Structures, correspond to Type in ACPI_HMAT_STRUCTURE
*/

/* 0: Memory subystem address range */

typedef struct acpi_hmat_address_range
{
ACPI_HMAT_STRUCTURE Header;
UINT16 Flags;
UINT16 Reserved1;
UINT32 ProcessorPD; /* Processor proximity domain */
UINT32 MemoryPD; /* Memory proximity domain */
UINT32 Reserved2;
UINT64 PhysicalAddressBase; /* Physical address range base */
UINT64 PhysicalAddressLength; /* Physical address range length */

} ACPI_HMAT_ADDRESS_RANGE;

/* Masks for Flags field above */

#define ACPI_HMAT_PROCESSOR_PD_VALID (1) /* 1: ProcessorPD field is valid */
#define ACPI_HMAT_MEMORY_PD_VALID (1<<1) /* 1: MemoryPD field is valid */
#define ACPI_HMAT_RESERVATION_HINT (1<<2) /* 1: Reservation hint */


/* 1: System locality latency and bandwidth information */

typedef struct acpi_hmat_locality
{
ACPI_HMAT_STRUCTURE Header;
UINT8 Flags;
UINT8 DataType;
UINT16 Reserved1;
UINT32 NumberOfInitiatorPDs;
UINT32 NumberOfTargetPDs;
UINT32 Reserved2;
UINT64 EntryBaseUnit;

} ACPI_HMAT_LOCALITY;

/* Masks for Flags field above */

#define ACPI_HMAT_MEMORY_HIERARCHY (0x0F)

/* Values for Memory Hierarchy flag */

#define ACPI_HMAT_MEMORY 0
#define ACPI_HMAT_LAST_LEVEL_CACHE 1
#define ACPI_HMAT_1ST_LEVEL_CACHE 2
#define ACPI_HMAT_2ND_LEVEL_CACHE 3
#define ACPI_HMAT_3RD_LEVEL_CACHE 4

/* Values for DataType field above */

#define ACPI_HMAT_ACCESS_LATENCY 0
#define ACPI_HMAT_READ_LATENCY 1
#define ACPI_HMAT_WRITE_LATENCY 2
#define ACPI_HMAT_ACCESS_BANDWIDTH 3
#define ACPI_HMAT_READ_BANDWIDTH 4
#define ACPI_HMAT_WRITE_BANDWIDTH 5


/* 2: Memory side cache information */

typedef struct acpi_hmat_cache
{
ACPI_HMAT_STRUCTURE Header;
UINT32 MemoryPD;
UINT32 Reserved1;
UINT64 CacheSize;
UINT32 CacheAttributes;
UINT16 Reserved2;
UINT16 NumberOfSMBIOSHandles;

} ACPI_HMAT_CACHE;

/* Masks for CacheAttributes field above */

#define ACPI_HMAT_TOTAL_CACHE_LEVEL (0x0000000F)
#define ACPI_HMAT_CACHE_LEVEL (0x000000F0)
#define ACPI_HMAT_CACHE_ASSOCIATIVITY (0x00000F00)
#define ACPI_HMAT_WRITE_POLICY (0x0000F000)
#define ACPI_HMAT_CACHE_LINE_SIZE (0xFFFF0000)

/* Values for cache associativity flag */

#define ACPI_HMAT_CA_NONE (0)
#define ACPI_HMAT_CA_DIRECT_MAPPED (1)
#define ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING (2)

/* Values for write policy flag */

#define ACPI_HMAT_CP_NONE (0)
#define ACPI_HMAT_CP_WB (1)
#define ACPI_HMAT_CP_WT (2)


/*******************************************************************************
*
* MADT - Multiple APIC Description Table
Expand Down
4 changes: 4 additions & 0 deletions source/tools/acpisrc/astable.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,6 +633,7 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
{"ACPI_TABLE_FPDT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_GTDT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_HEST", SRC_TYPE_STRUCT},
{"ACPI_TABLE_HMAT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_HPET", SRC_TYPE_STRUCT},
{"ACPI_TABLE_IBFT", SRC_TYPE_STRUCT},
{"ACPI_TABLE_IORT", SRC_TYPE_STRUCT},
Expand Down Expand Up @@ -719,6 +720,9 @@ ACPI_TYPED_IDENTIFIER_TABLE AcpiIdentifiers[] = {
{"ACPI_HEST_GENERIC_STATUS", SRC_TYPE_STRUCT},
{"ACPI_HEST_GENERIC_DATA", SRC_TYPE_STRUCT},
{"ACPI_HEST_GENERIC_DATA_V300", SRC_TYPE_STRUCT},
{"ACPI_HMAT_ADDRESS_RANGE", SRC_TYPE_STRUCT},
{"ACPI_HMAT_LOCALITY", SRC_TYPE_STRUCT},
{"ACPI_HMAT_CACHE", SRC_TYPE_STRUCT},
{"ACPI_IBFT_HEADER", SRC_TYPE_STRUCT},
{"ACPI_IBFT_CONTROL", SRC_TYPE_STRUCT},
{"ACPI_IBFT_INITIATOR", SRC_TYPE_STRUCT},
Expand Down

0 comments on commit 3dae756

Please sign in to comment.