libnvdimm, nfit: initial libnvdimm infrastructure and NFIT support
[deliverable/linux.git] / drivers / acpi / nfit.h
1 /*
2 * NVDIMM Firmware Interface Table - NFIT
3 *
4 * Copyright(c) 2013-2015 Intel Corporation. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of version 2 of the GNU General Public License as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 */
15 #ifndef __NFIT_H__
16 #define __NFIT_H__
17 #include <linux/libnvdimm.h>
18 #include <linux/types.h>
19 #include <linux/uuid.h>
20 #include <linux/acpi.h>
21 #include <acpi/acuuid.h>
22
23 #define UUID_NFIT_BUS "2f10e7a4-9e91-11e4-89d3-123b93f75cba"
24 #define UUID_NFIT_DIMM "4309ac30-0d11-11e4-9191-0800200c9a66"
25
26 enum nfit_uuids {
27 NFIT_SPA_VOLATILE,
28 NFIT_SPA_PM,
29 NFIT_SPA_DCR,
30 NFIT_SPA_BDW,
31 NFIT_SPA_VDISK,
32 NFIT_SPA_VCD,
33 NFIT_SPA_PDISK,
34 NFIT_SPA_PCD,
35 NFIT_DEV_BUS,
36 NFIT_DEV_DIMM,
37 NFIT_UUID_MAX,
38 };
39
40 struct nfit_spa {
41 struct acpi_nfit_system_address *spa;
42 struct list_head list;
43 };
44
45 struct nfit_dcr {
46 struct acpi_nfit_control_region *dcr;
47 struct list_head list;
48 };
49
50 struct nfit_bdw {
51 struct acpi_nfit_data_region *bdw;
52 struct list_head list;
53 };
54
55 struct nfit_memdev {
56 struct acpi_nfit_memory_map *memdev;
57 struct list_head list;
58 };
59
60 /* assembled tables for a given dimm/memory-device */
61 struct nfit_mem {
62 struct acpi_nfit_memory_map *memdev_dcr;
63 struct acpi_nfit_memory_map *memdev_pmem;
64 struct acpi_nfit_control_region *dcr;
65 struct acpi_nfit_data_region *bdw;
66 struct acpi_nfit_system_address *spa_dcr;
67 struct acpi_nfit_system_address *spa_bdw;
68 struct list_head list;
69 };
70
71 struct acpi_nfit_desc {
72 struct nvdimm_bus_descriptor nd_desc;
73 struct acpi_table_nfit *nfit;
74 struct list_head memdevs;
75 struct list_head dimms;
76 struct list_head spas;
77 struct list_head dcrs;
78 struct list_head bdws;
79 struct nvdimm_bus *nvdimm_bus;
80 struct device *dev;
81 };
82
83 static inline struct acpi_nfit_memory_map *__to_nfit_memdev(
84 struct nfit_mem *nfit_mem)
85 {
86 if (nfit_mem->memdev_dcr)
87 return nfit_mem->memdev_dcr;
88 return nfit_mem->memdev_pmem;
89 }
90 #endif /* __NFIT_H__ */
This page took 0.034415 seconds and 5 git commands to generate.