diff mbox

[3/5] ARM: highbank: enable DMA zone for LPAE

Message ID 1375743009-28972-3-git-send-email-robherring2@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rob Herring Aug. 5, 2013, 10:50 p.m. UTC
From: Rob Herring <rob.herring@calxeda.com>

Some devices are restricted to 32-bit DMA. Thus the platform dma_zone_size
needs to be set. Otherwise dma-mapping code is complaining, e.g.

calxedaxgmac fff50000.ethernet: coherent DMA mask 0xffffffff is smaller
than system GFP_DMA mask 0xffffffffffffffff

Signed-off-by: Andreas Herrmann <andreas.herrmann@calxeda.com>
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
---
 arch/arm/mach-highbank/Kconfig    | 1 +
 arch/arm/mach-highbank/highbank.c | 3 +++
 2 files changed, 4 insertions(+)

Comments

Russell King - ARM Linux Aug. 6, 2013, 12:11 a.m. UTC | #1
On Mon, Aug 05, 2013 at 05:50:07PM -0500, Rob Herring wrote:
> From: Rob Herring <rob.herring@calxeda.com>
> 
> Some devices are restricted to 32-bit DMA. Thus the platform dma_zone_size
> needs to be set. Otherwise dma-mapping code is complaining, e.g.
> 
> calxedaxgmac fff50000.ethernet: coherent DMA mask 0xffffffff is smaller
> than system GFP_DMA mask 0xffffffffffffffff

Note that the patches I posted last week will fix that in a much nicer
way, as we will only error if we actually have sufficient memory that
the condition becomes problematical.

The other problem here is that we need to get better separation between
what's a bus address and what's a physical address.
Rob Herring Aug. 6, 2013, 3:29 a.m. UTC | #2
On Mon, Aug 5, 2013 at 7:11 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Mon, Aug 05, 2013 at 05:50:07PM -0500, Rob Herring wrote:
>> From: Rob Herring <rob.herring@calxeda.com>
>>
>> Some devices are restricted to 32-bit DMA. Thus the platform dma_zone_size
>> needs to be set. Otherwise dma-mapping code is complaining, e.g.
>>
>> calxedaxgmac fff50000.ethernet: coherent DMA mask 0xffffffff is smaller
>> than system GFP_DMA mask 0xffffffffffffffff
>
> Note that the patches I posted last week will fix that in a much nicer
> way, as we will only error if we actually have sufficient memory that
> the condition becomes problematical.

But in the Midway case it is problematic as we do have more than 4GB
with some masters being 32-bit. DMA zone is still the right way to
limit allocations to less than 4GB dma address, right?

> The other problem here is that we need to get better separation between
> what's a bus address and what's a physical address.

Right, but for Midway they are actually the same. There is no h/w
translation of 32-bit bus addresses to a >4GB physical address other
than with an IOMMU.

Rob
diff mbox

Patch

diff --git a/arch/arm/mach-highbank/Kconfig b/arch/arm/mach-highbank/Kconfig
index cd9fcb1..efe4961 100644
--- a/arch/arm/mach-highbank/Kconfig
+++ b/arch/arm/mach-highbank/Kconfig
@@ -18,3 +18,4 @@  config ARCH_HIGHBANK
 	select PL320_MBOX
 	select SPARSE_IRQ
 	select USE_OF
+	select ZONE_DMA if ARM_LPAE
diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c
index 8881579..1894dcf 100644
--- a/arch/arm/mach-highbank/highbank.c
+++ b/arch/arm/mach-highbank/highbank.c
@@ -176,6 +176,9 @@  static const char *highbank_match[] __initconst = {
 };
 
 DT_MACHINE_START(HIGHBANK, "Highbank")
+#ifdef CONFIG_ZONE_DMA
+	.dma_zone_size	= (4ULL * SZ_1G),
+#endif
 	.smp		= smp_ops(highbank_smp_ops),
 	.init_irq	= highbank_init_irq,
 	.init_time	= highbank_timer_init,