From e4a642c86713e98617173477b9327cfd3c4cd369 Mon Sep 17 00:00:00 2001 From: Furquan Shaikh Date: Sat, 31 Jan 2015 23:24:32 -0800 Subject: libpayload arm64: Allow board to define upper address limit on DMA Instead of forcing boards to have DMA region below 4GiB, provide Kconfig option DMA_LIM_EXCL that a board can use to set the upper limit in MiB units on the address range reserved by DMA. By default, this value is 0x1000 i.e. 4GiB limit on the DMA upper address. BUG=None BRANCH=None TEST=Compiles successfully for rush. Default value is seen as 0x1000. Change-Id: Ie35d3844a0989486ae022f8922fdd4c9d7d57fb4 Signed-off-by: Patrick Georgi Original-Commit-Id: 6716cf312a103bc0440a558fc43c8c77869816e3 Original-Change-Id: I3ecbb4ec90995ab1568cb0924d5ce9467492697d Original-Signed-off-by: Furquan Shaikh Original-Reviewed-on: https://chromium-review.googlesource.com/245250 Original-Tested-by: Furquan Shaikh Original-Reviewed-by: Aaron Durbin Original-Commit-Queue: Furquan Shaikh Reviewed-on: http://review.coreboot.org/8800 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh --- payloads/libpayload/arch/arm64/Config.in | 4 ++++ payloads/libpayload/arch/arm64/mmu.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'payloads/libpayload/arch/arm64') diff --git a/payloads/libpayload/arch/arm64/Config.in b/payloads/libpayload/arch/arm64/Config.in index 0f2596c452..d2f8e5675a 100644 --- a/payloads/libpayload/arch/arm64/Config.in +++ b/payloads/libpayload/arch/arm64/Config.in @@ -33,4 +33,8 @@ config ARCH_SPECIFIC_OPTIONS # dummy def_bool y select LITTLE_ENDIAN +config DMA_LIM_EXCL + hex "DMA address limit(exclusive) in MiB units" + default 0x1000 + endif diff --git a/payloads/libpayload/arch/arm64/mmu.c b/payloads/libpayload/arch/arm64/mmu.c index da2127d0da..adbee0f4b8 100644 --- a/payloads/libpayload/arch/arm64/mmu.c +++ b/payloads/libpayload/arch/arm64/mmu.c @@ -609,7 +609,7 @@ static struct mmu_memrange *mmu_add_dma_range(struct mmu_ranges *mmu_ranges) /* DMA_DEFAULT_SIZE is multiple of GRANULE_SIZE */ assert((DMA_DEFAULT_SIZE % GRANULE_SIZE) == 0); prop.size = DMA_DEFAULT_SIZE; - prop.lim_excl = MIN_64_BIT_ADDR; + prop.lim_excl = (uint64_t)CONFIG_LP_DMA_LIM_EXCL * MiB; prop.align = GRANULE_SIZE; prop.is_valid_range = NULL; prop.src_type = TYPE_NORMAL_MEM; -- cgit v1.2.3