Skip to content

Commit

Permalink
Merge branch 'dma-size' of git://git.yxit.co.uk/linux into devel-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Russell King committed Aug 23, 2011
2 parents fcb8ce5 + 97fef8b commit 0cd21eb
Show file tree
Hide file tree
Showing 30 changed files with 86 additions and 82 deletions.
7 changes: 7 additions & 0 deletions arch/arm/include/asm/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,13 @@ extern void *dma_alloc_writecombine(struct device *, size_t, dma_addr_t *,
int dma_mmap_writecombine(struct device *, struct vm_area_struct *,
void *, dma_addr_t, size_t);

/*
* This 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.
*/
extern void __init init_consistent_dma_size(unsigned long size);


#ifdef CONFIG_DMABOUNCE
/*
Expand Down
9 changes: 0 additions & 9 deletions arch/arm/include/asm/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-at91/at91sam9g45.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-at91/include/mach/at91sam9g45.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions arch/arm/mach-bcmring/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions arch/arm/mach-bcmring/mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*****************************************************************************/

#include <linux/platform_device.h>
#include <linux/dma-mapping.h>
#include <asm/mach/map.h>

#include <mach/hardware.h>
Expand Down Expand Up @@ -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);
}
3 changes: 3 additions & 0 deletions arch/arm/mach-davinci/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions arch/arm/mach-davinci/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
1 change: 1 addition & 0 deletions arch/arm/mach-omap1/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ void __init omap1_map_common_io(void)
#endif

omap_sram_init();
omap_init_consistent_dma_size();
}

/*
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions arch/arm/mach-s3c64xx/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 0 additions & 2 deletions arch/arm/mach-s3c64xx/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,4 @@

#define PLAT_PHYS_OFFSET UL(0x50000000)

#define CONSISTENT_DMA_SIZE SZ_8M

#endif
3 changes: 3 additions & 0 deletions arch/arm/mach-s5p64x0/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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)
Expand All @@ -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);
}

/*
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-s5p64x0/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
2 changes: 2 additions & 0 deletions arch/arm/mach-s5pv210/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion arch/arm/mach-s5pv210/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-shmobile/board-ag5evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-shmobile/board-ap4evb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-shmobile/board-g3evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-shmobile/board-g4evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 3 additions & 0 deletions arch/arm/mach-shmobile/board-mackerel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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();
Expand Down
3 changes: 0 additions & 3 deletions arch/arm/mach-shmobile/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
3 changes: 3 additions & 0 deletions arch/arm/mach-u300/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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);
}

/*
Expand Down
5 changes: 0 additions & 5 deletions arch/arm/mach-u300/include/mach/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading

0 comments on commit 0cd21eb

Please sign in to comment.