xref: /openbmc/linux/drivers/nvdimm/Kconfig (revision 51bc620b)
1# SPDX-License-Identifier: GPL-2.0-only
2menuconfig LIBNVDIMM
3	tristate "NVDIMM (Non-Volatile Memory Device) Support"
4	depends on PHYS_ADDR_T_64BIT
5	depends on HAS_IOMEM
6	depends on BLK_DEV
7	help
8	  Generic support for non-volatile memory devices including
9	  ACPI-6-NFIT defined resources.  On platforms that define an
10	  NFIT, or otherwise can discover NVDIMM resources, a libnvdimm
11	  bus is registered to advertise PMEM (persistent memory)
12	  namespaces (/dev/pmemX) and BLK (sliding mmio window(s))
13	  namespaces (/dev/ndblkX.Y). A PMEM namespace refers to a
14	  memory resource that may span multiple DIMMs and support DAX
15	  (see CONFIG_DAX).  A BLK namespace refers to an NVDIMM control
16	  region which exposes an mmio register set for windowed access
17	  mode to non-volatile memory.
18
19if LIBNVDIMM
20
21config BLK_DEV_PMEM
22	tristate "PMEM: Persistent memory block device support"
23	default LIBNVDIMM
24	select DAX_DRIVER
25	select ND_BTT if BTT
26	select ND_PFN if NVDIMM_PFN
27	help
28	  Memory ranges for PMEM are described by either an NFIT
29	  (NVDIMM Firmware Interface Table, see CONFIG_NFIT_ACPI), a
30	  non-standard OEM-specific E820 memory type (type-12, see
31	  CONFIG_X86_PMEM_LEGACY), or it is manually specified by the
32	  'memmap=nn[KMG]!ss[KMG]' kernel command line (see
33	  Documentation/admin-guide/kernel-parameters.rst).  This driver converts
34	  these persistent memory ranges into block devices that are
35	  capable of DAX (direct-access) file system mappings.  See
36	  Documentation/driver-api/nvdimm/nvdimm.rst for more details.
37
38	  Say Y if you want to use an NVDIMM
39
40config ND_BLK
41	tristate "BLK: Block data window (aperture) device support"
42	default LIBNVDIMM
43	select ND_BTT if BTT
44	help
45	  Support NVDIMMs, or other devices, that implement a BLK-mode
46	  access capability.  BLK-mode access uses memory-mapped-i/o
47	  apertures to access persistent media.
48
49	  Say Y if your platform firmware emits an ACPI.NFIT table
50	  (CONFIG_ACPI_NFIT), or otherwise exposes BLK-mode
51	  capabilities.
52
53config ND_CLAIM
54	bool
55
56config ND_BTT
57	tristate
58
59config BTT
60	bool "BTT: Block Translation Table (atomic sector updates)"
61	default y if LIBNVDIMM
62	select ND_CLAIM
63	help
64	  The Block Translation Table (BTT) provides atomic sector
65	  update semantics for persistent memory devices, so that
66	  applications that rely on sector writes not being torn (a
67	  guarantee that typical disks provide) can continue to do so.
68	  The BTT manifests itself as an alternate personality for an
69	  NVDIMM namespace, i.e. a namespace can be in raw mode (pmemX,
70	  ndblkX.Y, etc...), or 'sectored' mode, (pmemXs, ndblkX.Ys,
71	  etc...).
72
73	  Select Y if unsure
74
75config ND_PFN
76	tristate
77
78config NVDIMM_PFN
79	bool "PFN: Map persistent (device) memory"
80	default LIBNVDIMM
81	depends on ZONE_DEVICE
82	select ND_CLAIM
83	help
84	  Map persistent memory, i.e. advertise it to the memory
85	  management sub-system.  By default persistent memory does
86	  not support direct I/O, RDMA, or any other usage that
87	  requires a 'struct page' to mediate an I/O request.  This
88	  driver allocates and initializes the infrastructure needed
89	  to support those use cases.
90
91	  Select Y if unsure
92
93config NVDIMM_DAX
94	bool "NVDIMM DAX: Raw access to persistent memory"
95	default LIBNVDIMM
96	depends on NVDIMM_PFN
97	help
98	  Support raw device dax access to a persistent memory
99	  namespace.  For environments that want to hard partition
100	  persistent memory, this capability provides a mechanism to
101	  sub-divide a namespace into character devices that can only be
102	  accessed via DAX (mmap(2)).
103
104	  Select Y if unsure
105
106config OF_PMEM
107	tristate "Device-tree support for persistent memory regions"
108	depends on OF
109	default LIBNVDIMM
110	help
111	  Allows regions of persistent memory to be described in the
112	  device-tree.
113
114	  Select Y if unsure.
115
116config NVDIMM_KEYS
117	def_bool y
118	depends on ENCRYPTED_KEYS
119	depends on (LIBNVDIMM=ENCRYPTED_KEYS) || LIBNVDIMM=m
120
121endif
122