aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2016-07-15 14:27:03 -0400
committerDan Williams <dan.j.williams@intel.com>2016-07-21 17:12:18 -0400
commit5dc68e5574880c1ad4a2591b765c093fee24dcaa (patch)
treebae9dca9eece6eb02181dd541d91df2f250e9839 /tools
parent7bfe97c763fe7cb214f687e0f4d384b6908fec48 (diff)
tools/testing/nvdimm: add manufacturing_{date|location} dimm properties
New for ACPI 6.1, these fields are used in the common dimm representation format defined by section 5.2.25.9 "NVDIMM representation format". Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/testing/nvdimm/test/nfit.c54
1 files changed, 21 insertions, 33 deletions
diff --git a/tools/testing/nvdimm/test/nfit.c b/tools/testing/nvdimm/test/nfit.c
index 2b9e8a59d45b..f458ba906f13 100644
--- a/tools/testing/nvdimm/test/nfit.c
+++ b/tools/testing/nvdimm/test/nfit.c
@@ -639,6 +639,16 @@ static int nfit_test1_alloc(struct nfit_test *t)
639 return ars_state_init(&t->pdev.dev, &t->ars_state); 639 return ars_state_init(&t->pdev.dev, &t->ars_state);
640} 640}
641 641
642static void dcr_common_init(struct acpi_nfit_control_region *dcr)
643{
644 dcr->vendor_id = 0xabcd;
645 dcr->device_id = 0;
646 dcr->revision_id = 1;
647 dcr->valid_fields = 1;
648 dcr->manufacturing_location = 0xa;
649 dcr->manufacturing_date = cpu_to_be16(2016);
650}
651
642static void nfit_test0_setup(struct nfit_test *t) 652static void nfit_test0_setup(struct nfit_test *t)
643{ 653{
644 const int flush_hint_size = sizeof(struct acpi_nfit_flush_address) 654 const int flush_hint_size = sizeof(struct acpi_nfit_flush_address)
@@ -967,9 +977,7 @@ static void nfit_test0_setup(struct nfit_test *t)
967 dcr->header.type = ACPI_NFIT_TYPE_CONTROL_REGION; 977 dcr->header.type = ACPI_NFIT_TYPE_CONTROL_REGION;
968 dcr->header.length = sizeof(struct acpi_nfit_control_region); 978 dcr->header.length = sizeof(struct acpi_nfit_control_region);
969 dcr->region_index = 0+1; 979 dcr->region_index = 0+1;
970 dcr->vendor_id = 0xabcd; 980 dcr_common_init(dcr);
971 dcr->device_id = 0;
972 dcr->revision_id = 1;
973 dcr->serial_number = ~handle[0]; 981 dcr->serial_number = ~handle[0];
974 dcr->code = NFIT_FIC_BLK; 982 dcr->code = NFIT_FIC_BLK;
975 dcr->windows = 1; 983 dcr->windows = 1;
@@ -984,9 +992,7 @@ static void nfit_test0_setup(struct nfit_test *t)
984 dcr->header.type = ACPI_NFIT_TYPE_CONTROL_REGION; 992 dcr->header.type = ACPI_NFIT_TYPE_CONTROL_REGION;
985 dcr->header.length = sizeof(struct acpi_nfit_control_region); 993 dcr->header.length = sizeof(struct acpi_nfit_control_region);
986 dcr->region_index = 1+1; 994 dcr->region_index = 1+1;
987 dcr->vendor_id = 0xabcd; 995 dcr_common_init(dcr);
988 dcr->device_id = 0;
989 dcr->revision_id = 1;
990 dcr->serial_number = ~handle[1]; 996 dcr->serial_number = ~handle[1];
991 dcr->code = NFIT_FIC_BLK; 997 dcr->code = NFIT_FIC_BLK;
992 dcr->windows = 1; 998 dcr->windows = 1;
@@ -1001,9 +1007,7 @@ static void nfit_test0_setup(struct nfit_test *t)
1001 dcr->header.type = ACPI_NFIT_TYPE_CONTROL_REGION; 1007 dcr->header.type = ACPI_NFIT_TYPE_CONTROL_REGION;
1002 dcr->header.length = sizeof(struct acpi_nfit_control_region); 1008 dcr->header.length = sizeof(struct acpi_nfit_control_region);
1003 dcr->region_index = 2+1; 1009 dcr->region_index = 2+1;
1004 dcr->vendor_id = 0xabcd; 1010 dcr_common_init(dcr);
1005 dcr->device_id = 0;
1006 dcr->revision_id = 1;
1007 dcr->serial_number = ~handle[2]; 1011 dcr->serial_number = ~handle[2];
1008 dcr->code = NFIT_FIC_BLK; 1012 dcr->code = NFIT_FIC_BLK;
1009 dcr->windows = 1; 1013 dcr->windows = 1;
@@ -1018,9 +1022,7 @@ static void nfit_test0_setup(struct nfit_test *t)
1018 dcr->header.type = ACPI_NFIT_TYPE_CONTROL_REGION; 1022 dcr->header.type = ACPI_NFIT_TYPE_CONTROL_REGION;
1019 dcr->header.length = sizeof(struct acpi_nfit_control_region); 1023 dcr->header.length = sizeof(struct acpi_nfit_control_region);
1020 dcr->region_index = 3+1; 1024 dcr->region_index = 3+1;
1021 dcr->vendor_id = 0xabcd; 1025 dcr_common_init(dcr);
1022 dcr->device_id = 0;
1023 dcr->revision_id = 1;
1024 dcr->serial_number = ~handle[3]; 1026 dcr->serial_number = ~handle[3];
1025 dcr->code = NFIT_FIC_BLK; 1027 dcr->code = NFIT_FIC_BLK;
1026 dcr->windows = 1; 1028 dcr->windows = 1;
@@ -1037,9 +1039,7 @@ static void nfit_test0_setup(struct nfit_test *t)
1037 dcr->header.length = offsetof(struct acpi_nfit_control_region, 1039 dcr->header.length = offsetof(struct acpi_nfit_control_region,
1038 window_size); 1040 window_size);
1039 dcr->region_index = 4+1; 1041 dcr->region_index = 4+1;
1040 dcr->vendor_id = 0xabcd; 1042 dcr_common_init(dcr);
1041 dcr->device_id = 0;
1042 dcr->revision_id = 1;
1043 dcr->serial_number = ~handle[0]; 1043 dcr->serial_number = ~handle[0];
1044 dcr->code = NFIT_FIC_BYTEN; 1044 dcr->code = NFIT_FIC_BYTEN;
1045 dcr->windows = 0; 1045 dcr->windows = 0;
@@ -1051,9 +1051,7 @@ static void nfit_test0_setup(struct nfit_test *t)
1051 dcr->header.length = offsetof(struct acpi_nfit_control_region, 1051 dcr->header.length = offsetof(struct acpi_nfit_control_region,
1052 window_size); 1052 window_size);
1053 dcr->region_index = 5+1; 1053 dcr->region_index = 5+1;
1054 dcr->vendor_id = 0xabcd; 1054 dcr_common_init(dcr);
1055 dcr->device_id = 0;
1056 dcr->revision_id = 1;
1057 dcr->serial_number = ~handle[1]; 1055 dcr->serial_number = ~handle[1];
1058 dcr->code = NFIT_FIC_BYTEN; 1056 dcr->code = NFIT_FIC_BYTEN;
1059 dcr->windows = 0; 1057 dcr->windows = 0;
@@ -1065,9 +1063,7 @@ static void nfit_test0_setup(struct nfit_test *t)
1065 dcr->header.length = offsetof(struct acpi_nfit_control_region, 1063 dcr->header.length = offsetof(struct acpi_nfit_control_region,
1066 window_size); 1064 window_size);
1067 dcr->region_index = 6+1; 1065 dcr->region_index = 6+1;
1068 dcr->vendor_id = 0xabcd; 1066 dcr_common_init(dcr);
1069 dcr->device_id = 0;
1070 dcr->revision_id = 1;
1071 dcr->serial_number = ~handle[2]; 1067 dcr->serial_number = ~handle[2];
1072 dcr->code = NFIT_FIC_BYTEN; 1068 dcr->code = NFIT_FIC_BYTEN;
1073 dcr->windows = 0; 1069 dcr->windows = 0;
@@ -1079,9 +1075,7 @@ static void nfit_test0_setup(struct nfit_test *t)
1079 dcr->header.length = offsetof(struct acpi_nfit_control_region, 1075 dcr->header.length = offsetof(struct acpi_nfit_control_region,
1080 window_size); 1076 window_size);
1081 dcr->region_index = 7+1; 1077 dcr->region_index = 7+1;
1082 dcr->vendor_id = 0xabcd; 1078 dcr_common_init(dcr);
1083 dcr->device_id = 0;
1084 dcr->revision_id = 1;
1085 dcr->serial_number = ~handle[3]; 1079 dcr->serial_number = ~handle[3];
1086 dcr->code = NFIT_FIC_BYTEN; 1080 dcr->code = NFIT_FIC_BYTEN;
1087 dcr->windows = 0; 1081 dcr->windows = 0;
@@ -1176,9 +1170,7 @@ static void nfit_test0_setup(struct nfit_test *t)
1176 dcr->header.type = ACPI_NFIT_TYPE_CONTROL_REGION; 1170 dcr->header.type = ACPI_NFIT_TYPE_CONTROL_REGION;
1177 dcr->header.length = sizeof(struct acpi_nfit_control_region); 1171 dcr->header.length = sizeof(struct acpi_nfit_control_region);
1178 dcr->region_index = 8+1; 1172 dcr->region_index = 8+1;
1179 dcr->vendor_id = 0xabcd; 1173 dcr_common_init(dcr);
1180 dcr->device_id = 0;
1181 dcr->revision_id = 1;
1182 dcr->serial_number = ~handle[4]; 1174 dcr->serial_number = ~handle[4];
1183 dcr->code = NFIT_FIC_BLK; 1175 dcr->code = NFIT_FIC_BLK;
1184 dcr->windows = 1; 1176 dcr->windows = 1;
@@ -1195,9 +1187,7 @@ static void nfit_test0_setup(struct nfit_test *t)
1195 dcr->header.length = offsetof(struct acpi_nfit_control_region, 1187 dcr->header.length = offsetof(struct acpi_nfit_control_region,
1196 window_size); 1188 window_size);
1197 dcr->region_index = 9+1; 1189 dcr->region_index = 9+1;
1198 dcr->vendor_id = 0xabcd; 1190 dcr_common_init(dcr);
1199 dcr->device_id = 0;
1200 dcr->revision_id = 1;
1201 dcr->serial_number = ~handle[4]; 1191 dcr->serial_number = ~handle[4];
1202 dcr->code = NFIT_FIC_BYTEN; 1192 dcr->code = NFIT_FIC_BYTEN;
1203 dcr->windows = 0; 1193 dcr->windows = 0;
@@ -1375,9 +1365,7 @@ static void nfit_test1_setup(struct nfit_test *t)
1375 dcr->header.length = offsetof(struct acpi_nfit_control_region, 1365 dcr->header.length = offsetof(struct acpi_nfit_control_region,
1376 window_size); 1366 window_size);
1377 dcr->region_index = 0+1; 1367 dcr->region_index = 0+1;
1378 dcr->vendor_id = 0xabcd; 1368 dcr_common_init(dcr);
1379 dcr->device_id = 0;
1380 dcr->revision_id = 1;
1381 dcr->serial_number = ~0; 1369 dcr->serial_number = ~0;
1382 dcr->code = NFIT_FIC_BYTE; 1370 dcr->code = NFIT_FIC_BYTE;
1383 dcr->windows = 0; 1371 dcr->windows = 0;