]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'smp' into misc
authorRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 6 Jan 2011 22:31:35 +0000 (22:31 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 6 Jan 2011 22:32:03 +0000 (22:32 +0000)
Conflicts:
arch/arm/kernel/entry-armv.S
arch/arm/mm/ioremap.c

117 files changed:
Documentation/arm/00-INDEX
Documentation/arm/swp_emulation [new file with mode: 0644]
arch/arm/Kconfig
arch/arm/Kconfig.debug
arch/arm/common/Kconfig
arch/arm/common/Makefile
arch/arm/common/dmabounce.c
arch/arm/include/asm/assembler.h
arch/arm/include/asm/cache.h
arch/arm/include/asm/clkdev.h
arch/arm/include/asm/dma-mapping.h
arch/arm/include/asm/domain.h
arch/arm/include/asm/entry-macro-multi.S [new file with mode: 0644]
arch/arm/include/asm/futex.h
arch/arm/include/asm/mach/arch.h
arch/arm/include/asm/mach/irq.h
arch/arm/include/asm/mach/time.h
arch/arm/include/asm/system.h
arch/arm/include/asm/traps.h
arch/arm/include/asm/uaccess.h
arch/arm/kernel/Makefile
arch/arm/kernel/entry-armv.S
arch/arm/kernel/fiq.c
arch/arm/kernel/irq.c
arch/arm/kernel/setup.c
arch/arm/kernel/swp_emulate.c [new file with mode: 0644]
arch/arm/kernel/time.c
arch/arm/kernel/traps.c
arch/arm/kernel/vmlinux.lds.S
arch/arm/lib/getuser.S
arch/arm/lib/putuser.S
arch/arm/lib/uaccess.S
arch/arm/mach-bcmring/clock.c
arch/arm/mach-bcmring/core.c
arch/arm/mach-cns3xxx/Kconfig
arch/arm/mach-davinci/clock.h
arch/arm/mach-ep93xx/clock.c
arch/arm/mach-imx/clock-imx1.c
arch/arm/mach-imx/clock-imx21.c
arch/arm/mach-imx/clock-imx27.c
arch/arm/mach-integrator/Kconfig
arch/arm/mach-integrator/core.c
arch/arm/mach-integrator/impd1.c
arch/arm/mach-integrator/integrator_cp.c
arch/arm/mach-iop13xx/include/mach/memory.h
arch/arm/mach-ks8695/Kconfig
arch/arm/mach-ks8695/include/mach/memory.h
arch/arm/mach-lpc32xx/clock.c
arch/arm/mach-mmp/clock.h
arch/arm/mach-mx25/clock.c
arch/arm/mach-mx3/clock-imx31.c
arch/arm/mach-mx3/clock-imx35.c
arch/arm/mach-mx5/clock-mx51.c
arch/arm/mach-mxc91231/clock.c
arch/arm/mach-nomadik/clock.c
arch/arm/mach-nuc93x/clock.h
arch/arm/mach-omap1/clock.c
arch/arm/mach-omap2/dpll3xxx.c
arch/arm/mach-pnx4008/clock.c
arch/arm/mach-pxa/Kconfig
arch/arm/mach-pxa/clock.c
arch/arm/mach-pxa/clock.h
arch/arm/mach-realview/core.c
arch/arm/mach-s3c2412/Kconfig
arch/arm/mach-shmobile/Kconfig
arch/arm/mach-shmobile/clock-sh7367.c
arch/arm/mach-shmobile/clock-sh7372.c
arch/arm/mach-shmobile/clock-sh7377.c
arch/arm/mach-tcc8k/clock.c
arch/arm/mach-tegra/clock.c
arch/arm/mach-tegra/clock.h
arch/arm/mach-tegra/tegra2_clocks.c
arch/arm/mach-u300/clock.c
arch/arm/mach-ux500/clock.c
arch/arm/mach-versatile/Kconfig
arch/arm/mach-versatile/core.c
arch/arm/mach-vexpress/ct-ca9x4.c
arch/arm/mach-vexpress/v2m.c
arch/arm/mach-w90x900/clock.h
arch/arm/mm/Kconfig
arch/arm/mm/dma-mapping.c
arch/arm/mm/ioremap.c
arch/arm/mm/mmu.c
arch/arm/mm/proc-macros.S
arch/arm/mm/proc-v7.S
arch/arm/plat-omap/Kconfig
arch/arm/plat-omap/include/plat/clkdev_omap.h
arch/arm/plat-omap/include/plat/memory.h
arch/arm/plat-spear/include/plat/clock.h
arch/arm/plat-stmp3xxx/clock.c
arch/sh/Kconfig
arch/sh/boards/mach-highlander/setup.c
arch/sh/include/asm/clkdev.h
arch/sh/kernel/Makefile
arch/sh/kernel/clkdev.c [deleted file]
arch/sh/kernel/cpu/clock-cpg.c
arch/sh/kernel/cpu/clock.c
arch/sh/kernel/cpu/sh4/clock-sh4-202.c
arch/sh/kernel/cpu/sh4a/clock-sh7343.c
arch/sh/kernel/cpu/sh4a/clock-sh7366.c
arch/sh/kernel/cpu/sh4a/clock-sh7722.c
arch/sh/kernel/cpu/sh4a/clock-sh7723.c
arch/sh/kernel/cpu/sh4a/clock-sh7724.c
arch/sh/kernel/cpu/sh4a/clock-sh7757.c
arch/sh/kernel/cpu/sh4a/clock-sh7763.c
arch/sh/kernel/cpu/sh4a/clock-sh7780.c
arch/sh/kernel/cpu/sh4a/clock-sh7785.c
arch/sh/kernel/cpu/sh4a/clock-sh7786.c
arch/sh/kernel/cpu/sh4a/clock-shx3.c
drivers/Kconfig
drivers/Makefile
drivers/amba/bus.c
drivers/clk/Kconfig [new file with mode: 0644]
drivers/clk/Makefile [new file with mode: 0644]
drivers/clk/clkdev.c [moved from arch/arm/common/clkdev.c with 93% similarity]
include/linux/amba/bus.h
include/linux/clkdev.h [new file with mode: 0644]

index ecf7d04bca2601d79e8239b08a777c207198b451..91c24a1e8a9ef14d209bb7c3fa655fef6c81149b 100644 (file)
@@ -34,3 +34,5 @@ memory.txt
        - description of the virtual memory layout
 nwfpe/
        - NWFPE floating point emulator documentation
+swp_emulation
+       - SWP/SWPB emulation handler/logging description
diff --git a/Documentation/arm/swp_emulation b/Documentation/arm/swp_emulation
new file mode 100644 (file)
index 0000000..af903d2
--- /dev/null
@@ -0,0 +1,27 @@
+Software emulation of deprecated SWP instruction (CONFIG_SWP_EMULATE)
+---------------------------------------------------------------------
+
+ARMv6 architecture deprecates use of the SWP/SWPB instructions, and recommeds
+moving to the load-locked/store-conditional instructions LDREX and STREX.
+
+ARMv7 multiprocessing extensions introduce the ability to disable these
+instructions, triggering an undefined instruction exception when executed.
+Trapped instructions are emulated using an LDREX/STREX or LDREXB/STREXB
+sequence. If a memory access fault (an abort) occurs, a segmentation fault is
+signalled to the triggering process.
+
+/proc/cpu/swp_emulation holds some statistics/information, including the PID of
+the last process to trigger the emulation to be invocated. For example:
+---
+Emulated SWP:          12
+Emulated SWPB:         0
+Aborted SWP{B}:                1
+Last process:          314
+---
+
+NOTE: when accessing uncached shared regions, LDREX/STREX rely on an external
+transaction monitoring block called a global monitor to maintain update
+atomicity. If your system does not implement a global monitor, this option can
+cause programs that perform SWP operations to uncached memory to deadlock, as
+the STREX operation will always fail.
+
index 15a177573b74b34c076922b04d353f857a00808c..6344543974f681931dcb85da606ce7ae83504272 100644 (file)
@@ -2,6 +2,7 @@ config ARM
        bool
        default y
        select HAVE_AOUT
+       select HAVE_DMA_API_DEBUG
        select HAVE_IDE
        select HAVE_MEMBLOCK
        select RTC_LIB
@@ -34,6 +35,9 @@ config ARM
 config HAVE_PWM
        bool
 
+config MIGHT_HAVE_PCI
+       bool
+
 config SYS_SUPPORTS_APM_EMULATION
        bool
 
@@ -221,7 +225,7 @@ config ARCH_INTEGRATOR
        bool "ARM Ltd. Integrator family"
        select ARM_AMBA
        select ARCH_HAS_CPUFREQ
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select ICST
        select GENERIC_CLOCKEVENTS
        select PLAT_VERSATILE
@@ -231,7 +235,7 @@ config ARCH_INTEGRATOR
 config ARCH_REALVIEW
        bool "ARM Ltd. RealView family"
        select ARM_AMBA
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select ICST
        select GENERIC_CLOCKEVENTS
        select ARCH_WANT_OPTIONAL_GPIOLIB
@@ -245,7 +249,7 @@ config ARCH_VERSATILE
        bool "ARM Ltd. Versatile family"
        select ARM_AMBA
        select ARM_VIC
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select ICST
        select GENERIC_CLOCKEVENTS
        select ARCH_WANT_OPTIONAL_GPIOLIB
@@ -259,7 +263,7 @@ config ARCH_VEXPRESS
        select ARCH_WANT_OPTIONAL_GPIOLIB
        select ARM_AMBA
        select ARM_TIMER_SP804
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select GENERIC_CLOCKEVENTS
        select HAVE_CLK
        select ICST
@@ -280,7 +284,7 @@ config ARCH_BCMRING
        depends on MMU
        select CPU_V6
        select ARM_AMBA
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select GENERIC_CLOCKEVENTS
        select ARCH_WANT_OPTIONAL_GPIOLIB
        help
@@ -298,6 +302,7 @@ config ARCH_CNS3XXX
        select CPU_V6
        select GENERIC_CLOCKEVENTS
        select ARM_GIC
+       select MIGHT_HAVE_PCI
        select PCI_DOMAINS if PCI
        help
          Support for Cavium Networks CNS3XXX platform.
@@ -327,7 +332,7 @@ config ARCH_EP93XX
        select CPU_ARM920T
        select ARM_AMBA
        select ARM_VIC
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select ARCH_REQUIRE_GPIOLIB
        select ARCH_HAS_HOLES_MEMORYMODEL
        select ARCH_USES_GETTIMEOFFSET
@@ -347,14 +352,14 @@ config ARCH_MXC
        bool "Freescale MXC/iMX-based"
        select GENERIC_CLOCKEVENTS
        select ARCH_REQUIRE_GPIOLIB
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        help
          Support for Freescale MXC/iMX-based family of processors
 
 config ARCH_STMP3XXX
        bool "Freescale STMP3xxx"
        select CPU_ARM926T
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select ARCH_REQUIRE_GPIOLIB
        select GENERIC_CLOCKEVENTS
        select USB_ARCH_HAS_EHCI
@@ -433,6 +438,7 @@ config ARCH_IXP4XX
        select CPU_XSCALE
        select GENERIC_GPIO
        select GENERIC_CLOCKEVENTS
+       select MIGHT_HAVE_PCI
        select DMABOUNCE if PCI
        help
          Support for Intel's IXP4XX (XScale) family of processors.
@@ -472,7 +478,7 @@ config ARCH_LPC32XX
        select HAVE_IDE
        select ARM_AMBA
        select USB_ARCH_HAS_OHCI
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select GENERIC_TIME
        select GENERIC_CLOCKEVENTS
        help
@@ -506,7 +512,7 @@ config ARCH_MMP
        bool "Marvell PXA168/910/MMP2"
        depends on MMU
        select ARCH_REQUIRE_GPIOLIB
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select GENERIC_CLOCKEVENTS
        select TICK_ONESHOT
        select PLAT_PXA
@@ -539,7 +545,7 @@ config ARCH_W90X900
        bool "Nuvoton W90X900 CPU"
        select CPU_ARM926T
        select ARCH_REQUIRE_GPIOLIB
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select GENERIC_CLOCKEVENTS
        help
          Support for Nuvoton (Winbond logic dept.) ARM9 processor,
@@ -553,7 +559,7 @@ config ARCH_W90X900
 config ARCH_NUC93X
        bool "Nuvoton NUC93X CPU"
        select CPU_ARM926T
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        help
          Support for Nuvoton (Winbond logic dept.) NUC93X MCU,The NUC93X is a
          low-power and high performance MPEG-4/JPEG multimedia controller chip.
@@ -564,7 +570,7 @@ config ARCH_TEGRA
        select GENERIC_CLOCKEVENTS
        select GENERIC_GPIO
        select HAVE_CLK
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select ARCH_HAS_BARRIERS if CACHE_L2X0
        select ARCH_HAS_CPUFREQ
        help
@@ -574,7 +580,7 @@ config ARCH_TEGRA
 config ARCH_PNX4008
        bool "Philips Nexperia PNX4008 Mobile"
        select CPU_ARM926T
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select ARCH_USES_GETTIMEOFFSET
        help
          This enables support for Philips PNX4008 mobile platform.
@@ -584,7 +590,7 @@ config ARCH_PXA
        depends on MMU
        select ARCH_MTD_XIP
        select ARCH_HAS_CPUFREQ
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select ARCH_REQUIRE_GPIOLIB
        select GENERIC_CLOCKEVENTS
        select TICK_ONESHOT
@@ -761,7 +767,7 @@ config ARCH_TCC_926
        bool "Telechips TCC ARM926-based systems"
        select CPU_ARM926T
        select HAVE_CLK
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select GENERIC_CLOCKEVENTS
        help
          Support for Telechips TCC ARM926-based systems.
@@ -785,7 +791,7 @@ config ARCH_U300
        select ARM_AMBA
        select ARM_VIC
        select GENERIC_CLOCKEVENTS
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select GENERIC_GPIO
        help
          Support for ST-Ericsson U300 series mobile platforms.
@@ -795,7 +801,7 @@ config ARCH_U8500
        select CPU_V7
        select ARM_AMBA
        select GENERIC_CLOCKEVENTS
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select ARCH_REQUIRE_GPIOLIB
        help
          Support for ST-Ericsson's Ux500 architecture
@@ -805,7 +811,7 @@ config ARCH_NOMADIK
        select ARM_AMBA
        select ARM_VIC
        select CPU_ARM926T
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select GENERIC_CLOCKEVENTS
        select ARCH_REQUIRE_GPIOLIB
        help
@@ -817,7 +823,7 @@ config ARCH_DAVINCI
        select ARCH_REQUIRE_GPIOLIB
        select ZONE_DMA
        select HAVE_IDE
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select GENERIC_ALLOCATOR
        select ARCH_HAS_HOLES_MEMORYMODEL
        help
@@ -837,7 +843,7 @@ config PLAT_SPEAR
        bool "ST SPEAr"
        select ARM_AMBA
        select ARCH_REQUIRE_GPIOLIB
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select GENERIC_CLOCKEVENTS
        select HAVE_CLK
        help
@@ -1017,6 +1023,11 @@ config CPU_HAS_PMU
        default y
        bool
 
+config MULTI_IRQ_HANDLER
+       bool
+       help
+         Allow each machine to specify it's own IRQ handler at run time.
+
 if !MMU
 source "arch/arm/Kconfig-nommu"
 endif
@@ -1164,7 +1175,7 @@ config ISA_DMA_API
        bool
 
 config PCI
-       bool "PCI support" if ARCH_INTEGRATOR_AP || ARCH_VERSATILE_PB || ARCH_IXP4XX || ARCH_KS8695 || MACH_ARMCORE || ARCH_CNS3XXX
+       bool "PCI support" if MIGHT_HAVE_PCI
        help
          Find out whether you have a PCI motherboard. PCI is the name of a
          bus system, i.e. the way the CPU talks to the other stuff inside
@@ -1311,7 +1322,7 @@ config HZ
        default 100
 
 config THUMB2_KERNEL
-       bool "Compile the kernel in Thumb-2 mode"
+       bool "Compile the kernel in Thumb-2 mode (EXPERIMENTAL)"
        depends on CPU_V7 && EXPERIMENTAL
        select AEABI
        select ARM_ASM_UNIFIED
@@ -1525,6 +1536,7 @@ config SECCOMP
 
 config CC_STACKPROTECTOR
        bool "Enable -fstack-protector buffer overflow detection (EXPERIMENTAL)"
+       depends on EXPERIMENTAL
        help
          This option turns on the -fstack-protector GCC feature. This
          feature puts, at the beginning of functions, a canary value on
@@ -1708,7 +1720,7 @@ config CPU_FREQ_S3C
          Internal configuration node for common cpufreq on Samsung SoC
 
 config CPU_FREQ_S3C24XX
-       bool "CPUfreq driver for Samsung S3C24XX series CPUs"
+       bool "CPUfreq driver for Samsung S3C24XX series CPUs (EXPERIMENTAL)"
        depends on ARCH_S3C2410 && CPU_FREQ && EXPERIMENTAL
        select CPU_FREQ_S3C
        help
@@ -1720,7 +1732,7 @@ config CPU_FREQ_S3C24XX
          If in doubt, say N.
 
 config CPU_FREQ_S3C24XX_PLL
-       bool "Support CPUfreq changing of PLL frequency"
+       bool "Support CPUfreq changing of PLL frequency (EXPERIMENTAL)"
        depends on CPU_FREQ_S3C24XX && EXPERIMENTAL
        help
          Compile in support for changing the PLL frequency from the
index 2fd0b99afc4bc849cd448780358fa5fdd68ff644..a5775a56f0b2b837396316f5e6b3af344b425618 100644 (file)
@@ -31,7 +31,7 @@ config FRAME_POINTER
          reported is severely limited.
 
 config ARM_UNWIND
-       bool "Enable stack unwinding support"
+       bool "Enable stack unwinding support (EXPERIMENTAL)"
        depends on AEABI && EXPERIMENTAL
        default y
        help
index 0a34c8186924415398601d46d488a2b011136219..778655f0257a9f27f73d3c1a0fddd81eb28919f4 100644 (file)
@@ -37,7 +37,3 @@ config SHARP_PARAM
 
 config SHARP_SCOOP
        bool
-
-config COMMON_CLKDEV
-       bool
-       select HAVE_CLK
index e6e8664a94139cd7e4086020d537ded4ca087f9e..799e140274f15597240e59e6d44d29331044de0f 100644 (file)
@@ -16,4 +16,3 @@ obj-$(CONFIG_SHARP_SCOOP)     += scoop.o
 obj-$(CONFIG_ARCH_IXP2000)     += uengine.o
 obj-$(CONFIG_ARCH_IXP23XX)     += uengine.o
 obj-$(CONFIG_PCI_HOST_ITE8152)  += it8152.o
-obj-$(CONFIG_COMMON_CLKDEV)    += clkdev.o
index cc0a932bbea90780f659becc4ee7d93087ab61cf..e5681636626f5fab71e38ac758a4409b2a127247 100644 (file)
@@ -328,7 +328,7 @@ static inline void unmap_single(struct device *dev, dma_addr_t dma_addr,
  * substitute the safe buffer for the unsafe one.
  * (basically move the buffer from an unsafe area to a safe one)
  */
-dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
+dma_addr_t __dma_map_single(struct device *dev, void *ptr, size_t size,
                enum dma_data_direction dir)
 {
        dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n",
@@ -338,7 +338,7 @@ dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size,
 
        return map_single(dev, ptr, size, dir);
 }
-EXPORT_SYMBOL(dma_map_single);
+EXPORT_SYMBOL(__dma_map_single);
 
 /*
  * see if a mapped address was really a "safe" buffer and if so, copy
@@ -346,7 +346,7 @@ EXPORT_SYMBOL(dma_map_single);
  * the safe buffer.  (basically return things back to the way they
  * should be)
  */
-void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
+void __dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
                enum dma_data_direction dir)
 {
        dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n",
@@ -354,9 +354,9 @@ void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size,
 
        unmap_single(dev, dma_addr, size, dir);
 }
-EXPORT_SYMBOL(dma_unmap_single);
+EXPORT_SYMBOL(__dma_unmap_single);
 
-dma_addr_t dma_map_page(struct device *dev, struct page *page,
+dma_addr_t __dma_map_page(struct device *dev, struct page *page,
                unsigned long offset, size_t size, enum dma_data_direction dir)
 {
        dev_dbg(dev, "%s(page=%p,off=%#lx,size=%zx,dir=%x)\n",
@@ -372,7 +372,7 @@ dma_addr_t dma_map_page(struct device *dev, struct page *page,
 
        return map_single(dev, page_address(page) + offset, size, dir);
 }
-EXPORT_SYMBOL(dma_map_page);
+EXPORT_SYMBOL(__dma_map_page);
 
 /*
  * see if a mapped address was really a "safe" buffer and if so, copy
@@ -380,7 +380,7 @@ EXPORT_SYMBOL(dma_map_page);
  * the safe buffer.  (basically return things back to the way they
  * should be)
  */
-void dma_unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size,
+void __dma_unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size,
                enum dma_data_direction dir)
 {
        dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n",
@@ -388,7 +388,7 @@ void dma_unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size,
 
        unmap_single(dev, dma_addr, size, dir);
 }
-EXPORT_SYMBOL(dma_unmap_page);
+EXPORT_SYMBOL(__dma_unmap_page);
 
 int dmabounce_sync_for_cpu(struct device *dev, dma_addr_t addr,
                unsigned long off, size_t sz, enum dma_data_direction dir)
index 72d3389e9c12ee3f838e06947c4eb47d3a4e31ac..bc2d2d75f7068998bb69a92b69c1216ec4dbd8fe 100644 (file)
@@ -18,6 +18,7 @@
 #endif
 
 #include <asm/ptrace.h>
+#include <asm/domain.h>
 
 /*
  * Endian independent macros for shifting bytes within registers.
  */
 #ifdef CONFIG_THUMB2_KERNEL
 
-       .macro  usraccoff, instr, reg, ptr, inc, off, cond, abort
+       .macro  usraccoff, instr, reg, ptr, inc, off, cond, abort, t=T()
 9999:
        .if     \inc == 1
-       \instr\cond\()bt \reg, [\ptr, #\off]
+       \instr\cond\()b\()\t\().w \reg, [\ptr, #\off]
        .elseif \inc == 4
-       \instr\cond\()t \reg, [\ptr, #\off]
+       \instr\cond\()\t\().w \reg, [\ptr, #\off]
        .else
        .error  "Unsupported inc macro argument"
        .endif
 
 #else  /* !CONFIG_THUMB2_KERNEL */
 
-       .macro  usracc, instr, reg, ptr, inc, cond, rept, abort
+       .macro  usracc, instr, reg, ptr, inc, cond, rept, abort, t=T()
        .rept   \rept
 9999:
        .if     \inc == 1
-       \instr\cond\()bt \reg, [\ptr], #\inc
+       \instr\cond\()b\()\t \reg, [\ptr], #\inc
        .elseif \inc == 4
-       \instr\cond\()t \reg, [\ptr], #\inc
+       \instr\cond\()\t \reg, [\ptr], #\inc
        .else
        .error  "Unsupported inc macro argument"
        .endif
index 9d6122096fbec40ad41ab473c189722816225399..75fe66bc02b420014f37459c1ad786d49b1529c0 100644 (file)
@@ -23,4 +23,6 @@
 #define ARCH_SLAB_MINALIGN 8
 #endif
 
+#define __read_mostly __attribute__((__section__(".data..read_mostly")))
+
 #endif
index b56c1389b6fa49da16bb940a04931480a4466c84..765d3322236942473fb342ad49a32746200f6bc3 100644 (file)
 #ifndef __ASM_CLKDEV_H
 #define __ASM_CLKDEV_H
 
-struct clk;
-struct device;
+#include <linux/slab.h>
 
-struct clk_lookup {
-       struct list_head        node;
-       const char              *dev_id;
-       const char              *con_id;
-       struct clk              *clk;
-};
+#include <mach/clkdev.h>
 
-struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id,
-       const char *dev_fmt, ...);
-
-void clkdev_add(struct clk_lookup *cl);
-void clkdev_drop(struct clk_lookup *cl);
-
-void clkdev_add_table(struct clk_lookup *, size_t);
-int clk_add_alias(const char *, const char *, char *, struct device *);
+static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
+{
+       return kzalloc(size, GFP_KERNEL);
+}
 
 #endif
index c568da7dcae45e60e8630e2b3060599f561d6555..4fff837363edd93249a0884d11f0fabc2ec6db30 100644 (file)
@@ -5,24 +5,29 @@
 
 #include <linux/mm_types.h>
 #include <linux/scatterlist.h>
+#include <linux/dma-debug.h>
 
 #include <asm-generic/dma-coherent.h>
 #include <asm/memory.h>
 
+#ifdef __arch_page_to_dma
+#error Please update to __arch_pfn_to_dma
+#endif
+
 /*
- * page_to_dma/dma_to_virt/virt_to_dma are architecture private functions
- * used internally by the DMA-mapping API to provide DMA addresses. They
- * must not be used by drivers.
+ * dma_to_pfn/pfn_to_dma/dma_to_virt/virt_to_dma are architecture private
+ * functions used internally by the DMA-mapping API to provide DMA
+ * addresses. They must not be used by drivers.
  */
-#ifndef __arch_page_to_dma
-static inline dma_addr_t page_to_dma(struct device *dev, struct page *page)
+#ifndef __arch_pfn_to_dma
+static inline dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn)
 {
-       return (dma_addr_t)__pfn_to_bus(page_to_pfn(page));
+       return (dma_addr_t)__pfn_to_bus(pfn);
 }
 
-static inline struct page *dma_to_page(struct device *dev, dma_addr_t addr)
+static inline unsigned long dma_to_pfn(struct device *dev, dma_addr_t addr)
 {
-       return pfn_to_page(__bus_to_pfn(addr));
+       return __bus_to_pfn(addr);
 }
 
 static inline void *dma_to_virt(struct device *dev, dma_addr_t addr)
@@ -35,14 +40,14 @@ static inline dma_addr_t virt_to_dma(struct device *dev, void *addr)
        return (dma_addr_t)__virt_to_bus((unsigned long)(addr));
 }
 #else
-static inline dma_addr_t page_to_dma(struct device *dev, struct page *page)
+static inline dma_addr_t pfn_to_dma(struct device *dev, unsigned long pfn)
 {
-       return __arch_page_to_dma(dev, page);
+       return __arch_pfn_to_dma(dev, pfn);
 }
 
-static inline struct page *dma_to_page(struct device *dev, dma_addr_t addr)
+static inline unsigned long dma_to_pfn(struct device *dev, dma_addr_t addr)
 {
-       return __arch_dma_to_page(dev, addr);
+       return __arch_dma_to_pfn(dev, addr);
 }
 
 static inline void *dma_to_virt(struct device *dev, dma_addr_t addr)
@@ -293,13 +298,13 @@ extern int dma_needs_bounce(struct device*, dma_addr_t, size_t);
 /*
  * The DMA API, implemented by dmabounce.c.  See below for descriptions.
  */
-extern dma_addr_t dma_map_single(struct device *, void *, size_t,
+extern dma_addr_t __dma_map_single(struct device *, void *, size_t,
                enum dma_data_direction);
-extern void dma_unmap_single(struct device *, dma_addr_t, size_t,
+extern void __dma_unmap_single(struct device *, dma_addr_t, size_t,
                enum dma_data_direction);
-extern dma_addr_t dma_map_page(struct device *, struct page *,
+extern dma_addr_t __dma_map_page(struct device *, struct page *,
                unsigned long, size_t, enum dma_data_direction);
-extern void dma_unmap_page(struct device *, dma_addr_t, size_t,
+extern void __dma_unmap_page(struct device *, dma_addr_t, size_t,
                enum dma_data_direction);
 
 /*
@@ -323,6 +328,34 @@ static inline int dmabounce_sync_for_device(struct device *d, dma_addr_t addr,
 }
 
 
+static inline dma_addr_t __dma_map_single(struct device *dev, void *cpu_addr,
+               size_t size, enum dma_data_direction dir)
+{
+       __dma_single_cpu_to_dev(cpu_addr, size, dir);
+       return virt_to_dma(dev, cpu_addr);
+}
+
+static inline dma_addr_t __dma_map_page(struct device *dev, struct page *page,
+            unsigned long offset, size_t size, enum dma_data_direction dir)
+{
+       __dma_page_cpu_to_dev(page, offset, size, dir);
+       return pfn_to_dma(dev, page_to_pfn(page)) + offset;
+}
+
+static inline void __dma_unmap_single(struct device *dev, dma_addr_t handle,
+               size_t size, enum dma_data_direction dir)
+{
+       __dma_single_dev_to_cpu(dma_to_virt(dev, handle), size, dir);
+}
+
+static inline void __dma_unmap_page(struct device *dev, dma_addr_t handle,
+               size_t size, enum dma_data_direction dir)
+{
+       __dma_page_dev_to_cpu(pfn_to_page(dma_to_pfn(dev, handle)),
+               handle & ~PAGE_MASK, size, dir);
+}
+#endif /* CONFIG_DMABOUNCE */
+
 /**
  * dma_map_single - map a single buffer for streaming DMA
  * @dev: valid struct device pointer, or NULL for ISA and EISA-like devices
@@ -340,11 +373,16 @@ static inline int dmabounce_sync_for_device(struct device *d, dma_addr_t addr,
 static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr,
                size_t size, enum dma_data_direction dir)
 {
+       dma_addr_t addr;
+
        BUG_ON(!valid_dma_direction(dir));
 
-       __dma_single_cpu_to_dev(cpu_addr, size, dir);
+       addr = __dma_map_single(dev, cpu_addr, size, dir);
+       debug_dma_map_page(dev, virt_to_page(cpu_addr),
+                       (unsigned long)cpu_addr & ~PAGE_MASK, size,
+                       dir, addr, true);
 
-       return virt_to_dma(dev, cpu_addr);
+       return addr;
 }
 
 /**
@@ -364,11 +402,14 @@ static inline dma_addr_t dma_map_single(struct device *dev, void *cpu_addr,
 static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
             unsigned long offset, size_t size, enum dma_data_direction dir)
 {
+       dma_addr_t addr;
+
        BUG_ON(!valid_dma_direction(dir));
 
-       __dma_page_cpu_to_dev(page, offset, size, dir);
+       addr = __dma_map_page(dev, page, offset, size, dir);
+       debug_dma_map_page(dev, page, offset, size, dir, addr, false);
 
-       return page_to_dma(dev, page) + offset;
+       return addr;
 }
 
 /**
@@ -388,7 +429,8 @@ static inline dma_addr_t dma_map_page(struct device *dev, struct page *page,
 static inline void dma_unmap_single(struct device *dev, dma_addr_t handle,
                size_t size, enum dma_data_direction dir)
 {
-       __dma_single_dev_to_cpu(dma_to_virt(dev, handle), size, dir);
+       debug_dma_unmap_page(dev, handle, size, dir, true);
+       __dma_unmap_single(dev, handle, size, dir);
 }
 
 /**
@@ -408,10 +450,9 @@ static inline void dma_unmap_single(struct device *dev, dma_addr_t handle,
 static inline void dma_unmap_page(struct device *dev, dma_addr_t handle,
                size_t size, enum dma_data_direction dir)
 {
-       __dma_page_dev_to_cpu(dma_to_page(dev, handle), handle & ~PAGE_MASK,
-               size, dir);
+       debug_dma_unmap_page(dev, handle, size, dir, false);
+       __dma_unmap_page(dev, handle, size, dir);
 }
-#endif /* CONFIG_DMABOUNCE */
 
 /**
  * dma_sync_single_range_for_cpu
@@ -437,6 +478,8 @@ static inline void dma_sync_single_range_for_cpu(struct device *dev,
 {
        BUG_ON(!valid_dma_direction(dir));
 
+       debug_dma_sync_single_for_cpu(dev, handle + offset, size, dir);
+
        if (!dmabounce_sync_for_cpu(dev, handle, offset, size, dir))
                return;
 
@@ -449,6 +492,8 @@ static inline void dma_sync_single_range_for_device(struct device *dev,
 {
        BUG_ON(!valid_dma_direction(dir));
 
+       debug_dma_sync_single_for_device(dev, handle + offset, size, dir);
+
        if (!dmabounce_sync_for_device(dev, handle, offset, size, dir))
                return;
 
index cc7ef4080711ff5b2b506449dc54602d8fe65b8d..af18ceaacf5d2ec2bafe51de722387fb3249ac4e 100644 (file)
  */
 #define DOMAIN_NOACCESS        0
 #define DOMAIN_CLIENT  1
+#ifdef CONFIG_CPU_USE_DOMAINS
 #define DOMAIN_MANAGER 3
+#else
+#define DOMAIN_MANAGER 1
+#endif
 
 #define domain_val(dom,type)   ((type) << (2*(dom)))
 
 #ifndef __ASSEMBLY__
 
-#ifdef CONFIG_MMU
+#ifdef CONFIG_CPU_USE_DOMAINS
 #define set_domain(x)                                  \
        do {                                            \
        __asm__ __volatile__(                           \
 #define modify_domain(dom,type)        do { } while (0)
 #endif
 
+/*
+ * Generate the T (user) versions of the LDR/STR and related
+ * instructions (inline assembly)
+ */
+#ifdef CONFIG_CPU_USE_DOMAINS
+#define T(instr)       #instr "t"
+#else
+#define T(instr)       #instr
 #endif
-#endif /* !__ASSEMBLY__ */
+
+#else /* __ASSEMBLY__ */
+
+/*
+ * Generate the T (user) versions of the LDR/STR and related
+ * instructions
+ */
+#ifdef CONFIG_CPU_USE_DOMAINS
+#define T(instr)       instr ## t
+#else
+#define T(instr)       instr
+#endif
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* !__ASM_PROC_DOMAIN_H */
diff --git a/arch/arm/include/asm/entry-macro-multi.S b/arch/arm/include/asm/entry-macro-multi.S
new file mode 100644 (file)
index 0000000..ec0bbf7
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Interrupt handling.  Preserves r7, r8, r9
+ */
+       .macro  arch_irq_handler_default
+       get_irqnr_preamble r5, lr
+1:     get_irqnr_and_base r0, r6, r5, lr
+       movne   r1, sp
+       @
+       @ routine called with r0 = irq number, r1 = struct pt_regs *
+       @
+       adrne   lr, BSYM(1b)
+       bne     asm_do_IRQ
+
+#ifdef CONFIG_SMP
+       /*
+        * XXX
+        *
+        * this macro assumes that irqstat (r6) and base (r5) are
+        * preserved from get_irqnr_and_base above
+        */
+       ALT_SMP(test_for_ipi r0, r6, r5, lr)
+       ALT_UP_B(9997f)
+       movne   r1, sp
+       adrne   lr, BSYM(1b)
+       bne     do_IPI
+
+#ifdef CONFIG_LOCAL_TIMERS
+       test_for_ltirq r0, r6, r5, lr
+       movne   r0, sp
+       adrne   lr, BSYM(1b)
+       bne     do_local_timer
+#endif
+#endif
+9997:
+       .endm
+
+       .macro  arch_irq_handler, symbol_name
+       .align  5
+       .global \symbol_name
+\symbol_name:
+       mov     r4, lr
+       arch_irq_handler_default
+       mov     pc, r4
+       .endm
index 540a044153a54ce1ffc8bed90a6bf7cee59631d8..b33fe7065b38694fa1d3047c6147a74348d4b732 100644 (file)
 #include <linux/preempt.h>
 #include <linux/uaccess.h>
 #include <asm/errno.h>
+#include <asm/domain.h>
 
 #define __futex_atomic_op(insn, ret, oldval, uaddr, oparg)     \
        __asm__ __volatile__(                                   \
-       "1:     ldrt    %1, [%2]\n"                             \
+       "1:     " T(ldr) "      %1, [%2]\n"                     \
        "       " insn "\n"                                     \
-       "2:     strt    %0, [%2]\n"                             \
+       "2:     " T(str) "      %0, [%2]\n"                     \
        "       mov     %0, #0\n"                               \
        "3:\n"                                                  \
        "       .pushsection __ex_table,\"a\"\n"                \
@@ -97,10 +98,10 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
        pagefault_disable();    /* implies preempt_disable() */
 
        __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n"
-       "1:     ldrt    %0, [%3]\n"
+       "1:     " T(ldr) "      %0, [%3]\n"
        "       teq     %0, %1\n"
        "       it      eq      @ explicit IT needed for the 2b label\n"
-       "2:     streqt  %2, [%3]\n"
+       "2:     " T(streq) "    %2, [%3]\n"
        "3:\n"
        "       .pushsection __ex_table,\"a\"\n"
        "       .align  3\n"
index d97a964207fa15693c011f88f27dc64f4c7c3f16..3a0893a76a3b23abbb8ecaf4c4c9ce1a528f3bd4 100644 (file)
@@ -37,11 +37,20 @@ struct machine_desc {
                                         struct meminfo *);
        void                    (*reserve)(void);/* reserve mem blocks  */
        void                    (*map_io)(void);/* IO mapping function  */
+       void                    (*init_early)(void);
        void                    (*init_irq)(void);
        struct sys_timer        *timer;         /* system tick timer    */
        void                    (*init_machine)(void);
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+       void                    (*handle_irq)(struct pt_regs *);
+#endif
 };
 
+/*
+ * Current machine - only accessible during boot.
+ */
+extern struct machine_desc *machine_desc;
+
 /*
  * Set of macros to define architecture features.  This is built into
  * a table by the linker.
index 2bc47fb94d5191b0708f0a9c65a3e9332d67059a..22ac140edd9efb83ee2b770636d6ef32e7916f1e 100644 (file)
@@ -17,11 +17,13 @@ struct seq_file;
 /*
  * This is internal.  Do not use it.
  */
-extern unsigned int arch_nr_irqs;
-extern void (*init_arch_irq)(void);
 extern void init_FIQ(void);
 extern int show_fiq_list(struct seq_file *, int);
 
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+extern void (*handle_arch_irq)(struct pt_regs *);
+#endif
+
 /*
  * This is for easy migration, but should be changed in the source
  */
index 35d408f6dccfbee8db3b678576166af283f8ed56..883f6be5117a75a529e8a07af892cc80f2974dd6 100644 (file)
@@ -43,7 +43,6 @@ struct sys_timer {
 #endif
 };
 
-extern struct sys_timer *system_timer;
 extern void timer_tick(void);
 
 #endif
index 1120f18a6b17695e48c37a6b4d1d7e50d306e478..9ab8d7e647376c72d0cb9ae665e03c2d441c3979 100644 (file)
@@ -119,6 +119,13 @@ extern unsigned int user_debug;
 #define vectors_high() (0)
 #endif
 
+#if __LINUX_ARM_ARCH__ >= 7 ||         \
+       (__LINUX_ARM_ARCH__ == 6 && defined(CONFIG_CPU_32v6K))
+#define sev()  __asm__ __volatile__ ("sev" : : : "memory")
+#define wfe()  __asm__ __volatile__ ("wfe" : : : "memory")
+#define wfi()  __asm__ __volatile__ ("wfi" : : : "memory")
+#endif
+
 #if __LINUX_ARM_ARCH__ >= 7
 #define isb() __asm__ __volatile__ ("isb" : : : "memory")
 #define dsb() __asm__ __volatile__ ("dsb" : : : "memory")
index 491960bf42602e9c509a32d382815a42b3089047..af5d5d1388c6b2c803d15b5f5a5bffa35c3dd543 100644 (file)
@@ -27,4 +27,6 @@ static inline int in_exception_text(unsigned long ptr)
 extern void __init early_trap_init(void);
 extern void dump_backtrace_entry(unsigned long where, unsigned long from, unsigned long frame);
 
+extern void *vectors_page;
+
 #endif
index 33e4a48fe1037575d4d6e212000a8aa01303f7fc..b293616a1a1a8d6cf92a5ae1560994c7e3d66e46 100644 (file)
@@ -227,7 +227,7 @@ do {                                                                        \
 
 #define __get_user_asm_byte(x,addr,err)                                \
        __asm__ __volatile__(                                   \
-       "1:     ldrbt   %1,[%2]\n"                              \
+       "1:     " T(ldrb) "     %1,[%2],#0\n"                   \
        "2:\n"                                                  \
        "       .pushsection .fixup,\"ax\"\n"                   \
        "       .align  2\n"                                    \
@@ -263,7 +263,7 @@ do {                                                                        \
 
 #define __get_user_asm_word(x,addr,err)                                \
        __asm__ __volatile__(                                   \
-       "1:     ldrt    %1,[%2]\n"                              \
+       "1:     " T(ldr) "      %1,[%2],#0\n"                   \
        "2:\n"                                                  \
        "       .pushsection .fixup,\"ax\"\n"                   \
        "       .align  2\n"                                    \
@@ -308,7 +308,7 @@ do {                                                                        \
 
 #define __put_user_asm_byte(x,__pu_addr,err)                   \
        __asm__ __volatile__(                                   \
-       "1:     strbt   %1,[%2]\n"                              \
+       "1:     " T(strb) "     %1,[%2],#0\n"                   \
        "2:\n"                                                  \
        "       .pushsection .fixup,\"ax\"\n"                   \
        "       .align  2\n"                                    \
@@ -341,7 +341,7 @@ do {                                                                        \
 
 #define __put_user_asm_word(x,__pu_addr,err)                   \
        __asm__ __volatile__(                                   \
-       "1:     strt    %1,[%2]\n"                              \
+       "1:     " T(str) "      %1,[%2],#0\n"                   \
        "2:\n"                                                  \
        "       .pushsection .fixup,\"ax\"\n"                   \
        "       .align  2\n"                                    \
@@ -366,10 +366,10 @@ do {                                                                      \
 
 #define __put_user_asm_dword(x,__pu_addr,err)                  \
        __asm__ __volatile__(                                   \
- ARM(  "1:     strt    " __reg_oper1 ", [%1], #4\n"    )       \
- ARM(  "2:     strt    " __reg_oper0 ", [%1]\n"        )       \
- THUMB(        "1:     strt    " __reg_oper1 ", [%1]\n"        )       \
- THUMB(        "2:     strt    " __reg_oper0 ", [%1, #4]\n"    )       \
+ ARM(  "1:     " T(str) "      " __reg_oper1 ", [%1], #4\n"    )       \
+ ARM(  "2:     " T(str) "      " __reg_oper0 ", [%1]\n"        )       \
+ THUMB(        "1:     " T(str) "      " __reg_oper1 ", [%1]\n"        )       \
+ THUMB(        "2:     " T(str) "      " __reg_oper0 ", [%1, #4]\n"    )       \
        "3:\n"                                                  \
        "       .pushsection .fixup,\"ax\"\n"                   \
        "       .align  2\n"                                    \
index 659937b0a8964da124f26d94ca761115d834fce2..0e106795702938993065558f4d1700fcdf66d182 100644 (file)
@@ -42,6 +42,8 @@ obj-$(CONFIG_KGDB)            += kgdb.o
 obj-$(CONFIG_ARM_UNWIND)       += unwind.o
 obj-$(CONFIG_HAVE_TCM)         += tcm.o
 obj-$(CONFIG_CRASH_DUMP)       += crash_dump.o
+obj-$(CONFIG_SWP_EMULATE)      += swp_emulate.o
+CFLAGS_swp_emulate.o           := -Wa,-march=armv7-a
 obj-$(CONFIG_HAVE_HW_BREAKPOINT)       += hw_breakpoint.o
 
 obj-$(CONFIG_CRUNCH)           += crunch.o crunch-bits.o
index 7f22a11a5105011f50399f395c9d6811785bdb8e..8e2dacdbdccb7e6638d9e1c0785f820d4bf7cf12 100644 (file)
 #include <asm/tls.h>
 
 #include "entry-header.S"
+#include <asm/entry-macro-multi.S>
 
 /*
  * Interrupt handling.  Preserves r7, r8, r9
  */
        .macro  irq_handler
-       get_irqnr_preamble r5, lr
-1:     get_irqnr_and_base r0, r6, r5, lr
-       movne   r1, sp
-       @
-       @ routine called with r0 = irq number, r1 = struct pt_regs *
-       @
-       adrne   lr, BSYM(1b)
-       bne     asm_do_IRQ
-
-#ifdef CONFIG_SMP
-       /*
-        * XXX
-        *
-        * this macro assumes that irqstat (r6) and base (r5) are
-        * preserved from get_irqnr_and_base above
-        */
-       ALT_SMP(test_for_ipi r0, r6, r5, lr)
-       ALT_UP_B(9997f)
-       movne   r1, sp
-       adrne   lr, BSYM(1b)
-       bne     do_IPI
-
-#ifdef CONFIG_LOCAL_TIMERS
-       test_for_ltirq r0, r6, r5, lr
-       movne   r0, sp
-       adrne   lr, BSYM(1b)
-       bne     do_local_timer
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+       ldr     r5, =handle_arch_irq
+       mov     r0, sp
+       ldr     r5, [r5]
+       adr     lr, BSYM(9997f)
+       teq     r5, #0
+       movne   pc, r5
 #endif
+       arch_irq_handler_default
 9997:
-#endif
-
        .endm
 
 #ifdef CONFIG_KPROBES
@@ -735,7 +715,7 @@ ENTRY(__switch_to)
  THUMB(        stmia   ip!, {r4 - sl, fp}         )    @ Store most regs on stack
  THUMB(        str     sp, [ip], #4               )
  THUMB(        str     lr, [ip], #4               )
-#ifdef CONFIG_MMU
+#ifdef CONFIG_CPU_USE_DOMAINS
        ldr     r6, [r2, #TI_CPU_DOMAIN]
 #endif
        set_tls r3, r4, r5
@@ -744,7 +724,7 @@ ENTRY(__switch_to)
        ldr     r8, =__stack_chk_guard
        ldr     r7, [r7, #TSK_STACK_CANARY]
 #endif
-#ifdef CONFIG_MMU
+#ifdef CONFIG_CPU_USE_DOMAINS
        mcr     p15, 0, r6, c3, c0, 0           @ Set domain register
 #endif
        mov     r5, r0
@@ -1245,3 +1225,9 @@ cr_alignment:
        .space  4
 cr_no_alignment:
        .space  4
+
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+       .globl  handle_arch_irq
+handle_arch_irq:
+       .space  4
+#endif
index 47837b85c07cb584fd4b3c337ccee90f401fdec2..e72dc34eea1cfbd0f3202067c1a937c4a20821d2 100644 (file)
@@ -45,6 +45,7 @@
 #include <asm/fiq.h>
 #include <asm/irq.h>
 #include <asm/system.h>
+#include <asm/traps.h>
 
 static unsigned long no_fiq_insn;
 
@@ -78,7 +79,11 @@ int show_fiq_list(struct seq_file *p, int prec)
 
 void set_fiq_handler(void *start, unsigned int length)
 {
+#if defined(CONFIG_CPU_USE_DOMAINS)
        memcpy((void *)0xffff001c, start, length);
+#else
+       memcpy(vectors_page + 0x1c, start, length);
+#endif
        flush_icache_range(0xffff001c, 0xffff001c + length);
        if (!vectors_high())
                flush_icache_range(0x1c, 0x1c + length);
index 6276f01df9e4e66d932ecc538322adb0fabc5376..c1269944cc59fd4ba4d43058827d2c05eb4a1bc2 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/proc_fs.h>
 
 #include <asm/system.h>
+#include <asm/mach/arch.h>
 #include <asm/mach/irq.h>
 #include <asm/mach/time.h>
 
@@ -47,8 +48,6 @@
 #define irq_finish(irq) do { } while (0)
 #endif
 
-unsigned int arch_nr_irqs;
-void (*init_arch_irq)(void) __initdata = NULL;
 unsigned long irq_err_count;
 
 int show_interrupts(struct seq_file *p, void *v)
@@ -165,13 +164,13 @@ void set_irq_flags(unsigned int irq, unsigned int iflags)
 
 void __init init_IRQ(void)
 {
-       init_arch_irq();
+       machine_desc->init_irq();
 }
 
 #ifdef CONFIG_SPARSE_IRQ
 int __init arch_probe_nr_irqs(void)
 {
-       nr_irqs = arch_nr_irqs ? arch_nr_irqs : NR_IRQS;
+       nr_irqs = machine_desc->nr_irqs ? machine_desc->nr_irqs : NR_IRQS;
        return nr_irqs;
 }
 #endif
index 336f14e0e5c212685c09f13f8ecbb30662873354..3455ad33de4c425bfdba98b7bef29999792f54e3 100644 (file)
@@ -75,9 +75,9 @@ extern void reboot_setup(char *str);
 
 unsigned int processor_id;
 EXPORT_SYMBOL(processor_id);
-unsigned int __machine_arch_type;
+unsigned int __machine_arch_type __read_mostly;
 EXPORT_SYMBOL(__machine_arch_type);
-unsigned int cacheid;
+unsigned int cacheid __read_mostly;
 EXPORT_SYMBOL(cacheid);
 
 unsigned int __atags_pointer __initdata;
@@ -91,24 +91,24 @@ EXPORT_SYMBOL(system_serial_low);
 unsigned int system_serial_high;
 EXPORT_SYMBOL(system_serial_high);
 
-unsigned int elf_hwcap;
+unsigned int elf_hwcap __read_mostly;
 EXPORT_SYMBOL(elf_hwcap);
 
 
 #ifdef MULTI_CPU
-struct processor processor;
+struct processor processor __read_mostly;
 #endif
 #ifdef MULTI_TLB
-struct cpu_tlb_fns cpu_tlb;
+struct cpu_tlb_fns cpu_tlb __read_mostly;
 #endif
 #ifdef MULTI_USER
-struct cpu_user_fns cpu_user;
+struct cpu_user_fns cpu_user __read_mostly;
 #endif
 #ifdef MULTI_CACHE
-struct cpu_cache_fns cpu_cache;
+struct cpu_cache_fns cpu_cache __read_mostly;
 #endif
 #ifdef CONFIG_OUTER_CACHE
-struct outer_cache_fns outer_cache;
+struct outer_cache_fns outer_cache __read_mostly;
 EXPORT_SYMBOL(outer_cache);
 #endif
 
@@ -126,6 +126,7 @@ EXPORT_SYMBOL(elf_platform);
 static const char *cpu_name;
 static const char *machine_name;
 static char __initdata cmd_line[COMMAND_LINE_SIZE];
+struct machine_desc *machine_desc __initdata;
 
 static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
 static union { char c[4]; unsigned long l; } endian_test __initdata = { { 'l', '?', '?', 'b' } };
@@ -708,13 +709,11 @@ static struct init_tags {
        { 0, ATAG_NONE }
 };
 
-static void (*init_machine)(void) __initdata;
-
 static int __init customize_machine(void)
 {
        /* customizes platform devices, or adds new ones */
-       if (init_machine)
-               init_machine();
+       if (machine_desc->init_machine)
+               machine_desc->init_machine();
        return 0;
 }
 arch_initcall(customize_machine);
@@ -809,6 +808,7 @@ void __init setup_arch(char **cmdline_p)
 
        setup_processor();
        mdesc = setup_machine(machine_arch_type);
+       machine_desc = mdesc;
        machine_name = mdesc->name;
 
        if (mdesc->soft_reboot)
@@ -868,13 +868,9 @@ void __init setup_arch(char **cmdline_p)
        cpu_init();
        tcm_init();
 
-       /*
-        * Set up various architecture-specific pointers
-        */
-       arch_nr_irqs = mdesc->nr_irqs;
-       init_arch_irq = mdesc->init_irq;
-       system_timer = mdesc->timer;
-       init_machine = mdesc->init_machine;
+#ifdef CONFIG_MULTI_IRQ_HANDLER
+       handle_arch_irq = mdesc->handle_irq;
+#endif
 
 #ifdef CONFIG_VT
 #if defined(CONFIG_VGA_CONSOLE)
@@ -884,6 +880,9 @@ void __init setup_arch(char **cmdline_p)
 #endif
 #endif
        early_trap_init();
+
+       if (mdesc->init_early)
+               mdesc->init_early();
 }
 
 
diff --git a/arch/arm/kernel/swp_emulate.c b/arch/arm/kernel/swp_emulate.c
new file mode 100644 (file)
index 0000000..7a57609
--- /dev/null
@@ -0,0 +1,267 @@
+/*
+ *  linux/arch/arm/kernel/swp_emulate.c
+ *
+ *  Copyright (C) 2009 ARM Limited
+ *  __user_* functions adapted from include/asm/uaccess.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ *  Implements emulation of the SWP/SWPB instructions using load-exclusive and
+ *  store-exclusive for processors that have them disabled (or future ones that
+ *  might not implement them).
+ *
+ *  Syntax of SWP{B} instruction: SWP{B}<c> <Rt>, <Rt2>, [<Rn>]
+ *  Where: Rt  = destination
+ *        Rt2 = source
+ *        Rn  = address
+ */
+
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/proc_fs.h>
+#include <linux/sched.h>
+#include <linux/syscalls.h>
+#include <linux/perf_event.h>
+
+#include <asm/traps.h>
+#include <asm/uaccess.h>
+
+/*
+ * Error-checking SWP macros implemented using ldrex{b}/strex{b}
+ */
+#define __user_swpX_asm(data, addr, res, temp, B)              \
+       __asm__ __volatile__(                                   \
+       "       mov             %2, %1\n"                       \
+       "0:     ldrex"B"        %1, [%3]\n"                     \
+       "1:     strex"B"        %0, %2, [%3]\n"                 \
+       "       cmp             %0, #0\n"                       \
+       "       movne           %0, %4\n"                       \
+       "2:\n"                                                  \
+       "       .section         .fixup,\"ax\"\n"               \
+       "       .align          2\n"                            \
+       "3:     mov             %0, %5\n"                       \
+       "       b               2b\n"                           \
+       "       .previous\n"                                    \
+       "       .section         __ex_table,\"a\"\n"            \
+       "       .align          3\n"                            \
+       "       .long           0b, 3b\n"                       \
+       "       .long           1b, 3b\n"                       \
+       "       .previous"                                      \
+       : "=&r" (res), "+r" (data), "=&r" (temp)                \
+       : "r" (addr), "i" (-EAGAIN), "i" (-EFAULT)              \
+       : "cc", "memory")
+
+#define __user_swp_asm(data, addr, res, temp) \
+       __user_swpX_asm(data, addr, res, temp, "")
+#define __user_swpb_asm(data, addr, res, temp) \
+       __user_swpX_asm(data, addr, res, temp, "b")
+
+/*
+ * Macros/defines for extracting register numbers from instruction.
+ */
+#define EXTRACT_REG_NUM(instruction, offset) \
+       (((instruction) & (0xf << (offset))) >> (offset))
+#define RN_OFFSET  16
+#define RT_OFFSET  12
+#define RT2_OFFSET  0
+/*
+ * Bit 22 of the instruction encoding distinguishes between
+ * the SWP and SWPB variants (bit set means SWPB).
+ */
+#define TYPE_SWPB (1 << 22)
+
+static unsigned long swpcounter;
+static unsigned long swpbcounter;
+static unsigned long abtcounter;
+static pid_t         previous_pid;
+
+#ifdef CONFIG_PROC_FS
+static int proc_read_status(char *page, char **start, off_t off, int count,
+                           int *eof, void *data)
+{
+       char *p = page;
+       int len;
+
+       p += sprintf(p, "Emulated SWP:\t\t%lu\n", swpcounter);
+       p += sprintf(p, "Emulated SWPB:\t\t%lu\n", swpbcounter);
+       p += sprintf(p, "Aborted SWP{B}:\t\t%lu\n", abtcounter);
+       if (previous_pid != 0)
+               p += sprintf(p, "Last process:\t\t%d\n", previous_pid);
+
+       len = (p - page) - off;
+       if (len < 0)
+               len = 0;
+
+       *eof = (len <= count) ? 1 : 0;
+       *start = page + off;
+
+       return len;
+}
+#endif
+
+/*
+ * Set up process info to signal segmentation fault - called on access error.
+ */
+static void set_segfault(struct pt_regs *regs, unsigned long addr)
+{
+       siginfo_t info;
+
+       if (find_vma(current->mm, addr) == NULL)
+               info.si_code = SEGV_MAPERR;
+       else
+               info.si_code = SEGV_ACCERR;
+
+       info.si_signo = SIGSEGV;
+       info.si_errno = 0;
+       info.si_addr  = (void *) instruction_pointer(regs);
+
+       pr_debug("SWP{B} emulation: access caused memory abort!\n");
+       arm_notify_die("Illegal memory access", regs, &info, 0, 0);
+
+       abtcounter++;
+}
+
+static int emulate_swpX(unsigned int address, unsigned int *data,
+                       unsigned int type)
+{
+       unsigned int res = 0;
+
+       if ((type != TYPE_SWPB) && (address & 0x3)) {
+               /* SWP to unaligned address not permitted */
+               pr_debug("SWP instruction on unaligned pointer!\n");
+               return -EFAULT;
+       }
+
+       while (1) {
+               unsigned long temp;
+
+               /*
+                * Barrier required between accessing protected resource and
+                * releasing a lock for it. Legacy code might not have done
+                * this, and we cannot determine that this is not the case
+                * being emulated, so insert always.
+                */
+               smp_mb();
+
+               if (type == TYPE_SWPB)
+                       __user_swpb_asm(*data, address, res, temp);
+               else
+                       __user_swp_asm(*data, address, res, temp);
+
+               if (likely(res != -EAGAIN) || signal_pending(current))
+                       break;
+
+               cond_resched();
+       }
+
+       if (res == 0) {
+               /*
+                * Barrier also required between aquiring a lock for a
+                * protected resource and accessing the resource. Inserted for
+                * same reason as above.
+                */
+               smp_mb();
+
+               if (type == TYPE_SWPB)
+                       swpbcounter++;
+               else
+                       swpcounter++;
+       }
+
+       return res;
+}
+
+/*
+ * swp_handler logs the id of calling process, dissects the instruction, sanity
+ * checks the memory location, calls emulate_swpX for the actual operation and
+ * deals with fixup/error handling before returning
+ */
+static int swp_handler(struct pt_regs *regs, unsigned int instr)
+{
+       unsigned int address, destreg, data, type;
+       unsigned int res = 0;
+
+       perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, 0, regs, regs->ARM_pc);
+
+       if (current->pid != previous_pid) {
+               pr_debug("\"%s\" (%ld) uses deprecated SWP{B} instruction\n",
+                        current->comm, (unsigned long)current->pid);
+               previous_pid = current->pid;
+       }
+
+       address = regs->uregs[EXTRACT_REG_NUM(instr, RN_OFFSET)];
+       data    = regs->uregs[EXTRACT_REG_NUM(instr, RT2_OFFSET)];
+       destreg = EXTRACT_REG_NUM(instr, RT_OFFSET);
+
+       type = instr & TYPE_SWPB;
+
+       pr_debug("addr in r%d->0x%08x, dest is r%d, source in r%d->0x%08x)\n",
+                EXTRACT_REG_NUM(instr, RN_OFFSET), address,
+                destreg, EXTRACT_REG_NUM(instr, RT2_OFFSET), data);
+
+       /* Check access in reasonable access range for both SWP and SWPB */
+       if (!access_ok(VERIFY_WRITE, (address & ~3), 4)) {
+               pr_debug("SWP{B} emulation: access to %p not allowed!\n",
+                        (void *)address);
+               res = -EFAULT;
+       } else {
+               res = emulate_swpX(address, &data, type);
+       }
+
+       if (res == 0) {
+               /*
+                * On successful emulation, revert the adjustment to the PC
+                * made in kernel/traps.c in order to resume execution at the
+                * instruction following the SWP{B}.
+                */
+               regs->ARM_pc += 4;
+               regs->uregs[destreg] = data;
+       } else if (res == -EFAULT) {
+               /*
+                * Memory errors do not mean emulation failed.
+                * Set up signal info to return SEGV, then return OK
+                */
+               set_segfault(regs, address);
+       }
+
+       return 0;
+}
+
+/*
+ * Only emulate SWP/SWPB executed in ARM state/User mode.
+ * The kernel must be SWP free and SWP{B} does not exist in Thumb/ThumbEE.
+ */
+static struct undef_hook swp_hook = {
+       .instr_mask = 0x0fb00ff0,
+       .instr_val  = 0x01000090,
+       .cpsr_mask  = MODE_MASK | PSR_T_BIT | PSR_J_BIT,
+       .cpsr_val   = USR_MODE,
+       .fn         = swp_handler
+};
+
+/*
+ * Register handler and create status file in /proc/cpu
+ * Invoked as late_initcall, since not needed before init spawned.
+ */
+static int __init swp_emulation_init(void)
+{
+#ifdef CONFIG_PROC_FS
+       struct proc_dir_entry *res;
+
+       res = create_proc_entry("cpu/swp_emulation", S_IRUGO, NULL);
+
+       if (!res)
+               return -ENOMEM;
+
+       res->read_proc = proc_read_status;
+#endif /* CONFIG_PROC_FS */
+
+       printk(KERN_NOTICE "Registering SWP/SWPB emulation handler\n");
+       register_undef_hook(&swp_hook);
+
+       return 0;
+}
+
+late_initcall(swp_emulation_init);
index 38c261f9951c8ddf5be050e61743dfe449f887bb..f1e2eb19a67d40b9fd71166da0e46c21be72e124 100644 (file)
 #include <asm/leds.h>
 #include <asm/thread_info.h>
 #include <asm/stacktrace.h>
+#include <asm/mach/arch.h>
 #include <asm/mach/time.h>
 
 /*
  * Our system timer.
  */
-struct sys_timer *system_timer;
+static struct sys_timer *system_timer;
 
 #if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE)
 /* this needs a better home */
@@ -160,6 +161,7 @@ device_initcall(timer_init_sysfs);
 
 void __init time_init(void)
 {
+       system_timer = machine_desc->timer;
        system_timer->init();
 }
 
index 446aee97436f22b82ba7d2f16a06d74b507b7042..e02f4f7537c51342fb0a9a6e0f794bd49a4bbe80 100644 (file)
@@ -37,6 +37,8 @@
 
 static const char *handler[]= { "prefetch abort", "data abort", "address exception", "interrupt" };
 
+void *vectors_page;
+
 #ifdef CONFIG_DEBUG_USER
 unsigned int user_debug;
 
@@ -756,7 +758,11 @@ static void __init kuser_get_tls_init(unsigned long vectors)
 
 void __init early_trap_init(void)
 {
+#if defined(CONFIG_CPU_USE_DOMAINS)
        unsigned long vectors = CONFIG_VECTORS_BASE;
+#else
+       unsigned long vectors = (unsigned long)vectors_page;
+#endif
        extern char __stubs_start[], __stubs_end[];
        extern char __vectors_start[], __vectors_end[];
        extern char __kuser_helper_start[], __kuser_helper_end[];
@@ -780,10 +786,10 @@ void __init early_trap_init(void)
         * Copy signal return handlers into the vector page, and
         * set sigreturn to be a pointer to these.
         */
-       memcpy((void *)KERN_SIGRETURN_CODE, sigreturn_codes,
-              sizeof(sigreturn_codes));
-       memcpy((void *)KERN_RESTART_CODE, syscall_restart_code,
-              sizeof(syscall_restart_code));
+       memcpy((void *)(vectors + KERN_SIGRETURN_CODE - CONFIG_VECTORS_BASE),
+              sigreturn_codes, sizeof(sigreturn_codes));
+       memcpy((void *)(vectors + KERN_RESTART_CODE - CONFIG_VECTORS_BASE),
+              syscall_restart_code, sizeof(syscall_restart_code));
 
        flush_icache_range(vectors, vectors + PAGE_SIZE);
        modify_domain(DOMAIN_USER, DOMAIN_CLIENT);
index cead8893b46bc2d91ac156b9c8382c8aa4ebc71f..1581f6d18ccad57ac5f8b6338327750727b6afd2 100644 (file)
@@ -167,6 +167,7 @@ SECTIONS
 
                NOSAVE_DATA
                CACHELINE_ALIGNED_DATA(32)
+               READ_MOSTLY_DATA(32)
 
                /*
                 * The exception fixup table (might need resorting at runtime)
index b1631a7dbe750dc4615e8d76f535e48fb2a0c52d..1b049cd7a49a8badab511ed2b0532d1f7e76b733 100644 (file)
  */
 #include <linux/linkage.h>
 #include <asm/errno.h>
+#include <asm/domain.h>
 
 ENTRY(__get_user_1)
-1:     ldrbt   r2, [r0]
+1:     T(ldrb) r2, [r0]
        mov     r0, #0
        mov     pc, lr
 ENDPROC(__get_user_1)
 
 ENTRY(__get_user_2)
 #ifdef CONFIG_THUMB2_KERNEL
-2:     ldrbt   r2, [r0]
-3:     ldrbt   r3, [r0, #1]
+2:     T(ldrb) r2, [r0]
+3:     T(ldrb) r3, [r0, #1]
 #else
-2:     ldrbt   r2, [r0], #1
-3:     ldrbt   r3, [r0]
+2:     T(ldrb) r2, [r0], #1
+3:     T(ldrb) r3, [r0]
 #endif
 #ifndef __ARMEB__
        orr     r2, r2, r3, lsl #8
@@ -53,7 +54,7 @@ ENTRY(__get_user_2)
 ENDPROC(__get_user_2)
 
 ENTRY(__get_user_4)
-4:     ldrt    r2, [r0]
+4:     T(ldr)  r2, [r0]
        mov     r0, #0
        mov     pc, lr
 ENDPROC(__get_user_4)
index 5a01a23c6c06f8315a571e93dde34a18dc744591..c023fc11e86c7b603eaaa08270e7ea429ecfab5f 100644 (file)
  */
 #include <linux/linkage.h>
 #include <asm/errno.h>
+#include <asm/domain.h>
 
 ENTRY(__put_user_1)
-1:     strbt   r2, [r0]
+1:     T(strb) r2, [r0]
        mov     r0, #0
        mov     pc, lr
 ENDPROC(__put_user_1)
@@ -39,19 +40,19 @@ ENTRY(__put_user_2)
        mov     ip, r2, lsr #8
 #ifdef CONFIG_THUMB2_KERNEL
 #ifndef __ARMEB__
-2:     strbt   r2, [r0]
-3:     strbt   ip, [r0, #1]
+2:     T(strb) r2, [r0]
+3:     T(strb) ip, [r0, #1]
 #else
-2:     strbt   ip, [r0]
-3:     strbt   r2, [r0, #1]
+2:     T(strb) ip, [r0]
+3:     T(strb) r2, [r0, #1]
 #endif
 #else  /* !CONFIG_THUMB2_KERNEL */
 #ifndef __ARMEB__
-2:     strbt   r2, [r0], #1
-3:     strbt   ip, [r0]
+2:     T(strb) r2, [r0], #1
+3:     T(strb) ip, [r0]
 #else
-2:     strbt   ip, [r0], #1
-3:     strbt   r2, [r0]
+2:     T(strb) ip, [r0], #1
+3:     T(strb) r2, [r0]
 #endif
 #endif /* CONFIG_THUMB2_KERNEL */
        mov     r0, #0
@@ -59,18 +60,18 @@ ENTRY(__put_user_2)
 ENDPROC(__put_user_2)
 
 ENTRY(__put_user_4)
-4:     strt    r2, [r0]
+4:     T(str)  r2, [r0]
        mov     r0, #0
        mov     pc, lr
 ENDPROC(__put_user_4)
 
 ENTRY(__put_user_8)
 #ifdef CONFIG_THUMB2_KERNEL
-5:     strt    r2, [r0]
-6:     strt    r3, [r0, #4]
+5:     T(str)  r2, [r0]
+6:     T(str)  r3, [r0, #4]
 #else
-5:     strt    r2, [r0], #4
-6:     strt    r3, [r0]
+5:     T(str)  r2, [r0], #4
+6:     T(str)  r3, [r0]
 #endif
        mov     r0, #0
        mov     pc, lr
index fee9f6f88adb5eddf11f78ac8345423256381757..d0ece2aeb70dfc380d689a85a141a28a5917ec20 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 #include <asm/errno.h>
+#include <asm/domain.h>
 
                .text
 
                rsb     ip, ip, #4
                cmp     ip, #2
                ldrb    r3, [r1], #1
-USER(          strbt   r3, [r0], #1)                   @ May fault
+USER(          T(strb) r3, [r0], #1)                   @ May fault
                ldrgeb  r3, [r1], #1
-USER(          strgebt r3, [r0], #1)                   @ May fault
+USER(          T(strgeb) r3, [r0], #1)                 @ May fault
                ldrgtb  r3, [r1], #1
-USER(          strgtbt r3, [r0], #1)                   @ May fault
+USER(          T(strgtb) r3, [r0], #1)                 @ May fault
                sub     r2, r2, ip
                b       .Lc2u_dest_aligned
 
@@ -58,7 +59,7 @@ ENTRY(__copy_to_user)
                addmi   ip, r2, #4
                bmi     .Lc2u_0nowords
                ldr     r3, [r1], #4
-USER(          strt    r3, [r0], #4)                   @ May fault
+USER(          T(str)  r3, [r0], #4)                   @ May fault
                mov     ip, r0, lsl #32 - PAGE_SHIFT    @ On each page, use a ld/st??t instruction
                rsb     ip, ip, #0
                movs    ip, ip, lsr #32 - PAGE_SHIFT
@@ -87,18 +88,18 @@ USER(               strt    r3, [r0], #4)                   @ May fault
                stmneia r0!, {r3 - r4}                  @ Shouldnt fault
                tst     ip, #4
                ldrne   r3, [r1], #4
-               strnet  r3, [r0], #4                    @ Shouldnt fault
+               T(strne) r3, [r0], #4                   @ Shouldnt fault
                ands    ip, ip, #3
                beq     .Lc2u_0fupi
 .Lc2u_0nowords:        teq     ip, #0
                beq     .Lc2u_finished
 .Lc2u_nowords: cmp     ip, #2
                ldrb    r3, [r1], #1
-USER(          strbt   r3, [r0], #1)                   @ May fault
+USER(          T(strb) r3, [r0], #1)                   @ May fault
                ldrgeb  r3, [r1], #1
-USER(          strgebt r3, [r0], #1)                   @ May fault
+USER(          T(strgeb) r3, [r0], #1)                 @ May fault
                ldrgtb  r3, [r1], #1
-USER(          strgtbt r3, [r0], #1)                   @ May fault
+USER(          T(strgtb) r3, [r0], #1)                 @ May fault
                b       .Lc2u_finished
 
 .Lc2u_not_enough:
@@ -119,7 +120,7 @@ USER(               strgtbt r3, [r0], #1)                   @ May fault
                mov     r3, r7, pull #8
                ldr     r7, [r1], #4
                orr     r3, r3, r7, push #24
-USER(          strt    r3, [r0], #4)                   @ May fault
+USER(          T(str)  r3, [r0], #4)                   @ May fault
                mov     ip, r0, lsl #32 - PAGE_SHIFT
                rsb     ip, ip, #0
                movs    ip, ip, lsr #32 - PAGE_SHIFT
@@ -154,18 +155,18 @@ USER(             strt    r3, [r0], #4)                   @ May fault
                movne   r3, r7, pull #8
                ldrne   r7, [r1], #4
                orrne   r3, r3, r7, push #24
-               strnet  r3, [r0], #4                    @ Shouldnt fault
+               T(strne) r3, [r0], #4                   @ Shouldnt fault
                ands    ip, ip, #3
                beq     .Lc2u_1fupi
 .Lc2u_1nowords:        mov     r3, r7, get_byte_1
                teq     ip, #0
                beq     .Lc2u_finished
                cmp     ip, #2
-USER(          strbt   r3, [r0], #1)                   @ May fault
+USER(          T(strb) r3, [r0], #1)                   @ May fault
                movge   r3, r7, get_byte_2
-USER(          strgebt r3, [r0], #1)                   @ May fault
+USER(          T(strgeb) r3, [r0], #1)                 @ May fault
                movgt   r3, r7, get_byte_3
-USER(          strgtbt r3, [r0], #1)                   @ May fault
+USER(          T(strgtb) r3, [r0], #1)                 @ May fault
                b       .Lc2u_finished
 
 .Lc2u_2fupi:   subs    r2, r2, #4
@@ -174,7 +175,7 @@ USER(               strgtbt r3, [r0], #1)                   @ May fault
                mov     r3, r7, pull #16
                ldr     r7, [r1], #4
                orr     r3, r3, r7, push #16
-USER(          strt    r3, [r0], #4)                   @ May fault
+USER(          T(str)  r3, [r0], #4)                   @ May fault
                mov     ip, r0, lsl #32 - PAGE_SHIFT
                rsb     ip, ip, #0
                movs    ip, ip, lsr #32 - PAGE_SHIFT
@@ -209,18 +210,18 @@ USER(             strt    r3, [r0], #4)                   @ May fault
                movne   r3, r7, pull #16
                ldrne   r7, [r1], #4
                orrne   r3, r3, r7, push #16
-               strnet  r3, [r0], #4                    @ Shouldnt fault
+               T(strne) r3, [r0], #4                   @ Shouldnt fault
                ands    ip, ip, #3
                beq     .Lc2u_2fupi
 .Lc2u_2nowords:        mov     r3, r7, get_byte_2
                teq     ip, #0
                beq     .Lc2u_finished
                cmp     ip, #2
-USER(          strbt   r3, [r0], #1)                   @ May fault
+USER(          T(strb) r3, [r0], #1)                   @ May fault
                movge   r3, r7, get_byte_3
-USER(          strgebt r3, [r0], #1)                   @ May fault
+USER(          T(strgeb) r3, [r0], #1)                 @ May fault
                ldrgtb  r3, [r1], #0
-USER(          strgtbt r3, [r0], #1)                   @ May fault
+USER(          T(strgtb) r3, [r0], #1)                 @ May fault
                b       .Lc2u_finished
 
 .Lc2u_3fupi:   subs    r2, r2, #4
@@ -229,7 +230,7 @@ USER(               strgtbt r3, [r0], #1)                   @ May fault
                mov     r3, r7, pull #24
                ldr     r7, [r1], #4
                orr     r3, r3, r7, push #8
-USER(          strt    r3, [r0], #4)                   @ May fault
+USER(          T(str)  r3, [r0], #4)                   @ May fault
                mov     ip, r0, lsl #32 - PAGE_SHIFT
                rsb     ip, ip, #0
                movs    ip, ip, lsr #32 - PAGE_SHIFT
@@ -264,18 +265,18 @@ USER(             strt    r3, [r0], #4)                   @ May fault
                movne   r3, r7, pull #24
                ldrne   r7, [r1], #4
                orrne   r3, r3, r7, push #8
-               strnet  r3, [r0], #4                    @ Shouldnt fault
+               T(strne) r3, [r0], #4                   @ Shouldnt fault
                ands    ip, ip, #3
                beq     .Lc2u_3fupi
 .Lc2u_3nowords:        mov     r3, r7, get_byte_3
                teq     ip, #0
                beq     .Lc2u_finished
                cmp     ip, #2
-USER(          strbt   r3, [r0], #1)                   @ May fault
+USER(          T(strb) r3, [r0], #1)                   @ May fault
                ldrgeb  r3, [r1], #1
-USER(          strgebt r3, [r0], #1)                   @ May fault
+USER(          T(strgeb) r3, [r0], #1)                 @ May fault
                ldrgtb  r3, [r1], #0
-USER(          strgtbt r3, [r0], #1)                   @ May fault
+USER(          T(strgtb) r3, [r0], #1)                 @ May fault
                b       .Lc2u_finished
 ENDPROC(__copy_to_user)
 
@@ -294,11 +295,11 @@ ENDPROC(__copy_to_user)
 .Lcfu_dest_not_aligned:
                rsb     ip, ip, #4
                cmp     ip, #2
-USER(          ldrbt   r3, [r1], #1)                   @ May fault
+USER(          T(ldrb) r3, [r1], #1)                   @ May fault
                strb    r3, [r0], #1
-USER(          ldrgebt r3, [r1], #1)                   @ May fault
+USER(          T(ldrgeb) r3, [r1], #1)                 @ May fault
                strgeb  r3, [r0], #1
-USER(          ldrgtbt r3, [r1], #1)                   @ May fault
+USER(          T(ldrgtb) r3, [r1], #1)                 @ May fault
                strgtb  r3, [r0], #1
                sub     r2, r2, ip
                b       .Lcfu_dest_aligned
@@ -321,7 +322,7 @@ ENTRY(__copy_from_user)
 .Lcfu_0fupi:   subs    r2, r2, #4
                addmi   ip, r2, #4
                bmi     .Lcfu_0nowords
-USER(          ldrt    r3, [r1], #4)
+USER(          T(ldr)  r3, [r1], #4)
                str     r3, [r0], #4
                mov     ip, r1, lsl #32 - PAGE_SHIFT    @ On each page, use a ld/st??t instruction
                rsb     ip, ip, #0
@@ -350,18 +351,18 @@ USER(             ldrt    r3, [r1], #4)
                ldmneia r1!, {r3 - r4}                  @ Shouldnt fault
                stmneia r0!, {r3 - r4}
                tst     ip, #4
-               ldrnet  r3, [r1], #4                    @ Shouldnt fault
+               T(ldrne) r3, [r1], #4                   @ Shouldnt fault
                strne   r3, [r0], #4
                ands    ip, ip, #3
                beq     .Lcfu_0fupi
 .Lcfu_0nowords:        teq     ip, #0
                beq     .Lcfu_finished
 .Lcfu_nowords: cmp     ip, #2
-USER(          ldrbt   r3, [r1], #1)                   @ May fault
+USER(          T(ldrb) r3, [r1], #1)                   @ May fault
                strb    r3, [r0], #1
-USER(          ldrgebt r3, [r1], #1)                   @ May fault
+USER(          T(ldrgeb) r3, [r1], #1)                 @ May fault
                strgeb  r3, [r0], #1
-USER(          ldrgtbt r3, [r1], #1)                   @ May fault
+USER(          T(ldrgtb) r3, [r1], #1)                 @ May fault
                strgtb  r3, [r0], #1
                b       .Lcfu_finished
 
@@ -374,7 +375,7 @@ USER(               ldrgtbt r3, [r1], #1)                   @ May fault
 
 .Lcfu_src_not_aligned:
                bic     r1, r1, #3
-USER(          ldrt    r7, [r1], #4)                   @ May fault
+USER(          T(ldr)  r7, [r1], #4)                   @ May fault
                cmp     ip, #2
                bgt     .Lcfu_3fupi
                beq     .Lcfu_2fupi
@@ -382,7 +383,7 @@ USER(               ldrt    r7, [r1], #4)                   @ May fault
                addmi   ip, r2, #4
                bmi     .Lcfu_1nowords
                mov     r3, r7, pull #8
-USER(          ldrt    r7, [r1], #4)                   @ May fault
+USER(          T(ldr)  r7, [r1], #4)                   @ May fault
                orr     r3, r3, r7, push #24
                str     r3, [r0], #4
                mov     ip, r1, lsl #32 - PAGE_SHIFT
@@ -417,7 +418,7 @@ USER(               ldrt    r7, [r1], #4)                   @ May fault
                stmneia r0!, {r3 - r4}
                tst     ip, #4
                movne   r3, r7, pull #8
-USER(          ldrnet  r7, [r1], #4)                   @ May fault
+USER(          T(ldrne) r7, [r1], #4)                  @ May fault
                orrne   r3, r3, r7, push #24
                strne   r3, [r0], #4
                ands    ip, ip, #3
@@ -437,7 +438,7 @@ USER(               ldrnet  r7, [r1], #4)                   @ May fault
                addmi   ip, r2, #4
                bmi     .Lcfu_2nowords
                mov     r3, r7, pull #16
-USER(          ldrt    r7, [r1], #4)                   @ May fault
+USER(          T(ldr)  r7, [r1], #4)                   @ May fault
                orr     r3, r3, r7, push #16
                str     r3, [r0], #4
                mov     ip, r1, lsl #32 - PAGE_SHIFT
@@ -473,7 +474,7 @@ USER(               ldrt    r7, [r1], #4)                   @ May fault
                stmneia r0!, {r3 - r4}
                tst     ip, #4
                movne   r3, r7, pull #16
-USER(          ldrnet  r7, [r1], #4)                   @ May fault
+USER(          T(ldrne) r7, [r1], #4)                  @ May fault
                orrne   r3, r3, r7, push #16
                strne   r3, [r0], #4
                ands    ip, ip, #3
@@ -485,7 +486,7 @@ USER(               ldrnet  r7, [r1], #4)                   @ May fault
                strb    r3, [r0], #1
                movge   r3, r7, get_byte_3
                strgeb  r3, [r0], #1
-USER(          ldrgtbt r3, [r1], #0)                   @ May fault
+USER(          T(ldrgtb) r3, [r1], #0)                 @ May fault
                strgtb  r3, [r0], #1
                b       .Lcfu_finished
 
@@ -493,7 +494,7 @@ USER(               ldrgtbt r3, [r1], #0)                   @ May fault
                addmi   ip, r2, #4
                bmi     .Lcfu_3nowords
                mov     r3, r7, pull #24
-USER(          ldrt    r7, [r1], #4)                   @ May fault
+USER(          T(ldr)  r7, [r1], #4)                   @ May fault
                orr     r3, r3, r7, push #8
                str     r3, [r0], #4
                mov     ip, r1, lsl #32 - PAGE_SHIFT
@@ -528,7 +529,7 @@ USER(               ldrt    r7, [r1], #4)                   @ May fault
                stmneia r0!, {r3 - r4}
                tst     ip, #4
                movne   r3, r7, pull #24
-USER(          ldrnet  r7, [r1], #4)                   @ May fault
+USER(          T(ldrne) r7, [r1], #4)                  @ May fault
                orrne   r3, r3, r7, push #8
                strne   r3, [r0], #4
                ands    ip, ip, #3
@@ -538,9 +539,9 @@ USER(               ldrnet  r7, [r1], #4)                   @ May fault
                beq     .Lcfu_finished
                cmp     ip, #2
                strb    r3, [r0], #1
-USER(          ldrgebt r3, [r1], #1)                   @ May fault
+USER(          T(ldrgeb) r3, [r1], #1)                 @ May fault
                strgeb  r3, [r0], #1
-USER(          ldrgtbt r3, [r1], #1)                   @ May fault
+USER(          T(ldrgtb) r3, [r1], #1)                 @ May fault
                strgtb  r3, [r0], #1
                b       .Lcfu_finished
 ENDPROC(__copy_from_user)
index 14bafc38f2dcc05e51443db5f90f7d1e0d356f4b..ad237a42d265ec6033c85d7684f16940551c17ad 100644 (file)
 #include <linux/string.h>
 #include <linux/clk.h>
 #include <linux/spinlock.h>
+#include <linux/clkdev.h>
 #include <mach/csp/hw_cfg.h>
 #include <mach/csp/chipcHw_def.h>
 #include <mach/csp/chipcHw_reg.h>
 #include <mach/csp/chipcHw_inline.h>
 
-#include <asm/clkdev.h>
-
 #include "clock.h"
 
 #define clk_is_primary(x)       ((x)->type & CLK_TYPE_PRIMARY)
index d3f959e92b2dd2ef15e129a3bd79e52801811efe..ed96ef400474b4f3a4dbaec9153d3481380c1639 100644 (file)
 #include <linux/amba/bus.h>
 #include <linux/clocksource.h>
 #include <linux/clockchips.h>
+#include <linux/clkdev.h>
 
 #include <mach/csp/mm_addr.h>
 #include <mach/hardware.h>
-#include <asm/clkdev.h>
 #include <linux/io.h>
 #include <asm/irq.h>
 #include <asm/hardware/arm_timer.h>
index 9ebfcc46feb1a0f115970cfd53805cc117de57f5..29b13f249aa9b473d11168f42447da800d2dcdb7 100644 (file)
@@ -3,6 +3,7 @@ menu "CNS3XXX platform type"
 
 config MACH_CNS3420VB
        bool "Support for CNS3420 Validation Board"
+       select MIGHT_HAVE_PCI
        help
          Include support for the Cavium Networks CNS3420 MPCore Platform
          Baseboard.
index 11099980b58bdfc2342ba67a8ccd373f07fb4fdf..0dd22031ec6222467a4a3a5ccb0eb27405e1d510 100644 (file)
@@ -68,7 +68,7 @@
 #ifndef __ASSEMBLER__
 
 #include <linux/list.h>
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 
 #define PLLSTAT_GOSTAT BIT(0)
 #define PLLCMD_GOSET   BIT(0)
index ef06c66a6f1630cbab1ec79487382dc8704f4049..ca4de71050973184945297febfc7b2111103f76c 100644 (file)
 #include <linux/string.h>
 #include <linux/io.h>
 #include <linux/spinlock.h>
+#include <linux/clkdev.h>
 
 #include <mach/hardware.h>
 
-#include <asm/clkdev.h>
 #include <asm/div64.h>
 
 
index daca30b2d5b1ad5d77c03e8166910a8b7ca5a066..3938a563b2807d70f89d4eedcb4e2a2d9537a170 100644 (file)
@@ -22,8 +22,7 @@
 #include <linux/err.h>
 #include <linux/clk.h>
 #include <linux/io.h>
-
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 
 #include <mach/clock.h>
 #include <mach/hardware.h>
index cf15ea516a72c4e177d1d4d66374ea0a4ed8676f..d7056559715a0de656f4064b95f01381935fa60d 100644 (file)
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/module.h>
+#include <linux/clkdev.h>
 
 #include <mach/clock.h>
 #include <mach/hardware.h>
 #include <mach/common.h>
-#include <asm/clkdev.h>
 #include <asm/div64.h>
 
 #define IO_ADDR_CCM(off)       (MX21_IO_ADDRESS(MX21_CCM_BASE_ADDR + (off)))
index 98a25bada783fef44c1c5911dcc5cd7ca7ab8c9a..ca1017b9028d0a2bc9c186236fe3a3d5277aeaca 100644 (file)
@@ -21,8 +21,8 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/module.h>
+#include <linux/clkdev.h>
 
-#include <asm/clkdev.h>
 #include <asm/div64.h>
 
 #include <mach/clock.h>
index 27db275b367cf167e3dcf018f9d76eb30098b65b..769b0f10c83496a48565ba50b236f9a10aaf9df9 100644 (file)
@@ -4,6 +4,7 @@ menu "Integrator Options"
 
 config ARCH_INTEGRATOR_AP
        bool "Support Integrator/AP and Integrator/PP2 platforms"
+       select MIGHT_HAVE_PCI
        help
          Include support for the ARM(R) Integrator/AP and
          Integrator/PP2 platforms.
index 8f4fb6d638f7ea66717a5afb5d962ef0d88723a3..b8e884b450da7454e77b9fe3d030f2729aacd8aa 100644 (file)
@@ -21,9 +21,8 @@
 #include <linux/amba/bus.h>
 #include <linux/amba/serial.h>
 #include <linux/io.h>
+#include <linux/clkdev.h>
 
-#include <asm/clkdev.h>
-#include <mach/clkdev.h>
 #include <mach/hardware.h>
 #include <mach/platform.h>
 #include <asm/irq.h>
index fd684bf205e5d228b11ccf13685d9ed14229be96..5db574f8ae3fd218d393898512930adf53fe2bf3 100644 (file)
@@ -22,9 +22,8 @@
 #include <linux/amba/clcd.h>
 #include <linux/io.h>
 #include <linux/slab.h>
+#include <linux/clkdev.h>
 
-#include <asm/clkdev.h>
-#include <mach/clkdev.h>
 #include <asm/hardware/icst.h>
 #include <mach/lm.h>
 #include <mach/impd1.h>
index 6258c90d020c30edf75faa7f06976d6cedef2e7e..9403d2fa13a39fd58877b6c47f48fafc3f22b4cb 100644 (file)
@@ -21,9 +21,8 @@
 #include <linux/amba/mmci.h>
 #include <linux/io.h>
 #include <linux/gfp.h>
+#include <linux/clkdev.h>
 
-#include <asm/clkdev.h>
-#include <mach/clkdev.h>
 #include <mach/hardware.h>
 #include <mach/platform.h>
 #include <asm/irq.h>
index 7415e4338651e7c84e2e3a587092a1c1859cda1d..3ad455318868db02adf4c44bd62555f33682af7f 100644 (file)
@@ -58,13 +58,13 @@ static inline unsigned long __lbus_to_virt(dma_addr_t x)
                __dma;                                                  \
        })
 
-#define __arch_page_to_dma(dev, page)                                  \
+#define __arch_pfn_to_dma(dev, pfn)                                    \
        ({                                                              \
                /* __is_lbus_virt() can never be true for RAM pages */  \
-               (dma_addr_t)page_to_phys(page);                         \
+               (dma_addr_t)__pfn_to_phys(pfn);                         \
        })
 
-#define __arch_dma_to_page(dev, addr)  phys_to_page(addr)
+#define __arch_dma_to_pfn(dev, addr)   __phys_to_pfn(addr)
 
 #endif /* CONFIG_ARCH_IOP13XX */
 #endif /* !ASSEMBLY */
index fe0c82e30b2dbdc9fb3ff81a1c64c277b7e8843f..f5c39a8c2b00f39b683819e2b0c93ab89705b243 100644 (file)
@@ -4,6 +4,7 @@ menu "Kendin/Micrel KS8695 Implementations"
 
 config MACH_KS8695
        bool "KS8695 development board"
+       select MIGHT_HAVE_PCI
        help
          Say 'Y' here if you want your kernel to run on the original
          Kendin-Micrel KS8695 development board.
index ffa19aae6e054676f039b4691b946966205597b7..bace9a681adcbe5ace6f063f519a384ccf048eae 100644 (file)
@@ -35,17 +35,17 @@ extern struct bus_type platform_bus_type;
                                        __phys_to_virt(x) : __bus_to_virt(x)); })
 #define __arch_virt_to_dma(dev, x)     ({ is_lbus_device(dev) ? \
                                        (dma_addr_t)__virt_to_phys(x) : (dma_addr_t)__virt_to_bus(x); })
-#define __arch_page_to_dma(dev, x)     \
-       ({ dma_addr_t __dma = page_to_phys(page); \
+#define __arch_pfn_to_dma(dev, pfn)    \
+       ({ dma_addr_t __dma = __pfn_to_phys(pfn); \
           if (!is_lbus_device(dev)) \
                __dma = __dma - PHYS_OFFSET + KS8695_PCIMEM_PA; \
           __dma; })
 
-#define __arch_dma_to_page(dev, x)     \
+#define __arch_dma_to_pfn(dev, x)      \
        ({ dma_addr_t __dma = x;                                \
           if (!is_lbus_device(dev))                            \
                __dma += PHYS_OFFSET - KS8695_PCIMEM_PA;        \
-          phys_to_page(__dma);                                 \
+          __phys_to_pfn(__dma);                                \
        })
 
 #endif
index 32d63796430aa12d91e7391fdc7f293bfca92f0d..da0e6498110a4f6400274b74015e964ab81566f5 100644 (file)
 #include <linux/clk.h>
 #include <linux/amba/bus.h>
 #include <linux/amba/clcd.h>
+#include <linux/clkdev.h>
 
 #include <mach/hardware.h>
-#include <asm/clkdev.h>
-#include <mach/clkdev.h>
 #include <mach/platform.h>
 #include "clock.h"
 #include "common.h"
index 016ae94691c04cd42838c9b0af352b68a6e7cacc..9b027d7491f5e9ba854e496568eaa2fafdc9be5e 100644 (file)
@@ -6,7 +6,7 @@
  *  published by the Free Software Foundation.
  */
 
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 
 struct clkops {
        void                    (*enable)(struct clk *);
index 9e4a5578c2fb9dc6a392aa07b5fb085dde900651..00dcb08019e96e2b41e127edd2a62ef1c52f8c9b 100644 (file)
@@ -21,8 +21,7 @@
 #include <linux/list.h>
 #include <linux/clk.h>
 #include <linux/io.h>
-
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 
 #include <mach/clock.h>
 #include <mach/hardware.h>
index 109e98f323e0568a299d46f1481ee3a31116476e..1cd8b40b7676c1f7d0feb5ddae10a4fb9a264df6 100644 (file)
@@ -23,8 +23,8 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/io.h>
+#include <linux/clkdev.h>
 
-#include <asm/clkdev.h>
 #include <asm/div64.h>
 
 #include <mach/clock.h>
index 61e4a318980a2bc9fe4fa25c7de02a08a7b89bb8..819dd809615a430c59a161eef21edc186ed14b7b 100644 (file)
@@ -21,8 +21,7 @@
 #include <linux/list.h>
 #include <linux/clk.h>
 #include <linux/io.h>
-
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 
 #include <mach/clock.h>
 #include <mach/hardware.h>
index 8ac36d88292764634b7897f5e55a6bfb3615b293..5975edb47de82ad76e9518bb77a15410faf1fd89 100644 (file)
@@ -14,8 +14,8 @@
 #include <linux/delay.h>
 #include <linux/clk.h>
 #include <linux/io.h>
+#include <linux/clkdev.h>
 
-#include <asm/clkdev.h>
 #include <asm/div64.h>
 
 #include <mach/hardware.h>
index 5c85075d8a56b9b6c40059785dd9a4cd69658632..9fab505f1eb1a2c73b14ea489553442956782af0 100644 (file)
@@ -2,12 +2,12 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/io.h>
+#include <linux/clkdev.h>
 
 #include <mach/clock.h>
 #include <mach/hardware.h>
 #include <mach/common.h>
 
-#include <asm/clkdev.h>
 #include <asm/bug.h>
 #include <asm/div64.h>
 
index 89f793adf77643093c9e465c35447553102ae295..48a59f24e10c16bd6aed13b846f86973e2a9324a 100644 (file)
@@ -7,7 +7,7 @@
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/clk.h>
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 #include "clock.h"
 
 /*
index 18e51be4816f7bece014b71f8ac16f380ab416f1..4de1f1da9dc52d43c2898cbfa1d1d5a38efc382f 100644 (file)
@@ -10,7 +10,7 @@
  * the Free Software Foundation; either version 2 of the License.
  */
 
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 
 void nuc93x_clk_enable(struct clk *clk, int enable);
 void clks_register(struct clk_lookup *clks, size_t num);
index b8c7fb9d792108adbccb8b342083c7551830924f..84ef70476b511e1005b75f7e80b633ef3a66c7fd 100644 (file)
@@ -17,9 +17,9 @@
 #include <linux/err.h>
 #include <linux/clk.h>
 #include <linux/io.h>
+#include <linux/clkdev.h>
 
 #include <asm/mach-types.h>
-#include <asm/clkdev.h>
 
 #include <plat/cpu.h>
 #include <plat/usb.h>
index ed8d330522f18043a0b8ce6be06023a92988e988..ebb888f59365c29ffe8567bbaa6321de9358d9b4 100644 (file)
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/bitops.h>
+#include <linux/clkdev.h>
 
 #include <plat/cpu.h>
 #include <plat/clock.h>
-#include <asm/clkdev.h>
 
 #include "clock.h"
 #include "prm.h"
index 9d1975fa4d9f2c2e71e3782c7716bd66c5c67dff..a4a3819c96cbf2777da665a5ccef10323f7caab5 100644 (file)
@@ -21,8 +21,7 @@
 #include <linux/err.h>
 #include <linux/delay.h>
 #include <linux/io.h>
-
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 
 #include <mach/hardware.h>
 #include <mach/clock.h>
index dd235ecc9d6c5946d6610bb7adef42cb57476210..716a2e159c2c35cc6e4a4ece6533d61792bf36a7 100644 (file)
@@ -94,6 +94,7 @@ config MACH_ARMCORE
        select PXA27x
        select IWMMXT
        select PXA25x
+       select MIGHT_HAVE_PCI
 
 config MACH_EM_X270
        bool "CompuLab EM-x270 platform"
index abba0089a2ae0d6af3ca35a9bf961d9a5a65406e..4e4a84be96baccc41fab586fd02042a0dd730ce0 100644 (file)
@@ -11,8 +11,8 @@
 #include <linux/spinlock.h>
 #include <linux/platform_device.h>
 #include <linux/delay.h>
+#include <linux/clkdev.h>
 
-#include <asm/clkdev.h>
 #include <mach/pxa2xx-regs.h>
 #include <mach/hardware.h>
 
index d8488742b8075179fd4d66026d79730e00505a21..12cc0e87e6c43e880b1876901c00bc7491e76679 100644 (file)
@@ -1,4 +1,4 @@
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 
 struct clkops {
        void                    (*enable)(struct clk *);
index 07c08151dfe6434be39b510e215acd79e86ea297..3d915b1ccdb51d5c24cacd437d586918c2be5bea 100644 (file)
@@ -30,8 +30,8 @@
 #include <linux/ata_platform.h>
 #include <linux/amba/mmci.h>
 #include <linux/gfp.h>
+#include <linux/clkdev.h>
 
-#include <asm/clkdev.h>
 #include <asm/system.h>
 #include <mach/hardware.h>
 #include <asm/irq.h>
@@ -47,7 +47,6 @@
 
 #include <asm/hardware/gic.h>
 
-#include <mach/clkdev.h>
 #include <mach/platform.h>
 #include <mach/irqs.h>
 #include <plat/timer-sp.h>
index cef6a65637bd946c31e12691ba51d2d05f554f6a..e824a85c89a835cf64a465917c13cb2df8276072 100644 (file)
@@ -52,7 +52,7 @@ config MACH_JIVE
          Say Y here if you are using the Logitech Jive.
 
 config MACH_JIVE_SHOW_BOOTLOADER
-       bool "Allow access to bootloader partitions in MTD"
+       bool "Allow access to bootloader partitions in MTD (EXPERIMENTAL)"
        depends on MACH_JIVE && EXPERIMENTAL
 
 config MACH_SMDK2413
index 51dcd59eda6a1aeb965d02b5b94bf66e8737e2ff..6329333572427ec97d1c168aeca2e76c896f965c 100644 (file)
@@ -6,7 +6,7 @@ config ARCH_SH7367
        bool "SH-Mobile G3 (SH7367)"
        select CPU_V6
        select HAVE_CLK
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select SH_CLK_CPG
        select GENERIC_CLOCKEVENTS
 
@@ -14,7 +14,7 @@ config ARCH_SH7377
        bool "SH-Mobile G4 (SH7377)"
        select CPU_V7
        select HAVE_CLK
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select SH_CLK_CPG
        select GENERIC_CLOCKEVENTS
 
@@ -22,7 +22,7 @@ config ARCH_SH7372
        bool "SH-Mobile AP4 (SH7372)"
        select CPU_V7
        select HAVE_CLK
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        select SH_CLK_CPG
        select GENERIC_CLOCKEVENTS
 
index 9f78729098f2721bdd3b46c866ea6fed1a7e08e0..6b186aefcbd63792e22167e47fda0d02a9d9fcef 100644 (file)
@@ -20,8 +20,8 @@
 #include <linux/kernel.h>
 #include <linux/io.h>
 #include <linux/sh_clk.h>
+#include <linux/clkdev.h>
 #include <mach/common.h>
-#include <asm/clkdev.h>
 
 /* SH7367 registers */
 #define RTFRQCR    0xe6150000
index 3aa026069435a7b99ae1cbff5ccac101af016731..d98deb497c2fac81991411b9ff949c4dfb0afb15 100644 (file)
@@ -20,8 +20,8 @@
 #include <linux/kernel.h>
 #include <linux/io.h>
 #include <linux/sh_clk.h>
+#include <linux/clkdev.h>
 #include <mach/common.h>
-#include <asm/clkdev.h>
 
 /* SH7372 registers */
 #define FRQCRA         0xe6150000
index f91395aeb9abadd50b13c037670d23260e841920..95942466e63f212fb89c8d7392c15b7507afcb34 100644 (file)
@@ -20,8 +20,8 @@
 #include <linux/kernel.h>
 #include <linux/io.h>
 #include <linux/sh_clk.h>
+#include <linux/clkdev.h>
 #include <mach/common.h>
-#include <asm/clkdev.h>
 
 /* SH7377 registers */
 #define RTFRQCR    0xe6150000
index ba32a15127ab7afdd7fe53354dafd902c2939fca..3970a9cdce26e3d3afc39c1d7630639238744769 100644 (file)
@@ -12,8 +12,7 @@
 #include <linux/io.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
-
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 
 #include <mach/clock.h>
 #include <mach/irqs.h>
index ae19f95585be119c51456a9d2d75183fc3b1ff4c..77948e0f49098e5decc0858257e26a0e30537d59 100644 (file)
@@ -25,7 +25,7 @@
 #include <linux/slab.h>
 #include <linux/seq_file.h>
 #include <linux/regulator/consumer.h>
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 
 #include "clock.h"
 #include "board.h"
index 94fd859770f1a992a0bd001e265a781c3bf7448b..083a4cfc6cf0d0ef635a74950a5557415e31e9b1 100644 (file)
@@ -21,7 +21,7 @@
 #define __MACH_TEGRA_CLOCK_H
 
 #include <linux/list.h>
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 
 #define DIV_BUS                        (1 << 0)
 #define DIV_U71                        (1 << 1)
index ae3b308e22a4d158b464d8b47f383a7509cf6efd..f0dae6d8ba520a5046848dc7710caa92624a4f0d 100644 (file)
@@ -24,8 +24,7 @@
 #include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/hrtimer.h>
-
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 
 #include <mach/iomap.h>
 
index 7458fc6df5c67b466184bc6a4a317745304101ee..fabcc49abe80c7e63bbec3cedc275d60ad6c4728 100644 (file)
@@ -25,8 +25,8 @@
 #include <linux/timer.h>
 #include <linux/io.h>
 #include <linux/seq_file.h>
+#include <linux/clkdev.h>
 
-#include <asm/clkdev.h>
 #include <mach/hardware.h>
 #include <mach/syscon.h>
 
index 1675047daf20f74f5f00a1a7e88feab2e5c4f281..531de5c63641566a32a4640bd07e87276049f0fc 100644 (file)
@@ -13,8 +13,7 @@
 #include <linux/err.h>
 #include <linux/clk.h>
 #include <linux/io.h>
-
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 
 #include <plat/mtu.h>
 #include <mach/hardware.h>
index c781f30c8368a0d9dc4f33f271f91121f08c29fc..3f7b5e9d83c51633556dca30b9fada357c49e0ba 100644 (file)
@@ -4,6 +4,7 @@ menu "Versatile platform type"
 config ARCH_VERSATILE_PB
        bool "Support Versatile/PB platform"
        select CPU_ARM926T
+       select MIGHT_HAVE_PCI
        default y
        help
          Include support for the ARM(R) Versatile/PB platform.
index e38acb0f89c884b961bdb1dc11fa59b1a0112bc0..8c1ca1d63538f9b0dbfda7152972bb41b05014a0 100644 (file)
@@ -31,8 +31,8 @@
 #include <linux/amba/pl022.h>
 #include <linux/io.h>
 #include <linux/gfp.h>
+#include <linux/clkdev.h>
 
-#include <asm/clkdev.h>
 #include <asm/system.h>
 #include <asm/irq.h>
 #include <asm/leds.h>
@@ -46,7 +46,6 @@
 #include <asm/mach/irq.h>
 #include <asm/mach/time.h>
 #include <asm/mach/map.h>
-#include <mach/clkdev.h>
 #include <mach/hardware.h>
 #include <mach/platform.h>
 #include <plat/timer-sp.h>
index fd25ccd7272f7045b24a193f4c025a84c3bca97b..f4455e3ed6a45e9e450bc3f2819c7ff158b0cdc9 100644 (file)
@@ -8,8 +8,8 @@
 #include <linux/platform_device.h>
 #include <linux/amba/bus.h>
 #include <linux/amba/clcd.h>
+#include <linux/clkdev.h>
 
-#include <asm/clkdev.h>
 #include <asm/pgtable.h>
 #include <asm/hardware/arm_timer.h>
 #include <asm/hardware/cache-l2x0.h>
@@ -18,7 +18,6 @@
 #include <asm/pmu.h>
 #include <asm/smp_twd.h>
 
-#include <mach/clkdev.h>
 #include <mach/ct-ca9x4.h>
 
 #include <plat/timer-sp.h>
index 7eaa232180a5ae627c3639ba642755444a5d3e27..d374a78986e8b438e7f9cea51aebb2de499ee46c 100644 (file)
 #include <linux/spinlock.h>
 #include <linux/sysdev.h>
 #include <linux/usb/isp1760.h>
+#include <linux/clkdev.h>
 
-#include <asm/clkdev.h>
 #include <asm/sizes.h>
 #include <asm/mach/flash.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
 #include <asm/hardware/arm_timer.h>
 
-#include <mach/clkdev.h>
 #include <mach/motherboard.h>
 
 #include <plat/timer-sp.h>
index c56ddab3d9128acce33ba0d293a3dcfa29bcd08c..b88a1b16b2e965b29c88417b0c153e662a382e5f 100644 (file)
@@ -10,7 +10,7 @@
  * the Free Software Foundation; either version 2 of the License.
  */
 
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 
 void nuc900_clk_enable(struct clk *clk, int enable);
 void nuc900_subclk_enable(struct clk *clk, int enable);
index 4414a01e1e8a392befa91d6da826f8ab1698223c..8493ed04797a663a24e9aa820127fb23e7053f57 100644 (file)
@@ -599,6 +599,14 @@ config CPU_CP15_MPU
        help
          Processor has the CP15 register, which has MPU related registers.
 
+config CPU_USE_DOMAINS
+       bool
+       depends on MMU
+       default y if !CPU_32v6K
+       help
+         This option enables or disables the use of domain switching
+         via the set_fs() function.
+
 #
 # CPU supports 36-bit I/O
 #
@@ -628,6 +636,33 @@ config ARM_THUMBEE
          Say Y here if you have a CPU with the ThumbEE extension and code to
          make use of it. Say N for code that can run on CPUs without ThumbEE.
 
+config SWP_EMULATE
+       bool "Emulate SWP/SWPB instructions"
+       depends on CPU_V7
+       select HAVE_PROC_CPU if PROC_FS
+       default y if SMP
+       help
+         ARMv6 architecture deprecates use of the SWP/SWPB instructions.
+         ARMv7 multiprocessing extensions introduce the ability to disable
+         these instructions, triggering an undefined instruction exception
+         when executed. Say Y here to enable software emulation of these
+         instructions for userspace (not kernel) using LDREX/STREX.
+         Also creates /proc/cpu/swp_emulation for statistics.
+
+         In some older versions of glibc [<=2.8] SWP is used during futex
+         trylock() operations with the assumption that the code will not
+         be preempted. This invalid assumption may be more likely to fail
+         with SWP emulation enabled, leading to deadlock of the user
+         application.
+
+         NOTE: when accessing uncached shared regions, LDREX/STREX rely
+         on an external transaction monitoring block called a global
+         monitor to maintain update atomicity. If your system does not
+         implement a global monitor, this option can cause programs that
+         perform SWP operations to uncached memory to deadlock.
+
+         If unsure, say Y.
+
 config CPU_BIG_ENDIAN
        bool "Build big-endian kernel"
        depends on ARCH_SUPPORTS_BIG_ENDIAN
index ac6a36142fcd5a28084b3c669fac9e800fd65497..e24fe6d9c712abb8f30a0b5a77d5f6b1cdc0a28a 100644 (file)
@@ -311,7 +311,7 @@ __dma_alloc(struct device *dev, size_t size, dma_addr_t *handle, gfp_t gfp,
                addr = page_address(page);
 
        if (addr)
-               *handle = page_to_dma(dev, page);
+               *handle = pfn_to_dma(dev, page_to_pfn(page));
 
        return addr;
 }
@@ -406,7 +406,7 @@ void dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, dma_addr
        if (!arch_is_coherent())
                __dma_free_remap(cpu_addr, size);
 
-       __dma_free_buffer(dma_to_page(dev, handle), size);
+       __dma_free_buffer(pfn_to_page(dma_to_pfn(dev, handle)), size);
 }
 EXPORT_SYMBOL(dma_free_coherent);
 
@@ -554,17 +554,20 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents,
        struct scatterlist *s;
        int i, j;
 
+       BUG_ON(!valid_dma_direction(dir));
+
        for_each_sg(sg, s, nents, i) {
-               s->dma_address = dma_map_page(dev, sg_page(s), s->offset,
+               s->dma_address = __dma_map_page(dev, sg_page(s), s->offset,
                                                s->length, dir);
                if (dma_mapping_error(dev, s->dma_address))
                        goto bad_mapping;
        }
+       debug_dma_map_sg(dev, sg, nents, nents, dir);
        return nents;
 
  bad_mapping:
        for_each_sg(sg, s, i, j)
-               dma_unmap_page(dev, sg_dma_address(s), sg_dma_len(s), dir);
+               __dma_unmap_page(dev, sg_dma_address(s), sg_dma_len(s), dir);
        return 0;
 }
 EXPORT_SYMBOL(dma_map_sg);
@@ -585,8 +588,10 @@ void dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents,
        struct scatterlist *s;
        int i;
 
+       debug_dma_unmap_sg(dev, sg, nents, dir);
+
        for_each_sg(sg, s, nents, i)
-               dma_unmap_page(dev, sg_dma_address(s), sg_dma_len(s), dir);
+               __dma_unmap_page(dev, sg_dma_address(s), sg_dma_len(s), dir);
 }
 EXPORT_SYMBOL(dma_unmap_sg);
 
@@ -611,6 +616,8 @@ void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
                __dma_page_dev_to_cpu(sg_page(s), s->offset,
                                      s->length, dir);
        }
+
+       debug_dma_sync_sg_for_cpu(dev, sg, nents, dir);
 }
 EXPORT_SYMBOL(dma_sync_sg_for_cpu);
 
@@ -635,5 +642,16 @@ void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
                __dma_page_cpu_to_dev(sg_page(s), s->offset,
                                      s->length, dir);
        }
+
+       debug_dma_sync_sg_for_device(dev, sg, nents, dir);
 }
 EXPORT_SYMBOL(dma_sync_sg_for_device);
+
+#define PREALLOC_DMA_DEBUG_ENTRIES     4096
+
+static int __init dma_debug_do_init(void)
+{
+       dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES);
+       return 0;
+}
+fs_initcall(dma_debug_do_init);
index 55c17a6fb22fba2450ebce975a467f6c33ddf0ea..ab506272b2d3ef459b264b7741d61af46f6aa6b8 100644 (file)
@@ -204,12 +204,8 @@ void __iomem * __arm_ioremap_pfn_caller(unsigned long pfn,
        /*
         * Don't allow RAM to be mapped - this causes problems with ARMv6+
         */
-       if (pfn_valid(pfn)) {
-               printk(KERN_WARNING "BUG: Your driver calls ioremap() on system memory.  This leads\n"
-                      "to architecturally unpredictable behaviour on ARMv6+, and ioremap()\n"
-                      "will fail in the next kernel release.  Please fix your driver.\n");
-               WARN_ON(1);
-       }
+       if (WARN_ON(pfn_valid(pfn)))
+               return NULL;
 
        type = get_mem_type(mtype);
        if (!type)
index 72ad3e1f56cfb704e800a2e109f5eea7f66017a4..79c01f540cbe31dccda7d795026ae4c6ec349763 100644 (file)
@@ -24,6 +24,7 @@
 #include <asm/smp_plat.h>
 #include <asm/tlb.h>
 #include <asm/highmem.h>
+#include <asm/traps.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -914,12 +915,11 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
 {
        struct map_desc map;
        unsigned long addr;
-       void *vectors;
 
        /*
         * Allocate the vector page early.
         */
-       vectors = early_alloc(PAGE_SIZE);
+       vectors_page = early_alloc(PAGE_SIZE);
 
        for (addr = VMALLOC_END; addr; addr += PGDIR_SIZE)
                pmd_clear(pmd_off_k(addr));
@@ -959,7 +959,7 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
         * location (0xffff0000).  If we aren't using high-vectors, also
         * create a mapping at the low-vectors virtual address.
         */
-       map.pfn = __phys_to_pfn(virt_to_phys(vectors));
+       map.pfn = __phys_to_pfn(virt_to_phys(vectors_page));
        map.virtual = 0xffff0000;
        map.length = PAGE_SIZE;
        map.type = MT_HIGH_VECTORS;
index 7d63beaf97456541c0718c84b475b844194156e6..337f10256cd686d77b1547fe2835617cd57c0207 100644 (file)
  *  110x   0   1   0   r/w     r/o
  *  11x0   0   1   0   r/w     r/o
  *  1111   0   1   1   r/w     r/w
+ *
+ * If !CONFIG_CPU_USE_DOMAINS, the following permissions are changed:
+ *  110x   1   1   1   r/o     r/o
+ *  11x0   1   1   1   r/o     r/o
  */
        .macro  armv6_mt_table pfx
 \pfx\()_mt_table:
 
        tst     r1, #L_PTE_USER
        orrne   r3, r3, #PTE_EXT_AP1
+#ifdef CONFIG_CPU_USE_DOMAINS
+       @ allow kernel read/write access to read-only user pages
        tstne   r3, #PTE_EXT_APX
        bicne   r3, r3, #PTE_EXT_APX | PTE_EXT_AP0
+#endif
 
        tst     r1, #L_PTE_EXEC
        orreq   r3, r3, #PTE_EXT_XN
index 53cbe2225153de55cf6848394d63d1fb1ea00a18..2b5b20baf80d2def839dce5c75bd328393972ccc 100644 (file)
@@ -148,8 +148,11 @@ ENTRY(cpu_v7_set_pte_ext)
 
        tst     r1, #L_PTE_USER
        orrne   r3, r3, #PTE_EXT_AP1
+#ifdef CONFIG_CPU_USE_DOMAINS
+       @ allow kernel read/write access to read-only user pages
        tstne   r3, #PTE_EXT_APX
        bicne   r3, r3, #PTE_EXT_APX | PTE_EXT_AP0
+#endif
 
        tst     r1, #L_PTE_EXEC
        orreq   r3, r3, #PTE_EXT_XN
@@ -273,8 +276,6 @@ __v7_setup:
        ALT_SMP(orr     r4, r4, #TTB_FLAGS_SMP)
        ALT_UP(orr      r4, r4, #TTB_FLAGS_UP)
        mcr     p15, 0, r4, c2, c0, 1           @ load TTB1
-       mov     r10, #0x1f                      @ domains 0, 1 = manager
-       mcr     p15, 0, r10, c3, c0, 0          @ load domain access register
        /*
         * Memory region attributes with SCTLR.TRE=1
         *
@@ -312,6 +313,10 @@ __v7_setup:
        ldmia   r5, {r5, r6}
 #ifdef CONFIG_CPU_ENDIAN_BE8
        orr     r6, r6, #1 << 25                @ big-endian page tables
+#endif
+#ifdef CONFIG_SWP_EMULATE
+       orr     r5, r5, #(1 << 10)              @ set SW bit in "clear"
+       bic     r6, r6, #(1 << 10)              @ clear it in "mmuset"
 #endif
        mrc     p15, 0, r0, c1, c0, 0           @ read control register
        bic     r0, r0, r5                      @ clear bits them
index 92c5bb7909f5632c6d0132813292e655a1d16161..c9408434a855ecaf648c63cbc83efb4699f3a5f2 100644 (file)
@@ -11,13 +11,13 @@ choice
 
 config ARCH_OMAP1
        bool "TI OMAP1"
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        help
          "Systems based on omap7xx, omap15xx or omap16xx"
 
 config ARCH_OMAP2PLUS
        bool "TI OMAP2/3/4"
-       select COMMON_CLKDEV
+       select CLKDEV_LOOKUP
        help
          "Systems based on OMAP2, OMAP3 or OMAP4"
 
index bb937f3fabed3b9f88b9cb98df6109748d3d312b..4b2028ab4d2b5ca0047297ac7532be2add5a4002 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_CLKDEV_OMAP_H
 #define __ARCH_ARM_PLAT_OMAP_INCLUDE_PLAT_CLKDEV_OMAP_H
 
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 
 struct omap_clk {
        u16                             cpu;
index d5306bee44b2fe74cad97f3e459fc579a0b4d6fa..f8d922fb5584e1763b1ddecd8644523533295d2d 100644 (file)
 #define lbus_to_virt(x)                ((x) - OMAP1510_LB_OFFSET + PAGE_OFFSET)
 #define is_lbus_device(dev)    (cpu_is_omap15xx() && dev && (strncmp(dev_name(dev), "ohci", 4) == 0))
 
-#define __arch_page_to_dma(dev, page)  \
-       ({ dma_addr_t __dma = page_to_phys(page); \
+#define __arch_pfn_to_dma(dev, pfn)    \
+       ({ dma_addr_t __dma = __pfn_to_phys(pfn); \
           if (is_lbus_device(dev)) \
                __dma = __dma - PHYS_OFFSET + OMAP1510_LB_OFFSET; \
           __dma; })
 
-#define __arch_dma_to_page(dev, addr)  \
+#define __arch_dma_to_pfn(dev, addr)   \
        ({ dma_addr_t __dma = addr;                             \
           if (is_lbus_device(dev))                             \
                __dma += PHYS_OFFSET - OMAP1510_LB_OFFSET;      \
-          phys_to_page(__dma);                                 \
+          __phys_to_pfn(__dma);                                \
        })
 
 #define __arch_dma_to_virt(dev, addr)  ({ (void *) (is_lbus_device(dev) ? \
index 298bafc0a52f71d4edfa91fca8c146204329216e..2572260f990f1494f98fff245d338a8dae15ad0b 100644 (file)
@@ -15,7 +15,7 @@
 #define __PLAT_CLOCK_H
 
 #include <linux/list.h>
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 #include <linux/types.h>
 
 /* clk structure flags */
index e593a2a801c63370efea993d529adf8b8960e0f4..2e712e17ce7257757c4592587ce63b296e39f995 100644 (file)
@@ -25,9 +25,9 @@
 #include <linux/err.h>
 #include <linux/delay.h>
 #include <linux/io.h>
+#include <linux/clkdev.h>
 
 #include <asm/mach-types.h>
-#include <asm/clkdev.h>
 #include <mach/platform.h>
 #include <mach/regs-clkctrl.h>
 
index 7f217b3a50a806b7347f991b588397011aa3388e..b31b097e9bc654697e8e7911f2400bf1da110a93 100644 (file)
@@ -1,7 +1,7 @@
 config SUPERH
        def_bool y
        select EMBEDDED
-       select HAVE_CLK
+       select CLKDEV_LOOKUP
        select HAVE_IDE if HAS_IOPORT
        select HAVE_MEMBLOCK
        select HAVE_OPROFILE
index a5ecfbacaf36b37c3f812c5ca9b2189a3c077447..87618c91d1781881140d7e55fbf7e2a718d1c142 100644 (file)
 #include <linux/interrupt.h>
 #include <linux/usb/r8a66597.h>
 #include <linux/usb/m66592.h>
+#include <linux/clkdev.h>
 #include <net/ax88796.h>
 #include <asm/machvec.h>
 #include <mach/highlander.h>
-#include <asm/clkdev.h>
 #include <asm/clock.h>
 #include <asm/heartbeat.h>
 #include <asm/io.h>
index 5645f358128b62586ccfdcaf42022deb2db5c3ce..6ba91868201ce947f625a5c982c0b4ec3a290653 100644 (file)
@@ -1,9 +1,5 @@
 /*
- *  arch/sh/include/asm/clkdev.h
- *
- * Cloned from arch/arm/include/asm/clkdev.h:
- *
- *  Copyright (C) 2008 Russell King.
+ *  Copyright (C) 2010 Paul Mundt <lethal@linux-sh.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  *
  * Helper for the clk API to assist looking up a struct clk.
  */
-#ifndef __ASM_CLKDEV_H
-#define __ASM_CLKDEV_H
 
-struct clk;
+#ifndef __CLKDEV__H_
+#define __CLKDEV__H_
 
-struct clk_lookup {
-       struct list_head        node;
-       const char              *dev_id;
-       const char              *con_id;
-       struct clk              *clk;
-};
+#include <linux/bootmem.h>
+#include <linux/mm.h>
+#include <linux/slab.h>
 
-struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id,
-       const char *dev_fmt, ...);
+#include <asm/clock.h>
 
-void clkdev_add(struct clk_lookup *cl);
-void clkdev_drop(struct clk_lookup *cl);
+static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
+{
+       if (!slab_is_available())
+               return alloc_bootmem_low_pages(size);
+       else
+               return kzalloc(size, GFP_KERNEL);
+}
 
-void clkdev_add_table(struct clk_lookup *, size_t);
-int clk_add_alias(const char *, const char *, char *, struct device *);
+#define __clk_put(clk)
+#define __clk_get(clk) ({ 1; })
 
-#endif
+#endif /* __CLKDEV_H__ */
index 8eed6a4854463418c26dfd7410874481706e5adf..cf652217952382622273c6c0663b958cb9d42824 100644 (file)
@@ -11,7 +11,7 @@ endif
 
 CFLAGS_REMOVE_return_address.o = -pg
 
-obj-y  := clkdev.o debugtraps.o dma-nommu.o dumpstack.o                \
+obj-y  := debugtraps.o dma-nommu.o dumpstack.o                 \
           idle.o io.o irq.o irq_$(BITS).o kdebugfs.o                   \
           machvec.o nmi_debug.o process.o                              \
           process_$(BITS).o ptrace.o ptrace_$(BITS).o                  \
diff --git a/arch/sh/kernel/clkdev.c b/arch/sh/kernel/clkdev.c
deleted file mode 100644 (file)
index 1f800ef..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * arch/sh/kernel/clkdev.c
- *
- * Cloned from arch/arm/common/clkdev.c:
- *
- *  Copyright (C) 2008 Russell King.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Helper for the clk API to assist looking up a struct clk.
- */
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/device.h>
-#include <linux/list.h>
-#include <linux/errno.h>
-#include <linux/err.h>
-#include <linux/string.h>
-#include <linux/mutex.h>
-#include <linux/clk.h>
-#include <linux/slab.h>
-#include <linux/bootmem.h>
-#include <linux/mm.h>
-#include <asm/clock.h>
-#include <asm/clkdev.h>
-
-static LIST_HEAD(clocks);
-static DEFINE_MUTEX(clocks_mutex);
-
-/*
- * Find the correct struct clk for the device and connection ID.
- * We do slightly fuzzy matching here:
- *  An entry with a NULL ID is assumed to be a wildcard.
- *  If an entry has a device ID, it must match
- *  If an entry has a connection ID, it must match
- * Then we take the most specific entry - with the following
- * order of precedence: dev+con > dev only > con only.
- */
-static struct clk *clk_find(const char *dev_id, const char *con_id)
-{
-       struct clk_lookup *p;
-       struct clk *clk = NULL;
-       int match, best = 0;
-
-       list_for_each_entry(p, &clocks, node) {
-               match = 0;
-               if (p->dev_id) {
-                       if (!dev_id || strcmp(p->dev_id, dev_id))
-                               continue;
-                       match += 2;
-               }
-               if (p->con_id) {
-                       if (!con_id || strcmp(p->con_id, con_id))
-                               continue;
-                       match += 1;
-               }
-               if (match == 0)
-                       continue;
-
-               if (match > best) {
-                       clk = p->clk;
-                       best = match;
-               }
-       }
-       return clk;
-}
-
-struct clk *clk_get_sys(const char *dev_id, const char *con_id)
-{
-       struct clk *clk;
-
-       mutex_lock(&clocks_mutex);
-       clk = clk_find(dev_id, con_id);
-       mutex_unlock(&clocks_mutex);
-
-       return clk ? clk : ERR_PTR(-ENOENT);
-}
-EXPORT_SYMBOL(clk_get_sys);
-
-void clkdev_add(struct clk_lookup *cl)
-{
-       mutex_lock(&clocks_mutex);
-       list_add_tail(&cl->node, &clocks);
-       mutex_unlock(&clocks_mutex);
-}
-EXPORT_SYMBOL(clkdev_add);
-
-void __init clkdev_add_table(struct clk_lookup *cl, size_t num)
-{
-       mutex_lock(&clocks_mutex);
-       while (num--) {
-               list_add_tail(&cl->node, &clocks);
-               cl++;
-       }
-       mutex_unlock(&clocks_mutex);
-}
-
-#define MAX_DEV_ID     20
-#define MAX_CON_ID     16
-
-struct clk_lookup_alloc {
-       struct clk_lookup cl;
-       char    dev_id[MAX_DEV_ID];
-       char    con_id[MAX_CON_ID];
-};
-
-struct clk_lookup * __init_refok
-clkdev_alloc(struct clk *clk, const char *con_id, const char *dev_fmt, ...)
-{
-       struct clk_lookup_alloc *cla;
-
-       if (!slab_is_available())
-               cla = alloc_bootmem_low_pages(sizeof(*cla));
-       else
-               cla = kzalloc(sizeof(*cla), GFP_KERNEL);
-
-       if (!cla)
-               return NULL;
-
-       cla->cl.clk = clk;
-       if (con_id) {
-               strlcpy(cla->con_id, con_id, sizeof(cla->con_id));
-               cla->cl.con_id = cla->con_id;
-       }
-
-       if (dev_fmt) {
-               va_list ap;
-
-               va_start(ap, dev_fmt);
-               vscnprintf(cla->dev_id, sizeof(cla->dev_id), dev_fmt, ap);
-               cla->cl.dev_id = cla->dev_id;
-               va_end(ap);
-       }
-
-       return &cla->cl;
-}
-EXPORT_SYMBOL(clkdev_alloc);
-
-int clk_add_alias(const char *alias, const char *alias_dev_name, char *id,
-       struct device *dev)
-{
-       struct clk *r = clk_get(dev, id);
-       struct clk_lookup *l;
-
-       if (IS_ERR(r))
-               return PTR_ERR(r);
-
-       l = clkdev_alloc(r, alias, alias_dev_name);
-       clk_put(r);
-       if (!l)
-               return -ENODEV;
-       clkdev_add(l);
-       return 0;
-}
-EXPORT_SYMBOL(clk_add_alias);
-
-/*
- * clkdev_drop - remove a clock dynamically allocated
- */
-void clkdev_drop(struct clk_lookup *cl)
-{
-       struct clk_lookup_alloc *cla = container_of(cl, struct clk_lookup_alloc, cl);
-
-       mutex_lock(&clocks_mutex);
-       list_del(&cl->node);
-       mutex_unlock(&clocks_mutex);
-       kfree(cla);
-}
-EXPORT_SYMBOL(clkdev_drop);
index e2f63d68da5153d2d754798719b0f3f7fde39c8d..dd0e0f2113598801270737de56eb3c8d4672a112 100644 (file)
@@ -2,7 +2,7 @@
 #include <linux/compiler.h>
 #include <linux/slab.h>
 #include <linux/io.h>
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 #include <asm/clock.h>
 
 static struct clk master_clk = {
index 50f887dda56550bde11bc85101000ca224a4e75a..4187cf4fe18583b74533536e9c491dee3246dcc9 100644 (file)
@@ -48,20 +48,4 @@ int __init clk_init(void)
        return ret;
 }
 
-/*
- * Returns a clock. Note that we first try to use device id on the bus
- * and clock name. If this fails, we try to use clock name only.
- */
-struct clk *clk_get(struct device *dev, const char *con_id)
-{
-       const char *dev_id = dev ? dev_name(dev) : NULL;
-
-       return clk_get_sys(dev_id, con_id);
-}
-EXPORT_SYMBOL_GPL(clk_get);
-
-void clk_put(struct clk *clk)
-{
-}
-EXPORT_SYMBOL_GPL(clk_put);
 
index b601fa3978d1995f53ea466e6aed5145e6ef1f75..fbb66571b7a7a3e6b6ac49efbcf4ccd06a5035f6 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/err.h>
 #include <linux/io.h>
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 #include <asm/clock.h>
 #include <asm/freq.h>
 
index 71291ae201b9f4ed0c5693bdbe3dfd529795ad29..93c646072c1b93005bb6b13dff60c5afeb882854 100644 (file)
@@ -21,7 +21,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/io.h>
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 #include <asm/clock.h>
 
 /* SH7343 registers */
index 7ce5bbcd4084d0fd8efc4032ace6a11241e27b13..049dc0628ccc196d48c75a0aa4f8a2469f0575f2 100644 (file)
@@ -21,7 +21,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/io.h>
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 #include <asm/clock.h>
 
 /* SH7366 registers */
index 2030f3d9fac7e59ddcb725295e4bf555bf272223..9d23a36f0647b97a6b5afc24ac4f7078262f57b1 100644 (file)
@@ -21,7 +21,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/io.h>
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 #include <asm/clock.h>
 #include <asm/hwblk.h>
 #include <cpu/sh7722.h>
index d3938f0d37029775743265fe46319d0d03b9c70f..55493cd5bd8f3b5ce3860431882c6341539d2efb 100644 (file)
@@ -22,7 +22,7 @@
 #include <linux/kernel.h>
 #include <linux/io.h>
 #include <linux/clk.h>
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 #include <asm/clock.h>
 #include <asm/hwblk.h>
 #include <cpu/sh7723.h>
index 0fe2e9329cb25f699acd433dd4f2d9b4b945f00b..3e34ac0fc0f94ea4ca4f69e425ed012319326a42 100644 (file)
@@ -22,7 +22,7 @@
 #include <linux/kernel.h>
 #include <linux/io.h>
 #include <linux/clk.h>
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 #include <asm/clock.h>
 #include <asm/hwblk.h>
 #include <cpu/sh7724.h>
index ce39a2ae8c6cd8a8140a9bd8a09a977b75a48a27..e073e3eb4c3de8e3933a919c27ec194ab4f29e25 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/io.h>
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 #include <asm/clock.h>
 #include <asm/freq.h>
 
index 1f1df48008cdfaf7bfe4d15e6a2ba375c3d7583f..599630fc4d3bd952ae04bd4fb11565f7a0546a30 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/io.h>
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 #include <asm/clock.h>
 #include <asm/freq.h>
 #include <asm/io.h>
index 62d706350060089add0e76aa4c1f3b5b3fd00dac..8894926479a614234302af0f7f51fbc3e9f56266 100644 (file)
@@ -12,7 +12,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/io.h>
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 #include <asm/clock.h>
 #include <asm/freq.h>
 #include <asm/io.h>
index c3e458aaa2b7ecc167da7bb0d31cd51911970768..2d960247f3ebff7e8e4b55865176ed3244b0aa56 100644 (file)
@@ -14,7 +14,7 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/cpufreq.h>
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 #include <asm/clock.h>
 #include <asm/freq.h>
 #include <cpu/sh7785.h>
index 597c9fbe49c6d88e45a248c424400422e949188f..42e403be9076da889384ec7544627bd144e47f1a 100644 (file)
@@ -13,7 +13,7 @@
 #include <linux/kernel.h>
 #include <linux/clk.h>
 #include <linux/io.h>
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 #include <asm/clock.h>
 #include <asm/freq.h>
 
index 4f70df6b6169cb5170261f60f28cdf4b66b4107a..1afdb93b8ccb28d9c3ce42517288934496a718cc 100644 (file)
@@ -14,7 +14,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/io.h>
-#include <asm/clkdev.h>
+#include <linux/clkdev.h>
 #include <asm/clock.h>
 #include <asm/freq.h>
 
index a2b902f4d43706334e87b30656b1addc399b1c77..3d93b3a3d630ca9e71f7775691a5071546f45746 100644 (file)
@@ -111,4 +111,6 @@ source "drivers/xen/Kconfig"
 source "drivers/staging/Kconfig"
 
 source "drivers/platform/Kconfig"
+
+source "drivers/clk/Kconfig"
 endmenu
index f3ebb30f1b7fd9c7ed93d6328dbe4d8c54b1fd87..bf15ce7493d274eee5b135ea194106da84db2864 100644 (file)
@@ -115,3 +115,5 @@ obj-$(CONFIG_VLYNQ)         += vlynq/
 obj-$(CONFIG_STAGING)          += staging/
 obj-y                          += platform/
 obj-y                          += ieee802154/
+#common clk code
+obj-y                          += clk/
index 2737b97522052e7a653eb9c7622132a07a6bcded..e7df019d29d44731b7eacf035b5edd5de78a3780 100644 (file)
@@ -147,6 +147,39 @@ static void amba_put_disable_pclk(struct amba_device *pcdev)
        clk_put(pclk);
 }
 
+static int amba_get_enable_vcore(struct amba_device *pcdev)
+{
+       struct regulator *vcore = regulator_get(&pcdev->dev, "vcore");
+       int ret;
+
+       pcdev->vcore = vcore;
+
+       if (IS_ERR(vcore)) {
+               /* It is OK not to supply a vcore regulator */
+               if (PTR_ERR(vcore) == -ENODEV)
+                       return 0;
+               return PTR_ERR(vcore);
+       }
+
+       ret = regulator_enable(vcore);
+       if (ret) {
+               regulator_put(vcore);
+               pcdev->vcore = ERR_PTR(-ENODEV);
+       }
+
+       return ret;
+}
+
+static void amba_put_disable_vcore(struct amba_device *pcdev)
+{
+       struct regulator *vcore = pcdev->vcore;
+
+       if (!IS_ERR(vcore)) {
+               regulator_disable(vcore);
+               regulator_put(vcore);
+       }
+}
+
 /*
  * These are the device model conversion veneers; they convert the
  * device model structures to our more specific structures.
@@ -159,6 +192,10 @@ static int amba_probe(struct device *dev)
        int ret;
 
        do {
+               ret = amba_get_enable_vcore(pcdev);
+               if (ret)
+                       break;
+
                ret = amba_get_enable_pclk(pcdev);
                if (ret)
                        break;
@@ -168,6 +205,7 @@ static int amba_probe(struct device *dev)
                        break;
 
                amba_put_disable_pclk(pcdev);
+               amba_put_disable_vcore(pcdev);
        } while (0);
 
        return ret;
@@ -180,6 +218,7 @@ static int amba_remove(struct device *dev)
        int ret = drv->remove(pcdev);
 
        amba_put_disable_pclk(pcdev);
+       amba_put_disable_vcore(pcdev);
 
        return ret;
 }
diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
new file mode 100644 (file)
index 0000000..4168c88
--- /dev/null
@@ -0,0 +1,4 @@
+
+config CLKDEV_LOOKUP
+       bool
+       select HAVE_CLK
diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile
new file mode 100644 (file)
index 0000000..07613fa
--- /dev/null
@@ -0,0 +1,2 @@
+
+obj-$(CONFIG_CLKDEV_LOOKUP)    += clkdev.o
similarity index 93%
rename from arch/arm/common/clkdev.c
rename to drivers/clk/clkdev.c
index e2b2bb66e09490e0761c8949cea58f466acb6384..0fc0a79852de0f919bd2ac9ac117533ed8a0f991 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  arch/arm/common/clkdev.c
+ * drivers/clk/clkdev.c
  *
  *  Copyright (C) 2008 Russell King.
  *
 #include <linux/string.h>
 #include <linux/mutex.h>
 #include <linux/clk.h>
-#include <linux/slab.h>
-
-#include <asm/clkdev.h>
-#include <mach/clkdev.h>
+#include <linux/clkdev.h>
 
 static LIST_HEAD(clocks);
 static DEFINE_MUTEX(clocks_mutex);
@@ -120,12 +117,12 @@ struct clk_lookup_alloc {
        char    con_id[MAX_CON_ID];
 };
 
-struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id,
-       const char *dev_fmt, ...)
+struct clk_lookup * __init_refok
+clkdev_alloc(struct clk *clk, const char *con_id, const char *dev_fmt, ...)
 {
        struct clk_lookup_alloc *cla;
 
-       cla = kzalloc(sizeof(*cla), GFP_KERNEL);
+       cla = __clkdev_alloc(sizeof(*cla));
        if (!cla)
                return NULL;
 
index c6454cca044787f65965369d92837f4649297a93..9e7f259346e1e25dc3fc44a9078604d892a81aa1 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/device.h>
 #include <linux/err.h>
 #include <linux/resource.h>
+#include <linux/regulator/consumer.h>
 
 #define AMBA_NR_IRQS   2
 #define AMBA_CID       0xb105f00d
@@ -28,6 +29,7 @@ struct amba_device {
        struct device           dev;
        struct resource         res;
        struct clk              *pclk;
+       struct regulator        *vcore;
        u64                     dma_mask;
        unsigned int            periphid;
        unsigned int            irq[AMBA_NR_IRQS];
@@ -71,6 +73,12 @@ void amba_release_regions(struct amba_device *);
 #define amba_pclk_disable(d)   \
        do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0)
 
+#define amba_vcore_enable(d)   \
+       (IS_ERR((d)->vcore) ? 0 : regulator_enable((d)->vcore))
+
+#define amba_vcore_disable(d)  \
+       do { if (!IS_ERR((d)->vcore)) regulator_disable((d)->vcore); } while (0)
+
 /* Some drivers don't use the struct amba_device */
 #define AMBA_CONFIG_BITS(a) (((a) >> 24) & 0xff)
 #define AMBA_REV_BITS(a) (((a) >> 20) & 0x0f)
diff --git a/include/linux/clkdev.h b/include/linux/clkdev.h
new file mode 100644 (file)
index 0000000..457bcb0
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ *  include/linux/clkdev.h
+ *
+ *  Copyright (C) 2008 Russell King.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Helper for the clk API to assist looking up a struct clk.
+ */
+#ifndef __CLKDEV_H
+#define __CLKDEV_H
+
+#include <asm/clkdev.h>
+
+struct clk;
+struct device;
+
+struct clk_lookup {
+       struct list_head        node;
+       const char              *dev_id;
+       const char              *con_id;
+       struct clk              *clk;
+};
+
+struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id,
+       const char *dev_fmt, ...);
+
+void clkdev_add(struct clk_lookup *cl);
+void clkdev_drop(struct clk_lookup *cl);
+
+void clkdev_add_table(struct clk_lookup *, size_t);
+int clk_add_alias(const char *, const char *, char *, struct device *);
+
+#endif