# SPDX-License-Identifier: GPL-2.0-only
config [31mCONFIG_HAS_DMA[0m
bool
depends on ![31mCONFIG_NO_DMA[0m
default y
config [31mCONFIG_NEED_SG_DMA_LENGTH[0m
bool
config [31mCONFIG_NEED_DMA_MAP_STATE[0m
bool
config [31mCONFIG_ARCH_DMA_ADDR_T_64BIT[0m
def_bool [31mCONFIG_64BIT[0m || [31mCONFIG_PHYS_ADDR_T_64BIT[0m
config [31mCONFIG_ARCH_HAS_DMA_COHERENCE_H[0m
bool
config [31mCONFIG_ARCH_HAS_DMA_SET_MASK[0m
bool
#
# Select this option if the architecture needs special handling for
# DMA_ATTR_WRITE_COMBINE. Normally the "uncached" mapping should be what
# people thing of when saying write combine, so very few platforms should
# need to enable this.
#
config [31mCONFIG_ARCH_HAS_DMA_WRITE_COMBINE[0m
bool
config [31mCONFIG_DMA_DECLARE_COHERENT[0m
bool
config [31mCONFIG_ARCH_HAS_SETUP_DMA_OPS[0m
bool
config [31mCONFIG_ARCH_HAS_TEARDOWN_DMA_OPS[0m
bool
config [31mCONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE[0m
bool
config [31mCONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU[0m
bool
select [31mCONFIG_NEED_DMA_MAP_STATE[0m
config [31mCONFIG_ARCH_HAS_SYNC_DMA_FOR_CPU_ALL[0m
bool
config [31mCONFIG_ARCH_HAS_DMA_PREP_COHERENT[0m
bool
config [31mCONFIG_ARCH_HAS_DMA_COHERENT_TO_PFN[0m
bool
config [31mCONFIG_ARCH_HAS_FORCE_DMA_UNENCRYPTED[0m
bool
config [31mCONFIG_DMA_NONCOHERENT_CACHE_SYNC[0m
bool
config [31mCONFIG_DMA_VIRT_OPS[0m
bool
depends on [31mCONFIG_HAS_DMA[0m
config [31mCONFIG_SWIOTLB[0m
bool
select [31mCONFIG_NEED_DMA_MAP_STATE[0m
config [31mCONFIG_DMA_REMAP[0m
depends on [31mCONFIG_MMU[0m
select [31mCONFIG_GENERIC_ALLOCATOR[0m
bool
config [31mCONFIG_DMA_DIRECT_REMAP[0m
bool
select [31mCONFIG_DMA_REMAP[0m
config [31mCONFIG_DMA_CMA[0m
bool "DMA Contiguous Memory Allocator"
depends on [31mCONFIG_HAVE_DMA_CONTIGUOUS[0m && [31mCONFIG_CMA[0m
help
This enables the Contiguous Memory Allocator which allows drivers
to allocate big physically-contiguous blocks of memory for use with
hardware components that do not support I/O map nor scatter-gather.
You can disable [31mCONFIG_CMA[0m by specifying "cma=0" on the kernel's command
line.
For more information see <include/linux/dma-contiguous.h>.
If unsure, say "n".
if [31mCONFIG_DMA_CMA[0m
comment "Default contiguous memory area size:"
config [31mCONFIG_CMA_SIZE_MBYTES[0m
int "Size in Mega Bytes"
depends on ![31mCONFIG_CMA_SIZE_SEL_PERCENTAGE[0m
default 0 if [31mCONFIG_X86[0m
default 16
help
Defines the size (in MiB) of the default memory area for Contiguous
Memory Allocator. If the size of 0 is selected, [31mCONFIG_CMA[0m is disabled by
default, but it can be enabled by passing cma=size[MG] to the kernel.
config [31mCONFIG_CMA_SIZE_PERCENTAGE[0m
int "Percentage of total memory"
depends on ![31mCONFIG_CMA_SIZE_SEL_MBYTES[0m
default 0 if [31mCONFIG_X86[0m
default 10
help
Defines the size of the default memory area for Contiguous Memory
Allocator as a percentage of the total memory in the system.
If 0 percent is selected, [31mCONFIG_CMA[0m is disabled by default, but it can be
enabled by passing cma=size[MG] to the kernel.
choice
prompt "Selected region size"
default [31mCONFIG_CMA_SIZE_SEL_MBYTES[0m
config [31mCONFIG_CMA_SIZE_SEL_MBYTES[0m
bool "Use mega bytes value only"
config [31mCONFIG_CMA_SIZE_SEL_PERCENTAGE[0m
bool "Use percentage value only"
config [31mCONFIG_CMA_SIZE_SEL_MIN[0m
bool "Use lower value (minimum)"
config [31mCONFIG_CMA_SIZE_SEL_MAX[0m
bool "Use higher value (maximum)"
endchoice
config [31mCONFIG_CMA_ALIGNMENT[0m
int "Maximum PAGE_SIZE order of alignment for contiguous buffers"
range 4 12
default 8
help
DMA mapping framework by default aligns all buffers to the smallest
PAGE_SIZE order which is greater than or equal to the requested buffer
size. This works well for buffers up to a few hundreds kilobytes, but
for larger buffers it just a memory waste. With this parameter you can
specify the maximum PAGE_SIZE order for contiguous buffers. Larger
buffers will be aligned only to this specified order. The order is
expressed as a power of two multiplied by the PAGE_SIZE.
For example, if your system defaults to 4KiB pages, the order value
of 8 means that the buffers will be aligned up to 1MiB only.
If unsure, leave the default value "8".
endif
config [31mCONFIG_DMA_API_DEBUG[0m
bool "Enable debugging of DMA-API usage"
select [31mCONFIG_NEED_DMA_MAP_STATE[0m
help
Enable this option to debug the use of the DMA API by device drivers.
With this option you will be able to detect common bugs in device
drivers like double-freeing of DMA mappings or freeing mappings that
were never allocated.
This also attempts to catch cases where a page owned by DMA is
accessed by the cpu in a way that could cause data corruption. For
example, this enables cow_user_page() to check that the source page is
not undergoing DMA.
This option causes a performance degradation. Use only if you want to
debug device drivers and dma interactions.
If unsure, say N.
config [31mCONFIG_DMA_API_DEBUG_SG[0m
bool "Debug DMA scatter-gather usage"
default y
depends on [31mCONFIG_DMA_API_DEBUG[0m
help
Perform extra checking that callers of dma_map_sg() have respected the
appropriate segment length/boundary limits for the given device when
preparing DMA scatterlists.
This is particularly likely to have been overlooked in cases where the
dma_map_sg() API is used for general bulk mapping of pages rather than
preparing literal scatter-gather descriptors, where there is a risk of
unexpected behaviour from DMA API implementations if the scatterlist
is technically out-of-spec.
If unsure, say N.