Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f69eda00 authored by Russell King's avatar Russell King Committed by Russell King
Browse files

Merge AT91, EP93xx, General devel, PXA, S3C, V6+ and Xscale trees

Loading
Loading
Loading
Loading
+46 −0
Original line number Original line Diff line number Diff line
			S3C2410 DMA
			===========

Introduction
------------

   The kernel provides an interface to manage DMA transfers
   using the DMA channels in the cpu, so that the central
   duty of managing channel mappings, and programming the
   channel generators is in one place.


DMA Channel Ordering
--------------------

   Many of the range do not have connections for the DMA
   channels to all sources, which means that some devices
   have a restricted number of channels that can be used.

   To allow flexibilty for each cpu type and board, the
   dma code can be given an dma ordering structure which
   allows the order of channel search to be specified, as
   well as allowing the prohibition of certain claims.

   struct s3c24xx_dma_order has a list of channels, and
   each channel within has a slot for a list of dma
   channel numbers. The slots are searched in order, for
   the presence of a dma channel number with DMA_CH_VALID
   orred in.

   If the order has the flag DMA_CH_NEVER set, then after
   checking the channel list, the system will return no
   found channel, thus denying the request.

   A board support file can call s3c24xx_dma_order_set()
   to register an complete ordering set. The routine will
   copy the data, so the original can be discared with
   __initdata.


Authour
-------

Ben Dooks,
Copyright (c) 2007 Ben Dooks, Simtec Electronics
Licensed under the GPL v2
+17 −4
Original line number Original line Diff line number Diff line
@@ -8,13 +8,10 @@ Introduction


  The Samsung S3C24XX range of ARM9 System-on-Chip CPUs are supported
  The Samsung S3C24XX range of ARM9 System-on-Chip CPUs are supported
  by the 's3c2410' architecture of ARM Linux. Currently the S3C2410,
  by the 's3c2410' architecture of ARM Linux. Currently the S3C2410,
  S3C2440 and S3C2442 devices are supported.
  S3C2412, S3C2413, S3C2440 and S3C2442 devices are supported.


  Support for the S3C2400 series is in progress.
  Support for the S3C2400 series is in progress.


  Support for the S3C2412 and S3C2413 CPUs is being merged.


Configuration
Configuration
-------------
-------------


@@ -26,6 +23,22 @@ Configuration
  please check the machine specific documentation.
  please check the machine specific documentation.




Layout
------

  The core support files are located in the platform code contained in
  arch/arm/plat-s3c24xx with headers in include/asm-arm/plat-s3c24xx.
  This directory should be kept to items shared between the platform
  code (arch/arm/plat-s3c24xx) and the arch/arm/mach-s3c24* code.

  Each cpu has a directory with the support files for it, and the
  machines that carry the device. For example S3C2410 is contained
  in arch/arm/mach-s3c2410 and S3C2440 in arch/arm/mach-s3c2440

  Register, kernel and platform data definitions are held in the
  include/asm-arm/arch-s3c2410 directory.


Machines
Machines
--------
--------


+12 −2
Original line number Original line Diff line number Diff line
@@ -280,6 +280,7 @@ config ARCH_PXA
	bool "PXA2xx-based"
	bool "PXA2xx-based"
	depends on MMU
	depends on MMU
	select ARCH_MTD_XIP
	select ARCH_MTD_XIP
	select GENERIC_TIME
	help
	help
	  Support for Intel's PXA2XX processor line.
	  Support for Intel's PXA2XX processor line.


@@ -303,7 +304,7 @@ config ARCH_SA1100
	  Support for StrongARM 11x0 based boards.
	  Support for StrongARM 11x0 based boards.


config ARCH_S3C2410
config ARCH_S3C2410
	bool "Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442"
	bool "Samsung S3C2410, S3C2412, S3C2413, S3C2440, S3C2442, S3C2443"
	help
	help
	  Samsung S3C2410X CPU based systems, such as the Simtec Electronics
	  Samsung S3C2410X CPU based systems, such as the Simtec Electronics
	  BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or
	  BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or
@@ -363,7 +364,16 @@ source "arch/arm/mach-omap1/Kconfig"


source "arch/arm/mach-omap2/Kconfig"
source "arch/arm/mach-omap2/Kconfig"


source "arch/arm/plat-s3c24xx/Kconfig"

if ARCH_S3C2410
source "arch/arm/mach-s3c2400/Kconfig"
source "arch/arm/mach-s3c2410/Kconfig"
source "arch/arm/mach-s3c2410/Kconfig"
source "arch/arm/mach-s3c2412/Kconfig"
source "arch/arm/mach-s3c2440/Kconfig"
source "arch/arm/mach-s3c2442/Kconfig"
source "arch/arm/mach-s3c2443/Kconfig"
endif


source "arch/arm/mach-lh7a40x/Kconfig"
source "arch/arm/mach-lh7a40x/Kconfig"


@@ -377,7 +387,7 @@ source "arch/arm/mach-aaec2000/Kconfig"


source "arch/arm/mach-realview/Kconfig"
source "arch/arm/mach-realview/Kconfig"


source "arch/arm/mach-at91rm9200/Kconfig"
source "arch/arm/mach-at91/Kconfig"


source "arch/arm/mach-netx/Kconfig"
source "arch/arm/mach-netx/Kconfig"


+8 −2
Original line number Original line Diff line number Diff line
@@ -124,7 +124,7 @@ endif
 machine-$(CONFIG_ARCH_H720X)	   := h720x
 machine-$(CONFIG_ARCH_H720X)	   := h720x
 machine-$(CONFIG_ARCH_AAEC2000)   := aaec2000
 machine-$(CONFIG_ARCH_AAEC2000)   := aaec2000
 machine-$(CONFIG_ARCH_REALVIEW)   := realview
 machine-$(CONFIG_ARCH_REALVIEW)   := realview
 machine-$(CONFIG_ARCH_AT91)       := at91rm9200
 machine-$(CONFIG_ARCH_AT91)       := at91
 machine-$(CONFIG_ARCH_EP93XX)     := ep93xx
 machine-$(CONFIG_ARCH_EP93XX)     := ep93xx
 machine-$(CONFIG_ARCH_PNX4008)    := pnx4008
 machine-$(CONFIG_ARCH_PNX4008)    := pnx4008
 machine-$(CONFIG_ARCH_NETX)       := netx
 machine-$(CONFIG_ARCH_NETX)       := netx
@@ -161,6 +161,11 @@ endif
# If we have a machine-specific directory, then include it in the build.
# If we have a machine-specific directory, then include it in the build.
core-y				+= arch/arm/kernel/ arch/arm/mm/ arch/arm/common/
core-y				+= arch/arm/kernel/ arch/arm/mm/ arch/arm/common/
core-y				+= $(MACHINE)
core-y				+= $(MACHINE)
core-$(CONFIG_ARCH_S3C2410)	+= arch/arm/mach-s3c2400/
core-$(CONFIG_ARCH_S3C2410)	+= arch/arm/mach-s3c2412/
core-$(CONFIG_ARCH_S3C2410)	+= arch/arm/mach-s3c2440/
core-$(CONFIG_ARCH_S3C2410)	+= arch/arm/mach-s3c2442/
core-$(CONFIG_ARCH_S3C2410)	+= arch/arm/mach-s3c2443/
core-$(CONFIG_FPE_NWFPE)	+= arch/arm/nwfpe/
core-$(CONFIG_FPE_NWFPE)	+= arch/arm/nwfpe/
core-$(CONFIG_FPE_FASTFPE)	+= $(FASTFPE_OBJ)
core-$(CONFIG_FPE_FASTFPE)	+= $(FASTFPE_OBJ)
core-$(CONFIG_VFP)		+= arch/arm/vfp/
core-$(CONFIG_VFP)		+= arch/arm/vfp/
@@ -168,6 +173,7 @@ core-$(CONFIG_VFP) += arch/arm/vfp/
# If we have a common platform directory, then include it in the build.
# If we have a common platform directory, then include it in the build.
core-$(CONFIG_PLAT_IOP)		+= arch/arm/plat-iop/
core-$(CONFIG_PLAT_IOP)		+= arch/arm/plat-iop/
core-$(CONFIG_ARCH_OMAP)	+= arch/arm/plat-omap/
core-$(CONFIG_ARCH_OMAP)	+= arch/arm/plat-omap/
core-$(CONFIG_PLAT_S3C24XX)		+= arch/arm/plat-s3c24xx/


drivers-$(CONFIG_OPROFILE)      += arch/arm/oprofile/
drivers-$(CONFIG_OPROFILE)      += arch/arm/oprofile/
drivers-$(CONFIG_ARCH_CLPS7500)	+= drivers/acorn/char/
drivers-$(CONFIG_ARCH_CLPS7500)	+= drivers/acorn/char/
+14 −7
Original line number Original line Diff line number Diff line
@@ -258,9 +258,13 @@ map_single(struct device *dev, void *ptr, size_t size,
		ptr = buf->safe;
		ptr = buf->safe;


		dma_addr = buf->safe_dma_addr;
		dma_addr = buf->safe_dma_addr;
	}
	} else {

		/*
		 * We don't need to sync the DMA buffer since
		 * it was allocated via the coherent allocators.
		 */
		consistent_sync(ptr, size, dir);
		consistent_sync(ptr, size, dir);
	}


	return dma_addr;
	return dma_addr;
}
}
@@ -294,12 +298,12 @@ unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
		DO_STATS ( device_info->bounce_count++ );
		DO_STATS ( device_info->bounce_count++ );


		if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) {
		if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) {
			unsigned long ptr;
			void *ptr = buf->ptr;


			dev_dbg(dev,
			dev_dbg(dev,
				"%s: copy back safe %p to unsafe %p size %d\n",
				"%s: copy back safe %p to unsafe %p size %d\n",
				__func__, buf->safe, buf->ptr, size);
				__func__, buf->safe, ptr, size);
			memcpy(buf->ptr, buf->safe, size);
			memcpy(ptr, buf->safe, size);


			/*
			/*
			 * DMA buffers must have the same cache properties
			 * DMA buffers must have the same cache properties
@@ -309,8 +313,8 @@ unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
			 * bidirectional case because we know the cache
			 * bidirectional case because we know the cache
			 * lines will be coherent with the data written.
			 * lines will be coherent with the data written.
			 */
			 */
			ptr = (unsigned long)buf->ptr;
			dmac_clean_range(ptr, ptr + size);
			dmac_clean_range(ptr, ptr + size);
			outer_clean_range(__pa(ptr), __pa(ptr) + size);
		}
		}
		free_safe_buffer(device_info, buf);
		free_safe_buffer(device_info, buf);
	}
	}
@@ -374,7 +378,10 @@ sync_single(struct device *dev, dma_addr_t dma_addr, size_t size,
		default:
		default:
			BUG();
			BUG();
		}
		}
		consistent_sync(buf->safe, size, dir);
		/*
		 * No need to sync the safe buffer - it was allocated
		 * via the coherent allocators.
		 */
	} else {
	} else {
		consistent_sync(dma_to_virt(dev, dma_addr), size, dir);
		consistent_sync(dma_to_virt(dev, dma_addr), size, dir);
	}
	}
Loading