1cf65a0f6SChristoph Hellwig 2cf65a0f6SChristoph Hellwigconfig HAS_DMA 3cf65a0f6SChristoph Hellwig bool 4cf65a0f6SChristoph Hellwig depends on !NO_DMA 5cf65a0f6SChristoph Hellwig default y 6cf65a0f6SChristoph Hellwig 7cf65a0f6SChristoph Hellwigconfig NEED_SG_DMA_LENGTH 8cf65a0f6SChristoph Hellwig bool 9cf65a0f6SChristoph Hellwig 10cf65a0f6SChristoph Hellwigconfig NEED_DMA_MAP_STATE 11cf65a0f6SChristoph Hellwig bool 12cf65a0f6SChristoph Hellwig 13cf65a0f6SChristoph Hellwigconfig ARCH_DMA_ADDR_T_64BIT 14cf65a0f6SChristoph Hellwig def_bool 64BIT || PHYS_ADDR_T_64BIT 15cf65a0f6SChristoph Hellwig 16f3ecc0ffSChristoph Hellwigconfig ARCH_HAS_DMA_COHERENCE_H 17f3ecc0ffSChristoph Hellwig bool 18f3ecc0ffSChristoph Hellwig 19cf65a0f6SChristoph Hellwigconfig HAVE_GENERIC_DMA_COHERENT 20cf65a0f6SChristoph Hellwig bool 21cf65a0f6SChristoph Hellwig 22347cb6afSChristoph Hellwigconfig ARCH_HAS_SETUP_DMA_OPS 23347cb6afSChristoph Hellwig bool 24347cb6afSChristoph Hellwig 25*dc2acdedSChristoph Hellwigconfig ARCH_HAS_TEARDOWN_DMA_OPS 26*dc2acdedSChristoph Hellwig bool 27*dc2acdedSChristoph Hellwig 28cf65a0f6SChristoph Hellwigconfig ARCH_HAS_SYNC_DMA_FOR_DEVICE 29cf65a0f6SChristoph Hellwig bool 30cf65a0f6SChristoph Hellwig 31cf65a0f6SChristoph Hellwigconfig ARCH_HAS_SYNC_DMA_FOR_CPU 32cf65a0f6SChristoph Hellwig bool 33cf65a0f6SChristoph Hellwig select NEED_DMA_MAP_STATE 34cf65a0f6SChristoph Hellwig 35684f7e91SChristoph Hellwigconfig ARCH_HAS_SYNC_DMA_FOR_CPU_ALL 36684f7e91SChristoph Hellwig bool 37684f7e91SChristoph Hellwig 3858b04406SChristoph Hellwigconfig ARCH_HAS_DMA_COHERENT_TO_PFN 3958b04406SChristoph Hellwig bool 4058b04406SChristoph Hellwig 4158b04406SChristoph Hellwigconfig ARCH_HAS_DMA_MMAP_PGPROT 4258b04406SChristoph Hellwig bool 4358b04406SChristoph Hellwig 44cf65a0f6SChristoph Hellwigconfig DMA_NONCOHERENT_CACHE_SYNC 45cf65a0f6SChristoph Hellwig bool 46cf65a0f6SChristoph Hellwig 47cf65a0f6SChristoph Hellwigconfig DMA_VIRT_OPS 48cf65a0f6SChristoph Hellwig bool 49cf65a0f6SChristoph Hellwig depends on HAS_DMA 50cf65a0f6SChristoph Hellwig 51cf65a0f6SChristoph Hellwigconfig SWIOTLB 52cf65a0f6SChristoph Hellwig bool 53cf65a0f6SChristoph Hellwig select NEED_DMA_MAP_STATE 54f0edfea8SChristoph Hellwig 55f0edfea8SChristoph Hellwigconfig DMA_REMAP 56f0edfea8SChristoph Hellwig depends on MMU 57f0edfea8SChristoph Hellwig bool 580c3b3171SChristoph Hellwig 590c3b3171SChristoph Hellwigconfig DMA_DIRECT_REMAP 600c3b3171SChristoph Hellwig bool 610c3b3171SChristoph Hellwig select DMA_REMAP 6270ca7ba2SAndy Shevchenko 6370ca7ba2SAndy Shevchenkoconfig DMA_API_DEBUG 6470ca7ba2SAndy Shevchenko bool "Enable debugging of DMA-API usage" 6570ca7ba2SAndy Shevchenko select NEED_DMA_MAP_STATE 6670ca7ba2SAndy Shevchenko help 6770ca7ba2SAndy Shevchenko Enable this option to debug the use of the DMA API by device drivers. 6870ca7ba2SAndy Shevchenko With this option you will be able to detect common bugs in device 6970ca7ba2SAndy Shevchenko drivers like double-freeing of DMA mappings or freeing mappings that 7070ca7ba2SAndy Shevchenko were never allocated. 7170ca7ba2SAndy Shevchenko 7270ca7ba2SAndy Shevchenko This also attempts to catch cases where a page owned by DMA is 7370ca7ba2SAndy Shevchenko accessed by the cpu in a way that could cause data corruption. For 7470ca7ba2SAndy Shevchenko example, this enables cow_user_page() to check that the source page is 7570ca7ba2SAndy Shevchenko not undergoing DMA. 7670ca7ba2SAndy Shevchenko 7770ca7ba2SAndy Shevchenko This option causes a performance degradation. Use only if you want to 7870ca7ba2SAndy Shevchenko debug device drivers and dma interactions. 7970ca7ba2SAndy Shevchenko 8070ca7ba2SAndy Shevchenko If unsure, say N. 8170ca7ba2SAndy Shevchenko 8270ca7ba2SAndy Shevchenkoconfig DMA_API_DEBUG_SG 8370ca7ba2SAndy Shevchenko bool "Debug DMA scatter-gather usage" 8470ca7ba2SAndy Shevchenko default y 8570ca7ba2SAndy Shevchenko depends on DMA_API_DEBUG 8670ca7ba2SAndy Shevchenko help 8770ca7ba2SAndy Shevchenko Perform extra checking that callers of dma_map_sg() have respected the 8870ca7ba2SAndy Shevchenko appropriate segment length/boundary limits for the given device when 8970ca7ba2SAndy Shevchenko preparing DMA scatterlists. 9070ca7ba2SAndy Shevchenko 9170ca7ba2SAndy Shevchenko This is particularly likely to have been overlooked in cases where the 9270ca7ba2SAndy Shevchenko dma_map_sg() API is used for general bulk mapping of pages rather than 9370ca7ba2SAndy Shevchenko preparing literal scatter-gather descriptors, where there is a risk of 9470ca7ba2SAndy Shevchenko unexpected behaviour from DMA API implementations if the scatterlist 9570ca7ba2SAndy Shevchenko is technically out-of-spec. 9670ca7ba2SAndy Shevchenko 9770ca7ba2SAndy Shevchenko If unsure, say N. 98