[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190731154752.16557-5-nsaenzjulienne@suse.de>
Date: Wed, 31 Jul 2019 17:47:47 +0200
From: Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
To: catalin.marinas@....com, hch@....de, wahrenst@....net,
marc.zyngier@....com, Robin Murphy <robin.murphy@....com>,
linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
iommu@...ts.linux-foundation.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Cc: phill@...pberryi.org, f.fainelli@...il.com, will@...nel.org,
robh+dt@...nel.org, eric@...olt.net, mbrugger@...e.com,
nsaenzjulienne@...e.de, akpm@...ux-foundation.org,
frowand.list@...il.com, m.szyprowski@...sung.com,
linux-rpi-kernel@...ts.infradead.org
Subject: [PATCH 4/8] arm64: re-introduce max_zone_dma_phys()
Some devices might have multiple interconnects with different DMA
addressing limitations. This function provides the higher physical
address accessible by all peripherals on the SoC. If such limitation
doesn't exist it'll return 0.
Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
---
arch/arm64/mm/init.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 8956c22634dd..1c4ffabbe1cb 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -174,6 +174,19 @@ static phys_addr_t __init max_zone_dma32_phys(void)
return min(offset + (1ULL << 32), memblock_end_of_DRAM());
}
+static phys_addr_t __init max_zone_dma_phys(void)
+
+{
+ u64 memory_size = memblock_end_of_DRAM() - memblock_start_of_DRAM();
+ u64 zone_dma_size;
+
+ of_scan_flat_dt(early_init_dt_dma_zone_size, &zone_dma_size);
+ if (zone_dma_size && zone_dma_size < min(memory_size, SZ_4G))
+ return memblock_start_of_DRAM() + zone_dma_size;
+
+ return 0;
+}
+
#ifdef CONFIG_NUMA
static void __init zone_sizes_init(unsigned long min, unsigned long max)
--
2.22.0
Powered by blists - more mailing lists