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