aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2015-05-20 22:31:58 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-05-21 21:22:21 -0400
commit04f8e38497b02cd5596ff9af278e62cd057fff68 (patch)
tree3031dbc5a4f226e1316fd9bbfa2c88c33946038f
parent0bb346cca1899542cdad470f2416070881d54437 (diff)
ACPICA: ACPI 6.0: Add support for NFIT table.
ACPICA commit e4e17ca361373e9b81494bb4ca697a12cef3cba6 NVDIMM Firmware Interface Table. Link: https://github.com/acpica/acpica/commit/e4e17ca3 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/acpica/uthex.c4
-rw-r--r--include/acpi/actbl1.h154
-rw-r--r--include/acpi/acuuid.h64
3 files changed, 220 insertions, 2 deletions
diff --git a/drivers/acpi/acpica/uthex.c b/drivers/acpi/acpica/uthex.c
index aa448278ba28..fda8b3def81c 100644
--- a/drivers/acpi/acpica/uthex.c
+++ b/drivers/acpi/acpica/uthex.c
@@ -75,9 +75,9 @@ char acpi_ut_hex_to_ascii_char(u64 integer, u32 position)
75 75
76/******************************************************************************* 76/*******************************************************************************
77 * 77 *
78 * FUNCTION: acpi_ut_hex_char_to_value 78 * FUNCTION: acpi_ut_ascii_char_to_hex
79 * 79 *
80 * PARAMETERS: ascii_char - Hex character in Ascii 80 * PARAMETERS: hex_char - Hex character in Ascii
81 * 81 *
82 * RETURN: The binary value of the ascii/hex character 82 * RETURN: The binary value of the ascii/hex character
83 * 83 *
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index cadf21c9e9be..06b61f01ea59 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -71,6 +71,7 @@
71#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */ 71#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
72#define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */ 72#define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */
73#define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */ 73#define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */
74#define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table */
74 75
75/* 76/*
76 * All tables must be byte-packed to match the ACPI specification, since 77 * All tables must be byte-packed to match the ACPI specification, since
@@ -922,6 +923,159 @@ struct acpi_msct_proximity {
922 923
923/******************************************************************************* 924/*******************************************************************************
924 * 925 *
926 * NFIT - NVDIMM Interface Table (ACPI 6.0)
927 * Version 1
928 *
929 ******************************************************************************/
930
931struct acpi_table_nfit {
932 struct acpi_table_header header; /* Common ACPI table header */
933 u32 reserved; /* Reserved, must be zero */
934};
935
936/* Subtable header for NFIT */
937
938struct acpi_nfit_header {
939 u16 type;
940 u16 length;
941};
942
943/* Values for subtable type in struct acpi_nfit_header */
944
945enum acpi_nfit_type {
946 ACPI_NFIT_TYPE_SYSTEM_ADDRESS = 0,
947 ACPI_NFIT_TYPE_MEMORY_MAP = 1,
948 ACPI_NFIT_TYPE_INTERLEAVE = 2,
949 ACPI_NFIT_TYPE_SMBIOS = 3,
950 ACPI_NFIT_TYPE_CONTROL_REGION = 4,
951 ACPI_NFIT_TYPE_DATA_REGION = 5,
952 ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6,
953 ACPI_NFIT_TYPE_RESERVED = 7 /* 7 and greater are reserved */
954};
955
956/*
957 * NFIT Subtables
958 */
959
960/* 0: System Physical Address Range Structure */
961
962struct acpi_nfit_system_address {
963 struct acpi_nfit_header header;
964 u16 range_index;
965 u16 flags;
966 u32 reserved; /* Reseved, must be zero */
967 u32 proximity_domain;
968 u8 range_guid[16];
969 u64 address;
970 u64 length;
971 u64 memory_mapping;
972};
973
974/* Flags */
975
976#define ACPI_NFIT_ADD_ONLINE_ONLY (1) /* 00: Add/Online Operation Only */
977#define ACPI_NFIT_PROXIMITY_VALID (1<<1) /* 01: Proximity Domain Valid */
978
979/* Range Type GUIDs appear in the include/acuuid.h file */
980
981/* 1: Memory Device to System Address Range Map Structure */
982
983struct acpi_nfit_memory_map {
984 struct acpi_nfit_header header;
985 u32 device_handle;
986 u16 physical_id;
987 u16 region_id;
988 u16 range_index;
989 u16 region_index;
990 u64 region_size;
991 u64 region_offset;
992 u64 address;
993 u16 interleave_index;
994 u16 interleave_ways;
995 u16 flags;
996 u16 reserved; /* Reserved, must be zero */
997};
998
999/* Flags */
1000
1001#define ACPI_NFIT_MEM_SAVE_FAILED (1) /* 00: Last SAVE to Memory Device failed */
1002#define ACPI_NFIT_MEM_RESTORE_FAILED (1<<1) /* 01: Last RESTORE from Memory Device failed */
1003#define ACPI_NFIT_MEM_FLUSH_FAILED (1<<2) /* 02: Platform flush failed */
1004#define ACPI_NFIT_MEM_ARMED (1<<3) /* 03: Memory Device observed to be not armed */
1005#define ACPI_NFIT_MEM_HEALTH_OBSERVED (1<<4) /* 04: Memory Device observed SMART/health events */
1006#define ACPI_NFIT_MEM_HEALTH_ENABLED (1<<5) /* 05: SMART/health events enabled */
1007
1008/* 2: Interleave Structure */
1009
1010struct acpi_nfit_interleave {
1011 struct acpi_nfit_header header;
1012 u16 interleave_index;
1013 u16 reserved; /* Reserved, must be zero */
1014 u32 line_count;
1015 u32 line_size;
1016 u32 line_offset[1]; /* Variable length */
1017};
1018
1019/* 3: SMBIOS Management Information Structure */
1020
1021struct acpi_nfit_smbios {
1022 struct acpi_nfit_header header;
1023 u32 reserved; /* Reserved, must be zero */
1024 u8 data[1]; /* Variable length */
1025};
1026
1027/* 4: NVDIMM Control Region Structure */
1028
1029struct acpi_nfit_control_region {
1030 struct acpi_nfit_header header;
1031 u16 region_index;
1032 u16 vendor_id;
1033 u16 device_id;
1034 u16 revision_id;
1035 u16 subsystem_vendor_id;
1036 u16 subsystem_device_id;
1037 u16 subsystem_revision_id;
1038 u8 reserved[6]; /* Reserved, must be zero */
1039 u32 serial_number;
1040 u16 code;
1041 u16 windows;
1042 u64 window_size;
1043 u64 command_offset;
1044 u64 command_size;
1045 u64 status_offset;
1046 u64 status_size;
1047 u16 flags;
1048 u8 reserved1[6]; /* Reserved, must be zero */
1049};
1050
1051/* Flags */
1052
1053#define ACPI_NFIT_CONTROL_BUFFERED (1) /* Block Data Windows implementation is buffered */
1054
1055/* 5: NVDIMM Block Data Window Region Structure */
1056
1057struct acpi_nfit_data_region {
1058 struct acpi_nfit_header header;
1059 u16 region_index;
1060 u16 windows;
1061 u64 offset;
1062 u64 size;
1063 u64 capacity;
1064 u64 start_address;
1065};
1066
1067/* 6: Flush Hint Address Structure */
1068
1069struct acpi_nfit_flush_address {
1070 struct acpi_nfit_header header;
1071 u32 device_handle;
1072 u16 hint_count;
1073 u8 reserved[6]; /* Reserved, must be zero */
1074 u64 hint_address[1]; /* Variable length */
1075};
1076
1077/*******************************************************************************
1078 *
925 * SBST - Smart Battery Specification Table 1079 * SBST - Smart Battery Specification Table
926 * Version 1 1080 * Version 1
927 * 1081 *
diff --git a/include/acpi/acuuid.h b/include/acpi/acuuid.h
new file mode 100644
index 000000000000..4955d5ec71f1
--- /dev/null
+++ b/include/acpi/acuuid.h
@@ -0,0 +1,64 @@
1/******************************************************************************
2 *
3 * Name: acuuid.h - ACPI-related UUID/GUID definitions
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
29 *
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
42 */
43
44#ifndef __ACUUID_H__
45#define __ACUUID_H__
46
47/*
48 * Note1: UUIDs and GUIDs are defined to be identical in ACPI.
49 *
50 * Note2: This file is standalone and should remain that way.
51 */
52
53/* NFIT/NVDIMM */
54
55#define UUID_VOLATILE_MEMORY "4F940573-DAFD-E344-B16C-3F22D252E5D0"
56#define UUID_PERSISTENT_MEMORY "79D3F066-F3B4-7440-AC43-0D3318B78CDB"
57#define UUID_CONTROL_REGION "F601F792-B413-5D40-910B-299367E8234C"
58#define UUID_DATA_REGION "3005AF91-865D-0E47-A6B0-0A2DB9408249"
59#define UUID_VOLATILE_VIRTUAL_DISK "5A53AB77-FC45-4B62-5560-F7B281D1F96E"
60#define UUID_VOLATILE_VIRTUAL_CD "30BD5A3D-7541-CE87-6D64-D2ADE523C4BB"
61#define UUID_PERSISTENT_VIRTUAL_DISK "C902EA5C-074D-69D3-269F-4496FBE096F9"
62#define UUID_PERSISTENT_VIRTUAL_CD "88810108-CD42-48BB-100F-5387D53DED3D"
63
64#endif /* __AUUID_H__ */