1 /* SPDX-License-Identifier: GPL-2.0-only */
5 #include <linux/platform_device.h>
6 #include <linux/libnvdimm.h>
8 /* SCM device is unable to persist memory contents */
9 #define PAPR_PMEM_UNARMED (1ULL << (63 - 0))
10 /* SCM device failed to persist memory contents */
11 #define PAPR_PMEM_SHUTDOWN_DIRTY (1ULL << (63 - 1))
12 /* SCM device contents are not persisted from previous IPL */
13 #define PAPR_PMEM_EMPTY (1ULL << (63 - 3))
14 #define PAPR_PMEM_HEALTH_CRITICAL (1ULL << (63 - 4))
15 /* SCM device will be garded off next IPL due to failure */
16 #define PAPR_PMEM_HEALTH_FATAL (1ULL << (63 - 5))
17 /* SCM contents cannot persist due to current platform health status */
18 #define PAPR_PMEM_HEALTH_UNHEALTHY (1ULL << (63 - 6))
20 /* Bits status indicators for health bitmap indicating unarmed dimm */
21 #define PAPR_PMEM_UNARMED_MASK (PAPR_PMEM_UNARMED | \
22 PAPR_PMEM_HEALTH_UNHEALTHY)
24 #define PAPR_PMEM_SAVE_FAILED (1ULL << (63 - 10))
26 /* Bits status indicators for health bitmap indicating unflushed dimm */
27 #define PAPR_PMEM_BAD_SHUTDOWN_MASK (PAPR_PMEM_SHUTDOWN_DIRTY)
29 /* Bits status indicators for health bitmap indicating unrestored dimm */
30 #define PAPR_PMEM_BAD_RESTORE_MASK (PAPR_PMEM_EMPTY)
32 /* Bit status indicators for smart event notification */
33 #define PAPR_PMEM_SMART_EVENT_MASK (PAPR_PMEM_HEALTH_CRITICAL | \
34 PAPR_PMEM_HEALTH_FATAL | \
35 PAPR_PMEM_HEALTH_UNHEALTHY)
37 #define PAPR_PMEM_SAVE_MASK (PAPR_PMEM_SAVE_FAILED)
42 struct platform_device pdev;
43 struct device_node *dn;
44 struct list_head resources;
45 struct nvdimm_bus_descriptor bus_desc;
46 struct nvdimm_bus *bus;
47 struct ndtest_config *config;
50 dma_addr_t *label_dma;
54 struct ndtest_blk_mmio {
65 struct nvdimm *nvdimm;
66 struct ndtest_blk_mmio *mmio;
67 struct nd_region *blk_region;
70 unsigned long long flags;
71 unsigned long config_size;
77 unsigned int fail_cmd;
78 unsigned int physical_id;
79 unsigned int num_formats;
85 struct ndtest_mapping {
92 struct ndtest_region {
93 struct nd_region *region;
94 struct ndtest_mapping *mapping;
101 struct ndtest_config {
102 struct ndtest_dimm *dimms;
103 struct ndtest_region *regions;
104 unsigned int dimm_count;
105 unsigned int dimm_start;
109 #endif /* NDTEST_H */