aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2012-05-09 22:51:07 -0400
committerPaul Mundt <lethal@linux-sh.org>2012-05-09 22:51:07 -0400
commit15f99cbd071aa402e113d342448603344a337046 (patch)
tree56f98892d1bd38029988eb8931e2321ef7e79aa0 /arch
parentb2212ea41dacda8cce0e7681a3a6ccc76c63802e (diff)
parent41797f75486d8ca3b98d7658c2a506ac7879a8e5 (diff)
Merge branch 'sh/rsk-updates' into sh-latest
Conflicts: arch/sh/Kconfig Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/Kconfig2
-rw-r--r--arch/alpha/include/asm/rtc.h8
-rw-r--r--arch/alpha/kernel/core_tsunami.c1
-rw-r--r--arch/alpha/kernel/sys_marvel.c2
-rw-r--r--arch/arm/Kconfig9
-rw-r--r--arch/arm/boot/dts/msm8660-surf.dts4
-rw-r--r--arch/arm/boot/dts/versatile-ab.dts2
-rw-r--r--arch/arm/boot/dts/versatile-pb.dts2
-rw-r--r--arch/arm/configs/imx_v4_v5_defconfig1
-rw-r--r--arch/arm/configs/mini2440_defconfig2
-rw-r--r--arch/arm/configs/u8500_defconfig9
-rw-r--r--arch/arm/include/asm/thread_info.h7
-rw-r--r--arch/arm/include/asm/tls.h4
-rw-r--r--arch/arm/kernel/irq.c6
-rw-r--r--arch/arm/kernel/ptrace.c24
-rw-r--r--arch/arm/kernel/signal.c55
-rw-r--r--arch/arm/kernel/smp.c32
-rw-r--r--arch/arm/kernel/smp_twd.c6
-rw-r--r--arch/arm/kernel/sys_arm.c2
-rw-r--r--arch/arm/mach-at91/at91rm9200_devices.c1
-rw-r--r--arch/arm/mach-at91/at91rm9200_time.c2
-rw-r--r--arch/arm/mach-at91/board-rm9200ek.c2
-rw-r--r--arch/arm/mach-at91/board-sam9261ek.c5
-rw-r--r--arch/arm/mach-at91/clock.c1
-rw-r--r--arch/arm/mach-at91/include/mach/at91_pmc.h2
-rw-r--r--arch/arm/mach-at91/setup.c2
-rw-r--r--arch/arm/mach-bcmring/core.c4
-rw-r--r--arch/arm/mach-exynos/clock-exynos4.c24
-rw-r--r--arch/arm/mach-exynos/clock-exynos5.c24
-rw-r--r--arch/arm/mach-exynos/common.c14
-rw-r--r--arch/arm/mach-exynos/dev-dwmci.c13
-rw-r--r--arch/arm/mach-exynos/mach-nuri.c1
-rw-r--r--arch/arm/mach-exynos/mach-universal_c210.c1
-rw-r--r--arch/arm/mach-imx/imx27-dt.c6
-rw-r--r--arch/arm/mach-imx/mm-imx5.c2
-rw-r--r--arch/arm/mach-kirkwood/board-dt.c1
-rw-r--r--arch/arm/mach-msm/board-msm8x60.c25
-rw-r--r--arch/arm/mach-omap1/ams-delta-fiq.c2
-rw-r--r--arch/arm/mach-omap1/mux.c1
-rw-r--r--arch/arm/mach-omap1/timer.c4
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c12
-rw-r--r--arch/arm/mach-omap2/board-generic.c2
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c2
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c13
-rw-r--r--arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h8
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c17
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2420_data.c1
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2430_data.c1
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c1
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_44xx_data.c9
-rw-r--r--arch/arm/mach-omap2/serial.c124
-rw-r--r--arch/arm/mach-omap2/twl-common.c37
-rw-r--r--arch/arm/mach-omap2/twl-common.h10
-rw-r--r--arch/arm/mach-orion5x/mpp.h4
-rw-r--r--arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h7
-rw-r--r--arch/arm/mach-pxa/mfp-pxa2xx.c21
-rw-r--r--arch/arm/mach-pxa/pxa27x.c6
-rw-r--r--arch/arm/mach-s3c24xx/Kconfig8
-rw-r--r--arch/arm/mach-s5pv210/mach-goni.c2
-rw-r--r--arch/arm/mach-sa1100/generic.c2
-rw-r--r--arch/arm/mach-u300/core.c6
-rw-r--r--arch/arm/mach-u300/i2c.c9
-rw-r--r--arch/arm/mach-u300/include/mach/irqs.h150
-rw-r--r--arch/arm/mach-ux500/Kconfig1
-rw-r--r--arch/arm/mach-ux500/mbox-db5500.c2
-rw-r--r--arch/arm/mach-ux500/platsmp.c2
-rw-r--r--arch/arm/mm/abort-ev6.S17
-rw-r--r--arch/arm/mm/cache-l2x0.c25
-rw-r--r--arch/arm/mm/init.c4
-rw-r--r--arch/arm/mm/mmu.c4
-rw-r--r--arch/arm/plat-omap/dma.c14
-rw-r--r--arch/arm/plat-omap/include/plat/omap_hwmod.h4
-rw-r--r--arch/arm/plat-omap/sram.c12
-rw-r--r--arch/arm/plat-samsung/include/plat/sdhci.h28
-rw-r--r--arch/arm/vfp/vfpmodule.c99
-rw-r--r--arch/blackfin/mach-bf538/boards/ezkit.c53
-rw-r--r--arch/hexagon/kernel/dma.c1
-rw-r--r--arch/hexagon/kernel/process.c6
-rw-r--r--arch/hexagon/kernel/ptrace.c1
-rw-r--r--arch/hexagon/kernel/smp.c8
-rw-r--r--arch/hexagon/kernel/time.c1
-rw-r--r--arch/hexagon/kernel/vdso.c1
-rw-r--r--arch/ia64/kernel/perfmon.c18
-rw-r--r--arch/ia64/kvm/kvm-ia64.c2
-rw-r--r--arch/m68k/configs/m5275evb_defconfig1
-rw-r--r--arch/m68k/platform/527x/config.c2
-rw-r--r--arch/m68k/platform/68EZ328/Makefile6
-rw-r--r--arch/m68k/platform/68VZ328/Makefile9
-rw-r--r--arch/m68k/platform/68VZ328/bootlogo.h (renamed from arch/m68k/platform/68EZ328/bootlogo.h)2
-rw-r--r--arch/m68k/platform/coldfire/device.c2
-rw-r--r--arch/mips/ath79/dev-wmac.c2
-rw-r--r--arch/mips/include/asm/mach-jz4740/irq.h2
-rw-r--r--arch/mips/include/asm/mmu_context.h6
-rw-r--r--arch/mips/kernel/signal.c27
-rw-r--r--arch/mips/kernel/signal32.c20
-rw-r--r--arch/mips/kernel/signal_n32.c10
-rw-r--r--arch/parisc/kernel/pdc_cons.c2
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-mpic-message-B.dtsi43
-rw-r--r--arch/powerpc/boot/dts/fsl/pq3-mpic.dtsi10
-rw-r--r--arch/powerpc/include/asm/exception-64s.h7
-rw-r--r--arch/powerpc/include/asm/irq.h4
-rw-r--r--arch/powerpc/include/asm/mpic.h18
-rw-r--r--arch/powerpc/include/asm/mpic_msgr.h1
-rw-r--r--arch/powerpc/include/asm/reg_booke.h5
-rw-r--r--arch/powerpc/kernel/entry_64.S18
-rw-r--r--arch/powerpc/kernel/exceptions-64s.S2
-rw-r--r--arch/powerpc/kernel/irq.c14
-rw-r--r--arch/powerpc/kernel/machine_kexec.c7
-rw-r--r--arch/powerpc/kernel/setup_32.c3
-rw-r--r--arch/powerpc/kernel/traps.c10
-rw-r--r--arch/powerpc/kvm/book3s_64_mmu_hv.c22
-rw-r--r--arch/powerpc/kvm/book3s_hv.c2
-rw-r--r--arch/powerpc/net/bpf_jit.h8
-rw-r--r--arch/powerpc/net/bpf_jit_64.S108
-rw-r--r--arch/powerpc/net/bpf_jit_comp.c26
-rw-r--r--arch/powerpc/platforms/85xx/common.c6
-rw-r--r--arch/powerpc/platforms/85xx/mpc85xx_mds.c11
-rw-r--r--arch/powerpc/platforms/85xx/p1022_ds.c13
-rw-r--r--arch/powerpc/platforms/cell/axon_msi.c8
-rw-r--r--arch/powerpc/platforms/cell/beat_interrupt.c2
-rw-r--r--arch/powerpc/platforms/powermac/low_i2c.c9
-rw-r--r--arch/powerpc/platforms/powermac/pic.c6
-rw-r--r--arch/powerpc/platforms/pseries/Kconfig4
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c2
-rw-r--r--arch/powerpc/sysdev/cpm2_pic.c3
-rw-r--r--arch/powerpc/sysdev/mpc8xx_pic.c61
-rw-r--r--arch/powerpc/sysdev/mpic.c54
-rw-r--r--arch/powerpc/sysdev/mpic_msgr.c12
-rw-r--r--arch/powerpc/sysdev/scom.c1
-rw-r--r--arch/powerpc/sysdev/xics/xics-common.c7
-rw-r--r--arch/sh/Kconfig10
-rw-r--r--arch/sh/boards/Kconfig2
-rw-r--r--arch/sh/boards/mach-rsk/Kconfig5
-rw-r--r--arch/sh/boards/mach-rsk/Makefile1
-rw-r--r--arch/sh/boards/mach-rsk/devices-rsk7264.c58
-rw-r--r--arch/sh/configs/rsk7264_defconfig80
-rw-r--r--arch/sh/include/asm/atomic.h2
-rw-r--r--arch/sh/include/asm/processor.h2
-rw-r--r--arch/sh/include/cpu-sh2a/cpu/sh7264.h176
-rw-r--r--arch/sh/kernel/cpu/proc.c1
-rw-r--r--arch/sh/kernel/cpu/sh2a/Makefile2
-rw-r--r--arch/sh/kernel/cpu/sh2a/clock-sh7264.c153
-rw-r--r--arch/sh/kernel/cpu/sh2a/pinmux-sh7264.c2136
-rw-r--r--arch/sh/kernel/cpu/sh2a/probe.c3
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-sh7264.c606
-rw-r--r--arch/sh/tools/mach-types1
-rw-r--r--arch/sparc/kernel/leon_smp.c3
-rw-r--r--arch/sparc/kernel/sys_sparc_64.c7
-rw-r--r--arch/tile/include/asm/pci.h4
-rw-r--r--arch/tile/kernel/pci.c4
-rw-r--r--arch/tile/kernel/single_step.c4
-rw-r--r--arch/x86/Kconfig2
-rw-r--r--arch/x86/boot/compressed/head_32.S14
-rw-r--r--arch/x86/boot/compressed/head_64.S22
-rw-r--r--arch/x86/boot/compressed/relocs.c2
-rw-r--r--arch/x86/boot/tools/build.c15
-rw-r--r--arch/x86/ia32/ia32_aout.c35
-rw-r--r--arch/x86/include/asm/posix_types.h6
-rw-r--r--arch/x86/include/asm/sigcontext.h2
-rw-r--r--arch/x86/include/asm/siginfo.h8
-rw-r--r--arch/x86/include/asm/unistd.h6
-rw-r--r--arch/x86/include/asm/word-at-a-time.h33
-rw-r--r--arch/x86/include/asm/x86_init.h1
-rw-r--r--arch/x86/kernel/acpi/sleep.c4
-rw-r--r--arch/x86/kernel/acpi/sleep.h4
-rw-r--r--arch/x86/kernel/acpi/wakeup_32.S4
-rw-r--r--arch/x86/kernel/acpi/wakeup_64.S4
-rw-r--r--arch/x86/kernel/apic/apic.c34
-rw-r--r--arch/x86/kernel/apic/apic_numachip.c7
-rw-r--r--arch/x86/kernel/apic/x2apic_phys.c6
-rw-r--r--arch/x86/kernel/cpu/amd.c29
-rw-r--r--arch/x86/kernel/cpu/common.c9
-rw-r--r--arch/x86/kernel/cpu/intel_cacheinfo.c8
-rw-r--r--arch/x86/kernel/i387.c1
-rw-r--r--arch/x86/kernel/kvm.c9
-rw-r--r--arch/x86/kernel/microcode_amd.c12
-rw-r--r--arch/x86/kernel/microcode_core.c10
-rw-r--r--arch/x86/kernel/process_64.c1
-rw-r--r--arch/x86/kernel/setup_percpu.c14
-rw-r--r--arch/x86/kernel/x86_init.c1
-rw-r--r--arch/x86/kvm/pmu.c18
-rw-r--r--arch/x86/kvm/vmx.c5
-rw-r--r--arch/x86/kvm/x86.c9
-rw-r--r--arch/x86/platform/geode/net5501.c2
-rw-r--r--arch/x86/platform/mrst/mrst.c4
-rw-r--r--arch/x86/xen/enlighten.c46
-rw-r--r--arch/x86/xen/mmu.c7
-rw-r--r--arch/x86/xen/smp.c15
-rw-r--r--arch/x86/xen/xen-asm.S2
-rw-r--r--arch/xtensa/include/asm/hardirq.h3
-rw-r--r--arch/xtensa/include/asm/io.h1
-rw-r--r--arch/xtensa/kernel/signal.c1
192 files changed, 4412 insertions, 932 deletions
diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 56a4df952fb0..22e58a99f38b 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -477,7 +477,7 @@ config ALPHA_BROKEN_IRQ_MASK
477 477
478config VGA_HOSE 478config VGA_HOSE
479 bool 479 bool
480 depends on ALPHA_GENERIC || ALPHA_TITAN || ALPHA_MARVEL || ALPHA_TSUNAMI 480 depends on VGA_CONSOLE && (ALPHA_GENERIC || ALPHA_TITAN || ALPHA_MARVEL || ALPHA_TSUNAMI)
481 default y 481 default y
482 help 482 help
483 Support VGA on an arbitrary hose; needed for several platforms 483 Support VGA on an arbitrary hose; needed for several platforms
diff --git a/arch/alpha/include/asm/rtc.h b/arch/alpha/include/asm/rtc.h
index 1f7fba671ae6..d70408d36677 100644
--- a/arch/alpha/include/asm/rtc.h
+++ b/arch/alpha/include/asm/rtc.h
@@ -1,14 +1,10 @@
1#ifndef _ALPHA_RTC_H 1#ifndef _ALPHA_RTC_H
2#define _ALPHA_RTC_H 2#define _ALPHA_RTC_H
3 3
4#if defined(CONFIG_ALPHA_GENERIC) 4#if defined(CONFIG_ALPHA_MARVEL) && defined(CONFIG_SMP) \
5 || defined(CONFIG_ALPHA_GENERIC)
5# define get_rtc_time alpha_mv.rtc_get_time 6# define get_rtc_time alpha_mv.rtc_get_time
6# define set_rtc_time alpha_mv.rtc_set_time 7# define set_rtc_time alpha_mv.rtc_set_time
7#else
8# if defined(CONFIG_ALPHA_MARVEL) && defined(CONFIG_SMP)
9# define get_rtc_time marvel_get_rtc_time
10# define set_rtc_time marvel_set_rtc_time
11# endif
12#endif 8#endif
13 9
14#include <asm-generic/rtc.h> 10#include <asm-generic/rtc.h>
diff --git a/arch/alpha/kernel/core_tsunami.c b/arch/alpha/kernel/core_tsunami.c
index 5e7c28f92f19..61893d7bdda5 100644
--- a/arch/alpha/kernel/core_tsunami.c
+++ b/arch/alpha/kernel/core_tsunami.c
@@ -11,6 +11,7 @@
11#include <asm/core_tsunami.h> 11#include <asm/core_tsunami.h>
12#undef __EXTERN_INLINE 12#undef __EXTERN_INLINE
13 13
14#include <linux/module.h>
14#include <linux/types.h> 15#include <linux/types.h>
15#include <linux/pci.h> 16#include <linux/pci.h>
16#include <linux/sched.h> 17#include <linux/sched.h>
diff --git a/arch/alpha/kernel/sys_marvel.c b/arch/alpha/kernel/sys_marvel.c
index 14a4b6a7cf59..407accc80877 100644
--- a/arch/alpha/kernel/sys_marvel.c
+++ b/arch/alpha/kernel/sys_marvel.c
@@ -317,7 +317,7 @@ marvel_init_irq(void)
317} 317}
318 318
319static int 319static int
320marvel_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) 320marvel_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
321{ 321{
322 struct pci_controller *hose = dev->sysdata; 322 struct pci_controller *hose = dev->sysdata;
323 struct io7_port *io7_port = hose->sysdata; 323 struct io7_port *io7_port = hose->sysdata;
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index cf006d40342c..36586dba6fa6 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1186,6 +1186,15 @@ if !MMU
1186source "arch/arm/Kconfig-nommu" 1186source "arch/arm/Kconfig-nommu"
1187endif 1187endif
1188 1188
1189config ARM_ERRATA_326103
1190 bool "ARM errata: FSR write bit incorrect on a SWP to read-only memory"
1191 depends on CPU_V6
1192 help
1193 Executing a SWP instruction to read-only memory does not set bit 11
1194 of the FSR on the ARM 1136 prior to r1p0. This causes the kernel to
1195 treat the access as a read, preventing a COW from occurring and
1196 causing the faulting task to livelock.
1197
1189config ARM_ERRATA_411920 1198config ARM_ERRATA_411920
1190 bool "ARM errata: Invalidation of the Instruction Cache operation can fail" 1199 bool "ARM errata: Invalidation of the Instruction Cache operation can fail"
1191 depends on CPU_V6 || CPU_V6K 1200 depends on CPU_V6 || CPU_V6K
diff --git a/arch/arm/boot/dts/msm8660-surf.dts b/arch/arm/boot/dts/msm8660-surf.dts
index 15ded0deaa79..45bc4bb04e57 100644
--- a/arch/arm/boot/dts/msm8660-surf.dts
+++ b/arch/arm/boot/dts/msm8660-surf.dts
@@ -10,7 +10,7 @@
10 intc: interrupt-controller@02080000 { 10 intc: interrupt-controller@02080000 {
11 compatible = "qcom,msm-8660-qgic"; 11 compatible = "qcom,msm-8660-qgic";
12 interrupt-controller; 12 interrupt-controller;
13 #interrupt-cells = <1>; 13 #interrupt-cells = <3>;
14 reg = < 0x02080000 0x1000 >, 14 reg = < 0x02080000 0x1000 >,
15 < 0x02081000 0x1000 >; 15 < 0x02081000 0x1000 >;
16 }; 16 };
@@ -19,6 +19,6 @@
19 compatible = "qcom,msm-hsuart", "qcom,msm-uart"; 19 compatible = "qcom,msm-hsuart", "qcom,msm-uart";
20 reg = <0x19c40000 0x1000>, 20 reg = <0x19c40000 0x1000>,
21 <0x19c00000 0x1000>; 21 <0x19c00000 0x1000>;
22 interrupts = <195>; 22 interrupts = <0 195 0x0>;
23 }; 23 };
24}; 24};
diff --git a/arch/arm/boot/dts/versatile-ab.dts b/arch/arm/boot/dts/versatile-ab.dts
index 0b32925f2147..e2fe3195c0d1 100644
--- a/arch/arm/boot/dts/versatile-ab.dts
+++ b/arch/arm/boot/dts/versatile-ab.dts
@@ -173,7 +173,7 @@
173 mmc@5000 { 173 mmc@5000 {
174 compatible = "arm,primecell"; 174 compatible = "arm,primecell";
175 reg = < 0x5000 0x1000>; 175 reg = < 0x5000 0x1000>;
176 interrupts = <22>; 176 interrupts = <22 34>;
177 }; 177 };
178 kmi@6000 { 178 kmi@6000 {
179 compatible = "arm,pl050", "arm,primecell"; 179 compatible = "arm,pl050", "arm,primecell";
diff --git a/arch/arm/boot/dts/versatile-pb.dts b/arch/arm/boot/dts/versatile-pb.dts
index 166461073b78..7e8175269064 100644
--- a/arch/arm/boot/dts/versatile-pb.dts
+++ b/arch/arm/boot/dts/versatile-pb.dts
@@ -41,7 +41,7 @@
41 mmc@b000 { 41 mmc@b000 {
42 compatible = "arm,primecell"; 42 compatible = "arm,primecell";
43 reg = <0xb000 0x1000>; 43 reg = <0xb000 0x1000>;
44 interrupts = <23>; 44 interrupts = <23 34>;
45 }; 45 };
46 }; 46 };
47 }; 47 };
diff --git a/arch/arm/configs/imx_v4_v5_defconfig b/arch/arm/configs/imx_v4_v5_defconfig
index b5ac644e12af..6b31cb60daab 100644
--- a/arch/arm/configs/imx_v4_v5_defconfig
+++ b/arch/arm/configs/imx_v4_v5_defconfig
@@ -112,6 +112,7 @@ CONFIG_WATCHDOG=y
112CONFIG_IMX2_WDT=y 112CONFIG_IMX2_WDT=y
113CONFIG_MFD_MC13XXX=y 113CONFIG_MFD_MC13XXX=y
114CONFIG_REGULATOR=y 114CONFIG_REGULATOR=y
115CONFIG_REGULATOR_FIXED_VOLTAGE=y
115CONFIG_REGULATOR_MC13783=y 116CONFIG_REGULATOR_MC13783=y
116CONFIG_REGULATOR_MC13892=y 117CONFIG_REGULATOR_MC13892=y
117CONFIG_FB=y 118CONFIG_FB=y
diff --git a/arch/arm/configs/mini2440_defconfig b/arch/arm/configs/mini2440_defconfig
index 42da9183acc8..082175c54e7c 100644
--- a/arch/arm/configs/mini2440_defconfig
+++ b/arch/arm/configs/mini2440_defconfig
@@ -14,6 +14,8 @@ CONFIG_MODULE_FORCE_UNLOAD=y
14# CONFIG_BLK_DEV_BSG is not set 14# CONFIG_BLK_DEV_BSG is not set
15CONFIG_BLK_DEV_INTEGRITY=y 15CONFIG_BLK_DEV_INTEGRITY=y
16CONFIG_ARCH_S3C24XX=y 16CONFIG_ARCH_S3C24XX=y
17# CONFIG_CPU_S3C2410 is not set
18CONFIG_CPU_S3C2440=y
17CONFIG_S3C_ADC=y 19CONFIG_S3C_ADC=y
18CONFIG_S3C24XX_PWM=y 20CONFIG_S3C24XX_PWM=y
19CONFIG_MACH_MINI2440=y 21CONFIG_MACH_MINI2440=y
diff --git a/arch/arm/configs/u8500_defconfig b/arch/arm/configs/u8500_defconfig
index 889d73ac1ae1..7e84f453e8a6 100644
--- a/arch/arm/configs/u8500_defconfig
+++ b/arch/arm/configs/u8500_defconfig
@@ -8,8 +8,6 @@ CONFIG_MODULE_UNLOAD=y
8# CONFIG_LBDAF is not set 8# CONFIG_LBDAF is not set
9# CONFIG_BLK_DEV_BSG is not set 9# CONFIG_BLK_DEV_BSG is not set
10CONFIG_ARCH_U8500=y 10CONFIG_ARCH_U8500=y
11CONFIG_UX500_SOC_DB5500=y
12CONFIG_UX500_SOC_DB8500=y
13CONFIG_MACH_HREFV60=y 11CONFIG_MACH_HREFV60=y
14CONFIG_MACH_SNOWBALL=y 12CONFIG_MACH_SNOWBALL=y
15CONFIG_MACH_U5500=y 13CONFIG_MACH_U5500=y
@@ -39,7 +37,6 @@ CONFIG_CAIF=y
39CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 37CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
40CONFIG_BLK_DEV_RAM=y 38CONFIG_BLK_DEV_RAM=y
41CONFIG_BLK_DEV_RAM_SIZE=65536 39CONFIG_BLK_DEV_RAM_SIZE=65536
42CONFIG_MISC_DEVICES=y
43CONFIG_AB8500_PWM=y 40CONFIG_AB8500_PWM=y
44CONFIG_SENSORS_BH1780=y 41CONFIG_SENSORS_BH1780=y
45CONFIG_NETDEVICES=y 42CONFIG_NETDEVICES=y
@@ -65,16 +62,18 @@ CONFIG_SERIAL_AMBA_PL011=y
65CONFIG_SERIAL_AMBA_PL011_CONSOLE=y 62CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
66CONFIG_HW_RANDOM=y 63CONFIG_HW_RANDOM=y
67CONFIG_HW_RANDOM_NOMADIK=y 64CONFIG_HW_RANDOM_NOMADIK=y
68CONFIG_I2C=y
69CONFIG_I2C_NOMADIK=y
70CONFIG_SPI=y 65CONFIG_SPI=y
71CONFIG_SPI_PL022=y 66CONFIG_SPI_PL022=y
72CONFIG_GPIO_STMPE=y 67CONFIG_GPIO_STMPE=y
73CONFIG_GPIO_TC3589X=y 68CONFIG_GPIO_TC3589X=y
69CONFIG_POWER_SUPPLY=y
70CONFIG_AB8500_BM=y
71CONFIG_AB8500_BATTERY_THERM_ON_BATCTRL=y
74CONFIG_MFD_STMPE=y 72CONFIG_MFD_STMPE=y
75CONFIG_MFD_TC3589X=y 73CONFIG_MFD_TC3589X=y
76CONFIG_AB5500_CORE=y 74CONFIG_AB5500_CORE=y
77CONFIG_AB8500_CORE=y 75CONFIG_AB8500_CORE=y
76CONFIG_REGULATOR=y
78CONFIG_REGULATOR_AB8500=y 77CONFIG_REGULATOR_AB8500=y
79# CONFIG_HID_SUPPORT is not set 78# CONFIG_HID_SUPPORT is not set
80CONFIG_USB_GADGET=y 79CONFIG_USB_GADGET=y
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h
index d4c24d412a8d..0f04d84582e1 100644
--- a/arch/arm/include/asm/thread_info.h
+++ b/arch/arm/include/asm/thread_info.h
@@ -118,6 +118,13 @@ extern void iwmmxt_task_switch(struct thread_info *);
118extern void vfp_sync_hwstate(struct thread_info *); 118extern void vfp_sync_hwstate(struct thread_info *);
119extern void vfp_flush_hwstate(struct thread_info *); 119extern void vfp_flush_hwstate(struct thread_info *);
120 120
121struct user_vfp;
122struct user_vfp_exc;
123
124extern int vfp_preserve_user_clear_hwstate(struct user_vfp __user *,
125 struct user_vfp_exc __user *);
126extern int vfp_restore_user_hwstate(struct user_vfp __user *,
127 struct user_vfp_exc __user *);
121#endif 128#endif
122 129
123/* 130/*
diff --git a/arch/arm/include/asm/tls.h b/arch/arm/include/asm/tls.h
index 60843eb0f61c..73409e6c0251 100644
--- a/arch/arm/include/asm/tls.h
+++ b/arch/arm/include/asm/tls.h
@@ -7,6 +7,8 @@
7 7
8 .macro set_tls_v6k, tp, tmp1, tmp2 8 .macro set_tls_v6k, tp, tmp1, tmp2
9 mcr p15, 0, \tp, c13, c0, 3 @ set TLS register 9 mcr p15, 0, \tp, c13, c0, 3 @ set TLS register
10 mov \tmp1, #0
11 mcr p15, 0, \tmp1, c13, c0, 2 @ clear user r/w TLS register
10 .endm 12 .endm
11 13
12 .macro set_tls_v6, tp, tmp1, tmp2 14 .macro set_tls_v6, tp, tmp1, tmp2
@@ -15,6 +17,8 @@
15 mov \tmp2, #0xffff0fff 17 mov \tmp2, #0xffff0fff
16 tst \tmp1, #HWCAP_TLS @ hardware TLS available? 18 tst \tmp1, #HWCAP_TLS @ hardware TLS available?
17 mcrne p15, 0, \tp, c13, c0, 3 @ yes, set TLS register 19 mcrne p15, 0, \tp, c13, c0, 3 @ yes, set TLS register
20 movne \tmp1, #0
21 mcrne p15, 0, \tmp1, c13, c0, 2 @ clear user r/w TLS register
18 streq \tp, [\tmp2, #-15] @ set TLS value at 0xffff0ff0 22 streq \tp, [\tmp2, #-15] @ set TLS value at 0xffff0ff0
19 .endm 23 .endm
20 24
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
index 71ccdbfed662..8349d4e97e2b 100644
--- a/arch/arm/kernel/irq.c
+++ b/arch/arm/kernel/irq.c
@@ -155,10 +155,10 @@ static bool migrate_one_irq(struct irq_desc *desc)
155 } 155 }
156 156
157 c = irq_data_get_irq_chip(d); 157 c = irq_data_get_irq_chip(d);
158 if (c->irq_set_affinity) 158 if (!c->irq_set_affinity)
159 c->irq_set_affinity(d, affinity, true);
160 else
161 pr_debug("IRQ%u: unable to set affinity\n", d->irq); 159 pr_debug("IRQ%u: unable to set affinity\n", d->irq);
160 else if (c->irq_set_affinity(d, affinity, true) == IRQ_SET_MASK_OK && ret)
161 cpumask_copy(d->affinity, affinity);
162 162
163 return ret; 163 return ret;
164} 164}
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index 80abafb9bf33..9650c143afc1 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -906,27 +906,14 @@ long arch_ptrace(struct task_struct *child, long request,
906 return ret; 906 return ret;
907} 907}
908 908
909#ifdef __ARMEB__
910#define AUDIT_ARCH_NR AUDIT_ARCH_ARMEB
911#else
912#define AUDIT_ARCH_NR AUDIT_ARCH_ARM
913#endif
914
915asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) 909asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
916{ 910{
917 unsigned long ip; 911 unsigned long ip;
918 912
919 /* 913 if (why)
920 * Save IP. IP is used to denote syscall entry/exit:
921 * IP = 0 -> entry, = 1 -> exit
922 */
923 ip = regs->ARM_ip;
924 regs->ARM_ip = why;
925
926 if (!ip)
927 audit_syscall_exit(regs); 914 audit_syscall_exit(regs);
928 else 915 else
929 audit_syscall_entry(AUDIT_ARCH_NR, scno, regs->ARM_r0, 916 audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0,
930 regs->ARM_r1, regs->ARM_r2, regs->ARM_r3); 917 regs->ARM_r1, regs->ARM_r2, regs->ARM_r3);
931 918
932 if (!test_thread_flag(TIF_SYSCALL_TRACE)) 919 if (!test_thread_flag(TIF_SYSCALL_TRACE))
@@ -936,6 +923,13 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
936 923
937 current_thread_info()->syscall = scno; 924 current_thread_info()->syscall = scno;
938 925
926 /*
927 * IP is used to denote syscall entry/exit:
928 * IP = 0 -> entry, =1 -> exit
929 */
930 ip = regs->ARM_ip;
931 regs->ARM_ip = why;
932
939 /* the 0x80 provides a way for the tracing parent to distinguish 933 /* the 0x80 provides a way for the tracing parent to distinguish
940 between a syscall stop and SIGTRAP delivery */ 934 between a syscall stop and SIGTRAP delivery */
941 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) 935 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 7cb532fc8aa4..d68d1b694680 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -180,44 +180,23 @@ static int restore_iwmmxt_context(struct iwmmxt_sigframe *frame)
180 180
181static int preserve_vfp_context(struct vfp_sigframe __user *frame) 181static int preserve_vfp_context(struct vfp_sigframe __user *frame)
182{ 182{
183 struct thread_info *thread = current_thread_info();
184 struct vfp_hard_struct *h = &thread->vfpstate.hard;
185 const unsigned long magic = VFP_MAGIC; 183 const unsigned long magic = VFP_MAGIC;
186 const unsigned long size = VFP_STORAGE_SIZE; 184 const unsigned long size = VFP_STORAGE_SIZE;
187 int err = 0; 185 int err = 0;
188 186
189 vfp_sync_hwstate(thread);
190 __put_user_error(magic, &frame->magic, err); 187 __put_user_error(magic, &frame->magic, err);
191 __put_user_error(size, &frame->size, err); 188 __put_user_error(size, &frame->size, err);
192 189
193 /* 190 if (err)
194 * Copy the floating point registers. There can be unused 191 return -EFAULT;
195 * registers see asm/hwcap.h for details.
196 */
197 err |= __copy_to_user(&frame->ufp.fpregs, &h->fpregs,
198 sizeof(h->fpregs));
199 /*
200 * Copy the status and control register.
201 */
202 __put_user_error(h->fpscr, &frame->ufp.fpscr, err);
203
204 /*
205 * Copy the exception registers.
206 */
207 __put_user_error(h->fpexc, &frame->ufp_exc.fpexc, err);
208 __put_user_error(h->fpinst, &frame->ufp_exc.fpinst, err);
209 __put_user_error(h->fpinst2, &frame->ufp_exc.fpinst2, err);
210 192
211 return err ? -EFAULT : 0; 193 return vfp_preserve_user_clear_hwstate(&frame->ufp, &frame->ufp_exc);
212} 194}
213 195
214static int restore_vfp_context(struct vfp_sigframe __user *frame) 196static int restore_vfp_context(struct vfp_sigframe __user *frame)
215{ 197{
216 struct thread_info *thread = current_thread_info();
217 struct vfp_hard_struct *h = &thread->vfpstate.hard;
218 unsigned long magic; 198 unsigned long magic;
219 unsigned long size; 199 unsigned long size;
220 unsigned long fpexc;
221 int err = 0; 200 int err = 0;
222 201
223 __get_user_error(magic, &frame->magic, err); 202 __get_user_error(magic, &frame->magic, err);
@@ -228,33 +207,7 @@ static int restore_vfp_context(struct vfp_sigframe __user *frame)
228 if (magic != VFP_MAGIC || size != VFP_STORAGE_SIZE) 207 if (magic != VFP_MAGIC || size != VFP_STORAGE_SIZE)
229 return -EINVAL; 208 return -EINVAL;
230 209
231 vfp_flush_hwstate(thread); 210 return vfp_restore_user_hwstate(&frame->ufp, &frame->ufp_exc);
232
233 /*
234 * Copy the floating point registers. There can be unused
235 * registers see asm/hwcap.h for details.
236 */
237 err |= __copy_from_user(&h->fpregs, &frame->ufp.fpregs,
238 sizeof(h->fpregs));
239 /*
240 * Copy the status and control register.
241 */
242 __get_user_error(h->fpscr, &frame->ufp.fpscr, err);
243
244 /*
245 * Sanitise and restore the exception registers.
246 */
247 __get_user_error(fpexc, &frame->ufp_exc.fpexc, err);
248 /* Ensure the VFP is enabled. */
249 fpexc |= FPEXC_EN;
250 /* Ensure FPINST2 is invalid and the exception flag is cleared. */
251 fpexc &= ~(FPEXC_EX | FPEXC_FP2V);
252 h->fpexc = fpexc;
253
254 __get_user_error(h->fpinst, &frame->ufp_exc.fpinst, err);
255 __get_user_error(h->fpinst2, &frame->ufp_exc.fpinst2, err);
256
257 return err ? -EFAULT : 0;
258} 211}
259 212
260#endif 213#endif
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index addbbe8028c2..8f4644659777 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -251,8 +251,6 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
251 struct mm_struct *mm = &init_mm; 251 struct mm_struct *mm = &init_mm;
252 unsigned int cpu = smp_processor_id(); 252 unsigned int cpu = smp_processor_id();
253 253
254 printk("CPU%u: Booted secondary processor\n", cpu);
255
256 /* 254 /*
257 * All kernel threads share the same mm context; grab a 255 * All kernel threads share the same mm context; grab a
258 * reference and switch to it. 256 * reference and switch to it.
@@ -264,6 +262,8 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
264 enter_lazy_tlb(mm, current); 262 enter_lazy_tlb(mm, current);
265 local_flush_tlb_all(); 263 local_flush_tlb_all();
266 264
265 printk("CPU%u: Booted secondary processor\n", cpu);
266
267 cpu_init(); 267 cpu_init();
268 preempt_disable(); 268 preempt_disable();
269 trace_hardirqs_off(); 269 trace_hardirqs_off();
@@ -510,10 +510,6 @@ static void ipi_cpu_stop(unsigned int cpu)
510 local_fiq_disable(); 510 local_fiq_disable();
511 local_irq_disable(); 511 local_irq_disable();
512 512
513#ifdef CONFIG_HOTPLUG_CPU
514 platform_cpu_kill(cpu);
515#endif
516
517 while (1) 513 while (1)
518 cpu_relax(); 514 cpu_relax();
519} 515}
@@ -576,17 +572,25 @@ void smp_send_reschedule(int cpu)
576 smp_cross_call(cpumask_of(cpu), IPI_RESCHEDULE); 572 smp_cross_call(cpumask_of(cpu), IPI_RESCHEDULE);
577} 573}
578 574
575#ifdef CONFIG_HOTPLUG_CPU
576static void smp_kill_cpus(cpumask_t *mask)
577{
578 unsigned int cpu;
579 for_each_cpu(cpu, mask)
580 platform_cpu_kill(cpu);
581}
582#else
583static void smp_kill_cpus(cpumask_t *mask) { }
584#endif
585
579void smp_send_stop(void) 586void smp_send_stop(void)
580{ 587{
581 unsigned long timeout; 588 unsigned long timeout;
589 struct cpumask mask;
582 590
583 if (num_online_cpus() > 1) { 591 cpumask_copy(&mask, cpu_online_mask);
584 struct cpumask mask; 592 cpumask_clear_cpu(smp_processor_id(), &mask);
585 cpumask_copy(&mask, cpu_online_mask); 593 smp_cross_call(&mask, IPI_CPU_STOP);
586 cpumask_clear_cpu(smp_processor_id(), &mask);
587
588 smp_cross_call(&mask, IPI_CPU_STOP);
589 }
590 594
591 /* Wait up to one second for other CPUs to stop */ 595 /* Wait up to one second for other CPUs to stop */
592 timeout = USEC_PER_SEC; 596 timeout = USEC_PER_SEC;
@@ -595,6 +599,8 @@ void smp_send_stop(void)
595 599
596 if (num_online_cpus() > 1) 600 if (num_online_cpus() > 1)
597 pr_warning("SMP: failed to stop secondary CPUs\n"); 601 pr_warning("SMP: failed to stop secondary CPUs\n");
602
603 smp_kill_cpus(&mask);
598} 604}
599 605
600/* 606/*
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 5b150afb995b..fef42b21cecb 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -118,14 +118,10 @@ static int twd_cpufreq_transition(struct notifier_block *nb,
118 * The twd clock events must be reprogrammed to account for the new 118 * The twd clock events must be reprogrammed to account for the new
119 * frequency. The timer is local to a cpu, so cross-call to the 119 * frequency. The timer is local to a cpu, so cross-call to the
120 * changing cpu. 120 * changing cpu.
121 *
122 * Only wait for it to finish, if the cpu is active to avoid
123 * deadlock when cpu1 is spinning on while(!cpu_active(cpu1)) during
124 * booting of that cpu.
125 */ 121 */
126 if (state == CPUFREQ_POSTCHANGE || state == CPUFREQ_RESUMECHANGE) 122 if (state == CPUFREQ_POSTCHANGE || state == CPUFREQ_RESUMECHANGE)
127 smp_call_function_single(freqs->cpu, twd_update_frequency, 123 smp_call_function_single(freqs->cpu, twd_update_frequency,
128 NULL, cpu_active(freqs->cpu)); 124 NULL, 1);
129 125
130 return NOTIFY_OK; 126 return NOTIFY_OK;
131} 127}
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index d2b177905cdb..76cbb055dd05 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -115,7 +115,7 @@ int kernel_execve(const char *filename,
115 "Ir" (THREAD_START_SP - sizeof(regs)), 115 "Ir" (THREAD_START_SP - sizeof(regs)),
116 "r" (&regs), 116 "r" (&regs),
117 "Ir" (sizeof(regs)) 117 "Ir" (sizeof(regs))
118 : "r0", "r1", "r2", "r3", "ip", "lr", "memory"); 118 : "r0", "r1", "r2", "r3", "r8", "r9", "ip", "lr", "memory");
119 119
120 out: 120 out:
121 return ret; 121 return ret;
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index 99ce5c955e39..05774e5b1cba 100644
--- a/arch/arm/mach-at91/at91rm9200_devices.c
+++ b/arch/arm/mach-at91/at91rm9200_devices.c
@@ -1173,7 +1173,6 @@ void __init at91_add_device_serial(void)
1173 printk(KERN_INFO "AT91: No default serial console defined.\n"); 1173 printk(KERN_INFO "AT91: No default serial console defined.\n");
1174} 1174}
1175#else 1175#else
1176void __init __deprecated at91_init_serial(struct at91_uart_config *config) {}
1177void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {} 1176void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {}
1178void __init at91_set_serial_console(unsigned portnr) {} 1177void __init at91_set_serial_console(unsigned portnr) {}
1179void __init at91_add_device_serial(void) {} 1178void __init at91_add_device_serial(void) {}
diff --git a/arch/arm/mach-at91/at91rm9200_time.c b/arch/arm/mach-at91/at91rm9200_time.c
index dd7f782b0b91..104ca40d8d18 100644
--- a/arch/arm/mach-at91/at91rm9200_time.c
+++ b/arch/arm/mach-at91/at91rm9200_time.c
@@ -23,6 +23,7 @@
23#include <linux/interrupt.h> 23#include <linux/interrupt.h>
24#include <linux/irq.h> 24#include <linux/irq.h>
25#include <linux/clockchips.h> 25#include <linux/clockchips.h>
26#include <linux/export.h>
26 27
27#include <asm/mach/time.h> 28#include <asm/mach/time.h>
28 29
@@ -176,6 +177,7 @@ static struct clock_event_device clkevt = {
176}; 177};
177 178
178void __iomem *at91_st_base; 179void __iomem *at91_st_base;
180EXPORT_SYMBOL_GPL(at91_st_base);
179 181
180void __init at91rm9200_ioremap_st(u32 addr) 182void __init at91rm9200_ioremap_st(u32 addr)
181{ 183{
diff --git a/arch/arm/mach-at91/board-rm9200ek.c b/arch/arm/mach-at91/board-rm9200ek.c
index 11cbaa8946fe..b2e4fe21f346 100644
--- a/arch/arm/mach-at91/board-rm9200ek.c
+++ b/arch/arm/mach-at91/board-rm9200ek.c
@@ -117,7 +117,7 @@ static struct i2c_board_info __initdata ek_i2c_devices[] = {
117}; 117};
118 118
119#define EK_FLASH_BASE AT91_CHIPSELECT_0 119#define EK_FLASH_BASE AT91_CHIPSELECT_0
120#define EK_FLASH_SIZE SZ_2M 120#define EK_FLASH_SIZE SZ_8M
121 121
122static struct physmap_flash_data ek_flash_data = { 122static struct physmap_flash_data ek_flash_data = {
123 .width = 2, 123 .width = 2,
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
index c3f994462864..065fed342424 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -85,8 +85,6 @@ static struct resource dm9000_resource[] = {
85 .flags = IORESOURCE_MEM 85 .flags = IORESOURCE_MEM
86 }, 86 },
87 [2] = { 87 [2] = {
88 .start = AT91_PIN_PC11,
89 .end = AT91_PIN_PC11,
90 .flags = IORESOURCE_IRQ 88 .flags = IORESOURCE_IRQ
91 | IORESOURCE_IRQ_LOWEDGE | IORESOURCE_IRQ_HIGHEDGE, 89 | IORESOURCE_IRQ_LOWEDGE | IORESOURCE_IRQ_HIGHEDGE,
92 } 90 }
@@ -130,6 +128,8 @@ static struct sam9_smc_config __initdata dm9000_smc_config = {
130 128
131static void __init ek_add_device_dm9000(void) 129static void __init ek_add_device_dm9000(void)
132{ 130{
131 struct resource *r = &dm9000_resource[2];
132
133 /* Configure chip-select 2 (DM9000) */ 133 /* Configure chip-select 2 (DM9000) */
134 sam9_smc_configure(0, 2, &dm9000_smc_config); 134 sam9_smc_configure(0, 2, &dm9000_smc_config);
135 135
@@ -139,6 +139,7 @@ static void __init ek_add_device_dm9000(void)
139 /* Configure Interrupt pin as input, no pull-up */ 139 /* Configure Interrupt pin as input, no pull-up */
140 at91_set_gpio_input(AT91_PIN_PC11, 0); 140 at91_set_gpio_input(AT91_PIN_PC11, 0);
141 141
142 r->start = r->end = gpio_to_irq(AT91_PIN_PC11);
142 platform_device_register(&dm9000_device); 143 platform_device_register(&dm9000_device);
143} 144}
144#else 145#else
diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c
index a0f4d7424cdc..6b692824c988 100644
--- a/arch/arm/mach-at91/clock.c
+++ b/arch/arm/mach-at91/clock.c
@@ -35,6 +35,7 @@
35#include "generic.h" 35#include "generic.h"
36 36
37void __iomem *at91_pmc_base; 37void __iomem *at91_pmc_base;
38EXPORT_SYMBOL_GPL(at91_pmc_base);
38 39
39/* 40/*
40 * There's a lot more which can be done with clocks, including cpufreq 41 * There's a lot more which can be done with clocks, including cpufreq
diff --git a/arch/arm/mach-at91/include/mach/at91_pmc.h b/arch/arm/mach-at91/include/mach/at91_pmc.h
index 36604782a78f..ea2c57a86ca6 100644
--- a/arch/arm/mach-at91/include/mach/at91_pmc.h
+++ b/arch/arm/mach-at91/include/mach/at91_pmc.h
@@ -25,7 +25,7 @@ extern void __iomem *at91_pmc_base;
25#define at91_pmc_write(field, value) \ 25#define at91_pmc_write(field, value) \
26 __raw_writel(value, at91_pmc_base + field) 26 __raw_writel(value, at91_pmc_base + field)
27#else 27#else
28.extern at91_aic_base 28.extern at91_pmc_base
29#endif 29#endif
30 30
31#define AT91_PMC_SCER 0x00 /* System Clock Enable Register */ 31#define AT91_PMC_SCER 0x00 /* System Clock Enable Register */
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index 97cc04dc8073..f44a2e7272e3 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -54,6 +54,7 @@ void __init at91_init_interrupts(unsigned int *priority)
54} 54}
55 55
56void __iomem *at91_ramc_base[2]; 56void __iomem *at91_ramc_base[2];
57EXPORT_SYMBOL_GPL(at91_ramc_base);
57 58
58void __init at91_ioremap_ramc(int id, u32 addr, u32 size) 59void __init at91_ioremap_ramc(int id, u32 addr, u32 size)
59{ 60{
@@ -292,6 +293,7 @@ void __init at91_ioremap_rstc(u32 base_addr)
292} 293}
293 294
294void __iomem *at91_matrix_base; 295void __iomem *at91_matrix_base;
296EXPORT_SYMBOL_GPL(at91_matrix_base);
295 297
296void __init at91_ioremap_matrix(u32 base_addr) 298void __init at91_ioremap_matrix(u32 base_addr)
297{ 299{
diff --git a/arch/arm/mach-bcmring/core.c b/arch/arm/mach-bcmring/core.c
index 22e4e0a28ad1..adbfb1994582 100644
--- a/arch/arm/mach-bcmring/core.c
+++ b/arch/arm/mach-bcmring/core.c
@@ -52,8 +52,8 @@
52#include <mach/csp/chipcHw_inline.h> 52#include <mach/csp/chipcHw_inline.h>
53#include <mach/csp/tmrHw_reg.h> 53#include <mach/csp/tmrHw_reg.h>
54 54
55static AMBA_APB_DEVICE(uartA, "uarta", MM_ADDR_IO_UARTA, { IRQ_UARTA }, NULL); 55static AMBA_APB_DEVICE(uartA, "uartA", 0, MM_ADDR_IO_UARTA, {IRQ_UARTA}, NULL);
56static AMBA_APB_DEVICE(uartB, "uartb", MM_ADDR_IO_UARTB, { IRQ_UARTB }, NULL); 56static AMBA_APB_DEVICE(uartB, "uartB", 0, MM_ADDR_IO_UARTB, {IRQ_UARTB}, NULL);
57 57
58static struct clk pll1_clk = { 58static struct clk pll1_clk = {
59 .name = "PLL1", 59 .name = "PLL1",
diff --git a/arch/arm/mach-exynos/clock-exynos4.c b/arch/arm/mach-exynos/clock-exynos4.c
index df54c2a92225..6efd1e5919fd 100644
--- a/arch/arm/mach-exynos/clock-exynos4.c
+++ b/arch/arm/mach-exynos/clock-exynos4.c
@@ -497,25 +497,25 @@ static struct clk exynos4_init_clocks_off[] = {
497 .ctrlbit = (1 << 3), 497 .ctrlbit = (1 << 3),
498 }, { 498 }, {
499 .name = "hsmmc", 499 .name = "hsmmc",
500 .devname = "s3c-sdhci.0", 500 .devname = "exynos4-sdhci.0",
501 .parent = &exynos4_clk_aclk_133.clk, 501 .parent = &exynos4_clk_aclk_133.clk,
502 .enable = exynos4_clk_ip_fsys_ctrl, 502 .enable = exynos4_clk_ip_fsys_ctrl,
503 .ctrlbit = (1 << 5), 503 .ctrlbit = (1 << 5),
504 }, { 504 }, {
505 .name = "hsmmc", 505 .name = "hsmmc",
506 .devname = "s3c-sdhci.1", 506 .devname = "exynos4-sdhci.1",
507 .parent = &exynos4_clk_aclk_133.clk, 507 .parent = &exynos4_clk_aclk_133.clk,
508 .enable = exynos4_clk_ip_fsys_ctrl, 508 .enable = exynos4_clk_ip_fsys_ctrl,
509 .ctrlbit = (1 << 6), 509 .ctrlbit = (1 << 6),
510 }, { 510 }, {
511 .name = "hsmmc", 511 .name = "hsmmc",
512 .devname = "s3c-sdhci.2", 512 .devname = "exynos4-sdhci.2",
513 .parent = &exynos4_clk_aclk_133.clk, 513 .parent = &exynos4_clk_aclk_133.clk,
514 .enable = exynos4_clk_ip_fsys_ctrl, 514 .enable = exynos4_clk_ip_fsys_ctrl,
515 .ctrlbit = (1 << 7), 515 .ctrlbit = (1 << 7),
516 }, { 516 }, {
517 .name = "hsmmc", 517 .name = "hsmmc",
518 .devname = "s3c-sdhci.3", 518 .devname = "exynos4-sdhci.3",
519 .parent = &exynos4_clk_aclk_133.clk, 519 .parent = &exynos4_clk_aclk_133.clk,
520 .enable = exynos4_clk_ip_fsys_ctrl, 520 .enable = exynos4_clk_ip_fsys_ctrl,
521 .ctrlbit = (1 << 8), 521 .ctrlbit = (1 << 8),
@@ -1202,7 +1202,7 @@ static struct clksrc_clk exynos4_clk_sclk_uart3 = {
1202static struct clksrc_clk exynos4_clk_sclk_mmc0 = { 1202static struct clksrc_clk exynos4_clk_sclk_mmc0 = {
1203 .clk = { 1203 .clk = {
1204 .name = "sclk_mmc", 1204 .name = "sclk_mmc",
1205 .devname = "s3c-sdhci.0", 1205 .devname = "exynos4-sdhci.0",
1206 .parent = &exynos4_clk_dout_mmc0.clk, 1206 .parent = &exynos4_clk_dout_mmc0.clk,
1207 .enable = exynos4_clksrc_mask_fsys_ctrl, 1207 .enable = exynos4_clksrc_mask_fsys_ctrl,
1208 .ctrlbit = (1 << 0), 1208 .ctrlbit = (1 << 0),
@@ -1213,7 +1213,7 @@ static struct clksrc_clk exynos4_clk_sclk_mmc0 = {
1213static struct clksrc_clk exynos4_clk_sclk_mmc1 = { 1213static struct clksrc_clk exynos4_clk_sclk_mmc1 = {
1214 .clk = { 1214 .clk = {
1215 .name = "sclk_mmc", 1215 .name = "sclk_mmc",
1216 .devname = "s3c-sdhci.1", 1216 .devname = "exynos4-sdhci.1",
1217 .parent = &exynos4_clk_dout_mmc1.clk, 1217 .parent = &exynos4_clk_dout_mmc1.clk,
1218 .enable = exynos4_clksrc_mask_fsys_ctrl, 1218 .enable = exynos4_clksrc_mask_fsys_ctrl,
1219 .ctrlbit = (1 << 4), 1219 .ctrlbit = (1 << 4),
@@ -1224,7 +1224,7 @@ static struct clksrc_clk exynos4_clk_sclk_mmc1 = {
1224static struct clksrc_clk exynos4_clk_sclk_mmc2 = { 1224static struct clksrc_clk exynos4_clk_sclk_mmc2 = {
1225 .clk = { 1225 .clk = {
1226 .name = "sclk_mmc", 1226 .name = "sclk_mmc",
1227 .devname = "s3c-sdhci.2", 1227 .devname = "exynos4-sdhci.2",
1228 .parent = &exynos4_clk_dout_mmc2.clk, 1228 .parent = &exynos4_clk_dout_mmc2.clk,
1229 .enable = exynos4_clksrc_mask_fsys_ctrl, 1229 .enable = exynos4_clksrc_mask_fsys_ctrl,
1230 .ctrlbit = (1 << 8), 1230 .ctrlbit = (1 << 8),
@@ -1235,7 +1235,7 @@ static struct clksrc_clk exynos4_clk_sclk_mmc2 = {
1235static struct clksrc_clk exynos4_clk_sclk_mmc3 = { 1235static struct clksrc_clk exynos4_clk_sclk_mmc3 = {
1236 .clk = { 1236 .clk = {
1237 .name = "sclk_mmc", 1237 .name = "sclk_mmc",
1238 .devname = "s3c-sdhci.3", 1238 .devname = "exynos4-sdhci.3",
1239 .parent = &exynos4_clk_dout_mmc3.clk, 1239 .parent = &exynos4_clk_dout_mmc3.clk,
1240 .enable = exynos4_clksrc_mask_fsys_ctrl, 1240 .enable = exynos4_clksrc_mask_fsys_ctrl,
1241 .ctrlbit = (1 << 12), 1241 .ctrlbit = (1 << 12),
@@ -1340,10 +1340,10 @@ static struct clk_lookup exynos4_clk_lookup[] = {
1340 CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &exynos4_clk_sclk_uart1.clk), 1340 CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &exynos4_clk_sclk_uart1.clk),
1341 CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &exynos4_clk_sclk_uart2.clk), 1341 CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &exynos4_clk_sclk_uart2.clk),
1342 CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &exynos4_clk_sclk_uart3.clk), 1342 CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &exynos4_clk_sclk_uart3.clk),
1343 CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &exynos4_clk_sclk_mmc0.clk), 1343 CLKDEV_INIT("exynos4-sdhci.0", "mmc_busclk.2", &exynos4_clk_sclk_mmc0.clk),
1344 CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &exynos4_clk_sclk_mmc1.clk), 1344 CLKDEV_INIT("exynos4-sdhci.1", "mmc_busclk.2", &exynos4_clk_sclk_mmc1.clk),
1345 CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &exynos4_clk_sclk_mmc2.clk), 1345 CLKDEV_INIT("exynos4-sdhci.2", "mmc_busclk.2", &exynos4_clk_sclk_mmc2.clk),
1346 CLKDEV_INIT("s3c-sdhci.3", "mmc_busclk.2", &exynos4_clk_sclk_mmc3.clk), 1346 CLKDEV_INIT("exynos4-sdhci.3", "mmc_busclk.2", &exynos4_clk_sclk_mmc3.clk),
1347 CLKDEV_INIT("exynos4-fb.0", "lcd", &exynos4_clk_fimd0), 1347 CLKDEV_INIT("exynos4-fb.0", "lcd", &exynos4_clk_fimd0),
1348 CLKDEV_INIT("dma-pl330.0", "apb_pclk", &exynos4_clk_pdma0), 1348 CLKDEV_INIT("dma-pl330.0", "apb_pclk", &exynos4_clk_pdma0),
1349 CLKDEV_INIT("dma-pl330.1", "apb_pclk", &exynos4_clk_pdma1), 1349 CLKDEV_INIT("dma-pl330.1", "apb_pclk", &exynos4_clk_pdma1),
diff --git a/arch/arm/mach-exynos/clock-exynos5.c b/arch/arm/mach-exynos/clock-exynos5.c
index d013982d0f8e..5cd7a8b8868c 100644
--- a/arch/arm/mach-exynos/clock-exynos5.c
+++ b/arch/arm/mach-exynos/clock-exynos5.c
@@ -455,25 +455,25 @@ static struct clk exynos5_init_clocks_off[] = {
455 .ctrlbit = (1 << 20), 455 .ctrlbit = (1 << 20),
456 }, { 456 }, {
457 .name = "hsmmc", 457 .name = "hsmmc",
458 .devname = "s3c-sdhci.0", 458 .devname = "exynos4-sdhci.0",
459 .parent = &exynos5_clk_aclk_200.clk, 459 .parent = &exynos5_clk_aclk_200.clk,
460 .enable = exynos5_clk_ip_fsys_ctrl, 460 .enable = exynos5_clk_ip_fsys_ctrl,
461 .ctrlbit = (1 << 12), 461 .ctrlbit = (1 << 12),
462 }, { 462 }, {
463 .name = "hsmmc", 463 .name = "hsmmc",
464 .devname = "s3c-sdhci.1", 464 .devname = "exynos4-sdhci.1",
465 .parent = &exynos5_clk_aclk_200.clk, 465 .parent = &exynos5_clk_aclk_200.clk,
466 .enable = exynos5_clk_ip_fsys_ctrl, 466 .enable = exynos5_clk_ip_fsys_ctrl,
467 .ctrlbit = (1 << 13), 467 .ctrlbit = (1 << 13),
468 }, { 468 }, {
469 .name = "hsmmc", 469 .name = "hsmmc",
470 .devname = "s3c-sdhci.2", 470 .devname = "exynos4-sdhci.2",
471 .parent = &exynos5_clk_aclk_200.clk, 471 .parent = &exynos5_clk_aclk_200.clk,
472 .enable = exynos5_clk_ip_fsys_ctrl, 472 .enable = exynos5_clk_ip_fsys_ctrl,
473 .ctrlbit = (1 << 14), 473 .ctrlbit = (1 << 14),
474 }, { 474 }, {
475 .name = "hsmmc", 475 .name = "hsmmc",
476 .devname = "s3c-sdhci.3", 476 .devname = "exynos4-sdhci.3",
477 .parent = &exynos5_clk_aclk_200.clk, 477 .parent = &exynos5_clk_aclk_200.clk,
478 .enable = exynos5_clk_ip_fsys_ctrl, 478 .enable = exynos5_clk_ip_fsys_ctrl,
479 .ctrlbit = (1 << 15), 479 .ctrlbit = (1 << 15),
@@ -813,7 +813,7 @@ static struct clksrc_clk exynos5_clk_sclk_uart3 = {
813static struct clksrc_clk exynos5_clk_sclk_mmc0 = { 813static struct clksrc_clk exynos5_clk_sclk_mmc0 = {
814 .clk = { 814 .clk = {
815 .name = "sclk_mmc", 815 .name = "sclk_mmc",
816 .devname = "s3c-sdhci.0", 816 .devname = "exynos4-sdhci.0",
817 .parent = &exynos5_clk_dout_mmc0.clk, 817 .parent = &exynos5_clk_dout_mmc0.clk,
818 .enable = exynos5_clksrc_mask_fsys_ctrl, 818 .enable = exynos5_clksrc_mask_fsys_ctrl,
819 .ctrlbit = (1 << 0), 819 .ctrlbit = (1 << 0),
@@ -824,7 +824,7 @@ static struct clksrc_clk exynos5_clk_sclk_mmc0 = {
824static struct clksrc_clk exynos5_clk_sclk_mmc1 = { 824static struct clksrc_clk exynos5_clk_sclk_mmc1 = {
825 .clk = { 825 .clk = {
826 .name = "sclk_mmc", 826 .name = "sclk_mmc",
827 .devname = "s3c-sdhci.1", 827 .devname = "exynos4-sdhci.1",
828 .parent = &exynos5_clk_dout_mmc1.clk, 828 .parent = &exynos5_clk_dout_mmc1.clk,
829 .enable = exynos5_clksrc_mask_fsys_ctrl, 829 .enable = exynos5_clksrc_mask_fsys_ctrl,
830 .ctrlbit = (1 << 4), 830 .ctrlbit = (1 << 4),
@@ -835,7 +835,7 @@ static struct clksrc_clk exynos5_clk_sclk_mmc1 = {
835static struct clksrc_clk exynos5_clk_sclk_mmc2 = { 835static struct clksrc_clk exynos5_clk_sclk_mmc2 = {
836 .clk = { 836 .clk = {
837 .name = "sclk_mmc", 837 .name = "sclk_mmc",
838 .devname = "s3c-sdhci.2", 838 .devname = "exynos4-sdhci.2",
839 .parent = &exynos5_clk_dout_mmc2.clk, 839 .parent = &exynos5_clk_dout_mmc2.clk,
840 .enable = exynos5_clksrc_mask_fsys_ctrl, 840 .enable = exynos5_clksrc_mask_fsys_ctrl,
841 .ctrlbit = (1 << 8), 841 .ctrlbit = (1 << 8),
@@ -846,7 +846,7 @@ static struct clksrc_clk exynos5_clk_sclk_mmc2 = {
846static struct clksrc_clk exynos5_clk_sclk_mmc3 = { 846static struct clksrc_clk exynos5_clk_sclk_mmc3 = {
847 .clk = { 847 .clk = {
848 .name = "sclk_mmc", 848 .name = "sclk_mmc",
849 .devname = "s3c-sdhci.3", 849 .devname = "exynos4-sdhci.3",
850 .parent = &exynos5_clk_dout_mmc3.clk, 850 .parent = &exynos5_clk_dout_mmc3.clk,
851 .enable = exynos5_clksrc_mask_fsys_ctrl, 851 .enable = exynos5_clksrc_mask_fsys_ctrl,
852 .ctrlbit = (1 << 12), 852 .ctrlbit = (1 << 12),
@@ -990,10 +990,10 @@ static struct clk_lookup exynos5_clk_lookup[] = {
990 CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &exynos5_clk_sclk_uart1.clk), 990 CLKDEV_INIT("exynos4210-uart.1", "clk_uart_baud0", &exynos5_clk_sclk_uart1.clk),
991 CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &exynos5_clk_sclk_uart2.clk), 991 CLKDEV_INIT("exynos4210-uart.2", "clk_uart_baud0", &exynos5_clk_sclk_uart2.clk),
992 CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &exynos5_clk_sclk_uart3.clk), 992 CLKDEV_INIT("exynos4210-uart.3", "clk_uart_baud0", &exynos5_clk_sclk_uart3.clk),
993 CLKDEV_INIT("s3c-sdhci.0", "mmc_busclk.2", &exynos5_clk_sclk_mmc0.clk), 993 CLKDEV_INIT("exynos4-sdhci.0", "mmc_busclk.2", &exynos5_clk_sclk_mmc0.clk),
994 CLKDEV_INIT("s3c-sdhci.1", "mmc_busclk.2", &exynos5_clk_sclk_mmc1.clk), 994 CLKDEV_INIT("exynos4-sdhci.1", "mmc_busclk.2", &exynos5_clk_sclk_mmc1.clk),
995 CLKDEV_INIT("s3c-sdhci.2", "mmc_busclk.2", &exynos5_clk_sclk_mmc2.clk), 995 CLKDEV_INIT("exynos4-sdhci.2", "mmc_busclk.2", &exynos5_clk_sclk_mmc2.clk),
996 CLKDEV_INIT("s3c-sdhci.3", "mmc_busclk.2", &exynos5_clk_sclk_mmc3.clk), 996 CLKDEV_INIT("exynos4-sdhci.3", "mmc_busclk.2", &exynos5_clk_sclk_mmc3.clk),
997 CLKDEV_INIT("dma-pl330.0", "apb_pclk", &exynos5_clk_pdma0), 997 CLKDEV_INIT("dma-pl330.0", "apb_pclk", &exynos5_clk_pdma0),
998 CLKDEV_INIT("dma-pl330.1", "apb_pclk", &exynos5_clk_pdma1), 998 CLKDEV_INIT("dma-pl330.1", "apb_pclk", &exynos5_clk_pdma1),
999 CLKDEV_INIT("dma-pl330.2", "apb_pclk", &exynos5_clk_mdma1), 999 CLKDEV_INIT("dma-pl330.2", "apb_pclk", &exynos5_clk_mdma1),
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 8614aab47cc0..5ccd6e80a607 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -326,6 +326,11 @@ static void __init exynos4_map_io(void)
326 s3c_fimc_setname(2, "exynos4-fimc"); 326 s3c_fimc_setname(2, "exynos4-fimc");
327 s3c_fimc_setname(3, "exynos4-fimc"); 327 s3c_fimc_setname(3, "exynos4-fimc");
328 328
329 s3c_sdhci_setname(0, "exynos4-sdhci");
330 s3c_sdhci_setname(1, "exynos4-sdhci");
331 s3c_sdhci_setname(2, "exynos4-sdhci");
332 s3c_sdhci_setname(3, "exynos4-sdhci");
333
329 /* The I2C bus controllers are directly compatible with s3c2440 */ 334 /* The I2C bus controllers are directly compatible with s3c2440 */
330 s3c_i2c0_setname("s3c2440-i2c"); 335 s3c_i2c0_setname("s3c2440-i2c");
331 s3c_i2c1_setname("s3c2440-i2c"); 336 s3c_i2c1_setname("s3c2440-i2c");
@@ -344,6 +349,11 @@ static void __init exynos5_map_io(void)
344 s3c_device_i2c0.resource[1].start = EXYNOS5_IRQ_IIC; 349 s3c_device_i2c0.resource[1].start = EXYNOS5_IRQ_IIC;
345 s3c_device_i2c0.resource[1].end = EXYNOS5_IRQ_IIC; 350 s3c_device_i2c0.resource[1].end = EXYNOS5_IRQ_IIC;
346 351
352 s3c_sdhci_setname(0, "exynos4-sdhci");
353 s3c_sdhci_setname(1, "exynos4-sdhci");
354 s3c_sdhci_setname(2, "exynos4-sdhci");
355 s3c_sdhci_setname(3, "exynos4-sdhci");
356
347 /* The I2C bus controllers are directly compatible with s3c2440 */ 357 /* The I2C bus controllers are directly compatible with s3c2440 */
348 s3c_i2c0_setname("s3c2440-i2c"); 358 s3c_i2c0_setname("s3c2440-i2c");
349 s3c_i2c1_setname("s3c2440-i2c"); 359 s3c_i2c1_setname("s3c2440-i2c");
@@ -537,7 +547,9 @@ void __init exynos5_init_irq(void)
537{ 547{
538 int irq; 548 int irq;
539 549
540 gic_init(0, IRQ_PPI(0), S5P_VA_GIC_DIST, S5P_VA_GIC_CPU); 550#ifdef CONFIG_OF
551 of_irq_init(exynos4_dt_irq_match);
552#endif
541 553
542 for (irq = 0; irq < EXYNOS5_MAX_COMBINER_NR; irq++) { 554 for (irq = 0; irq < EXYNOS5_MAX_COMBINER_NR; irq++) {
543 combiner_init(irq, (void __iomem *)S5P_VA_COMBINER(irq), 555 combiner_init(irq, (void __iomem *)S5P_VA_COMBINER(irq),
diff --git a/arch/arm/mach-exynos/dev-dwmci.c b/arch/arm/mach-exynos/dev-dwmci.c
index b025db4bf602..79035018fb74 100644
--- a/arch/arm/mach-exynos/dev-dwmci.c
+++ b/arch/arm/mach-exynos/dev-dwmci.c
@@ -16,6 +16,7 @@
16#include <linux/dma-mapping.h> 16#include <linux/dma-mapping.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/ioport.h>
19#include <linux/mmc/dw_mmc.h> 20#include <linux/mmc/dw_mmc.h>
20 21
21#include <plat/devs.h> 22#include <plat/devs.h>
@@ -33,16 +34,8 @@ static int exynos4_dwmci_init(u32 slot_id, irq_handler_t handler, void *data)
33} 34}
34 35
35static struct resource exynos4_dwmci_resource[] = { 36static struct resource exynos4_dwmci_resource[] = {
36 [0] = { 37 [0] = DEFINE_RES_MEM(EXYNOS4_PA_DWMCI, SZ_4K),
37 .start = EXYNOS4_PA_DWMCI, 38 [1] = DEFINE_RES_IRQ(EXYNOS4_IRQ_DWMCI),
38 .end = EXYNOS4_PA_DWMCI + SZ_4K - 1,
39 .flags = IORESOURCE_MEM,
40 },
41 [1] = {
42 .start = IRQ_DWMCI,
43 .end = IRQ_DWMCI,
44 .flags = IORESOURCE_IRQ,
45 }
46}; 39};
47 40
48static struct dw_mci_board exynos4_dwci_pdata = { 41static struct dw_mci_board exynos4_dwci_pdata = {
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
index b4f1f902ce6d..ed90aef404c3 100644
--- a/arch/arm/mach-exynos/mach-nuri.c
+++ b/arch/arm/mach-exynos/mach-nuri.c
@@ -112,6 +112,7 @@ static struct s3c_sdhci_platdata nuri_hsmmc0_data __initdata = {
112 .host_caps = (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA | 112 .host_caps = (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA |
113 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | 113 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED |
114 MMC_CAP_ERASE), 114 MMC_CAP_ERASE),
115 .host_caps2 = MMC_CAP2_BROKEN_VOLTAGE,
115 .cd_type = S3C_SDHCI_CD_PERMANENT, 116 .cd_type = S3C_SDHCI_CD_PERMANENT,
116 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, 117 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
117}; 118};
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c
index 7ebf79c2ab34..cb2b027f09a6 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -747,6 +747,7 @@ static struct s3c_sdhci_platdata universal_hsmmc0_data __initdata = {
747 .max_width = 8, 747 .max_width = 8,
748 .host_caps = (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA | 748 .host_caps = (MMC_CAP_8_BIT_DATA | MMC_CAP_4_BIT_DATA |
749 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED), 749 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
750 .host_caps2 = MMC_CAP2_BROKEN_VOLTAGE,
750 .cd_type = S3C_SDHCI_CD_PERMANENT, 751 .cd_type = S3C_SDHCI_CD_PERMANENT,
751 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, 752 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
752}; 753};
diff --git a/arch/arm/mach-imx/imx27-dt.c b/arch/arm/mach-imx/imx27-dt.c
index 861ceb8232d6..ed38d03c61f2 100644
--- a/arch/arm/mach-imx/imx27-dt.c
+++ b/arch/arm/mach-imx/imx27-dt.c
@@ -35,7 +35,7 @@ static const struct of_dev_auxdata imx27_auxdata_lookup[] __initconst = {
35static int __init imx27_avic_add_irq_domain(struct device_node *np, 35static int __init imx27_avic_add_irq_domain(struct device_node *np,
36 struct device_node *interrupt_parent) 36 struct device_node *interrupt_parent)
37{ 37{
38 irq_domain_add_simple(np, 0); 38 irq_domain_add_legacy(np, 64, 0, 0, &irq_domain_simple_ops, NULL);
39 return 0; 39 return 0;
40} 40}
41 41
@@ -44,7 +44,9 @@ static int __init imx27_gpio_add_irq_domain(struct device_node *np,
44{ 44{
45 static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS; 45 static int gpio_irq_base = MXC_GPIO_IRQ_START + ARCH_NR_GPIOS;
46 46
47 irq_domain_add_simple(np, gpio_irq_base); 47 gpio_irq_base -= 32;
48 irq_domain_add_legacy(np, 32, gpio_irq_base, 0, &irq_domain_simple_ops,
49 NULL);
48 50
49 return 0; 51 return 0;
50} 52}
diff --git a/arch/arm/mach-imx/mm-imx5.c b/arch/arm/mach-imx/mm-imx5.c
index 05250aed61fb..e10f3914fcfe 100644
--- a/arch/arm/mach-imx/mm-imx5.c
+++ b/arch/arm/mach-imx/mm-imx5.c
@@ -35,7 +35,7 @@ static void imx5_idle(void)
35 } 35 }
36 clk_enable(gpc_dvfs_clk); 36 clk_enable(gpc_dvfs_clk);
37 mx5_cpu_lp_set(WAIT_UNCLOCKED_POWER_OFF); 37 mx5_cpu_lp_set(WAIT_UNCLOCKED_POWER_OFF);
38 if (tzic_enable_wake() != 0) 38 if (!tzic_enable_wake())
39 cpu_do_idle(); 39 cpu_do_idle();
40 clk_disable(gpc_dvfs_clk); 40 clk_disable(gpc_dvfs_clk);
41} 41}
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 1c672d9e6656..f7fe1b9f3170 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -14,6 +14,7 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/of.h> 15#include <linux/of.h>
16#include <linux/of_platform.h> 16#include <linux/of_platform.h>
17#include <linux/kexec.h>
17#include <asm/mach/arch.h> 18#include <asm/mach/arch.h>
18#include <asm/mach/map.h> 19#include <asm/mach/map.h>
19#include <mach/bridge-regs.h> 20#include <mach/bridge-regs.h>
diff --git a/arch/arm/mach-msm/board-msm8x60.c b/arch/arm/mach-msm/board-msm8x60.c
index 962e71169750..fb3496a52ef4 100644
--- a/arch/arm/mach-msm/board-msm8x60.c
+++ b/arch/arm/mach-msm/board-msm8x60.c
@@ -17,6 +17,7 @@
17#include <linux/irqdomain.h> 17#include <linux/irqdomain.h>
18#include <linux/of.h> 18#include <linux/of.h>
19#include <linux/of_address.h> 19#include <linux/of_address.h>
20#include <linux/of_irq.h>
20#include <linux/of_platform.h> 21#include <linux/of_platform.h>
21#include <linux/memblock.h> 22#include <linux/memblock.h>
22 23
@@ -49,10 +50,22 @@ static void __init msm8x60_map_io(void)
49 msm_map_msm8x60_io(); 50 msm_map_msm8x60_io();
50} 51}
51 52
53#ifdef CONFIG_OF
54static struct of_device_id msm_dt_gic_match[] __initdata = {
55 { .compatible = "qcom,msm-8660-qgic", .data = gic_of_init },
56 {}
57};
58#endif
59
52static void __init msm8x60_init_irq(void) 60static void __init msm8x60_init_irq(void)
53{ 61{
54 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE, 62 if (!of_have_populated_dt())
55 (void *)MSM_QGIC_CPU_BASE); 63 gic_init(0, GIC_PPI_START, MSM_QGIC_DIST_BASE,
64 (void *)MSM_QGIC_CPU_BASE);
65#ifdef CONFIG_OF
66 else
67 of_irq_init(msm_dt_gic_match);
68#endif
56 69
57 /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */ 70 /* Edge trigger PPIs except AVS_SVICINT and AVS_SVICINTSWDONE */
58 writel(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4); 71 writel(0xFFFFD7FF, MSM_QGIC_DIST_BASE + GIC_DIST_CONFIG + 4);
@@ -73,16 +86,8 @@ static struct of_dev_auxdata msm_auxdata_lookup[] __initdata = {
73 {} 86 {}
74}; 87};
75 88
76static struct of_device_id msm_dt_gic_match[] __initdata = {
77 { .compatible = "qcom,msm-8660-qgic", },
78 {}
79};
80
81static void __init msm8x60_dt_init(void) 89static void __init msm8x60_dt_init(void)
82{ 90{
83 irq_domain_generate_simple(msm_dt_gic_match, MSM8X60_QGIC_DIST_PHYS,
84 GIC_SPI_START);
85
86 if (of_machine_is_compatible("qcom,msm8660-surf")) { 91 if (of_machine_is_compatible("qcom,msm8660-surf")) {
87 printk(KERN_INFO "Init surf UART registers\n"); 92 printk(KERN_INFO "Init surf UART registers\n");
88 msm8x60_init_uart12dm(); 93 msm8x60_init_uart12dm();
diff --git a/arch/arm/mach-omap1/ams-delta-fiq.c b/arch/arm/mach-omap1/ams-delta-fiq.c
index fcce7ff37630..cfd98b186fcc 100644
--- a/arch/arm/mach-omap1/ams-delta-fiq.c
+++ b/arch/arm/mach-omap1/ams-delta-fiq.c
@@ -48,7 +48,7 @@ static irqreturn_t deferred_fiq(int irq, void *dev_id)
48 struct irq_chip *irq_chip = NULL; 48 struct irq_chip *irq_chip = NULL;
49 int gpio, irq_num, fiq_count; 49 int gpio, irq_num, fiq_count;
50 50
51 irq_desc = irq_to_desc(IH_GPIO_BASE); 51 irq_desc = irq_to_desc(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK));
52 if (irq_desc) 52 if (irq_desc)
53 irq_chip = irq_desc->irq_data.chip; 53 irq_chip = irq_desc->irq_data.chip;
54 54
diff --git a/arch/arm/mach-omap1/mux.c b/arch/arm/mach-omap1/mux.c
index 087dba0df47e..e9cc52d4cb28 100644
--- a/arch/arm/mach-omap1/mux.c
+++ b/arch/arm/mach-omap1/mux.c
@@ -27,6 +27,7 @@
27#include <linux/io.h> 27#include <linux/io.h>
28#include <linux/spinlock.h> 28#include <linux/spinlock.h>
29 29
30#include <mach/hardware.h>
30 31
31#include <plat/mux.h> 32#include <plat/mux.h>
32 33
diff --git a/arch/arm/mach-omap1/timer.c b/arch/arm/mach-omap1/timer.c
index 6e90665a7c47..fb202af01d0d 100644
--- a/arch/arm/mach-omap1/timer.c
+++ b/arch/arm/mach-omap1/timer.c
@@ -47,9 +47,9 @@ static int omap1_dm_timer_set_src(struct platform_device *pdev,
47 int n = (pdev->id - 1) << 1; 47 int n = (pdev->id - 1) << 1;
48 u32 l; 48 u32 l;
49 49
50 l = __raw_readl(MOD_CONF_CTRL_1) & ~(0x03 << n); 50 l = omap_readl(MOD_CONF_CTRL_1) & ~(0x03 << n);
51 l |= source << n; 51 l |= source << n;
52 __raw_writel(l, MOD_CONF_CTRL_1); 52 omap_writel(l, MOD_CONF_CTRL_1);
53 53
54 return 0; 54 return 0;
55} 55}
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index a39fc4bbd2b8..130ab00c09a2 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -20,6 +20,7 @@
20#include <linux/usb/otg.h> 20#include <linux/usb/otg.h>
21#include <linux/spi/spi.h> 21#include <linux/spi/spi.h>
22#include <linux/i2c/twl.h> 22#include <linux/i2c/twl.h>
23#include <linux/mfd/twl6040.h>
23#include <linux/gpio_keys.h> 24#include <linux/gpio_keys.h>
24#include <linux/regulator/machine.h> 25#include <linux/regulator/machine.h>
25#include <linux/regulator/fixed.h> 26#include <linux/regulator/fixed.h>
@@ -560,7 +561,7 @@ static struct regulator_init_data sdp4430_vusim = {
560 }, 561 },
561}; 562};
562 563
563static struct twl4030_codec_data twl6040_codec = { 564static struct twl6040_codec_data twl6040_codec = {
564 /* single-step ramp for headset and handsfree */ 565 /* single-step ramp for headset and handsfree */
565 .hs_left_step = 0x0f, 566 .hs_left_step = 0x0f,
566 .hs_right_step = 0x0f, 567 .hs_right_step = 0x0f,
@@ -568,7 +569,7 @@ static struct twl4030_codec_data twl6040_codec = {
568 .hf_right_step = 0x1d, 569 .hf_right_step = 0x1d,
569}; 570};
570 571
571static struct twl4030_vibra_data twl6040_vibra = { 572static struct twl6040_vibra_data twl6040_vibra = {
572 .vibldrv_res = 8, 573 .vibldrv_res = 8,
573 .vibrdrv_res = 3, 574 .vibrdrv_res = 3,
574 .viblmotor_res = 10, 575 .viblmotor_res = 10,
@@ -577,16 +578,14 @@ static struct twl4030_vibra_data twl6040_vibra = {
577 .vddvibr_uV = 0, /* fixed volt supply - VBAT */ 578 .vddvibr_uV = 0, /* fixed volt supply - VBAT */
578}; 579};
579 580
580static struct twl4030_audio_data twl6040_audio = { 581static struct twl6040_platform_data twl6040_data = {
581 .codec = &twl6040_codec, 582 .codec = &twl6040_codec,
582 .vibra = &twl6040_vibra, 583 .vibra = &twl6040_vibra,
583 .audpwron_gpio = 127, 584 .audpwron_gpio = 127,
584 .naudint_irq = OMAP44XX_IRQ_SYS_2N,
585 .irq_base = TWL6040_CODEC_IRQ_BASE, 585 .irq_base = TWL6040_CODEC_IRQ_BASE,
586}; 586};
587 587
588static struct twl4030_platform_data sdp4430_twldata = { 588static struct twl4030_platform_data sdp4430_twldata = {
589 .audio = &twl6040_audio,
590 /* Regulators */ 589 /* Regulators */
591 .vusim = &sdp4430_vusim, 590 .vusim = &sdp4430_vusim,
592 .vaux1 = &sdp4430_vaux1, 591 .vaux1 = &sdp4430_vaux1,
@@ -617,7 +616,8 @@ static int __init omap4_i2c_init(void)
617 TWL_COMMON_REGULATOR_VCXIO | 616 TWL_COMMON_REGULATOR_VCXIO |
618 TWL_COMMON_REGULATOR_VUSB | 617 TWL_COMMON_REGULATOR_VUSB |
619 TWL_COMMON_REGULATOR_CLK32KG); 618 TWL_COMMON_REGULATOR_CLK32KG);
620 omap4_pmic_init("twl6030", &sdp4430_twldata); 619 omap4_pmic_init("twl6030", &sdp4430_twldata,
620 &twl6040_data, OMAP44XX_IRQ_SYS_2N);
621 omap_register_i2c_bus(2, 400, NULL, 0); 621 omap_register_i2c_bus(2, 400, NULL, 0);
622 omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo, 622 omap_register_i2c_bus(3, 400, sdp4430_i2c_3_boardinfo,
623 ARRAY_SIZE(sdp4430_i2c_3_boardinfo)); 623 ARRAY_SIZE(sdp4430_i2c_3_boardinfo));
diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c
index 74e1687b5170..098d183a0086 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -137,7 +137,7 @@ static struct twl4030_platform_data sdp4430_twldata = {
137 137
138static void __init omap4_i2c_init(void) 138static void __init omap4_i2c_init(void)
139{ 139{
140 omap4_pmic_init("twl6030", &sdp4430_twldata); 140 omap4_pmic_init("twl6030", &sdp4430_twldata, NULL, 0);
141} 141}
142 142
143static void __init omap4_init(void) 143static void __init omap4_init(void)
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 930c0d380435..740cee9369ba 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -641,7 +641,7 @@ static struct regulator_consumer_supply dummy_supplies[] = {
641 641
642static void __init igep_init(void) 642static void __init igep_init(void)
643{ 643{
644 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 644 regulator_register_fixed(1, dummy_supplies, ARRAY_SIZE(dummy_supplies));
645 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 645 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
646 646
647 /* Get IGEP2 hardware revision */ 647 /* Get IGEP2 hardware revision */
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index d8c0e89f0126..1b782ba53433 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -25,6 +25,7 @@
25#include <linux/gpio.h> 25#include <linux/gpio.h>
26#include <linux/usb/otg.h> 26#include <linux/usb/otg.h>
27#include <linux/i2c/twl.h> 27#include <linux/i2c/twl.h>
28#include <linux/mfd/twl6040.h>
28#include <linux/regulator/machine.h> 29#include <linux/regulator/machine.h>
29#include <linux/regulator/fixed.h> 30#include <linux/regulator/fixed.h>
30#include <linux/wl12xx.h> 31#include <linux/wl12xx.h>
@@ -284,7 +285,7 @@ static int __init omap4_twl6030_hsmmc_init(struct omap2_hsmmc_info *controllers)
284 return 0; 285 return 0;
285} 286}
286 287
287static struct twl4030_codec_data twl6040_codec = { 288static struct twl6040_codec_data twl6040_codec = {
288 /* single-step ramp for headset and handsfree */ 289 /* single-step ramp for headset and handsfree */
289 .hs_left_step = 0x0f, 290 .hs_left_step = 0x0f,
290 .hs_right_step = 0x0f, 291 .hs_right_step = 0x0f,
@@ -292,17 +293,14 @@ static struct twl4030_codec_data twl6040_codec = {
292 .hf_right_step = 0x1d, 293 .hf_right_step = 0x1d,
293}; 294};
294 295
295static struct twl4030_audio_data twl6040_audio = { 296static struct twl6040_platform_data twl6040_data = {
296 .codec = &twl6040_codec, 297 .codec = &twl6040_codec,
297 .audpwron_gpio = 127, 298 .audpwron_gpio = 127,
298 .naudint_irq = OMAP44XX_IRQ_SYS_2N,
299 .irq_base = TWL6040_CODEC_IRQ_BASE, 299 .irq_base = TWL6040_CODEC_IRQ_BASE,
300}; 300};
301 301
302/* Panda board uses the common PMIC configuration */ 302/* Panda board uses the common PMIC configuration */
303static struct twl4030_platform_data omap4_panda_twldata = { 303static struct twl4030_platform_data omap4_panda_twldata;
304 .audio = &twl6040_audio,
305};
306 304
307/* 305/*
308 * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM 306 * Display monitor features are burnt in their EEPROM as EDID data. The EEPROM
@@ -326,7 +324,8 @@ static int __init omap4_panda_i2c_init(void)
326 TWL_COMMON_REGULATOR_VCXIO | 324 TWL_COMMON_REGULATOR_VCXIO |
327 TWL_COMMON_REGULATOR_VUSB | 325 TWL_COMMON_REGULATOR_VUSB |
328 TWL_COMMON_REGULATOR_CLK32KG); 326 TWL_COMMON_REGULATOR_CLK32KG);
329 omap4_pmic_init("twl6030", &omap4_panda_twldata); 327 omap4_pmic_init("twl6030", &omap4_panda_twldata,
328 &twl6040_data, OMAP44XX_IRQ_SYS_2N);
330 omap_register_i2c_bus(2, 400, NULL, 0); 329 omap_register_i2c_bus(2, 400, NULL, 0);
331 /* 330 /*
332 * Bus 3 is attached to the DVI port where devices like the pico DLP 331 * Bus 3 is attached to the DVI port where devices like the pico DLP
diff --git a/arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h b/arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h
index 1e2d3322f33e..c88420de1151 100644
--- a/arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h
+++ b/arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h
@@ -941,10 +941,10 @@
941#define OMAP4_DSI2_LANEENABLE_MASK (0x7 << 29) 941#define OMAP4_DSI2_LANEENABLE_MASK (0x7 << 29)
942#define OMAP4_DSI1_LANEENABLE_SHIFT 24 942#define OMAP4_DSI1_LANEENABLE_SHIFT 24
943#define OMAP4_DSI1_LANEENABLE_MASK (0x1f << 24) 943#define OMAP4_DSI1_LANEENABLE_MASK (0x1f << 24)
944#define OMAP4_DSI2_PIPD_SHIFT 19 944#define OMAP4_DSI1_PIPD_SHIFT 19
945#define OMAP4_DSI2_PIPD_MASK (0x1f << 19) 945#define OMAP4_DSI1_PIPD_MASK (0x1f << 19)
946#define OMAP4_DSI1_PIPD_SHIFT 14 946#define OMAP4_DSI2_PIPD_SHIFT 14
947#define OMAP4_DSI1_PIPD_MASK (0x1f << 14) 947#define OMAP4_DSI2_PIPD_MASK (0x1f << 14)
948 948
949/* CONTROL_MCBSPLP */ 949/* CONTROL_MCBSPLP */
950#define OMAP4_ALBCTRLRX_FSX_SHIFT 31 950#define OMAP4_ALBCTRLRX_FSX_SHIFT 31
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 2c27fdb61e66..7144ae651d3d 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1422,6 +1422,9 @@ static int _ocp_softreset(struct omap_hwmod *oh)
1422 goto dis_opt_clks; 1422 goto dis_opt_clks;
1423 _write_sysconfig(v, oh); 1423 _write_sysconfig(v, oh);
1424 1424
1425 if (oh->class->sysc->srst_udelay)
1426 udelay(oh->class->sysc->srst_udelay);
1427
1425 if (oh->class->sysc->sysc_flags & SYSS_HAS_RESET_STATUS) 1428 if (oh->class->sysc->sysc_flags & SYSS_HAS_RESET_STATUS)
1426 omap_test_timeout((omap_hwmod_read(oh, 1429 omap_test_timeout((omap_hwmod_read(oh,
1427 oh->class->sysc->syss_offs) 1430 oh->class->sysc->syss_offs)
@@ -1903,10 +1906,20 @@ void omap_hwmod_write(u32 v, struct omap_hwmod *oh, u16 reg_offs)
1903 */ 1906 */
1904int omap_hwmod_softreset(struct omap_hwmod *oh) 1907int omap_hwmod_softreset(struct omap_hwmod *oh)
1905{ 1908{
1906 if (!oh) 1909 u32 v;
1910 int ret;
1911
1912 if (!oh || !(oh->_sysc_cache))
1907 return -EINVAL; 1913 return -EINVAL;
1908 1914
1909 return _ocp_softreset(oh); 1915 v = oh->_sysc_cache;
1916 ret = _set_softreset(oh, &v);
1917 if (ret)
1918 goto error;
1919 _write_sysconfig(v, oh);
1920
1921error:
1922 return ret;
1910} 1923}
1911 1924
1912/** 1925/**
diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
index a5409ce3f323..a6bde34e443a 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c
@@ -1000,7 +1000,6 @@ static struct omap_hwmod_ocp_if omap2420_l4_core__dss_venc = {
1000 .flags = OMAP_FIREWALL_L4, 1000 .flags = OMAP_FIREWALL_L4,
1001 } 1001 }
1002 }, 1002 },
1003 .flags = OCPIF_SWSUP_IDLE,
1004 .user = OCP_USER_MPU | OCP_USER_SDMA, 1003 .user = OCP_USER_MPU | OCP_USER_SDMA,
1005}; 1004};
1006 1005
diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
index c4f56cb60d7d..04a3885f4475 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c
@@ -1049,7 +1049,6 @@ static struct omap_hwmod_ocp_if omap2430_l4_core__dss_venc = {
1049 .slave = &omap2430_dss_venc_hwmod, 1049 .slave = &omap2430_dss_venc_hwmod,
1050 .clk = "dss_ick", 1050 .clk = "dss_ick",
1051 .addr = omap2_dss_venc_addrs, 1051 .addr = omap2_dss_venc_addrs,
1052 .flags = OCPIF_SWSUP_IDLE,
1053 .user = OCP_USER_MPU | OCP_USER_SDMA, 1052 .user = OCP_USER_MPU | OCP_USER_SDMA,
1054}; 1053};
1055 1054
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 34b9766d1d23..db86ce90c69f 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -1676,7 +1676,6 @@ static struct omap_hwmod_ocp_if omap3xxx_l4_core__dss_venc = {
1676 .flags = OMAP_FIREWALL_L4, 1676 .flags = OMAP_FIREWALL_L4,
1677 } 1677 }
1678 }, 1678 },
1679 .flags = OCPIF_SWSUP_IDLE,
1680 .user = OCP_USER_MPU | OCP_USER_SDMA, 1679 .user = OCP_USER_MPU | OCP_USER_SDMA,
1681}; 1680};
1682 1681
diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
index cc9bd106a854..6abc75753e42 100644
--- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c
@@ -2594,6 +2594,15 @@ static struct omap_hwmod omap44xx_ipu_hwmod = {
2594static struct omap_hwmod_class_sysconfig omap44xx_iss_sysc = { 2594static struct omap_hwmod_class_sysconfig omap44xx_iss_sysc = {
2595 .rev_offs = 0x0000, 2595 .rev_offs = 0x0000,
2596 .sysc_offs = 0x0010, 2596 .sysc_offs = 0x0010,
2597 /*
2598 * ISS needs 100 OCP clk cycles delay after a softreset before
2599 * accessing sysconfig again.
2600 * The lowest frequency at the moment for L3 bus is 100 MHz, so
2601 * 1usec delay is needed. Add an x2 margin to be safe (2 usecs).
2602 *
2603 * TODO: Indicate errata when available.
2604 */
2605 .srst_udelay = 2,
2597 .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_RESET_STATUS | 2606 .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_RESET_STATUS |
2598 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET), 2607 SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
2599 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | 2608 .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 0cdd359a128e..9fc2f44188cb 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -108,8 +108,14 @@ static void omap_uart_set_noidle(struct platform_device *pdev)
108static void omap_uart_set_smartidle(struct platform_device *pdev) 108static void omap_uart_set_smartidle(struct platform_device *pdev)
109{ 109{
110 struct omap_device *od = to_omap_device(pdev); 110 struct omap_device *od = to_omap_device(pdev);
111 u8 idlemode;
111 112
112 omap_hwmod_set_slave_idlemode(od->hwmods[0], HWMOD_IDLEMODE_SMART); 113 if (od->hwmods[0]->class->sysc->idlemodes & SIDLE_SMART_WKUP)
114 idlemode = HWMOD_IDLEMODE_SMART_WKUP;
115 else
116 idlemode = HWMOD_IDLEMODE_SMART;
117
118 omap_hwmod_set_slave_idlemode(od->hwmods[0], idlemode);
113} 119}
114 120
115#else 121#else
@@ -120,124 +126,8 @@ static void omap_uart_set_smartidle(struct platform_device *pdev) {}
120#endif /* CONFIG_PM */ 126#endif /* CONFIG_PM */
121 127
122#ifdef CONFIG_OMAP_MUX 128#ifdef CONFIG_OMAP_MUX
123static struct omap_device_pad default_uart1_pads[] __initdata = {
124 {
125 .name = "uart1_cts.uart1_cts",
126 .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0,
127 },
128 {
129 .name = "uart1_rts.uart1_rts",
130 .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0,
131 },
132 {
133 .name = "uart1_tx.uart1_tx",
134 .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0,
135 },
136 {
137 .name = "uart1_rx.uart1_rx",
138 .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP,
139 .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0,
140 .idle = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0,
141 },
142};
143
144static struct omap_device_pad default_uart2_pads[] __initdata = {
145 {
146 .name = "uart2_cts.uart2_cts",
147 .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0,
148 },
149 {
150 .name = "uart2_rts.uart2_rts",
151 .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0,
152 },
153 {
154 .name = "uart2_tx.uart2_tx",
155 .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0,
156 },
157 {
158 .name = "uart2_rx.uart2_rx",
159 .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP,
160 .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0,
161 .idle = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0,
162 },
163};
164
165static struct omap_device_pad default_uart3_pads[] __initdata = {
166 {
167 .name = "uart3_cts_rctx.uart3_cts_rctx",
168 .enable = OMAP_PIN_INPUT_PULLUP | OMAP_MUX_MODE0,
169 },
170 {
171 .name = "uart3_rts_sd.uart3_rts_sd",
172 .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0,
173 },
174 {
175 .name = "uart3_tx_irtx.uart3_tx_irtx",
176 .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0,
177 },
178 {
179 .name = "uart3_rx_irrx.uart3_rx_irrx",
180 .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP,
181 .enable = OMAP_PIN_INPUT | OMAP_MUX_MODE0,
182 .idle = OMAP_PIN_INPUT | OMAP_MUX_MODE0,
183 },
184};
185
186static struct omap_device_pad default_omap36xx_uart4_pads[] __initdata = {
187 {
188 .name = "gpmc_wait2.uart4_tx",
189 .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0,
190 },
191 {
192 .name = "gpmc_wait3.uart4_rx",
193 .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP,
194 .enable = OMAP_PIN_INPUT | OMAP_MUX_MODE2,
195 .idle = OMAP_PIN_INPUT | OMAP_MUX_MODE2,
196 },
197};
198
199static struct omap_device_pad default_omap4_uart4_pads[] __initdata = {
200 {
201 .name = "uart4_tx.uart4_tx",
202 .enable = OMAP_PIN_OUTPUT | OMAP_MUX_MODE0,
203 },
204 {
205 .name = "uart4_rx.uart4_rx",
206 .flags = OMAP_DEVICE_PAD_REMUX | OMAP_DEVICE_PAD_WAKEUP,
207 .enable = OMAP_PIN_INPUT | OMAP_MUX_MODE0,
208 .idle = OMAP_PIN_INPUT | OMAP_MUX_MODE0,
209 },
210};
211
212static void omap_serial_fill_default_pads(struct omap_board_data *bdata) 129static void omap_serial_fill_default_pads(struct omap_board_data *bdata)
213{ 130{
214 switch (bdata->id) {
215 case 0:
216 bdata->pads = default_uart1_pads;
217 bdata->pads_cnt = ARRAY_SIZE(default_uart1_pads);
218 break;
219 case 1:
220 bdata->pads = default_uart2_pads;
221 bdata->pads_cnt = ARRAY_SIZE(default_uart2_pads);
222 break;
223 case 2:
224 bdata->pads = default_uart3_pads;
225 bdata->pads_cnt = ARRAY_SIZE(default_uart3_pads);
226 break;
227 case 3:
228 if (cpu_is_omap44xx()) {
229 bdata->pads = default_omap4_uart4_pads;
230 bdata->pads_cnt =
231 ARRAY_SIZE(default_omap4_uart4_pads);
232 } else if (cpu_is_omap3630()) {
233 bdata->pads = default_omap36xx_uart4_pads;
234 bdata->pads_cnt =
235 ARRAY_SIZE(default_omap36xx_uart4_pads);
236 }
237 break;
238 default:
239 break;
240 }
241} 131}
242#else 132#else
243static void omap_serial_fill_default_pads(struct omap_board_data *bdata) {} 133static void omap_serial_fill_default_pads(struct omap_board_data *bdata) {}
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index 4b57757bf9d1..7a7b89304c48 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -37,6 +37,16 @@ static struct i2c_board_info __initdata pmic_i2c_board_info = {
37 .flags = I2C_CLIENT_WAKE, 37 .flags = I2C_CLIENT_WAKE,
38}; 38};
39 39
40static struct i2c_board_info __initdata omap4_i2c1_board_info[] = {
41 {
42 .addr = 0x48,
43 .flags = I2C_CLIENT_WAKE,
44 },
45 {
46 I2C_BOARD_INFO("twl6040", 0x4b),
47 },
48};
49
40void __init omap_pmic_init(int bus, u32 clkrate, 50void __init omap_pmic_init(int bus, u32 clkrate,
41 const char *pmic_type, int pmic_irq, 51 const char *pmic_type, int pmic_irq,
42 struct twl4030_platform_data *pmic_data) 52 struct twl4030_platform_data *pmic_data)
@@ -49,14 +59,31 @@ void __init omap_pmic_init(int bus, u32 clkrate,
49 omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1); 59 omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1);
50} 60}
51 61
62void __init omap4_pmic_init(const char *pmic_type,
63 struct twl4030_platform_data *pmic_data,
64 struct twl6040_platform_data *twl6040_data, int twl6040_irq)
65{
66 /* PMIC part*/
67 strncpy(omap4_i2c1_board_info[0].type, pmic_type,
68 sizeof(omap4_i2c1_board_info[0].type));
69 omap4_i2c1_board_info[0].irq = OMAP44XX_IRQ_SYS_1N;
70 omap4_i2c1_board_info[0].platform_data = pmic_data;
71
72 /* TWL6040 audio IC part */
73 omap4_i2c1_board_info[1].irq = twl6040_irq;
74 omap4_i2c1_board_info[1].platform_data = twl6040_data;
75
76 omap_register_i2c_bus(1, 400, omap4_i2c1_board_info, 2);
77
78}
79
52void __init omap_pmic_late_init(void) 80void __init omap_pmic_late_init(void)
53{ 81{
54 /* Init the OMAP TWL parameters (if PMIC has been registerd) */ 82 /* Init the OMAP TWL parameters (if PMIC has been registerd) */
55 if (!pmic_i2c_board_info.irq) 83 if (pmic_i2c_board_info.irq)
56 return; 84 omap3_twl_init();
57 85 if (omap4_i2c1_board_info[0].irq)
58 omap3_twl_init(); 86 omap4_twl_init();
59 omap4_twl_init();
60} 87}
61 88
62#if defined(CONFIG_ARCH_OMAP3) 89#if defined(CONFIG_ARCH_OMAP3)
diff --git a/arch/arm/mach-omap2/twl-common.h b/arch/arm/mach-omap2/twl-common.h
index 275dde8cb27a..09627483a57f 100644
--- a/arch/arm/mach-omap2/twl-common.h
+++ b/arch/arm/mach-omap2/twl-common.h
@@ -29,6 +29,7 @@
29 29
30 30
31struct twl4030_platform_data; 31struct twl4030_platform_data;
32struct twl6040_platform_data;
32 33
33void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq, 34void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int pmic_irq,
34 struct twl4030_platform_data *pmic_data); 35 struct twl4030_platform_data *pmic_data);
@@ -46,12 +47,9 @@ static inline void omap3_pmic_init(const char *pmic_type,
46 omap_pmic_init(1, 2600, pmic_type, INT_34XX_SYS_NIRQ, pmic_data); 47 omap_pmic_init(1, 2600, pmic_type, INT_34XX_SYS_NIRQ, pmic_data);
47} 48}
48 49
49static inline void omap4_pmic_init(const char *pmic_type, 50void omap4_pmic_init(const char *pmic_type,
50 struct twl4030_platform_data *pmic_data) 51 struct twl4030_platform_data *pmic_data,
51{ 52 struct twl6040_platform_data *audio_data, int twl6040_irq);
52 /* Phoenix Audio IC needs I2C1 to start with 400 KHz or less */
53 omap_pmic_init(1, 400, pmic_type, OMAP44XX_IRQ_SYS_1N, pmic_data);
54}
55 53
56void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data, 54void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
57 u32 pdata_flags, u32 regulators_flags); 55 u32 pdata_flags, u32 regulators_flags);
diff --git a/arch/arm/mach-orion5x/mpp.h b/arch/arm/mach-orion5x/mpp.h
index eac68978a2c2..db70e79a1198 100644
--- a/arch/arm/mach-orion5x/mpp.h
+++ b/arch/arm/mach-orion5x/mpp.h
@@ -65,8 +65,8 @@
65#define MPP8_GIGE MPP(8, 0x1, 0, 0, 1, 1, 1) 65#define MPP8_GIGE MPP(8, 0x1, 0, 0, 1, 1, 1)
66 66
67#define MPP9_UNUSED MPP(9, 0x0, 0, 0, 1, 1, 1) 67#define MPP9_UNUSED MPP(9, 0x0, 0, 0, 1, 1, 1)
68#define MPP9_GPIO MPP(9, 0x0, 0, 0, 1, 1, 1) 68#define MPP9_GPIO MPP(9, 0x0, 1, 1, 1, 1, 1)
69#define MPP9_GIGE MPP(9, 0x1, 1, 1, 1, 1, 1) 69#define MPP9_GIGE MPP(9, 0x1, 0, 0, 1, 1, 1)
70 70
71#define MPP10_UNUSED MPP(10, 0x0, 0, 0, 1, 1, 1) 71#define MPP10_UNUSED MPP(10, 0x0, 0, 0, 1, 1, 1)
72#define MPP10_GPIO MPP(10, 0x0, 1, 1, 1, 1, 1) 72#define MPP10_GPIO MPP(10, 0x0, 1, 1, 1, 1, 1)
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h b/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h
index c54cef25895c..cbf51ae81855 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa2xx.h
@@ -17,6 +17,7 @@
17 * 17 *
18 * bit 23 - Input/Output (PXA2xx specific) 18 * bit 23 - Input/Output (PXA2xx specific)
19 * bit 24 - Wakeup Enable(PXA2xx specific) 19 * bit 24 - Wakeup Enable(PXA2xx specific)
20 * bit 25 - Keep Output (PXA2xx specific)
20 */ 21 */
21 22
22#define MFP_DIR_IN (0x0 << 23) 23#define MFP_DIR_IN (0x0 << 23)
@@ -25,6 +26,12 @@
25#define MFP_DIR(x) (((x) >> 23) & 0x1) 26#define MFP_DIR(x) (((x) >> 23) & 0x1)
26 27
27#define MFP_LPM_CAN_WAKEUP (0x1 << 24) 28#define MFP_LPM_CAN_WAKEUP (0x1 << 24)
29
30/*
31 * MFP_LPM_KEEP_OUTPUT must be specified for pins that need to
32 * retain their last output level (low or high).
33 * Note: MFP_LPM_KEEP_OUTPUT has no effect on pins configured for input.
34 */
28#define MFP_LPM_KEEP_OUTPUT (0x1 << 25) 35#define MFP_LPM_KEEP_OUTPUT (0x1 << 25)
29 36
30#define WAKEUP_ON_EDGE_RISE (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_RISE) 37#define WAKEUP_ON_EDGE_RISE (MFP_LPM_CAN_WAKEUP | MFP_LPM_EDGE_RISE)
diff --git a/arch/arm/mach-pxa/mfp-pxa2xx.c b/arch/arm/mach-pxa/mfp-pxa2xx.c
index b0a842887780..ef0426a159d4 100644
--- a/arch/arm/mach-pxa/mfp-pxa2xx.c
+++ b/arch/arm/mach-pxa/mfp-pxa2xx.c
@@ -33,6 +33,8 @@
33#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2)) 33#define BANK_OFF(n) (((n) < 3) ? (n) << 2 : 0x100 + (((n) - 3) << 2))
34#define GPLR(x) __REG2(0x40E00000, BANK_OFF((x) >> 5)) 34#define GPLR(x) __REG2(0x40E00000, BANK_OFF((x) >> 5))
35#define GPDR(x) __REG2(0x40E00000, BANK_OFF((x) >> 5) + 0x0c) 35#define GPDR(x) __REG2(0x40E00000, BANK_OFF((x) >> 5) + 0x0c)
36#define GPSR(x) __REG2(0x40E00000, BANK_OFF((x) >> 5) + 0x18)
37#define GPCR(x) __REG2(0x40E00000, BANK_OFF((x) >> 5) + 0x24)
36 38
37#define PWER_WE35 (1 << 24) 39#define PWER_WE35 (1 << 24)
38 40
@@ -348,6 +350,7 @@ static inline void pxa27x_mfp_init(void) {}
348#ifdef CONFIG_PM 350#ifdef CONFIG_PM
349static unsigned long saved_gafr[2][4]; 351static unsigned long saved_gafr[2][4];
350static unsigned long saved_gpdr[4]; 352static unsigned long saved_gpdr[4];
353static unsigned long saved_gplr[4];
351static unsigned long saved_pgsr[4]; 354static unsigned long saved_pgsr[4];
352 355
353static int pxa2xx_mfp_suspend(void) 356static int pxa2xx_mfp_suspend(void)
@@ -366,14 +369,26 @@ static int pxa2xx_mfp_suspend(void)
366 } 369 }
367 370
368 for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) { 371 for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) {
369
370 saved_gafr[0][i] = GAFR_L(i); 372 saved_gafr[0][i] = GAFR_L(i);
371 saved_gafr[1][i] = GAFR_U(i); 373 saved_gafr[1][i] = GAFR_U(i);
372 saved_gpdr[i] = GPDR(i * 32); 374 saved_gpdr[i] = GPDR(i * 32);
375 saved_gplr[i] = GPLR(i * 32);
373 saved_pgsr[i] = PGSR(i); 376 saved_pgsr[i] = PGSR(i);
374 377
375 GPDR(i * 32) = gpdr_lpm[i]; 378 GPSR(i * 32) = PGSR(i);
379 GPCR(i * 32) = ~PGSR(i);
380 }
381
382 /* set GPDR bits taking into account MFP_LPM_KEEP_OUTPUT */
383 for (i = 0; i < pxa_last_gpio; i++) {
384 if ((gpdr_lpm[gpio_to_bank(i)] & GPIO_bit(i)) ||
385 ((gpio_desc[i].config & MFP_LPM_KEEP_OUTPUT) &&
386 (saved_gpdr[gpio_to_bank(i)] & GPIO_bit(i))))
387 GPDR(i) |= GPIO_bit(i);
388 else
389 GPDR(i) &= ~GPIO_bit(i);
376 } 390 }
391
377 return 0; 392 return 0;
378} 393}
379 394
@@ -384,6 +399,8 @@ static void pxa2xx_mfp_resume(void)
384 for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) { 399 for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) {
385 GAFR_L(i) = saved_gafr[0][i]; 400 GAFR_L(i) = saved_gafr[0][i];
386 GAFR_U(i) = saved_gafr[1][i]; 401 GAFR_U(i) = saved_gafr[1][i];
402 GPSR(i * 32) = saved_gplr[i];
403 GPCR(i * 32) = ~saved_gplr[i];
387 GPDR(i * 32) = saved_gpdr[i]; 404 GPDR(i * 32) = saved_gpdr[i];
388 PGSR(i) = saved_pgsr[i]; 405 PGSR(i) = saved_pgsr[i];
389 } 406 }
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 6bce78edce7a..4726c246dcdc 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -421,8 +421,11 @@ void __init pxa27x_set_i2c_power_info(struct i2c_pxa_platform_data *info)
421 pxa_register_device(&pxa27x_device_i2c_power, info); 421 pxa_register_device(&pxa27x_device_i2c_power, info);
422} 422}
423 423
424static struct pxa_gpio_platform_data pxa27x_gpio_info __initdata = {
425 .gpio_set_wake = gpio_set_wake,
426};
427
424static struct platform_device *devices[] __initdata = { 428static struct platform_device *devices[] __initdata = {
425 &pxa_device_gpio,
426 &pxa27x_device_udc, 429 &pxa27x_device_udc,
427 &pxa_device_pmu, 430 &pxa_device_pmu,
428 &pxa_device_i2s, 431 &pxa_device_i2s,
@@ -458,6 +461,7 @@ static int __init pxa27x_init(void)
458 register_syscore_ops(&pxa2xx_mfp_syscore_ops); 461 register_syscore_ops(&pxa2xx_mfp_syscore_ops);
459 register_syscore_ops(&pxa2xx_clock_syscore_ops); 462 register_syscore_ops(&pxa2xx_clock_syscore_ops);
460 463
464 pxa_register_device(&pxa_device_gpio, &pxa27x_gpio_info);
461 ret = platform_add_devices(devices, ARRAY_SIZE(devices)); 465 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
462 } 466 }
463 467
diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig
index 0f3a327ebcaa..b34287ab5afd 100644
--- a/arch/arm/mach-s3c24xx/Kconfig
+++ b/arch/arm/mach-s3c24xx/Kconfig
@@ -111,10 +111,6 @@ config S3C24XX_SETUP_TS
111 help 111 help
112 Compile in platform device definition for Samsung TouchScreen. 112 Compile in platform device definition for Samsung TouchScreen.
113 113
114# cpu-specific sections
115
116if CPU_S3C2410
117
118config S3C2410_DMA 114config S3C2410_DMA
119 bool 115 bool
120 depends on S3C24XX_DMA && (CPU_S3C2410 || CPU_S3C2442) 116 depends on S3C24XX_DMA && (CPU_S3C2410 || CPU_S3C2442)
@@ -127,6 +123,10 @@ config S3C2410_PM
127 help 123 help
128 Power Management code common to S3C2410 and better 124 Power Management code common to S3C2410 and better
129 125
126# cpu-specific sections
127
128if CPU_S3C2410
129
130config S3C24XX_SIMTEC_NOR 130config S3C24XX_SIMTEC_NOR
131 bool 131 bool
132 help 132 help
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c
index a8933de3d627..32395664e879 100644
--- a/arch/arm/mach-s5pv210/mach-goni.c
+++ b/arch/arm/mach-s5pv210/mach-goni.c
@@ -25,6 +25,7 @@
25#include <linux/gpio_keys.h> 25#include <linux/gpio_keys.h>
26#include <linux/input.h> 26#include <linux/input.h>
27#include <linux/gpio.h> 27#include <linux/gpio.h>
28#include <linux/mmc/host.h>
28#include <linux/interrupt.h> 29#include <linux/interrupt.h>
29 30
30#include <asm/hardware/vic.h> 31#include <asm/hardware/vic.h>
@@ -765,6 +766,7 @@ static void __init goni_pmic_init(void)
765/* MoviNAND */ 766/* MoviNAND */
766static struct s3c_sdhci_platdata goni_hsmmc0_data __initdata = { 767static struct s3c_sdhci_platdata goni_hsmmc0_data __initdata = {
767 .max_width = 4, 768 .max_width = 4,
769 .host_caps2 = MMC_CAP2_BROKEN_VOLTAGE,
768 .cd_type = S3C_SDHCI_CD_PERMANENT, 770 .cd_type = S3C_SDHCI_CD_PERMANENT,
769}; 771};
770 772
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index 7c524b4e415d..16be4c56abe3 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -306,7 +306,7 @@ void sa11x0_register_irda(struct irda_platform_data *irda)
306} 306}
307 307
308static struct resource sa1100_rtc_resources[] = { 308static struct resource sa1100_rtc_resources[] = {
309 DEFINE_RES_MEM(0x90010000, 0x9001003f), 309 DEFINE_RES_MEM(0x90010000, 0x40),
310 DEFINE_RES_IRQ_NAMED(IRQ_RTC1Hz, "rtc 1Hz"), 310 DEFINE_RES_IRQ_NAMED(IRQ_RTC1Hz, "rtc 1Hz"),
311 DEFINE_RES_IRQ_NAMED(IRQ_RTCAlrm, "rtc alarm"), 311 DEFINE_RES_IRQ_NAMED(IRQ_RTCAlrm, "rtc alarm"),
312}; 312};
diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c
index 1621ad07d284..33339745d432 100644
--- a/arch/arm/mach-u300/core.c
+++ b/arch/arm/mach-u300/core.c
@@ -1667,8 +1667,10 @@ void __init u300_init_irq(void)
1667 1667
1668 for (i = 0; i < U300_VIC_IRQS_END; i++) 1668 for (i = 0; i < U300_VIC_IRQS_END; i++)
1669 set_bit(i, (unsigned long *) &mask[0]); 1669 set_bit(i, (unsigned long *) &mask[0]);
1670 vic_init((void __iomem *) U300_INTCON0_VBASE, 0, mask[0], mask[0]); 1670 vic_init((void __iomem *) U300_INTCON0_VBASE, IRQ_U300_INTCON0_START,
1671 vic_init((void __iomem *) U300_INTCON1_VBASE, 32, mask[1], mask[1]); 1671 mask[0], mask[0]);
1672 vic_init((void __iomem *) U300_INTCON1_VBASE, IRQ_U300_INTCON1_START,
1673 mask[1], mask[1]);
1672} 1674}
1673 1675
1674 1676
diff --git a/arch/arm/mach-u300/i2c.c b/arch/arm/mach-u300/i2c.c
index a38f80238ea9..cb04bd6ab3e7 100644
--- a/arch/arm/mach-u300/i2c.c
+++ b/arch/arm/mach-u300/i2c.c
@@ -146,9 +146,6 @@ static struct ab3100_platform_data ab3100_plf_data = {
146 .min_uV = 1800000, 146 .min_uV = 1800000,
147 .max_uV = 1800000, 147 .max_uV = 1800000,
148 .valid_modes_mask = REGULATOR_MODE_NORMAL, 148 .valid_modes_mask = REGULATOR_MODE_NORMAL,
149 .valid_ops_mask =
150 REGULATOR_CHANGE_VOLTAGE |
151 REGULATOR_CHANGE_STATUS,
152 .always_on = 1, 149 .always_on = 1,
153 .boot_on = 1, 150 .boot_on = 1,
154 }, 151 },
@@ -160,9 +157,6 @@ static struct ab3100_platform_data ab3100_plf_data = {
160 .min_uV = 2500000, 157 .min_uV = 2500000,
161 .max_uV = 2500000, 158 .max_uV = 2500000,
162 .valid_modes_mask = REGULATOR_MODE_NORMAL, 159 .valid_modes_mask = REGULATOR_MODE_NORMAL,
163 .valid_ops_mask =
164 REGULATOR_CHANGE_VOLTAGE |
165 REGULATOR_CHANGE_STATUS,
166 .always_on = 1, 160 .always_on = 1,
167 .boot_on = 1, 161 .boot_on = 1,
168 }, 162 },
@@ -230,8 +224,7 @@ static struct ab3100_platform_data ab3100_plf_data = {
230 .max_uV = 1800000, 224 .max_uV = 1800000,
231 .valid_modes_mask = REGULATOR_MODE_NORMAL, 225 .valid_modes_mask = REGULATOR_MODE_NORMAL,
232 .valid_ops_mask = 226 .valid_ops_mask =
233 REGULATOR_CHANGE_VOLTAGE | 227 REGULATOR_CHANGE_VOLTAGE,
234 REGULATOR_CHANGE_STATUS,
235 .always_on = 1, 228 .always_on = 1,
236 .boot_on = 1, 229 .boot_on = 1,
237 }, 230 },
diff --git a/arch/arm/mach-u300/include/mach/irqs.h b/arch/arm/mach-u300/include/mach/irqs.h
index ee78a26707eb..ec09c1e07b1a 100644
--- a/arch/arm/mach-u300/include/mach/irqs.h
+++ b/arch/arm/mach-u300/include/mach/irqs.h
@@ -12,101 +12,101 @@
12#ifndef __MACH_IRQS_H 12#ifndef __MACH_IRQS_H
13#define __MACH_IRQS_H 13#define __MACH_IRQS_H
14 14
15#define IRQ_U300_INTCON0_START 0 15#define IRQ_U300_INTCON0_START 1
16#define IRQ_U300_INTCON1_START 32 16#define IRQ_U300_INTCON1_START 33
17/* These are on INTCON0 - 30 lines */ 17/* These are on INTCON0 - 30 lines */
18#define IRQ_U300_IRQ0_EXT 0 18#define IRQ_U300_IRQ0_EXT 1
19#define IRQ_U300_IRQ1_EXT 1 19#define IRQ_U300_IRQ1_EXT 2
20#define IRQ_U300_DMA 2 20#define IRQ_U300_DMA 3
21#define IRQ_U300_VIDEO_ENC_0 3 21#define IRQ_U300_VIDEO_ENC_0 4
22#define IRQ_U300_VIDEO_ENC_1 4 22#define IRQ_U300_VIDEO_ENC_1 5
23#define IRQ_U300_AAIF_RX 5 23#define IRQ_U300_AAIF_RX 6
24#define IRQ_U300_AAIF_TX 6 24#define IRQ_U300_AAIF_TX 7
25#define IRQ_U300_AAIF_VGPIO 7 25#define IRQ_U300_AAIF_VGPIO 8
26#define IRQ_U300_AAIF_WAKEUP 8 26#define IRQ_U300_AAIF_WAKEUP 9
27#define IRQ_U300_PCM_I2S0_FRAME 9 27#define IRQ_U300_PCM_I2S0_FRAME 10
28#define IRQ_U300_PCM_I2S0_FIFO 10 28#define IRQ_U300_PCM_I2S0_FIFO 11
29#define IRQ_U300_PCM_I2S1_FRAME 11 29#define IRQ_U300_PCM_I2S1_FRAME 12
30#define IRQ_U300_PCM_I2S1_FIFO 12 30#define IRQ_U300_PCM_I2S1_FIFO 13
31#define IRQ_U300_XGAM_GAMCON 13 31#define IRQ_U300_XGAM_GAMCON 14
32#define IRQ_U300_XGAM_CDI 14 32#define IRQ_U300_XGAM_CDI 15
33#define IRQ_U300_XGAM_CDICON 15 33#define IRQ_U300_XGAM_CDICON 16
34#if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330) 34#if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330)
35/* MMIACC not used on the DB3210 or DB3350 chips */ 35/* MMIACC not used on the DB3210 or DB3350 chips */
36#define IRQ_U300_XGAM_MMIACC 16 36#define IRQ_U300_XGAM_MMIACC 17
37#endif 37#endif
38#define IRQ_U300_XGAM_PDI 17 38#define IRQ_U300_XGAM_PDI 18
39#define IRQ_U300_XGAM_PDICON 18 39#define IRQ_U300_XGAM_PDICON 19
40#define IRQ_U300_XGAM_GAMEACC 19 40#define IRQ_U300_XGAM_GAMEACC 20
41#define IRQ_U300_XGAM_MCIDCT 20 41#define IRQ_U300_XGAM_MCIDCT 21
42#define IRQ_U300_APEX 21 42#define IRQ_U300_APEX 22
43#define IRQ_U300_UART0 22 43#define IRQ_U300_UART0 23
44#define IRQ_U300_SPI 23 44#define IRQ_U300_SPI 24
45#define IRQ_U300_TIMER_APP_OS 24 45#define IRQ_U300_TIMER_APP_OS 25
46#define IRQ_U300_TIMER_APP_DD 25 46#define IRQ_U300_TIMER_APP_DD 26
47#define IRQ_U300_TIMER_APP_GP1 26 47#define IRQ_U300_TIMER_APP_GP1 27
48#define IRQ_U300_TIMER_APP_GP2 27 48#define IRQ_U300_TIMER_APP_GP2 28
49#define IRQ_U300_TIMER_OS 28 49#define IRQ_U300_TIMER_OS 29
50#define IRQ_U300_TIMER_MS 29 50#define IRQ_U300_TIMER_MS 30
51#define IRQ_U300_KEYPAD_KEYBF 30 51#define IRQ_U300_KEYPAD_KEYBF 31
52#define IRQ_U300_KEYPAD_KEYBR 31 52#define IRQ_U300_KEYPAD_KEYBR 32
53/* These are on INTCON1 - 32 lines */ 53/* These are on INTCON1 - 32 lines */
54#define IRQ_U300_GPIO_PORT0 32 54#define IRQ_U300_GPIO_PORT0 33
55#define IRQ_U300_GPIO_PORT1 33 55#define IRQ_U300_GPIO_PORT1 34
56#define IRQ_U300_GPIO_PORT2 34 56#define IRQ_U300_GPIO_PORT2 35
57 57
58#if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330) || \ 58#if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330) || \
59 defined(CONFIG_MACH_U300_BS335) 59 defined(CONFIG_MACH_U300_BS335)
60/* These are for DB3150, DB3200 and DB3350 */ 60/* These are for DB3150, DB3200 and DB3350 */
61#define IRQ_U300_WDOG 35 61#define IRQ_U300_WDOG 36
62#define IRQ_U300_EVHIST 36 62#define IRQ_U300_EVHIST 37
63#define IRQ_U300_MSPRO 37 63#define IRQ_U300_MSPRO 38
64#define IRQ_U300_MMCSD_MCIINTR0 38 64#define IRQ_U300_MMCSD_MCIINTR0 39
65#define IRQ_U300_MMCSD_MCIINTR1 39 65#define IRQ_U300_MMCSD_MCIINTR1 40
66#define IRQ_U300_I2C0 40 66#define IRQ_U300_I2C0 41
67#define IRQ_U300_I2C1 41 67#define IRQ_U300_I2C1 42
68#define IRQ_U300_RTC 42 68#define IRQ_U300_RTC 43
69#define IRQ_U300_NFIF 43 69#define IRQ_U300_NFIF 44
70#define IRQ_U300_NFIF2 44 70#define IRQ_U300_NFIF2 45
71#endif 71#endif
72 72
73/* DB3150 and DB3200 have only 45 IRQs */ 73/* DB3150 and DB3200 have only 45 IRQs */
74#if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330) 74#if defined(CONFIG_MACH_U300_BS2X) || defined(CONFIG_MACH_U300_BS330)
75#define U300_VIC_IRQS_END 45 75#define U300_VIC_IRQS_END 46
76#endif 76#endif
77 77
78/* The DB3350-specific interrupt lines */ 78/* The DB3350-specific interrupt lines */
79#ifdef CONFIG_MACH_U300_BS335 79#ifdef CONFIG_MACH_U300_BS335
80#define IRQ_U300_ISP_F0 45 80#define IRQ_U300_ISP_F0 46
81#define IRQ_U300_ISP_F1 46 81#define IRQ_U300_ISP_F1 47
82#define IRQ_U300_ISP_F2 47 82#define IRQ_U300_ISP_F2 48
83#define IRQ_U300_ISP_F3 48 83#define IRQ_U300_ISP_F3 49
84#define IRQ_U300_ISP_F4 49 84#define IRQ_U300_ISP_F4 50
85#define IRQ_U300_GPIO_PORT3 50 85#define IRQ_U300_GPIO_PORT3 51
86#define IRQ_U300_SYSCON_PLL_LOCK 51 86#define IRQ_U300_SYSCON_PLL_LOCK 52
87#define IRQ_U300_UART1 52 87#define IRQ_U300_UART1 53
88#define IRQ_U300_GPIO_PORT4 53 88#define IRQ_U300_GPIO_PORT4 54
89#define IRQ_U300_GPIO_PORT5 54 89#define IRQ_U300_GPIO_PORT5 55
90#define IRQ_U300_GPIO_PORT6 55 90#define IRQ_U300_GPIO_PORT6 56
91#define U300_VIC_IRQS_END 56 91#define U300_VIC_IRQS_END 57
92#endif 92#endif
93 93
94/* The DB3210-specific interrupt lines */ 94/* The DB3210-specific interrupt lines */
95#ifdef CONFIG_MACH_U300_BS365 95#ifdef CONFIG_MACH_U300_BS365
96#define IRQ_U300_GPIO_PORT3 35 96#define IRQ_U300_GPIO_PORT3 36
97#define IRQ_U300_GPIO_PORT4 36 97#define IRQ_U300_GPIO_PORT4 37
98#define IRQ_U300_WDOG 37 98#define IRQ_U300_WDOG 38
99#define IRQ_U300_EVHIST 38 99#define IRQ_U300_EVHIST 39
100#define IRQ_U300_MSPRO 39 100#define IRQ_U300_MSPRO 40
101#define IRQ_U300_MMCSD_MCIINTR0 40 101#define IRQ_U300_MMCSD_MCIINTR0 41
102#define IRQ_U300_MMCSD_MCIINTR1 41 102#define IRQ_U300_MMCSD_MCIINTR1 42
103#define IRQ_U300_I2C0 42 103#define IRQ_U300_I2C0 43
104#define IRQ_U300_I2C1 43 104#define IRQ_U300_I2C1 44
105#define IRQ_U300_RTC 44 105#define IRQ_U300_RTC 45
106#define IRQ_U300_NFIF 45 106#define IRQ_U300_NFIF 46
107#define IRQ_U300_NFIF2 46 107#define IRQ_U300_NFIF2 47
108#define IRQ_U300_SYSCON_PLL_LOCK 47 108#define IRQ_U300_SYSCON_PLL_LOCK 48
109#define U300_VIC_IRQS_END 48 109#define U300_VIC_IRQS_END 49
110#endif 110#endif
111 111
112/* Maximum 8*7 GPIO lines */ 112/* Maximum 8*7 GPIO lines */
@@ -117,6 +117,6 @@
117#define IRQ_U300_GPIO_END (U300_VIC_IRQS_END) 117#define IRQ_U300_GPIO_END (U300_VIC_IRQS_END)
118#endif 118#endif
119 119
120#define NR_IRQS (IRQ_U300_GPIO_END) 120#define NR_IRQS (IRQ_U300_GPIO_END - IRQ_U300_INTCON0_START)
121 121
122#endif 122#endif
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig
index 880d02ec89d4..ef7099eea0f2 100644
--- a/arch/arm/mach-ux500/Kconfig
+++ b/arch/arm/mach-ux500/Kconfig
@@ -17,6 +17,7 @@ config UX500_SOC_DB5500
17config UX500_SOC_DB8500 17config UX500_SOC_DB8500
18 bool 18 bool
19 select MFD_DB8500_PRCMU 19 select MFD_DB8500_PRCMU
20 select REGULATOR
20 select REGULATOR_DB8500_PRCMU 21 select REGULATOR_DB8500_PRCMU
21 select CPU_FREQ_TABLE if CPU_FREQ 22 select CPU_FREQ_TABLE if CPU_FREQ
22 23
diff --git a/arch/arm/mach-ux500/mbox-db5500.c b/arch/arm/mach-ux500/mbox-db5500.c
index 2b2d51caf9d8..0127490218cd 100644
--- a/arch/arm/mach-ux500/mbox-db5500.c
+++ b/arch/arm/mach-ux500/mbox-db5500.c
@@ -168,7 +168,7 @@ static ssize_t mbox_read_fifo(struct device *dev,
168 return sprintf(buf, "0x%X\n", mbox_value); 168 return sprintf(buf, "0x%X\n", mbox_value);
169} 169}
170 170
171static DEVICE_ATTR(fifo, S_IWUGO | S_IRUGO, mbox_read_fifo, mbox_write_fifo); 171static DEVICE_ATTR(fifo, S_IWUSR | S_IRUGO, mbox_read_fifo, mbox_write_fifo);
172 172
173static int mbox_show(struct seq_file *s, void *data) 173static int mbox_show(struct seq_file *s, void *data)
174{ 174{
diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c
index d2058ef8345f..eff5842f6232 100644
--- a/arch/arm/mach-ux500/platsmp.c
+++ b/arch/arm/mach-ux500/platsmp.c
@@ -99,7 +99,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
99 */ 99 */
100 write_pen_release(cpu_logical_map(cpu)); 100 write_pen_release(cpu_logical_map(cpu));
101 101
102 gic_raise_softirq(cpumask_of(cpu), 1); 102 smp_send_reschedule(cpu);
103 103
104 timeout = jiffies + (1 * HZ); 104 timeout = jiffies + (1 * HZ);
105 while (time_before(jiffies, timeout)) { 105 while (time_before(jiffies, timeout)) {
diff --git a/arch/arm/mm/abort-ev6.S b/arch/arm/mm/abort-ev6.S
index ff1f7cc11f87..80741992a9fc 100644
--- a/arch/arm/mm/abort-ev6.S
+++ b/arch/arm/mm/abort-ev6.S
@@ -26,18 +26,23 @@ ENTRY(v6_early_abort)
26 mrc p15, 0, r1, c5, c0, 0 @ get FSR 26 mrc p15, 0, r1, c5, c0, 0 @ get FSR
27 mrc p15, 0, r0, c6, c0, 0 @ get FAR 27 mrc p15, 0, r0, c6, c0, 0 @ get FAR
28/* 28/*
29 * Faulty SWP instruction on 1136 doesn't set bit 11 in DFSR (erratum 326103). 29 * Faulty SWP instruction on 1136 doesn't set bit 11 in DFSR.
30 * The test below covers all the write situations, including Java bytecodes
31 */ 30 */
32 bic r1, r1, #1 << 11 @ clear bit 11 of FSR 31#ifdef CONFIG_ARM_ERRATA_326103
32 ldr ip, =0x4107b36
33 mrc p15, 0, r3, c0, c0, 0 @ get processor id
34 teq ip, r3, lsr #4 @ r0 ARM1136?
35 bne do_DataAbort
33 tst r5, #PSR_J_BIT @ Java? 36 tst r5, #PSR_J_BIT @ Java?
37 tsteq r5, #PSR_T_BIT @ Thumb?
34 bne do_DataAbort 38 bne do_DataAbort
35 do_thumb_abort fsr=r1, pc=r4, psr=r5, tmp=r3 39 bic r1, r1, #1 << 11 @ clear bit 11 of FSR
36 ldreq r3, [r4] @ read aborted ARM instruction 40 ldr r3, [r4] @ read aborted ARM instruction
37#ifdef CONFIG_CPU_ENDIAN_BE8 41#ifdef CONFIG_CPU_ENDIAN_BE8
38 reveq r3, r3 42 rev r3, r3
39#endif 43#endif
40 do_ldrd_abort tmp=ip, insn=r3 44 do_ldrd_abort tmp=ip, insn=r3
41 tst r3, #1 << 20 @ L = 0 -> write 45 tst r3, #1 << 20 @ L = 0 -> write
42 orreq r1, r1, #1 << 11 @ yes. 46 orreq r1, r1, #1 << 11 @ yes.
47#endif
43 b do_DataAbort 48 b do_DataAbort
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index a53fd2aaa2f4..2a8e380501e8 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -32,6 +32,7 @@ static void __iomem *l2x0_base;
32static DEFINE_RAW_SPINLOCK(l2x0_lock); 32static DEFINE_RAW_SPINLOCK(l2x0_lock);
33static u32 l2x0_way_mask; /* Bitmask of active ways */ 33static u32 l2x0_way_mask; /* Bitmask of active ways */
34static u32 l2x0_size; 34static u32 l2x0_size;
35static unsigned long sync_reg_offset = L2X0_CACHE_SYNC;
35 36
36struct l2x0_regs l2x0_saved_regs; 37struct l2x0_regs l2x0_saved_regs;
37 38
@@ -61,12 +62,7 @@ static inline void cache_sync(void)
61{ 62{
62 void __iomem *base = l2x0_base; 63 void __iomem *base = l2x0_base;
63 64
64#ifdef CONFIG_PL310_ERRATA_753970 65 writel_relaxed(0, base + sync_reg_offset);
65 /* write to an unmmapped register */
66 writel_relaxed(0, base + L2X0_DUMMY_REG);
67#else
68 writel_relaxed(0, base + L2X0_CACHE_SYNC);
69#endif
70 cache_wait(base + L2X0_CACHE_SYNC, 1); 66 cache_wait(base + L2X0_CACHE_SYNC, 1);
71} 67}
72 68
@@ -85,10 +81,13 @@ static inline void l2x0_inv_line(unsigned long addr)
85} 81}
86 82
87#if defined(CONFIG_PL310_ERRATA_588369) || defined(CONFIG_PL310_ERRATA_727915) 83#if defined(CONFIG_PL310_ERRATA_588369) || defined(CONFIG_PL310_ERRATA_727915)
84static inline void debug_writel(unsigned long val)
85{
86 if (outer_cache.set_debug)
87 outer_cache.set_debug(val);
88}
88 89
89#define debug_writel(val) outer_cache.set_debug(val) 90static void pl310_set_debug(unsigned long val)
90
91static void l2x0_set_debug(unsigned long val)
92{ 91{
93 writel_relaxed(val, l2x0_base + L2X0_DEBUG_CTRL); 92 writel_relaxed(val, l2x0_base + L2X0_DEBUG_CTRL);
94} 93}
@@ -98,7 +97,7 @@ static inline void debug_writel(unsigned long val)
98{ 97{
99} 98}
100 99
101#define l2x0_set_debug NULL 100#define pl310_set_debug NULL
102#endif 101#endif
103 102
104#ifdef CONFIG_PL310_ERRATA_588369 103#ifdef CONFIG_PL310_ERRATA_588369
@@ -331,6 +330,11 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask)
331 else 330 else
332 ways = 8; 331 ways = 8;
333 type = "L310"; 332 type = "L310";
333#ifdef CONFIG_PL310_ERRATA_753970
334 /* Unmapped register. */
335 sync_reg_offset = L2X0_DUMMY_REG;
336#endif
337 outer_cache.set_debug = pl310_set_debug;
334 break; 338 break;
335 case L2X0_CACHE_ID_PART_L210: 339 case L2X0_CACHE_ID_PART_L210:
336 ways = (aux >> 13) & 0xf; 340 ways = (aux >> 13) & 0xf;
@@ -379,7 +383,6 @@ void __init l2x0_init(void __iomem *base, u32 aux_val, u32 aux_mask)
379 outer_cache.flush_all = l2x0_flush_all; 383 outer_cache.flush_all = l2x0_flush_all;
380 outer_cache.inv_all = l2x0_inv_all; 384 outer_cache.inv_all = l2x0_inv_all;
381 outer_cache.disable = l2x0_disable; 385 outer_cache.disable = l2x0_disable;
382 outer_cache.set_debug = l2x0_set_debug;
383 386
384 printk(KERN_INFO "%s cache controller enabled\n", type); 387 printk(KERN_INFO "%s cache controller enabled\n", type);
385 printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x, Cache size: %d B\n", 388 printk(KERN_INFO "l2x0: %d ways, CACHE_ID 0x%08x, AUX_CTRL 0x%08x, Cache size: %d B\n",
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 595079fa9d1d..8f5813bbffb5 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -293,11 +293,11 @@ EXPORT_SYMBOL(pfn_valid);
293#endif 293#endif
294 294
295#ifndef CONFIG_SPARSEMEM 295#ifndef CONFIG_SPARSEMEM
296static void arm_memory_present(void) 296static void __init arm_memory_present(void)
297{ 297{
298} 298}
299#else 299#else
300static void arm_memory_present(void) 300static void __init arm_memory_present(void)
301{ 301{
302 struct memblock_region *reg; 302 struct memblock_region *reg;
303 303
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index b86f8933ff91..2c7cf2f9c837 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -618,8 +618,8 @@ static void __init alloc_init_section(pud_t *pud, unsigned long addr,
618 } 618 }
619} 619}
620 620
621static void alloc_init_pud(pgd_t *pgd, unsigned long addr, unsigned long end, 621static void __init alloc_init_pud(pgd_t *pgd, unsigned long addr,
622 unsigned long phys, const struct mem_type *type) 622 unsigned long end, unsigned long phys, const struct mem_type *type)
623{ 623{
624 pud_t *pud = pud_offset(pgd, addr); 624 pud_t *pud = pud_offset(pgd, addr);
625 unsigned long next; 625 unsigned long next;
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index ecdb3da0dea9..c58d896cd5c3 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -916,6 +916,13 @@ void omap_start_dma(int lch)
916 l |= OMAP_DMA_CCR_BUFFERING_DISABLE; 916 l |= OMAP_DMA_CCR_BUFFERING_DISABLE;
917 l |= OMAP_DMA_CCR_EN; 917 l |= OMAP_DMA_CCR_EN;
918 918
919 /*
920 * As dma_write() uses IO accessors which are weakly ordered, there
921 * is no guarantee that data in coherent DMA memory will be visible
922 * to the DMA device. Add a memory barrier here to ensure that any
923 * such data is visible prior to enabling DMA.
924 */
925 mb();
919 p->dma_write(l, CCR, lch); 926 p->dma_write(l, CCR, lch);
920 927
921 dma_chan[lch].flags |= OMAP_DMA_ACTIVE; 928 dma_chan[lch].flags |= OMAP_DMA_ACTIVE;
@@ -965,6 +972,13 @@ void omap_stop_dma(int lch)
965 p->dma_write(l, CCR, lch); 972 p->dma_write(l, CCR, lch);
966 } 973 }
967 974
975 /*
976 * Ensure that data transferred by DMA is visible to any access
977 * after DMA has been disabled. This is important for coherent
978 * DMA regions.
979 */
980 mb();
981
968 if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) { 982 if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) {
969 int next_lch, cur_lch = lch; 983 int next_lch, cur_lch = lch;
970 char dma_chan_link_map[dma_lch_count]; 984 char dma_chan_link_map[dma_lch_count];
diff --git a/arch/arm/plat-omap/include/plat/omap_hwmod.h b/arch/arm/plat-omap/include/plat/omap_hwmod.h
index 8070145ccb98..3f26db4ee8e6 100644
--- a/arch/arm/plat-omap/include/plat/omap_hwmod.h
+++ b/arch/arm/plat-omap/include/plat/omap_hwmod.h
@@ -305,6 +305,7 @@ struct omap_hwmod_sysc_fields {
305 * @rev_offs: IP block revision register offset (from module base addr) 305 * @rev_offs: IP block revision register offset (from module base addr)
306 * @sysc_offs: OCP_SYSCONFIG register offset (from module base addr) 306 * @sysc_offs: OCP_SYSCONFIG register offset (from module base addr)
307 * @syss_offs: OCP_SYSSTATUS register offset (from module base addr) 307 * @syss_offs: OCP_SYSSTATUS register offset (from module base addr)
308 * @srst_udelay: Delay needed after doing a softreset in usecs
308 * @idlemodes: One or more of {SIDLE,MSTANDBY}_{OFF,FORCE,SMART} 309 * @idlemodes: One or more of {SIDLE,MSTANDBY}_{OFF,FORCE,SMART}
309 * @sysc_flags: SYS{C,S}_HAS* flags indicating SYSCONFIG bits supported 310 * @sysc_flags: SYS{C,S}_HAS* flags indicating SYSCONFIG bits supported
310 * @clockact: the default value of the module CLOCKACTIVITY bits 311 * @clockact: the default value of the module CLOCKACTIVITY bits
@@ -330,9 +331,10 @@ struct omap_hwmod_class_sysconfig {
330 u16 sysc_offs; 331 u16 sysc_offs;
331 u16 syss_offs; 332 u16 syss_offs;
332 u16 sysc_flags; 333 u16 sysc_flags;
334 struct omap_hwmod_sysc_fields *sysc_fields;
335 u8 srst_udelay;
333 u8 idlemodes; 336 u8 idlemodes;
334 u8 clockact; 337 u8 clockact;
335 struct omap_hwmod_sysc_fields *sysc_fields;
336}; 338};
337 339
338/** 340/**
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c
index eec98afa0f83..f9a8c5341ee9 100644
--- a/arch/arm/plat-omap/sram.c
+++ b/arch/arm/plat-omap/sram.c
@@ -348,7 +348,6 @@ u32 omap3_configure_core_dpll(u32 m2, u32 unlock_dll, u32 f, u32 inc,
348 sdrc_actim_ctrl_b_1, sdrc_mr_1); 348 sdrc_actim_ctrl_b_1, sdrc_mr_1);
349} 349}
350 350
351#ifdef CONFIG_PM
352void omap3_sram_restore_context(void) 351void omap3_sram_restore_context(void)
353{ 352{
354 omap_sram_ceil = omap_sram_base + omap_sram_size; 353 omap_sram_ceil = omap_sram_base + omap_sram_size;
@@ -358,17 +357,18 @@ void omap3_sram_restore_context(void)
358 omap3_sram_configure_core_dpll_sz); 357 omap3_sram_configure_core_dpll_sz);
359 omap_push_sram_idle(); 358 omap_push_sram_idle();
360} 359}
361#endif /* CONFIG_PM */
362
363#endif /* CONFIG_ARCH_OMAP3 */
364 360
365static inline int omap34xx_sram_init(void) 361static inline int omap34xx_sram_init(void)
366{ 362{
367#if defined(CONFIG_ARCH_OMAP3) && defined(CONFIG_PM)
368 omap3_sram_restore_context(); 363 omap3_sram_restore_context();
369#endif
370 return 0; 364 return 0;
371} 365}
366#else
367static inline int omap34xx_sram_init(void)
368{
369 return 0;
370}
371#endif /* CONFIG_ARCH_OMAP3 */
372 372
373static inline int am33xx_sram_init(void) 373static inline int am33xx_sram_init(void)
374{ 374{
diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h
index 317e246ffc56..e834c5ef437c 100644
--- a/arch/arm/plat-samsung/include/plat/sdhci.h
+++ b/arch/arm/plat-samsung/include/plat/sdhci.h
@@ -18,6 +18,8 @@
18#ifndef __PLAT_S3C_SDHCI_H 18#ifndef __PLAT_S3C_SDHCI_H
19#define __PLAT_S3C_SDHCI_H __FILE__ 19#define __PLAT_S3C_SDHCI_H __FILE__
20 20
21#include <plat/devs.h>
22
21struct platform_device; 23struct platform_device;
22struct mmc_host; 24struct mmc_host;
23struct mmc_card; 25struct mmc_card;
@@ -356,4 +358,30 @@ static inline void exynos4_default_sdhci3(void) { }
356 358
357#endif /* CONFIG_EXYNOS4_SETUP_SDHCI */ 359#endif /* CONFIG_EXYNOS4_SETUP_SDHCI */
358 360
361static inline void s3c_sdhci_setname(int id, char *name)
362{
363 switch (id) {
364#ifdef CONFIG_S3C_DEV_HSMMC
365 case 0:
366 s3c_device_hsmmc0.name = name;
367 break;
368#endif
369#ifdef CONFIG_S3C_DEV_HSMMC1
370 case 1:
371 s3c_device_hsmmc1.name = name;
372 break;
373#endif
374#ifdef CONFIG_S3C_DEV_HSMMC2
375 case 2:
376 s3c_device_hsmmc2.name = name;
377 break;
378#endif
379#ifdef CONFIG_S3C_DEV_HSMMC3
380 case 3:
381 s3c_device_hsmmc3.name = name;
382 break;
383#endif
384 }
385}
386
359#endif /* __PLAT_S3C_SDHCI_H */ 387#endif /* __PLAT_S3C_SDHCI_H */
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 858748eaa144..bc683b8219b5 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -17,6 +17,8 @@
17#include <linux/sched.h> 17#include <linux/sched.h>
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/uaccess.h>
21#include <linux/user.h>
20 22
21#include <asm/cp15.h> 23#include <asm/cp15.h>
22#include <asm/cputype.h> 24#include <asm/cputype.h>
@@ -529,6 +531,103 @@ void vfp_flush_hwstate(struct thread_info *thread)
529} 531}
530 532
531/* 533/*
534 * Save the current VFP state into the provided structures and prepare
535 * for entry into a new function (signal handler).
536 */
537int vfp_preserve_user_clear_hwstate(struct user_vfp __user *ufp,
538 struct user_vfp_exc __user *ufp_exc)
539{
540 struct thread_info *thread = current_thread_info();
541 struct vfp_hard_struct *hwstate = &thread->vfpstate.hard;
542 int err = 0;
543
544 /* Ensure that the saved hwstate is up-to-date. */
545 vfp_sync_hwstate(thread);
546
547 /*
548 * Copy the floating point registers. There can be unused
549 * registers see asm/hwcap.h for details.
550 */
551 err |= __copy_to_user(&ufp->fpregs, &hwstate->fpregs,
552 sizeof(hwstate->fpregs));
553 /*
554 * Copy the status and control register.
555 */
556 __put_user_error(hwstate->fpscr, &ufp->fpscr, err);
557
558 /*
559 * Copy the exception registers.
560 */
561 __put_user_error(hwstate->fpexc, &ufp_exc->fpexc, err);
562 __put_user_error(hwstate->fpinst, &ufp_exc->fpinst, err);
563 __put_user_error(hwstate->fpinst2, &ufp_exc->fpinst2, err);
564
565 if (err)
566 return -EFAULT;
567
568 /* Ensure that VFP is disabled. */
569 vfp_flush_hwstate(thread);
570
571 /*
572 * As per the PCS, clear the length and stride bits for function
573 * entry.
574 */
575 hwstate->fpscr &= ~(FPSCR_LENGTH_MASK | FPSCR_STRIDE_MASK);
576
577 /*
578 * Disable VFP in the hwstate so that we can detect if it gets
579 * used.
580 */
581 hwstate->fpexc &= ~FPEXC_EN;
582 return 0;
583}
584
585/* Sanitise and restore the current VFP state from the provided structures. */
586int vfp_restore_user_hwstate(struct user_vfp __user *ufp,
587 struct user_vfp_exc __user *ufp_exc)
588{
589 struct thread_info *thread = current_thread_info();
590 struct vfp_hard_struct *hwstate = &thread->vfpstate.hard;
591 unsigned long fpexc;
592 int err = 0;
593
594 /*
595 * If VFP has been used, then disable it to avoid corrupting
596 * the new thread state.
597 */
598 if (hwstate->fpexc & FPEXC_EN)
599 vfp_flush_hwstate(thread);
600
601 /*
602 * Copy the floating point registers. There can be unused
603 * registers see asm/hwcap.h for details.
604 */
605 err |= __copy_from_user(&hwstate->fpregs, &ufp->fpregs,
606 sizeof(hwstate->fpregs));
607 /*
608 * Copy the status and control register.
609 */
610 __get_user_error(hwstate->fpscr, &ufp->fpscr, err);
611
612 /*
613 * Sanitise and restore the exception registers.
614 */
615 __get_user_error(fpexc, &ufp_exc->fpexc, err);
616
617 /* Ensure the VFP is enabled. */
618 fpexc |= FPEXC_EN;
619
620 /* Ensure FPINST2 is invalid and the exception flag is cleared. */
621 fpexc &= ~(FPEXC_EX | FPEXC_FP2V);
622 hwstate->fpexc = fpexc;
623
624 __get_user_error(hwstate->fpinst, &ufp_exc->fpinst, err);
625 __get_user_error(hwstate->fpinst2, &ufp_exc->fpinst2, err);
626
627 return err ? -EFAULT : 0;
628}
629
630/*
532 * VFP hardware can lose all context when a CPU goes offline. 631 * VFP hardware can lose all context when a CPU goes offline.
533 * As we will be running in SMP mode with CPU hotplug, we will save the 632 * As we will be running in SMP mode with CPU hotplug, we will save the
534 * hardware state at every thread switch. We clear our held state when 633 * hardware state at every thread switch. We clear our held state when
diff --git a/arch/blackfin/mach-bf538/boards/ezkit.c b/arch/blackfin/mach-bf538/boards/ezkit.c
index 1633a6f306c0..85038f54354d 100644
--- a/arch/blackfin/mach-bf538/boards/ezkit.c
+++ b/arch/blackfin/mach-bf538/boards/ezkit.c
@@ -38,7 +38,7 @@ static struct platform_device rtc_device = {
38 .name = "rtc-bfin", 38 .name = "rtc-bfin",
39 .id = -1, 39 .id = -1,
40}; 40};
41#endif 41#endif /* CONFIG_RTC_DRV_BFIN */
42 42
43#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 43#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
44#ifdef CONFIG_SERIAL_BFIN_UART0 44#ifdef CONFIG_SERIAL_BFIN_UART0
@@ -100,7 +100,7 @@ static struct platform_device bfin_uart0_device = {
100 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ 100 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
101 }, 101 },
102}; 102};
103#endif 103#endif /* CONFIG_SERIAL_BFIN_UART0 */
104#ifdef CONFIG_SERIAL_BFIN_UART1 104#ifdef CONFIG_SERIAL_BFIN_UART1
105static struct resource bfin_uart1_resources[] = { 105static struct resource bfin_uart1_resources[] = {
106 { 106 {
@@ -148,7 +148,7 @@ static struct platform_device bfin_uart1_device = {
148 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */ 148 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
149 }, 149 },
150}; 150};
151#endif 151#endif /* CONFIG_SERIAL_BFIN_UART1 */
152#ifdef CONFIG_SERIAL_BFIN_UART2 152#ifdef CONFIG_SERIAL_BFIN_UART2
153static struct resource bfin_uart2_resources[] = { 153static struct resource bfin_uart2_resources[] = {
154 { 154 {
@@ -196,8 +196,8 @@ static struct platform_device bfin_uart2_device = {
196 .platform_data = &bfin_uart2_peripherals, /* Passed to driver */ 196 .platform_data = &bfin_uart2_peripherals, /* Passed to driver */
197 }, 197 },
198}; 198};
199#endif 199#endif /* CONFIG_SERIAL_BFIN_UART2 */
200#endif 200#endif /* CONFIG_SERIAL_BFIN */
201 201
202#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 202#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
203#ifdef CONFIG_BFIN_SIR0 203#ifdef CONFIG_BFIN_SIR0
@@ -224,7 +224,7 @@ static struct platform_device bfin_sir0_device = {
224 .num_resources = ARRAY_SIZE(bfin_sir0_resources), 224 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
225 .resource = bfin_sir0_resources, 225 .resource = bfin_sir0_resources,
226}; 226};
227#endif 227#endif /* CONFIG_BFIN_SIR0 */
228#ifdef CONFIG_BFIN_SIR1 228#ifdef CONFIG_BFIN_SIR1
229static struct resource bfin_sir1_resources[] = { 229static struct resource bfin_sir1_resources[] = {
230 { 230 {
@@ -249,7 +249,7 @@ static struct platform_device bfin_sir1_device = {
249 .num_resources = ARRAY_SIZE(bfin_sir1_resources), 249 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
250 .resource = bfin_sir1_resources, 250 .resource = bfin_sir1_resources,
251}; 251};
252#endif 252#endif /* CONFIG_BFIN_SIR1 */
253#ifdef CONFIG_BFIN_SIR2 253#ifdef CONFIG_BFIN_SIR2
254static struct resource bfin_sir2_resources[] = { 254static struct resource bfin_sir2_resources[] = {
255 { 255 {
@@ -274,8 +274,8 @@ static struct platform_device bfin_sir2_device = {
274 .num_resources = ARRAY_SIZE(bfin_sir2_resources), 274 .num_resources = ARRAY_SIZE(bfin_sir2_resources),
275 .resource = bfin_sir2_resources, 275 .resource = bfin_sir2_resources,
276}; 276};
277#endif 277#endif /* CONFIG_BFIN_SIR2 */
278#endif 278#endif /* CONFIG_BFIN_SIR */
279 279
280#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) 280#if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE)
281#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART 281#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
@@ -311,7 +311,7 @@ static struct platform_device bfin_sport0_uart_device = {
311 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */ 311 .platform_data = &bfin_sport0_peripherals, /* Passed to driver */
312 }, 312 },
313}; 313};
314#endif 314#endif /* CONFIG_SERIAL_BFIN_SPORT0_UART */
315#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART 315#ifdef CONFIG_SERIAL_BFIN_SPORT1_UART
316static struct resource bfin_sport1_uart_resources[] = { 316static struct resource bfin_sport1_uart_resources[] = {
317 { 317 {
@@ -345,7 +345,7 @@ static struct platform_device bfin_sport1_uart_device = {
345 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */ 345 .platform_data = &bfin_sport1_peripherals, /* Passed to driver */
346 }, 346 },
347}; 347};
348#endif 348#endif /* CONFIG_SERIAL_BFIN_SPORT1_UART */
349#ifdef CONFIG_SERIAL_BFIN_SPORT2_UART 349#ifdef CONFIG_SERIAL_BFIN_SPORT2_UART
350static struct resource bfin_sport2_uart_resources[] = { 350static struct resource bfin_sport2_uart_resources[] = {
351 { 351 {
@@ -379,7 +379,7 @@ static struct platform_device bfin_sport2_uart_device = {
379 .platform_data = &bfin_sport2_peripherals, /* Passed to driver */ 379 .platform_data = &bfin_sport2_peripherals, /* Passed to driver */
380 }, 380 },
381}; 381};
382#endif 382#endif /* CONFIG_SERIAL_BFIN_SPORT2_UART */
383#ifdef CONFIG_SERIAL_BFIN_SPORT3_UART 383#ifdef CONFIG_SERIAL_BFIN_SPORT3_UART
384static struct resource bfin_sport3_uart_resources[] = { 384static struct resource bfin_sport3_uart_resources[] = {
385 { 385 {
@@ -413,8 +413,8 @@ static struct platform_device bfin_sport3_uart_device = {
413 .platform_data = &bfin_sport3_peripherals, /* Passed to driver */ 413 .platform_data = &bfin_sport3_peripherals, /* Passed to driver */
414 }, 414 },
415}; 415};
416#endif 416#endif /* CONFIG_SERIAL_BFIN_SPORT3_UART */
417#endif 417#endif /* CONFIG_SERIAL_BFIN_SPORT */
418 418
419#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE) 419#if defined(CONFIG_CAN_BFIN) || defined(CONFIG_CAN_BFIN_MODULE)
420static unsigned short bfin_can_peripherals[] = { 420static unsigned short bfin_can_peripherals[] = {
@@ -452,7 +452,7 @@ static struct platform_device bfin_can_device = {
452 .platform_data = &bfin_can_peripherals, /* Passed to driver */ 452 .platform_data = &bfin_can_peripherals, /* Passed to driver */
453 }, 453 },
454}; 454};
455#endif 455#endif /* CONFIG_CAN_BFIN */
456 456
457/* 457/*
458 * USB-LAN EzExtender board 458 * USB-LAN EzExtender board
@@ -488,7 +488,7 @@ static struct platform_device smc91x_device = {
488 .platform_data = &smc91x_info, 488 .platform_data = &smc91x_info,
489 }, 489 },
490}; 490};
491#endif 491#endif /* CONFIG_SMC91X */
492 492
493#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE) 493#if defined(CONFIG_SPI_BFIN5XX) || defined(CONFIG_SPI_BFIN5XX_MODULE)
494/* all SPI peripherals info goes here */ 494/* all SPI peripherals info goes here */
@@ -518,7 +518,8 @@ static struct flash_platform_data bfin_spi_flash_data = {
518static struct bfin5xx_spi_chip spi_flash_chip_info = { 518static struct bfin5xx_spi_chip spi_flash_chip_info = {
519 .enable_dma = 0, /* use dma transfer with this chip*/ 519 .enable_dma = 0, /* use dma transfer with this chip*/
520}; 520};
521#endif 521#endif /* CONFIG_MTD_M25P80 */
522#endif /* CONFIG_SPI_BFIN5XX */
522 523
523#if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE) 524#if defined(CONFIG_TOUCHSCREEN_AD7879) || defined(CONFIG_TOUCHSCREEN_AD7879_MODULE)
524#include <linux/spi/ad7879.h> 525#include <linux/spi/ad7879.h>
@@ -535,7 +536,7 @@ static const struct ad7879_platform_data bfin_ad7879_ts_info = {
535 .gpio_export = 1, /* Export GPIO to gpiolib */ 536 .gpio_export = 1, /* Export GPIO to gpiolib */
536 .gpio_base = -1, /* Dynamic allocation */ 537 .gpio_base = -1, /* Dynamic allocation */
537}; 538};
538#endif 539#endif /* CONFIG_TOUCHSCREEN_AD7879 */
539 540
540#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 541#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
541#include <asm/bfin-lq035q1.h> 542#include <asm/bfin-lq035q1.h>
@@ -564,7 +565,7 @@ static struct platform_device bfin_lq035q1_device = {
564 .platform_data = &bfin_lq035q1_data, 565 .platform_data = &bfin_lq035q1_data,
565 }, 566 },
566}; 567};
567#endif 568#endif /* CONFIG_FB_BFIN_LQ035Q1 */
568 569
569static struct spi_board_info bf538_spi_board_info[] __initdata = { 570static struct spi_board_info bf538_spi_board_info[] __initdata = {
570#if defined(CONFIG_MTD_M25P80) \ 571#if defined(CONFIG_MTD_M25P80) \
@@ -579,7 +580,7 @@ static struct spi_board_info bf538_spi_board_info[] __initdata = {
579 .controller_data = &spi_flash_chip_info, 580 .controller_data = &spi_flash_chip_info,
580 .mode = SPI_MODE_3, 581 .mode = SPI_MODE_3,
581 }, 582 },
582#endif 583#endif /* CONFIG_MTD_M25P80 */
583#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE) 584#if defined(CONFIG_TOUCHSCREEN_AD7879_SPI) || defined(CONFIG_TOUCHSCREEN_AD7879_SPI_MODULE)
584 { 585 {
585 .modalias = "ad7879", 586 .modalias = "ad7879",
@@ -590,7 +591,7 @@ static struct spi_board_info bf538_spi_board_info[] __initdata = {
590 .chip_select = 1, 591 .chip_select = 1,
591 .mode = SPI_CPHA | SPI_CPOL, 592 .mode = SPI_CPHA | SPI_CPOL,
592 }, 593 },
593#endif 594#endif /* CONFIG_TOUCHSCREEN_AD7879_SPI */
594#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE) 595#if defined(CONFIG_FB_BFIN_LQ035Q1) || defined(CONFIG_FB_BFIN_LQ035Q1_MODULE)
595 { 596 {
596 .modalias = "bfin-lq035q1-spi", 597 .modalias = "bfin-lq035q1-spi",
@@ -599,7 +600,7 @@ static struct spi_board_info bf538_spi_board_info[] __initdata = {
599 .chip_select = 2, 600 .chip_select = 2,
600 .mode = SPI_CPHA | SPI_CPOL, 601 .mode = SPI_CPHA | SPI_CPOL,
601 }, 602 },
602#endif 603#endif /* CONFIG_FB_BFIN_LQ035Q1 */
603#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE) 604#if defined(CONFIG_SPI_SPIDEV) || defined(CONFIG_SPI_SPIDEV_MODULE)
604 { 605 {
605 .modalias = "spidev", 606 .modalias = "spidev",
@@ -607,7 +608,7 @@ static struct spi_board_info bf538_spi_board_info[] __initdata = {
607 .bus_num = 0, 608 .bus_num = 0,
608 .chip_select = 1, 609 .chip_select = 1,
609 }, 610 },
610#endif 611#endif /* CONFIG_SPI_SPIDEV */
611}; 612};
612 613
613/* SPI (0) */ 614/* SPI (0) */
@@ -716,8 +717,6 @@ static struct platform_device bf538_spi_master2 = {
716 }, 717 },
717}; 718};
718 719
719#endif /* spi master and devices */
720
721#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 720#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
722static struct resource bfin_twi0_resource[] = { 721static struct resource bfin_twi0_resource[] = {
723 [0] = { 722 [0] = {
@@ -759,8 +758,8 @@ static struct platform_device i2c_bfin_twi1_device = {
759 .num_resources = ARRAY_SIZE(bfin_twi1_resource), 758 .num_resources = ARRAY_SIZE(bfin_twi1_resource),
760 .resource = bfin_twi1_resource, 759 .resource = bfin_twi1_resource,
761}; 760};
762#endif 761#endif /* CONFIG_BF542 */
763#endif 762#endif /* CONFIG_I2C_BLACKFIN_TWI */
764 763
765#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 764#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
766#include <linux/gpio_keys.h> 765#include <linux/gpio_keys.h>
diff --git a/arch/hexagon/kernel/dma.c b/arch/hexagon/kernel/dma.c
index 37302218ca4a..0f2367cc5493 100644
--- a/arch/hexagon/kernel/dma.c
+++ b/arch/hexagon/kernel/dma.c
@@ -22,6 +22,7 @@
22#include <linux/bootmem.h> 22#include <linux/bootmem.h>
23#include <linux/genalloc.h> 23#include <linux/genalloc.h>
24#include <asm/dma-mapping.h> 24#include <asm/dma-mapping.h>
25#include <linux/module.h>
25 26
26struct dma_map_ops *dma_ops; 27struct dma_map_ops *dma_ops;
27EXPORT_SYMBOL(dma_ops); 28EXPORT_SYMBOL(dma_ops);
diff --git a/arch/hexagon/kernel/process.c b/arch/hexagon/kernel/process.c
index 18c4f0b0f4ba..ff02821bfb7e 100644
--- a/arch/hexagon/kernel/process.c
+++ b/arch/hexagon/kernel/process.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Process creation support for Hexagon 2 * Process creation support for Hexagon
3 * 3 *
4 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. 4 * Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 and 7 * it under the terms of the GNU General Public License version 2 and
@@ -88,7 +88,7 @@ void (*idle_sleep)(void) = default_idle;
88void cpu_idle(void) 88void cpu_idle(void)
89{ 89{
90 while (1) { 90 while (1) {
91 tick_nohz_stop_sched_tick(1); 91 tick_nohz_idle_enter();
92 local_irq_disable(); 92 local_irq_disable();
93 while (!need_resched()) { 93 while (!need_resched()) {
94 idle_sleep(); 94 idle_sleep();
@@ -97,7 +97,7 @@ void cpu_idle(void)
97 local_irq_disable(); 97 local_irq_disable();
98 } 98 }
99 local_irq_enable(); 99 local_irq_enable();
100 tick_nohz_restart_sched_tick(); 100 tick_nohz_idle_exit();
101 schedule(); 101 schedule();
102 } 102 }
103} 103}
diff --git a/arch/hexagon/kernel/ptrace.c b/arch/hexagon/kernel/ptrace.c
index 32342de1a79c..96c3b2c4dbad 100644
--- a/arch/hexagon/kernel/ptrace.c
+++ b/arch/hexagon/kernel/ptrace.c
@@ -28,6 +28,7 @@
28#include <linux/ptrace.h> 28#include <linux/ptrace.h>
29#include <linux/regset.h> 29#include <linux/regset.h>
30#include <linux/user.h> 30#include <linux/user.h>
31#include <linux/elf.h>
31 32
32#include <asm/user.h> 33#include <asm/user.h>
33 34
diff --git a/arch/hexagon/kernel/smp.c b/arch/hexagon/kernel/smp.c
index 9b44a9e2d05a..1298141874a3 100644
--- a/arch/hexagon/kernel/smp.c
+++ b/arch/hexagon/kernel/smp.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * SMP support for Hexagon 2 * SMP support for Hexagon
3 * 3 *
4 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved. 4 * Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 and 7 * it under the terms of the GNU General Public License version 2 and
@@ -28,6 +28,7 @@
28#include <linux/sched.h> 28#include <linux/sched.h>
29#include <linux/smp.h> 29#include <linux/smp.h>
30#include <linux/spinlock.h> 30#include <linux/spinlock.h>
31#include <linux/cpu.h>
31 32
32#include <asm/time.h> /* timer_interrupt */ 33#include <asm/time.h> /* timer_interrupt */
33#include <asm/hexagon_vm.h> 34#include <asm/hexagon_vm.h>
@@ -177,7 +178,12 @@ void __cpuinit start_secondary(void)
177 178
178 printk(KERN_INFO "%s cpu %d\n", __func__, current_thread_info()->cpu); 179 printk(KERN_INFO "%s cpu %d\n", __func__, current_thread_info()->cpu);
179 180
181 notify_cpu_starting(cpu);
182
183 ipi_call_lock();
180 set_cpu_online(cpu, true); 184 set_cpu_online(cpu, true);
185 ipi_call_unlock();
186
181 local_irq_enable(); 187 local_irq_enable();
182 188
183 cpu_idle(); 189 cpu_idle();
diff --git a/arch/hexagon/kernel/time.c b/arch/hexagon/kernel/time.c
index 6bee15c9c113..5d9b33b67935 100644
--- a/arch/hexagon/kernel/time.c
+++ b/arch/hexagon/kernel/time.c
@@ -28,6 +28,7 @@
28#include <linux/of.h> 28#include <linux/of.h>
29#include <linux/of_address.h> 29#include <linux/of_address.h>
30#include <linux/of_irq.h> 30#include <linux/of_irq.h>
31#include <linux/module.h>
31 32
32#include <asm/timer-regs.h> 33#include <asm/timer-regs.h>
33#include <asm/hexagon_vm.h> 34#include <asm/hexagon_vm.h>
diff --git a/arch/hexagon/kernel/vdso.c b/arch/hexagon/kernel/vdso.c
index f212a453b527..5d39f42f7085 100644
--- a/arch/hexagon/kernel/vdso.c
+++ b/arch/hexagon/kernel/vdso.c
@@ -21,6 +21,7 @@
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/mm.h> 22#include <linux/mm.h>
23#include <linux/vmalloc.h> 23#include <linux/vmalloc.h>
24#include <linux/binfmts.h>
24 25
25#include <asm/vdso.h> 26#include <asm/vdso.h>
26 27
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 9d0fd7d5bb82..f00ba025375d 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -604,12 +604,6 @@ pfm_unprotect_ctx_ctxsw(pfm_context_t *x, unsigned long f)
604 spin_unlock(&(x)->ctx_lock); 604 spin_unlock(&(x)->ctx_lock);
605} 605}
606 606
607static inline unsigned int
608pfm_do_munmap(struct mm_struct *mm, unsigned long addr, size_t len, int acct)
609{
610 return do_munmap(mm, addr, len);
611}
612
613static inline unsigned long 607static inline unsigned long
614pfm_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags, unsigned long exec) 608pfm_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags, unsigned long exec)
615{ 609{
@@ -1458,8 +1452,9 @@ pfm_unreserve_session(pfm_context_t *ctx, int is_syswide, unsigned int cpu)
1458 * a PROTECT_CTX() section. 1452 * a PROTECT_CTX() section.
1459 */ 1453 */
1460static int 1454static int
1461pfm_remove_smpl_mapping(struct task_struct *task, void *vaddr, unsigned long size) 1455pfm_remove_smpl_mapping(void *vaddr, unsigned long size)
1462{ 1456{
1457 struct task_struct *task = current;
1463 int r; 1458 int r;
1464 1459
1465 /* sanity checks */ 1460 /* sanity checks */
@@ -1473,13 +1468,8 @@ pfm_remove_smpl_mapping(struct task_struct *task, void *vaddr, unsigned long siz
1473 /* 1468 /*
1474 * does the actual unmapping 1469 * does the actual unmapping
1475 */ 1470 */
1476 down_write(&task->mm->mmap_sem); 1471 r = vm_munmap((unsigned long)vaddr, size);
1477 1472
1478 DPRINT(("down_write done smpl_vaddr=%p size=%lu\n", vaddr, size));
1479
1480 r = pfm_do_munmap(task->mm, (unsigned long)vaddr, size, 0);
1481
1482 up_write(&task->mm->mmap_sem);
1483 if (r !=0) { 1473 if (r !=0) {
1484 printk(KERN_ERR "perfmon: [%d] unable to unmap sampling buffer @%p size=%lu\n", task_pid_nr(task), vaddr, size); 1474 printk(KERN_ERR "perfmon: [%d] unable to unmap sampling buffer @%p size=%lu\n", task_pid_nr(task), vaddr, size);
1485 } 1475 }
@@ -1945,7 +1935,7 @@ pfm_flush(struct file *filp, fl_owner_t id)
1945 * because some VM function reenables interrupts. 1935 * because some VM function reenables interrupts.
1946 * 1936 *
1947 */ 1937 */
1948 if (smpl_buf_vaddr) pfm_remove_smpl_mapping(current, smpl_buf_vaddr, smpl_buf_size); 1938 if (smpl_buf_vaddr) pfm_remove_smpl_mapping(smpl_buf_vaddr, smpl_buf_size);
1949 1939
1950 return 0; 1940 return 0;
1951} 1941}
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c
index f5104b7c52cd..463fb3bbe11e 100644
--- a/arch/ia64/kvm/kvm-ia64.c
+++ b/arch/ia64/kvm/kvm-ia64.c
@@ -1174,7 +1174,7 @@ out:
1174 1174
1175bool kvm_vcpu_compatible(struct kvm_vcpu *vcpu) 1175bool kvm_vcpu_compatible(struct kvm_vcpu *vcpu)
1176{ 1176{
1177 return irqchip_in_kernel(vcpu->kcm) == (vcpu->arch.apic != NULL); 1177 return irqchip_in_kernel(vcpu->kvm) == (vcpu->arch.apic != NULL);
1178} 1178}
1179 1179
1180int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu) 1180int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
diff --git a/arch/m68k/configs/m5275evb_defconfig b/arch/m68k/configs/m5275evb_defconfig
index 33c32aeca12b..a1230e82bb1e 100644
--- a/arch/m68k/configs/m5275evb_defconfig
+++ b/arch/m68k/configs/m5275evb_defconfig
@@ -49,7 +49,6 @@ CONFIG_BLK_DEV_RAM=y
49CONFIG_NETDEVICES=y 49CONFIG_NETDEVICES=y
50CONFIG_NET_ETHERNET=y 50CONFIG_NET_ETHERNET=y
51CONFIG_FEC=y 51CONFIG_FEC=y
52CONFIG_FEC2=y
53# CONFIG_NETDEV_1000 is not set 52# CONFIG_NETDEV_1000 is not set
54# CONFIG_NETDEV_10000 is not set 53# CONFIG_NETDEV_10000 is not set
55CONFIG_PPP=y 54CONFIG_PPP=y
diff --git a/arch/m68k/platform/527x/config.c b/arch/m68k/platform/527x/config.c
index 7ed848c3b848..f91a53294c35 100644
--- a/arch/m68k/platform/527x/config.c
+++ b/arch/m68k/platform/527x/config.c
@@ -74,9 +74,7 @@ static void __init m527x_fec_init(void)
74 writew(par | 0xf00, MCF_IPSBAR + 0x100082); 74 writew(par | 0xf00, MCF_IPSBAR + 0x100082);
75 v = readb(MCF_IPSBAR + 0x100078); 75 v = readb(MCF_IPSBAR + 0x100078);
76 writeb(v | 0xc0, MCF_IPSBAR + 0x100078); 76 writeb(v | 0xc0, MCF_IPSBAR + 0x100078);
77#endif
78 77
79#ifdef CONFIG_FEC2
80 /* Set multi-function pins to ethernet mode for fec1 */ 78 /* Set multi-function pins to ethernet mode for fec1 */
81 par = readw(MCF_IPSBAR + 0x100082); 79 par = readw(MCF_IPSBAR + 0x100082);
82 writew(par | 0xa0, MCF_IPSBAR + 0x100082); 80 writew(par | 0xa0, MCF_IPSBAR + 0x100082);
diff --git a/arch/m68k/platform/68EZ328/Makefile b/arch/m68k/platform/68EZ328/Makefile
index ee97735a242c..b44d799b1115 100644
--- a/arch/m68k/platform/68EZ328/Makefile
+++ b/arch/m68k/platform/68EZ328/Makefile
@@ -3,9 +3,3 @@
3# 3#
4 4
5obj-y := config.o 5obj-y := config.o
6
7extra-y := bootlogo.rh
8
9$(obj)/bootlogo.rh: $(src)/bootlogo.h
10 perl $(src)/../68328/bootlogo.pl < $(src)/bootlogo.h \
11 > $(obj)/bootlogo.rh
diff --git a/arch/m68k/platform/68VZ328/Makefile b/arch/m68k/platform/68VZ328/Makefile
index 447ffa0fd7c7..a49d75e65489 100644
--- a/arch/m68k/platform/68VZ328/Makefile
+++ b/arch/m68k/platform/68VZ328/Makefile
@@ -3,14 +3,9 @@
3# 3#
4 4
5obj-y := config.o 5obj-y := config.o
6logo-$(UCDIMM) := bootlogo.rh 6extra-$(DRAGEN2):= screen.h
7logo-$(DRAGEN2) := screen.h
8extra-y := $(logo-y)
9
10$(obj)/bootlogo.rh: $(src)/../68EZ328/bootlogo.h
11 perl $(src)/bootlogo.pl < $(src)/../68328/bootlogo.h > $(obj)/bootlogo.rh
12 7
13$(obj)/screen.h: $(src)/screen.xbm $(src)/xbm2lcd.pl 8$(obj)/screen.h: $(src)/screen.xbm $(src)/xbm2lcd.pl
14 perl $(src)/xbm2lcd.pl < $(src)/screen.xbm > $(obj)/screen.h 9 perl $(src)/xbm2lcd.pl < $(src)/screen.xbm > $(obj)/screen.h
15 10
16clean-files := $(obj)/screen.h $(obj)/bootlogo.rh 11clean-files := $(obj)/screen.h
diff --git a/arch/m68k/platform/68EZ328/bootlogo.h b/arch/m68k/platform/68VZ328/bootlogo.h
index e842bdae5839..b38e2b255142 100644
--- a/arch/m68k/platform/68EZ328/bootlogo.h
+++ b/arch/m68k/platform/68VZ328/bootlogo.h
@@ -1,6 +1,6 @@
1#define splash_width 640 1#define splash_width 640
2#define splash_height 480 2#define splash_height 480
3static unsigned char splash_bits[] = { 3unsigned char __attribute__ ((aligned(16))) bootlogo_bits[] = {
4 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 4 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
5 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 5 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
6 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 6 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
diff --git a/arch/m68k/platform/coldfire/device.c b/arch/m68k/platform/coldfire/device.c
index fa50c48292ff..7af97362b95c 100644
--- a/arch/m68k/platform/coldfire/device.c
+++ b/arch/m68k/platform/coldfire/device.c
@@ -114,7 +114,7 @@ static struct resource mcf_fec1_resources[] = {
114 114
115static struct platform_device mcf_fec1 = { 115static struct platform_device mcf_fec1 = {
116 .name = "fec", 116 .name = "fec",
117 .id = 0, 117 .id = 1,
118 .num_resources = ARRAY_SIZE(mcf_fec1_resources), 118 .num_resources = ARRAY_SIZE(mcf_fec1_resources),
119 .resource = mcf_fec1_resources, 119 .resource = mcf_fec1_resources,
120}; 120};
diff --git a/arch/mips/ath79/dev-wmac.c b/arch/mips/ath79/dev-wmac.c
index e21507052066..9c717bf98ffe 100644
--- a/arch/mips/ath79/dev-wmac.c
+++ b/arch/mips/ath79/dev-wmac.c
@@ -58,8 +58,8 @@ static void __init ar913x_wmac_setup(void)
58 58
59static int ar933x_wmac_reset(void) 59static int ar933x_wmac_reset(void)
60{ 60{
61 ath79_device_reset_clear(AR933X_RESET_WMAC);
62 ath79_device_reset_set(AR933X_RESET_WMAC); 61 ath79_device_reset_set(AR933X_RESET_WMAC);
62 ath79_device_reset_clear(AR933X_RESET_WMAC);
63 63
64 return 0; 64 return 0;
65} 65}
diff --git a/arch/mips/include/asm/mach-jz4740/irq.h b/arch/mips/include/asm/mach-jz4740/irq.h
index a865c983c70a..5ad1a9c113c6 100644
--- a/arch/mips/include/asm/mach-jz4740/irq.h
+++ b/arch/mips/include/asm/mach-jz4740/irq.h
@@ -45,7 +45,7 @@
45#define JZ4740_IRQ_LCD JZ4740_IRQ(30) 45#define JZ4740_IRQ_LCD JZ4740_IRQ(30)
46 46
47/* 2nd-level interrupts */ 47/* 2nd-level interrupts */
48#define JZ4740_IRQ_DMA(x) (JZ4740_IRQ(32) + (X)) 48#define JZ4740_IRQ_DMA(x) (JZ4740_IRQ(32) + (x))
49 49
50#define JZ4740_IRQ_INTC_GPIO(x) (JZ4740_IRQ_GPIO0 - (x)) 50#define JZ4740_IRQ_INTC_GPIO(x) (JZ4740_IRQ_GPIO0 - (x))
51#define JZ4740_IRQ_GPIO(x) (JZ4740_IRQ(48) + (x)) 51#define JZ4740_IRQ_GPIO(x) (JZ4740_IRQ(48) + (x))
diff --git a/arch/mips/include/asm/mmu_context.h b/arch/mips/include/asm/mmu_context.h
index 73c0d45798de..9b02cfba7449 100644
--- a/arch/mips/include/asm/mmu_context.h
+++ b/arch/mips/include/asm/mmu_context.h
@@ -37,12 +37,6 @@ extern void tlbmiss_handler_setup_pgd(unsigned long pgd);
37 write_c0_xcontext((unsigned long) smp_processor_id() << 51); \ 37 write_c0_xcontext((unsigned long) smp_processor_id() << 51); \
38 } while (0) 38 } while (0)
39 39
40
41static inline unsigned long get_current_pgd(void)
42{
43 return PHYS_TO_XKSEG_CACHED((read_c0_context() >> 11) & ~0xfffUL);
44}
45
46#else /* CONFIG_MIPS_PGD_C0_CONTEXT: using pgd_current*/ 40#else /* CONFIG_MIPS_PGD_C0_CONTEXT: using pgd_current*/
47 41
48/* 42/*
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c
index 185ca00c4c84..d5a338a1739c 100644
--- a/arch/mips/kernel/signal.c
+++ b/arch/mips/kernel/signal.c
@@ -257,11 +257,8 @@ asmlinkage int sys_sigsuspend(nabi_no_regargs struct pt_regs regs)
257 return -EFAULT; 257 return -EFAULT;
258 sigdelsetmask(&newset, ~_BLOCKABLE); 258 sigdelsetmask(&newset, ~_BLOCKABLE);
259 259
260 spin_lock_irq(&current->sighand->siglock);
261 current->saved_sigmask = current->blocked; 260 current->saved_sigmask = current->blocked;
262 current->blocked = newset; 261 set_current_blocked(&newset);
263 recalc_sigpending();
264 spin_unlock_irq(&current->sighand->siglock);
265 262
266 current->state = TASK_INTERRUPTIBLE; 263 current->state = TASK_INTERRUPTIBLE;
267 schedule(); 264 schedule();
@@ -286,11 +283,8 @@ asmlinkage int sys_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
286 return -EFAULT; 283 return -EFAULT;
287 sigdelsetmask(&newset, ~_BLOCKABLE); 284 sigdelsetmask(&newset, ~_BLOCKABLE);
288 285
289 spin_lock_irq(&current->sighand->siglock);
290 current->saved_sigmask = current->blocked; 286 current->saved_sigmask = current->blocked;
291 current->blocked = newset; 287 set_current_blocked(&newset);
292 recalc_sigpending();
293 spin_unlock_irq(&current->sighand->siglock);
294 288
295 current->state = TASK_INTERRUPTIBLE; 289 current->state = TASK_INTERRUPTIBLE;
296 schedule(); 290 schedule();
@@ -362,10 +356,7 @@ asmlinkage void sys_sigreturn(nabi_no_regargs struct pt_regs regs)
362 goto badframe; 356 goto badframe;
363 357
364 sigdelsetmask(&blocked, ~_BLOCKABLE); 358 sigdelsetmask(&blocked, ~_BLOCKABLE);
365 spin_lock_irq(&current->sighand->siglock); 359 set_current_blocked(&blocked);
366 current->blocked = blocked;
367 recalc_sigpending();
368 spin_unlock_irq(&current->sighand->siglock);
369 360
370 sig = restore_sigcontext(&regs, &frame->sf_sc); 361 sig = restore_sigcontext(&regs, &frame->sf_sc);
371 if (sig < 0) 362 if (sig < 0)
@@ -401,10 +392,7 @@ asmlinkage void sys_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
401 goto badframe; 392 goto badframe;
402 393
403 sigdelsetmask(&set, ~_BLOCKABLE); 394 sigdelsetmask(&set, ~_BLOCKABLE);
404 spin_lock_irq(&current->sighand->siglock); 395 set_current_blocked(&set);
405 current->blocked = set;
406 recalc_sigpending();
407 spin_unlock_irq(&current->sighand->siglock);
408 396
409 sig = restore_sigcontext(&regs, &frame->rs_uc.uc_mcontext); 397 sig = restore_sigcontext(&regs, &frame->rs_uc.uc_mcontext);
410 if (sig < 0) 398 if (sig < 0)
@@ -580,12 +568,7 @@ static int handle_signal(unsigned long sig, siginfo_t *info,
580 if (ret) 568 if (ret)
581 return ret; 569 return ret;
582 570
583 spin_lock_irq(&current->sighand->siglock); 571 block_sigmask(ka, sig);
584 sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
585 if (!(ka->sa.sa_flags & SA_NODEFER))
586 sigaddset(&current->blocked, sig);
587 recalc_sigpending();
588 spin_unlock_irq(&current->sighand->siglock);
589 572
590 return ret; 573 return ret;
591} 574}
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c
index 06b5da392e24..ac3b8d89aae5 100644
--- a/arch/mips/kernel/signal32.c
+++ b/arch/mips/kernel/signal32.c
@@ -290,11 +290,8 @@ asmlinkage int sys32_sigsuspend(nabi_no_regargs struct pt_regs regs)
290 return -EFAULT; 290 return -EFAULT;
291 sigdelsetmask(&newset, ~_BLOCKABLE); 291 sigdelsetmask(&newset, ~_BLOCKABLE);
292 292
293 spin_lock_irq(&current->sighand->siglock);
294 current->saved_sigmask = current->blocked; 293 current->saved_sigmask = current->blocked;
295 current->blocked = newset; 294 set_current_blocked(&newset);
296 recalc_sigpending();
297 spin_unlock_irq(&current->sighand->siglock);
298 295
299 current->state = TASK_INTERRUPTIBLE; 296 current->state = TASK_INTERRUPTIBLE;
300 schedule(); 297 schedule();
@@ -318,11 +315,8 @@ asmlinkage int sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
318 return -EFAULT; 315 return -EFAULT;
319 sigdelsetmask(&newset, ~_BLOCKABLE); 316 sigdelsetmask(&newset, ~_BLOCKABLE);
320 317
321 spin_lock_irq(&current->sighand->siglock);
322 current->saved_sigmask = current->blocked; 318 current->saved_sigmask = current->blocked;
323 current->blocked = newset; 319 set_current_blocked(&newset);
324 recalc_sigpending();
325 spin_unlock_irq(&current->sighand->siglock);
326 320
327 current->state = TASK_INTERRUPTIBLE; 321 current->state = TASK_INTERRUPTIBLE;
328 schedule(); 322 schedule();
@@ -488,10 +482,7 @@ asmlinkage void sys32_sigreturn(nabi_no_regargs struct pt_regs regs)
488 goto badframe; 482 goto badframe;
489 483
490 sigdelsetmask(&blocked, ~_BLOCKABLE); 484 sigdelsetmask(&blocked, ~_BLOCKABLE);
491 spin_lock_irq(&current->sighand->siglock); 485 set_current_blocked(&blocked);
492 current->blocked = blocked;
493 recalc_sigpending();
494 spin_unlock_irq(&current->sighand->siglock);
495 486
496 sig = restore_sigcontext32(&regs, &frame->sf_sc); 487 sig = restore_sigcontext32(&regs, &frame->sf_sc);
497 if (sig < 0) 488 if (sig < 0)
@@ -529,10 +520,7 @@ asmlinkage void sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
529 goto badframe; 520 goto badframe;
530 521
531 sigdelsetmask(&set, ~_BLOCKABLE); 522 sigdelsetmask(&set, ~_BLOCKABLE);
532 spin_lock_irq(&current->sighand->siglock); 523 set_current_blocked(&set);
533 current->blocked = set;
534 recalc_sigpending();
535 spin_unlock_irq(&current->sighand->siglock);
536 524
537 sig = restore_sigcontext32(&regs, &frame->rs_uc.uc_mcontext); 525 sig = restore_sigcontext32(&regs, &frame->rs_uc.uc_mcontext);
538 if (sig < 0) 526 if (sig < 0)
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c
index ae29e894ab8d..86eb4b04631c 100644
--- a/arch/mips/kernel/signal_n32.c
+++ b/arch/mips/kernel/signal_n32.c
@@ -93,11 +93,8 @@ asmlinkage int sysn32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs)
93 sigset_from_compat(&newset, &uset); 93 sigset_from_compat(&newset, &uset);
94 sigdelsetmask(&newset, ~_BLOCKABLE); 94 sigdelsetmask(&newset, ~_BLOCKABLE);
95 95
96 spin_lock_irq(&current->sighand->siglock);
97 current->saved_sigmask = current->blocked; 96 current->saved_sigmask = current->blocked;
98 current->blocked = newset; 97 set_current_blocked(&newset);
99 recalc_sigpending();
100 spin_unlock_irq(&current->sighand->siglock);
101 98
102 current->state = TASK_INTERRUPTIBLE; 99 current->state = TASK_INTERRUPTIBLE;
103 schedule(); 100 schedule();
@@ -121,10 +118,7 @@ asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs)
121 goto badframe; 118 goto badframe;
122 119
123 sigdelsetmask(&set, ~_BLOCKABLE); 120 sigdelsetmask(&set, ~_BLOCKABLE);
124 spin_lock_irq(&current->sighand->siglock); 121 set_current_blocked(&set);
125 current->blocked = set;
126 recalc_sigpending();
127 spin_unlock_irq(&current->sighand->siglock);
128 122
129 sig = restore_sigcontext(&regs, &frame->rs_uc.uc_mcontext); 123 sig = restore_sigcontext(&regs, &frame->rs_uc.uc_mcontext);
130 if (sig < 0) 124 if (sig < 0)
diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c
index 4f004596a6e7..0b3393381a81 100644
--- a/arch/parisc/kernel/pdc_cons.c
+++ b/arch/parisc/kernel/pdc_cons.c
@@ -104,7 +104,7 @@ static int pdc_console_tty_open(struct tty_struct *tty, struct file *filp)
104 104
105static void pdc_console_tty_close(struct tty_struct *tty, struct file *filp) 105static void pdc_console_tty_close(struct tty_struct *tty, struct file *filp)
106{ 106{
107 if (!tty->count) { 107 if (tty->count == 1) {
108 del_timer_sync(&pdc_console_timer); 108 del_timer_sync(&pdc_console_timer);
109 tty_port_tty_set(&tty_port, NULL); 109 tty_port_tty_set(&tty_port, NULL);
110 } 110 }
diff --git a/arch/powerpc/boot/dts/fsl/pq3-mpic-message-B.dtsi b/arch/powerpc/boot/dts/fsl/pq3-mpic-message-B.dtsi
new file mode 100644
index 000000000000..1cf0b77b1efe
--- /dev/null
+++ b/arch/powerpc/boot/dts/fsl/pq3-mpic-message-B.dtsi
@@ -0,0 +1,43 @@
1/*
2 * PQ3 MPIC Message (Group B) device tree stub [ controller @ offset 0x42400 ]
3 *
4 * Copyright 2012 Freescale Semiconductor Inc.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of Freescale Semiconductor nor the
14 * names of its contributors may be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 *
18 * ALTERNATIVELY, this software may be distributed under the terms of the
19 * GNU General Public License ("GPL") as published by the Free Software
20 * Foundation, either version 2 of that License or (at your option) any
21 * later version.
22 *
23 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
24 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
27 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */
34
35message@42400 {
36 compatible = "fsl,mpic-v3.1-msgr";
37 reg = <0x42400 0x200>;
38 interrupts = <
39 0xb4 2 0 0
40 0xb5 2 0 0
41 0xb6 2 0 0
42 0xb7 2 0 0>;
43};
diff --git a/arch/powerpc/boot/dts/fsl/pq3-mpic.dtsi b/arch/powerpc/boot/dts/fsl/pq3-mpic.dtsi
index fdedf7b1fe0f..71c30eb10056 100644
--- a/arch/powerpc/boot/dts/fsl/pq3-mpic.dtsi
+++ b/arch/powerpc/boot/dts/fsl/pq3-mpic.dtsi
@@ -53,6 +53,16 @@ timer@41100 {
53 3 0 3 0>; 53 3 0 3 0>;
54}; 54};
55 55
56message@41400 {
57 compatible = "fsl,mpic-v3.1-msgr";
58 reg = <0x41400 0x200>;
59 interrupts = <
60 0xb0 2 0 0
61 0xb1 2 0 0
62 0xb2 2 0 0
63 0xb3 2 0 0>;
64};
65
56msi@41600 { 66msi@41600 {
57 compatible = "fsl,mpic-msi"; 67 compatible = "fsl,mpic-msi";
58 reg = <0x41600 0x80>; 68 reg = <0x41600 0x80>;
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index 548da3aa0a30..d58fc4e4149c 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -288,13 +288,6 @@ label##_hv: \
288/* Exception addition: Hard disable interrupts */ 288/* Exception addition: Hard disable interrupts */
289#define DISABLE_INTS SOFT_DISABLE_INTS(r10,r11) 289#define DISABLE_INTS SOFT_DISABLE_INTS(r10,r11)
290 290
291/* Exception addition: Keep interrupt state */
292#define ENABLE_INTS \
293 ld r11,PACAKMSR(r13); \
294 ld r12,_MSR(r1); \
295 rlwimi r11,r12,0,MSR_EE; \
296 mtmsrd r11,1
297
298#define ADD_NVGPRS \ 291#define ADD_NVGPRS \
299 bl .save_nvgprs 292 bl .save_nvgprs
300 293
diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h
index e648af92ced1..0e40843a1c6e 100644
--- a/arch/powerpc/include/asm/irq.h
+++ b/arch/powerpc/include/asm/irq.h
@@ -18,10 +18,6 @@
18#include <linux/atomic.h> 18#include <linux/atomic.h>
19 19
20 20
21/* Define a way to iterate across irqs. */
22#define for_each_irq(i) \
23 for ((i) = 0; (i) < NR_IRQS; ++(i))
24
25extern atomic_t ppc_n_lost_interrupts; 21extern atomic_t ppc_n_lost_interrupts;
26 22
27/* This number is used when no interrupt has been assigned */ 23/* This number is used when no interrupt has been assigned */
diff --git a/arch/powerpc/include/asm/mpic.h b/arch/powerpc/include/asm/mpic.h
index c65b9294376e..c9f698a994be 100644
--- a/arch/powerpc/include/asm/mpic.h
+++ b/arch/powerpc/include/asm/mpic.h
@@ -275,9 +275,6 @@ struct mpic
275 unsigned int isu_mask; 275 unsigned int isu_mask;
276 /* Number of sources */ 276 /* Number of sources */
277 unsigned int num_sources; 277 unsigned int num_sources;
278 /* default senses array */
279 unsigned char *senses;
280 unsigned int senses_count;
281 278
282 /* vector numbers used for internal sources (ipi/timers) */ 279 /* vector numbers used for internal sources (ipi/timers) */
283 unsigned int ipi_vecs[4]; 280 unsigned int ipi_vecs[4];
@@ -415,21 +412,6 @@ extern struct mpic *mpic_alloc(struct device_node *node,
415extern void mpic_assign_isu(struct mpic *mpic, unsigned int isu_num, 412extern void mpic_assign_isu(struct mpic *mpic, unsigned int isu_num,
416 phys_addr_t phys_addr); 413 phys_addr_t phys_addr);
417 414
418/* Set default sense codes
419 *
420 * @mpic: controller
421 * @senses: array of sense codes
422 * @count: size of above array
423 *
424 * Optionally provide an array (indexed on hardware interrupt numbers
425 * for this MPIC) of default sense codes for the chip. Those are linux
426 * sense codes IRQ_TYPE_*
427 *
428 * The driver gets ownership of the pointer, don't dispose of it or
429 * anything like that. __init only.
430 */
431extern void mpic_set_default_senses(struct mpic *mpic, u8 *senses, int count);
432
433 415
434/* Initialize the controller. After this has been called, none of the above 416/* Initialize the controller. After this has been called, none of the above
435 * should be called again for this mpic 417 * should be called again for this mpic
diff --git a/arch/powerpc/include/asm/mpic_msgr.h b/arch/powerpc/include/asm/mpic_msgr.h
index 3ec37dc9003e..326d33ca55cd 100644
--- a/arch/powerpc/include/asm/mpic_msgr.h
+++ b/arch/powerpc/include/asm/mpic_msgr.h
@@ -13,6 +13,7 @@
13 13
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/spinlock.h> 15#include <linux/spinlock.h>
16#include <asm/smp.h>
16 17
17struct mpic_msgr { 18struct mpic_msgr {
18 u32 __iomem *base; 19 u32 __iomem *base;
diff --git a/arch/powerpc/include/asm/reg_booke.h b/arch/powerpc/include/asm/reg_booke.h
index b86faa9107da..8a97aa7289d3 100644
--- a/arch/powerpc/include/asm/reg_booke.h
+++ b/arch/powerpc/include/asm/reg_booke.h
@@ -15,11 +15,6 @@
15#ifndef __ASM_POWERPC_REG_BOOKE_H__ 15#ifndef __ASM_POWERPC_REG_BOOKE_H__
16#define __ASM_POWERPC_REG_BOOKE_H__ 16#define __ASM_POWERPC_REG_BOOKE_H__
17 17
18#ifdef CONFIG_BOOKE_WDT
19extern u32 booke_wdt_enabled;
20extern u32 booke_wdt_period;
21#endif /* CONFIG_BOOKE_WDT */
22
23/* Machine State Register (MSR) Fields */ 18/* Machine State Register (MSR) Fields */
24#define MSR_GS (1<<28) /* Guest state */ 19#define MSR_GS (1<<28) /* Guest state */
25#define MSR_UCLE (1<<26) /* User-mode cache lock enable */ 20#define MSR_UCLE (1<<26) /* User-mode cache lock enable */
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index f8a7a1a1a9f4..fc6015027a86 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -767,16 +767,6 @@ do_work:
767 SOFT_DISABLE_INTS(r3,r4) 767 SOFT_DISABLE_INTS(r3,r4)
7681: bl .preempt_schedule_irq 7681: bl .preempt_schedule_irq
769 769
770 /* Hard-disable interrupts again (and update PACA) */
771#ifdef CONFIG_PPC_BOOK3E
772 wrteei 0
773#else
774 ld r10,PACAKMSR(r13) /* Get kernel MSR without EE */
775 mtmsrd r10,1
776#endif /* CONFIG_PPC_BOOK3E */
777 li r0,PACA_IRQ_HARD_DIS
778 stb r0,PACAIRQHAPPENED(r13)
779
780 /* Re-test flags and eventually loop */ 770 /* Re-test flags and eventually loop */
781 clrrdi r9,r1,THREAD_SHIFT 771 clrrdi r9,r1,THREAD_SHIFT
782 ld r4,TI_FLAGS(r9) 772 ld r4,TI_FLAGS(r9)
@@ -787,14 +777,6 @@ do_work:
787user_work: 777user_work:
788#endif /* CONFIG_PREEMPT */ 778#endif /* CONFIG_PREEMPT */
789 779
790 /* Enable interrupts */
791#ifdef CONFIG_PPC_BOOK3E
792 wrteei 1
793#else
794 ori r10,r10,MSR_EE
795 mtmsrd r10,1
796#endif /* CONFIG_PPC_BOOK3E */
797
798 andi. r0,r4,_TIF_NEED_RESCHED 780 andi. r0,r4,_TIF_NEED_RESCHED
799 beq 1f 781 beq 1f
800 bl .restore_interrupts 782 bl .restore_interrupts
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index cb705fdbb458..8f880bc77c56 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -768,8 +768,8 @@ alignment_common:
768 std r3,_DAR(r1) 768 std r3,_DAR(r1)
769 std r4,_DSISR(r1) 769 std r4,_DSISR(r1)
770 bl .save_nvgprs 770 bl .save_nvgprs
771 DISABLE_INTS
771 addi r3,r1,STACK_FRAME_OVERHEAD 772 addi r3,r1,STACK_FRAME_OVERHEAD
772 ENABLE_INTS
773 bl .alignment_exception 773 bl .alignment_exception
774 b .ret_from_except 774 b .ret_from_except
775 775
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 5ec1b2354ca6..c6c6f3b7f8cd 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -260,11 +260,17 @@ EXPORT_SYMBOL(arch_local_irq_restore);
260 * if they are currently disabled. This is typically called before 260 * if they are currently disabled. This is typically called before
261 * schedule() or do_signal() when returning to userspace. We do it 261 * schedule() or do_signal() when returning to userspace. We do it
262 * in C to avoid the burden of dealing with lockdep etc... 262 * in C to avoid the burden of dealing with lockdep etc...
263 *
264 * NOTE: This is called with interrupts hard disabled but not marked
265 * as such in paca->irq_happened, so we need to resync this.
263 */ 266 */
264void restore_interrupts(void) 267void restore_interrupts(void)
265{ 268{
266 if (irqs_disabled()) 269 if (irqs_disabled()) {
270 local_paca->irq_happened |= PACA_IRQ_HARD_DIS;
267 local_irq_enable(); 271 local_irq_enable();
272 } else
273 __hard_irq_enable();
268} 274}
269 275
270#endif /* CONFIG_PPC64 */ 276#endif /* CONFIG_PPC64 */
@@ -330,14 +336,10 @@ void migrate_irqs(void)
330 336
331 alloc_cpumask_var(&mask, GFP_KERNEL); 337 alloc_cpumask_var(&mask, GFP_KERNEL);
332 338
333 for_each_irq(irq) { 339 for_each_irq_desc(irq, desc) {
334 struct irq_data *data; 340 struct irq_data *data;
335 struct irq_chip *chip; 341 struct irq_chip *chip;
336 342
337 desc = irq_to_desc(irq);
338 if (!desc)
339 continue;
340
341 data = irq_desc_get_irq_data(desc); 343 data = irq_desc_get_irq_data(desc);
342 if (irqd_is_per_cpu(data)) 344 if (irqd_is_per_cpu(data))
343 continue; 345 continue;
diff --git a/arch/powerpc/kernel/machine_kexec.c b/arch/powerpc/kernel/machine_kexec.c
index c957b1202bdc..5df777794403 100644
--- a/arch/powerpc/kernel/machine_kexec.c
+++ b/arch/powerpc/kernel/machine_kexec.c
@@ -23,14 +23,11 @@
23 23
24void machine_kexec_mask_interrupts(void) { 24void machine_kexec_mask_interrupts(void) {
25 unsigned int i; 25 unsigned int i;
26 struct irq_desc *desc;
26 27
27 for_each_irq(i) { 28 for_each_irq_desc(i, desc) {
28 struct irq_desc *desc = irq_to_desc(i);
29 struct irq_chip *chip; 29 struct irq_chip *chip;
30 30
31 if (!desc)
32 continue;
33
34 chip = irq_desc_get_chip(desc); 31 chip = irq_desc_get_chip(desc);
35 if (!chip) 32 if (!chip)
36 continue; 33 continue;
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 9825f29d1faf..ec8a53fa9e8f 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -150,6 +150,9 @@ notrace void __init machine_init(u64 dt_ptr)
150} 150}
151 151
152#ifdef CONFIG_BOOKE_WDT 152#ifdef CONFIG_BOOKE_WDT
153extern u32 booke_wdt_enabled;
154extern u32 booke_wdt_period;
155
153/* Checks wdt=x and wdt_period=xx command-line option */ 156/* Checks wdt=x and wdt_period=xx command-line option */
154notrace int __init early_parse_wdt(char *p) 157notrace int __init early_parse_wdt(char *p)
155{ 158{
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 6aa0c663e247..158972341a2d 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -248,7 +248,7 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
248 addr, regs->nip, regs->link, code); 248 addr, regs->nip, regs->link, code);
249 } 249 }
250 250
251 if (!arch_irq_disabled_regs(regs)) 251 if (arch_irqs_disabled() && !arch_irq_disabled_regs(regs))
252 local_irq_enable(); 252 local_irq_enable();
253 253
254 memset(&info, 0, sizeof(info)); 254 memset(&info, 0, sizeof(info));
@@ -1019,7 +1019,9 @@ void __kprobes program_check_exception(struct pt_regs *regs)
1019 return; 1019 return;
1020 } 1020 }
1021 1021
1022 local_irq_enable(); 1022 /* We restore the interrupt state now */
1023 if (!arch_irq_disabled_regs(regs))
1024 local_irq_enable();
1023 1025
1024#ifdef CONFIG_MATH_EMULATION 1026#ifdef CONFIG_MATH_EMULATION
1025 /* (reason & REASON_ILLEGAL) would be the obvious thing here, 1027 /* (reason & REASON_ILLEGAL) would be the obvious thing here,
@@ -1069,6 +1071,10 @@ void alignment_exception(struct pt_regs *regs)
1069{ 1071{
1070 int sig, code, fixed = 0; 1072 int sig, code, fixed = 0;
1071 1073
1074 /* We restore the interrupt state now */
1075 if (!arch_irq_disabled_regs(regs))
1076 local_irq_enable();
1077
1072 /* we don't implement logging of alignment exceptions */ 1078 /* we don't implement logging of alignment exceptions */
1073 if (!(current->thread.align_ctl & PR_UNALIGN_SIGBUS)) 1079 if (!(current->thread.align_ctl & PR_UNALIGN_SIGBUS))
1074 fixed = fix_alignment(regs); 1080 fixed = fix_alignment(regs);
diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c
index ddc485a529f2..c3beaeef3f60 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
@@ -258,6 +258,8 @@ static long kvmppc_get_guest_page(struct kvm *kvm, unsigned long gfn,
258 !(memslot->userspace_addr & (s - 1))) { 258 !(memslot->userspace_addr & (s - 1))) {
259 start &= ~(s - 1); 259 start &= ~(s - 1);
260 pgsize = s; 260 pgsize = s;
261 get_page(hpage);
262 put_page(page);
261 page = hpage; 263 page = hpage;
262 } 264 }
263 } 265 }
@@ -281,11 +283,8 @@ static long kvmppc_get_guest_page(struct kvm *kvm, unsigned long gfn,
281 err = 0; 283 err = 0;
282 284
283 out: 285 out:
284 if (got) { 286 if (got)
285 if (PageHuge(page))
286 page = compound_head(page);
287 put_page(page); 287 put_page(page);
288 }
289 return err; 288 return err;
290 289
291 up_err: 290 up_err:
@@ -678,8 +677,15 @@ int kvmppc_book3s_hv_page_fault(struct kvm_run *run, struct kvm_vcpu *vcpu,
678 SetPageDirty(page); 677 SetPageDirty(page);
679 678
680 out_put: 679 out_put:
681 if (page) 680 if (page) {
682 put_page(page); 681 /*
682 * We drop pages[0] here, not page because page might
683 * have been set to the head page of a compound, but
684 * we have to drop the reference on the correct tail
685 * page to match the get inside gup()
686 */
687 put_page(pages[0]);
688 }
683 return ret; 689 return ret;
684 690
685 out_unlock: 691 out_unlock:
@@ -979,6 +985,7 @@ void *kvmppc_pin_guest_page(struct kvm *kvm, unsigned long gpa,
979 pa = *physp; 985 pa = *physp;
980 } 986 }
981 page = pfn_to_page(pa >> PAGE_SHIFT); 987 page = pfn_to_page(pa >> PAGE_SHIFT);
988 get_page(page);
982 } else { 989 } else {
983 hva = gfn_to_hva_memslot(memslot, gfn); 990 hva = gfn_to_hva_memslot(memslot, gfn);
984 npages = get_user_pages_fast(hva, 1, 1, pages); 991 npages = get_user_pages_fast(hva, 1, 1, pages);
@@ -991,8 +998,6 @@ void *kvmppc_pin_guest_page(struct kvm *kvm, unsigned long gpa,
991 page = compound_head(page); 998 page = compound_head(page);
992 psize <<= compound_order(page); 999 psize <<= compound_order(page);
993 } 1000 }
994 if (!kvm->arch.using_mmu_notifiers)
995 get_page(page);
996 offset = gpa & (psize - 1); 1001 offset = gpa & (psize - 1);
997 if (nb_ret) 1002 if (nb_ret)
998 *nb_ret = psize - offset; 1003 *nb_ret = psize - offset;
@@ -1003,7 +1008,6 @@ void kvmppc_unpin_guest_page(struct kvm *kvm, void *va)
1003{ 1008{
1004 struct page *page = virt_to_page(va); 1009 struct page *page = virt_to_page(va);
1005 1010
1006 page = compound_head(page);
1007 put_page(page); 1011 put_page(page);
1008} 1012}
1009 1013
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 01294a5099dd..108d1f580177 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -1192,8 +1192,6 @@ static void unpin_slot(struct kvm *kvm, int slot_id)
1192 continue; 1192 continue;
1193 pfn = physp[j] >> PAGE_SHIFT; 1193 pfn = physp[j] >> PAGE_SHIFT;
1194 page = pfn_to_page(pfn); 1194 page = pfn_to_page(pfn);
1195 if (PageHuge(page))
1196 page = compound_head(page);
1197 SetPageDirty(page); 1195 SetPageDirty(page);
1198 put_page(page); 1196 put_page(page);
1199 } 1197 }
diff --git a/arch/powerpc/net/bpf_jit.h b/arch/powerpc/net/bpf_jit.h
index af1ab5e9a691..5c3cf2d04e41 100644
--- a/arch/powerpc/net/bpf_jit.h
+++ b/arch/powerpc/net/bpf_jit.h
@@ -48,7 +48,13 @@
48/* 48/*
49 * Assembly helpers from arch/powerpc/net/bpf_jit.S: 49 * Assembly helpers from arch/powerpc/net/bpf_jit.S:
50 */ 50 */
51extern u8 sk_load_word[], sk_load_half[], sk_load_byte[], sk_load_byte_msh[]; 51#define DECLARE_LOAD_FUNC(func) \
52 extern u8 func[], func##_negative_offset[], func##_positive_offset[]
53
54DECLARE_LOAD_FUNC(sk_load_word);
55DECLARE_LOAD_FUNC(sk_load_half);
56DECLARE_LOAD_FUNC(sk_load_byte);
57DECLARE_LOAD_FUNC(sk_load_byte_msh);
52 58
53#define FUNCTION_DESCR_SIZE 24 59#define FUNCTION_DESCR_SIZE 24
54 60
diff --git a/arch/powerpc/net/bpf_jit_64.S b/arch/powerpc/net/bpf_jit_64.S
index ff4506e85cce..55ba3855a97f 100644
--- a/arch/powerpc/net/bpf_jit_64.S
+++ b/arch/powerpc/net/bpf_jit_64.S
@@ -31,14 +31,13 @@
31 * then branch directly to slow_path_XXX if required. (In fact, could 31 * then branch directly to slow_path_XXX if required. (In fact, could
32 * load a spare GPR with the address of slow_path_generic and pass size 32 * load a spare GPR with the address of slow_path_generic and pass size
33 * as an argument, making the call site a mtlr, li and bllr.) 33 * as an argument, making the call site a mtlr, li and bllr.)
34 *
35 * Technically, the "is addr < 0" check is unnecessary & slowing down
36 * the ABS path, as it's statically checked on generation.
37 */ 34 */
38 .globl sk_load_word 35 .globl sk_load_word
39sk_load_word: 36sk_load_word:
40 cmpdi r_addr, 0 37 cmpdi r_addr, 0
41 blt bpf_error 38 blt bpf_slow_path_word_neg
39 .globl sk_load_word_positive_offset
40sk_load_word_positive_offset:
42 /* Are we accessing past headlen? */ 41 /* Are we accessing past headlen? */
43 subi r_scratch1, r_HL, 4 42 subi r_scratch1, r_HL, 4
44 cmpd r_scratch1, r_addr 43 cmpd r_scratch1, r_addr
@@ -51,7 +50,9 @@ sk_load_word:
51 .globl sk_load_half 50 .globl sk_load_half
52sk_load_half: 51sk_load_half:
53 cmpdi r_addr, 0 52 cmpdi r_addr, 0
54 blt bpf_error 53 blt bpf_slow_path_half_neg
54 .globl sk_load_half_positive_offset
55sk_load_half_positive_offset:
55 subi r_scratch1, r_HL, 2 56 subi r_scratch1, r_HL, 2
56 cmpd r_scratch1, r_addr 57 cmpd r_scratch1, r_addr
57 blt bpf_slow_path_half 58 blt bpf_slow_path_half
@@ -61,7 +62,9 @@ sk_load_half:
61 .globl sk_load_byte 62 .globl sk_load_byte
62sk_load_byte: 63sk_load_byte:
63 cmpdi r_addr, 0 64 cmpdi r_addr, 0
64 blt bpf_error 65 blt bpf_slow_path_byte_neg
66 .globl sk_load_byte_positive_offset
67sk_load_byte_positive_offset:
65 cmpd r_HL, r_addr 68 cmpd r_HL, r_addr
66 ble bpf_slow_path_byte 69 ble bpf_slow_path_byte
67 lbzx r_A, r_D, r_addr 70 lbzx r_A, r_D, r_addr
@@ -69,22 +72,20 @@ sk_load_byte:
69 72
70/* 73/*
71 * BPF_S_LDX_B_MSH: ldxb 4*([offset]&0xf) 74 * BPF_S_LDX_B_MSH: ldxb 4*([offset]&0xf)
72 * r_addr is the offset value, already known positive 75 * r_addr is the offset value
73 */ 76 */
74 .globl sk_load_byte_msh 77 .globl sk_load_byte_msh
75sk_load_byte_msh: 78sk_load_byte_msh:
79 cmpdi r_addr, 0
80 blt bpf_slow_path_byte_msh_neg
81 .globl sk_load_byte_msh_positive_offset
82sk_load_byte_msh_positive_offset:
76 cmpd r_HL, r_addr 83 cmpd r_HL, r_addr
77 ble bpf_slow_path_byte_msh 84 ble bpf_slow_path_byte_msh
78 lbzx r_X, r_D, r_addr 85 lbzx r_X, r_D, r_addr
79 rlwinm r_X, r_X, 2, 32-4-2, 31-2 86 rlwinm r_X, r_X, 2, 32-4-2, 31-2
80 blr 87 blr
81 88
82bpf_error:
83 /* Entered with cr0 = lt */
84 li r3, 0
85 /* Generated code will 'blt epilogue', returning 0. */
86 blr
87
88/* Call out to skb_copy_bits: 89/* Call out to skb_copy_bits:
89 * We'll need to back up our volatile regs first; we have 90 * We'll need to back up our volatile regs first; we have
90 * local variable space at r1+(BPF_PPC_STACK_BASIC). 91 * local variable space at r1+(BPF_PPC_STACK_BASIC).
@@ -136,3 +137,84 @@ bpf_slow_path_byte_msh:
136 lbz r_X, BPF_PPC_STACK_BASIC+(2*8)(r1) 137 lbz r_X, BPF_PPC_STACK_BASIC+(2*8)(r1)
137 rlwinm r_X, r_X, 2, 32-4-2, 31-2 138 rlwinm r_X, r_X, 2, 32-4-2, 31-2
138 blr 139 blr
140
141/* Call out to bpf_internal_load_pointer_neg_helper:
142 * We'll need to back up our volatile regs first; we have
143 * local variable space at r1+(BPF_PPC_STACK_BASIC).
144 * Allocate a new stack frame here to remain ABI-compliant in
145 * stashing LR.
146 */
147#define sk_negative_common(SIZE) \
148 mflr r0; \
149 std r0, 16(r1); \
150 /* R3 goes in parameter space of caller's frame */ \
151 std r_skb, (BPF_PPC_STACKFRAME+48)(r1); \
152 std r_A, (BPF_PPC_STACK_BASIC+(0*8))(r1); \
153 std r_X, (BPF_PPC_STACK_BASIC+(1*8))(r1); \
154 stdu r1, -BPF_PPC_SLOWPATH_FRAME(r1); \
155 /* R3 = r_skb, as passed */ \
156 mr r4, r_addr; \
157 li r5, SIZE; \
158 bl bpf_internal_load_pointer_neg_helper; \
159 /* R3 != 0 on success */ \
160 addi r1, r1, BPF_PPC_SLOWPATH_FRAME; \
161 ld r0, 16(r1); \
162 ld r_A, (BPF_PPC_STACK_BASIC+(0*8))(r1); \
163 ld r_X, (BPF_PPC_STACK_BASIC+(1*8))(r1); \
164 mtlr r0; \
165 cmpldi r3, 0; \
166 beq bpf_error_slow; /* cr0 = EQ */ \
167 mr r_addr, r3; \
168 ld r_skb, (BPF_PPC_STACKFRAME+48)(r1); \
169 /* Great success! */
170
171bpf_slow_path_word_neg:
172 lis r_scratch1,-32 /* SKF_LL_OFF */
173 cmpd r_addr, r_scratch1 /* addr < SKF_* */
174 blt bpf_error /* cr0 = LT */
175 .globl sk_load_word_negative_offset
176sk_load_word_negative_offset:
177 sk_negative_common(4)
178 lwz r_A, 0(r_addr)
179 blr
180
181bpf_slow_path_half_neg:
182 lis r_scratch1,-32 /* SKF_LL_OFF */
183 cmpd r_addr, r_scratch1 /* addr < SKF_* */
184 blt bpf_error /* cr0 = LT */
185 .globl sk_load_half_negative_offset
186sk_load_half_negative_offset:
187 sk_negative_common(2)
188 lhz r_A, 0(r_addr)
189 blr
190
191bpf_slow_path_byte_neg:
192 lis r_scratch1,-32 /* SKF_LL_OFF */
193 cmpd r_addr, r_scratch1 /* addr < SKF_* */
194 blt bpf_error /* cr0 = LT */
195 .globl sk_load_byte_negative_offset
196sk_load_byte_negative_offset:
197 sk_negative_common(1)
198 lbz r_A, 0(r_addr)
199 blr
200
201bpf_slow_path_byte_msh_neg:
202 lis r_scratch1,-32 /* SKF_LL_OFF */
203 cmpd r_addr, r_scratch1 /* addr < SKF_* */
204 blt bpf_error /* cr0 = LT */
205 .globl sk_load_byte_msh_negative_offset
206sk_load_byte_msh_negative_offset:
207 sk_negative_common(1)
208 lbz r_X, 0(r_addr)
209 rlwinm r_X, r_X, 2, 32-4-2, 31-2
210 blr
211
212bpf_error_slow:
213 /* fabricate a cr0 = lt */
214 li r_scratch1, -1
215 cmpdi r_scratch1, 0
216bpf_error:
217 /* Entered with cr0 = lt */
218 li r3, 0
219 /* Generated code will 'blt epilogue', returning 0. */
220 blr
diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c
index 73619d3aeb6c..2dc8b1484845 100644
--- a/arch/powerpc/net/bpf_jit_comp.c
+++ b/arch/powerpc/net/bpf_jit_comp.c
@@ -127,6 +127,9 @@ static void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)
127 PPC_BLR(); 127 PPC_BLR();
128} 128}
129 129
130#define CHOOSE_LOAD_FUNC(K, func) \
131 ((int)K < 0 ? ((int)K >= SKF_LL_OFF ? func##_negative_offset : func) : func##_positive_offset)
132
130/* Assemble the body code between the prologue & epilogue. */ 133/* Assemble the body code between the prologue & epilogue. */
131static int bpf_jit_build_body(struct sk_filter *fp, u32 *image, 134static int bpf_jit_build_body(struct sk_filter *fp, u32 *image,
132 struct codegen_context *ctx, 135 struct codegen_context *ctx,
@@ -391,21 +394,16 @@ static int bpf_jit_build_body(struct sk_filter *fp, u32 *image,
391 394
392 /*** Absolute loads from packet header/data ***/ 395 /*** Absolute loads from packet header/data ***/
393 case BPF_S_LD_W_ABS: 396 case BPF_S_LD_W_ABS:
394 func = sk_load_word; 397 func = CHOOSE_LOAD_FUNC(K, sk_load_word);
395 goto common_load; 398 goto common_load;
396 case BPF_S_LD_H_ABS: 399 case BPF_S_LD_H_ABS:
397 func = sk_load_half; 400 func = CHOOSE_LOAD_FUNC(K, sk_load_half);
398 goto common_load; 401 goto common_load;
399 case BPF_S_LD_B_ABS: 402 case BPF_S_LD_B_ABS:
400 func = sk_load_byte; 403 func = CHOOSE_LOAD_FUNC(K, sk_load_byte);
401 common_load: 404 common_load:
402 /* 405 /* Load from [K]. */
403 * Load from [K]. Reference with the (negative)
404 * SKF_NET_OFF/SKF_LL_OFF offsets is unsupported.
405 */
406 ctx->seen |= SEEN_DATAREF; 406 ctx->seen |= SEEN_DATAREF;
407 if ((int)K < 0)
408 return -ENOTSUPP;
409 PPC_LI64(r_scratch1, func); 407 PPC_LI64(r_scratch1, func);
410 PPC_MTLR(r_scratch1); 408 PPC_MTLR(r_scratch1);
411 PPC_LI32(r_addr, K); 409 PPC_LI32(r_addr, K);
@@ -429,7 +427,7 @@ static int bpf_jit_build_body(struct sk_filter *fp, u32 *image,
429 common_load_ind: 427 common_load_ind:
430 /* 428 /*
431 * Load from [X + K]. Negative offsets are tested for 429 * Load from [X + K]. Negative offsets are tested for
432 * in the helper functions, and result in a 'ret 0'. 430 * in the helper functions.
433 */ 431 */
434 ctx->seen |= SEEN_DATAREF | SEEN_XREG; 432 ctx->seen |= SEEN_DATAREF | SEEN_XREG;
435 PPC_LI64(r_scratch1, func); 433 PPC_LI64(r_scratch1, func);
@@ -443,13 +441,7 @@ static int bpf_jit_build_body(struct sk_filter *fp, u32 *image,
443 break; 441 break;
444 442
445 case BPF_S_LDX_B_MSH: 443 case BPF_S_LDX_B_MSH:
446 /* 444 func = CHOOSE_LOAD_FUNC(K, sk_load_byte_msh);
447 * x86 version drops packet (RET 0) when K<0, whereas
448 * interpreter does allow K<0 (__load_pointer, special
449 * ancillary data). common_load returns ENOTSUPP if K<0,
450 * so we fall back to interpreter & filter works.
451 */
452 func = sk_load_byte_msh;
453 goto common_load; 445 goto common_load;
454 break; 446 break;
455 447
diff --git a/arch/powerpc/platforms/85xx/common.c b/arch/powerpc/platforms/85xx/common.c
index 9fef5302adc1..67dac22b4363 100644
--- a/arch/powerpc/platforms/85xx/common.c
+++ b/arch/powerpc/platforms/85xx/common.c
@@ -21,6 +21,12 @@ static struct of_device_id __initdata mpc85xx_common_ids[] = {
21 { .compatible = "fsl,qe", }, 21 { .compatible = "fsl,qe", },
22 { .compatible = "fsl,cpm2", }, 22 { .compatible = "fsl,cpm2", },
23 { .compatible = "fsl,srio", }, 23 { .compatible = "fsl,srio", },
24 /* So that the DMA channel nodes can be probed individually: */
25 { .compatible = "fsl,eloplus-dma", },
26 /* For the PMC driver */
27 { .compatible = "fsl,mpc8548-guts", },
28 /* Probably unnecessary? */
29 { .compatible = "gpio-leds", },
24 {}, 30 {},
25}; 31};
26 32
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 9a6f04406e0d..d208ebccb91c 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -399,12 +399,6 @@ static int __init board_fixups(void)
399machine_arch_initcall(mpc8568_mds, board_fixups); 399machine_arch_initcall(mpc8568_mds, board_fixups);
400machine_arch_initcall(mpc8569_mds, board_fixups); 400machine_arch_initcall(mpc8569_mds, board_fixups);
401 401
402static struct of_device_id mpc85xx_ids[] = {
403 { .compatible = "fsl,mpc8548-guts", },
404 { .compatible = "gpio-leds", },
405 {},
406};
407
408static int __init mpc85xx_publish_devices(void) 402static int __init mpc85xx_publish_devices(void)
409{ 403{
410 if (machine_is(mpc8568_mds)) 404 if (machine_is(mpc8568_mds))
@@ -412,10 +406,7 @@ static int __init mpc85xx_publish_devices(void)
412 if (machine_is(mpc8569_mds)) 406 if (machine_is(mpc8569_mds))
413 simple_gpiochip_init("fsl,mpc8569mds-bcsr-gpio"); 407 simple_gpiochip_init("fsl,mpc8569mds-bcsr-gpio");
414 408
415 mpc85xx_common_publish_devices(); 409 return mpc85xx_common_publish_devices();
416 of_platform_bus_probe(NULL, mpc85xx_ids, NULL);
417
418 return 0;
419} 410}
420 411
421machine_device_initcall(mpc8568_mds, mpc85xx_publish_devices); 412machine_device_initcall(mpc8568_mds, mpc85xx_publish_devices);
diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c b/arch/powerpc/platforms/85xx/p1022_ds.c
index e74b7cde9aee..f700c81a1321 100644
--- a/arch/powerpc/platforms/85xx/p1022_ds.c
+++ b/arch/powerpc/platforms/85xx/p1022_ds.c
@@ -460,18 +460,7 @@ static void __init p1022_ds_setup_arch(void)
460 pr_info("Freescale P1022 DS reference board\n"); 460 pr_info("Freescale P1022 DS reference board\n");
461} 461}
462 462
463static struct of_device_id __initdata p1022_ds_ids[] = { 463machine_device_initcall(p1022_ds, mpc85xx_common_publish_devices);
464 /* So that the DMA channel nodes can be probed individually: */
465 { .compatible = "fsl,eloplus-dma", },
466 {},
467};
468
469static int __init p1022_ds_publish_devices(void)
470{
471 mpc85xx_common_publish_devices();
472 return of_platform_bus_probe(NULL, p1022_ds_ids, NULL);
473}
474machine_device_initcall(p1022_ds, p1022_ds_publish_devices);
475 464
476machine_arch_initcall(p1022_ds, swiotlb_setup_bus_notifier); 465machine_arch_initcall(p1022_ds, swiotlb_setup_bus_notifier);
477 466
diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c
index d09f3e8e6867..85825b5401e5 100644
--- a/arch/powerpc/platforms/cell/axon_msi.c
+++ b/arch/powerpc/platforms/cell/axon_msi.c
@@ -114,7 +114,7 @@ static void axon_msi_cascade(unsigned int irq, struct irq_desc *desc)
114 pr_devel("axon_msi: woff %x roff %x msi %x\n", 114 pr_devel("axon_msi: woff %x roff %x msi %x\n",
115 write_offset, msic->read_offset, msi); 115 write_offset, msic->read_offset, msi);
116 116
117 if (msi < NR_IRQS && irq_get_chip_data(msi) == msic) { 117 if (msi < nr_irqs && irq_get_chip_data(msi) == msic) {
118 generic_handle_irq(msi); 118 generic_handle_irq(msi);
119 msic->fifo_virt[idx] = cpu_to_le32(0xffffffff); 119 msic->fifo_virt[idx] = cpu_to_le32(0xffffffff);
120 } else { 120 } else {
@@ -276,9 +276,6 @@ static int axon_msi_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
276 if (rc) 276 if (rc)
277 return rc; 277 return rc;
278 278
279 /* We rely on being able to stash a virq in a u16 */
280 BUILD_BUG_ON(NR_IRQS > 65536);
281
282 list_for_each_entry(entry, &dev->msi_list, list) { 279 list_for_each_entry(entry, &dev->msi_list, list) {
283 virq = irq_create_direct_mapping(msic->irq_domain); 280 virq = irq_create_direct_mapping(msic->irq_domain);
284 if (virq == NO_IRQ) { 281 if (virq == NO_IRQ) {
@@ -392,7 +389,8 @@ static int axon_msi_probe(struct platform_device *device)
392 } 389 }
393 memset(msic->fifo_virt, 0xff, MSIC_FIFO_SIZE_BYTES); 390 memset(msic->fifo_virt, 0xff, MSIC_FIFO_SIZE_BYTES);
394 391
395 msic->irq_domain = irq_domain_add_nomap(dn, 0, &msic_host_ops, msic); 392 /* We rely on being able to stash a virq in a u16, so limit irqs to < 65536 */
393 msic->irq_domain = irq_domain_add_nomap(dn, 65536, &msic_host_ops, msic);
396 if (!msic->irq_domain) { 394 if (!msic->irq_domain) {
397 printk(KERN_ERR "axon_msi: couldn't allocate irq_domain for %s\n", 395 printk(KERN_ERR "axon_msi: couldn't allocate irq_domain for %s\n",
398 dn->full_name); 396 dn->full_name);
diff --git a/arch/powerpc/platforms/cell/beat_interrupt.c b/arch/powerpc/platforms/cell/beat_interrupt.c
index f9a48af335cb..8c6dc42ecf65 100644
--- a/arch/powerpc/platforms/cell/beat_interrupt.c
+++ b/arch/powerpc/platforms/cell/beat_interrupt.c
@@ -248,6 +248,6 @@ void beatic_deinit_IRQ(void)
248{ 248{
249 int i; 249 int i;
250 250
251 for (i = 1; i < NR_IRQS; i++) 251 for (i = 1; i < nr_irqs; i++)
252 beat_destruct_irq_plug(i); 252 beat_destruct_irq_plug(i);
253} 253}
diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index 996c5ff7824b..03685a329d7d 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -366,11 +366,20 @@ static void kw_i2c_timeout(unsigned long data)
366 unsigned long flags; 366 unsigned long flags;
367 367
368 spin_lock_irqsave(&host->lock, flags); 368 spin_lock_irqsave(&host->lock, flags);
369
370 /*
371 * If the timer is pending, that means we raced with the
372 * irq, in which case we just return
373 */
374 if (timer_pending(&host->timeout_timer))
375 goto skip;
376
369 kw_i2c_handle_interrupt(host, kw_read_reg(reg_isr)); 377 kw_i2c_handle_interrupt(host, kw_read_reg(reg_isr));
370 if (host->state != state_idle) { 378 if (host->state != state_idle) {
371 host->timeout_timer.expires = jiffies + KW_POLL_TIMEOUT; 379 host->timeout_timer.expires = jiffies + KW_POLL_TIMEOUT;
372 add_timer(&host->timeout_timer); 380 add_timer(&host->timeout_timer);
373 } 381 }
382 skip:
374 spin_unlock_irqrestore(&host->lock, flags); 383 spin_unlock_irqrestore(&host->lock, flags);
375} 384}
376 385
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index 66ad93de1d55..c4e630576ff2 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -57,9 +57,9 @@ static int max_real_irqs;
57 57
58static DEFINE_RAW_SPINLOCK(pmac_pic_lock); 58static DEFINE_RAW_SPINLOCK(pmac_pic_lock);
59 59
60#define NR_MASK_WORDS ((NR_IRQS + 31) / 32) 60/* The max irq number this driver deals with is 128; see max_irqs */
61static unsigned long ppc_lost_interrupts[NR_MASK_WORDS]; 61static DECLARE_BITMAP(ppc_lost_interrupts, 128);
62static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS]; 62static DECLARE_BITMAP(ppc_cached_irq_mask, 128);
63static int pmac_irq_cascade = -1; 63static int pmac_irq_cascade = -1;
64static struct irq_domain *pmac_pic_host; 64static struct irq_domain *pmac_pic_host;
65 65
diff --git a/arch/powerpc/platforms/pseries/Kconfig b/arch/powerpc/platforms/pseries/Kconfig
index aadbe4f6d537..178a5f300bc9 100644
--- a/arch/powerpc/platforms/pseries/Kconfig
+++ b/arch/powerpc/platforms/pseries/Kconfig
@@ -30,9 +30,9 @@ config PPC_SPLPAR
30 two or more partitions. 30 two or more partitions.
31 31
32config EEH 32config EEH
33 bool "PCI Extended Error Handling (EEH)" if EXPERT 33 bool
34 depends on PPC_PSERIES && PCI 34 depends on PPC_PSERIES && PCI
35 default y if !EXPERT 35 default y
36 36
37config PSERIES_MSI 37config PSERIES_MSI
38 bool 38 bool
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index 309d38ef7322..a75e37dc41aa 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -1076,7 +1076,7 @@ static void eeh_add_device_late(struct pci_dev *dev)
1076 pr_debug("EEH: Adding device %s\n", pci_name(dev)); 1076 pr_debug("EEH: Adding device %s\n", pci_name(dev));
1077 1077
1078 dn = pci_device_to_OF_node(dev); 1078 dn = pci_device_to_OF_node(dev);
1079 edev = pci_dev_to_eeh_dev(dev); 1079 edev = of_node_to_eeh_dev(dn);
1080 if (edev->pdev == dev) { 1080 if (edev->pdev == dev) {
1081 pr_debug("EEH: Already referenced !\n"); 1081 pr_debug("EEH: Already referenced !\n");
1082 return; 1082 return;
diff --git a/arch/powerpc/sysdev/cpm2_pic.c b/arch/powerpc/sysdev/cpm2_pic.c
index d3be961e2ae7..10386b676d87 100644
--- a/arch/powerpc/sysdev/cpm2_pic.c
+++ b/arch/powerpc/sysdev/cpm2_pic.c
@@ -51,8 +51,7 @@
51static intctl_cpm2_t __iomem *cpm2_intctl; 51static intctl_cpm2_t __iomem *cpm2_intctl;
52 52
53static struct irq_domain *cpm2_pic_host; 53static struct irq_domain *cpm2_pic_host;
54#define NR_MASK_WORDS ((NR_IRQS + 31) / 32) 54static unsigned long ppc_cached_irq_mask[2]; /* 2 32-bit registers */
55static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS];
56 55
57static const u_char irq_to_siureg[] = { 56static const u_char irq_to_siureg[] = {
58 1, 1, 1, 1, 1, 1, 1, 1, 57 1, 1, 1, 1, 1, 1, 1, 1,
diff --git a/arch/powerpc/sysdev/mpc8xx_pic.c b/arch/powerpc/sysdev/mpc8xx_pic.c
index d5f5416be310..b724622c3a0b 100644
--- a/arch/powerpc/sysdev/mpc8xx_pic.c
+++ b/arch/powerpc/sysdev/mpc8xx_pic.c
@@ -18,69 +18,45 @@
18extern int cpm_get_irq(struct pt_regs *regs); 18extern int cpm_get_irq(struct pt_regs *regs);
19 19
20static struct irq_domain *mpc8xx_pic_host; 20static struct irq_domain *mpc8xx_pic_host;
21#define NR_MASK_WORDS ((NR_IRQS + 31) / 32) 21static unsigned long mpc8xx_cached_irq_mask;
22static unsigned long ppc_cached_irq_mask[NR_MASK_WORDS];
23static sysconf8xx_t __iomem *siu_reg; 22static sysconf8xx_t __iomem *siu_reg;
24 23
25int cpm_get_irq(struct pt_regs *regs); 24static inline unsigned long mpc8xx_irqd_to_bit(struct irq_data *d)
25{
26 return 0x80000000 >> irqd_to_hwirq(d);
27}
26 28
27static void mpc8xx_unmask_irq(struct irq_data *d) 29static void mpc8xx_unmask_irq(struct irq_data *d)
28{ 30{
29 int bit, word; 31 mpc8xx_cached_irq_mask |= mpc8xx_irqd_to_bit(d);
30 unsigned int irq_nr = (unsigned int)irqd_to_hwirq(d); 32 out_be32(&siu_reg->sc_simask, mpc8xx_cached_irq_mask);
31
32 bit = irq_nr & 0x1f;
33 word = irq_nr >> 5;
34
35 ppc_cached_irq_mask[word] |= (1 << (31-bit));
36 out_be32(&siu_reg->sc_simask, ppc_cached_irq_mask[word]);
37} 33}
38 34
39static void mpc8xx_mask_irq(struct irq_data *d) 35static void mpc8xx_mask_irq(struct irq_data *d)
40{ 36{
41 int bit, word; 37 mpc8xx_cached_irq_mask &= ~mpc8xx_irqd_to_bit(d);
42 unsigned int irq_nr = (unsigned int)irqd_to_hwirq(d); 38 out_be32(&siu_reg->sc_simask, mpc8xx_cached_irq_mask);
43
44 bit = irq_nr & 0x1f;
45 word = irq_nr >> 5;
46
47 ppc_cached_irq_mask[word] &= ~(1 << (31-bit));
48 out_be32(&siu_reg->sc_simask, ppc_cached_irq_mask[word]);
49} 39}
50 40
51static void mpc8xx_ack(struct irq_data *d) 41static void mpc8xx_ack(struct irq_data *d)
52{ 42{
53 int bit; 43 out_be32(&siu_reg->sc_sipend, mpc8xx_irqd_to_bit(d));
54 unsigned int irq_nr = (unsigned int)irqd_to_hwirq(d);
55
56 bit = irq_nr & 0x1f;
57 out_be32(&siu_reg->sc_sipend, 1 << (31-bit));
58} 44}
59 45
60static void mpc8xx_end_irq(struct irq_data *d) 46static void mpc8xx_end_irq(struct irq_data *d)
61{ 47{
62 int bit, word; 48 mpc8xx_cached_irq_mask |= mpc8xx_irqd_to_bit(d);
63 unsigned int irq_nr = (unsigned int)irqd_to_hwirq(d); 49 out_be32(&siu_reg->sc_simask, mpc8xx_cached_irq_mask);
64
65 bit = irq_nr & 0x1f;
66 word = irq_nr >> 5;
67
68 ppc_cached_irq_mask[word] |= (1 << (31-bit));
69 out_be32(&siu_reg->sc_simask, ppc_cached_irq_mask[word]);
70} 50}
71 51
72static int mpc8xx_set_irq_type(struct irq_data *d, unsigned int flow_type) 52static int mpc8xx_set_irq_type(struct irq_data *d, unsigned int flow_type)
73{ 53{
74 if (flow_type & IRQ_TYPE_EDGE_FALLING) { 54 /* only external IRQ senses are programmable */
75 irq_hw_number_t hw = (unsigned int)irqd_to_hwirq(d); 55 if ((flow_type & IRQ_TYPE_EDGE_FALLING) && !(irqd_to_hwirq(d) & 1)) {
76 unsigned int siel = in_be32(&siu_reg->sc_siel); 56 unsigned int siel = in_be32(&siu_reg->sc_siel);
77 57 siel |= mpc8xx_irqd_to_bit(d);
78 /* only external IRQ senses are programmable */ 58 out_be32(&siu_reg->sc_siel, siel);
79 if ((hw & 1) == 0) { 59 __irq_set_handler_locked(d->irq, handle_edge_irq);
80 siel |= (0x80000000 >> hw);
81 out_be32(&siu_reg->sc_siel, siel);
82 __irq_set_handler_locked(d->irq, handle_edge_irq);
83 }
84 } 60 }
85 return 0; 61 return 0;
86} 62}
@@ -132,6 +108,9 @@ static int mpc8xx_pic_host_xlate(struct irq_domain *h, struct device_node *ct,
132 IRQ_TYPE_EDGE_FALLING, 108 IRQ_TYPE_EDGE_FALLING,
133 }; 109 };
134 110
111 if (intspec[0] > 0x1f)
112 return 0;
113
135 *out_hwirq = intspec[0]; 114 *out_hwirq = intspec[0];
136 if (intsize > 1 && intspec[1] < 4) 115 if (intsize > 1 && intspec[1] < 4)
137 *out_flags = map_pic_senses[intspec[1]]; 116 *out_flags = map_pic_senses[intspec[1]];
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 9ac71ebd2c40..395af1347749 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -604,18 +604,14 @@ static struct mpic *mpic_find(unsigned int irq)
604} 604}
605 605
606/* Determine if the linux irq is an IPI */ 606/* Determine if the linux irq is an IPI */
607static unsigned int mpic_is_ipi(struct mpic *mpic, unsigned int irq) 607static unsigned int mpic_is_ipi(struct mpic *mpic, unsigned int src)
608{ 608{
609 unsigned int src = virq_to_hw(irq);
610
611 return (src >= mpic->ipi_vecs[0] && src <= mpic->ipi_vecs[3]); 609 return (src >= mpic->ipi_vecs[0] && src <= mpic->ipi_vecs[3]);
612} 610}
613 611
614/* Determine if the linux irq is a timer */ 612/* Determine if the linux irq is a timer */
615static unsigned int mpic_is_tm(struct mpic *mpic, unsigned int irq) 613static unsigned int mpic_is_tm(struct mpic *mpic, unsigned int src)
616{ 614{
617 unsigned int src = virq_to_hw(irq);
618
619 return (src >= mpic->timer_vecs[0] && src <= mpic->timer_vecs[7]); 615 return (src >= mpic->timer_vecs[0] && src <= mpic->timer_vecs[7]);
620} 616}
621 617
@@ -876,21 +872,45 @@ int mpic_set_irq_type(struct irq_data *d, unsigned int flow_type)
876 if (src >= mpic->num_sources) 872 if (src >= mpic->num_sources)
877 return -EINVAL; 873 return -EINVAL;
878 874
875 vold = mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI));
876
877 /* We don't support "none" type */
879 if (flow_type == IRQ_TYPE_NONE) 878 if (flow_type == IRQ_TYPE_NONE)
880 if (mpic->senses && src < mpic->senses_count) 879 flow_type = IRQ_TYPE_DEFAULT;
881 flow_type = mpic->senses[src]; 880
882 if (flow_type == IRQ_TYPE_NONE) 881 /* Default: read HW settings */
883 flow_type = IRQ_TYPE_LEVEL_LOW; 882 if (flow_type == IRQ_TYPE_DEFAULT) {
883 switch(vold & (MPIC_INFO(VECPRI_POLARITY_MASK) |
884 MPIC_INFO(VECPRI_SENSE_MASK))) {
885 case MPIC_INFO(VECPRI_SENSE_EDGE) |
886 MPIC_INFO(VECPRI_POLARITY_POSITIVE):
887 flow_type = IRQ_TYPE_EDGE_RISING;
888 break;
889 case MPIC_INFO(VECPRI_SENSE_EDGE) |
890 MPIC_INFO(VECPRI_POLARITY_NEGATIVE):
891 flow_type = IRQ_TYPE_EDGE_FALLING;
892 break;
893 case MPIC_INFO(VECPRI_SENSE_LEVEL) |
894 MPIC_INFO(VECPRI_POLARITY_POSITIVE):
895 flow_type = IRQ_TYPE_LEVEL_HIGH;
896 break;
897 case MPIC_INFO(VECPRI_SENSE_LEVEL) |
898 MPIC_INFO(VECPRI_POLARITY_NEGATIVE):
899 flow_type = IRQ_TYPE_LEVEL_LOW;
900 break;
901 }
902 }
884 903
904 /* Apply to irq desc */
885 irqd_set_trigger_type(d, flow_type); 905 irqd_set_trigger_type(d, flow_type);
886 906
907 /* Apply to HW */
887 if (mpic_is_ht_interrupt(mpic, src)) 908 if (mpic_is_ht_interrupt(mpic, src))
888 vecpri = MPIC_VECPRI_POLARITY_POSITIVE | 909 vecpri = MPIC_VECPRI_POLARITY_POSITIVE |
889 MPIC_VECPRI_SENSE_EDGE; 910 MPIC_VECPRI_SENSE_EDGE;
890 else 911 else
891 vecpri = mpic_type_to_vecpri(mpic, flow_type); 912 vecpri = mpic_type_to_vecpri(mpic, flow_type);
892 913
893 vold = mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI));
894 vnew = vold & ~(MPIC_INFO(VECPRI_POLARITY_MASK) | 914 vnew = vold & ~(MPIC_INFO(VECPRI_POLARITY_MASK) |
895 MPIC_INFO(VECPRI_SENSE_MASK)); 915 MPIC_INFO(VECPRI_SENSE_MASK));
896 vnew |= vecpri; 916 vnew |= vecpri;
@@ -1026,7 +1046,7 @@ static int mpic_host_map(struct irq_domain *h, unsigned int virq,
1026 irq_set_chip_and_handler(virq, chip, handle_fasteoi_irq); 1046 irq_set_chip_and_handler(virq, chip, handle_fasteoi_irq);
1027 1047
1028 /* Set default irq type */ 1048 /* Set default irq type */
1029 irq_set_irq_type(virq, IRQ_TYPE_NONE); 1049 irq_set_irq_type(virq, IRQ_TYPE_DEFAULT);
1030 1050
1031 /* If the MPIC was reset, then all vectors have already been 1051 /* If the MPIC was reset, then all vectors have already been
1032 * initialized. Otherwise, a per source lazy initialization 1052 * initialized. Otherwise, a per source lazy initialization
@@ -1417,12 +1437,6 @@ void __init mpic_assign_isu(struct mpic *mpic, unsigned int isu_num,
1417 mpic->num_sources = isu_first + mpic->isu_size; 1437 mpic->num_sources = isu_first + mpic->isu_size;
1418} 1438}
1419 1439
1420void __init mpic_set_default_senses(struct mpic *mpic, u8 *senses, int count)
1421{
1422 mpic->senses = senses;
1423 mpic->senses_count = count;
1424}
1425
1426void __init mpic_init(struct mpic *mpic) 1440void __init mpic_init(struct mpic *mpic)
1427{ 1441{
1428 int i, cpu; 1442 int i, cpu;
@@ -1555,12 +1569,12 @@ void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
1555 return; 1569 return;
1556 1570
1557 raw_spin_lock_irqsave(&mpic_lock, flags); 1571 raw_spin_lock_irqsave(&mpic_lock, flags);
1558 if (mpic_is_ipi(mpic, irq)) { 1572 if (mpic_is_ipi(mpic, src)) {
1559 reg = mpic_ipi_read(src - mpic->ipi_vecs[0]) & 1573 reg = mpic_ipi_read(src - mpic->ipi_vecs[0]) &
1560 ~MPIC_VECPRI_PRIORITY_MASK; 1574 ~MPIC_VECPRI_PRIORITY_MASK;
1561 mpic_ipi_write(src - mpic->ipi_vecs[0], 1575 mpic_ipi_write(src - mpic->ipi_vecs[0],
1562 reg | (pri << MPIC_VECPRI_PRIORITY_SHIFT)); 1576 reg | (pri << MPIC_VECPRI_PRIORITY_SHIFT));
1563 } else if (mpic_is_tm(mpic, irq)) { 1577 } else if (mpic_is_tm(mpic, src)) {
1564 reg = mpic_tm_read(src - mpic->timer_vecs[0]) & 1578 reg = mpic_tm_read(src - mpic->timer_vecs[0]) &
1565 ~MPIC_VECPRI_PRIORITY_MASK; 1579 ~MPIC_VECPRI_PRIORITY_MASK;
1566 mpic_tm_write(src - mpic->timer_vecs[0], 1580 mpic_tm_write(src - mpic->timer_vecs[0],
diff --git a/arch/powerpc/sysdev/mpic_msgr.c b/arch/powerpc/sysdev/mpic_msgr.c
index 6e7fa386e76a..483d8fa72e8b 100644
--- a/arch/powerpc/sysdev/mpic_msgr.c
+++ b/arch/powerpc/sysdev/mpic_msgr.c
@@ -27,6 +27,7 @@
27 27
28static struct mpic_msgr **mpic_msgrs; 28static struct mpic_msgr **mpic_msgrs;
29static unsigned int mpic_msgr_count; 29static unsigned int mpic_msgr_count;
30static DEFINE_RAW_SPINLOCK(msgrs_lock);
30 31
31static inline void _mpic_msgr_mer_write(struct mpic_msgr *msgr, u32 value) 32static inline void _mpic_msgr_mer_write(struct mpic_msgr *msgr, u32 value)
32{ 33{
@@ -56,12 +57,11 @@ struct mpic_msgr *mpic_msgr_get(unsigned int reg_num)
56 if (reg_num >= mpic_msgr_count) 57 if (reg_num >= mpic_msgr_count)
57 return ERR_PTR(-ENODEV); 58 return ERR_PTR(-ENODEV);
58 59
59 raw_spin_lock_irqsave(&msgr->lock, flags); 60 raw_spin_lock_irqsave(&msgrs_lock, flags);
60 if (mpic_msgrs[reg_num]->in_use == MSGR_FREE) { 61 msgr = mpic_msgrs[reg_num];
61 msgr = mpic_msgrs[reg_num]; 62 if (msgr->in_use == MSGR_FREE)
62 msgr->in_use = MSGR_INUSE; 63 msgr->in_use = MSGR_INUSE;
63 } 64 raw_spin_unlock_irqrestore(&msgrs_lock, flags);
64 raw_spin_unlock_irqrestore(&msgr->lock, flags);
65 65
66 return msgr; 66 return msgr;
67} 67}
@@ -228,7 +228,7 @@ static __devinit int mpic_msgr_probe(struct platform_device *dev)
228 228
229 reg_number = block_number * MPIC_MSGR_REGISTERS_PER_BLOCK + i; 229 reg_number = block_number * MPIC_MSGR_REGISTERS_PER_BLOCK + i;
230 msgr->base = msgr_block_addr + i * MPIC_MSGR_STRIDE; 230 msgr->base = msgr_block_addr + i * MPIC_MSGR_STRIDE;
231 msgr->mer = msgr->base + MPIC_MSGR_MER_OFFSET; 231 msgr->mer = (u32 *)((u8 *)msgr->base + MPIC_MSGR_MER_OFFSET);
232 msgr->in_use = MSGR_FREE; 232 msgr->in_use = MSGR_FREE;
233 msgr->num = i; 233 msgr->num = i;
234 raw_spin_lock_init(&msgr->lock); 234 raw_spin_lock_init(&msgr->lock);
diff --git a/arch/powerpc/sysdev/scom.c b/arch/powerpc/sysdev/scom.c
index 49a3ece1c6b3..702256a1ca11 100644
--- a/arch/powerpc/sysdev/scom.c
+++ b/arch/powerpc/sysdev/scom.c
@@ -22,6 +22,7 @@
22#include <linux/debugfs.h> 22#include <linux/debugfs.h>
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/export.h> 24#include <linux/export.h>
25#include <asm/debug.h>
25#include <asm/prom.h> 26#include <asm/prom.h>
26#include <asm/scom.h> 27#include <asm/scom.h>
27 28
diff --git a/arch/powerpc/sysdev/xics/xics-common.c b/arch/powerpc/sysdev/xics/xics-common.c
index ea5e204e3450..cd1d18db92c6 100644
--- a/arch/powerpc/sysdev/xics/xics-common.c
+++ b/arch/powerpc/sysdev/xics/xics-common.c
@@ -188,6 +188,7 @@ void xics_migrate_irqs_away(void)
188{ 188{
189 int cpu = smp_processor_id(), hw_cpu = hard_smp_processor_id(); 189 int cpu = smp_processor_id(), hw_cpu = hard_smp_processor_id();
190 unsigned int irq, virq; 190 unsigned int irq, virq;
191 struct irq_desc *desc;
191 192
192 /* If we used to be the default server, move to the new "boot_cpuid" */ 193 /* If we used to be the default server, move to the new "boot_cpuid" */
193 if (hw_cpu == xics_default_server) 194 if (hw_cpu == xics_default_server)
@@ -202,8 +203,7 @@ void xics_migrate_irqs_away(void)
202 /* Allow IPIs again... */ 203 /* Allow IPIs again... */
203 icp_ops->set_priority(DEFAULT_PRIORITY); 204 icp_ops->set_priority(DEFAULT_PRIORITY);
204 205
205 for_each_irq(virq) { 206 for_each_irq_desc(virq, desc) {
206 struct irq_desc *desc;
207 struct irq_chip *chip; 207 struct irq_chip *chip;
208 long server; 208 long server;
209 unsigned long flags; 209 unsigned long flags;
@@ -212,9 +212,8 @@ void xics_migrate_irqs_away(void)
212 /* We can't set affinity on ISA interrupts */ 212 /* We can't set affinity on ISA interrupts */
213 if (virq < NUM_ISA_INTERRUPTS) 213 if (virq < NUM_ISA_INTERRUPTS)
214 continue; 214 continue;
215 desc = irq_to_desc(virq);
216 /* We only need to migrate enabled IRQS */ 215 /* We only need to migrate enabled IRQS */
217 if (!desc || !desc->action) 216 if (!desc->action)
218 continue; 217 continue;
219 if (desc->irq_data.domain != xics_host) 218 if (desc->irq_data.domain != xics_host)
220 continue; 219 continue;
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index 98405fa24e81..65bdb5da79c5 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -288,6 +288,13 @@ config CPU_SUBTYPE_SH7263
288 select SYS_SUPPORTS_CMT 288 select SYS_SUPPORTS_CMT
289 select SYS_SUPPORTS_MTU2 289 select SYS_SUPPORTS_MTU2
290 290
291config CPU_SUBTYPE_SH7264
292 bool "Support SH7264 processor"
293 select CPU_SH2A
294 select CPU_HAS_FPU
295 select SYS_SUPPORTS_CMT
296 select SYS_SUPPORTS_MTU2
297
291config CPU_SUBTYPE_MXG 298config CPU_SUBTYPE_MXG
292 bool "Support MX-G processor" 299 bool "Support MX-G processor"
293 select CPU_SH2A 300 select CPU_SH2A
@@ -594,7 +601,8 @@ config SH_CLK_CPG
594config SH_CLK_CPG_LEGACY 601config SH_CLK_CPG_LEGACY
595 depends on SH_CLK_CPG 602 depends on SH_CLK_CPG
596 def_bool y if !CPU_SUBTYPE_SH7785 && !ARCH_SHMOBILE && \ 603 def_bool y if !CPU_SUBTYPE_SH7785 && !ARCH_SHMOBILE && \
597 !CPU_SHX3 && !CPU_SUBTYPE_SH7757 && !CPU_SUBTYPE_SH7734 604 !CPU_SHX3 && !CPU_SUBTYPE_SH7757 && \
605 !CPU_SUBTYPE_SH7734 && !CPU_SUBTYPE_SH7264
598 606
599source "kernel/time/Kconfig" 607source "kernel/time/Kconfig"
600 608
diff --git a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig
index 6c96daab499b..414a797f3be5 100644
--- a/arch/sh/boards/Kconfig
+++ b/arch/sh/boards/Kconfig
@@ -133,7 +133,7 @@ config SH_RTS7751R2D
133 133
134config SH_RSK 134config SH_RSK
135 bool "Renesas Starter Kit" 135 bool "Renesas Starter Kit"
136 depends on CPU_SUBTYPE_SH7201 || CPU_SUBTYPE_SH7203 136 depends on CPU_SUBTYPE_SH7201 || CPU_SUBTYPE_SH7203 || CPU_SUBTYPE_SH7264
137 help 137 help
138 Select this option if configuring for any of the RSK+ MCU 138 Select this option if configuring for any of the RSK+ MCU
139 evaluation platforms. 139 evaluation platforms.
diff --git a/arch/sh/boards/mach-rsk/Kconfig b/arch/sh/boards/mach-rsk/Kconfig
index aeff3b042205..4315af511649 100644
--- a/arch/sh/boards/mach-rsk/Kconfig
+++ b/arch/sh/boards/mach-rsk/Kconfig
@@ -13,6 +13,11 @@ config SH_RSK7203
13 select ARCH_REQUIRE_GPIOLIB 13 select ARCH_REQUIRE_GPIOLIB
14 depends on CPU_SUBTYPE_SH7203 14 depends on CPU_SUBTYPE_SH7203
15 15
16config SH_RSK7264
17 bool "RSK2+SH7264"
18 select ARCH_REQUIRE_GPIOLIB
19 depends on CPU_SUBTYPE_SH7264
20
16endchoice 21endchoice
17 22
18endif 23endif
diff --git a/arch/sh/boards/mach-rsk/Makefile b/arch/sh/boards/mach-rsk/Makefile
index 498da75ce38b..bae6ae45aba8 100644
--- a/arch/sh/boards/mach-rsk/Makefile
+++ b/arch/sh/boards/mach-rsk/Makefile
@@ -1,2 +1,3 @@
1obj-y := setup.o 1obj-y := setup.o
2obj-$(CONFIG_SH_RSK7203) += devices-rsk7203.o 2obj-$(CONFIG_SH_RSK7203) += devices-rsk7203.o
3obj-$(CONFIG_SH_RSK7264) += devices-rsk7264.o
diff --git a/arch/sh/boards/mach-rsk/devices-rsk7264.c b/arch/sh/boards/mach-rsk/devices-rsk7264.c
new file mode 100644
index 000000000000..7251e37a842f
--- /dev/null
+++ b/arch/sh/boards/mach-rsk/devices-rsk7264.c
@@ -0,0 +1,58 @@
1/*
2 * RSK+SH7264 Support.
3 *
4 * Copyright (C) 2012 Renesas Electronics Europe
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10#include <linux/init.h>
11#include <linux/types.h>
12#include <linux/platform_device.h>
13#include <linux/interrupt.h>
14#include <linux/input.h>
15#include <linux/smsc911x.h>
16#include <asm/machvec.h>
17#include <asm/io.h>
18
19static struct smsc911x_platform_config smsc911x_config = {
20 .phy_interface = PHY_INTERFACE_MODE_MII,
21 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
22 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
23 .flags = SMSC911X_USE_16BIT | SMSC911X_SWAP_FIFO,
24};
25
26static struct resource smsc911x_resources[] = {
27 [0] = {
28 .start = 0x28000000,
29 .end = 0x280000ff,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = 65,
34 .end = 65,
35 .flags = IORESOURCE_IRQ,
36 },
37};
38
39static struct platform_device smsc911x_device = {
40 .name = "smsc911x",
41 .id = -1,
42 .num_resources = ARRAY_SIZE(smsc911x_resources),
43 .resource = smsc911x_resources,
44 .dev = {
45 .platform_data = &smsc911x_config,
46 },
47};
48
49static struct platform_device *rsk7264_devices[] __initdata = {
50 &smsc911x_device,
51};
52
53static int __init rsk7264_devices_setup(void)
54{
55 return platform_add_devices(rsk7264_devices,
56 ARRAY_SIZE(rsk7264_devices));
57}
58device_initcall(rsk7264_devices_setup);
diff --git a/arch/sh/configs/rsk7264_defconfig b/arch/sh/configs/rsk7264_defconfig
new file mode 100644
index 000000000000..1600426224c2
--- /dev/null
+++ b/arch/sh/configs/rsk7264_defconfig
@@ -0,0 +1,80 @@
1CONFIG_LOCALVERSION="uClinux RSK2+SH7264"
2# CONFIG_LOCALVERSION_AUTO is not set
3CONFIG_SYSVIPC=y
4CONFIG_BSD_PROCESS_ACCT=y
5CONFIG_IKCONFIG=y
6CONFIG_LOG_BUF_SHIFT=14
7CONFIG_NAMESPACES=y
8CONFIG_SYSFS_DEPRECATED=y
9CONFIG_SYSFS_DEPRECATED_V2=y
10CONFIG_CC_OPTIMIZE_FOR_SIZE=y
11CONFIG_SYSCTL_SYSCALL=y
12CONFIG_KALLSYMS_ALL=y
13CONFIG_EMBEDDED=y
14CONFIG_PERF_COUNTERS=y
15# CONFIG_VM_EVENT_COUNTERS is not set
16CONFIG_SLAB=y
17CONFIG_MMAP_ALLOW_UNINITIALIZED=y
18CONFIG_PROFILING=y
19# CONFIG_LBDAF is not set
20# CONFIG_BLK_DEV_BSG is not set
21CONFIG_PARTITION_ADVANCED=y
22# CONFIG_IOSCHED_DEADLINE is not set
23# CONFIG_IOSCHED_CFQ is not set
24CONFIG_CPU_SUBTYPE_SH7264=y
25CONFIG_MEMORY_START=0x0c000000
26CONFIG_FLATMEM_MANUAL=y
27CONFIG_CPU_BIG_ENDIAN=y
28CONFIG_SH_RSK=y
29# CONFIG_SH_TIMER_MTU2 is not set
30CONFIG_BINFMT_FLAT=y
31CONFIG_NET=y
32CONFIG_INET=y
33CONFIG_IP_PNP=y
34CONFIG_IP_PNP_DHCP=y
35# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
36# CONFIG_INET_XFRM_MODE_TUNNEL is not set
37# CONFIG_INET_XFRM_MODE_BEET is not set
38# CONFIG_INET_LRO is not set
39# CONFIG_INET_DIAG is not set
40# CONFIG_IPV6 is not set
41CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
42# CONFIG_PREVENT_FIRMWARE_BUILD is not set
43# CONFIG_FW_LOADER is not set
44CONFIG_BLK_DEV_LOOP=y
45CONFIG_BLK_DEV_RAM=y
46CONFIG_BLK_DEV_RAM_COUNT=4
47CONFIG_SCSI=y
48CONFIG_BLK_DEV_SD=y
49CONFIG_NETDEVICES=y
50CONFIG_SMSC911X=y
51CONFIG_SMSC_PHY=y
52CONFIG_INPUT_FF_MEMLESS=y
53# CONFIG_INPUT_MOUSEDEV is not set
54# CONFIG_INPUT_KEYBOARD is not set
55# CONFIG_INPUT_MOUSE is not set
56# CONFIG_SERIO is not set
57CONFIG_VT_HW_CONSOLE_BINDING=y
58CONFIG_SERIAL_SH_SCI=y
59CONFIG_SERIAL_SH_SCI_NR_UARTS=8
60CONFIG_SERIAL_SH_SCI_CONSOLE=y
61# CONFIG_HWMON is not set
62CONFIG_USB=y
63CONFIG_USB_DEBUG=y
64CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
65# CONFIG_USB_DEVICE_CLASS is not set
66CONFIG_USB_R8A66597_HCD=y
67CONFIG_USB_STORAGE=y
68CONFIG_USB_STORAGE_DEBUG=y
69CONFIG_USB_LIBUSUAL=y
70CONFIG_EXT2_FS=y
71CONFIG_EXT3_FS=y
72# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
73CONFIG_VFAT_FS=y
74CONFIG_NFS_FS=y
75CONFIG_NFS_V3=y
76CONFIG_ROOT_NFS=y
77CONFIG_NLS_CODEPAGE_437=y
78CONFIG_NLS_ISO8859_1=y
79# CONFIG_ENABLE_MUST_CHECK is not set
80# CONFIG_FTRACE is not set
diff --git a/arch/sh/include/asm/atomic.h b/arch/sh/include/asm/atomic.h
index 37f2f4a55231..f4c1c20bcdf6 100644
--- a/arch/sh/include/asm/atomic.h
+++ b/arch/sh/include/asm/atomic.h
@@ -11,7 +11,7 @@
11#include <linux/types.h> 11#include <linux/types.h>
12#include <asm/cmpxchg.h> 12#include <asm/cmpxchg.h>
13 13
14#define ATOMIC_INIT(i) ( (atomic_t) { (i) } ) 14#define ATOMIC_INIT(i) { (i) }
15 15
16#define atomic_read(v) (*(volatile int *)&(v)->counter) 16#define atomic_read(v) (*(volatile int *)&(v)->counter)
17#define atomic_set(v,i) ((v)->counter = (i)) 17#define atomic_set(v,i) ((v)->counter = (i))
diff --git a/arch/sh/include/asm/processor.h b/arch/sh/include/asm/processor.h
index 26b12fd8fcbd..858b716ca64d 100644
--- a/arch/sh/include/asm/processor.h
+++ b/arch/sh/include/asm/processor.h
@@ -18,7 +18,7 @@ enum cpu_type {
18 CPU_SH7619, 18 CPU_SH7619,
19 19
20 /* SH-2A types */ 20 /* SH-2A types */
21 CPU_SH7201, CPU_SH7203, CPU_SH7206, CPU_SH7263, CPU_MXG, 21 CPU_SH7201, CPU_SH7203, CPU_SH7206, CPU_SH7263, CPU_SH7264, CPU_MXG,
22 22
23 /* SH-3 types */ 23 /* SH-3 types */
24 CPU_SH7705, CPU_SH7706, CPU_SH7707, 24 CPU_SH7705, CPU_SH7706, CPU_SH7707,
diff --git a/arch/sh/include/cpu-sh2a/cpu/sh7264.h b/arch/sh/include/cpu-sh2a/cpu/sh7264.h
new file mode 100644
index 000000000000..4d1ef6d74bd6
--- /dev/null
+++ b/arch/sh/include/cpu-sh2a/cpu/sh7264.h
@@ -0,0 +1,176 @@
1#ifndef __ASM_SH7264_H__
2#define __ASM_SH7264_H__
3
4enum {
5 /* Port A */
6 GPIO_PA3, GPIO_PA2, GPIO_PA1, GPIO_PA0,
7
8 /* Port B */
9 GPIO_PB22, GPIO_PB21, GPIO_PB20,
10 GPIO_PB19, GPIO_PB18, GPIO_PB17, GPIO_PB16,
11 GPIO_PB15, GPIO_PB14, GPIO_PB13, GPIO_PB12,
12 GPIO_PB11, GPIO_PB10, GPIO_PB9, GPIO_PB8,
13 GPIO_PB7, GPIO_PB6, GPIO_PB5, GPIO_PB4,
14 GPIO_PB3, GPIO_PB2, GPIO_PB1,
15
16 /* Port C */
17 GPIO_PC10, GPIO_PC9, GPIO_PC8,
18 GPIO_PC7, GPIO_PC6, GPIO_PC5, GPIO_PC4,
19 GPIO_PC3, GPIO_PC2, GPIO_PC1, GPIO_PC0,
20
21 /* Port D */
22 GPIO_PD15, GPIO_PD14, GPIO_PD13, GPIO_PD12,
23 GPIO_PD11, GPIO_PD10, GPIO_PD9, GPIO_PD8,
24 GPIO_PD7, GPIO_PD6, GPIO_PD5, GPIO_PD4,
25 GPIO_PD3, GPIO_PD2, GPIO_PD1, GPIO_PD0,
26
27 /* Port E */
28 GPIO_PE5, GPIO_PE4,
29 GPIO_PE3, GPIO_PE2, GPIO_PE1, GPIO_PE0,
30
31 /* Port F */
32 GPIO_PF12,
33 GPIO_PF11, GPIO_PF10, GPIO_PF9, GPIO_PF8,
34 GPIO_PF7, GPIO_PF6, GPIO_PF5, GPIO_PF4,
35 GPIO_PF3, GPIO_PF2, GPIO_PF1, GPIO_PF0,
36
37 /* Port G */
38 GPIO_PG24,
39 GPIO_PG23, GPIO_PG22, GPIO_PG21, GPIO_PG20,
40 GPIO_PG19, GPIO_PG18, GPIO_PG17, GPIO_PG16,
41 GPIO_PG15, GPIO_PG14, GPIO_PG13, GPIO_PG12,
42 GPIO_PG11, GPIO_PG10, GPIO_PG9, GPIO_PG8,
43 GPIO_PG7, GPIO_PG6, GPIO_PG5, GPIO_PG4,
44 GPIO_PG3, GPIO_PG2, GPIO_PG1, GPIO_PG0,
45
46 /* Port H */
47 GPIO_PH7, GPIO_PH6, GPIO_PH5, GPIO_PH4,
48 GPIO_PH3, GPIO_PH2, GPIO_PH1, GPIO_PH0,
49
50 /* Port I - not on device */
51
52 /* Port J */
53 GPIO_PJ11, GPIO_PJ10, GPIO_PJ9, GPIO_PJ8,
54 GPIO_PJ7, GPIO_PJ6, GPIO_PJ5, GPIO_PJ4,
55 GPIO_PJ3, GPIO_PJ2, GPIO_PJ1, GPIO_PJ0,
56
57 /* Port K */
58 GPIO_PK11, GPIO_PK10, GPIO_PK9, GPIO_PK8,
59 GPIO_PK7, GPIO_PK6, GPIO_PK5, GPIO_PK4,
60 GPIO_PK3, GPIO_PK2, GPIO_PK1, GPIO_PK0,
61
62 /* INTC: IRQ and PINT on PB/PD/PE */
63 GPIO_FN_PINT7_PG, GPIO_FN_PINT6_PG, GPIO_FN_PINT5_PG, GPIO_FN_PINT4_PG,
64 GPIO_FN_PINT3_PG, GPIO_FN_PINT2_PG, GPIO_FN_PINT1_PG,
65
66 GPIO_FN_IRQ7_PC, GPIO_FN_IRQ6_PC, GPIO_FN_IRQ5_PC, GPIO_FN_IRQ4_PC,
67 GPIO_FN_IRQ3_PG, GPIO_FN_IRQ2_PG, GPIO_FN_IRQ1_PJ, GPIO_FN_IRQ0_PJ,
68 GPIO_FN_IRQ3_PE, GPIO_FN_IRQ2_PE, GPIO_FN_IRQ1_PE, GPIO_FN_IRQ0_PE,
69
70 /* WDT */
71 GPIO_FN_WDTOVF,
72
73 /* CAN */
74 GPIO_FN_CTX1, GPIO_FN_CRX1, GPIO_FN_CTX0, GPIO_FN_CTX0_CTX1,
75 GPIO_FN_CRX0, GPIO_FN_CRX0_CRX1,
76
77 /* DMAC */
78 GPIO_FN_TEND0, GPIO_FN_DACK0, GPIO_FN_DREQ0,
79 GPIO_FN_TEND1, GPIO_FN_DACK1, GPIO_FN_DREQ1,
80
81 /* ADC */
82 GPIO_FN_ADTRG,
83
84 /* BSC */
85
86 GPIO_FN_A25, GPIO_FN_A24,
87 GPIO_FN_A23, GPIO_FN_A22, GPIO_FN_A21, GPIO_FN_A20,
88 GPIO_FN_A19, GPIO_FN_A18, GPIO_FN_A17, GPIO_FN_A16,
89 GPIO_FN_A15, GPIO_FN_A14, GPIO_FN_A13, GPIO_FN_A12,
90 GPIO_FN_A11, GPIO_FN_A10, GPIO_FN_A9, GPIO_FN_A8,
91 GPIO_FN_A7, GPIO_FN_A6, GPIO_FN_A5, GPIO_FN_A4,
92 GPIO_FN_A3, GPIO_FN_A2, GPIO_FN_A1, GPIO_FN_A0,
93 GPIO_FN_D15, GPIO_FN_D14, GPIO_FN_D13, GPIO_FN_D12,
94 GPIO_FN_D11, GPIO_FN_D10, GPIO_FN_D9, GPIO_FN_D8,
95 GPIO_FN_D7, GPIO_FN_D6, GPIO_FN_D5, GPIO_FN_D4,
96 GPIO_FN_D3, GPIO_FN_D2, GPIO_FN_D1, GPIO_FN_D0,
97
98 GPIO_FN_BS,
99 GPIO_FN_CS4, GPIO_FN_CS3, GPIO_FN_CS2, GPIO_FN_CS1, GPIO_FN_CS0,
100 GPIO_FN_CS6CE1B, GPIO_FN_CS5CE1A,
101 GPIO_FN_CE2A, GPIO_FN_CE2B,
102 GPIO_FN_RD, GPIO_FN_RDWR,
103 GPIO_FN_ICIOWRAH, GPIO_FN_ICIORD,
104 GPIO_FN_WE1DQMUWE, GPIO_FN_WE0DQML,
105 GPIO_FN_RAS, GPIO_FN_CAS, GPIO_FN_CKE,
106 GPIO_FN_WAIT, GPIO_FN_BREQ, GPIO_FN_BACK,
107 GPIO_FN_IOIS16,
108
109 /* TMU */
110 GPIO_FN_TIOC4D, GPIO_FN_TIOC4C, GPIO_FN_TIOC4B, GPIO_FN_TIOC4A,
111 GPIO_FN_TIOC3D, GPIO_FN_TIOC3C, GPIO_FN_TIOC3B, GPIO_FN_TIOC3A,
112 GPIO_FN_TIOC2B, GPIO_FN_TIOC1B, GPIO_FN_TIOC2A, GPIO_FN_TIOC1A,
113 GPIO_FN_TIOC0D, GPIO_FN_TIOC0C, GPIO_FN_TIOC0B, GPIO_FN_TIOC0A,
114 GPIO_FN_TCLKD, GPIO_FN_TCLKC, GPIO_FN_TCLKB, GPIO_FN_TCLKA,
115
116 /* SSU */
117 GPIO_FN_SCS0_PD, GPIO_FN_SSO0_PD, GPIO_FN_SSI0_PD, GPIO_FN_SSCK0_PD,
118 GPIO_FN_SCS0_PF, GPIO_FN_SSO0_PF, GPIO_FN_SSI0_PF, GPIO_FN_SSCK0_PF,
119 GPIO_FN_SCS1_PD, GPIO_FN_SSO1_PD, GPIO_FN_SSI1_PD, GPIO_FN_SSCK1_PD,
120 GPIO_FN_SCS1_PF, GPIO_FN_SSO1_PF, GPIO_FN_SSI1_PF, GPIO_FN_SSCK1_PF,
121
122 /* SCIF */
123 GPIO_FN_SCK0, GPIO_FN_SCK1, GPIO_FN_SCK2, GPIO_FN_SCK3,
124 GPIO_FN_RXD0, GPIO_FN_RXD1, GPIO_FN_RXD2, GPIO_FN_RXD3,
125 GPIO_FN_TXD0, GPIO_FN_TXD1, GPIO_FN_TXD2, GPIO_FN_TXD3,
126 GPIO_FN_RXD4, GPIO_FN_RXD5, GPIO_FN_RXD6, GPIO_FN_RXD7,
127 GPIO_FN_TXD4, GPIO_FN_TXD5, GPIO_FN_TXD6, GPIO_FN_TXD7,
128 GPIO_FN_RTS1, GPIO_FN_RTS3, GPIO_FN_CTS1, GPIO_FN_CTS3,
129
130 /* RSPI */
131 GPIO_FN_RSPCK0, GPIO_FN_MOSI0,
132 GPIO_FN_MISO0_PF12, GPIO_FN_MISO1,
133 GPIO_FN_SSL00,
134 GPIO_FN_RSPCK1, GPIO_FN_MOSI1,
135 GPIO_FN_MISO1_PG19, GPIO_FN_SSL10,
136
137 /* IIC3 */
138 GPIO_FN_SCL0, GPIO_FN_SCL1, GPIO_FN_SCL2,
139 GPIO_FN_SDA2, GPIO_FN_SDA1, GPIO_FN_SDA0,
140
141 /* SSI */
142 GPIO_FN_SSISCK0, GPIO_FN_SSIWS0, GPIO_FN_SSITXD0, GPIO_FN_SSIRXD0,
143 GPIO_FN_SSIWS1, GPIO_FN_SSIWS2, GPIO_FN_SSIWS3,
144 GPIO_FN_SSISCK1, GPIO_FN_SSISCK2, GPIO_FN_SSISCK3,
145 GPIO_FN_SSIDATA1, GPIO_FN_SSIDATA2, GPIO_FN_SSIDATA3,
146 GPIO_FN_AUDIO_CLK,
147
148 /* SIOF */
149 GPIO_FN_SIOFTXD, GPIO_FN_SIOFRXD, GPIO_FN_SIOFSYNC, GPIO_FN_SIOFSCK,
150
151 /* SPDIF */
152 GPIO_FN_SPDIF_IN,
153 GPIO_FN_SPDIF_OUT,
154
155 /* NANDFMC */ /* NOTE Controller is not available in boot mode 0 */
156 GPIO_FN_FCE,
157 GPIO_FN_FRB,
158
159 /* VDC3 */
160 GPIO_FN_DV_CLK, GPIO_FN_DV_VSYNC, GPIO_FN_DV_HSYNC,
161 GPIO_FN_DV_DATA7, GPIO_FN_DV_DATA6, GPIO_FN_DV_DATA5, GPIO_FN_DV_DATA4,
162 GPIO_FN_DV_DATA3, GPIO_FN_DV_DATA2, GPIO_FN_DV_DATA1, GPIO_FN_DV_DATA0,
163 GPIO_FN_LCD_CLK, GPIO_FN_LCD_EXTCLK,
164 GPIO_FN_LCD_VSYNC, GPIO_FN_LCD_HSYNC, GPIO_FN_LCD_DE,
165 GPIO_FN_LCD_DATA15, GPIO_FN_LCD_DATA14,
166 GPIO_FN_LCD_DATA13, GPIO_FN_LCD_DATA12,
167 GPIO_FN_LCD_DATA11, GPIO_FN_LCD_DATA10,
168 GPIO_FN_LCD_DATA9, GPIO_FN_LCD_DATA8,
169 GPIO_FN_LCD_DATA7, GPIO_FN_LCD_DATA6,
170 GPIO_FN_LCD_DATA5, GPIO_FN_LCD_DATA4,
171 GPIO_FN_LCD_DATA3, GPIO_FN_LCD_DATA2,
172 GPIO_FN_LCD_DATA1, GPIO_FN_LCD_DATA0,
173 GPIO_FN_LCD_M_DISP,
174};
175
176#endif /* __ASM_SH7264_H__ */
diff --git a/arch/sh/kernel/cpu/proc.c b/arch/sh/kernel/cpu/proc.c
index e3a16d104528..27dd6f915eae 100644
--- a/arch/sh/kernel/cpu/proc.c
+++ b/arch/sh/kernel/cpu/proc.c
@@ -7,6 +7,7 @@
7static const char *cpu_name[] = { 7static const char *cpu_name[] = {
8 [CPU_SH7201] = "SH7201", 8 [CPU_SH7201] = "SH7201",
9 [CPU_SH7203] = "SH7203", [CPU_SH7263] = "SH7263", 9 [CPU_SH7203] = "SH7203", [CPU_SH7263] = "SH7263",
10 [CPU_SH7264] = "SH7264",
10 [CPU_SH7206] = "SH7206", [CPU_SH7619] = "SH7619", 11 [CPU_SH7206] = "SH7206", [CPU_SH7619] = "SH7619",
11 [CPU_SH7705] = "SH7705", [CPU_SH7706] = "SH7706", 12 [CPU_SH7705] = "SH7705", [CPU_SH7706] = "SH7706",
12 [CPU_SH7707] = "SH7707", [CPU_SH7708] = "SH7708", 13 [CPU_SH7707] = "SH7707", [CPU_SH7708] = "SH7708",
diff --git a/arch/sh/kernel/cpu/sh2a/Makefile b/arch/sh/kernel/cpu/sh2a/Makefile
index 45f85c77ef75..64b0986275b9 100644
--- a/arch/sh/kernel/cpu/sh2a/Makefile
+++ b/arch/sh/kernel/cpu/sh2a/Makefile
@@ -11,10 +11,12 @@ obj-$(CONFIG_SH_FPU) += fpu.o
11obj-$(CONFIG_CPU_SUBTYPE_SH7201) += setup-sh7201.o clock-sh7201.o 11obj-$(CONFIG_CPU_SUBTYPE_SH7201) += setup-sh7201.o clock-sh7201.o
12obj-$(CONFIG_CPU_SUBTYPE_SH7203) += setup-sh7203.o clock-sh7203.o 12obj-$(CONFIG_CPU_SUBTYPE_SH7203) += setup-sh7203.o clock-sh7203.o
13obj-$(CONFIG_CPU_SUBTYPE_SH7263) += setup-sh7203.o clock-sh7203.o 13obj-$(CONFIG_CPU_SUBTYPE_SH7263) += setup-sh7203.o clock-sh7203.o
14obj-$(CONFIG_CPU_SUBTYPE_SH7264) += setup-sh7264.o clock-sh7264.o
14obj-$(CONFIG_CPU_SUBTYPE_SH7206) += setup-sh7206.o clock-sh7206.o 15obj-$(CONFIG_CPU_SUBTYPE_SH7206) += setup-sh7206.o clock-sh7206.o
15obj-$(CONFIG_CPU_SUBTYPE_MXG) += setup-mxg.o clock-sh7206.o 16obj-$(CONFIG_CPU_SUBTYPE_MXG) += setup-mxg.o clock-sh7206.o
16 17
17# Pinmux setup 18# Pinmux setup
18pinmux-$(CONFIG_CPU_SUBTYPE_SH7203) := pinmux-sh7203.o 19pinmux-$(CONFIG_CPU_SUBTYPE_SH7203) := pinmux-sh7203.o
20pinmux-$(CONFIG_CPU_SUBTYPE_SH7264) := pinmux-sh7264.o
19 21
20obj-$(CONFIG_GENERIC_GPIO) += $(pinmux-y) 22obj-$(CONFIG_GENERIC_GPIO) += $(pinmux-y)
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7264.c b/arch/sh/kernel/cpu/sh2a/clock-sh7264.c
new file mode 100644
index 000000000000..fdf585c95289
--- /dev/null
+++ b/arch/sh/kernel/cpu/sh2a/clock-sh7264.c
@@ -0,0 +1,153 @@
1/*
2 * arch/sh/kernel/cpu/sh2a/clock-sh7264.c
3 *
4 * SH7264 clock framework support
5 *
6 * Copyright (C) 2012 Phil Edworthy
7 *
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive
10 * for more details.
11 */
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/io.h>
15#include <linux/clkdev.h>
16#include <asm/clock.h>
17
18/* SH7264 registers */
19#define FRQCR 0xfffe0010
20#define STBCR3 0xfffe0408
21#define STBCR4 0xfffe040c
22#define STBCR5 0xfffe0410
23#define STBCR6 0xfffe0414
24#define STBCR7 0xfffe0418
25#define STBCR8 0xfffe041c
26
27static const unsigned int pll1rate[] = {8, 12};
28
29static unsigned int pll1_div;
30
31/* Fixed 32 KHz root clock for RTC */
32static struct clk r_clk = {
33 .rate = 32768,
34};
35
36/*
37 * Default rate for the root input clock, reset this with clk_set_rate()
38 * from the platform code.
39 */
40static struct clk extal_clk = {
41 .rate = 18000000,
42};
43
44static unsigned long pll_recalc(struct clk *clk)
45{
46 unsigned long rate = clk->parent->rate / pll1_div;
47 return rate * pll1rate[(__raw_readw(FRQCR) >> 8) & 1];
48}
49
50static struct sh_clk_ops pll_clk_ops = {
51 .recalc = pll_recalc,
52};
53
54static struct clk pll_clk = {
55 .ops = &pll_clk_ops,
56 .parent = &extal_clk,
57 .flags = CLK_ENABLE_ON_INIT,
58};
59
60struct clk *main_clks[] = {
61 &r_clk,
62 &extal_clk,
63 &pll_clk,
64};
65
66static int div2[] = { 1, 2, 3, 4, 6, 8, 12 };
67
68static struct clk_div_mult_table div4_div_mult_table = {
69 .divisors = div2,
70 .nr_divisors = ARRAY_SIZE(div2),
71};
72
73static struct clk_div4_table div4_table = {
74 .div_mult_table = &div4_div_mult_table,
75};
76
77enum { DIV4_I, DIV4_P,
78 DIV4_NR };
79
80#define DIV4(_reg, _bit, _mask, _flags) \
81 SH_CLK_DIV4(&pll_clk, _reg, _bit, _mask, _flags)
82
83/* The mask field specifies the div2 entries that are valid */
84struct clk div4_clks[DIV4_NR] = {
85 [DIV4_I] = DIV4(FRQCR, 4, 0x7, CLK_ENABLE_REG_16BIT
86 | CLK_ENABLE_ON_INIT),
87 [DIV4_P] = DIV4(FRQCR, 0, 0x78, CLK_ENABLE_REG_16BIT),
88};
89
90enum { MSTP77, MSTP74, MSTP72,
91 MSTP60,
92 MSTP35, MSTP34, MSTP33, MSTP32, MSTP30,
93 MSTP_NR };
94
95static struct clk mstp_clks[MSTP_NR] = {
96 [MSTP77] = SH_CLK_MSTP8(&div4_clks[DIV4_P], STBCR7, 7, 0), /* SCIF */
97 [MSTP74] = SH_CLK_MSTP8(&div4_clks[DIV4_P], STBCR7, 4, 0), /* VDC */
98 [MSTP72] = SH_CLK_MSTP8(&div4_clks[DIV4_P], STBCR7, 2, 0), /* CMT */
99 [MSTP60] = SH_CLK_MSTP8(&div4_clks[DIV4_P], STBCR6, 0, 0), /* USB */
100 [MSTP35] = SH_CLK_MSTP8(&div4_clks[DIV4_P], STBCR3, 6, 0), /* MTU2 */
101 [MSTP34] = SH_CLK_MSTP8(&div4_clks[DIV4_P], STBCR3, 4, 0), /* SDHI0 */
102 [MSTP33] = SH_CLK_MSTP8(&div4_clks[DIV4_P], STBCR3, 3, 0), /* SDHI1 */
103 [MSTP32] = SH_CLK_MSTP8(&div4_clks[DIV4_P], STBCR3, 2, 0), /* ADC */
104 [MSTP30] = SH_CLK_MSTP8(&r_clk, STBCR3, 0, 0), /* RTC */
105};
106
107static struct clk_lookup lookups[] = {
108 /* main clocks */
109 CLKDEV_CON_ID("rclk", &r_clk),
110 CLKDEV_CON_ID("extal", &extal_clk),
111 CLKDEV_CON_ID("pll_clk", &pll_clk),
112
113 /* DIV4 clocks */
114 CLKDEV_CON_ID("cpu_clk", &div4_clks[DIV4_I]),
115 CLKDEV_CON_ID("peripheral_clk", &div4_clks[DIV4_P]),
116
117 /* MSTP clocks */
118 CLKDEV_CON_ID("sci_ick", &mstp_clks[MSTP77]),
119 CLKDEV_CON_ID("vdc3", &mstp_clks[MSTP74]),
120 CLKDEV_CON_ID("cmt_fck", &mstp_clks[MSTP72]),
121 CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]),
122 CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP35]),
123 CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP34]),
124 CLKDEV_CON_ID("sdhi1", &mstp_clks[MSTP33]),
125 CLKDEV_CON_ID("adc0", &mstp_clks[MSTP32]),
126 CLKDEV_CON_ID("rtc0", &mstp_clks[MSTP30]),
127};
128
129int __init arch_clk_init(void)
130{
131 int k, ret = 0;
132
133 if (test_mode_pin(MODE_PIN0)) {
134 if (test_mode_pin(MODE_PIN1))
135 pll1_div = 3;
136 else
137 pll1_div = 4;
138 } else
139 pll1_div = 1;
140
141 for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++)
142 ret = clk_register(main_clks[k]);
143
144 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
145
146 if (!ret)
147 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
148
149 if (!ret)
150 ret = sh_clk_mstp_register(mstp_clks, MSTP_NR);
151
152 return ret;
153}
diff --git a/arch/sh/kernel/cpu/sh2a/pinmux-sh7264.c b/arch/sh/kernel/cpu/sh2a/pinmux-sh7264.c
new file mode 100644
index 000000000000..b055b55d6f27
--- /dev/null
+++ b/arch/sh/kernel/cpu/sh2a/pinmux-sh7264.c
@@ -0,0 +1,2136 @@
1/*
2 * SH7264 Pinmux
3 *
4 * Copyright (C) 2012 Renesas Electronics Europe Ltd
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11#include <linux/init.h>
12#include <linux/kernel.h>
13#include <linux/gpio.h>
14#include <cpu/sh7264.h>
15
16enum {
17 PINMUX_RESERVED = 0,
18
19 PINMUX_DATA_BEGIN,
20 /* Port A */
21 PA3_DATA, PA2_DATA, PA1_DATA, PA0_DATA,
22 /* Port B */
23 PB22_DATA, PB21_DATA, PB20_DATA,
24 PB19_DATA, PB18_DATA, PB17_DATA, PB16_DATA,
25 PB15_DATA, PB14_DATA, PB13_DATA, PB12_DATA,
26 PB11_DATA, PB10_DATA, PB9_DATA, PB8_DATA,
27 PB7_DATA, PB6_DATA, PB5_DATA, PB4_DATA,
28 PB3_DATA, PB2_DATA, PB1_DATA,
29 /* Port C */
30 PC10_DATA, PC9_DATA, PC8_DATA,
31 PC7_DATA, PC6_DATA, PC5_DATA, PC4_DATA,
32 PC3_DATA, PC2_DATA, PC1_DATA, PC0_DATA,
33 /* Port D */
34 PD15_DATA, PD14_DATA, PD13_DATA, PD12_DATA,
35 PD11_DATA, PD10_DATA, PD9_DATA, PD8_DATA,
36 PD7_DATA, PD6_DATA, PD5_DATA, PD4_DATA,
37 PD3_DATA, PD2_DATA, PD1_DATA, PD0_DATA,
38 /* Port E */
39 PE5_DATA, PE4_DATA,
40 PE3_DATA, PE2_DATA, PE1_DATA, PE0_DATA,
41 /* Port F */
42 PF12_DATA,
43 PF11_DATA, PF10_DATA, PF9_DATA, PF8_DATA,
44 PF7_DATA, PF6_DATA, PF5_DATA, PF4_DATA,
45 PF3_DATA, PF2_DATA, PF1_DATA, PF0_DATA,
46 /* Port G */
47 PG24_DATA,
48 PG23_DATA, PG22_DATA, PG21_DATA, PG20_DATA,
49 PG19_DATA, PG18_DATA, PG17_DATA, PG16_DATA,
50 PG15_DATA, PG14_DATA, PG13_DATA, PG12_DATA,
51 PG11_DATA, PG10_DATA, PG9_DATA, PG8_DATA,
52 PG7_DATA, PG6_DATA, PG5_DATA, PG4_DATA,
53 PG3_DATA, PG2_DATA, PG1_DATA, PG0_DATA,
54 /* Port H */
55 /* NOTE - Port H does not have a Data Register, but PH Data is
56 connected to PH Port Register */
57 PH7_DATA, PH6_DATA, PH5_DATA, PH4_DATA,
58 PH3_DATA, PH2_DATA, PH1_DATA, PH0_DATA,
59 /* Port I - not on device */
60 /* Port J */
61 PJ12_DATA,
62 PJ11_DATA, PJ10_DATA, PJ9_DATA, PJ8_DATA,
63 PJ7_DATA, PJ6_DATA, PJ5_DATA, PJ4_DATA,
64 PJ3_DATA, PJ2_DATA, PJ1_DATA, PJ0_DATA,
65 /* Port K */
66 PK12_DATA,
67 PK11_DATA, PK10_DATA, PK9_DATA, PK8_DATA,
68 PK7_DATA, PK6_DATA, PK5_DATA, PK4_DATA,
69 PK3_DATA, PK2_DATA, PK1_DATA, PK0_DATA,
70 PINMUX_DATA_END,
71
72 PINMUX_INPUT_BEGIN,
73 FORCE_IN,
74 /* Port A */
75 PA3_IN, PA2_IN, PA1_IN, PA0_IN,
76 /* Port B */
77 PB22_IN, PB21_IN, PB20_IN,
78 PB19_IN, PB18_IN, PB17_IN, PB16_IN,
79 PB15_IN, PB14_IN, PB13_IN, PB12_IN,
80 PB11_IN, PB10_IN, PB9_IN, PB8_IN,
81 PB7_IN, PB6_IN, PB5_IN, PB4_IN,
82 PB3_IN, PB2_IN, PB1_IN,
83 /* Port C */
84 PC10_IN, PC9_IN, PC8_IN,
85 PC7_IN, PC6_IN, PC5_IN, PC4_IN,
86 PC3_IN, PC2_IN, PC1_IN, PC0_IN,
87 /* Port D */
88 PD15_IN, PD14_IN, PD13_IN, PD12_IN,
89 PD11_IN, PD10_IN, PD9_IN, PD8_IN,
90 PD7_IN, PD6_IN, PD5_IN, PD4_IN,
91 PD3_IN, PD2_IN, PD1_IN, PD0_IN,
92 /* Port E */
93 PE5_IN, PE4_IN,
94 PE3_IN, PE2_IN, PE1_IN, PE0_IN,
95 /* Port F */
96 PF12_IN,
97 PF11_IN, PF10_IN, PF9_IN, PF8_IN,
98 PF7_IN, PF6_IN, PF5_IN, PF4_IN,
99 PF3_IN, PF2_IN, PF1_IN, PF0_IN,
100 /* Port G */
101 PG24_IN,
102 PG23_IN, PG22_IN, PG21_IN, PG20_IN,
103 PG19_IN, PG18_IN, PG17_IN, PG16_IN,
104 PG15_IN, PG14_IN, PG13_IN, PG12_IN,
105 PG11_IN, PG10_IN, PG9_IN, PG8_IN,
106 PG7_IN, PG6_IN, PG5_IN, PG4_IN,
107 PG3_IN, PG2_IN, PG1_IN, PG0_IN,
108 /* Port H - Port H does not have a Data Register */
109 /* Port I - not on device */
110 /* Port J */
111 PJ12_IN,
112 PJ11_IN, PJ10_IN, PJ9_IN, PJ8_IN,
113 PJ7_IN, PJ6_IN, PJ5_IN, PJ4_IN,
114 PJ3_IN, PJ2_IN, PJ1_IN, PJ0_IN,
115 /* Port K */
116 PK12_IN,
117 PK11_IN, PK10_IN, PK9_IN, PK8_IN,
118 PK7_IN, PK6_IN, PK5_IN, PK4_IN,
119 PK3_IN, PK2_IN, PK1_IN, PK0_IN,
120 PINMUX_INPUT_END,
121
122 PINMUX_OUTPUT_BEGIN,
123 FORCE_OUT,
124 /* Port A */
125 PA3_OUT, PA2_OUT, PA1_OUT, PA0_OUT,
126 /* Port B */
127 PB22_OUT, PB21_OUT, PB20_OUT,
128 PB19_OUT, PB18_OUT, PB17_OUT, PB16_OUT,
129 PB15_OUT, PB14_OUT, PB13_OUT, PB12_OUT,
130 PB11_OUT, PB10_OUT, PB9_OUT, PB8_OUT,
131 PB7_OUT, PB6_OUT, PB5_OUT, PB4_OUT,
132 PB3_OUT, PB2_OUT, PB1_OUT,
133 /* Port C */
134 PC10_OUT, PC9_OUT, PC8_OUT,
135 PC7_OUT, PC6_OUT, PC5_OUT, PC4_OUT,
136 PC3_OUT, PC2_OUT, PC1_OUT, PC0_OUT,
137 /* Port D */
138 PD15_OUT, PD14_OUT, PD13_OUT, PD12_OUT,
139 PD11_OUT, PD10_OUT, PD9_OUT, PD8_OUT,
140 PD7_OUT, PD6_OUT, PD5_OUT, PD4_OUT,
141 PD3_OUT, PD2_OUT, PD1_OUT, PD0_OUT,
142 /* Port E */
143 PE5_OUT, PE4_OUT,
144 PE3_OUT, PE2_OUT, PE1_OUT, PE0_OUT,
145 /* Port F */
146 PF12_OUT,
147 PF11_OUT, PF10_OUT, PF9_OUT, PF8_OUT,
148 PF7_OUT, PF6_OUT, PF5_OUT, PF4_OUT,
149 PF3_OUT, PF2_OUT, PF1_OUT, PF0_OUT,
150 /* Port G */
151 PG24_OUT,
152 PG23_OUT, PG22_OUT, PG21_OUT, PG20_OUT,
153 PG19_OUT, PG18_OUT, PG17_OUT, PG16_OUT,
154 PG15_OUT, PG14_OUT, PG13_OUT, PG12_OUT,
155 PG11_OUT, PG10_OUT, PG9_OUT, PG8_OUT,
156 PG7_OUT, PG6_OUT, PG5_OUT, PG4_OUT,
157 PG3_OUT, PG2_OUT, PG1_OUT, PG0_OUT,
158 /* Port H - Port H does not have a Data Register */
159 /* Port I - not on device */
160 /* Port J */
161 PJ12_OUT,
162 PJ11_OUT, PJ10_OUT, PJ9_OUT, PJ8_OUT,
163 PJ7_OUT, PJ6_OUT, PJ5_OUT, PJ4_OUT,
164 PJ3_OUT, PJ2_OUT, PJ1_OUT, PJ0_OUT,
165 /* Port K */
166 PK12_OUT,
167 PK11_OUT, PK10_OUT, PK9_OUT, PK8_OUT,
168 PK7_OUT, PK6_OUT, PK5_OUT, PK4_OUT,
169 PK3_OUT, PK2_OUT, PK1_OUT, PK0_OUT,
170 PINMUX_OUTPUT_END,
171
172 PINMUX_FUNCTION_BEGIN,
173 /* Port A */
174 PA3_IOR_IN, PA3_IOR_OUT,
175 PA2_IOR_IN, PA2_IOR_OUT,
176 PA1_IOR_IN, PA1_IOR_OUT,
177 PA0_IOR_IN, PA0_IOR_OUT,
178
179 /* Port B */
180 PB11_IOR_IN, PB11_IOR_OUT,
181 PB10_IOR_IN, PB10_IOR_OUT,
182 PB9_IOR_IN, PB9_IOR_OUT,
183 PB8_IOR_IN, PB8_IOR_OUT,
184
185 PB22MD_00, PB22MD_01, PB22MD_10,
186 PB21MD_0, PB21MD_1,
187 PB20MD_0, PB20MD_1,
188 PB19MD_00, PB19MD_01, PB19MD_10, PB19MD_11,
189 PB18MD_00, PB18MD_01, PB18MD_10, PB18MD_11,
190 PB17MD_00, PB17MD_01, PB17MD_10, PB17MD_11,
191 PB16MD_00, PB16MD_01, PB16MD_10, PB16MD_11,
192 PB15MD_00, PB15MD_01, PB15MD_10, PB15MD_11,
193 PB14MD_00, PB14MD_01, PB14MD_10, PB14MD_11,
194 PB13MD_00, PB13MD_01, PB13MD_10, PB13MD_11,
195 PB12MD_00, PB12MD_01, PB12MD_10, PB12MD_11,
196 PB11MD_00, PB11MD_01, PB11MD_10, PB11MD_11,
197 PB10MD_00, PB10MD_01, PB10MD_10, PB10MD_11,
198 PB9MD_00, PB9MD_01, PB9MD_10, PB9MD_11,
199 PB8MD_00, PB8MD_01, PB8MD_10, PB8MD_11,
200 PB7MD_00, PB7MD_01, PB7MD_10, PB7MD_11,
201 PB6MD_00, PB6MD_01, PB6MD_10, PB6MD_11,
202 PB5MD_00, PB5MD_01, PB5MD_10, PB5MD_11,
203 PB4MD_00, PB4MD_01, PB4MD_10, PB4MD_11,
204 PB3MD_0, PB3MD_1,
205 PB2MD_0, PB2MD_1,
206 PB1MD_0, PB1MD_1,
207
208 /* Port C */
209 PC14_IOR_IN, PC14_IOR_OUT,
210 PC13_IOR_IN, PC13_IOR_OUT,
211 PC12_IOR_IN, PC12_IOR_OUT,
212 PC11_IOR_IN, PC11_IOR_OUT,
213 PC10_IOR_IN, PC10_IOR_OUT,
214 PC9_IOR_IN, PC9_IOR_OUT,
215 PC8_IOR_IN, PC8_IOR_OUT,
216 PC7_IOR_IN, PC7_IOR_OUT,
217 PC6_IOR_IN, PC6_IOR_OUT,
218 PC5_IOR_IN, PC5_IOR_OUT,
219 PC4_IOR_IN, PC4_IOR_OUT,
220 PC3_IOR_IN, PC3_IOR_OUT,
221 PC2_IOR_IN, PC2_IOR_OUT,
222 PC1_IOR_IN, PC1_IOR_OUT,
223 PC0_IOR_IN, PC0_IOR_OUT,
224
225 PC10MD_0, PC10MD_1,
226 PC9MD_0, PC9MD_1,
227 PC8MD_00, PC8MD_01, PC8MD_10, PC8MD_11,
228 PC7MD_00, PC7MD_01, PC7MD_10, PC7MD_11,
229 PC6MD_00, PC6MD_01, PC6MD_10, PC6MD_11,
230 PC5MD_00, PC5MD_01, PC5MD_10, PC5MD_11,
231 PC4MD_0, PC4MD_1,
232 PC3MD_0, PC3MD_1,
233 PC2MD_0, PC2MD_1,
234 PC1MD_0, PC1MD_1,
235 PC0MD_0, PC0MD_1,
236
237 /* Port D */
238 PD15_IOR_IN, PD15_IOR_OUT,
239 PD14_IOR_IN, PD14_IOR_OUT,
240 PD13_IOR_IN, PD13_IOR_OUT,
241 PD12_IOR_IN, PD12_IOR_OUT,
242 PD11_IOR_IN, PD11_IOR_OUT,
243 PD10_IOR_IN, PD10_IOR_OUT,
244 PD9_IOR_IN, PD9_IOR_OUT,
245 PD8_IOR_IN, PD8_IOR_OUT,
246 PD7_IOR_IN, PD7_IOR_OUT,
247 PD6_IOR_IN, PD6_IOR_OUT,
248 PD5_IOR_IN, PD5_IOR_OUT,
249 PD4_IOR_IN, PD4_IOR_OUT,
250 PD3_IOR_IN, PD3_IOR_OUT,
251 PD2_IOR_IN, PD2_IOR_OUT,
252 PD1_IOR_IN, PD1_IOR_OUT,
253 PD0_IOR_IN, PD0_IOR_OUT,
254
255 PD15MD_00, PD15MD_01, PD15MD_10, PD15MD_11,
256 PD14MD_00, PD14MD_01, PD14MD_10, PD14MD_11,
257 PD13MD_00, PD13MD_01, PD13MD_10, PD13MD_11,
258 PD12MD_00, PD12MD_01, PD12MD_10, PD12MD_11,
259 PD11MD_00, PD11MD_01, PD11MD_10, PD11MD_11,
260 PD10MD_00, PD10MD_01, PD10MD_10, PD10MD_11,
261 PD9MD_00, PD9MD_01, PD9MD_10, PD9MD_11,
262 PD8MD_00, PD8MD_01, PD8MD_10, PD8MD_11,
263 PD7MD_00, PD7MD_01, PD7MD_10, PD7MD_11,
264 PD6MD_00, PD6MD_01, PD6MD_10, PD6MD_11,
265 PD5MD_00, PD5MD_01, PD5MD_10, PD5MD_11,
266 PD4MD_00, PD4MD_01, PD4MD_10, PD4MD_11,
267 PD3MD_00, PD3MD_01, PD3MD_10, PD3MD_11,
268 PD2MD_00, PD2MD_01, PD2MD_10, PD2MD_11,
269 PD1MD_00, PD1MD_01, PD1MD_10, PD1MD_11,
270 PD0MD_00, PD0MD_01, PD0MD_10, PD0MD_11,
271
272 /* Port E */
273 PE5_IOR_IN, PE5_IOR_OUT,
274 PE4_IOR_IN, PE4_IOR_OUT,
275 PE3_IOR_IN, PE3_IOR_OUT,
276 PE2_IOR_IN, PE2_IOR_OUT,
277 PE1_IOR_IN, PE1_IOR_OUT,
278 PE0_IOR_IN, PE0_IOR_OUT,
279
280 PE5MD_00, PE5MD_01, PE5MD_10, PE5MD_11,
281 PE4MD_00, PE4MD_01, PE4MD_10, PE4MD_11,
282 PE3MD_00, PE3MD_01, PE3MD_10, PE3MD_11,
283 PE2MD_00, PE2MD_01, PE2MD_10, PE2MD_11,
284 PE1MD_000, PE1MD_001, PE1MD_010, PE1MD_011,
285 PE1MD_100, PE1MD_101, PE1MD_110, PE1MD_111,
286 PE0MD_00, PE0MD_01, PE0MD_10, PE0MD_11,
287
288 /* Port F */
289 PF12_IOR_IN, PF12_IOR_OUT,
290 PF11_IOR_IN, PF11_IOR_OUT,
291 PF10_IOR_IN, PF10_IOR_OUT,
292 PF9_IOR_IN, PF9_IOR_OUT,
293 PF8_IOR_IN, PF8_IOR_OUT,
294 PF7_IOR_IN, PF7_IOR_OUT,
295 PF6_IOR_IN, PF6_IOR_OUT,
296 PF5_IOR_IN, PF5_IOR_OUT,
297 PF4_IOR_IN, PF4_IOR_OUT,
298 PF3_IOR_IN, PF3_IOR_OUT,
299 PF2_IOR_IN, PF2_IOR_OUT,
300 PF1_IOR_IN, PF1_IOR_OUT,
301 PF0_IOR_IN, PF0_IOR_OUT,
302
303 PF12MD_000, PF12MD_001, PF12MD_010, PF12MD_011,
304 PF12MD_100, PF12MD_101, PF12MD_110, PF12MD_111,
305 PF11MD_000, PF11MD_001, PF11MD_010, PF11MD_011,
306 PF11MD_100, PF11MD_101, PF11MD_110, PF11MD_111,
307 PF10MD_000, PF10MD_001, PF10MD_010, PF10MD_011,
308 PF10MD_100, PF10MD_101, PF10MD_110, PF10MD_111,
309 PF9MD_000, PF9MD_001, PF9MD_010, PF9MD_011,
310 PF9MD_100, PF9MD_101, PF9MD_110, PF9MD_111,
311 PF8MD_00, PF8MD_01, PF8MD_10, PF8MD_11,
312 PF7MD_000, PF7MD_001, PF7MD_010, PF7MD_011,
313 PF7MD_100, PF7MD_101, PF7MD_110, PF7MD_111,
314 PF6MD_000, PF6MD_001, PF6MD_010, PF6MD_011,
315 PF6MD_100, PF6MD_101, PF6MD_110, PF6MD_111,
316 PF5MD_000, PF5MD_001, PF5MD_010, PF5MD_011,
317 PF5MD_100, PF5MD_101, PF5MD_110, PF5MD_111,
318 PF4MD_000, PF4MD_001, PF4MD_010, PF4MD_011,
319 PF4MD_100, PF4MD_101, PF4MD_110, PF4MD_111,
320 PF3MD_000, PF3MD_001, PF3MD_010, PF3MD_011,
321 PF3MD_100, PF3MD_101, PF3MD_110, PF3MD_111,
322 PF2MD_000, PF2MD_001, PF2MD_010, PF2MD_011,
323 PF2MD_100, PF2MD_101, PF2MD_110, PF2MD_111,
324 PF1MD_000, PF1MD_001, PF1MD_010, PF1MD_011,
325 PF1MD_100, PF1MD_101, PF1MD_110, PF1MD_111,
326 PF0MD_000, PF0MD_001, PF0MD_010, PF0MD_011,
327 PF0MD_100, PF0MD_101, PF0MD_110, PF0MD_111,
328
329 /* Port G */
330 PG24_IOR_IN, PG24_IOR_OUT,
331 PG23_IOR_IN, PG23_IOR_OUT,
332 PG22_IOR_IN, PG22_IOR_OUT,
333 PG21_IOR_IN, PG21_IOR_OUT,
334 PG20_IOR_IN, PG20_IOR_OUT,
335 PG19_IOR_IN, PG19_IOR_OUT,
336 PG18_IOR_IN, PG18_IOR_OUT,
337 PG17_IOR_IN, PG17_IOR_OUT,
338 PG16_IOR_IN, PG16_IOR_OUT,
339 PG15_IOR_IN, PG15_IOR_OUT,
340 PG14_IOR_IN, PG14_IOR_OUT,
341 PG13_IOR_IN, PG13_IOR_OUT,
342 PG12_IOR_IN, PG12_IOR_OUT,
343 PG11_IOR_IN, PG11_IOR_OUT,
344 PG10_IOR_IN, PG10_IOR_OUT,
345 PG9_IOR_IN, PG9_IOR_OUT,
346 PG8_IOR_IN, PG8_IOR_OUT,
347 PG7_IOR_IN, PG7_IOR_OUT,
348 PG6_IOR_IN, PG6_IOR_OUT,
349 PG5_IOR_IN, PG5_IOR_OUT,
350 PG4_IOR_IN, PG4_IOR_OUT,
351 PG3_IOR_IN, PG3_IOR_OUT,
352 PG2_IOR_IN, PG2_IOR_OUT,
353 PG1_IOR_IN, PG1_IOR_OUT,
354 PG0_IOR_IN, PG0_IOR_OUT,
355
356 PG24MD_00, PG24MD_01, PG24MD_10, PG24MD_11,
357 PG23MD_00, PG23MD_01, PG23MD_10, PG23MD_11,
358 PG22MD_00, PG22MD_01, PG22MD_10, PG22MD_11,
359 PG21MD_00, PG21MD_01, PG21MD_10, PG21MD_11,
360 PG20MD_000, PG20MD_001, PG20MD_010, PG20MD_011,
361 PG20MD_100, PG20MD_101, PG20MD_110, PG20MD_111,
362 PG19MD_000, PG19MD_001, PG19MD_010, PG19MD_011,
363 PG19MD_100, PG19MD_101, PG19MD_110, PG19MD_111,
364 PG18MD_000, PG18MD_001, PG18MD_010, PG18MD_011,
365 PG18MD_100, PG18MD_101, PG18MD_110, PG18MD_111,
366 PG17MD_000, PG17MD_001, PG17MD_010, PG17MD_011,
367 PG17MD_100, PG17MD_101, PG17MD_110, PG17MD_111,
368 PG16MD_000, PG16MD_001, PG16MD_010, PG16MD_011,
369 PG16MD_100, PG16MD_101, PG16MD_110, PG16MD_111,
370 PG15MD_000, PG15MD_001, PG15MD_010, PG15MD_011,
371 PG15MD_100, PG15MD_101, PG15MD_110, PG15MD_111,
372 PG14MD_000, PG14MD_001, PG14MD_010, PG14MD_011,
373 PG14MD_100, PG14MD_101, PG14MD_110, PG14MD_111,
374 PG13MD_000, PG13MD_001, PG13MD_010, PG13MD_011,
375 PG13MD_100, PG13MD_101, PG13MD_110, PG13MD_111,
376 PG12MD_000, PG12MD_001, PG12MD_010, PG12MD_011,
377 PG12MD_100, PG12MD_101, PG12MD_110, PG12MD_111,
378 PG11MD_000, PG11MD_001, PG11MD_010, PG11MD_011,
379 PG11MD_100, PG11MD_101, PG11MD_110, PG11MD_111,
380 PG10MD_000, PG10MD_001, PG10MD_010, PG10MD_011,
381 PG10MD_100, PG10MD_101, PG10MD_110, PG10MD_111,
382 PG9MD_000, PG9MD_001, PG9MD_010, PG9MD_011,
383 PG9MD_100, PG9MD_101, PG9MD_110, PG9MD_111,
384 PG8MD_000, PG8MD_001, PG8MD_010, PG8MD_011,
385 PG8MD_100, PG8MD_101, PG8MD_110, PG8MD_111,
386 PG7MD_00, PG7MD_01, PG7MD_10, PG7MD_11,
387 PG6MD_00, PG6MD_01, PG6MD_10, PG6MD_11,
388 PG5MD_00, PG5MD_01, PG5MD_10, PG5MD_11,
389 PG4MD_00, PG4MD_01, PG4MD_10, PG4MD_11,
390 PG3MD_00, PG3MD_01, PG3MD_10, PG3MD_11,
391 PG2MD_00, PG2MD_01, PG2MD_10, PG2MD_11,
392 PG1MD_00, PG1MD_01, PG1MD_10, PG1MD_11,
393 PG0MD_000, PG0MD_001, PG0MD_010, PG0MD_011,
394 PG0MD_100, PG0MD_101, PG0MD_110, PG0MD_111,
395
396 /* Port H */
397 PH7MD_0, PH7MD_1,
398 PH6MD_0, PH6MD_1,
399 PH5MD_0, PH5MD_1,
400 PH4MD_0, PH4MD_1,
401 PH3MD_0, PH3MD_1,
402 PH2MD_0, PH2MD_1,
403 PH1MD_0, PH1MD_1,
404 PH0MD_0, PH0MD_1,
405
406 /* Port I - not on device */
407
408 /* Port J */
409 PJ11_IOR_IN, PJ11_IOR_OUT,
410 PJ10_IOR_IN, PJ10_IOR_OUT,
411 PJ9_IOR_IN, PJ9_IOR_OUT,
412 PJ8_IOR_IN, PJ8_IOR_OUT,
413 PJ7_IOR_IN, PJ7_IOR_OUT,
414 PJ6_IOR_IN, PJ6_IOR_OUT,
415 PJ5_IOR_IN, PJ5_IOR_OUT,
416 PJ4_IOR_IN, PJ4_IOR_OUT,
417 PJ3_IOR_IN, PJ3_IOR_OUT,
418 PJ2_IOR_IN, PJ2_IOR_OUT,
419 PJ1_IOR_IN, PJ1_IOR_OUT,
420 PJ0_IOR_IN, PJ0_IOR_OUT,
421
422 PJ11MD_00, PJ11MD_01, PJ11MD_10, PJ11MD_11,
423 PJ10MD_00, PJ10MD_01, PJ10MD_10, PJ10MD_11,
424 PJ9MD_00, PJ9MD_01, PJ9MD_10, PJ9MD_11,
425 PJ8MD_00, PJ8MD_01, PJ8MD_10, PJ8MD_11,
426 PJ7MD_00, PJ7MD_01, PJ7MD_10, PJ7MD_11,
427 PJ6MD_00, PJ6MD_01, PJ6MD_10, PJ6MD_11,
428 PJ5MD_00, PJ5MD_01, PJ5MD_10, PJ5MD_11,
429 PJ4MD_00, PJ4MD_01, PJ4MD_10, PJ4MD_11,
430 PJ3MD_00, PJ3MD_01, PJ3MD_10, PJ3MD_11,
431 PJ2MD_000, PJ2MD_001, PJ2MD_010, PJ2MD_011,
432 PJ2MD_100, PJ2MD_101, PJ2MD_110, PJ2MD_111,
433 PJ1MD_000, PJ1MD_001, PJ1MD_010, PJ1MD_011,
434 PJ1MD_100, PJ1MD_101, PJ1MD_110, PJ1MD_111,
435 PJ0MD_000, PJ0MD_001, PJ0MD_010, PJ0MD_011,
436 PJ0MD_100, PJ0MD_101, PJ0MD_110, PJ0MD_111,
437
438 /* Port K */
439 PK11_IOR_IN, PK11_IOR_OUT,
440 PK10_IOR_IN, PK10_IOR_OUT,
441 PK9_IOR_IN, PK9_IOR_OUT,
442 PK8_IOR_IN, PK8_IOR_OUT,
443 PK7_IOR_IN, PK7_IOR_OUT,
444 PK6_IOR_IN, PK6_IOR_OUT,
445 PK5_IOR_IN, PK5_IOR_OUT,
446 PK4_IOR_IN, PK4_IOR_OUT,
447 PK3_IOR_IN, PK3_IOR_OUT,
448 PK2_IOR_IN, PK2_IOR_OUT,
449 PK1_IOR_IN, PK1_IOR_OUT,
450 PK0_IOR_IN, PK0_IOR_OUT,
451
452 PK11MD_00, PK11MD_01, PK11MD_10, PK11MD_11,
453 PK10MD_00, PK10MD_01, PK10MD_10, PK10MD_11,
454 PK9MD_00, PK9MD_01, PK9MD_10, PK9MD_11,
455 PK8MD_00, PK8MD_01, PK8MD_10, PK8MD_11,
456 PK7MD_00, PK7MD_01, PK7MD_10, PK7MD_11,
457 PK6MD_00, PK6MD_01, PK6MD_10, PK6MD_11,
458 PK5MD_00, PK5MD_01, PK5MD_10, PK5MD_11,
459 PK4MD_00, PK4MD_01, PK4MD_10, PK4MD_11,
460 PK3MD_00, PK3MD_01, PK3MD_10, PK3MD_11,
461 PK2MD_00, PK2MD_01, PK2MD_10, PK2MD_11,
462 PK1MD_00, PK1MD_01, PK1MD_10, PK1MD_11,
463 PK0MD_00, PK0MD_01, PK0MD_10, PK0MD_11,
464 PINMUX_FUNCTION_END,
465
466 PINMUX_MARK_BEGIN,
467 /* Port A */
468
469 /* Port B */
470
471 /* Port C */
472
473 /* Port D */
474
475 /* Port E */
476
477 /* Port F */
478
479 /* Port G */
480
481 /* Port H */
482 PHAN7_MARK, PHAN6_MARK, PHAN5_MARK, PHAN4_MARK,
483 PHAN3_MARK, PHAN2_MARK, PHAN1_MARK, PHAN0_MARK,
484
485 /* Port I - not on device */
486
487 /* Port J */
488
489 /* Port K */
490
491 IRQ7_PC_MARK, IRQ6_PC_MARK, IRQ5_PC_MARK, IRQ4_PC_MARK,
492 IRQ3_PG_MARK, IRQ2_PG_MARK, IRQ1_PJ_MARK, IRQ0_PJ_MARK,
493 IRQ3_PE_MARK, IRQ2_PE_MARK, IRQ1_PE_MARK, IRQ0_PE_MARK,
494
495 PINT7_PG_MARK, PINT6_PG_MARK, PINT5_PG_MARK, PINT4_PG_MARK,
496 PINT3_PG_MARK, PINT2_PG_MARK, PINT1_PG_MARK, PINT0_PG_MARK,
497
498 SD_CD_MARK, SD_D0_MARK, SD_D1_MARK, SD_D2_MARK, SD_D3_MARK,
499 SD_WP_MARK, SD_CLK_MARK, SD_CMD_MARK,
500 CRX0_MARK, CRX1_MARK,
501 CTX0_MARK, CTX1_MARK,
502
503 PWM1A_MARK, PWM1B_MARK, PWM1C_MARK, PWM1D_MARK,
504 PWM1E_MARK, PWM1F_MARK, PWM1G_MARK, PWM1H_MARK,
505 PWM2A_MARK, PWM2B_MARK, PWM2C_MARK, PWM2D_MARK,
506 PWM2E_MARK, PWM2F_MARK, PWM2G_MARK, PWM2H_MARK,
507 IERXD_MARK, IETXD_MARK,
508 CRX0CRX1_MARK,
509 WDTOVF_MARK,
510
511 CRX0X1_MARK,
512
513 /* DMAC */
514 TEND0_MARK, DACK0_MARK, DREQ0_MARK,
515 TEND1_MARK, DACK1_MARK, DREQ1_MARK,
516
517 /* ADC */
518 ADTRG_MARK,
519
520 /* BSC */
521 A25_MARK, A24_MARK,
522 A23_MARK, A22_MARK, A21_MARK, A20_MARK,
523 A19_MARK, A18_MARK, A17_MARK, A16_MARK,
524 A15_MARK, A14_MARK, A13_MARK, A12_MARK,
525 A11_MARK, A10_MARK, A9_MARK, A8_MARK,
526 A7_MARK, A6_MARK, A5_MARK, A4_MARK,
527 A3_MARK, A2_MARK, A1_MARK, A0_MARK,
528 D15_MARK, D14_MARK, D13_MARK, D12_MARK,
529 D11_MARK, D10_MARK, D9_MARK, D8_MARK,
530 D7_MARK, D6_MARK, D5_MARK, D4_MARK,
531 D3_MARK, D2_MARK, D1_MARK, D0_MARK,
532 BS_MARK,
533 CS4_MARK, CS3_MARK, CS2_MARK, CS1_MARK, CS0_MARK,
534 CS6CE1B_MARK, CS5CE1A_MARK,
535 CE2A_MARK, CE2B_MARK,
536 RD_MARK, RDWR_MARK,
537 ICIOWRAH_MARK,
538 ICIORD_MARK,
539 WE1DQMUWE_MARK,
540 WE0DQML_MARK,
541 RAS_MARK, CAS_MARK, CKE_MARK,
542 WAIT_MARK, BREQ_MARK, BACK_MARK, IOIS16_MARK,
543
544 /* TMU */
545 TIOC0A_MARK, TIOC0B_MARK, TIOC0C_MARK, TIOC0D_MARK,
546 TIOC1A_MARK, TIOC1B_MARK,
547 TIOC2A_MARK, TIOC2B_MARK,
548 TIOC3A_MARK, TIOC3B_MARK, TIOC3C_MARK, TIOC3D_MARK,
549 TIOC4A_MARK, TIOC4B_MARK, TIOC4C_MARK, TIOC4D_MARK,
550 TCLKA_MARK, TCLKB_MARK, TCLKC_MARK, TCLKD_MARK,
551
552 /* SCIF */
553 SCK0_MARK, SCK1_MARK, SCK2_MARK, SCK3_MARK,
554 RXD0_MARK, RXD1_MARK, RXD2_MARK, RXD3_MARK,
555 TXD0_MARK, TXD1_MARK, TXD2_MARK, TXD3_MARK,
556 RXD4_MARK, RXD5_MARK, RXD6_MARK, RXD7_MARK,
557 TXD4_MARK, TXD5_MARK, TXD6_MARK, TXD7_MARK,
558 RTS1_MARK, RTS3_MARK,
559 CTS1_MARK, CTS3_MARK,
560
561 /* RSPI */
562 RSPCK0_MARK, RSPCK1_MARK,
563 MOSI0_MARK, MOSI1_MARK,
564 MISO0_PF12_MARK, MISO1_MARK, MISO1_PG19_MARK,
565 SSL00_MARK, SSL10_MARK,
566
567 /* IIC3 */
568 SCL0_MARK, SCL1_MARK, SCL2_MARK,
569 SDA0_MARK, SDA1_MARK, SDA2_MARK,
570
571 /* SSI */
572 SSISCK0_MARK,
573 SSIWS0_MARK,
574 SSITXD0_MARK,
575 SSIRXD0_MARK,
576 SSIWS1_MARK, SSIWS2_MARK, SSIWS3_MARK,
577 SSISCK1_MARK, SSISCK2_MARK, SSISCK3_MARK,
578 SSIDATA1_MARK, SSIDATA2_MARK, SSIDATA3_MARK,
579 AUDIO_CLK_MARK,
580
581 /* SIOF */ /* NOTE Shares AUDIO_CLK with SSI */
582 SIOFTXD_MARK, SIOFRXD_MARK, SIOFSYNC_MARK, SIOFSCK_MARK,
583
584 /* SPDIF */ /* NOTE Shares AUDIO_CLK with SSI */
585 SPDIF_IN_MARK, SPDIF_OUT_MARK,
586
587 /* NANDFMC */ /* NOTE Controller is not available in boot mode 0 */
588 FCE_MARK,
589 FRB_MARK,
590
591 /* VDC3 */
592 DV_CLK_MARK,
593 DV_VSYNC_MARK, DV_HSYNC_MARK,
594 DV_DATA7_MARK, DV_DATA6_MARK, DV_DATA5_MARK, DV_DATA4_MARK,
595 DV_DATA3_MARK, DV_DATA2_MARK, DV_DATA1_MARK, DV_DATA0_MARK,
596 LCD_CLK_MARK, LCD_EXTCLK_MARK,
597 LCD_VSYNC_MARK, LCD_HSYNC_MARK, LCD_DE_MARK,
598 LCD_DATA15_MARK, LCD_DATA14_MARK, LCD_DATA13_MARK, LCD_DATA12_MARK,
599 LCD_DATA11_MARK, LCD_DATA10_MARK, LCD_DATA9_MARK, LCD_DATA8_MARK,
600 LCD_DATA7_MARK, LCD_DATA6_MARK, LCD_DATA5_MARK, LCD_DATA4_MARK,
601 LCD_DATA3_MARK, LCD_DATA2_MARK, LCD_DATA1_MARK, LCD_DATA0_MARK,
602 LCD_M_DISP_MARK,
603 PINMUX_MARK_END,
604};
605
606static pinmux_enum_t pinmux_data[] = {
607
608 /* Port A */
609 PINMUX_DATA(PA3_DATA, PA3_IN),
610 PINMUX_DATA(PA2_DATA, PA2_IN),
611 PINMUX_DATA(PA1_DATA, PA1_IN),
612 PINMUX_DATA(PA0_DATA, PA0_IN),
613
614 /* Port B */
615 PINMUX_DATA(PB22_DATA, PB22MD_00, PB22_IN, PB22_OUT),
616 PINMUX_DATA(A22_MARK, PB22MD_01),
617 PINMUX_DATA(CS4_MARK, PB22MD_10),
618
619 PINMUX_DATA(PB21_DATA, PB21MD_0, PB21_IN, PB21_OUT),
620 PINMUX_DATA(A21_MARK, PB21MD_1),
621 PINMUX_DATA(A20_MARK, PB20MD_1),
622 PINMUX_DATA(A19_MARK, PB19MD_01),
623 PINMUX_DATA(A18_MARK, PB18MD_01),
624 PINMUX_DATA(A17_MARK, PB17MD_01),
625 PINMUX_DATA(A16_MARK, PB16MD_01),
626 PINMUX_DATA(A15_MARK, PB15MD_01),
627 PINMUX_DATA(A14_MARK, PB14MD_01),
628 PINMUX_DATA(A13_MARK, PB13MD_01),
629 PINMUX_DATA(A12_MARK, PB12MD_01),
630 PINMUX_DATA(A11_MARK, PB11MD_01),
631 PINMUX_DATA(A10_MARK, PB10MD_01),
632 PINMUX_DATA(A9_MARK, PB9MD_01),
633 PINMUX_DATA(A8_MARK, PB8MD_01),
634 PINMUX_DATA(A7_MARK, PB7MD_01),
635 PINMUX_DATA(A6_MARK, PB6MD_01),
636 PINMUX_DATA(A5_MARK, PB5MD_01),
637 PINMUX_DATA(A4_MARK, PB4MD_01),
638 PINMUX_DATA(A3_MARK, PB3MD_1),
639 PINMUX_DATA(A2_MARK, PB2MD_1),
640 PINMUX_DATA(A1_MARK, PB1MD_1),
641
642 /* Port C */
643 PINMUX_DATA(PC10_DATA, PC10MD_0),
644 PINMUX_DATA(TIOC2B_MARK, PC1MD_1),
645 PINMUX_DATA(PC9_DATA, PC9MD_0),
646 PINMUX_DATA(TIOC2A_MARK, PC9MD_1),
647 PINMUX_DATA(PC8_DATA, PC8MD_00),
648 PINMUX_DATA(CS3_MARK, PC8MD_01),
649 PINMUX_DATA(TIOC4D_MARK, PC8MD_10),
650 PINMUX_DATA(IRQ7_PC_MARK, PC8MD_11),
651 PINMUX_DATA(PC7_DATA, PC7MD_00),
652 PINMUX_DATA(CKE_MARK, PC7MD_01),
653 PINMUX_DATA(TIOC4C_MARK, PC7MD_10),
654 PINMUX_DATA(IRQ6_PC_MARK, PC7MD_11),
655 PINMUX_DATA(PC6_DATA, PC6MD_00),
656 PINMUX_DATA(CAS_MARK, PC6MD_01),
657 PINMUX_DATA(TIOC4B_MARK, PC6MD_10),
658 PINMUX_DATA(IRQ5_PC_MARK, PC6MD_11),
659 PINMUX_DATA(PC5_DATA, PC5MD_00),
660 PINMUX_DATA(RAS_MARK, PC5MD_01),
661 PINMUX_DATA(TIOC4A_MARK, PC5MD_10),
662 PINMUX_DATA(IRQ4_PC_MARK, PC5MD_11),
663 PINMUX_DATA(PC4_DATA, PC4MD_0),
664 PINMUX_DATA(WE1DQMUWE_MARK, PC4MD_1),
665 PINMUX_DATA(PC3_DATA, PC3MD_0),
666 PINMUX_DATA(WE0DQML_MARK, PC3MD_1),
667 PINMUX_DATA(PC2_DATA, PC2MD_0),
668 PINMUX_DATA(RDWR_MARK, PC2MD_1),
669 PINMUX_DATA(PC1_DATA, PC1MD_0),
670 PINMUX_DATA(RD_MARK, PC1MD_1),
671 PINMUX_DATA(PC0_DATA, PC0MD_0),
672 PINMUX_DATA(CS0_MARK, PC0MD_1),
673
674 /* Port D */
675 PINMUX_DATA(D15_MARK, PD15MD_01),
676 PINMUX_DATA(D14_MARK, PD14MD_01),
677 PINMUX_DATA(D13_MARK, PD13MD_01),
678 PINMUX_DATA(D12_MARK, PD12MD_01),
679 PINMUX_DATA(D11_MARK, PD11MD_01),
680 PINMUX_DATA(D10_MARK, PD10MD_01),
681 PINMUX_DATA(D9_MARK, PD9MD_01),
682 PINMUX_DATA(D8_MARK, PD8MD_01),
683 PINMUX_DATA(D7_MARK, PD7MD_01),
684 PINMUX_DATA(D6_MARK, PD6MD_01),
685 PINMUX_DATA(D5_MARK, PD5MD_01),
686 PINMUX_DATA(D4_MARK, PD4MD_01),
687 PINMUX_DATA(D3_MARK, PD3MD_01),
688 PINMUX_DATA(D2_MARK, PD2MD_01),
689 PINMUX_DATA(D1_MARK, PD1MD_01),
690 PINMUX_DATA(D0_MARK, PD0MD_01),
691
692 /* Port E */
693 PINMUX_DATA(PE5_DATA, PE5MD_00),
694 PINMUX_DATA(SDA2_MARK, PE5MD_01),
695 PINMUX_DATA(DV_HSYNC_MARK, PE5MD_11),
696
697 PINMUX_DATA(PE4_DATA, PE4MD_00),
698 PINMUX_DATA(SCL2_MARK, PE4MD_01),
699 PINMUX_DATA(DV_VSYNC_MARK, PE4MD_11),
700
701 PINMUX_DATA(PE3_DATA, PE3MD_00),
702 PINMUX_DATA(SDA1_MARK, PE3MD_01),
703 PINMUX_DATA(IRQ3_PE_MARK, PE3MD_11),
704
705 PINMUX_DATA(PE2_DATA, PE2MD_00),
706 PINMUX_DATA(SCL1_MARK, PE2MD_01),
707 PINMUX_DATA(IRQ2_PE_MARK, PE2MD_11),
708
709 PINMUX_DATA(PE1_DATA, PE1MD_000),
710 PINMUX_DATA(SDA0_MARK, PE1MD_001),
711 PINMUX_DATA(IOIS16_MARK, PE1MD_010),
712 PINMUX_DATA(IRQ1_PE_MARK, PE1MD_011),
713 PINMUX_DATA(TCLKA_MARK, PE1MD_100),
714 PINMUX_DATA(ADTRG_MARK, PE1MD_101),
715
716 PINMUX_DATA(PE0_DATA, PE0MD_00),
717 PINMUX_DATA(SCL0_MARK, PE0MD_01),
718 PINMUX_DATA(AUDIO_CLK_MARK, PE0MD_10),
719 PINMUX_DATA(IRQ0_PE_MARK, PE0MD_11),
720
721 /* Port F */
722 PINMUX_DATA(PF12_DATA, PF12MD_000),
723 PINMUX_DATA(BS_MARK, PF12MD_001),
724 PINMUX_DATA(MISO0_PF12_MARK, PF12MD_011),
725 PINMUX_DATA(TIOC3D_MARK, PF12MD_100),
726 PINMUX_DATA(SPDIF_OUT_MARK, PF12MD_101),
727
728 PINMUX_DATA(PF11_DATA, PF11MD_000),
729 PINMUX_DATA(A25_MARK, PF11MD_001),
730 PINMUX_DATA(SSIDATA3_MARK, PF11MD_010),
731 PINMUX_DATA(MOSI0_MARK, PF11MD_011),
732 PINMUX_DATA(TIOC3C_MARK, PF11MD_100),
733 PINMUX_DATA(SPDIF_IN_MARK, PF11MD_101),
734
735 PINMUX_DATA(PF10_DATA, PF10MD_000),
736 PINMUX_DATA(A24_MARK, PF10MD_001),
737 PINMUX_DATA(SSIWS3_MARK, PF10MD_010),
738 PINMUX_DATA(SSL00_MARK, PF10MD_011),
739 PINMUX_DATA(TIOC3B_MARK, PF10MD_100),
740 PINMUX_DATA(FCE_MARK, PF10MD_101),
741
742 PINMUX_DATA(PF9_DATA, PF9MD_000),
743 PINMUX_DATA(A23_MARK, PF9MD_001),
744 PINMUX_DATA(SSISCK3_MARK, PF9MD_010),
745 PINMUX_DATA(RSPCK0_MARK, PF9MD_011),
746 PINMUX_DATA(TIOC3A_MARK, PF9MD_100),
747 PINMUX_DATA(FRB_MARK, PF9MD_101),
748
749 PINMUX_DATA(PF8_DATA, PF8MD_00),
750 PINMUX_DATA(CE2B_MARK, PF8MD_01),
751 PINMUX_DATA(SSIDATA3_MARK, PF8MD_10),
752 PINMUX_DATA(DV_CLK_MARK, PF8MD_11),
753
754 PINMUX_DATA(PF7_DATA, PF7MD_000),
755 PINMUX_DATA(CE2A_MARK, PF7MD_001),
756 PINMUX_DATA(SSIWS3_MARK, PF7MD_010),
757 PINMUX_DATA(DV_DATA7_MARK, PF7MD_011),
758 PINMUX_DATA(TCLKD_MARK, PF7MD_100),
759
760 PINMUX_DATA(PF6_DATA, PF6MD_000),
761 PINMUX_DATA(CS6CE1B_MARK, PF6MD_001),
762 PINMUX_DATA(SSISCK3_MARK, PF6MD_010),
763 PINMUX_DATA(DV_DATA6_MARK, PF6MD_011),
764 PINMUX_DATA(TCLKB_MARK, PF6MD_100),
765
766 PINMUX_DATA(PF5_DATA, PF5MD_000),
767 PINMUX_DATA(CS5CE1A_MARK, PF5MD_001),
768 PINMUX_DATA(SSIDATA2_MARK, PF5MD_010),
769 PINMUX_DATA(DV_DATA5_MARK, PF5MD_011),
770 PINMUX_DATA(TCLKC_MARK, PF5MD_100),
771
772 PINMUX_DATA(PF4_DATA, PF4MD_000),
773 PINMUX_DATA(ICIOWRAH_MARK, PF4MD_001),
774 PINMUX_DATA(SSIWS2_MARK, PF4MD_010),
775 PINMUX_DATA(DV_DATA4_MARK, PF4MD_011),
776 PINMUX_DATA(TXD3_MARK, PF4MD_100),
777
778 PINMUX_DATA(PF3_DATA, PF3MD_000),
779 PINMUX_DATA(ICIORD_MARK, PF3MD_001),
780 PINMUX_DATA(SSISCK2_MARK, PF3MD_010),
781 PINMUX_DATA(DV_DATA3_MARK, PF3MD_011),
782 PINMUX_DATA(RXD3_MARK, PF3MD_100),
783
784 PINMUX_DATA(PF2_DATA, PF2MD_000),
785 PINMUX_DATA(BACK_MARK, PF2MD_001),
786 PINMUX_DATA(SSIDATA1_MARK, PF2MD_010),
787 PINMUX_DATA(DV_DATA2_MARK, PF2MD_011),
788 PINMUX_DATA(TXD2_MARK, PF2MD_100),
789 PINMUX_DATA(DACK0_MARK, PF2MD_101),
790
791 PINMUX_DATA(PF1_DATA, PF1MD_000),
792 PINMUX_DATA(BREQ_MARK, PF1MD_001),
793 PINMUX_DATA(SSIWS1_MARK, PF1MD_010),
794 PINMUX_DATA(DV_DATA1_MARK, PF1MD_011),
795 PINMUX_DATA(RXD2_MARK, PF1MD_100),
796 PINMUX_DATA(DREQ0_MARK, PF1MD_101),
797
798 PINMUX_DATA(PF0_DATA, PF0MD_000),
799 PINMUX_DATA(WAIT_MARK, PF0MD_001),
800 PINMUX_DATA(SSISCK1_MARK, PF0MD_010),
801 PINMUX_DATA(DV_DATA0_MARK, PF0MD_011),
802 PINMUX_DATA(SCK2_MARK, PF0MD_100),
803 PINMUX_DATA(TEND0_MARK, PF0MD_101),
804
805 /* Port G */
806 PINMUX_DATA(PG24_DATA, PG24MD_00),
807 PINMUX_DATA(MOSI0_MARK, PG24MD_01),
808 PINMUX_DATA(TIOC0D_MARK, PG24MD_10),
809
810 PINMUX_DATA(PG23_DATA, PG23MD_00),
811 PINMUX_DATA(MOSI1_MARK, PG23MD_01),
812 PINMUX_DATA(TIOC0C_MARK, PG23MD_10),
813
814 PINMUX_DATA(PG22_DATA, PG22MD_00),
815 PINMUX_DATA(SSL10_MARK, PG22MD_01),
816 PINMUX_DATA(TIOC0B_MARK, PG22MD_10),
817
818 PINMUX_DATA(PG21_DATA, PG21MD_00),
819 PINMUX_DATA(RSPCK1_MARK, PG21MD_01),
820 PINMUX_DATA(TIOC0A_MARK, PG21MD_10),
821
822 PINMUX_DATA(PG20_DATA, PG20MD_000),
823 PINMUX_DATA(LCD_EXTCLK_MARK, PG20MD_001),
824 PINMUX_DATA(MISO1_MARK, PG20MD_011),
825 PINMUX_DATA(TXD7_MARK, PG20MD_100),
826
827 PINMUX_DATA(PG19_DATA, PG19MD_000),
828 PINMUX_DATA(LCD_CLK_MARK, PG19MD_001),
829 PINMUX_DATA(TIOC2B_MARK, PG19MD_010),
830 PINMUX_DATA(MISO1_PG19_MARK, PG19MD_011),
831 PINMUX_DATA(RXD7_MARK, PG19MD_100),
832
833 PINMUX_DATA(PG18_DATA, PG18MD_000),
834 PINMUX_DATA(LCD_DE_MARK, PG18MD_001),
835 PINMUX_DATA(TIOC2A_MARK, PG18MD_010),
836 PINMUX_DATA(SSL10_MARK, PG18MD_011),
837 PINMUX_DATA(TXD6_MARK, PG18MD_100),
838
839 PINMUX_DATA(PG17_DATA, PG17MD_000),
840 PINMUX_DATA(LCD_HSYNC_MARK, PG17MD_001),
841 PINMUX_DATA(TIOC1B_MARK, PG17MD_010),
842 PINMUX_DATA(RSPCK1_MARK, PG17MD_011),
843 PINMUX_DATA(RXD6_MARK, PG17MD_100),
844
845 PINMUX_DATA(PG16_DATA, PG16MD_000),
846 PINMUX_DATA(LCD_VSYNC_MARK, PG16MD_001),
847 PINMUX_DATA(TIOC1A_MARK, PG16MD_010),
848 PINMUX_DATA(TXD3_MARK, PG16MD_011),
849 PINMUX_DATA(CTS1_MARK, PG16MD_100),
850
851 PINMUX_DATA(PG15_DATA, PG15MD_000),
852 PINMUX_DATA(LCD_DATA15_MARK, PG15MD_001),
853 PINMUX_DATA(TIOC0D_MARK, PG15MD_010),
854 PINMUX_DATA(RXD3_MARK, PG15MD_011),
855 PINMUX_DATA(RTS1_MARK, PG15MD_100),
856
857 PINMUX_DATA(PG14_DATA, PG14MD_000),
858 PINMUX_DATA(LCD_DATA14_MARK, PG14MD_001),
859 PINMUX_DATA(TIOC0C_MARK, PG14MD_010),
860 PINMUX_DATA(SCK1_MARK, PG14MD_100),
861
862 PINMUX_DATA(PG13_DATA, PG13MD_000),
863 PINMUX_DATA(LCD_DATA13_MARK, PG13MD_001),
864 PINMUX_DATA(TIOC0B_MARK, PG13MD_010),
865 PINMUX_DATA(TXD1_MARK, PG13MD_100),
866
867 PINMUX_DATA(PG12_DATA, PG12MD_000),
868 PINMUX_DATA(LCD_DATA12_MARK, PG12MD_001),
869 PINMUX_DATA(TIOC0A_MARK, PG12MD_010),
870 PINMUX_DATA(RXD1_MARK, PG12MD_100),
871
872 PINMUX_DATA(PG11_DATA, PG11MD_000),
873 PINMUX_DATA(LCD_DATA11_MARK, PG11MD_001),
874 PINMUX_DATA(SSITXD0_MARK, PG11MD_010),
875 PINMUX_DATA(IRQ3_PG_MARK, PG11MD_011),
876 PINMUX_DATA(TXD5_MARK, PG11MD_100),
877 PINMUX_DATA(SIOFTXD_MARK, PG11MD_101),
878
879 PINMUX_DATA(PG10_DATA, PG10MD_000),
880 PINMUX_DATA(LCD_DATA10_MARK, PG10MD_001),
881 PINMUX_DATA(SSIRXD0_MARK, PG10MD_010),
882 PINMUX_DATA(IRQ2_PG_MARK, PG10MD_011),
883 PINMUX_DATA(RXD5_MARK, PG10MD_100),
884 PINMUX_DATA(SIOFRXD_MARK, PG10MD_101),
885
886 PINMUX_DATA(PG9_DATA, PG9MD_000),
887 PINMUX_DATA(LCD_DATA9_MARK, PG9MD_001),
888 PINMUX_DATA(SSIWS0_MARK, PG9MD_010),
889 PINMUX_DATA(TXD4_MARK, PG9MD_100),
890 PINMUX_DATA(SIOFSYNC_MARK, PG9MD_101),
891
892 PINMUX_DATA(PG8_DATA, PG8MD_000),
893 PINMUX_DATA(LCD_DATA8_MARK, PG8MD_001),
894 PINMUX_DATA(SSISCK0_MARK, PG8MD_010),
895 PINMUX_DATA(RXD4_MARK, PG8MD_100),
896 PINMUX_DATA(SIOFSCK_MARK, PG8MD_101),
897
898 PINMUX_DATA(PG7_DATA, PG7MD_00),
899 PINMUX_DATA(LCD_DATA7_MARK, PG7MD_01),
900 PINMUX_DATA(SD_CD_MARK, PG7MD_10),
901 PINMUX_DATA(PINT7_PG_MARK, PG7MD_11),
902
903 PINMUX_DATA(PG6_DATA, PG7MD_00),
904 PINMUX_DATA(LCD_DATA6_MARK, PG7MD_01),
905 PINMUX_DATA(SD_WP_MARK, PG7MD_10),
906 PINMUX_DATA(PINT6_PG_MARK, PG7MD_11),
907
908 PINMUX_DATA(PG5_DATA, PG5MD_00),
909 PINMUX_DATA(LCD_DATA5_MARK, PG5MD_01),
910 PINMUX_DATA(SD_D1_MARK, PG5MD_10),
911 PINMUX_DATA(PINT5_PG_MARK, PG5MD_11),
912
913 PINMUX_DATA(PG4_DATA, PG4MD_00),
914 PINMUX_DATA(LCD_DATA4_MARK, PG4MD_01),
915 PINMUX_DATA(SD_D0_MARK, PG4MD_10),
916 PINMUX_DATA(PINT4_PG_MARK, PG4MD_11),
917
918 PINMUX_DATA(PG3_DATA, PG3MD_00),
919 PINMUX_DATA(LCD_DATA3_MARK, PG3MD_01),
920 PINMUX_DATA(SD_CLK_MARK, PG3MD_10),
921 PINMUX_DATA(PINT3_PG_MARK, PG3MD_11),
922
923 PINMUX_DATA(PG2_DATA, PG2MD_00),
924 PINMUX_DATA(LCD_DATA2_MARK, PG2MD_01),
925 PINMUX_DATA(SD_CMD_MARK, PG2MD_10),
926 PINMUX_DATA(PINT2_PG_MARK, PG2MD_11),
927
928 PINMUX_DATA(PG1_DATA, PG1MD_00),
929 PINMUX_DATA(LCD_DATA1_MARK, PG1MD_01),
930 PINMUX_DATA(SD_D3_MARK, PG1MD_10),
931 PINMUX_DATA(PINT1_PG_MARK, PG1MD_11),
932
933 PINMUX_DATA(PG0_DATA, PG0MD_000),
934 PINMUX_DATA(LCD_DATA0_MARK, PG0MD_001),
935 PINMUX_DATA(SD_D2_MARK, PG0MD_010),
936 PINMUX_DATA(PINT0_PG_MARK, PG0MD_011),
937 PINMUX_DATA(WDTOVF_MARK, PG0MD_100),
938
939 /* Port H */
940 PINMUX_DATA(PH7_DATA, PH7MD_0),
941 PINMUX_DATA(PHAN7_MARK, PH7MD_1),
942
943 PINMUX_DATA(PH6_DATA, PH6MD_0),
944 PINMUX_DATA(PHAN6_MARK, PH6MD_1),
945
946 PINMUX_DATA(PH5_DATA, PH5MD_0),
947 PINMUX_DATA(PHAN5_MARK, PH5MD_1),
948
949 PINMUX_DATA(PH4_DATA, PH4MD_0),
950 PINMUX_DATA(PHAN4_MARK, PH4MD_1),
951
952 PINMUX_DATA(PH3_DATA, PH3MD_0),
953 PINMUX_DATA(PHAN3_MARK, PH3MD_1),
954
955 PINMUX_DATA(PH2_DATA, PH2MD_0),
956 PINMUX_DATA(PHAN2_MARK, PH2MD_1),
957
958 PINMUX_DATA(PH1_DATA, PH1MD_0),
959 PINMUX_DATA(PHAN1_MARK, PH1MD_1),
960
961 PINMUX_DATA(PH0_DATA, PH0MD_0),
962 PINMUX_DATA(PHAN0_MARK, PH0MD_1),
963
964 /* Port I - not on device */
965
966 /* Port J */
967 PINMUX_DATA(PJ11_DATA, PJ11MD_00),
968 PINMUX_DATA(PWM2H_MARK, PJ11MD_01),
969 PINMUX_DATA(DACK1_MARK, PJ11MD_10),
970
971 PINMUX_DATA(PJ10_DATA, PJ10MD_00),
972 PINMUX_DATA(PWM2G_MARK, PJ10MD_01),
973 PINMUX_DATA(DREQ1_MARK, PJ10MD_10),
974
975 PINMUX_DATA(PJ9_DATA, PJ9MD_00),
976 PINMUX_DATA(PWM2F_MARK, PJ9MD_01),
977 PINMUX_DATA(TEND1_MARK, PJ9MD_10),
978
979 PINMUX_DATA(PJ8_DATA, PJ8MD_00),
980 PINMUX_DATA(PWM2E_MARK, PJ8MD_01),
981 PINMUX_DATA(RTS3_MARK, PJ8MD_10),
982
983 PINMUX_DATA(PJ7_DATA, PJ7MD_00),
984 PINMUX_DATA(TIOC1B_MARK, PJ7MD_01),
985 PINMUX_DATA(CTS3_MARK, PJ7MD_10),
986
987 PINMUX_DATA(PJ6_DATA, PJ6MD_00),
988 PINMUX_DATA(TIOC1A_MARK, PJ6MD_01),
989 PINMUX_DATA(SCK3_MARK, PJ6MD_10),
990
991 PINMUX_DATA(PJ5_DATA, PJ5MD_00),
992 PINMUX_DATA(IERXD_MARK, PJ5MD_01),
993 PINMUX_DATA(TXD3_MARK, PJ5MD_10),
994
995 PINMUX_DATA(PJ4_DATA, PJ4MD_00),
996 PINMUX_DATA(IETXD_MARK, PJ4MD_01),
997 PINMUX_DATA(RXD3_MARK, PJ4MD_10),
998
999 PINMUX_DATA(PJ3_DATA, PJ3MD_00),
1000 PINMUX_DATA(CRX1_MARK, PJ3MD_01),
1001 PINMUX_DATA(CRX0X1_MARK, PJ3MD_10),
1002 PINMUX_DATA(IRQ1_PJ_MARK, PJ3MD_11),
1003
1004 PINMUX_DATA(PJ2_DATA, PJ2MD_000),
1005 PINMUX_DATA(CTX1_MARK, PJ2MD_001),
1006 PINMUX_DATA(CRX0CRX1_MARK, PJ2MD_010),
1007 PINMUX_DATA(CS2_MARK, PJ2MD_011),
1008 PINMUX_DATA(SCK0_MARK, PJ2MD_100),
1009 PINMUX_DATA(LCD_M_DISP_MARK, PJ2MD_101),
1010
1011 PINMUX_DATA(PJ1_DATA, PJ1MD_000),
1012 PINMUX_DATA(CRX0_MARK, PJ1MD_001),
1013 PINMUX_DATA(IERXD_MARK, PJ1MD_010),
1014 PINMUX_DATA(IRQ0_PJ_MARK, PJ1MD_011),
1015 PINMUX_DATA(RXD0_MARK, PJ1MD_100),
1016
1017 PINMUX_DATA(PJ0_DATA, PJ0MD_000),
1018 PINMUX_DATA(CTX0_MARK, PJ0MD_001),
1019 PINMUX_DATA(IERXD_MARK, PJ0MD_010),
1020 PINMUX_DATA(CS1_MARK, PJ0MD_011),
1021 PINMUX_DATA(TXD0_MARK, PJ0MD_100),
1022 PINMUX_DATA(A0_MARK, PJ0MD_101),
1023
1024 /* Port K */
1025 PINMUX_DATA(PK11_DATA, PK11MD_00),
1026 PINMUX_DATA(PWM2D_MARK, PK11MD_01),
1027 PINMUX_DATA(SSITXD0_MARK, PK11MD_10),
1028
1029 PINMUX_DATA(PK10_DATA, PK10MD_00),
1030 PINMUX_DATA(PWM2C_MARK, PK10MD_01),
1031 PINMUX_DATA(SSIRXD0_MARK, PK10MD_10),
1032
1033 PINMUX_DATA(PK9_DATA, PK9MD_00),
1034 PINMUX_DATA(PWM2B_MARK, PK9MD_01),
1035 PINMUX_DATA(SSIWS0_MARK, PK9MD_10),
1036
1037 PINMUX_DATA(PK8_DATA, PK8MD_00),
1038 PINMUX_DATA(PWM2A_MARK, PK8MD_01),
1039 PINMUX_DATA(SSISCK0_MARK, PK8MD_10),
1040
1041 PINMUX_DATA(PK7_DATA, PK7MD_00),
1042 PINMUX_DATA(PWM1H_MARK, PK7MD_01),
1043 PINMUX_DATA(SD_CD_MARK, PK7MD_10),
1044
1045 PINMUX_DATA(PK6_DATA, PK6MD_00),
1046 PINMUX_DATA(PWM1G_MARK, PK6MD_01),
1047 PINMUX_DATA(SD_WP_MARK, PK6MD_10),
1048
1049 PINMUX_DATA(PK5_DATA, PK5MD_00),
1050 PINMUX_DATA(PWM1F_MARK, PK5MD_01),
1051 PINMUX_DATA(SD_D1_MARK, PK5MD_10),
1052
1053 PINMUX_DATA(PK4_DATA, PK4MD_00),
1054 PINMUX_DATA(PWM1E_MARK, PK4MD_01),
1055 PINMUX_DATA(SD_D0_MARK, PK4MD_10),
1056
1057 PINMUX_DATA(PK3_DATA, PK3MD_00),
1058 PINMUX_DATA(PWM1D_MARK, PK3MD_01),
1059 PINMUX_DATA(SD_CLK_MARK, PK3MD_10),
1060
1061 PINMUX_DATA(PK2_DATA, PK2MD_00),
1062 PINMUX_DATA(PWM1C_MARK, PK2MD_01),
1063 PINMUX_DATA(SD_CMD_MARK, PK2MD_10),
1064
1065 PINMUX_DATA(PK1_DATA, PK1MD_00),
1066 PINMUX_DATA(PWM1B_MARK, PK1MD_01),
1067 PINMUX_DATA(SD_D3_MARK, PK1MD_10),
1068
1069 PINMUX_DATA(PK0_DATA, PK0MD_00),
1070 PINMUX_DATA(PWM1A_MARK, PK0MD_01),
1071 PINMUX_DATA(SD_D2_MARK, PK0MD_10),
1072};
1073
1074static struct pinmux_gpio pinmux_gpios[] = {
1075
1076 /* Port A */
1077 PINMUX_GPIO(GPIO_PA3, PA3_DATA),
1078 PINMUX_GPIO(GPIO_PA2, PA2_DATA),
1079 PINMUX_GPIO(GPIO_PA1, PA1_DATA),
1080 PINMUX_GPIO(GPIO_PA0, PA0_DATA),
1081
1082 /* Port B */
1083 PINMUX_GPIO(GPIO_PB22, PB22_DATA),
1084 PINMUX_GPIO(GPIO_PB21, PB21_DATA),
1085 PINMUX_GPIO(GPIO_PB20, PB20_DATA),
1086 PINMUX_GPIO(GPIO_PB19, PB19_DATA),
1087 PINMUX_GPIO(GPIO_PB18, PB18_DATA),
1088 PINMUX_GPIO(GPIO_PB17, PB17_DATA),
1089 PINMUX_GPIO(GPIO_PB16, PB16_DATA),
1090 PINMUX_GPIO(GPIO_PB15, PB15_DATA),
1091 PINMUX_GPIO(GPIO_PB14, PB14_DATA),
1092 PINMUX_GPIO(GPIO_PB13, PB13_DATA),
1093 PINMUX_GPIO(GPIO_PB12, PB12_DATA),
1094 PINMUX_GPIO(GPIO_PB11, PB11_DATA),
1095 PINMUX_GPIO(GPIO_PB10, PB10_DATA),
1096 PINMUX_GPIO(GPIO_PB9, PB9_DATA),
1097 PINMUX_GPIO(GPIO_PB8, PB8_DATA),
1098 PINMUX_GPIO(GPIO_PB7, PB7_DATA),
1099 PINMUX_GPIO(GPIO_PB6, PB6_DATA),
1100 PINMUX_GPIO(GPIO_PB5, PB5_DATA),
1101 PINMUX_GPIO(GPIO_PB4, PB4_DATA),
1102 PINMUX_GPIO(GPIO_PB3, PB3_DATA),
1103 PINMUX_GPIO(GPIO_PB2, PB2_DATA),
1104 PINMUX_GPIO(GPIO_PB1, PB1_DATA),
1105
1106 /* Port C */
1107 PINMUX_GPIO(GPIO_PC10, PC10_DATA),
1108 PINMUX_GPIO(GPIO_PC9, PC9_DATA),
1109 PINMUX_GPIO(GPIO_PC8, PC8_DATA),
1110 PINMUX_GPIO(GPIO_PC7, PC7_DATA),
1111 PINMUX_GPIO(GPIO_PC6, PC6_DATA),
1112 PINMUX_GPIO(GPIO_PC5, PC5_DATA),
1113 PINMUX_GPIO(GPIO_PC4, PC4_DATA),
1114 PINMUX_GPIO(GPIO_PC3, PC3_DATA),
1115 PINMUX_GPIO(GPIO_PC2, PC2_DATA),
1116 PINMUX_GPIO(GPIO_PC1, PC1_DATA),
1117 PINMUX_GPIO(GPIO_PC0, PC0_DATA),
1118
1119 /* Port D */
1120 PINMUX_GPIO(GPIO_PD15, PD15_DATA),
1121 PINMUX_GPIO(GPIO_PD14, PD14_DATA),
1122 PINMUX_GPIO(GPIO_PD13, PD13_DATA),
1123 PINMUX_GPIO(GPIO_PD12, PD12_DATA),
1124 PINMUX_GPIO(GPIO_PD11, PD11_DATA),
1125 PINMUX_GPIO(GPIO_PD10, PD10_DATA),
1126 PINMUX_GPIO(GPIO_PD9, PD9_DATA),
1127 PINMUX_GPIO(GPIO_PD8, PD8_DATA),
1128 PINMUX_GPIO(GPIO_PD7, PD7_DATA),
1129 PINMUX_GPIO(GPIO_PD6, PD6_DATA),
1130 PINMUX_GPIO(GPIO_PD5, PD5_DATA),
1131 PINMUX_GPIO(GPIO_PD4, PD4_DATA),
1132 PINMUX_GPIO(GPIO_PD3, PD3_DATA),
1133 PINMUX_GPIO(GPIO_PD2, PD2_DATA),
1134 PINMUX_GPIO(GPIO_PD1, PD1_DATA),
1135 PINMUX_GPIO(GPIO_PD0, PD0_DATA),
1136
1137 /* Port E */
1138 PINMUX_GPIO(GPIO_PE5, PE5_DATA),
1139 PINMUX_GPIO(GPIO_PE4, PE4_DATA),
1140 PINMUX_GPIO(GPIO_PE3, PE3_DATA),
1141 PINMUX_GPIO(GPIO_PE2, PE2_DATA),
1142 PINMUX_GPIO(GPIO_PE1, PE1_DATA),
1143 PINMUX_GPIO(GPIO_PE0, PE0_DATA),
1144
1145 /* Port F */
1146 PINMUX_GPIO(GPIO_PF12, PF12_DATA),
1147 PINMUX_GPIO(GPIO_PF11, PF11_DATA),
1148 PINMUX_GPIO(GPIO_PF10, PF10_DATA),
1149 PINMUX_GPIO(GPIO_PF9, PF9_DATA),
1150 PINMUX_GPIO(GPIO_PF8, PF8_DATA),
1151 PINMUX_GPIO(GPIO_PF7, PF7_DATA),
1152 PINMUX_GPIO(GPIO_PF6, PF6_DATA),
1153 PINMUX_GPIO(GPIO_PF5, PF5_DATA),
1154 PINMUX_GPIO(GPIO_PF4, PF4_DATA),
1155 PINMUX_GPIO(GPIO_PF3, PF3_DATA),
1156 PINMUX_GPIO(GPIO_PF2, PF2_DATA),
1157 PINMUX_GPIO(GPIO_PF1, PF1_DATA),
1158 PINMUX_GPIO(GPIO_PF0, PF0_DATA),
1159
1160 /* Port G */
1161 PINMUX_GPIO(GPIO_PG24, PG24_DATA),
1162 PINMUX_GPIO(GPIO_PG23, PG23_DATA),
1163 PINMUX_GPIO(GPIO_PG22, PG22_DATA),
1164 PINMUX_GPIO(GPIO_PG21, PG21_DATA),
1165 PINMUX_GPIO(GPIO_PG20, PG20_DATA),
1166 PINMUX_GPIO(GPIO_PG19, PG19_DATA),
1167 PINMUX_GPIO(GPIO_PG18, PG18_DATA),
1168 PINMUX_GPIO(GPIO_PG17, PG17_DATA),
1169 PINMUX_GPIO(GPIO_PG16, PG16_DATA),
1170 PINMUX_GPIO(GPIO_PG15, PG15_DATA),
1171 PINMUX_GPIO(GPIO_PG14, PG14_DATA),
1172 PINMUX_GPIO(GPIO_PG13, PG13_DATA),
1173 PINMUX_GPIO(GPIO_PG12, PG12_DATA),
1174 PINMUX_GPIO(GPIO_PG11, PG11_DATA),
1175 PINMUX_GPIO(GPIO_PG10, PG10_DATA),
1176 PINMUX_GPIO(GPIO_PG9, PG9_DATA),
1177 PINMUX_GPIO(GPIO_PG8, PG8_DATA),
1178 PINMUX_GPIO(GPIO_PG7, PG7_DATA),
1179 PINMUX_GPIO(GPIO_PG6, PG6_DATA),
1180 PINMUX_GPIO(GPIO_PG5, PG5_DATA),
1181 PINMUX_GPIO(GPIO_PG4, PG4_DATA),
1182 PINMUX_GPIO(GPIO_PG3, PG3_DATA),
1183 PINMUX_GPIO(GPIO_PG2, PG2_DATA),
1184 PINMUX_GPIO(GPIO_PG1, PG1_DATA),
1185 PINMUX_GPIO(GPIO_PG0, PG0_DATA),
1186
1187 /* Port H - Port H does not have a Data Register */
1188
1189 /* Port I - not on device */
1190
1191 /* Port J */
1192 PINMUX_GPIO(GPIO_PJ11, PJ11_DATA),
1193 PINMUX_GPIO(GPIO_PJ10, PJ10_DATA),
1194 PINMUX_GPIO(GPIO_PJ9, PJ9_DATA),
1195 PINMUX_GPIO(GPIO_PJ8, PJ8_DATA),
1196 PINMUX_GPIO(GPIO_PJ7, PJ7_DATA),
1197 PINMUX_GPIO(GPIO_PJ6, PJ6_DATA),
1198 PINMUX_GPIO(GPIO_PJ5, PJ5_DATA),
1199 PINMUX_GPIO(GPIO_PJ4, PJ4_DATA),
1200 PINMUX_GPIO(GPIO_PJ3, PJ3_DATA),
1201 PINMUX_GPIO(GPIO_PJ2, PJ2_DATA),
1202 PINMUX_GPIO(GPIO_PJ1, PJ1_DATA),
1203 PINMUX_GPIO(GPIO_PJ0, PJ0_DATA),
1204
1205 /* Port K */
1206 PINMUX_GPIO(GPIO_PK11, PK11_DATA),
1207 PINMUX_GPIO(GPIO_PK10, PK10_DATA),
1208 PINMUX_GPIO(GPIO_PK9, PK9_DATA),
1209 PINMUX_GPIO(GPIO_PK8, PK8_DATA),
1210 PINMUX_GPIO(GPIO_PK7, PK7_DATA),
1211 PINMUX_GPIO(GPIO_PK6, PK6_DATA),
1212 PINMUX_GPIO(GPIO_PK5, PK5_DATA),
1213 PINMUX_GPIO(GPIO_PK4, PK4_DATA),
1214 PINMUX_GPIO(GPIO_PK3, PK3_DATA),
1215 PINMUX_GPIO(GPIO_PK2, PK2_DATA),
1216 PINMUX_GPIO(GPIO_PK1, PK1_DATA),
1217 PINMUX_GPIO(GPIO_PK0, PK0_DATA),
1218
1219 /* INTC */
1220 PINMUX_GPIO(GPIO_FN_PINT7_PG, PINT7_PG_MARK),
1221 PINMUX_GPIO(GPIO_FN_PINT6_PG, PINT6_PG_MARK),
1222 PINMUX_GPIO(GPIO_FN_PINT5_PG, PINT5_PG_MARK),
1223 PINMUX_GPIO(GPIO_FN_PINT4_PG, PINT4_PG_MARK),
1224 PINMUX_GPIO(GPIO_FN_PINT3_PG, PINT3_PG_MARK),
1225 PINMUX_GPIO(GPIO_FN_PINT2_PG, PINT2_PG_MARK),
1226 PINMUX_GPIO(GPIO_FN_PINT1_PG, PINT1_PG_MARK),
1227
1228 PINMUX_GPIO(GPIO_FN_IRQ7_PC, IRQ7_PC_MARK),
1229 PINMUX_GPIO(GPIO_FN_IRQ6_PC, IRQ6_PC_MARK),
1230 PINMUX_GPIO(GPIO_FN_IRQ5_PC, IRQ5_PC_MARK),
1231 PINMUX_GPIO(GPIO_FN_IRQ4_PC, IRQ4_PC_MARK),
1232 PINMUX_GPIO(GPIO_FN_IRQ3_PG, IRQ3_PG_MARK),
1233 PINMUX_GPIO(GPIO_FN_IRQ2_PG, IRQ2_PG_MARK),
1234 PINMUX_GPIO(GPIO_FN_IRQ1_PJ, IRQ1_PJ_MARK),
1235 PINMUX_GPIO(GPIO_FN_IRQ0_PJ, IRQ0_PJ_MARK),
1236 PINMUX_GPIO(GPIO_FN_IRQ3_PE, IRQ3_PE_MARK),
1237 PINMUX_GPIO(GPIO_FN_IRQ2_PE, IRQ2_PE_MARK),
1238 PINMUX_GPIO(GPIO_FN_IRQ1_PE, IRQ1_PE_MARK),
1239 PINMUX_GPIO(GPIO_FN_IRQ0_PE, IRQ0_PE_MARK),
1240
1241 /* WDT */
1242 PINMUX_GPIO(GPIO_FN_WDTOVF, WDTOVF_MARK),
1243
1244 /* CAN */
1245 PINMUX_GPIO(GPIO_FN_CTX1, CTX1_MARK),
1246 PINMUX_GPIO(GPIO_FN_CRX1, CRX1_MARK),
1247 PINMUX_GPIO(GPIO_FN_CTX0, CTX0_MARK),
1248 PINMUX_GPIO(GPIO_FN_CRX0, CRX0_MARK),
1249 PINMUX_GPIO(GPIO_FN_CRX0_CRX1, CRX0CRX1_MARK),
1250
1251 /* DMAC */
1252 PINMUX_GPIO(GPIO_FN_TEND0, TEND0_MARK),
1253 PINMUX_GPIO(GPIO_FN_DACK0, DACK0_MARK),
1254 PINMUX_GPIO(GPIO_FN_DREQ0, DREQ0_MARK),
1255 PINMUX_GPIO(GPIO_FN_TEND1, TEND1_MARK),
1256 PINMUX_GPIO(GPIO_FN_DACK1, DACK1_MARK),
1257 PINMUX_GPIO(GPIO_FN_DREQ1, DREQ1_MARK),
1258
1259 /* ADC */
1260 PINMUX_GPIO(GPIO_FN_ADTRG, ADTRG_MARK),
1261
1262 /* BSCh */
1263 PINMUX_GPIO(GPIO_FN_A25, A25_MARK),
1264 PINMUX_GPIO(GPIO_FN_A24, A24_MARK),
1265 PINMUX_GPIO(GPIO_FN_A23, A23_MARK),
1266 PINMUX_GPIO(GPIO_FN_A22, A22_MARK),
1267 PINMUX_GPIO(GPIO_FN_A21, A21_MARK),
1268 PINMUX_GPIO(GPIO_FN_A20, A20_MARK),
1269 PINMUX_GPIO(GPIO_FN_A19, A19_MARK),
1270 PINMUX_GPIO(GPIO_FN_A18, A18_MARK),
1271 PINMUX_GPIO(GPIO_FN_A17, A17_MARK),
1272 PINMUX_GPIO(GPIO_FN_A16, A16_MARK),
1273 PINMUX_GPIO(GPIO_FN_A15, A15_MARK),
1274 PINMUX_GPIO(GPIO_FN_A14, A14_MARK),
1275 PINMUX_GPIO(GPIO_FN_A13, A13_MARK),
1276 PINMUX_GPIO(GPIO_FN_A12, A12_MARK),
1277 PINMUX_GPIO(GPIO_FN_A11, A11_MARK),
1278 PINMUX_GPIO(GPIO_FN_A10, A10_MARK),
1279 PINMUX_GPIO(GPIO_FN_A9, A9_MARK),
1280 PINMUX_GPIO(GPIO_FN_A8, A8_MARK),
1281 PINMUX_GPIO(GPIO_FN_A7, A7_MARK),
1282 PINMUX_GPIO(GPIO_FN_A6, A6_MARK),
1283 PINMUX_GPIO(GPIO_FN_A5, A5_MARK),
1284 PINMUX_GPIO(GPIO_FN_A4, A4_MARK),
1285 PINMUX_GPIO(GPIO_FN_A3, A3_MARK),
1286 PINMUX_GPIO(GPIO_FN_A2, A2_MARK),
1287 PINMUX_GPIO(GPIO_FN_A1, A1_MARK),
1288 PINMUX_GPIO(GPIO_FN_A0, A0_MARK),
1289
1290 PINMUX_GPIO(GPIO_FN_D15, D15_MARK),
1291 PINMUX_GPIO(GPIO_FN_D14, D14_MARK),
1292 PINMUX_GPIO(GPIO_FN_D13, D13_MARK),
1293 PINMUX_GPIO(GPIO_FN_D12, D12_MARK),
1294 PINMUX_GPIO(GPIO_FN_D11, D11_MARK),
1295 PINMUX_GPIO(GPIO_FN_D10, D10_MARK),
1296 PINMUX_GPIO(GPIO_FN_D9, D9_MARK),
1297 PINMUX_GPIO(GPIO_FN_D8, D8_MARK),
1298 PINMUX_GPIO(GPIO_FN_D7, D7_MARK),
1299 PINMUX_GPIO(GPIO_FN_D6, D6_MARK),
1300 PINMUX_GPIO(GPIO_FN_D5, D5_MARK),
1301 PINMUX_GPIO(GPIO_FN_D4, D4_MARK),
1302 PINMUX_GPIO(GPIO_FN_D3, D3_MARK),
1303 PINMUX_GPIO(GPIO_FN_D2, D2_MARK),
1304 PINMUX_GPIO(GPIO_FN_D1, D1_MARK),
1305 PINMUX_GPIO(GPIO_FN_D0, D0_MARK),
1306
1307 PINMUX_GPIO(GPIO_FN_BS, BS_MARK),
1308 PINMUX_GPIO(GPIO_FN_CS4, CS4_MARK),
1309 PINMUX_GPIO(GPIO_FN_CS3, CS3_MARK),
1310 PINMUX_GPIO(GPIO_FN_CS2, CS2_MARK),
1311 PINMUX_GPIO(GPIO_FN_CS1, CS1_MARK),
1312 PINMUX_GPIO(GPIO_FN_CS0, CS0_MARK),
1313 PINMUX_GPIO(GPIO_FN_CS6CE1B, CS6CE1B_MARK),
1314 PINMUX_GPIO(GPIO_FN_CS5CE1A, CS5CE1A_MARK),
1315 PINMUX_GPIO(GPIO_FN_CE2A, CE2A_MARK),
1316 PINMUX_GPIO(GPIO_FN_CE2B, CE2B_MARK),
1317 PINMUX_GPIO(GPIO_FN_RD, RD_MARK),
1318 PINMUX_GPIO(GPIO_FN_RDWR, RDWR_MARK),
1319 PINMUX_GPIO(GPIO_FN_ICIOWRAH, ICIOWRAH_MARK),
1320 PINMUX_GPIO(GPIO_FN_ICIORD, ICIORD_MARK),
1321 PINMUX_GPIO(GPIO_FN_WE1DQMUWE, WE1DQMUWE_MARK),
1322 PINMUX_GPIO(GPIO_FN_WE0DQML, WE0DQML_MARK),
1323 PINMUX_GPIO(GPIO_FN_RAS, RAS_MARK),
1324 PINMUX_GPIO(GPIO_FN_CAS, CAS_MARK),
1325 PINMUX_GPIO(GPIO_FN_CKE, CKE_MARK),
1326 PINMUX_GPIO(GPIO_FN_WAIT, WAIT_MARK),
1327 PINMUX_GPIO(GPIO_FN_BREQ, BREQ_MARK),
1328 PINMUX_GPIO(GPIO_FN_BACK, BACK_MARK),
1329 PINMUX_GPIO(GPIO_FN_IOIS16, IOIS16_MARK),
1330
1331 /* TMU */
1332 PINMUX_GPIO(GPIO_FN_TIOC4D, TIOC4D_MARK),
1333 PINMUX_GPIO(GPIO_FN_TIOC4C, TIOC4C_MARK),
1334 PINMUX_GPIO(GPIO_FN_TIOC4B, TIOC4B_MARK),
1335 PINMUX_GPIO(GPIO_FN_TIOC4A, TIOC4A_MARK),
1336 PINMUX_GPIO(GPIO_FN_TIOC3D, TIOC3D_MARK),
1337 PINMUX_GPIO(GPIO_FN_TIOC3C, TIOC3C_MARK),
1338 PINMUX_GPIO(GPIO_FN_TIOC3B, TIOC3B_MARK),
1339 PINMUX_GPIO(GPIO_FN_TIOC3A, TIOC3A_MARK),
1340 PINMUX_GPIO(GPIO_FN_TIOC2B, TIOC2B_MARK),
1341 PINMUX_GPIO(GPIO_FN_TIOC1B, TIOC1B_MARK),
1342 PINMUX_GPIO(GPIO_FN_TIOC2A, TIOC2A_MARK),
1343 PINMUX_GPIO(GPIO_FN_TIOC1A, TIOC1A_MARK),
1344 PINMUX_GPIO(GPIO_FN_TIOC0D, TIOC0D_MARK),
1345 PINMUX_GPIO(GPIO_FN_TIOC0C, TIOC0C_MARK),
1346 PINMUX_GPIO(GPIO_FN_TIOC0B, TIOC0B_MARK),
1347 PINMUX_GPIO(GPIO_FN_TIOC0A, TIOC0A_MARK),
1348 PINMUX_GPIO(GPIO_FN_TCLKD, TCLKD_MARK),
1349 PINMUX_GPIO(GPIO_FN_TCLKC, TCLKC_MARK),
1350 PINMUX_GPIO(GPIO_FN_TCLKB, TCLKB_MARK),
1351 PINMUX_GPIO(GPIO_FN_TCLKA, TCLKA_MARK),
1352
1353 /* SCIF */
1354 PINMUX_GPIO(GPIO_FN_TXD0, TXD0_MARK),
1355 PINMUX_GPIO(GPIO_FN_RXD0, RXD0_MARK),
1356 PINMUX_GPIO(GPIO_FN_SCK0, SCK0_MARK),
1357 PINMUX_GPIO(GPIO_FN_TXD1, TXD1_MARK),
1358 PINMUX_GPIO(GPIO_FN_RXD1, RXD1_MARK),
1359 PINMUX_GPIO(GPIO_FN_SCK1, SCK1_MARK),
1360 PINMUX_GPIO(GPIO_FN_TXD2, TXD2_MARK),
1361 PINMUX_GPIO(GPIO_FN_RXD2, RXD2_MARK),
1362 PINMUX_GPIO(GPIO_FN_SCK2, SCK2_MARK),
1363 PINMUX_GPIO(GPIO_FN_RTS3, RTS3_MARK),
1364 PINMUX_GPIO(GPIO_FN_CTS3, CTS3_MARK),
1365 PINMUX_GPIO(GPIO_FN_TXD3, TXD3_MARK),
1366 PINMUX_GPIO(GPIO_FN_RXD3, RXD3_MARK),
1367 PINMUX_GPIO(GPIO_FN_SCK3, SCK3_MARK),
1368 PINMUX_GPIO(GPIO_FN_TXD4, TXD4_MARK),
1369 PINMUX_GPIO(GPIO_FN_RXD4, RXD4_MARK),
1370 PINMUX_GPIO(GPIO_FN_TXD5, TXD5_MARK),
1371 PINMUX_GPIO(GPIO_FN_RXD5, RXD5_MARK),
1372 PINMUX_GPIO(GPIO_FN_TXD6, TXD6_MARK),
1373 PINMUX_GPIO(GPIO_FN_RXD6, RXD6_MARK),
1374 PINMUX_GPIO(GPIO_FN_TXD7, TXD7_MARK),
1375 PINMUX_GPIO(GPIO_FN_RXD7, RXD7_MARK),
1376 PINMUX_GPIO(GPIO_FN_RTS1, RTS1_MARK),
1377 PINMUX_GPIO(GPIO_FN_CTS1, CTS1_MARK),
1378
1379 /* RSPI */
1380 PINMUX_GPIO(GPIO_FN_RSPCK0, RSPCK0_MARK),
1381 PINMUX_GPIO(GPIO_FN_MOSI0, MOSI0_MARK),
1382 PINMUX_GPIO(GPIO_FN_MISO0_PF12, MISO0_PF12_MARK),
1383 PINMUX_GPIO(GPIO_FN_MISO1, MISO1_MARK),
1384 PINMUX_GPIO(GPIO_FN_SSL00, SSL00_MARK),
1385 PINMUX_GPIO(GPIO_FN_RSPCK1, RSPCK1_MARK),
1386 PINMUX_GPIO(GPIO_FN_MOSI1, MOSI1_MARK),
1387 PINMUX_GPIO(GPIO_FN_MISO1_PG19, MISO1_PG19_MARK),
1388 PINMUX_GPIO(GPIO_FN_SSL10, SSL10_MARK),
1389
1390 /* IIC3 */
1391 PINMUX_GPIO(GPIO_FN_SCL0, SCL0_MARK),
1392 PINMUX_GPIO(GPIO_FN_SCL1, SCL1_MARK),
1393 PINMUX_GPIO(GPIO_FN_SCL2, SCL2_MARK),
1394 PINMUX_GPIO(GPIO_FN_SDA0, SDA0_MARK),
1395 PINMUX_GPIO(GPIO_FN_SDA1, SDA1_MARK),
1396 PINMUX_GPIO(GPIO_FN_SDA2, SDA2_MARK),
1397
1398 /* SSI */
1399 PINMUX_GPIO(GPIO_FN_SSISCK0, SSISCK0_MARK),
1400 PINMUX_GPIO(GPIO_FN_SSIWS0, SSIWS0_MARK),
1401 PINMUX_GPIO(GPIO_FN_SSITXD0, SSITXD0_MARK),
1402 PINMUX_GPIO(GPIO_FN_SSIRXD0, SSIRXD0_MARK),
1403 PINMUX_GPIO(GPIO_FN_SSIWS1, SSIWS1_MARK),
1404 PINMUX_GPIO(GPIO_FN_SSIWS2, SSIWS2_MARK),
1405 PINMUX_GPIO(GPIO_FN_SSIWS3, SSIWS3_MARK),
1406 PINMUX_GPIO(GPIO_FN_SSISCK1, SSISCK1_MARK),
1407 PINMUX_GPIO(GPIO_FN_SSISCK2, SSISCK2_MARK),
1408 PINMUX_GPIO(GPIO_FN_SSISCK3, SSISCK3_MARK),
1409 PINMUX_GPIO(GPIO_FN_SSIDATA1, SSIDATA1_MARK),
1410 PINMUX_GPIO(GPIO_FN_SSIDATA2, SSIDATA2_MARK),
1411 PINMUX_GPIO(GPIO_FN_SSIDATA3, SSIDATA3_MARK),
1412 PINMUX_GPIO(GPIO_FN_AUDIO_CLK, AUDIO_CLK_MARK),
1413
1414 /* SIOF */ /* NOTE Shares AUDIO_CLK with SSI */
1415 PINMUX_GPIO(GPIO_FN_SIOFTXD, SIOFTXD_MARK),
1416 PINMUX_GPIO(GPIO_FN_SIOFRXD, SIOFRXD_MARK),
1417 PINMUX_GPIO(GPIO_FN_SIOFSYNC, SIOFSYNC_MARK),
1418 PINMUX_GPIO(GPIO_FN_SIOFSCK, SIOFSCK_MARK),
1419
1420 /* SPDIF */ /* NOTE Shares AUDIO_CLK with SSI */
1421 PINMUX_GPIO(GPIO_FN_SPDIF_IN, SPDIF_IN_MARK),
1422 PINMUX_GPIO(GPIO_FN_SPDIF_OUT, SPDIF_OUT_MARK),
1423
1424 /* NANDFMC */ /* NOTE Controller is not available in boot mode 0 */
1425 PINMUX_GPIO(GPIO_FN_FCE, FCE_MARK),
1426 PINMUX_GPIO(GPIO_FN_FRB, FRB_MARK),
1427
1428 /* VDC3 */
1429 PINMUX_GPIO(GPIO_FN_DV_CLK, DV_CLK_MARK),
1430 PINMUX_GPIO(GPIO_FN_DV_VSYNC, DV_VSYNC_MARK),
1431 PINMUX_GPIO(GPIO_FN_DV_HSYNC, DV_HSYNC_MARK),
1432
1433 PINMUX_GPIO(GPIO_FN_DV_DATA7, DV_DATA7_MARK),
1434 PINMUX_GPIO(GPIO_FN_DV_DATA6, DV_DATA6_MARK),
1435 PINMUX_GPIO(GPIO_FN_DV_DATA5, DV_DATA5_MARK),
1436 PINMUX_GPIO(GPIO_FN_DV_DATA4, DV_DATA4_MARK),
1437 PINMUX_GPIO(GPIO_FN_DV_DATA3, DV_DATA3_MARK),
1438 PINMUX_GPIO(GPIO_FN_DV_DATA2, DV_DATA2_MARK),
1439 PINMUX_GPIO(GPIO_FN_DV_DATA1, DV_DATA1_MARK),
1440 PINMUX_GPIO(GPIO_FN_DV_DATA0, DV_DATA0_MARK),
1441
1442 PINMUX_GPIO(GPIO_FN_LCD_CLK, LCD_CLK_MARK),
1443 PINMUX_GPIO(GPIO_FN_LCD_EXTCLK, LCD_EXTCLK_MARK),
1444 PINMUX_GPIO(GPIO_FN_LCD_VSYNC, LCD_VSYNC_MARK),
1445 PINMUX_GPIO(GPIO_FN_LCD_HSYNC, LCD_HSYNC_MARK),
1446 PINMUX_GPIO(GPIO_FN_LCD_DE, LCD_DE_MARK),
1447
1448 PINMUX_GPIO(GPIO_FN_LCD_DATA15, LCD_DATA15_MARK),
1449 PINMUX_GPIO(GPIO_FN_LCD_DATA14, LCD_DATA14_MARK),
1450 PINMUX_GPIO(GPIO_FN_LCD_DATA13, LCD_DATA13_MARK),
1451 PINMUX_GPIO(GPIO_FN_LCD_DATA12, LCD_DATA12_MARK),
1452 PINMUX_GPIO(GPIO_FN_LCD_DATA11, LCD_DATA11_MARK),
1453 PINMUX_GPIO(GPIO_FN_LCD_DATA10, LCD_DATA10_MARK),
1454 PINMUX_GPIO(GPIO_FN_LCD_DATA9, LCD_DATA9_MARK),
1455 PINMUX_GPIO(GPIO_FN_LCD_DATA8, LCD_DATA8_MARK),
1456 PINMUX_GPIO(GPIO_FN_LCD_DATA7, LCD_DATA7_MARK),
1457 PINMUX_GPIO(GPIO_FN_LCD_DATA6, LCD_DATA6_MARK),
1458 PINMUX_GPIO(GPIO_FN_LCD_DATA5, LCD_DATA5_MARK),
1459 PINMUX_GPIO(GPIO_FN_LCD_DATA4, LCD_DATA4_MARK),
1460 PINMUX_GPIO(GPIO_FN_LCD_DATA3, LCD_DATA3_MARK),
1461 PINMUX_GPIO(GPIO_FN_LCD_DATA2, LCD_DATA2_MARK),
1462 PINMUX_GPIO(GPIO_FN_LCD_DATA1, LCD_DATA1_MARK),
1463 PINMUX_GPIO(GPIO_FN_LCD_DATA0, LCD_DATA0_MARK),
1464
1465 PINMUX_GPIO(GPIO_FN_LCD_M_DISP, LCD_M_DISP_MARK),
1466};
1467
1468static struct pinmux_cfg_reg pinmux_config_regs[] = {
1469 { PINMUX_CFG_REG("PAIOR0", 0xfffe3812, 16, 1) {
1470 0, 0, 0, 0, 0, 0, 0, 0,
1471 0, 0, 0, 0, 0, 0, 0, 0,
1472 0, 0, 0, 0, 0, 0, 0, 0,
1473 PA3_IN, PA3_OUT,
1474 PA2_IN, PA2_OUT,
1475 PA1_IN, PA1_OUT,
1476 PA0_IN, PA0_OUT }
1477 },
1478
1479 { PINMUX_CFG_REG("PBCR5", 0xfffe3824, 16, 4) {
1480 0, 0, 0, 0, 0, 0, 0, 0,
1481 0, 0, 0, 0, 0, 0, 0, 0,
1482 PB22MD_00, PB22MD_01, PB22MD_10, 0, 0, 0, 0, 0,
1483 0, 0, 0, 0, 0, 0, 0, 0,
1484 PB21MD_0, PB21MD_1, 0, 0, 0, 0, 0, 0,
1485 0, 0, 0, 0, 0, 0, 0, 0,
1486 0, PB20MD_1, 0, 0, 0, 0, 0, 0,
1487 0, 0, 0, 0, 0, 0, 0, 0 }
1488
1489 },
1490 { PINMUX_CFG_REG("PBCR4", 0xfffe3826, 16, 4) {
1491 0, PB19MD_01, 0, 0, 0, 0, 0, 0,
1492 0, 0, 0, 0, 0, 0, 0, 0,
1493 0, PB18MD_01, 0, 0, 0, 0, 0, 0,
1494 0, 0, 0, 0, 0, 0, 0, 0,
1495 0, PB17MD_01, 0, 0, 0, 0, 0, 0,
1496 0, 0, 0, 0, 0, 0, 0, 0,
1497 0, PB16MD_01, 0, 0, 0, 0, 0, 0,
1498 0, 0, 0, 0, 0, 0, 0, 0 }
1499 },
1500 { PINMUX_CFG_REG("PBCR3", 0xfffe3828, 16, 4) {
1501 0, PB15MD_01, 0, 0, 0, 0, 0, 0,
1502 0, 0, 0, 0, 0, 0, 0, 0,
1503 0, PB14MD_01, 0, 0, 0, 0, 0, 0,
1504 0, 0, 0, 0, 0, 0, 0, 0,
1505 0, PB13MD_01, 0, 0, 0, 0, 0, 0,
1506 0, 0, 0, 0, 0, 0, 0, 0,
1507 0, PB12MD_01, 0, 0, 0, 0, 0, 0,
1508 0, 0, 0, 0, 0, 0, 0, 0 }
1509 },
1510 { PINMUX_CFG_REG("PBCR2", 0xfffe382a, 16, 4) {
1511 0, PB11MD_01, 0, 0, 0, 0, 0, 0,
1512 0, 0, 0, 0, 0, 0, 0, 0,
1513 0, PB10MD_01, 0, 0, 0, 0, 0, 0,
1514 0, 0, 0, 0, 0, 0, 0, 0,
1515 0, PB9MD_01, 0, 0, 0, 0, 0, 0,
1516 0, 0, 0, 0, 0, 0, 0, 0,
1517 0, PB8MD_01, 0, 0, 0, 0, 0, 0,
1518 0, 0, 0, 0, 0, 0, 0, 0 }
1519 },
1520 { PINMUX_CFG_REG("PBCR1", 0xfffe382c, 16, 4) {
1521 0, PB7MD_01, 0, 0, 0, 0, 0, 0,
1522 0, 0, 0, 0, 0, 0, 0, 0,
1523 0, PB6MD_01, 0, 0, 0, 0, 0, 0,
1524 0, 0, 0, 0, 0, 0, 0, 0,
1525 0, PB5MD_01, 0, 0, 0, 0, 0, 0,
1526 0, 0, 0, 0, 0, 0, 0, 0,
1527 0, PB4MD_01, 0, 0, 0, 0, 0, 0,
1528 0, 0, 0, 0, 0, 0, 0, 0 }
1529 },
1530 { PINMUX_CFG_REG("PBCR0", 0xfffe382e, 16, 4) {
1531 0, PB3MD_1, 0, 0, 0, 0, 0, 0,
1532 0, 0, 0, 0, 0, 0, 0, 0,
1533 0, PB2MD_1, 0, 0, 0, 0, 0, 0,
1534 0, 0, 0, 0, 0, 0, 0, 0,
1535 0, PB1MD_1, 0, 0, 0, 0, 0, 0,
1536 0, 0, 0, 0, 0, 0, 0, 0,
1537 0, 0, 0, 0, 0, 0, 0, 0,
1538 0, 0, 0, 0, 0, 0, 0, 0 }
1539 },
1540
1541 { PINMUX_CFG_REG("PBIOR1", 0xfffe3830, 16, 1) {
1542 0, 0, 0, 0, 0, 0, 0, 0,
1543 0, 0, 0, 0, 0, 0, 0, 0,
1544 0, 0,
1545 PB22_IN, PB22_OUT,
1546 PB21_IN, PB21_OUT,
1547 PB20_IN, PB20_OUT,
1548 PB19_IN, PB19_OUT,
1549 PB18_IN, PB18_OUT,
1550 PB17_IN, PB17_OUT,
1551 PB16_IN, PB16_OUT }
1552 },
1553
1554 { PINMUX_CFG_REG("PBIOR0", 0xfffe3832, 16, 1) {
1555 PB15_IN, PB15_OUT,
1556 PB14_IN, PB14_OUT,
1557 PB13_IN, PB13_OUT,
1558 PB12_IN, PB12_OUT,
1559 PB11_IN, PB11_OUT,
1560 PB10_IN, PB10_OUT,
1561 PB9_IN, PB9_OUT,
1562 PB8_IN, PB8_OUT,
1563 PB7_IN, PB7_OUT,
1564 PB6_IN, PB6_OUT,
1565 PB5_IN, PB5_OUT,
1566 PB4_IN, PB4_OUT,
1567 PB3_IN, PB3_OUT,
1568 PB2_IN, PB2_OUT,
1569 PB1_IN, PB1_OUT,
1570 0, 0 }
1571 },
1572
1573 { PINMUX_CFG_REG("PCCR2", 0xfffe384a, 16, 4) {
1574 0, 0, 0, 0, 0, 0, 0, 0,
1575 0, 0, 0, 0, 0, 0, 0, 0,
1576 PC10MD_0, PC10MD_1, 0, 0, 0, 0, 0, 0,
1577 0, 0, 0, 0, 0, 0, 0, 0,
1578 PC9MD_0, PC9MD_1, 0, 0, 0, 0, 0, 0,
1579 0, 0, 0, 0, 0, 0, 0, 0,
1580 PC8MD_00, PC8MD_01, PC8MD_10, PC8MD_11, 0, 0, 0, 0,
1581 0, 0, 0, 0, 0, 0, 0, 0 }
1582 },
1583 { PINMUX_CFG_REG("PCCR1", 0xfffe384c, 16, 4) {
1584 PC7MD_00, PC7MD_01, PC7MD_10, PC7MD_11, 0, 0, 0, 0,
1585 0, 0, 0, 0, 0, 0, 0, 0,
1586 PC6MD_00, PC6MD_01, PC6MD_10, PC6MD_11, 0, 0, 0, 0,
1587 0, 0, 0, 0, 0, 0, 0, 0,
1588 PC5MD_00, PC5MD_01, PC5MD_10, PC5MD_11, 0, 0, 0, 0,
1589 0, 0, 0, 0, 0, 0, 0, 0,
1590 PC4MD_0, PC4MD_1, 0, 0, 0, 0, 0, 0,
1591 0, 0, 0, 0, 0, 0, 0, 0 }
1592 },
1593 { PINMUX_CFG_REG("PCCR0", 0xfffe384e, 16, 4) {
1594 PC3MD_0, PC3MD_1, 0, 0, 0, 0, 0, 0,
1595 0, 0, 0, 0, 0, 0, 0, 0,
1596 PC2MD_0, PC2MD_1, 0, 0, 0, 0, 0, 0,
1597 0, 0, 0, 0, 0, 0, 0, 0,
1598 PC1MD_0, PC1MD_1, 0, 0, 0, 0, 0, 0,
1599 0, 0, 0, 0, 0, 0, 0, 0,
1600 PC0MD_0, PC0MD_1, 0, 0, 0, 0, 0, 0,
1601 0, 0, 0, 0, 0, 0, 0, 0 }
1602 },
1603
1604 { PINMUX_CFG_REG("PCIOR0", 0xfffe3852, 16, 1) {
1605 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1606 PC10_IN, PC10_OUT,
1607 PC9_IN, PC9_OUT,
1608 PC8_IN, PC8_OUT,
1609 PC7_IN, PC7_OUT,
1610 PC6_IN, PC6_OUT,
1611 PC5_IN, PC5_OUT,
1612 PC4_IN, PC4_OUT,
1613 PC3_IN, PC3_OUT,
1614 PC2_IN, PC2_OUT,
1615 PC1_IN, PC1_OUT,
1616 PC0_IN, PC0_OUT
1617 }
1618 },
1619
1620 { PINMUX_CFG_REG("PDCR3", 0xfffe3868, 16, 4) {
1621 0, PD15MD_01, 0, 0, 0, 0, 0, 0,
1622 0, 0, 0, 0, 0, 0, 0, 0,
1623 0, PD14MD_01, 0, 0, 0, 0, 0, 0,
1624 0, 0, 0, 0, 0, 0, 0, 0,
1625 0, PD13MD_01, 0, 0, 0, 0, 0, 0,
1626 0, 0, 0, 0, 0, 0, 0, 0,
1627 0, PD12MD_01, 0, 0, 0, 0, 0, 0,
1628 0, 0, 0, 0, 0, 0, 0, 0 }
1629 },
1630 { PINMUX_CFG_REG("PDCR2", 0xfffe386a, 16, 4) {
1631 0, PD11MD_01, 0, 0, 0, 0, 0, 0,
1632 0, 0, 0, 0, 0, 0, 0, 0,
1633 0, PD10MD_01, 0, 0, 0, 0, 0, 0,
1634 0, 0, 0, 0, 0, 0, 0, 0,
1635 0, PD9MD_01, 0, 0, 0, 0, 0, 0,
1636 0, 0, 0, 0, 0, 0, 0, 0,
1637 0, PD8MD_01, 0, 0, 0, 0, 0, 0,
1638 0, 0, 0, 0, 0, 0, 0, 0 }
1639 },
1640 { PINMUX_CFG_REG("PDCR1", 0xfffe386c, 16, 4) {
1641 0, PD7MD_01, 0, 0, 0, 0, 0, 0,
1642 0, 0, 0, 0, 0, 0, 0, 0,
1643 0, PD6MD_01, 0, 0, 0, 0, 0, 0,
1644 0, 0, 0, 0, 0, 0, 0, 0,
1645 0, PD5MD_01, 0, 0, 0, 0, 0, 0,
1646 0, 0, 0, 0, 0, 0, 0, 0,
1647 0, PD4MD_01, 0, 0, 0, 0, 0, 0,
1648 0, 0, 0, 0, 0, 0, 0, 0 }
1649 },
1650 { PINMUX_CFG_REG("PDCR0", 0xfffe386e, 16, 4) {
1651 0, PD3MD_01, 0, 0, 0, 0, 0, 0,
1652 0, 0, 0, 0, 0, 0, 0, 0,
1653 0, PD2MD_01, 0, 0, 0, 0, 0, 0,
1654 0, 0, 0, 0, 0, 0, 0, 0,
1655 0, PD1MD_01, 0, 0, 0, 0, 0, 0,
1656 0, 0, 0, 0, 0, 0, 0, 0,
1657 0, PD0MD_01, 0, 0, 0, 0, 0, 0,
1658 0, 0, 0, 0, 0, 0, 0, 0 }
1659 },
1660
1661 { PINMUX_CFG_REG("PDIOR0", 0xfffe3872, 16, 1) {
1662 PD15_IN, PD15_OUT,
1663 PD14_IN, PD14_OUT,
1664 PD13_IN, PD13_OUT,
1665 PD12_IN, PD12_OUT,
1666 PD11_IN, PD11_OUT,
1667 PD10_IN, PD10_OUT,
1668 PD9_IN, PD9_OUT,
1669 PD8_IN, PD8_OUT,
1670 PD7_IN, PD7_OUT,
1671 PD6_IN, PD6_OUT,
1672 PD5_IN, PD5_OUT,
1673 PD4_IN, PD4_OUT,
1674 PD3_IN, PD3_OUT,
1675 PD2_IN, PD2_OUT,
1676 PD1_IN, PD1_OUT,
1677 PD0_IN, PD0_OUT }
1678 },
1679
1680 { PINMUX_CFG_REG("PECR1", 0xfffe388c, 16, 4) {
1681 0, 0, 0, 0, 0, 0, 0, 0,
1682 0, 0, 0, 0, 0, 0, 0, 0,
1683 0, 0, 0, 0, 0, 0, 0, 0,
1684 0, 0, 0, 0, 0, 0, 0, 0,
1685 PE5MD_00, PE5MD_01, 0, PE5MD_11, 0, 0, 0, 0,
1686 0, 0, 0, 0, 0, 0, 0, 0,
1687 PE4MD_00, PE4MD_01, 0, PE4MD_11, 0, 0, 0, 0,
1688 0, 0, 0, 0, 0, 0, 0, 0 }
1689 },
1690
1691 { PINMUX_CFG_REG("PECR0", 0xfffe388e, 16, 4) {
1692 PE3MD_00, PE3MD_01, 0, PE3MD_11, 0, 0, 0, 0,
1693 0, 0, 0, 0, 0, 0, 0, 0,
1694 PE2MD_00, PE2MD_01, 0, PE2MD_11, 0, 0, 0, 0,
1695 0, 0, 0, 0, 0, 0, 0, 0,
1696 PE1MD_000, PE1MD_001, PE1MD_010, PE1MD_011,
1697 PE1MD_100, PE1MD_101, 0, 0,
1698 0, 0, 0, 0, 0, 0, 0, 0,
1699 PE0MD_00, PE0MD_01, PE0MD_10, PE0MD_11, 0, 0, 0, 0,
1700 0, 0, 0, 0, 0, 0, 0, 0 }
1701 },
1702
1703 { PINMUX_CFG_REG("PEIOR0", 0xfffe3892, 16, 1) {
1704 0, 0, 0, 0, 0, 0, 0, 0,
1705 0, 0, 0, 0, 0, 0, 0, 0,
1706 0, 0, 0, 0,
1707 PE5_IN, PE5_OUT,
1708 PE4_IN, PE4_OUT,
1709 PE3_IN, PE3_OUT,
1710 PE2_IN, PE2_OUT,
1711 PE1_IN, PE1_OUT,
1712 PE0_IN, PE0_OUT }
1713 },
1714
1715 { PINMUX_CFG_REG("PFCR3", 0xfffe38a8, 16, 4) {
1716 PF12MD_000, PF12MD_001, 0, PF12MD_011,
1717 PF12MD_100, PF12MD_101, 0, 0,
1718 0, 0, 0, 0, 0, 0, 0, 0 }
1719 },
1720
1721 { PINMUX_CFG_REG("PFCR2", 0xfffe38aa, 16, 4) {
1722 PF11MD_000, PF11MD_001, PF11MD_010, PF11MD_011,
1723 PF11MD_100, PF11MD_101, 0, 0,
1724 0, 0, 0, 0, 0, 0, 0, 0,
1725 PF10MD_000, PF10MD_001, PF10MD_010, PF10MD_011,
1726 PF10MD_100, PF10MD_101, 0, 0,
1727 0, 0, 0, 0, 0, 0, 0, 0,
1728 PF9MD_000, PF9MD_001, PF9MD_010, PF9MD_011,
1729 PF9MD_100, PF9MD_101, 0, 0,
1730 0, 0, 0, 0, 0, 0, 0, 0,
1731 PF8MD_00, PF8MD_01, PF8MD_10, PF8MD_11, 0, 0, 0, 0,
1732 0, 0, 0, 0, 0, 0, 0, 0 }
1733 },
1734
1735 { PINMUX_CFG_REG("PFCR1", 0xfffe38ac, 16, 4) {
1736 PF7MD_000, PF7MD_001, PF7MD_010, PF7MD_011,
1737 PF7MD_100, 0, 0, 0,
1738 0, 0, 0, 0, 0, 0, 0, 0,
1739 PF6MD_000, PF6MD_001, PF6MD_010, PF6MD_011,
1740 PF6MD_100, 0, 0, 0,
1741 0, 0, 0, 0, 0, 0, 0, 0,
1742 PF5MD_000, PF5MD_001, PF5MD_010, PF5MD_011,
1743 PF5MD_100, 0, 0, 0,
1744 0, 0, 0, 0, 0, 0, 0, 0,
1745 PF4MD_000, PF4MD_001, PF4MD_010, PF4MD_011,
1746 PF4MD_100, 0, 0, 0,
1747 0, 0, 0, 0, 0, 0, 0, 0 }
1748 },
1749
1750 { PINMUX_CFG_REG("PFCR0", 0xfffe38ae, 16, 4) {
1751 PF3MD_000, PF3MD_001, PF3MD_010, PF3MD_011,
1752 PF3MD_100, 0, 0, 0,
1753 0, 0, 0, 0, 0, 0, 0, 0,
1754 PF2MD_000, PF2MD_001, PF2MD_010, PF2MD_011,
1755 PF2MD_100, PF2MD_101, 0, 0,
1756 0, 0, 0, 0, 0, 0, 0, 0,
1757 PF1MD_000, PF1MD_001, PF1MD_010, PF1MD_011,
1758 PF1MD_100, PF1MD_101, 0, 0,
1759 0, 0, 0, 0, 0, 0, 0, 0
1760 }
1761 },
1762
1763 { PINMUX_CFG_REG("PFIOR0", 0xfffe38b2, 16, 1) {
1764 0, 0, 0, 0, 0, 0,
1765 PF12_IN, PF12_OUT,
1766 PF11_IN, PF11_OUT,
1767 PF10_IN, PF10_OUT,
1768 PF9_IN, PF9_OUT,
1769 PF8_IN, PF8_OUT,
1770 PF7_IN, PF7_OUT,
1771 PF6_IN, PF6_OUT,
1772 PF5_IN, PF5_OUT,
1773 PF4_IN, PF4_OUT,
1774 PF3_IN, PF3_OUT,
1775 PF2_IN, PF2_OUT,
1776 PF1_IN, PF1_OUT,
1777 PF0_IN, PF0_OUT }
1778 },
1779
1780 { PINMUX_CFG_REG("PGCR7", 0xfffe38c0, 16, 4) {
1781 0, 0, 0, 0, 0, 0, 0, 0,
1782 0, 0, 0, 0, 0, 0, 0, 0,
1783 0, 0, 0, 0, 0, 0, 0, 0,
1784 0, 0, 0, 0, 0, 0, 0, 0,
1785 0, 0, 0, 0, 0, 0, 0, 0,
1786 0, 0, 0, 0, 0, 0, 0, 0,
1787 PG0MD_000, PG0MD_001, PG0MD_010, PG0MD_011,
1788 PG0MD_100, 0, 0, 0,
1789 0, 0, 0, 0, 0, 0, 0, 0 }
1790 },
1791
1792 { PINMUX_CFG_REG("PGCR6", 0xfffe38c2, 16, 4) {
1793 0, 0, 0, 0, 0, 0, 0, 0,
1794 0, 0, 0, 0, 0, 0, 0, 0,
1795 0, 0, 0, 0, 0, 0, 0, 0,
1796 0, 0, 0, 0, 0, 0, 0, 0,
1797 0, 0, 0, 0, 0, 0, 0, 0,
1798 0, 0, 0, 0, 0, 0, 0, 0,
1799 PG24MD_00, PG24MD_01, PG24MD_10, PG24MD_11, 0, 0, 0, 0,
1800 0, 0, 0, 0, 0, 0, 0, 0 }
1801 },
1802
1803 { PINMUX_CFG_REG("PGCR5", 0xfffe38c4, 16, 4) {
1804 PG23MD_00, PG23MD_01, PG23MD_10, PG23MD_11, 0, 0, 0, 0,
1805 0, 0, 0, 0, 0, 0, 0, 0,
1806 PG22MD_00, PG22MD_01, PG22MD_10, PG22MD_11, 0, 0, 0, 0,
1807 0, 0, 0, 0, 0, 0, 0, 0,
1808 PG21MD_00, PG21MD_01, PG21MD_10, PG21MD_11, 0, 0, 0, 0,
1809 0, 0, 0, 0, 0, 0, 0, 0,
1810 PG20MD_000, PG20MD_001, PG20MD_010, PG20MD_011,
1811 PG20MD_100, 0, 0, 0,
1812 0, 0, 0, 0, 0, 0, 0, 0 }
1813 },
1814
1815 { PINMUX_CFG_REG("PGCR4", 0xfffe38c6, 16, 4) {
1816 PG19MD_000, PG19MD_001, PG19MD_010, PG19MD_011,
1817 PG19MD_100, 0, 0, 0,
1818 0, 0, 0, 0, 0, 0, 0, 0,
1819 PG18MD_000, PG18MD_001, PG18MD_010, PG18MD_011,
1820 PG18MD_100, 0, 0, 0,
1821 0, 0, 0, 0, 0, 0, 0, 0,
1822 PG17MD_000, PG17MD_001, PG17MD_010, PG17MD_011,
1823 PG17MD_100, 0, 0, 0,
1824 0, 0, 0, 0, 0, 0, 0, 0,
1825 PG16MD_000, PG16MD_001, PG16MD_010, PG16MD_011,
1826 PG16MD_100, 0, 0, 0,
1827 0, 0, 0, 0, 0, 0, 0, 0 }
1828 },
1829
1830 { PINMUX_CFG_REG("PGCR3", 0xfffe38c8, 16, 4) {
1831 PG15MD_000, PG15MD_001, PG15MD_010, PG15MD_011,
1832 PG15MD_100, 0, 0, 0,
1833 0, 0, 0, 0, 0, 0, 0, 0,
1834 PG14MD_000, PG14MD_001, PG14MD_010, 0,
1835 PG14MD_100, 0, 0, 0,
1836 0, 0, 0, 0, 0, 0, 0, 0,
1837 PG13MD_000, PG13MD_001, PG13MD_010, 0,
1838 PG13MD_100, 0, 0, 0,
1839 0, 0, 0, 0, 0, 0, 0, 0,
1840 PG12MD_000, PG12MD_001, PG12MD_010, 0,
1841 PG12MD_100, 0, 0, 0,
1842 0, 0, 0, 0, 0, 0, 0, 0 }
1843 },
1844 { PINMUX_CFG_REG("PGCR2", 0xfffe38ca, 16, 4) {
1845 PG11MD_000, PG11MD_001, PG11MD_010, PG11MD_011,
1846 PG11MD_100, PG11MD_101, 0, 0,
1847 0, 0, 0, 0, 0, 0, 0, 0,
1848 PG10MD_000, PG10MD_001, PG10MD_010, PG10MD_011,
1849 PG10MD_100, PG10MD_101, 0, 0,
1850 0, 0, 0, 0, 0, 0, 0, 0,
1851 PG9MD_000, PG9MD_001, PG9MD_010, PG9MD_011,
1852 PG9MD_100, PG9MD_101, 0, 0,
1853 0, 0, 0, 0, 0, 0, 0, 0,
1854 PG8MD_000, PG8MD_001, PG8MD_010, PG8MD_011,
1855 PG8MD_100, PG8MD_101, 0, 0,
1856 0, 0, 0, 0, 0, 0, 0, 0 }
1857 },
1858
1859 { PINMUX_CFG_REG("PGCR1", 0xfffe38cc, 16, 4) {
1860 PG7MD_00, PG7MD_01, PG7MD_10, PG7MD_11, 0, 0, 0, 0,
1861 0, 0, 0, 0, 0, 0, 0, 0,
1862 PG6MD_00, PG6MD_01, PG6MD_10, PG6MD_11, 0, 0, 0, 0,
1863 0, 0, 0, 0, 0, 0, 0, 0,
1864 PG5MD_00, PG5MD_01, PG5MD_10, PG5MD_11, 0, 0, 0, 0,
1865 0, 0, 0, 0, 0, 0, 0, 0,
1866 PG4MD_00, PG4MD_01, PG4MD_10, PG4MD_11, 0, 0, 0, 0,
1867 0, 0, 0, 0, 0, 0, 0, 0 }
1868 },
1869 { PINMUX_CFG_REG("PGCR0", 0xfffe38ce, 16, 4) {
1870 PG3MD_00, PG3MD_01, PG3MD_10, PG3MD_11, 0, 0, 0, 0,
1871 0, 0, 0, 0, 0, 0, 0, 0,
1872 PG2MD_00, PG2MD_01, PG2MD_10, PG2MD_11, 0, 0, 0, 0,
1873 0, 0, 0, 0, 0, 0, 0, 0,
1874 PG1MD_00, PG1MD_01, PG1MD_10, PG1MD_11, 0, 0, 0, 0,
1875 0, 0, 0, 0, 0, 0, 0, 0,
1876 0, 0, 0, 0, 0, 0, 0, 0,
1877 0, 0, 0, 0, 0, 0, 0, 0 }
1878 },
1879 { PINMUX_CFG_REG("PGIOR1", 0xfffe38d0, 16, 1) {
1880 0, 0, 0, 0, 0, 0, 0, 0,
1881 0, 0, 0, 0, 0, 0,
1882 PG24_IN, PG24_OUT,
1883 PG23_IN, PG23_OUT,
1884 PG22_IN, PG22_OUT,
1885 PG21_IN, PG21_OUT,
1886 PG20_IN, PG20_OUT,
1887 PG19_IN, PG19_OUT,
1888 PG18_IN, PG18_OUT,
1889 PG17_IN, PG17_OUT,
1890 PG16_IN, PG16_OUT }
1891 },
1892
1893 { PINMUX_CFG_REG("PGIOR0", 0xfffe38d2, 16, 1) {
1894 PG15_IN, PG15_OUT,
1895 PG14_IN, PG14_OUT,
1896 PG13_IN, PG13_OUT,
1897 PG12_IN, PG12_OUT,
1898 PG11_IN, PG11_OUT,
1899 PG10_IN, PG10_OUT,
1900 PG9_IN, PG9_OUT,
1901 PG8_IN, PG8_OUT,
1902 PG7_IN, PG7_OUT,
1903 PG6_IN, PG6_OUT,
1904 PG5_IN, PG5_OUT,
1905 PG4_IN, PG4_OUT,
1906 PG3_IN, PG3_OUT,
1907 PG2_IN, PG2_OUT,
1908 PG1_IN, PG1_OUT,
1909 PG0_IN, PG0_OUT
1910 }
1911 },
1912
1913 { PINMUX_CFG_REG("PHCR1", 0xfffe38ec, 16, 4) {
1914 PH7MD_0, PH7MD_1, 0, 0, 0, 0, 0, 0,
1915 0, 0, 0, 0, 0, 0, 0, 0,
1916 PH6MD_0, PH6MD_1, 0, 0, 0, 0, 0, 0,
1917 0, 0, 0, 0, 0, 0, 0, 0,
1918 PH5MD_0, PH5MD_1, 0, 0, 0, 0, 0, 0,
1919 0, 0, 0, 0, 0, 0, 0, 0,
1920 PH4MD_0, PH4MD_1, 0, 0, 0, 0, 0, 0,
1921 0, 0, 0, 0, 0, 0, 0, 0 }
1922 },
1923
1924 { PINMUX_CFG_REG("PHCR0", 0xfffe38ee, 16, 4) {
1925 PH3MD_0, PH3MD_1, 0, 0, 0, 0, 0, 0,
1926 0, 0, 0, 0, 0, 0, 0, 0,
1927 PH2MD_0, PH2MD_1, 0, 0, 0, 0, 0, 0,
1928 0, 0, 0, 0, 0, 0, 0, 0,
1929 PH1MD_0, PH1MD_1, 0, 0, 0, 0, 0, 0,
1930 0, 0, 0, 0, 0, 0, 0, 0,
1931 PH0MD_0, PH0MD_1, 0, 0, 0, 0, 0, 0,
1932 0, 0, 0, 0, 0, 0, 0, 0 }
1933 },
1934
1935 { PINMUX_CFG_REG("PJCR2", 0xfffe390a, 16, 4) {
1936 PJ11MD_00, PJ11MD_01, PJ11MD_10, 0, 0, 0, 0, 0,
1937 0, 0, 0, 0, 0, 0, 0, 0,
1938 PJ10MD_00, PJ10MD_01, PJ10MD_10, 0, 0, 0, 0, 0,
1939 0, 0, 0, 0, 0, 0, 0, 0,
1940 PJ9MD_00, PJ9MD_01, PJ9MD_10, 0, 0, 0, 0, 0,
1941 0, 0, 0, 0, 0, 0, 0, 0,
1942 PJ8MD_00, PJ8MD_01, PJ8MD_10, 0, 0, 0, 0, 0,
1943 0, 0, 0, 0, 0, 0, 0, 0 }
1944 },
1945 { PINMUX_CFG_REG("PJCR1", 0xfffe390c, 16, 4) {
1946 PJ7MD_00, PJ7MD_01, PJ7MD_10, 0, 0, 0, 0, 0,
1947 0, 0, 0, 0, 0, 0, 0, 0,
1948 PJ6MD_00, PJ6MD_01, PJ6MD_10, 0, 0, 0, 0, 0,
1949 0, 0, 0, 0, 0, 0, 0, 0,
1950 PJ5MD_00, PJ5MD_01, PJ5MD_10, 0, 0, 0, 0, 0,
1951 0, 0, 0, 0, 0, 0, 0, 0,
1952 PJ4MD_00, PJ4MD_01, PJ4MD_10, 0, 0, 0, 0, 0,
1953 0, 0, 0, 0, 0, 0, 0, 0 }
1954 },
1955 { PINMUX_CFG_REG("PJCR0", 0xfffe390e, 16, 4) {
1956 PJ3MD_00, PJ3MD_01, PJ3MD_10, PJ3MD_11, 0, 0, 0, 0,
1957 0, 0, 0, 0, 0, 0, 0, 0,
1958 PJ2MD_000, PJ2MD_001, PJ2MD_010, PJ2MD_011,
1959 PJ2MD_100, PJ2MD_101, 0, 0,
1960 0, 0, 0, 0, 0, 0, 0, 0,
1961 PJ1MD_000, PJ1MD_001, PJ1MD_010, PJ1MD_011,
1962 PJ1MD_100, 0, 0, 0,
1963 0, 0, 0, 0, 0, 0, 0, 0,
1964 PJ0MD_000, PJ0MD_001, PJ0MD_010, PJ0MD_011,
1965 PJ0MD_100, PJ0MD_101, 0, 0,
1966 0, 0, 0, 0, 0, 0, 0, 0, }
1967 },
1968 { PINMUX_CFG_REG("PJIOR0", 0xfffe3912, 16, 1) {
1969 0, 0, 0, 0, 0, 0, 0, 0,
1970 PJ11_IN, PJ11_OUT,
1971 PJ10_IN, PJ10_OUT,
1972 PJ9_IN, PJ9_OUT,
1973 PJ8_IN, PJ8_OUT,
1974 PJ7_IN, PJ7_OUT,
1975 PJ6_IN, PJ6_OUT,
1976 PJ5_IN, PJ5_OUT,
1977 PJ4_IN, PJ4_OUT,
1978 PJ3_IN, PJ3_OUT,
1979 PJ2_IN, PJ2_OUT,
1980 PJ1_IN, PJ1_OUT,
1981 PJ0_IN, PJ0_OUT }
1982 },
1983
1984 { PINMUX_CFG_REG("PKCR2", 0xfffe392a, 16, 4) {
1985 PK11MD_00, PK11MD_01, PK11MD_10, 0, 0, 0, 0, 0,
1986 0, 0, 0, 0, 0, 0, 0, 0,
1987 PK10MD_00, PK10MD_01, PK10MD_10, 0, 0, 0, 0, 0,
1988 0, 0, 0, 0, 0, 0, 0, 0,
1989 PK9MD_00, PK9MD_01, PK9MD_10, 0, 0, 0, 0, 0,
1990 0, 0, 0, 0, 0, 0, 0, 0,
1991 PK8MD_00, PK8MD_01, PK8MD_10, 0, 0, 0, 0, 0,
1992 0, 0, 0, 0, 0, 0, 0, 0 }
1993 },
1994
1995 { PINMUX_CFG_REG("PKCR1", 0xfffe392c, 16, 4) {
1996 PK7MD_00, PK7MD_01, PK7MD_10, 0, 0, 0, 0, 0,
1997 0, 0, 0, 0, 0, 0, 0, 0,
1998 PK6MD_00, PK6MD_01, PK6MD_10, 0, 0, 0, 0, 0,
1999 0, 0, 0, 0, 0, 0, 0, 0,
2000 PK5MD_00, PK5MD_01, PK5MD_10, 0, 0, 0, 0, 0,
2001 0, 0, 0, 0, 0, 0, 0, 0,
2002 PK4MD_00, PK4MD_01, PK4MD_10, 0, 0, 0, 0, 0,
2003 0, 0, 0, 0, 0, 0, 0, 0 }
2004 },
2005 { PINMUX_CFG_REG("PKCR0", 0xfffe392e, 16, 4) {
2006 PK3MD_00, PK3MD_01, PK3MD_10, 0, 0, 0, 0, 0,
2007 0, 0, 0, 0, 0, 0, 0, 0,
2008 PK2MD_00, PK2MD_01, PK2MD_10, 0, 0, 0, 0, 0,
2009 0, 0, 0, 0, 0, 0, 0, 0,
2010 PK1MD_00, PK1MD_01, PK1MD_10, 0, 0, 0, 0, 0,
2011 0, 0, 0, 0, 0, 0, 0, 0,
2012 PK0MD_00, PK0MD_01, PK0MD_10, 0, 0, 0, 0, 0,
2013 0, 0, 0, 0, 0, 0, 0, 0 }
2014 },
2015
2016 { PINMUX_CFG_REG("PKIOR0", 0xfffe3932, 16, 1) {
2017 0, 0, 0, 0, 0, 0, 0, 0,
2018 PJ11_IN, PJ11_OUT,
2019 PJ10_IN, PJ10_OUT,
2020 PJ9_IN, PJ9_OUT,
2021 PJ8_IN, PJ8_OUT,
2022 PJ7_IN, PJ7_OUT,
2023 PJ6_IN, PJ6_OUT,
2024 PJ5_IN, PJ5_OUT,
2025 PJ4_IN, PJ4_OUT,
2026 PJ3_IN, PJ3_OUT,
2027 PJ2_IN, PJ2_OUT,
2028 PJ1_IN, PJ1_OUT,
2029 PJ0_IN, PJ0_OUT }
2030 },
2031 {}
2032};
2033
2034static struct pinmux_data_reg pinmux_data_regs[] = {
2035 { PINMUX_DATA_REG("PADR1", 0xfffe3814, 16) {
2036 0, 0, 0, 0, 0, 0, 0, PA3_DATA,
2037 0, 0, 0, 0, 0, 0, 0, PA2_DATA }
2038 },
2039
2040 { PINMUX_DATA_REG("PADR0", 0xfffe3816, 16) {
2041 0, 0, 0, 0, 0, 0, 0, PA1_DATA,
2042 0, 0, 0, 0, 0, 0, 0, PA0_DATA }
2043 },
2044
2045 { PINMUX_DATA_REG("PBDR1", 0xfffe3834, 16) {
2046 0, 0, 0, 0, 0, 0, 0, 0,
2047 0, PB22_DATA, PB21_DATA, PB20_DATA,
2048 PB19_DATA, PB18_DATA, PB17_DATA, PB16_DATA }
2049 },
2050
2051 { PINMUX_DATA_REG("PBDR0", 0xfffe3836, 16) {
2052 PB15_DATA, PB14_DATA, PB13_DATA, PB12_DATA,
2053 PB11_DATA, PB10_DATA, PB9_DATA, PB8_DATA,
2054 PB7_DATA, PB6_DATA, PB5_DATA, PB4_DATA,
2055 PB3_DATA, PB2_DATA, PB1_DATA, 0 }
2056 },
2057
2058 { PINMUX_DATA_REG("PCDR0", 0xfffe3856, 16) {
2059 0, 0, 0, 0,
2060 0, PC10_DATA, PC9_DATA, PC8_DATA,
2061 PC7_DATA, PC6_DATA, PC5_DATA, PC4_DATA,
2062 PC3_DATA, PC2_DATA, PC1_DATA, PC0_DATA }
2063 },
2064
2065 { PINMUX_DATA_REG("PDDR0", 0xfffe3876, 16) {
2066 PD15_DATA, PD14_DATA, PD13_DATA, PD12_DATA,
2067 PD11_DATA, PD10_DATA, PD9_DATA, PD8_DATA,
2068 PD7_DATA, PD6_DATA, PD5_DATA, PD4_DATA,
2069 PD3_DATA, PD2_DATA, PD1_DATA, PD0_DATA }
2070 },
2071
2072 { PINMUX_DATA_REG("PEDR0", 0xfffe3896, 16) {
2073 0, 0, 0, 0, 0, 0, 0, 0,
2074 0, 0, PE5_DATA, PE4_DATA,
2075 PE3_DATA, PE2_DATA, PE1_DATA, PE0_DATA }
2076 },
2077
2078 { PINMUX_DATA_REG("PFDR0", 0xfffe38b6, 16) {
2079 0, 0, 0, PF12_DATA,
2080 PF11_DATA, PF10_DATA, PF9_DATA, PF8_DATA,
2081 PF7_DATA, PF6_DATA, PF5_DATA, PF4_DATA,
2082 PF3_DATA, PF2_DATA, PF1_DATA, PF0_DATA }
2083 },
2084
2085 { PINMUX_DATA_REG("PGDR1", 0xfffe38d4, 16) {
2086 0, 0, 0, 0, 0, 0, 0, PG24_DATA,
2087 PG23_DATA, PG22_DATA, PG21_DATA, PG20_DATA,
2088 PG19_DATA, PG18_DATA, PG17_DATA, PG16_DATA }
2089 },
2090
2091 { PINMUX_DATA_REG("PGDR0", 0xfffe38d6, 16) {
2092 PG15_DATA, PG14_DATA, PG13_DATA, PG12_DATA,
2093 PG11_DATA, PG10_DATA, PG9_DATA, PG8_DATA,
2094 PG7_DATA, PG6_DATA, PG5_DATA, PG4_DATA,
2095 PG3_DATA, PG2_DATA, PG1_DATA, PG0_DATA }
2096 },
2097 { PINMUX_DATA_REG("PJDR0", 0xfffe3916, 16) {
2098 0, 0, 0, PJ12_DATA,
2099 PJ11_DATA, PJ10_DATA, PJ9_DATA, PJ8_DATA,
2100 PJ7_DATA, PJ6_DATA, PJ5_DATA, PJ4_DATA,
2101 PJ3_DATA, PJ2_DATA, PJ1_DATA, PJ0_DATA }
2102 },
2103 { PINMUX_DATA_REG("PKDR0", 0xfffe3936, 16) {
2104 0, 0, 0, PK12_DATA,
2105 PK11_DATA, PK10_DATA, PK9_DATA, PK8_DATA,
2106 PK7_DATA, PK6_DATA, PK5_DATA, PK4_DATA,
2107 PK3_DATA, PK2_DATA, PK1_DATA, PK0_DATA }
2108 },
2109 { }
2110};
2111
2112static struct pinmux_info sh7264_pinmux_info = {
2113 .name = "sh7264_pfc",
2114 .reserved_id = PINMUX_RESERVED,
2115 .data = { PINMUX_DATA_BEGIN, PINMUX_DATA_END },
2116 .input = { PINMUX_INPUT_BEGIN, PINMUX_INPUT_END, FORCE_IN },
2117 .output = { PINMUX_OUTPUT_BEGIN, PINMUX_OUTPUT_END, FORCE_OUT },
2118 .mark = { PINMUX_MARK_BEGIN, PINMUX_MARK_END },
2119 .function = { PINMUX_FUNCTION_BEGIN, PINMUX_FUNCTION_END },
2120
2121 .first_gpio = GPIO_PA3,
2122 .last_gpio = GPIO_FN_LCD_M_DISP,
2123
2124 .gpios = pinmux_gpios,
2125 .cfg_regs = pinmux_config_regs,
2126 .data_regs = pinmux_data_regs,
2127
2128 .gpio_data = pinmux_data,
2129 .gpio_data_size = ARRAY_SIZE(pinmux_data),
2130};
2131
2132static int __init plat_pinmux_setup(void)
2133{
2134 return register_pinmux(&sh7264_pinmux_info);
2135}
2136arch_initcall(plat_pinmux_setup);
diff --git a/arch/sh/kernel/cpu/sh2a/probe.c b/arch/sh/kernel/cpu/sh2a/probe.c
index 48e97a2a0c8d..414b2581c606 100644
--- a/arch/sh/kernel/cpu/sh2a/probe.c
+++ b/arch/sh/kernel/cpu/sh2a/probe.c
@@ -29,6 +29,9 @@ void __cpuinit cpu_probe(void)
29#elif defined(CONFIG_CPU_SUBTYPE_SH7263) 29#elif defined(CONFIG_CPU_SUBTYPE_SH7263)
30 boot_cpu_data.type = CPU_SH7263; 30 boot_cpu_data.type = CPU_SH7263;
31 boot_cpu_data.flags |= CPU_HAS_FPU; 31 boot_cpu_data.flags |= CPU_HAS_FPU;
32#elif defined(CONFIG_CPU_SUBTYPE_SH7264)
33 boot_cpu_data.type = CPU_SH7264;
34 boot_cpu_data.flags |= CPU_HAS_FPU;
32#elif defined(CONFIG_CPU_SUBTYPE_SH7206) 35#elif defined(CONFIG_CPU_SUBTYPE_SH7206)
33 boot_cpu_data.type = CPU_SH7206; 36 boot_cpu_data.type = CPU_SH7206;
34 boot_cpu_data.flags |= CPU_HAS_DSP; 37 boot_cpu_data.flags |= CPU_HAS_DSP;
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7264.c b/arch/sh/kernel/cpu/sh2a/setup-sh7264.c
new file mode 100644
index 000000000000..ce5c1b5aebfa
--- /dev/null
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7264.c
@@ -0,0 +1,606 @@
1/*
2 * SH7264 Setup
3 *
4 * Copyright (C) 2012 Renesas Electronics Europe Ltd
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10#include <linux/platform_device.h>
11#include <linux/init.h>
12#include <linux/serial.h>
13#include <linux/serial_sci.h>
14#include <linux/usb/r8a66597.h>
15#include <linux/sh_timer.h>
16#include <linux/io.h>
17
18enum {
19 UNUSED = 0,
20
21 /* interrupt sources */
22 IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7,
23 PINT0, PINT1, PINT2, PINT3, PINT4, PINT5, PINT6, PINT7,
24
25 DMAC0, DMAC1, DMAC2, DMAC3, DMAC4, DMAC5, DMAC6, DMAC7,
26 DMAC8, DMAC9, DMAC10, DMAC11, DMAC12, DMAC13, DMAC14, DMAC15,
27 USB, VDC3, CMT0, CMT1, BSC, WDT,
28 MTU0_ABCD, MTU0_VEF, MTU1_AB, MTU1_VU, MTU2_AB, MTU2_VU,
29 MTU3_ABCD, MTU3_TCI3V, MTU4_ABCD, MTU4_TCI4V,
30 PWMT1, PWMT2, ADC_ADI,
31 SSIF0, SSII1, SSII2, SSII3,
32 RSPDIF,
33 IIC30, IIC31, IIC32, IIC33,
34 SCIF0_BRI, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI,
35 SCIF1_BRI, SCIF1_ERI, SCIF1_RXI, SCIF1_TXI,
36 SCIF2_BRI, SCIF2_ERI, SCIF2_RXI, SCIF2_TXI,
37 SCIF3_BRI, SCIF3_ERI, SCIF3_RXI, SCIF3_TXI,
38 SCIF4_BRI, SCIF4_ERI, SCIF4_RXI, SCIF4_TXI,
39 SCIF5_BRI, SCIF5_ERI, SCIF5_RXI, SCIF5_TXI,
40 SCIF6_BRI, SCIF6_ERI, SCIF6_RXI, SCIF6_TXI,
41 SCIF7_BRI, SCIF7_ERI, SCIF7_RXI, SCIF7_TXI,
42 SIO_FIFO, RSPIC0, RSPIC1,
43 RCAN0, RCAN1, IEBC, CD_ROMD,
44 NFMC, SDHI, RTC,
45 SRCC0, SRCC1, DCOMU, OFFI, IFEI,
46
47 /* interrupt groups */
48 PINT, SCIF0, SCIF1, SCIF2, SCIF3, SCIF4, SCIF5, SCIF6, SCIF7,
49};
50
51static struct intc_vect vectors[] __initdata = {
52 INTC_IRQ(IRQ0, 64), INTC_IRQ(IRQ1, 65),
53 INTC_IRQ(IRQ2, 66), INTC_IRQ(IRQ3, 67),
54 INTC_IRQ(IRQ4, 68), INTC_IRQ(IRQ5, 69),
55 INTC_IRQ(IRQ6, 70), INTC_IRQ(IRQ7, 71),
56
57 INTC_IRQ(PINT0, 80), INTC_IRQ(PINT1, 81),
58 INTC_IRQ(PINT2, 82), INTC_IRQ(PINT3, 83),
59 INTC_IRQ(PINT4, 84), INTC_IRQ(PINT5, 85),
60 INTC_IRQ(PINT6, 86), INTC_IRQ(PINT7, 87),
61
62 INTC_IRQ(DMAC0, 108), INTC_IRQ(DMAC0, 109),
63 INTC_IRQ(DMAC1, 112), INTC_IRQ(DMAC1, 113),
64 INTC_IRQ(DMAC2, 116), INTC_IRQ(DMAC2, 117),
65 INTC_IRQ(DMAC3, 120), INTC_IRQ(DMAC3, 121),
66 INTC_IRQ(DMAC4, 124), INTC_IRQ(DMAC4, 125),
67 INTC_IRQ(DMAC5, 128), INTC_IRQ(DMAC5, 129),
68 INTC_IRQ(DMAC6, 132), INTC_IRQ(DMAC6, 133),
69 INTC_IRQ(DMAC7, 136), INTC_IRQ(DMAC7, 137),
70 INTC_IRQ(DMAC8, 140), INTC_IRQ(DMAC8, 141),
71 INTC_IRQ(DMAC9, 144), INTC_IRQ(DMAC9, 145),
72 INTC_IRQ(DMAC10, 148), INTC_IRQ(DMAC10, 149),
73 INTC_IRQ(DMAC11, 152), INTC_IRQ(DMAC11, 153),
74 INTC_IRQ(DMAC12, 156), INTC_IRQ(DMAC12, 157),
75 INTC_IRQ(DMAC13, 160), INTC_IRQ(DMAC13, 161),
76 INTC_IRQ(DMAC14, 164), INTC_IRQ(DMAC14, 165),
77 INTC_IRQ(DMAC15, 168), INTC_IRQ(DMAC15, 169),
78
79 INTC_IRQ(USB, 170),
80 INTC_IRQ(VDC3, 171), INTC_IRQ(VDC3, 172),
81 INTC_IRQ(VDC3, 173), INTC_IRQ(VDC3, 174),
82 INTC_IRQ(CMT0, 175), INTC_IRQ(CMT1, 176),
83 INTC_IRQ(BSC, 177), INTC_IRQ(WDT, 178),
84
85 INTC_IRQ(MTU0_ABCD, 179), INTC_IRQ(MTU0_ABCD, 180),
86 INTC_IRQ(MTU0_ABCD, 181), INTC_IRQ(MTU0_ABCD, 182),
87 INTC_IRQ(MTU0_VEF, 183),
88 INTC_IRQ(MTU0_VEF, 184), INTC_IRQ(MTU0_VEF, 185),
89 INTC_IRQ(MTU1_AB, 186), INTC_IRQ(MTU1_AB, 187),
90 INTC_IRQ(MTU1_VU, 188), INTC_IRQ(MTU1_VU, 189),
91 INTC_IRQ(MTU2_AB, 190), INTC_IRQ(MTU2_AB, 191),
92 INTC_IRQ(MTU2_VU, 192), INTC_IRQ(MTU2_VU, 193),
93 INTC_IRQ(MTU3_ABCD, 194), INTC_IRQ(MTU3_ABCD, 195),
94 INTC_IRQ(MTU3_ABCD, 196), INTC_IRQ(MTU3_ABCD, 197),
95 INTC_IRQ(MTU3_TCI3V, 198),
96 INTC_IRQ(MTU4_ABCD, 199), INTC_IRQ(MTU4_ABCD, 200),
97 INTC_IRQ(MTU4_ABCD, 201), INTC_IRQ(MTU4_ABCD, 202),
98 INTC_IRQ(MTU4_TCI4V, 203),
99
100 INTC_IRQ(PWMT1, 204), INTC_IRQ(PWMT2, 205),
101
102 INTC_IRQ(ADC_ADI, 206),
103
104 INTC_IRQ(SSIF0, 207), INTC_IRQ(SSIF0, 208),
105 INTC_IRQ(SSIF0, 209),
106 INTC_IRQ(SSII1, 210), INTC_IRQ(SSII1, 211),
107 INTC_IRQ(SSII2, 212), INTC_IRQ(SSII2, 213),
108 INTC_IRQ(SSII3, 214), INTC_IRQ(SSII3, 215),
109
110 INTC_IRQ(RSPDIF, 216),
111
112 INTC_IRQ(IIC30, 217), INTC_IRQ(IIC30, 218),
113 INTC_IRQ(IIC30, 219), INTC_IRQ(IIC30, 220),
114 INTC_IRQ(IIC30, 221),
115 INTC_IRQ(IIC31, 222), INTC_IRQ(IIC31, 223),
116 INTC_IRQ(IIC31, 224), INTC_IRQ(IIC31, 225),
117 INTC_IRQ(IIC31, 226),
118 INTC_IRQ(IIC32, 227), INTC_IRQ(IIC32, 228),
119 INTC_IRQ(IIC32, 229), INTC_IRQ(IIC32, 230),
120 INTC_IRQ(IIC32, 231),
121
122 INTC_IRQ(SCIF0_BRI, 232), INTC_IRQ(SCIF0_ERI, 233),
123 INTC_IRQ(SCIF0_RXI, 234), INTC_IRQ(SCIF0_TXI, 235),
124 INTC_IRQ(SCIF1_BRI, 236), INTC_IRQ(SCIF1_ERI, 237),
125 INTC_IRQ(SCIF1_RXI, 238), INTC_IRQ(SCIF1_TXI, 239),
126 INTC_IRQ(SCIF2_BRI, 240), INTC_IRQ(SCIF2_ERI, 241),
127 INTC_IRQ(SCIF2_RXI, 242), INTC_IRQ(SCIF2_TXI, 243),
128 INTC_IRQ(SCIF3_BRI, 244), INTC_IRQ(SCIF3_ERI, 245),
129 INTC_IRQ(SCIF3_RXI, 246), INTC_IRQ(SCIF3_TXI, 247),
130 INTC_IRQ(SCIF4_BRI, 248), INTC_IRQ(SCIF4_ERI, 249),
131 INTC_IRQ(SCIF4_RXI, 250), INTC_IRQ(SCIF4_TXI, 251),
132 INTC_IRQ(SCIF5_BRI, 252), INTC_IRQ(SCIF5_ERI, 253),
133 INTC_IRQ(SCIF5_RXI, 254), INTC_IRQ(SCIF5_TXI, 255),
134 INTC_IRQ(SCIF6_BRI, 256), INTC_IRQ(SCIF6_ERI, 257),
135 INTC_IRQ(SCIF6_RXI, 258), INTC_IRQ(SCIF6_TXI, 259),
136 INTC_IRQ(SCIF7_BRI, 260), INTC_IRQ(SCIF7_ERI, 261),
137 INTC_IRQ(SCIF7_RXI, 262), INTC_IRQ(SCIF7_TXI, 263),
138
139 INTC_IRQ(SIO_FIFO, 264),
140
141 INTC_IRQ(RSPIC0, 265), INTC_IRQ(RSPIC0, 266),
142 INTC_IRQ(RSPIC0, 267),
143 INTC_IRQ(RSPIC1, 268), INTC_IRQ(RSPIC1, 269),
144 INTC_IRQ(RSPIC1, 270),
145
146 INTC_IRQ(RCAN0, 271), INTC_IRQ(RCAN0, 272),
147 INTC_IRQ(RCAN0, 273), INTC_IRQ(RCAN0, 274),
148 INTC_IRQ(RCAN0, 275),
149 INTC_IRQ(RCAN1, 276), INTC_IRQ(RCAN1, 277),
150 INTC_IRQ(RCAN1, 278), INTC_IRQ(RCAN1, 279),
151 INTC_IRQ(RCAN1, 280),
152
153 INTC_IRQ(IEBC, 281),
154
155 INTC_IRQ(CD_ROMD, 282), INTC_IRQ(CD_ROMD, 283),
156 INTC_IRQ(CD_ROMD, 284), INTC_IRQ(CD_ROMD, 285),
157 INTC_IRQ(CD_ROMD, 286), INTC_IRQ(CD_ROMD, 287),
158
159 INTC_IRQ(NFMC, 288), INTC_IRQ(NFMC, 289),
160 INTC_IRQ(NFMC, 290), INTC_IRQ(NFMC, 291),
161
162 INTC_IRQ(SDHI, 292), INTC_IRQ(SDHI, 293),
163 INTC_IRQ(SDHI, 294),
164
165 INTC_IRQ(RTC, 296), INTC_IRQ(RTC, 297),
166 INTC_IRQ(RTC, 298),
167
168 INTC_IRQ(SRCC0, 299), INTC_IRQ(SRCC0, 300),
169 INTC_IRQ(SRCC0, 301), INTC_IRQ(SRCC0, 302),
170 INTC_IRQ(SRCC0, 303),
171 INTC_IRQ(SRCC1, 304), INTC_IRQ(SRCC1, 305),
172 INTC_IRQ(SRCC1, 306), INTC_IRQ(SRCC1, 307),
173 INTC_IRQ(SRCC1, 308),
174
175 INTC_IRQ(DCOMU, 310), INTC_IRQ(DCOMU, 311),
176 INTC_IRQ(DCOMU, 312),
177};
178
179static struct intc_group groups[] __initdata = {
180 INTC_GROUP(PINT, PINT0, PINT1, PINT2, PINT3,
181 PINT4, PINT5, PINT6, PINT7),
182 INTC_GROUP(SCIF0, SCIF0_BRI, SCIF0_ERI, SCIF0_RXI, SCIF0_TXI),
183 INTC_GROUP(SCIF1, SCIF1_BRI, SCIF1_ERI, SCIF1_RXI, SCIF1_TXI),
184 INTC_GROUP(SCIF2, SCIF2_BRI, SCIF2_ERI, SCIF2_RXI, SCIF2_TXI),
185 INTC_GROUP(SCIF3, SCIF3_BRI, SCIF3_ERI, SCIF3_RXI, SCIF3_TXI),
186 INTC_GROUP(SCIF4, SCIF4_BRI, SCIF4_ERI, SCIF4_RXI, SCIF4_TXI),
187 INTC_GROUP(SCIF5, SCIF5_BRI, SCIF5_ERI, SCIF5_RXI, SCIF5_TXI),
188 INTC_GROUP(SCIF6, SCIF6_BRI, SCIF6_ERI, SCIF6_RXI, SCIF6_TXI),
189 INTC_GROUP(SCIF7, SCIF7_BRI, SCIF7_ERI, SCIF7_RXI, SCIF7_TXI),
190};
191
192static struct intc_prio_reg prio_registers[] __initdata = {
193 { 0xfffe0818, 0, 16, 4, /* IPR01 */ { IRQ0, IRQ1, IRQ2, IRQ3 } },
194 { 0xfffe081a, 0, 16, 4, /* IPR02 */ { IRQ4, IRQ5, IRQ6, IRQ7 } },
195 { 0xfffe0820, 0, 16, 4, /* IPR05 */ { PINT, 0, 0, 0 } },
196 { 0xfffe0c00, 0, 16, 4, /* IPR06 */ { DMAC0, DMAC1, DMAC2, DMAC3 } },
197 { 0xfffe0c02, 0, 16, 4, /* IPR07 */ { DMAC4, DMAC5, DMAC6, DMAC7 } },
198 { 0xfffe0c04, 0, 16, 4, /* IPR08 */ { DMAC8, DMAC9,
199 DMAC10, DMAC11 } },
200 { 0xfffe0c06, 0, 16, 4, /* IPR09 */ { DMAC12, DMAC13,
201 DMAC14, DMAC15 } },
202 { 0xfffe0c08, 0, 16, 4, /* IPR10 */ { USB, VDC3, CMT0, CMT1 } },
203 { 0xfffe0c0a, 0, 16, 4, /* IPR11 */ { BSC, WDT, MTU0_ABCD, MTU0_VEF } },
204 { 0xfffe0c0c, 0, 16, 4, /* IPR12 */ { MTU1_AB, MTU1_VU,
205 MTU2_AB, MTU2_VU } },
206 { 0xfffe0c0e, 0, 16, 4, /* IPR13 */ { MTU3_ABCD, MTU3_TCI3V,
207 MTU4_ABCD, MTU4_TCI4V } },
208 { 0xfffe0c10, 0, 16, 4, /* IPR14 */ { PWMT1, PWMT2, ADC_ADI, 0 } },
209 { 0xfffe0c12, 0, 16, 4, /* IPR15 */ { SSIF0, SSII1, SSII2, SSII3 } },
210 { 0xfffe0c14, 0, 16, 4, /* IPR16 */ { RSPDIF, IIC30, IIC31, IIC32 } },
211 { 0xfffe0c16, 0, 16, 4, /* IPR17 */ { SCIF0, SCIF1, SCIF2, SCIF3 } },
212 { 0xfffe0c18, 0, 16, 4, /* IPR18 */ { SCIF4, SCIF5, SCIF6, SCIF7 } },
213 { 0xfffe0c1a, 0, 16, 4, /* IPR19 */ { SIO_FIFO, 0, RSPIC0, RSPIC1, } },
214 { 0xfffe0c1c, 0, 16, 4, /* IPR20 */ { RCAN0, RCAN1, IEBC, CD_ROMD } },
215 { 0xfffe0c1e, 0, 16, 4, /* IPR21 */ { NFMC, SDHI, RTC, 0 } },
216 { 0xfffe0c20, 0, 16, 4, /* IPR22 */ { SRCC0, SRCC1, 0, DCOMU } },
217};
218
219static struct intc_mask_reg mask_registers[] __initdata = {
220 { 0xfffe0808, 0, 16, /* PINTER */
221 { 0, 0, 0, 0, 0, 0, 0, 0,
222 PINT7, PINT6, PINT5, PINT4, PINT3, PINT2, PINT1, PINT0 } },
223};
224
225static DECLARE_INTC_DESC(intc_desc, "sh7264", vectors, groups,
226 mask_registers, prio_registers, NULL);
227
228static struct plat_sci_port scif0_platform_data = {
229 .mapbase = 0xfffe8000,
230 .flags = UPF_BOOT_AUTOCONF,
231 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
232 SCSCR_REIE | SCSCR_TOIE,
233 .scbrr_algo_id = SCBRR_ALGO_2,
234 .type = PORT_SCIF,
235 .irqs = { 233, 234, 235, 232 },
236 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
237};
238
239static struct platform_device scif0_device = {
240 .name = "sh-sci",
241 .id = 0,
242 .dev = {
243 .platform_data = &scif0_platform_data,
244 },
245};
246
247static struct plat_sci_port scif1_platform_data = {
248 .mapbase = 0xfffe8800,
249 .flags = UPF_BOOT_AUTOCONF,
250 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
251 SCSCR_REIE | SCSCR_TOIE,
252 .scbrr_algo_id = SCBRR_ALGO_2,
253 .type = PORT_SCIF,
254 .irqs = { 237, 238, 239, 236 },
255 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
256};
257
258static struct platform_device scif1_device = {
259 .name = "sh-sci",
260 .id = 1,
261 .dev = {
262 .platform_data = &scif1_platform_data,
263 },
264};
265
266static struct plat_sci_port scif2_platform_data = {
267 .mapbase = 0xfffe9000,
268 .flags = UPF_BOOT_AUTOCONF,
269 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
270 SCSCR_REIE | SCSCR_TOIE,
271 .scbrr_algo_id = SCBRR_ALGO_2,
272 .type = PORT_SCIF,
273 .irqs = { 241, 242, 243, 240 },
274 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
275};
276
277static struct platform_device scif2_device = {
278 .name = "sh-sci",
279 .id = 2,
280 .dev = {
281 .platform_data = &scif2_platform_data,
282 },
283};
284
285static struct plat_sci_port scif3_platform_data = {
286 .mapbase = 0xfffe9800,
287 .flags = UPF_BOOT_AUTOCONF,
288 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
289 SCSCR_REIE | SCSCR_TOIE,
290 .scbrr_algo_id = SCBRR_ALGO_2,
291 .type = PORT_SCIF,
292 .irqs = { 245, 246, 247, 244 },
293 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
294};
295
296static struct platform_device scif3_device = {
297 .name = "sh-sci",
298 .id = 3,
299 .dev = {
300 .platform_data = &scif3_platform_data,
301 },
302};
303
304static struct plat_sci_port scif4_platform_data = {
305 .mapbase = 0xfffea000,
306 .flags = UPF_BOOT_AUTOCONF,
307 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
308 SCSCR_REIE | SCSCR_TOIE,
309 .scbrr_algo_id = SCBRR_ALGO_2,
310 .type = PORT_SCIF,
311 .irqs = { 249, 250, 251, 248 },
312 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
313};
314
315static struct platform_device scif4_device = {
316 .name = "sh-sci",
317 .id = 4,
318 .dev = {
319 .platform_data = &scif4_platform_data,
320 },
321};
322
323static struct plat_sci_port scif5_platform_data = {
324 .mapbase = 0xfffea800,
325 .flags = UPF_BOOT_AUTOCONF,
326 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
327 SCSCR_REIE | SCSCR_TOIE,
328 .scbrr_algo_id = SCBRR_ALGO_2,
329 .type = PORT_SCIF,
330 .irqs = { 253, 254, 255, 252 },
331 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
332};
333
334static struct platform_device scif5_device = {
335 .name = "sh-sci",
336 .id = 5,
337 .dev = {
338 .platform_data = &scif5_platform_data,
339 },
340};
341
342static struct plat_sci_port scif6_platform_data = {
343 .mapbase = 0xfffeb000,
344 .flags = UPF_BOOT_AUTOCONF,
345 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
346 SCSCR_REIE | SCSCR_TOIE,
347 .scbrr_algo_id = SCBRR_ALGO_2,
348 .type = PORT_SCIF,
349 .irqs = { 257, 258, 259, 256 },
350 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
351};
352
353static struct platform_device scif6_device = {
354 .name = "sh-sci",
355 .id = 6,
356 .dev = {
357 .platform_data = &scif6_platform_data,
358 },
359};
360
361static struct plat_sci_port scif7_platform_data = {
362 .mapbase = 0xfffeb800,
363 .flags = UPF_BOOT_AUTOCONF,
364 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE |
365 SCSCR_REIE | SCSCR_TOIE,
366 .scbrr_algo_id = SCBRR_ALGO_2,
367 .type = PORT_SCIF,
368 .irqs = { 261, 262, 263, 260 },
369 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE,
370};
371
372static struct platform_device scif7_device = {
373 .name = "sh-sci",
374 .id = 7,
375 .dev = {
376 .platform_data = &scif7_platform_data,
377 },
378};
379
380static struct sh_timer_config cmt0_platform_data = {
381 .channel_offset = 0x02,
382 .timer_bit = 0,
383 .clockevent_rating = 125,
384 .clocksource_rating = 0, /* disabled due to code generation issues */
385};
386
387static struct resource cmt0_resources[] = {
388 [0] = {
389 .name = "CMT0",
390 .start = 0xfffec002,
391 .end = 0xfffec007,
392 .flags = IORESOURCE_MEM,
393 },
394 [1] = {
395 .start = 175,
396 .flags = IORESOURCE_IRQ,
397 },
398};
399
400static struct platform_device cmt0_device = {
401 .name = "sh_cmt",
402 .id = 0,
403 .dev = {
404 .platform_data = &cmt0_platform_data,
405 },
406 .resource = cmt0_resources,
407 .num_resources = ARRAY_SIZE(cmt0_resources),
408};
409
410static struct sh_timer_config cmt1_platform_data = {
411 .name = "CMT1",
412 .channel_offset = 0x08,
413 .timer_bit = 1,
414 .clockevent_rating = 125,
415 .clocksource_rating = 0, /* disabled due to code generation issues */
416};
417
418static struct resource cmt1_resources[] = {
419 [0] = {
420 .name = "CMT1",
421 .start = 0xfffec008,
422 .end = 0xfffec00d,
423 .flags = IORESOURCE_MEM,
424 },
425 [1] = {
426 .start = 176,
427 .flags = IORESOURCE_IRQ,
428 },
429};
430
431static struct platform_device cmt1_device = {
432 .name = "sh_cmt",
433 .id = 1,
434 .dev = {
435 .platform_data = &cmt1_platform_data,
436 },
437 .resource = cmt1_resources,
438 .num_resources = ARRAY_SIZE(cmt1_resources),
439};
440
441static struct sh_timer_config mtu2_0_platform_data = {
442 .name = "MTU2_0",
443 .channel_offset = -0x80,
444 .timer_bit = 0,
445 .clockevent_rating = 200,
446};
447
448static struct resource mtu2_0_resources[] = {
449 [0] = {
450 .name = "MTU2_0",
451 .start = 0xfffe4300,
452 .end = 0xfffe4326,
453 .flags = IORESOURCE_MEM,
454 },
455 [1] = {
456 .start = 179,
457 .flags = IORESOURCE_IRQ,
458 },
459};
460
461static struct platform_device mtu2_0_device = {
462 .name = "sh_mtu2",
463 .id = 0,
464 .dev = {
465 .platform_data = &mtu2_0_platform_data,
466 },
467 .resource = mtu2_0_resources,
468 .num_resources = ARRAY_SIZE(mtu2_0_resources),
469};
470
471static struct sh_timer_config mtu2_1_platform_data = {
472 .name = "MTU2_1",
473 .channel_offset = -0x100,
474 .timer_bit = 1,
475 .clockevent_rating = 200,
476};
477
478static struct resource mtu2_1_resources[] = {
479 [0] = {
480 .name = "MTU2_1",
481 .start = 0xfffe4380,
482 .end = 0xfffe4390,
483 .flags = IORESOURCE_MEM,
484 },
485 [1] = {
486 .start = 186,
487 .flags = IORESOURCE_IRQ,
488 },
489};
490
491static struct platform_device mtu2_1_device = {
492 .name = "sh_mtu2",
493 .id = 1,
494 .dev = {
495 .platform_data = &mtu2_1_platform_data,
496 },
497 .resource = mtu2_1_resources,
498 .num_resources = ARRAY_SIZE(mtu2_1_resources),
499};
500
501static struct resource rtc_resources[] = {
502 [0] = {
503 .start = 0xfffe6000,
504 .end = 0xfffe6000 + 0x30 - 1,
505 .flags = IORESOURCE_IO,
506 },
507 [1] = {
508 /* Shared Period/Carry/Alarm IRQ */
509 .start = 296,
510 .flags = IORESOURCE_IRQ,
511 },
512};
513
514static struct platform_device rtc_device = {
515 .name = "sh-rtc",
516 .id = -1,
517 .num_resources = ARRAY_SIZE(rtc_resources),
518 .resource = rtc_resources,
519};
520
521/* USB Host */
522static void usb_port_power(int port, int power)
523{
524 __raw_writew(0x200 , 0xffffc0c2) ; /* Initialise UACS25 */
525}
526
527static struct r8a66597_platdata r8a66597_data = {
528 .on_chip = 1,
529 .endian = 1,
530 .port_power = usb_port_power,
531};
532
533static struct resource r8a66597_usb_host_resources[] = {
534 [0] = {
535 .start = 0xffffc000,
536 .end = 0xffffc0e4,
537 .flags = IORESOURCE_MEM,
538 },
539 [1] = {
540 .start = 170,
541 .end = 170,
542 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
543 },
544};
545
546static struct platform_device r8a66597_usb_host_device = {
547 .name = "r8a66597_hcd",
548 .id = 0,
549 .dev = {
550 .dma_mask = NULL, /* not use dma */
551 .coherent_dma_mask = 0xffffffff,
552 .platform_data = &r8a66597_data,
553 },
554 .num_resources = ARRAY_SIZE(r8a66597_usb_host_resources),
555 .resource = r8a66597_usb_host_resources,
556};
557
558static struct platform_device *sh7264_devices[] __initdata = {
559 &scif0_device,
560 &scif1_device,
561 &scif2_device,
562 &scif3_device,
563 &scif4_device,
564 &scif5_device,
565 &scif6_device,
566 &scif7_device,
567 &cmt0_device,
568 &cmt1_device,
569 &mtu2_0_device,
570 &mtu2_1_device,
571 &rtc_device,
572 &r8a66597_usb_host_device,
573};
574
575static int __init sh7264_devices_setup(void)
576{
577 return platform_add_devices(sh7264_devices,
578 ARRAY_SIZE(sh7264_devices));
579}
580arch_initcall(sh7264_devices_setup);
581
582void __init plat_irq_setup(void)
583{
584 register_intc_controller(&intc_desc);
585}
586
587static struct platform_device *sh7264_early_devices[] __initdata = {
588 &scif0_device,
589 &scif1_device,
590 &scif2_device,
591 &scif3_device,
592 &scif4_device,
593 &scif5_device,
594 &scif6_device,
595 &scif7_device,
596 &cmt0_device,
597 &cmt1_device,
598 &mtu2_0_device,
599 &mtu2_1_device,
600};
601
602void __init plat_early_device_setup(void)
603{
604 early_platform_add_devices(sh7264_early_devices,
605 ARRAY_SIZE(sh7264_early_devices));
606}
diff --git a/arch/sh/tools/mach-types b/arch/sh/tools/mach-types
index 6dd56c4d0054..d007c81acfad 100644
--- a/arch/sh/tools/mach-types
+++ b/arch/sh/tools/mach-types
@@ -51,6 +51,7 @@ SDK7780 SH_SDK7780
51MIGOR SH_MIGOR 51MIGOR SH_MIGOR
52RSK7201 SH_RSK7201 52RSK7201 SH_RSK7201
53RSK7203 SH_RSK7203 53RSK7203 SH_RSK7203
54RSK7264 SH_RSK7264
54AP325RXA SH_AP325RXA 55AP325RXA SH_AP325RXA
55SH2007 SH_SH2007 56SH2007 SH_SH2007
56SH7757LCR SH_SH7757LCR 57SH7757LCR SH_SH7757LCR
diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c
index 1210fde18740..160cac9c4036 100644
--- a/arch/sparc/kernel/leon_smp.c
+++ b/arch/sparc/kernel/leon_smp.c
@@ -23,6 +23,7 @@
23#include <linux/pm.h> 23#include <linux/pm.h>
24#include <linux/delay.h> 24#include <linux/delay.h>
25#include <linux/gfp.h> 25#include <linux/gfp.h>
26#include <linux/cpu.h>
26 27
27#include <asm/cacheflush.h> 28#include <asm/cacheflush.h>
28#include <asm/tlbflush.h> 29#include <asm/tlbflush.h>
@@ -78,6 +79,8 @@ void __cpuinit leon_callin(void)
78 local_flush_tlb_all(); 79 local_flush_tlb_all();
79 leon_configure_cache_smp(); 80 leon_configure_cache_smp();
80 81
82 notify_cpu_starting(cpuid);
83
81 /* Get our local ticker going. */ 84 /* Get our local ticker going. */
82 smp_setup_percpu_timer(); 85 smp_setup_percpu_timer();
83 86
diff --git a/arch/sparc/kernel/sys_sparc_64.c b/arch/sparc/kernel/sys_sparc_64.c
index 232df9949530..3ee51f189a55 100644
--- a/arch/sparc/kernel/sys_sparc_64.c
+++ b/arch/sparc/kernel/sys_sparc_64.c
@@ -566,15 +566,10 @@ out:
566 566
567SYSCALL_DEFINE2(64_munmap, unsigned long, addr, size_t, len) 567SYSCALL_DEFINE2(64_munmap, unsigned long, addr, size_t, len)
568{ 568{
569 long ret;
570
571 if (invalid_64bit_range(addr, len)) 569 if (invalid_64bit_range(addr, len))
572 return -EINVAL; 570 return -EINVAL;
573 571
574 down_write(&current->mm->mmap_sem); 572 return vm_munmap(addr, len);
575 ret = do_munmap(current->mm, addr, len);
576 up_write(&current->mm->mmap_sem);
577 return ret;
578} 573}
579 574
580extern unsigned long do_mremap(unsigned long addr, 575extern unsigned long do_mremap(unsigned long addr,
diff --git a/arch/tile/include/asm/pci.h b/arch/tile/include/asm/pci.h
index 5d5a635530bd..32e6cbe8dff3 100644
--- a/arch/tile/include/asm/pci.h
+++ b/arch/tile/include/asm/pci.h
@@ -47,8 +47,8 @@ struct pci_controller {
47 */ 47 */
48#define PCI_DMA_BUS_IS_PHYS 1 48#define PCI_DMA_BUS_IS_PHYS 1
49 49
50int __devinit tile_pci_init(void); 50int __init tile_pci_init(void);
51int __devinit pcibios_init(void); 51int __init pcibios_init(void);
52 52
53static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) {} 53static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr) {}
54 54
diff --git a/arch/tile/kernel/pci.c b/arch/tile/kernel/pci.c
index a1bb59eecc18..b56d12bf5900 100644
--- a/arch/tile/kernel/pci.c
+++ b/arch/tile/kernel/pci.c
@@ -141,7 +141,7 @@ static int __devinit tile_init_irqs(int controller_id,
141 * 141 *
142 * Returns the number of controllers discovered. 142 * Returns the number of controllers discovered.
143 */ 143 */
144int __devinit tile_pci_init(void) 144int __init tile_pci_init(void)
145{ 145{
146 int i; 146 int i;
147 147
@@ -287,7 +287,7 @@ static void __devinit fixup_read_and_payload_sizes(void)
287 * The controllers have been set up by the time we get here, by a call to 287 * The controllers have been set up by the time we get here, by a call to
288 * tile_pci_init. 288 * tile_pci_init.
289 */ 289 */
290int __devinit pcibios_init(void) 290int __init pcibios_init(void)
291{ 291{
292 int i; 292 int i;
293 293
diff --git a/arch/tile/kernel/single_step.c b/arch/tile/kernel/single_step.c
index 9efbc1391b3c..89529c9f0605 100644
--- a/arch/tile/kernel/single_step.c
+++ b/arch/tile/kernel/single_step.c
@@ -346,12 +346,10 @@ void single_step_once(struct pt_regs *regs)
346 } 346 }
347 347
348 /* allocate a cache line of writable, executable memory */ 348 /* allocate a cache line of writable, executable memory */
349 down_write(&current->mm->mmap_sem); 349 buffer = (void __user *) vm_mmap(NULL, 0, 64,
350 buffer = (void __user *) do_mmap(NULL, 0, 64,
351 PROT_EXEC | PROT_READ | PROT_WRITE, 350 PROT_EXEC | PROT_READ | PROT_WRITE,
352 MAP_PRIVATE | MAP_ANONYMOUS, 351 MAP_PRIVATE | MAP_ANONYMOUS,
353 0); 352 0);
354 up_write(&current->mm->mmap_sem);
355 353
356 if (IS_ERR((void __force *)buffer)) { 354 if (IS_ERR((void __force *)buffer)) {
357 kfree(state); 355 kfree(state);
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 1d14cc6b79ad..c9866b0b77d8 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -81,7 +81,7 @@ config X86
81 select CLKEVT_I8253 81 select CLKEVT_I8253
82 select ARCH_HAVE_NMI_SAFE_CMPXCHG 82 select ARCH_HAVE_NMI_SAFE_CMPXCHG
83 select GENERIC_IOMAP 83 select GENERIC_IOMAP
84 select DCACHE_WORD_ACCESS if !DEBUG_PAGEALLOC 84 select DCACHE_WORD_ACCESS
85 85
86config INSTRUCTION_DECODER 86config INSTRUCTION_DECODER
87 def_bool (KPROBES || PERF_EVENTS) 87 def_bool (KPROBES || PERF_EVENTS)
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S
index a0559930a180..c85e3ac99bba 100644
--- a/arch/x86/boot/compressed/head_32.S
+++ b/arch/x86/boot/compressed/head_32.S
@@ -33,6 +33,9 @@
33 __HEAD 33 __HEAD
34ENTRY(startup_32) 34ENTRY(startup_32)
35#ifdef CONFIG_EFI_STUB 35#ifdef CONFIG_EFI_STUB
36 jmp preferred_addr
37
38 .balign 0x10
36 /* 39 /*
37 * We don't need the return address, so set up the stack so 40 * We don't need the return address, so set up the stack so
38 * efi_main() can find its arugments. 41 * efi_main() can find its arugments.
@@ -41,12 +44,17 @@ ENTRY(startup_32)
41 44
42 call efi_main 45 call efi_main
43 cmpl $0, %eax 46 cmpl $0, %eax
44 je preferred_addr
45 movl %eax, %esi 47 movl %eax, %esi
46 call 1f 48 jne 2f
471: 491:
50 /* EFI init failed, so hang. */
51 hlt
52 jmp 1b
532:
54 call 3f
553:
48 popl %eax 56 popl %eax
49 subl $1b, %eax 57 subl $3b, %eax
50 subl BP_pref_address(%esi), %eax 58 subl BP_pref_address(%esi), %eax
51 add BP_code32_start(%esi), %eax 59 add BP_code32_start(%esi), %eax
52 leal preferred_addr(%eax), %eax 60 leal preferred_addr(%eax), %eax
diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
index 558d76ce23bc..87e03a13d8e3 100644
--- a/arch/x86/boot/compressed/head_64.S
+++ b/arch/x86/boot/compressed/head_64.S
@@ -200,18 +200,28 @@ ENTRY(startup_64)
200 * entire text+data+bss and hopefully all of memory. 200 * entire text+data+bss and hopefully all of memory.
201 */ 201 */
202#ifdef CONFIG_EFI_STUB 202#ifdef CONFIG_EFI_STUB
203 pushq %rsi 203 /*
204 * The entry point for the PE/COFF executable is 0x210, so only
205 * legacy boot loaders will execute this jmp.
206 */
207 jmp preferred_addr
208
209 .org 0x210
204 mov %rcx, %rdi 210 mov %rcx, %rdi
205 mov %rdx, %rsi 211 mov %rdx, %rsi
206 call efi_main 212 call efi_main
207 popq %rsi
208 cmpq $0,%rax
209 je preferred_addr
210 movq %rax,%rsi 213 movq %rax,%rsi
211 call 1f 214 cmpq $0,%rax
215 jne 2f
2121: 2161:
217 /* EFI init failed, so hang. */
218 hlt
219 jmp 1b
2202:
221 call 3f
2223:
213 popq %rax 223 popq %rax
214 subq $1b, %rax 224 subq $3b, %rax
215 subq BP_pref_address(%rsi), %rax 225 subq BP_pref_address(%rsi), %rax
216 add BP_code32_start(%esi), %eax 226 add BP_code32_start(%esi), %eax
217 leaq preferred_addr(%rax), %rax 227 leaq preferred_addr(%rax), %rax
diff --git a/arch/x86/boot/compressed/relocs.c b/arch/x86/boot/compressed/relocs.c
index d3c0b0277666..fb7117a4ade1 100644
--- a/arch/x86/boot/compressed/relocs.c
+++ b/arch/x86/boot/compressed/relocs.c
@@ -403,13 +403,11 @@ static void print_absolute_symbols(void)
403 for (i = 0; i < ehdr.e_shnum; i++) { 403 for (i = 0; i < ehdr.e_shnum; i++) {
404 struct section *sec = &secs[i]; 404 struct section *sec = &secs[i];
405 char *sym_strtab; 405 char *sym_strtab;
406 Elf32_Sym *sh_symtab;
407 int j; 406 int j;
408 407
409 if (sec->shdr.sh_type != SHT_SYMTAB) { 408 if (sec->shdr.sh_type != SHT_SYMTAB) {
410 continue; 409 continue;
411 } 410 }
412 sh_symtab = sec->symtab;
413 sym_strtab = sec->link->strtab; 411 sym_strtab = sec->link->strtab;
414 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf32_Sym); j++) { 412 for (j = 0; j < sec->shdr.sh_size/sizeof(Elf32_Sym); j++) {
415 Elf32_Sym *sym; 413 Elf32_Sym *sym;
diff --git a/arch/x86/boot/tools/build.c b/arch/x86/boot/tools/build.c
index ed549767a231..24443a332083 100644
--- a/arch/x86/boot/tools/build.c
+++ b/arch/x86/boot/tools/build.c
@@ -205,8 +205,13 @@ int main(int argc, char ** argv)
205 put_unaligned_le32(file_sz, &buf[pe_header + 0x50]); 205 put_unaligned_le32(file_sz, &buf[pe_header + 0x50]);
206 206
207#ifdef CONFIG_X86_32 207#ifdef CONFIG_X86_32
208 /* Address of entry point */ 208 /*
209 put_unaligned_le32(i, &buf[pe_header + 0x28]); 209 * Address of entry point.
210 *
211 * The EFI stub entry point is +16 bytes from the start of
212 * the .text section.
213 */
214 put_unaligned_le32(i + 16, &buf[pe_header + 0x28]);
210 215
211 /* .text size */ 216 /* .text size */
212 put_unaligned_le32(file_sz, &buf[pe_header + 0xb0]); 217 put_unaligned_le32(file_sz, &buf[pe_header + 0xb0]);
@@ -217,9 +222,11 @@ int main(int argc, char ** argv)
217 /* 222 /*
218 * Address of entry point. startup_32 is at the beginning and 223 * Address of entry point. startup_32 is at the beginning and
219 * the 64-bit entry point (startup_64) is always 512 bytes 224 * the 64-bit entry point (startup_64) is always 512 bytes
220 * after. 225 * after. The EFI stub entry point is 16 bytes after that, as
226 * the first instruction allows legacy loaders to jump over
227 * the EFI stub initialisation
221 */ 228 */
222 put_unaligned_le32(i + 512, &buf[pe_header + 0x28]); 229 put_unaligned_le32(i + 528, &buf[pe_header + 0x28]);
223 230
224 /* .text size */ 231 /* .text size */
225 put_unaligned_le32(file_sz, &buf[pe_header + 0xc0]); 232 put_unaligned_le32(file_sz, &buf[pe_header + 0xc0]);
diff --git a/arch/x86/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c
index d511d951a052..07b3a68d2d29 100644
--- a/arch/x86/ia32/ia32_aout.c
+++ b/arch/x86/ia32/ia32_aout.c
@@ -119,9 +119,7 @@ static void set_brk(unsigned long start, unsigned long end)
119 end = PAGE_ALIGN(end); 119 end = PAGE_ALIGN(end);
120 if (end <= start) 120 if (end <= start)
121 return; 121 return;
122 down_write(&current->mm->mmap_sem); 122 vm_brk(start, end - start);
123 do_brk(start, end - start);
124 up_write(&current->mm->mmap_sem);
125} 123}
126 124
127#ifdef CORE_DUMP 125#ifdef CORE_DUMP
@@ -296,8 +294,7 @@ static int load_aout_binary(struct linux_binprm *bprm, struct pt_regs *regs)
296 294
297 /* OK, This is the point of no return */ 295 /* OK, This is the point of no return */
298 set_personality(PER_LINUX); 296 set_personality(PER_LINUX);
299 set_thread_flag(TIF_IA32); 297 set_personality_ia32(false);
300 current->mm->context.ia32_compat = 1;
301 298
302 setup_new_exec(bprm); 299 setup_new_exec(bprm);
303 300
@@ -332,9 +329,7 @@ static int load_aout_binary(struct linux_binprm *bprm, struct pt_regs *regs)
332 pos = 32; 329 pos = 32;
333 map_size = ex.a_text+ex.a_data; 330 map_size = ex.a_text+ex.a_data;
334 331
335 down_write(&current->mm->mmap_sem); 332 error = vm_brk(text_addr & PAGE_MASK, map_size);
336 error = do_brk(text_addr & PAGE_MASK, map_size);
337 up_write(&current->mm->mmap_sem);
338 333
339 if (error != (text_addr & PAGE_MASK)) { 334 if (error != (text_addr & PAGE_MASK)) {
340 send_sig(SIGKILL, current, 0); 335 send_sig(SIGKILL, current, 0);
@@ -373,9 +368,7 @@ static int load_aout_binary(struct linux_binprm *bprm, struct pt_regs *regs)
373 if (!bprm->file->f_op->mmap || (fd_offset & ~PAGE_MASK) != 0) { 368 if (!bprm->file->f_op->mmap || (fd_offset & ~PAGE_MASK) != 0) {
374 loff_t pos = fd_offset; 369 loff_t pos = fd_offset;
375 370
376 down_write(&current->mm->mmap_sem); 371 vm_brk(N_TXTADDR(ex), ex.a_text+ex.a_data);
377 do_brk(N_TXTADDR(ex), ex.a_text+ex.a_data);
378 up_write(&current->mm->mmap_sem);
379 bprm->file->f_op->read(bprm->file, 372 bprm->file->f_op->read(bprm->file,
380 (char __user *)N_TXTADDR(ex), 373 (char __user *)N_TXTADDR(ex),
381 ex.a_text+ex.a_data, &pos); 374 ex.a_text+ex.a_data, &pos);
@@ -385,26 +378,22 @@ static int load_aout_binary(struct linux_binprm *bprm, struct pt_regs *regs)
385 goto beyond_if; 378 goto beyond_if;
386 } 379 }
387 380
388 down_write(&current->mm->mmap_sem); 381 error = vm_mmap(bprm->file, N_TXTADDR(ex), ex.a_text,
389 error = do_mmap(bprm->file, N_TXTADDR(ex), ex.a_text,
390 PROT_READ | PROT_EXEC, 382 PROT_READ | PROT_EXEC,
391 MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | 383 MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE |
392 MAP_EXECUTABLE | MAP_32BIT, 384 MAP_EXECUTABLE | MAP_32BIT,
393 fd_offset); 385 fd_offset);
394 up_write(&current->mm->mmap_sem);
395 386
396 if (error != N_TXTADDR(ex)) { 387 if (error != N_TXTADDR(ex)) {
397 send_sig(SIGKILL, current, 0); 388 send_sig(SIGKILL, current, 0);
398 return error; 389 return error;
399 } 390 }
400 391
401 down_write(&current->mm->mmap_sem); 392 error = vm_mmap(bprm->file, N_DATADDR(ex), ex.a_data,
402 error = do_mmap(bprm->file, N_DATADDR(ex), ex.a_data,
403 PROT_READ | PROT_WRITE | PROT_EXEC, 393 PROT_READ | PROT_WRITE | PROT_EXEC,
404 MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | 394 MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE |
405 MAP_EXECUTABLE | MAP_32BIT, 395 MAP_EXECUTABLE | MAP_32BIT,
406 fd_offset + ex.a_text); 396 fd_offset + ex.a_text);
407 up_write(&current->mm->mmap_sem);
408 if (error != N_DATADDR(ex)) { 397 if (error != N_DATADDR(ex)) {
409 send_sig(SIGKILL, current, 0); 398 send_sig(SIGKILL, current, 0);
410 return error; 399 return error;
@@ -476,9 +465,7 @@ static int load_aout_library(struct file *file)
476 error_time = jiffies; 465 error_time = jiffies;
477 } 466 }
478#endif 467#endif
479 down_write(&current->mm->mmap_sem); 468 vm_brk(start_addr, ex.a_text + ex.a_data + ex.a_bss);
480 do_brk(start_addr, ex.a_text + ex.a_data + ex.a_bss);
481 up_write(&current->mm->mmap_sem);
482 469
483 file->f_op->read(file, (char __user *)start_addr, 470 file->f_op->read(file, (char __user *)start_addr,
484 ex.a_text + ex.a_data, &pos); 471 ex.a_text + ex.a_data, &pos);
@@ -490,12 +477,10 @@ static int load_aout_library(struct file *file)
490 goto out; 477 goto out;
491 } 478 }
492 /* Now use mmap to map the library into memory. */ 479 /* Now use mmap to map the library into memory. */
493 down_write(&current->mm->mmap_sem); 480 error = vm_mmap(file, start_addr, ex.a_text + ex.a_data,
494 error = do_mmap(file, start_addr, ex.a_text + ex.a_data,
495 PROT_READ | PROT_WRITE | PROT_EXEC, 481 PROT_READ | PROT_WRITE | PROT_EXEC,
496 MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_32BIT, 482 MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_32BIT,
497 N_TXTOFF(ex)); 483 N_TXTOFF(ex));
498 up_write(&current->mm->mmap_sem);
499 retval = error; 484 retval = error;
500 if (error != start_addr) 485 if (error != start_addr)
501 goto out; 486 goto out;
@@ -503,9 +488,7 @@ static int load_aout_library(struct file *file)
503 len = PAGE_ALIGN(ex.a_text + ex.a_data); 488 len = PAGE_ALIGN(ex.a_text + ex.a_data);
504 bss = ex.a_text + ex.a_data + ex.a_bss; 489 bss = ex.a_text + ex.a_data + ex.a_bss;
505 if (bss > len) { 490 if (bss > len) {
506 down_write(&current->mm->mmap_sem); 491 error = vm_brk(start_addr + len, bss - len);
507 error = do_brk(start_addr + len, bss - len);
508 up_write(&current->mm->mmap_sem);
509 retval = error; 492 retval = error;
510 if (error != start_addr + len) 493 if (error != start_addr + len)
511 goto out; 494 goto out;
diff --git a/arch/x86/include/asm/posix_types.h b/arch/x86/include/asm/posix_types.h
index 3427b7798dbc..7ef7c3020e5c 100644
--- a/arch/x86/include/asm/posix_types.h
+++ b/arch/x86/include/asm/posix_types.h
@@ -7,9 +7,9 @@
7#else 7#else
8# ifdef __i386__ 8# ifdef __i386__
9# include "posix_types_32.h" 9# include "posix_types_32.h"
10# elif defined(__LP64__) 10# elif defined(__ILP32__)
11# include "posix_types_64.h"
12# else
13# include "posix_types_x32.h" 11# include "posix_types_x32.h"
12# else
13# include "posix_types_64.h"
14# endif 14# endif
15#endif 15#endif
diff --git a/arch/x86/include/asm/sigcontext.h b/arch/x86/include/asm/sigcontext.h
index 4a085383af27..5ca71c065eef 100644
--- a/arch/x86/include/asm/sigcontext.h
+++ b/arch/x86/include/asm/sigcontext.h
@@ -257,7 +257,7 @@ struct sigcontext {
257 __u64 oldmask; 257 __u64 oldmask;
258 __u64 cr2; 258 __u64 cr2;
259 struct _fpstate __user *fpstate; /* zero when no FPU context */ 259 struct _fpstate __user *fpstate; /* zero when no FPU context */
260#ifndef __LP64__ 260#ifdef __ILP32__
261 __u32 __fpstate_pad; 261 __u32 __fpstate_pad;
262#endif 262#endif
263 __u64 reserved1[8]; 263 __u64 reserved1[8];
diff --git a/arch/x86/include/asm/siginfo.h b/arch/x86/include/asm/siginfo.h
index fc1aa5535646..34c47b3341c0 100644
--- a/arch/x86/include/asm/siginfo.h
+++ b/arch/x86/include/asm/siginfo.h
@@ -2,7 +2,13 @@
2#define _ASM_X86_SIGINFO_H 2#define _ASM_X86_SIGINFO_H
3 3
4#ifdef __x86_64__ 4#ifdef __x86_64__
5# define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) 5# ifdef __ILP32__ /* x32 */
6typedef long long __kernel_si_clock_t __attribute__((aligned(4)));
7# define __ARCH_SI_CLOCK_T __kernel_si_clock_t
8# define __ARCH_SI_ATTRIBUTES __attribute__((aligned(8)))
9# else /* x86-64 */
10# define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
11# endif
6#endif 12#endif
7 13
8#include <asm-generic/siginfo.h> 14#include <asm-generic/siginfo.h>
diff --git a/arch/x86/include/asm/unistd.h b/arch/x86/include/asm/unistd.h
index 37cdc9d99bb1..4437001d8e3d 100644
--- a/arch/x86/include/asm/unistd.h
+++ b/arch/x86/include/asm/unistd.h
@@ -63,10 +63,10 @@
63#else 63#else
64# ifdef __i386__ 64# ifdef __i386__
65# include <asm/unistd_32.h> 65# include <asm/unistd_32.h>
66# elif defined(__LP64__) 66# elif defined(__ILP32__)
67# include <asm/unistd_64.h>
68# else
69# include <asm/unistd_x32.h> 67# include <asm/unistd_x32.h>
68# else
69# include <asm/unistd_64.h>
70# endif 70# endif
71#endif 71#endif
72 72
diff --git a/arch/x86/include/asm/word-at-a-time.h b/arch/x86/include/asm/word-at-a-time.h
index 6fe6767b7124..e58f03b206c3 100644
--- a/arch/x86/include/asm/word-at-a-time.h
+++ b/arch/x86/include/asm/word-at-a-time.h
@@ -43,4 +43,37 @@ static inline unsigned long has_zero(unsigned long a)
43 return ((a - REPEAT_BYTE(0x01)) & ~a) & REPEAT_BYTE(0x80); 43 return ((a - REPEAT_BYTE(0x01)) & ~a) & REPEAT_BYTE(0x80);
44} 44}
45 45
46/*
47 * Load an unaligned word from kernel space.
48 *
49 * In the (very unlikely) case of the word being a page-crosser
50 * and the next page not being mapped, take the exception and
51 * return zeroes in the non-existing part.
52 */
53static inline unsigned long load_unaligned_zeropad(const void *addr)
54{
55 unsigned long ret, dummy;
56
57 asm(
58 "1:\tmov %2,%0\n"
59 "2:\n"
60 ".section .fixup,\"ax\"\n"
61 "3:\t"
62 "lea %2,%1\n\t"
63 "and %3,%1\n\t"
64 "mov (%1),%0\n\t"
65 "leal %2,%%ecx\n\t"
66 "andl %4,%%ecx\n\t"
67 "shll $3,%%ecx\n\t"
68 "shr %%cl,%0\n\t"
69 "jmp 2b\n"
70 ".previous\n"
71 _ASM_EXTABLE(1b, 3b)
72 :"=&r" (ret),"=&c" (dummy)
73 :"m" (*(unsigned long *)addr),
74 "i" (-sizeof(unsigned long)),
75 "i" (sizeof(unsigned long)-1));
76 return ret;
77}
78
46#endif /* _ASM_WORD_AT_A_TIME_H */ 79#endif /* _ASM_WORD_AT_A_TIME_H */
diff --git a/arch/x86/include/asm/x86_init.h b/arch/x86/include/asm/x86_init.h
index baaca8defec8..764b66a4cf89 100644
--- a/arch/x86/include/asm/x86_init.h
+++ b/arch/x86/include/asm/x86_init.h
@@ -195,6 +195,5 @@ extern struct x86_msi_ops x86_msi;
195 195
196extern void x86_init_noop(void); 196extern void x86_init_noop(void);
197extern void x86_init_uint_noop(unsigned int unused); 197extern void x86_init_uint_noop(unsigned int unused);
198extern void x86_default_fixup_cpu_id(struct cpuinfo_x86 *c, int node);
199 198
200#endif 199#endif
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c
index 103b6ab368d3..146a49c763a4 100644
--- a/arch/x86/kernel/acpi/sleep.c
+++ b/arch/x86/kernel/acpi/sleep.c
@@ -24,6 +24,10 @@ unsigned long acpi_realmode_flags;
24static char temp_stack[4096]; 24static char temp_stack[4096];
25#endif 25#endif
26 26
27asmlinkage void acpi_enter_s3(void)
28{
29 acpi_enter_sleep_state(3, wake_sleep_flags);
30}
27/** 31/**
28 * acpi_suspend_lowlevel - save kernel state 32 * acpi_suspend_lowlevel - save kernel state
29 * 33 *
diff --git a/arch/x86/kernel/acpi/sleep.h b/arch/x86/kernel/acpi/sleep.h
index 416d4be13fef..d68677a2a010 100644
--- a/arch/x86/kernel/acpi/sleep.h
+++ b/arch/x86/kernel/acpi/sleep.h
@@ -3,12 +3,16 @@
3 */ 3 */
4 4
5#include <asm/trampoline.h> 5#include <asm/trampoline.h>
6#include <linux/linkage.h>
6 7
7extern unsigned long saved_video_mode; 8extern unsigned long saved_video_mode;
8extern long saved_magic; 9extern long saved_magic;
9 10
10extern int wakeup_pmode_return; 11extern int wakeup_pmode_return;
11 12
13extern u8 wake_sleep_flags;
14extern asmlinkage void acpi_enter_s3(void);
15
12extern unsigned long acpi_copy_wakeup_routine(unsigned long); 16extern unsigned long acpi_copy_wakeup_routine(unsigned long);
13extern void wakeup_long64(void); 17extern void wakeup_long64(void);
14 18
diff --git a/arch/x86/kernel/acpi/wakeup_32.S b/arch/x86/kernel/acpi/wakeup_32.S
index 13ab720573e3..72610839f03b 100644
--- a/arch/x86/kernel/acpi/wakeup_32.S
+++ b/arch/x86/kernel/acpi/wakeup_32.S
@@ -74,9 +74,7 @@ restore_registers:
74ENTRY(do_suspend_lowlevel) 74ENTRY(do_suspend_lowlevel)
75 call save_processor_state 75 call save_processor_state
76 call save_registers 76 call save_registers
77 pushl $3 77 call acpi_enter_s3
78 call acpi_enter_sleep_state
79 addl $4, %esp
80 78
81# In case of S3 failure, we'll emerge here. Jump 79# In case of S3 failure, we'll emerge here. Jump
82# to ret_point to recover 80# to ret_point to recover
diff --git a/arch/x86/kernel/acpi/wakeup_64.S b/arch/x86/kernel/acpi/wakeup_64.S
index 8ea5164cbd04..014d1d28c397 100644
--- a/arch/x86/kernel/acpi/wakeup_64.S
+++ b/arch/x86/kernel/acpi/wakeup_64.S
@@ -71,9 +71,7 @@ ENTRY(do_suspend_lowlevel)
71 movq %rsi, saved_rsi 71 movq %rsi, saved_rsi
72 72
73 addq $8, %rsp 73 addq $8, %rsp
74 movl $3, %edi 74 call acpi_enter_s3
75 xorl %eax, %eax
76 call acpi_enter_sleep_state
77 /* in case something went wrong, restore the machine status and go on */ 75 /* in case something went wrong, restore the machine status and go on */
78 jmp resume_point 76 jmp resume_point
79 77
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 11544d8f1e97..edc24480469f 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -1637,9 +1637,11 @@ static int __init apic_verify(void)
1637 mp_lapic_addr = APIC_DEFAULT_PHYS_BASE; 1637 mp_lapic_addr = APIC_DEFAULT_PHYS_BASE;
1638 1638
1639 /* The BIOS may have set up the APIC at some other address */ 1639 /* The BIOS may have set up the APIC at some other address */
1640 rdmsr(MSR_IA32_APICBASE, l, h); 1640 if (boot_cpu_data.x86 >= 6) {
1641 if (l & MSR_IA32_APICBASE_ENABLE) 1641 rdmsr(MSR_IA32_APICBASE, l, h);
1642 mp_lapic_addr = l & MSR_IA32_APICBASE_BASE; 1642 if (l & MSR_IA32_APICBASE_ENABLE)
1643 mp_lapic_addr = l & MSR_IA32_APICBASE_BASE;
1644 }
1643 1645
1644 pr_info("Found and enabled local APIC!\n"); 1646 pr_info("Found and enabled local APIC!\n");
1645 return 0; 1647 return 0;
@@ -1657,13 +1659,15 @@ int __init apic_force_enable(unsigned long addr)
1657 * MSR. This can only be done in software for Intel P6 or later 1659 * MSR. This can only be done in software for Intel P6 or later
1658 * and AMD K7 (Model > 1) or later. 1660 * and AMD K7 (Model > 1) or later.
1659 */ 1661 */
1660 rdmsr(MSR_IA32_APICBASE, l, h); 1662 if (boot_cpu_data.x86 >= 6) {
1661 if (!(l & MSR_IA32_APICBASE_ENABLE)) { 1663 rdmsr(MSR_IA32_APICBASE, l, h);
1662 pr_info("Local APIC disabled by BIOS -- reenabling.\n"); 1664 if (!(l & MSR_IA32_APICBASE_ENABLE)) {
1663 l &= ~MSR_IA32_APICBASE_BASE; 1665 pr_info("Local APIC disabled by BIOS -- reenabling.\n");
1664 l |= MSR_IA32_APICBASE_ENABLE | addr; 1666 l &= ~MSR_IA32_APICBASE_BASE;
1665 wrmsr(MSR_IA32_APICBASE, l, h); 1667 l |= MSR_IA32_APICBASE_ENABLE | addr;
1666 enabled_via_apicbase = 1; 1668 wrmsr(MSR_IA32_APICBASE, l, h);
1669 enabled_via_apicbase = 1;
1670 }
1667 } 1671 }
1668 return apic_verify(); 1672 return apic_verify();
1669} 1673}
@@ -2209,10 +2213,12 @@ static void lapic_resume(void)
2209 * FIXME! This will be wrong if we ever support suspend on 2213 * FIXME! This will be wrong if we ever support suspend on
2210 * SMP! We'll need to do this as part of the CPU restore! 2214 * SMP! We'll need to do this as part of the CPU restore!
2211 */ 2215 */
2212 rdmsr(MSR_IA32_APICBASE, l, h); 2216 if (boot_cpu_data.x86 >= 6) {
2213 l &= ~MSR_IA32_APICBASE_BASE; 2217 rdmsr(MSR_IA32_APICBASE, l, h);
2214 l |= MSR_IA32_APICBASE_ENABLE | mp_lapic_addr; 2218 l &= ~MSR_IA32_APICBASE_BASE;
2215 wrmsr(MSR_IA32_APICBASE, l, h); 2219 l |= MSR_IA32_APICBASE_ENABLE | mp_lapic_addr;
2220 wrmsr(MSR_IA32_APICBASE, l, h);
2221 }
2216 } 2222 }
2217 2223
2218 maxlvt = lapic_get_maxlvt(); 2224 maxlvt = lapic_get_maxlvt();
diff --git a/arch/x86/kernel/apic/apic_numachip.c b/arch/x86/kernel/apic/apic_numachip.c
index 899803e03214..23e75422e013 100644
--- a/arch/x86/kernel/apic/apic_numachip.c
+++ b/arch/x86/kernel/apic/apic_numachip.c
@@ -207,8 +207,11 @@ static void __init map_csrs(void)
207 207
208static void fixup_cpu_id(struct cpuinfo_x86 *c, int node) 208static void fixup_cpu_id(struct cpuinfo_x86 *c, int node)
209{ 209{
210 c->phys_proc_id = node; 210
211 per_cpu(cpu_llc_id, smp_processor_id()) = node; 211 if (c->phys_proc_id != node) {
212 c->phys_proc_id = node;
213 per_cpu(cpu_llc_id, smp_processor_id()) = node;
214 }
212} 215}
213 216
214static int __init numachip_system_init(void) 217static int __init numachip_system_init(void)
diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c
index 8a778db45e3a..991e315f4227 100644
--- a/arch/x86/kernel/apic/x2apic_phys.c
+++ b/arch/x86/kernel/apic/x2apic_phys.c
@@ -24,6 +24,12 @@ static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id)
24{ 24{
25 if (x2apic_phys) 25 if (x2apic_phys)
26 return x2apic_enabled(); 26 return x2apic_enabled();
27 else if ((acpi_gbl_FADT.header.revision >= FADT2_REVISION_ID) &&
28 (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL) &&
29 x2apic_enabled()) {
30 printk(KERN_DEBUG "System requires x2apic physical mode\n");
31 return 1;
32 }
27 else 33 else
28 return 0; 34 return 0;
29} 35}
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
index 0a44b90602b0..146bb6218eec 100644
--- a/arch/x86/kernel/cpu/amd.c
+++ b/arch/x86/kernel/cpu/amd.c
@@ -26,7 +26,8 @@
26 * contact AMD for precise details and a CPU swap. 26 * contact AMD for precise details and a CPU swap.
27 * 27 *
28 * See http://www.multimania.com/poulot/k6bug.html 28 * See http://www.multimania.com/poulot/k6bug.html
29 * http://www.amd.com/K6/k6docs/revgd.html 29 * and section 2.6.2 of "AMD-K6 Processor Revision Guide - Model 6"
30 * (Publication # 21266 Issue Date: August 1998)
30 * 31 *
31 * The following test is erm.. interesting. AMD neglected to up 32 * The following test is erm.. interesting. AMD neglected to up
32 * the chip setting when fixing the bug but they also tweaked some 33 * the chip setting when fixing the bug but they also tweaked some
@@ -94,7 +95,6 @@ static void __cpuinit init_amd_k6(struct cpuinfo_x86 *c)
94 "system stability may be impaired when more than 32 MB are used.\n"); 95 "system stability may be impaired when more than 32 MB are used.\n");
95 else 96 else
96 printk(KERN_CONT "probably OK (after B9730xxxx).\n"); 97 printk(KERN_CONT "probably OK (after B9730xxxx).\n");
97 printk(KERN_INFO "Please see http://membres.lycos.fr/poulot/k6bug.html\n");
98 } 98 }
99 99
100 /* K6 with old style WHCR */ 100 /* K6 with old style WHCR */
@@ -353,10 +353,11 @@ static void __cpuinit srat_detect_node(struct cpuinfo_x86 *c)
353 node = per_cpu(cpu_llc_id, cpu); 353 node = per_cpu(cpu_llc_id, cpu);
354 354
355 /* 355 /*
356 * If core numbers are inconsistent, it's likely a multi-fabric platform, 356 * On multi-fabric platform (e.g. Numascale NumaChip) a
357 * so invoke platform-specific handler 357 * platform-specific handler needs to be called to fixup some
358 * IDs of the CPU.
358 */ 359 */
359 if (c->phys_proc_id != node) 360 if (x86_cpuinit.fixup_cpu_id)
360 x86_cpuinit.fixup_cpu_id(c, node); 361 x86_cpuinit.fixup_cpu_id(c, node);
361 362
362 if (!node_online(node)) { 363 if (!node_online(node)) {
@@ -579,6 +580,24 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)
579 } 580 }
580 } 581 }
581 582
583 /* re-enable TopologyExtensions if switched off by BIOS */
584 if ((c->x86 == 0x15) &&
585 (c->x86_model >= 0x10) && (c->x86_model <= 0x1f) &&
586 !cpu_has(c, X86_FEATURE_TOPOEXT)) {
587 u64 val;
588
589 if (!rdmsrl_amd_safe(0xc0011005, &val)) {
590 val |= 1ULL << 54;
591 wrmsrl_amd_safe(0xc0011005, val);
592 rdmsrl(0xc0011005, val);
593 if (val & (1ULL << 54)) {
594 set_cpu_cap(c, X86_FEATURE_TOPOEXT);
595 printk(KERN_INFO FW_INFO "CPU: Re-enabling "
596 "disabled Topology Extensions Support\n");
597 }
598 }
599 }
600
582 cpu_detect_cache_sizes(c); 601 cpu_detect_cache_sizes(c);
583 602
584 /* Multi core CPU? */ 603 /* Multi core CPU? */
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 67e258362a3d..cf79302198a6 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1163,15 +1163,6 @@ static void dbg_restore_debug_regs(void)
1163#endif /* ! CONFIG_KGDB */ 1163#endif /* ! CONFIG_KGDB */
1164 1164
1165/* 1165/*
1166 * Prints an error where the NUMA and configured core-number mismatch and the
1167 * platform didn't override this to fix it up
1168 */
1169void __cpuinit x86_default_fixup_cpu_id(struct cpuinfo_x86 *c, int node)
1170{
1171 pr_err("NUMA core number %d differs from configured core number %d\n", node, c->phys_proc_id);
1172}
1173
1174/*
1175 * cpu_init() initializes state that is per-CPU. Some data is already 1166 * cpu_init() initializes state that is per-CPU. Some data is already
1176 * initialized (naturally) in the bootstrap process, such as the GDT 1167 * initialized (naturally) in the bootstrap process, such as the GDT
1177 * and IDT. We reload them nevertheless, this function acts as a 1168 * and IDT. We reload them nevertheless, this function acts as a
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index 73d08ed98a64..b8f3653dddbc 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -433,14 +433,14 @@ int amd_set_l3_disable_slot(struct amd_northbridge *nb, int cpu, unsigned slot,
433 /* check if @slot is already used or the index is already disabled */ 433 /* check if @slot is already used or the index is already disabled */
434 ret = amd_get_l3_disable_slot(nb, slot); 434 ret = amd_get_l3_disable_slot(nb, slot);
435 if (ret >= 0) 435 if (ret >= 0)
436 return -EINVAL; 436 return -EEXIST;
437 437
438 if (index > nb->l3_cache.indices) 438 if (index > nb->l3_cache.indices)
439 return -EINVAL; 439 return -EINVAL;
440 440
441 /* check whether the other slot has disabled the same index already */ 441 /* check whether the other slot has disabled the same index already */
442 if (index == amd_get_l3_disable_slot(nb, !slot)) 442 if (index == amd_get_l3_disable_slot(nb, !slot))
443 return -EINVAL; 443 return -EEXIST;
444 444
445 amd_l3_disable_index(nb, cpu, slot, index); 445 amd_l3_disable_index(nb, cpu, slot, index);
446 446
@@ -468,8 +468,8 @@ static ssize_t store_cache_disable(struct _cpuid4_info *this_leaf,
468 err = amd_set_l3_disable_slot(this_leaf->base.nb, cpu, slot, val); 468 err = amd_set_l3_disable_slot(this_leaf->base.nb, cpu, slot, val);
469 if (err) { 469 if (err) {
470 if (err == -EEXIST) 470 if (err == -EEXIST)
471 printk(KERN_WARNING "L3 disable slot %d in use!\n", 471 pr_warning("L3 slot %d in use/index already disabled!\n",
472 slot); 472 slot);
473 return err; 473 return err;
474 } 474 }
475 return count; 475 return count;
diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
index 7734bcbb5a3a..2d6e6498c176 100644
--- a/arch/x86/kernel/i387.c
+++ b/arch/x86/kernel/i387.c
@@ -235,6 +235,7 @@ int init_fpu(struct task_struct *tsk)
235 if (tsk_used_math(tsk)) { 235 if (tsk_used_math(tsk)) {
236 if (HAVE_HWFP && tsk == current) 236 if (HAVE_HWFP && tsk == current)
237 unlazy_fpu(tsk); 237 unlazy_fpu(tsk);
238 tsk->thread.fpu.last_cpu = ~0;
238 return 0; 239 return 0;
239 } 240 }
240 241
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index b8ba6e4a27e4..e554e5ad2fe8 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -79,7 +79,6 @@ struct kvm_task_sleep_node {
79 u32 token; 79 u32 token;
80 int cpu; 80 int cpu;
81 bool halted; 81 bool halted;
82 struct mm_struct *mm;
83}; 82};
84 83
85static struct kvm_task_sleep_head { 84static struct kvm_task_sleep_head {
@@ -126,9 +125,7 @@ void kvm_async_pf_task_wait(u32 token)
126 125
127 n.token = token; 126 n.token = token;
128 n.cpu = smp_processor_id(); 127 n.cpu = smp_processor_id();
129 n.mm = current->active_mm;
130 n.halted = idle || preempt_count() > 1; 128 n.halted = idle || preempt_count() > 1;
131 atomic_inc(&n.mm->mm_count);
132 init_waitqueue_head(&n.wq); 129 init_waitqueue_head(&n.wq);
133 hlist_add_head(&n.link, &b->list); 130 hlist_add_head(&n.link, &b->list);
134 spin_unlock(&b->lock); 131 spin_unlock(&b->lock);
@@ -161,9 +158,6 @@ EXPORT_SYMBOL_GPL(kvm_async_pf_task_wait);
161static void apf_task_wake_one(struct kvm_task_sleep_node *n) 158static void apf_task_wake_one(struct kvm_task_sleep_node *n)
162{ 159{
163 hlist_del_init(&n->link); 160 hlist_del_init(&n->link);
164 if (!n->mm)
165 return;
166 mmdrop(n->mm);
167 if (n->halted) 161 if (n->halted)
168 smp_send_reschedule(n->cpu); 162 smp_send_reschedule(n->cpu);
169 else if (waitqueue_active(&n->wq)) 163 else if (waitqueue_active(&n->wq))
@@ -207,7 +201,7 @@ again:
207 * async PF was not yet handled. 201 * async PF was not yet handled.
208 * Add dummy entry for the token. 202 * Add dummy entry for the token.
209 */ 203 */
210 n = kmalloc(sizeof(*n), GFP_ATOMIC); 204 n = kzalloc(sizeof(*n), GFP_ATOMIC);
211 if (!n) { 205 if (!n) {
212 /* 206 /*
213 * Allocation failed! Busy wait while other cpu 207 * Allocation failed! Busy wait while other cpu
@@ -219,7 +213,6 @@ again:
219 } 213 }
220 n->token = token; 214 n->token = token;
221 n->cpu = smp_processor_id(); 215 n->cpu = smp_processor_id();
222 n->mm = NULL;
223 init_waitqueue_head(&n->wq); 216 init_waitqueue_head(&n->wq);
224 hlist_add_head(&n->link, &b->list); 217 hlist_add_head(&n->link, &b->list);
225 } else 218 } else
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
index 73465aab28f8..8a2ce8fd41c0 100644
--- a/arch/x86/kernel/microcode_amd.c
+++ b/arch/x86/kernel/microcode_amd.c
@@ -82,11 +82,6 @@ static int collect_cpu_info_amd(int cpu, struct cpu_signature *csig)
82{ 82{
83 struct cpuinfo_x86 *c = &cpu_data(cpu); 83 struct cpuinfo_x86 *c = &cpu_data(cpu);
84 84
85 if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) {
86 pr_warning("CPU%d: family %d not supported\n", cpu, c->x86);
87 return -1;
88 }
89
90 csig->rev = c->microcode; 85 csig->rev = c->microcode;
91 pr_info("CPU%d: patch_level=0x%08x\n", cpu, csig->rev); 86 pr_info("CPU%d: patch_level=0x%08x\n", cpu, csig->rev);
92 87
@@ -380,6 +375,13 @@ static struct microcode_ops microcode_amd_ops = {
380 375
381struct microcode_ops * __init init_amd_microcode(void) 376struct microcode_ops * __init init_amd_microcode(void)
382{ 377{
378 struct cpuinfo_x86 *c = &cpu_data(0);
379
380 if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) {
381 pr_warning("AMD CPU family 0x%x not supported\n", c->x86);
382 return NULL;
383 }
384
383 patch = (void *)get_zeroed_page(GFP_KERNEL); 385 patch = (void *)get_zeroed_page(GFP_KERNEL);
384 if (!patch) 386 if (!patch)
385 return NULL; 387 return NULL;
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
index 87a0f8688301..c9bda6d6035c 100644
--- a/arch/x86/kernel/microcode_core.c
+++ b/arch/x86/kernel/microcode_core.c
@@ -419,10 +419,8 @@ static int mc_device_add(struct device *dev, struct subsys_interface *sif)
419 if (err) 419 if (err)
420 return err; 420 return err;
421 421
422 if (microcode_init_cpu(cpu) == UCODE_ERROR) { 422 if (microcode_init_cpu(cpu) == UCODE_ERROR)
423 sysfs_remove_group(&dev->kobj, &mc_attr_group);
424 return -EINVAL; 423 return -EINVAL;
425 }
426 424
427 return err; 425 return err;
428} 426}
@@ -528,11 +526,11 @@ static int __init microcode_init(void)
528 microcode_ops = init_intel_microcode(); 526 microcode_ops = init_intel_microcode();
529 else if (c->x86_vendor == X86_VENDOR_AMD) 527 else if (c->x86_vendor == X86_VENDOR_AMD)
530 microcode_ops = init_amd_microcode(); 528 microcode_ops = init_amd_microcode();
531 529 else
532 if (!microcode_ops) {
533 pr_err("no support for this CPU vendor\n"); 530 pr_err("no support for this CPU vendor\n");
531
532 if (!microcode_ops)
534 return -ENODEV; 533 return -ENODEV;
535 }
536 534
537 microcode_pdev = platform_device_register_simple("microcode", -1, 535 microcode_pdev = platform_device_register_simple("microcode", -1,
538 NULL, 0); 536 NULL, 0);
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 733ca39f367e..43d8b48b23e6 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -423,6 +423,7 @@ void set_personality_ia32(bool x32)
423 current_thread_info()->status |= TS_COMPAT; 423 current_thread_info()->status |= TS_COMPAT;
424 } 424 }
425} 425}
426EXPORT_SYMBOL_GPL(set_personality_ia32);
426 427
427unsigned long get_wchan(struct task_struct *p) 428unsigned long get_wchan(struct task_struct *p)
428{ 429{
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 71f4727da373..5a98aa272184 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -185,10 +185,22 @@ void __init setup_per_cpu_areas(void)
185#endif 185#endif
186 rc = -EINVAL; 186 rc = -EINVAL;
187 if (pcpu_chosen_fc != PCPU_FC_PAGE) { 187 if (pcpu_chosen_fc != PCPU_FC_PAGE) {
188 const size_t atom_size = cpu_has_pse ? PMD_SIZE : PAGE_SIZE;
189 const size_t dyn_size = PERCPU_MODULE_RESERVE + 188 const size_t dyn_size = PERCPU_MODULE_RESERVE +
190 PERCPU_DYNAMIC_RESERVE - PERCPU_FIRST_CHUNK_RESERVE; 189 PERCPU_DYNAMIC_RESERVE - PERCPU_FIRST_CHUNK_RESERVE;
190 size_t atom_size;
191 191
192 /*
193 * On 64bit, use PMD_SIZE for atom_size so that embedded
194 * percpu areas are aligned to PMD. This, in the future,
195 * can also allow using PMD mappings in vmalloc area. Use
196 * PAGE_SIZE on 32bit as vmalloc space is highly contended
197 * and large vmalloc area allocs can easily fail.
198 */
199#ifdef CONFIG_X86_64
200 atom_size = PMD_SIZE;
201#else
202 atom_size = PAGE_SIZE;
203#endif
192 rc = pcpu_embed_first_chunk(PERCPU_FIRST_CHUNK_RESERVE, 204 rc = pcpu_embed_first_chunk(PERCPU_FIRST_CHUNK_RESERVE,
193 dyn_size, atom_size, 205 dyn_size, atom_size,
194 pcpu_cpu_distance, 206 pcpu_cpu_distance,
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index e9f265fd79ae..9cf71d0b2d37 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -93,7 +93,6 @@ struct x86_init_ops x86_init __initdata = {
93struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = { 93struct x86_cpuinit_ops x86_cpuinit __cpuinitdata = {
94 .early_percpu_clock_init = x86_init_noop, 94 .early_percpu_clock_init = x86_init_noop,
95 .setup_percpu_clockev = setup_secondary_APIC_clock, 95 .setup_percpu_clockev = setup_secondary_APIC_clock,
96 .fixup_cpu_id = x86_default_fixup_cpu_id,
97}; 96};
98 97
99static void default_nmi_init(void) { }; 98static void default_nmi_init(void) { };
diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c
index 173df38dbda5..2e88438ffd83 100644
--- a/arch/x86/kvm/pmu.c
+++ b/arch/x86/kvm/pmu.c
@@ -459,17 +459,17 @@ void kvm_pmu_cpuid_update(struct kvm_vcpu *vcpu)
459 pmu->available_event_types = ~entry->ebx & ((1ull << bitmap_len) - 1); 459 pmu->available_event_types = ~entry->ebx & ((1ull << bitmap_len) - 1);
460 460
461 if (pmu->version == 1) { 461 if (pmu->version == 1) {
462 pmu->global_ctrl = (1 << pmu->nr_arch_gp_counters) - 1; 462 pmu->nr_arch_fixed_counters = 0;
463 return; 463 } else {
464 pmu->nr_arch_fixed_counters = min((int)(entry->edx & 0x1f),
465 X86_PMC_MAX_FIXED);
466 pmu->counter_bitmask[KVM_PMC_FIXED] =
467 ((u64)1 << ((entry->edx >> 5) & 0xff)) - 1;
464 } 468 }
465 469
466 pmu->nr_arch_fixed_counters = min((int)(entry->edx & 0x1f), 470 pmu->global_ctrl = ((1 << pmu->nr_arch_gp_counters) - 1) |
467 X86_PMC_MAX_FIXED); 471 (((1ull << pmu->nr_arch_fixed_counters) - 1) << X86_PMC_IDX_FIXED);
468 pmu->counter_bitmask[KVM_PMC_FIXED] = 472 pmu->global_ctrl_mask = ~pmu->global_ctrl;
469 ((u64)1 << ((entry->edx >> 5) & 0xff)) - 1;
470 pmu->global_ctrl_mask = ~(((1 << pmu->nr_arch_gp_counters) - 1)
471 | (((1ull << pmu->nr_arch_fixed_counters) - 1)
472 << X86_PMC_IDX_FIXED));
473} 473}
474 474
475void kvm_pmu_init(struct kvm_vcpu *vcpu) 475void kvm_pmu_init(struct kvm_vcpu *vcpu)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index ad85adfef843..4ff0ab9bc3c8 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2210,9 +2210,12 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data)
2210 msr = find_msr_entry(vmx, msr_index); 2210 msr = find_msr_entry(vmx, msr_index);
2211 if (msr) { 2211 if (msr) {
2212 msr->data = data; 2212 msr->data = data;
2213 if (msr - vmx->guest_msrs < vmx->save_nmsrs) 2213 if (msr - vmx->guest_msrs < vmx->save_nmsrs) {
2214 preempt_disable();
2214 kvm_set_shared_msr(msr->index, msr->data, 2215 kvm_set_shared_msr(msr->index, msr->data,
2215 msr->mask); 2216 msr->mask);
2217 preempt_enable();
2218 }
2216 break; 2219 break;
2217 } 2220 }
2218 ret = kvm_set_msr_common(vcpu, msr_index, data); 2221 ret = kvm_set_msr_common(vcpu, msr_index, data);
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 4044ce0bf7c1..185a2b823a2d 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6336,13 +6336,11 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
6336 if (npages && !old.rmap) { 6336 if (npages && !old.rmap) {
6337 unsigned long userspace_addr; 6337 unsigned long userspace_addr;
6338 6338
6339 down_write(&current->mm->mmap_sem); 6339 userspace_addr = vm_mmap(NULL, 0,
6340 userspace_addr = do_mmap(NULL, 0,
6341 npages * PAGE_SIZE, 6340 npages * PAGE_SIZE,
6342 PROT_READ | PROT_WRITE, 6341 PROT_READ | PROT_WRITE,
6343 map_flags, 6342 map_flags,
6344 0); 6343 0);
6345 up_write(&current->mm->mmap_sem);
6346 6344
6347 if (IS_ERR((void *)userspace_addr)) 6345 if (IS_ERR((void *)userspace_addr))
6348 return PTR_ERR((void *)userspace_addr); 6346 return PTR_ERR((void *)userspace_addr);
@@ -6366,10 +6364,8 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
6366 if (!user_alloc && !old.user_alloc && old.rmap && !npages) { 6364 if (!user_alloc && !old.user_alloc && old.rmap && !npages) {
6367 int ret; 6365 int ret;
6368 6366
6369 down_write(&current->mm->mmap_sem); 6367 ret = vm_munmap(old.userspace_addr,
6370 ret = do_munmap(current->mm, old.userspace_addr,
6371 old.npages * PAGE_SIZE); 6368 old.npages * PAGE_SIZE);
6372 up_write(&current->mm->mmap_sem);
6373 if (ret < 0) 6369 if (ret < 0)
6374 printk(KERN_WARNING 6370 printk(KERN_WARNING
6375 "kvm_vm_ioctl_set_memory_region: " 6371 "kvm_vm_ioctl_set_memory_region: "
@@ -6585,6 +6581,7 @@ void kvm_arch_async_page_present(struct kvm_vcpu *vcpu,
6585 kvm_inject_page_fault(vcpu, &fault); 6581 kvm_inject_page_fault(vcpu, &fault);
6586 } 6582 }
6587 vcpu->arch.apf.halted = false; 6583 vcpu->arch.apf.halted = false;
6584 vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
6588} 6585}
6589 6586
6590bool kvm_arch_can_inject_async_page_present(struct kvm_vcpu *vcpu) 6587bool kvm_arch_can_inject_async_page_present(struct kvm_vcpu *vcpu)
diff --git a/arch/x86/platform/geode/net5501.c b/arch/x86/platform/geode/net5501.c
index 66d377e334f7..646e3b5b4bb6 100644
--- a/arch/x86/platform/geode/net5501.c
+++ b/arch/x86/platform/geode/net5501.c
@@ -63,7 +63,7 @@ static struct gpio_led net5501_leds[] = {
63 .name = "net5501:1", 63 .name = "net5501:1",
64 .gpio = 6, 64 .gpio = 6,
65 .default_trigger = "default-on", 65 .default_trigger = "default-on",
66 .active_low = 1, 66 .active_low = 0,
67 }, 67 },
68}; 68};
69 69
diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c
index e0a37233c0af..e31bcd8f2eee 100644
--- a/arch/x86/platform/mrst/mrst.c
+++ b/arch/x86/platform/mrst/mrst.c
@@ -805,7 +805,7 @@ void intel_scu_devices_create(void)
805 } else 805 } else
806 i2c_register_board_info(i2c_bus[i], i2c_devs[i], 1); 806 i2c_register_board_info(i2c_bus[i], i2c_devs[i], 1);
807 } 807 }
808 intel_scu_notifier_post(SCU_AVAILABLE, 0L); 808 intel_scu_notifier_post(SCU_AVAILABLE, NULL);
809} 809}
810EXPORT_SYMBOL_GPL(intel_scu_devices_create); 810EXPORT_SYMBOL_GPL(intel_scu_devices_create);
811 811
@@ -814,7 +814,7 @@ void intel_scu_devices_destroy(void)
814{ 814{
815 int i; 815 int i;
816 816
817 intel_scu_notifier_post(SCU_DOWN, 0L); 817 intel_scu_notifier_post(SCU_DOWN, NULL);
818 818
819 for (i = 0; i < ipc_next_dev; i++) 819 for (i = 0; i < ipc_next_dev; i++)
820 platform_device_del(ipc_devs[i]); 820 platform_device_del(ipc_devs[i]);
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index 4f51bebac02c..95dccce8e979 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -63,6 +63,7 @@
63#include <asm/stackprotector.h> 63#include <asm/stackprotector.h>
64#include <asm/hypervisor.h> 64#include <asm/hypervisor.h>
65#include <asm/mwait.h> 65#include <asm/mwait.h>
66#include <asm/pci_x86.h>
66 67
67#ifdef CONFIG_ACPI 68#ifdef CONFIG_ACPI
68#include <linux/acpi.h> 69#include <linux/acpi.h>
@@ -261,7 +262,8 @@ static void xen_cpuid(unsigned int *ax, unsigned int *bx,
261 262
262static bool __init xen_check_mwait(void) 263static bool __init xen_check_mwait(void)
263{ 264{
264#ifdef CONFIG_ACPI 265#if defined(CONFIG_ACPI) && !defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR) && \
266 !defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR_MODULE)
265 struct xen_platform_op op = { 267 struct xen_platform_op op = {
266 .cmd = XENPF_set_processor_pminfo, 268 .cmd = XENPF_set_processor_pminfo,
267 .u.set_pminfo.id = -1, 269 .u.set_pminfo.id = -1,
@@ -349,7 +351,6 @@ static void __init xen_init_cpuid_mask(void)
349 /* Xen will set CR4.OSXSAVE if supported and not disabled by force */ 351 /* Xen will set CR4.OSXSAVE if supported and not disabled by force */
350 if ((cx & xsave_mask) != xsave_mask) 352 if ((cx & xsave_mask) != xsave_mask)
351 cpuid_leaf1_ecx_mask &= ~xsave_mask; /* disable XSAVE & OSXSAVE */ 353 cpuid_leaf1_ecx_mask &= ~xsave_mask; /* disable XSAVE & OSXSAVE */
352
353 if (xen_check_mwait()) 354 if (xen_check_mwait())
354 cpuid_leaf1_ecx_set_mask = (1 << (X86_FEATURE_MWAIT % 32)); 355 cpuid_leaf1_ecx_set_mask = (1 << (X86_FEATURE_MWAIT % 32));
355} 356}
@@ -809,9 +810,40 @@ static void xen_io_delay(void)
809} 810}
810 811
811#ifdef CONFIG_X86_LOCAL_APIC 812#ifdef CONFIG_X86_LOCAL_APIC
813static unsigned long xen_set_apic_id(unsigned int x)
814{
815 WARN_ON(1);
816 return x;
817}
818static unsigned int xen_get_apic_id(unsigned long x)
819{
820 return ((x)>>24) & 0xFFu;
821}
812static u32 xen_apic_read(u32 reg) 822static u32 xen_apic_read(u32 reg)
813{ 823{
814 return 0; 824 struct xen_platform_op op = {
825 .cmd = XENPF_get_cpuinfo,
826 .interface_version = XENPF_INTERFACE_VERSION,
827 .u.pcpu_info.xen_cpuid = 0,
828 };
829 int ret = 0;
830
831 /* Shouldn't need this as APIC is turned off for PV, and we only
832 * get called on the bootup processor. But just in case. */
833 if (!xen_initial_domain() || smp_processor_id())
834 return 0;
835
836 if (reg == APIC_LVR)
837 return 0x10;
838
839 if (reg != APIC_ID)
840 return 0;
841
842 ret = HYPERVISOR_dom0_op(&op);
843 if (ret)
844 return 0;
845
846 return op.u.pcpu_info.apic_id << 24;
815} 847}
816 848
817static void xen_apic_write(u32 reg, u32 val) 849static void xen_apic_write(u32 reg, u32 val)
@@ -849,6 +881,8 @@ static void set_xen_basic_apic_ops(void)
849 apic->icr_write = xen_apic_icr_write; 881 apic->icr_write = xen_apic_icr_write;
850 apic->wait_icr_idle = xen_apic_wait_icr_idle; 882 apic->wait_icr_idle = xen_apic_wait_icr_idle;
851 apic->safe_wait_icr_idle = xen_safe_apic_wait_icr_idle; 883 apic->safe_wait_icr_idle = xen_safe_apic_wait_icr_idle;
884 apic->set_apic_id = xen_set_apic_id;
885 apic->get_apic_id = xen_get_apic_id;
852} 886}
853 887
854#endif 888#endif
@@ -1365,8 +1399,10 @@ asmlinkage void __init xen_start_kernel(void)
1365 /* Make sure ACS will be enabled */ 1399 /* Make sure ACS will be enabled */
1366 pci_request_acs(); 1400 pci_request_acs();
1367 } 1401 }
1368 1402#ifdef CONFIG_PCI
1369 1403 /* PCI BIOS service won't work from a PV guest. */
1404 pci_probe &= ~PCI_PROBE_BIOS;
1405#endif
1370 xen_raw_console_write("about to get started...\n"); 1406 xen_raw_console_write("about to get started...\n");
1371 1407
1372 xen_setup_runstate_info(0); 1408 xen_setup_runstate_info(0);
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index b8e279479a6b..69f5857660ac 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -353,8 +353,13 @@ static pteval_t pte_mfn_to_pfn(pteval_t val)
353{ 353{
354 if (val & _PAGE_PRESENT) { 354 if (val & _PAGE_PRESENT) {
355 unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; 355 unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT;
356 unsigned long pfn = mfn_to_pfn(mfn);
357
356 pteval_t flags = val & PTE_FLAGS_MASK; 358 pteval_t flags = val & PTE_FLAGS_MASK;
357 val = ((pteval_t)mfn_to_pfn(mfn) << PAGE_SHIFT) | flags; 359 if (unlikely(pfn == ~0))
360 val = flags & ~_PAGE_PRESENT;
361 else
362 val = ((pteval_t)pfn << PAGE_SHIFT) | flags;
358 } 363 }
359 364
360 return val; 365 return val;
diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
index 5fac6919b957..0503c0c493a9 100644
--- a/arch/x86/xen/smp.c
+++ b/arch/x86/xen/smp.c
@@ -178,6 +178,7 @@ static void __init xen_fill_possible_map(void)
178static void __init xen_filter_cpu_maps(void) 178static void __init xen_filter_cpu_maps(void)
179{ 179{
180 int i, rc; 180 int i, rc;
181 unsigned int subtract = 0;
181 182
182 if (!xen_initial_domain()) 183 if (!xen_initial_domain())
183 return; 184 return;
@@ -192,8 +193,22 @@ static void __init xen_filter_cpu_maps(void)
192 } else { 193 } else {
193 set_cpu_possible(i, false); 194 set_cpu_possible(i, false);
194 set_cpu_present(i, false); 195 set_cpu_present(i, false);
196 subtract++;
195 } 197 }
196 } 198 }
199#ifdef CONFIG_HOTPLUG_CPU
200 /* This is akin to using 'nr_cpus' on the Linux command line.
201 * Which is OK as when we use 'dom0_max_vcpus=X' we can only
202 * have up to X, while nr_cpu_ids is greater than X. This
203 * normally is not a problem, except when CPU hotplugging
204 * is involved and then there might be more than X CPUs
205 * in the guest - which will not work as there is no
206 * hypercall to expand the max number of VCPUs an already
207 * running guest has. So cap it up to X. */
208 if (subtract)
209 nr_cpu_ids = nr_cpu_ids - subtract;
210#endif
211
197} 212}
198 213
199static void __init xen_smp_prepare_boot_cpu(void) 214static void __init xen_smp_prepare_boot_cpu(void)
diff --git a/arch/x86/xen/xen-asm.S b/arch/x86/xen/xen-asm.S
index 79d7362ad6d1..3e45aa000718 100644
--- a/arch/x86/xen/xen-asm.S
+++ b/arch/x86/xen/xen-asm.S
@@ -96,7 +96,7 @@ ENTRY(xen_restore_fl_direct)
96 96
97 /* check for unmasked and pending */ 97 /* check for unmasked and pending */
98 cmpw $0x0001, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_pending 98 cmpw $0x0001, PER_CPU_VAR(xen_vcpu_info) + XEN_vcpu_info_pending
99 jz 1f 99 jnz 1f
1002: call check_events 1002: call check_events
1011: 1011:
102ENDPATCH(xen_restore_fl_direct) 102ENDPATCH(xen_restore_fl_direct)
diff --git a/arch/xtensa/include/asm/hardirq.h b/arch/xtensa/include/asm/hardirq.h
index 26664cef8f11..91695a135498 100644
--- a/arch/xtensa/include/asm/hardirq.h
+++ b/arch/xtensa/include/asm/hardirq.h
@@ -11,9 +11,6 @@
11#ifndef _XTENSA_HARDIRQ_H 11#ifndef _XTENSA_HARDIRQ_H
12#define _XTENSA_HARDIRQ_H 12#define _XTENSA_HARDIRQ_H
13 13
14void ack_bad_irq(unsigned int irq);
15#define ack_bad_irq ack_bad_irq
16
17#include <asm-generic/hardirq.h> 14#include <asm-generic/hardirq.h>
18 15
19#endif /* _XTENSA_HARDIRQ_H */ 16#endif /* _XTENSA_HARDIRQ_H */
diff --git a/arch/xtensa/include/asm/io.h b/arch/xtensa/include/asm/io.h
index d04cd3a625fa..4beb43c087d3 100644
--- a/arch/xtensa/include/asm/io.h
+++ b/arch/xtensa/include/asm/io.h
@@ -14,6 +14,7 @@
14#ifdef __KERNEL__ 14#ifdef __KERNEL__
15#include <asm/byteorder.h> 15#include <asm/byteorder.h>
16#include <asm/page.h> 16#include <asm/page.h>
17#include <linux/bug.h>
17#include <linux/kernel.h> 18#include <linux/kernel.h>
18 19
19#include <linux/types.h> 20#include <linux/types.h>
diff --git a/arch/xtensa/kernel/signal.c b/arch/xtensa/kernel/signal.c
index b69b000349fc..d78869a00b11 100644
--- a/arch/xtensa/kernel/signal.c
+++ b/arch/xtensa/kernel/signal.c
@@ -496,6 +496,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
496 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 496 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
497 497
498 if (signr > 0) { 498 if (signr > 0) {
499 int ret;
499 500
500 /* Are we from a system call? */ 501 /* Are we from a system call? */
501 502