[PATCH 1/3] lib: acpi: add support for PMTT

Alex Hung alex.hung at canonical.com
Fri Aug 5 12:07:46 UTC 2016


Signed-off-by: Alex Hung <alex.hung at canonical.com>
---
 src/lib/include/fwts_acpi.h | 53 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/src/lib/include/fwts_acpi.h b/src/lib/include/fwts_acpi.h
index 4a4e699..fed8dc2 100644
--- a/src/lib/include/fwts_acpi.h
+++ b/src/lib/include/fwts_acpi.h
@@ -1040,6 +1040,59 @@ typedef struct {
 } __attribute__ ((packed)) fwts_acpi_table_mpst_power_char_list;
 
 /*
+ * ACPI PMTT (Memory Topology Table, 5.2.21.12
+ */
+typedef struct {
+	fwts_acpi_table_header	header;
+	uint32_t	reserved;
+} __attribute__ ((packed)) fwts_acpi_table_pmtt;
+
+typedef struct {
+	uint8_t		type;
+	uint8_t		reserved1;
+	uint16_t	length;
+	uint16_t	flags;
+	uint16_t	reserved2;
+} __attribute__ ((packed)) fwts_acpi_table_pmtt_header;
+
+typedef enum {
+	FWTS_ACPI_PMTT_TYPE_SOCKET		= 0,
+	FWTS_ACPI_PMTT_TYPE_CONTROLLER		= 1,
+	FWTS_ACPI_PMTT_TYPE_DIMM		= 2,
+	FWTS_ACPI_PMTT_TYPE_RESERVED		= 3 /* 0x03-0xFF are reserved */
+} fwts_acpi_pmtt_type;
+
+typedef struct {
+	fwts_acpi_table_pmtt_header	header;
+	uint16_t	socket_id;
+	uint16_t	reserved;
+} __attribute__ ((packed)) fwts_acpi_table_pmtt_socket;
+
+typedef struct {
+	fwts_acpi_table_pmtt_header	header;
+	uint32_t	read_latency;
+	uint32_t	write_latency;
+	uint32_t	read_bandwidth;
+	uint32_t	write_bandwidth;
+	uint16_t	access_width;
+	uint16_t	alignment;
+	uint16_t	reserved;
+	uint16_t	domain_count;
+} __attribute__ ((packed)) fwts_acpi_table_pmtt_controller;
+
+typedef struct {
+	uint32_t	proximity_domain;
+} __attribute__ ((packed)) fwts_acpi_table_pmtt_domain;
+
+typedef struct {
+	fwts_acpi_table_pmtt_header	header;
+	uint16_t	component_id;
+	uint16_t	reserved;
+	uint32_t	memory_size;
+	uint32_t	bios_handle;
+} __attribute__ ((packed)) fwts_acpi_table_pmtt_physical_component;
+
+/*
  * ACPI NFIT (NVDIMM Firmware Interface), 5.2.25
  */
 typedef struct {
-- 
2.7.4




More information about the fwts-devel mailing list