xen/arm: Allow a platform to override the DMA width
authorJulien Grall <jgrall@amazon.com>
Sat, 16 May 2020 10:41:16 +0000 (11:41 +0100)
committerJulien Grall <jgrall@amazon.com>
Sun, 24 May 2020 13:59:46 +0000 (14:59 +0100)
commitb92223aeedc5cf1cd2882a7b769865d652cf8b06
tree5f7e854ac07aba9a83d64416bc0d4ccfdd09c795
parent5e015d48a5ee68ba03addad2698364d8f015afec
xen/arm: Allow a platform to override the DMA width

At the moment, Xen is assuming that all the devices are at least 32-bit
DMA capable. However, some SoC have devices that may be able to access
a much restricted range. For instance, the RPI has devices that can
only access the first 1GB of RAM.

The structure platform_desc is now extended to allow a platform to
override the DMA width. The new is used to implement
arch_get_dma_bit_size().

The prototype is now moved in asm-arm/mm.h as the function is not NUMA
specific. The implementation is done in platform.c so we don't have to
include platform.h everywhere. This should be fine as the function is
not expected to be called in hotpath.

Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Tested-by: Corey Minyard <cminyard@mvista.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/platform.c
xen/include/asm-arm/mm.h
xen/include/asm-arm/numa.h
xen/include/asm-arm/platform.h