On 25/12/13 04:36, Siarhei Siamashka wrote:
Previously only sun7i had ZONE_DMA enabled, which is originating
from the Allwinner linux-3.3 code drop. But there should be no
reason to have it different for sun4i and sun5i.

The practical effect of setting the dma_zone_size is that it
affects the placement of the CMA area in physical RAM (if CMA
is enabled in the kernel). And we want to have it placed in the
first 256MB of physical RAM because the Cedar VPU is going to
be unhappy otherwise. For example, the encoding of the address
in MACC_MPEG_VLD_ADDR register is a bit tricky for anything that
needs more than 28 bits:
     http://linux-sunxi.org/VE_Register_guide#MACC_MPEG_VLD_ADDR
The low 4 bits might be supposed to store the high part of the
address, but in practice the video playback is currently broken
(in the proprietary libve and in the open source libvdpau-sunxi)
if Cedar memory buffer is allocated at a physical address
above 256MB.

TL;DR this workarounds Cedar VPU issues in the case if CMA is
enabled.

Signed-off-by: Siarhei Siamashka <siarhei.siamas...@gmail.com>
---
  arch/arm/Kconfig           | 2 ++
  arch/arm/plat-sunxi/core.c | 6 ++++++
  2 files changed, 8 insertions(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 26bec47..fd06762 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -710,6 +710,7 @@ config ARCH_SUN4I
        select ARM_L1_CACHE_SHIFT_6
        select NEED_MACH_IO_H
        select ARCH_WANT_OPTIONAL_GPIOLIB
+       select ZONE_DMA
        help
          This enables support for Allwinner Technology Co., Ltd A10 SoC based 
systems

@@ -724,6 +725,7 @@ config ARCH_SUN5I
          select ARM_L1_CACHE_SHIFT_6
        select NEED_MACH_IO_H
        select ARCH_WANT_OPTIONAL_GPIOLIB
+       select ZONE_DMA
          help
          This enables support for Allwinner Technology Co., Ltd A10s/A13 SoC 
based systems

diff --git a/arch/arm/plat-sunxi/core.c b/arch/arm/plat-sunxi/core.c
index 11ddbbf..e7da395 100644
--- a/arch/arm/plat-sunxi/core.c
+++ b/arch/arm/plat-sunxi/core.c
@@ -402,6 +402,9 @@ MACHINE_START(SUN4I, "sun4i")
        .init_machine   = sw_core_init,
        .reserve        = sw_core_reserve,
        .restart        = sun4i_restart,
+#ifdef CONFIG_ZONE_DMA
+       .dma_zone_size  = SZ_256M,
+#endif
  MACHINE_END

  MACHINE_START(SUN5I, "sun5i")
@@ -413,6 +416,9 @@ MACHINE_START(SUN5I, "sun5i")
        .init_machine   = sw_core_init,
        .reserve        = sw_core_reserve,
        .restart        = sun4i_restart,
+#ifdef CONFIG_ZONE_DMA
+       .dma_zone_size  = SZ_256M,
+#endif
  MACHINE_END

  MACHINE_START(SUN7I, "sun7i")


thank you, applied on stage/sunxi-3.4

Cheers,
Alejandro Mery

--
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to