xref: /linux/drivers/nvdimm/Kconfig (revision 33dd70752cd76f4d883a165a674f13121a4155ed)
1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only
218da2c9eSDan Williamsmenuconfig LIBNVDIMM
3b94d5230SDan Williams	tristate "NVDIMM (Non-Volatile Memory Device) Support"
4b94d5230SDan Williams	depends on PHYS_ADDR_T_64BIT
529b9aa0aSDan Williams	depends on HAS_IOMEM
6b94d5230SDan Williams	depends on BLK_DEV
7*33dd7075SDan Williams	select MEMREGION
8b94d5230SDan Williams	help
9b94d5230SDan Williams	  Generic support for non-volatile memory devices including
10b94d5230SDan Williams	  ACPI-6-NFIT defined resources.  On platforms that define an
11b94d5230SDan Williams	  NFIT, or otherwise can discover NVDIMM resources, a libnvdimm
12b94d5230SDan Williams	  bus is registered to advertise PMEM (persistent memory)
13b94d5230SDan Williams	  namespaces (/dev/pmemX) and BLK (sliding mmio window(s))
145212e11fSVishal Verma	  namespaces (/dev/ndblkX.Y). A PMEM namespace refers to a
155212e11fSVishal Verma	  memory resource that may span multiple DIMMs and support DAX
165212e11fSVishal Verma	  (see CONFIG_DAX).  A BLK namespace refers to an NVDIMM control
175212e11fSVishal Verma	  region which exposes an mmio register set for windowed access
185212e11fSVishal Verma	  mode to non-volatile memory.
1918da2c9eSDan Williams
2018da2c9eSDan Williamsif LIBNVDIMM
2118da2c9eSDan Williams
2218da2c9eSDan Williamsconfig BLK_DEV_PMEM
2318da2c9eSDan Williams	tristate "PMEM: Persistent memory block device support"
2418da2c9eSDan Williams	default LIBNVDIMM
252080e88aSDan Williams	select DAX_DRIVER
265212e11fSVishal Verma	select ND_BTT if BTT
27e1455744SDan Williams	select ND_PFN if NVDIMM_PFN
2818da2c9eSDan Williams	help
2918da2c9eSDan Williams	  Memory ranges for PMEM are described by either an NFIT
3018da2c9eSDan Williams	  (NVDIMM Firmware Interface Table, see CONFIG_NFIT_ACPI), a
3118da2c9eSDan Williams	  non-standard OEM-specific E820 memory type (type-12, see
3218da2c9eSDan Williams	  CONFIG_X86_PMEM_LEGACY), or it is manually specified by the
3318da2c9eSDan Williams	  'memmap=nn[KMG]!ss[KMG]' kernel command line (see
348c27ceffSMauro Carvalho Chehab	  Documentation/admin-guide/kernel-parameters.rst).  This driver converts
3518da2c9eSDan Williams	  these persistent memory ranges into block devices that are
3618da2c9eSDan Williams	  capable of DAX (direct-access) file system mappings.  See
37ae4a0502SMauro Carvalho Chehab	  Documentation/driver-api/nvdimm/nvdimm.rst for more details.
3818da2c9eSDan Williams
3918da2c9eSDan Williams	  Say Y if you want to use an NVDIMM
4018da2c9eSDan Williams
41047fc8a1SRoss Zwislerconfig ND_BLK
42047fc8a1SRoss Zwisler	tristate "BLK: Block data window (aperture) device support"
43047fc8a1SRoss Zwisler	default LIBNVDIMM
44047fc8a1SRoss Zwisler	select ND_BTT if BTT
45047fc8a1SRoss Zwisler	help
46047fc8a1SRoss Zwisler	  Support NVDIMMs, or other devices, that implement a BLK-mode
47047fc8a1SRoss Zwisler	  access capability.  BLK-mode access uses memory-mapped-i/o
48047fc8a1SRoss Zwisler	  apertures to access persistent media.
49047fc8a1SRoss Zwisler
50047fc8a1SRoss Zwisler	  Say Y if your platform firmware emits an ACPI.NFIT table
51047fc8a1SRoss Zwisler	  (CONFIG_ACPI_NFIT), or otherwise exposes BLK-mode
52047fc8a1SRoss Zwisler	  capabilities.
53047fc8a1SRoss Zwisler
54e1455744SDan Williamsconfig ND_CLAIM
55e1455744SDan Williams	bool
56e1455744SDan Williams
575212e11fSVishal Vermaconfig ND_BTT
585212e11fSVishal Verma	tristate
595212e11fSVishal Verma
608c2f7e86SDan Williamsconfig BTT
615212e11fSVishal Verma	bool "BTT: Block Translation Table (atomic sector updates)"
625212e11fSVishal Verma	default y if LIBNVDIMM
63e1455744SDan Williams	select ND_CLAIM
645212e11fSVishal Verma	help
655212e11fSVishal Verma	  The Block Translation Table (BTT) provides atomic sector
665212e11fSVishal Verma	  update semantics for persistent memory devices, so that
675212e11fSVishal Verma	  applications that rely on sector writes not being torn (a
685212e11fSVishal Verma	  guarantee that typical disks provide) can continue to do so.
695212e11fSVishal Verma	  The BTT manifests itself as an alternate personality for an
705212e11fSVishal Verma	  NVDIMM namespace, i.e. a namespace can be in raw mode (pmemX,
715212e11fSVishal Verma	  ndblkX.Y, etc...), or 'sectored' mode, (pmemXs, ndblkX.Ys,
725212e11fSVishal Verma	  etc...).
735212e11fSVishal Verma
745212e11fSVishal Verma	  Select Y if unsure
758c2f7e86SDan Williams
76e1455744SDan Williamsconfig ND_PFN
77e1455744SDan Williams	tristate
78e1455744SDan Williams
79e1455744SDan Williamsconfig NVDIMM_PFN
80e1455744SDan Williams	bool "PFN: Map persistent (device) memory"
81e1455744SDan Williams	default LIBNVDIMM
8232ab0a3fSDan Williams	depends on ZONE_DEVICE
83e1455744SDan Williams	select ND_CLAIM
84e1455744SDan Williams	help
85e1455744SDan Williams	  Map persistent memory, i.e. advertise it to the memory
86e1455744SDan Williams	  management sub-system.  By default persistent memory does
87e1455744SDan Williams	  not support direct I/O, RDMA, or any other usage that
88e1455744SDan Williams	  requires a 'struct page' to mediate an I/O request.  This
89e1455744SDan Williams	  driver allocates and initializes the infrastructure needed
90e1455744SDan Williams	  to support those use cases.
91e1455744SDan Williams
92e1455744SDan Williams	  Select Y if unsure
93e1455744SDan Williams
94cd03412aSDan Williamsconfig NVDIMM_DAX
95867dfe34SArnd Bergmann	bool "NVDIMM DAX: Raw access to persistent memory"
96cd03412aSDan Williams	default LIBNVDIMM
97cd03412aSDan Williams	depends on NVDIMM_PFN
98cd03412aSDan Williams	help
99cd03412aSDan Williams	  Support raw device dax access to a persistent memory
100cd03412aSDan Williams	  namespace.  For environments that want to hard partition
10183fc61a5SMasanari Iida	  persistent memory, this capability provides a mechanism to
102cd03412aSDan Williams	  sub-divide a namespace into character devices that can only be
103cd03412aSDan Williams	  accessed via DAX (mmap(2)).
104cd03412aSDan Williams
105cd03412aSDan Williams	  Select Y if unsure
106cd03412aSDan Williams
10771719760SOliver O'Halloranconfig OF_PMEM
108f22acf82SDan Williams	tristate "Device-tree support for persistent memory regions"
10971719760SOliver O'Halloran	depends on OF
11071719760SOliver O'Halloran	default LIBNVDIMM
11171719760SOliver O'Halloran	help
11271719760SOliver O'Halloran	  Allows regions of persistent memory to be described in the
11371719760SOliver O'Halloran	  device-tree.
11471719760SOliver O'Halloran
11571719760SOliver O'Halloran	  Select Y if unsure.
11671719760SOliver O'Halloran
1174c6926a2SDave Jiangconfig NVDIMM_KEYS
1184c6926a2SDave Jiang	def_bool y
1194c6926a2SDave Jiang	depends on ENCRYPTED_KEYS
1204c6926a2SDave Jiang	depends on (LIBNVDIMM=ENCRYPTED_KEYS) || LIBNVDIMM=m
1214c6926a2SDave Jiang
12262974fc3SDan Williamsconfig NVDIMM_TEST_BUILD
12362974fc3SDan Williams	tristate "Build the unit test core"
12462974fc3SDan Williams	depends on m
12562974fc3SDan Williams	depends on COMPILE_TEST && X86_64
12662974fc3SDan Williams	default m if COMPILE_TEST
12762974fc3SDan Williams	help
12862974fc3SDan Williams	  Build the core of the unit test infrastructure. The result of
12962974fc3SDan Williams	  this build is non-functional for unit test execution, but it
13062974fc3SDan Williams	  otherwise helps catch build errors induced by changes to the
13162974fc3SDan Williams	  core devm_memremap_pages() implementation and other
13262974fc3SDan Williams	  infrastructure.
13362974fc3SDan Williams
13418da2c9eSDan Williamsendif
135