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)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 23 Jul 2014 10:23:58 +0000 (11:23 +0100)
commitd50314a6b0702c630c35b88148c1acb76d2e4ede
treedc9cc23e17eac20dd41b27b7ae13c72be230255d
parentfa2ec3ea10bd377f9d55772b1dab65178425a1a2
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>
arch/arm64/mm/init.c