Skip to content

Commit 6e97ea2

Browse files
author
Octavian Purdila
committed
lkl: add support for noop dma mappings
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
1 parent 5646eb9 commit 6e97ea2

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

arch/lkl/Kconfig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ config LKL
1616
select NO_HZ_IDLE
1717
select NO_PREEMPT
1818
select ARCH_WANT_FRAME_POINTERS
19+
select HAS_DMA
1920
select PHYS_ADDR_T_64BIT if 64BIT
2021
select 64BIT if OUTPUT_FORMAT = "elf64-x86-64"
2122
select HAVE_UNDERSCORE_SYMBOL_PREFIX if OUTPUT_FORMAT = "pe-i386"
@@ -38,9 +39,6 @@ config 64BIT
3839
config BIG_ENDIAN
3940
def_bool n
4041

41-
config NO_DMA
42-
def_bool y
43-
4442
config GENERIC_CSUM
4543
def_bool y
4644

arch/lkl/include/asm/dma-mapping.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
#ifndef _ASM_LKL_DMA_MAPPING_H
22
#define _ASM_LKL_DMA_MAPPING_H
33

4-
#include <asm-generic/dma-mapping-broken.h>
4+
static inline struct dma_map_ops *get_dma_ops(struct device *dev)
5+
{
6+
return &dma_noop_ops;
7+
}
8+
9+
static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
10+
enum dma_data_direction direction)
11+
{
12+
}
13+
14+
static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
15+
{
16+
if (!dev->dma_mask)
17+
return false;
18+
return addr + size - 1 <= *dev->dma_mask;
19+
}
520

621
#endif

0 commit comments

Comments
 (0)