arm64: Create non-empty ZONE_DMA when DRAM starts above 4GB
authorCatalin Marinas <catalin.marinas@arm.com>
Fri, 18 Jul 2014 10:54:37 +0000 (11:54 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 21 Jan 2015 23:10:57 +0000 (23:10 +0000)
commit34c668387658fabfb18c67abdc7f194009954d7e
tree321c777b765a38079071bda995fdac120e5bf9a3
parent29cdbe3b974687b51f1016489455e65751a7fc40
arm64: Create non-empty ZONE_DMA when DRAM starts above 4GB

ZONE_DMA is created to allow 32-bit only devices to access memory in the
absence of an IOMMU. On systems where the memory starts above 4GB, it is
expected that some devices have a DMA offset hardwired to be able to
access the bottom of the memory. Linux currently supports DT bindings
for the DMA offsets but they are not (easily) available early during
boot.

This patch tries to guess a DMA offset and assumes that ZONE_DMA
corresponds to the 32-bit mask above the start of DRAM.

Fixes: 2d5a5612bc (arm64: Limit the CMA buffer to 32-bit if ZONE_DMA)
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Reported-by: Mark Salter <msalter@redhat.com>
Tested-by: Mark Salter <msalter@redhat.com>
Tested-by: Anup Patel <anup.patel@linaro.org>
(cherry picked from commit d50314a6b0702c630c35b88148c1acb76d2e4ede)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
arch/arm64/mm/init.c
arch/arm64/mm/init.c