Skip to contentSkip to conversation

ARM: Remove define CONSISTENT_DMA_SIZE

PATCH In review Jon Medhurst 8 participants 30 messages Aug 8, 2011 – Aug 22, 2011

Subsystems (9)
lore
Share & tools
lore
#0 lore raw

cover ARM: Remove define CONSISTENT_DMA_SIZE

The size of the consistent DMA mapping region is given by the define CONSISTENT_DMA_SIZE. This defaults to a value of 2MB but various platforms increase this, usually to support larger frame buffers.

To enable support for building multiple ARM platforms into a single kernel binary, we need to remove the compile time constant CONSISTENT_DMA_SIZE and make it configured at boot time.

To implement this, this patch series provides a function to set the size - init_consistent_dma_size() - then each platform which requires a non-default value is modified to call this during the map_io callback. (This call-site was chosen as it is platform specific, early enough, and is somewhat related to the functions being performed.)

Future CMA work may make these changes obsolete, so this is probably a near term solution to help progress the 'single zImage' work.

CC Ben Dooks <[email protected]>
CC Kukjin Kim <[email protected]>
CC Sascha Hauer <[email protected]>
CC Amit Kucheria <[email protected]>
CC Sekhar Nori <[email protected]>
CC Kevin Hilman <[email protected]>
CC Linus Walleij <[email protected]>
CC Nicolas Ferre <[email protected]>
CC Jiandong Zheng <[email protected]>
CC Scott Branden <[email protected]>
CC Paul Mundt <[email protected]>
CC Magnus Damm <[email protected]>
---
 arch/arm/include/asm/dma-mapping.h            |    3 ++
 arch/arm/include/asm/memory.h                 |    9 -----
 arch/arm/mach-at91/at91sam9g45.c              |    2 +
 arch/arm/mach-at91/include/mach/at91sam9g45.h |    2 -
 arch/arm/mach-bcmring/include/mach/memory.h   |    5 ---
 arch/arm/mach-bcmring/mm.c                    |    3 ++
 arch/arm/mach-davinci/common.c                |    3 ++
 arch/arm/mach-davinci/include/mach/memory.h   |    5 ---
 arch/arm/mach-imx/mm-imx1.c                   |    1 +
 arch/arm/mach-imx/mm-imx21.c                  |    1 +
 arch/arm/mach-imx/mm-imx25.c                  |    1 +
 arch/arm/mach-imx/mm-imx27.c                  |    1 +
 arch/arm/mach-imx/mm-imx31.c                  |    1 +
 arch/arm/mach-imx/mm-imx35.c                  |    1 +
 arch/arm/mach-mx5/mm-mx50.c                   |    1 +
 arch/arm/mach-mx5/mm.c                        |    2 +
 arch/arm/mach-omap1/io.c                      |    1 +
 arch/arm/mach-omap2/io.c                      |    2 +-
 arch/arm/mach-s3c64xx/cpu.c                   |    2 +
 arch/arm/mach-s3c64xx/include/mach/memory.h   |    2 -
 arch/arm/mach-s5p64x0/cpu.c                   |    3 ++
 arch/arm/mach-s5p64x0/include/mach/memory.h   |    1 -
 arch/arm/mach-s5pv210/cpu.c                   |    2 +
 arch/arm/mach-s5pv210/include/mach/memory.h   |    1 -
 arch/arm/mach-shmobile/board-ag5evm.c         |    3 ++
 arch/arm/mach-shmobile/board-ap4evb.c         |    3 ++
 arch/arm/mach-shmobile/board-g3evm.c          |    3 ++
 arch/arm/mach-shmobile/board-g4evm.c          |    3 ++
 arch/arm/mach-shmobile/board-mackerel.c       |    3 ++
 arch/arm/mach-shmobile/include/mach/memory.h  |    3 --
 arch/arm/mach-u300/core.c                     |    3 ++
 arch/arm/mach-u300/include/mach/memory.h      |    5 ---
 arch/arm/mm/dma-mapping.c                     |   45 +++++++++++++++++++------
 arch/arm/mm/init.c                            |    9 -----
 arch/arm/plat-mxc/include/mach/common.h       |    1 +
 arch/arm/plat-mxc/include/mach/memory.h       |   15 --------
 arch/arm/plat-mxc/system.c                    |   16 +++++++++
 arch/arm/plat-omap/include/plat/io.h          |    2 +
 arch/arm/plat-omap/include/plat/memory.h      |   13 -------
 arch/arm/plat-omap/io.c                       |    8 ++++
 40 files changed, 108 insertions(+), 82 deletions(-)
#1 lore raw

PATCH 1/12 ARM: Add init_consistent_dma_size()

This function can be called during boot to increase the size of the consistent DMA region above it's default value of 2MB. It must be called before the memory allocator is initialised, i.e. before any core_initcall.

---
 arch/arm/include/asm/dma-mapping.h |    3 ++
 arch/arm/include/asm/memory.h      |    9 ------
 arch/arm/mm/dma-mapping.c          |   49 +++++++++++++++++++++++++++--------
 arch/arm/mm/init.c                 |    9 ------
 4 files changed, 41 insertions(+), 29 deletions(-)
arch/arm/include/asm/dma-mapping.h +3 -0
index 7a21d0b..328416b 100644
@@ -206,6 +206,9 @@ int dma_mmap_writecombine(struct device *, struct vm_area_struct *,
 		void *, dma_addr_t, size_t);
 
 
+extern void __init init_consistent_dma_size(unsigned long size);
+
+
 #ifdef CONFIG_DMABOUNCE
 /*
  * For SA-1111, IXP425, and ADI systems  the dma-mapping functions are "magic"
arch/arm/include/asm/memory.h +0 -9
index b8de516..652fccc 100644
@@ -77,16 +77,7 @@
  */
 #define IOREMAP_MAX_ORDER	24
 
-/*
- * Size of DMA-consistent memory region.  Must be multiple of 2M,
- * between 2MB and 14MB inclusive.
- */
-#ifndef CONSISTENT_DMA_SIZE
-#define CONSISTENT_DMA_SIZE 	SZ_2M
-#endif
-
 #define CONSISTENT_END		(0xffe00000UL)
-#define CONSISTENT_BASE		(CONSISTENT_END - CONSISTENT_DMA_SIZE)
 
 #else /* CONFIG_MMU */
 
arch/arm/mm/dma-mapping.c +38 -11

90 lines not on this page · raw message

arch/arm/mm/init.c +0 -9
index 2fee782..2a7c173 100644
@@ -653,9 +653,6 @@ void __init mem_init(void)
 			"    ITCM    : 0x%08lx - 0x%08lx   (%4ld kB)\n"
 #endif
 			"    fixmap  : 0x%08lx - 0x%08lx   (%4ld kB)\n"
-#ifdef CONFIG_MMU
-			"    DMA     : 0x%08lx - 0x%08lx   (%4ld MB)\n"
-#endif
 			"    vmalloc : 0x%08lx - 0x%08lx   (%4ld MB)\n"
 			"    lowmem  : 0x%08lx - 0x%08lx   (%4ld MB)\n"
 #ifdef CONFIG_HIGHMEM
@@ -674,9 +671,6 @@ void __init mem_init(void)
 			MLK(ITCM_OFFSET, (unsigned long) itcm_end),
 #endif
 			MLK(FIXADDR_START, FIXADDR_TOP),
-#ifdef CONFIG_MMU
-			MLM(CONSISTENT_BASE, CONSISTENT_END),
-#endif
 			MLM(VMALLOC_START, VMALLOC_END),
 			MLM(PAGE_OFFSET, (unsigned long)high_memory),
 #ifdef CONFIG_HIGHMEM
@@ -699,9 +693,6 @@ void __init mem_init(void)
 	 * be detected at build time already.
 	 */
 #ifdef CONFIG_MMU
-	BUILD_BUG_ON(VMALLOC_END			> CONSISTENT_BASE);
-	BUG_ON(VMALLOC_END				> CONSISTENT_BASE);
-
 	BUILD_BUG_ON(TASK_SIZE				> MODULES_VADDR);
 	BUG_ON(TASK_SIZE 				> MODULES_VADDR);
 #endif
Signature · 1 line
1.7.2.5
#2 lore raw

PATCH 1/12 ARM: Add init_consistent_dma_size()

Quoted 5 lines · Jon Medhurst

This function can be called during boot to increase the size of the consistent DMA region above it's default value of 2MB. It must be called before the memory allocator is initialised, i.e. before any core_initcall.

I'd add a comment above the declaration for init_consistent_dma_size() repeating the above commit message so it is clearer what this call does without having to look up the git history log. Otherwise you can add:

Quoted 183 lines
---
 arch/arm/include/asm/dma-mapping.h |    3 ++
 arch/arm/include/asm/memory.h      |    9 ------
 arch/arm/mm/dma-mapping.c          |   49 +++++++++++++++++++++++++++--------
 arch/arm/mm/init.c                 |    9 ------
 4 files changed, 41 insertions(+), 29 deletions(-)
arch/arm/include/asm/dma-mapping.h +3 -0
index 7a21d0b..328416b 100644
@@ -206,6 +206,9 @@ int dma_mmap_writecombine(struct device *, struct vm_area_struct *,
 		void *, dma_addr_t, size_t);
 
 
+extern void __init init_consistent_dma_size(unsigned long size);
+
+
 #ifdef CONFIG_DMABOUNCE
 /*
  * For SA-1111, IXP425, and ADI systems  the dma-mapping functions are "magic"
arch/arm/include/asm/memory.h +0 -9
index b8de516..652fccc 100644
@@ -77,16 +77,7 @@
  */
 #define IOREMAP_MAX_ORDER	24
 
-/*
- * Size of DMA-consistent memory region.  Must be multiple of 2M,
- * between 2MB and 14MB inclusive.
- */
-#ifndef CONSISTENT_DMA_SIZE
-#define CONSISTENT_DMA_SIZE 	SZ_2M
-#endif
-
 #define CONSISTENT_END		(0xffe00000UL)
-#define CONSISTENT_BASE		(CONSISTENT_END - CONSISTENT_DMA_SIZE)
 
 #else /* CONFIG_MMU */
 
arch/arm/mm/dma-mapping.c +38 -11
index 0a0a1e7..5b59ce5 100644
@@ -18,12 +18,14 @@
 #include <linux/device.h>
 #include <linux/dma-mapping.h>
 #include <linux/highmem.h>
+#include <linux/slab.h>
 
 #include <asm/memory.h>
 #include <asm/highmem.h>
 #include <asm/cacheflush.h>
 #include <asm/tlbflush.h>
 #include <asm/sizes.h>
+#include <asm/mach/arch.h>
 
 #include "mm.h"
 
@@ -117,26 +119,41 @@ static void __dma_free_buffer(struct page *page, size_t size)
 }
 
 #ifdef CONFIG_MMU
-/* Sanity check size */
-#if (CONSISTENT_DMA_SIZE % SZ_2M)
-#error "CONSISTENT_DMA_SIZE must be multiple of 2MiB"
-#endif
 
-#define CONSISTENT_OFFSET(x)	(((unsigned long)(x) - CONSISTENT_BASE) >> PAGE_SHIFT)
-#define CONSISTENT_PTE_INDEX(x) (((unsigned long)(x) - CONSISTENT_BASE) >> PGDIR_SHIFT)
-#define NUM_CONSISTENT_PTES (CONSISTENT_DMA_SIZE >> PGDIR_SHIFT)
+
+#define CONSISTENT_OFFSET(x)	(((unsigned long)(x) - consistent_base) >> PAGE_SHIFT)
+#define CONSISTENT_PTE_INDEX(x) (((unsigned long)(x) - consistent_base) >> PGDIR_SHIFT)
 
 /*
  * These are the page tables (2MB each) covering uncached, DMA consistent allocations
  */
-static pte_t *consistent_pte[NUM_CONSISTENT_PTES];
+static pte_t **consistent_pte;
+
+#ifdef CONSISTENT_DMA_SIZE
+#define DEFAULT_CONSISTENT_DMA_SIZE CONSISTENT_DMA_SIZE
+#else
+#define DEFAULT_CONSISTENT_DMA_SIZE SZ_2M
+#endif
+
+unsigned long consistent_base = CONSISTENT_END - DEFAULT_CONSISTENT_DMA_SIZE;
+
+void __init init_consistent_dma_size(unsigned long size)
+{
+	unsigned long base = CONSISTENT_END - ALIGN(size, SZ_2M);
+
+	BUG_ON(consistent_pte); /* Check we're called before DMA region init */
+	BUG_ON(base < VMALLOC_END);
+
+	/* Grow region to accommodate specified size  */
+	if (base < consistent_base)
+		consistent_base = base;
+}
 
 #include "vmregion.h"
 
 static struct arm_vmregion_head consistent_head = {
 	.vm_lock	= __SPIN_LOCK_UNLOCKED(&consistent_head.vm_lock),
 	.vm_list	= LIST_HEAD_INIT(consistent_head.vm_list),
-	.vm_start	= CONSISTENT_BASE,
 	.vm_end		= CONSISTENT_END,
 };
 
@@ -155,7 +172,17 @@ static int __init consistent_init(void)
 	pmd_t *pmd;
 	pte_t *pte;
 	int i = 0;
-	u32 base = CONSISTENT_BASE;
+	unsigned long base = consistent_base;
+	unsigned long num_ptes = (CONSISTENT_END - base) >> PGDIR_SHIFT;
+
+	consistent_pte = kmalloc(num_ptes * sizeof(pte_t), GFP_KERNEL);
+	if (!consistent_pte) {
+		pr_err("%s: no memory\n", __func__);
+		return -ENOMEM;
+	}
+
+	pr_debug("DMA memory: 0x%08lx - 0x%08lx:\n", base, CONSISTENT_END);
+	consistent_head.vm_start = base;
 
 	do {
 		pgd = pgd_offset(&init_mm, base);
@@ -198,7 +225,7 @@ __dma_alloc_remap(struct page *page, size_t size, gfp_t gfp, pgprot_t prot)
 	size_t align;
 	int bit;
 
-	if (!consistent_pte[0]) {
+	if (!consistent_pte) {
 		printk(KERN_ERR "%s: not initialised\n", __func__);
 		dump_stack();
 		return NULL;
arch/arm/mm/init.c +0 -9
index 2fee782..2a7c173 100644
@@ -653,9 +653,6 @@ void __init mem_init(void)
 			"    ITCM    : 0x%08lx - 0x%08lx   (%4ld kB)\n"
 #endif
 			"    fixmap  : 0x%08lx - 0x%08lx   (%4ld kB)\n"
-#ifdef CONFIG_MMU
-			"    DMA     : 0x%08lx - 0x%08lx   (%4ld MB)\n"
-#endif
 			"    vmalloc : 0x%08lx - 0x%08lx   (%4ld MB)\n"
 			"    lowmem  : 0x%08lx - 0x%08lx   (%4ld MB)\n"
 #ifdef CONFIG_HIGHMEM
@@ -674,9 +671,6 @@ void __init mem_init(void)
 			MLK(ITCM_OFFSET, (unsigned long) itcm_end),
 #endif
 			MLK(FIXADDR_START, FIXADDR_TOP),
-#ifdef CONFIG_MMU
-			MLM(CONSISTENT_BASE, CONSISTENT_END),
-#endif
 			MLM(VMALLOC_START, VMALLOC_END),
 			MLM(PAGE_OFFSET, (unsigned long)high_memory),
 #ifdef CONFIG_HIGHMEM
@@ -699,9 +693,6 @@ void __init mem_init(void)
 	 * be detected at build time already.
 	 */
 #ifdef CONFIG_MMU
-	BUILD_BUG_ON(VMALLOC_END			> CONSISTENT_BASE);
-	BUG_ON(VMALLOC_END				> CONSISTENT_BASE);
-
 	BUILD_BUG_ON(TASK_SIZE				> MODULES_VADDR);
 	BUG_ON(TASK_SIZE 				> MODULES_VADDR);
 #endif
Signature · 7 lines
1.7.2.5


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#3 lore raw

PATCH 2/12 ARM: omap: Setup consistent dma size at boot time

In reply to Jon Medhurst
---
 arch/arm/plat-omap/include/plat/io.h     |    2 ++
 arch/arm/plat-omap/include/plat/memory.h |   13 -------------
 arch/arm/mach-omap1/io.c                 |    1 +
 arch/arm/mach-omap2/io.c                 |    2 +-
 arch/arm/plat-omap/io.c                  |    8 ++++++++
 5 files changed, 12 insertions(+), 14 deletions(-)
arch/arm/plat-omap/include/plat/io.h +2 -0
index d72ec85..ebe67ea 100644
@@ -309,6 +309,8 @@ extern void omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0,
 void __iomem *omap_ioremap(unsigned long phys, size_t size, unsigned int type);
 void omap_iounmap(volatile void __iomem *addr);
 
+extern void __init omap_init_consistent_dma_size(void);
+
 #endif
 
 #endif
arch/arm/plat-omap/include/plat/memory.h +0 -13
index e6720aa..7f9df6f 100644
@@ -85,18 +85,5 @@
 
 #endif	/* CONFIG_ARCH_OMAP15XX */
 
-/* Override the ARM default */
-#ifdef CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE
-
-#if (CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE == 0)
-#undef CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE
-#define CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE 2
-#endif
-
-#define CONSISTENT_DMA_SIZE \
-	(((CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE + 1) & ~1) * 1024 * 1024)
-
-#endif
-
 #endif
 
arch/arm/mach-omap1/io.c +1 -0
index 870886a..1cfa1b6 100644
@@ -121,6 +121,7 @@ void __init omap1_map_common_io(void)
 #endif
 
 	omap_sram_init();
+	omap_init_consistent_dma_size();
 }
 
 /*
arch/arm/mach-omap2/io.c +1 -1
index 2ce1ce6..d6d01cb 100644
@@ -16,7 +16,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -250,6 +249,7 @@ static void __init _omap2_map_common_io(void)
 
 	omap2_check_revision();
 	omap_sram_init();
+	omap_init_consistent_dma_size();
 }
 
 #ifdef CONFIG_SOC_OMAP2420
arch/arm/plat-omap/io.c +8 -0
index f1ecfa9..e9b0e23 100644
@@ -12,6 +12,7 @@
 #include <linux/module.h>
 #include <linux/io.h>
 #include <linux/mm.h>
+#include <linux/dma-mapping.h>
 
 #include <plat/omap7xx.h>
 #include <plat/omap1510.h>
@@ -139,3 +140,10 @@ void omap_iounmap(volatile void __iomem *addr)
 		__iounmap(addr);
 }
 EXPORT_SYMBOL(omap_iounmap);
+
+void __init omap_init_consistent_dma_size(void)
+{
+#ifdef CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE
+	init_consistent_dma_size(CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE << 20);
+#endif
+}
Signature · 1 line
1.7.2.5
#4 lore raw

PATCH 3/12 ARM: mach-s3c64xx: Setup consistent dma size at boot time

In reply to Jon Medhurst
---
 arch/arm/mach-s3c64xx/include/mach/memory.h |    2 --
 arch/arm/mach-s3c64xx/cpu.c                 |    2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-s3c64xx/include/mach/memory.h +0 -2
index 4760cda..b704669 100644
@@ -15,6 +15,4 @@
 
 #define PLAT_PHYS_OFFSET     UL(0x50000000)
 
-#define CONSISTENT_DMA_SIZE	SZ_8M
-
 #endif
arch/arm/mach-s3c64xx/cpu.c +2 -0
index 374e45e..8dc0576 100644
@@ -20,6 +20,7 @@
 #include <linux/serial_core.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
+#include <linux/dma-mapping.h>
 
 #include <mach/hardware.h>
 #include <mach/map.h>
@@ -145,6 +146,7 @@ void __init s3c64xx_init_io(struct map_desc *mach_desc, int size)
 	/* initialise the io descriptors we need for initialisation */
 	iotable_init(s3c_iodesc, ARRAY_SIZE(s3c_iodesc));
 	iotable_init(mach_desc, size);
+	init_consistent_dma_size(SZ_8M);
 
 	idcode = __raw_readl(S3C_VA_SYS + 0x118);
 	if (!idcode) {
Signature · 1 line
1.7.2.5
#5 lore raw

PATCH 4/12 ARM: mach-s5p64x0: Setup consistent dma size at boot time

In reply to Jon Medhurst
---
 arch/arm/mach-s5p64x0/include/mach/memory.h |    1 -
 arch/arm/mach-s5p64x0/cpu.c                 |    3 +++
 2 files changed, 3 insertions(+), 1 deletions(-)
arch/arm/mach-s5p64x0/include/mach/memory.h +0 -1
index 365a6eb..b14cbc3 100644
@@ -14,6 +14,5 @@
 #define __ASM_ARCH_MEMORY_H __FILE__
 
 #define PLAT_PHYS_OFFSET		UL(0x20000000)
-#define CONSISTENT_DMA_SIZE	SZ_8M
 
 #endif /* __ASM_ARCH_MEMORY_H */
arch/arm/mach-s5p64x0/cpu.c +3 -0
index a5c0095..8a93854 100644
@@ -20,6 +20,7 @@
 #include <linux/serial_core.h>
 #include <linux/platform_device.h>
 #include <linux/sched.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -111,6 +112,7 @@ void __init s5p6440_map_io(void)
 
 	iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc));
 	iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc));
+	init_consistent_dma_size(SZ_8M);
 }
 
 void __init s5p6450_map_io(void)
@@ -120,6 +122,7 @@ void __init s5p6450_map_io(void)
 
 	iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc));
 	iotable_init(s5p6450_iodesc, ARRAY_SIZE(s5p6450_iodesc));
+	init_consistent_dma_size(SZ_8M);
 }
 
 /*
Signature · 1 line
1.7.2.5
#6 lore raw

PATCH 5/12 ARM: mach-s5pv210: Setup consistent dma size at boot time

In reply to Jon Medhurst
---
 arch/arm/mach-s5pv210/include/mach/memory.h |    1 -
 arch/arm/mach-s5pv210/cpu.c                 |    2 ++
 2 files changed, 2 insertions(+), 1 deletions(-)
arch/arm/mach-s5pv210/include/mach/memory.h +0 -1
index 7b5fcf0..2d3cfa2 100644
@@ -14,7 +14,6 @@
 #define __ASM_ARCH_MEMORY_H
 
 #define PLAT_PHYS_OFFSET		UL(0x20000000)
-#define CONSISTENT_DMA_SIZE	(SZ_8M + SZ_4M + SZ_2M)
 
 /*
  * Sparsemem support
arch/arm/mach-s5pv210/cpu.c +2 -0
index 79907ec..9114572 100644
@@ -20,6 +20,7 @@
 #include <linux/sysdev.h>
 #include <linux/platform_device.h>
 #include <linux/sched.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -119,6 +120,7 @@ static void s5pv210_sw_reset(void)
 void __init s5pv210_map_io(void)
 {
 	iotable_init(s5pv210_iodesc, ARRAY_SIZE(s5pv210_iodesc));
+	init_consistent_dma_size(14 << 20);
 
 	/* initialise device information early */
 	s5pv210_default_sdhci0();
Signature · 1 line
1.7.2.5
#7 lore raw

PATCH 5/12 ARM: mach-s5pv210: Setup consistent dma size at boot time

Quoted 3 lines

-#define CONSISTENT_DMA_SIZE (SZ_8M + SZ_4M + SZ_2M)

...

arch/arm/mach-s5pv210/cpu.c static void s5pv210_sw_reset(void) · line 123

Quoted 1 line
arch/arm/mach-s5pv210/cpu.c +1 -0
+	init_consistent_dma_size(14 << 20);

Are you sure that's equivalent?

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
author
#8 lore raw

PATCH 5/12 ARM: mach-s5pv210: Setup consistent dma size at boot time

Quoted 6 lines · Pavel Machek
Quoted 2 lines

-#define CONSISTENT_DMA_SIZE (SZ_8M + SZ_4M + SZ_2M)

...

arch/arm/mach-s5pv210/cpu.c static void s5pv210_sw_reset(void) · line 123

Quoted 1 line
arch/arm/mach-s5pv210/cpu.c +1 -0
+	init_consistent_dma_size(14 << 20);

Are you sure that's equivalent?

Yes. From include/asm-generic/sizes.h

#define SZ_2M 0x00200000
#define SZ_4M 0x00400000
#define SZ_8M 0x00800000

The max DMA size seems to be have been defined as 14MB at some point and several platforms define the size to be this value, but in different ways:

	SZ_16M - SZ_2M
	SZ_8M + SZ_4M + SZ_2M
	14 << 20

I chose to use just one for consistency, and (14 << 20) seemed clearer to me.

Signature · 1 line
Jon (a.k.a. Tixy)
#9 lore raw

PATCH 5/12 ARM: mach-s5pv210: Setup consistent dma size at boot time

Quoted 18 lines · Tixy
Quoted 6 lines · Pavel Machek
Quoted 2 lines

-#define CONSISTENT_DMA_SIZE (SZ_8M + SZ_4M + SZ_2M)

...

arch/arm/mach-s5pv210/cpu.c static void s5pv210_sw_reset(void) · line 123

Quoted 1 line
arch/arm/mach-s5pv210/cpu.c +1 -0
+	init_consistent_dma_size(14 << 20);

Are you sure that's equivalent?

Yes. From include/asm-generic/sizes.h

#define SZ_2M 0x00200000
#define SZ_4M 0x00400000
#define SZ_8M 0x00800000

The max DMA size seems to be have been defined as 14MB at some point and several platforms define the size to be this value, but in different ways:

Quoted 6 lines
	SZ_16M - SZ_2M
	SZ_8M + SZ_4M + SZ_2M
	14 << 20

I chose to use just one for consistency, and (14 << 20) seemed clearer to me.

I missed the "4" in "14". Doing 14 *1024*1024 would be more usual way of writing this...

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#10 lore raw

PATCH 6/12 ARM: mxc: Setup consistent dma size at boot time

In reply to Jon Medhurst
CC Sascha Hauer <[email protected]>
CC Amit Kucheria <[email protected]>
---
 arch/arm/plat-mxc/include/mach/common.h |    1 +
 arch/arm/plat-mxc/include/mach/memory.h |   15 ---------------
 arch/arm/mach-imx/mm-imx1.c             |    1 +
 arch/arm/mach-imx/mm-imx21.c            |    1 +
 arch/arm/mach-imx/mm-imx25.c            |    1 +
 arch/arm/mach-imx/mm-imx27.c            |    1 +
 arch/arm/mach-imx/mm-imx31.c            |    1 +
 arch/arm/mach-imx/mm-imx35.c            |    1 +
 arch/arm/mach-mx5/mm-mx50.c             |    1 +
 arch/arm/mach-mx5/mm.c                  |    2 ++
 arch/arm/plat-mxc/system.c              |   16 ++++++++++++++++
 11 files changed, 26 insertions(+), 15 deletions(-)
arch/arm/plat-mxc/include/mach/common.h +1 -0
index 4e3d978..40fb4d8 100644
@@ -72,4 +72,5 @@ extern void mxc_arch_reset_init(void __iomem *);
 extern void mx51_efikamx_reset(void);
 extern int mx53_revision(void);
 extern int mx53_display_revision(void);
+extern void __init mxc_init_consistent_dma_size(void);
 #endif
arch/arm/plat-mxc/include/mach/memory.h +0 -15
index 11be5cd..3ec84b9 100644
@@ -40,19 +40,4 @@
 # endif
 #endif
 
-#if defined(CONFIG_MX3_VIDEO)
-/*
- * Increase size of DMA-consistent memory region.
- * This is required for mx3 camera driver to capture at least two QXGA frames.
- */
-#define CONSISTENT_DMA_SIZE SZ_8M
-
-#elif defined(CONFIG_MX1_VIDEO) || defined(CONFIG_VIDEO_MX2_HOSTSUPPORT)
-/*
- * Increase size of DMA-consistent memory region.
- * This is required for i.MX camera driver to capture at least four VGA frames.
- */
-#define CONSISTENT_DMA_SIZE SZ_4M
-#endif /* CONFIG_MX1_VIDEO || CONFIG_VIDEO_MX2_HOSTSUPPORT */
-
 #endif /* __ASM_ARCH_MXC_MEMORY_H__ */
arch/arm/mach-imx/mm-imx1.c +1 -0
index 2bded59..f70e318 100644
@@ -33,6 +33,7 @@ static struct map_desc imx_io_desc[] __initdata = {
 void __init mx1_map_io(void)
 {
 	iotable_init(imx_io_desc, ARRAY_SIZE(imx_io_desc));
+	mxc_init_consistent_dma_size();
 }
 
 void __init imx1_init_early(void)
arch/arm/mach-imx/mm-imx21.c +1 -0
index 3f05dfe..440816a 100644
@@ -60,6 +60,7 @@ static struct map_desc imx21_io_desc[] __initdata = {
 void __init mx21_map_io(void)
 {
 	iotable_init(imx21_io_desc, ARRAY_SIZE(imx21_io_desc));
+	mxc_init_consistent_dma_size();
 }
 
 void __init imx21_init_early(void)
arch/arm/mach-imx/mm-imx25.c +1 -0
index cc4d152..12f5759 100644
@@ -48,6 +48,7 @@ static struct map_desc mx25_io_desc[] __initdata = {
 void __init mx25_map_io(void)
 {
 	iotable_init(mx25_io_desc, ARRAY_SIZE(mx25_io_desc));
+	mxc_init_consistent_dma_size();
 }
 
 void __init imx25_init_early(void)
arch/arm/mach-imx/mm-imx27.c +1 -0
index 96dd1f5..8799265 100644
@@ -60,6 +60,7 @@ static struct map_desc imx27_io_desc[] __initdata = {
 void __init mx27_map_io(void)
 {
 	iotable_init(imx27_io_desc, ARRAY_SIZE(imx27_io_desc));
+	mxc_init_consistent_dma_size();
 }
 
 void __init imx27_init_early(void)
arch/arm/mach-imx/mm-imx31.c +1 -0
index b7c55e7..b2331cf 100644
@@ -45,6 +45,7 @@ static struct map_desc mx31_io_desc[] __initdata = {
 void __init mx31_map_io(void)
 {
 	iotable_init(mx31_io_desc, ARRAY_SIZE(mx31_io_desc));
+	mxc_init_consistent_dma_size();
 }
 
 void __init imx31_init_early(void)
arch/arm/mach-imx/mm-imx35.c +1 -0
index f49bac7..eb60521 100644
@@ -41,6 +41,7 @@ static struct map_desc mx35_io_desc[] __initdata = {
 void __init mx35_map_io(void)
 {
 	iotable_init(mx35_io_desc, ARRAY_SIZE(mx35_io_desc));
+	mxc_init_consistent_dma_size();
 }
 
 void __init imx35_init_early(void)
arch/arm/mach-mx5/mm-mx50.c +1 -0
index 77e374c..04a02cc 100644
@@ -46,6 +46,7 @@ static struct map_desc mx50_io_desc[] __initdata = {
 void __init mx50_map_io(void)
 {
 	iotable_init(mx50_io_desc, ARRAY_SIZE(mx50_io_desc));
+	mxc_init_consistent_dma_size();
 }
 
 void __init imx50_init_early(void)
arch/arm/mach-mx5/mm.c +2 -0
index baea6e5..e0ca2b5 100644
@@ -49,6 +49,7 @@ static struct map_desc mx53_io_desc[] __initdata = {
 void __init mx51_map_io(void)
 {
 	iotable_init(mx51_io_desc, ARRAY_SIZE(mx51_io_desc));
+	mxc_init_consistent_dma_size();
 }
 
 void __init imx51_init_early(void)
@@ -61,6 +62,7 @@ void __init imx51_init_early(void)
 void __init mx53_map_io(void)
 {
 	iotable_init(mx53_io_desc, ARRAY_SIZE(mx53_io_desc));
+	mxc_init_consistent_dma_size();
 }
 
 void __init imx53_init_early(void)
arch/arm/plat-mxc/system.c +16 -0
index 8024f2a..75d1592 100644
@@ -21,6 +21,7 @@
 #include <linux/io.h>
 #include <linux/err.h>
 #include <linux/delay.h>
+#include <linux/dma-mapping.h>
 
 #include <mach/hardware.h>
 #include <mach/common.h>
@@ -74,3 +75,18 @@ void mxc_arch_reset_init(void __iomem *base)
 {
 	wdog_base = base;
 }
+
+void __init mxc_init_consistent_dma_size(void)
+{
+#if defined(CONFIG_MX3_VIDEO)
+
+	/* Required for mx3 camera driver to capture at least two QXGA frames */
+	init_consistent_dma_size(SZ_8M);
+
+#elif defined(CONFIG_MX1_VIDEO) || defined(CONFIG_VIDEO_MX2_HOSTSUPPORT)
+
+	/* Required for i.MX camera driver to capture at least 4 VGA frames */
+	init_consistent_dma_size(SZ_4M);
+
+#endif
+}
Signature · 1 line
1.7.2.5
maintainer
#11 lore raw

PATCH 6/12 ARM: mxc: Setup consistent dma size at boot time

Hi Jon,

Quoted 16 lines · Jon Medhurst
CC Sascha Hauer <[email protected]>
CC Amit Kucheria <[email protected]>
---
 arch/arm/plat-mxc/include/mach/common.h |    1 +
 arch/arm/plat-mxc/include/mach/memory.h |   15 ---------------
 arch/arm/mach-imx/mm-imx1.c             |    1 +
 arch/arm/mach-imx/mm-imx21.c            |    1 +
 arch/arm/mach-imx/mm-imx25.c            |    1 +
 arch/arm/mach-imx/mm-imx27.c            |    1 +
 arch/arm/mach-imx/mm-imx31.c            |    1 +
 arch/arm/mach-imx/mm-imx35.c            |    1 +
 arch/arm/mach-mx5/mm-mx50.c             |    1 +
 arch/arm/mach-mx5/mm.c                  |    2 ++
 arch/arm/plat-mxc/system.c              |   16 ++++++++++++++++
 11 files changed, 26 insertions(+), 15 deletions(-)

Should the base patch be ok I'd like to rework this one. I want to call init_consistent_dma_size on a per board base instead in a global function with ifdeffery.

Sascha

Quoted 174 lines
arch/arm/plat-mxc/include/mach/common.h +1 -0
index 4e3d978..40fb4d8 100644
@@ -72,4 +72,5 @@ extern void mxc_arch_reset_init(void __iomem *);
 extern void mx51_efikamx_reset(void);
 extern int mx53_revision(void);
 extern int mx53_display_revision(void);
+extern void __init mxc_init_consistent_dma_size(void);
 #endif
arch/arm/plat-mxc/include/mach/memory.h +0 -15
index 11be5cd..3ec84b9 100644
@@ -40,19 +40,4 @@
 # endif
 #endif
 
-#if defined(CONFIG_MX3_VIDEO)
-/*
- * Increase size of DMA-consistent memory region.
- * This is required for mx3 camera driver to capture at least two QXGA frames.
- */
-#define CONSISTENT_DMA_SIZE SZ_8M
-
-#elif defined(CONFIG_MX1_VIDEO) || defined(CONFIG_VIDEO_MX2_HOSTSUPPORT)
-/*
- * Increase size of DMA-consistent memory region.
- * This is required for i.MX camera driver to capture at least four VGA frames.
- */
-#define CONSISTENT_DMA_SIZE SZ_4M
-#endif /* CONFIG_MX1_VIDEO || CONFIG_VIDEO_MX2_HOSTSUPPORT */
-
 #endif /* __ASM_ARCH_MXC_MEMORY_H__ */
arch/arm/mach-imx/mm-imx1.c +1 -0
index 2bded59..f70e318 100644
@@ -33,6 +33,7 @@ static struct map_desc imx_io_desc[] __initdata = {
 void __init mx1_map_io(void)
 {
 	iotable_init(imx_io_desc, ARRAY_SIZE(imx_io_desc));
+	mxc_init_consistent_dma_size();
 }
 
 void __init imx1_init_early(void)
arch/arm/mach-imx/mm-imx21.c +1 -0
index 3f05dfe..440816a 100644
@@ -60,6 +60,7 @@ static struct map_desc imx21_io_desc[] __initdata = {
 void __init mx21_map_io(void)
 {
 	iotable_init(imx21_io_desc, ARRAY_SIZE(imx21_io_desc));
+	mxc_init_consistent_dma_size();
 }
 
 void __init imx21_init_early(void)
arch/arm/mach-imx/mm-imx25.c +1 -0
index cc4d152..12f5759 100644
@@ -48,6 +48,7 @@ static struct map_desc mx25_io_desc[] __initdata = {
 void __init mx25_map_io(void)
 {
 	iotable_init(mx25_io_desc, ARRAY_SIZE(mx25_io_desc));
+	mxc_init_consistent_dma_size();
 }
 
 void __init imx25_init_early(void)
arch/arm/mach-imx/mm-imx27.c +1 -0
index 96dd1f5..8799265 100644
@@ -60,6 +60,7 @@ static struct map_desc imx27_io_desc[] __initdata = {
 void __init mx27_map_io(void)
 {
 	iotable_init(imx27_io_desc, ARRAY_SIZE(imx27_io_desc));
+	mxc_init_consistent_dma_size();
 }
 
 void __init imx27_init_early(void)
arch/arm/mach-imx/mm-imx31.c +1 -0
index b7c55e7..b2331cf 100644
@@ -45,6 +45,7 @@ static struct map_desc mx31_io_desc[] __initdata = {
 void __init mx31_map_io(void)
 {
 	iotable_init(mx31_io_desc, ARRAY_SIZE(mx31_io_desc));
+	mxc_init_consistent_dma_size();
 }
 
 void __init imx31_init_early(void)
arch/arm/mach-imx/mm-imx35.c +1 -0
index f49bac7..eb60521 100644
@@ -41,6 +41,7 @@ static struct map_desc mx35_io_desc[] __initdata = {
 void __init mx35_map_io(void)
 {
 	iotable_init(mx35_io_desc, ARRAY_SIZE(mx35_io_desc));
+	mxc_init_consistent_dma_size();
 }
 
 void __init imx35_init_early(void)
arch/arm/mach-mx5/mm-mx50.c +1 -0
index 77e374c..04a02cc 100644
@@ -46,6 +46,7 @@ static struct map_desc mx50_io_desc[] __initdata = {
 void __init mx50_map_io(void)
 {
 	iotable_init(mx50_io_desc, ARRAY_SIZE(mx50_io_desc));
+	mxc_init_consistent_dma_size();
 }
 
 void __init imx50_init_early(void)
arch/arm/mach-mx5/mm.c +2 -0
index baea6e5..e0ca2b5 100644
@@ -49,6 +49,7 @@ static struct map_desc mx53_io_desc[] __initdata = {
 void __init mx51_map_io(void)
 {
 	iotable_init(mx51_io_desc, ARRAY_SIZE(mx51_io_desc));
+	mxc_init_consistent_dma_size();
 }
 
 void __init imx51_init_early(void)
@@ -61,6 +62,7 @@ void __init imx51_init_early(void)
 void __init mx53_map_io(void)
 {
 	iotable_init(mx53_io_desc, ARRAY_SIZE(mx53_io_desc));
+	mxc_init_consistent_dma_size();
 }
 
 void __init imx53_init_early(void)
arch/arm/plat-mxc/system.c +16 -0
index 8024f2a..75d1592 100644
@@ -21,6 +21,7 @@
 #include <linux/io.h>
 #include <linux/err.h>
 #include <linux/delay.h>
+#include <linux/dma-mapping.h>
 
 #include <mach/hardware.h>
 #include <mach/common.h>
@@ -74,3 +75,18 @@ void mxc_arch_reset_init(void __iomem *base)
 {
 	wdog_base = base;
 }
+
+void __init mxc_init_consistent_dma_size(void)
+{
+#if defined(CONFIG_MX3_VIDEO)
+
+	/* Required for mx3 camera driver to capture at least two QXGA frames */
+	init_consistent_dma_size(SZ_8M);
+
+#elif defined(CONFIG_MX1_VIDEO) || defined(CONFIG_VIDEO_MX2_HOSTSUPPORT)
+
+	/* Required for i.MX camera driver to capture at least 4 VGA frames */
+	init_consistent_dma_size(SZ_4M);
+
+#endif
+}
Signature · 1 line
1.7.2.5
Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
author
#12 lore raw

PATCH 6/12 ARM: mxc: Setup consistent dma size at boot time

Quoted 20 lines · Sascha Hauer

Hi Jon,

Quoted 16 lines · Jon Medhurst
CC Sascha Hauer <[email protected]>
CC Amit Kucheria <[email protected]>
---
 arch/arm/plat-mxc/include/mach/common.h |    1 +
 arch/arm/plat-mxc/include/mach/memory.h |   15 ---------------
 arch/arm/mach-imx/mm-imx1.c             |    1 +
 arch/arm/mach-imx/mm-imx21.c            |    1 +
 arch/arm/mach-imx/mm-imx25.c            |    1 +
 arch/arm/mach-imx/mm-imx27.c            |    1 +
 arch/arm/mach-imx/mm-imx31.c            |    1 +
 arch/arm/mach-imx/mm-imx35.c            |    1 +
 arch/arm/mach-mx5/mm-mx50.c             |    1 +
 arch/arm/mach-mx5/mm.c                  |    2 ++
 arch/arm/plat-mxc/system.c              |   16 ++++++++++++++++
 11 files changed, 26 insertions(+), 15 deletions(-)
Quoted 3 lines

Should the base patch be ok I'd like to rework this one. I want to call init_consistent_dma_size on a per board base instead in a global function with ifdeffery.

Yes, that would be the a better way. I started down that route myself but realised I didn't have the confidence to be certain which video drivers and config options were valid with which platforms. So I played safe and kept the existing behaviour.

Signature · 1 line
Jon (often known as Tixy)
#13 lore raw

PATCH 6/12 ARM: mxc: Setup consistent dma size at boot time

In reply to Sascha Hauer
Quoted 20 lines · Sascha Hauer

Hi Jon,

Quoted 16 lines · Jon Medhurst
CC Sascha Hauer <[email protected]>
CC Amit Kucheria <[email protected]>
---
 arch/arm/plat-mxc/include/mach/common.h |    1 +
 arch/arm/plat-mxc/include/mach/memory.h |   15 ---------------
 arch/arm/mach-imx/mm-imx1.c             |    1 +
 arch/arm/mach-imx/mm-imx21.c            |    1 +
 arch/arm/mach-imx/mm-imx25.c            |    1 +
 arch/arm/mach-imx/mm-imx27.c            |    1 +
 arch/arm/mach-imx/mm-imx31.c            |    1 +
 arch/arm/mach-imx/mm-imx35.c            |    1 +
 arch/arm/mach-mx5/mm-mx50.c             |    1 +
 arch/arm/mach-mx5/mm.c                  |    2 ++
 arch/arm/plat-mxc/system.c              |   16 ++++++++++++++++
 11 files changed, 26 insertions(+), 15 deletions(-)
Quoted 3 lines

Should the base patch be ok I'd like to rework this one. I want to call init_consistent_dma_size on a per board base instead in a global function with ifdeffery.

Hello Sascha,

Did you manage to work on this? Ideally it would be nice to have a reworked patch from you that could be used in this series as some later patches depend on this series.

Thanks.

Nicolas

author
#14 lore raw

PATCH 6/12 ARM: mxc: Setup consistent dma size at boot time

Quoted 26 lines · Nicolas Pitre
Quoted 20 lines · Sascha Hauer

Hi Jon,

Quoted 16 lines · Jon Medhurst
CC Sascha Hauer <[email protected]>
CC Amit Kucheria <[email protected]>
---
 arch/arm/plat-mxc/include/mach/common.h |    1 +
 arch/arm/plat-mxc/include/mach/memory.h |   15 ---------------
 arch/arm/mach-imx/mm-imx1.c             |    1 +
 arch/arm/mach-imx/mm-imx21.c            |    1 +
 arch/arm/mach-imx/mm-imx25.c            |    1 +
 arch/arm/mach-imx/mm-imx27.c            |    1 +
 arch/arm/mach-imx/mm-imx31.c            |    1 +
 arch/arm/mach-imx/mm-imx35.c            |    1 +
 arch/arm/mach-mx5/mm-mx50.c             |    1 +
 arch/arm/mach-mx5/mm.c                  |    2 ++
 arch/arm/plat-mxc/system.c              |   16 ++++++++++++++++
 11 files changed, 26 insertions(+), 15 deletions(-)
Quoted 3 lines

Should the base patch be ok I'd like to rework this one. I want to call init_consistent_dma_size on a per board base instead in a global function with ifdeffery.

Quoted 5 lines

Hello Sascha,

Did you manage to work on this? Ideally it would be nice to have a reworked patch from you that could be used in this series as some later patches depend on this series.

Are we happy with the base patch? Specifically, having init_consistent_dma_size() declaired in include/asm/dma-mapping.h?

If so, I don't mind making the changes if Sascha can give me some rules and pattern to apply. E.g. is it

In mach-imx/mm-imx2*.c

#if defined(CONFIG_VIDEO_MX2_HOSTSUPPORT)
	init_consistent_dma_size(SZ_4M);

#endif

And likewise with CONFIG_MX1_VIDEO in mach-imx/mm-imx1.c and CONFIG_MX3_VIDEO in mach-imx/mm-imx3*.c.

What about mach-mx5?

Signature · 1 line
Tixy
maintainer
#15 lore raw

PATCH 6/12 ARM: mxc: Setup consistent dma size at boot time

Quoted 41 lines · Tixy
Quoted 26 lines · Nicolas Pitre
Quoted 20 lines · Sascha Hauer

Hi Jon,

Quoted 16 lines · Jon Medhurst
CC Sascha Hauer <[email protected]>
CC Amit Kucheria <[email protected]>
---
 arch/arm/plat-mxc/include/mach/common.h |    1 +
 arch/arm/plat-mxc/include/mach/memory.h |   15 ---------------
 arch/arm/mach-imx/mm-imx1.c             |    1 +
 arch/arm/mach-imx/mm-imx21.c            |    1 +
 arch/arm/mach-imx/mm-imx25.c            |    1 +
 arch/arm/mach-imx/mm-imx27.c            |    1 +
 arch/arm/mach-imx/mm-imx31.c            |    1 +
 arch/arm/mach-imx/mm-imx35.c            |    1 +
 arch/arm/mach-mx5/mm-mx50.c             |    1 +
 arch/arm/mach-mx5/mm.c                  |    2 ++
 arch/arm/plat-mxc/system.c              |   16 ++++++++++++++++
 11 files changed, 26 insertions(+), 15 deletions(-)
Quoted 3 lines

Should the base patch be ok I'd like to rework this one. I want to call init_consistent_dma_size on a per board base instead in a global function with ifdeffery.

Quoted 5 lines

Hello Sascha,

Did you manage to work on this? Ideally it would be nice to have a reworked patch from you that could be used in this series as some later patches depend on this series.

Are we happy with the base patch? Specifically, having init_consistent_dma_size() declaired in include/asm/dma-mapping.h?

If so, I don't mind making the changes if Sascha can give me some rules and pattern to apply. E.g. is it

In mach-imx/mm-imx2*.c

Quoted 8 lines
#if defined(CONFIG_VIDEO_MX2_HOSTSUPPORT)
	init_consistent_dma_size(SZ_4M);

#endif

And likewise with CONFIG_MX1_VIDEO in mach-imx/mm-imx1.c and CONFIG_MX3_VIDEO in mach-imx/mm-imx3*.c.

What about mach-mx5?

Sorry, I forgot about this issue. The solution is really simple: All boards in tree using video use memblock_* functions to get their coherent dma space for the camera. So we can just remove all CONSISTENT_DMA_SIZE defines in arch/arm/plat-mxc/include/mach/memory.h.

If I understand your patch correctly we get a default size of 2MiB when init_consistent_dma_size() is not called. That's fine for the other i.MX boards.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
author
#16 lore raw

PATCH 6/12 ARM: mxc: Setup consistent dma size at boot time

Quoted 51 lines · Sascha Hauer
Quoted 41 lines · Tixy
Quoted 26 lines · Nicolas Pitre
Quoted 20 lines · Sascha Hauer

Hi Jon,

Quoted 16 lines · Jon Medhurst
CC Sascha Hauer <[email protected]>
CC Amit Kucheria <[email protected]>
---
 arch/arm/plat-mxc/include/mach/common.h |    1 +
 arch/arm/plat-mxc/include/mach/memory.h |   15 ---------------
 arch/arm/mach-imx/mm-imx1.c             |    1 +
 arch/arm/mach-imx/mm-imx21.c            |    1 +
 arch/arm/mach-imx/mm-imx25.c            |    1 +
 arch/arm/mach-imx/mm-imx27.c            |    1 +
 arch/arm/mach-imx/mm-imx31.c            |    1 +
 arch/arm/mach-imx/mm-imx35.c            |    1 +
 arch/arm/mach-mx5/mm-mx50.c             |    1 +
 arch/arm/mach-mx5/mm.c                  |    2 ++
 arch/arm/plat-mxc/system.c              |   16 ++++++++++++++++
 11 files changed, 26 insertions(+), 15 deletions(-)
Quoted 3 lines

Should the base patch be ok I'd like to rework this one. I want to call init_consistent_dma_size on a per board base instead in a global function with ifdeffery.

Quoted 5 lines

Hello Sascha,

Did you manage to work on this? Ideally it would be nice to have a reworked patch from you that could be used in this series as some later patches depend on this series.

Are we happy with the base patch? Specifically, having init_consistent_dma_size() declaired in include/asm/dma-mapping.h?

If so, I don't mind making the changes if Sascha can give me some rules and pattern to apply. E.g. is it

In mach-imx/mm-imx2*.c

Quoted 8 lines
#if defined(CONFIG_VIDEO_MX2_HOSTSUPPORT)
	init_consistent_dma_size(SZ_4M);

#endif

And likewise with CONFIG_MX1_VIDEO in mach-imx/mm-imx1.c and CONFIG_MX3_VIDEO in mach-imx/mm-imx3*.c.

What about mach-mx5?

Quoted 8 lines

Sorry, I forgot about this issue. The solution is really simple: All boards in tree using video use memblock_* functions to get their coherent dma space for the camera. So we can just remove all CONSISTENT_DMA_SIZE defines in arch/arm/plat-mxc/include/mach/memory.h.

If I understand your patch correctly we get a default size of 2MiB when init_consistent_dma_size() is not called. That's fine for the other i.MX boards.

Just to make sure I've understood. I see memblock_ calls in

	mach-mx31_3ds.c
	mach-pcm037.c
	mach-mx31moboard.c

these all seem to be mx3 related.

For mx1 and mx2, these currently increase CONSISTENT_DMA_SIZE to 4MB, but the 2MB default is actually big enough for these?

Therefore, as you said, we can just delete the definitions of CONSISTENT_DMA_SIZE from memory.h and leave all other imx and mx5 files unchanged.

Thanks.

Signature · 1 line
Tixy
maintainer
#17 lore raw

PATCH 6/12 ARM: mxc: Setup consistent dma size at boot time

Quoted 9 lines · Tixy
Quoted 8 lines

Sorry, I forgot about this issue. The solution is really simple: All boards in tree using video use memblock_* functions to get their coherent dma space for the camera. So we can just remove all CONSISTENT_DMA_SIZE defines in arch/arm/plat-mxc/include/mach/memory.h.

If I understand your patch correctly we get a default size of 2MiB when init_consistent_dma_size() is not called. That's fine for the other i.MX boards.

Quoted 8 lines

Just to make sure I've understood. I see memblock_ calls in

	mach-mx31_3ds.c
	mach-pcm037.c
	mach-mx31moboard.c

these all seem to be mx3 related.

For mx1 and mx2, these currently increase CONSISTENT_DMA_SIZE to 4MB, but the 2MB default is actually big enough for these?

It should be bigger for boards which make use of the camera driver, but no mx1/2 board in the tree currently registers the camera.

Quoted 4 lines

Therefore, as you said, we can just delete the definitions of CONSISTENT_DMA_SIZE from memory.h and leave all other imx and mx5 files unchanged.

Yes

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
author
#18 lore raw

PATCH 6/12 ARM: mxc: Setup consistent dma size at boot time

Hi Sascha, does the following revised patch gain receive your Acked-by?...

From: Jon Medhurst <[email protected]>

All in tree MX boards using video use memblock_* functions to get their coherent dma space for the camera, so there is no need to increase CONSISTENT_DMA_SIZE beyond the default and we can simply remove the defines which do this.

---
 arch/arm/plat-mxc/include/mach/memory.h |   15 ---------------
 1 files changed, 0 insertions(+), 15 deletions(-)
arch/arm/plat-mxc/include/mach/memory.h +0 -15
index 11be5cd..3ec84b9 100644
@@ -40,19 +40,4 @@
 # endif
 #endif
 
-#if defined(CONFIG_MX3_VIDEO)
-/*
- * Increase size of DMA-consistent memory region.
- * This is required for mx3 camera driver to capture at least two QXGA frames.
- */
-#define CONSISTENT_DMA_SIZE SZ_8M
-
-#elif defined(CONFIG_MX1_VIDEO) || defined(CONFIG_VIDEO_MX2_HOSTSUPPORT)
-/*
- * Increase size of DMA-consistent memory region.
- * This is required for i.MX camera driver to capture at least four VGA frames.
- */
-#define CONSISTENT_DMA_SIZE SZ_4M
-#endif /* CONFIG_MX1_VIDEO || CONFIG_VIDEO_MX2_HOSTSUPPORT */
-
 #endif /* __ASM_ARCH_MXC_MEMORY_H__ */
Signature · 1 line
1.7.2.5
maintainer
#19 lore raw

PATCH 6/12 ARM: mxc: Setup consistent dma size at boot time

Quoted 11 lines · Tixy

Hi Sascha, does the following revised patch gain receive your Acked-by?...

From: Jon Medhurst <[email protected]>

All in tree MX boards using video use memblock_* functions to get their coherent dma space for the camera, so there is no need to increase CONSISTENT_DMA_SIZE beyond the default and we can simply remove the defines which do this.

Quoted 33 lines
---
 arch/arm/plat-mxc/include/mach/memory.h |   15 ---------------
 1 files changed, 0 insertions(+), 15 deletions(-)
arch/arm/plat-mxc/include/mach/memory.h +0 -15
index 11be5cd..3ec84b9 100644
@@ -40,19 +40,4 @@
 # endif
 #endif
 
-#if defined(CONFIG_MX3_VIDEO)
-/*
- * Increase size of DMA-consistent memory region.
- * This is required for mx3 camera driver to capture at least two QXGA frames.
- */
-#define CONSISTENT_DMA_SIZE SZ_8M
-
-#elif defined(CONFIG_MX1_VIDEO) || defined(CONFIG_VIDEO_MX2_HOSTSUPPORT)
-/*
- * Increase size of DMA-consistent memory region.
- * This is required for i.MX camera driver to capture at least four VGA frames.
- */
-#define CONSISTENT_DMA_SIZE SZ_4M
-#endif /* CONFIG_MX1_VIDEO || CONFIG_VIDEO_MX2_HOSTSUPPORT */
-
 #endif /* __ASM_ARCH_MXC_MEMORY_H__ */
Signature · 1 line
1.7.2.5
Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#20 lore raw

PATCH 7/12 ARM: mach-davinci: Setup consistent dma size at boot time

In reply to Jon Medhurst
CC Sekhar Nori <[email protected]>
CC Kevin Hilman <[email protected]>
---
 arch/arm/mach-davinci/include/mach/memory.h |    5 -----
 arch/arm/mach-davinci/common.c              |    3 +++
 2 files changed, 3 insertions(+), 5 deletions(-)
arch/arm/mach-davinci/include/mach/memory.h +0 -5
index 7873194..885d233 100644
@@ -36,9 +36,4 @@
 #define DDR2_MCLKSTOPEN_BIT	BIT(30)
 #define DDR2_LPMODEN_BIT	BIT(31)
 
-/*
- * Increase size of DMA-consistent memory region
- */
-#define CONSISTENT_DMA_SIZE (14<<20)
-
 #endif /* __ASM_ARCH_MEMORY_H */
arch/arm/mach-davinci/common.c +3 -0
index 1d25573..865ffe5 100644
@@ -12,6 +12,7 @@
 #include <linux/io.h>
 #include <linux/etherdevice.h>
 #include <linux/davinci_emac.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/tlb.h>
 #include <asm/mach/map.h>
@@ -86,6 +87,8 @@ void __init davinci_common_init(struct davinci_soc_info *soc_info)
 		iotable_init(davinci_soc_info.io_desc,
 				davinci_soc_info.io_desc_num);
 
+	init_consistent_dma_size(14 << 20);
+
 	/*
 	 * Normally devicemaps_init() would flush caches and tlb after
 	 * mdesc->map_io(), but we must also do it here because of the CPU
Signature · 1 line
1.7.2.5
#21 lore raw

PATCH 8/12 ARM: mach-u300: Setup consistent dma size at boot time

In reply to Jon Medhurst
---
 arch/arm/mach-u300/include/mach/memory.h |    5 -----
 arch/arm/mach-u300/core.c                |    3 +++
 2 files changed, 3 insertions(+), 5 deletions(-)
arch/arm/mach-u300/include/mach/memory.h +0 -5
index 888e2e3..38741da 100644
@@ -34,9 +34,4 @@
 	    (CONFIG_MACH_U300_ACCESS_MEM_SIZE & 1))*1024*1024 + 0x100)
 #endif
 
-/*
- * We enable a real big DMA buffer if need be.
- */
-#define CONSISTENT_DMA_SIZE SZ_4M
-
 #endif
arch/arm/mach-u300/core.c +3 -0
index 399c89f..376b6df 100644
@@ -25,6 +25,7 @@
 #include <linux/err.h>
 #include <linux/mtd/nand.h>
 #include <linux/mtd/fsmc.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/types.h>
 #include <asm/setup.h>
@@ -92,6 +93,8 @@ static struct map_desc u300_io_desc[] __initdata = {
 void __init u300_map_io(void)
 {
 	iotable_init(u300_io_desc, ARRAY_SIZE(u300_io_desc));
+	/* We enable a real big DMA buffer if need be. */
+	init_consistent_dma_size(SZ_4M);
 }
 
 /*
Signature · 1 line
1.7.2.5
#23 lore raw

PATCH 9/12 ARM: mach-at91: Setup consistent dma size at boot time

In reply to Jon Medhurst
---
 arch/arm/mach-at91/include/mach/at91sam9g45.h |    2 --
 arch/arm/mach-at91/at91sam9g45.c              |    2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-at91/include/mach/at91sam9g45.h +0 -2
index 2c611b9..406bb64 100644
@@ -128,8 +128,6 @@
 #define AT91SAM9G45_EHCI_BASE	0x00800000	/* USB Host controller (EHCI) */
 #define AT91SAM9G45_VDEC_BASE	0x00900000	/* Video Decoder Controller */
 
-#define CONSISTENT_DMA_SIZE	SZ_4M
-
 /*
  * DMA peripheral identifiers
  * for hardware handshaking interface
arch/arm/mach-at91/at91sam9g45.c +2 -0
index e04c5fb..1532b50 100644
@@ -12,6 +12,7 @@
 
 #include <linux/module.h>
 #include <linux/pm.h>
+#include <linux/dma-mapping.h>
 
 #include <asm/irq.h>
 #include <asm/mach/arch.h>
@@ -319,6 +320,7 @@ static void at91sam9g45_poweroff(void)
 static void __init at91sam9g45_map_io(void)
 {
 	at91_init_sram(0, AT91SAM9G45_SRAM_BASE, AT91SAM9G45_SRAM_SIZE);
+	init_consistent_dma_size(SZ_4M);
 }
 
 static void __init at91sam9g45_initialize(void)
Signature · 1 line
1.7.2.5
#24 lore raw

PATCH 9/12 ARM: mach-at91: Setup consistent dma size at boot time

Quoted 2 lines · Jon Medhurst

Thanks,

Quoted 38 lines
---
  arch/arm/mach-at91/include/mach/at91sam9g45.h |    2 --
  arch/arm/mach-at91/at91sam9g45.c              |    2 ++
  2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-at91/include/mach/at91sam9g45.h +0 -2
index 2c611b9..406bb64 100644
@@ -128,8 +128,6 @@
  #define AT91SAM9G45_EHCI_BASE	0x00800000	/* USB Host controller (EHCI) */
  #define AT91SAM9G45_VDEC_BASE	0x00900000	/* Video Decoder Controller */
 
-#define CONSISTENT_DMA_SIZE	SZ_4M
-
  /*
   * DMA peripheral identifiers
   * for hardware handshaking interface
arch/arm/mach-at91/at91sam9g45.c +2 -0
index e04c5fb..1532b50 100644
@@ -12,6 +12,7 @@
 
  #include<linux/module.h>
  #include<linux/pm.h>
+#include<linux/dma-mapping.h>
 
  #include<asm/irq.h>
  #include<asm/mach/arch.h>
@@ -319,6 +320,7 @@ static void at91sam9g45_poweroff(void)
  static void __init at91sam9g45_map_io(void)
  {
  	at91_init_sram(0, AT91SAM9G45_SRAM_BASE, AT91SAM9G45_SRAM_SIZE);
+	init_consistent_dma_size(SZ_4M);
  }
 
  static void __init at91sam9g45_initialize(void)
Signature · 1 line
Nicolas Ferre
#25 lore raw

PATCH 10/12 ARM: mach-bcmring: Setup consistent dma size at boot time

In reply to Jon Medhurst
CC Jiandong Zheng <[email protected]>
CC Scott Branden <[email protected]>
---
 arch/arm/mach-bcmring/include/mach/memory.h |    5 -----
 arch/arm/mach-bcmring/mm.c                  |    3 +++
 2 files changed, 3 insertions(+), 5 deletions(-)
arch/arm/mach-bcmring/include/mach/memory.h +0 -5
index 15162e4..8848a5b 100644
@@ -25,9 +25,4 @@
 
 #define PLAT_PHYS_OFFSET CFG_GLOBAL_RAM_BASE
 
-/*
- * Maximum DMA memory allowed is 14M
- */
-#define CONSISTENT_DMA_SIZE (SZ_16M - SZ_2M)
-
 #endif
arch/arm/mach-bcmring/mm.c +3 -0
index 0f1c37e..8616876 100644
@@ -13,6 +13,7 @@
 *****************************************************************************/
 
 #include <linux/platform_device.h>
+#include <linux/dma-mapping.h>
 #include <asm/mach/map.h>
 
 #include <mach/hardware.h>
@@ -53,4 +54,6 @@ void __init bcmring_map_io(void)
 {
 
 	iotable_init(bcmring_io_desc, ARRAY_SIZE(bcmring_io_desc));
+	/* Maximum DMA memory allowed is 14M */
+	init_consistent_dma_size(14 << 20);
 }
Signature · 1 line
1.7.2.5
#26 lore raw

PATCH 11/12 ARM: mach-shmobile: Setup consistent dma size at boot time

In reply to Jon Medhurst
CC Paul Mundt <[email protected]>
CC Magnus Damm <[email protected]>
---
 arch/arm/mach-shmobile/include/mach/memory.h |    3 ---
 arch/arm/mach-shmobile/board-ag5evm.c        |    3 +++
 arch/arm/mach-shmobile/board-ap4evb.c        |    3 +++
 arch/arm/mach-shmobile/board-g3evm.c         |    3 +++
 arch/arm/mach-shmobile/board-g4evm.c         |    3 +++
 arch/arm/mach-shmobile/board-mackerel.c      |    3 +++
 6 files changed, 15 insertions(+), 3 deletions(-)
arch/arm/mach-shmobile/include/mach/memory.h +0 -3
index ad00c3c..0ffbe81 100644
@@ -4,7 +4,4 @@
 #define PLAT_PHYS_OFFSET	UL(CONFIG_MEMORY_START)
 #define MEM_SIZE	UL(CONFIG_MEMORY_SIZE)
 
-/* DMA memory at 0xf6000000 - 0xffdfffff */
-#define CONSISTENT_DMA_SIZE (158 << 20)
-
 #endif /* __ASM_MACH_MEMORY_H */
arch/arm/mach-shmobile/board-ag5evm.c +3 -0
index ce5c251..167a67c 100644
@@ -37,6 +37,7 @@
 #include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/mfd/tmio.h>
 #include <linux/sh_clk.h>
+#include <linux/dma-mapping.h>
 #include <video/sh_mobile_lcdc.h>
 #include <video/sh_mipi_dsi.h>
 #include <sound/sh_fsi.h>
@@ -446,6 +447,8 @@ static struct map_desc ag5evm_io_desc[] __initdata = {
 static void __init ag5evm_map_io(void)
 {
 	iotable_init(ag5evm_io_desc, ARRAY_SIZE(ag5evm_io_desc));
+	/* DMA memory at 0xf6000000 - 0xffdfffff */
+	init_consistent_dma_size(158 << 20);
 
 	/* setup early devices and console here as well */
 	sh73a0_add_early_devices();
arch/arm/mach-shmobile/board-ap4evb.c +3 -0
index 9e0856b..ec8f9d9 100644
@@ -42,6 +42,7 @@
 #include <linux/leds.h>
 #include <linux/input/sh_keysc.h>
 #include <linux/usb/r8a66597.h>
+#include <linux/dma-mapping.h>
 
 #include <media/sh_mobile_ceu.h>
 #include <media/sh_mobile_csi2.h>
@@ -1170,6 +1171,8 @@ static struct map_desc ap4evb_io_desc[] __initdata = {
 static void __init ap4evb_map_io(void)
 {
 	iotable_init(ap4evb_io_desc, ARRAY_SIZE(ap4evb_io_desc));
+	/* DMA memory at 0xf6000000 - 0xffdfffff */
+	init_consistent_dma_size(158 << 20);
 
 	/* setup early devices and console here as well */
 	sh7372_add_early_devices();
arch/arm/mach-shmobile/board-g3evm.c +3 -0
index ef4613b..8b620bf 100644
@@ -32,6 +32,7 @@
 #include <linux/gpio.h>
 #include <linux/input.h>
 #include <linux/input/sh_keysc.h>
+#include <linux/dma-mapping.h>
 #include <mach/sh7367.h>
 #include <mach/common.h>
 #include <asm/mach-types.h>
@@ -260,6 +261,8 @@ static struct map_desc g3evm_io_desc[] __initdata = {
 static void __init g3evm_map_io(void)
 {
 	iotable_init(g3evm_io_desc, ARRAY_SIZE(g3evm_io_desc));
+	/* DMA memory at 0xf6000000 - 0xffdfffff */
+	init_consistent_dma_size(158 << 20);
 
 	/* setup early devices and console here as well */
 	sh7367_add_early_devices();
arch/arm/mach-shmobile/board-g4evm.c +3 -0
index 8e3c555..7719ddc 100644
@@ -33,6 +33,7 @@
 #include <linux/mmc/host.h>
 #include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/gpio.h>
+#include <linux/dma-mapping.h>
 #include <mach/sh7377.h>
 #include <mach/common.h>
 #include <asm/mach-types.h>
@@ -274,6 +275,8 @@ static struct map_desc g4evm_io_desc[] __initdata = {
 static void __init g4evm_map_io(void)
 {
 	iotable_init(g4evm_io_desc, ARRAY_SIZE(g4evm_io_desc));
+	/* DMA memory at 0xf6000000 - 0xffdfffff */
+	init_consistent_dma_size(158 << 20);
 
 	/* setup early devices and console here as well */
 	sh7377_add_early_devices();
arch/arm/mach-shmobile/board-mackerel.c +3 -0
index d41c01f..671925d 100644
@@ -45,6 +45,7 @@
 #include <linux/tca6416_keypad.h>
 #include <linux/usb/r8a66597.h>
 #include <linux/usb/renesas_usbhs.h>
+#include <linux/dma-mapping.h>
 
 #include <video/sh_mobile_hdmi.h>
 #include <video/sh_mobile_lcdc.h>
@@ -1377,6 +1378,8 @@ static struct map_desc mackerel_io_desc[] __initdata = {
 static void __init mackerel_map_io(void)
 {
 	iotable_init(mackerel_io_desc, ARRAY_SIZE(mackerel_io_desc));
+	/* DMA memory at 0xf6000000 - 0xffdfffff */
+	init_consistent_dma_size(158 << 20);
 
 	/* setup early devices and console here as well */
 	sh7372_add_early_devices();
Signature · 1 line
1.7.2.5
#27 lore raw

PATCH 12/12 ARM: Remove support for macro CONSISTENT_DMA_SIZE

In reply to Jon Medhurst

There are now no platforms which set this macro.

---
 arch/arm/mm/dma-mapping.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
arch/arm/mm/dma-mapping.c +0 -4
index 5b59ce5..50be842 100644
@@ -129,11 +129,7 @@ static void __dma_free_buffer(struct page *page, size_t size)
  */
 static pte_t **consistent_pte;
 
-#ifdef CONSISTENT_DMA_SIZE
-#define DEFAULT_CONSISTENT_DMA_SIZE CONSISTENT_DMA_SIZE
-#else
 #define DEFAULT_CONSISTENT_DMA_SIZE SZ_2M
-#endif
 
 unsigned long consistent_base = CONSISTENT_END - DEFAULT_CONSISTENT_DMA_SIZE;
 
Signature · 1 line
1.7.2.5
#28 lore raw

Submitting patchset: ARM: Remove define CONSISTENT_DMA_SIZE

In reply to Jon Medhurst

I was wondering how I should submit the patches for removing CONSISTENT_DMA_SIZE. Following on from the thread in linux-arm-kernel titled "Patch Merging Path - RMK or Arnd?" [1], I'm guessing...

- Patch one, "ARM: Add init_consistent_dma_size()" to go into RMK's tree
- All the patches to go into the arm-soc tree

Or do we have a plan to bundle up the cleanup patches for the single zImage work?

Signature · 3 lines
Tixy

[1] http://www.spinics.net/lists/arm-kernel/msg137059.html
#29 lore raw

Submitting patchset: ARM: Remove define CONSISTENT_DMA_SIZE

Quoted 9 lines · Tixy

I was wondering how I should submit the patches for removing CONSISTENT_DMA_SIZE. Following on from the thread in linux-arm-kernel titled "Patch Merging Path - RMK or Arnd?" [1], I'm guessing...

- Patch one, "ARM: Add init_consistent_dma_size()" to go into RMK's tree
- All the patches to go into the arm-soc tree

Or do we have a plan to bundle up the cleanup patches for the single zImage work?

Even if this is touching mostly platform code, the concept is enforced in core code. I would therefore recommend that you send RMK a pull request. Either he'll just pull it, or he'll ask you to bounce it to Arnd.

Nicolas