Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Limiting the DMA zone in arm64
@ 2019-07-11  9:51 Nicolas Saenz Julienne
  2019-07-11 10:15 ` Jisheng Zhang
  2019-07-11 10:17 ` Will Deacon
  0 siblings, 2 replies; 6+ messages in thread
From: Nicolas Saenz Julienne @ 2019-07-11  9:51 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Stefan Wahren, Catalin Marinas, Florian Fainelli, will

Hi,
I'm trying to bring up the new RPi4 on arm64, and running into issues with DMA
allocations. The device has up to 4GB of ram, but AFAIK only the first GB of
ram can be used for DMA: the DMA address range is 0xc0000000-0xffffffff which
is aliased to the first GB of memory 0x00000000-0x40000000.

This is solved in arm32 using a board file with '.dma_zone_size = SZ_1G'. But I
haven't found any similar mechanism for arm64. Any suggestions?

Just it case it helps understand the issue, I managed to get things going by
doing the following:

diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index f3c795278def..ec3cb7b76a76 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -407,7 +407,8 @@ void __init arm64_memblock_init(void)
 
        /* 4GB maximum for 32-bit only capable devices */
        if (IS_ENABLED(CONFIG_ZONE_DMA32))
-               arm64_dma_phys_limit = max_zone_dma_phys();
+               arm64_dma_phys_limit = 0x40000000;
        else
                arm64_dma_phys_limit = PHYS_MASK + 1;

Regards,
Nicolas



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-07-11 13:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-11  9:51 Limiting the DMA zone in arm64 Nicolas Saenz Julienne
2019-07-11 10:15 ` Jisheng Zhang
2019-07-11 10:17   ` Nicolas Saenz Julienne
2019-07-11 10:17 ` Will Deacon
2019-07-11 11:10   ` Nicolas Saenz Julienne
2019-07-11 13:32     ` Phil Elwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox