aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/Kconfig29
-rw-r--r--arch/arm/Kconfig.debug2
-rw-r--r--arch/arm/Makefile2
-rw-r--r--arch/arm/boot/compressed/head.S2
-rw-r--r--arch/arm/common/it8152.c7
-rw-r--r--arch/arm/common/pl330.c3
-rw-r--r--arch/arm/configs/at91cap9_defconfig108
-rw-r--r--arch/arm/configs/mini2440_defconfig2
-rw-r--r--arch/arm/configs/s3c2410_defconfig57
-rw-r--r--arch/arm/configs/tct_hammer_defconfig2
-rw-r--r--arch/arm/include/asm/assembler.h5
-rw-r--r--arch/arm/include/asm/hardware/pl330.h2
-rw-r--r--arch/arm/include/asm/processor.h1
-rw-r--r--arch/arm/kernel/ptrace.c9
-rw-r--r--arch/arm/kernel/smp_twd.c2
-rw-r--r--arch/arm/mach-at91/Kconfig26
-rw-r--r--arch/arm/mach-at91/Makefile4
-rw-r--r--arch/arm/mach-at91/Makefile.boot6
-rw-r--r--arch/arm/mach-at91/at91cap9.c404
-rw-r--r--arch/arm/mach-at91/at91cap9_devices.c1273
-rw-r--r--arch/arm/mach-at91/board-cap9adk.c396
-rw-r--r--arch/arm/mach-at91/clock.c5
-rw-r--r--arch/arm/mach-at91/cpuidle.c11
-rw-r--r--arch/arm/mach-at91/generic.h1
-rw-r--r--arch/arm/mach-at91/include/mach/at91_pmc.h14
-rw-r--r--arch/arm/mach-at91/include/mach/at91cap9.h122
-rw-r--r--arch/arm/mach-at91/include/mach/at91cap9_matrix.h137
-rw-r--r--arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h10
-rw-r--r--arch/arm/mach-at91/include/mach/cpu.h21
-rw-r--r--arch/arm/mach-at91/include/mach/hardware.h4
-rw-r--r--arch/arm/mach-at91/pm.c17
-rw-r--r--arch/arm/mach-at91/pm.h91
-rw-r--r--arch/arm/mach-at91/pm_slowclock.S12
-rw-r--r--arch/arm/mach-at91/setup.c17
-rw-r--r--arch/arm/mach-at91/soc.h5
-rw-r--r--arch/arm/mach-davinci/board-dm355-evm.c3
-rw-r--r--arch/arm/mach-davinci/board-dm355-leopard.c3
-rw-r--r--arch/arm/mach-davinci/board-dm365-evm.c3
-rw-r--r--arch/arm/mach-davinci/board-dm644x-evm.c28
-rw-r--r--arch/arm/mach-davinci/board-dm646x-evm.c32
-rw-r--r--arch/arm/mach-davinci/board-neuros-osd2.c3
-rw-r--r--arch/arm/mach-davinci/board-sffsdr.c3
-rw-r--r--arch/arm/mach-davinci/davinci.h96
-rw-r--r--arch/arm/mach-davinci/devices.c32
-rw-r--r--arch/arm/mach-davinci/dm355.c3
-rw-r--r--arch/arm/mach-davinci/dm365.c19
-rw-r--r--arch/arm/mach-davinci/dm644x.c53
-rw-r--r--arch/arm/mach-davinci/dm646x.c21
-rw-r--r--arch/arm/mach-davinci/include/mach/dm355.h32
-rw-r--r--arch/arm/mach-davinci/include/mach/dm365.h53
-rw-r--r--arch/arm/mach-davinci/include/mach/dm644x.h47
-rw-r--r--arch/arm/mach-davinci/include/mach/dm646x.h42
-rw-r--r--arch/arm/mach-davinci/include/mach/hardware.h2
-rw-r--r--arch/arm/mach-exynos/clock-exynos4210.c2
-rw-r--r--arch/arm/mach-exynos/clock-exynos4212.c2
-rw-r--r--arch/arm/mach-exynos/clock.c2
-rw-r--r--arch/arm/mach-exynos/common.c2
-rw-r--r--arch/arm/mach-exynos/dma.c16
-rw-r--r--arch/arm/mach-exynos/mach-origen.c2
-rw-r--r--arch/arm/mach-exynos/mach-universal_c210.c2
-rw-r--r--arch/arm/mach-imx/clock-imx31.c2
-rw-r--r--arch/arm/mach-imx/clock-imx35.c166
-rw-r--r--arch/arm/mach-imx/crmregs-imx3.h (renamed from arch/arm/mach-imx/crmregs-imx31.h)15
-rw-r--r--arch/arm/mach-imx/mach-armadillo5x0.c2
-rw-r--r--arch/arm/mach-omap1/gpio15xx.c7
-rw-r--r--arch/arm/mach-omap1/gpio16xx.c40
-rw-r--r--arch/arm/mach-omap1/gpio7xx.c14
-rw-r--r--arch/arm/mach-omap2/cm2xxx_3xxx.c2
-rw-r--r--arch/arm/mach-omap2/common.c1
-rw-r--r--arch/arm/mach-omap2/control.c1
-rw-r--r--arch/arm/mach-omap2/gpio.c36
-rw-r--r--arch/arm/mach-omap2/pm34xx.c14
-rw-r--r--arch/arm/mach-omap2/sdrc2xxx.c1
-rw-r--r--arch/arm/mach-omap2/voltagedomains3xxx_data.c2
-rw-r--r--arch/arm/mach-omap2/voltagedomains44xx_data.c2
-rw-r--r--arch/arm/mach-s3c2410/Kconfig154
-rw-r--r--arch/arm/mach-s3c2410/Makefile26
-rw-r--r--arch/arm/mach-s3c2410/include/mach/spi.h38
-rw-r--r--arch/arm/mach-s3c2410/usb-simtec.h16
-rw-r--r--arch/arm/mach-s3c2412/Kconfig85
-rw-r--r--arch/arm/mach-s3c2412/Makefile12
-rw-r--r--arch/arm/mach-s3c2416/Kconfig60
-rw-r--r--arch/arm/mach-s3c2416/Makefile22
-rw-r--r--arch/arm/mach-s3c2440/Kconfig165
-rw-r--r--arch/arm/mach-s3c2440/Makefile26
-rw-r--r--arch/arm/mach-s3c2440/common.h17
-rw-r--r--arch/arm/mach-s3c2443/Kconfig32
-rw-r--r--arch/arm/mach-s3c2443/Makefile20
-rw-r--r--arch/arm/mach-s3c24xx/Kconfig538
-rw-r--r--arch/arm/mach-s3c24xx/Makefile95
-rw-r--r--arch/arm/mach-s3c24xx/Makefile.boot (renamed from arch/arm/mach-s3c2410/Makefile.boot)0
-rw-r--r--arch/arm/mach-s3c24xx/bast-ide.c (renamed from arch/arm/mach-s3c2410/bast-ide.c)0
-rw-r--r--arch/arm/mach-s3c24xx/bast-irq.c (renamed from arch/arm/mach-s3c2410/bast-irq.c)0
-rw-r--r--arch/arm/mach-s3c24xx/clock-s3c2412.c (renamed from arch/arm/mach-s3c2412/clock.c)0
-rw-r--r--arch/arm/mach-s3c24xx/clock-s3c2416.c (renamed from arch/arm/mach-s3c2416/clock.c)7
-rw-r--r--arch/arm/mach-s3c24xx/clock-s3c2440.c (renamed from arch/arm/mach-s3c2440/clock.c)0
-rw-r--r--arch/arm/mach-s3c24xx/clock-s3c2443.c (renamed from arch/arm/mach-s3c2443/clock.c)7
-rw-r--r--arch/arm/mach-s3c24xx/clock-s3c244x.c (renamed from arch/arm/mach-s3c2440/s3c244x-clock.c)0
-rw-r--r--arch/arm/mach-s3c24xx/common-s3c2443.c (renamed from arch/arm/plat-s3c24xx/s3c2443-clock.c)90
-rw-r--r--arch/arm/mach-s3c24xx/common-smdk.c (renamed from arch/arm/plat-s3c24xx/common-smdk.c)0
-rw-r--r--arch/arm/mach-s3c24xx/common.h (renamed from arch/arm/mach-s3c2410/common.h)6
-rw-r--r--arch/arm/mach-s3c24xx/dma-s3c2410.c (renamed from arch/arm/mach-s3c2410/dma.c)0
-rw-r--r--arch/arm/mach-s3c24xx/dma-s3c2412.c (renamed from arch/arm/mach-s3c2412/dma.c)0
-rw-r--r--arch/arm/mach-s3c24xx/dma-s3c2440.c (renamed from arch/arm/mach-s3c2440/dma.c)0
-rw-r--r--arch/arm/mach-s3c24xx/dma-s3c2443.c (renamed from arch/arm/mach-s3c2443/dma.c)30
-rw-r--r--arch/arm/mach-s3c24xx/h1940-bluetooth.c (renamed from arch/arm/mach-s3c2410/h1940-bluetooth.c)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/anubis-cpld.h (renamed from arch/arm/mach-s3c2410/include/mach/anubis-cpld.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/anubis-irq.h (renamed from arch/arm/mach-s3c2410/include/mach/anubis-irq.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/anubis-map.h (renamed from arch/arm/mach-s3c2410/include/mach/anubis-map.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/bast-cpld.h (renamed from arch/arm/mach-s3c2410/include/mach/bast-cpld.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/bast-irq.h (renamed from arch/arm/mach-s3c2410/include/mach/bast-irq.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/bast-map.h (renamed from arch/arm/mach-s3c2410/include/mach/bast-map.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/bast-pmu.h (renamed from arch/arm/mach-s3c2410/include/mach/bast-pmu.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/debug-macro.S (renamed from arch/arm/mach-s3c2410/include/mach/debug-macro.S)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/dma.h (renamed from arch/arm/mach-s3c2410/include/mach/dma.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/entry-macro.S (renamed from arch/arm/mach-s3c2410/include/mach/entry-macro.S)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/fb.h (renamed from arch/arm/mach-s3c2410/include/mach/fb.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/gpio-fns.h (renamed from arch/arm/mach-s3c2410/include/mach/gpio-fns.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/gpio-nrs.h (renamed from arch/arm/mach-s3c2410/include/mach/gpio-nrs.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/gpio-track.h (renamed from arch/arm/mach-s3c2410/include/mach/gpio-track.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/gpio.h (renamed from arch/arm/mach-s3c2410/include/mach/gpio.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/gta02.h (renamed from arch/arm/mach-s3c2440/include/mach/gta02.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/h1940-latch.h (renamed from arch/arm/mach-s3c2410/include/mach/h1940-latch.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/h1940.h (renamed from arch/arm/mach-s3c2410/include/mach/h1940.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/hardware.h (renamed from arch/arm/mach-s3c2410/include/mach/hardware.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/idle.h (renamed from arch/arm/mach-s3c2410/include/mach/idle.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/io.h (renamed from arch/arm/mach-s3c2410/include/mach/io.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/irqs.h (renamed from arch/arm/mach-s3c2410/include/mach/irqs.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/leds-gpio.h (renamed from arch/arm/mach-s3c2410/include/mach/leds-gpio.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/map.h (renamed from arch/arm/mach-s3c2410/include/mach/map.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/osiris-cpld.h (renamed from arch/arm/mach-s3c2410/include/mach/osiris-cpld.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/osiris-map.h (renamed from arch/arm/mach-s3c2410/include/mach/osiris-map.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/otom-map.h (renamed from arch/arm/mach-s3c2410/include/mach/otom-map.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/pm-core.h (renamed from arch/arm/mach-s3c2410/include/mach/pm-core.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-clock.h (renamed from arch/arm/mach-s3c2410/include/mach/regs-clock.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-dsc.h (renamed from arch/arm/mach-s3c2410/include/mach/regs-dsc.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-gpio.h (renamed from arch/arm/mach-s3c2410/include/mach/regs-gpio.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-gpioj.h (renamed from arch/arm/mach-s3c2410/include/mach/regs-gpioj.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-irq.h (renamed from arch/arm/mach-s3c2410/include/mach/regs-irq.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-lcd.h (renamed from arch/arm/mach-s3c2410/include/mach/regs-lcd.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-mem.h (renamed from arch/arm/mach-s3c2410/include/mach/regs-mem.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-power.h (renamed from arch/arm/mach-s3c2410/include/mach/regs-power.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-s3c2412-mem.h (renamed from arch/arm/mach-s3c2410/include/mach/regs-s3c2412-mem.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-s3c2412.h (renamed from arch/arm/mach-s3c2410/include/mach/regs-s3c2412.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-s3c2416-mem.h (renamed from arch/arm/mach-s3c2410/include/mach/regs-s3c2416-mem.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-s3c2416.h (renamed from arch/arm/mach-s3c2410/include/mach/regs-s3c2416.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-s3c2443-clock.h (renamed from arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/regs-sdi.h (renamed from arch/arm/mach-s3c2410/include/mach/regs-sdi.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/tick.h (renamed from arch/arm/mach-s3c2410/include/mach/tick.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/timex.h (renamed from arch/arm/mach-s3c2410/include/mach/timex.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/uncompress.h (renamed from arch/arm/mach-s3c2410/include/mach/uncompress.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/vr1000-cpld.h (renamed from arch/arm/mach-s3c2410/include/mach/vr1000-cpld.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/vr1000-irq.h (renamed from arch/arm/mach-s3c2410/include/mach/vr1000-irq.h)0
-rw-r--r--arch/arm/mach-s3c24xx/include/mach/vr1000-map.h (renamed from arch/arm/mach-s3c2410/include/mach/vr1000-map.h)0
-rw-r--r--arch/arm/mach-s3c24xx/irq-s3c2412.c (renamed from arch/arm/mach-s3c2412/irq.c)0
-rw-r--r--arch/arm/mach-s3c24xx/irq-s3c2416.c (renamed from arch/arm/mach-s3c2416/irq.c)0
-rw-r--r--arch/arm/mach-s3c24xx/irq-s3c2440.c (renamed from arch/arm/mach-s3c2440/irq.c)0
-rw-r--r--arch/arm/mach-s3c24xx/irq-s3c2443.c (renamed from arch/arm/mach-s3c2443/irq.c)0
-rw-r--r--arch/arm/mach-s3c24xx/irq-s3c244x.c (renamed from arch/arm/mach-s3c2440/s3c244x-irq.c)0
-rw-r--r--arch/arm/mach-s3c24xx/mach-amlm5900.c (renamed from arch/arm/mach-s3c2410/mach-amlm5900.c)0
-rw-r--r--arch/arm/mach-s3c24xx/mach-anubis.c (renamed from arch/arm/mach-s3c2440/mach-anubis.c)1
-rw-r--r--arch/arm/mach-s3c24xx/mach-at2440evb.c (renamed from arch/arm/mach-s3c2440/mach-at2440evb.c)0
-rw-r--r--arch/arm/mach-s3c24xx/mach-bast.c (renamed from arch/arm/mach-s3c2410/mach-bast.c)3
-rw-r--r--arch/arm/mach-s3c24xx/mach-gta02.c (renamed from arch/arm/mach-s3c2440/mach-gta02.c)6
-rw-r--r--arch/arm/mach-s3c24xx/mach-h1940.c (renamed from arch/arm/mach-s3c2410/mach-h1940.c)12
-rw-r--r--arch/arm/mach-s3c24xx/mach-jive.c (renamed from arch/arm/mach-s3c2412/mach-jive.c)0
-rw-r--r--arch/arm/mach-s3c24xx/mach-mini2440.c (renamed from arch/arm/mach-s3c2440/mach-mini2440.c)0
-rw-r--r--arch/arm/mach-s3c24xx/mach-n30.c (renamed from arch/arm/mach-s3c2410/mach-n30.c)0
-rw-r--r--arch/arm/mach-s3c24xx/mach-nexcoder.c (renamed from arch/arm/mach-s3c2440/mach-nexcoder.c)0
-rw-r--r--arch/arm/mach-s3c24xx/mach-osiris-dvs.c (renamed from arch/arm/mach-s3c2440/mach-osiris-dvs.c)0
-rw-r--r--arch/arm/mach-s3c24xx/mach-osiris.c (renamed from arch/arm/mach-s3c2440/mach-osiris.c)0
-rw-r--r--arch/arm/mach-s3c24xx/mach-otom.c (renamed from arch/arm/mach-s3c2410/mach-otom.c)0
-rw-r--r--arch/arm/mach-s3c24xx/mach-qt2410.c (renamed from arch/arm/mach-s3c2410/mach-qt2410.c)0
-rw-r--r--arch/arm/mach-s3c24xx/mach-rx1950.c (renamed from arch/arm/mach-s3c2440/mach-rx1950.c)12
-rw-r--r--arch/arm/mach-s3c24xx/mach-rx3715.c (renamed from arch/arm/mach-s3c2440/mach-rx3715.c)0
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2410.c (renamed from arch/arm/mach-s3c2410/mach-smdk2410.c)0
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2413.c (renamed from arch/arm/mach-s3c2412/mach-smdk2413.c)0
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2416.c (renamed from arch/arm/mach-s3c2416/mach-smdk2416.c)8
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2440.c (renamed from arch/arm/mach-s3c2440/mach-smdk2440.c)0
-rw-r--r--arch/arm/mach-s3c24xx/mach-smdk2443.c (renamed from arch/arm/mach-s3c2443/mach-smdk2443.c)0
-rw-r--r--arch/arm/mach-s3c24xx/mach-tct_hammer.c (renamed from arch/arm/mach-s3c2410/mach-tct_hammer.c)0
-rw-r--r--arch/arm/mach-s3c24xx/mach-vr1000.c (renamed from arch/arm/mach-s3c2410/mach-vr1000.c)3
-rw-r--r--arch/arm/mach-s3c24xx/mach-vstms.c (renamed from arch/arm/mach-s3c2412/mach-vstms.c)0
-rw-r--r--arch/arm/mach-s3c24xx/pm-h1940.S (renamed from arch/arm/mach-s3c2410/pm-h1940.S)0
-rw-r--r--arch/arm/mach-s3c24xx/pm-s3c2410.c (renamed from arch/arm/mach-s3c2410/pm.c)0
-rw-r--r--arch/arm/mach-s3c24xx/pm-s3c2412.c (renamed from arch/arm/mach-s3c2412/pm.c)0
-rw-r--r--arch/arm/mach-s3c24xx/pm-s3c2416.c (renamed from arch/arm/mach-s3c2416/pm.c)0
-rw-r--r--arch/arm/mach-s3c24xx/s3c2410.c (renamed from arch/arm/mach-s3c2410/s3c2410.c)0
-rw-r--r--arch/arm/mach-s3c24xx/s3c2412.c (renamed from arch/arm/mach-s3c2412/s3c2412.c)0
-rw-r--r--arch/arm/mach-s3c24xx/s3c2416.c (renamed from arch/arm/mach-s3c2416/s3c2416.c)0
-rw-r--r--arch/arm/mach-s3c24xx/s3c2440.c (renamed from arch/arm/mach-s3c2440/s3c2440.c)0
-rw-r--r--arch/arm/mach-s3c24xx/s3c2442.c (renamed from arch/arm/mach-s3c2440/s3c2442.c)0
-rw-r--r--arch/arm/mach-s3c24xx/s3c2443.c (renamed from arch/arm/mach-s3c2443/s3c2443.c)0
-rw-r--r--arch/arm/mach-s3c24xx/s3c244x.c (renamed from arch/arm/mach-s3c2440/s3c244x.c)0
-rw-r--r--arch/arm/mach-s3c24xx/setup-i2c.c (renamed from arch/arm/plat-s3c24xx/setup-i2c.c)0
-rw-r--r--arch/arm/mach-s3c24xx/setup-sdhci-gpio.c (renamed from arch/arm/mach-s3c2416/setup-sdhci-gpio.c)0
-rw-r--r--arch/arm/mach-s3c24xx/setup-ts.c (renamed from arch/arm/plat-s3c24xx/setup-ts.c)0
-rw-r--r--arch/arm/mach-s3c24xx/simtec-audio.c (renamed from arch/arm/plat-s3c24xx/simtec-audio.c)2
-rw-r--r--arch/arm/mach-s3c24xx/simtec-nor.c (renamed from arch/arm/mach-s3c2410/nor-simtec.c)2
-rw-r--r--arch/arm/mach-s3c24xx/simtec-pm.c (renamed from arch/arm/plat-s3c24xx/pm-simtec.c)0
-rw-r--r--arch/arm/mach-s3c24xx/simtec-usb.c (renamed from arch/arm/mach-s3c2410/usb-simtec.c)2
-rw-r--r--arch/arm/mach-s3c24xx/simtec.h (renamed from arch/arm/mach-s3c2410/nor-simtec.h)9
-rw-r--r--arch/arm/mach-s3c24xx/sleep-s3c2410.S (renamed from arch/arm/mach-s3c2410/sleep.S)0
-rw-r--r--arch/arm/mach-s3c24xx/sleep-s3c2412.S (renamed from arch/arm/mach-s3c2412/sleep.S)0
-rw-r--r--arch/arm/mach-s3c64xx/common.h2
-rw-r--r--arch/arm/mach-s3c64xx/irq-pm.c2
-rw-r--r--arch/arm/mach-s5p64x0/clock.c11
-rw-r--r--arch/arm/mach-s5p64x0/dma.c12
-rw-r--r--arch/arm/mach-s5p64x0/include/mach/s5p64x0-clock.h7
-rw-r--r--arch/arm/mach-s5pc100/clock.c28
-rw-r--r--arch/arm/mach-s5pc100/dma.c16
-rw-r--r--arch/arm/mach-s5pv210/dma.c16
-rw-r--r--arch/arm/mach-s5pv210/mach-goni.c2
-rw-r--r--arch/arm/mach-s5pv210/mach-smdkv210.c2
-rw-r--r--arch/arm/mach-shmobile/board-ag5evm.c29
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c12
-rw-r--r--arch/arm/mach-shmobile/board-kota2.c3
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c95
-rw-r--r--arch/arm/mach-shmobile/clock-sh73a0.c113
-rw-r--r--arch/arm/mach-shmobile/include/mach/sh73a0.h6
-rw-r--r--arch/arm/mach-shmobile/intc-sh73a0.c2
-rw-r--r--arch/arm/mach-shmobile/pfc-r8a7779.c2
-rw-r--r--arch/arm/mach-shmobile/pfc-sh7372.c41
-rw-r--r--arch/arm/mach-shmobile/smp-sh73a0.c2
-rw-r--r--arch/arm/mach-tegra/Kconfig14
-rw-r--r--arch/arm/mach-tegra/Makefile3
-rw-r--r--arch/arm/mach-tegra/common.c2
-rw-r--r--arch/arm/mach-tegra/usb_phy.c11
-rw-r--r--arch/arm/mm/Kconfig3
-rw-r--r--arch/arm/mm/cache-v7.S2
-rw-r--r--arch/arm/plat-mxc/audmux-v1.c5
-rw-r--r--arch/arm/plat-mxc/avic.c2
-rw-r--r--arch/arm/plat-omap/include/plat/gpio.h29
-rw-r--r--arch/arm/plat-s3c24xx/Kconfig57
-rw-r--r--arch/arm/plat-s3c24xx/Makefile19
-rw-r--r--arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c36
-rw-r--r--arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c38
-rw-r--r--arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c36
-rw-r--r--arch/arm/plat-s5p/irq-eint.c2
-rw-r--r--arch/arm/plat-s5p/irq-gpioint.c2
-rw-r--r--arch/arm/plat-samsung/Kconfig4
-rw-r--r--arch/arm/plat-samsung/devs.c13
-rw-r--r--arch/arm/plat-samsung/dma-ops.c2
-rw-r--r--arch/arm/plat-samsung/include/plat/audio-simtec.h3
-rw-r--r--arch/arm/plat-samsung/include/plat/clock.h22
-rw-r--r--arch/arm/plat-samsung/include/plat/regs-dma.h2
-rw-r--r--arch/arm/plat-samsung/include/plat/s3c2410.h2
-rw-r--r--arch/arm/plat-samsung/include/plat/s3c2443.h20
-rw-r--r--arch/avr32/mach-at32ap/include/mach/cpu.h3
-rw-r--r--arch/c6x/boot/Makefile2
-rw-r--r--arch/m68k/include/asm/mcf_pgtable.h3
-rw-r--r--arch/m68k/mm/mcfmmu.c9
-rw-r--r--arch/m68k/platform/coldfire/entry.S4
-rw-r--r--arch/powerpc/kernel/entry_32.S2
-rw-r--r--arch/powerpc/kernel/entry_64.S6
-rw-r--r--arch/powerpc/kernel/exceptions-64s.S2
-rw-r--r--arch/powerpc/kernel/signal.c12
-rw-r--r--arch/powerpc/kernel/signal.h2
-rw-r--r--arch/powerpc/platforms/wsp/smp.c2
-rw-r--r--arch/s390/kernel/compat_wrapper.S2
-rw-r--r--arch/s390/kernel/process.c5
-rw-r--r--arch/s390/kernel/time.c7
-rw-r--r--arch/s390/mm/pgtable.c2
-rw-r--r--arch/sh/boards/board-sh7757lcr.c20
-rw-r--r--arch/sh/boards/mach-ap325rxa/setup.c1
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c2
-rw-r--r--arch/sh/boards/mach-kfr2r09/setup.c1
-rw-r--r--arch/sh/boards/mach-migor/setup.c2
-rw-r--r--arch/sh/boards/mach-se/7724/setup.c1
-rw-r--r--arch/sh/drivers/pci/pci-sh7780.c2
-rw-r--r--arch/sh/include/asm/device.h8
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7724.c2
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7757.c22
-rw-r--r--arch/sh/kernel/smp.c2
-rw-r--r--arch/sh/kernel/topology.c2
-rw-r--r--arch/sh/mm/cache-sh2a.c2
-rw-r--r--arch/x86/include/asm/i387.h53
-rw-r--r--arch/x86/include/asm/processor.h3
-rw-r--r--arch/x86/kernel/cpu/common.c5
-rw-r--r--arch/x86/kernel/process_32.c3
-rw-r--r--arch/x86/kernel/process_64.c3
-rw-r--r--arch/x86/kernel/traps.c40
282 files changed, 1749 insertions, 4343 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 7d809b7e050..1655c0734d7 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -327,7 +327,7 @@ config ARCH_AT91
327 select CLKDEV_LOOKUP 327 select CLKDEV_LOOKUP
328 help 328 help
329 This enables support for systems based on the Atmel AT91RM9200, 329 This enables support for systems based on the Atmel AT91RM9200,
330 AT91SAM9 and AT91CAP9 processors. 330 AT91SAM9 processors.
331 331
332config ARCH_BCMRING 332config ARCH_BCMRING
333 bool "Broadcom BCMRING" 333 bool "Broadcom BCMRING"
@@ -769,22 +769,21 @@ config ARCH_SA1100
769 help 769 help
770 Support for StrongARM 11x0 based boards. 770 Support for StrongARM 11x0 based boards.
771 771
772config ARCH_S3C2410 772config ARCH_S3C24XX
773 bool "Samsung S3C2410, S3C2412, S3C2413, S3C2416, S3C2440, S3C2442, S3C2443, S3C2450" 773 bool "Samsung S3C24XX SoCs"
774 select GENERIC_GPIO 774 select GENERIC_GPIO
775 select ARCH_HAS_CPUFREQ 775 select ARCH_HAS_CPUFREQ
776 select HAVE_CLK 776 select HAVE_CLK
777 select CLKDEV_LOOKUP 777 select CLKDEV_LOOKUP
778 select ARCH_USES_GETTIMEOFFSET 778 select ARCH_USES_GETTIMEOFFSET
779 select HAVE_S3C2410_I2C if I2C 779 select HAVE_S3C2410_I2C if I2C
780 select HAVE_S3C_RTC if RTC_CLASS
781 select HAVE_S3C2410_WATCHDOG if WATCHDOG
780 help 782 help
781 Samsung S3C2410X CPU based systems, such as the Simtec Electronics 783 Samsung S3C2410, S3C2412, S3C2413, S3C2416, S3C2440, S3C2442, S3C2443
782 BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or 784 and S3C2450 SoCs based systems, such as the Simtec Electronics BAST
783 the Samsung SMDK2410 development board (and derivatives). 785 (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or the
784 786 Samsung SMDK2410 development board (and derivatives).
785 Note, the S3C2416 and the S3C2450 are so close that they even share
786 the same SoC ID code. This means that there is no separate machine
787 directory (no arch/arm/mach-s3c2450) as the S3C2416 was first.
788 787
789config ARCH_S3C64XX 788config ARCH_S3C64XX
790 bool "Samsung S3C64XX" 789 bool "Samsung S3C64XX"
@@ -1072,12 +1071,10 @@ source "arch/arm/plat-s5p/Kconfig"
1072 1071
1073source "arch/arm/plat-spear/Kconfig" 1072source "arch/arm/plat-spear/Kconfig"
1074 1073
1075if ARCH_S3C2410 1074source "arch/arm/mach-s3c24xx/Kconfig"
1076source "arch/arm/mach-s3c2410/Kconfig" 1075if ARCH_S3C24XX
1077source "arch/arm/mach-s3c2412/Kconfig" 1076source "arch/arm/mach-s3c2412/Kconfig"
1078source "arch/arm/mach-s3c2416/Kconfig"
1079source "arch/arm/mach-s3c2440/Kconfig" 1077source "arch/arm/mach-s3c2440/Kconfig"
1080source "arch/arm/mach-s3c2443/Kconfig"
1081endif 1078endif
1082 1079
1083if ARCH_S3C64XX 1080if ARCH_S3C64XX
@@ -1594,7 +1591,7 @@ source kernel/Kconfig.preempt
1594 1591
1595config HZ 1592config HZ
1596 int 1593 int
1597 default 200 if ARCH_EBSA110 || ARCH_S3C2410 || ARCH_S5P64X0 || \ 1594 default 200 if ARCH_EBSA110 || ARCH_S3C24XX || ARCH_S5P64X0 || \
1598 ARCH_S5PV210 || ARCH_EXYNOS4 1595 ARCH_S5PV210 || ARCH_EXYNOS4
1599 default OMAP_32K_TIMER_HZ if ARCH_OMAP && OMAP_32K_TIMER 1596 default OMAP_32K_TIMER_HZ if ARCH_OMAP && OMAP_32K_TIMER
1600 default AT91_TIMER_HZ if ARCH_AT91 1597 default AT91_TIMER_HZ if ARCH_AT91
@@ -2120,7 +2117,7 @@ config CPU_FREQ_S3C
2120 2117
2121config CPU_FREQ_S3C24XX 2118config CPU_FREQ_S3C24XX
2122 bool "CPUfreq driver for Samsung S3C24XX series CPUs (EXPERIMENTAL)" 2119 bool "CPUfreq driver for Samsung S3C24XX series CPUs (EXPERIMENTAL)"
2123 depends on ARCH_S3C2410 && CPU_FREQ && EXPERIMENTAL 2120 depends on ARCH_S3C24XX && CPU_FREQ && EXPERIMENTAL
2124 select CPU_FREQ_S3C 2121 select CPU_FREQ_S3C
2125 help 2122 help
2126 This enables the CPUfreq driver for the Samsung S3C24XX family 2123 This enables the CPUfreq driver for the Samsung S3C24XX family
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 03646c4c13d..b895a2a92da 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -86,7 +86,7 @@ choice
86 depends on HAVE_AT91_DBGU0 86 depends on HAVE_AT91_DBGU0
87 87
88 config AT91_DEBUG_LL_DBGU1 88 config AT91_DEBUG_LL_DBGU1
89 bool "Kernel low-level debugging on 9263, 9g45 and cap9" 89 bool "Kernel low-level debugging on 9263 and 9g45"
90 depends on HAVE_AT91_DBGU1 90 depends on HAVE_AT91_DBGU1
91 91
92 config DEBUG_CLPS711X_UART1 92 config DEBUG_CLPS711X_UART1
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 1683bfb9166..0106f75530c 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -174,7 +174,7 @@ machine-$(CONFIG_ARCH_PRIMA2) := prima2
174machine-$(CONFIG_ARCH_PXA) := pxa 174machine-$(CONFIG_ARCH_PXA) := pxa
175machine-$(CONFIG_ARCH_REALVIEW) := realview 175machine-$(CONFIG_ARCH_REALVIEW) := realview
176machine-$(CONFIG_ARCH_RPC) := rpc 176machine-$(CONFIG_ARCH_RPC) := rpc
177machine-$(CONFIG_ARCH_S3C2410) := s3c2410 s3c2412 s3c2416 s3c2440 s3c2443 177machine-$(CONFIG_ARCH_S3C24XX) := s3c24xx s3c2412 s3c2440
178machine-$(CONFIG_ARCH_S3C64XX) := s3c64xx 178machine-$(CONFIG_ARCH_S3C64XX) := s3c64xx
179machine-$(CONFIG_ARCH_S5P64X0) := s5p64x0 179machine-$(CONFIG_ARCH_S5P64X0) := s5p64x0
180machine-$(CONFIG_ARCH_S5PC100) := s5pc100 180machine-$(CONFIG_ARCH_S5PC100) := s5pc100
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index c5d60250d43..5f6045f1766 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -58,7 +58,7 @@
58 add \rb, \rb, #0x00010000 @ Ser1 58 add \rb, \rb, #0x00010000 @ Ser1
59#endif 59#endif
60 .endm 60 .endm
61#elif defined(CONFIG_ARCH_S3C2410) 61#elif defined(CONFIG_ARCH_S3C24XX)
62 .macro loadsp, rb, tmp 62 .macro loadsp, rb, tmp
63 mov \rb, #0x50000000 63 mov \rb, #0x50000000
64 add \rb, \rb, #0x4000 * CONFIG_S3C_LOWLEVEL_UART_PORT 64 add \rb, \rb, #0x4000 * CONFIG_S3C_LOWLEVEL_UART_PORT
diff --git a/arch/arm/common/it8152.c b/arch/arm/common/it8152.c
index d1bcd7b13eb..fb1f1cfce60 100644
--- a/arch/arm/common/it8152.c
+++ b/arch/arm/common/it8152.c
@@ -320,13 +320,6 @@ err0:
320 return -EBUSY; 320 return -EBUSY;
321} 321}
322 322
323/*
324 * If we set up a device for bus mastering, we need to check the latency
325 * timer as we don't have even crappy BIOSes to set it properly.
326 * The implementation is from arch/i386/pci/i386.c
327 */
328unsigned int pcibios_max_latency = 255;
329
330/* ITE bridge requires setting latency timer to avoid early bus access 323/* ITE bridge requires setting latency timer to avoid early bus access
331 termination by PCI bus master devices 324 termination by PCI bus master devices
332*/ 325*/
diff --git a/arch/arm/common/pl330.c b/arch/arm/common/pl330.c
index d8e44a43047..ff3ad224482 100644
--- a/arch/arm/common/pl330.c
+++ b/arch/arm/common/pl330.c
@@ -1502,12 +1502,13 @@ int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op)
1502 struct pl330_thread *thrd = ch_id; 1502 struct pl330_thread *thrd = ch_id;
1503 struct pl330_dmac *pl330; 1503 struct pl330_dmac *pl330;
1504 unsigned long flags; 1504 unsigned long flags;
1505 int ret = 0, active = thrd->req_running; 1505 int ret = 0, active;
1506 1506
1507 if (!thrd || thrd->free || thrd->dmac->state == DYING) 1507 if (!thrd || thrd->free || thrd->dmac->state == DYING)
1508 return -EINVAL; 1508 return -EINVAL;
1509 1509
1510 pl330 = thrd->dmac; 1510 pl330 = thrd->dmac;
1511 active = thrd->req_running;
1511 1512
1512 spin_lock_irqsave(&pl330->lock, flags); 1513 spin_lock_irqsave(&pl330->lock, flags);
1513 1514
diff --git a/arch/arm/configs/at91cap9_defconfig b/arch/arm/configs/at91cap9_defconfig
deleted file mode 100644
index 8826eb218e7..00000000000
--- a/arch/arm/configs/at91cap9_defconfig
+++ /dev/null
@@ -1,108 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2# CONFIG_LOCALVERSION_AUTO is not set
3# CONFIG_SWAP is not set
4CONFIG_SYSVIPC=y
5CONFIG_LOG_BUF_SHIFT=14
6CONFIG_BLK_DEV_INITRD=y
7CONFIG_SLAB=y
8CONFIG_MODULES=y
9CONFIG_MODULE_UNLOAD=y
10# CONFIG_BLK_DEV_BSG is not set
11# CONFIG_IOSCHED_DEADLINE is not set
12# CONFIG_IOSCHED_CFQ is not set
13CONFIG_ARCH_AT91=y
14CONFIG_ARCH_AT91CAP9=y
15CONFIG_MACH_AT91CAP9ADK=y
16CONFIG_MTD_AT91_DATAFLASH_CARD=y
17CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
18# CONFIG_ARM_THUMB is not set
19CONFIG_AEABI=y
20CONFIG_LEDS=y
21CONFIG_LEDS_CPU=y
22CONFIG_ZBOOT_ROM_TEXT=0x0
23CONFIG_ZBOOT_ROM_BSS=0x0
24CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/ram0 rw"
25CONFIG_FPE_NWFPE=y
26CONFIG_NET=y
27CONFIG_PACKET=y
28CONFIG_UNIX=y
29CONFIG_INET=y
30CONFIG_IP_PNP=y
31CONFIG_IP_PNP_BOOTP=y
32CONFIG_IP_PNP_RARP=y
33# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
34# CONFIG_INET_XFRM_MODE_TUNNEL is not set
35# CONFIG_INET_XFRM_MODE_BEET is not set
36# CONFIG_INET_LRO is not set
37# CONFIG_INET_DIAG is not set
38# CONFIG_IPV6 is not set
39CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
40CONFIG_MTD=y
41CONFIG_MTD_CMDLINE_PARTS=y
42CONFIG_MTD_CHAR=y
43CONFIG_MTD_BLOCK=y
44CONFIG_MTD_CFI=y
45CONFIG_MTD_JEDECPROBE=y
46CONFIG_MTD_CFI_AMDSTD=y
47CONFIG_MTD_PHYSMAP=y
48CONFIG_MTD_DATAFLASH=y
49CONFIG_MTD_NAND=y
50CONFIG_MTD_NAND_ATMEL=y
51CONFIG_BLK_DEV_LOOP=y
52CONFIG_BLK_DEV_RAM=y
53CONFIG_BLK_DEV_RAM_SIZE=8192
54CONFIG_SCSI=y
55CONFIG_BLK_DEV_SD=y
56CONFIG_SCSI_MULTI_LUN=y
57CONFIG_NETDEVICES=y
58CONFIG_MII=y
59CONFIG_MACB=y
60# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
61CONFIG_INPUT_EVDEV=y
62# CONFIG_INPUT_KEYBOARD is not set
63# CONFIG_INPUT_MOUSE is not set
64CONFIG_INPUT_TOUCHSCREEN=y
65CONFIG_TOUCHSCREEN_ADS7846=y
66# CONFIG_SERIO is not set
67CONFIG_SERIAL_ATMEL=y
68CONFIG_SERIAL_ATMEL_CONSOLE=y
69CONFIG_HW_RANDOM=y
70CONFIG_I2C=y
71CONFIG_I2C_CHARDEV=y
72CONFIG_SPI=y
73CONFIG_SPI_ATMEL=y
74# CONFIG_HWMON is not set
75CONFIG_WATCHDOG=y
76CONFIG_WATCHDOG_NOWAYOUT=y
77CONFIG_FB=y
78CONFIG_FB_ATMEL=y
79CONFIG_LOGO=y
80# CONFIG_LOGO_LINUX_MONO is not set
81# CONFIG_LOGO_LINUX_CLUT224 is not set
82# CONFIG_USB_HID is not set
83CONFIG_USB=y
84CONFIG_USB_DEVICEFS=y
85CONFIG_USB_MON=y
86CONFIG_USB_OHCI_HCD=y
87CONFIG_USB_STORAGE=y
88CONFIG_USB_GADGET=y
89CONFIG_USB_ETH=m
90CONFIG_USB_FILE_STORAGE=m
91CONFIG_MMC=y
92CONFIG_MMC_AT91=m
93CONFIG_RTC_CLASS=y
94CONFIG_RTC_DRV_AT91SAM9=y
95CONFIG_EXT2_FS=y
96CONFIG_VFAT_FS=y
97CONFIG_TMPFS=y
98CONFIG_JFFS2_FS=y
99CONFIG_CRAMFS=y
100CONFIG_NFS_FS=y
101CONFIG_ROOT_NFS=y
102CONFIG_NLS_CODEPAGE_437=y
103CONFIG_NLS_CODEPAGE_850=y
104CONFIG_NLS_ISO8859_1=y
105CONFIG_DEBUG_FS=y
106CONFIG_DEBUG_KERNEL=y
107CONFIG_DEBUG_INFO=y
108CONFIG_DEBUG_USER=y
diff --git a/arch/arm/configs/mini2440_defconfig b/arch/arm/configs/mini2440_defconfig
index 2472a958583..42da9183acc 100644
--- a/arch/arm/configs/mini2440_defconfig
+++ b/arch/arm/configs/mini2440_defconfig
@@ -13,7 +13,7 @@ CONFIG_MODULE_UNLOAD=y
13CONFIG_MODULE_FORCE_UNLOAD=y 13CONFIG_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_S3C2410=y 16CONFIG_ARCH_S3C24XX=y
17CONFIG_S3C_ADC=y 17CONFIG_S3C_ADC=y
18CONFIG_S3C24XX_PWM=y 18CONFIG_S3C24XX_PWM=y
19CONFIG_MACH_MINI2440=y 19CONFIG_MACH_MINI2440=y
diff --git a/arch/arm/configs/s3c2410_defconfig b/arch/arm/configs/s3c2410_defconfig
index f9096c1b0a6..193448f3128 100644
--- a/arch/arm/configs/s3c2410_defconfig
+++ b/arch/arm/configs/s3c2410_defconfig
@@ -3,40 +3,47 @@ CONFIG_SYSVIPC=y
3CONFIG_IKCONFIG=m 3CONFIG_IKCONFIG=m
4CONFIG_IKCONFIG_PROC=y 4CONFIG_IKCONFIG_PROC=y
5CONFIG_LOG_BUF_SHIFT=16 5CONFIG_LOG_BUF_SHIFT=16
6CONFIG_SYSFS_DEPRECATED_V2=y
7CONFIG_BLK_DEV_INITRD=y 6CONFIG_BLK_DEV_INITRD=y
8CONFIG_SLAB=y 7CONFIG_SLAB=y
9CONFIG_MODULES=y 8CONFIG_MODULES=y
10CONFIG_MODULE_UNLOAD=y 9CONFIG_MODULE_UNLOAD=y
11# CONFIG_BLK_DEV_BSG is not set 10# CONFIG_BLK_DEV_BSG is not set
12CONFIG_ARCH_S3C2410=y 11CONFIG_PARTITION_ADVANCED=y
12CONFIG_BSD_DISKLABEL=y
13CONFIG_SOLARIS_X86_PARTITION=y
14CONFIG_ARCH_S3C24XX=y
13CONFIG_S3C_BOOT_ERROR_RESET=y 15CONFIG_S3C_BOOT_ERROR_RESET=y
14CONFIG_S3C_ADC=y 16CONFIG_S3C_ADC=y
15CONFIG_S3C24XX_PWM=y 17CONFIG_S3C24XX_PWM=y
16CONFIG_ARCH_SMDK2410=y 18CONFIG_CPU_S3C2412=y
19CONFIG_CPU_S3C2416=y
20CONFIG_CPU_S3C2440=y
21CONFIG_CPU_S3C2442=y
22CONFIG_CPU_S3C2443=y
23CONFIG_MACH_AML_M5900=y
24CONFIG_ARCH_BAST=y
17CONFIG_ARCH_H1940=y 25CONFIG_ARCH_H1940=y
18CONFIG_MACH_N30=y 26CONFIG_MACH_N30=y
19CONFIG_ARCH_BAST=y
20CONFIG_MACH_OTOM=y 27CONFIG_MACH_OTOM=y
21CONFIG_MACH_AML_M5900=y 28CONFIG_MACH_QT2410=y
29CONFIG_ARCH_SMDK2410=y
22CONFIG_MACH_TCT_HAMMER=y 30CONFIG_MACH_TCT_HAMMER=y
23CONFIG_MACH_VR1000=y 31CONFIG_MACH_VR1000=y
24CONFIG_MACH_QT2410=y
25CONFIG_MACH_JIVE=y 32CONFIG_MACH_JIVE=y
26CONFIG_MACH_SMDK2412=y 33CONFIG_MACH_SMDK2412=y
27CONFIG_MACH_VSTMS=y 34CONFIG_MACH_VSTMS=y
28CONFIG_MACH_SMDK2416=y 35CONFIG_MACH_SMDK2416=y
29CONFIG_MACH_ANUBIS=y 36CONFIG_MACH_ANUBIS=y
30CONFIG_MACH_NEO1973_GTA02=y 37CONFIG_MACH_AT2440EVB=y
38CONFIG_MACH_MINI2440=y
39CONFIG_MACH_NEXCODER_2440=y
31CONFIG_MACH_OSIRIS=y 40CONFIG_MACH_OSIRIS=y
32CONFIG_MACH_OSIRIS_DVS=m 41CONFIG_MACH_OSIRIS_DVS=m
33CONFIG_MACH_RX3715=y 42CONFIG_MACH_RX3715=y
34CONFIG_ARCH_S3C2440=y 43CONFIG_ARCH_S3C2440=y
35CONFIG_MACH_NEXCODER_2440=y 44CONFIG_MACH_NEO1973_GTA02=y
36CONFIG_SMDK2440_CPU2442=y
37CONFIG_MACH_AT2440EVB=y
38CONFIG_MACH_MINI2440=y
39CONFIG_MACH_RX1950=y 45CONFIG_MACH_RX1950=y
46CONFIG_SMDK2440_CPU2442=y
40CONFIG_MACH_SMDK2443=y 47CONFIG_MACH_SMDK2443=y
41# CONFIG_ARM_THUMB is not set 48# CONFIG_ARM_THUMB is not set
42CONFIG_ZBOOT_ROM_TEXT=0x0 49CONFIG_ZBOOT_ROM_TEXT=0x0
@@ -45,7 +52,6 @@ CONFIG_CMDLINE="root=/dev/hda1 ro init=/bin/bash console=ttySAC0"
45CONFIG_FPE_NWFPE=y 52CONFIG_FPE_NWFPE=y
46CONFIG_FPE_NWFPE_XP=y 53CONFIG_FPE_NWFPE_XP=y
47CONFIG_BINFMT_AOUT=y 54CONFIG_BINFMT_AOUT=y
48CONFIG_PM=y
49CONFIG_APM_EMULATION=m 55CONFIG_APM_EMULATION=m
50CONFIG_NET=y 56CONFIG_NET=y
51CONFIG_PACKET=y 57CONFIG_PACKET=y
@@ -58,7 +64,6 @@ CONFIG_IP_PNP=y
58CONFIG_IP_PNP_DHCP=y 64CONFIG_IP_PNP_DHCP=y
59CONFIG_IP_PNP_BOOTP=y 65CONFIG_IP_PNP_BOOTP=y
60CONFIG_NET_IPIP=m 66CONFIG_NET_IPIP=m
61CONFIG_NET_IPGRE=m
62CONFIG_INET_AH=m 67CONFIG_INET_AH=m
63CONFIG_INET_ESP=m 68CONFIG_INET_ESP=m
64CONFIG_INET_IPCOMP=m 69CONFIG_INET_IPCOMP=m
@@ -80,7 +85,6 @@ CONFIG_IPV6_MIP6=m
80CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m 85CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
81CONFIG_IPV6_TUNNEL=m 86CONFIG_IPV6_TUNNEL=m
82CONFIG_NETFILTER=y 87CONFIG_NETFILTER=y
83CONFIG_NETFILTER_NETLINK_QUEUE=m
84CONFIG_NF_CONNTRACK=m 88CONFIG_NF_CONNTRACK=m
85CONFIG_NF_CONNTRACK_EVENTS=y 89CONFIG_NF_CONNTRACK_EVENTS=y
86CONFIG_NF_CT_PROTO_DCCP=m 90CONFIG_NF_CT_PROTO_DCCP=m
@@ -138,7 +142,6 @@ CONFIG_IP_VS=m
138CONFIG_NF_CONNTRACK_IPV4=m 142CONFIG_NF_CONNTRACK_IPV4=m
139CONFIG_IP_NF_QUEUE=m 143CONFIG_IP_NF_QUEUE=m
140CONFIG_IP_NF_IPTABLES=m 144CONFIG_IP_NF_IPTABLES=m
141CONFIG_IP_NF_MATCH_ADDRTYPE=m
142CONFIG_IP_NF_MATCH_AH=m 145CONFIG_IP_NF_MATCH_AH=m
143CONFIG_IP_NF_MATCH_ECN=m 146CONFIG_IP_NF_MATCH_ECN=m
144CONFIG_IP_NF_MATCH_TTL=m 147CONFIG_IP_NF_MATCH_TTL=m
@@ -150,7 +153,6 @@ CONFIG_NF_NAT=m
150CONFIG_IP_NF_TARGET_MASQUERADE=m 153CONFIG_IP_NF_TARGET_MASQUERADE=m
151CONFIG_IP_NF_TARGET_NETMAP=m 154CONFIG_IP_NF_TARGET_NETMAP=m
152CONFIG_IP_NF_TARGET_REDIRECT=m 155CONFIG_IP_NF_TARGET_REDIRECT=m
153CONFIG_NF_NAT_SNMP_BASIC=m
154CONFIG_IP_NF_MANGLE=m 156CONFIG_IP_NF_MANGLE=m
155CONFIG_IP_NF_TARGET_CLUSTERIP=m 157CONFIG_IP_NF_TARGET_CLUSTERIP=m
156CONFIG_IP_NF_TARGET_ECN=m 158CONFIG_IP_NF_TARGET_ECN=m
@@ -177,8 +179,6 @@ CONFIG_IP6_NF_TARGET_REJECT=m
177CONFIG_IP6_NF_MANGLE=m 179CONFIG_IP6_NF_MANGLE=m
178CONFIG_IP6_NF_RAW=m 180CONFIG_IP6_NF_RAW=m
179CONFIG_BT=m 181CONFIG_BT=m
180CONFIG_BT_L2CAP=m
181CONFIG_BT_SCO=m
182CONFIG_BT_RFCOMM=m 182CONFIG_BT_RFCOMM=m
183CONFIG_BT_RFCOMM_TTY=y 183CONFIG_BT_RFCOMM_TTY=y
184CONFIG_BT_BNEP=m 184CONFIG_BT_BNEP=m
@@ -199,7 +199,6 @@ CONFIG_MAC80211_MESH=y
199CONFIG_MAC80211_LEDS=y 199CONFIG_MAC80211_LEDS=y
200CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 200CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
201CONFIG_MTD=y 201CONFIG_MTD=y
202CONFIG_MTD_PARTITIONS=y
203CONFIG_MTD_REDBOOT_PARTS=y 202CONFIG_MTD_REDBOOT_PARTS=y
204CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y 203CONFIG_MTD_REDBOOT_PARTS_UNALLOCATED=y
205CONFIG_MTD_CMDLINE_PARTS=y 204CONFIG_MTD_CMDLINE_PARTS=y
@@ -221,9 +220,6 @@ CONFIG_BLK_DEV_NBD=m
221CONFIG_BLK_DEV_UB=m 220CONFIG_BLK_DEV_UB=m
222CONFIG_BLK_DEV_RAM=y 221CONFIG_BLK_DEV_RAM=y
223CONFIG_ATA_OVER_ETH=m 222CONFIG_ATA_OVER_ETH=m
224CONFIG_EEPROM_AT25=m
225CONFIG_EEPROM_LEGACY=m
226CONFIG_EEPROM_93CX6=m
227CONFIG_IDE=y 223CONFIG_IDE=y
228CONFIG_BLK_DEV_IDECD=y 224CONFIG_BLK_DEV_IDECD=y
229CONFIG_BLK_DEV_IDETAPE=m 225CONFIG_BLK_DEV_IDETAPE=m
@@ -240,7 +236,6 @@ CONFIG_SCSI_MULTI_LUN=y
240CONFIG_SCSI_CONSTANTS=y 236CONFIG_SCSI_CONSTANTS=y
241CONFIG_SCSI_SCAN_ASYNC=y 237CONFIG_SCSI_SCAN_ASYNC=y
242CONFIG_NETDEVICES=y 238CONFIG_NETDEVICES=y
243CONFIG_NET_ETHERNET=y
244CONFIG_DM9000=y 239CONFIG_DM9000=y
245CONFIG_INPUT_EVDEV=y 240CONFIG_INPUT_EVDEV=y
246CONFIG_MOUSE_APPLETOUCH=m 241CONFIG_MOUSE_APPLETOUCH=m
@@ -274,7 +269,6 @@ CONFIG_JOYSTICK_XPAD_LEDS=y
274CONFIG_INPUT_TOUCHSCREEN=y 269CONFIG_INPUT_TOUCHSCREEN=y
275CONFIG_TOUCHSCREEN_USB_COMPOSITE=m 270CONFIG_TOUCHSCREEN_USB_COMPOSITE=m
276CONFIG_INPUT_MISC=y 271CONFIG_INPUT_MISC=y
277CONFIG_INPUT_ATI_REMOTE=m
278CONFIG_INPUT_ATI_REMOTE2=m 272CONFIG_INPUT_ATI_REMOTE2=m
279CONFIG_INPUT_KEYSPAN_REMOTE=m 273CONFIG_INPUT_KEYSPAN_REMOTE=m
280CONFIG_INPUT_POWERMATE=m 274CONFIG_INPUT_POWERMATE=m
@@ -300,7 +294,6 @@ CONFIG_I2C_SIMTEC=y
300CONFIG_SPI=y 294CONFIG_SPI=y
301CONFIG_SPI_GPIO=m 295CONFIG_SPI_GPIO=m
302CONFIG_SPI_S3C24XX=m 296CONFIG_SPI_S3C24XX=m
303CONFIG_SPI_S3C24XX_GPIO=m
304CONFIG_SPI_SPIDEV=m 297CONFIG_SPI_SPIDEV=m
305CONFIG_SPI_TLE62X0=m 298CONFIG_SPI_TLE62X0=m
306CONFIG_SENSORS_LM75=m 299CONFIG_SENSORS_LM75=m
@@ -315,7 +308,6 @@ CONFIG_FB_MODE_HELPERS=y
315CONFIG_FB_S3C2410=y 308CONFIG_FB_S3C2410=y
316CONFIG_FB_SM501=y 309CONFIG_FB_SM501=y
317CONFIG_BACKLIGHT_PWM=m 310CONFIG_BACKLIGHT_PWM=m
318# CONFIG_VGA_CONSOLE is not set
319CONFIG_FRAMEBUFFER_CONSOLE=y 311CONFIG_FRAMEBUFFER_CONSOLE=y
320CONFIG_SOUND=y 312CONFIG_SOUND=y
321CONFIG_SND=y 313CONFIG_SND=y
@@ -330,10 +322,6 @@ CONFIG_SND_VERBOSE_PRINTK=y
330CONFIG_SND_USB_AUDIO=m 322CONFIG_SND_USB_AUDIO=m
331CONFIG_SND_USB_CAIAQ=m 323CONFIG_SND_USB_CAIAQ=m
332CONFIG_SND_SOC=y 324CONFIG_SND_SOC=y
333CONFIG_SND_S3C24XX_SOC=y
334CONFIG_SND_S3C24XX_SOC_JIVE_WM8750=m
335CONFIG_SND_S3C24XX_SOC_SMDK2443_WM9710=m
336CONFIG_SND_S3C24XX_SOC_LN2440SBC_ALC650=m
337# CONFIG_USB_HID is not set 325# CONFIG_USB_HID is not set
338CONFIG_USB=y 326CONFIG_USB=y
339CONFIG_USB_DEVICEFS=y 327CONFIG_USB_DEVICEFS=y
@@ -387,9 +375,7 @@ CONFIG_MMC_TEST=m
387CONFIG_MMC_SDHCI=m 375CONFIG_MMC_SDHCI=m
388CONFIG_MMC_SPI=m 376CONFIG_MMC_SPI=m
389CONFIG_MMC_S3C=y 377CONFIG_MMC_S3C=y
390CONFIG_LEDS_CLASS=m
391CONFIG_LEDS_S3C24XX=m 378CONFIG_LEDS_S3C24XX=m
392CONFIG_LEDS_H1940=m
393CONFIG_LEDS_PCA9532=m 379CONFIG_LEDS_PCA9532=m
394CONFIG_LEDS_GPIO=m 380CONFIG_LEDS_GPIO=m
395CONFIG_LEDS_PCA955X=m 381CONFIG_LEDS_PCA955X=m
@@ -410,8 +396,6 @@ CONFIG_EXT3_FS=y
410CONFIG_EXT3_FS_POSIX_ACL=y 396CONFIG_EXT3_FS_POSIX_ACL=y
411CONFIG_EXT4_FS=m 397CONFIG_EXT4_FS=m
412CONFIG_EXT4_FS_POSIX_ACL=y 398CONFIG_EXT4_FS_POSIX_ACL=y
413CONFIG_INOTIFY=y
414CONFIG_AUTOFS_FS=m
415CONFIG_AUTOFS4_FS=m 399CONFIG_AUTOFS4_FS=m
416CONFIG_FUSE_FS=m 400CONFIG_FUSE_FS=m
417CONFIG_ISO9660_FS=y 401CONFIG_ISO9660_FS=y
@@ -436,9 +420,6 @@ CONFIG_NFSD=m
436CONFIG_NFSD_V3_ACL=y 420CONFIG_NFSD_V3_ACL=y
437CONFIG_NFSD_V4=y 421CONFIG_NFSD_V4=y
438CONFIG_CIFS=m 422CONFIG_CIFS=m
439CONFIG_PARTITION_ADVANCED=y
440CONFIG_BSD_DISKLABEL=y
441CONFIG_SOLARIS_X86_PARTITION=y
442CONFIG_NLS_CODEPAGE_437=y 423CONFIG_NLS_CODEPAGE_437=y
443CONFIG_NLS_CODEPAGE_737=m 424CONFIG_NLS_CODEPAGE_737=m
444CONFIG_NLS_CODEPAGE_775=m 425CONFIG_NLS_CODEPAGE_775=m
@@ -481,9 +462,7 @@ CONFIG_MAGIC_SYSRQ=y
481CONFIG_DEBUG_KERNEL=y 462CONFIG_DEBUG_KERNEL=y
482CONFIG_DEBUG_MUTEXES=y 463CONFIG_DEBUG_MUTEXES=y
483CONFIG_DEBUG_INFO=y 464CONFIG_DEBUG_INFO=y
484# CONFIG_RCU_CPU_STALL_DETECTOR is not set
485CONFIG_SYSCTL_SYSCALL_CHECK=y 465CONFIG_SYSCTL_SYSCALL_CHECK=y
486CONFIG_DEBUG_USER=y 466CONFIG_DEBUG_USER=y
487CONFIG_DEBUG_ERRORS=y
488CONFIG_DEBUG_LL=y 467CONFIG_DEBUG_LL=y
489# CONFIG_CRYPTO_ANSI_CPRNG is not set 468# CONFIG_CRYPTO_ANSI_CPRNG is not set
diff --git a/arch/arm/configs/tct_hammer_defconfig b/arch/arm/configs/tct_hammer_defconfig
index 95c0f0d63db..1d24f8458be 100644
--- a/arch/arm/configs/tct_hammer_defconfig
+++ b/arch/arm/configs/tct_hammer_defconfig
@@ -14,7 +14,7 @@ CONFIG_SLOB=y
14CONFIG_MODULES=y 14CONFIG_MODULES=y
15CONFIG_MODULE_UNLOAD=y 15CONFIG_MODULE_UNLOAD=y
16# CONFIG_BLK_DEV_BSG is not set 16# CONFIG_BLK_DEV_BSG is not set
17CONFIG_ARCH_S3C2410=y 17CONFIG_ARCH_S3C24XX=y
18CONFIG_MACH_TCT_HAMMER=y 18CONFIG_MACH_TCT_HAMMER=y
19CONFIG_ZBOOT_ROM_TEXT=0x0 19CONFIG_ZBOOT_ROM_TEXT=0x0
20CONFIG_ZBOOT_ROM_BSS=0x0 20CONFIG_ZBOOT_ROM_BSS=0x0
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
index 62f8095d46d..23371b17b23 100644
--- a/arch/arm/include/asm/assembler.h
+++ b/arch/arm/include/asm/assembler.h
@@ -137,6 +137,11 @@
137 disable_irq 137 disable_irq
138 .endm 138 .endm
139 139
140 .macro save_and_disable_irqs_notrace, oldcpsr
141 mrs \oldcpsr, cpsr
142 disable_irq_notrace
143 .endm
144
140/* 145/*
141 * Restore interrupt state previously stored in a register. We don't 146 * Restore interrupt state previously stored in a register. We don't
142 * guarantee that this will preserve the flags. 147 * guarantee that this will preserve the flags.
diff --git a/arch/arm/include/asm/hardware/pl330.h b/arch/arm/include/asm/hardware/pl330.h
index 575fa8186ca..c1821385abf 100644
--- a/arch/arm/include/asm/hardware/pl330.h
+++ b/arch/arm/include/asm/hardware/pl330.h
@@ -41,7 +41,7 @@ enum pl330_dstcachectrl {
41 DCCTRL1, /* Bufferable only */ 41 DCCTRL1, /* Bufferable only */
42 DCCTRL2, /* Cacheable, but do not allocate */ 42 DCCTRL2, /* Cacheable, but do not allocate */
43 DCCTRL3, /* Cacheable and bufferable, but do not allocate */ 43 DCCTRL3, /* Cacheable and bufferable, but do not allocate */
44 DINVALID1 = 8, 44 DINVALID1, /* AWCACHE = 0x1000 */
45 DINVALID2, 45 DINVALID2,
46 DCCTRL6, /* Cacheable write-through, allocate on writes only */ 46 DCCTRL6, /* Cacheable write-through, allocate on writes only */
47 DCCTRL7, /* Cacheable write-back, allocate on writes only */ 47 DCCTRL7, /* Cacheable write-back, allocate on writes only */
diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h
index ce280b8d613..cb8d638924f 100644
--- a/arch/arm/include/asm/processor.h
+++ b/arch/arm/include/asm/processor.h
@@ -22,6 +22,7 @@
22#include <asm/hw_breakpoint.h> 22#include <asm/hw_breakpoint.h>
23#include <asm/ptrace.h> 23#include <asm/ptrace.h>
24#include <asm/types.h> 24#include <asm/types.h>
25#include <asm/system.h>
25 26
26#ifdef __KERNEL__ 27#ifdef __KERNEL__
27#define STACK_TOP ((current->personality & ADDR_LIMIT_32BIT) ? \ 28#define STACK_TOP ((current->personality & ADDR_LIMIT_32BIT) ? \
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index e33870ff0ac..ede6443c34d 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -23,6 +23,7 @@
23#include <linux/perf_event.h> 23#include <linux/perf_event.h>
24#include <linux/hw_breakpoint.h> 24#include <linux/hw_breakpoint.h>
25#include <linux/regset.h> 25#include <linux/regset.h>
26#include <linux/audit.h>
26 27
27#include <asm/pgtable.h> 28#include <asm/pgtable.h>
28#include <asm/system.h> 29#include <asm/system.h>
@@ -904,6 +905,12 @@ long arch_ptrace(struct task_struct *child, long request,
904 return ret; 905 return ret;
905} 906}
906 907
908#ifdef __ARMEB__
909#define AUDIT_ARCH_NR AUDIT_ARCH_ARMEB
910#else
911#define AUDIT_ARCH_NR AUDIT_ARCH_ARM
912#endif
913
907asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) 914asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
908{ 915{
909 unsigned long ip; 916 unsigned long ip;
@@ -918,7 +925,7 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
918 if (!ip) 925 if (!ip)
919 audit_syscall_exit(regs); 926 audit_syscall_exit(regs);
920 else 927 else
921 audit_syscall_entry(AUDIT_ARCH_ARMEB, scno, regs->ARM_r0, 928 audit_syscall_entry(AUDIT_ARCH_NR, scno, regs->ARM_r0,
922 regs->ARM_r1, regs->ARM_r2, regs->ARM_r3); 929 regs->ARM_r1, regs->ARM_r2, regs->ARM_r3);
923 930
924 if (!test_thread_flag(TIF_SYSCALL_TRACE)) 931 if (!test_thread_flag(TIF_SYSCALL_TRACE))
diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
index 4285daa077b..7a79b24597b 100644
--- a/arch/arm/kernel/smp_twd.c
+++ b/arch/arm/kernel/smp_twd.c
@@ -129,7 +129,7 @@ static struct notifier_block twd_cpufreq_nb = {
129 129
130static int twd_cpufreq_init(void) 130static int twd_cpufreq_init(void)
131{ 131{
132 if (!IS_ERR(twd_clk)) 132 if (twd_evt && *__this_cpu_ptr(twd_evt) && !IS_ERR(twd_clk))
133 return cpufreq_register_notifier(&twd_cpufreq_nb, 133 return cpufreq_register_notifier(&twd_cpufreq_nb,
134 CPUFREQ_TRANSITION_NOTIFIER); 134 CPUFREQ_TRANSITION_NOTIFIER);
135 135
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 71feb00a1e9..0284e66c47f 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -102,15 +102,6 @@ config ARCH_AT91SAM9G45
102 select HAVE_AT91_DBGU1 102 select HAVE_AT91_DBGU1
103 select AT91_SAM9G45_RESET 103 select AT91_SAM9G45_RESET
104 104
105config ARCH_AT91CAP9
106 bool "AT91CAP9"
107 select CPU_ARM926T
108 select GENERIC_CLOCKEVENTS
109 select HAVE_FB_ATMEL
110 select HAVE_NET_MACB
111 select HAVE_AT91_DBGU1
112 select AT91_SAM9G45_RESET
113
114config ARCH_AT91X40 105config ARCH_AT91X40
115 bool "AT91x40" 106 bool "AT91x40"
116 select ARCH_USES_GETTIMEOFFSET 107 select ARCH_USES_GETTIMEOFFSET
@@ -447,21 +438,6 @@ endif
447 438
448# ---------------------------------------------------------- 439# ----------------------------------------------------------
449 440
450if ARCH_AT91CAP9
451
452comment "AT91CAP9 Board Type"
453
454config MACH_AT91CAP9ADK
455 bool "Atmel AT91CAP9A-DK Evaluation Kit"
456 select HAVE_AT91_DATAFLASH_CARD
457 help
458 Select this if you are using Atmel's AT91CAP9A-DK Evaluation Kit.
459 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4138>
460
461endif
462
463# ----------------------------------------------------------
464
465if ARCH_AT91X40 441if ARCH_AT91X40
466 442
467comment "AT91X40 Board Type" 443comment "AT91X40 Board Type"
@@ -544,7 +520,7 @@ config AT91_EARLY_DBGU0
544 depends on HAVE_AT91_DBGU0 520 depends on HAVE_AT91_DBGU0
545 521
546config AT91_EARLY_DBGU1 522config AT91_EARLY_DBGU1
547 bool "DBGU on 9263, 9g45 and cap9" 523 bool "DBGU on 9263 and 9g45"
548 depends on HAVE_AT91_DBGU1 524 depends on HAVE_AT91_DBGU1
549 525
550config AT91_EARLY_USART0 526config AT91_EARLY_USART0
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 705e1fbded3..aeb76f1690d 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -20,7 +20,6 @@ obj-$(CONFIG_ARCH_AT91SAM9263) += at91sam9263.o at91sam926x_time.o at91sam9263_d
20obj-$(CONFIG_ARCH_AT91SAM9RL) += at91sam9rl.o at91sam926x_time.o at91sam9rl_devices.o sam9_smc.o 20obj-$(CONFIG_ARCH_AT91SAM9RL) += at91sam9rl.o at91sam926x_time.o at91sam9rl_devices.o sam9_smc.o
21obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o 21obj-$(CONFIG_ARCH_AT91SAM9G20) += at91sam9260.o at91sam926x_time.o at91sam9260_devices.o sam9_smc.o
22obj-$(CONFIG_ARCH_AT91SAM9G45) += at91sam9g45.o at91sam926x_time.o at91sam9g45_devices.o sam9_smc.o 22obj-$(CONFIG_ARCH_AT91SAM9G45) += at91sam9g45.o at91sam926x_time.o at91sam9g45_devices.o sam9_smc.o
23obj-$(CONFIG_ARCH_AT91CAP9) += at91cap9.o at91sam926x_time.o at91cap9_devices.o sam9_smc.o
24obj-$(CONFIG_ARCH_AT91X40) += at91x40.o at91x40_time.o 23obj-$(CONFIG_ARCH_AT91X40) += at91x40.o at91x40_time.o
25 24
26# AT91RM9200 board-specific support 25# AT91RM9200 board-specific support
@@ -81,9 +80,6 @@ obj-$(CONFIG_MACH_AT91SAM9M10G45EK) += board-sam9m10g45ek.o
81# AT91SAM board with device-tree 80# AT91SAM board with device-tree
82obj-$(CONFIG_MACH_AT91SAM_DT) += board-dt.o 81obj-$(CONFIG_MACH_AT91SAM_DT) += board-dt.o
83 82
84# AT91CAP9 board-specific support
85obj-$(CONFIG_MACH_AT91CAP9ADK) += board-cap9adk.o
86
87# AT91X40 board-specific support 83# AT91X40 board-specific support
88obj-$(CONFIG_MACH_AT91EB01) += board-eb01.o 84obj-$(CONFIG_MACH_AT91EB01) += board-eb01.o
89 85
diff --git a/arch/arm/mach-at91/Makefile.boot b/arch/arm/mach-at91/Makefile.boot
index 8ddafadfdc7..2fd051eb244 100644
--- a/arch/arm/mach-at91/Makefile.boot
+++ b/arch/arm/mach-at91/Makefile.boot
@@ -3,11 +3,7 @@
3# PARAMS_PHYS must be within 4MB of ZRELADDR 3# PARAMS_PHYS must be within 4MB of ZRELADDR
4# INITRD_PHYS must be in RAM 4# INITRD_PHYS must be in RAM
5 5
6ifeq ($(CONFIG_ARCH_AT91CAP9),y) 6ifeq ($(CONFIG_ARCH_AT91SAM9G45),y)
7 zreladdr-y += 0x70008000
8params_phys-y := 0x70000100
9initrd_phys-y := 0x70410000
10else ifeq ($(CONFIG_ARCH_AT91SAM9G45),y)
11 zreladdr-y += 0x70008000 7 zreladdr-y += 0x70008000
12params_phys-y := 0x70000100 8params_phys-y := 0x70000100
13initrd_phys-y := 0x70410000 9initrd_phys-y := 0x70410000
diff --git a/arch/arm/mach-at91/at91cap9.c b/arch/arm/mach-at91/at91cap9.c
deleted file mode 100644
index 8967d75c2ea..00000000000
--- a/arch/arm/mach-at91/at91cap9.c
+++ /dev/null
@@ -1,404 +0,0 @@
1/*
2 * arch/arm/mach-at91/at91cap9.c
3 *
4 * Copyright (C) 2007 Stelian Pop <stelian.pop@leadtechdesign.com>
5 * Copyright (C) 2007 Lead Tech Design <www.leadtechdesign.com>
6 * Copyright (C) 2007 Atmel Corporation.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 */
14
15#include <linux/module.h>
16
17#include <asm/proc-fns.h>
18#include <asm/irq.h>
19#include <asm/mach/arch.h>
20#include <asm/mach/map.h>
21
22#include <mach/cpu.h>
23#include <mach/at91cap9.h>
24#include <mach/at91_pmc.h>
25
26#include "soc.h"
27#include "generic.h"
28#include "clock.h"
29#include "sam9_smc.h"
30
31/* --------------------------------------------------------------------
32 * Clocks
33 * -------------------------------------------------------------------- */
34
35/*
36 * The peripheral clocks.
37 */
38static struct clk pioABCD_clk = {
39 .name = "pioABCD_clk",
40 .pmc_mask = 1 << AT91CAP9_ID_PIOABCD,
41 .type = CLK_TYPE_PERIPHERAL,
42};
43static struct clk mpb0_clk = {
44 .name = "mpb0_clk",
45 .pmc_mask = 1 << AT91CAP9_ID_MPB0,
46 .type = CLK_TYPE_PERIPHERAL,
47};
48static struct clk mpb1_clk = {
49 .name = "mpb1_clk",
50 .pmc_mask = 1 << AT91CAP9_ID_MPB1,
51 .type = CLK_TYPE_PERIPHERAL,
52};
53static struct clk mpb2_clk = {
54 .name = "mpb2_clk",
55 .pmc_mask = 1 << AT91CAP9_ID_MPB2,
56 .type = CLK_TYPE_PERIPHERAL,
57};
58static struct clk mpb3_clk = {
59 .name = "mpb3_clk",
60 .pmc_mask = 1 << AT91CAP9_ID_MPB3,
61 .type = CLK_TYPE_PERIPHERAL,
62};
63static struct clk mpb4_clk = {
64 .name = "mpb4_clk",
65 .pmc_mask = 1 << AT91CAP9_ID_MPB4,
66 .type = CLK_TYPE_PERIPHERAL,
67};
68static struct clk usart0_clk = {
69 .name = "usart0_clk",
70 .pmc_mask = 1 << AT91CAP9_ID_US0,
71 .type = CLK_TYPE_PERIPHERAL,
72};
73static struct clk usart1_clk = {
74 .name = "usart1_clk",
75 .pmc_mask = 1 << AT91CAP9_ID_US1,
76 .type = CLK_TYPE_PERIPHERAL,
77};
78static struct clk usart2_clk = {
79 .name = "usart2_clk",
80 .pmc_mask = 1 << AT91CAP9_ID_US2,
81 .type = CLK_TYPE_PERIPHERAL,
82};
83static struct clk mmc0_clk = {
84 .name = "mci0_clk",
85 .pmc_mask = 1 << AT91CAP9_ID_MCI0,
86 .type = CLK_TYPE_PERIPHERAL,
87};
88static struct clk mmc1_clk = {
89 .name = "mci1_clk",
90 .pmc_mask = 1 << AT91CAP9_ID_MCI1,
91 .type = CLK_TYPE_PERIPHERAL,
92};
93static struct clk can_clk = {
94 .name = "can_clk",
95 .pmc_mask = 1 << AT91CAP9_ID_CAN,
96 .type = CLK_TYPE_PERIPHERAL,
97};
98static struct clk twi_clk = {
99 .name = "twi_clk",
100 .pmc_mask = 1 << AT91CAP9_ID_TWI,
101 .type = CLK_TYPE_PERIPHERAL,
102};
103static struct clk spi0_clk = {
104 .name = "spi0_clk",
105 .pmc_mask = 1 << AT91CAP9_ID_SPI0,
106 .type = CLK_TYPE_PERIPHERAL,
107};
108static struct clk spi1_clk = {
109 .name = "spi1_clk",
110 .pmc_mask = 1 << AT91CAP9_ID_SPI1,
111 .type = CLK_TYPE_PERIPHERAL,
112};
113static struct clk ssc0_clk = {
114 .name = "ssc0_clk",
115 .pmc_mask = 1 << AT91CAP9_ID_SSC0,
116 .type = CLK_TYPE_PERIPHERAL,
117};
118static struct clk ssc1_clk = {
119 .name = "ssc1_clk",
120 .pmc_mask = 1 << AT91CAP9_ID_SSC1,
121 .type = CLK_TYPE_PERIPHERAL,
122};
123static struct clk ac97_clk = {
124 .name = "ac97_clk",
125 .pmc_mask = 1 << AT91CAP9_ID_AC97C,
126 .type = CLK_TYPE_PERIPHERAL,
127};
128static struct clk tcb_clk = {
129 .name = "tcb_clk",
130 .pmc_mask = 1 << AT91CAP9_ID_TCB,
131 .type = CLK_TYPE_PERIPHERAL,
132};
133static struct clk pwm_clk = {
134 .name = "pwm_clk",
135 .pmc_mask = 1 << AT91CAP9_ID_PWMC,
136 .type = CLK_TYPE_PERIPHERAL,
137};
138static struct clk macb_clk = {
139 .name = "pclk",
140 .pmc_mask = 1 << AT91CAP9_ID_EMAC,
141 .type = CLK_TYPE_PERIPHERAL,
142};
143static struct clk aestdes_clk = {
144 .name = "aestdes_clk",
145 .pmc_mask = 1 << AT91CAP9_ID_AESTDES,
146 .type = CLK_TYPE_PERIPHERAL,
147};
148static struct clk adc_clk = {
149 .name = "adc_clk",
150 .pmc_mask = 1 << AT91CAP9_ID_ADC,
151 .type = CLK_TYPE_PERIPHERAL,
152};
153static struct clk isi_clk = {
154 .name = "isi_clk",
155 .pmc_mask = 1 << AT91CAP9_ID_ISI,
156 .type = CLK_TYPE_PERIPHERAL,
157};
158static struct clk lcdc_clk = {
159 .name = "lcdc_clk",
160 .pmc_mask = 1 << AT91CAP9_ID_LCDC,
161 .type = CLK_TYPE_PERIPHERAL,
162};
163static struct clk dma_clk = {
164 .name = "dma_clk",
165 .pmc_mask = 1 << AT91CAP9_ID_DMA,
166 .type = CLK_TYPE_PERIPHERAL,
167};
168static struct clk udphs_clk = {
169 .name = "udphs_clk",
170 .pmc_mask = 1 << AT91CAP9_ID_UDPHS,
171 .type = CLK_TYPE_PERIPHERAL,
172};
173static struct clk ohci_clk = {
174 .name = "ohci_clk",
175 .pmc_mask = 1 << AT91CAP9_ID_UHP,
176 .type = CLK_TYPE_PERIPHERAL,
177};
178
179static struct clk *periph_clocks[] __initdata = {
180 &pioABCD_clk,
181 &mpb0_clk,
182 &mpb1_clk,
183 &mpb2_clk,
184 &mpb3_clk,
185 &mpb4_clk,
186 &usart0_clk,
187 &usart1_clk,
188 &usart2_clk,
189 &mmc0_clk,
190 &mmc1_clk,
191 &can_clk,
192 &twi_clk,
193 &spi0_clk,
194 &spi1_clk,
195 &ssc0_clk,
196 &ssc1_clk,
197 &ac97_clk,
198 &tcb_clk,
199 &pwm_clk,
200 &macb_clk,
201 &aestdes_clk,
202 &adc_clk,
203 &isi_clk,
204 &lcdc_clk,
205 &dma_clk,
206 &udphs_clk,
207 &ohci_clk,
208 // irq0 .. irq1
209};
210
211static struct clk_lookup periph_clocks_lookups[] = {
212 /* One additional fake clock for macb_hclk */
213 CLKDEV_CON_ID("hclk", &macb_clk),
214 CLKDEV_CON_DEV_ID("hclk", "atmel_usba_udc", &utmi_clk),
215 CLKDEV_CON_DEV_ID("pclk", "atmel_usba_udc", &udphs_clk),
216 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.0", &mmc0_clk),
217 CLKDEV_CON_DEV_ID("mci_clk", "at91_mci.1", &mmc1_clk),
218 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.0", &spi0_clk),
219 CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
220 CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk),
221 CLKDEV_CON_DEV_ID("pclk", "ssc.0", &ssc0_clk),
222 CLKDEV_CON_DEV_ID("pclk", "ssc.1", &ssc1_clk),
223 /* fake hclk clock */
224 CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
225 CLKDEV_CON_ID("pioA", &pioABCD_clk),
226 CLKDEV_CON_ID("pioB", &pioABCD_clk),
227 CLKDEV_CON_ID("pioC", &pioABCD_clk),
228 CLKDEV_CON_ID("pioD", &pioABCD_clk),
229};
230
231static struct clk_lookup usart_clocks_lookups[] = {
232 CLKDEV_CON_DEV_ID("usart", "atmel_usart.0", &mck),
233 CLKDEV_CON_DEV_ID("usart", "atmel_usart.1", &usart0_clk),
234 CLKDEV_CON_DEV_ID("usart", "atmel_usart.2", &usart1_clk),
235 CLKDEV_CON_DEV_ID("usart", "atmel_usart.3", &usart2_clk),
236};
237
238/*
239 * The four programmable clocks.
240 * You must configure pin multiplexing to bring these signals out.
241 */
242static struct clk pck0 = {
243 .name = "pck0",
244 .pmc_mask = AT91_PMC_PCK0,
245 .type = CLK_TYPE_PROGRAMMABLE,
246 .id = 0,
247};
248static struct clk pck1 = {
249 .name = "pck1",
250 .pmc_mask = AT91_PMC_PCK1,
251 .type = CLK_TYPE_PROGRAMMABLE,
252 .id = 1,
253};
254static struct clk pck2 = {
255 .name = "pck2",
256 .pmc_mask = AT91_PMC_PCK2,
257 .type = CLK_TYPE_PROGRAMMABLE,
258 .id = 2,
259};
260static struct clk pck3 = {
261 .name = "pck3",
262 .pmc_mask = AT91_PMC_PCK3,
263 .type = CLK_TYPE_PROGRAMMABLE,
264 .id = 3,
265};
266
267static void __init at91cap9_register_clocks(void)
268{
269 int i;
270
271 for (i = 0; i < ARRAY_SIZE(periph_clocks); i++)
272 clk_register(periph_clocks[i]);
273
274 clkdev_add_table(periph_clocks_lookups,
275 ARRAY_SIZE(periph_clocks_lookups));
276 clkdev_add_table(usart_clocks_lookups,
277 ARRAY_SIZE(usart_clocks_lookups));
278
279 clk_register(&pck0);
280 clk_register(&pck1);
281 clk_register(&pck2);
282 clk_register(&pck3);
283}
284
285static struct clk_lookup console_clock_lookup;
286
287void __init at91cap9_set_console_clock(int id)
288{
289 if (id >= ARRAY_SIZE(usart_clocks_lookups))
290 return;
291
292 console_clock_lookup.con_id = "usart";
293 console_clock_lookup.clk = usart_clocks_lookups[id].clk;
294 clkdev_add(&console_clock_lookup);
295}
296
297/* --------------------------------------------------------------------
298 * GPIO
299 * -------------------------------------------------------------------- */
300
301static struct at91_gpio_bank at91cap9_gpio[] __initdata = {
302 {
303 .id = AT91CAP9_ID_PIOABCD,
304 .regbase = AT91CAP9_BASE_PIOA,
305 }, {
306 .id = AT91CAP9_ID_PIOABCD,
307 .regbase = AT91CAP9_BASE_PIOB,
308 }, {
309 .id = AT91CAP9_ID_PIOABCD,
310 .regbase = AT91CAP9_BASE_PIOC,
311 }, {
312 .id = AT91CAP9_ID_PIOABCD,
313 .regbase = AT91CAP9_BASE_PIOD,
314 }
315};
316
317static void at91cap9_idle(void)
318{
319 at91_sys_write(AT91_PMC_SCDR, AT91_PMC_PCK);
320 cpu_do_idle();
321}
322
323/* --------------------------------------------------------------------
324 * AT91CAP9 processor initialization
325 * -------------------------------------------------------------------- */
326
327static void __init at91cap9_map_io(void)
328{
329 at91_init_sram(0, AT91CAP9_SRAM_BASE, AT91CAP9_SRAM_SIZE);
330}
331
332static void __init at91cap9_ioremap_registers(void)
333{
334 at91_ioremap_shdwc(AT91CAP9_BASE_SHDWC);
335 at91_ioremap_rstc(AT91CAP9_BASE_RSTC);
336 at91sam926x_ioremap_pit(AT91CAP9_BASE_PIT);
337 at91sam9_ioremap_smc(0, AT91CAP9_BASE_SMC);
338}
339
340static void __init at91cap9_initialize(void)
341{
342 arm_pm_idle = at91cap9_idle;
343 arm_pm_restart = at91sam9g45_restart;
344 at91_extern_irq = (1 << AT91CAP9_ID_IRQ0) | (1 << AT91CAP9_ID_IRQ1);
345
346 /* Register GPIO subsystem */
347 at91_gpio_init(at91cap9_gpio, 4);
348
349 /* Remember the silicon revision */
350 if (cpu_is_at91cap9_revB())
351 system_rev = 0xB;
352 else if (cpu_is_at91cap9_revC())
353 system_rev = 0xC;
354}
355
356/* --------------------------------------------------------------------
357 * Interrupt initialization
358 * -------------------------------------------------------------------- */
359
360/*
361 * The default interrupt priority levels (0 = lowest, 7 = highest).
362 */
363static unsigned int at91cap9_default_irq_priority[NR_AIC_IRQS] __initdata = {
364 7, /* Advanced Interrupt Controller (FIQ) */
365 7, /* System Peripherals */
366 1, /* Parallel IO Controller A, B, C and D */
367 0, /* MP Block Peripheral 0 */
368 0, /* MP Block Peripheral 1 */
369 0, /* MP Block Peripheral 2 */
370 0, /* MP Block Peripheral 3 */
371 0, /* MP Block Peripheral 4 */
372 5, /* USART 0 */
373 5, /* USART 1 */
374 5, /* USART 2 */
375 0, /* Multimedia Card Interface 0 */
376 0, /* Multimedia Card Interface 1 */
377 3, /* CAN */
378 6, /* Two-Wire Interface */
379 5, /* Serial Peripheral Interface 0 */
380 5, /* Serial Peripheral Interface 1 */
381 4, /* Serial Synchronous Controller 0 */
382 4, /* Serial Synchronous Controller 1 */
383 5, /* AC97 Controller */
384 0, /* Timer Counter 0, 1 and 2 */
385 0, /* Pulse Width Modulation Controller */
386 3, /* Ethernet */
387 0, /* Advanced Encryption Standard, Triple DES*/
388 0, /* Analog-to-Digital Converter */
389 0, /* Image Sensor Interface */
390 3, /* LCD Controller */
391 0, /* DMA Controller */
392 2, /* USB Device Port */
393 2, /* USB Host port */
394 0, /* Advanced Interrupt Controller (IRQ0) */
395 0, /* Advanced Interrupt Controller (IRQ1) */
396};
397
398struct at91_init_soc __initdata at91cap9_soc = {
399 .map_io = at91cap9_map_io,
400 .default_irq_priority = at91cap9_default_irq_priority,
401 .ioremap_registers = at91cap9_ioremap_registers,
402 .register_clocks = at91cap9_register_clocks,
403 .init = at91cap9_initialize,
404};
diff --git a/arch/arm/mach-at91/at91cap9_devices.c b/arch/arm/mach-at91/at91cap9_devices.c
deleted file mode 100644
index d298fb7cb21..00000000000
--- a/arch/arm/mach-at91/at91cap9_devices.c
+++ /dev/null
@@ -1,1273 +0,0 @@
1/*
2 * arch/arm/mach-at91/at91cap9_devices.c
3 *
4 * Copyright (C) 2007 Stelian Pop <stelian.pop@leadtechdesign.com>
5 * Copyright (C) 2007 Lead Tech Design <www.leadtechdesign.com>
6 * Copyright (C) 2007 Atmel Corporation.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 */
14#include <asm/mach/arch.h>
15#include <asm/mach/map.h>
16#include <asm/mach/irq.h>
17
18#include <linux/dma-mapping.h>
19#include <linux/gpio.h>
20#include <linux/platform_device.h>
21#include <linux/i2c-gpio.h>
22
23#include <video/atmel_lcdc.h>
24
25#include <mach/board.h>
26#include <mach/cpu.h>
27#include <mach/at91cap9.h>
28#include <mach/at91cap9_matrix.h>
29#include <mach/at91sam9_smc.h>
30
31#include "generic.h"
32
33
34/* --------------------------------------------------------------------
35 * USB Host
36 * -------------------------------------------------------------------- */
37
38#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
39static u64 ohci_dmamask = DMA_BIT_MASK(32);
40static struct at91_usbh_data usbh_data;
41
42static struct resource usbh_resources[] = {
43 [0] = {
44 .start = AT91CAP9_UHP_BASE,
45 .end = AT91CAP9_UHP_BASE + SZ_1M - 1,
46 .flags = IORESOURCE_MEM,
47 },
48 [1] = {
49 .start = AT91CAP9_ID_UHP,
50 .end = AT91CAP9_ID_UHP,
51 .flags = IORESOURCE_IRQ,
52 },
53};
54
55static struct platform_device at91_usbh_device = {
56 .name = "at91_ohci",
57 .id = -1,
58 .dev = {
59 .dma_mask = &ohci_dmamask,
60 .coherent_dma_mask = DMA_BIT_MASK(32),
61 .platform_data = &usbh_data,
62 },
63 .resource = usbh_resources,
64 .num_resources = ARRAY_SIZE(usbh_resources),
65};
66
67void __init at91_add_device_usbh(struct at91_usbh_data *data)
68{
69 int i;
70
71 if (!data)
72 return;
73
74 if (cpu_is_at91cap9_revB())
75 irq_set_irq_type(AT91CAP9_ID_UHP, IRQ_TYPE_LEVEL_HIGH);
76
77 /* Enable VBus control for UHP ports */
78 for (i = 0; i < data->ports; i++) {
79 if (gpio_is_valid(data->vbus_pin[i]))
80 at91_set_gpio_output(data->vbus_pin[i], 0);
81 }
82
83 /* Enable overcurrent notification */
84 for (i = 0; i < data->ports; i++) {
85 if (data->overcurrent_pin[i])
86 at91_set_gpio_input(data->overcurrent_pin[i], 1);
87 }
88
89 usbh_data = *data;
90 platform_device_register(&at91_usbh_device);
91}
92#else
93void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
94#endif
95
96
97/* --------------------------------------------------------------------
98 * USB HS Device (Gadget)
99 * -------------------------------------------------------------------- */
100
101#if defined(CONFIG_USB_ATMEL_USBA) || defined(CONFIG_USB_ATMEL_USBA_MODULE)
102
103static struct resource usba_udc_resources[] = {
104 [0] = {
105 .start = AT91CAP9_UDPHS_FIFO,
106 .end = AT91CAP9_UDPHS_FIFO + SZ_512K - 1,
107 .flags = IORESOURCE_MEM,
108 },
109 [1] = {
110 .start = AT91CAP9_BASE_UDPHS,
111 .end = AT91CAP9_BASE_UDPHS + SZ_1K - 1,
112 .flags = IORESOURCE_MEM,
113 },
114 [2] = {
115 .start = AT91CAP9_ID_UDPHS,
116 .end = AT91CAP9_ID_UDPHS,
117 .flags = IORESOURCE_IRQ,
118 },
119};
120
121#define EP(nam, idx, maxpkt, maxbk, dma, isoc) \
122 [idx] = { \
123 .name = nam, \
124 .index = idx, \
125 .fifo_size = maxpkt, \
126 .nr_banks = maxbk, \
127 .can_dma = dma, \
128 .can_isoc = isoc, \
129 }
130
131static struct usba_ep_data usba_udc_ep[] = {
132 EP("ep0", 0, 64, 1, 0, 0),
133 EP("ep1", 1, 1024, 3, 1, 1),
134 EP("ep2", 2, 1024, 3, 1, 1),
135 EP("ep3", 3, 1024, 2, 1, 1),
136 EP("ep4", 4, 1024, 2, 1, 1),
137 EP("ep5", 5, 1024, 2, 1, 0),
138 EP("ep6", 6, 1024, 2, 1, 0),
139 EP("ep7", 7, 1024, 2, 0, 0),
140};
141
142#undef EP
143
144/*
145 * pdata doesn't have room for any endpoints, so we need to
146 * append room for the ones we need right after it.
147 */
148static struct {
149 struct usba_platform_data pdata;
150 struct usba_ep_data ep[8];
151} usba_udc_data;
152
153static struct platform_device at91_usba_udc_device = {
154 .name = "atmel_usba_udc",
155 .id = -1,
156 .dev = {
157 .platform_data = &usba_udc_data.pdata,
158 },
159 .resource = usba_udc_resources,
160 .num_resources = ARRAY_SIZE(usba_udc_resources),
161};
162
163void __init at91_add_device_usba(struct usba_platform_data *data)
164{
165 if (cpu_is_at91cap9_revB()) {
166 irq_set_irq_type(AT91CAP9_ID_UDPHS, IRQ_TYPE_LEVEL_HIGH);
167 at91_sys_write(AT91_MATRIX_UDPHS, AT91_MATRIX_SELECT_UDPHS |
168 AT91_MATRIX_UDPHS_BYPASS_LOCK);
169 }
170 else
171 at91_sys_write(AT91_MATRIX_UDPHS, AT91_MATRIX_SELECT_UDPHS);
172
173 /*
174 * Invalid pins are 0 on AT91, but the usba driver is shared
175 * with AVR32, which use negative values instead. Once/if
176 * gpio_is_valid() is ported to AT91, revisit this code.
177 */
178 usba_udc_data.pdata.vbus_pin = -EINVAL;
179 usba_udc_data.pdata.num_ep = ARRAY_SIZE(usba_udc_ep);
180 memcpy(usba_udc_data.ep, usba_udc_ep, sizeof(usba_udc_ep));
181
182 if (data && gpio_is_valid(data->vbus_pin)) {
183 at91_set_gpio_input(data->vbus_pin, 0);
184 at91_set_deglitch(data->vbus_pin, 1);
185 usba_udc_data.pdata.vbus_pin = data->vbus_pin;
186 }
187
188 /* Pullup pin is handled internally by USB device peripheral */
189
190 platform_device_register(&at91_usba_udc_device);
191}
192#else
193void __init at91_add_device_usba(struct usba_platform_data *data) {}
194#endif
195
196
197/* --------------------------------------------------------------------
198 * Ethernet
199 * -------------------------------------------------------------------- */
200
201#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
202static u64 eth_dmamask = DMA_BIT_MASK(32);
203static struct macb_platform_data eth_data;
204
205static struct resource eth_resources[] = {
206 [0] = {
207 .start = AT91CAP9_BASE_EMAC,
208 .end = AT91CAP9_BASE_EMAC + SZ_16K - 1,
209 .flags = IORESOURCE_MEM,
210 },
211 [1] = {
212 .start = AT91CAP9_ID_EMAC,
213 .end = AT91CAP9_ID_EMAC,
214 .flags = IORESOURCE_IRQ,
215 },
216};
217
218static struct platform_device at91cap9_eth_device = {
219 .name = "macb",
220 .id = -1,
221 .dev = {
222 .dma_mask = &eth_dmamask,
223 .coherent_dma_mask = DMA_BIT_MASK(32),
224 .platform_data = &eth_data,
225 },
226 .resource = eth_resources,
227 .num_resources = ARRAY_SIZE(eth_resources),
228};
229
230void __init at91_add_device_eth(struct macb_platform_data *data)
231{
232 if (!data)
233 return;
234
235 if (gpio_is_valid(data->phy_irq_pin)) {
236 at91_set_gpio_input(data->phy_irq_pin, 0);
237 at91_set_deglitch(data->phy_irq_pin, 1);
238 }
239
240 /* Pins used for MII and RMII */
241 at91_set_A_periph(AT91_PIN_PB21, 0); /* ETXCK_EREFCK */
242 at91_set_A_periph(AT91_PIN_PB22, 0); /* ERXDV */
243 at91_set_A_periph(AT91_PIN_PB25, 0); /* ERX0 */
244 at91_set_A_periph(AT91_PIN_PB26, 0); /* ERX1 */
245 at91_set_A_periph(AT91_PIN_PB27, 0); /* ERXER */
246 at91_set_A_periph(AT91_PIN_PB28, 0); /* ETXEN */
247 at91_set_A_periph(AT91_PIN_PB23, 0); /* ETX0 */
248 at91_set_A_periph(AT91_PIN_PB24, 0); /* ETX1 */
249 at91_set_A_periph(AT91_PIN_PB30, 0); /* EMDIO */
250 at91_set_A_periph(AT91_PIN_PB29, 0); /* EMDC */
251
252 if (!data->is_rmii) {
253 at91_set_B_periph(AT91_PIN_PC25, 0); /* ECRS */
254 at91_set_B_periph(AT91_PIN_PC26, 0); /* ECOL */
255 at91_set_B_periph(AT91_PIN_PC22, 0); /* ERX2 */
256 at91_set_B_periph(AT91_PIN_PC23, 0); /* ERX3 */
257 at91_set_B_periph(AT91_PIN_PC27, 0); /* ERXCK */
258 at91_set_B_periph(AT91_PIN_PC20, 0); /* ETX2 */
259 at91_set_B_periph(AT91_PIN_PC21, 0); /* ETX3 */
260 at91_set_B_periph(AT91_PIN_PC24, 0); /* ETXER */
261 }
262
263 eth_data = *data;
264 platform_device_register(&at91cap9_eth_device);
265}
266#else
267void __init at91_add_device_eth(struct macb_platform_data *data) {}
268#endif
269
270
271/* --------------------------------------------------------------------
272 * MMC / SD
273 * -------------------------------------------------------------------- */
274
275#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
276static u64 mmc_dmamask = DMA_BIT_MASK(32);
277static struct at91_mmc_data mmc0_data, mmc1_data;
278
279static struct resource mmc0_resources[] = {
280 [0] = {
281 .start = AT91CAP9_BASE_MCI0,
282 .end = AT91CAP9_BASE_MCI0 + SZ_16K - 1,
283 .flags = IORESOURCE_MEM,
284 },
285 [1] = {
286 .start = AT91CAP9_ID_MCI0,
287 .end = AT91CAP9_ID_MCI0,
288 .flags = IORESOURCE_IRQ,
289 },
290};
291
292static struct platform_device at91cap9_mmc0_device = {
293 .name = "at91_mci",
294 .id = 0,
295 .dev = {
296 .dma_mask = &mmc_dmamask,
297 .coherent_dma_mask = DMA_BIT_MASK(32),
298 .platform_data = &mmc0_data,
299 },
300 .resource = mmc0_resources,
301 .num_resources = ARRAY_SIZE(mmc0_resources),
302};
303
304static struct resource mmc1_resources[] = {
305 [0] = {
306 .start = AT91CAP9_BASE_MCI1,
307 .end = AT91CAP9_BASE_MCI1 + SZ_16K - 1,
308 .flags = IORESOURCE_MEM,
309 },
310 [1] = {
311 .start = AT91CAP9_ID_MCI1,
312 .end = AT91CAP9_ID_MCI1,
313 .flags = IORESOURCE_IRQ,
314 },
315};
316
317static struct platform_device at91cap9_mmc1_device = {
318 .name = "at91_mci",
319 .id = 1,
320 .dev = {
321 .dma_mask = &mmc_dmamask,
322 .coherent_dma_mask = DMA_BIT_MASK(32),
323 .platform_data = &mmc1_data,
324 },
325 .resource = mmc1_resources,
326 .num_resources = ARRAY_SIZE(mmc1_resources),
327};
328
329void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data)
330{
331 if (!data)
332 return;
333
334 /* input/irq */
335 if (gpio_is_valid(data->det_pin)) {
336 at91_set_gpio_input(data->det_pin, 1);
337 at91_set_deglitch(data->det_pin, 1);
338 }
339 if (gpio_is_valid(data->wp_pin))
340 at91_set_gpio_input(data->wp_pin, 1);
341 if (gpio_is_valid(data->vcc_pin))
342 at91_set_gpio_output(data->vcc_pin, 0);
343
344 if (mmc_id == 0) { /* MCI0 */
345 /* CLK */
346 at91_set_A_periph(AT91_PIN_PA2, 0);
347
348 /* CMD */
349 at91_set_A_periph(AT91_PIN_PA1, 1);
350
351 /* DAT0, maybe DAT1..DAT3 */
352 at91_set_A_periph(AT91_PIN_PA0, 1);
353 if (data->wire4) {
354 at91_set_A_periph(AT91_PIN_PA3, 1);
355 at91_set_A_periph(AT91_PIN_PA4, 1);
356 at91_set_A_periph(AT91_PIN_PA5, 1);
357 }
358
359 mmc0_data = *data;
360 platform_device_register(&at91cap9_mmc0_device);
361 } else { /* MCI1 */
362 /* CLK */
363 at91_set_A_periph(AT91_PIN_PA16, 0);
364
365 /* CMD */
366 at91_set_A_periph(AT91_PIN_PA17, 1);
367
368 /* DAT0, maybe DAT1..DAT3 */
369 at91_set_A_periph(AT91_PIN_PA18, 1);
370 if (data->wire4) {
371 at91_set_A_periph(AT91_PIN_PA19, 1);
372 at91_set_A_periph(AT91_PIN_PA20, 1);
373 at91_set_A_periph(AT91_PIN_PA21, 1);
374 }
375
376 mmc1_data = *data;
377 platform_device_register(&at91cap9_mmc1_device);
378 }
379}
380#else
381void __init at91_add_device_mmc(short mmc_id, struct at91_mmc_data *data) {}
382#endif
383
384
385/* --------------------------------------------------------------------
386 * NAND / SmartMedia
387 * -------------------------------------------------------------------- */
388
389#if defined(CONFIG_MTD_NAND_ATMEL) || defined(CONFIG_MTD_NAND_ATMEL_MODULE)
390static struct atmel_nand_data nand_data;
391
392#define NAND_BASE AT91_CHIPSELECT_3
393
394static struct resource nand_resources[] = {
395 [0] = {
396 .start = NAND_BASE,
397 .end = NAND_BASE + SZ_256M - 1,
398 .flags = IORESOURCE_MEM,
399 },
400 [1] = {
401 .start = AT91CAP9_BASE_ECC,
402 .end = AT91CAP9_BASE_ECC + SZ_512 - 1,
403 .flags = IORESOURCE_MEM,
404 }
405};
406
407static struct platform_device at91cap9_nand_device = {
408 .name = "atmel_nand",
409 .id = -1,
410 .dev = {
411 .platform_data = &nand_data,
412 },
413 .resource = nand_resources,
414 .num_resources = ARRAY_SIZE(nand_resources),
415};
416
417void __init at91_add_device_nand(struct atmel_nand_data *data)
418{
419 unsigned long csa;
420
421 if (!data)
422 return;
423
424 csa = at91_sys_read(AT91_MATRIX_EBICSA);
425 at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA);
426
427 /* enable pin */
428 if (gpio_is_valid(data->enable_pin))
429 at91_set_gpio_output(data->enable_pin, 1);
430
431 /* ready/busy pin */
432 if (gpio_is_valid(data->rdy_pin))
433 at91_set_gpio_input(data->rdy_pin, 1);
434
435 /* card detect pin */
436 if (gpio_is_valid(data->det_pin))
437 at91_set_gpio_input(data->det_pin, 1);
438
439 nand_data = *data;
440 platform_device_register(&at91cap9_nand_device);
441}
442#else
443void __init at91_add_device_nand(struct atmel_nand_data *data) {}
444#endif
445
446
447/* --------------------------------------------------------------------
448 * TWI (i2c)
449 * -------------------------------------------------------------------- */
450
451/*
452 * Prefer the GPIO code since the TWI controller isn't robust
453 * (gets overruns and underruns under load) and can only issue
454 * repeated STARTs in one scenario (the driver doesn't yet handle them).
455 */
456#if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE)
457
458static struct i2c_gpio_platform_data pdata = {
459 .sda_pin = AT91_PIN_PB4,
460 .sda_is_open_drain = 1,
461 .scl_pin = AT91_PIN_PB5,
462 .scl_is_open_drain = 1,
463 .udelay = 2, /* ~100 kHz */
464};
465
466static struct platform_device at91cap9_twi_device = {
467 .name = "i2c-gpio",
468 .id = -1,
469 .dev.platform_data = &pdata,
470};
471
472void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
473{
474 at91_set_GPIO_periph(AT91_PIN_PB4, 1); /* TWD (SDA) */
475 at91_set_multi_drive(AT91_PIN_PB4, 1);
476
477 at91_set_GPIO_periph(AT91_PIN_PB5, 1); /* TWCK (SCL) */
478 at91_set_multi_drive(AT91_PIN_PB5, 1);
479
480 i2c_register_board_info(0, devices, nr_devices);
481 platform_device_register(&at91cap9_twi_device);
482}
483
484#elif defined(CONFIG_I2C_AT91) || defined(CONFIG_I2C_AT91_MODULE)
485
486static struct resource twi_resources[] = {
487 [0] = {
488 .start = AT91CAP9_BASE_TWI,
489 .end = AT91CAP9_BASE_TWI + SZ_16K - 1,
490 .flags = IORESOURCE_MEM,
491 },
492 [1] = {
493 .start = AT91CAP9_ID_TWI,
494 .end = AT91CAP9_ID_TWI,
495 .flags = IORESOURCE_IRQ,
496 },
497};
498
499static struct platform_device at91cap9_twi_device = {
500 .name = "at91_i2c",
501 .id = -1,
502 .resource = twi_resources,
503 .num_resources = ARRAY_SIZE(twi_resources),
504};
505
506void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
507{
508 /* pins used for TWI interface */
509 at91_set_B_periph(AT91_PIN_PB4, 0); /* TWD */
510 at91_set_multi_drive(AT91_PIN_PB4, 1);
511
512 at91_set_B_periph(AT91_PIN_PB5, 0); /* TWCK */
513 at91_set_multi_drive(AT91_PIN_PB5, 1);
514
515 i2c_register_board_info(0, devices, nr_devices);
516 platform_device_register(&at91cap9_twi_device);
517}
518#else
519void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) {}
520#endif
521
522/* --------------------------------------------------------------------
523 * SPI
524 * -------------------------------------------------------------------- */
525
526#if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
527static u64 spi_dmamask = DMA_BIT_MASK(32);
528
529static struct resource spi0_resources[] = {
530 [0] = {
531 .start = AT91CAP9_BASE_SPI0,
532 .end = AT91CAP9_BASE_SPI0 + SZ_16K - 1,
533 .flags = IORESOURCE_MEM,
534 },
535 [1] = {
536 .start = AT91CAP9_ID_SPI0,
537 .end = AT91CAP9_ID_SPI0,
538 .flags = IORESOURCE_IRQ,
539 },
540};
541
542static struct platform_device at91cap9_spi0_device = {
543 .name = "atmel_spi",
544 .id = 0,
545 .dev = {
546 .dma_mask = &spi_dmamask,
547 .coherent_dma_mask = DMA_BIT_MASK(32),
548 },
549 .resource = spi0_resources,
550 .num_resources = ARRAY_SIZE(spi0_resources),
551};
552
553static const unsigned spi0_standard_cs[4] = { AT91_PIN_PA5, AT91_PIN_PA3, AT91_PIN_PD0, AT91_PIN_PD1 };
554
555static struct resource spi1_resources[] = {
556 [0] = {
557 .start = AT91CAP9_BASE_SPI1,
558 .end = AT91CAP9_BASE_SPI1 + SZ_16K - 1,
559 .flags = IORESOURCE_MEM,
560 },
561 [1] = {
562 .start = AT91CAP9_ID_SPI1,
563 .end = AT91CAP9_ID_SPI1,
564 .flags = IORESOURCE_IRQ,
565 },
566};
567
568static struct platform_device at91cap9_spi1_device = {
569 .name = "atmel_spi",
570 .id = 1,
571 .dev = {
572 .dma_mask = &spi_dmamask,
573 .coherent_dma_mask = DMA_BIT_MASK(32),
574 },
575 .resource = spi1_resources,
576 .num_resources = ARRAY_SIZE(spi1_resources),
577};
578
579static const unsigned spi1_standard_cs[4] = { AT91_PIN_PB15, AT91_PIN_PB16, AT91_PIN_PB17, AT91_PIN_PB18 };
580
581void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
582{
583 int i;
584 unsigned long cs_pin;
585 short enable_spi0 = 0;
586 short enable_spi1 = 0;
587
588 /* Choose SPI chip-selects */
589 for (i = 0; i < nr_devices; i++) {
590 if (devices[i].controller_data)
591 cs_pin = (unsigned long) devices[i].controller_data;
592 else if (devices[i].bus_num == 0)
593 cs_pin = spi0_standard_cs[devices[i].chip_select];
594 else
595 cs_pin = spi1_standard_cs[devices[i].chip_select];
596
597 if (devices[i].bus_num == 0)
598 enable_spi0 = 1;
599 else
600 enable_spi1 = 1;
601
602 /* enable chip-select pin */
603 at91_set_gpio_output(cs_pin, 1);
604
605 /* pass chip-select pin to driver */
606 devices[i].controller_data = (void *) cs_pin;
607 }
608
609 spi_register_board_info(devices, nr_devices);
610
611 /* Configure SPI bus(es) */
612 if (enable_spi0) {
613 at91_set_B_periph(AT91_PIN_PA0, 0); /* SPI0_MISO */
614 at91_set_B_periph(AT91_PIN_PA1, 0); /* SPI0_MOSI */
615 at91_set_B_periph(AT91_PIN_PA2, 0); /* SPI0_SPCK */
616
617 platform_device_register(&at91cap9_spi0_device);
618 }
619 if (enable_spi1) {
620 at91_set_A_periph(AT91_PIN_PB12, 0); /* SPI1_MISO */
621 at91_set_A_periph(AT91_PIN_PB13, 0); /* SPI1_MOSI */
622 at91_set_A_periph(AT91_PIN_PB14, 0); /* SPI1_SPCK */
623
624 platform_device_register(&at91cap9_spi1_device);
625 }
626}
627#else
628void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) {}
629#endif
630
631
632/* --------------------------------------------------------------------
633 * Timer/Counter block
634 * -------------------------------------------------------------------- */
635
636#ifdef CONFIG_ATMEL_TCLIB
637
638static struct resource tcb_resources[] = {
639 [0] = {
640 .start = AT91CAP9_BASE_TCB0,
641 .end = AT91CAP9_BASE_TCB0 + SZ_16K - 1,
642 .flags = IORESOURCE_MEM,
643 },
644 [1] = {
645 .start = AT91CAP9_ID_TCB,
646 .end = AT91CAP9_ID_TCB,
647 .flags = IORESOURCE_IRQ,
648 },
649};
650
651static struct platform_device at91cap9_tcb_device = {
652 .name = "atmel_tcb",
653 .id = 0,
654 .resource = tcb_resources,
655 .num_resources = ARRAY_SIZE(tcb_resources),
656};
657
658static void __init at91_add_device_tc(void)
659{
660 platform_device_register(&at91cap9_tcb_device);
661}
662#else
663static void __init at91_add_device_tc(void) { }
664#endif
665
666
667/* --------------------------------------------------------------------
668 * RTT
669 * -------------------------------------------------------------------- */
670
671static struct resource rtt_resources[] = {
672 {
673 .start = AT91CAP9_BASE_RTT,
674 .end = AT91CAP9_BASE_RTT + SZ_16 - 1,
675 .flags = IORESOURCE_MEM,
676 }
677};
678
679static struct platform_device at91cap9_rtt_device = {
680 .name = "at91_rtt",
681 .id = 0,
682 .resource = rtt_resources,
683 .num_resources = ARRAY_SIZE(rtt_resources),
684};
685
686static void __init at91_add_device_rtt(void)
687{
688 platform_device_register(&at91cap9_rtt_device);
689}
690
691
692/* --------------------------------------------------------------------
693 * Watchdog
694 * -------------------------------------------------------------------- */
695
696#if defined(CONFIG_AT91SAM9X_WATCHDOG) || defined(CONFIG_AT91SAM9X_WATCHDOG_MODULE)
697static struct resource wdt_resources[] = {
698 {
699 .start = AT91CAP9_BASE_WDT,
700 .end = AT91CAP9_BASE_WDT + SZ_16 - 1,
701 .flags = IORESOURCE_MEM,
702 }
703};
704
705static struct platform_device at91cap9_wdt_device = {
706 .name = "at91_wdt",
707 .id = -1,
708 .resource = wdt_resources,
709 .num_resources = ARRAY_SIZE(wdt_resources),
710};
711
712static void __init at91_add_device_watchdog(void)
713{
714 platform_device_register(&at91cap9_wdt_device);
715}
716#else
717static void __init at91_add_device_watchdog(void) {}
718#endif
719
720
721/* --------------------------------------------------------------------
722 * PWM
723 * --------------------------------------------------------------------*/
724
725#if defined(CONFIG_ATMEL_PWM)
726static u32 pwm_mask;
727
728static struct resource pwm_resources[] = {
729 [0] = {
730 .start = AT91CAP9_BASE_PWMC,
731 .end = AT91CAP9_BASE_PWMC + SZ_16K - 1,
732 .flags = IORESOURCE_MEM,
733 },
734 [1] = {
735 .start = AT91CAP9_ID_PWMC,
736 .end = AT91CAP9_ID_PWMC,
737 .flags = IORESOURCE_IRQ,
738 },
739};
740
741static struct platform_device at91cap9_pwm0_device = {
742 .name = "atmel_pwm",
743 .id = -1,
744 .dev = {
745 .platform_data = &pwm_mask,
746 },
747 .resource = pwm_resources,
748 .num_resources = ARRAY_SIZE(pwm_resources),
749};
750
751void __init at91_add_device_pwm(u32 mask)
752{
753 if (mask & (1 << AT91_PWM0))
754 at91_set_A_periph(AT91_PIN_PB19, 1); /* enable PWM0 */
755
756 if (mask & (1 << AT91_PWM1))
757 at91_set_B_periph(AT91_PIN_PB8, 1); /* enable PWM1 */
758
759 if (mask & (1 << AT91_PWM2))
760 at91_set_B_periph(AT91_PIN_PC29, 1); /* enable PWM2 */
761
762 if (mask & (1 << AT91_PWM3))
763 at91_set_B_periph(AT91_PIN_PA11, 1); /* enable PWM3 */
764
765 pwm_mask = mask;
766
767 platform_device_register(&at91cap9_pwm0_device);
768}
769#else
770void __init at91_add_device_pwm(u32 mask) {}
771#endif
772
773
774
775/* --------------------------------------------------------------------
776 * AC97
777 * -------------------------------------------------------------------- */
778
779#if defined(CONFIG_SND_ATMEL_AC97C) || defined(CONFIG_SND_ATMEL_AC97C_MODULE)
780static u64 ac97_dmamask = DMA_BIT_MASK(32);
781static struct ac97c_platform_data ac97_data;
782
783static struct resource ac97_resources[] = {
784 [0] = {
785 .start = AT91CAP9_BASE_AC97C,
786 .end = AT91CAP9_BASE_AC97C + SZ_16K - 1,
787 .flags = IORESOURCE_MEM,
788 },
789 [1] = {
790 .start = AT91CAP9_ID_AC97C,
791 .end = AT91CAP9_ID_AC97C,
792 .flags = IORESOURCE_IRQ,
793 },
794};
795
796static struct platform_device at91cap9_ac97_device = {
797 .name = "atmel_ac97c",
798 .id = 1,
799 .dev = {
800 .dma_mask = &ac97_dmamask,
801 .coherent_dma_mask = DMA_BIT_MASK(32),
802 .platform_data = &ac97_data,
803 },
804 .resource = ac97_resources,
805 .num_resources = ARRAY_SIZE(ac97_resources),
806};
807
808void __init at91_add_device_ac97(struct ac97c_platform_data *data)
809{
810 if (!data)
811 return;
812
813 at91_set_A_periph(AT91_PIN_PA6, 0); /* AC97FS */
814 at91_set_A_periph(AT91_PIN_PA7, 0); /* AC97CK */
815 at91_set_A_periph(AT91_PIN_PA8, 0); /* AC97TX */
816 at91_set_A_periph(AT91_PIN_PA9, 0); /* AC97RX */
817
818 /* reset */
819 if (gpio_is_valid(data->reset_pin))
820 at91_set_gpio_output(data->reset_pin, 0);
821
822 ac97_data = *data;
823 platform_device_register(&at91cap9_ac97_device);
824}
825#else
826void __init at91_add_device_ac97(struct ac97c_platform_data *data) {}
827#endif
828
829
830/* --------------------------------------------------------------------
831 * LCD Controller
832 * -------------------------------------------------------------------- */
833
834#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
835static u64 lcdc_dmamask = DMA_BIT_MASK(32);
836static struct atmel_lcdfb_info lcdc_data;
837
838static struct resource lcdc_resources[] = {
839 [0] = {
840 .start = AT91CAP9_LCDC_BASE,
841 .end = AT91CAP9_LCDC_BASE + SZ_4K - 1,
842 .flags = IORESOURCE_MEM,
843 },
844 [1] = {
845 .start = AT91CAP9_ID_LCDC,
846 .end = AT91CAP9_ID_LCDC,
847 .flags = IORESOURCE_IRQ,
848 },
849};
850
851static struct platform_device at91_lcdc_device = {
852 .name = "atmel_lcdfb",
853 .id = 0,
854 .dev = {
855 .dma_mask = &lcdc_dmamask,
856 .coherent_dma_mask = DMA_BIT_MASK(32),
857 .platform_data = &lcdc_data,
858 },
859 .resource = lcdc_resources,
860 .num_resources = ARRAY_SIZE(lcdc_resources),
861};
862
863void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
864{
865 if (!data)
866 return;
867
868 if (cpu_is_at91cap9_revB())
869 irq_set_irq_type(AT91CAP9_ID_LCDC, IRQ_TYPE_LEVEL_HIGH);
870
871 at91_set_A_periph(AT91_PIN_PC1, 0); /* LCDHSYNC */
872 at91_set_A_periph(AT91_PIN_PC2, 0); /* LCDDOTCK */
873 at91_set_A_periph(AT91_PIN_PC3, 0); /* LCDDEN */
874 at91_set_B_periph(AT91_PIN_PB9, 0); /* LCDCC */
875 at91_set_A_periph(AT91_PIN_PC6, 0); /* LCDD2 */
876 at91_set_A_periph(AT91_PIN_PC7, 0); /* LCDD3 */
877 at91_set_A_periph(AT91_PIN_PC8, 0); /* LCDD4 */
878 at91_set_A_periph(AT91_PIN_PC9, 0); /* LCDD5 */
879 at91_set_A_periph(AT91_PIN_PC10, 0); /* LCDD6 */
880 at91_set_A_periph(AT91_PIN_PC11, 0); /* LCDD7 */
881 at91_set_A_periph(AT91_PIN_PC14, 0); /* LCDD10 */
882 at91_set_A_periph(AT91_PIN_PC15, 0); /* LCDD11 */
883 at91_set_A_periph(AT91_PIN_PC16, 0); /* LCDD12 */
884 at91_set_A_periph(AT91_PIN_PC17, 0); /* LCDD13 */
885 at91_set_A_periph(AT91_PIN_PC18, 0); /* LCDD14 */
886 at91_set_A_periph(AT91_PIN_PC19, 0); /* LCDD15 */
887 at91_set_A_periph(AT91_PIN_PC22, 0); /* LCDD18 */
888 at91_set_A_periph(AT91_PIN_PC23, 0); /* LCDD19 */
889 at91_set_A_periph(AT91_PIN_PC24, 0); /* LCDD20 */
890 at91_set_A_periph(AT91_PIN_PC25, 0); /* LCDD21 */
891 at91_set_A_periph(AT91_PIN_PC26, 0); /* LCDD22 */
892 at91_set_A_periph(AT91_PIN_PC27, 0); /* LCDD23 */
893
894 lcdc_data = *data;
895 platform_device_register(&at91_lcdc_device);
896}
897#else
898void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {}
899#endif
900
901
902/* --------------------------------------------------------------------
903 * SSC -- Synchronous Serial Controller
904 * -------------------------------------------------------------------- */
905
906#if defined(CONFIG_ATMEL_SSC) || defined(CONFIG_ATMEL_SSC_MODULE)
907static u64 ssc0_dmamask = DMA_BIT_MASK(32);
908
909static struct resource ssc0_resources[] = {
910 [0] = {
911 .start = AT91CAP9_BASE_SSC0,
912 .end = AT91CAP9_BASE_SSC0 + SZ_16K - 1,
913 .flags = IORESOURCE_MEM,
914 },
915 [1] = {
916 .start = AT91CAP9_ID_SSC0,
917 .end = AT91CAP9_ID_SSC0,
918 .flags = IORESOURCE_IRQ,
919 },
920};
921
922static struct platform_device at91cap9_ssc0_device = {
923 .name = "ssc",
924 .id = 0,
925 .dev = {
926 .dma_mask = &ssc0_dmamask,
927 .coherent_dma_mask = DMA_BIT_MASK(32),
928 },
929 .resource = ssc0_resources,
930 .num_resources = ARRAY_SIZE(ssc0_resources),
931};
932
933static inline void configure_ssc0_pins(unsigned pins)
934{
935 if (pins & ATMEL_SSC_TF)
936 at91_set_A_periph(AT91_PIN_PB0, 1);
937 if (pins & ATMEL_SSC_TK)
938 at91_set_A_periph(AT91_PIN_PB1, 1);
939 if (pins & ATMEL_SSC_TD)
940 at91_set_A_periph(AT91_PIN_PB2, 1);
941 if (pins & ATMEL_SSC_RD)
942 at91_set_A_periph(AT91_PIN_PB3, 1);
943 if (pins & ATMEL_SSC_RK)
944 at91_set_A_periph(AT91_PIN_PB4, 1);
945 if (pins & ATMEL_SSC_RF)
946 at91_set_A_periph(AT91_PIN_PB5, 1);
947}
948
949static u64 ssc1_dmamask = DMA_BIT_MASK(32);
950
951static struct resource ssc1_resources[] = {
952 [0] = {
953 .start = AT91CAP9_BASE_SSC1,
954 .end = AT91CAP9_BASE_SSC1 + SZ_16K - 1,
955 .flags = IORESOURCE_MEM,
956 },
957 [1] = {
958 .start = AT91CAP9_ID_SSC1,
959 .end = AT91CAP9_ID_SSC1,
960 .flags = IORESOURCE_IRQ,
961 },
962};
963
964static struct platform_device at91cap9_ssc1_device = {
965 .name = "ssc",
966 .id = 1,
967 .dev = {
968 .dma_mask = &ssc1_dmamask,
969 .coherent_dma_mask = DMA_BIT_MASK(32),
970 },
971 .resource = ssc1_resources,
972 .num_resources = ARRAY_SIZE(ssc1_resources),
973};
974
975static inline void configure_ssc1_pins(unsigned pins)
976{
977 if (pins & ATMEL_SSC_TF)
978 at91_set_A_periph(AT91_PIN_PB6, 1);
979 if (pins & ATMEL_SSC_TK)
980 at91_set_A_periph(AT91_PIN_PB7, 1);
981 if (pins & ATMEL_SSC_TD)
982 at91_set_A_periph(AT91_PIN_PB8, 1);
983 if (pins & ATMEL_SSC_RD)
984 at91_set_A_periph(AT91_PIN_PB9, 1);
985 if (pins & ATMEL_SSC_RK)
986 at91_set_A_periph(AT91_PIN_PB10, 1);
987 if (pins & ATMEL_SSC_RF)
988 at91_set_A_periph(AT91_PIN_PB11, 1);
989}
990
991/*
992 * SSC controllers are accessed through library code, instead of any
993 * kind of all-singing/all-dancing driver. For example one could be
994 * used by a particular I2S audio codec's driver, while another one
995 * on the same system might be used by a custom data capture driver.
996 */
997void __init at91_add_device_ssc(unsigned id, unsigned pins)
998{
999 struct platform_device *pdev;
1000
1001 /*
1002 * NOTE: caller is responsible for passing information matching
1003 * "pins" to whatever will be using each particular controller.
1004 */
1005 switch (id) {
1006 case AT91CAP9_ID_SSC0:
1007 pdev = &at91cap9_ssc0_device;
1008 configure_ssc0_pins(pins);
1009 break;
1010 case AT91CAP9_ID_SSC1:
1011 pdev = &at91cap9_ssc1_device;
1012 configure_ssc1_pins(pins);
1013 break;
1014 default:
1015 return;
1016 }
1017
1018 platform_device_register(pdev);
1019}
1020
1021#else
1022void __init at91_add_device_ssc(unsigned id, unsigned pins) {}
1023#endif
1024
1025
1026/* --------------------------------------------------------------------
1027 * UART
1028 * -------------------------------------------------------------------- */
1029
1030#if defined(CONFIG_SERIAL_ATMEL)
1031static struct resource dbgu_resources[] = {
1032 [0] = {
1033 .start = AT91CAP9_BASE_DBGU,
1034 .end = AT91CAP9_BASE_DBGU + SZ_512 - 1,
1035 .flags = IORESOURCE_MEM,
1036 },
1037 [1] = {
1038 .start = AT91_ID_SYS,
1039 .end = AT91_ID_SYS,
1040 .flags = IORESOURCE_IRQ,
1041 },
1042};
1043
1044static struct atmel_uart_data dbgu_data = {
1045 .use_dma_tx = 0,
1046 .use_dma_rx = 0, /* DBGU not capable of receive DMA */
1047};
1048
1049static u64 dbgu_dmamask = DMA_BIT_MASK(32);
1050
1051static struct platform_device at91cap9_dbgu_device = {
1052 .name = "atmel_usart",
1053 .id = 0,
1054 .dev = {
1055 .dma_mask = &dbgu_dmamask,
1056 .coherent_dma_mask = DMA_BIT_MASK(32),
1057 .platform_data = &dbgu_data,
1058 },
1059 .resource = dbgu_resources,
1060 .num_resources = ARRAY_SIZE(dbgu_resources),
1061};
1062
1063static inline void configure_dbgu_pins(void)
1064{
1065 at91_set_A_periph(AT91_PIN_PC30, 0); /* DRXD */
1066 at91_set_A_periph(AT91_PIN_PC31, 1); /* DTXD */
1067}
1068
1069static struct resource uart0_resources[] = {
1070 [0] = {
1071 .start = AT91CAP9_BASE_US0,
1072 .end = AT91CAP9_BASE_US0 + SZ_16K - 1,
1073 .flags = IORESOURCE_MEM,
1074 },
1075 [1] = {
1076 .start = AT91CAP9_ID_US0,
1077 .end = AT91CAP9_ID_US0,
1078 .flags = IORESOURCE_IRQ,
1079 },
1080};
1081
1082static struct atmel_uart_data uart0_data = {
1083 .use_dma_tx = 1,
1084 .use_dma_rx = 1,
1085};
1086
1087static u64 uart0_dmamask = DMA_BIT_MASK(32);
1088
1089static struct platform_device at91cap9_uart0_device = {
1090 .name = "atmel_usart",
1091 .id = 1,
1092 .dev = {
1093 .dma_mask = &uart0_dmamask,
1094 .coherent_dma_mask = DMA_BIT_MASK(32),
1095 .platform_data = &uart0_data,
1096 },
1097 .resource = uart0_resources,
1098 .num_resources = ARRAY_SIZE(uart0_resources),
1099};
1100
1101static inline void configure_usart0_pins(unsigned pins)
1102{
1103 at91_set_A_periph(AT91_PIN_PA22, 1); /* TXD0 */
1104 at91_set_A_periph(AT91_PIN_PA23, 0); /* RXD0 */
1105
1106 if (pins & ATMEL_UART_RTS)
1107 at91_set_A_periph(AT91_PIN_PA24, 0); /* RTS0 */
1108 if (pins & ATMEL_UART_CTS)
1109 at91_set_A_periph(AT91_PIN_PA25, 0); /* CTS0 */
1110}
1111
1112static struct resource uart1_resources[] = {
1113 [0] = {
1114 .start = AT91CAP9_BASE_US1,
1115 .end = AT91CAP9_BASE_US1 + SZ_16K - 1,
1116 .flags = IORESOURCE_MEM,
1117 },
1118 [1] = {
1119 .start = AT91CAP9_ID_US1,
1120 .end = AT91CAP9_ID_US1,
1121 .flags = IORESOURCE_IRQ,
1122 },
1123};
1124
1125static struct atmel_uart_data uart1_data = {
1126 .use_dma_tx = 1,
1127 .use_dma_rx = 1,
1128};
1129
1130static u64 uart1_dmamask = DMA_BIT_MASK(32);
1131
1132static struct platform_device at91cap9_uart1_device = {
1133 .name = "atmel_usart",
1134 .id = 2,
1135 .dev = {
1136 .dma_mask = &uart1_dmamask,
1137 .coherent_dma_mask = DMA_BIT_MASK(32),
1138 .platform_data = &uart1_data,
1139 },
1140 .resource = uart1_resources,
1141 .num_resources = ARRAY_SIZE(uart1_resources),
1142};
1143
1144static inline void configure_usart1_pins(unsigned pins)
1145{
1146 at91_set_A_periph(AT91_PIN_PD0, 1); /* TXD1 */
1147 at91_set_A_periph(AT91_PIN_PD1, 0); /* RXD1 */
1148
1149 if (pins & ATMEL_UART_RTS)
1150 at91_set_B_periph(AT91_PIN_PD7, 0); /* RTS1 */
1151 if (pins & ATMEL_UART_CTS)
1152 at91_set_B_periph(AT91_PIN_PD8, 0); /* CTS1 */
1153}
1154
1155static struct resource uart2_resources[] = {
1156 [0] = {
1157 .start = AT91CAP9_BASE_US2,
1158 .end = AT91CAP9_BASE_US2 + SZ_16K - 1,
1159 .flags = IORESOURCE_MEM,
1160 },
1161 [1] = {
1162 .start = AT91CAP9_ID_US2,
1163 .end = AT91CAP9_ID_US2,
1164 .flags = IORESOURCE_IRQ,
1165 },
1166};
1167
1168static struct atmel_uart_data uart2_data = {
1169 .use_dma_tx = 1,
1170 .use_dma_rx = 1,
1171};
1172
1173static u64 uart2_dmamask = DMA_BIT_MASK(32);
1174
1175static struct platform_device at91cap9_uart2_device = {
1176 .name = "atmel_usart",
1177 .id = 3,
1178 .dev = {
1179 .dma_mask = &uart2_dmamask,
1180 .coherent_dma_mask = DMA_BIT_MASK(32),
1181 .platform_data = &uart2_data,
1182 },
1183 .resource = uart2_resources,
1184 .num_resources = ARRAY_SIZE(uart2_resources),
1185};
1186
1187static inline void configure_usart2_pins(unsigned pins)
1188{
1189 at91_set_A_periph(AT91_PIN_PD2, 1); /* TXD2 */
1190 at91_set_A_periph(AT91_PIN_PD3, 0); /* RXD2 */
1191
1192 if (pins & ATMEL_UART_RTS)
1193 at91_set_B_periph(AT91_PIN_PD5, 0); /* RTS2 */
1194 if (pins & ATMEL_UART_CTS)
1195 at91_set_B_periph(AT91_PIN_PD6, 0); /* CTS2 */
1196}
1197
1198static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
1199struct platform_device *atmel_default_console_device; /* the serial console device */
1200
1201void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins)
1202{
1203 struct platform_device *pdev;
1204 struct atmel_uart_data *pdata;
1205
1206 switch (id) {
1207 case 0: /* DBGU */
1208 pdev = &at91cap9_dbgu_device;
1209 configure_dbgu_pins();
1210 break;
1211 case AT91CAP9_ID_US0:
1212 pdev = &at91cap9_uart0_device;
1213 configure_usart0_pins(pins);
1214 break;
1215 case AT91CAP9_ID_US1:
1216 pdev = &at91cap9_uart1_device;
1217 configure_usart1_pins(pins);
1218 break;
1219 case AT91CAP9_ID_US2:
1220 pdev = &at91cap9_uart2_device;
1221 configure_usart2_pins(pins);
1222 break;
1223 default:
1224 return;
1225 }
1226 pdata = pdev->dev.platform_data;
1227 pdata->num = portnr; /* update to mapped ID */
1228
1229 if (portnr < ATMEL_MAX_UART)
1230 at91_uarts[portnr] = pdev;
1231}
1232
1233void __init at91_set_serial_console(unsigned portnr)
1234{
1235 if (portnr < ATMEL_MAX_UART) {
1236 atmel_default_console_device = at91_uarts[portnr];
1237 at91cap9_set_console_clock(at91_uarts[portnr]->id);
1238 }
1239}
1240
1241void __init at91_add_device_serial(void)
1242{
1243 int i;
1244
1245 for (i = 0; i < ATMEL_MAX_UART; i++) {
1246 if (at91_uarts[i])
1247 platform_device_register(at91_uarts[i]);
1248 }
1249
1250 if (!atmel_default_console_device)
1251 printk(KERN_INFO "AT91: No default serial console defined.\n");
1252}
1253#else
1254void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) {}
1255void __init at91_set_serial_console(unsigned portnr) {}
1256void __init at91_add_device_serial(void) {}
1257#endif
1258
1259
1260/* -------------------------------------------------------------------- */
1261/*
1262 * These devices are always present and don't need any board-specific
1263 * setup.
1264 */
1265static int __init at91_add_standard_devices(void)
1266{
1267 at91_add_device_rtt();
1268 at91_add_device_watchdog();
1269 at91_add_device_tc();
1270 return 0;
1271}
1272
1273arch_initcall(at91_add_standard_devices);
diff --git a/arch/arm/mach-at91/board-cap9adk.c b/arch/arm/mach-at91/board-cap9adk.c
deleted file mode 100644
index ac3de4f7c31..00000000000
--- a/arch/arm/mach-at91/board-cap9adk.c
+++ /dev/null
@@ -1,396 +0,0 @@
1/*
2 * linux/arch/arm/mach-at91/board-cap9adk.c
3 *
4 * Copyright (C) 2007 Stelian Pop <stelian.pop@leadtechdesign.com>
5 * Copyright (C) 2007 Lead Tech Design <www.leadtechdesign.com>
6 * Copyright (C) 2005 SAN People
7 * Copyright (C) 2007 Atmel Corporation.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23
24#include <linux/types.h>
25#include <linux/gpio.h>
26#include <linux/init.h>
27#include <linux/mm.h>
28#include <linux/module.h>
29#include <linux/platform_device.h>
30#include <linux/spi/spi.h>
31#include <linux/spi/ads7846.h>
32#include <linux/fb.h>
33#include <linux/mtd/physmap.h>
34
35#include <video/atmel_lcdc.h>
36
37#include <mach/hardware.h>
38#include <asm/setup.h>
39#include <asm/mach-types.h>
40
41#include <asm/mach/arch.h>
42#include <asm/mach/map.h>
43
44#include <mach/board.h>
45#include <mach/at91cap9_matrix.h>
46#include <mach/at91sam9_smc.h>
47#include <mach/system_rev.h>
48
49#include "sam9_smc.h"
50#include "generic.h"
51
52
53static void __init cap9adk_init_early(void)
54{
55 /* Initialize processor: 12 MHz crystal */
56 at91_initialize(12000000);
57
58 /* Setup the LEDs: USER1 and USER2 LED for cpu/timer... */
59 at91_init_leds(AT91_PIN_PA10, AT91_PIN_PA11);
60 /* ... POWER LED always on */
61 at91_set_gpio_output(AT91_PIN_PC29, 1);
62
63 /* Setup the serial ports and console */
64 at91_register_uart(0, 0, 0); /* DBGU = ttyS0 */
65 at91_set_serial_console(0);
66}
67
68/*
69 * USB Host port
70 */
71static struct at91_usbh_data __initdata cap9adk_usbh_data = {
72 .ports = 2,
73 .vbus_pin = {-EINVAL, -EINVAL},
74 .overcurrent_pin= {-EINVAL, -EINVAL},
75};
76
77/*
78 * USB HS Device port
79 */
80static struct usba_platform_data __initdata cap9adk_usba_udc_data = {
81 .vbus_pin = AT91_PIN_PB31,
82};
83
84/*
85 * ADS7846 Touchscreen
86 */
87#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
88static int ads7843_pendown_state(void)
89{
90 return !at91_get_gpio_value(AT91_PIN_PC4); /* Touchscreen PENIRQ */
91}
92
93static struct ads7846_platform_data ads_info = {
94 .model = 7843,
95 .x_min = 150,
96 .x_max = 3830,
97 .y_min = 190,
98 .y_max = 3830,
99 .vref_delay_usecs = 100,
100 .x_plate_ohms = 450,
101 .y_plate_ohms = 250,
102 .pressure_max = 15000,
103 .debounce_max = 1,
104 .debounce_rep = 0,
105 .debounce_tol = (~0),
106 .get_pendown_state = ads7843_pendown_state,
107};
108
109static void __init cap9adk_add_device_ts(void)
110{
111 at91_set_gpio_input(AT91_PIN_PC4, 1); /* Touchscreen PENIRQ */
112 at91_set_gpio_input(AT91_PIN_PC5, 1); /* Touchscreen BUSY */
113}
114#else
115static void __init cap9adk_add_device_ts(void) {}
116#endif
117
118
119/*
120 * SPI devices.
121 */
122static struct spi_board_info cap9adk_spi_devices[] = {
123#if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
124 { /* DataFlash card */
125 .modalias = "mtd_dataflash",
126 .chip_select = 0,
127 .max_speed_hz = 15 * 1000 * 1000,
128 .bus_num = 0,
129 },
130#endif
131#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
132 {
133 .modalias = "ads7846",
134 .chip_select = 3, /* can be 2 or 3, depending on J2 jumper */
135 .max_speed_hz = 125000 * 26, /* (max sample rate @ 3V) * (cmd + data + overhead) */
136 .bus_num = 0,
137 .platform_data = &ads_info,
138 .irq = AT91_PIN_PC4,
139 },
140#endif
141};
142
143
144/*
145 * MCI (SD/MMC)
146 */
147static struct at91_mmc_data __initdata cap9adk_mmc_data = {
148 .wire4 = 1,
149 .det_pin = -EINVAL,
150 .wp_pin = -EINVAL,
151 .vcc_pin = -EINVAL,
152};
153
154
155/*
156 * MACB Ethernet device
157 */
158static struct macb_platform_data __initdata cap9adk_macb_data = {
159 .phy_irq_pin = -EINVAL,
160 .is_rmii = 1,
161};
162
163
164/*
165 * NAND flash
166 */
167static struct mtd_partition __initdata cap9adk_nand_partitions[] = {
168 {
169 .name = "NAND partition",
170 .offset = 0,
171 .size = MTDPART_SIZ_FULL,
172 },
173};
174
175static struct atmel_nand_data __initdata cap9adk_nand_data = {
176 .ale = 21,
177 .cle = 22,
178 .det_pin = -EINVAL,
179 .rdy_pin = -EINVAL,
180 .enable_pin = AT91_PIN_PD15,
181 .parts = cap9adk_nand_partitions,
182 .num_parts = ARRAY_SIZE(cap9adk_nand_partitions),
183};
184
185static struct sam9_smc_config __initdata cap9adk_nand_smc_config = {
186 .ncs_read_setup = 1,
187 .nrd_setup = 2,
188 .ncs_write_setup = 1,
189 .nwe_setup = 2,
190
191 .ncs_read_pulse = 6,
192 .nrd_pulse = 4,
193 .ncs_write_pulse = 6,
194 .nwe_pulse = 4,
195
196 .read_cycle = 8,
197 .write_cycle = 8,
198
199 .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE,
200 .tdf_cycles = 1,
201};
202
203static void __init cap9adk_add_device_nand(void)
204{
205 unsigned long csa;
206
207 csa = at91_sys_read(AT91_MATRIX_EBICSA);
208 at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_VDDIOMSEL_3_3V);
209
210 cap9adk_nand_data.bus_width_16 = board_have_nand_16bit();
211 /* setup bus-width (8 or 16) */
212 if (cap9adk_nand_data.bus_width_16)
213 cap9adk_nand_smc_config.mode |= AT91_SMC_DBW_16;
214 else
215 cap9adk_nand_smc_config.mode |= AT91_SMC_DBW_8;
216
217 /* configure chip-select 3 (NAND) */
218 sam9_smc_configure(0, 3, &cap9adk_nand_smc_config);
219
220 at91_add_device_nand(&cap9adk_nand_data);
221}
222
223
224/*
225 * NOR flash
226 */
227static struct mtd_partition cap9adk_nor_partitions[] = {
228 {
229 .name = "NOR partition",
230 .offset = 0,
231 .size = MTDPART_SIZ_FULL,
232 },
233};
234
235static struct physmap_flash_data cap9adk_nor_data = {
236 .width = 2,
237 .parts = cap9adk_nor_partitions,
238 .nr_parts = ARRAY_SIZE(cap9adk_nor_partitions),
239};
240
241#define NOR_BASE AT91_CHIPSELECT_0
242#define NOR_SIZE SZ_8M
243
244static struct resource nor_flash_resources[] = {
245 {
246 .start = NOR_BASE,
247 .end = NOR_BASE + NOR_SIZE - 1,
248 .flags = IORESOURCE_MEM,
249 }
250};
251
252static struct platform_device cap9adk_nor_flash = {
253 .name = "physmap-flash",
254 .id = 0,
255 .dev = {
256 .platform_data = &cap9adk_nor_data,
257 },
258 .resource = nor_flash_resources,
259 .num_resources = ARRAY_SIZE(nor_flash_resources),
260};
261
262static struct sam9_smc_config __initdata cap9adk_nor_smc_config = {
263 .ncs_read_setup = 2,
264 .nrd_setup = 4,
265 .ncs_write_setup = 2,
266 .nwe_setup = 4,
267
268 .ncs_read_pulse = 10,
269 .nrd_pulse = 8,
270 .ncs_write_pulse = 10,
271 .nwe_pulse = 8,
272
273 .read_cycle = 16,
274 .write_cycle = 16,
275
276 .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE | AT91_SMC_BAT_WRITE | AT91_SMC_DBW_16,
277 .tdf_cycles = 1,
278};
279
280static __init void cap9adk_add_device_nor(void)
281{
282 unsigned long csa;
283
284 csa = at91_sys_read(AT91_MATRIX_EBICSA);
285 at91_sys_write(AT91_MATRIX_EBICSA, csa | AT91_MATRIX_EBI_VDDIOMSEL_3_3V);
286
287 /* configure chip-select 0 (NOR) */
288 sam9_smc_configure(0, 0, &cap9adk_nor_smc_config);
289
290 platform_device_register(&cap9adk_nor_flash);
291}
292
293
294/*
295 * LCD Controller
296 */
297#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
298static struct fb_videomode at91_tft_vga_modes[] = {
299 {
300 .name = "TX09D50VM1CCA @ 60",
301 .refresh = 60,
302 .xres = 240, .yres = 320,
303 .pixclock = KHZ2PICOS(4965),
304
305 .left_margin = 1, .right_margin = 33,
306 .upper_margin = 1, .lower_margin = 0,
307 .hsync_len = 5, .vsync_len = 1,
308
309 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
310 .vmode = FB_VMODE_NONINTERLACED,
311 },
312};
313
314static struct fb_monspecs at91fb_default_monspecs = {
315 .manufacturer = "HIT",
316 .monitor = "TX09D70VM1CCA",
317
318 .modedb = at91_tft_vga_modes,
319 .modedb_len = ARRAY_SIZE(at91_tft_vga_modes),
320 .hfmin = 15000,
321 .hfmax = 64000,
322 .vfmin = 50,
323 .vfmax = 150,
324};
325
326#define AT91CAP9_DEFAULT_LCDCON2 (ATMEL_LCDC_MEMOR_LITTLE \
327 | ATMEL_LCDC_DISTYPE_TFT \
328 | ATMEL_LCDC_CLKMOD_ALWAYSACTIVE)
329
330static void at91_lcdc_power_control(int on)
331{
332 if (on)
333 at91_set_gpio_value(AT91_PIN_PC0, 0); /* power up */
334 else
335 at91_set_gpio_value(AT91_PIN_PC0, 1); /* power down */
336}
337
338/* Driver datas */
339static struct atmel_lcdfb_info __initdata cap9adk_lcdc_data = {
340 .default_bpp = 16,
341 .default_dmacon = ATMEL_LCDC_DMAEN,
342 .default_lcdcon2 = AT91CAP9_DEFAULT_LCDCON2,
343 .default_monspecs = &at91fb_default_monspecs,
344 .atmel_lcdfb_power_control = at91_lcdc_power_control,
345 .guard_time = 1,
346};
347
348#else
349static struct atmel_lcdfb_info __initdata cap9adk_lcdc_data;
350#endif
351
352
353/*
354 * AC97
355 */
356static struct ac97c_platform_data cap9adk_ac97_data = {
357 .reset_pin = -EINVAL,
358};
359
360
361static void __init cap9adk_board_init(void)
362{
363 /* Serial */
364 at91_add_device_serial();
365 /* USB Host */
366 at91_add_device_usbh(&cap9adk_usbh_data);
367 /* USB HS */
368 at91_add_device_usba(&cap9adk_usba_udc_data);
369 /* SPI */
370 at91_add_device_spi(cap9adk_spi_devices, ARRAY_SIZE(cap9adk_spi_devices));
371 /* Touchscreen */
372 cap9adk_add_device_ts();
373 /* MMC */
374 at91_add_device_mmc(1, &cap9adk_mmc_data);
375 /* Ethernet */
376 at91_add_device_eth(&cap9adk_macb_data);
377 /* NAND */
378 cap9adk_add_device_nand();
379 /* NOR Flash */
380 cap9adk_add_device_nor();
381 /* I2C */
382 at91_add_device_i2c(NULL, 0);
383 /* LCD Controller */
384 at91_add_device_lcdc(&cap9adk_lcdc_data);
385 /* AC97 */
386 at91_add_device_ac97(&cap9adk_ac97_data);
387}
388
389MACHINE_START(AT91CAP9ADK, "Atmel AT91CAP9A-DK")
390 /* Maintainer: Stelian Pop <stelian.pop@leadtechdesign.com> */
391 .timer = &at91sam926x_timer,
392 .map_io = at91_map_io,
393 .init_early = cap9adk_init_early,
394 .init_irq = at91_init_irq_default,
395 .init_machine = cap9adk_board_init,
396MACHINE_END
diff --git a/arch/arm/mach-at91/clock.c b/arch/arm/mach-at91/clock.c
index 61873f3aa92..aa04e22a9da 100644
--- a/arch/arm/mach-at91/clock.c
+++ b/arch/arm/mach-at91/clock.c
@@ -47,8 +47,7 @@
47/* 47/*
48 * Chips have some kind of clocks : group them by functionality 48 * Chips have some kind of clocks : group them by functionality
49 */ 49 */
50#define cpu_has_utmi() ( cpu_is_at91cap9() \ 50#define cpu_has_utmi() ( cpu_is_at91sam9rl() \
51 || cpu_is_at91sam9rl() \
52 || cpu_is_at91sam9g45()) 51 || cpu_is_at91sam9g45())
53 52
54#define cpu_has_800M_plla() ( cpu_is_at91sam9g20() \ 53#define cpu_has_800M_plla() ( cpu_is_at91sam9g20() \
@@ -602,8 +601,6 @@ static void __init at91_pllb_usbfs_clock_init(unsigned long main_clock)
602 cpu_is_at91sam9g10()) { 601 cpu_is_at91sam9g10()) {
603 uhpck.pmc_mask = AT91SAM926x_PMC_UHP; 602 uhpck.pmc_mask = AT91SAM926x_PMC_UHP;
604 udpck.pmc_mask = AT91SAM926x_PMC_UDP; 603 udpck.pmc_mask = AT91SAM926x_PMC_UDP;
605 } else if (cpu_is_at91cap9()) {
606 uhpck.pmc_mask = AT91CAP9_PMC_UHP;
607 } 604 }
608 at91_sys_write(AT91_CKGR_PLLBR, 0); 605 at91_sys_write(AT91_CKGR_PLLBR, 0);
609 606
diff --git a/arch/arm/mach-at91/cpuidle.c b/arch/arm/mach-at91/cpuidle.c
index a851e6c9842..555d956b3a5 100644
--- a/arch/arm/mach-at91/cpuidle.c
+++ b/arch/arm/mach-at91/cpuidle.c
@@ -39,20 +39,15 @@ static int at91_enter_idle(struct cpuidle_device *dev,
39{ 39{
40 struct timeval before, after; 40 struct timeval before, after;
41 int idle_time; 41 int idle_time;
42 u32 saved_lpr;
43 42
44 local_irq_disable(); 43 local_irq_disable();
45 do_gettimeofday(&before); 44 do_gettimeofday(&before);
46 if (index == 0) 45 if (index == 0)
47 /* Wait for interrupt state */ 46 /* Wait for interrupt state */
48 cpu_do_idle(); 47 cpu_do_idle();
49 else if (index == 1) { 48 else if (index == 1)
50 asm("b 1f; .align 5; 1:"); 49 at91_standby();
51 asm("mcr p15, 0, r0, c7, c10, 4"); /* drain write buffer */ 50
52 saved_lpr = sdram_selfrefresh_enable();
53 cpu_do_idle();
54 sdram_selfrefresh_disable(saved_lpr);
55 }
56 do_gettimeofday(&after); 51 do_gettimeofday(&after);
57 local_irq_enable(); 52 local_irq_enable();
58 idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC + 53 idle_time = (after.tv_sec - before.tv_sec) * USEC_PER_SEC +
diff --git a/arch/arm/mach-at91/generic.h b/arch/arm/mach-at91/generic.h
index 594133451c0..7e8280e798c 100644
--- a/arch/arm/mach-at91/generic.h
+++ b/arch/arm/mach-at91/generic.h
@@ -45,7 +45,6 @@ extern void __init at91sam9261_set_console_clock(int id);
45extern void __init at91sam9263_set_console_clock(int id); 45extern void __init at91sam9263_set_console_clock(int id);
46extern void __init at91sam9rl_set_console_clock(int id); 46extern void __init at91sam9rl_set_console_clock(int id);
47extern void __init at91sam9g45_set_console_clock(int id); 47extern void __init at91sam9g45_set_console_clock(int id);
48extern void __init at91cap9_set_console_clock(int id);
49#ifdef CONFIG_AT91_PMC_UNIT 48#ifdef CONFIG_AT91_PMC_UNIT
50extern int __init at91_clock_init(unsigned long main_clock); 49extern int __init at91_clock_init(unsigned long main_clock);
51#else 50#else
diff --git a/arch/arm/mach-at91/include/mach/at91_pmc.h b/arch/arm/mach-at91/include/mach/at91_pmc.h
index e46f93e34aa..dbdd6ae473d 100644
--- a/arch/arm/mach-at91/include/mach/at91_pmc.h
+++ b/arch/arm/mach-at91/include/mach/at91_pmc.h
@@ -23,10 +23,8 @@
23#define AT91_PMC_PCK (1 << 0) /* Processor Clock */ 23#define AT91_PMC_PCK (1 << 0) /* Processor Clock */
24#define AT91RM9200_PMC_UDP (1 << 1) /* USB Devcice Port Clock [AT91RM9200 only] */ 24#define AT91RM9200_PMC_UDP (1 << 1) /* USB Devcice Port Clock [AT91RM9200 only] */
25#define AT91RM9200_PMC_MCKUDP (1 << 2) /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */ 25#define AT91RM9200_PMC_MCKUDP (1 << 2) /* USB Device Port Master Clock Automatic Disable on Suspend [AT91RM9200 only] */
26#define AT91CAP9_PMC_DDR (1 << 2) /* DDR Clock [CAP9 revC & some SAM9 only] */
27#define AT91RM9200_PMC_UHP (1 << 4) /* USB Host Port Clock [AT91RM9200 only] */ 26#define AT91RM9200_PMC_UHP (1 << 4) /* USB Host Port Clock [AT91RM9200 only] */
28#define AT91SAM926x_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91SAM926x only] */ 27#define AT91SAM926x_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91SAM926x only] */
29#define AT91CAP9_PMC_UHP (1 << 6) /* USB Host Port Clock [AT91CAP9 only] */
30#define AT91SAM926x_PMC_UDP (1 << 7) /* USB Devcice Port Clock [AT91SAM926x only] */ 28#define AT91SAM926x_PMC_UDP (1 << 7) /* USB Devcice Port Clock [AT91SAM926x only] */
31#define AT91_PMC_PCK0 (1 << 8) /* Programmable Clock 0 */ 29#define AT91_PMC_PCK0 (1 << 8) /* Programmable Clock 0 */
32#define AT91_PMC_PCK1 (1 << 9) /* Programmable Clock 1 */ 30#define AT91_PMC_PCK1 (1 << 9) /* Programmable Clock 1 */
@@ -40,7 +38,7 @@
40#define AT91_PMC_PCDR (AT91_PMC + 0x14) /* Peripheral Clock Disable Register */ 38#define AT91_PMC_PCDR (AT91_PMC + 0x14) /* Peripheral Clock Disable Register */
41#define AT91_PMC_PCSR (AT91_PMC + 0x18) /* Peripheral Clock Status Register */ 39#define AT91_PMC_PCSR (AT91_PMC + 0x18) /* Peripheral Clock Status Register */
42 40
43#define AT91_CKGR_UCKR (AT91_PMC + 0x1C) /* UTMI Clock Register [some SAM9, CAP9] */ 41#define AT91_CKGR_UCKR (AT91_PMC + 0x1C) /* UTMI Clock Register [some SAM9] */
44#define AT91_PMC_UPLLEN (1 << 16) /* UTMI PLL Enable */ 42#define AT91_PMC_UPLLEN (1 << 16) /* UTMI PLL Enable */
45#define AT91_PMC_UPLLCOUNT (0xf << 20) /* UTMI PLL Start-up Time */ 43#define AT91_PMC_UPLLCOUNT (0xf << 20) /* UTMI PLL Start-up Time */
46#define AT91_PMC_BIASEN (1 << 24) /* UTMI BIAS Enable */ 44#define AT91_PMC_BIASEN (1 << 24) /* UTMI BIAS Enable */
@@ -48,7 +46,7 @@
48 46
49#define AT91_CKGR_MOR (AT91_PMC + 0x20) /* Main Oscillator Register [not on SAM9RL] */ 47#define AT91_CKGR_MOR (AT91_PMC + 0x20) /* Main Oscillator Register [not on SAM9RL] */
50#define AT91_PMC_MOSCEN (1 << 0) /* Main Oscillator Enable */ 48#define AT91_PMC_MOSCEN (1 << 0) /* Main Oscillator Enable */
51#define AT91_PMC_OSCBYPASS (1 << 1) /* Oscillator Bypass [SAM9x, CAP9] */ 49#define AT91_PMC_OSCBYPASS (1 << 1) /* Oscillator Bypass [SAM9x] */
52#define AT91_PMC_OSCOUNT (0xff << 8) /* Main Oscillator Start-up Time */ 50#define AT91_PMC_OSCOUNT (0xff << 8) /* Main Oscillator Start-up Time */
53 51
54#define AT91_CKGR_MCFR (AT91_PMC + 0x24) /* Main Clock Frequency Register */ 52#define AT91_CKGR_MCFR (AT91_PMC + 0x24) /* Main Clock Frequency Register */
@@ -87,7 +85,7 @@
87#define AT91RM9200_PMC_MDIV_2 (1 << 8) 85#define AT91RM9200_PMC_MDIV_2 (1 << 8)
88#define AT91RM9200_PMC_MDIV_3 (2 << 8) 86#define AT91RM9200_PMC_MDIV_3 (2 << 8)
89#define AT91RM9200_PMC_MDIV_4 (3 << 8) 87#define AT91RM9200_PMC_MDIV_4 (3 << 8)
90#define AT91SAM9_PMC_MDIV_1 (0 << 8) /* [SAM9,CAP9 only] */ 88#define AT91SAM9_PMC_MDIV_1 (0 << 8) /* [SAM9 only] */
91#define AT91SAM9_PMC_MDIV_2 (1 << 8) 89#define AT91SAM9_PMC_MDIV_2 (1 << 8)
92#define AT91SAM9_PMC_MDIV_4 (2 << 8) 90#define AT91SAM9_PMC_MDIV_4 (2 << 8)
93#define AT91SAM9_PMC_MDIV_6 (3 << 8) /* [some SAM9 only] */ 91#define AT91SAM9_PMC_MDIV_6 (3 << 8) /* [some SAM9 only] */
@@ -117,17 +115,15 @@
117#define AT91_PMC_LOCKA (1 << 1) /* PLLA Lock */ 115#define AT91_PMC_LOCKA (1 << 1) /* PLLA Lock */
118#define AT91_PMC_LOCKB (1 << 2) /* PLLB Lock */ 116#define AT91_PMC_LOCKB (1 << 2) /* PLLB Lock */
119#define AT91_PMC_MCKRDY (1 << 3) /* Master Clock */ 117#define AT91_PMC_MCKRDY (1 << 3) /* Master Clock */
120#define AT91_PMC_LOCKU (1 << 6) /* UPLL Lock [some SAM9, AT91CAP9 only] */ 118#define AT91_PMC_LOCKU (1 << 6) /* UPLL Lock [some SAM9] */
121#define AT91_PMC_OSCSEL (1 << 7) /* Slow Clock Oscillator [AT91CAP9 revC only] */
122#define AT91_PMC_PCK0RDY (1 << 8) /* Programmable Clock 0 */ 119#define AT91_PMC_PCK0RDY (1 << 8) /* Programmable Clock 0 */
123#define AT91_PMC_PCK1RDY (1 << 9) /* Programmable Clock 1 */ 120#define AT91_PMC_PCK1RDY (1 << 9) /* Programmable Clock 1 */
124#define AT91_PMC_PCK2RDY (1 << 10) /* Programmable Clock 2 */ 121#define AT91_PMC_PCK2RDY (1 << 10) /* Programmable Clock 2 */
125#define AT91_PMC_PCK3RDY (1 << 11) /* Programmable Clock 3 */ 122#define AT91_PMC_PCK3RDY (1 << 11) /* Programmable Clock 3 */
126#define AT91_PMC_IMR (AT91_PMC + 0x6c) /* Interrupt Mask Register */ 123#define AT91_PMC_IMR (AT91_PMC + 0x6c) /* Interrupt Mask Register */
127 124
128#define AT91_PMC_PROT (AT91_PMC + 0xe4) /* Protect Register [AT91CAP9 revC only] */ 125#define AT91_PMC_PROT (AT91_PMC + 0xe4) /* Write Protect Mode Register [some SAM9] */
129#define AT91_PMC_PROTKEY 0x504d4301 /* Activation Code */ 126#define AT91_PMC_PROTKEY 0x504d4301 /* Activation Code */
130 127
131#define AT91_PMC_VER (AT91_PMC + 0xfc) /* PMC Module Version [AT91CAP9 only] */
132 128
133#endif 129#endif
diff --git a/arch/arm/mach-at91/include/mach/at91cap9.h b/arch/arm/mach-at91/include/mach/at91cap9.h
deleted file mode 100644
index 61d952902f2..00000000000
--- a/arch/arm/mach-at91/include/mach/at91cap9.h
+++ /dev/null
@@ -1,122 +0,0 @@
1/*
2 * arch/arm/mach-at91/include/mach/at91cap9.h
3 *
4 * Copyright (C) 2007 Stelian Pop <stelian.pop@leadtechdesign.com>
5 * Copyright (C) 2007 Lead Tech Design <www.leadtechdesign.com>
6 * Copyright (C) 2007 Atmel Corporation.
7 *
8 * Common definitions.
9 * Based on AT91CAP9 datasheet revision B (Preliminary).
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 */
16
17#ifndef AT91CAP9_H
18#define AT91CAP9_H
19
20/*
21 * Peripheral identifiers/interrupts.
22 */
23#define AT91CAP9_ID_PIOABCD 2 /* Parallel IO Controller A, B, C and D */
24#define AT91CAP9_ID_MPB0 3 /* MP Block Peripheral 0 */
25#define AT91CAP9_ID_MPB1 4 /* MP Block Peripheral 1 */
26#define AT91CAP9_ID_MPB2 5 /* MP Block Peripheral 2 */
27#define AT91CAP9_ID_MPB3 6 /* MP Block Peripheral 3 */
28#define AT91CAP9_ID_MPB4 7 /* MP Block Peripheral 4 */
29#define AT91CAP9_ID_US0 8 /* USART 0 */
30#define AT91CAP9_ID_US1 9 /* USART 1 */
31#define AT91CAP9_ID_US2 10 /* USART 2 */
32#define AT91CAP9_ID_MCI0 11 /* Multimedia Card Interface 0 */
33#define AT91CAP9_ID_MCI1 12 /* Multimedia Card Interface 1 */
34#define AT91CAP9_ID_CAN 13 /* CAN */
35#define AT91CAP9_ID_TWI 14 /* Two-Wire Interface */
36#define AT91CAP9_ID_SPI0 15 /* Serial Peripheral Interface 0 */
37#define AT91CAP9_ID_SPI1 16 /* Serial Peripheral Interface 0 */
38#define AT91CAP9_ID_SSC0 17 /* Serial Synchronous Controller 0 */
39#define AT91CAP9_ID_SSC1 18 /* Serial Synchronous Controller 1 */
40#define AT91CAP9_ID_AC97C 19 /* AC97 Controller */
41#define AT91CAP9_ID_TCB 20 /* Timer Counter 0, 1 and 2 */
42#define AT91CAP9_ID_PWMC 21 /* Pulse Width Modulation Controller */
43#define AT91CAP9_ID_EMAC 22 /* Ethernet */
44#define AT91CAP9_ID_AESTDES 23 /* Advanced Encryption Standard, Triple DES */
45#define AT91CAP9_ID_ADC 24 /* Analog-to-Digital Converter */
46#define AT91CAP9_ID_ISI 25 /* Image Sensor Interface */
47#define AT91CAP9_ID_LCDC 26 /* LCD Controller */
48#define AT91CAP9_ID_DMA 27 /* DMA Controller */
49#define AT91CAP9_ID_UDPHS 28 /* USB High Speed Device Port */
50#define AT91CAP9_ID_UHP 29 /* USB Host Port */
51#define AT91CAP9_ID_IRQ0 30 /* Advanced Interrupt Controller (IRQ0) */
52#define AT91CAP9_ID_IRQ1 31 /* Advanced Interrupt Controller (IRQ1) */
53
54/*
55 * User Peripheral physical base addresses.
56 */
57#define AT91CAP9_BASE_UDPHS 0xfff78000
58#define AT91CAP9_BASE_TCB0 0xfff7c000
59#define AT91CAP9_BASE_TC0 0xfff7c000
60#define AT91CAP9_BASE_TC1 0xfff7c040
61#define AT91CAP9_BASE_TC2 0xfff7c080
62#define AT91CAP9_BASE_MCI0 0xfff80000
63#define AT91CAP9_BASE_MCI1 0xfff84000
64#define AT91CAP9_BASE_TWI 0xfff88000
65#define AT91CAP9_BASE_US0 0xfff8c000
66#define AT91CAP9_BASE_US1 0xfff90000
67#define AT91CAP9_BASE_US2 0xfff94000
68#define AT91CAP9_BASE_SSC0 0xfff98000
69#define AT91CAP9_BASE_SSC1 0xfff9c000
70#define AT91CAP9_BASE_AC97C 0xfffa0000
71#define AT91CAP9_BASE_SPI0 0xfffa4000
72#define AT91CAP9_BASE_SPI1 0xfffa8000
73#define AT91CAP9_BASE_CAN 0xfffac000
74#define AT91CAP9_BASE_PWMC 0xfffb8000
75#define AT91CAP9_BASE_EMAC 0xfffbc000
76#define AT91CAP9_BASE_ADC 0xfffc0000
77#define AT91CAP9_BASE_ISI 0xfffc4000
78
79/*
80 * System Peripherals (offset from AT91_BASE_SYS)
81 */
82#define AT91_BCRAMC (0xffffe400 - AT91_BASE_SYS)
83#define AT91_DDRSDRC0 (0xffffe600 - AT91_BASE_SYS)
84#define AT91_MATRIX (0xffffea00 - AT91_BASE_SYS)
85#define AT91_PMC (0xfffffc00 - AT91_BASE_SYS)
86#define AT91_GPBR (cpu_is_at91cap9_revB() ? \
87 (0xfffffd50 - AT91_BASE_SYS) : \
88 (0xfffffd60 - AT91_BASE_SYS))
89
90#define AT91CAP9_BASE_ECC 0xffffe200
91#define AT91CAP9_BASE_DMA 0xffffec00
92#define AT91CAP9_BASE_SMC 0xffffe800
93#define AT91CAP9_BASE_DBGU AT91_BASE_DBGU1
94#define AT91CAP9_BASE_PIOA 0xfffff200
95#define AT91CAP9_BASE_PIOB 0xfffff400
96#define AT91CAP9_BASE_PIOC 0xfffff600
97#define AT91CAP9_BASE_PIOD 0xfffff800
98#define AT91CAP9_BASE_RSTC 0xfffffd00
99#define AT91CAP9_BASE_SHDWC 0xfffffd10
100#define AT91CAP9_BASE_RTT 0xfffffd20
101#define AT91CAP9_BASE_PIT 0xfffffd30
102#define AT91CAP9_BASE_WDT 0xfffffd40
103
104#define AT91_USART0 AT91CAP9_BASE_US0
105#define AT91_USART1 AT91CAP9_BASE_US1
106#define AT91_USART2 AT91CAP9_BASE_US2
107
108
109/*
110 * Internal Memory.
111 */
112#define AT91CAP9_SRAM_BASE 0x00100000 /* Internal SRAM base address */
113#define AT91CAP9_SRAM_SIZE (32 * SZ_1K) /* Internal SRAM size (32Kb) */
114
115#define AT91CAP9_ROM_BASE 0x00400000 /* Internal ROM base address */
116#define AT91CAP9_ROM_SIZE (32 * SZ_1K) /* Internal ROM size (32Kb) */
117
118#define AT91CAP9_LCDC_BASE 0x00500000 /* LCD Controller */
119#define AT91CAP9_UDPHS_FIFO 0x00600000 /* USB High Speed Device Port */
120#define AT91CAP9_UHP_BASE 0x00700000 /* USB Host controller */
121
122#endif
diff --git a/arch/arm/mach-at91/include/mach/at91cap9_matrix.h b/arch/arm/mach-at91/include/mach/at91cap9_matrix.h
deleted file mode 100644
index 4b9d4aff4b4..00000000000
--- a/arch/arm/mach-at91/include/mach/at91cap9_matrix.h
+++ /dev/null
@@ -1,137 +0,0 @@
1/*
2 * arch/arm/mach-at91/include/mach/at91cap9_matrix.h
3 *
4 * Copyright (C) 2007 Stelian Pop <stelian.pop@leadtechdesign.com>
5 * Copyright (C) 2007 Lead Tech Design <www.leadtechdesign.com>
6 * Copyright (C) 2006 Atmel Corporation.
7 *
8 * Memory Controllers (MATRIX, EBI) - System peripherals registers.
9 * Based on AT91CAP9 datasheet revision B (Preliminary).
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 */
16
17#ifndef AT91CAP9_MATRIX_H
18#define AT91CAP9_MATRIX_H
19
20#define AT91_MATRIX_MCFG0 (AT91_MATRIX + 0x00) /* Master Configuration Register 0 */
21#define AT91_MATRIX_MCFG1 (AT91_MATRIX + 0x04) /* Master Configuration Register 1 */
22#define AT91_MATRIX_MCFG2 (AT91_MATRIX + 0x08) /* Master Configuration Register 2 */
23#define AT91_MATRIX_MCFG3 (AT91_MATRIX + 0x0C) /* Master Configuration Register 3 */
24#define AT91_MATRIX_MCFG4 (AT91_MATRIX + 0x10) /* Master Configuration Register 4 */
25#define AT91_MATRIX_MCFG5 (AT91_MATRIX + 0x14) /* Master Configuration Register 5 */
26#define AT91_MATRIX_MCFG6 (AT91_MATRIX + 0x18) /* Master Configuration Register 6 */
27#define AT91_MATRIX_MCFG7 (AT91_MATRIX + 0x1C) /* Master Configuration Register 7 */
28#define AT91_MATRIX_MCFG8 (AT91_MATRIX + 0x20) /* Master Configuration Register 8 */
29#define AT91_MATRIX_MCFG9 (AT91_MATRIX + 0x24) /* Master Configuration Register 9 */
30#define AT91_MATRIX_MCFG10 (AT91_MATRIX + 0x28) /* Master Configuration Register 10 */
31#define AT91_MATRIX_MCFG11 (AT91_MATRIX + 0x2C) /* Master Configuration Register 11 */
32#define AT91_MATRIX_ULBT (7 << 0) /* Undefined Length Burst Type */
33#define AT91_MATRIX_ULBT_INFINITE (0 << 0)
34#define AT91_MATRIX_ULBT_SINGLE (1 << 0)
35#define AT91_MATRIX_ULBT_FOUR (2 << 0)
36#define AT91_MATRIX_ULBT_EIGHT (3 << 0)
37#define AT91_MATRIX_ULBT_SIXTEEN (4 << 0)
38
39#define AT91_MATRIX_SCFG0 (AT91_MATRIX + 0x40) /* Slave Configuration Register 0 */
40#define AT91_MATRIX_SCFG1 (AT91_MATRIX + 0x44) /* Slave Configuration Register 1 */
41#define AT91_MATRIX_SCFG2 (AT91_MATRIX + 0x48) /* Slave Configuration Register 2 */
42#define AT91_MATRIX_SCFG3 (AT91_MATRIX + 0x4C) /* Slave Configuration Register 3 */
43#define AT91_MATRIX_SCFG4 (AT91_MATRIX + 0x50) /* Slave Configuration Register 4 */
44#define AT91_MATRIX_SCFG5 (AT91_MATRIX + 0x54) /* Slave Configuration Register 5 */
45#define AT91_MATRIX_SCFG6 (AT91_MATRIX + 0x58) /* Slave Configuration Register 6 */
46#define AT91_MATRIX_SCFG7 (AT91_MATRIX + 0x5C) /* Slave Configuration Register 7 */
47#define AT91_MATRIX_SCFG8 (AT91_MATRIX + 0x60) /* Slave Configuration Register 8 */
48#define AT91_MATRIX_SCFG9 (AT91_MATRIX + 0x64) /* Slave Configuration Register 9 */
49#define AT91_MATRIX_SLOT_CYCLE (0xff << 0) /* Maximum Number of Allowed Cycles for a Burst */
50#define AT91_MATRIX_DEFMSTR_TYPE (3 << 16) /* Default Master Type */
51#define AT91_MATRIX_DEFMSTR_TYPE_NONE (0 << 16)
52#define AT91_MATRIX_DEFMSTR_TYPE_LAST (1 << 16)
53#define AT91_MATRIX_DEFMSTR_TYPE_FIXED (2 << 16)
54#define AT91_MATRIX_FIXED_DEFMSTR (0xf << 18) /* Fixed Index of Default Master */
55#define AT91_MATRIX_ARBT (3 << 24) /* Arbitration Type */
56#define AT91_MATRIX_ARBT_ROUND_ROBIN (0 << 24)
57#define AT91_MATRIX_ARBT_FIXED_PRIORITY (1 << 24)
58
59#define AT91_MATRIX_PRAS0 (AT91_MATRIX + 0x80) /* Priority Register A for Slave 0 */
60#define AT91_MATRIX_PRBS0 (AT91_MATRIX + 0x84) /* Priority Register B for Slave 0 */
61#define AT91_MATRIX_PRAS1 (AT91_MATRIX + 0x88) /* Priority Register A for Slave 1 */
62#define AT91_MATRIX_PRBS1 (AT91_MATRIX + 0x8C) /* Priority Register B for Slave 1 */
63#define AT91_MATRIX_PRAS2 (AT91_MATRIX + 0x90) /* Priority Register A for Slave 2 */
64#define AT91_MATRIX_PRBS2 (AT91_MATRIX + 0x94) /* Priority Register B for Slave 2 */
65#define AT91_MATRIX_PRAS3 (AT91_MATRIX + 0x98) /* Priority Register A for Slave 3 */
66#define AT91_MATRIX_PRBS3 (AT91_MATRIX + 0x9C) /* Priority Register B for Slave 3 */
67#define AT91_MATRIX_PRAS4 (AT91_MATRIX + 0xA0) /* Priority Register A for Slave 4 */
68#define AT91_MATRIX_PRBS4 (AT91_MATRIX + 0xA4) /* Priority Register B for Slave 4 */
69#define AT91_MATRIX_PRAS5 (AT91_MATRIX + 0xA8) /* Priority Register A for Slave 5 */
70#define AT91_MATRIX_PRBS5 (AT91_MATRIX + 0xAC) /* Priority Register B for Slave 5 */
71#define AT91_MATRIX_PRAS6 (AT91_MATRIX + 0xB0) /* Priority Register A for Slave 6 */
72#define AT91_MATRIX_PRBS6 (AT91_MATRIX + 0xB4) /* Priority Register B for Slave 6 */
73#define AT91_MATRIX_PRAS7 (AT91_MATRIX + 0xB8) /* Priority Register A for Slave 7 */
74#define AT91_MATRIX_PRBS7 (AT91_MATRIX + 0xBC) /* Priority Register B for Slave 7 */
75#define AT91_MATRIX_PRAS8 (AT91_MATRIX + 0xC0) /* Priority Register A for Slave 8 */
76#define AT91_MATRIX_PRBS8 (AT91_MATRIX + 0xC4) /* Priority Register B for Slave 8 */
77#define AT91_MATRIX_PRAS9 (AT91_MATRIX + 0xC8) /* Priority Register A for Slave 9 */
78#define AT91_MATRIX_PRBS9 (AT91_MATRIX + 0xCC) /* Priority Register B for Slave 9 */
79#define AT91_MATRIX_M0PR (3 << 0) /* Master 0 Priority */
80#define AT91_MATRIX_M1PR (3 << 4) /* Master 1 Priority */
81#define AT91_MATRIX_M2PR (3 << 8) /* Master 2 Priority */
82#define AT91_MATRIX_M3PR (3 << 12) /* Master 3 Priority */
83#define AT91_MATRIX_M4PR (3 << 16) /* Master 4 Priority */
84#define AT91_MATRIX_M5PR (3 << 20) /* Master 5 Priority */
85#define AT91_MATRIX_M6PR (3 << 24) /* Master 6 Priority */
86#define AT91_MATRIX_M7PR (3 << 28) /* Master 7 Priority */
87#define AT91_MATRIX_M8PR (3 << 0) /* Master 8 Priority (in Register B) */
88#define AT91_MATRIX_M9PR (3 << 4) /* Master 9 Priority (in Register B) */
89#define AT91_MATRIX_M10PR (3 << 8) /* Master 10 Priority (in Register B) */
90#define AT91_MATRIX_M11PR (3 << 12) /* Master 11 Priority (in Register B) */
91
92#define AT91_MATRIX_MRCR (AT91_MATRIX + 0x100) /* Master Remap Control Register */
93#define AT91_MATRIX_RCB0 (1 << 0) /* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
94#define AT91_MATRIX_RCB1 (1 << 1) /* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
95#define AT91_MATRIX_RCB2 (1 << 2)
96#define AT91_MATRIX_RCB3 (1 << 3)
97#define AT91_MATRIX_RCB4 (1 << 4)
98#define AT91_MATRIX_RCB5 (1 << 5)
99#define AT91_MATRIX_RCB6 (1 << 6)
100#define AT91_MATRIX_RCB7 (1 << 7)
101#define AT91_MATRIX_RCB8 (1 << 8)
102#define AT91_MATRIX_RCB9 (1 << 9)
103#define AT91_MATRIX_RCB10 (1 << 10)
104#define AT91_MATRIX_RCB11 (1 << 11)
105
106#define AT91_MPBS0_SFR (AT91_MATRIX + 0x114) /* MPBlock Slave 0 Special Function Register */
107#define AT91_MPBS1_SFR (AT91_MATRIX + 0x11C) /* MPBlock Slave 1 Special Function Register */
108
109#define AT91_MATRIX_UDPHS (AT91_MATRIX + 0x118) /* USBHS Special Function Register [AT91CAP9 only] */
110#define AT91_MATRIX_SELECT_UDPHS (0 << 31) /* select High Speed UDP */
111#define AT91_MATRIX_SELECT_UDP (1 << 31) /* select standard UDP */
112#define AT91_MATRIX_UDPHS_BYPASS_LOCK (1 << 30) /* bypass lock bit */
113
114#define AT91_MATRIX_EBICSA (AT91_MATRIX + 0x120) /* EBI Chip Select Assignment Register */
115#define AT91_MATRIX_EBI_CS1A (1 << 1) /* Chip Select 1 Assignment */
116#define AT91_MATRIX_EBI_CS1A_SMC (0 << 1)
117#define AT91_MATRIX_EBI_CS1A_BCRAMC (1 << 1)
118#define AT91_MATRIX_EBI_CS3A (1 << 3) /* Chip Select 3 Assignment */
119#define AT91_MATRIX_EBI_CS3A_SMC (0 << 3)
120#define AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA (1 << 3)
121#define AT91_MATRIX_EBI_CS4A (1 << 4) /* Chip Select 4 Assignment */
122#define AT91_MATRIX_EBI_CS4A_SMC (0 << 4)
123#define AT91_MATRIX_EBI_CS4A_SMC_CF1 (1 << 4)
124#define AT91_MATRIX_EBI_CS5A (1 << 5) /* Chip Select 5 Assignment */
125#define AT91_MATRIX_EBI_CS5A_SMC (0 << 5)
126#define AT91_MATRIX_EBI_CS5A_SMC_CF2 (1 << 5)
127#define AT91_MATRIX_EBI_DBPUC (1 << 8) /* Data Bus Pull-up Configuration */
128#define AT91_MATRIX_EBI_DQSPDC (1 << 9) /* Data Qualifier Strobe Pull-Down Configuration */
129#define AT91_MATRIX_EBI_VDDIOMSEL (1 << 16) /* Memory voltage selection */
130#define AT91_MATRIX_EBI_VDDIOMSEL_1_8V (0 << 16)
131#define AT91_MATRIX_EBI_VDDIOMSEL_3_3V (1 << 16)
132
133#define AT91_MPBS2_SFR (AT91_MATRIX + 0x12C) /* MPBlock Slave 2 Special Function Register */
134#define AT91_MPBS3_SFR (AT91_MATRIX + 0x130) /* MPBlock Slave 3 Special Function Register */
135#define AT91_APB_SFR (AT91_MATRIX + 0x134) /* APB Bridge Special Function Register */
136
137#endif
diff --git a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
index e2f8da8ce5b..5d4a9f84658 100644
--- a/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
+++ b/arch/arm/mach-at91/include/mach/at91sam9_ddrsdr.h
@@ -59,7 +59,6 @@
59#define AT91_DDRSDRC_TRP (0xf << 16) /* Row precharge delay */ 59#define AT91_DDRSDRC_TRP (0xf << 16) /* Row precharge delay */
60#define AT91_DDRSDRC_TRRD (0xf << 20) /* Active BankA to BankB */ 60#define AT91_DDRSDRC_TRRD (0xf << 20) /* Active BankA to BankB */
61#define AT91_DDRSDRC_TWTR (0x7 << 24) /* Internal Write to Read delay */ 61#define AT91_DDRSDRC_TWTR (0x7 << 24) /* Internal Write to Read delay */
62#define AT91CAP9_DDRSDRC_TWTR (1 << 24) /* Internal Write to Read delay */
63#define AT91_DDRSDRC_RED_WRRD (0x1 << 27) /* Reduce Write to Read Delay [SAM9 Only] */ 62#define AT91_DDRSDRC_RED_WRRD (0x1 << 27) /* Reduce Write to Read Delay [SAM9 Only] */
64#define AT91_DDRSDRC_TMRD (0xf << 28) /* Load mode to active/refresh delay */ 63#define AT91_DDRSDRC_TMRD (0xf << 28) /* Load mode to active/refresh delay */
65 64
@@ -76,7 +75,6 @@
76#define AT91_DDRSDRC_TRTP (0x7 << 12) /* Read to Precharge delay */ 75#define AT91_DDRSDRC_TRTP (0x7 << 12) /* Read to Precharge delay */
77 76
78#define AT91_DDRSDRC_LPR 0x1C /* Low Power Register */ 77#define AT91_DDRSDRC_LPR 0x1C /* Low Power Register */
79#define AT91CAP9_DDRSDRC_LPR 0x18 /* Low Power Register */
80#define AT91_DDRSDRC_LPCB (3 << 0) /* Low-power Configurations */ 78#define AT91_DDRSDRC_LPCB (3 << 0) /* Low-power Configurations */
81#define AT91_DDRSDRC_LPCB_DISABLE 0 79#define AT91_DDRSDRC_LPCB_DISABLE 0
82#define AT91_DDRSDRC_LPCB_SELF_REFRESH 1 80#define AT91_DDRSDRC_LPCB_SELF_REFRESH 1
@@ -94,11 +92,9 @@
94#define AT91_DDRSDRC_UPD_MR (3 << 20) /* Update load mode register and extended mode register */ 92#define AT91_DDRSDRC_UPD_MR (3 << 20) /* Update load mode register and extended mode register */
95 93
96#define AT91_DDRSDRC_MDR 0x20 /* Memory Device Register */ 94#define AT91_DDRSDRC_MDR 0x20 /* Memory Device Register */
97#define AT91CAP9_DDRSDRC_MDR 0x1C /* Memory Device Register */
98#define AT91_DDRSDRC_MD (3 << 0) /* Memory Device Type */ 95#define AT91_DDRSDRC_MD (3 << 0) /* Memory Device Type */
99#define AT91_DDRSDRC_MD_SDR 0 96#define AT91_DDRSDRC_MD_SDR 0
100#define AT91_DDRSDRC_MD_LOW_POWER_SDR 1 97#define AT91_DDRSDRC_MD_LOW_POWER_SDR 1
101#define AT91CAP9_DDRSDRC_MD_DDR 2
102#define AT91_DDRSDRC_MD_LOW_POWER_DDR 3 98#define AT91_DDRSDRC_MD_LOW_POWER_DDR 3
103#define AT91_DDRSDRC_MD_DDR2 6 /* [SAM9 Only] */ 99#define AT91_DDRSDRC_MD_DDR2 6 /* [SAM9 Only] */
104#define AT91_DDRSDRC_DBW (1 << 4) /* Data Bus Width */ 100#define AT91_DDRSDRC_DBW (1 << 4) /* Data Bus Width */
@@ -106,16 +102,10 @@
106#define AT91_DDRSDRC_DBW_16BITS (1 << 4) 102#define AT91_DDRSDRC_DBW_16BITS (1 << 4)
107 103
108#define AT91_DDRSDRC_DLL 0x24 /* DLL Information Register */ 104#define AT91_DDRSDRC_DLL 0x24 /* DLL Information Register */
109#define AT91CAP9_DDRSDRC_DLL 0x20 /* DLL Information Register */
110#define AT91_DDRSDRC_MDINC (1 << 0) /* Master Delay increment */ 105#define AT91_DDRSDRC_MDINC (1 << 0) /* Master Delay increment */
111#define AT91_DDRSDRC_MDDEC (1 << 1) /* Master Delay decrement */ 106#define AT91_DDRSDRC_MDDEC (1 << 1) /* Master Delay decrement */
112#define AT91_DDRSDRC_MDOVF (1 << 2) /* Master Delay Overflow */ 107#define AT91_DDRSDRC_MDOVF (1 << 2) /* Master Delay Overflow */
113#define AT91CAP9_DDRSDRC_SDCOVF (1 << 3) /* Slave Delay Correction Overflow */
114#define AT91CAP9_DDRSDRC_SDCUDF (1 << 4) /* Slave Delay Correction Underflow */
115#define AT91CAP9_DDRSDRC_SDERF (1 << 5) /* Slave Delay Correction error */
116#define AT91_DDRSDRC_MDVAL (0xff << 8) /* Master Delay value */ 108#define AT91_DDRSDRC_MDVAL (0xff << 8) /* Master Delay value */
117#define AT91CAP9_DDRSDRC_SDVAL (0xff << 16) /* Slave Delay value */
118#define AT91CAP9_DDRSDRC_SDCVAL (0xff << 24) /* Slave Delay Correction value */
119 109
120#define AT91_DDRSDRC_HS 0x2C /* High Speed Register [SAM9 Only] */ 110#define AT91_DDRSDRC_HS 0x2C /* High Speed Register [SAM9 Only] */
121#define AT91_DDRSDRC_DIS_ATCP_RD (1 << 2) /* Anticip read access is disabled */ 111#define AT91_DDRSDRC_DIS_ATCP_RD (1 << 2) /* Anticip read access is disabled */
diff --git a/arch/arm/mach-at91/include/mach/cpu.h b/arch/arm/mach-at91/include/mach/cpu.h
index f6ce936dba2..0118c333855 100644
--- a/arch/arm/mach-at91/include/mach/cpu.h
+++ b/arch/arm/mach-at91/include/mach/cpu.h
@@ -25,7 +25,6 @@
25#define ARCH_ID_AT91SAM9G45MRL 0x819b05a2 /* aka 9G45-ES2 & non ES lots */ 25#define ARCH_ID_AT91SAM9G45MRL 0x819b05a2 /* aka 9G45-ES2 & non ES lots */
26#define ARCH_ID_AT91SAM9G45ES 0x819b05a1 /* 9G45-ES (Engineering Sample) */ 26#define ARCH_ID_AT91SAM9G45ES 0x819b05a1 /* 9G45-ES (Engineering Sample) */
27#define ARCH_ID_AT91SAM9X5 0x819a05a0 27#define ARCH_ID_AT91SAM9X5 0x819a05a0
28#define ARCH_ID_AT91CAP9 0x039A03A0
29 28
30#define ARCH_ID_AT91SAM9XE128 0x329973a0 29#define ARCH_ID_AT91SAM9XE128 0x329973a0
31#define ARCH_ID_AT91SAM9XE256 0x329a93a0 30#define ARCH_ID_AT91SAM9XE256 0x329a93a0
@@ -51,10 +50,6 @@
51#define ARCH_FAMILY_AT91SAM9 0x01900000 50#define ARCH_FAMILY_AT91SAM9 0x01900000
52#define ARCH_FAMILY_AT91SAM9XE 0x02900000 51#define ARCH_FAMILY_AT91SAM9XE 0x02900000
53 52
54/* PMC revision */
55#define ARCH_REVISION_CAP9_B 0x399
56#define ARCH_REVISION_CAP9_C 0x601
57
58/* RM9200 type */ 53/* RM9200 type */
59#define ARCH_REVISON_9200_BGA (0 << 0) 54#define ARCH_REVISON_9200_BGA (0 << 0)
60#define ARCH_REVISON_9200_PQFP (1 << 0) 55#define ARCH_REVISON_9200_PQFP (1 << 0)
@@ -63,9 +58,6 @@ enum at91_soc_type {
63 /* 920T */ 58 /* 920T */
64 AT91_SOC_RM9200, 59 AT91_SOC_RM9200,
65 60
66 /* CAP */
67 AT91_SOC_CAP9,
68
69 /* SAM92xx */ 61 /* SAM92xx */
70 AT91_SOC_SAM9260, AT91_SOC_SAM9261, AT91_SOC_SAM9263, 62 AT91_SOC_SAM9260, AT91_SOC_SAM9261, AT91_SOC_SAM9263,
71 63
@@ -86,9 +78,6 @@ enum at91_soc_subtype {
86 /* RM9200 */ 78 /* RM9200 */
87 AT91_SOC_RM9200_BGA, AT91_SOC_RM9200_PQFP, 79 AT91_SOC_RM9200_BGA, AT91_SOC_RM9200_PQFP,
88 80
89 /* CAP9 */
90 AT91_SOC_CAP9_REV_B, AT91_SOC_CAP9_REV_C,
91
92 /* SAM9260 */ 81 /* SAM9260 */
93 AT91_SOC_SAM9XE, 82 AT91_SOC_SAM9XE,
94 83
@@ -195,16 +184,6 @@ static inline int at91_soc_is_detected(void)
195#define cpu_is_at91sam9x25() (0) 184#define cpu_is_at91sam9x25() (0)
196#endif 185#endif
197 186
198#ifdef CONFIG_ARCH_AT91CAP9
199#define cpu_is_at91cap9() (at91_soc_initdata.type == AT91_SOC_CAP9)
200#define cpu_is_at91cap9_revB() (at91_soc_initdata.subtype == AT91_SOC_CAP9_REV_B)
201#define cpu_is_at91cap9_revC() (at91_soc_initdata.subtype == AT91_SOC_CAP9_REV_C)
202#else
203#define cpu_is_at91cap9() (0)
204#define cpu_is_at91cap9_revB() (0)
205#define cpu_is_at91cap9_revC() (0)
206#endif
207
208/* 187/*
209 * Since this is ARM, we will never run on any AVR32 CPU. But these 188 * Since this is ARM, we will never run on any AVR32 CPU. But these
210 * definitions may reduce clutter in common drivers. 189 * definitions may reduce clutter in common drivers.
diff --git a/arch/arm/mach-at91/include/mach/hardware.h b/arch/arm/mach-at91/include/mach/hardware.h
index 2d0e4e99856..c213f28628c 100644
--- a/arch/arm/mach-at91/include/mach/hardware.h
+++ b/arch/arm/mach-at91/include/mach/hardware.h
@@ -19,7 +19,7 @@
19/* DBGU base */ 19/* DBGU base */
20/* rm9200, 9260/9g20, 9261/9g10, 9rl */ 20/* rm9200, 9260/9g20, 9261/9g10, 9rl */
21#define AT91_BASE_DBGU0 0xfffff200 21#define AT91_BASE_DBGU0 0xfffff200
22/* 9263, 9g45, cap9 */ 22/* 9263, 9g45 */
23#define AT91_BASE_DBGU1 0xffffee00 23#define AT91_BASE_DBGU1 0xffffee00
24 24
25#if defined(CONFIG_ARCH_AT91RM9200) 25#if defined(CONFIG_ARCH_AT91RM9200)
@@ -34,8 +34,6 @@
34#include <mach/at91sam9rl.h> 34#include <mach/at91sam9rl.h>
35#elif defined(CONFIG_ARCH_AT91SAM9G45) 35#elif defined(CONFIG_ARCH_AT91SAM9G45)
36#include <mach/at91sam9g45.h> 36#include <mach/at91sam9g45.h>
37#elif defined(CONFIG_ARCH_AT91CAP9)
38#include <mach/at91cap9.h>
39#elif defined(CONFIG_ARCH_AT91X40) 37#elif defined(CONFIG_ARCH_AT91X40)
40#include <mach/at91x40.h> 38#include <mach/at91x40.h>
41#else 39#else
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 1606379ac28..d554e6771b4 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -150,11 +150,6 @@ static int at91_pm_verify_clocks(void)
150 pr_err("AT91: PM - Suspend-to-RAM with USB still active\n"); 150 pr_err("AT91: PM - Suspend-to-RAM with USB still active\n");
151 return 0; 151 return 0;
152 } 152 }
153 } else if (cpu_is_at91cap9()) {
154 if ((scsr & AT91CAP9_PMC_UHP) != 0) {
155 pr_err("AT91: PM - Suspend-to-RAM with USB still active\n");
156 return 0;
157 }
158 } 153 }
159 154
160#ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS 155#ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS
@@ -203,7 +198,6 @@ extern u32 at91_slow_clock_sz;
203 198
204static int at91_pm_enter(suspend_state_t state) 199static int at91_pm_enter(suspend_state_t state)
205{ 200{
206 u32 saved_lpr;
207 at91_gpio_suspend(); 201 at91_gpio_suspend();
208 at91_irq_suspend(); 202 at91_irq_suspend();
209 203
@@ -259,16 +253,7 @@ static int at91_pm_enter(suspend_state_t state)
259 * For ARM 926 based chips, this requirement is weaker 253 * For ARM 926 based chips, this requirement is weaker
260 * as at91sam9 can access a RAM in self-refresh mode. 254 * as at91sam9 can access a RAM in self-refresh mode.
261 */ 255 */
262 asm volatile ( "mov r0, #0\n\t" 256 at91_standby();
263 "b 1f\n\t"
264 ".align 5\n\t"
265 "1: mcr p15, 0, r0, c7, c10, 4\n\t"
266 : /* no output */
267 : /* no input */
268 : "r0");
269 saved_lpr = sdram_selfrefresh_enable();
270 wait_for_interrupt_enable();
271 sdram_selfrefresh_disable(saved_lpr);
272 break; 257 break;
273 258
274 case PM_SUSPEND_ON: 259 case PM_SUSPEND_ON:
diff --git a/arch/arm/mach-at91/pm.h b/arch/arm/mach-at91/pm.h
index 7eb40d24242..bba9ce1aaae 100644
--- a/arch/arm/mach-at91/pm.h
+++ b/arch/arm/mach-at91/pm.h
@@ -1,3 +1,16 @@
1/*
2 * AT91 Power Management
3 *
4 * Copyright (C) 2005 David Brownell
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11#ifndef __ARCH_ARM_MACH_AT91_PM
12#define __ARCH_ARM_MACH_AT91_PM
13
1#ifdef CONFIG_ARCH_AT91RM9200 14#ifdef CONFIG_ARCH_AT91RM9200
2#include <mach/at91rm9200_mc.h> 15#include <mach/at91rm9200_mc.h>
3 16
@@ -11,36 +24,25 @@
11 * still in self-refresh is "not recommended", but seems to work. 24 * still in self-refresh is "not recommended", but seems to work.
12 */ 25 */
13 26
14static inline u32 sdram_selfrefresh_enable(void) 27static inline void at91rm9200_standby(void)
15{
16 u32 saved_lpr = at91_sys_read(AT91_SDRAMC_LPR);
17
18 at91_sys_write(AT91_SDRAMC_LPR, 0);
19 at91_sys_write(AT91_SDRAMC_SRR, 1);
20 return saved_lpr;
21}
22
23#define sdram_selfrefresh_disable(saved_lpr) at91_sys_write(AT91_SDRAMC_LPR, saved_lpr)
24#define wait_for_interrupt_enable() asm volatile ("mcr p15, 0, %0, c7, c0, 4" \
25 : : "r" (0))
26
27#elif defined(CONFIG_ARCH_AT91CAP9)
28#include <mach/at91sam9_ddrsdr.h>
29
30
31static inline u32 sdram_selfrefresh_enable(void)
32{ 28{
33 u32 saved_lpr, lpr; 29 u32 lpr = at91_sys_read(AT91_SDRAMC_LPR);
34 30
35 saved_lpr = at91_ramc_read(0, AT91CAP9_DDRSDRC_LPR); 31 asm volatile(
36 32 "b 1f\n\t"
37 lpr = saved_lpr & ~AT91_DDRSDRC_LPCB; 33 ".align 5\n\t"
38 at91_ramc_write(0, AT91CAP9_DDRSDRC_LPR, lpr | AT91_DDRSDRC_LPCB_SELF_REFRESH); 34 "1: mcr p15, 0, %0, c7, c10, 4\n\t"
39 return saved_lpr; 35 " str %0, [%1, %2]\n\t"
36 " str %3, [%1, %4]\n\t"
37 " mcr p15, 0, %0, c7, c0, 4\n\t"
38 " str %5, [%1, %2]"
39 :
40 : "r" (0), "r" (AT91_BASE_SYS), "r" (AT91_SDRAMC_LPR),
41 "r" (1), "r" (AT91_SDRAMC_SRR),
42 "r" (lpr));
40} 43}
41 44
42#define sdram_selfrefresh_disable(saved_lpr) at91_ramc_write(0, AT91CAP9_DDRSDRC_LPR, saved_lpr) 45#define at91_standby at91rm9200_standby
43#define wait_for_interrupt_enable() cpu_do_idle()
44 46
45#elif defined(CONFIG_ARCH_AT91SAM9G45) 47#elif defined(CONFIG_ARCH_AT91SAM9G45)
46#include <mach/at91sam9_ddrsdr.h> 48#include <mach/at91sam9_ddrsdr.h>
@@ -48,14 +50,12 @@ static inline u32 sdram_selfrefresh_enable(void)
48/* We manage both DDRAM/SDRAM controllers, we need more than one value to 50/* We manage both DDRAM/SDRAM controllers, we need more than one value to
49 * remember. 51 * remember.
50 */ 52 */
51static u32 saved_lpr1; 53static inline void at91sam9g45_standby(void)
52
53static inline u32 sdram_selfrefresh_enable(void)
54{ 54{
55 /* Those tow values allow us to delay self-refresh activation 55 /* Those two values allow us to delay self-refresh activation
56 * to the maximum. */ 56 * to the maximum. */
57 u32 lpr0, lpr1; 57 u32 lpr0, lpr1;
58 u32 saved_lpr0; 58 u32 saved_lpr0, saved_lpr1;
59 59
60 saved_lpr1 = at91_ramc_read(1, AT91_DDRSDRC_LPR); 60 saved_lpr1 = at91_ramc_read(1, AT91_DDRSDRC_LPR);
61 lpr1 = saved_lpr1 & ~AT91_DDRSDRC_LPCB; 61 lpr1 = saved_lpr1 & ~AT91_DDRSDRC_LPCB;
@@ -69,15 +69,13 @@ static inline u32 sdram_selfrefresh_enable(void)
69 at91_ramc_write(0, AT91_DDRSDRC_LPR, lpr0); 69 at91_ramc_write(0, AT91_DDRSDRC_LPR, lpr0);
70 at91_ramc_write(1, AT91_DDRSDRC_LPR, lpr1); 70 at91_ramc_write(1, AT91_DDRSDRC_LPR, lpr1);
71 71
72 return saved_lpr0; 72 cpu_do_idle();
73
74 at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr0);
75 at91_ramc_write(1, AT91_DDRSDRC_LPR, saved_lpr1);
73} 76}
74 77
75#define sdram_selfrefresh_disable(saved_lpr0) \ 78#define at91_standby at91sam9g45_standby
76 do { \
77 at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr0); \
78 at91_ramc_write(1, AT91_DDRSDRC_LPR, saved_lpr1); \
79 } while (0)
80#define wait_for_interrupt_enable() cpu_do_idle()
81 79
82#else 80#else
83#include <mach/at91sam9_sdramc.h> 81#include <mach/at91sam9_sdramc.h>
@@ -90,18 +88,23 @@ static inline u32 sdram_selfrefresh_enable(void)
90#warning Assuming EB1 SDRAM controller is *NOT* used 88#warning Assuming EB1 SDRAM controller is *NOT* used
91#endif 89#endif
92 90
93static inline u32 sdram_selfrefresh_enable(void) 91static inline void at91sam9_standby(void)
94{ 92{
95 u32 saved_lpr, lpr; 93 u32 saved_lpr, lpr;
96 94
97 saved_lpr = at91_ramc_read(0, AT91_SDRAMC_LPR); 95 saved_lpr = at91_ramc_read(0, AT91_SDRAMC_LPR);
98 96
99 lpr = saved_lpr & ~AT91_SDRAMC_LPCB; 97 lpr = saved_lpr & ~AT91_SDRAMC_LPCB;
100 at91_ramc_write(0, AT91_SDRAMC_LPR, lpr | AT91_SDRAMC_LPCB_SELF_REFRESH); 98 at91_ramc_write(0, AT91_SDRAMC_LPR, lpr |
101 return saved_lpr; 99 AT91_SDRAMC_LPCB_SELF_REFRESH);
100
101 cpu_do_idle();
102
103 at91_ramc_write(0, AT91_SDRAMC_LPR, saved_lpr);
102} 104}
103 105
104#define sdram_selfrefresh_disable(saved_lpr) at91_ramc_write(0, AT91_SDRAMC_LPR, saved_lpr) 106#define at91_standby at91sam9_standby
105#define wait_for_interrupt_enable() cpu_do_idle() 107
108#endif
106 109
107#endif 110#endif
diff --git a/arch/arm/mach-at91/pm_slowclock.S b/arch/arm/mach-at91/pm_slowclock.S
index 92dfb846139..f8539a8bcd6 100644
--- a/arch/arm/mach-at91/pm_slowclock.S
+++ b/arch/arm/mach-at91/pm_slowclock.S
@@ -18,8 +18,7 @@
18 18
19#if defined(CONFIG_ARCH_AT91RM9200) 19#if defined(CONFIG_ARCH_AT91RM9200)
20#include <mach/at91rm9200_mc.h> 20#include <mach/at91rm9200_mc.h>
21#elif defined(CONFIG_ARCH_AT91CAP9) \ 21#elif defined(CONFIG_ARCH_AT91SAM9G45)
22 || defined(CONFIG_ARCH_AT91SAM9G45)
23#include <mach/at91sam9_ddrsdr.h> 22#include <mach/at91sam9_ddrsdr.h>
24#else 23#else
25#include <mach/at91sam9_sdramc.h> 24#include <mach/at91sam9_sdramc.h>
@@ -130,8 +129,7 @@ ENTRY(at91_slow_clock)
130 /* Put SDRAM in self-refresh mode */ 129 /* Put SDRAM in self-refresh mode */
131 mov r3, #1 130 mov r3, #1
132 str r3, [r2, #AT91_SDRAMC_SRR] 131 str r3, [r2, #AT91_SDRAMC_SRR]
133#elif defined(CONFIG_ARCH_AT91CAP9) \ 132#elif defined(CONFIG_ARCH_AT91SAM9G45)
134 || defined(CONFIG_ARCH_AT91SAM9G45)
135 133
136 /* prepare for DDRAM self-refresh mode */ 134 /* prepare for DDRAM self-refresh mode */
137 ldr r3, [r2, #AT91_DDRSDRC_LPR] 135 ldr r3, [r2, #AT91_DDRSDRC_LPR]
@@ -263,8 +261,7 @@ ENTRY(at91_slow_clock)
263 261
264#ifdef CONFIG_ARCH_AT91RM9200 262#ifdef CONFIG_ARCH_AT91RM9200
265 /* Do nothing - self-refresh is automatically disabled. */ 263 /* Do nothing - self-refresh is automatically disabled. */
266#elif defined(CONFIG_ARCH_AT91CAP9) \ 264#elif defined(CONFIG_ARCH_AT91SAM9G45)
267 || defined(CONFIG_ARCH_AT91SAM9G45)
268 /* Restore LPR on AT91 with DDRAM */ 265 /* Restore LPR on AT91 with DDRAM */
269 ldr r3, .saved_sam9_lpr 266 ldr r3, .saved_sam9_lpr
270 str r3, [r2, #AT91_DDRSDRC_LPR] 267 str r3, [r2, #AT91_DDRSDRC_LPR]
@@ -305,8 +302,7 @@ ENTRY(at91_slow_clock)
305#ifdef CONFIG_ARCH_AT91RM9200 302#ifdef CONFIG_ARCH_AT91RM9200
306.at91_va_base_sdramc: 303.at91_va_base_sdramc:
307 .word AT91_VA_BASE_SYS 304 .word AT91_VA_BASE_SYS
308#elif defined(CONFIG_ARCH_AT91CAP9) \ 305#elif defined(CONFIG_ARCH_AT91SAM9G45)
309 || defined(CONFIG_ARCH_AT91SAM9G45)
310.at91_va_base_sdramc: 306.at91_va_base_sdramc:
311 .word AT91_VA_BASE_SYS + AT91_DDRSDRC0 307 .word AT91_VA_BASE_SYS + AT91_DDRSDRC0
312#else 308#else
diff --git a/arch/arm/mach-at91/setup.c b/arch/arm/mach-at91/setup.c
index 69d3fc4c46f..620c67e8f81 100644
--- a/arch/arm/mach-at91/setup.c
+++ b/arch/arm/mach-at91/setup.c
@@ -86,20 +86,6 @@ static void __init soc_detect(u32 dbgu_base)
86 socid = cidr & ~AT91_CIDR_VERSION; 86 socid = cidr & ~AT91_CIDR_VERSION;
87 87
88 switch (socid) { 88 switch (socid) {
89 case ARCH_ID_AT91CAP9: {
90#ifdef CONFIG_AT91_PMC_UNIT
91 u32 pmc_ver = at91_sys_read(AT91_PMC_VER);
92
93 if (pmc_ver == ARCH_REVISION_CAP9_B)
94 at91_soc_initdata.subtype = AT91_SOC_CAP9_REV_B;
95 else if (pmc_ver == ARCH_REVISION_CAP9_C)
96 at91_soc_initdata.subtype = AT91_SOC_CAP9_REV_C;
97#endif
98 at91_soc_initdata.type = AT91_SOC_CAP9;
99 at91_boot_soc = at91cap9_soc;
100 break;
101 }
102
103 case ARCH_ID_AT91RM9200: 89 case ARCH_ID_AT91RM9200:
104 at91_soc_initdata.type = AT91_SOC_RM9200; 90 at91_soc_initdata.type = AT91_SOC_RM9200;
105 at91_boot_soc = at91rm9200_soc; 91 at91_boot_soc = at91rm9200_soc;
@@ -200,7 +186,6 @@ static void __init soc_detect(u32 dbgu_base)
200 186
201static const char *soc_name[] = { 187static const char *soc_name[] = {
202 [AT91_SOC_RM9200] = "at91rm9200", 188 [AT91_SOC_RM9200] = "at91rm9200",
203 [AT91_SOC_CAP9] = "at91cap9",
204 [AT91_SOC_SAM9260] = "at91sam9260", 189 [AT91_SOC_SAM9260] = "at91sam9260",
205 [AT91_SOC_SAM9261] = "at91sam9261", 190 [AT91_SOC_SAM9261] = "at91sam9261",
206 [AT91_SOC_SAM9263] = "at91sam9263", 191 [AT91_SOC_SAM9263] = "at91sam9263",
@@ -221,8 +206,6 @@ EXPORT_SYMBOL(at91_get_soc_type);
221static const char *soc_subtype_name[] = { 206static const char *soc_subtype_name[] = {
222 [AT91_SOC_RM9200_BGA] = "at91rm9200 BGA", 207 [AT91_SOC_RM9200_BGA] = "at91rm9200 BGA",
223 [AT91_SOC_RM9200_PQFP] = "at91rm9200 PQFP", 208 [AT91_SOC_RM9200_PQFP] = "at91rm9200 PQFP",
224 [AT91_SOC_CAP9_REV_B] = "at91cap9 revB",
225 [AT91_SOC_CAP9_REV_C] = "at91cap9 revC",
226 [AT91_SOC_SAM9XE] = "at91sam9xe", 209 [AT91_SOC_SAM9XE] = "at91sam9xe",
227 [AT91_SOC_SAM9G45ES] = "at91sam9g45es", 210 [AT91_SOC_SAM9G45ES] = "at91sam9g45es",
228 [AT91_SOC_SAM9M10] = "at91sam9m10", 211 [AT91_SOC_SAM9M10] = "at91sam9m10",
diff --git a/arch/arm/mach-at91/soc.h b/arch/arm/mach-at91/soc.h
index 4588ae6f7ac..5db4aa45404 100644
--- a/arch/arm/mach-at91/soc.h
+++ b/arch/arm/mach-at91/soc.h
@@ -13,7 +13,6 @@ struct at91_init_soc {
13}; 13};
14 14
15extern struct at91_init_soc at91_boot_soc; 15extern struct at91_init_soc at91_boot_soc;
16extern struct at91_init_soc at91cap9_soc;
17extern struct at91_init_soc at91rm9200_soc; 16extern struct at91_init_soc at91rm9200_soc;
18extern struct at91_init_soc at91sam9260_soc; 17extern struct at91_init_soc at91sam9260_soc;
19extern struct at91_init_soc at91sam9261_soc; 18extern struct at91_init_soc at91sam9261_soc;
@@ -27,10 +26,6 @@ static inline int at91_soc_is_enabled(void)
27 return at91_boot_soc.init != NULL; 26 return at91_boot_soc.init != NULL;
28} 27}
29 28
30#if !defined(CONFIG_ARCH_AT91CAP9)
31#define at91cap9_soc at91_boot_soc
32#endif
33
34#if !defined(CONFIG_ARCH_AT91RM9200) 29#if !defined(CONFIG_ARCH_AT91RM9200)
35#define at91rm9200_soc at91_boot_soc 30#define at91rm9200_soc at91_boot_soc
36#endif 31#endif
diff --git a/arch/arm/mach-davinci/board-dm355-evm.c b/arch/arm/mach-davinci/board-dm355-evm.c
index 275341f159f..82ed753fb36 100644
--- a/arch/arm/mach-davinci/board-dm355-evm.c
+++ b/arch/arm/mach-davinci/board-dm355-evm.c
@@ -26,13 +26,14 @@
26#include <asm/mach-types.h> 26#include <asm/mach-types.h>
27#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28 28
29#include <mach/dm355.h>
30#include <mach/i2c.h> 29#include <mach/i2c.h>
31#include <mach/serial.h> 30#include <mach/serial.h>
32#include <mach/nand.h> 31#include <mach/nand.h>
33#include <mach/mmc.h> 32#include <mach/mmc.h>
34#include <mach/usb.h> 33#include <mach/usb.h>
35 34
35#include "davinci.h"
36
36/* NOTE: this is geared for the standard config, with a socketed 37/* NOTE: this is geared for the standard config, with a socketed
37 * 2 GByte Micron NAND (MT29F16G08FAA) using 128KB sectors. If you 38 * 2 GByte Micron NAND (MT29F16G08FAA) using 128KB sectors. If you
38 * swap chips, maybe with a different block size, partitioning may 39 * swap chips, maybe with a different block size, partitioning may
diff --git a/arch/arm/mach-davinci/board-dm355-leopard.c b/arch/arm/mach-davinci/board-dm355-leopard.c
index e99db28181a..d74a8b3445f 100644
--- a/arch/arm/mach-davinci/board-dm355-leopard.c
+++ b/arch/arm/mach-davinci/board-dm355-leopard.c
@@ -23,13 +23,14 @@
23#include <asm/mach-types.h> 23#include <asm/mach-types.h>
24#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
25 25
26#include <mach/dm355.h>
27#include <mach/i2c.h> 26#include <mach/i2c.h>
28#include <mach/serial.h> 27#include <mach/serial.h>
29#include <mach/nand.h> 28#include <mach/nand.h>
30#include <mach/mmc.h> 29#include <mach/mmc.h>
31#include <mach/usb.h> 30#include <mach/usb.h>
32 31
32#include "davinci.h"
33
33/* NOTE: this is geared for the standard config, with a socketed 34/* NOTE: this is geared for the standard config, with a socketed
34 * 2 GByte Micron NAND (MT29F16G08FAA) using 128KB sectors. If you 35 * 2 GByte Micron NAND (MT29F16G08FAA) using 128KB sectors. If you
35 * swap chips, maybe with a different block size, partitioning may 36 * swap chips, maybe with a different block size, partitioning may
diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index 849311d3cb7..5bce2b83bb4 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -32,7 +32,6 @@
32#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
33 33
34#include <mach/mux.h> 34#include <mach/mux.h>
35#include <mach/dm365.h>
36#include <mach/common.h> 35#include <mach/common.h>
37#include <mach/i2c.h> 36#include <mach/i2c.h>
38#include <mach/serial.h> 37#include <mach/serial.h>
@@ -42,6 +41,8 @@
42 41
43#include <media/tvp514x.h> 42#include <media/tvp514x.h>
44 43
44#include "davinci.h"
45
45static inline int have_imager(void) 46static inline int have_imager(void)
46{ 47{
47 /* REVISIT when it's supported, trigger via Kconfig */ 48 /* REVISIT when it's supported, trigger via Kconfig */
diff --git a/arch/arm/mach-davinci/board-dm644x-evm.c b/arch/arm/mach-davinci/board-dm644x-evm.c
index 1247ecdcf75..864f676ecca 100644
--- a/arch/arm/mach-davinci/board-dm644x-evm.c
+++ b/arch/arm/mach-davinci/board-dm644x-evm.c
@@ -30,7 +30,6 @@
30#include <asm/mach-types.h> 30#include <asm/mach-types.h>
31#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
32 32
33#include <mach/dm644x.h>
34#include <mach/common.h> 33#include <mach/common.h>
35#include <mach/i2c.h> 34#include <mach/i2c.h>
36#include <mach/serial.h> 35#include <mach/serial.h>
@@ -40,6 +39,8 @@
40#include <mach/usb.h> 39#include <mach/usb.h>
41#include <mach/aemif.h> 40#include <mach/aemif.h>
42 41
42#include "davinci.h"
43
43#define DM644X_EVM_PHY_ID "davinci_mdio-0:01" 44#define DM644X_EVM_PHY_ID "davinci_mdio-0:01"
44#define LXT971_PHY_ID (0x001378e2) 45#define LXT971_PHY_ID (0x001378e2)
45#define LXT971_PHY_MASK (0xfffffff0) 46#define LXT971_PHY_MASK (0xfffffff0)
@@ -189,7 +190,7 @@ static struct platform_device davinci_fb_device = {
189 .num_resources = 0, 190 .num_resources = 0,
190}; 191};
191 192
192static struct tvp514x_platform_data tvp5146_pdata = { 193static struct tvp514x_platform_data dm644xevm_tvp5146_pdata = {
193 .clk_polarity = 0, 194 .clk_polarity = 0,
194 .hs_polarity = 1, 195 .hs_polarity = 1,
195 .vs_polarity = 1 196 .vs_polarity = 1
@@ -197,7 +198,7 @@ static struct tvp514x_platform_data tvp5146_pdata = {
197 198
198#define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL) 199#define TVP514X_STD_ALL (V4L2_STD_NTSC | V4L2_STD_PAL)
199/* Inputs available at the TVP5146 */ 200/* Inputs available at the TVP5146 */
200static struct v4l2_input tvp5146_inputs[] = { 201static struct v4l2_input dm644xevm_tvp5146_inputs[] = {
201 { 202 {
202 .index = 0, 203 .index = 0,
203 .name = "Composite", 204 .name = "Composite",
@@ -217,7 +218,7 @@ static struct v4l2_input tvp5146_inputs[] = {
217 * ouput that goes to vpfe. There is a one to one correspondence 218 * ouput that goes to vpfe. There is a one to one correspondence
218 * with tvp5146_inputs 219 * with tvp5146_inputs
219 */ 220 */
220static struct vpfe_route tvp5146_routes[] = { 221static struct vpfe_route dm644xevm_tvp5146_routes[] = {
221 { 222 {
222 .input = INPUT_CVBS_VI2B, 223 .input = INPUT_CVBS_VI2B,
223 .output = OUTPUT_10BIT_422_EMBEDDED_SYNC, 224 .output = OUTPUT_10BIT_422_EMBEDDED_SYNC,
@@ -228,13 +229,13 @@ static struct vpfe_route tvp5146_routes[] = {
228 }, 229 },
229}; 230};
230 231
231static struct vpfe_subdev_info vpfe_sub_devs[] = { 232static struct vpfe_subdev_info dm644xevm_vpfe_sub_devs[] = {
232 { 233 {
233 .name = "tvp5146", 234 .name = "tvp5146",
234 .grp_id = 0, 235 .grp_id = 0,
235 .num_inputs = ARRAY_SIZE(tvp5146_inputs), 236 .num_inputs = ARRAY_SIZE(dm644xevm_tvp5146_inputs),
236 .inputs = tvp5146_inputs, 237 .inputs = dm644xevm_tvp5146_inputs,
237 .routes = tvp5146_routes, 238 .routes = dm644xevm_tvp5146_routes,
238 .can_route = 1, 239 .can_route = 1,
239 .ccdc_if_params = { 240 .ccdc_if_params = {
240 .if_type = VPFE_BT656, 241 .if_type = VPFE_BT656,
@@ -243,15 +244,15 @@ static struct vpfe_subdev_info vpfe_sub_devs[] = {
243 }, 244 },
244 .board_info = { 245 .board_info = {
245 I2C_BOARD_INFO("tvp5146", 0x5d), 246 I2C_BOARD_INFO("tvp5146", 0x5d),
246 .platform_data = &tvp5146_pdata, 247 .platform_data = &dm644xevm_tvp5146_pdata,
247 }, 248 },
248 }, 249 },
249}; 250};
250 251
251static struct vpfe_config vpfe_cfg = { 252static struct vpfe_config dm644xevm_capture_cfg = {
252 .num_subdevs = ARRAY_SIZE(vpfe_sub_devs), 253 .num_subdevs = ARRAY_SIZE(dm644xevm_vpfe_sub_devs),
253 .i2c_adapter_id = 1, 254 .i2c_adapter_id = 1,
254 .sub_devs = vpfe_sub_devs, 255 .sub_devs = dm644xevm_vpfe_sub_devs,
255 .card_name = "DM6446 EVM", 256 .card_name = "DM6446 EVM",
256 .ccdc = "DM6446 CCDC", 257 .ccdc = "DM6446 CCDC",
257}; 258};
@@ -624,8 +625,6 @@ static struct davinci_uart_config uart_config __initdata = {
624static void __init 625static void __init
625davinci_evm_map_io(void) 626davinci_evm_map_io(void)
626{ 627{
627 /* setup input configuration for VPFE input devices */
628 dm644x_set_vpfe_config(&vpfe_cfg);
629 dm644x_init(); 628 dm644x_init();
630} 629}
631 630
@@ -697,6 +696,7 @@ static __init void davinci_evm_init(void)
697 evm_init_i2c(); 696 evm_init_i2c();
698 697
699 davinci_setup_mmc(0, &dm6446evm_mmc_config); 698 davinci_setup_mmc(0, &dm6446evm_mmc_config);
699 dm644x_init_video(&dm644xevm_capture_cfg);
700 700
701 davinci_serial_init(&uart_config); 701 davinci_serial_init(&uart_config);
702 dm644x_init_asp(&dm644x_evm_snd_data); 702 dm644x_init_asp(&dm644x_evm_snd_data);
diff --git a/arch/arm/mach-davinci/board-dm646x-evm.c b/arch/arm/mach-davinci/board-dm646x-evm.c
index 872ac69fa04..d72ab948d63 100644
--- a/arch/arm/mach-davinci/board-dm646x-evm.c
+++ b/arch/arm/mach-davinci/board-dm646x-evm.c
@@ -36,7 +36,6 @@
36#include <asm/mach-types.h> 36#include <asm/mach-types.h>
37#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
38 38
39#include <mach/dm646x.h>
40#include <mach/common.h> 39#include <mach/common.h>
41#include <mach/serial.h> 40#include <mach/serial.h>
42#include <mach/i2c.h> 41#include <mach/i2c.h>
@@ -45,6 +44,7 @@
45#include <mach/cdce949.h> 44#include <mach/cdce949.h>
46#include <mach/aemif.h> 45#include <mach/aemif.h>
47 46
47#include "davinci.h"
48#include "clock.h" 48#include "clock.h"
49 49
50#define NAND_BLOCK_SIZE SZ_128K 50#define NAND_BLOCK_SIZE SZ_128K
@@ -410,8 +410,6 @@ static struct davinci_i2c_platform_data i2c_pdata = {
410 .bus_delay = 0 /* usec */, 410 .bus_delay = 0 /* usec */,
411}; 411};
412 412
413#define VIDCLKCTL_OFFSET (DAVINCI_SYSTEM_MODULE_BASE + 0x38)
414#define VSCLKDIS_OFFSET (DAVINCI_SYSTEM_MODULE_BASE + 0x6c)
415#define VCH2CLK_MASK (BIT_MASK(10) | BIT_MASK(9) | BIT_MASK(8)) 413#define VCH2CLK_MASK (BIT_MASK(10) | BIT_MASK(9) | BIT_MASK(8))
416#define VCH2CLK_SYSCLK8 (BIT(9)) 414#define VCH2CLK_SYSCLK8 (BIT(9))
417#define VCH2CLK_AUXCLK (BIT(9) | BIT(8)) 415#define VCH2CLK_AUXCLK (BIT(9) | BIT(8))
@@ -429,8 +427,6 @@ static struct davinci_i2c_platform_data i2c_pdata = {
429#define TVP5147_CH0 "tvp514x-0" 427#define TVP5147_CH0 "tvp514x-0"
430#define TVP5147_CH1 "tvp514x-1" 428#define TVP5147_CH1 "tvp514x-1"
431 429
432static void __iomem *vpif_vidclkctl_reg;
433static void __iomem *vpif_vsclkdis_reg;
434/* spin lock for updating above registers */ 430/* spin lock for updating above registers */
435static spinlock_t vpif_reg_lock; 431static spinlock_t vpif_reg_lock;
436 432
@@ -441,14 +437,14 @@ static int set_vpif_clock(int mux_mode, int hd)
441 int val = 0; 437 int val = 0;
442 int err = 0; 438 int err = 0;
443 439
444 if (!vpif_vidclkctl_reg || !vpif_vsclkdis_reg || !cpld_client) 440 if (!cpld_client)
445 return -ENXIO; 441 return -ENXIO;
446 442
447 /* disable the clock */ 443 /* disable the clock */
448 spin_lock_irqsave(&vpif_reg_lock, flags); 444 spin_lock_irqsave(&vpif_reg_lock, flags);
449 value = __raw_readl(vpif_vsclkdis_reg); 445 value = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_VSCLKDIS));
450 value |= (VIDCH3CLK | VIDCH2CLK); 446 value |= (VIDCH3CLK | VIDCH2CLK);
451 __raw_writel(value, vpif_vsclkdis_reg); 447 __raw_writel(value, DAVINCI_SYSMOD_VIRT(SYSMOD_VSCLKDIS));
452 spin_unlock_irqrestore(&vpif_reg_lock, flags); 448 spin_unlock_irqrestore(&vpif_reg_lock, flags);
453 449
454 val = i2c_smbus_read_byte(cpld_client); 450 val = i2c_smbus_read_byte(cpld_client);
@@ -464,7 +460,7 @@ static int set_vpif_clock(int mux_mode, int hd)
464 if (err) 460 if (err)
465 return err; 461 return err;
466 462
467 value = __raw_readl(vpif_vidclkctl_reg); 463 value = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_VIDCLKCTL));
468 value &= ~(VCH2CLK_MASK); 464 value &= ~(VCH2CLK_MASK);
469 value &= ~(VCH3CLK_MASK); 465 value &= ~(VCH3CLK_MASK);
470 466
@@ -473,13 +469,13 @@ static int set_vpif_clock(int mux_mode, int hd)
473 else 469 else
474 value |= (VCH2CLK_AUXCLK | VCH3CLK_AUXCLK); 470 value |= (VCH2CLK_AUXCLK | VCH3CLK_AUXCLK);
475 471
476 __raw_writel(value, vpif_vidclkctl_reg); 472 __raw_writel(value, DAVINCI_SYSMOD_VIRT(SYSMOD_VIDCLKCTL));
477 473
478 spin_lock_irqsave(&vpif_reg_lock, flags); 474 spin_lock_irqsave(&vpif_reg_lock, flags);
479 value = __raw_readl(vpif_vsclkdis_reg); 475 value = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_VSCLKDIS));
480 /* enable the clock */ 476 /* enable the clock */
481 value &= ~(VIDCH3CLK | VIDCH2CLK); 477 value &= ~(VIDCH3CLK | VIDCH2CLK);
482 __raw_writel(value, vpif_vsclkdis_reg); 478 __raw_writel(value, DAVINCI_SYSMOD_VIRT(SYSMOD_VSCLKDIS));
483 spin_unlock_irqrestore(&vpif_reg_lock, flags); 479 spin_unlock_irqrestore(&vpif_reg_lock, flags);
484 480
485 return 0; 481 return 0;
@@ -564,7 +560,7 @@ static int setup_vpif_input_channel_mode(int mux_mode)
564 int val; 560 int val;
565 u32 value; 561 u32 value;
566 562
567 if (!vpif_vidclkctl_reg || !cpld_client) 563 if (!cpld_client)
568 return -ENXIO; 564 return -ENXIO;
569 565
570 val = i2c_smbus_read_byte(cpld_client); 566 val = i2c_smbus_read_byte(cpld_client);
@@ -572,7 +568,7 @@ static int setup_vpif_input_channel_mode(int mux_mode)
572 return val; 568 return val;
573 569
574 spin_lock_irqsave(&vpif_reg_lock, flags); 570 spin_lock_irqsave(&vpif_reg_lock, flags);
575 value = __raw_readl(vpif_vidclkctl_reg); 571 value = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_VIDCLKCTL));
576 if (mux_mode) { 572 if (mux_mode) {
577 val &= VPIF_INPUT_TWO_CHANNEL; 573 val &= VPIF_INPUT_TWO_CHANNEL;
578 value |= VIDCH1CLK; 574 value |= VIDCH1CLK;
@@ -580,7 +576,7 @@ static int setup_vpif_input_channel_mode(int mux_mode)
580 val |= VPIF_INPUT_ONE_CHANNEL; 576 val |= VPIF_INPUT_ONE_CHANNEL;
581 value &= ~VIDCH1CLK; 577 value &= ~VIDCH1CLK;
582 } 578 }
583 __raw_writel(value, vpif_vidclkctl_reg); 579 __raw_writel(value, DAVINCI_SYSMOD_VIRT(SYSMOD_VIDCLKCTL));
584 spin_unlock_irqrestore(&vpif_reg_lock, flags); 580 spin_unlock_irqrestore(&vpif_reg_lock, flags);
585 581
586 err = i2c_smbus_write_byte(cpld_client, val); 582 err = i2c_smbus_write_byte(cpld_client, val);
@@ -674,12 +670,6 @@ static struct vpif_capture_config dm646x_vpif_capture_cfg = {
674 670
675static void __init evm_init_video(void) 671static void __init evm_init_video(void)
676{ 672{
677 vpif_vidclkctl_reg = ioremap(VIDCLKCTL_OFFSET, 4);
678 vpif_vsclkdis_reg = ioremap(VSCLKDIS_OFFSET, 4);
679 if (!vpif_vidclkctl_reg || !vpif_vsclkdis_reg) {
680 pr_err("Can't map VPIF VIDCLKCTL or VSCLKDIS registers\n");
681 return;
682 }
683 spin_lock_init(&vpif_reg_lock); 673 spin_lock_init(&vpif_reg_lock);
684 674
685 dm646x_setup_vpif(&dm646x_vpif_display_config, 675 dm646x_setup_vpif(&dm646x_vpif_display_config,
diff --git a/arch/arm/mach-davinci/board-neuros-osd2.c b/arch/arm/mach-davinci/board-neuros-osd2.c
index 8d34f513d41..a772bb45570 100644
--- a/arch/arm/mach-davinci/board-neuros-osd2.c
+++ b/arch/arm/mach-davinci/board-neuros-osd2.c
@@ -30,7 +30,6 @@
30#include <asm/mach-types.h> 30#include <asm/mach-types.h>
31#include <asm/mach/arch.h> 31#include <asm/mach/arch.h>
32 32
33#include <mach/dm644x.h>
34#include <mach/common.h> 33#include <mach/common.h>
35#include <mach/i2c.h> 34#include <mach/i2c.h>
36#include <mach/serial.h> 35#include <mach/serial.h>
@@ -39,6 +38,8 @@
39#include <mach/mmc.h> 38#include <mach/mmc.h>
40#include <mach/usb.h> 39#include <mach/usb.h>
41 40
41#include "davinci.h"
42
42#define NEUROS_OSD2_PHY_ID "davinci_mdio-0:01" 43#define NEUROS_OSD2_PHY_ID "davinci_mdio-0:01"
43#define LXT971_PHY_ID 0x001378e2 44#define LXT971_PHY_ID 0x001378e2
44#define LXT971_PHY_MASK 0xfffffff0 45#define LXT971_PHY_MASK 0xfffffff0
diff --git a/arch/arm/mach-davinci/board-sffsdr.c b/arch/arm/mach-davinci/board-sffsdr.c
index 31da3c5b2ba..76e67509610 100644
--- a/arch/arm/mach-davinci/board-sffsdr.c
+++ b/arch/arm/mach-davinci/board-sffsdr.c
@@ -35,13 +35,14 @@
35#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
36#include <asm/mach/flash.h> 36#include <asm/mach/flash.h>
37 37
38#include <mach/dm644x.h>
39#include <mach/common.h> 38#include <mach/common.h>
40#include <mach/i2c.h> 39#include <mach/i2c.h>
41#include <mach/serial.h> 40#include <mach/serial.h>
42#include <mach/mux.h> 41#include <mach/mux.h>
43#include <mach/usb.h> 42#include <mach/usb.h>
44 43
44#include "davinci.h"
45
45#define SFFSDR_PHY_ID "davinci_mdio-0:01" 46#define SFFSDR_PHY_ID "davinci_mdio-0:01"
46static struct mtd_partition davinci_sffsdr_nandflash_partition[] = { 47static struct mtd_partition davinci_sffsdr_nandflash_partition[] = {
47 /* U-Boot Environment: Block 0 48 /* U-Boot Environment: Block 0
diff --git a/arch/arm/mach-davinci/davinci.h b/arch/arm/mach-davinci/davinci.h
new file mode 100644
index 00000000000..9d708034b57
--- /dev/null
+++ b/arch/arm/mach-davinci/davinci.h
@@ -0,0 +1,96 @@
1/*
2 * This file contains the processor specific definitions
3 * of the TI DM644x, DM355, DM365, and DM646x.
4 *
5 * Copyright (C) 2011 Texas Instruments Incorporated
6 * Copyright (c) 2007 Deep Root Systems, LLC
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation version 2.
11 *
12 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
13 * kind, whether express or implied; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 */
17#ifndef __DAVINCI_H
18#define __DAVINCI_H
19
20#include <linux/clk.h>
21#include <linux/videodev2.h>
22#include <linux/davinci_emac.h>
23#include <linux/platform_device.h>
24#include <linux/spi/spi.h>
25
26#include <mach/asp.h>
27#include <mach/keyscan.h>
28#include <mach/hardware.h>
29
30#include <media/davinci/vpfe_capture.h>
31#include <media/davinci/vpif_types.h>
32
33#define DAVINCI_SYSTEM_MODULE_BASE 0x01c40000
34#define SYSMOD_VIDCLKCTL 0x38
35#define SYSMOD_VDD3P3VPWDN 0x48
36#define SYSMOD_VSCLKDIS 0x6c
37#define SYSMOD_PUPDCTL1 0x7c
38
39extern void __iomem *davinci_sysmod_base;
40#define DAVINCI_SYSMOD_VIRT(x) (davinci_sysmod_base + (x))
41void davinci_map_sysmod(void);
42
43/* DM355 base addresses */
44#define DM355_ASYNC_EMIF_CONTROL_BASE 0x01e10000
45#define DM355_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
46
47#define ASP1_TX_EVT_EN 1
48#define ASP1_RX_EVT_EN 2
49
50/* DM365 base addresses */
51#define DM365_ASYNC_EMIF_CONTROL_BASE 0x01d10000
52#define DM365_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
53#define DM365_ASYNC_EMIF_DATA_CE1_BASE 0x04000000
54
55/* DM644x base addresses */
56#define DM644X_ASYNC_EMIF_CONTROL_BASE 0x01e00000
57#define DM644X_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
58#define DM644X_ASYNC_EMIF_DATA_CE1_BASE 0x04000000
59#define DM644X_ASYNC_EMIF_DATA_CE2_BASE 0x06000000
60#define DM644X_ASYNC_EMIF_DATA_CE3_BASE 0x08000000
61
62/* DM646x base addresses */
63#define DM646X_ASYNC_EMIF_CONTROL_BASE 0x20008000
64#define DM646X_ASYNC_EMIF_CS2_SPACE_BASE 0x42000000
65
66/* DM355 function declarations */
67void __init dm355_init(void);
68void dm355_init_spi0(unsigned chipselect_mask,
69 struct spi_board_info *info, unsigned len);
70void __init dm355_init_asp1(u32 evt_enable, struct snd_platform_data *pdata);
71void dm355_set_vpfe_config(struct vpfe_config *cfg);
72
73/* DM365 function declarations */
74void __init dm365_init(void);
75void __init dm365_init_asp(struct snd_platform_data *pdata);
76void __init dm365_init_vc(struct snd_platform_data *pdata);
77void __init dm365_init_ks(struct davinci_ks_platform_data *pdata);
78void __init dm365_init_rtc(void);
79void dm365_init_spi0(unsigned chipselect_mask,
80 struct spi_board_info *info, unsigned len);
81void dm365_set_vpfe_config(struct vpfe_config *cfg);
82
83/* DM644x function declarations */
84void __init dm644x_init(void);
85void __init dm644x_init_asp(struct snd_platform_data *pdata);
86int __init dm644x_init_video(struct vpfe_config *);
87
88/* DM646x function declarations */
89void __init dm646x_init(void);
90void __init dm646x_init_mcasp0(struct snd_platform_data *pdata);
91void __init dm646x_init_mcasp1(struct snd_platform_data *pdata);
92int __init dm646x_init_edma(struct edma_rsv_info *rsv);
93void dm646x_video_init(void);
94void dm646x_setup_vpif(struct vpif_display_config *,
95 struct vpif_capture_config *);
96#endif /*__DAVINCI_H */
diff --git a/arch/arm/mach-davinci/devices.c b/arch/arm/mach-davinci/devices.c
index 50c0156b426..d2f9666284a 100644
--- a/arch/arm/mach-davinci/devices.c
+++ b/arch/arm/mach-davinci/devices.c
@@ -23,6 +23,7 @@
23#include <mach/mmc.h> 23#include <mach/mmc.h>
24#include <mach/time.h> 24#include <mach/time.h>
25 25
26#include "davinci.h"
26#include "clock.h" 27#include "clock.h"
27 28
28#define DAVINCI_I2C_BASE 0x01C21000 29#define DAVINCI_I2C_BASE 0x01C21000
@@ -33,8 +34,19 @@
33#define DM365_MMCSD0_BASE 0x01D11000 34#define DM365_MMCSD0_BASE 0x01D11000
34#define DM365_MMCSD1_BASE 0x01D00000 35#define DM365_MMCSD1_BASE 0x01D00000
35 36
36/* System control register offsets */ 37void __iomem *davinci_sysmod_base;
37#define DM64XX_VDD3P3V_PWDN 0x48 38
39void davinci_map_sysmod(void)
40{
41 davinci_sysmod_base = ioremap_nocache(DAVINCI_SYSTEM_MODULE_BASE,
42 0x800);
43 /*
44 * Throw a bug since a lot of board initialization code depends
45 * on system module availability. ioremap() failing this early
46 * need careful looking into anyway.
47 */
48 BUG_ON(!davinci_sysmod_base);
49}
38 50
39static struct resource i2c_resources[] = { 51static struct resource i2c_resources[] = {
40 { 52 {
@@ -212,12 +224,12 @@ void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config)
212 davinci_cfg_reg(DM355_SD1_DATA2); 224 davinci_cfg_reg(DM355_SD1_DATA2);
213 davinci_cfg_reg(DM355_SD1_DATA3); 225 davinci_cfg_reg(DM355_SD1_DATA3);
214 } else if (cpu_is_davinci_dm365()) { 226 } else if (cpu_is_davinci_dm365()) {
215 void __iomem *pupdctl1 =
216 IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE + 0x7c);
217
218 /* Configure pull down control */ 227 /* Configure pull down control */
219 __raw_writel((__raw_readl(pupdctl1) & ~0xfc0), 228 unsigned v;
220 pupdctl1); 229
230 v = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_PUPDCTL1));
231 __raw_writel(v & ~0xfc0,
232 DAVINCI_SYSMOD_VIRT(SYSMOD_PUPDCTL1));
221 233
222 mmcsd1_resources[0].start = DM365_MMCSD1_BASE; 234 mmcsd1_resources[0].start = DM365_MMCSD1_BASE;
223 mmcsd1_resources[0].end = DM365_MMCSD1_BASE + 235 mmcsd1_resources[0].end = DM365_MMCSD1_BASE +
@@ -246,11 +258,9 @@ void __init davinci_setup_mmc(int module, struct davinci_mmc_config *config)
246 mmcsd0_resources[2].start = IRQ_DM365_SDIOINT0; 258 mmcsd0_resources[2].start = IRQ_DM365_SDIOINT0;
247 } else if (cpu_is_davinci_dm644x()) { 259 } else if (cpu_is_davinci_dm644x()) {
248 /* REVISIT: should this be in board-init code? */ 260 /* REVISIT: should this be in board-init code? */
249 void __iomem *base =
250 IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE);
251
252 /* Power-on 3.3V IO cells */ 261 /* Power-on 3.3V IO cells */
253 __raw_writel(0, base + DM64XX_VDD3P3V_PWDN); 262 __raw_writel(0,
263 DAVINCI_SYSMOD_VIRT(SYSMOD_VDD3P3VPWDN));
254 /*Set up the pull regiter for MMC */ 264 /*Set up the pull regiter for MMC */
255 davinci_cfg_reg(DM644X_MSTK); 265 davinci_cfg_reg(DM644X_MSTK);
256 } 266 }
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index 19667cfc5de..fd3d09aa6cd 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -18,7 +18,6 @@
18 18
19#include <asm/mach/map.h> 19#include <asm/mach/map.h>
20 20
21#include <mach/dm355.h>
22#include <mach/cputype.h> 21#include <mach/cputype.h>
23#include <mach/edma.h> 22#include <mach/edma.h>
24#include <mach/psc.h> 23#include <mach/psc.h>
@@ -31,6 +30,7 @@
31#include <mach/spi.h> 30#include <mach/spi.h>
32#include <mach/gpio-davinci.h> 31#include <mach/gpio-davinci.h>
33 32
33#include "davinci.h"
34#include "clock.h" 34#include "clock.h"
35#include "mux.h" 35#include "mux.h"
36 36
@@ -871,6 +871,7 @@ void __init dm355_init_asp1(u32 evt_enable, struct snd_platform_data *pdata)
871void __init dm355_init(void) 871void __init dm355_init(void)
872{ 872{
873 davinci_common_init(&davinci_soc_info_dm355); 873 davinci_common_init(&davinci_soc_info_dm355);
874 davinci_map_sysmod();
874} 875}
875 876
876static int __init dm355_init_devices(void) 877static int __init dm355_init_devices(void)
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index f15b435cc65..1a2e953082b 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -21,7 +21,6 @@
21 21
22#include <asm/mach/map.h> 22#include <asm/mach/map.h>
23 23
24#include <mach/dm365.h>
25#include <mach/cputype.h> 24#include <mach/cputype.h>
26#include <mach/edma.h> 25#include <mach/edma.h>
27#include <mach/psc.h> 26#include <mach/psc.h>
@@ -35,11 +34,28 @@
35#include <mach/spi.h> 34#include <mach/spi.h>
36#include <mach/gpio-davinci.h> 35#include <mach/gpio-davinci.h>
37 36
37#include "davinci.h"
38#include "clock.h" 38#include "clock.h"
39#include "mux.h" 39#include "mux.h"
40 40
41#define DM365_REF_FREQ 24000000 /* 24 MHz on the DM365 EVM */ 41#define DM365_REF_FREQ 24000000 /* 24 MHz on the DM365 EVM */
42 42
43/* Base of key scan register bank */
44#define DM365_KEYSCAN_BASE 0x01c69400
45
46#define DM365_RTC_BASE 0x01c69000
47
48#define DAVINCI_DM365_VC_BASE 0x01d0c000
49#define DAVINCI_DMA_VC_TX 2
50#define DAVINCI_DMA_VC_RX 3
51
52#define DM365_EMAC_BASE 0x01d07000
53#define DM365_EMAC_MDIO_BASE (DM365_EMAC_BASE + 0x4000)
54#define DM365_EMAC_CNTRL_OFFSET 0x0000
55#define DM365_EMAC_CNTRL_MOD_OFFSET 0x3000
56#define DM365_EMAC_CNTRL_RAM_OFFSET 0x1000
57#define DM365_EMAC_CNTRL_RAM_SIZE 0x2000
58
43static struct pll_data pll1_data = { 59static struct pll_data pll1_data = {
44 .num = 1, 60 .num = 1,
45 .phys_base = DAVINCI_PLL1_BASE, 61 .phys_base = DAVINCI_PLL1_BASE,
@@ -1122,6 +1138,7 @@ void __init dm365_init_rtc(void)
1122void __init dm365_init(void) 1138void __init dm365_init(void)
1123{ 1139{
1124 davinci_common_init(&davinci_soc_info_dm365); 1140 davinci_common_init(&davinci_soc_info_dm365);
1141 davinci_map_sysmod();
1125} 1142}
1126 1143
1127static struct resource dm365_vpss_resources[] = { 1144static struct resource dm365_vpss_resources[] = {
diff --git a/arch/arm/mach-davinci/dm644x.c b/arch/arm/mach-davinci/dm644x.c
index 43a48ee1917..23e81cafba8 100644
--- a/arch/arm/mach-davinci/dm644x.c
+++ b/arch/arm/mach-davinci/dm644x.c
@@ -15,7 +15,6 @@
15 15
16#include <asm/mach/map.h> 16#include <asm/mach/map.h>
17 17
18#include <mach/dm644x.h>
19#include <mach/cputype.h> 18#include <mach/cputype.h>
20#include <mach/edma.h> 19#include <mach/edma.h>
21#include <mach/irqs.h> 20#include <mach/irqs.h>
@@ -27,6 +26,7 @@
27#include <mach/asp.h> 26#include <mach/asp.h>
28#include <mach/gpio-davinci.h> 27#include <mach/gpio-davinci.h>
29 28
29#include "davinci.h"
30#include "clock.h" 30#include "clock.h"
31#include "mux.h" 31#include "mux.h"
32 32
@@ -35,6 +35,13 @@
35 */ 35 */
36#define DM644X_REF_FREQ 27000000 36#define DM644X_REF_FREQ 27000000
37 37
38#define DM644X_EMAC_BASE 0x01c80000
39#define DM644X_EMAC_MDIO_BASE (DM644X_EMAC_BASE + 0x4000)
40#define DM644X_EMAC_CNTRL_OFFSET 0x0000
41#define DM644X_EMAC_CNTRL_MOD_OFFSET 0x1000
42#define DM644X_EMAC_CNTRL_RAM_OFFSET 0x2000
43#define DM644X_EMAC_CNTRL_RAM_SIZE 0x2000
44
38static struct pll_data pll1_data = { 45static struct pll_data pll1_data = {
39 .num = 1, 46 .num = 1,
40 .phys_base = DAVINCI_PLL1_BASE, 47 .phys_base = DAVINCI_PLL1_BASE,
@@ -587,13 +594,15 @@ static struct platform_device dm644x_asp_device = {
587 .resource = dm644x_asp_resources, 594 .resource = dm644x_asp_resources,
588}; 595};
589 596
597#define DM644X_VPSS_BASE 0x01c73400
598
590static struct resource dm644x_vpss_resources[] = { 599static struct resource dm644x_vpss_resources[] = {
591 { 600 {
592 /* VPSS Base address */ 601 /* VPSS Base address */
593 .name = "vpss", 602 .name = "vpss",
594 .start = 0x01c73400, 603 .start = DM644X_VPSS_BASE,
595 .end = 0x01c73400 + 0xff, 604 .end = DM644X_VPSS_BASE + 0xff,
596 .flags = IORESOURCE_MEM, 605 .flags = IORESOURCE_MEM,
597 }, 606 },
598}; 607};
599 608
@@ -605,7 +614,7 @@ static struct platform_device dm644x_vpss_device = {
605 .resource = dm644x_vpss_resources, 614 .resource = dm644x_vpss_resources,
606}; 615};
607 616
608static struct resource vpfe_resources[] = { 617static struct resource dm644x_vpfe_resources[] = {
609 { 618 {
610 .start = IRQ_VDINT0, 619 .start = IRQ_VDINT0,
611 .end = IRQ_VDINT0, 620 .end = IRQ_VDINT0,
@@ -639,22 +648,17 @@ static struct platform_device dm644x_ccdc_dev = {
639 }, 648 },
640}; 649};
641 650
642static struct platform_device vpfe_capture_dev = { 651static struct platform_device dm644x_vpfe_dev = {
643 .name = CAPTURE_DRV_NAME, 652 .name = CAPTURE_DRV_NAME,
644 .id = -1, 653 .id = -1,
645 .num_resources = ARRAY_SIZE(vpfe_resources), 654 .num_resources = ARRAY_SIZE(dm644x_vpfe_resources),
646 .resource = vpfe_resources, 655 .resource = dm644x_vpfe_resources,
647 .dev = { 656 .dev = {
648 .dma_mask = &vpfe_capture_dma_mask, 657 .dma_mask = &vpfe_capture_dma_mask,
649 .coherent_dma_mask = DMA_BIT_MASK(32), 658 .coherent_dma_mask = DMA_BIT_MASK(32),
650 }, 659 },
651}; 660};
652 661
653void dm644x_set_vpfe_config(struct vpfe_config *cfg)
654{
655 vpfe_capture_dev.dev.platform_data = cfg;
656}
657
658/*----------------------------------------------------------------------*/ 662/*----------------------------------------------------------------------*/
659 663
660static struct map_desc dm644x_io_desc[] = { 664static struct map_desc dm644x_io_desc[] = {
@@ -779,16 +783,29 @@ void __init dm644x_init_asp(struct snd_platform_data *pdata)
779void __init dm644x_init(void) 783void __init dm644x_init(void)
780{ 784{
781 davinci_common_init(&davinci_soc_info_dm644x); 785 davinci_common_init(&davinci_soc_info_dm644x);
786 davinci_map_sysmod();
782} 787}
783 788
784static int __init dm644x_init_devices(void) 789int __init dm644x_init_video(struct vpfe_config *vpfe_cfg)
785{ 790{
786 if (!cpu_is_davinci_dm644x()) 791 dm644x_vpfe_dev.dev.platform_data = vpfe_cfg;
787 return 0;
788 792
789 /* Add ccdc clock aliases */ 793 /* Add ccdc clock aliases */
790 clk_add_alias("master", dm644x_ccdc_dev.name, "vpss_master", NULL); 794 clk_add_alias("master", dm644x_ccdc_dev.name, "vpss_master", NULL);
791 clk_add_alias("slave", dm644x_ccdc_dev.name, "vpss_slave", NULL); 795 clk_add_alias("slave", dm644x_ccdc_dev.name, "vpss_slave", NULL);
796
797 platform_device_register(&dm644x_vpss_device);
798 platform_device_register(&dm644x_ccdc_dev);
799 platform_device_register(&dm644x_vpfe_dev);
800
801 return 0;
802}
803
804static int __init dm644x_init_devices(void)
805{
806 if (!cpu_is_davinci_dm644x())
807 return 0;
808
792 platform_device_register(&dm644x_edma_device); 809 platform_device_register(&dm644x_edma_device);
793 810
794 platform_device_register(&dm644x_mdio_device); 811 platform_device_register(&dm644x_mdio_device);
@@ -796,10 +813,6 @@ static int __init dm644x_init_devices(void)
796 clk_add_alias(NULL, dev_name(&dm644x_mdio_device.dev), 813 clk_add_alias(NULL, dev_name(&dm644x_mdio_device.dev),
797 NULL, &dm644x_emac_device.dev); 814 NULL, &dm644x_emac_device.dev);
798 815
799 platform_device_register(&dm644x_vpss_device);
800 platform_device_register(&dm644x_ccdc_dev);
801 platform_device_register(&vpfe_capture_dev);
802
803 return 0; 816 return 0;
804} 817}
805postcore_initcall(dm644x_init_devices); 818postcore_initcall(dm644x_init_devices);
diff --git a/arch/arm/mach-davinci/dm646x.c b/arch/arm/mach-davinci/dm646x.c
index 00f774394b1..9eb87c1d1ed 100644
--- a/arch/arm/mach-davinci/dm646x.c
+++ b/arch/arm/mach-davinci/dm646x.c
@@ -16,7 +16,6 @@
16 16
17#include <asm/mach/map.h> 17#include <asm/mach/map.h>
18 18
19#include <mach/dm646x.h>
20#include <mach/cputype.h> 19#include <mach/cputype.h>
21#include <mach/edma.h> 20#include <mach/edma.h>
22#include <mach/irqs.h> 21#include <mach/irqs.h>
@@ -28,12 +27,11 @@
28#include <mach/asp.h> 27#include <mach/asp.h>
29#include <mach/gpio-davinci.h> 28#include <mach/gpio-davinci.h>
30 29
30#include "davinci.h"
31#include "clock.h" 31#include "clock.h"
32#include "mux.h" 32#include "mux.h"
33 33
34#define DAVINCI_VPIF_BASE (0x01C12000) 34#define DAVINCI_VPIF_BASE (0x01C12000)
35#define VDD3P3V_PWDN_OFFSET (0x48)
36#define VSCLKDIS_OFFSET (0x6C)
37 35
38#define VDD3P3V_VID_MASK (BIT_MASK(3) | BIT_MASK(2) | BIT_MASK(1) |\ 36#define VDD3P3V_VID_MASK (BIT_MASK(3) | BIT_MASK(2) | BIT_MASK(1) |\
39 BIT_MASK(0)) 37 BIT_MASK(0))
@@ -46,6 +44,13 @@
46#define DM646X_REF_FREQ 27000000 44#define DM646X_REF_FREQ 27000000
47#define DM646X_AUX_FREQ 24000000 45#define DM646X_AUX_FREQ 24000000
48 46
47#define DM646X_EMAC_BASE 0x01c80000
48#define DM646X_EMAC_MDIO_BASE (DM646X_EMAC_BASE + 0x4000)
49#define DM646X_EMAC_CNTRL_OFFSET 0x0000
50#define DM646X_EMAC_CNTRL_MOD_OFFSET 0x1000
51#define DM646X_EMAC_CNTRL_RAM_OFFSET 0x2000
52#define DM646X_EMAC_CNTRL_RAM_SIZE 0x2000
53
49static struct pll_data pll1_data = { 54static struct pll_data pll1_data = {
50 .num = 1, 55 .num = 1,
51 .phys_base = DAVINCI_PLL1_BASE, 56 .phys_base = DAVINCI_PLL1_BASE,
@@ -873,15 +878,14 @@ void dm646x_setup_vpif(struct vpif_display_config *display_config,
873 struct vpif_capture_config *capture_config) 878 struct vpif_capture_config *capture_config)
874{ 879{
875 unsigned int value; 880 unsigned int value;
876 void __iomem *base = IO_ADDRESS(DAVINCI_SYSTEM_MODULE_BASE);
877 881
878 value = __raw_readl(base + VSCLKDIS_OFFSET); 882 value = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_VSCLKDIS));
879 value &= ~VSCLKDIS_MASK; 883 value &= ~VSCLKDIS_MASK;
880 __raw_writel(value, base + VSCLKDIS_OFFSET); 884 __raw_writel(value, DAVINCI_SYSMOD_VIRT(SYSMOD_VSCLKDIS));
881 885
882 value = __raw_readl(base + VDD3P3V_PWDN_OFFSET); 886 value = __raw_readl(DAVINCI_SYSMOD_VIRT(SYSMOD_VDD3P3VPWDN));
883 value &= ~VDD3P3V_VID_MASK; 887 value &= ~VDD3P3V_VID_MASK;
884 __raw_writel(value, base + VDD3P3V_PWDN_OFFSET); 888 __raw_writel(value, DAVINCI_SYSMOD_VIRT(SYSMOD_VDD3P3VPWDN));
885 889
886 davinci_cfg_reg(DM646X_STSOMUX_DISABLE); 890 davinci_cfg_reg(DM646X_STSOMUX_DISABLE);
887 davinci_cfg_reg(DM646X_STSIMUX_DISABLE); 891 davinci_cfg_reg(DM646X_STSIMUX_DISABLE);
@@ -905,6 +909,7 @@ int __init dm646x_init_edma(struct edma_rsv_info *rsv)
905void __init dm646x_init(void) 909void __init dm646x_init(void)
906{ 910{
907 davinci_common_init(&davinci_soc_info_dm646x); 911 davinci_common_init(&davinci_soc_info_dm646x);
912 davinci_map_sysmod();
908} 913}
909 914
910static int __init dm646x_init_devices(void) 915static int __init dm646x_init_devices(void)
diff --git a/arch/arm/mach-davinci/include/mach/dm355.h b/arch/arm/mach-davinci/include/mach/dm355.h
deleted file mode 100644
index 36dff4a0ce3..00000000000
--- a/arch/arm/mach-davinci/include/mach/dm355.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * Chip specific defines for DM355 SoC
3 *
4 * Author: Kevin Hilman, Deep Root Systems, LLC
5 *
6 * 2007 (c) Deep Root Systems, LLC. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11#ifndef __ASM_ARCH_DM355_H
12#define __ASM_ARCH_DM355_H
13
14#include <mach/hardware.h>
15#include <mach/asp.h>
16#include <media/davinci/vpfe_capture.h>
17
18#define DM355_ASYNC_EMIF_CONTROL_BASE 0x01E10000
19#define DM355_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
20
21#define ASP1_TX_EVT_EN 1
22#define ASP1_RX_EVT_EN 2
23
24struct spi_board_info;
25
26void __init dm355_init(void);
27void dm355_init_spi0(unsigned chipselect_mask,
28 struct spi_board_info *info, unsigned len);
29void __init dm355_init_asp1(u32 evt_enable, struct snd_platform_data *pdata);
30void dm355_set_vpfe_config(struct vpfe_config *cfg);
31
32#endif /* __ASM_ARCH_DM355_H */
diff --git a/arch/arm/mach-davinci/include/mach/dm365.h b/arch/arm/mach-davinci/include/mach/dm365.h
index 2563bf4e93a..b9bf3d6a442 100644
--- a/arch/arm/mach-davinci/include/mach/dm365.h
+++ b/arch/arm/mach-davinci/include/mach/dm365.h
@@ -1,52 +1 @@
1/* /* empty, remove once unused */
2 * Copyright (C) 2009 Texas Instruments Incorporated
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation version 2.
7 *
8 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
9 * kind, whether express or implied; without even the implied warranty
10 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13#ifndef __ASM_ARCH_DM365_H
14#define __ASM_ARCH_DM665_H
15
16#include <linux/platform_device.h>
17#include <linux/davinci_emac.h>
18#include <mach/hardware.h>
19#include <mach/asp.h>
20#include <mach/keyscan.h>
21#include <media/davinci/vpfe_capture.h>
22
23#define DM365_EMAC_BASE (0x01D07000)
24#define DM365_EMAC_MDIO_BASE (DM365_EMAC_BASE + 0x4000)
25#define DM365_EMAC_CNTRL_OFFSET (0x0000)
26#define DM365_EMAC_CNTRL_MOD_OFFSET (0x3000)
27#define DM365_EMAC_CNTRL_RAM_OFFSET (0x1000)
28#define DM365_EMAC_CNTRL_RAM_SIZE (0x2000)
29
30/* Base of key scan register bank */
31#define DM365_KEYSCAN_BASE (0x01C69400)
32
33#define DM365_RTC_BASE (0x01C69000)
34
35#define DAVINCI_DM365_VC_BASE (0x01D0C000)
36#define DAVINCI_DMA_VC_TX 2
37#define DAVINCI_DMA_VC_RX 3
38
39#define DM365_ASYNC_EMIF_CONTROL_BASE 0x01D10000
40#define DM365_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
41#define DM365_ASYNC_EMIF_DATA_CE1_BASE 0x04000000
42
43void __init dm365_init(void);
44void __init dm365_init_asp(struct snd_platform_data *pdata);
45void __init dm365_init_vc(struct snd_platform_data *pdata);
46void __init dm365_init_ks(struct davinci_ks_platform_data *pdata);
47void __init dm365_init_rtc(void);
48void dm365_init_spi0(unsigned chipselect_mask,
49 struct spi_board_info *info, unsigned len);
50
51void dm365_set_vpfe_config(struct vpfe_config *cfg);
52#endif /* __ASM_ARCH_DM365_H */
diff --git a/arch/arm/mach-davinci/include/mach/dm644x.h b/arch/arm/mach-davinci/include/mach/dm644x.h
deleted file mode 100644
index 5a1b26d4e68..00000000000
--- a/arch/arm/mach-davinci/include/mach/dm644x.h
+++ /dev/null
@@ -1,47 +0,0 @@
1/*
2 * This file contains the processor specific definitions
3 * of the TI DM644x.
4 *
5 * Copyright (C) 2008 Texas Instruments.
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */
22#ifndef __ASM_ARCH_DM644X_H
23#define __ASM_ARCH_DM644X_H
24
25#include <linux/davinci_emac.h>
26#include <mach/hardware.h>
27#include <mach/asp.h>
28#include <media/davinci/vpfe_capture.h>
29
30#define DM644X_EMAC_BASE (0x01C80000)
31#define DM644X_EMAC_MDIO_BASE (DM644X_EMAC_BASE + 0x4000)
32#define DM644X_EMAC_CNTRL_OFFSET (0x0000)
33#define DM644X_EMAC_CNTRL_MOD_OFFSET (0x1000)
34#define DM644X_EMAC_CNTRL_RAM_OFFSET (0x2000)
35#define DM644X_EMAC_CNTRL_RAM_SIZE (0x2000)
36
37#define DM644X_ASYNC_EMIF_CONTROL_BASE 0x01E00000
38#define DM644X_ASYNC_EMIF_DATA_CE0_BASE 0x02000000
39#define DM644X_ASYNC_EMIF_DATA_CE1_BASE 0x04000000
40#define DM644X_ASYNC_EMIF_DATA_CE2_BASE 0x06000000
41#define DM644X_ASYNC_EMIF_DATA_CE3_BASE 0x08000000
42
43void __init dm644x_init(void);
44void __init dm644x_init_asp(struct snd_platform_data *pdata);
45void dm644x_set_vpfe_config(struct vpfe_config *cfg);
46
47#endif /* __ASM_ARCH_DM644X_H */
diff --git a/arch/arm/mach-davinci/include/mach/dm646x.h b/arch/arm/mach-davinci/include/mach/dm646x.h
index a8ee6c9f0bb..b9bf3d6a442 100644
--- a/arch/arm/mach-davinci/include/mach/dm646x.h
+++ b/arch/arm/mach-davinci/include/mach/dm646x.h
@@ -1,41 +1 @@
1/* /* empty, remove once unused */
2 * Chip specific defines for DM646x SoC
3 *
4 * Author: Kevin Hilman, Deep Root Systems, LLC
5 *
6 * 2007 (c) Deep Root Systems, LLC. This file is licensed under
7 * the terms of the GNU General Public License version 2. This program
8 * is licensed "as is" without any warranty of any kind, whether express
9 * or implied.
10 */
11#ifndef __ASM_ARCH_DM646X_H
12#define __ASM_ARCH_DM646X_H
13
14#include <mach/hardware.h>
15#include <mach/asp.h>
16#include <linux/i2c.h>
17#include <linux/videodev2.h>
18#include <linux/davinci_emac.h>
19#include <media/davinci/vpif_types.h>
20
21#define DM646X_EMAC_BASE (0x01C80000)
22#define DM646X_EMAC_MDIO_BASE (DM646X_EMAC_BASE + 0x4000)
23#define DM646X_EMAC_CNTRL_OFFSET (0x0000)
24#define DM646X_EMAC_CNTRL_MOD_OFFSET (0x1000)
25#define DM646X_EMAC_CNTRL_RAM_OFFSET (0x2000)
26#define DM646X_EMAC_CNTRL_RAM_SIZE (0x2000)
27
28#define DM646X_ASYNC_EMIF_CONTROL_BASE 0x20008000
29#define DM646X_ASYNC_EMIF_CS2_SPACE_BASE 0x42000000
30
31void __init dm646x_init(void);
32void __init dm646x_init_mcasp0(struct snd_platform_data *pdata);
33void __init dm646x_init_mcasp1(struct snd_platform_data *pdata);
34int __init dm646x_init_edma(struct edma_rsv_info *rsv);
35
36void dm646x_video_init(void);
37
38void dm646x_setup_vpif(struct vpif_display_config *,
39 struct vpif_capture_config *);
40
41#endif /* __ASM_ARCH_DM646X_H */
diff --git a/arch/arm/mach-davinci/include/mach/hardware.h b/arch/arm/mach-davinci/include/mach/hardware.h
index 414e0b93e74..0209b1fc22a 100644
--- a/arch/arm/mach-davinci/include/mach/hardware.h
+++ b/arch/arm/mach-davinci/include/mach/hardware.h
@@ -19,8 +19,6 @@
19 * and the chip/board init code should then explicitly include 19 * and the chip/board init code should then explicitly include
20 * <chipname>.h 20 * <chipname>.h
21 */ 21 */
22#define DAVINCI_SYSTEM_MODULE_BASE 0x01C40000
23
24/* 22/*
25 * I/O mapping 23 * I/O mapping
26 */ 24 */
diff --git a/arch/arm/mach-exynos/clock-exynos4210.c b/arch/arm/mach-exynos/clock-exynos4210.c
index 13312ccb2d9..54a92efcf5b 100644
--- a/arch/arm/mach-exynos/clock-exynos4210.c
+++ b/arch/arm/mach-exynos/clock-exynos4210.c
@@ -117,7 +117,7 @@ static void exynos4210_clock_resume(void)
117#define exynos4210_clock_resume NULL 117#define exynos4210_clock_resume NULL
118#endif 118#endif
119 119
120struct syscore_ops exynos4210_clock_syscore_ops = { 120static struct syscore_ops exynos4210_clock_syscore_ops = {
121 .suspend = exynos4210_clock_suspend, 121 .suspend = exynos4210_clock_suspend,
122 .resume = exynos4210_clock_resume, 122 .resume = exynos4210_clock_resume,
123}; 123};
diff --git a/arch/arm/mach-exynos/clock-exynos4212.c b/arch/arm/mach-exynos/clock-exynos4212.c
index 48af28566fa..8e07ab13ff1 100644
--- a/arch/arm/mach-exynos/clock-exynos4212.c
+++ b/arch/arm/mach-exynos/clock-exynos4212.c
@@ -89,7 +89,7 @@ static void exynos4212_clock_resume(void)
89#define exynos4212_clock_resume NULL 89#define exynos4212_clock_resume NULL
90#endif 90#endif
91 91
92struct syscore_ops exynos4212_clock_syscore_ops = { 92static struct syscore_ops exynos4212_clock_syscore_ops = {
93 .suspend = exynos4212_clock_suspend, 93 .suspend = exynos4212_clock_suspend,
94 .resume = exynos4212_clock_resume, 94 .resume = exynos4212_clock_resume,
95}; 95};
diff --git a/arch/arm/mach-exynos/clock.c b/arch/arm/mach-exynos/clock.c
index 187287aa57a..200874e82dc 100644
--- a/arch/arm/mach-exynos/clock.c
+++ b/arch/arm/mach-exynos/clock.c
@@ -1526,7 +1526,7 @@ static void exynos4_clock_resume(void)
1526#define exynos4_clock_resume NULL 1526#define exynos4_clock_resume NULL
1527#endif 1527#endif
1528 1528
1529struct syscore_ops exynos4_clock_syscore_ops = { 1529static struct syscore_ops exynos4_clock_syscore_ops = {
1530 .suspend = exynos4_clock_suspend, 1530 .suspend = exynos4_clock_suspend,
1531 .resume = exynos4_clock_resume, 1531 .resume = exynos4_clock_resume,
1532}; 1532};
diff --git a/arch/arm/mach-exynos/common.c b/arch/arm/mach-exynos/common.c
index 031c1e5b3df..34e819068fa 100644
--- a/arch/arm/mach-exynos/common.c
+++ b/arch/arm/mach-exynos/common.c
@@ -661,7 +661,7 @@ static void exynos4_irq_eint0_15(unsigned int irq, struct irq_desc *desc)
661 chained_irq_exit(chip, desc); 661 chained_irq_exit(chip, desc);
662} 662}
663 663
664int __init exynos4_init_irq_eint(void) 664static int __init exynos4_init_irq_eint(void)
665{ 665{
666 int irq; 666 int irq;
667 667
diff --git a/arch/arm/mach-exynos/dma.c b/arch/arm/mach-exynos/dma.c
index 91370def4a7..25f3ef2c36e 100644
--- a/arch/arm/mach-exynos/dma.c
+++ b/arch/arm/mach-exynos/dma.c
@@ -36,7 +36,7 @@
36 36
37static u64 dma_dmamask = DMA_BIT_MASK(32); 37static u64 dma_dmamask = DMA_BIT_MASK(32);
38 38
39u8 pdma0_peri[] = { 39static u8 pdma0_peri[] = {
40 DMACH_PCM0_RX, 40 DMACH_PCM0_RX,
41 DMACH_PCM0_TX, 41 DMACH_PCM0_TX,
42 DMACH_PCM2_RX, 42 DMACH_PCM2_RX,
@@ -69,15 +69,15 @@ u8 pdma0_peri[] = {
69 DMACH_AC97_PCMOUT, 69 DMACH_AC97_PCMOUT,
70}; 70};
71 71
72struct dma_pl330_platdata exynos4_pdma0_pdata = { 72static struct dma_pl330_platdata exynos4_pdma0_pdata = {
73 .nr_valid_peri = ARRAY_SIZE(pdma0_peri), 73 .nr_valid_peri = ARRAY_SIZE(pdma0_peri),
74 .peri_id = pdma0_peri, 74 .peri_id = pdma0_peri,
75}; 75};
76 76
77AMBA_AHB_DEVICE(exynos4_pdma0, "dma-pl330.0", 0x00041330, EXYNOS4_PA_PDMA0, 77static AMBA_AHB_DEVICE(exynos4_pdma0, "dma-pl330.0", 0x00041330,
78 {IRQ_PDMA0}, &exynos4_pdma0_pdata); 78 EXYNOS4_PA_PDMA0, {IRQ_PDMA0}, &exynos4_pdma0_pdata);
79 79
80u8 pdma1_peri[] = { 80static u8 pdma1_peri[] = {
81 DMACH_PCM0_RX, 81 DMACH_PCM0_RX,
82 DMACH_PCM0_TX, 82 DMACH_PCM0_TX,
83 DMACH_PCM1_RX, 83 DMACH_PCM1_RX,
@@ -105,13 +105,13 @@ u8 pdma1_peri[] = {
105 DMACH_SLIMBUS5_TX, 105 DMACH_SLIMBUS5_TX,
106}; 106};
107 107
108struct dma_pl330_platdata exynos4_pdma1_pdata = { 108static struct dma_pl330_platdata exynos4_pdma1_pdata = {
109 .nr_valid_peri = ARRAY_SIZE(pdma1_peri), 109 .nr_valid_peri = ARRAY_SIZE(pdma1_peri),
110 .peri_id = pdma1_peri, 110 .peri_id = pdma1_peri,
111}; 111};
112 112
113AMBA_AHB_DEVICE(exynos4_pdma1, "dma-pl330.1", 0x00041330, EXYNOS4_PA_PDMA1, 113static AMBA_AHB_DEVICE(exynos4_pdma1, "dma-pl330.1", 0x00041330,
114 {IRQ_PDMA1}, &exynos4_pdma1_pdata); 114 EXYNOS4_PA_PDMA1, {IRQ_PDMA1}, &exynos4_pdma1_pdata);
115 115
116static int __init exynos4_dma_init(void) 116static int __init exynos4_dma_init(void)
117{ 117{
diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c
index 0679b8ad2d1..3ec3ccf9f35 100644
--- a/arch/arm/mach-exynos/mach-origen.c
+++ b/arch/arm/mach-exynos/mach-origen.c
@@ -412,7 +412,7 @@ static struct max8997_regulator_data __initdata origen_max8997_regulators[] = {
412 { MAX8997_BUCK7, &max8997_buck7_data }, 412 { MAX8997_BUCK7, &max8997_buck7_data },
413}; 413};
414 414
415struct max8997_platform_data __initdata origen_max8997_pdata = { 415static struct max8997_platform_data __initdata origen_max8997_pdata = {
416 .num_regulators = ARRAY_SIZE(origen_max8997_regulators), 416 .num_regulators = ARRAY_SIZE(origen_max8997_regulators),
417 .regulators = origen_max8997_regulators, 417 .regulators = origen_max8997_regulators,
418 418
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c
index 0fc65ffde8f..e00d8e26d52 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -997,7 +997,7 @@ static void __init universal_map_io(void)
997 s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs)); 997 s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs));
998} 998}
999 999
1000void s5p_tv_setup(void) 1000static void s5p_tv_setup(void)
1001{ 1001{
1002 /* direct HPD to HDMI chip */ 1002 /* direct HPD to HDMI chip */
1003 gpio_request_one(EXYNOS4_GPX3(7), GPIOF_IN, "hpd-plug"); 1003 gpio_request_one(EXYNOS4_GPX3(7), GPIOF_IN, "hpd-plug");
diff --git a/arch/arm/mach-imx/clock-imx31.c b/arch/arm/mach-imx/clock-imx31.c
index 988a28178d4..3a943cd4159 100644
--- a/arch/arm/mach-imx/clock-imx31.c
+++ b/arch/arm/mach-imx/clock-imx31.c
@@ -32,7 +32,7 @@
32#include <mach/mx31.h> 32#include <mach/mx31.h>
33#include <mach/common.h> 33#include <mach/common.h>
34 34
35#include "crmregs-imx31.h" 35#include "crmregs-imx3.h"
36 36
37#define PRE_DIV_MIN_FREQ 10000000 /* Minimum Frequency after Predivider */ 37#define PRE_DIV_MIN_FREQ 10000000 /* Minimum Frequency after Predivider */
38 38
diff --git a/arch/arm/mach-imx/clock-imx35.c b/arch/arm/mach-imx/clock-imx35.c
index ac8238caecb..1e279af656a 100644
--- a/arch/arm/mach-imx/clock-imx35.c
+++ b/arch/arm/mach-imx/clock-imx35.c
@@ -27,23 +27,7 @@
27#include <mach/hardware.h> 27#include <mach/hardware.h>
28#include <mach/common.h> 28#include <mach/common.h>
29 29
30#define CCM_BASE MX35_IO_ADDRESS(MX35_CCM_BASE_ADDR) 30#include "crmregs-imx3.h"
31
32#define CCM_CCMR 0x00
33#define CCM_PDR0 0x04
34#define CCM_PDR1 0x08
35#define CCM_PDR2 0x0C
36#define CCM_PDR3 0x10
37#define CCM_PDR4 0x14
38#define CCM_RCSR 0x18
39#define CCM_MPCTL 0x1C
40#define CCM_PPCTL 0x20
41#define CCM_ACMR 0x24
42#define CCM_COSR 0x28
43#define CCM_CGR0 0x2C
44#define CCM_CGR1 0x30
45#define CCM_CGR2 0x34
46#define CCM_CGR3 0x38
47 31
48#ifdef HAVE_SET_RATE_SUPPORT 32#ifdef HAVE_SET_RATE_SUPPORT
49static void calc_dividers(u32 div, u32 *pre, u32 *post, u32 maxpost) 33static void calc_dividers(u32 div, u32 *pre, u32 *post, u32 maxpost)
@@ -111,14 +95,14 @@ static void calc_dividers_3_3(u32 div, u32 *pre, u32 *post)
111 95
112static unsigned long get_rate_mpll(void) 96static unsigned long get_rate_mpll(void)
113{ 97{
114 ulong mpctl = __raw_readl(CCM_BASE + CCM_MPCTL); 98 ulong mpctl = __raw_readl(MX35_CCM_MPCTL);
115 99
116 return mxc_decode_pll(mpctl, 24000000); 100 return mxc_decode_pll(mpctl, 24000000);
117} 101}
118 102
119static unsigned long get_rate_ppll(void) 103static unsigned long get_rate_ppll(void)
120{ 104{
121 ulong ppctl = __raw_readl(CCM_BASE + CCM_PPCTL); 105 ulong ppctl = __raw_readl(MX35_CCM_PPCTL);
122 106
123 return mxc_decode_pll(ppctl, 24000000); 107 return mxc_decode_pll(ppctl, 24000000);
124} 108}
@@ -148,7 +132,7 @@ static struct arm_ahb_div clk_consumer[] = {
148 132
149static unsigned long get_rate_arm(void) 133static unsigned long get_rate_arm(void)
150{ 134{
151 unsigned long pdr0 = __raw_readl(CCM_BASE + CCM_PDR0); 135 unsigned long pdr0 = __raw_readl(MXC_CCM_PDR0);
152 struct arm_ahb_div *aad; 136 struct arm_ahb_div *aad;
153 unsigned long fref = get_rate_mpll(); 137 unsigned long fref = get_rate_mpll();
154 138
@@ -161,7 +145,7 @@ static unsigned long get_rate_arm(void)
161 145
162static unsigned long get_rate_ahb(struct clk *clk) 146static unsigned long get_rate_ahb(struct clk *clk)
163{ 147{
164 unsigned long pdr0 = __raw_readl(CCM_BASE + CCM_PDR0); 148 unsigned long pdr0 = __raw_readl(MXC_CCM_PDR0);
165 struct arm_ahb_div *aad; 149 struct arm_ahb_div *aad;
166 unsigned long fref = get_rate_arm(); 150 unsigned long fref = get_rate_arm();
167 151
@@ -177,8 +161,8 @@ static unsigned long get_rate_ipg(struct clk *clk)
177 161
178static unsigned long get_rate_uart(struct clk *clk) 162static unsigned long get_rate_uart(struct clk *clk)
179{ 163{
180 unsigned long pdr3 = __raw_readl(CCM_BASE + CCM_PDR3); 164 unsigned long pdr3 = __raw_readl(MX35_CCM_PDR3);
181 unsigned long pdr4 = __raw_readl(CCM_BASE + CCM_PDR4); 165 unsigned long pdr4 = __raw_readl(MX35_CCM_PDR4);
182 unsigned long div = ((pdr4 >> 10) & 0x3f) + 1; 166 unsigned long div = ((pdr4 >> 10) & 0x3f) + 1;
183 167
184 if (pdr3 & (1 << 14)) 168 if (pdr3 & (1 << 14))
@@ -189,7 +173,7 @@ static unsigned long get_rate_uart(struct clk *clk)
189 173
190static unsigned long get_rate_sdhc(struct clk *clk) 174static unsigned long get_rate_sdhc(struct clk *clk)
191{ 175{
192 unsigned long pdr3 = __raw_readl(CCM_BASE + CCM_PDR3); 176 unsigned long pdr3 = __raw_readl(MX35_CCM_PDR3);
193 unsigned long div, rate; 177 unsigned long div, rate;
194 178
195 if (pdr3 & (1 << 6)) 179 if (pdr3 & (1 << 6))
@@ -215,7 +199,7 @@ static unsigned long get_rate_sdhc(struct clk *clk)
215 199
216static unsigned long get_rate_mshc(struct clk *clk) 200static unsigned long get_rate_mshc(struct clk *clk)
217{ 201{
218 unsigned long pdr1 = __raw_readl(CCM_BASE + CCM_PDR1); 202 unsigned long pdr1 = __raw_readl(MXC_CCM_PDR1);
219 unsigned long div1, div2, rate; 203 unsigned long div1, div2, rate;
220 204
221 if (pdr1 & (1 << 7)) 205 if (pdr1 & (1 << 7))
@@ -231,7 +215,7 @@ static unsigned long get_rate_mshc(struct clk *clk)
231 215
232static unsigned long get_rate_ssi(struct clk *clk) 216static unsigned long get_rate_ssi(struct clk *clk)
233{ 217{
234 unsigned long pdr2 = __raw_readl(CCM_BASE + CCM_PDR2); 218 unsigned long pdr2 = __raw_readl(MX35_CCM_PDR2);
235 unsigned long div1, div2, rate; 219 unsigned long div1, div2, rate;
236 220
237 if (pdr2 & (1 << 6)) 221 if (pdr2 & (1 << 6))
@@ -256,7 +240,7 @@ static unsigned long get_rate_ssi(struct clk *clk)
256 240
257static unsigned long get_rate_csi(struct clk *clk) 241static unsigned long get_rate_csi(struct clk *clk)
258{ 242{
259 unsigned long pdr2 = __raw_readl(CCM_BASE + CCM_PDR2); 243 unsigned long pdr2 = __raw_readl(MX35_CCM_PDR2);
260 unsigned long rate; 244 unsigned long rate;
261 245
262 if (pdr2 & (1 << 7)) 246 if (pdr2 & (1 << 7))
@@ -269,7 +253,7 @@ static unsigned long get_rate_csi(struct clk *clk)
269 253
270static unsigned long get_rate_otg(struct clk *clk) 254static unsigned long get_rate_otg(struct clk *clk)
271{ 255{
272 unsigned long pdr4 = __raw_readl(CCM_BASE + CCM_PDR4); 256 unsigned long pdr4 = __raw_readl(MX35_CCM_PDR4);
273 unsigned long rate; 257 unsigned long rate;
274 258
275 if (pdr4 & (1 << 9)) 259 if (pdr4 & (1 << 9))
@@ -282,8 +266,8 @@ static unsigned long get_rate_otg(struct clk *clk)
282 266
283static unsigned long get_rate_ipg_per(struct clk *clk) 267static unsigned long get_rate_ipg_per(struct clk *clk)
284{ 268{
285 unsigned long pdr0 = __raw_readl(CCM_BASE + CCM_PDR0); 269 unsigned long pdr0 = __raw_readl(MXC_CCM_PDR0);
286 unsigned long pdr4 = __raw_readl(CCM_BASE + CCM_PDR4); 270 unsigned long pdr4 = __raw_readl(MX35_CCM_PDR4);
287 unsigned long div; 271 unsigned long div;
288 272
289 if (pdr0 & (1 << 26)) { 273 if (pdr0 & (1 << 26)) {
@@ -297,7 +281,7 @@ static unsigned long get_rate_ipg_per(struct clk *clk)
297 281
298static unsigned long get_rate_hsp(struct clk *clk) 282static unsigned long get_rate_hsp(struct clk *clk)
299{ 283{
300 unsigned long hsp_podf = (__raw_readl(CCM_BASE + CCM_PDR0) >> 20) & 0x03; 284 unsigned long hsp_podf = (__raw_readl(MXC_CCM_PDR0) >> 20) & 0x03;
301 unsigned long fref = get_rate_mpll(); 285 unsigned long fref = get_rate_mpll();
302 286
303 if (fref > 400 * 1000 * 1000) { 287 if (fref > 400 * 1000 * 1000) {
@@ -345,7 +329,7 @@ static void clk_cgr_disable(struct clk *clk)
345#define DEFINE_CLOCK(name, i, er, es, gr, sr) \ 329#define DEFINE_CLOCK(name, i, er, es, gr, sr) \
346 static struct clk name = { \ 330 static struct clk name = { \
347 .id = i, \ 331 .id = i, \
348 .enable_reg = CCM_BASE + er, \ 332 .enable_reg = er, \
349 .enable_shift = es, \ 333 .enable_shift = es, \
350 .get_rate = gr, \ 334 .get_rate = gr, \
351 .set_rate = sr, \ 335 .set_rate = sr, \
@@ -353,59 +337,59 @@ static void clk_cgr_disable(struct clk *clk)
353 .disable = clk_cgr_disable, \ 337 .disable = clk_cgr_disable, \
354 } 338 }
355 339
356DEFINE_CLOCK(asrc_clk, 0, CCM_CGR0, 0, NULL, NULL); 340DEFINE_CLOCK(asrc_clk, 0, MX35_CCM_CGR0, 0, NULL, NULL);
357DEFINE_CLOCK(pata_clk, 0, CCM_CGR0, 2, get_rate_ipg, NULL); 341DEFINE_CLOCK(pata_clk, 0, MX35_CCM_CGR0, 2, get_rate_ipg, NULL);
358/* DEFINE_CLOCK(audmux_clk, 0, CCM_CGR0, 4, NULL, NULL); */ 342/* DEFINE_CLOCK(audmux_clk, 0, MX35_CCM_CGR0, 4, NULL, NULL); */
359DEFINE_CLOCK(can1_clk, 0, CCM_CGR0, 6, get_rate_ipg, NULL); 343DEFINE_CLOCK(can1_clk, 0, MX35_CCM_CGR0, 6, get_rate_ipg, NULL);
360DEFINE_CLOCK(can2_clk, 1, CCM_CGR0, 8, get_rate_ipg, NULL); 344DEFINE_CLOCK(can2_clk, 1, MX35_CCM_CGR0, 8, get_rate_ipg, NULL);
361DEFINE_CLOCK(cspi1_clk, 0, CCM_CGR0, 10, get_rate_ipg, NULL); 345DEFINE_CLOCK(cspi1_clk, 0, MX35_CCM_CGR0, 10, get_rate_ipg, NULL);
362DEFINE_CLOCK(cspi2_clk, 1, CCM_CGR0, 12, get_rate_ipg, NULL); 346DEFINE_CLOCK(cspi2_clk, 1, MX35_CCM_CGR0, 12, get_rate_ipg, NULL);
363DEFINE_CLOCK(ect_clk, 0, CCM_CGR0, 14, get_rate_ipg, NULL); 347DEFINE_CLOCK(ect_clk, 0, MX35_CCM_CGR0, 14, get_rate_ipg, NULL);
364DEFINE_CLOCK(edio_clk, 0, CCM_CGR0, 16, NULL, NULL); 348DEFINE_CLOCK(edio_clk, 0, MX35_CCM_CGR0, 16, NULL, NULL);
365DEFINE_CLOCK(emi_clk, 0, CCM_CGR0, 18, get_rate_ipg, NULL); 349DEFINE_CLOCK(emi_clk, 0, MX35_CCM_CGR0, 18, get_rate_ipg, NULL);
366DEFINE_CLOCK(epit1_clk, 0, CCM_CGR0, 20, get_rate_ipg, NULL); 350DEFINE_CLOCK(epit1_clk, 0, MX35_CCM_CGR0, 20, get_rate_ipg, NULL);
367DEFINE_CLOCK(epit2_clk, 1, CCM_CGR0, 22, get_rate_ipg, NULL); 351DEFINE_CLOCK(epit2_clk, 1, MX35_CCM_CGR0, 22, get_rate_ipg, NULL);
368DEFINE_CLOCK(esai_clk, 0, CCM_CGR0, 24, NULL, NULL); 352DEFINE_CLOCK(esai_clk, 0, MX35_CCM_CGR0, 24, NULL, NULL);
369DEFINE_CLOCK(esdhc1_clk, 0, CCM_CGR0, 26, get_rate_sdhc, NULL); 353DEFINE_CLOCK(esdhc1_clk, 0, MX35_CCM_CGR0, 26, get_rate_sdhc, NULL);
370DEFINE_CLOCK(esdhc2_clk, 1, CCM_CGR0, 28, get_rate_sdhc, NULL); 354DEFINE_CLOCK(esdhc2_clk, 1, MX35_CCM_CGR0, 28, get_rate_sdhc, NULL);
371DEFINE_CLOCK(esdhc3_clk, 2, CCM_CGR0, 30, get_rate_sdhc, NULL); 355DEFINE_CLOCK(esdhc3_clk, 2, MX35_CCM_CGR0, 30, get_rate_sdhc, NULL);
372 356
373DEFINE_CLOCK(fec_clk, 0, CCM_CGR1, 0, get_rate_ipg, NULL); 357DEFINE_CLOCK(fec_clk, 0, MX35_CCM_CGR1, 0, get_rate_ipg, NULL);
374DEFINE_CLOCK(gpio1_clk, 0, CCM_CGR1, 2, NULL, NULL); 358DEFINE_CLOCK(gpio1_clk, 0, MX35_CCM_CGR1, 2, NULL, NULL);
375DEFINE_CLOCK(gpio2_clk, 1, CCM_CGR1, 4, NULL, NULL); 359DEFINE_CLOCK(gpio2_clk, 1, MX35_CCM_CGR1, 4, NULL, NULL);
376DEFINE_CLOCK(gpio3_clk, 2, CCM_CGR1, 6, NULL, NULL); 360DEFINE_CLOCK(gpio3_clk, 2, MX35_CCM_CGR1, 6, NULL, NULL);
377DEFINE_CLOCK(gpt_clk, 0, CCM_CGR1, 8, get_rate_ipg, NULL); 361DEFINE_CLOCK(gpt_clk, 0, MX35_CCM_CGR1, 8, get_rate_ipg, NULL);
378DEFINE_CLOCK(i2c1_clk, 0, CCM_CGR1, 10, get_rate_ipg_per, NULL); 362DEFINE_CLOCK(i2c1_clk, 0, MX35_CCM_CGR1, 10, get_rate_ipg_per, NULL);
379DEFINE_CLOCK(i2c2_clk, 1, CCM_CGR1, 12, get_rate_ipg_per, NULL); 363DEFINE_CLOCK(i2c2_clk, 1, MX35_CCM_CGR1, 12, get_rate_ipg_per, NULL);
380DEFINE_CLOCK(i2c3_clk, 2, CCM_CGR1, 14, get_rate_ipg_per, NULL); 364DEFINE_CLOCK(i2c3_clk, 2, MX35_CCM_CGR1, 14, get_rate_ipg_per, NULL);
381DEFINE_CLOCK(iomuxc_clk, 0, CCM_CGR1, 16, NULL, NULL); 365DEFINE_CLOCK(iomuxc_clk, 0, MX35_CCM_CGR1, 16, NULL, NULL);
382DEFINE_CLOCK(ipu_clk, 0, CCM_CGR1, 18, get_rate_hsp, NULL); 366DEFINE_CLOCK(ipu_clk, 0, MX35_CCM_CGR1, 18, get_rate_hsp, NULL);
383DEFINE_CLOCK(kpp_clk, 0, CCM_CGR1, 20, get_rate_ipg, NULL); 367DEFINE_CLOCK(kpp_clk, 0, MX35_CCM_CGR1, 20, get_rate_ipg, NULL);
384DEFINE_CLOCK(mlb_clk, 0, CCM_CGR1, 22, get_rate_ahb, NULL); 368DEFINE_CLOCK(mlb_clk, 0, MX35_CCM_CGR1, 22, get_rate_ahb, NULL);
385DEFINE_CLOCK(mshc_clk, 0, CCM_CGR1, 24, get_rate_mshc, NULL); 369DEFINE_CLOCK(mshc_clk, 0, MX35_CCM_CGR1, 24, get_rate_mshc, NULL);
386DEFINE_CLOCK(owire_clk, 0, CCM_CGR1, 26, get_rate_ipg_per, NULL); 370DEFINE_CLOCK(owire_clk, 0, MX35_CCM_CGR1, 26, get_rate_ipg_per, NULL);
387DEFINE_CLOCK(pwm_clk, 0, CCM_CGR1, 28, get_rate_ipg_per, NULL); 371DEFINE_CLOCK(pwm_clk, 0, MX35_CCM_CGR1, 28, get_rate_ipg_per, NULL);
388DEFINE_CLOCK(rngc_clk, 0, CCM_CGR1, 30, get_rate_ipg, NULL); 372DEFINE_CLOCK(rngc_clk, 0, MX35_CCM_CGR1, 30, get_rate_ipg, NULL);
389 373
390DEFINE_CLOCK(rtc_clk, 0, CCM_CGR2, 0, get_rate_ipg, NULL); 374DEFINE_CLOCK(rtc_clk, 0, MX35_CCM_CGR2, 0, get_rate_ipg, NULL);
391DEFINE_CLOCK(rtic_clk, 0, CCM_CGR2, 2, get_rate_ahb, NULL); 375DEFINE_CLOCK(rtic_clk, 0, MX35_CCM_CGR2, 2, get_rate_ahb, NULL);
392DEFINE_CLOCK(scc_clk, 0, CCM_CGR2, 4, get_rate_ipg, NULL); 376DEFINE_CLOCK(scc_clk, 0, MX35_CCM_CGR2, 4, get_rate_ipg, NULL);
393DEFINE_CLOCK(sdma_clk, 0, CCM_CGR2, 6, NULL, NULL); 377DEFINE_CLOCK(sdma_clk, 0, MX35_CCM_CGR2, 6, NULL, NULL);
394DEFINE_CLOCK(spba_clk, 0, CCM_CGR2, 8, get_rate_ipg, NULL); 378DEFINE_CLOCK(spba_clk, 0, MX35_CCM_CGR2, 8, get_rate_ipg, NULL);
395DEFINE_CLOCK(spdif_clk, 0, CCM_CGR2, 10, NULL, NULL); 379DEFINE_CLOCK(spdif_clk, 0, MX35_CCM_CGR2, 10, NULL, NULL);
396DEFINE_CLOCK(ssi1_clk, 0, CCM_CGR2, 12, get_rate_ssi, NULL); 380DEFINE_CLOCK(ssi1_clk, 0, MX35_CCM_CGR2, 12, get_rate_ssi, NULL);
397DEFINE_CLOCK(ssi2_clk, 1, CCM_CGR2, 14, get_rate_ssi, NULL); 381DEFINE_CLOCK(ssi2_clk, 1, MX35_CCM_CGR2, 14, get_rate_ssi, NULL);
398DEFINE_CLOCK(uart1_clk, 0, CCM_CGR2, 16, get_rate_uart, NULL); 382DEFINE_CLOCK(uart1_clk, 0, MX35_CCM_CGR2, 16, get_rate_uart, NULL);
399DEFINE_CLOCK(uart2_clk, 1, CCM_CGR2, 18, get_rate_uart, NULL); 383DEFINE_CLOCK(uart2_clk, 1, MX35_CCM_CGR2, 18, get_rate_uart, NULL);
400DEFINE_CLOCK(uart3_clk, 2, CCM_CGR2, 20, get_rate_uart, NULL); 384DEFINE_CLOCK(uart3_clk, 2, MX35_CCM_CGR2, 20, get_rate_uart, NULL);
401DEFINE_CLOCK(usbotg_clk, 0, CCM_CGR2, 22, get_rate_otg, NULL); 385DEFINE_CLOCK(usbotg_clk, 0, MX35_CCM_CGR2, 22, get_rate_otg, NULL);
402DEFINE_CLOCK(wdog_clk, 0, CCM_CGR2, 24, NULL, NULL); 386DEFINE_CLOCK(wdog_clk, 0, MX35_CCM_CGR2, 24, NULL, NULL);
403DEFINE_CLOCK(max_clk, 0, CCM_CGR2, 26, NULL, NULL); 387DEFINE_CLOCK(max_clk, 0, MX35_CCM_CGR2, 26, NULL, NULL);
404DEFINE_CLOCK(audmux_clk, 0, CCM_CGR2, 30, NULL, NULL); 388DEFINE_CLOCK(audmux_clk, 0, MX35_CCM_CGR2, 30, NULL, NULL);
405 389
406DEFINE_CLOCK(csi_clk, 0, CCM_CGR3, 0, get_rate_csi, NULL); 390DEFINE_CLOCK(csi_clk, 0, MX35_CCM_CGR3, 0, get_rate_csi, NULL);
407DEFINE_CLOCK(iim_clk, 0, CCM_CGR3, 2, NULL, NULL); 391DEFINE_CLOCK(iim_clk, 0, MX35_CCM_CGR3, 2, NULL, NULL);
408DEFINE_CLOCK(gpu2d_clk, 0, CCM_CGR3, 4, NULL, NULL); 392DEFINE_CLOCK(gpu2d_clk, 0, MX35_CCM_CGR3, 4, NULL, NULL);
409 393
410DEFINE_CLOCK(usbahb_clk, 0, 0, 0, get_rate_ahb, NULL); 394DEFINE_CLOCK(usbahb_clk, 0, 0, 0, get_rate_ahb, NULL);
411 395
@@ -422,7 +406,7 @@ static unsigned long get_rate_nfc(struct clk *clk)
422{ 406{
423 unsigned long div1; 407 unsigned long div1;
424 408
425 div1 = (__raw_readl(CCM_BASE + CCM_PDR4) >> 28) + 1; 409 div1 = (__raw_readl(MX35_CCM_PDR4) >> 28) + 1;
426 410
427 return get_rate_ahb(NULL) / div1; 411 return get_rate_ahb(NULL) / div1;
428} 412}
@@ -518,11 +502,11 @@ int __init mx35_clocks_init()
518 /* Turn off all clocks except the ones we need to survive, namely: 502 /* Turn off all clocks except the ones we need to survive, namely:
519 * EMI, GPIO1/2/3, GPT, IOMUX, MAX and eventually uart 503 * EMI, GPIO1/2/3, GPT, IOMUX, MAX and eventually uart
520 */ 504 */
521 __raw_writel((3 << 18), CCM_BASE + CCM_CGR0); 505 __raw_writel((3 << 18), MX35_CCM_CGR0);
522 __raw_writel((3 << 2) | (3 << 4) | (3 << 6) | (3 << 8) | (3 << 16), 506 __raw_writel((3 << 2) | (3 << 4) | (3 << 6) | (3 << 8) | (3 << 16),
523 CCM_BASE + CCM_CGR1); 507 MX35_CCM_CGR1);
524 __raw_writel(cgr2, CCM_BASE + CCM_CGR2); 508 __raw_writel(cgr2, MX35_CCM_CGR2);
525 __raw_writel(0, CCM_BASE + CCM_CGR3); 509 __raw_writel(0, MX35_CCM_CGR3);
526 510
527 clk_enable(&iim_clk); 511 clk_enable(&iim_clk);
528 imx_print_silicon_rev("i.MX35", mx35_revision()); 512 imx_print_silicon_rev("i.MX35", mx35_revision());
@@ -533,7 +517,7 @@ int __init mx35_clocks_init()
533 * extra clocks turned on, otherwise the MX35 boot ROM code will 517 * extra clocks turned on, otherwise the MX35 boot ROM code will
534 * hang after a watchdog reset. 518 * hang after a watchdog reset.
535 */ 519 */
536 if (!(__raw_readl(CCM_BASE + CCM_RCSR) & (3 << 10))) { 520 if (!(__raw_readl(MX35_CCM_RCSR) & (3 << 10))) {
537 /* Additionally turn on UART1, SCC, and IIM clocks */ 521 /* Additionally turn on UART1, SCC, and IIM clocks */
538 clk_enable(&iim_clk); 522 clk_enable(&iim_clk);
539 clk_enable(&uart1_clk); 523 clk_enable(&uart1_clk);
diff --git a/arch/arm/mach-imx/crmregs-imx31.h b/arch/arm/mach-imx/crmregs-imx3.h
index 37a8a07beda..d7691e2362c 100644
--- a/arch/arm/mach-imx/crmregs-imx31.h
+++ b/arch/arm/mach-imx/crmregs-imx3.h
@@ -24,23 +24,36 @@
24#define CKIH_CLK_FREQ_27MHZ 27000000 24#define CKIH_CLK_FREQ_27MHZ 27000000
25#define CKIL_CLK_FREQ 32768 25#define CKIL_CLK_FREQ 32768
26 26
27#define MXC_CCM_BASE MX31_IO_ADDRESS(MX31_CCM_BASE_ADDR) 27#define MXC_CCM_BASE (cpu_is_mx31() ? \
28MX31_IO_ADDRESS(MX31_CCM_BASE_ADDR) : MX35_IO_ADDRESS(MX35_CCM_BASE_ADDR))
28 29
29/* Register addresses */ 30/* Register addresses */
30#define MXC_CCM_CCMR (MXC_CCM_BASE + 0x00) 31#define MXC_CCM_CCMR (MXC_CCM_BASE + 0x00)
31#define MXC_CCM_PDR0 (MXC_CCM_BASE + 0x04) 32#define MXC_CCM_PDR0 (MXC_CCM_BASE + 0x04)
32#define MXC_CCM_PDR1 (MXC_CCM_BASE + 0x08) 33#define MXC_CCM_PDR1 (MXC_CCM_BASE + 0x08)
34#define MX35_CCM_PDR2 (MXC_CCM_BASE + 0x0C)
33#define MXC_CCM_RCSR (MXC_CCM_BASE + 0x0C) 35#define MXC_CCM_RCSR (MXC_CCM_BASE + 0x0C)
36#define MX35_CCM_PDR3 (MXC_CCM_BASE + 0x10)
34#define MXC_CCM_MPCTL (MXC_CCM_BASE + 0x10) 37#define MXC_CCM_MPCTL (MXC_CCM_BASE + 0x10)
38#define MX35_CCM_PDR4 (MXC_CCM_BASE + 0x14)
35#define MXC_CCM_UPCTL (MXC_CCM_BASE + 0x14) 39#define MXC_CCM_UPCTL (MXC_CCM_BASE + 0x14)
40#define MX35_CCM_RCSR (MXC_CCM_BASE + 0x18)
36#define MXC_CCM_SRPCTL (MXC_CCM_BASE + 0x18) 41#define MXC_CCM_SRPCTL (MXC_CCM_BASE + 0x18)
42#define MX35_CCM_MPCTL (MXC_CCM_BASE + 0x1C)
37#define MXC_CCM_COSR (MXC_CCM_BASE + 0x1C) 43#define MXC_CCM_COSR (MXC_CCM_BASE + 0x1C)
44#define MX35_CCM_PPCTL (MXC_CCM_BASE + 0x20)
38#define MXC_CCM_CGR0 (MXC_CCM_BASE + 0x20) 45#define MXC_CCM_CGR0 (MXC_CCM_BASE + 0x20)
46#define MX35_CCM_ACMR (MXC_CCM_BASE + 0x24)
39#define MXC_CCM_CGR1 (MXC_CCM_BASE + 0x24) 47#define MXC_CCM_CGR1 (MXC_CCM_BASE + 0x24)
48#define MX35_CCM_COSR (MXC_CCM_BASE + 0x28)
40#define MXC_CCM_CGR2 (MXC_CCM_BASE + 0x28) 49#define MXC_CCM_CGR2 (MXC_CCM_BASE + 0x28)
50#define MX35_CCM_CGR0 (MXC_CCM_BASE + 0x2C)
41#define MXC_CCM_WIMR (MXC_CCM_BASE + 0x2C) 51#define MXC_CCM_WIMR (MXC_CCM_BASE + 0x2C)
52#define MX35_CCM_CGR1 (MXC_CCM_BASE + 0x30)
42#define MXC_CCM_LDC (MXC_CCM_BASE + 0x30) 53#define MXC_CCM_LDC (MXC_CCM_BASE + 0x30)
54#define MX35_CCM_CGR2 (MXC_CCM_BASE + 0x34)
43#define MXC_CCM_DCVR0 (MXC_CCM_BASE + 0x34) 55#define MXC_CCM_DCVR0 (MXC_CCM_BASE + 0x34)
56#define MX35_CCM_CGR3 (MXC_CCM_BASE + 0x38)
44#define MXC_CCM_DCVR1 (MXC_CCM_BASE + 0x38) 57#define MXC_CCM_DCVR1 (MXC_CCM_BASE + 0x38)
45#define MXC_CCM_DCVR2 (MXC_CCM_BASE + 0x3C) 58#define MXC_CCM_DCVR2 (MXC_CCM_BASE + 0x3C)
46#define MXC_CCM_DCVR3 (MXC_CCM_BASE + 0x40) 59#define MXC_CCM_DCVR3 (MXC_CCM_BASE + 0x40)
diff --git a/arch/arm/mach-imx/mach-armadillo5x0.c b/arch/arm/mach-imx/mach-armadillo5x0.c
index e4f426a0989..27bc27e6ea4 100644
--- a/arch/arm/mach-imx/mach-armadillo5x0.c
+++ b/arch/arm/mach-imx/mach-armadillo5x0.c
@@ -51,7 +51,7 @@
51#include <mach/ulpi.h> 51#include <mach/ulpi.h>
52 52
53#include "devices-imx31.h" 53#include "devices-imx31.h"
54#include "crmregs-imx31.h" 54#include "crmregs-imx3.h"
55 55
56static int armadillo5x0_pins[] = { 56static int armadillo5x0_pins[] = {
57 /* UART1 */ 57 /* UART1 */
diff --git a/arch/arm/mach-omap1/gpio15xx.c b/arch/arm/mach-omap1/gpio15xx.c
index 399da4ce017..634903ef829 100644
--- a/arch/arm/mach-omap1/gpio15xx.c
+++ b/arch/arm/mach-omap1/gpio15xx.c
@@ -42,11 +42,12 @@ static struct omap_gpio_reg_offs omap15xx_mpuio_regs = {
42 .irqstatus = OMAP_MPUIO_GPIO_INT, 42 .irqstatus = OMAP_MPUIO_GPIO_INT,
43 .irqenable = OMAP_MPUIO_GPIO_MASKIT, 43 .irqenable = OMAP_MPUIO_GPIO_MASKIT,
44 .irqenable_inv = true, 44 .irqenable_inv = true,
45 .irqctrl = OMAP_MPUIO_GPIO_INT_EDGE,
45}; 46};
46 47
47static struct __initdata omap_gpio_platform_data omap15xx_mpu_gpio_config = { 48static struct __initdata omap_gpio_platform_data omap15xx_mpu_gpio_config = {
48 .virtual_irq_start = IH_MPUIO_BASE, 49 .virtual_irq_start = IH_MPUIO_BASE,
49 .bank_type = METHOD_MPUIO, 50 .is_mpuio = true,
50 .bank_width = 16, 51 .bank_width = 16,
51 .bank_stride = 1, 52 .bank_stride = 1,
52 .regs = &omap15xx_mpuio_regs, 53 .regs = &omap15xx_mpuio_regs,
@@ -83,11 +84,12 @@ static struct omap_gpio_reg_offs omap15xx_gpio_regs = {
83 .irqstatus = OMAP1510_GPIO_INT_STATUS, 84 .irqstatus = OMAP1510_GPIO_INT_STATUS,
84 .irqenable = OMAP1510_GPIO_INT_MASK, 85 .irqenable = OMAP1510_GPIO_INT_MASK,
85 .irqenable_inv = true, 86 .irqenable_inv = true,
87 .irqctrl = OMAP1510_GPIO_INT_CONTROL,
88 .pinctrl = OMAP1510_GPIO_PIN_CONTROL,
86}; 89};
87 90
88static struct __initdata omap_gpio_platform_data omap15xx_gpio_config = { 91static struct __initdata omap_gpio_platform_data omap15xx_gpio_config = {
89 .virtual_irq_start = IH_GPIO_BASE, 92 .virtual_irq_start = IH_GPIO_BASE,
90 .bank_type = METHOD_GPIO_1510,
91 .bank_width = 16, 93 .bank_width = 16,
92 .regs = &omap15xx_gpio_regs, 94 .regs = &omap15xx_gpio_regs,
93}; 95};
@@ -115,7 +117,6 @@ static int __init omap15xx_gpio_init(void)
115 platform_device_register(&omap15xx_mpu_gpio); 117 platform_device_register(&omap15xx_mpu_gpio);
116 platform_device_register(&omap15xx_gpio); 118 platform_device_register(&omap15xx_gpio);
117 119
118 gpio_bank_count = 2;
119 return 0; 120 return 0;
120} 121}
121postcore_initcall(omap15xx_gpio_init); 122postcore_initcall(omap15xx_gpio_init);
diff --git a/arch/arm/mach-omap1/gpio16xx.c b/arch/arm/mach-omap1/gpio16xx.c
index 99cabc498ab..1fb3b9ad496 100644
--- a/arch/arm/mach-omap1/gpio16xx.c
+++ b/arch/arm/mach-omap1/gpio16xx.c
@@ -24,6 +24,9 @@
24#define OMAP1610_GPIO4_BASE 0xfffbbc00 24#define OMAP1610_GPIO4_BASE 0xfffbbc00
25#define OMAP1_MPUIO_VBASE OMAP1_MPUIO_BASE 25#define OMAP1_MPUIO_VBASE OMAP1_MPUIO_BASE
26 26
27/* smart idle, enable wakeup */
28#define SYSCONFIG_WORD 0x14
29
27/* mpu gpio */ 30/* mpu gpio */
28static struct __initdata resource omap16xx_mpu_gpio_resources[] = { 31static struct __initdata resource omap16xx_mpu_gpio_resources[] = {
29 { 32 {
@@ -45,11 +48,12 @@ static struct omap_gpio_reg_offs omap16xx_mpuio_regs = {
45 .irqstatus = OMAP_MPUIO_GPIO_INT, 48 .irqstatus = OMAP_MPUIO_GPIO_INT,
46 .irqenable = OMAP_MPUIO_GPIO_MASKIT, 49 .irqenable = OMAP_MPUIO_GPIO_MASKIT,
47 .irqenable_inv = true, 50 .irqenable_inv = true,
51 .irqctrl = OMAP_MPUIO_GPIO_INT_EDGE,
48}; 52};
49 53
50static struct __initdata omap_gpio_platform_data omap16xx_mpu_gpio_config = { 54static struct __initdata omap_gpio_platform_data omap16xx_mpu_gpio_config = {
51 .virtual_irq_start = IH_MPUIO_BASE, 55 .virtual_irq_start = IH_MPUIO_BASE,
52 .bank_type = METHOD_MPUIO, 56 .is_mpuio = true,
53 .bank_width = 16, 57 .bank_width = 16,
54 .bank_stride = 1, 58 .bank_stride = 1,
55 .regs = &omap16xx_mpuio_regs, 59 .regs = &omap16xx_mpuio_regs,
@@ -89,11 +93,13 @@ static struct omap_gpio_reg_offs omap16xx_gpio_regs = {
89 .irqenable = OMAP1610_GPIO_IRQENABLE1, 93 .irqenable = OMAP1610_GPIO_IRQENABLE1,
90 .set_irqenable = OMAP1610_GPIO_SET_IRQENABLE1, 94 .set_irqenable = OMAP1610_GPIO_SET_IRQENABLE1,
91 .clr_irqenable = OMAP1610_GPIO_CLEAR_IRQENABLE1, 95 .clr_irqenable = OMAP1610_GPIO_CLEAR_IRQENABLE1,
96 .wkup_en = OMAP1610_GPIO_WAKEUPENABLE,
97 .edgectrl1 = OMAP1610_GPIO_EDGE_CTRL1,
98 .edgectrl2 = OMAP1610_GPIO_EDGE_CTRL2,
92}; 99};
93 100
94static struct __initdata omap_gpio_platform_data omap16xx_gpio1_config = { 101static struct __initdata omap_gpio_platform_data omap16xx_gpio1_config = {
95 .virtual_irq_start = IH_GPIO_BASE, 102 .virtual_irq_start = IH_GPIO_BASE,
96 .bank_type = METHOD_GPIO_1610,
97 .bank_width = 16, 103 .bank_width = 16,
98 .regs = &omap16xx_gpio_regs, 104 .regs = &omap16xx_gpio_regs,
99}; 105};
@@ -123,7 +129,6 @@ static struct __initdata resource omap16xx_gpio2_resources[] = {
123 129
124static struct __initdata omap_gpio_platform_data omap16xx_gpio2_config = { 130static struct __initdata omap_gpio_platform_data omap16xx_gpio2_config = {
125 .virtual_irq_start = IH_GPIO_BASE + 16, 131 .virtual_irq_start = IH_GPIO_BASE + 16,
126 .bank_type = METHOD_GPIO_1610,
127 .bank_width = 16, 132 .bank_width = 16,
128 .regs = &omap16xx_gpio_regs, 133 .regs = &omap16xx_gpio_regs,
129}; 134};
@@ -153,7 +158,6 @@ static struct __initdata resource omap16xx_gpio3_resources[] = {
153 158
154static struct __initdata omap_gpio_platform_data omap16xx_gpio3_config = { 159static struct __initdata omap_gpio_platform_data omap16xx_gpio3_config = {
155 .virtual_irq_start = IH_GPIO_BASE + 32, 160 .virtual_irq_start = IH_GPIO_BASE + 32,
156 .bank_type = METHOD_GPIO_1610,
157 .bank_width = 16, 161 .bank_width = 16,
158 .regs = &omap16xx_gpio_regs, 162 .regs = &omap16xx_gpio_regs,
159}; 163};
@@ -183,7 +187,6 @@ static struct __initdata resource omap16xx_gpio4_resources[] = {
183 187
184static struct __initdata omap_gpio_platform_data omap16xx_gpio4_config = { 188static struct __initdata omap_gpio_platform_data omap16xx_gpio4_config = {
185 .virtual_irq_start = IH_GPIO_BASE + 48, 189 .virtual_irq_start = IH_GPIO_BASE + 48,
186 .bank_type = METHOD_GPIO_1610,
187 .bank_width = 16, 190 .bank_width = 16,
188 .regs = &omap16xx_gpio_regs, 191 .regs = &omap16xx_gpio_regs,
189}; 192};
@@ -214,6 +217,10 @@ static struct __initdata platform_device * omap16xx_gpio_dev[] = {
214static int __init omap16xx_gpio_init(void) 217static int __init omap16xx_gpio_init(void)
215{ 218{
216 int i; 219 int i;
220 void __iomem *base;
221 struct resource *res;
222 struct platform_device *pdev;
223 struct omap_gpio_platform_data *pdata;
217 224
218 if (!cpu_is_omap16xx()) 225 if (!cpu_is_omap16xx())
219 return -EINVAL; 226 return -EINVAL;
@@ -225,10 +232,27 @@ static int __init omap16xx_gpio_init(void)
225 omap_writel(omap_readl(ULPD_CAM_CLK_CTRL) | 0x04, 232 omap_writel(omap_readl(ULPD_CAM_CLK_CTRL) | 0x04,
226 ULPD_CAM_CLK_CTRL); 233 ULPD_CAM_CLK_CTRL);
227 234
228 for (i = 0; i < ARRAY_SIZE(omap16xx_gpio_dev); i++) 235 for (i = 0; i < ARRAY_SIZE(omap16xx_gpio_dev); i++) {
229 platform_device_register(omap16xx_gpio_dev[i]); 236 pdev = omap16xx_gpio_dev[i];
237 pdata = pdev->dev.platform_data;
238
239 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
240 if (unlikely(!res)) {
241 dev_err(&pdev->dev, "Invalid mem resource.\n");
242 return -ENODEV;
243 }
230 244
231 gpio_bank_count = ARRAY_SIZE(omap16xx_gpio_dev); 245 base = ioremap(res->start, resource_size(res));
246 if (unlikely(!base)) {
247 dev_err(&pdev->dev, "ioremap failed.\n");
248 return -ENOMEM;
249 }
250
251 __raw_writel(SYSCONFIG_WORD, base + OMAP1610_GPIO_SYSCONFIG);
252 iounmap(base);
253
254 platform_device_register(omap16xx_gpio_dev[i]);
255 }
232 256
233 return 0; 257 return 0;
234} 258}
diff --git a/arch/arm/mach-omap1/gpio7xx.c b/arch/arm/mach-omap1/gpio7xx.c
index 5ab63eab0ff..4771d6b68b9 100644
--- a/arch/arm/mach-omap1/gpio7xx.c
+++ b/arch/arm/mach-omap1/gpio7xx.c
@@ -47,12 +47,13 @@ static struct omap_gpio_reg_offs omap7xx_mpuio_regs = {
47 .irqstatus = OMAP_MPUIO_GPIO_INT / 2, 47 .irqstatus = OMAP_MPUIO_GPIO_INT / 2,
48 .irqenable = OMAP_MPUIO_GPIO_MASKIT / 2, 48 .irqenable = OMAP_MPUIO_GPIO_MASKIT / 2,
49 .irqenable_inv = true, 49 .irqenable_inv = true,
50 .irqctrl = OMAP_MPUIO_GPIO_INT_EDGE >> 1,
50}; 51};
51 52
52static struct __initdata omap_gpio_platform_data omap7xx_mpu_gpio_config = { 53static struct __initdata omap_gpio_platform_data omap7xx_mpu_gpio_config = {
53 .virtual_irq_start = IH_MPUIO_BASE, 54 .virtual_irq_start = IH_MPUIO_BASE,
54 .bank_type = METHOD_MPUIO, 55 .is_mpuio = true,
55 .bank_width = 32, 56 .bank_width = 16,
56 .bank_stride = 2, 57 .bank_stride = 2,
57 .regs = &omap7xx_mpuio_regs, 58 .regs = &omap7xx_mpuio_regs,
58}; 59};
@@ -88,11 +89,11 @@ static struct omap_gpio_reg_offs omap7xx_gpio_regs = {
88 .irqstatus = OMAP7XX_GPIO_INT_STATUS, 89 .irqstatus = OMAP7XX_GPIO_INT_STATUS,
89 .irqenable = OMAP7XX_GPIO_INT_MASK, 90 .irqenable = OMAP7XX_GPIO_INT_MASK,
90 .irqenable_inv = true, 91 .irqenable_inv = true,
92 .irqctrl = OMAP7XX_GPIO_INT_CONTROL,
91}; 93};
92 94
93static struct __initdata omap_gpio_platform_data omap7xx_gpio1_config = { 95static struct __initdata omap_gpio_platform_data omap7xx_gpio1_config = {
94 .virtual_irq_start = IH_GPIO_BASE, 96 .virtual_irq_start = IH_GPIO_BASE,
95 .bank_type = METHOD_GPIO_7XX,
96 .bank_width = 32, 97 .bank_width = 32,
97 .regs = &omap7xx_gpio_regs, 98 .regs = &omap7xx_gpio_regs,
98}; 99};
@@ -122,7 +123,6 @@ static struct __initdata resource omap7xx_gpio2_resources[] = {
122 123
123static struct __initdata omap_gpio_platform_data omap7xx_gpio2_config = { 124static struct __initdata omap_gpio_platform_data omap7xx_gpio2_config = {
124 .virtual_irq_start = IH_GPIO_BASE + 32, 125 .virtual_irq_start = IH_GPIO_BASE + 32,
125 .bank_type = METHOD_GPIO_7XX,
126 .bank_width = 32, 126 .bank_width = 32,
127 .regs = &omap7xx_gpio_regs, 127 .regs = &omap7xx_gpio_regs,
128}; 128};
@@ -152,7 +152,6 @@ static struct __initdata resource omap7xx_gpio3_resources[] = {
152 152
153static struct __initdata omap_gpio_platform_data omap7xx_gpio3_config = { 153static struct __initdata omap_gpio_platform_data omap7xx_gpio3_config = {
154 .virtual_irq_start = IH_GPIO_BASE + 64, 154 .virtual_irq_start = IH_GPIO_BASE + 64,
155 .bank_type = METHOD_GPIO_7XX,
156 .bank_width = 32, 155 .bank_width = 32,
157 .regs = &omap7xx_gpio_regs, 156 .regs = &omap7xx_gpio_regs,
158}; 157};
@@ -182,7 +181,6 @@ static struct __initdata resource omap7xx_gpio4_resources[] = {
182 181
183static struct __initdata omap_gpio_platform_data omap7xx_gpio4_config = { 182static struct __initdata omap_gpio_platform_data omap7xx_gpio4_config = {
184 .virtual_irq_start = IH_GPIO_BASE + 96, 183 .virtual_irq_start = IH_GPIO_BASE + 96,
185 .bank_type = METHOD_GPIO_7XX,
186 .bank_width = 32, 184 .bank_width = 32,
187 .regs = &omap7xx_gpio_regs, 185 .regs = &omap7xx_gpio_regs,
188}; 186};
@@ -212,7 +210,6 @@ static struct __initdata resource omap7xx_gpio5_resources[] = {
212 210
213static struct __initdata omap_gpio_platform_data omap7xx_gpio5_config = { 211static struct __initdata omap_gpio_platform_data omap7xx_gpio5_config = {
214 .virtual_irq_start = IH_GPIO_BASE + 128, 212 .virtual_irq_start = IH_GPIO_BASE + 128,
215 .bank_type = METHOD_GPIO_7XX,
216 .bank_width = 32, 213 .bank_width = 32,
217 .regs = &omap7xx_gpio_regs, 214 .regs = &omap7xx_gpio_regs,
218}; 215};
@@ -242,7 +239,6 @@ static struct __initdata resource omap7xx_gpio6_resources[] = {
242 239
243static struct __initdata omap_gpio_platform_data omap7xx_gpio6_config = { 240static struct __initdata omap_gpio_platform_data omap7xx_gpio6_config = {
244 .virtual_irq_start = IH_GPIO_BASE + 160, 241 .virtual_irq_start = IH_GPIO_BASE + 160,
245 .bank_type = METHOD_GPIO_7XX,
246 .bank_width = 32, 242 .bank_width = 32,
247 .regs = &omap7xx_gpio_regs, 243 .regs = &omap7xx_gpio_regs,
248}; 244};
@@ -282,8 +278,6 @@ static int __init omap7xx_gpio_init(void)
282 for (i = 0; i < ARRAY_SIZE(omap7xx_gpio_dev); i++) 278 for (i = 0; i < ARRAY_SIZE(omap7xx_gpio_dev); i++)
283 platform_device_register(omap7xx_gpio_dev[i]); 279 platform_device_register(omap7xx_gpio_dev[i]);
284 280
285 gpio_bank_count = ARRAY_SIZE(omap7xx_gpio_dev);
286
287 return 0; 281 return 0;
288} 282}
289postcore_initcall(omap7xx_gpio_init); 283postcore_initcall(omap7xx_gpio_init);
diff --git a/arch/arm/mach-omap2/cm2xxx_3xxx.c b/arch/arm/mach-omap2/cm2xxx_3xxx.c
index c79ed63601c..389f9f8b570 100644
--- a/arch/arm/mach-omap2/cm2xxx_3xxx.c
+++ b/arch/arm/mach-omap2/cm2xxx_3xxx.c
@@ -18,6 +18,8 @@
18#include <linux/err.h> 18#include <linux/err.h>
19#include <linux/io.h> 19#include <linux/io.h>
20 20
21#include <plat/hardware.h>
22
21#include "iomap.h" 23#include "iomap.h"
22#include "common.h" 24#include "common.h"
23#include "cm.h" 25#include "cm.h"
diff --git a/arch/arm/mach-omap2/common.c b/arch/arm/mach-omap2/common.c
index 93419de4534..1549c11000d 100644
--- a/arch/arm/mach-omap2/common.c
+++ b/arch/arm/mach-omap2/common.c
@@ -17,6 +17,7 @@
17#include <linux/clk.h> 17#include <linux/clk.h>
18#include <linux/io.h> 18#include <linux/io.h>
19 19
20#include <plat/hardware.h>
20#include <plat/board.h> 21#include <plat/board.h>
21#include <plat/mux.h> 22#include <plat/mux.h>
22#include <plat/clock.h> 23#include <plat/clock.h>
diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
index 2fd5fd1abb4..08e674bb041 100644
--- a/arch/arm/mach-omap2/control.c
+++ b/arch/arm/mach-omap2/control.c
@@ -15,6 +15,7 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/io.h> 16#include <linux/io.h>
17 17
18#include <plat/hardware.h>
18#include <plat/sdrc.h> 19#include <plat/sdrc.h>
19 20
20#include "iomap.h" 21#include "iomap.h"
diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
index 64c0caed951..2f994e5194e 100644
--- a/arch/arm/mach-omap2/gpio.c
+++ b/arch/arm/mach-omap2/gpio.c
@@ -23,6 +23,9 @@
23 23
24#include <plat/omap_hwmod.h> 24#include <plat/omap_hwmod.h>
25#include <plat/omap_device.h> 25#include <plat/omap_device.h>
26#include <plat/omap-pm.h>
27
28#include "powerdomain.h"
26 29
27static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused) 30static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
28{ 31{
@@ -31,6 +34,7 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
31 struct omap_gpio_dev_attr *dev_attr; 34 struct omap_gpio_dev_attr *dev_attr;
32 char *name = "omap_gpio"; 35 char *name = "omap_gpio";
33 int id; 36 int id;
37 struct powerdomain *pwrdm;
34 38
35 /* 39 /*
36 * extract the device id from name field available in the 40 * extract the device id from name field available in the
@@ -52,7 +56,7 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
52 pdata->bank_width = dev_attr->bank_width; 56 pdata->bank_width = dev_attr->bank_width;
53 pdata->dbck_flag = dev_attr->dbck_flag; 57 pdata->dbck_flag = dev_attr->dbck_flag;
54 pdata->virtual_irq_start = IH_GPIO_BASE + 32 * (id - 1); 58 pdata->virtual_irq_start = IH_GPIO_BASE + 32 * (id - 1);
55 59 pdata->get_context_loss_count = omap_pm_get_dev_context_loss_count;
56 pdata->regs = kzalloc(sizeof(struct omap_gpio_reg_offs), GFP_KERNEL); 60 pdata->regs = kzalloc(sizeof(struct omap_gpio_reg_offs), GFP_KERNEL);
57 if (!pdata) { 61 if (!pdata) {
58 pr_err("gpio%d: Memory allocation failed\n", id); 62 pr_err("gpio%d: Memory allocation failed\n", id);
@@ -61,8 +65,15 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
61 65
62 switch (oh->class->rev) { 66 switch (oh->class->rev) {
63 case 0: 67 case 0:
68 if (id == 1)
69 /* non-wakeup GPIO pins for OMAP2 Bank1 */
70 pdata->non_wakeup_gpios = 0xe203ffc0;
71 else if (id == 2)
72 /* non-wakeup GPIO pins for OMAP2 Bank2 */
73 pdata->non_wakeup_gpios = 0x08700040;
74 /* fall through */
75
64 case 1: 76 case 1:
65 pdata->bank_type = METHOD_GPIO_24XX;
66 pdata->regs->revision = OMAP24XX_GPIO_REVISION; 77 pdata->regs->revision = OMAP24XX_GPIO_REVISION;
67 pdata->regs->direction = OMAP24XX_GPIO_OE; 78 pdata->regs->direction = OMAP24XX_GPIO_OE;
68 pdata->regs->datain = OMAP24XX_GPIO_DATAIN; 79 pdata->regs->datain = OMAP24XX_GPIO_DATAIN;
@@ -72,13 +83,19 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
72 pdata->regs->irqstatus = OMAP24XX_GPIO_IRQSTATUS1; 83 pdata->regs->irqstatus = OMAP24XX_GPIO_IRQSTATUS1;
73 pdata->regs->irqstatus2 = OMAP24XX_GPIO_IRQSTATUS2; 84 pdata->regs->irqstatus2 = OMAP24XX_GPIO_IRQSTATUS2;
74 pdata->regs->irqenable = OMAP24XX_GPIO_IRQENABLE1; 85 pdata->regs->irqenable = OMAP24XX_GPIO_IRQENABLE1;
86 pdata->regs->irqenable2 = OMAP24XX_GPIO_IRQENABLE2;
75 pdata->regs->set_irqenable = OMAP24XX_GPIO_SETIRQENABLE1; 87 pdata->regs->set_irqenable = OMAP24XX_GPIO_SETIRQENABLE1;
76 pdata->regs->clr_irqenable = OMAP24XX_GPIO_CLEARIRQENABLE1; 88 pdata->regs->clr_irqenable = OMAP24XX_GPIO_CLEARIRQENABLE1;
77 pdata->regs->debounce = OMAP24XX_GPIO_DEBOUNCE_VAL; 89 pdata->regs->debounce = OMAP24XX_GPIO_DEBOUNCE_VAL;
78 pdata->regs->debounce_en = OMAP24XX_GPIO_DEBOUNCE_EN; 90 pdata->regs->debounce_en = OMAP24XX_GPIO_DEBOUNCE_EN;
91 pdata->regs->ctrl = OMAP24XX_GPIO_CTRL;
92 pdata->regs->wkup_en = OMAP24XX_GPIO_WAKE_EN;
93 pdata->regs->leveldetect0 = OMAP24XX_GPIO_LEVELDETECT0;
94 pdata->regs->leveldetect1 = OMAP24XX_GPIO_LEVELDETECT1;
95 pdata->regs->risingdetect = OMAP24XX_GPIO_RISINGDETECT;
96 pdata->regs->fallingdetect = OMAP24XX_GPIO_FALLINGDETECT;
79 break; 97 break;
80 case 2: 98 case 2:
81 pdata->bank_type = METHOD_GPIO_44XX;
82 pdata->regs->revision = OMAP4_GPIO_REVISION; 99 pdata->regs->revision = OMAP4_GPIO_REVISION;
83 pdata->regs->direction = OMAP4_GPIO_OE; 100 pdata->regs->direction = OMAP4_GPIO_OE;
84 pdata->regs->datain = OMAP4_GPIO_DATAIN; 101 pdata->regs->datain = OMAP4_GPIO_DATAIN;
@@ -88,10 +105,17 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
88 pdata->regs->irqstatus = OMAP4_GPIO_IRQSTATUS0; 105 pdata->regs->irqstatus = OMAP4_GPIO_IRQSTATUS0;
89 pdata->regs->irqstatus2 = OMAP4_GPIO_IRQSTATUS1; 106 pdata->regs->irqstatus2 = OMAP4_GPIO_IRQSTATUS1;
90 pdata->regs->irqenable = OMAP4_GPIO_IRQSTATUSSET0; 107 pdata->regs->irqenable = OMAP4_GPIO_IRQSTATUSSET0;
108 pdata->regs->irqenable2 = OMAP4_GPIO_IRQSTATUSSET1;
91 pdata->regs->set_irqenable = OMAP4_GPIO_IRQSTATUSSET0; 109 pdata->regs->set_irqenable = OMAP4_GPIO_IRQSTATUSSET0;
92 pdata->regs->clr_irqenable = OMAP4_GPIO_IRQSTATUSCLR0; 110 pdata->regs->clr_irqenable = OMAP4_GPIO_IRQSTATUSCLR0;
93 pdata->regs->debounce = OMAP4_GPIO_DEBOUNCINGTIME; 111 pdata->regs->debounce = OMAP4_GPIO_DEBOUNCINGTIME;
94 pdata->regs->debounce_en = OMAP4_GPIO_DEBOUNCENABLE; 112 pdata->regs->debounce_en = OMAP4_GPIO_DEBOUNCENABLE;
113 pdata->regs->ctrl = OMAP4_GPIO_CTRL;
114 pdata->regs->wkup_en = OMAP4_GPIO_IRQWAKEN0;
115 pdata->regs->leveldetect0 = OMAP4_GPIO_LEVELDETECT0;
116 pdata->regs->leveldetect1 = OMAP4_GPIO_LEVELDETECT1;
117 pdata->regs->risingdetect = OMAP4_GPIO_RISINGDETECT;
118 pdata->regs->fallingdetect = OMAP4_GPIO_FALLINGDETECT;
95 break; 119 break;
96 default: 120 default:
97 WARN(1, "Invalid gpio bank_type\n"); 121 WARN(1, "Invalid gpio bank_type\n");
@@ -99,6 +123,9 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
99 return -EINVAL; 123 return -EINVAL;
100 } 124 }
101 125
126 pwrdm = omap_hwmod_get_pwrdm(oh);
127 pdata->loses_context = pwrdm_can_ever_lose_context(pwrdm);
128
102 pdev = omap_device_build(name, id - 1, oh, pdata, 129 pdev = omap_device_build(name, id - 1, oh, pdata,
103 sizeof(*pdata), NULL, 0, false); 130 sizeof(*pdata), NULL, 0, false);
104 kfree(pdata); 131 kfree(pdata);
@@ -109,9 +136,6 @@ static int __init omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
109 return PTR_ERR(pdev); 136 return PTR_ERR(pdev);
110 } 137 }
111 138
112 omap_device_disable_idle_on_suspend(pdev);
113
114 gpio_bank_count++;
115 return 0; 139 return 0;
116} 140}
117 141
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index da054370f83..027a537d72b 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -71,16 +71,6 @@ static struct powerdomain *mpu_pwrdm, *neon_pwrdm;
71static struct powerdomain *core_pwrdm, *per_pwrdm; 71static struct powerdomain *core_pwrdm, *per_pwrdm;
72static struct powerdomain *cam_pwrdm; 72static struct powerdomain *cam_pwrdm;
73 73
74static inline void omap3_per_save_context(void)
75{
76 omap_gpio_save_context();
77}
78
79static inline void omap3_per_restore_context(void)
80{
81 omap_gpio_restore_context();
82}
83
84static void omap3_enable_io_chain(void) 74static void omap3_enable_io_chain(void)
85{ 75{
86 int timeout = 0; 76 int timeout = 0;
@@ -323,8 +313,6 @@ void omap_sram_idle(void)
323 if (per_next_state < PWRDM_POWER_ON) { 313 if (per_next_state < PWRDM_POWER_ON) {
324 per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0; 314 per_going_off = (per_next_state == PWRDM_POWER_OFF) ? 1 : 0;
325 omap2_gpio_prepare_for_idle(per_going_off); 315 omap2_gpio_prepare_for_idle(per_going_off);
326 if (per_next_state == PWRDM_POWER_OFF)
327 omap3_per_save_context();
328 } 316 }
329 317
330 /* CORE */ 318 /* CORE */
@@ -390,8 +378,6 @@ void omap_sram_idle(void)
390 if (per_next_state < PWRDM_POWER_ON) { 378 if (per_next_state < PWRDM_POWER_ON) {
391 per_prev_state = pwrdm_read_prev_pwrst(per_pwrdm); 379 per_prev_state = pwrdm_read_prev_pwrst(per_pwrdm);
392 omap2_gpio_resume_after_idle(); 380 omap2_gpio_resume_after_idle();
393 if (per_prev_state == PWRDM_POWER_OFF)
394 omap3_per_restore_context();
395 } 381 }
396 382
397 /* Disable IO-PAD and IO-CHAIN wakeup */ 383 /* Disable IO-PAD and IO-CHAIN wakeup */
diff --git a/arch/arm/mach-omap2/sdrc2xxx.c b/arch/arm/mach-omap2/sdrc2xxx.c
index 2c329a6f477..1133bb2f632 100644
--- a/arch/arm/mach-omap2/sdrc2xxx.c
+++ b/arch/arm/mach-omap2/sdrc2xxx.c
@@ -24,6 +24,7 @@
24#include <linux/clk.h> 24#include <linux/clk.h>
25#include <linux/io.h> 25#include <linux/io.h>
26 26
27#include <plat/hardware.h>
27#include <plat/clock.h> 28#include <plat/clock.h>
28#include <plat/sram.h> 29#include <plat/sram.h>
29#include <plat/sdrc.h> 30#include <plat/sdrc.h>
diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
index c005e2f5e38..57db2038b23 100644
--- a/arch/arm/mach-omap2/voltagedomains3xxx_data.c
+++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c
@@ -108,6 +108,7 @@ void __init omap3xxx_voltagedomains_init(void)
108 * XXX Will depend on the process, validation, and binning 108 * XXX Will depend on the process, validation, and binning
109 * for the currently-running IC 109 * for the currently-running IC
110 */ 110 */
111#ifdef CONFIG_PM_OPP
111 if (cpu_is_omap3630()) { 112 if (cpu_is_omap3630()) {
112 omap3_voltdm_mpu.volt_data = omap36xx_vddmpu_volt_data; 113 omap3_voltdm_mpu.volt_data = omap36xx_vddmpu_volt_data;
113 omap3_voltdm_core.volt_data = omap36xx_vddcore_volt_data; 114 omap3_voltdm_core.volt_data = omap36xx_vddcore_volt_data;
@@ -115,6 +116,7 @@ void __init omap3xxx_voltagedomains_init(void)
115 omap3_voltdm_mpu.volt_data = omap34xx_vddmpu_volt_data; 116 omap3_voltdm_mpu.volt_data = omap34xx_vddmpu_volt_data;
116 omap3_voltdm_core.volt_data = omap34xx_vddcore_volt_data; 117 omap3_voltdm_core.volt_data = omap34xx_vddcore_volt_data;
117 } 118 }
119#endif
118 120
119 if (cpu_is_omap3517() || cpu_is_omap3505()) 121 if (cpu_is_omap3517() || cpu_is_omap3505())
120 voltdms = voltagedomains_am35xx; 122 voltdms = voltagedomains_am35xx;
diff --git a/arch/arm/mach-omap2/voltagedomains44xx_data.c b/arch/arm/mach-omap2/voltagedomains44xx_data.c
index 4e11d022595..c3115f6853d 100644
--- a/arch/arm/mach-omap2/voltagedomains44xx_data.c
+++ b/arch/arm/mach-omap2/voltagedomains44xx_data.c
@@ -100,9 +100,11 @@ void __init omap44xx_voltagedomains_init(void)
100 * XXX Will depend on the process, validation, and binning 100 * XXX Will depend on the process, validation, and binning
101 * for the currently-running IC 101 * for the currently-running IC
102 */ 102 */
103#ifdef CONFIG_PM_OPP
103 omap4_voltdm_mpu.volt_data = omap44xx_vdd_mpu_volt_data; 104 omap4_voltdm_mpu.volt_data = omap44xx_vdd_mpu_volt_data;
104 omap4_voltdm_iva.volt_data = omap44xx_vdd_iva_volt_data; 105 omap4_voltdm_iva.volt_data = omap44xx_vdd_iva_volt_data;
105 omap4_voltdm_core.volt_data = omap44xx_vdd_core_volt_data; 106 omap4_voltdm_core.volt_data = omap44xx_vdd_core_volt_data;
107#endif
106 108
107 for (i = 0; voltdm = voltagedomains_omap4[i], voltdm; i++) 109 for (i = 0; voltdm = voltagedomains_omap4[i], voltdm; i++)
108 voltdm->sys_clk.name = sys_clk_name; 110 voltdm->sys_clk.name = sys_clk_name;
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index 5261a7ed099..68d89cb96af 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -2,42 +2,6 @@
2# 2#
3# Licensed under GPLv2 3# Licensed under GPLv2
4 4
5config CPU_S3C2410
6 bool
7 depends on ARCH_S3C2410
8 select CPU_ARM920T
9 select S3C2410_CLOCK
10 select CPU_LLSERIAL_S3C2410
11 select S3C2410_PM if PM
12 select S3C2410_CPUFREQ if CPU_FREQ_S3C24XX
13 help
14 Support for S3C2410 and S3C2410A family from the S3C24XX line
15 of Samsung Mobile CPUs.
16
17config CPU_S3C2410_DMA
18 bool
19 depends on S3C2410_DMA && (CPU_S3C2410 || CPU_S3C2442)
20 default y if CPU_S3C2410 || CPU_S3C2442
21 help
22 DMA device selection for S3C2410 and compatible CPUs
23
24config S3C2410_PM
25 bool
26 help
27 Power Management code common to S3C2410 and better
28
29config SIMTEC_NOR
30 bool
31 help
32 Internal node to specify machine has simtec NOR mapping
33
34config MACH_BAST_IDE
35 bool
36 select HAVE_PATA_PLATFORM
37 help
38 Internal node for machines with an BAST style IDE
39 interface
40
41# cpu frequency scaling support 5# cpu frequency scaling support
42 6
43config S3C2410_CPUFREQ 7config S3C2410_CPUFREQ
@@ -54,121 +18,3 @@ config S3C2410_PLLTABLE
54 help 18 help
55 Select the PLL table for the S3C2410 19 Select the PLL table for the S3C2410
56 20
57menu "S3C2410 Machines"
58
59config ARCH_SMDK2410
60 bool "SMDK2410/A9M2410"
61 select CPU_S3C2410
62 select MACH_SMDK
63 help
64 Say Y here if you are using the SMDK2410 or the derived module A9M2410
65 <http://www.fsforth.de>
66
67config ARCH_H1940
68 bool "IPAQ H1940"
69 select CPU_S3C2410
70 select PM_H1940 if PM
71 select S3C_DEV_USB_HOST
72 select S3C_DEV_NAND
73 select S3C2410_SETUP_TS
74 help
75 Say Y here if you are using the HP IPAQ H1940
76
77config H1940BT
78 tristate "Control the state of H1940 bluetooth chip"
79 depends on ARCH_H1940
80 select RFKILL
81 help
82 This is a simple driver that is able to control
83 the state of built in bluetooth chip on h1940.
84
85config PM_H1940
86 bool
87 help
88 Internal node for H1940 and related PM
89
90config MACH_N30
91 bool "Acer N30 family"
92 select CPU_S3C2410
93 select MACH_N35
94 select S3C_DEV_USB_HOST
95 select S3C_DEV_NAND
96 help
97 Say Y here if you want suppt for the Acer N30, Acer N35,
98 Navman PiN570, Yakumo AlphaX or Airis NC05 PDAs.
99
100config MACH_N35
101 bool
102 help
103 Internal node in order to enable support for Acer N35 if Acer N30 is
104 selected.
105
106config ARCH_BAST
107 bool "Simtec Electronics BAST (EB2410ITX)"
108 select CPU_S3C2410
109 select S3C2410_IOTIMING if S3C2410_CPUFREQ
110 select PM_SIMTEC if PM
111 select SIMTEC_NOR
112 select MACH_BAST_IDE
113 select S3C24XX_DCLK
114 select ISA
115 select S3C_DEV_HWMON
116 select S3C_DEV_USB_HOST
117 select S3C_DEV_NAND
118 help
119 Say Y here if you are using the Simtec Electronics EB2410ITX
120 development board (also known as BAST)
121
122config MACH_OTOM
123 bool "NexVision OTOM Board"
124 select CPU_S3C2410
125 select S3C_DEV_USB_HOST
126 select S3C_DEV_NAND
127 help
128 Say Y here if you are using the Nex Vision OTOM board
129
130config MACH_AML_M5900
131 bool "AML M5900 Series"
132 select CPU_S3C2410
133 select PM_SIMTEC if PM
134 select S3C_DEV_USB_HOST
135 help
136 Say Y here if you are using the American Microsystems M5900 Series
137 <http://www.amltd.com>
138
139config BAST_PC104_IRQ
140 bool "BAST PC104 IRQ support"
141 depends on ARCH_BAST
142 default y
143 help
144 Say Y here to enable the PC104 IRQ routing on the
145 Simtec BAST (EB2410ITX)
146
147config MACH_TCT_HAMMER
148 bool "TCT Hammer Board"
149 select CPU_S3C2410
150 select S3C_DEV_USB_HOST
151 help
152 Say Y here if you are using the TinCanTools Hammer Board
153 <http://www.tincantools.com>
154
155config MACH_VR1000
156 bool "Thorcom VR1000"
157 select PM_SIMTEC if PM
158 select S3C24XX_DCLK
159 select SIMTEC_NOR
160 select MACH_BAST_IDE
161 select CPU_S3C2410
162 select S3C_DEV_USB_HOST
163 help
164 Say Y here if you are using the Thorcom VR1000 board.
165
166config MACH_QT2410
167 bool "QT2410"
168 select CPU_S3C2410
169 select S3C_DEV_USB_HOST
170 select S3C_DEV_NAND
171 help
172 Say Y here if you are using the Armzone QT2410
173
174endmenu
diff --git a/arch/arm/mach-s3c2410/Makefile b/arch/arm/mach-s3c2410/Makefile
index 782fd81144e..6b9a316e004 100644
--- a/arch/arm/mach-s3c2410/Makefile
+++ b/arch/arm/mach-s3c2410/Makefile
@@ -9,32 +9,6 @@ obj-m :=
9obj-n := 9obj-n :=
10obj- := 10obj- :=
11 11
12obj-$(CONFIG_CPU_S3C2410) += s3c2410.o
13obj-$(CONFIG_CPU_S3C2410_DMA) += dma.o
14obj-$(CONFIG_CPU_S3C2410_DMA) += dma.o
15obj-$(CONFIG_S3C2410_PM) += pm.o sleep.o
16obj-$(CONFIG_S3C2410_CPUFREQ) += cpu-freq.o 12obj-$(CONFIG_S3C2410_CPUFREQ) += cpu-freq.o
17obj-$(CONFIG_S3C2410_PLLTABLE) += pll.o 13obj-$(CONFIG_S3C2410_PLLTABLE) += pll.o
18 14
19# Machine support
20
21obj-$(CONFIG_ARCH_SMDK2410) += mach-smdk2410.o
22obj-$(CONFIG_ARCH_H1940) += mach-h1940.o
23obj-$(CONFIG_H1940BT) += h1940-bluetooth.o
24obj-$(CONFIG_PM_H1940) += pm-h1940.o
25obj-$(CONFIG_MACH_N30) += mach-n30.o
26obj-$(CONFIG_ARCH_BAST) += mach-bast.o usb-simtec.o
27obj-$(CONFIG_MACH_OTOM) += mach-otom.o
28obj-$(CONFIG_MACH_AML_M5900) += mach-amlm5900.o
29obj-$(CONFIG_BAST_PC104_IRQ) += bast-irq.o
30obj-$(CONFIG_MACH_TCT_HAMMER) += mach-tct_hammer.o
31obj-$(CONFIG_MACH_VR1000) += mach-vr1000.o usb-simtec.o
32obj-$(CONFIG_MACH_QT2410) += mach-qt2410.o
33
34# Common bits of machine support
35
36obj-$(CONFIG_SIMTEC_NOR) += nor-simtec.o
37
38# machine additions
39
40obj-$(CONFIG_MACH_BAST_IDE) += bast-ide.o
diff --git a/arch/arm/mach-s3c2410/include/mach/spi.h b/arch/arm/mach-s3c2410/include/mach/spi.h
deleted file mode 100644
index 4d9588373aa..00000000000
--- a/arch/arm/mach-s3c2410/include/mach/spi.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/* arch/arm/mach-s3c2410/include/mach/spi.h
2 *
3 * Copyright (c) 2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * S3C2410 - SPI Controller platform_device info
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11*/
12
13#ifndef __ASM_ARCH_SPI_H
14#define __ASM_ARCH_SPI_H __FILE__
15
16struct s3c2410_spi_info {
17 int pin_cs; /* simple gpio cs */
18 unsigned int num_cs; /* total chipselects */
19 int bus_num; /* bus number to use. */
20
21 unsigned int use_fiq:1; /* use fiq */
22
23 void (*gpio_setup)(struct s3c2410_spi_info *spi, int enable);
24 void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol);
25};
26
27/* Standard setup / suspend routines for SPI GPIO pins. */
28
29extern void s3c24xx_spi_gpiocfg_bus0_gpe11_12_13(struct s3c2410_spi_info *spi,
30 int enable);
31
32extern void s3c24xx_spi_gpiocfg_bus1_gpg5_6_7(struct s3c2410_spi_info *spi,
33 int enable);
34
35extern void s3c24xx_spi_gpiocfg_bus1_gpd8_9_10(struct s3c2410_spi_info *spi,
36 int enable);
37
38#endif /* __ASM_ARCH_SPI_H */
diff --git a/arch/arm/mach-s3c2410/usb-simtec.h b/arch/arm/mach-s3c2410/usb-simtec.h
deleted file mode 100644
index 03842ede9e7..00000000000
--- a/arch/arm/mach-s3c2410/usb-simtec.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/* linux/arch/arm/mach-s3c2410/usb-simtec.h
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * http://www.simtec.co.uk/products/EB2410ITX/
7 *
8 * Simtec BAST and Thorcom VR1000 USB port support functions
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13*/
14
15extern int usb_simtec_init(void);
16
diff --git a/arch/arm/mach-s3c2412/Kconfig b/arch/arm/mach-s3c2412/Kconfig
index b8b9029e9f2..c5256f4e90b 100644
--- a/arch/arm/mach-s3c2412/Kconfig
+++ b/arch/arm/mach-s3c2412/Kconfig
@@ -2,41 +2,6 @@
2# 2#
3# Licensed under GPLv2 3# Licensed under GPLv2
4 4
5config CPU_S3C2412
6 bool
7 depends on ARCH_S3C2410
8 select CPU_ARM926T
9 select CPU_LLSERIAL_S3C2440
10 select S3C2412_PM if PM
11 select S3C2412_DMA if S3C2410_DMA
12 help
13 Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line
14
15config CPU_S3C2412_ONLY
16 bool
17 depends on ARCH_S3C2410 && !CPU_S3C2410 && \
18 !CPU_S3C2416 && !CPU_S3C2440 && !CPU_S3C2442 && \
19 !CPU_S3C2443 && CPU_S3C2412
20 default y if CPU_S3C2412
21
22config S3C2412_DMA
23 bool
24 depends on CPU_S3C2412
25 help
26 Internal config node for S3C2412 DMA support
27
28config S3C2412_PM
29 bool
30 select S3C2412_PM_SLEEP
31 help
32 Internal config node to apply S3C2412 power management
33
34config S3C2412_PM_SLEEP
35 bool
36 help
37 Internal config node to apply sleep for S3C2412 power management.
38 Can be selected by another SoCs with similar sleep procedure.
39
40# Note, the S3C2412 IOtiming support is in plat-s3c24xx 5# Note, the S3C2412 IOtiming support is in plat-s3c24xx
41 6
42config S3C2412_CPUFREQ 7config S3C2412_CPUFREQ
@@ -46,53 +11,3 @@ config S3C2412_CPUFREQ
46 default y 11 default y
47 help 12 help
48 CPU Frequency scaling support for S3C2412 and S3C2413 SoC CPUs. 13 CPU Frequency scaling support for S3C2412 and S3C2413 SoC CPUs.
49
50menu "S3C2412 Machines"
51
52config MACH_JIVE
53 bool "Logitech Jive"
54 select CPU_S3C2412
55 select S3C_DEV_USB_HOST
56 select S3C_DEV_NAND
57 help
58 Say Y here if you are using the Logitech Jive.
59
60config MACH_JIVE_SHOW_BOOTLOADER
61 bool "Allow access to bootloader partitions in MTD (EXPERIMENTAL)"
62 depends on MACH_JIVE && EXPERIMENTAL
63
64config MACH_SMDK2413
65 bool "SMDK2413"
66 select CPU_S3C2412
67 select MACH_S3C2413
68 select MACH_SMDK
69 select S3C_DEV_USB_HOST
70 select S3C_DEV_NAND
71 help
72 Say Y here if you are using an SMDK2413
73
74config MACH_S3C2413
75 bool
76 help
77 Internal node for S3C2413 version of SMDK2413, so that
78 machine_is_s3c2413() will work when MACH_SMDK2413 is
79 selected
80
81config MACH_SMDK2412
82 bool "SMDK2412"
83 select MACH_SMDK2413
84 help
85 Say Y here if you are using an SMDK2412
86
87 Note, this shares support with SMDK2413, so will automatically
88 select MACH_SMDK2413.
89
90config MACH_VSTMS
91 bool "VMSTMS"
92 select CPU_S3C2412
93 select S3C_DEV_USB_HOST
94 select S3C_DEV_NAND
95 help
96 Say Y here if you are using an VSTMS board
97
98endmenu
diff --git a/arch/arm/mach-s3c2412/Makefile b/arch/arm/mach-s3c2412/Makefile
index 7e4d95fa8a9..41a6c279fb2 100644
--- a/arch/arm/mach-s3c2412/Makefile
+++ b/arch/arm/mach-s3c2412/Makefile
@@ -9,16 +9,4 @@ obj-m :=
9obj-n := 9obj-n :=
10obj- := 10obj- :=
11 11
12obj-$(CONFIG_CPU_S3C2412) += s3c2412.o
13obj-$(CONFIG_CPU_S3C2412) += irq.o
14obj-$(CONFIG_CPU_S3C2412) += clock.o
15obj-$(CONFIG_S3C2412_DMA) += dma.o
16obj-$(CONFIG_S3C2412_PM) += pm.o
17obj-$(CONFIG_S3C2412_PM_SLEEP) += sleep.o
18obj-$(CONFIG_S3C2412_CPUFREQ) += cpu-freq.o 12obj-$(CONFIG_S3C2412_CPUFREQ) += cpu-freq.o
19
20# Machine support
21
22obj-$(CONFIG_MACH_JIVE) += mach-jive.o
23obj-$(CONFIG_MACH_SMDK2413) += mach-smdk2413.o
24obj-$(CONFIG_MACH_VSTMS) += mach-vstms.o
diff --git a/arch/arm/mach-s3c2416/Kconfig b/arch/arm/mach-s3c2416/Kconfig
deleted file mode 100644
index 84c7b03e5a3..00000000000
--- a/arch/arm/mach-s3c2416/Kconfig
+++ /dev/null
@@ -1,60 +0,0 @@
1# arch/arm/mach-s3c2416/Kconfig
2#
3# Copyright 2009 Yauhen Kharuzhy <jekhor@gmail.com>
4#
5# Licensed under GPLv2
6
7# note, this also supports the S3C2450 which is so similar it has the same
8# ID code as the S3C2416.
9
10config CPU_S3C2416
11 bool
12 depends on ARCH_S3C2410
13 select CPU_ARM926T
14 select S3C2416_DMA if S3C2410_DMA
15 select CPU_LLSERIAL_S3C2440
16 select SAMSUNG_CLKSRC
17 select S3C2443_CLOCK
18 help
19 Support for the S3C2416 SoC from the S3C24XX line
20
21config S3C2416_DMA
22 bool
23 depends on CPU_S3C2416
24 help
25 Internal config node for S3C2416 DMA support
26
27config S3C2416_PM
28 bool
29 select S3C2412_PM_SLEEP
30 help
31 Internal config node to apply S3C2416 power management
32
33config S3C2416_SETUP_SDHCI
34 bool
35 select S3C2416_SETUP_SDHCI_GPIO
36 help
37 Internal helper functions for S3C2416 based SDHCI systems
38
39config S3C2416_SETUP_SDHCI_GPIO
40 bool
41 help
42 Common setup code for SDHCI gpio.
43
44menu "S3C2416 Machines"
45
46config MACH_SMDK2416
47 bool "SMDK2416"
48 select CPU_S3C2416
49 select MACH_SMDK
50 select S3C_DEV_FB
51 select S3C_DEV_HSMMC
52 select S3C_DEV_HSMMC1
53 select S3C_DEV_NAND
54 select S3C_DEV_USB_HOST
55 select S3C2416_SETUP_SDHCI
56 select S3C2416_PM if PM
57 help
58 Say Y here if you are using an SMDK2416
59
60endmenu
diff --git a/arch/arm/mach-s3c2416/Makefile b/arch/arm/mach-s3c2416/Makefile
deleted file mode 100644
index ca0cd227f87..00000000000
--- a/arch/arm/mach-s3c2416/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
1# arch/arm/mach-s3c2416/Makefile
2#
3# Copyright 2009 Yauhen Kharuzhy <jekhor@gmail.com>
4#
5# Licensed under GPLv2
6
7obj-y :=
8obj-m :=
9obj-n :=
10obj- :=
11
12obj-$(CONFIG_CPU_S3C2416) += s3c2416.o clock.o
13obj-$(CONFIG_CPU_S3C2416) += irq.o
14obj-$(CONFIG_S3C2416_PM) += pm.o
15#obj-$(CONFIG_S3C2416_DMA) += dma.o
16
17# Device setup
18obj-$(CONFIG_S3C2416_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
19
20# Machine support
21
22obj-$(CONFIG_MACH_SMDK2416) += mach-smdk2416.o
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig
index 914e620f125..ece7a10fe3c 100644
--- a/arch/arm/mach-s3c2440/Kconfig
+++ b/arch/arm/mach-s3c2440/Kconfig
@@ -2,35 +2,6 @@
2# 2#
3# Licensed under GPLv2 3# Licensed under GPLv2
4 4
5config CPU_S3C2440
6 bool
7 select CPU_ARM920T
8 select S3C2410_CLOCK
9 select S3C2410_PM if PM
10 select S3C2440_DMA if S3C2410_DMA
11 select CPU_S3C244X
12 select CPU_LLSERIAL_S3C2440
13 help
14 Support for S3C2440 Samsung Mobile CPU based systems.
15
16config CPU_S3C2442
17 bool
18 select CPU_ARM920T
19 select S3C2410_CLOCK
20 select S3C2410_PM if PM
21 select CPU_S3C244X
22 select CPU_LLSERIAL_S3C2440
23 help
24 Support for S3C2442 Samsung Mobile CPU based systems.
25
26config CPU_S3C244X
27 bool
28 depends on CPU_S3C2440 || CPU_S3C2442
29 help
30 Support for S3C2440 and S3C2442 Samsung Mobile CPU based systems.
31
32
33
34config S3C2440_CPUFREQ 5config S3C2440_CPUFREQ
35 bool "S3C2440/S3C2442 CPU Frequency scaling support" 6 bool "S3C2440/S3C2442 CPU Frequency scaling support"
36 depends on CPU_FREQ_S3C24XX && (CPU_S3C2440 || CPU_S3C2442) 7 depends on CPU_FREQ_S3C24XX && (CPU_S3C2440 || CPU_S3C2442)
@@ -64,139 +35,3 @@ config S3C2440_PLL_16934400
64 default y if CPU_FREQ_S3C24XX_PLL 35 default y if CPU_FREQ_S3C24XX_PLL
65 help 36 help
66 PLL tables for S3C2440 or S3C2442 CPUs with 16.934MHz crystals. 37 PLL tables for S3C2440 or S3C2442 CPUs with 16.934MHz crystals.
67
68config S3C2440_DMA
69 bool
70 depends on CPU_S3C2440
71 help
72 Support for S3C2440 specific DMA code5A
73
74menu "S3C2440 and S3C2442 Machines"
75
76config MACH_ANUBIS
77 bool "Simtec Electronics ANUBIS"
78 select CPU_S3C2440
79 select S3C24XX_DCLK
80 select PM_SIMTEC if PM
81 select HAVE_PATA_PLATFORM
82 select S3C24XX_GPIO_EXTRA64
83 select S3C2440_XTAL_12000000
84 select S3C_DEV_USB_HOST
85 help
86 Say Y here if you are using the Simtec Electronics ANUBIS
87 development system
88
89config MACH_NEO1973_GTA02
90 bool "Openmoko GTA02 / Freerunner phone"
91 select CPU_S3C2442
92 select MFD_PCF50633
93 select PCF50633_GPIO
94 select I2C
95 select POWER_SUPPLY
96 select MACH_NEO1973
97 select S3C2410_PWM
98 select S3C_DEV_USB_HOST
99 help
100 Say Y here if you are using the Openmoko GTA02 / Freerunner GSM Phone
101
102config MACH_OSIRIS
103 bool "Simtec IM2440D20 (OSIRIS) module"
104 select CPU_S3C2440
105 select S3C24XX_DCLK
106 select PM_SIMTEC if PM
107 select S3C24XX_GPIO_EXTRA128
108 select S3C2440_XTAL_12000000
109 select S3C2410_IOTIMING if S3C2440_CPUFREQ
110 select S3C_DEV_USB_HOST
111 select S3C_DEV_NAND
112 help
113 Say Y here if you are using the Simtec IM2440D20 module, also
114 known as the Osiris.
115
116config MACH_OSIRIS_DVS
117 tristate "Simtec IM2440D20 (OSIRIS) Dynamic Voltage Scaling driver"
118 depends on MACH_OSIRIS
119 select TPS65010
120 help
121 Say Y/M here if you want to have dynamic voltage scaling support
122 on the Simtec IM2440D20 (OSIRIS) module via the TPS65011.
123
124 The DVS driver alters the voltage supplied to the ARM core
125 depending on the frequency it is running at. The driver itself
126 does not do any of the frequency alteration, which is left up
127 to the cpufreq driver.
128
129config MACH_RX3715
130 bool "HP iPAQ rx3715"
131 select CPU_S3C2440
132 select S3C2440_XTAL_16934400
133 select PM_H1940 if PM
134 select S3C_DEV_NAND
135 help
136 Say Y here if you are using the HP iPAQ rx3715.
137
138config ARCH_S3C2440
139 bool "SMDK2440"
140 select CPU_S3C2440
141 select S3C2440_XTAL_16934400
142 select MACH_SMDK
143 select S3C_DEV_USB_HOST
144 select S3C_DEV_NAND
145 help
146 Say Y here if you are using the SMDK2440.
147
148config MACH_NEXCODER_2440
149 bool "NexVision NEXCODER 2440 Light Board"
150 select CPU_S3C2440
151 select S3C2440_XTAL_12000000
152 select S3C_DEV_USB_HOST
153 select S3C_DEV_NAND
154 help
155 Say Y here if you are using the Nex Vision NEXCODER 2440 Light Board
156
157config SMDK2440_CPU2440
158 bool "SMDK2440 with S3C2440 CPU module"
159 default y if ARCH_S3C2440
160 select S3C2440_XTAL_16934400
161 select CPU_S3C2440
162
163config SMDK2440_CPU2442
164 bool "SMDM2440 with S3C2442 CPU module"
165 select CPU_S3C2442
166
167config MACH_AT2440EVB
168 bool "Avantech AT2440EVB development board"
169 select CPU_S3C2440
170 select S3C_DEV_USB_HOST
171 select S3C_DEV_NAND
172 help
173 Say Y here if you are using the AT2440EVB development board
174
175config MACH_MINI2440
176 bool "MINI2440 development board"
177 select CPU_S3C2440
178 select EEPROM_AT24
179 select NEW_LEDS
180 select LEDS_CLASS
181 select LEDS_TRIGGER
182 select LEDS_TRIGGER_BACKLIGHT
183 select S3C_DEV_NAND
184 select S3C_DEV_USB_HOST
185 help
186 Say Y here to select support for the MINI2440. Is a 10cm x 10cm board
187 available via various sources. It can come with a 3.5" or 7" touch LCD.
188
189config MACH_RX1950
190 bool "HP iPAQ rx1950"
191 select CPU_S3C2442
192 select S3C24XX_DCLK
193 select PM_H1940 if PM
194 select I2C
195 select S3C2410_PWM
196 select S3C_DEV_NAND
197 select S3C2410_IOTIMING if S3C2440_CPUFREQ
198 select S3C2440_XTAL_16934400
199 help
200 Say Y here if you're using HP iPAQ rx1950
201
202endmenu
diff --git a/arch/arm/mach-s3c2440/Makefile b/arch/arm/mach-s3c2440/Makefile
index d5440fa34b0..c4609243981 100644
--- a/arch/arm/mach-s3c2440/Makefile
+++ b/arch/arm/mach-s3c2440/Makefile
@@ -9,33 +9,9 @@ obj-m :=
9obj-n := 9obj-n :=
10obj- := 10obj- :=
11 11
12obj-$(CONFIG_CPU_S3C2440) += s3c2440.o dsc.o 12obj-$(CONFIG_CPU_S3C2440) += dsc.o
13obj-$(CONFIG_CPU_S3C2442) += s3c2442.o
14 13
15obj-$(CONFIG_CPU_S3C2440) += irq.o
16obj-$(CONFIG_CPU_S3C2440) += clock.o
17obj-$(CONFIG_S3C2440_DMA) += dma.o
18
19obj-$(CONFIG_CPU_S3C244X) += s3c244x.o
20obj-$(CONFIG_CPU_S3C244X) += s3c244x-irq.o
21obj-$(CONFIG_CPU_S3C244X) += s3c244x-clock.o
22obj-$(CONFIG_S3C2440_CPUFREQ) += s3c2440-cpufreq.o 14obj-$(CONFIG_S3C2440_CPUFREQ) += s3c2440-cpufreq.o
23 15
24obj-$(CONFIG_S3C2440_PLL_12000000) += s3c2440-pll-12000000.o 16obj-$(CONFIG_S3C2440_PLL_12000000) += s3c2440-pll-12000000.o
25obj-$(CONFIG_S3C2440_PLL_16934400) += s3c2440-pll-16934400.o 17obj-$(CONFIG_S3C2440_PLL_16934400) += s3c2440-pll-16934400.o
26
27# Machine support
28
29obj-$(CONFIG_MACH_ANUBIS) += mach-anubis.o
30obj-$(CONFIG_MACH_OSIRIS) += mach-osiris.o
31obj-$(CONFIG_MACH_RX3715) += mach-rx3715.o
32obj-$(CONFIG_ARCH_S3C2440) += mach-smdk2440.o
33obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
34obj-$(CONFIG_MACH_AT2440EVB) += mach-at2440evb.o
35obj-$(CONFIG_MACH_MINI2440) += mach-mini2440.o
36obj-$(CONFIG_MACH_NEO1973_GTA02) += mach-gta02.o
37obj-$(CONFIG_MACH_RX1950) += mach-rx1950.o
38
39# extra machine support
40
41obj-$(CONFIG_MACH_OSIRIS_DVS) += mach-osiris-dvs.o
diff --git a/arch/arm/mach-s3c2440/common.h b/arch/arm/mach-s3c2440/common.h
deleted file mode 100644
index db8a98ac68c..00000000000
--- a/arch/arm/mach-s3c2440/common.h
+++ /dev/null
@@ -1,17 +0,0 @@
1/*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
3 * http://www.samsung.com
4 *
5 * Common Header for S3C2440 machines
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 */
11
12#ifndef __ARCH_ARM_MACH_S3C2440_COMMON_H
13#define __ARCH_ARM_MACH_S3C2440_COMMON_H
14
15void s3c2440_restart(char mode, const char *cmd);
16
17#endif /* __ARCH_ARM_MACH_S3C2440_COMMON_H */
diff --git a/arch/arm/mach-s3c2443/Kconfig b/arch/arm/mach-s3c2443/Kconfig
deleted file mode 100644
index 8814031516c..00000000000
--- a/arch/arm/mach-s3c2443/Kconfig
+++ /dev/null
@@ -1,32 +0,0 @@
1# Copyright 2007 Simtec Electronics
2#
3# Licensed under GPLv2
4
5config CPU_S3C2443
6 bool
7 depends on ARCH_S3C2410
8 select CPU_ARM920T
9 select S3C2443_DMA if S3C2410_DMA
10 select CPU_LLSERIAL_S3C2440
11 select SAMSUNG_CLKSRC
12 select S3C2443_CLOCK
13 help
14 Support for the S3C2443 SoC from the S3C24XX line
15
16config S3C2443_DMA
17 bool
18 depends on CPU_S3C2443
19 help
20 Internal config node for S3C2443 DMA support
21
22menu "S3C2443 Machines"
23
24config MACH_SMDK2443
25 bool "SMDK2443"
26 select CPU_S3C2443
27 select MACH_SMDK
28 select S3C_DEV_HSMMC1
29 help
30 Say Y here if you are using an SMDK2443
31
32endmenu
diff --git a/arch/arm/mach-s3c2443/Makefile b/arch/arm/mach-s3c2443/Makefile
deleted file mode 100644
index d1843c9eb8b..00000000000
--- a/arch/arm/mach-s3c2443/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
1# arch/arm/mach-s3c2443/Makefile
2#
3# Copyright 2007 Simtec Electronics
4#
5# Licensed under GPLv2
6
7obj-y :=
8obj-m :=
9obj-n :=
10obj- :=
11
12obj-$(CONFIG_CPU_S3C2443) += s3c2443.o
13obj-$(CONFIG_CPU_S3C2443) += irq.o
14obj-$(CONFIG_CPU_S3C2443) += clock.o
15
16obj-$(CONFIG_S3C2443_DMA) += dma.o
17
18# Machine support
19
20obj-$(CONFIG_MACH_SMDK2443) += mach-smdk2443.o
diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig
new file mode 100644
index 00000000000..0f3a327ebca
--- /dev/null
+++ b/arch/arm/mach-s3c24xx/Kconfig
@@ -0,0 +1,538 @@
1# arch/arm/mach-s3c24xx/Kconfig
2#
3# Copyright (c) 2012 Samsung Electronics Co., Ltd.
4# http://www.samsung.com/
5#
6# Copyright 2007 Simtec Electronics
7#
8# Licensed under GPLv2
9
10if ARCH_S3C24XX
11
12menu "SAMSUNG S3C24XX SoCs Support"
13
14comment "S3C24XX SoCs"
15
16config CPU_S3C2410
17 bool "SAMSUNG S3C2410"
18 default y
19 select CPU_ARM920T
20 select S3C2410_CLOCK
21 select CPU_LLSERIAL_S3C2410
22 select S3C2410_PM if PM
23 select S3C2410_CPUFREQ if CPU_FREQ_S3C24XX
24 help
25 Support for S3C2410 and S3C2410A family from the S3C24XX line
26 of Samsung Mobile CPUs.
27
28config CPU_S3C2412
29 bool "SAMSUNG S3C2412"
30 depends on ARCH_S3C24XX
31 select CPU_ARM926T
32 select CPU_LLSERIAL_S3C2440
33 select S3C2412_PM if PM
34 select S3C2412_DMA if S3C24XX_DMA
35 help
36 Support for the S3C2412 and S3C2413 SoCs from the S3C24XX line
37
38config CPU_S3C2416
39 bool "SAMSUNG S3C2416/S3C2450"
40 depends on ARCH_S3C24XX
41 select CPU_ARM926T
42 select CPU_LLSERIAL_S3C2440
43 select SAMSUNG_CLKSRC
44 select S3C2443_COMMON
45 select S3C2443_DMA if S3C24XX_DMA
46 select S3C2416_PM if PM
47 help
48 Support for the S3C2416 SoC from the S3C24XX line
49
50config CPU_S3C2440
51 bool "SAMSUNG S3C2440"
52 select CPU_ARM920T
53 select CPU_LLSERIAL_S3C2440
54 select S3C2410_CLOCK
55 select S3C2410_PM if PM
56 select S3C2440_DMA if S3C24XX_DMA
57 help
58 Support for S3C2440 Samsung Mobile CPU based systems.
59
60config CPU_S3C2442
61 bool "SAMSUNG S3C2442"
62 select CPU_ARM920T
63 select CPU_LLSERIAL_S3C2440
64 select S3C2410_CLOCK
65 select S3C2410_PM if PM
66 help
67 Support for S3C2442 Samsung Mobile CPU based systems.
68
69config CPU_S3C244X
70 def_bool y
71 depends on CPU_S3C2440 || CPU_S3C2442
72
73config CPU_S3C2443
74 bool "SAMSUNG S3C2443"
75 depends on ARCH_S3C24XX
76 select CPU_ARM920T
77 select CPU_LLSERIAL_S3C2440
78 select SAMSUNG_CLKSRC
79 select S3C2443_COMMON
80 select S3C2443_DMA if S3C24XX_DMA
81 help
82 Support for the S3C2443 SoC from the S3C24XX line
83
84# common code
85
86config S3C24XX_SMDK
87 bool
88 help
89 Common machine code for SMDK2410 and SMDK2440
90
91config S3C24XX_SIMTEC_AUDIO
92 bool
93 depends on (ARCH_BAST || MACH_VR1000 || MACH_OSIRIS || MACH_ANUBIS)
94 default y
95 help
96 Add audio devices for common Simtec S3C24XX boards
97
98config S3C24XX_SIMTEC_PM
99 bool
100 help
101 Common power management code for systems that are
102 compatible with the Simtec style of power management
103
104config S3C24XX_SIMTEC_USB
105 bool
106 help
107 USB management code for common Simtec S3C24XX boards
108
109config S3C24XX_SETUP_TS
110 bool
111 help
112 Compile in platform device definition for Samsung TouchScreen.
113
114# cpu-specific sections
115
116if CPU_S3C2410
117
118config S3C2410_DMA
119 bool
120 depends on S3C24XX_DMA && (CPU_S3C2410 || CPU_S3C2442)
121 default y if CPU_S3C2410 || CPU_S3C2442
122 help
123 DMA device selection for S3C2410 and compatible CPUs
124
125config S3C2410_PM
126 bool
127 help
128 Power Management code common to S3C2410 and better
129
130config S3C24XX_SIMTEC_NOR
131 bool
132 help
133 Internal node to specify machine has simtec NOR mapping
134
135config MACH_BAST_IDE
136 bool
137 select HAVE_PATA_PLATFORM
138 help
139 Internal node for machines with an BAST style IDE
140 interface
141
142comment "S3C2410 Boards"
143
144#
145# The "S3C2410 Boards" list is ordered alphabetically by option text.
146# (without ARCH_ or MACH_)
147#
148
149config MACH_AML_M5900
150 bool "AML M5900 Series"
151 select S3C24XX_SIMTEC_PM if PM
152 select S3C_DEV_USB_HOST
153 help
154 Say Y here if you are using the American Microsystems M5900 Series
155 <http://www.amltd.com>
156
157config ARCH_BAST
158 bool "Simtec Electronics BAST (EB2410ITX)"
159 select S3C2410_IOTIMING if S3C2410_CPUFREQ
160 select S3C24XX_SIMTEC_PM if PM
161 select S3C24XX_SIMTEC_NOR
162 select S3C24XX_SIMTEC_USB
163 select MACH_BAST_IDE
164 select S3C24XX_DCLK
165 select ISA
166 select S3C_DEV_HWMON
167 select S3C_DEV_USB_HOST
168 select S3C_DEV_NAND
169 help
170 Say Y here if you are using the Simtec Electronics EB2410ITX
171 development board (also known as BAST)
172
173config BAST_PC104_IRQ
174 bool "BAST PC104 IRQ support"
175 depends on ARCH_BAST
176 default y
177 help
178 Say Y here to enable the PC104 IRQ routing on the
179 Simtec BAST (EB2410ITX)
180
181config ARCH_H1940
182 bool "IPAQ H1940"
183 select PM_H1940 if PM
184 select S3C_DEV_USB_HOST
185 select S3C_DEV_NAND
186 select S3C24XX_SETUP_TS
187 help
188 Say Y here if you are using the HP IPAQ H1940
189
190config H1940BT
191 tristate "Control the state of H1940 bluetooth chip"
192 depends on ARCH_H1940
193 select RFKILL
194 help
195 This is a simple driver that is able to control
196 the state of built in bluetooth chip on h1940.
197
198config PM_H1940
199 bool
200 help
201 Internal node for H1940 and related PM
202
203config MACH_N30
204 bool "Acer N30 family"
205 select MACH_N35
206 select S3C_DEV_USB_HOST
207 select S3C_DEV_NAND
208 help
209 Say Y here if you want suppt for the Acer N30, Acer N35,
210 Navman PiN570, Yakumo AlphaX or Airis NC05 PDAs.
211
212config MACH_OTOM
213 bool "NexVision OTOM Board"
214 select S3C_DEV_USB_HOST
215 select S3C_DEV_NAND
216 help
217 Say Y here if you are using the Nex Vision OTOM board
218
219config MACH_QT2410
220 bool "QT2410"
221 select S3C_DEV_USB_HOST
222 select S3C_DEV_NAND
223 help
224 Say Y here if you are using the Armzone QT2410
225
226config ARCH_SMDK2410
227 bool "SMDK2410/A9M2410"
228 select S3C24XX_SMDK
229 help
230 Say Y here if you are using the SMDK2410 or the derived module A9M2410
231 <http://www.fsforth.de>
232
233config MACH_TCT_HAMMER
234 bool "TCT Hammer Board"
235 select S3C_DEV_USB_HOST
236 help
237 Say Y here if you are using the TinCanTools Hammer Board
238 <http://www.tincantools.com>
239
240config MACH_VR1000
241 bool "Thorcom VR1000"
242 select S3C24XX_SIMTEC_PM if PM
243 select S3C24XX_DCLK
244 select S3C24XX_SIMTEC_NOR
245 select MACH_BAST_IDE
246 select S3C_DEV_USB_HOST
247 select S3C24XX_SIMTEC_USB
248 help
249 Say Y here if you are using the Thorcom VR1000 board.
250
251endif # CPU_S3C2410
252
253config S3C2412_PM_SLEEP
254 bool
255 help
256 Internal config node to apply sleep for S3C2412 power management.
257 Can be selected by another SoCs such as S3C2416 with similar
258 sleep procedure.
259
260if CPU_S3C2412
261
262config CPU_S3C2412_ONLY
263 bool
264 depends on ARCH_S3C24XX && !CPU_S3C2410 && \
265 !CPU_S3C2416 && !CPU_S3C2440 && !CPU_S3C2442 && \
266 !CPU_S3C2443 && CPU_S3C2412
267 default y
268
269config S3C2412_DMA
270 bool
271 help
272 Internal config node for S3C2412 DMA support
273
274config S3C2412_PM
275 bool
276 help
277 Internal config node to apply S3C2412 power management
278
279comment "S3C2412 Boards"
280
281#
282# The "S3C2412 Boards" list is ordered alphabetically by option text.
283# (without ARCH_ or MACH_)
284#
285
286config MACH_JIVE
287 bool "Logitech Jive"
288 select S3C_DEV_USB_HOST
289 select S3C_DEV_NAND
290 help
291 Say Y here if you are using the Logitech Jive.
292
293config MACH_JIVE_SHOW_BOOTLOADER
294 bool "Allow access to bootloader partitions in MTD (EXPERIMENTAL)"
295 depends on MACH_JIVE && EXPERIMENTAL
296
297config MACH_S3C2413
298 bool
299 help
300 Internal node for S3C2413 version of SMDK2413, so that
301 machine_is_s3c2413() will work when MACH_SMDK2413 is
302 selected
303
304config MACH_SMDK2412
305 bool "SMDK2412"
306 select MACH_SMDK2413
307 help
308 Say Y here if you are using an SMDK2412
309
310 Note, this shares support with SMDK2413, so will automatically
311 select MACH_SMDK2413.
312
313config MACH_SMDK2413
314 bool "SMDK2413"
315 select MACH_S3C2413
316 select S3C24XX_SMDK
317 select S3C_DEV_USB_HOST
318 select S3C_DEV_NAND
319 help
320 Say Y here if you are using an SMDK2413
321
322config MACH_VSTMS
323 bool "VMSTMS"
324 select S3C_DEV_USB_HOST
325 select S3C_DEV_NAND
326 help
327 Say Y here if you are using an VSTMS board
328
329endif # CPU_S3C2412
330
331if CPU_S3C2416
332
333config S3C2416_PM
334 bool
335 select S3C2412_PM_SLEEP
336 help
337 Internal config node to apply S3C2416 power management
338
339config S3C2416_SETUP_SDHCI
340 bool
341 select S3C2416_SETUP_SDHCI_GPIO
342 help
343 Internal helper functions for S3C2416 based SDHCI systems
344
345config S3C2416_SETUP_SDHCI_GPIO
346 bool
347 help
348 Common setup code for SDHCI gpio.
349
350comment "S3C2416 Boards"
351
352config MACH_SMDK2416
353 bool "SMDK2416"
354 select S3C24XX_SMDK
355 select S3C_DEV_FB
356 select S3C_DEV_HSMMC
357 select S3C_DEV_HSMMC1
358 select S3C_DEV_NAND
359 select S3C_DEV_USB_HOST
360 select S3C2416_SETUP_SDHCI
361 help
362 Say Y here if you are using an SMDK2416
363
364endif # CPU_S3C2416
365
366if CPU_S3C2440
367
368config S3C2440_DMA
369 bool
370 help
371 Support for S3C2440 specific DMA code5A
372
373comment "S3C2440 Boards"
374
375#
376# The "S3C2440 Boards" list is ordered alphabetically by option text.
377# (without ARCH_ or MACH_)
378#
379
380config MACH_ANUBIS
381 bool "Simtec Electronics ANUBIS"
382 select S3C24XX_DCLK
383 select S3C24XX_SIMTEC_PM if PM
384 select HAVE_PATA_PLATFORM
385 select S3C24XX_GPIO_EXTRA64
386 select S3C2440_XTAL_12000000
387 select S3C_DEV_USB_HOST
388 help
389 Say Y here if you are using the Simtec Electronics ANUBIS
390 development system
391
392config MACH_AT2440EVB
393 bool "Avantech AT2440EVB development board"
394 select S3C_DEV_USB_HOST
395 select S3C_DEV_NAND
396 help
397 Say Y here if you are using the AT2440EVB development board
398
399config MACH_MINI2440
400 bool "MINI2440 development board"
401 select EEPROM_AT24
402 select NEW_LEDS
403 select LEDS_CLASS
404 select LEDS_TRIGGER
405 select LEDS_TRIGGER_BACKLIGHT
406 select S3C_DEV_NAND
407 select S3C_DEV_USB_HOST
408 help
409 Say Y here to select support for the MINI2440. Is a 10cm x 10cm board
410 available via various sources. It can come with a 3.5" or 7" touch LCD.
411
412config MACH_NEXCODER_2440
413 bool "NexVision NEXCODER 2440 Light Board"
414 select S3C2440_XTAL_12000000
415 select S3C_DEV_USB_HOST
416 select S3C_DEV_NAND
417 help
418 Say Y here if you are using the Nex Vision NEXCODER 2440 Light Board
419
420config MACH_OSIRIS
421 bool "Simtec IM2440D20 (OSIRIS) module"
422 select S3C24XX_DCLK
423 select S3C24XX_SIMTEC_PM if PM
424 select S3C24XX_GPIO_EXTRA128
425 select S3C2440_XTAL_12000000
426 select S3C2410_IOTIMING if S3C2440_CPUFREQ
427 select S3C_DEV_USB_HOST
428 select S3C_DEV_NAND
429 help
430 Say Y here if you are using the Simtec IM2440D20 module, also
431 known as the Osiris.
432
433config MACH_OSIRIS_DVS
434 tristate "Simtec IM2440D20 (OSIRIS) Dynamic Voltage Scaling driver"
435 depends on MACH_OSIRIS
436 select TPS65010
437 help
438 Say Y/M here if you want to have dynamic voltage scaling support
439 on the Simtec IM2440D20 (OSIRIS) module via the TPS65011.
440
441 The DVS driver alters the voltage supplied to the ARM core
442 depending on the frequency it is running at. The driver itself
443 does not do any of the frequency alteration, which is left up
444 to the cpufreq driver.
445
446config MACH_RX3715
447 bool "HP iPAQ rx3715"
448 select S3C2440_XTAL_16934400
449 select PM_H1940 if PM
450 select S3C_DEV_NAND
451 help
452 Say Y here if you are using the HP iPAQ rx3715.
453
454config ARCH_S3C2440
455 bool "SMDK2440"
456 select S3C2440_XTAL_16934400
457 select S3C24XX_SMDK
458 select S3C_DEV_USB_HOST
459 select S3C_DEV_NAND
460 help
461 Say Y here if you are using the SMDK2440.
462
463config SMDK2440_CPU2440
464 bool "SMDK2440 with S3C2440 CPU module"
465 default y if ARCH_S3C2440
466 select S3C2440_XTAL_16934400
467
468endif # CPU_S3C2440
469
470if CPU_S3C2442
471
472comment "S3C2442 Boards"
473
474#
475# The "S3C2442 Boards" list is ordered alphabetically by option text.
476# (without ARCH_ or MACH_)
477#
478
479config MACH_NEO1973_GTA02
480 bool "Openmoko GTA02 / Freerunner phone"
481 select MFD_PCF50633
482 select PCF50633_GPIO
483 select I2C
484 select POWER_SUPPLY
485 select MACH_NEO1973
486 select S3C2410_PWM
487 select S3C_DEV_USB_HOST
488 help
489 Say Y here if you are using the Openmoko GTA02 / Freerunner GSM Phone
490
491config MACH_RX1950
492 bool "HP iPAQ rx1950"
493 select S3C24XX_DCLK
494 select PM_H1940 if PM
495 select I2C
496 select S3C2410_PWM
497 select S3C_DEV_NAND
498 select S3C2410_IOTIMING if S3C2440_CPUFREQ
499 select S3C2440_XTAL_16934400
500 help
501 Say Y here if you're using HP iPAQ rx1950
502
503config SMDK2440_CPU2442
504 bool "SMDM2440 with S3C2442 CPU module"
505
506endif # CPU_S3C2440
507
508if CPU_S3C2443 || CPU_S3C2416
509
510config S3C2443_COMMON
511 bool
512 help
513 Common code for the S3C2443 and similar processors, which includes
514 the S3C2416 and S3C2450.
515
516config S3C2443_DMA
517 bool
518 help
519 Internal config node for S3C2443 DMA support
520
521endif # CPU_S3C2443 || CPU_S3C2416
522
523if CPU_S3C2443
524
525comment "S3C2443 Boards"
526
527config MACH_SMDK2443
528 bool "SMDK2443"
529 select S3C24XX_SMDK
530 select S3C_DEV_HSMMC1
531 help
532 Say Y here if you are using an SMDK2443
533
534endif # CPU_S3C2443
535
536endmenu # SAMSUNG S3C24XX SoCs Support
537
538endif # ARCH_S3C24XX
diff --git a/arch/arm/mach-s3c24xx/Makefile b/arch/arm/mach-s3c24xx/Makefile
new file mode 100644
index 00000000000..3518fe812d5
--- /dev/null
+++ b/arch/arm/mach-s3c24xx/Makefile
@@ -0,0 +1,95 @@
1# arch/arm/mach-s3c24xx/Makefile
2#
3# Copyright (c) 2012 Samsung Electronics Co., Ltd.
4# http://www.samsung.com/
5#
6# Copyright 2007 Simtec Electronics
7#
8# Licensed under GPLv2
9
10obj-y :=
11obj-m :=
12obj-n :=
13obj- :=
14
15# core
16
17obj-$(CONFIG_CPU_S3C2410) += s3c2410.o
18obj-$(CONFIG_S3C2410_DMA) += dma-s3c2410.o
19obj-$(CONFIG_S3C2410_PM) += pm-s3c2410.o sleep-s3c2410.o
20
21obj-$(CONFIG_CPU_S3C2412) += s3c2412.o irq-s3c2412.o clock-s3c2412.o
22obj-$(CONFIG_S3C2412_DMA) += dma-s3c2412.o
23obj-$(CONFIG_S3C2412_PM) += pm-s3c2412.o
24obj-$(CONFIG_S3C2412_PM_SLEEP) += sleep-s3c2412.o
25
26obj-$(CONFIG_CPU_S3C2416) += s3c2416.o irq-s3c2416.o clock-s3c2416.o
27obj-$(CONFIG_S3C2416_PM) += pm-s3c2416.o
28
29obj-$(CONFIG_CPU_S3C2440) += s3c2440.o irq-s3c2440.o clock-s3c2440.o
30obj-$(CONFIG_CPU_S3C2442) += s3c2442.o
31obj-$(CONFIG_CPU_S3C244X) += s3c244x.o irq-s3c244x.o clock-s3c244x.o
32obj-$(CONFIG_S3C2440_DMA) += dma-s3c2440.o
33
34obj-$(CONFIG_CPU_S3C2443) += s3c2443.o irq-s3c2443.o clock-s3c2443.o
35
36# common code
37
38obj-$(CONFIG_S3C2443_COMMON) += common-s3c2443.o
39obj-$(CONFIG_S3C2443_DMA) += dma-s3c2443.o
40
41#
42# machine support
43# following is ordered alphabetically by option text.
44#
45
46obj-$(CONFIG_MACH_AML_M5900) += mach-amlm5900.o
47obj-$(CONFIG_ARCH_BAST) += mach-bast.o
48obj-$(CONFIG_BAST_PC104_IRQ) += bast-irq.o
49obj-$(CONFIG_ARCH_H1940) += mach-h1940.o
50obj-$(CONFIG_H1940BT) += h1940-bluetooth.o
51obj-$(CONFIG_PM_H1940) += pm-h1940.o
52obj-$(CONFIG_MACH_N30) += mach-n30.o
53obj-$(CONFIG_MACH_OTOM) += mach-otom.o
54obj-$(CONFIG_MACH_QT2410) += mach-qt2410.o
55obj-$(CONFIG_ARCH_SMDK2410) += mach-smdk2410.o
56obj-$(CONFIG_MACH_TCT_HAMMER) += mach-tct_hammer.o
57obj-$(CONFIG_MACH_VR1000) += mach-vr1000.o
58
59obj-$(CONFIG_MACH_JIVE) += mach-jive.o
60obj-$(CONFIG_MACH_SMDK2413) += mach-smdk2413.o
61obj-$(CONFIG_MACH_VSTMS) += mach-vstms.o
62
63obj-$(CONFIG_MACH_SMDK2416) += mach-smdk2416.o
64
65obj-$(CONFIG_MACH_ANUBIS) += mach-anubis.o
66obj-$(CONFIG_MACH_AT2440EVB) += mach-at2440evb.o
67obj-$(CONFIG_MACH_MINI2440) += mach-mini2440.o
68obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
69obj-$(CONFIG_MACH_OSIRIS) += mach-osiris.o
70obj-$(CONFIG_MACH_RX3715) += mach-rx3715.o
71obj-$(CONFIG_ARCH_S3C2440) += mach-smdk2440.o
72
73obj-$(CONFIG_MACH_NEO1973_GTA02) += mach-gta02.o
74obj-$(CONFIG_MACH_RX1950) += mach-rx1950.o
75
76obj-$(CONFIG_MACH_SMDK2443) += mach-smdk2443.o
77
78# common bits of machine support
79
80obj-$(CONFIG_S3C24XX_SMDK) += common-smdk.o
81obj-$(CONFIG_S3C24XX_SIMTEC_AUDIO) += simtec-audio.o
82obj-$(CONFIG_S3C24XX_SIMTEC_NOR) += simtec-nor.o
83obj-$(CONFIG_S3C24XX_SIMTEC_PM) += simtec-pm.o
84obj-$(CONFIG_S3C24XX_SIMTEC_USB) += simtec-usb.o
85
86# machine additions
87
88obj-$(CONFIG_MACH_BAST_IDE) += bast-ide.o
89obj-$(CONFIG_MACH_OSIRIS_DVS) += mach-osiris-dvs.o
90
91# device setup
92
93obj-$(CONFIG_S3C2416_SETUP_SDHCI_GPIO) += setup-sdhci-gpio.o
94obj-$(CONFIG_ARCH_S3C24XX) += setup-i2c.o
95obj-$(CONFIG_S3C24XX_SETUP_TS) += setup-ts.o
diff --git a/arch/arm/mach-s3c2410/Makefile.boot b/arch/arm/mach-s3c24xx/Makefile.boot
index 4457605ba04..4457605ba04 100644
--- a/arch/arm/mach-s3c2410/Makefile.boot
+++ b/arch/arm/mach-s3c24xx/Makefile.boot
diff --git a/arch/arm/mach-s3c2410/bast-ide.c b/arch/arm/mach-s3c24xx/bast-ide.c
index 298ececfa36..298ececfa36 100644
--- a/arch/arm/mach-s3c2410/bast-ide.c
+++ b/arch/arm/mach-s3c24xx/bast-ide.c
diff --git a/arch/arm/mach-s3c2410/bast-irq.c b/arch/arm/mach-s3c24xx/bast-irq.c
index ac7b2ad5c40..ac7b2ad5c40 100644
--- a/arch/arm/mach-s3c2410/bast-irq.c
+++ b/arch/arm/mach-s3c24xx/bast-irq.c
diff --git a/arch/arm/mach-s3c2412/clock.c b/arch/arm/mach-s3c24xx/clock-s3c2412.c
index d10b695a906..d10b695a906 100644
--- a/arch/arm/mach-s3c2412/clock.c
+++ b/arch/arm/mach-s3c24xx/clock-s3c2412.c
diff --git a/arch/arm/mach-s3c2416/clock.c b/arch/arm/mach-s3c24xx/clock-s3c2416.c
index 59f54d1d7f8..dbc9ab4aaca 100644
--- a/arch/arm/mach-s3c2416/clock.c
+++ b/arch/arm/mach-s3c24xx/clock-s3c2416.c
@@ -15,7 +15,6 @@
15#include <linux/clk.h> 15#include <linux/clk.h>
16 16
17#include <plat/s3c2416.h> 17#include <plat/s3c2416.h>
18#include <plat/s3c2443.h>
19#include <plat/clock.h> 18#include <plat/clock.h>
20#include <plat/clock-clksrc.h> 19#include <plat/clock-clksrc.h>
21#include <plat/cpu.h> 20#include <plat/cpu.h>
@@ -132,12 +131,6 @@ static struct clk hsmmc0_clk = {
132 .ctrlbit = S3C2416_HCLKCON_HSMMC0, 131 .ctrlbit = S3C2416_HCLKCON_HSMMC0,
133}; 132};
134 133
135void __init_or_cpufreq s3c2416_setup_clocks(void)
136{
137 s3c2443_common_setup_clocks(s3c2416_get_pll);
138}
139
140
141static struct clksrc_clk *clksrcs[] __initdata = { 134static struct clksrc_clk *clksrcs[] __initdata = {
142 &hsspi_eplldiv, 135 &hsspi_eplldiv,
143 &hsspi_mux, 136 &hsspi_mux,
diff --git a/arch/arm/mach-s3c2440/clock.c b/arch/arm/mach-s3c24xx/clock-s3c2440.c
index 414364eb426..414364eb426 100644
--- a/arch/arm/mach-s3c2440/clock.c
+++ b/arch/arm/mach-s3c24xx/clock-s3c2440.c
diff --git a/arch/arm/mach-s3c2443/clock.c b/arch/arm/mach-s3c24xx/clock-s3c2443.c
index 6dde2696f8f..efb3ac35956 100644
--- a/arch/arm/mach-s3c2443/clock.c
+++ b/arch/arm/mach-s3c24xx/clock-s3c2443.c
@@ -179,11 +179,6 @@ static struct clk *clks[] __initdata = {
179 &clk_hsmmc, 179 &clk_hsmmc,
180}; 180};
181 181
182void __init_or_cpufreq s3c2443_setup_clocks(void)
183{
184 s3c2443_common_setup_clocks(s3c2443_get_mpll);
185}
186
187void __init s3c2443_init_clocks(int xtal) 182void __init s3c2443_init_clocks(int xtal)
188{ 183{
189 unsigned long epllcon = __raw_readl(S3C2443_EPLLCON); 184 unsigned long epllcon = __raw_readl(S3C2443_EPLLCON);
@@ -196,8 +191,6 @@ void __init s3c2443_init_clocks(int xtal)
196 armdiv, ARRAY_SIZE(armdiv), 191 armdiv, ARRAY_SIZE(armdiv),
197 S3C2443_CLKDIV0_ARMDIV_MASK); 192 S3C2443_CLKDIV0_ARMDIV_MASK);
198 193
199 s3c2443_setup_clocks();
200
201 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks)); 194 s3c24xx_register_clocks(clks, ARRAY_SIZE(clks));
202 195
203 for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++) 196 for (ptr = 0; ptr < ARRAY_SIZE(clksrcs); ptr++)
diff --git a/arch/arm/mach-s3c2440/s3c244x-clock.c b/arch/arm/mach-s3c24xx/clock-s3c244x.c
index 6d9b688c442..6d9b688c442 100644
--- a/arch/arm/mach-s3c2440/s3c244x-clock.c
+++ b/arch/arm/mach-s3c24xx/clock-s3c244x.c
diff --git a/arch/arm/plat-s3c24xx/s3c2443-clock.c b/arch/arm/mach-s3c24xx/common-s3c2443.c
index 95e68190d59..460431589f3 100644
--- a/arch/arm/plat-s3c24xx/s3c2443-clock.c
+++ b/arch/arm/mach-s3c24xx/common-s3c2443.c
@@ -1,9 +1,18 @@
1/* linux/arch/arm/plat-s3c24xx/s3c2443-clock.c 1/*
2 * Common code for SoCs starting with the S3C2443
2 * 3 *
3 * Copyright (c) 2007, 2010 Simtec Electronics 4 * Copyright (c) 2007, 2010 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
5 * 6 *
6 * S3C2443 Clock control suport - common code 7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
7 */ 16 */
8 17
9#include <linux/init.h> 18#include <linux/init.h>
@@ -12,7 +21,6 @@
12 21
13#include <mach/regs-s3c2443-clock.h> 22#include <mach/regs-s3c2443-clock.h>
14 23
15#include <plat/s3c2443.h>
16#include <plat/clock.h> 24#include <plat/clock.h>
17#include <plat/clock-clksrc.h> 25#include <plat/clock-clksrc.h>
18#include <plat/cpu.h> 26#include <plat/cpu.h>
@@ -53,7 +61,7 @@ int s3c2443_clkcon_enable_s(struct clk *clk, int enable)
53 * elided as the EPLL can be either sourced by the XTAL or EXTCLK and as 61 * elided as the EPLL can be either sourced by the XTAL or EXTCLK and as
54 * such directly equating the two source clocks is impossible. 62 * such directly equating the two source clocks is impossible.
55 */ 63 */
56struct clk clk_mpllref = { 64static struct clk clk_mpllref = {
57 .name = "mpllref", 65 .name = "mpllref",
58 .parent = &clk_xtal, 66 .parent = &clk_xtal,
59}; 67};
@@ -160,6 +168,44 @@ static struct clk clk_prediv = {
160 }, 168 },
161}; 169};
162 170
171/* hclk divider
172 *
173 * divides the prediv and provides the hclk.
174 */
175
176static unsigned long s3c2443_hclkdiv_getrate(struct clk *clk)
177{
178 unsigned long rate = clk_get_rate(clk->parent);
179 unsigned long clkdiv0 = __raw_readl(S3C2443_CLKDIV0);
180
181 clkdiv0 &= S3C2443_CLKDIV0_HCLKDIV_MASK;
182
183 return rate / (clkdiv0 + 1);
184}
185
186static struct clk_ops clk_h_ops = {
187 .get_rate = s3c2443_hclkdiv_getrate,
188};
189
190/* pclk divider
191 *
192 * divides the hclk and provides the pclk.
193 */
194
195static unsigned long s3c2443_pclkdiv_getrate(struct clk *clk)
196{
197 unsigned long rate = clk_get_rate(clk->parent);
198 unsigned long clkdiv0 = __raw_readl(S3C2443_CLKDIV0);
199
200 clkdiv0 = ((clkdiv0 & S3C2443_CLKDIV0_HALF_PCLK) ? 1 : 0);
201
202 return rate / (clkdiv0 + 1);
203}
204
205static struct clk_ops clk_p_ops = {
206 .get_rate = s3c2443_pclkdiv_getrate,
207};
208
163/* armdiv 209/* armdiv
164 * 210 *
165 * this clock is sourced from msysclk and can have a number of 211 * this clock is sourced from msysclk and can have a number of
@@ -516,26 +562,15 @@ static struct clk hsmmc1_clk = {
516 .ctrlbit = S3C2443_HCLKCON_HSMMC, 562 .ctrlbit = S3C2443_HCLKCON_HSMMC,
517}; 563};
518 564
519static inline unsigned long s3c2443_get_hdiv(unsigned long clkcon0)
520{
521 clkcon0 &= S3C2443_CLKDIV0_HCLKDIV_MASK;
522
523 return clkcon0 + 1;
524}
525
526/* EPLLCON compatible enough to get on/off information */ 565/* EPLLCON compatible enough to get on/off information */
527 566
528void __init_or_cpufreq s3c2443_common_setup_clocks(pll_fn get_mpll) 567void __init_or_cpufreq s3c2443_common_setup_clocks(pll_fn get_mpll)
529{ 568{
530 unsigned long epllcon = __raw_readl(S3C2443_EPLLCON); 569 unsigned long epllcon = __raw_readl(S3C2443_EPLLCON);
531 unsigned long mpllcon = __raw_readl(S3C2443_MPLLCON); 570 unsigned long mpllcon = __raw_readl(S3C2443_MPLLCON);
532 unsigned long clkdiv0 = __raw_readl(S3C2443_CLKDIV0);
533 struct clk *xtal_clk; 571 struct clk *xtal_clk;
534 unsigned long xtal; 572 unsigned long xtal;
535 unsigned long pll; 573 unsigned long pll;
536 unsigned long fclk;
537 unsigned long hclk;
538 unsigned long pclk;
539 int ptr; 574 int ptr;
540 575
541 xtal_clk = clk_get(NULL, "xtal"); 576 xtal_clk = clk_get(NULL, "xtal");
@@ -544,18 +579,13 @@ void __init_or_cpufreq s3c2443_common_setup_clocks(pll_fn get_mpll)
544 579
545 pll = get_mpll(mpllcon, xtal); 580 pll = get_mpll(mpllcon, xtal);
546 clk_msysclk.clk.rate = pll; 581 clk_msysclk.clk.rate = pll;
547 582 clk_mpll.rate = pll;
548 fclk = clk_get_rate(&clk_armdiv);
549 hclk = s3c2443_prediv_getrate(&clk_prediv);
550 hclk /= s3c2443_get_hdiv(clkdiv0);
551 pclk = hclk / ((clkdiv0 & S3C2443_CLKDIV0_HALF_PCLK) ? 2 : 1);
552
553 s3c24xx_setup_clocks(fclk, hclk, pclk);
554 583
555 printk("CPU: MPLL %s %ld.%03ld MHz, cpu %ld.%03ld MHz, mem %ld.%03ld MHz, pclk %ld.%03ld MHz\n", 584 printk("CPU: MPLL %s %ld.%03ld MHz, cpu %ld.%03ld MHz, mem %ld.%03ld MHz, pclk %ld.%03ld MHz\n",
556 (mpllcon & S3C2443_PLLCON_OFF) ? "off":"on", 585 (mpllcon & S3C2443_PLLCON_OFF) ? "off" : "on",
557 print_mhz(pll), print_mhz(fclk), 586 print_mhz(pll), print_mhz(clk_get_rate(&clk_armdiv)),
558 print_mhz(hclk), print_mhz(pclk)); 587 print_mhz(clk_get_rate(&clk_h)),
588 print_mhz(clk_get_rate(&clk_p)));
559 589
560 for (ptr = 0; ptr < ARRAY_SIZE(clksrc_clks); ptr++) 590 for (ptr = 0; ptr < ARRAY_SIZE(clksrc_clks); ptr++)
561 s3c_set_clksrc(&clksrc_clks[ptr], true); 591 s3c_set_clksrc(&clksrc_clks[ptr], true);
@@ -568,7 +598,7 @@ void __init_or_cpufreq s3c2443_common_setup_clocks(pll_fn get_mpll)
568 } 598 }
569 599
570 printk("CPU: EPLL %s %ld.%03ld MHz, usb-bus %ld.%03ld MHz\n", 600 printk("CPU: EPLL %s %ld.%03ld MHz, usb-bus %ld.%03ld MHz\n",
571 (epllcon & S3C2443_PLLCON_OFF) ? "off":"on", 601 (epllcon & S3C2443_PLLCON_OFF) ? "off" : "on",
572 print_mhz(clk_get_rate(&clk_epll)), 602 print_mhz(clk_get_rate(&clk_epll)),
573 print_mhz(clk_get_rate(&clk_usb_bus))); 603 print_mhz(clk_get_rate(&clk_usb_bus)));
574} 604}
@@ -611,9 +641,13 @@ void __init s3c2443_common_init_clocks(int xtal, pll_fn get_mpll,
611 nr_armdiv = nr_divs; 641 nr_armdiv = nr_divs;
612 armdivmask = divmask; 642 armdivmask = divmask;
613 643
614 /* s3c2443 parents h and p clocks from prediv */ 644 /* s3c2443 parents h clock from prediv */
615 clk_h.parent = &clk_prediv; 645 clk_h.parent = &clk_prediv;
616 clk_p.parent = &clk_prediv; 646 clk_h.ops = &clk_h_ops;
647
648 /* and p clock from h clock */
649 clk_p.parent = &clk_h;
650 clk_p.ops = &clk_p_ops;
617 651
618 clk_usb_bus.parent = &clk_usb_bus_host.clk; 652 clk_usb_bus.parent = &clk_usb_bus_host.clk;
619 clk_epll.parent = &clk_epllref.clk; 653 clk_epll.parent = &clk_epllref.clk;
diff --git a/arch/arm/plat-s3c24xx/common-smdk.c b/arch/arm/mach-s3c24xx/common-smdk.c
index 084604be6ad..084604be6ad 100644
--- a/arch/arm/plat-s3c24xx/common-smdk.c
+++ b/arch/arm/mach-s3c24xx/common-smdk.c
diff --git a/arch/arm/mach-s3c2410/common.h b/arch/arm/mach-s3c24xx/common.h
index f65dc806296..62a2e196a68 100644
--- a/arch/arm/mach-s3c2410/common.h
+++ b/arch/arm/mach-s3c24xx/common.h
@@ -12,6 +12,12 @@
12#ifndef __ARCH_ARM_MACH_S3C2410_COMMON_H 12#ifndef __ARCH_ARM_MACH_S3C2410_COMMON_H
13#define __ARCH_ARM_MACH_S3C2410_COMMON_H 13#define __ARCH_ARM_MACH_S3C2410_COMMON_H
14 14
15#ifdef CONFIG_CPU_S3C2410
15void s3c2410_restart(char mode, const char *cmd); 16void s3c2410_restart(char mode, const char *cmd);
17#endif
18
19#ifdef CONFIG_CPU_S3C2440
20void s3c2440_restart(char mode, const char *cmd);
21#endif
16 22
17#endif /* __ARCH_ARM_MACH_S3C2410_COMMON_H */ 23#endif /* __ARCH_ARM_MACH_S3C2410_COMMON_H */
diff --git a/arch/arm/mach-s3c2410/dma.c b/arch/arm/mach-s3c24xx/dma-s3c2410.c
index 4803338cf56..4803338cf56 100644
--- a/arch/arm/mach-s3c2410/dma.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2410.c
diff --git a/arch/arm/mach-s3c2412/dma.c b/arch/arm/mach-s3c24xx/dma-s3c2412.c
index 38472ac920f..38472ac920f 100644
--- a/arch/arm/mach-s3c2412/dma.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2412.c
diff --git a/arch/arm/mach-s3c2440/dma.c b/arch/arm/mach-s3c24xx/dma-s3c2440.c
index 5f0a0c8ef84..5f0a0c8ef84 100644
--- a/arch/arm/mach-s3c2440/dma.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2440.c
diff --git a/arch/arm/mach-s3c2443/dma.c b/arch/arm/mach-s3c24xx/dma-s3c2443.c
index 14224517e62..e227c472a40 100644
--- a/arch/arm/mach-s3c2443/dma.c
+++ b/arch/arm/mach-s3c24xx/dma-s3c2443.c
@@ -51,7 +51,7 @@ static struct s3c24xx_dma_map __initdata s3c2443_dma_mappings[] = {
51 .name = "xdreq1", 51 .name = "xdreq1",
52 .channels = MAP(S3C2443_DMAREQSEL_XDREQ1), 52 .channels = MAP(S3C2443_DMAREQSEL_XDREQ1),
53 }, 53 },
54 [DMACH_SDI] = { 54 [DMACH_SDI] = { /* only on S3C2443 */
55 .name = "sdi", 55 .name = "sdi",
56 .channels = MAP(S3C2443_DMAREQSEL_SDI), 56 .channels = MAP(S3C2443_DMAREQSEL_SDI),
57 }, 57 },
@@ -59,7 +59,7 @@ static struct s3c24xx_dma_map __initdata s3c2443_dma_mappings[] = {
59 .name = "spi0", 59 .name = "spi0",
60 .channels = MAP(S3C2443_DMAREQSEL_SPI0TX), 60 .channels = MAP(S3C2443_DMAREQSEL_SPI0TX),
61 }, 61 },
62 [DMACH_SPI1] = { 62 [DMACH_SPI1] = { /* only on S3C2443/S3C2450 */
63 .name = "spi1", 63 .name = "spi1",
64 .channels = MAP(S3C2443_DMAREQSEL_SPI1TX), 64 .channels = MAP(S3C2443_DMAREQSEL_SPI1TX),
65 }, 65 },
@@ -71,11 +71,11 @@ static struct s3c24xx_dma_map __initdata s3c2443_dma_mappings[] = {
71 .name = "uart1", 71 .name = "uart1",
72 .channels = MAP(S3C2443_DMAREQSEL_UART1_0), 72 .channels = MAP(S3C2443_DMAREQSEL_UART1_0),
73 }, 73 },
74 [DMACH_UART2] = { 74 [DMACH_UART2] = {
75 .name = "uart2", 75 .name = "uart2",
76 .channels = MAP(S3C2443_DMAREQSEL_UART2_0), 76 .channels = MAP(S3C2443_DMAREQSEL_UART2_0),
77 }, 77 },
78 [DMACH_UART3] = { 78 [DMACH_UART3] = {
79 .name = "uart3", 79 .name = "uart3",
80 .channels = MAP(S3C2443_DMAREQSEL_UART3_0), 80 .channels = MAP(S3C2443_DMAREQSEL_UART3_0),
81 }, 81 },
@@ -87,11 +87,11 @@ static struct s3c24xx_dma_map __initdata s3c2443_dma_mappings[] = {
87 .name = "uart1", 87 .name = "uart1",
88 .channels = MAP(S3C2443_DMAREQSEL_UART1_1), 88 .channels = MAP(S3C2443_DMAREQSEL_UART1_1),
89 }, 89 },
90 [DMACH_UART2_SRC2] = { 90 [DMACH_UART2_SRC2] = {
91 .name = "uart2", 91 .name = "uart2",
92 .channels = MAP(S3C2443_DMAREQSEL_UART2_1), 92 .channels = MAP(S3C2443_DMAREQSEL_UART2_1),
93 }, 93 },
94 [DMACH_UART3_SRC2] = { 94 [DMACH_UART3_SRC2] = {
95 .name = "uart3", 95 .name = "uart3",
96 .channels = MAP(S3C2443_DMAREQSEL_UART3_1), 96 .channels = MAP(S3C2443_DMAREQSEL_UART3_1),
97 }, 97 },
@@ -142,6 +142,23 @@ static int __init s3c2443_dma_add(struct device *dev,
142 return s3c24xx_dma_init_map(&s3c2443_dma_sel); 142 return s3c24xx_dma_init_map(&s3c2443_dma_sel);
143} 143}
144 144
145#ifdef CONFIG_CPU_S3C2416
146/* S3C2416 DMA contains the same selection table as the S3C2443 */
147static struct subsys_interface s3c2416_dma_interface = {
148 .name = "s3c2416_dma",
149 .subsys = &s3c2416_subsys,
150 .add_dev = s3c2443_dma_add,
151};
152
153static int __init s3c2416_dma_init(void)
154{
155 return subsys_interface_register(&s3c2416_dma_interface);
156}
157
158arch_initcall(s3c2416_dma_init);
159#endif
160
161#ifdef CONFIG_CPU_S3C2443
145static struct subsys_interface s3c2443_dma_interface = { 162static struct subsys_interface s3c2443_dma_interface = {
146 .name = "s3c2443_dma", 163 .name = "s3c2443_dma",
147 .subsys = &s3c2443_subsys, 164 .subsys = &s3c2443_subsys,
@@ -154,3 +171,4 @@ static int __init s3c2443_dma_init(void)
154} 171}
155 172
156arch_initcall(s3c2443_dma_init); 173arch_initcall(s3c2443_dma_init);
174#endif
diff --git a/arch/arm/mach-s3c2410/h1940-bluetooth.c b/arch/arm/mach-s3c24xx/h1940-bluetooth.c
index a5eeb62ce1c..a5eeb62ce1c 100644
--- a/arch/arm/mach-s3c2410/h1940-bluetooth.c
+++ b/arch/arm/mach-s3c24xx/h1940-bluetooth.c
diff --git a/arch/arm/mach-s3c2410/include/mach/anubis-cpld.h b/arch/arm/mach-s3c24xx/include/mach/anubis-cpld.h
index 1b614d5a81f..1b614d5a81f 100644
--- a/arch/arm/mach-s3c2410/include/mach/anubis-cpld.h
+++ b/arch/arm/mach-s3c24xx/include/mach/anubis-cpld.h
diff --git a/arch/arm/mach-s3c2410/include/mach/anubis-irq.h b/arch/arm/mach-s3c24xx/include/mach/anubis-irq.h
index a2a328134e3..a2a328134e3 100644
--- a/arch/arm/mach-s3c2410/include/mach/anubis-irq.h
+++ b/arch/arm/mach-s3c24xx/include/mach/anubis-irq.h
diff --git a/arch/arm/mach-s3c2410/include/mach/anubis-map.h b/arch/arm/mach-s3c24xx/include/mach/anubis-map.h
index c9deb3a5b2c..c9deb3a5b2c 100644
--- a/arch/arm/mach-s3c2410/include/mach/anubis-map.h
+++ b/arch/arm/mach-s3c24xx/include/mach/anubis-map.h
diff --git a/arch/arm/mach-s3c2410/include/mach/bast-cpld.h b/arch/arm/mach-s3c24xx/include/mach/bast-cpld.h
index bee2a7a932a..bee2a7a932a 100644
--- a/arch/arm/mach-s3c2410/include/mach/bast-cpld.h
+++ b/arch/arm/mach-s3c24xx/include/mach/bast-cpld.h
diff --git a/arch/arm/mach-s3c2410/include/mach/bast-irq.h b/arch/arm/mach-s3c24xx/include/mach/bast-irq.h
index cac428c42e7..cac428c42e7 100644
--- a/arch/arm/mach-s3c2410/include/mach/bast-irq.h
+++ b/arch/arm/mach-s3c24xx/include/mach/bast-irq.h
diff --git a/arch/arm/mach-s3c2410/include/mach/bast-map.h b/arch/arm/mach-s3c24xx/include/mach/bast-map.h
index 6e7dc9d0cf0..6e7dc9d0cf0 100644
--- a/arch/arm/mach-s3c2410/include/mach/bast-map.h
+++ b/arch/arm/mach-s3c24xx/include/mach/bast-map.h
diff --git a/arch/arm/mach-s3c2410/include/mach/bast-pmu.h b/arch/arm/mach-s3c24xx/include/mach/bast-pmu.h
index 4c38b39b741..4c38b39b741 100644
--- a/arch/arm/mach-s3c2410/include/mach/bast-pmu.h
+++ b/arch/arm/mach-s3c24xx/include/mach/bast-pmu.h
diff --git a/arch/arm/mach-s3c2410/include/mach/debug-macro.S b/arch/arm/mach-s3c24xx/include/mach/debug-macro.S
index 4135de87d1f..4135de87d1f 100644
--- a/arch/arm/mach-s3c2410/include/mach/debug-macro.S
+++ b/arch/arm/mach-s3c24xx/include/mach/debug-macro.S
diff --git a/arch/arm/mach-s3c2410/include/mach/dma.h b/arch/arm/mach-s3c24xx/include/mach/dma.h
index acbdfecd418..acbdfecd418 100644
--- a/arch/arm/mach-s3c2410/include/mach/dma.h
+++ b/arch/arm/mach-s3c24xx/include/mach/dma.h
diff --git a/arch/arm/mach-s3c2410/include/mach/entry-macro.S b/arch/arm/mach-s3c24xx/include/mach/entry-macro.S
index 7615a14773f..7615a14773f 100644
--- a/arch/arm/mach-s3c2410/include/mach/entry-macro.S
+++ b/arch/arm/mach-s3c24xx/include/mach/entry-macro.S
diff --git a/arch/arm/mach-s3c2410/include/mach/fb.h b/arch/arm/mach-s3c24xx/include/mach/fb.h
index a957bc8ed44..a957bc8ed44 100644
--- a/arch/arm/mach-s3c2410/include/mach/fb.h
+++ b/arch/arm/mach-s3c24xx/include/mach/fb.h
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-fns.h b/arch/arm/mach-s3c24xx/include/mach/gpio-fns.h
index c53ad34c657..c53ad34c657 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio-fns.h
+++ b/arch/arm/mach-s3c24xx/include/mach/gpio-fns.h
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h b/arch/arm/mach-s3c24xx/include/mach/gpio-nrs.h
index 019ea86057f..019ea86057f 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio-nrs.h
+++ b/arch/arm/mach-s3c24xx/include/mach/gpio-nrs.h
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio-track.h b/arch/arm/mach-s3c24xx/include/mach/gpio-track.h
index c410a078622..c410a078622 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio-track.h
+++ b/arch/arm/mach-s3c24xx/include/mach/gpio-track.h
diff --git a/arch/arm/mach-s3c2410/include/mach/gpio.h b/arch/arm/mach-s3c24xx/include/mach/gpio.h
index 6fac70f3484..6fac70f3484 100644
--- a/arch/arm/mach-s3c2410/include/mach/gpio.h
+++ b/arch/arm/mach-s3c24xx/include/mach/gpio.h
diff --git a/arch/arm/mach-s3c2440/include/mach/gta02.h b/arch/arm/mach-s3c24xx/include/mach/gta02.h
index 3a56a229cac..3a56a229cac 100644
--- a/arch/arm/mach-s3c2440/include/mach/gta02.h
+++ b/arch/arm/mach-s3c24xx/include/mach/gta02.h
diff --git a/arch/arm/mach-s3c2410/include/mach/h1940-latch.h b/arch/arm/mach-s3c24xx/include/mach/h1940-latch.h
index fc897d3a056..fc897d3a056 100644
--- a/arch/arm/mach-s3c2410/include/mach/h1940-latch.h
+++ b/arch/arm/mach-s3c24xx/include/mach/h1940-latch.h
diff --git a/arch/arm/mach-s3c2410/include/mach/h1940.h b/arch/arm/mach-s3c24xx/include/mach/h1940.h
index 2aa683c8d3d..2aa683c8d3d 100644
--- a/arch/arm/mach-s3c2410/include/mach/h1940.h
+++ b/arch/arm/mach-s3c24xx/include/mach/h1940.h
diff --git a/arch/arm/mach-s3c2410/include/mach/hardware.h b/arch/arm/mach-s3c24xx/include/mach/hardware.h
index aef5631eac5..aef5631eac5 100644
--- a/arch/arm/mach-s3c2410/include/mach/hardware.h
+++ b/arch/arm/mach-s3c24xx/include/mach/hardware.h
diff --git a/arch/arm/mach-s3c2410/include/mach/idle.h b/arch/arm/mach-s3c24xx/include/mach/idle.h
index e9ddd706b16..e9ddd706b16 100644
--- a/arch/arm/mach-s3c2410/include/mach/idle.h
+++ b/arch/arm/mach-s3c24xx/include/mach/idle.h
diff --git a/arch/arm/mach-s3c2410/include/mach/io.h b/arch/arm/mach-s3c24xx/include/mach/io.h
index 118749f37c4..118749f37c4 100644
--- a/arch/arm/mach-s3c2410/include/mach/io.h
+++ b/arch/arm/mach-s3c24xx/include/mach/io.h
diff --git a/arch/arm/mach-s3c2410/include/mach/irqs.h b/arch/arm/mach-s3c24xx/include/mach/irqs.h
index e53b2177319..e53b2177319 100644
--- a/arch/arm/mach-s3c2410/include/mach/irqs.h
+++ b/arch/arm/mach-s3c24xx/include/mach/irqs.h
diff --git a/arch/arm/mach-s3c2410/include/mach/leds-gpio.h b/arch/arm/mach-s3c24xx/include/mach/leds-gpio.h
index d8a7672519b..d8a7672519b 100644
--- a/arch/arm/mach-s3c2410/include/mach/leds-gpio.h
+++ b/arch/arm/mach-s3c24xx/include/mach/leds-gpio.h
diff --git a/arch/arm/mach-s3c2410/include/mach/map.h b/arch/arm/mach-s3c24xx/include/mach/map.h
index 78ae807f128..78ae807f128 100644
--- a/arch/arm/mach-s3c2410/include/mach/map.h
+++ b/arch/arm/mach-s3c24xx/include/mach/map.h
diff --git a/arch/arm/mach-s3c2410/include/mach/osiris-cpld.h b/arch/arm/mach-s3c24xx/include/mach/osiris-cpld.h
index e9e36b0abba..e9e36b0abba 100644
--- a/arch/arm/mach-s3c2410/include/mach/osiris-cpld.h
+++ b/arch/arm/mach-s3c24xx/include/mach/osiris-cpld.h
diff --git a/arch/arm/mach-s3c2410/include/mach/osiris-map.h b/arch/arm/mach-s3c24xx/include/mach/osiris-map.h
index 17380f84842..17380f84842 100644
--- a/arch/arm/mach-s3c2410/include/mach/osiris-map.h
+++ b/arch/arm/mach-s3c24xx/include/mach/osiris-map.h
diff --git a/arch/arm/mach-s3c2410/include/mach/otom-map.h b/arch/arm/mach-s3c24xx/include/mach/otom-map.h
index f9277a52c14..f9277a52c14 100644
--- a/arch/arm/mach-s3c2410/include/mach/otom-map.h
+++ b/arch/arm/mach-s3c24xx/include/mach/otom-map.h
diff --git a/arch/arm/mach-s3c2410/include/mach/pm-core.h b/arch/arm/mach-s3c24xx/include/mach/pm-core.h
index 2eef7e6f767..2eef7e6f767 100644
--- a/arch/arm/mach-s3c2410/include/mach/pm-core.h
+++ b/arch/arm/mach-s3c24xx/include/mach/pm-core.h
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-clock.h b/arch/arm/mach-s3c24xx/include/mach/regs-clock.h
index 3415b60082d..3415b60082d 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-clock.h
+++ b/arch/arm/mach-s3c24xx/include/mach/regs-clock.h
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-dsc.h b/arch/arm/mach-s3c24xx/include/mach/regs-dsc.h
index 98fd4a05587..98fd4a05587 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-dsc.h
+++ b/arch/arm/mach-s3c24xx/include/mach/regs-dsc.h
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-gpio.h b/arch/arm/mach-s3c24xx/include/mach/regs-gpio.h
index cac1ad6b582..cac1ad6b582 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-gpio.h
+++ b/arch/arm/mach-s3c24xx/include/mach/regs-gpio.h
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-gpioj.h b/arch/arm/mach-s3c24xx/include/mach/regs-gpioj.h
index 19575e06111..19575e06111 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-gpioj.h
+++ b/arch/arm/mach-s3c24xx/include/mach/regs-gpioj.h
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-irq.h b/arch/arm/mach-s3c24xx/include/mach/regs-irq.h
index 0f07ba30b1f..0f07ba30b1f 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-irq.h
+++ b/arch/arm/mach-s3c24xx/include/mach/regs-irq.h
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-lcd.h b/arch/arm/mach-s3c24xx/include/mach/regs-lcd.h
index ee8f040aff5..ee8f040aff5 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-lcd.h
+++ b/arch/arm/mach-s3c24xx/include/mach/regs-lcd.h
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-mem.h b/arch/arm/mach-s3c24xx/include/mach/regs-mem.h
index e0c67b0163d..e0c67b0163d 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-mem.h
+++ b/arch/arm/mach-s3c24xx/include/mach/regs-mem.h
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-power.h b/arch/arm/mach-s3c24xx/include/mach/regs-power.h
index 4932b87bdf3..4932b87bdf3 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-power.h
+++ b/arch/arm/mach-s3c24xx/include/mach/regs-power.h
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-s3c2412-mem.h b/arch/arm/mach-s3c24xx/include/mach/regs-s3c2412-mem.h
index fb635251509..fb635251509 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-s3c2412-mem.h
+++ b/arch/arm/mach-s3c24xx/include/mach/regs-s3c2412-mem.h
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-s3c2412.h b/arch/arm/mach-s3c24xx/include/mach/regs-s3c2412.h
index aa69dc79bc3..aa69dc79bc3 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-s3c2412.h
+++ b/arch/arm/mach-s3c24xx/include/mach/regs-s3c2412.h
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-s3c2416-mem.h b/arch/arm/mach-s3c24xx/include/mach/regs-s3c2416-mem.h
index 2f31b74974a..2f31b74974a 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-s3c2416-mem.h
+++ b/arch/arm/mach-s3c24xx/include/mach/regs-s3c2416-mem.h
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-s3c2416.h b/arch/arm/mach-s3c24xx/include/mach/regs-s3c2416.h
index e443167efb8..e443167efb8 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-s3c2416.h
+++ b/arch/arm/mach-s3c24xx/include/mach/regs-s3c2416.h
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h b/arch/arm/mach-s3c24xx/include/mach/regs-s3c2443-clock.h
index c3feff3c048..c3feff3c048 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-s3c2443-clock.h
+++ b/arch/arm/mach-s3c24xx/include/mach/regs-s3c2443-clock.h
diff --git a/arch/arm/mach-s3c2410/include/mach/regs-sdi.h b/arch/arm/mach-s3c24xx/include/mach/regs-sdi.h
index cbf2d8884e3..cbf2d8884e3 100644
--- a/arch/arm/mach-s3c2410/include/mach/regs-sdi.h
+++ b/arch/arm/mach-s3c24xx/include/mach/regs-sdi.h
diff --git a/arch/arm/mach-s3c2410/include/mach/tick.h b/arch/arm/mach-s3c24xx/include/mach/tick.h
index 544da41979d..544da41979d 100644
--- a/arch/arm/mach-s3c2410/include/mach/tick.h
+++ b/arch/arm/mach-s3c24xx/include/mach/tick.h
diff --git a/arch/arm/mach-s3c2410/include/mach/timex.h b/arch/arm/mach-s3c24xx/include/mach/timex.h
index fe9ca1ffd51..fe9ca1ffd51 100644
--- a/arch/arm/mach-s3c2410/include/mach/timex.h
+++ b/arch/arm/mach-s3c24xx/include/mach/timex.h
diff --git a/arch/arm/mach-s3c2410/include/mach/uncompress.h b/arch/arm/mach-s3c24xx/include/mach/uncompress.h
index 8b283f847da..8b283f847da 100644
--- a/arch/arm/mach-s3c2410/include/mach/uncompress.h
+++ b/arch/arm/mach-s3c24xx/include/mach/uncompress.h
diff --git a/arch/arm/mach-s3c2410/include/mach/vr1000-cpld.h b/arch/arm/mach-s3c24xx/include/mach/vr1000-cpld.h
index e4119913d7c..e4119913d7c 100644
--- a/arch/arm/mach-s3c2410/include/mach/vr1000-cpld.h
+++ b/arch/arm/mach-s3c24xx/include/mach/vr1000-cpld.h
diff --git a/arch/arm/mach-s3c2410/include/mach/vr1000-irq.h b/arch/arm/mach-s3c24xx/include/mach/vr1000-irq.h
index 47add133b8e..47add133b8e 100644
--- a/arch/arm/mach-s3c2410/include/mach/vr1000-irq.h
+++ b/arch/arm/mach-s3c24xx/include/mach/vr1000-irq.h
diff --git a/arch/arm/mach-s3c2410/include/mach/vr1000-map.h b/arch/arm/mach-s3c24xx/include/mach/vr1000-map.h
index 99612fcc4eb..99612fcc4eb 100644
--- a/arch/arm/mach-s3c2410/include/mach/vr1000-map.h
+++ b/arch/arm/mach-s3c24xx/include/mach/vr1000-map.h
diff --git a/arch/arm/mach-s3c2412/irq.c b/arch/arm/mach-s3c24xx/irq-s3c2412.c
index e65619ddbcc..e65619ddbcc 100644
--- a/arch/arm/mach-s3c2412/irq.c
+++ b/arch/arm/mach-s3c24xx/irq-s3c2412.c
diff --git a/arch/arm/mach-s3c2416/irq.c b/arch/arm/mach-s3c24xx/irq-s3c2416.c
index fd49f35e448..fd49f35e448 100644
--- a/arch/arm/mach-s3c2416/irq.c
+++ b/arch/arm/mach-s3c24xx/irq-s3c2416.c
diff --git a/arch/arm/mach-s3c2440/irq.c b/arch/arm/mach-s3c24xx/irq-s3c2440.c
index 4a18cde439c..4a18cde439c 100644
--- a/arch/arm/mach-s3c2440/irq.c
+++ b/arch/arm/mach-s3c24xx/irq-s3c2440.c
diff --git a/arch/arm/mach-s3c2443/irq.c b/arch/arm/mach-s3c24xx/irq-s3c2443.c
index ac2829f56d1..ac2829f56d1 100644
--- a/arch/arm/mach-s3c2443/irq.c
+++ b/arch/arm/mach-s3c24xx/irq-s3c2443.c
diff --git a/arch/arm/mach-s3c2440/s3c244x-irq.c b/arch/arm/mach-s3c24xx/irq-s3c244x.c
index 5fe8e58d3af..5fe8e58d3af 100644
--- a/arch/arm/mach-s3c2440/s3c244x-irq.c
+++ b/arch/arm/mach-s3c24xx/irq-s3c244x.c
diff --git a/arch/arm/mach-s3c2410/mach-amlm5900.c b/arch/arm/mach-s3c24xx/mach-amlm5900.c
index 4220cc60de3..4220cc60de3 100644
--- a/arch/arm/mach-s3c2410/mach-amlm5900.c
+++ b/arch/arm/mach-s3c24xx/mach-amlm5900.c
diff --git a/arch/arm/mach-s3c2440/mach-anubis.c b/arch/arm/mach-s3c24xx/mach-anubis.c
index 24569550de1..9e0f74515bb 100644
--- a/arch/arm/mach-s3c2440/mach-anubis.c
+++ b/arch/arm/mach-s3c24xx/mach-anubis.c
@@ -55,6 +55,7 @@
55#include <plat/cpu.h> 55#include <plat/cpu.h>
56#include <plat/audio-simtec.h> 56#include <plat/audio-simtec.h>
57 57
58#include "simtec.h"
58#include "common.h" 59#include "common.h"
59 60
60#define COPYRIGHT ", Copyright 2005-2009 Simtec Electronics" 61#define COPYRIGHT ", Copyright 2005-2009 Simtec Electronics"
diff --git a/arch/arm/mach-s3c2440/mach-at2440evb.c b/arch/arm/mach-s3c24xx/mach-at2440evb.c
index d6a9763110c..d6a9763110c 100644
--- a/arch/arm/mach-s3c2440/mach-at2440evb.c
+++ b/arch/arm/mach-s3c24xx/mach-at2440evb.c
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c24xx/mach-bast.c
index feeaf73933d..53219c02eca 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c24xx/mach-bast.c
@@ -64,8 +64,7 @@
64#include <plat/gpio-cfg.h> 64#include <plat/gpio-cfg.h>
65#include <plat/audio-simtec.h> 65#include <plat/audio-simtec.h>
66 66
67#include "usb-simtec.h" 67#include "simtec.h"
68#include "nor-simtec.h"
69#include "common.h" 68#include "common.h"
70 69
71#define COPYRIGHT ", Copyright 2004-2008 Simtec Electronics" 70#define COPYRIGHT ", Copyright 2004-2008 Simtec Electronics"
diff --git a/arch/arm/mach-s3c2440/mach-gta02.c b/arch/arm/mach-s3c24xx/mach-gta02.c
index 5859e609d28..d0e0ad4e659 100644
--- a/arch/arm/mach-s3c2440/mach-gta02.c
+++ b/arch/arm/mach-s3c24xx/mach-gta02.c
@@ -38,6 +38,7 @@
38#include <linux/platform_device.h> 38#include <linux/platform_device.h>
39#include <linux/serial_core.h> 39#include <linux/serial_core.h>
40#include <linux/spi/spi.h> 40#include <linux/spi/spi.h>
41#include <linux/spi/s3c24xx.h>
41 42
42#include <linux/mmc/host.h> 43#include <linux/mmc/host.h>
43 44
@@ -73,7 +74,6 @@
73#include <mach/regs-gpioj.h> 74#include <mach/regs-gpioj.h>
74#include <mach/fb.h> 75#include <mach/fb.h>
75 76
76#include <mach/spi.h>
77#include <plat/usb-control.h> 77#include <plat/usb-control.h>
78#include <mach/regs-mem.h> 78#include <mach/regs-mem.h>
79#include <mach/hardware.h> 79#include <mach/hardware.h>
@@ -258,7 +258,7 @@ static struct pcf50633_bl_platform_data gta02_backlight_data = {
258 .ramp_time = 5, 258 .ramp_time = 5,
259}; 259};
260 260
261struct pcf50633_platform_data gta02_pcf_pdata = { 261static struct pcf50633_platform_data gta02_pcf_pdata = {
262 .resumers = { 262 .resumers = {
263 [0] = PCF50633_INT1_USBINS | 263 [0] = PCF50633_INT1_USBINS |
264 PCF50633_INT1_USBREM | 264 PCF50633_INT1_USBREM |
@@ -404,7 +404,7 @@ static struct platform_device gta02_nor_flash = {
404}; 404};
405 405
406 406
407struct platform_device s3c24xx_pwm_device = { 407static struct platform_device s3c24xx_pwm_device = {
408 .name = "s3c24xx_pwm", 408 .name = "s3c24xx_pwm",
409 .num_resources = 0, 409 .num_resources = 0,
410}; 410};
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c24xx/mach-h1940.c
index 41245a60398..6b21ba107ea 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c24xx/mach-h1940.c
@@ -162,7 +162,7 @@ static int h1940_gpiolib_latch_get(struct gpio_chip *chip,
162 return (latch_state >> (offset + 16)) & 1; 162 return (latch_state >> (offset + 16)) & 1;
163} 163}
164 164
165struct gpio_chip h1940_latch_gpiochip = { 165static struct gpio_chip h1940_latch_gpiochip = {
166 .base = H1940_LATCH_GPIO(0), 166 .base = H1940_LATCH_GPIO(0),
167 .owner = THIS_MODULE, 167 .owner = THIS_MODULE,
168 .label = "H1940_LATCH", 168 .label = "H1940_LATCH",
@@ -304,7 +304,7 @@ static const struct s3c_adc_bat_thresh bat_lut_acin[] = {
304 { .volt = 3841, .cur = 0, .level = 0}, 304 { .volt = 3841, .cur = 0, .level = 0},
305}; 305};
306 306
307int h1940_bat_init(void) 307static int h1940_bat_init(void)
308{ 308{
309 int ret; 309 int ret;
310 310
@@ -317,17 +317,17 @@ int h1940_bat_init(void)
317 317
318} 318}
319 319
320void h1940_bat_exit(void) 320static void h1940_bat_exit(void)
321{ 321{
322 gpio_free(H1940_LATCH_SM803_ENABLE); 322 gpio_free(H1940_LATCH_SM803_ENABLE);
323} 323}
324 324
325void h1940_enable_charger(void) 325static void h1940_enable_charger(void)
326{ 326{
327 gpio_set_value(H1940_LATCH_SM803_ENABLE, 1); 327 gpio_set_value(H1940_LATCH_SM803_ENABLE, 1);
328} 328}
329 329
330void h1940_disable_charger(void) 330static void h1940_disable_charger(void)
331{ 331{
332 gpio_set_value(H1940_LATCH_SM803_ENABLE, 0); 332 gpio_set_value(H1940_LATCH_SM803_ENABLE, 0);
333} 333}
@@ -364,7 +364,7 @@ static struct platform_device h1940_battery = {
364 }, 364 },
365}; 365};
366 366
367DEFINE_SPINLOCK(h1940_blink_spin); 367static DEFINE_SPINLOCK(h1940_blink_spin);
368 368
369int h1940_led_blink_set(unsigned gpio, int state, 369int h1940_led_blink_set(unsigned gpio, int state,
370 unsigned long *delay_on, unsigned long *delay_off) 370 unsigned long *delay_on, unsigned long *delay_off)
diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c24xx/mach-jive.c
index ae73ba34ecc..ae73ba34ecc 100644
--- a/arch/arm/mach-s3c2412/mach-jive.c
+++ b/arch/arm/mach-s3c24xx/mach-jive.c
diff --git a/arch/arm/mach-s3c2440/mach-mini2440.c b/arch/arm/mach-s3c24xx/mach-mini2440.c
index adbbb85bc4c..adbbb85bc4c 100644
--- a/arch/arm/mach-s3c2440/mach-mini2440.c
+++ b/arch/arm/mach-s3c24xx/mach-mini2440.c
diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c24xx/mach-n30.c
index 383d00ca8f6..383d00ca8f6 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c24xx/mach-n30.c
diff --git a/arch/arm/mach-s3c2440/mach-nexcoder.c b/arch/arm/mach-s3c24xx/mach-nexcoder.c
index 40eaf844bc1..40eaf844bc1 100644
--- a/arch/arm/mach-s3c2440/mach-nexcoder.c
+++ b/arch/arm/mach-s3c24xx/mach-nexcoder.c
diff --git a/arch/arm/mach-s3c2440/mach-osiris-dvs.c b/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
index ad2792dfbee..ad2792dfbee 100644
--- a/arch/arm/mach-s3c2440/mach-osiris-dvs.c
+++ b/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c24xx/mach-osiris.c
index 4c480ef734f..4c480ef734f 100644
--- a/arch/arm/mach-s3c2440/mach-osiris.c
+++ b/arch/arm/mach-s3c24xx/mach-osiris.c
diff --git a/arch/arm/mach-s3c2410/mach-otom.c b/arch/arm/mach-s3c24xx/mach-otom.c
index 5f1e0eeb38a..5f1e0eeb38a 100644
--- a/arch/arm/mach-s3c2410/mach-otom.c
+++ b/arch/arm/mach-s3c24xx/mach-otom.c
diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c b/arch/arm/mach-s3c24xx/mach-qt2410.c
index 91c16d9d245..91c16d9d245 100644
--- a/arch/arm/mach-s3c2410/mach-qt2410.c
+++ b/arch/arm/mach-s3c24xx/mach-qt2410.c
diff --git a/arch/arm/mach-s3c2440/mach-rx1950.c b/arch/arm/mach-s3c24xx/mach-rx1950.c
index 80077f6472e..4a8e2d34994 100644
--- a/arch/arm/mach-s3c2440/mach-rx1950.c
+++ b/arch/arm/mach-s3c24xx/mach-rx1950.c
@@ -217,7 +217,7 @@ static const struct s3c_adc_bat_thresh bat_lut_acin[] = {
217 { .volt = 3820, .cur = 0, .level = 0}, 217 { .volt = 3820, .cur = 0, .level = 0},
218}; 218};
219 219
220int rx1950_bat_init(void) 220static int rx1950_bat_init(void)
221{ 221{
222 int ret; 222 int ret;
223 223
@@ -236,25 +236,25 @@ err_gpio1:
236 return ret; 236 return ret;
237} 237}
238 238
239void rx1950_bat_exit(void) 239static void rx1950_bat_exit(void)
240{ 240{
241 gpio_free(S3C2410_GPJ(2)); 241 gpio_free(S3C2410_GPJ(2));
242 gpio_free(S3C2410_GPJ(3)); 242 gpio_free(S3C2410_GPJ(3));
243} 243}
244 244
245void rx1950_enable_charger(void) 245static void rx1950_enable_charger(void)
246{ 246{
247 gpio_direction_output(S3C2410_GPJ(2), 1); 247 gpio_direction_output(S3C2410_GPJ(2), 1);
248 gpio_direction_output(S3C2410_GPJ(3), 1); 248 gpio_direction_output(S3C2410_GPJ(3), 1);
249} 249}
250 250
251void rx1950_disable_charger(void) 251static void rx1950_disable_charger(void)
252{ 252{
253 gpio_direction_output(S3C2410_GPJ(2), 0); 253 gpio_direction_output(S3C2410_GPJ(2), 0);
254 gpio_direction_output(S3C2410_GPJ(3), 0); 254 gpio_direction_output(S3C2410_GPJ(3), 0);
255} 255}
256 256
257DEFINE_SPINLOCK(rx1950_blink_spin); 257static DEFINE_SPINLOCK(rx1950_blink_spin);
258 258
259static int rx1950_led_blink_set(unsigned gpio, int state, 259static int rx1950_led_blink_set(unsigned gpio, int state,
260 unsigned long *delay_on, unsigned long *delay_off) 260 unsigned long *delay_on, unsigned long *delay_off)
@@ -382,7 +382,7 @@ static struct s3c2410fb_mach_info rx1950_lcd_cfg = {
382 382
383static struct pwm_device *lcd_pwm; 383static struct pwm_device *lcd_pwm;
384 384
385void rx1950_lcd_power(int enable) 385static void rx1950_lcd_power(int enable)
386{ 386{
387 int i; 387 int i;
388 static int enabled; 388 static int enabled;
diff --git a/arch/arm/mach-s3c2440/mach-rx3715.c b/arch/arm/mach-s3c24xx/mach-rx3715.c
index 20103bafbd4..20103bafbd4 100644
--- a/arch/arm/mach-s3c2440/mach-rx3715.c
+++ b/arch/arm/mach-s3c24xx/mach-rx3715.c
diff --git a/arch/arm/mach-s3c2410/mach-smdk2410.c b/arch/arm/mach-s3c24xx/mach-smdk2410.c
index bdc27e77287..bdc27e77287 100644
--- a/arch/arm/mach-s3c2410/mach-smdk2410.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2410.c
diff --git a/arch/arm/mach-s3c2412/mach-smdk2413.c b/arch/arm/mach-s3c24xx/mach-smdk2413.c
index b11451b853d..b11451b853d 100644
--- a/arch/arm/mach-s3c2412/mach-smdk2413.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2413.c
diff --git a/arch/arm/mach-s3c2416/mach-smdk2416.c b/arch/arm/mach-s3c24xx/mach-smdk2416.c
index eebe1e72b93..30a44f806e0 100644
--- a/arch/arm/mach-s3c2416/mach-smdk2416.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2416.c
@@ -125,7 +125,7 @@ static struct s3c2410_uartcfg smdk2416_uartcfgs[] __initdata = {
125 } 125 }
126}; 126};
127 127
128void smdk2416_hsudc_gpio_init(void) 128static void smdk2416_hsudc_gpio_init(void)
129{ 129{
130 s3c_gpio_setpull(S3C2410_GPH(14), S3C_GPIO_PULL_UP); 130 s3c_gpio_setpull(S3C2410_GPH(14), S3C_GPIO_PULL_UP);
131 s3c_gpio_setpull(S3C2410_GPF(2), S3C_GPIO_PULL_NONE); 131 s3c_gpio_setpull(S3C2410_GPF(2), S3C_GPIO_PULL_NONE);
@@ -133,20 +133,20 @@ void smdk2416_hsudc_gpio_init(void)
133 s3c2410_modify_misccr(S3C2416_MISCCR_SEL_SUSPND, 0); 133 s3c2410_modify_misccr(S3C2416_MISCCR_SEL_SUSPND, 0);
134} 134}
135 135
136void smdk2416_hsudc_gpio_uninit(void) 136static void smdk2416_hsudc_gpio_uninit(void)
137{ 137{
138 s3c2410_modify_misccr(S3C2416_MISCCR_SEL_SUSPND, 1); 138 s3c2410_modify_misccr(S3C2416_MISCCR_SEL_SUSPND, 1);
139 s3c_gpio_setpull(S3C2410_GPH(14), S3C_GPIO_PULL_NONE); 139 s3c_gpio_setpull(S3C2410_GPH(14), S3C_GPIO_PULL_NONE);
140 s3c_gpio_cfgpin(S3C2410_GPH(14), S3C_GPIO_SFN(0)); 140 s3c_gpio_cfgpin(S3C2410_GPH(14), S3C_GPIO_SFN(0));
141} 141}
142 142
143struct s3c24xx_hsudc_platdata smdk2416_hsudc_platdata = { 143static struct s3c24xx_hsudc_platdata smdk2416_hsudc_platdata = {
144 .epnum = 9, 144 .epnum = 9,
145 .gpio_init = smdk2416_hsudc_gpio_init, 145 .gpio_init = smdk2416_hsudc_gpio_init,
146 .gpio_uninit = smdk2416_hsudc_gpio_uninit, 146 .gpio_uninit = smdk2416_hsudc_gpio_uninit,
147}; 147};
148 148
149struct s3c_fb_pd_win smdk2416_fb_win[] = { 149static struct s3c_fb_pd_win smdk2416_fb_win[] = {
150 [0] = { 150 [0] = {
151 /* think this is the same as the smdk6410 */ 151 /* think this is the same as the smdk6410 */
152 .win_mode = { 152 .win_mode = {
diff --git a/arch/arm/mach-s3c2440/mach-smdk2440.c b/arch/arm/mach-s3c24xx/mach-smdk2440.c
index 1deb60d12a6..1deb60d12a6 100644
--- a/arch/arm/mach-s3c2440/mach-smdk2440.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2440.c
diff --git a/arch/arm/mach-s3c2443/mach-smdk2443.c b/arch/arm/mach-s3c24xx/mach-smdk2443.c
index 20923695622..20923695622 100644
--- a/arch/arm/mach-s3c2443/mach-smdk2443.c
+++ b/arch/arm/mach-s3c24xx/mach-smdk2443.c
diff --git a/arch/arm/mach-s3c2410/mach-tct_hammer.c b/arch/arm/mach-s3c24xx/mach-tct_hammer.c
index 1114666f0ef..1114666f0ef 100644
--- a/arch/arm/mach-s3c2410/mach-tct_hammer.c
+++ b/arch/arm/mach-s3c24xx/mach-tct_hammer.c
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c24xx/mach-vr1000.c
index dbe668a803e..87608d45dac 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c24xx/mach-vr1000.c
@@ -51,8 +51,7 @@
51#include <plat/iic.h> 51#include <plat/iic.h>
52#include <plat/audio-simtec.h> 52#include <plat/audio-simtec.h>
53 53
54#include "usb-simtec.h" 54#include "simtec.h"
55#include "nor-simtec.h"
56#include "common.h" 55#include "common.h"
57 56
58/* macros for virtual address mods for the io space entries */ 57/* macros for virtual address mods for the io space entries */
diff --git a/arch/arm/mach-s3c2412/mach-vstms.c b/arch/arm/mach-s3c24xx/mach-vstms.c
index 94bfaa1fb14..94bfaa1fb14 100644
--- a/arch/arm/mach-s3c2412/mach-vstms.c
+++ b/arch/arm/mach-s3c24xx/mach-vstms.c
diff --git a/arch/arm/mach-s3c2410/pm-h1940.S b/arch/arm/mach-s3c24xx/pm-h1940.S
index c93bf2db9f4..c93bf2db9f4 100644
--- a/arch/arm/mach-s3c2410/pm-h1940.S
+++ b/arch/arm/mach-s3c24xx/pm-h1940.S
diff --git a/arch/arm/mach-s3c2410/pm.c b/arch/arm/mach-s3c24xx/pm-s3c2410.c
index 03f706dd600..03f706dd600 100644
--- a/arch/arm/mach-s3c2410/pm.c
+++ b/arch/arm/mach-s3c24xx/pm-s3c2410.c
diff --git a/arch/arm/mach-s3c2412/pm.c b/arch/arm/mach-s3c24xx/pm-s3c2412.c
index d04588506ec..d04588506ec 100644
--- a/arch/arm/mach-s3c2412/pm.c
+++ b/arch/arm/mach-s3c24xx/pm-s3c2412.c
diff --git a/arch/arm/mach-s3c2416/pm.c b/arch/arm/mach-s3c24xx/pm-s3c2416.c
index 1bd4817b8eb..1bd4817b8eb 100644
--- a/arch/arm/mach-s3c2416/pm.c
+++ b/arch/arm/mach-s3c24xx/pm-s3c2416.c
diff --git a/arch/arm/mach-s3c2410/s3c2410.c b/arch/arm/mach-s3c24xx/s3c2410.c
index 061b6bb1a55..061b6bb1a55 100644
--- a/arch/arm/mach-s3c2410/s3c2410.c
+++ b/arch/arm/mach-s3c24xx/s3c2410.c
diff --git a/arch/arm/mach-s3c2412/s3c2412.c b/arch/arm/mach-s3c24xx/s3c2412.c
index c6eac987109..c6eac987109 100644
--- a/arch/arm/mach-s3c2412/s3c2412.c
+++ b/arch/arm/mach-s3c24xx/s3c2412.c
diff --git a/arch/arm/mach-s3c2416/s3c2416.c b/arch/arm/mach-s3c24xx/s3c2416.c
index 08bb0355159..08bb0355159 100644
--- a/arch/arm/mach-s3c2416/s3c2416.c
+++ b/arch/arm/mach-s3c24xx/s3c2416.c
diff --git a/arch/arm/mach-s3c2440/s3c2440.c b/arch/arm/mach-s3c24xx/s3c2440.c
index 517623a09fc..517623a09fc 100644
--- a/arch/arm/mach-s3c2440/s3c2440.c
+++ b/arch/arm/mach-s3c24xx/s3c2440.c
diff --git a/arch/arm/mach-s3c2440/s3c2442.c b/arch/arm/mach-s3c24xx/s3c2442.c
index 22cb7c94a8c..22cb7c94a8c 100644
--- a/arch/arm/mach-s3c2440/s3c2442.c
+++ b/arch/arm/mach-s3c24xx/s3c2442.c
diff --git a/arch/arm/mach-s3c2443/s3c2443.c b/arch/arm/mach-s3c24xx/s3c2443.c
index b9deaeb0dff..b9deaeb0dff 100644
--- a/arch/arm/mach-s3c2443/s3c2443.c
+++ b/arch/arm/mach-s3c24xx/s3c2443.c
diff --git a/arch/arm/mach-s3c2440/s3c244x.c b/arch/arm/mach-s3c24xx/s3c244x.c
index 36bc60f61d0..36bc60f61d0 100644
--- a/arch/arm/mach-s3c2440/s3c244x.c
+++ b/arch/arm/mach-s3c24xx/s3c244x.c
diff --git a/arch/arm/plat-s3c24xx/setup-i2c.c b/arch/arm/mach-s3c24xx/setup-i2c.c
index 9e90a7cbd1d..9e90a7cbd1d 100644
--- a/arch/arm/plat-s3c24xx/setup-i2c.c
+++ b/arch/arm/mach-s3c24xx/setup-i2c.c
diff --git a/arch/arm/mach-s3c2416/setup-sdhci-gpio.c b/arch/arm/mach-s3c24xx/setup-sdhci-gpio.c
index f65cb3ef16c..f65cb3ef16c 100644
--- a/arch/arm/mach-s3c2416/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s3c24xx/setup-sdhci-gpio.c
diff --git a/arch/arm/plat-s3c24xx/setup-ts.c b/arch/arm/mach-s3c24xx/setup-ts.c
index ed263866367..ed263866367 100644
--- a/arch/arm/plat-s3c24xx/setup-ts.c
+++ b/arch/arm/mach-s3c24xx/setup-ts.c
diff --git a/arch/arm/plat-s3c24xx/simtec-audio.c b/arch/arm/mach-s3c24xx/simtec-audio.c
index 6bc832e0d8e..11881c9a38c 100644
--- a/arch/arm/plat-s3c24xx/simtec-audio.c
+++ b/arch/arm/mach-s3c24xx/simtec-audio.c
@@ -27,6 +27,8 @@
27#include <plat/audio-simtec.h> 27#include <plat/audio-simtec.h>
28#include <plat/devs.h> 28#include <plat/devs.h>
29 29
30#include "simtec.h"
31
30/* platform ops for audio */ 32/* platform ops for audio */
31 33
32static void simtec_audio_startup_lrroute(void) 34static void simtec_audio_startup_lrroute(void)
diff --git a/arch/arm/mach-s3c2410/nor-simtec.c b/arch/arm/mach-s3c24xx/simtec-nor.c
index ad9f750f1e5..2119ca6a73b 100644
--- a/arch/arm/mach-s3c2410/nor-simtec.c
+++ b/arch/arm/mach-s3c24xx/simtec-nor.c
@@ -30,7 +30,7 @@
30#include <mach/bast-map.h> 30#include <mach/bast-map.h>
31#include <mach/bast-cpld.h> 31#include <mach/bast-cpld.h>
32 32
33#include "nor-simtec.h" 33#include "simtec.h"
34 34
35static void simtec_nor_vpp(struct platform_device *pdev, int vpp) 35static void simtec_nor_vpp(struct platform_device *pdev, int vpp)
36{ 36{
diff --git a/arch/arm/plat-s3c24xx/pm-simtec.c b/arch/arm/mach-s3c24xx/simtec-pm.c
index 68296b1fe7e..68296b1fe7e 100644
--- a/arch/arm/plat-s3c24xx/pm-simtec.c
+++ b/arch/arm/mach-s3c24xx/simtec-pm.c
diff --git a/arch/arm/mach-s3c2410/usb-simtec.c b/arch/arm/mach-s3c24xx/simtec-usb.c
index 29bd3d987be..d91c1a72513 100644
--- a/arch/arm/mach-s3c2410/usb-simtec.c
+++ b/arch/arm/mach-s3c24xx/simtec-usb.c
@@ -37,7 +37,7 @@
37#include <plat/usb-control.h> 37#include <plat/usb-control.h>
38#include <plat/devs.h> 38#include <plat/devs.h>
39 39
40#include "usb-simtec.h" 40#include "simtec.h"
41 41
42/* control power and monitor over-current events on various Simtec 42/* control power and monitor over-current events on various Simtec
43 * designed boards. 43 * designed boards.
diff --git a/arch/arm/mach-s3c2410/nor-simtec.h b/arch/arm/mach-s3c24xx/simtec.h
index f619c1e0d0c..ae8f4f9ad2e 100644
--- a/arch/arm/mach-s3c2410/nor-simtec.h
+++ b/arch/arm/mach-s3c24xx/simtec.h
@@ -4,11 +4,18 @@
4 * http://armlinux.simtec.co.uk/ 4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk> 5 * Ben Dooks <ben@simtec.co.uk>
6 * 6 *
7 * Simtec NOR mapping 7 * Simtec common functions
8 * 8 *
9 * This program is free software; you can redistribute it and/or modify 9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as 10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation. 11 * published by the Free Software Foundation.
12*/ 12*/
13 13
14struct s3c24xx_audio_simtec_pdata;
15
14extern void nor_simtec_init(void); 16extern void nor_simtec_init(void);
17
18extern int usb_simtec_init(void);
19
20extern int simtec_audio_add(const char *codec_name, bool has_lr_routing,
21 struct s3c24xx_audio_simtec_pdata *pdata);
diff --git a/arch/arm/mach-s3c2410/sleep.S b/arch/arm/mach-s3c24xx/sleep-s3c2410.S
index dd5b6388a5a..dd5b6388a5a 100644
--- a/arch/arm/mach-s3c2410/sleep.S
+++ b/arch/arm/mach-s3c24xx/sleep-s3c2410.S
diff --git a/arch/arm/mach-s3c2412/sleep.S b/arch/arm/mach-s3c24xx/sleep-s3c2412.S
index c82418ed714..c82418ed714 100644
--- a/arch/arm/mach-s3c2412/sleep.S
+++ b/arch/arm/mach-s3c24xx/sleep-s3c2412.S
diff --git a/arch/arm/mach-s3c64xx/common.h b/arch/arm/mach-s3c64xx/common.h
index 5eb9c9a7d73..7a10be629ab 100644
--- a/arch/arm/mach-s3c64xx/common.h
+++ b/arch/arm/mach-s3c64xx/common.h
@@ -25,8 +25,6 @@ void s3c64xx_setup_clocks(void);
25 25
26void s3c64xx_restart(char mode, const char *cmd); 26void s3c64xx_restart(char mode, const char *cmd);
27 27
28extern struct syscore_ops s3c64xx_irq_syscore_ops;
29
30#ifdef CONFIG_CPU_S3C6400 28#ifdef CONFIG_CPU_S3C6400
31 29
32extern int s3c6400_init(void); 30extern int s3c6400_init(void);
diff --git a/arch/arm/mach-s3c64xx/irq-pm.c b/arch/arm/mach-s3c64xx/irq-pm.c
index 8bec61e242c..0c7e1d960ca 100644
--- a/arch/arm/mach-s3c64xx/irq-pm.c
+++ b/arch/arm/mach-s3c64xx/irq-pm.c
@@ -96,7 +96,7 @@ static void s3c64xx_irq_pm_resume(void)
96 S3C_PMDBG("%s: IRQ configuration restored\n", __func__); 96 S3C_PMDBG("%s: IRQ configuration restored\n", __func__);
97} 97}
98 98
99struct syscore_ops s3c64xx_irq_syscore_ops = { 99static struct syscore_ops s3c64xx_irq_syscore_ops = {
100 .suspend = s3c64xx_irq_pm_suspend, 100 .suspend = s3c64xx_irq_pm_suspend,
101 .resume = s3c64xx_irq_pm_resume, 101 .resume = s3c64xx_irq_pm_resume,
102}; 102};
diff --git a/arch/arm/mach-s5p64x0/clock.c b/arch/arm/mach-s5p64x0/clock.c
index 241d0e645c8..57e718957ef 100644
--- a/arch/arm/mach-s5p64x0/clock.c
+++ b/arch/arm/mach-s5p64x0/clock.c
@@ -73,7 +73,7 @@ static const u32 clock_table[][3] = {
73 {L2 * 1000, (3 << ARM_DIV_RATIO_SHIFT), (0 << S5P64X0_CLKDIV0_HCLK_SHIFT)}, 73 {L2 * 1000, (3 << ARM_DIV_RATIO_SHIFT), (0 << S5P64X0_CLKDIV0_HCLK_SHIFT)},
74}; 74};
75 75
76unsigned long s5p64x0_armclk_get_rate(struct clk *clk) 76static unsigned long s5p64x0_armclk_get_rate(struct clk *clk)
77{ 77{
78 unsigned long rate = clk_get_rate(clk->parent); 78 unsigned long rate = clk_get_rate(clk->parent);
79 u32 clkdiv; 79 u32 clkdiv;
@@ -84,7 +84,8 @@ unsigned long s5p64x0_armclk_get_rate(struct clk *clk)
84 return rate / (clkdiv + 1); 84 return rate / (clkdiv + 1);
85} 85}
86 86
87unsigned long s5p64x0_armclk_round_rate(struct clk *clk, unsigned long rate) 87static unsigned long s5p64x0_armclk_round_rate(struct clk *clk,
88 unsigned long rate)
88{ 89{
89 u32 iter; 90 u32 iter;
90 91
@@ -96,7 +97,7 @@ unsigned long s5p64x0_armclk_round_rate(struct clk *clk, unsigned long rate)
96 return clock_table[ARRAY_SIZE(clock_table) - 1][0]; 97 return clock_table[ARRAY_SIZE(clock_table) - 1][0];
97} 98}
98 99
99int s5p64x0_armclk_set_rate(struct clk *clk, unsigned long rate) 100static int s5p64x0_armclk_set_rate(struct clk *clk, unsigned long rate)
100{ 101{
101 u32 round_tmp; 102 u32 round_tmp;
102 u32 iter; 103 u32 iter;
@@ -148,7 +149,7 @@ int s5p64x0_armclk_set_rate(struct clk *clk, unsigned long rate)
148 return 0; 149 return 0;
149} 150}
150 151
151struct clk_ops s5p64x0_clkarm_ops = { 152static struct clk_ops s5p64x0_clkarm_ops = {
152 .get_rate = s5p64x0_armclk_get_rate, 153 .get_rate = s5p64x0_armclk_get_rate,
153 .set_rate = s5p64x0_armclk_set_rate, 154 .set_rate = s5p64x0_armclk_set_rate,
154 .round_rate = s5p64x0_armclk_round_rate, 155 .round_rate = s5p64x0_armclk_round_rate,
@@ -173,7 +174,7 @@ struct clksrc_clk clk_dout_mpll = {
173 .reg_div = { .reg = S5P64X0_CLK_DIV0, .shift = 4, .size = 1 }, 174 .reg_div = { .reg = S5P64X0_CLK_DIV0, .shift = 4, .size = 1 },
174}; 175};
175 176
176struct clk *clkset_hclk_low_list[] = { 177static struct clk *clkset_hclk_low_list[] = {
177 &clk_mout_apll.clk, 178 &clk_mout_apll.clk,
178 &clk_mout_mpll.clk, 179 &clk_mout_mpll.clk,
179}; 180};
diff --git a/arch/arm/mach-s5p64x0/dma.c b/arch/arm/mach-s5p64x0/dma.c
index f7f68ad7791..2ee5dc069b3 100644
--- a/arch/arm/mach-s5p64x0/dma.c
+++ b/arch/arm/mach-s5p64x0/dma.c
@@ -38,7 +38,7 @@
38 38
39static u64 dma_dmamask = DMA_BIT_MASK(32); 39static u64 dma_dmamask = DMA_BIT_MASK(32);
40 40
41u8 s5p6440_pdma_peri[] = { 41static u8 s5p6440_pdma_peri[] = {
42 DMACH_UART0_RX, 42 DMACH_UART0_RX,
43 DMACH_UART0_TX, 43 DMACH_UART0_TX,
44 DMACH_UART1_RX, 44 DMACH_UART1_RX,
@@ -63,12 +63,12 @@ u8 s5p6440_pdma_peri[] = {
63 DMACH_SPI1_RX, 63 DMACH_SPI1_RX,
64}; 64};
65 65
66struct dma_pl330_platdata s5p6440_pdma_pdata = { 66static struct dma_pl330_platdata s5p6440_pdma_pdata = {
67 .nr_valid_peri = ARRAY_SIZE(s5p6440_pdma_peri), 67 .nr_valid_peri = ARRAY_SIZE(s5p6440_pdma_peri),
68 .peri_id = s5p6440_pdma_peri, 68 .peri_id = s5p6440_pdma_peri,
69}; 69};
70 70
71u8 s5p6450_pdma_peri[] = { 71static u8 s5p6450_pdma_peri[] = {
72 DMACH_UART0_RX, 72 DMACH_UART0_RX,
73 DMACH_UART0_TX, 73 DMACH_UART0_TX,
74 DMACH_UART1_RX, 74 DMACH_UART1_RX,
@@ -103,13 +103,13 @@ u8 s5p6450_pdma_peri[] = {
103 DMACH_UART5_TX, 103 DMACH_UART5_TX,
104}; 104};
105 105
106struct dma_pl330_platdata s5p6450_pdma_pdata = { 106static struct dma_pl330_platdata s5p6450_pdma_pdata = {
107 .nr_valid_peri = ARRAY_SIZE(s5p6450_pdma_peri), 107 .nr_valid_peri = ARRAY_SIZE(s5p6450_pdma_peri),
108 .peri_id = s5p6450_pdma_peri, 108 .peri_id = s5p6450_pdma_peri,
109}; 109};
110 110
111AMBA_AHB_DEVICE(s5p64x0_pdma, "dma-pl330", 0x00041330, S5P64X0_PA_PDMA, 111static AMBA_AHB_DEVICE(s5p64x0_pdma, "dma-pl330", 0x00041330,
112 {IRQ_DMA0}, NULL); 112 S5P64X0_PA_PDMA, {IRQ_DMA0}, NULL);
113 113
114static int __init s5p64x0_dma_init(void) 114static int __init s5p64x0_dma_init(void)
115{ 115{
diff --git a/arch/arm/mach-s5p64x0/include/mach/s5p64x0-clock.h b/arch/arm/mach-s5p64x0/include/mach/s5p64x0-clock.h
index ff85b4b6e8d..0ef47d1b767 100644
--- a/arch/arm/mach-s5p64x0/include/mach/s5p64x0-clock.h
+++ b/arch/arm/mach-s5p64x0/include/mach/s5p64x0-clock.h
@@ -22,16 +22,9 @@ extern struct clksrc_clk clk_mout_epll;
22extern int s5p64x0_epll_enable(struct clk *clk, int enable); 22extern int s5p64x0_epll_enable(struct clk *clk, int enable);
23extern unsigned long s5p64x0_epll_get_rate(struct clk *clk); 23extern unsigned long s5p64x0_epll_get_rate(struct clk *clk);
24 24
25extern unsigned long s5p64x0_armclk_get_rate(struct clk *clk);
26extern unsigned long s5p64x0_armclk_round_rate(struct clk *clk, unsigned long rate);
27extern int s5p64x0_armclk_set_rate(struct clk *clk, unsigned long rate);
28
29extern struct clk_ops s5p64x0_clkarm_ops;
30
31extern struct clksrc_clk clk_armclk; 25extern struct clksrc_clk clk_armclk;
32extern struct clksrc_clk clk_dout_mpll; 26extern struct clksrc_clk clk_dout_mpll;
33 27
34extern struct clk *clkset_hclk_low_list[];
35extern struct clksrc_sources clkset_hclk_low; 28extern struct clksrc_sources clkset_hclk_low;
36 29
37extern int s5p64x0_pclk_ctrl(struct clk *clk, int enable); 30extern int s5p64x0_pclk_ctrl(struct clk *clk, int enable);
diff --git a/arch/arm/mach-s5pc100/clock.c b/arch/arm/mach-s5pc100/clock.c
index 247194dd366..16eca4ea201 100644
--- a/arch/arm/mach-s5pc100/clock.c
+++ b/arch/arm/mach-s5pc100/clock.c
@@ -170,7 +170,7 @@ static struct clk *clk_src_mout_am_list[] = {
170 [1] = &clk_div_apll2.clk, 170 [1] = &clk_div_apll2.clk,
171}; 171};
172 172
173struct clksrc_sources clk_src_mout_am = { 173static struct clksrc_sources clk_src_mout_am = {
174 .sources = clk_src_mout_am_list, 174 .sources = clk_src_mout_am_list,
175 .nr_sources = ARRAY_SIZE(clk_src_mout_am_list), 175 .nr_sources = ARRAY_SIZE(clk_src_mout_am_list),
176}; 176};
@@ -212,7 +212,7 @@ static struct clk *clk_src_mout_onenand_list[] = {
212 [1] = &clk_div_d1_bus.clk, 212 [1] = &clk_div_d1_bus.clk,
213}; 213};
214 214
215struct clksrc_sources clk_src_mout_onenand = { 215static struct clksrc_sources clk_src_mout_onenand = {
216 .sources = clk_src_mout_onenand_list, 216 .sources = clk_src_mout_onenand_list,
217 .nr_sources = ARRAY_SIZE(clk_src_mout_onenand_list), 217 .nr_sources = ARRAY_SIZE(clk_src_mout_onenand_list),
218}; 218};
@@ -756,7 +756,7 @@ static struct clk *clk_src_group1_list[] = {
756 [3] = &clk_mout_hpll.clk, 756 [3] = &clk_mout_hpll.clk,
757}; 757};
758 758
759struct clksrc_sources clk_src_group1 = { 759static struct clksrc_sources clk_src_group1 = {
760 .sources = clk_src_group1_list, 760 .sources = clk_src_group1_list,
761 .nr_sources = ARRAY_SIZE(clk_src_group1_list), 761 .nr_sources = ARRAY_SIZE(clk_src_group1_list),
762}; 762};
@@ -766,7 +766,7 @@ static struct clk *clk_src_group2_list[] = {
766 [1] = &clk_div_mpll.clk, 766 [1] = &clk_div_mpll.clk,
767}; 767};
768 768
769struct clksrc_sources clk_src_group2 = { 769static struct clksrc_sources clk_src_group2 = {
770 .sources = clk_src_group2_list, 770 .sources = clk_src_group2_list,
771 .nr_sources = ARRAY_SIZE(clk_src_group2_list), 771 .nr_sources = ARRAY_SIZE(clk_src_group2_list),
772}; 772};
@@ -780,7 +780,7 @@ static struct clk *clk_src_group3_list[] = {
780 [5] = &clk_mout_hpll.clk, 780 [5] = &clk_mout_hpll.clk,
781}; 781};
782 782
783struct clksrc_sources clk_src_group3 = { 783static struct clksrc_sources clk_src_group3 = {
784 .sources = clk_src_group3_list, 784 .sources = clk_src_group3_list,
785 .nr_sources = ARRAY_SIZE(clk_src_group3_list), 785 .nr_sources = ARRAY_SIZE(clk_src_group3_list),
786}; 786};
@@ -806,7 +806,7 @@ static struct clk *clk_src_group4_list[] = {
806 [5] = &clk_mout_hpll.clk, 806 [5] = &clk_mout_hpll.clk,
807}; 807};
808 808
809struct clksrc_sources clk_src_group4 = { 809static struct clksrc_sources clk_src_group4 = {
810 .sources = clk_src_group4_list, 810 .sources = clk_src_group4_list,
811 .nr_sources = ARRAY_SIZE(clk_src_group4_list), 811 .nr_sources = ARRAY_SIZE(clk_src_group4_list),
812}; 812};
@@ -831,7 +831,7 @@ static struct clk *clk_src_group5_list[] = {
831 [4] = &clk_mout_hpll.clk, 831 [4] = &clk_mout_hpll.clk,
832}; 832};
833 833
834struct clksrc_sources clk_src_group5 = { 834static struct clksrc_sources clk_src_group5 = {
835 .sources = clk_src_group5_list, 835 .sources = clk_src_group5_list,
836 .nr_sources = ARRAY_SIZE(clk_src_group5_list), 836 .nr_sources = ARRAY_SIZE(clk_src_group5_list),
837}; 837};
@@ -854,7 +854,7 @@ static struct clk *clk_src_group6_list[] = {
854 [2] = &clk_div_hdmi.clk, 854 [2] = &clk_div_hdmi.clk,
855}; 855};
856 856
857struct clksrc_sources clk_src_group6 = { 857static struct clksrc_sources clk_src_group6 = {
858 .sources = clk_src_group6_list, 858 .sources = clk_src_group6_list,
859 .nr_sources = ARRAY_SIZE(clk_src_group6_list), 859 .nr_sources = ARRAY_SIZE(clk_src_group6_list),
860}; 860};
@@ -866,7 +866,7 @@ static struct clk *clk_src_group7_list[] = {
866 [3] = &clk_vclk54m, 866 [3] = &clk_vclk54m,
867}; 867};
868 868
869struct clksrc_sources clk_src_group7 = { 869static struct clksrc_sources clk_src_group7 = {
870 .sources = clk_src_group7_list, 870 .sources = clk_src_group7_list,
871 .nr_sources = ARRAY_SIZE(clk_src_group7_list), 871 .nr_sources = ARRAY_SIZE(clk_src_group7_list),
872}; 872};
@@ -877,7 +877,7 @@ static struct clk *clk_src_mmc0_list[] = {
877 [2] = &clk_fin_epll, 877 [2] = &clk_fin_epll,
878}; 878};
879 879
880struct clksrc_sources clk_src_mmc0 = { 880static struct clksrc_sources clk_src_mmc0 = {
881 .sources = clk_src_mmc0_list, 881 .sources = clk_src_mmc0_list,
882 .nr_sources = ARRAY_SIZE(clk_src_mmc0_list), 882 .nr_sources = ARRAY_SIZE(clk_src_mmc0_list),
883}; 883};
@@ -889,7 +889,7 @@ static struct clk *clk_src_mmc12_list[] = {
889 [3] = &clk_mout_hpll.clk, 889 [3] = &clk_mout_hpll.clk,
890}; 890};
891 891
892struct clksrc_sources clk_src_mmc12 = { 892static struct clksrc_sources clk_src_mmc12 = {
893 .sources = clk_src_mmc12_list, 893 .sources = clk_src_mmc12_list,
894 .nr_sources = ARRAY_SIZE(clk_src_mmc12_list), 894 .nr_sources = ARRAY_SIZE(clk_src_mmc12_list),
895}; 895};
@@ -901,7 +901,7 @@ static struct clk *clk_src_irda_usb_list[] = {
901 [3] = &clk_mout_hpll.clk, 901 [3] = &clk_mout_hpll.clk,
902}; 902};
903 903
904struct clksrc_sources clk_src_irda_usb = { 904static struct clksrc_sources clk_src_irda_usb = {
905 .sources = clk_src_irda_usb_list, 905 .sources = clk_src_irda_usb_list,
906 .nr_sources = ARRAY_SIZE(clk_src_irda_usb_list), 906 .nr_sources = ARRAY_SIZE(clk_src_irda_usb_list),
907}; 907};
@@ -912,7 +912,7 @@ static struct clk *clk_src_pwi_list[] = {
912 [2] = &clk_div_mpll.clk, 912 [2] = &clk_div_mpll.clk,
913}; 913};
914 914
915struct clksrc_sources clk_src_pwi = { 915static struct clksrc_sources clk_src_pwi = {
916 .sources = clk_src_pwi_list, 916 .sources = clk_src_pwi_list,
917 .nr_sources = ARRAY_SIZE(clk_src_pwi_list), 917 .nr_sources = ARRAY_SIZE(clk_src_pwi_list),
918}; 918};
@@ -923,7 +923,7 @@ static struct clk *clk_sclk_spdif_list[] = {
923 [2] = &clk_sclk_audio2.clk, 923 [2] = &clk_sclk_audio2.clk,
924}; 924};
925 925
926struct clksrc_sources clk_src_sclk_spdif = { 926static struct clksrc_sources clk_src_sclk_spdif = {
927 .sources = clk_sclk_spdif_list, 927 .sources = clk_sclk_spdif_list,
928 .nr_sources = ARRAY_SIZE(clk_sclk_spdif_list), 928 .nr_sources = ARRAY_SIZE(clk_sclk_spdif_list),
929}; 929};
diff --git a/arch/arm/mach-s5pc100/dma.c b/arch/arm/mach-s5pc100/dma.c
index 96b1ab3dcd4..afd8db2d599 100644
--- a/arch/arm/mach-s5pc100/dma.c
+++ b/arch/arm/mach-s5pc100/dma.c
@@ -35,7 +35,7 @@
35 35
36static u64 dma_dmamask = DMA_BIT_MASK(32); 36static u64 dma_dmamask = DMA_BIT_MASK(32);
37 37
38u8 pdma0_peri[] = { 38static u8 pdma0_peri[] = {
39 DMACH_UART0_RX, 39 DMACH_UART0_RX,
40 DMACH_UART0_TX, 40 DMACH_UART0_TX,
41 DMACH_UART1_RX, 41 DMACH_UART1_RX,
@@ -68,15 +68,15 @@ u8 pdma0_peri[] = {
68 DMACH_HSI_TX, 68 DMACH_HSI_TX,
69}; 69};
70 70
71struct dma_pl330_platdata s5pc100_pdma0_pdata = { 71static struct dma_pl330_platdata s5pc100_pdma0_pdata = {
72 .nr_valid_peri = ARRAY_SIZE(pdma0_peri), 72 .nr_valid_peri = ARRAY_SIZE(pdma0_peri),
73 .peri_id = pdma0_peri, 73 .peri_id = pdma0_peri,
74}; 74};
75 75
76AMBA_AHB_DEVICE(s5pc100_pdma0, "dma-pl330.0", 0x00041330, S5PC100_PA_PDMA0, 76static AMBA_AHB_DEVICE(s5pc100_pdma0, "dma-pl330.0", 0x00041330,
77 {IRQ_PDMA0}, &s5pc100_pdma0_pdata); 77 S5PC100_PA_PDMA0, {IRQ_PDMA0}, &s5pc100_pdma0_pdata);
78 78
79u8 pdma1_peri[] = { 79static u8 pdma1_peri[] = {
80 DMACH_UART0_RX, 80 DMACH_UART0_RX,
81 DMACH_UART0_TX, 81 DMACH_UART0_TX,
82 DMACH_UART1_RX, 82 DMACH_UART1_RX,
@@ -109,13 +109,13 @@ u8 pdma1_peri[] = {
109 DMACH_MSM_REQ3, 109 DMACH_MSM_REQ3,
110}; 110};
111 111
112struct dma_pl330_platdata s5pc100_pdma1_pdata = { 112static struct dma_pl330_platdata s5pc100_pdma1_pdata = {
113 .nr_valid_peri = ARRAY_SIZE(pdma1_peri), 113 .nr_valid_peri = ARRAY_SIZE(pdma1_peri),
114 .peri_id = pdma1_peri, 114 .peri_id = pdma1_peri,
115}; 115};
116 116
117AMBA_AHB_DEVICE(s5pc100_pdma1, "dma-pl330.1", 0x00041330, S5PC100_PA_PDMA1, 117static AMBA_AHB_DEVICE(s5pc100_pdma1, "dma-pl330.1", 0x00041330,
118 {IRQ_PDMA1}, &s5pc100_pdma1_pdata); 118 S5PC100_PA_PDMA1, {IRQ_PDMA1}, &s5pc100_pdma1_pdata);
119 119
120static int __init s5pc100_dma_init(void) 120static int __init s5pc100_dma_init(void)
121{ 121{
diff --git a/arch/arm/mach-s5pv210/dma.c b/arch/arm/mach-s5pv210/dma.c
index f6885d247d1..86ce62f6619 100644
--- a/arch/arm/mach-s5pv210/dma.c
+++ b/arch/arm/mach-s5pv210/dma.c
@@ -35,7 +35,7 @@
35 35
36static u64 dma_dmamask = DMA_BIT_MASK(32); 36static u64 dma_dmamask = DMA_BIT_MASK(32);
37 37
38u8 pdma0_peri[] = { 38static u8 pdma0_peri[] = {
39 DMACH_UART0_RX, 39 DMACH_UART0_RX,
40 DMACH_UART0_TX, 40 DMACH_UART0_TX,
41 DMACH_UART1_RX, 41 DMACH_UART1_RX,
@@ -66,15 +66,15 @@ u8 pdma0_peri[] = {
66 DMACH_SPDIF, 66 DMACH_SPDIF,
67}; 67};
68 68
69struct dma_pl330_platdata s5pv210_pdma0_pdata = { 69static struct dma_pl330_platdata s5pv210_pdma0_pdata = {
70 .nr_valid_peri = ARRAY_SIZE(pdma0_peri), 70 .nr_valid_peri = ARRAY_SIZE(pdma0_peri),
71 .peri_id = pdma0_peri, 71 .peri_id = pdma0_peri,
72}; 72};
73 73
74AMBA_AHB_DEVICE(s5pv210_pdma0, "dma-pl330.0", 0x00041330, S5PV210_PA_PDMA0, 74static AMBA_AHB_DEVICE(s5pv210_pdma0, "dma-pl330.0", 0x00041330,
75 {IRQ_PDMA0}, &s5pv210_pdma0_pdata); 75 S5PV210_PA_PDMA0, {IRQ_PDMA0}, &s5pv210_pdma0_pdata);
76 76
77u8 pdma1_peri[] = { 77static u8 pdma1_peri[] = {
78 DMACH_UART0_RX, 78 DMACH_UART0_RX,
79 DMACH_UART0_TX, 79 DMACH_UART0_TX,
80 DMACH_UART1_RX, 80 DMACH_UART1_RX,
@@ -109,13 +109,13 @@ u8 pdma1_peri[] = {
109 DMACH_PCM2_TX, 109 DMACH_PCM2_TX,
110}; 110};
111 111
112struct dma_pl330_platdata s5pv210_pdma1_pdata = { 112static struct dma_pl330_platdata s5pv210_pdma1_pdata = {
113 .nr_valid_peri = ARRAY_SIZE(pdma1_peri), 113 .nr_valid_peri = ARRAY_SIZE(pdma1_peri),
114 .peri_id = pdma1_peri, 114 .peri_id = pdma1_peri,
115}; 115};
116 116
117AMBA_AHB_DEVICE(s5pv210_pdma1, "dma-pl330.1", 0x00041330, S5PV210_PA_PDMA1, 117static AMBA_AHB_DEVICE(s5pv210_pdma1, "dma-pl330.1", 0x00041330,
118 {IRQ_PDMA1}, &s5pv210_pdma1_pdata); 118 S5PV210_PA_PDMA1, {IRQ_PDMA1}, &s5pv210_pdma1_pdata);
119 119
120static int __init s5pv210_dma_init(void) 120static int __init s5pv210_dma_init(void)
121{ 121{
diff --git a/arch/arm/mach-s5pv210/mach-goni.c b/arch/arm/mach-s5pv210/mach-goni.c
index ff915261043..2cf5ed75f39 100644
--- a/arch/arm/mach-s5pv210/mach-goni.c
+++ b/arch/arm/mach-s5pv210/mach-goni.c
@@ -844,7 +844,7 @@ static struct s5p_fimc_isp_info goni_camera_sensors[] = {
844 }, 844 },
845}; 845};
846 846
847struct s5p_platform_fimc goni_fimc_md_platdata __initdata = { 847static struct s5p_platform_fimc goni_fimc_md_platdata __initdata = {
848 .isp_info = goni_camera_sensors, 848 .isp_info = goni_camera_sensors,
849 .num_clients = ARRAY_SIZE(goni_camera_sensors), 849 .num_clients = ARRAY_SIZE(goni_camera_sensors),
850}; 850};
diff --git a/arch/arm/mach-s5pv210/mach-smdkv210.c b/arch/arm/mach-s5pv210/mach-smdkv210.c
index dff9ea7b5bb..0933c8e1eb7 100644
--- a/arch/arm/mach-s5pv210/mach-smdkv210.c
+++ b/arch/arm/mach-s5pv210/mach-smdkv210.c
@@ -140,7 +140,7 @@ static struct dm9000_plat_data smdkv210_dm9000_platdata = {
140 .dev_addr = { 0x00, 0x09, 0xc0, 0xff, 0xec, 0x48 }, 140 .dev_addr = { 0x00, 0x09, 0xc0, 0xff, 0xec, 0x48 },
141}; 141};
142 142
143struct platform_device smdkv210_dm9000 = { 143static struct platform_device smdkv210_dm9000 = {
144 .name = "dm9000", 144 .name = "dm9000",
145 .id = -1, 145 .id = -1,
146 .num_resources = ARRAY_SIZE(smdkv210_dm9000_resources), 146 .num_resources = ARRAY_SIZE(smdkv210_dm9000_resources),
diff --git a/arch/arm/mach-shmobile/board-ag5evm.c b/arch/arm/mach-shmobile/board-ag5evm.c
index eff8a96c75e..068b754bc34 100644
--- a/arch/arm/mach-shmobile/board-ag5evm.c
+++ b/arch/arm/mach-shmobile/board-ag5evm.c
@@ -30,6 +30,7 @@
30#include <linux/serial_sci.h> 30#include <linux/serial_sci.h>
31#include <linux/smsc911x.h> 31#include <linux/smsc911x.h>
32#include <linux/gpio.h> 32#include <linux/gpio.h>
33#include <linux/videodev2.h>
33#include <linux/input.h> 34#include <linux/input.h>
34#include <linux/input/sh_keysc.h> 35#include <linux/input/sh_keysc.h>
35#include <linux/mmc/host.h> 36#include <linux/mmc/host.h>
@@ -37,7 +38,6 @@
37#include <linux/mmc/sh_mobile_sdhi.h> 38#include <linux/mmc/sh_mobile_sdhi.h>
38#include <linux/mfd/tmio.h> 39#include <linux/mfd/tmio.h>
39#include <linux/sh_clk.h> 40#include <linux/sh_clk.h>
40#include <linux/dma-mapping.h>
41#include <video/sh_mobile_lcdc.h> 41#include <video/sh_mobile_lcdc.h>
42#include <video/sh_mipi_dsi.h> 42#include <video/sh_mipi_dsi.h>
43#include <sound/sh_fsi.h> 43#include <sound/sh_fsi.h>
@@ -159,19 +159,12 @@ static struct resource sh_mmcif_resources[] = {
159 }, 159 },
160}; 160};
161 161
162static struct sh_mmcif_dma sh_mmcif_dma = {
163 .chan_priv_rx = {
164 .slave_id = SHDMA_SLAVE_MMCIF_RX,
165 },
166 .chan_priv_tx = {
167 .slave_id = SHDMA_SLAVE_MMCIF_TX,
168 },
169};
170static struct sh_mmcif_plat_data sh_mmcif_platdata = { 162static struct sh_mmcif_plat_data sh_mmcif_platdata = {
171 .sup_pclk = 0, 163 .sup_pclk = 0,
172 .ocr = MMC_VDD_165_195, 164 .ocr = MMC_VDD_165_195,
173 .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE, 165 .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
174 .dma = &sh_mmcif_dma, 166 .slave_id_tx = SHDMA_SLAVE_MMCIF_TX,
167 .slave_id_rx = SHDMA_SLAVE_MMCIF_RX,
175}; 168};
176 169
177static struct platform_device mmc_device = { 170static struct platform_device mmc_device = {
@@ -321,12 +314,11 @@ static struct resource mipidsi0_resources[] = {
321 }, 314 },
322}; 315};
323 316
324#define DSI0PHYCR 0xe615006c
325static int sh_mipi_set_dot_clock(struct platform_device *pdev, 317static int sh_mipi_set_dot_clock(struct platform_device *pdev,
326 void __iomem *base, 318 void __iomem *base,
327 int enable) 319 int enable)
328{ 320{
329 struct clk *pck; 321 struct clk *pck, *phy;
330 int ret; 322 int ret;
331 323
332 pck = clk_get(&pdev->dev, "dsip_clk"); 324 pck = clk_get(&pdev->dev, "dsip_clk");
@@ -335,18 +327,27 @@ static int sh_mipi_set_dot_clock(struct platform_device *pdev,
335 goto sh_mipi_set_dot_clock_pck_err; 327 goto sh_mipi_set_dot_clock_pck_err;
336 } 328 }
337 329
330 phy = clk_get(&pdev->dev, "dsiphy_clk");
331 if (IS_ERR(phy)) {
332 ret = PTR_ERR(phy);
333 goto sh_mipi_set_dot_clock_phy_err;
334 }
335
338 if (enable) { 336 if (enable) {
339 clk_set_rate(pck, clk_round_rate(pck, 24000000)); 337 clk_set_rate(pck, clk_round_rate(pck, 24000000));
340 __raw_writel(0x2a809010, DSI0PHYCR); 338 clk_set_rate(phy, clk_round_rate(pck, 510000000));
341 clk_enable(pck); 339 clk_enable(pck);
340 clk_enable(phy);
342 } else { 341 } else {
343 clk_disable(pck); 342 clk_disable(pck);
343 clk_disable(phy);
344 } 344 }
345 345
346 ret = 0; 346 ret = 0;
347 347
348 clk_put(phy);
349sh_mipi_set_dot_clock_phy_err:
348 clk_put(pck); 350 clk_put(pck);
349
350sh_mipi_set_dot_clock_pck_err: 351sh_mipi_set_dot_clock_pck_err:
351 return ret; 352 return ret;
352} 353}
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index aab0a349f75..eeb4d966458 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -295,15 +295,6 @@ static struct resource sh_mmcif_resources[] = {
295 }, 295 },
296}; 296};
297 297
298static struct sh_mmcif_dma sh_mmcif_dma = {
299 .chan_priv_rx = {
300 .slave_id = SHDMA_SLAVE_MMCIF_RX,
301 },
302 .chan_priv_tx = {
303 .slave_id = SHDMA_SLAVE_MMCIF_TX,
304 },
305};
306
307static struct sh_mmcif_plat_data sh_mmcif_plat = { 298static struct sh_mmcif_plat_data sh_mmcif_plat = {
308 .sup_pclk = 0, 299 .sup_pclk = 0,
309 .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34, 300 .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
@@ -311,7 +302,8 @@ static struct sh_mmcif_plat_data sh_mmcif_plat = {
311 MMC_CAP_8_BIT_DATA | 302 MMC_CAP_8_BIT_DATA |
312 MMC_CAP_NEEDS_POLL, 303 MMC_CAP_NEEDS_POLL,
313 .get_cd = slot_cn7_get_cd, 304 .get_cd = slot_cn7_get_cd,
314 .dma = &sh_mmcif_dma, 305 .slave_id_tx = SHDMA_SLAVE_MMCIF_TX,
306 .slave_id_rx = SHDMA_SLAVE_MMCIF_RX,
315}; 307};
316 308
317static struct platform_device sh_mmcif_device = { 309static struct platform_device sh_mmcif_device = {
diff --git a/arch/arm/mach-shmobile/board-kota2.c b/arch/arm/mach-shmobile/board-kota2.c
index 857ceeec1bb..c8e7ca23fc0 100644
--- a/arch/arm/mach-shmobile/board-kota2.c
+++ b/arch/arm/mach-shmobile/board-kota2.c
@@ -143,11 +143,10 @@ static struct gpio_keys_button gpio_buttons[] = {
143static struct gpio_keys_platform_data gpio_key_info = { 143static struct gpio_keys_platform_data gpio_key_info = {
144 .buttons = gpio_buttons, 144 .buttons = gpio_buttons,
145 .nbuttons = ARRAY_SIZE(gpio_buttons), 145 .nbuttons = ARRAY_SIZE(gpio_buttons),
146 .poll_interval = 250, /* polled for now */
147}; 146};
148 147
149static struct platform_device gpio_keys_device = { 148static struct platform_device gpio_keys_device = {
150 .name = "gpio-keys-polled", /* polled for now */ 149 .name = "gpio-keys",
151 .id = -1, 150 .id = -1,
152 .dev = { 151 .dev = {
153 .platform_data = &gpio_key_info, 152 .platform_data = &gpio_key_info,
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 9b42fbd10f8..a2813247b45 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -43,7 +43,6 @@
43#include <linux/smsc911x.h> 43#include <linux/smsc911x.h>
44#include <linux/sh_intc.h> 44#include <linux/sh_intc.h>
45#include <linux/tca6416_keypad.h> 45#include <linux/tca6416_keypad.h>
46#include <linux/usb/r8a66597.h>
47#include <linux/usb/renesas_usbhs.h> 46#include <linux/usb/renesas_usbhs.h>
48#include <linux/dma-mapping.h> 47#include <linux/dma-mapping.h>
49 48
@@ -145,11 +144,6 @@
145 * 1-2 short | VBUS 5V | Host 144 * 1-2 short | VBUS 5V | Host
146 * open | external VBUS | Function 145 * open | external VBUS | Function
147 * 146 *
148 * *1
149 * CN31 is used as
150 * CONFIG_USB_R8A66597_HCD Host
151 * CONFIG_USB_RENESAS_USBHS Function
152 *
153 * CAUTION 147 * CAUTION
154 * 148 *
155 * renesas_usbhs driver can use external interrupt mode 149 * renesas_usbhs driver can use external interrupt mode
@@ -161,15 +155,6 @@
161 * mackerel can not use external interrupt (IRQ7-PORT167) mode on "USB0", 155 * mackerel can not use external interrupt (IRQ7-PORT167) mode on "USB0",
162 * because Touchscreen is using IRQ7-PORT40. 156 * because Touchscreen is using IRQ7-PORT40.
163 * It is impossible to use IRQ7 demux on this board. 157 * It is impossible to use IRQ7 demux on this board.
164 *
165 * We can use external interrupt mode USB-Function on "USB1".
166 * USB1 can become Host by r8a66597, and become Function by renesas_usbhs.
167 * But don't select both drivers in same time.
168 * These uses same IRQ number for request_irq(), and aren't supporting
169 * IRQF_SHARED / IORESOURCE_IRQ_SHAREABLE.
170 *
171 * Actually these are old/new version of USB driver.
172 * This mean its register will be broken if it supports shared IRQ,
173 */ 158 */
174 159
175/* 160/*
@@ -208,6 +193,16 @@
208 */ 193 */
209 194
210/* 195/*
196 * FSI - AK4642
197 *
198 * it needs amixer settings for playing
199 *
200 * amixer set "Headphone" on
201 * amixer set "HPOUTL Mixer DACH" on
202 * amixer set "HPOUTR Mixer DACH" on
203 */
204
205/*
211 * FIXME !! 206 * FIXME !!
212 * 207 *
213 * gpio_no_direction 208 * gpio_no_direction
@@ -676,51 +671,16 @@ static struct platform_device usbhs0_device = {
676 * Use J30 to select between Host and Function. This setting 671 * Use J30 to select between Host and Function. This setting
677 * can however not be detected by software. Hotplug of USBHS1 672 * can however not be detected by software. Hotplug of USBHS1
678 * is provided via IRQ8. 673 * is provided via IRQ8.
674 *
675 * Current USB1 works as "USB Host".
676 * - set J30 "short"
677 *
678 * If you want to use it as "USB gadget",
679 * - J30 "open"
680 * - modify usbhs1_get_id() USBHS_HOST -> USBHS_GADGET
681 * - add .get_vbus = usbhs_get_vbus in usbhs1_private
679 */ 682 */
680#define IRQ8 evt2irq(0x0300) 683#define IRQ8 evt2irq(0x0300)
681
682/* USBHS1 USB Host support via r8a66597_hcd */
683static void usb1_host_port_power(int port, int power)
684{
685 if (!power) /* only power-on is supported for now */
686 return;
687
688 /* set VBOUT/PWEN and EXTLP1 in DVSTCTR */
689 __raw_writew(__raw_readw(0xE68B0008) | 0x600, 0xE68B0008);
690}
691
692static struct r8a66597_platdata usb1_host_data = {
693 .on_chip = 1,
694 .port_power = usb1_host_port_power,
695};
696
697static struct resource usb1_host_resources[] = {
698 [0] = {
699 .name = "USBHS1",
700 .start = 0xe68b0000,
701 .end = 0xe68b00e6 - 1,
702 .flags = IORESOURCE_MEM,
703 },
704 [1] = {
705 .start = evt2irq(0x1ce0) /* USB1_USB1I0 */,
706 .flags = IORESOURCE_IRQ,
707 },
708};
709
710static struct platform_device usb1_host_device = {
711 .name = "r8a66597_hcd",
712 .id = 1,
713 .dev = {
714 .dma_mask = NULL, /* not use dma */
715 .coherent_dma_mask = 0xffffffff,
716 .platform_data = &usb1_host_data,
717 },
718 .num_resources = ARRAY_SIZE(usb1_host_resources),
719 .resource = usb1_host_resources,
720};
721
722/* USBHS1 USB Function support via renesas_usbhs */
723
724#define USB_PHY_MODE (1 << 4) 684#define USB_PHY_MODE (1 << 4)
725#define USB_PHY_INT_EN ((1 << 3) | (1 << 2)) 685#define USB_PHY_INT_EN ((1 << 3) | (1 << 2))
726#define USB_PHY_ON (1 << 1) 686#define USB_PHY_ON (1 << 1)
@@ -776,7 +736,7 @@ static void usbhs1_hardware_exit(struct platform_device *pdev)
776 736
777static int usbhs1_get_id(struct platform_device *pdev) 737static int usbhs1_get_id(struct platform_device *pdev)
778{ 738{
779 return USBHS_GADGET; 739 return USBHS_HOST;
780} 740}
781 741
782static u32 usbhs1_pipe_cfg[] = { 742static u32 usbhs1_pipe_cfg[] = {
@@ -807,7 +767,6 @@ static struct usbhs_private usbhs1_private = {
807 .hardware_exit = usbhs1_hardware_exit, 767 .hardware_exit = usbhs1_hardware_exit,
808 .get_id = usbhs1_get_id, 768 .get_id = usbhs1_get_id,
809 .phy_reset = usbhs_phy_reset, 769 .phy_reset = usbhs_phy_reset,
810 .get_vbus = usbhs_get_vbus,
811 }, 770 },
812 .driver_param = { 771 .driver_param = {
813 .buswait_bwait = 4, 772 .buswait_bwait = 4,
@@ -1184,15 +1143,6 @@ static struct resource sh_mmcif_resources[] = {
1184 }, 1143 },
1185}; 1144};
1186 1145
1187static struct sh_mmcif_dma sh_mmcif_dma = {
1188 .chan_priv_rx = {
1189 .slave_id = SHDMA_SLAVE_MMCIF_RX,
1190 },
1191 .chan_priv_tx = {
1192 .slave_id = SHDMA_SLAVE_MMCIF_TX,
1193 },
1194};
1195
1196static struct sh_mmcif_plat_data sh_mmcif_plat = { 1146static struct sh_mmcif_plat_data sh_mmcif_plat = {
1197 .sup_pclk = 0, 1147 .sup_pclk = 0,
1198 .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34, 1148 .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
@@ -1200,7 +1150,8 @@ static struct sh_mmcif_plat_data sh_mmcif_plat = {
1200 MMC_CAP_8_BIT_DATA | 1150 MMC_CAP_8_BIT_DATA |
1201 MMC_CAP_NEEDS_POLL, 1151 MMC_CAP_NEEDS_POLL,
1202 .get_cd = slot_cn7_get_cd, 1152 .get_cd = slot_cn7_get_cd,
1203 .dma = &sh_mmcif_dma, 1153 .slave_id_tx = SHDMA_SLAVE_MMCIF_TX,
1154 .slave_id_rx = SHDMA_SLAVE_MMCIF_RX,
1204}; 1155};
1205 1156
1206static struct platform_device sh_mmcif_device = { 1157static struct platform_device sh_mmcif_device = {
@@ -1311,7 +1262,6 @@ static struct platform_device *mackerel_devices[] __initdata = {
1311 &nor_flash_device, 1262 &nor_flash_device,
1312 &smc911x_device, 1263 &smc911x_device,
1313 &lcdc_device, 1264 &lcdc_device,
1314 &usb1_host_device,
1315 &usbhs1_device, 1265 &usbhs1_device,
1316 &usbhs0_device, 1266 &usbhs0_device,
1317 &leds_device, 1267 &leds_device,
@@ -1473,9 +1423,6 @@ static void __init mackerel_init(void)
1473 gpio_pull_down(GPIO_PORT167CR); /* VBUS0_1 pull down */ 1423 gpio_pull_down(GPIO_PORT167CR); /* VBUS0_1 pull down */
1474 gpio_request(GPIO_FN_IDIN_1_113, NULL); 1424 gpio_request(GPIO_FN_IDIN_1_113, NULL);
1475 1425
1476 /* USB phy tweak to make the r8a66597_hcd host driver work */
1477 __raw_writew(0x8a0a, 0xe6058130); /* USBCR4 */
1478
1479 /* enable FSI2 port A (ak4643) */ 1426 /* enable FSI2 port A (ak4643) */
1480 gpio_request(GPIO_FN_FSIAIBT, NULL); 1427 gpio_request(GPIO_FN_FSIAIBT, NULL);
1481 gpio_request(GPIO_FN_FSIAILR, NULL); 1428 gpio_request(GPIO_FN_FSIAILR, NULL);
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
index afbead6a6e1..7727cca6136 100644
--- a/arch/arm/mach-shmobile/clock-sh73a0.c
+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
@@ -365,6 +365,114 @@ static struct clk div6_clks[DIV6_NR] = {
365 dsi_parent, ARRAY_SIZE(dsi_parent), 12, 3), 365 dsi_parent, ARRAY_SIZE(dsi_parent), 12, 3),
366}; 366};
367 367
368/* DSI DIV */
369static unsigned long dsiphy_recalc(struct clk *clk)
370{
371 u32 value;
372
373 value = __raw_readl(clk->mapping->base);
374
375 /* FIXME */
376 if (!(value & 0x000B8000))
377 return clk->parent->rate;
378
379 value &= 0x3f;
380 value += 1;
381
382 if ((value < 12) ||
383 (value > 33)) {
384 pr_err("DSIPHY has wrong value (%d)", value);
385 return 0;
386 }
387
388 return clk->parent->rate / value;
389}
390
391static long dsiphy_round_rate(struct clk *clk, unsigned long rate)
392{
393 return clk_rate_mult_range_round(clk, 12, 33, rate);
394}
395
396static void dsiphy_disable(struct clk *clk)
397{
398 u32 value;
399
400 value = __raw_readl(clk->mapping->base);
401 value &= ~0x000B8000;
402
403 __raw_writel(value , clk->mapping->base);
404}
405
406static int dsiphy_enable(struct clk *clk)
407{
408 u32 value;
409 int multi;
410
411 value = __raw_readl(clk->mapping->base);
412 multi = (value & 0x3f) + 1;
413
414 if ((multi < 12) || (multi > 33))
415 return -EIO;
416
417 __raw_writel(value | 0x000B8000, clk->mapping->base);
418
419 return 0;
420}
421
422static int dsiphy_set_rate(struct clk *clk, unsigned long rate)
423{
424 u32 value;
425 int idx;
426
427 idx = rate / clk->parent->rate;
428 if ((idx < 12) || (idx > 33))
429 return -EINVAL;
430
431 idx += -1;
432
433 value = __raw_readl(clk->mapping->base);
434 value = (value & ~0x3f) + idx;
435
436 __raw_writel(value, clk->mapping->base);
437
438 return 0;
439}
440
441static struct clk_ops dsiphy_clk_ops = {
442 .recalc = dsiphy_recalc,
443 .round_rate = dsiphy_round_rate,
444 .set_rate = dsiphy_set_rate,
445 .enable = dsiphy_enable,
446 .disable = dsiphy_disable,
447};
448
449static struct clk_mapping dsi0phy_clk_mapping = {
450 .phys = DSI0PHYCR,
451 .len = 4,
452};
453
454static struct clk_mapping dsi1phy_clk_mapping = {
455 .phys = DSI1PHYCR,
456 .len = 4,
457};
458
459static struct clk dsi0phy_clk = {
460 .ops = &dsiphy_clk_ops,
461 .parent = &div6_clks[DIV6_DSI0P], /* late install */
462 .mapping = &dsi0phy_clk_mapping,
463};
464
465static struct clk dsi1phy_clk = {
466 .ops = &dsiphy_clk_ops,
467 .parent = &div6_clks[DIV6_DSI1P], /* late install */
468 .mapping = &dsi1phy_clk_mapping,
469};
470
471static struct clk *late_main_clks[] = {
472 &dsi0phy_clk,
473 &dsi1phy_clk,
474};
475
368enum { MSTP001, 476enum { MSTP001,
369 MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100, 477 MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100,
370 MSTP219, 478 MSTP219,
@@ -429,6 +537,8 @@ static struct clk_lookup lookups[] = {
429 CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]), 537 CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]),
430 CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]), 538 CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]),
431 CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]), 539 CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]),
540 CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.0", &dsi0phy_clk),
541 CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.1", &dsi1phy_clk),
432 542
433 /* MSTP32 clocks */ 543 /* MSTP32 clocks */
434 CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */ 544 CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */
@@ -504,6 +614,9 @@ void __init sh73a0_clock_init(void)
504 if (!ret) 614 if (!ret)
505 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR); 615 ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
506 616
617 for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++)
618 ret = clk_register(late_main_clks[k]);
619
507 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 620 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
508 621
509 if (!ret) 622 if (!ret)
diff --git a/arch/arm/mach-shmobile/include/mach/sh73a0.h b/arch/arm/mach-shmobile/include/mach/sh73a0.h
index 881d515a968..cad57578cee 100644
--- a/arch/arm/mach-shmobile/include/mach/sh73a0.h
+++ b/arch/arm/mach-shmobile/include/mach/sh73a0.h
@@ -515,8 +515,8 @@ enum {
515 SHDMA_SLAVE_MMCIF_RX, 515 SHDMA_SLAVE_MMCIF_RX,
516}; 516};
517 517
518/* PINT interrupts are located at Linux IRQ 768 and up */ 518/* PINT interrupts are located at Linux IRQ 800 and up */
519#define SH73A0_PINT0_IRQ(irq) ((irq) + 768) 519#define SH73A0_PINT0_IRQ(irq) ((irq) + 800)
520#define SH73A0_PINT1_IRQ(irq) ((irq) + 800) 520#define SH73A0_PINT1_IRQ(irq) ((irq) + 832)
521 521
522#endif /* __ASM_SH73A0_H__ */ 522#endif /* __ASM_SH73A0_H__ */
diff --git a/arch/arm/mach-shmobile/intc-sh73a0.c b/arch/arm/mach-shmobile/intc-sh73a0.c
index 1eda6b0b69e..9857595eaa7 100644
--- a/arch/arm/mach-shmobile/intc-sh73a0.c
+++ b/arch/arm/mach-shmobile/intc-sh73a0.c
@@ -19,6 +19,7 @@
19#include <linux/kernel.h> 19#include <linux/kernel.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/module.h>
22#include <linux/irq.h> 23#include <linux/irq.h>
23#include <linux/io.h> 24#include <linux/io.h>
24#include <linux/sh_intc.h> 25#include <linux/sh_intc.h>
@@ -445,6 +446,7 @@ void __init sh73a0_init_irq(void)
445 setup_irq(gic_spi(1 + k), &sh73a0_irq_pin_cascade[k]); 446 setup_irq(gic_spi(1 + k), &sh73a0_irq_pin_cascade[k]);
446 447
447 n = intcs_evt2irq(to_intc_vect(gic_spi(1 + k))); 448 n = intcs_evt2irq(to_intc_vect(gic_spi(1 + k)));
449 WARN_ON(irq_alloc_desc_at(n, numa_node_id()) != n);
448 irq_set_chip_and_handler_name(n, &intca_gic_irq_chip, 450 irq_set_chip_and_handler_name(n, &intca_gic_irq_chip,
449 handle_level_irq, "level"); 451 handle_level_irq, "level");
450 set_irq_flags(n, IRQF_VALID); /* yuck */ 452 set_irq_flags(n, IRQF_VALID); /* yuck */
diff --git a/arch/arm/mach-shmobile/pfc-r8a7779.c b/arch/arm/mach-shmobile/pfc-r8a7779.c
index 963532f2b2c..d14c9b04807 100644
--- a/arch/arm/mach-shmobile/pfc-r8a7779.c
+++ b/arch/arm/mach-shmobile/pfc-r8a7779.c
@@ -2120,7 +2120,7 @@ static struct pinmux_cfg_reg pinmux_config_regs[] = {
2120 FN_AUDATA3, 0, 0, 0 } 2120 FN_AUDATA3, 0, 0, 0 }
2121 }, 2121 },
2122 { PINMUX_CFG_REG_VAR("IPSR4", 0xfffc0030, 32, 2122 { PINMUX_CFG_REG_VAR("IPSR4", 0xfffc0030, 32,
2123 3, 1, 1, 1, 1, 1, 1, 3, 3, 1, 2123 3, 1, 1, 1, 1, 1, 1, 3, 3,
2124 1, 1, 1, 1, 1, 1, 3, 3, 3, 2) { 2124 1, 1, 1, 1, 1, 1, 3, 3, 3, 2) {
2125 /* IP4_31_29 [3] */ 2125 /* IP4_31_29 [3] */
2126 FN_DU1_DB0, FN_VI2_DATA4_VI2_B4, FN_SCL2_B, FN_SD3_DAT0, 2126 FN_DU1_DB0, FN_VI2_DATA4_VI2_B4, FN_SCL2_B, FN_SD3_DAT0,
diff --git a/arch/arm/mach-shmobile/pfc-sh7372.c b/arch/arm/mach-shmobile/pfc-sh7372.c
index 1bd6585a6ac..336093f9210 100644
--- a/arch/arm/mach-shmobile/pfc-sh7372.c
+++ b/arch/arm/mach-shmobile/pfc-sh7372.c
@@ -23,6 +23,7 @@
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/kernel.h> 24#include <linux/kernel.h>
25#include <linux/gpio.h> 25#include <linux/gpio.h>
26#include <mach/irqs.h>
26#include <mach/sh7372.h> 27#include <mach/sh7372.h>
27 28
28#define CPU_ALL_PORT(fn, pfx, sfx) \ 29#define CPU_ALL_PORT(fn, pfx, sfx) \
@@ -1594,6 +1595,43 @@ static struct pinmux_data_reg pinmux_data_regs[] = {
1594 { }, 1595 { },
1595}; 1596};
1596 1597
1598#define EXT_IRQ16L(n) evt2irq(0x200 + ((n) << 5))
1599#define EXT_IRQ16H(n) evt2irq(0x3200 + (((n) - 16) << 5))
1600static struct pinmux_irq pinmux_irqs[] = {
1601 PINMUX_IRQ(EXT_IRQ16L(0), PORT6_FN0, PORT162_FN0),
1602 PINMUX_IRQ(EXT_IRQ16L(1), PORT12_FN0),
1603 PINMUX_IRQ(EXT_IRQ16L(2), PORT4_FN0, PORT5_FN0),
1604 PINMUX_IRQ(EXT_IRQ16L(3), PORT8_FN0, PORT16_FN0),
1605 PINMUX_IRQ(EXT_IRQ16L(4), PORT17_FN0, PORT163_FN0),
1606 PINMUX_IRQ(EXT_IRQ16L(5), PORT18_FN0),
1607 PINMUX_IRQ(EXT_IRQ16L(6), PORT39_FN0, PORT164_FN0),
1608 PINMUX_IRQ(EXT_IRQ16L(7), PORT40_FN0, PORT167_FN0),
1609 PINMUX_IRQ(EXT_IRQ16L(8), PORT41_FN0, PORT168_FN0),
1610 PINMUX_IRQ(EXT_IRQ16L(9), PORT42_FN0, PORT169_FN0),
1611 PINMUX_IRQ(EXT_IRQ16L(10), PORT65_FN0),
1612 PINMUX_IRQ(EXT_IRQ16L(11), PORT67_FN0),
1613 PINMUX_IRQ(EXT_IRQ16L(12), PORT80_FN0, PORT137_FN0),
1614 PINMUX_IRQ(EXT_IRQ16L(13), PORT81_FN0, PORT145_FN0),
1615 PINMUX_IRQ(EXT_IRQ16L(14), PORT82_FN0, PORT146_FN0),
1616 PINMUX_IRQ(EXT_IRQ16L(15), PORT83_FN0, PORT147_FN0),
1617 PINMUX_IRQ(EXT_IRQ16H(16), PORT84_FN0, PORT170_FN0),
1618 PINMUX_IRQ(EXT_IRQ16H(17), PORT85_FN0),
1619 PINMUX_IRQ(EXT_IRQ16H(18), PORT86_FN0),
1620 PINMUX_IRQ(EXT_IRQ16H(19), PORT87_FN0),
1621 PINMUX_IRQ(EXT_IRQ16H(20), PORT92_FN0),
1622 PINMUX_IRQ(EXT_IRQ16H(21), PORT93_FN0),
1623 PINMUX_IRQ(EXT_IRQ16H(22), PORT94_FN0),
1624 PINMUX_IRQ(EXT_IRQ16H(23), PORT95_FN0),
1625 PINMUX_IRQ(EXT_IRQ16H(24), PORT112_FN0),
1626 PINMUX_IRQ(EXT_IRQ16H(25), PORT119_FN0),
1627 PINMUX_IRQ(EXT_IRQ16H(26), PORT121_FN0, PORT172_FN0),
1628 PINMUX_IRQ(EXT_IRQ16H(27), PORT122_FN0, PORT180_FN0),
1629 PINMUX_IRQ(EXT_IRQ16H(28), PORT123_FN0, PORT181_FN0),
1630 PINMUX_IRQ(EXT_IRQ16H(29), PORT129_FN0, PORT182_FN0),
1631 PINMUX_IRQ(EXT_IRQ16H(30), PORT130_FN0, PORT183_FN0),
1632 PINMUX_IRQ(EXT_IRQ16H(31), PORT138_FN0, PORT184_FN0),
1633};
1634
1597static struct pinmux_info sh7372_pinmux_info = { 1635static struct pinmux_info sh7372_pinmux_info = {
1598 .name = "sh7372_pfc", 1636 .name = "sh7372_pfc",
1599 .reserved_id = PINMUX_RESERVED, 1637 .reserved_id = PINMUX_RESERVED,
@@ -1614,6 +1652,9 @@ static struct pinmux_info sh7372_pinmux_info = {
1614 1652
1615 .gpio_data = pinmux_data, 1653 .gpio_data = pinmux_data,
1616 .gpio_data_size = ARRAY_SIZE(pinmux_data), 1654 .gpio_data_size = ARRAY_SIZE(pinmux_data),
1655
1656 .gpio_irq = pinmux_irqs,
1657 .gpio_irq_size = ARRAY_SIZE(pinmux_irqs),
1617}; 1658};
1618 1659
1619void sh7372_pinmux_init(void) 1660void sh7372_pinmux_init(void)
diff --git a/arch/arm/mach-shmobile/smp-sh73a0.c b/arch/arm/mach-shmobile/smp-sh73a0.c
index 0d159d64a34..2d0d4212be4 100644
--- a/arch/arm/mach-shmobile/smp-sh73a0.c
+++ b/arch/arm/mach-shmobile/smp-sh73a0.c
@@ -80,7 +80,7 @@ int __cpuinit sh73a0_boot_secondary(unsigned int cpu)
80 /* enable cache coherency */ 80 /* enable cache coherency */
81 modify_scu_cpu_psr(0, 3 << (cpu * 8)); 81 modify_scu_cpu_psr(0, 3 << (cpu * 8));
82 82
83 if (((__raw_readw(__io(PSTR)) >> (4 * cpu)) & 3) == 3) 83 if (((__raw_readl(__io(PSTR)) >> (4 * cpu)) & 3) == 3)
84 __raw_writel(1 << cpu, __io(WUPCR)); /* wake up */ 84 __raw_writel(1 << cpu, __io(WUPCR)); /* wake up */
85 else 85 else
86 __raw_writel(1 << cpu, __io(SRESCR)); /* reset */ 86 __raw_writel(1 << cpu, __io(SRESCR)); /* reset */
diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig
index 373652d76b9..d2cb4b037f7 100644
--- a/arch/arm/mach-tegra/Kconfig
+++ b/arch/arm/mach-tegra/Kconfig
@@ -10,6 +10,14 @@ config ARCH_TEGRA_2x_SOC
10 select USB_ARCH_HAS_EHCI if USB_SUPPORT 10 select USB_ARCH_HAS_EHCI if USB_SUPPORT
11 select USB_ULPI if USB_SUPPORT 11 select USB_ULPI if USB_SUPPORT
12 select USB_ULPI_VIEWPORT if USB_SUPPORT 12 select USB_ULPI_VIEWPORT if USB_SUPPORT
13 select ARM_ERRATA_720789
14 select ARM_ERRATA_742230
15 select ARM_ERRATA_751472
16 select ARM_ERRATA_754327
17 select ARM_ERRATA_764369
18 select PL310_ERRATA_727915 if CACHE_L2X0
19 select PL310_ERRATA_769419 if CACHE_L2X0
20 select CPU_FREQ_TABLE if CPU_FREQ
13 help 21 help
14 Support for NVIDIA Tegra AP20 and T20 processors, based on the 22 Support for NVIDIA Tegra AP20 and T20 processors, based on the
15 ARM CortexA9MP CPU and the ARM PL310 L2 cache controller 23 ARM CortexA9MP CPU and the ARM PL310 L2 cache controller
@@ -23,6 +31,12 @@ config ARCH_TEGRA_3x_SOC
23 select USB_ULPI if USB_SUPPORT 31 select USB_ULPI if USB_SUPPORT
24 select USB_ULPI_VIEWPORT if USB_SUPPORT 32 select USB_ULPI_VIEWPORT if USB_SUPPORT
25 select USE_OF 33 select USE_OF
34 select ARM_ERRATA_743622
35 select ARM_ERRATA_751472
36 select ARM_ERRATA_754322
37 select ARM_ERRATA_764369
38 select PL310_ERRATA_769419 if CACHE_L2X0
39 select CPU_FREQ_TABLE if CPU_FREQ
26 help 40 help
27 Support for NVIDIA Tegra T30 processor family, based on the 41 Support for NVIDIA Tegra T30 processor family, based on the
28 ARM CortexA9MP CPU and the ARM PL310 L2 cache controller 42 ARM CortexA9MP CPU and the ARM PL310 L2 cache controller
diff --git a/arch/arm/mach-tegra/Makefile b/arch/arm/mach-tegra/Makefile
index e120ff54f66..829066fdc2a 100644
--- a/arch/arm/mach-tegra/Makefile
+++ b/arch/arm/mach-tegra/Makefile
@@ -13,7 +13,8 @@ obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += tegra2_emc.o
13obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += pinmux-tegra20-tables.o 13obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += pinmux-tegra20-tables.o
14obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += pinmux-tegra30-tables.o 14obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += pinmux-tegra30-tables.o
15obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o 15obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += board-dt-tegra30.o
16obj-$(CONFIG_SMP) += platsmp.o localtimer.o headsmp.o 16obj-$(CONFIG_SMP) += platsmp.o headsmp.o
17obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
17obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 18obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
18obj-$(CONFIG_TEGRA_SYSTEM_DMA) += dma.o 19obj-$(CONFIG_TEGRA_SYSTEM_DMA) += dma.o
19obj-$(CONFIG_CPU_FREQ) += cpu-tegra.o 20obj-$(CONFIG_CPU_FREQ) += cpu-tegra.o
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c
index 2db20da1d58..fac449e84d8 100644
--- a/arch/arm/mach-tegra/common.c
+++ b/arch/arm/mach-tegra/common.c
@@ -95,8 +95,6 @@ static void __init tegra_init_cache(u32 tag_latency, u32 data_latency)
95#ifdef CONFIG_ARCH_TEGRA_2x_SOC 95#ifdef CONFIG_ARCH_TEGRA_2x_SOC
96void __init tegra20_init_early(void) 96void __init tegra20_init_early(void)
97{ 97{
98 disable_hlt(); /* idle WFI usage needs to be confirmed */
99
100 tegra_init_fuse(); 98 tegra_init_fuse();
101 tegra2_init_clocks(); 99 tegra2_init_clocks();
102 tegra_clk_init_from_table(tegra20_clk_init_table); 100 tegra_clk_init_from_table(tegra20_clk_init_table);
diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c
index 37576a721ae..6091cf3d8e8 100644
--- a/arch/arm/mach-tegra/usb_phy.c
+++ b/arch/arm/mach-tegra/usb_phy.c
@@ -22,6 +22,7 @@
22#include <linux/delay.h> 22#include <linux/delay.h>
23#include <linux/slab.h> 23#include <linux/slab.h>
24#include <linux/err.h> 24#include <linux/err.h>
25#include <linux/export.h>
25#include <linux/platform_device.h> 26#include <linux/platform_device.h>
26#include <linux/io.h> 27#include <linux/io.h>
27#include <linux/gpio.h> 28#include <linux/gpio.h>
@@ -730,6 +731,7 @@ err0:
730 kfree(phy); 731 kfree(phy);
731 return ERR_PTR(err); 732 return ERR_PTR(err);
732} 733}
734EXPORT_SYMBOL_GPL(tegra_usb_phy_open);
733 735
734int tegra_usb_phy_power_on(struct tegra_usb_phy *phy) 736int tegra_usb_phy_power_on(struct tegra_usb_phy *phy)
735{ 737{
@@ -738,6 +740,7 @@ int tegra_usb_phy_power_on(struct tegra_usb_phy *phy)
738 else 740 else
739 return utmi_phy_power_on(phy); 741 return utmi_phy_power_on(phy);
740} 742}
743EXPORT_SYMBOL_GPL(tegra_usb_phy_power_on);
741 744
742void tegra_usb_phy_power_off(struct tegra_usb_phy *phy) 745void tegra_usb_phy_power_off(struct tegra_usb_phy *phy)
743{ 746{
@@ -746,18 +749,21 @@ void tegra_usb_phy_power_off(struct tegra_usb_phy *phy)
746 else 749 else
747 utmi_phy_power_off(phy); 750 utmi_phy_power_off(phy);
748} 751}
752EXPORT_SYMBOL_GPL(tegra_usb_phy_power_off);
749 753
750void tegra_usb_phy_preresume(struct tegra_usb_phy *phy) 754void tegra_usb_phy_preresume(struct tegra_usb_phy *phy)
751{ 755{
752 if (!phy_is_ulpi(phy)) 756 if (!phy_is_ulpi(phy))
753 utmi_phy_preresume(phy); 757 utmi_phy_preresume(phy);
754} 758}
759EXPORT_SYMBOL_GPL(tegra_usb_phy_preresume);
755 760
756void tegra_usb_phy_postresume(struct tegra_usb_phy *phy) 761void tegra_usb_phy_postresume(struct tegra_usb_phy *phy)
757{ 762{
758 if (!phy_is_ulpi(phy)) 763 if (!phy_is_ulpi(phy))
759 utmi_phy_postresume(phy); 764 utmi_phy_postresume(phy);
760} 765}
766EXPORT_SYMBOL_GPL(tegra_usb_phy_postresume);
761 767
762void tegra_ehci_phy_restore_start(struct tegra_usb_phy *phy, 768void tegra_ehci_phy_restore_start(struct tegra_usb_phy *phy,
763 enum tegra_usb_phy_port_speed port_speed) 769 enum tegra_usb_phy_port_speed port_speed)
@@ -765,24 +771,28 @@ void tegra_ehci_phy_restore_start(struct tegra_usb_phy *phy,
765 if (!phy_is_ulpi(phy)) 771 if (!phy_is_ulpi(phy))
766 utmi_phy_restore_start(phy, port_speed); 772 utmi_phy_restore_start(phy, port_speed);
767} 773}
774EXPORT_SYMBOL_GPL(tegra_ehci_phy_restore_start);
768 775
769void tegra_ehci_phy_restore_end(struct tegra_usb_phy *phy) 776void tegra_ehci_phy_restore_end(struct tegra_usb_phy *phy)
770{ 777{
771 if (!phy_is_ulpi(phy)) 778 if (!phy_is_ulpi(phy))
772 utmi_phy_restore_end(phy); 779 utmi_phy_restore_end(phy);
773} 780}
781EXPORT_SYMBOL_GPL(tegra_ehci_phy_restore_end);
774 782
775void tegra_usb_phy_clk_disable(struct tegra_usb_phy *phy) 783void tegra_usb_phy_clk_disable(struct tegra_usb_phy *phy)
776{ 784{
777 if (!phy_is_ulpi(phy)) 785 if (!phy_is_ulpi(phy))
778 utmi_phy_clk_disable(phy); 786 utmi_phy_clk_disable(phy);
779} 787}
788EXPORT_SYMBOL_GPL(tegra_usb_phy_clk_disable);
780 789
781void tegra_usb_phy_clk_enable(struct tegra_usb_phy *phy) 790void tegra_usb_phy_clk_enable(struct tegra_usb_phy *phy)
782{ 791{
783 if (!phy_is_ulpi(phy)) 792 if (!phy_is_ulpi(phy))
784 utmi_phy_clk_enable(phy); 793 utmi_phy_clk_enable(phy);
785} 794}
795EXPORT_SYMBOL_GPL(tegra_usb_phy_clk_enable);
786 796
787void tegra_usb_phy_close(struct tegra_usb_phy *phy) 797void tegra_usb_phy_close(struct tegra_usb_phy *phy)
788{ 798{
@@ -794,3 +804,4 @@ void tegra_usb_phy_close(struct tegra_usb_phy *phy)
794 clk_put(phy->pll_u); 804 clk_put(phy->pll_u);
795 kfree(phy); 805 kfree(phy);
796} 806}
807EXPORT_SYMBOL_GPL(tegra_usb_phy_close);
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 1a3ca248816..7edef912163 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -631,7 +631,8 @@ comment "Processor Features"
631 631
632config ARM_LPAE 632config ARM_LPAE
633 bool "Support for the Large Physical Address Extension" 633 bool "Support for the Large Physical Address Extension"
634 depends on MMU && CPU_V7 634 depends on MMU && CPU_32v7 && !CPU_32v6 && !CPU_32v5 && \
635 !CPU_32v4 && !CPU_32v3
635 help 636 help
636 Say Y if you have an ARMv7 processor supporting the LPAE page 637 Say Y if you have an ARMv7 processor supporting the LPAE page
637 table format and you would like to access memory beyond the 638 table format and you would like to access memory beyond the
diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S
index 7a24d39661f..a655d3da386 100644
--- a/arch/arm/mm/cache-v7.S
+++ b/arch/arm/mm/cache-v7.S
@@ -55,7 +55,7 @@ loop1:
55 cmp r1, #2 @ see what cache we have at this level 55 cmp r1, #2 @ see what cache we have at this level
56 blt skip @ skip if no cache, or just i-cache 56 blt skip @ skip if no cache, or just i-cache
57#ifdef CONFIG_PREEMPT 57#ifdef CONFIG_PREEMPT
58 save_and_disable_irqs r9 @ make cssr&csidr read atomic 58 save_and_disable_irqs_notrace r9 @ make cssr&csidr read atomic
59#endif 59#endif
60 mcr p15, 2, r10, c0, c0, 0 @ select current cache level in cssr 60 mcr p15, 2, r10, c0, c0, 0 @ select current cache level in cssr
61 isb @ isb to sych the new cssr&csidr 61 isb @ isb to sych the new cssr&csidr
diff --git a/arch/arm/plat-mxc/audmux-v1.c b/arch/arm/plat-mxc/audmux-v1.c
index 1180bef7664..14a3c048675 100644
--- a/arch/arm/plat-mxc/audmux-v1.c
+++ b/arch/arm/plat-mxc/audmux-v1.c
@@ -46,16 +46,13 @@ EXPORT_SYMBOL_GPL(mxc_audmux_v1_configure_port);
46 46
47static int mxc_audmux_v1_init(void) 47static int mxc_audmux_v1_init(void)
48{ 48{
49#ifdef CONFIG_MACH_MX21
50 if (cpu_is_mx21()) 49 if (cpu_is_mx21())
51 audmux_base = MX21_IO_ADDRESS(MX21_AUDMUX_BASE_ADDR); 50 audmux_base = MX21_IO_ADDRESS(MX21_AUDMUX_BASE_ADDR);
52 else 51 else
53#endif 52
54#ifdef CONFIG_MACH_MX27
55 if (cpu_is_mx27()) 53 if (cpu_is_mx27())
56 audmux_base = MX27_IO_ADDRESS(MX27_AUDMUX_BASE_ADDR); 54 audmux_base = MX27_IO_ADDRESS(MX27_AUDMUX_BASE_ADDR);
57 else 55 else
58#endif
59 (void)0; 56 (void)0;
60 57
61 return 0; 58 return 0;
diff --git a/arch/arm/plat-mxc/avic.c b/arch/arm/plat-mxc/avic.c
index 55f15699a38..689f81f9593 100644
--- a/arch/arm/plat-mxc/avic.c
+++ b/arch/arm/plat-mxc/avic.c
@@ -60,7 +60,7 @@ static int avic_irq_set_priority(unsigned char irq, unsigned char prio)
60 unsigned int mask = 0x0F << irq % 8 * 4; 60 unsigned int mask = 0x0F << irq % 8 * 4;
61 61
62 if (irq >= AVIC_NUM_IRQS) 62 if (irq >= AVIC_NUM_IRQS)
63 return -EINVAL;; 63 return -EINVAL;
64 64
65 temp = __raw_readl(avic_base + AVIC_NIPRIORITY(irq / 8)); 65 temp = __raw_readl(avic_base + AVIC_NIPRIORITY(irq / 8));
66 temp &= ~mask; 66 temp &= ~mask;
diff --git a/arch/arm/plat-omap/include/plat/gpio.h b/arch/arm/plat-omap/include/plat/gpio.h
index 9e86ee0aed0..cb75b657b04 100644
--- a/arch/arm/plat-omap/include/plat/gpio.h
+++ b/arch/arm/plat-omap/include/plat/gpio.h
@@ -162,13 +162,6 @@
162 IH_MPUIO_BASE + ((nr) & 0x0f) : \ 162 IH_MPUIO_BASE + ((nr) & 0x0f) : \
163 IH_GPIO_BASE + (nr)) 163 IH_GPIO_BASE + (nr))
164 164
165#define METHOD_MPUIO 0
166#define METHOD_GPIO_1510 1
167#define METHOD_GPIO_1610 2
168#define METHOD_GPIO_7XX 3
169#define METHOD_GPIO_24XX 5
170#define METHOD_GPIO_44XX 6
171
172struct omap_gpio_dev_attr { 165struct omap_gpio_dev_attr {
173 int bank_width; /* GPIO bank width */ 166 int bank_width; /* GPIO bank width */
174 bool dbck_flag; /* dbck required or not - True for OMAP3&4 */ 167 bool dbck_flag; /* dbck required or not - True for OMAP3&4 */
@@ -184,10 +177,21 @@ struct omap_gpio_reg_offs {
184 u16 irqstatus; 177 u16 irqstatus;
185 u16 irqstatus2; 178 u16 irqstatus2;
186 u16 irqenable; 179 u16 irqenable;
180 u16 irqenable2;
187 u16 set_irqenable; 181 u16 set_irqenable;
188 u16 clr_irqenable; 182 u16 clr_irqenable;
189 u16 debounce; 183 u16 debounce;
190 u16 debounce_en; 184 u16 debounce_en;
185 u16 ctrl;
186 u16 wkup_en;
187 u16 leveldetect0;
188 u16 leveldetect1;
189 u16 risingdetect;
190 u16 fallingdetect;
191 u16 irqctrl;
192 u16 edgectrl1;
193 u16 edgectrl2;
194 u16 pinctrl;
191 195
192 bool irqenable_inv; 196 bool irqenable_inv;
193}; 197};
@@ -198,19 +202,20 @@ struct omap_gpio_platform_data {
198 int bank_width; /* GPIO bank width */ 202 int bank_width; /* GPIO bank width */
199 int bank_stride; /* Only needed for omap1 MPUIO */ 203 int bank_stride; /* Only needed for omap1 MPUIO */
200 bool dbck_flag; /* dbck required or not - True for OMAP3&4 */ 204 bool dbck_flag; /* dbck required or not - True for OMAP3&4 */
205 bool loses_context; /* whether the bank would ever lose context */
206 bool is_mpuio; /* whether the bank is of type MPUIO */
207 u32 non_wakeup_gpios;
201 208
202 struct omap_gpio_reg_offs *regs; 209 struct omap_gpio_reg_offs *regs;
203};
204 210
205/* TODO: Analyze removing gpio_bank_count usage from driver code */ 211 /* Return context loss count due to PM states changing */
206extern int gpio_bank_count; 212 int (*get_context_loss_count)(struct device *dev);
213};
207 214
208extern void omap2_gpio_prepare_for_idle(int off_mode); 215extern void omap2_gpio_prepare_for_idle(int off_mode);
209extern void omap2_gpio_resume_after_idle(void); 216extern void omap2_gpio_resume_after_idle(void);
210extern void omap_set_gpio_debounce(int gpio, int enable); 217extern void omap_set_gpio_debounce(int gpio, int enable);
211extern void omap_set_gpio_debounce_time(int gpio, int enable); 218extern void omap_set_gpio_debounce_time(int gpio, int enable);
212extern void omap_gpio_save_context(void);
213extern void omap_gpio_restore_context(void);
214/*-------------------------------------------------------------------------*/ 219/*-------------------------------------------------------------------------*/
215 220
216/* Wrappers for "new style" GPIO calls, using the new infrastructure 221/* Wrappers for "new style" GPIO calls, using the new infrastructure
diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig
index d8973ac46bc..21bf6adb919 100644
--- a/arch/arm/plat-s3c24xx/Kconfig
+++ b/arch/arm/plat-s3c24xx/Kconfig
@@ -4,7 +4,7 @@
4 4
5config PLAT_S3C24XX 5config PLAT_S3C24XX
6 bool 6 bool
7 depends on ARCH_S3C2410 7 depends on ARCH_S3C24XX
8 default y 8 default y
9 select NO_IOPORT 9 select NO_IOPORT
10 select ARCH_REQUIRE_GPIOLIB 10 select ARCH_REQUIRE_GPIOLIB
@@ -44,12 +44,6 @@ config S3C2410_CLOCK
44 Clock code for the S3C2410, and similar processors which 44 Clock code for the S3C2410, and similar processors which
45 is currently includes the S3C2410, S3C2440, S3C2442. 45 is currently includes the S3C2410, S3C2440, S3C2442.
46 46
47config S3C2443_CLOCK
48 bool
49 help
50 Clock code for the S3C2443 and similar processors, which includes
51 the S3C2416 and S3C2450.
52
53config S3C24XX_DCLK 47config S3C24XX_DCLK
54 bool 48 bool
55 help 49 help
@@ -76,15 +70,9 @@ config S3C24XX_GPIO_EXTRA128
76 Add an extra 128 gpio numbers to the available GPIO pool. This is 70 Add an extra 128 gpio numbers to the available GPIO pool. This is
77 available for boards that need extra gpios for external devices. 71 available for boards that need extra gpios for external devices.
78 72
79config PM_SIMTEC 73config S3C24XX_DMA
80 bool
81 help
82 Common power management code for systems that are
83 compatible with the Simtec style of power management
84
85config S3C2410_DMA
86 bool "S3C2410 DMA support" 74 bool "S3C2410 DMA support"
87 depends on ARCH_S3C2410 75 depends on ARCH_S3C24XX
88 select S3C_DMA 76 select S3C_DMA
89 help 77 help
90 S3C2410 DMA support. This is needed for drivers like sound which 78 S3C2410 DMA support. This is needed for drivers like sound which
@@ -93,31 +81,11 @@ config S3C2410_DMA
93 81
94config S3C2410_DMA_DEBUG 82config S3C2410_DMA_DEBUG
95 bool "S3C2410 DMA support debug" 83 bool "S3C2410 DMA support debug"
96 depends on ARCH_S3C2410 && S3C2410_DMA 84 depends on ARCH_S3C24XX && S3C2410_DMA
97 help 85 help
98 Enable debugging output for the DMA code. This option sends info 86 Enable debugging output for the DMA code. This option sends info
99 to the kernel log, at priority KERN_DEBUG. 87 to the kernel log, at priority KERN_DEBUG.
100 88
101# SPI default pin configuration code
102
103config S3C24XX_SPI_BUS0_GPE11_GPE12_GPE13
104 bool
105 help
106 SPI GPIO configuration code for BUS0 when connected to
107 GPE11, GPE12 and GPE13.
108
109config S3C24XX_SPI_BUS1_GPG5_GPG6_GPG7
110 bool
111 help
112 SPI GPIO configuration code for BUS 1 when connected to
113 GPG5, GPG6 and GPG7.
114
115config S3C24XX_SPI_BUS1_GPD8_GPD9_GPD10
116 bool
117 help
118 SPI GPIO configuration code for BUS 1 when connected to
119 GPD8, GPD9 and GPD10.
120
121# common code for s3c24xx based machines, such as the SMDKs. 89# common code for s3c24xx based machines, such as the SMDKs.
122 90
123# cpu frequency items common between s3c2410 and s3c2440/s3c2442 91# cpu frequency items common between s3c2410 and s3c2440/s3c2442
@@ -145,21 +113,4 @@ config S3C2412_IOTIMING
145 Intel node to select io timing code that is common to the s3c2412 113 Intel node to select io timing code that is common to the s3c2412
146 and the s3c2443. 114 and the s3c2443.
147 115
148config MACH_SMDK
149 bool
150 help
151 Common machine code for SMDK2410 and SMDK2440
152
153config S3C24XX_SIMTEC_AUDIO
154 bool
155 depends on (ARCH_BAST || MACH_VR1000 || MACH_OSIRIS || MACH_ANUBIS)
156 default y
157 help
158 Add audio devices for common Simtec S3C24XX boards
159
160config S3C2410_SETUP_TS
161 bool
162 help
163 Compile in platform device definition for Samsung TouchScreen.
164
165endif 116endif
diff --git a/arch/arm/plat-s3c24xx/Makefile b/arch/arm/plat-s3c24xx/Makefile
index b2b01125de6..2467b800cc7 100644
--- a/arch/arm/plat-s3c24xx/Makefile
+++ b/arch/arm/plat-s3c24xx/Makefile
@@ -23,28 +23,11 @@ obj-$(CONFIG_CPU_FREQ_S3C24XX_DEBUGFS) += cpu-freq-debugfs.o
23 23
24# Architecture dependent builds 24# Architecture dependent builds
25 25
26obj-$(CONFIG_PM_SIMTEC) += pm-simtec.o
27obj-$(CONFIG_PM) += pm.o 26obj-$(CONFIG_PM) += pm.o
28obj-$(CONFIG_PM) += irq-pm.o 27obj-$(CONFIG_PM) += irq-pm.o
29obj-$(CONFIG_PM) += sleep.o 28obj-$(CONFIG_PM) += sleep.o
30obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o 29obj-$(CONFIG_S3C2410_CLOCK) += s3c2410-clock.o
31obj-$(CONFIG_S3C2443_CLOCK) += s3c2443-clock.o 30obj-$(CONFIG_S3C24XX_DMA) += dma.o
32obj-$(CONFIG_S3C2410_DMA) += dma.o
33obj-$(CONFIG_S3C2410_IOTIMING) += s3c2410-iotiming.o 31obj-$(CONFIG_S3C2410_IOTIMING) += s3c2410-iotiming.o
34obj-$(CONFIG_S3C2412_IOTIMING) += s3c2412-iotiming.o 32obj-$(CONFIG_S3C2412_IOTIMING) += s3c2412-iotiming.o
35obj-$(CONFIG_S3C2410_CPUFREQ_UTILS) += s3c2410-cpufreq-utils.o 33obj-$(CONFIG_S3C2410_CPUFREQ_UTILS) += s3c2410-cpufreq-utils.o
36
37# device specific setup and/or initialisation
38obj-$(CONFIG_ARCH_S3C2410) += setup-i2c.o
39obj-$(CONFIG_S3C2410_SETUP_TS) += setup-ts.o
40
41# SPI gpio central GPIO functions
42
43obj-$(CONFIG_S3C24XX_SPI_BUS0_GPE11_GPE12_GPE13) += spi-bus0-gpe11_12_13.o
44obj-$(CONFIG_S3C24XX_SPI_BUS1_GPG5_GPG6_GPG7) += spi-bus1-gpg5_6_7.o
45obj-$(CONFIG_S3C24XX_SPI_BUS1_GPD8_GPD9_GPD10) += spi-bus1-gpd8_9_10.o
46
47# machine common support
48
49obj-$(CONFIG_MACH_SMDK) += common-smdk.o
50obj-$(CONFIG_S3C24XX_SIMTEC_AUDIO) += simtec-audio.o
diff --git a/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c b/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c
deleted file mode 100644
index 704175b0573..00000000000
--- a/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c
+++ /dev/null
@@ -1,36 +0,0 @@
1/* linux/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C24XX SPI - gpio configuration for bus 0 on gpe11,12,13
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License.
12*/
13
14#include <linux/kernel.h>
15#include <linux/gpio.h>
16
17#include <mach/spi.h>
18#include <mach/regs-gpio.h>
19
20void s3c24xx_spi_gpiocfg_bus0_gpe11_12_13(struct s3c2410_spi_info *spi,
21 int enable)
22{
23 if (enable) {
24 s3c_gpio_cfgpin(S3C2410_GPE(13), S3C2410_GPE13_SPICLK0);
25 s3c_gpio_cfgpin(S3C2410_GPE(12), S3C2410_GPE12_SPIMOSI0);
26 s3c_gpio_cfgpin(S3C2410_GPE(11), S3C2410_GPE11_SPIMISO0);
27 s3c2410_gpio_pullup(S3C2410_GPE(11), 0);
28 s3c2410_gpio_pullup(S3C2410_GPE(13), 0);
29 } else {
30 s3c_gpio_cfgpin(S3C2410_GPE(13), S3C2410_GPIO_INPUT);
31 s3c_gpio_cfgpin(S3C2410_GPE(11), S3C2410_GPIO_INPUT);
32 s3c_gpio_setpull(S3C2410_GPE(11), S3C_GPIO_PULL_NONE);
33 s3c_gpio_setpull(S3C2410_GPE(12), S3C_GPIO_PULL_NONE);
34 s3c_gpio_setpull(S3C2410_GPE(13), S3C_GPIO_PULL_NONE);
35 }
36}
diff --git a/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c b/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c
deleted file mode 100644
index 72457afd625..00000000000
--- a/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c
+++ /dev/null
@@ -1,38 +0,0 @@
1/* linux/arch/arm/plat-s3c24xx/spi-bus0-gpd8_9_10.c
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C24XX SPI - gpio configuration for bus 1 on gpd8,9,10
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License.
12*/
13
14#include <linux/kernel.h>
15#include <linux/gpio.h>
16
17#include <mach/spi.h>
18#include <mach/regs-gpio.h>
19
20void s3c24xx_spi_gpiocfg_bus1_gpd8_9_10(struct s3c2410_spi_info *spi,
21 int enable)
22{
23
24 printk(KERN_INFO "%s(%d)\n", __func__, enable);
25 if (enable) {
26 s3c_gpio_cfgpin(S3C2410_GPD(10), S3C2440_GPD10_SPICLK1);
27 s3c_gpio_cfgpin(S3C2410_GPD(9), S3C2440_GPD9_SPIMOSI1);
28 s3c_gpio_cfgpin(S3C2410_GPD(8), S3C2440_GPD8_SPIMISO1);
29 s3c2410_gpio_pullup(S3C2410_GPD(10), 0);
30 s3c2410_gpio_pullup(S3C2410_GPD(9), 0);
31 } else {
32 s3c_gpio_cfgpin(S3C2410_GPD(8), S3C2410_GPIO_INPUT);
33 s3c_gpio_cfgpin(S3C2410_GPD(9), S3C2410_GPIO_INPUT);
34 s3c_gpio_setpull(S3C2410_GPD(10), S3C_GPIO_PULL_NONE);
35 s3c_gpio_setpull(S3C2410_GPD(9), S3C_GPIO_PULL_NONE);
36 s3c_gpio_setpull(S3C2410_GPD(8), S3C_GPIO_PULL_NONE);
37 }
38}
diff --git a/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c b/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c
deleted file mode 100644
index c3972b645d1..00000000000
--- a/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c
+++ /dev/null
@@ -1,36 +0,0 @@
1/* linux/arch/arm/plat-s3c24xx/spi-bus0-gpg5_6_7.c
2 *
3 * Copyright (c) 2008 Simtec Electronics
4 * http://armlinux.simtec.co.uk/
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * S3C24XX SPI - gpio configuration for bus 1 on gpg5,6,7
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License.
12*/
13
14#include <linux/kernel.h>
15#include <linux/gpio.h>
16
17#include <mach/spi.h>
18#include <mach/regs-gpio.h>
19
20void s3c24xx_spi_gpiocfg_bus1_gpg5_6_7(struct s3c2410_spi_info *spi,
21 int enable)
22{
23 if (enable) {
24 s3c_gpio_cfgpin(S3C2410_GPG(7), S3C2410_GPG7_SPICLK1);
25 s3c_gpio_cfgpin(S3C2410_GPG(6), S3C2410_GPG6_SPIMOSI1);
26 s3c_gpio_cfgpin(S3C2410_GPG(5), S3C2410_GPG5_SPIMISO1);
27 s3c2410_gpio_pullup(S3C2410_GPG(5), 0);
28 s3c2410_gpio_pullup(S3C2410_GPG(6), 0);
29 } else {
30 s3c_gpio_cfgpin(S3C2410_GPG(7), S3C2410_GPIO_INPUT);
31 s3c_gpio_cfgpin(S3C2410_GPG(5), S3C2410_GPIO_INPUT);
32 s3c_gpio_setpull(S3C2410_GPG(5), S3C_GPIO_PULL_NONE);
33 s3c_gpio_setpull(S3C2410_GPG(6), S3C_GPIO_PULL_NONE);
34 s3c_gpio_setpull(S3C2410_GPG(7), S3C_GPIO_PULL_NONE);
35 }
36}
diff --git a/arch/arm/plat-s5p/irq-eint.c b/arch/arm/plat-s5p/irq-eint.c
index c496b359c37..139c050918c 100644
--- a/arch/arm/plat-s5p/irq-eint.c
+++ b/arch/arm/plat-s5p/irq-eint.c
@@ -200,7 +200,7 @@ static struct irq_chip s5p_irq_vic_eint = {
200#endif 200#endif
201}; 201};
202 202
203int __init s5p_init_irq_eint(void) 203static int __init s5p_init_irq_eint(void)
204{ 204{
205 int irq; 205 int irq;
206 206
diff --git a/arch/arm/plat-s5p/irq-gpioint.c b/arch/arm/plat-s5p/irq-gpioint.c
index 1fdfaa4599c..82c7311017a 100644
--- a/arch/arm/plat-s5p/irq-gpioint.c
+++ b/arch/arm/plat-s5p/irq-gpioint.c
@@ -41,7 +41,7 @@ struct s5p_gpioint_bank {
41 void (*handler)(unsigned int, struct irq_desc *); 41 void (*handler)(unsigned int, struct irq_desc *);
42}; 42};
43 43
44LIST_HEAD(banks); 44static LIST_HEAD(banks);
45 45
46static int s5p_gpioint_set_type(struct irq_data *d, unsigned int type) 46static int s5p_gpioint_set_type(struct irq_data *d, unsigned int type)
47{ 47{
diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 6a2abe67c8b..71553f41001 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -205,7 +205,7 @@ config S3C_DEV_USB_HSOTG
205 205
206config S3C_DEV_WDT 206config S3C_DEV_WDT
207 bool 207 bool
208 default y if ARCH_S3C2410 208 default y if ARCH_S3C24XX
209 help 209 help
210 Complie in platform device definition for Watchdog Timer 210 Complie in platform device definition for Watchdog Timer
211 211
@@ -264,7 +264,7 @@ config SAMSUNG_DEV_KEYPAD
264 264
265config SAMSUNG_DEV_PWM 265config SAMSUNG_DEV_PWM
266 bool 266 bool
267 default y if ARCH_S3C2410 267 default y if ARCH_S3C24XX
268 help 268 help
269 Compile in platform device definition for PWM Timer 269 Compile in platform device definition for PWM Timer
270 270
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index f10768e988d..98b864777a3 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -744,17 +744,6 @@ struct platform_device s3c_device_iis = {
744}; 744};
745#endif /* CONFIG_PLAT_S3C24XX */ 745#endif /* CONFIG_PLAT_S3C24XX */
746 746
747#ifdef CONFIG_CPU_S3C2440
748struct platform_device s3c2412_device_iis = {
749 .name = "s3c2412-iis",
750 .id = -1,
751 .dev = {
752 .dma_mask = &samsung_device_dma_mask,
753 .coherent_dma_mask = DMA_BIT_MASK(32),
754 }
755};
756#endif /* CONFIG_CPU_S3C2440 */
757
758/* IDE CFCON */ 747/* IDE CFCON */
759 748
760#ifdef CONFIG_SAMSUNG_DEV_IDE 749#ifdef CONFIG_SAMSUNG_DEV_IDE
@@ -1078,7 +1067,7 @@ static struct resource s5p_pmu_resource[] = {
1078 DEFINE_RES_IRQ(IRQ_PMU) 1067 DEFINE_RES_IRQ(IRQ_PMU)
1079}; 1068};
1080 1069
1081struct platform_device s5p_device_pmu = { 1070static struct platform_device s5p_device_pmu = {
1082 .name = "arm-pmu", 1071 .name = "arm-pmu",
1083 .id = ARM_PMU_DEVICE_CPU, 1072 .id = ARM_PMU_DEVICE_CPU,
1084 .num_resources = ARRAY_SIZE(s5p_pmu_resource), 1073 .num_resources = ARRAY_SIZE(s5p_pmu_resource),
diff --git a/arch/arm/plat-samsung/dma-ops.c b/arch/arm/plat-samsung/dma-ops.c
index 0747c77a2fd..301d9c319d0 100644
--- a/arch/arm/plat-samsung/dma-ops.c
+++ b/arch/arm/plat-samsung/dma-ops.c
@@ -116,7 +116,7 @@ static inline int samsung_dmadev_flush(unsigned ch)
116 return dmaengine_terminate_all((struct dma_chan *)ch); 116 return dmaengine_terminate_all((struct dma_chan *)ch);
117} 117}
118 118
119struct samsung_dma_ops dmadev_ops = { 119static struct samsung_dma_ops dmadev_ops = {
120 .request = samsung_dmadev_request, 120 .request = samsung_dmadev_request,
121 .release = samsung_dmadev_release, 121 .release = samsung_dmadev_release,
122 .prepare = samsung_dmadev_prepare, 122 .prepare = samsung_dmadev_prepare,
diff --git a/arch/arm/plat-samsung/include/plat/audio-simtec.h b/arch/arm/plat-samsung/include/plat/audio-simtec.h
index 5345364e742..376af5286a3 100644
--- a/arch/arm/plat-samsung/include/plat/audio-simtec.h
+++ b/arch/arm/plat-samsung/include/plat/audio-simtec.h
@@ -32,6 +32,3 @@ struct s3c24xx_audio_simtec_pdata {
32 32
33 void (*startup)(void); 33 void (*startup)(void);
34}; 34};
35
36extern int simtec_audio_add(const char *codec_name, bool has_lr_routing,
37 struct s3c24xx_audio_simtec_pdata *pdata);
diff --git a/arch/arm/plat-samsung/include/plat/clock.h b/arch/arm/plat-samsung/include/plat/clock.h
index 73c66d4d10f..a62753dc15b 100644
--- a/arch/arm/plat-samsung/include/plat/clock.h
+++ b/arch/arm/plat-samsung/include/plat/clock.h
@@ -79,6 +79,10 @@ extern struct clk clk_epll;
79extern struct clk clk_xtal; 79extern struct clk clk_xtal;
80extern struct clk clk_ext; 80extern struct clk clk_ext;
81 81
82/* S3C2443/S3C2416 specific clocks */
83extern struct clksrc_clk clk_epllref;
84extern struct clksrc_clk clk_esysclk;
85
82/* S3C64XX specific clocks */ 86/* S3C64XX specific clocks */
83extern struct clk clk_h2; 87extern struct clk clk_h2;
84extern struct clk clk_27m; 88extern struct clk clk_27m;
@@ -114,7 +118,23 @@ extern void s3c24xx_setup_clocks(unsigned long fclk,
114extern void s3c2410_setup_clocks(void); 118extern void s3c2410_setup_clocks(void);
115extern void s3c2412_setup_clocks(void); 119extern void s3c2412_setup_clocks(void);
116extern void s3c244x_setup_clocks(void); 120extern void s3c244x_setup_clocks(void);
117extern void s3c2443_setup_clocks(void); 121
122/* S3C2410 specific clock functions */
123
124extern int s3c2410_baseclk_add(void);
125
126/* S3C2443/S3C2416 specific clock functions */
127
128typedef unsigned int (*pll_fn)(unsigned int reg, unsigned int base);
129
130extern void s3c2443_common_setup_clocks(pll_fn get_mpll);
131extern void s3c2443_common_init_clocks(int xtal, pll_fn get_mpll,
132 unsigned int *divs, int nr_divs,
133 int divmask);
134
135extern int s3c2443_clkcon_enable_h(struct clk *clk, int enable);
136extern int s3c2443_clkcon_enable_p(struct clk *clk, int enable);
137extern int s3c2443_clkcon_enable_s(struct clk *clk, int enable);
118 138
119/* S3C64XX specific functions and clocks */ 139/* S3C64XX specific functions and clocks */
120 140
diff --git a/arch/arm/plat-samsung/include/plat/regs-dma.h b/arch/arm/plat-samsung/include/plat/regs-dma.h
index 178bccbe480..a7d622ef16a 100644
--- a/arch/arm/plat-samsung/include/plat/regs-dma.h
+++ b/arch/arm/plat-samsung/include/plat/regs-dma.h
@@ -119,7 +119,7 @@
119#define S3C2412_DMAREQSEL_UART2_1 S3C2412_DMAREQSEL_SRC(24) 119#define S3C2412_DMAREQSEL_UART2_1 S3C2412_DMAREQSEL_SRC(24)
120#endif /* CONFIG_CPU_S3C2412 */ 120#endif /* CONFIG_CPU_S3C2412 */
121 121
122#ifdef CONFIG_CPU_S3C2443 122#if defined(CONFIG_CPU_S3C2416) || defined(CONFIG_CPU_S3C2443)
123 123
124#define S3C2443_DMAREQSEL_SRC(x) ((x) << 1) 124#define S3C2443_DMAREQSEL_SRC(x) ((x) << 1)
125 125
diff --git a/arch/arm/plat-samsung/include/plat/s3c2410.h b/arch/arm/plat-samsung/include/plat/s3c2410.h
index 3986497dd3f..55b0e5f51e9 100644
--- a/arch/arm/plat-samsung/include/plat/s3c2410.h
+++ b/arch/arm/plat-samsung/include/plat/s3c2410.h
@@ -29,5 +29,3 @@ extern void s3c2410_init_clocks(int xtal);
29#define s3c2410_init NULL 29#define s3c2410_init NULL
30#define s3c2410a_init NULL 30#define s3c2410a_init NULL
31#endif 31#endif
32
33extern int s3c2410_baseclk_add(void);
diff --git a/arch/arm/plat-samsung/include/plat/s3c2443.h b/arch/arm/plat-samsung/include/plat/s3c2443.h
index dce05b43d51..a5b794ff838 100644
--- a/arch/arm/plat-samsung/include/plat/s3c2443.h
+++ b/arch/arm/plat-samsung/include/plat/s3c2443.h
@@ -32,23 +32,3 @@ extern void s3c2443_restart(char mode, const char *cmd);
32#define s3c2443_init NULL 32#define s3c2443_init NULL
33#define s3c2443_restart NULL 33#define s3c2443_restart NULL
34#endif 34#endif
35
36/* common code used by s3c2443 and others.
37 * note, not to be used outside of arch/arm/mach-s3c* */
38
39struct clk; /* some files don't need clk.h otherwise */
40
41typedef unsigned int (*pll_fn)(unsigned int reg, unsigned int base);
42
43extern void s3c2443_common_setup_clocks(pll_fn get_mpll);
44extern void s3c2443_common_init_clocks(int xtal, pll_fn get_mpll,
45 unsigned int *divs, int nr_divs,
46 int divmask);
47
48extern int s3c2443_clkcon_enable_h(struct clk *clk, int enable);
49extern int s3c2443_clkcon_enable_p(struct clk *clk, int enable);
50extern int s3c2443_clkcon_enable_s(struct clk *clk, int enable);
51
52extern struct clksrc_clk clk_epllref;
53extern struct clksrc_clk clk_esysclk;
54extern struct clksrc_clk clk_msysclk;
diff --git a/arch/avr32/mach-at32ap/include/mach/cpu.h b/arch/avr32/mach-at32ap/include/mach/cpu.h
index 8181293115e..16a24b14146 100644
--- a/arch/avr32/mach-at32ap/include/mach/cpu.h
+++ b/arch/avr32/mach-at32ap/include/mach/cpu.h
@@ -30,9 +30,6 @@
30#define cpu_is_at91sam9261() (0) 30#define cpu_is_at91sam9261() (0)
31#define cpu_is_at91sam9263() (0) 31#define cpu_is_at91sam9263() (0)
32#define cpu_is_at91sam9rl() (0) 32#define cpu_is_at91sam9rl() (0)
33#define cpu_is_at91cap9() (0)
34#define cpu_is_at91cap9_revB() (0)
35#define cpu_is_at91cap9_revC() (0)
36#define cpu_is_at91sam9g10() (0) 33#define cpu_is_at91sam9g10() (0)
37#define cpu_is_at91sam9g20() (0) 34#define cpu_is_at91sam9g20() (0)
38#define cpu_is_at91sam9g45() (0) 35#define cpu_is_at91sam9g45() (0)
diff --git a/arch/c6x/boot/Makefile b/arch/c6x/boot/Makefile
index ecca820e604..6891257d514 100644
--- a/arch/c6x/boot/Makefile
+++ b/arch/c6x/boot/Makefile
@@ -13,7 +13,7 @@ obj-y += linked_dtb.o
13endif 13endif
14 14
15$(obj)/%.dtb: $(src)/dts/%.dts FORCE 15$(obj)/%.dtb: $(src)/dts/%.dts FORCE
16 $(call cmd,dtc) 16 $(call if_changed_dep,dtc)
17 17
18quiet_cmd_cp = CP $< $@$2 18quiet_cmd_cp = CP $< $@$2
19 cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false) 19 cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false)
diff --git a/arch/m68k/include/asm/mcf_pgtable.h b/arch/m68k/include/asm/mcf_pgtable.h
index 756bde4fb4f..3c793682e5d 100644
--- a/arch/m68k/include/asm/mcf_pgtable.h
+++ b/arch/m68k/include/asm/mcf_pgtable.h
@@ -78,7 +78,8 @@
78 | CF_PAGE_READABLE \ 78 | CF_PAGE_READABLE \
79 | CF_PAGE_WRITABLE \ 79 | CF_PAGE_WRITABLE \
80 | CF_PAGE_EXEC \ 80 | CF_PAGE_EXEC \
81 | CF_PAGE_SYSTEM) 81 | CF_PAGE_SYSTEM \
82 | CF_PAGE_SHARED)
82 83
83#define PAGE_COPY __pgprot(CF_PAGE_VALID \ 84#define PAGE_COPY __pgprot(CF_PAGE_VALID \
84 | CF_PAGE_ACCESSED \ 85 | CF_PAGE_ACCESSED \
diff --git a/arch/m68k/mm/mcfmmu.c b/arch/m68k/mm/mcfmmu.c
index babd5a97cdc..875b800ef0d 100644
--- a/arch/m68k/mm/mcfmmu.c
+++ b/arch/m68k/mm/mcfmmu.c
@@ -87,7 +87,7 @@ void __init paging_init(void)
87 87
88int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word) 88int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word)
89{ 89{
90 unsigned long flags, mmuar; 90 unsigned long flags, mmuar, mmutr;
91 struct mm_struct *mm; 91 struct mm_struct *mm;
92 pgd_t *pgd; 92 pgd_t *pgd;
93 pmd_t *pmd; 93 pmd_t *pmd;
@@ -137,9 +137,10 @@ int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word)
137 if (!pte_dirty(*pte) && !KMAPAREA(mmuar)) 137 if (!pte_dirty(*pte) && !KMAPAREA(mmuar))
138 set_pte(pte, pte_wrprotect(*pte)); 138 set_pte(pte, pte_wrprotect(*pte));
139 139
140 mmu_write(MMUTR, (mmuar & PAGE_MASK) | (asid << MMUTR_IDN) | 140 mmutr = (mmuar & PAGE_MASK) | (asid << MMUTR_IDN) | MMUTR_V;
141 (((int)(pte->pte) & (int)CF_PAGE_MMUTR_MASK) 141 if ((mmuar < TASK_UNMAPPED_BASE) || (mmuar >= TASK_SIZE))
142 >> CF_PAGE_MMUTR_SHIFT) | MMUTR_V); 142 mmutr |= (pte->pte & CF_PAGE_MMUTR_MASK) >> CF_PAGE_MMUTR_SHIFT;
143 mmu_write(MMUTR, mmutr);
143 144
144 mmu_write(MMUDR, (pte_val(*pte) & PAGE_MASK) | 145 mmu_write(MMUDR, (pte_val(*pte) & PAGE_MASK) |
145 ((pte->pte) & CF_PAGE_MMUDR_MASK) | MMUDR_SZ_8KB | MMUDR_X); 146 ((pte->pte) & CF_PAGE_MMUDR_MASK) | MMUDR_SZ_8KB | MMUDR_X);
diff --git a/arch/m68k/platform/coldfire/entry.S b/arch/m68k/platform/coldfire/entry.S
index 863889fc31c..281e38c2b6c 100644
--- a/arch/m68k/platform/coldfire/entry.S
+++ b/arch/m68k/platform/coldfire/entry.S
@@ -136,7 +136,7 @@ Luser_return:
136 movel %sp,%d1 /* get thread_info pointer */ 136 movel %sp,%d1 /* get thread_info pointer */
137 andl #-THREAD_SIZE,%d1 /* at base of kernel stack */ 137 andl #-THREAD_SIZE,%d1 /* at base of kernel stack */
138 movel %d1,%a0 138 movel %d1,%a0
139 movel %a0@(TINFO_FLAGS),%d1 /* get thread_info->flags */ 139 moveb %a0@(TINFO_FLAGS+3),%d1 /* thread_info->flags (low 8 bits) */
140 jne Lwork_to_do /* still work to do */ 140 jne Lwork_to_do /* still work to do */
141 141
142Lreturn: 142Lreturn:
@@ -148,8 +148,6 @@ Lwork_to_do:
148 btst #TIF_NEED_RESCHED,%d1 148 btst #TIF_NEED_RESCHED,%d1
149 jne reschedule 149 jne reschedule
150 150
151 /* GERG: do we need something here for TRACEing?? */
152
153Lsignal_return: 151Lsignal_return:
154 subql #4,%sp /* dummy return address */ 152 subql #4,%sp /* dummy return address */
155 SAVE_SWITCH_STACK 153 SAVE_SWITCH_STACK
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index 4f80cf1ce77..3e57a00b8cb 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -1213,7 +1213,7 @@ do_user_signal: /* r10 contains MSR_KERNEL here */
1213 stw r3,_TRAP(r1) 1213 stw r3,_TRAP(r1)
12142: addi r3,r1,STACK_FRAME_OVERHEAD 12142: addi r3,r1,STACK_FRAME_OVERHEAD
1215 mr r4,r9 1215 mr r4,r9
1216 bl do_signal 1216 bl do_notify_resume
1217 REST_NVGPRS(r1) 1217 REST_NVGPRS(r1)
1218 b recheck 1218 b recheck
1219 1219
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index d834425186a..866462cbe2d 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -751,12 +751,16 @@ user_work:
751 751
752 andi. r0,r4,_TIF_NEED_RESCHED 752 andi. r0,r4,_TIF_NEED_RESCHED
753 beq 1f 753 beq 1f
754 li r5,1
755 TRACE_AND_RESTORE_IRQ(r5);
754 bl .schedule 756 bl .schedule
755 b .ret_from_except_lite 757 b .ret_from_except_lite
756 758
7571: bl .save_nvgprs 7591: bl .save_nvgprs
760 li r5,1
761 TRACE_AND_RESTORE_IRQ(r5);
758 addi r3,r1,STACK_FRAME_OVERHEAD 762 addi r3,r1,STACK_FRAME_OVERHEAD
759 bl .do_signal 763 bl .do_notify_resume
760 b .ret_from_except 764 b .ret_from_except
761 765
762unrecov_restore: 766unrecov_restore:
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index 3844ca7c509..15c5a4f6de0 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -774,8 +774,8 @@ alignment_common:
774program_check_common: 774program_check_common:
775 EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN) 775 EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN)
776 bl .save_nvgprs 776 bl .save_nvgprs
777 addi r3,r1,STACK_FRAME_OVERHEAD
778 DISABLE_INTS 777 DISABLE_INTS
778 addi r3,r1,STACK_FRAME_OVERHEAD
779 bl .program_check_exception 779 bl .program_check_exception
780 b .ret_from_except 780 b .ret_from_except
781 781
diff --git a/arch/powerpc/kernel/signal.c b/arch/powerpc/kernel/signal.c
index 2300426e531..ac6e437b102 100644
--- a/arch/powerpc/kernel/signal.c
+++ b/arch/powerpc/kernel/signal.c
@@ -11,6 +11,7 @@
11 11
12#include <linux/tracehook.h> 12#include <linux/tracehook.h>
13#include <linux/signal.h> 13#include <linux/signal.h>
14#include <linux/key.h>
14#include <asm/hw_breakpoint.h> 15#include <asm/hw_breakpoint.h>
15#include <asm/uaccess.h> 16#include <asm/uaccess.h>
16#include <asm/unistd.h> 17#include <asm/unistd.h>
@@ -113,8 +114,9 @@ static void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka,
113 } 114 }
114} 115}
115 116
116static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs) 117static int do_signal(struct pt_regs *regs)
117{ 118{
119 sigset_t *oldset;
118 siginfo_t info; 120 siginfo_t info;
119 int signr; 121 int signr;
120 struct k_sigaction ka; 122 struct k_sigaction ka;
@@ -123,7 +125,7 @@ static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs)
123 125
124 if (current_thread_info()->local_flags & _TLF_RESTORE_SIGMASK) 126 if (current_thread_info()->local_flags & _TLF_RESTORE_SIGMASK)
125 oldset = &current->saved_sigmask; 127 oldset = &current->saved_sigmask;
126 else if (!oldset) 128 else
127 oldset = &current->blocked; 129 oldset = &current->blocked;
128 130
129 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 131 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
@@ -191,14 +193,16 @@ static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs)
191 return ret; 193 return ret;
192} 194}
193 195
194void do_signal(struct pt_regs *regs, unsigned long thread_info_flags) 196void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
195{ 197{
196 if (thread_info_flags & _TIF_SIGPENDING) 198 if (thread_info_flags & _TIF_SIGPENDING)
197 do_signal_pending(NULL, regs); 199 do_signal(regs);
198 200
199 if (thread_info_flags & _TIF_NOTIFY_RESUME) { 201 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
200 clear_thread_flag(TIF_NOTIFY_RESUME); 202 clear_thread_flag(TIF_NOTIFY_RESUME);
201 tracehook_notify_resume(regs); 203 tracehook_notify_resume(regs);
204 if (current->replacement_session_keyring)
205 key_replace_session_keyring();
202 } 206 }
203} 207}
204 208
diff --git a/arch/powerpc/kernel/signal.h b/arch/powerpc/kernel/signal.h
index 6c0ddfc0603..8dde973aaaf 100644
--- a/arch/powerpc/kernel/signal.h
+++ b/arch/powerpc/kernel/signal.h
@@ -12,7 +12,7 @@
12 12
13#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) 13#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
14 14
15extern void do_signal(struct pt_regs *regs, unsigned long thread_info_flags); 15extern void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags);
16 16
17extern void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, 17extern void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
18 size_t frame_size, int is_32); 18 size_t frame_size, int is_32);
diff --git a/arch/powerpc/platforms/wsp/smp.c b/arch/powerpc/platforms/wsp/smp.c
index 71bd105f386..0ba103ae83a 100644
--- a/arch/powerpc/platforms/wsp/smp.c
+++ b/arch/powerpc/platforms/wsp/smp.c
@@ -71,7 +71,7 @@ int __devinit smp_a2_kick_cpu(int nr)
71 71
72static int __init smp_a2_probe(void) 72static int __init smp_a2_probe(void)
73{ 73{
74 return cpus_weight(cpu_possible_map); 74 return num_possible_cpus();
75} 75}
76 76
77static struct smp_ops_t a2_smp_ops = { 77static struct smp_ops_t a2_smp_ops = {
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index 18c51df9fe0..ff605a39cf4 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -662,7 +662,7 @@ ENTRY(sys32_getresuid16_wrapper)
662ENTRY(sys32_poll_wrapper) 662ENTRY(sys32_poll_wrapper)
663 llgtr %r2,%r2 # struct pollfd * 663 llgtr %r2,%r2 # struct pollfd *
664 llgfr %r3,%r3 # unsigned int 664 llgfr %r3,%r3 # unsigned int
665 lgfr %r4,%r4 # long 665 lgfr %r4,%r4 # int
666 jg sys_poll # branch to system call 666 jg sys_poll # branch to system call
667 667
668ENTRY(sys32_setresgid16_wrapper) 668ENTRY(sys32_setresgid16_wrapper)
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 3201ae44799..4261aa79977 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -76,7 +76,6 @@ static void default_idle(void)
76 if (test_thread_flag(TIF_MCCK_PENDING)) { 76 if (test_thread_flag(TIF_MCCK_PENDING)) {
77 local_mcck_enable(); 77 local_mcck_enable();
78 local_irq_enable(); 78 local_irq_enable();
79 s390_handle_mcck();
80 return; 79 return;
81 } 80 }
82 trace_hardirqs_on(); 81 trace_hardirqs_on();
@@ -93,10 +92,12 @@ void cpu_idle(void)
93 for (;;) { 92 for (;;) {
94 tick_nohz_idle_enter(); 93 tick_nohz_idle_enter();
95 rcu_idle_enter(); 94 rcu_idle_enter();
96 while (!need_resched()) 95 while (!need_resched() && !test_thread_flag(TIF_MCCK_PENDING))
97 default_idle(); 96 default_idle();
98 rcu_idle_exit(); 97 rcu_idle_exit();
99 tick_nohz_idle_exit(); 98 tick_nohz_idle_exit();
99 if (test_thread_flag(TIF_MCCK_PENDING))
100 s390_handle_mcck();
100 preempt_enable_no_resched(); 101 preempt_enable_no_resched();
101 schedule(); 102 schedule();
102 preempt_disable(); 103 preempt_disable();
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index fa02f443f5f..14da278febb 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -113,11 +113,14 @@ static void fixup_clock_comparator(unsigned long long delta)
113static int s390_next_ktime(ktime_t expires, 113static int s390_next_ktime(ktime_t expires,
114 struct clock_event_device *evt) 114 struct clock_event_device *evt)
115{ 115{
116 struct timespec ts;
116 u64 nsecs; 117 u64 nsecs;
117 118
118 nsecs = ktime_to_ns(ktime_sub(expires, ktime_get_monotonic_offset())); 119 ts.tv_sec = ts.tv_nsec = 0;
120 monotonic_to_bootbased(&ts);
121 nsecs = ktime_to_ns(ktime_add(timespec_to_ktime(ts), expires));
119 do_div(nsecs, 125); 122 do_div(nsecs, 125);
120 S390_lowcore.clock_comparator = TOD_UNIX_EPOCH + (nsecs << 9); 123 S390_lowcore.clock_comparator = sched_clock_base_cc + (nsecs << 9);
121 set_clock_comparator(S390_lowcore.clock_comparator); 124 set_clock_comparator(S390_lowcore.clock_comparator);
122 return 0; 125 return 0;
123} 126}
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index 9a4d02f64f1..51b0738e13d 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -574,7 +574,7 @@ static inline void page_table_free_pgste(unsigned long *table)
574 page = pfn_to_page(__pa(table) >> PAGE_SHIFT); 574 page = pfn_to_page(__pa(table) >> PAGE_SHIFT);
575 mp = (struct gmap_pgtable *) page->index; 575 mp = (struct gmap_pgtable *) page->index;
576 BUG_ON(!list_empty(&mp->mapper)); 576 BUG_ON(!list_empty(&mp->mapper));
577 pgtable_page_ctor(page); 577 pgtable_page_dtor(page);
578 atomic_set(&page->_mapcount, -1); 578 atomic_set(&page->_mapcount, -1);
579 kfree(mp); 579 kfree(mp);
580 __free_page(page); 580 __free_page(page);
diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
index 0838154dd21..24b1ee410da 100644
--- a/arch/sh/boards/board-sh7757lcr.c
+++ b/arch/sh/boards/board-sh7757lcr.c
@@ -169,6 +169,11 @@ static struct resource sh_eth_giga1_resources[] = {
169 .end = 0xfee00fff, 169 .end = 0xfee00fff,
170 .flags = IORESOURCE_MEM, 170 .flags = IORESOURCE_MEM,
171 }, { 171 }, {
172 /* TSU */
173 .start = 0xfee01800,
174 .end = 0xfee01fff,
175 .flags = IORESOURCE_MEM,
176 }, {
172 .start = 316, 177 .start = 316,
173 .end = 316, 178 .end = 316,
174 .flags = IORESOURCE_IRQ, 179 .flags = IORESOURCE_IRQ,
@@ -210,20 +215,13 @@ static struct resource sh_mmcif_resources[] = {
210 }, 215 },
211}; 216};
212 217
213static struct sh_mmcif_dma sh7757lcr_mmcif_dma = {
214 .chan_priv_tx = {
215 .slave_id = SHDMA_SLAVE_MMCIF_TX,
216 },
217 .chan_priv_rx = {
218 .slave_id = SHDMA_SLAVE_MMCIF_RX,
219 }
220};
221
222static struct sh_mmcif_plat_data sh_mmcif_plat = { 218static struct sh_mmcif_plat_data sh_mmcif_plat = {
223 .dma = &sh7757lcr_mmcif_dma,
224 .sup_pclk = 0x0f, 219 .sup_pclk = 0x0f,
225 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, 220 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA |
221 MMC_CAP_NONREMOVABLE,
226 .ocr = MMC_VDD_32_33 | MMC_VDD_33_34, 222 .ocr = MMC_VDD_32_33 | MMC_VDD_33_34,
223 .slave_id_tx = SHDMA_SLAVE_MMCIF_TX,
224 .slave_id_rx = SHDMA_SLAVE_MMCIF_RX,
227}; 225};
228 226
229static struct platform_device sh_mmcif_device = { 227static struct platform_device sh_mmcif_device = {
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
index 6418e95c2b6..ebd0f818a25 100644
--- a/arch/sh/boards/mach-ap325rxa/setup.c
+++ b/arch/sh/boards/mach-ap325rxa/setup.c
@@ -22,6 +22,7 @@
22#include <linux/i2c.h> 22#include <linux/i2c.h>
23#include <linux/smsc911x.h> 23#include <linux/smsc911x.h>
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/videodev2.h>
25#include <media/ov772x.h> 26#include <media/ov772x.h>
26#include <media/soc_camera.h> 27#include <media/soc_camera.h>
27#include <media/soc_camera_platform.h> 28#include <media/soc_camera_platform.h>
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 033ef2ba621..cde7c0085ce 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -29,9 +29,11 @@
29#include <linux/input.h> 29#include <linux/input.h>
30#include <linux/input/sh_keysc.h> 30#include <linux/input/sh_keysc.h>
31#include <linux/sh_eth.h> 31#include <linux/sh_eth.h>
32#include <linux/videodev2.h>
32#include <video/sh_mobile_lcdc.h> 33#include <video/sh_mobile_lcdc.h>
33#include <sound/sh_fsi.h> 34#include <sound/sh_fsi.h>
34#include <media/sh_mobile_ceu.h> 35#include <media/sh_mobile_ceu.h>
36#include <media/soc_camera.h>
35#include <media/tw9910.h> 37#include <media/tw9910.h>
36#include <media/mt9t112.h> 38#include <media/mt9t112.h>
37#include <asm/heartbeat.h> 39#include <asm/heartbeat.h>
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
index 2a18b06abda..5b382e1afae 100644
--- a/arch/sh/boards/mach-kfr2r09/setup.c
+++ b/arch/sh/boards/mach-kfr2r09/setup.c
@@ -22,6 +22,7 @@
22#include <linux/input/sh_keysc.h> 22#include <linux/input/sh_keysc.h>
23#include <linux/i2c.h> 23#include <linux/i2c.h>
24#include <linux/usb/r8a66597.h> 24#include <linux/usb/r8a66597.h>
25#include <linux/videodev2.h>
25#include <media/rj54n1cb0c.h> 26#include <media/rj54n1cb0c.h>
26#include <media/soc_camera.h> 27#include <media/soc_camera.h>
27#include <media/sh_mobile_ceu.h> 28#include <media/sh_mobile_ceu.h>
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
index 68c3d6f4289..d37ba272052 100644
--- a/arch/sh/boards/mach-migor/setup.c
+++ b/arch/sh/boards/mach-migor/setup.c
@@ -21,9 +21,11 @@
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/gpio.h> 23#include <linux/gpio.h>
24#include <linux/videodev2.h>
24#include <video/sh_mobile_lcdc.h> 25#include <video/sh_mobile_lcdc.h>
25#include <media/sh_mobile_ceu.h> 26#include <media/sh_mobile_ceu.h>
26#include <media/ov772x.h> 27#include <media/ov772x.h>
28#include <media/soc_camera.h>
27#include <media/tw9910.h> 29#include <media/tw9910.h>
28#include <asm/clock.h> 30#include <asm/clock.h>
29#include <asm/machvec.h> 31#include <asm/machvec.h>
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index 036fe1adaef..2b07fc01695 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -24,6 +24,7 @@
24#include <linux/input/sh_keysc.h> 24#include <linux/input/sh_keysc.h>
25#include <linux/usb/r8a66597.h> 25#include <linux/usb/r8a66597.h>
26#include <linux/sh_eth.h> 26#include <linux/sh_eth.h>
27#include <linux/videodev2.h>
27#include <video/sh_mobile_lcdc.h> 28#include <video/sh_mobile_lcdc.h>
28#include <media/sh_mobile_ceu.h> 29#include <media/sh_mobile_ceu.h>
29#include <sound/sh_fsi.h> 30#include <sound/sh_fsi.h>
diff --git a/arch/sh/drivers/pci/pci-sh7780.c b/arch/sh/drivers/pci/pci-sh7780.c
index fa7b978cc72..fb8f1499074 100644
--- a/arch/sh/drivers/pci/pci-sh7780.c
+++ b/arch/sh/drivers/pci/pci-sh7780.c
@@ -74,7 +74,7 @@ struct pci_errors {
74 { SH4_PCIINT_MLCK, "master lock error" }, 74 { SH4_PCIINT_MLCK, "master lock error" },
75 { SH4_PCIINT_TABT, "target-target abort" }, 75 { SH4_PCIINT_TABT, "target-target abort" },
76 { SH4_PCIINT_TRET, "target retry time out" }, 76 { SH4_PCIINT_TRET, "target retry time out" },
77 { SH4_PCIINT_MFDE, "master function disable erorr" }, 77 { SH4_PCIINT_MFDE, "master function disable error" },
78 { SH4_PCIINT_PRTY, "address parity error" }, 78 { SH4_PCIINT_PRTY, "address parity error" },
79 { SH4_PCIINT_SERR, "SERR" }, 79 { SH4_PCIINT_SERR, "SERR" },
80 { SH4_PCIINT_TWDP, "data parity error for target write" }, 80 { SH4_PCIINT_TWDP, "data parity error for target write" },
diff --git a/arch/sh/include/asm/device.h b/arch/sh/include/asm/device.h
index a1c9c0daec1..071bcb4d4bf 100644
--- a/arch/sh/include/asm/device.h
+++ b/arch/sh/include/asm/device.h
@@ -3,9 +3,10 @@
3 * 3 *
4 * This file is released under the GPLv2 4 * This file is released under the GPLv2
5 */ 5 */
6#ifndef __ASM_SH_DEVICE_H
7#define __ASM_SH_DEVICE_H
6 8
7struct dev_archdata { 9#include <asm-generic/device.h>
8};
9 10
10struct platform_device; 11struct platform_device;
11/* allocate contiguous memory chunk and fill in struct resource */ 12/* allocate contiguous memory chunk and fill in struct resource */
@@ -14,5 +15,4 @@ int platform_resource_setup_memory(struct platform_device *pdev,
14 15
15void plat_early_device_setup(void); 16void plat_early_device_setup(void);
16 17
17struct pdev_archdata { 18#endif /* __ASM_SH_DEVICE_H */
18};
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
index b3c039a5064..70bd96646f4 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
@@ -343,7 +343,7 @@ static struct clk_lookup lookups[] = {
343 CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[HWBLK_CEU1]), 343 CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[HWBLK_CEU1]),
344 CLKDEV_CON_ID("beu1", &mstp_clks[HWBLK_BEU1]), 344 CLKDEV_CON_ID("beu1", &mstp_clks[HWBLK_BEU1]),
345 CLKDEV_CON_ID("2ddmac0", &mstp_clks[HWBLK_2DDMAC]), 345 CLKDEV_CON_ID("2ddmac0", &mstp_clks[HWBLK_2DDMAC]),
346 CLKDEV_CON_ID("spu0", &mstp_clks[HWBLK_SPU]), 346 CLKDEV_DEV_ID("sh_fsi.0", &mstp_clks[HWBLK_SPU]),
347 CLKDEV_CON_ID("jpu0", &mstp_clks[HWBLK_JPU]), 347 CLKDEV_CON_ID("jpu0", &mstp_clks[HWBLK_JPU]),
348 CLKDEV_DEV_ID("sh-vou.0", &mstp_clks[HWBLK_VOU]), 348 CLKDEV_DEV_ID("sh-vou.0", &mstp_clks[HWBLK_VOU]),
349 CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU0]), 349 CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU0]),
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
index a7b2da6b3a1..2875e8be4f7 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
@@ -133,7 +133,7 @@ static struct resource spi0_resources[] = {
133 [0] = { 133 [0] = {
134 .start = 0xfe002000, 134 .start = 0xfe002000,
135 .end = 0xfe0020ff, 135 .end = 0xfe0020ff,
136 .flags = IORESOURCE_MEM, 136 .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
137 }, 137 },
138 [1] = { 138 [1] = {
139 .start = 86, 139 .start = 86,
@@ -661,6 +661,25 @@ static struct platform_device spi0_device = {
661 .resource = spi0_resources, 661 .resource = spi0_resources,
662}; 662};
663 663
664static struct resource spi1_resources[] = {
665 {
666 .start = 0xffd8ee70,
667 .end = 0xffd8eeff,
668 .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
669 },
670 {
671 .start = 54,
672 .flags = IORESOURCE_IRQ,
673 },
674};
675
676static struct platform_device spi1_device = {
677 .name = "sh_spi",
678 .id = 1,
679 .num_resources = ARRAY_SIZE(spi1_resources),
680 .resource = spi1_resources,
681};
682
664static struct resource usb_ehci_resources[] = { 683static struct resource usb_ehci_resources[] = {
665 [0] = { 684 [0] = {
666 .start = 0xfe4f1000, 685 .start = 0xfe4f1000,
@@ -720,6 +739,7 @@ static struct platform_device *sh7757_devices[] __initdata = {
720 &dma2_device, 739 &dma2_device,
721 &dma3_device, 740 &dma3_device,
722 &spi0_device, 741 &spi0_device,
742 &spi1_device,
723 &usb_ehci_device, 743 &usb_ehci_device,
724 &usb_ohci_device, 744 &usb_ohci_device,
725}; 745};
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c
index 3147a9a6fb8..f624174bf23 100644
--- a/arch/sh/kernel/smp.c
+++ b/arch/sh/kernel/smp.c
@@ -63,7 +63,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
63 mp_ops->prepare_cpus(max_cpus); 63 mp_ops->prepare_cpus(max_cpus);
64 64
65#ifndef CONFIG_HOTPLUG_CPU 65#ifndef CONFIG_HOTPLUG_CPU
66 init_cpu_present(&cpu_possible_map); 66 init_cpu_present(cpu_possible_mask);
67#endif 67#endif
68} 68}
69 69
diff --git a/arch/sh/kernel/topology.c b/arch/sh/kernel/topology.c
index 4649a6ff0cf..772caffba22 100644
--- a/arch/sh/kernel/topology.c
+++ b/arch/sh/kernel/topology.c
@@ -27,7 +27,7 @@ static cpumask_t cpu_coregroup_map(unsigned int cpu)
27 * Presently all SH-X3 SMP cores are multi-cores, so just keep it 27 * Presently all SH-X3 SMP cores are multi-cores, so just keep it
28 * simple until we have a method for determining topology.. 28 * simple until we have a method for determining topology..
29 */ 29 */
30 return cpu_possible_map; 30 return *cpu_possible_mask;
31} 31}
32 32
33const struct cpumask *cpu_coregroup_mask(unsigned int cpu) 33const struct cpumask *cpu_coregroup_mask(unsigned int cpu)
diff --git a/arch/sh/mm/cache-sh2a.c b/arch/sh/mm/cache-sh2a.c
index ae08cbbfa56..949e2d3138a 100644
--- a/arch/sh/mm/cache-sh2a.c
+++ b/arch/sh/mm/cache-sh2a.c
@@ -23,6 +23,7 @@
23#define MAX_OCACHE_PAGES 32 23#define MAX_OCACHE_PAGES 32
24#define MAX_ICACHE_PAGES 32 24#define MAX_ICACHE_PAGES 32
25 25
26#ifdef CONFIG_CACHE_WRITEBACK
26static void sh2a_flush_oc_line(unsigned long v, int way) 27static void sh2a_flush_oc_line(unsigned long v, int way)
27{ 28{
28 unsigned long addr = (v & 0x000007f0) | (way << 11); 29 unsigned long addr = (v & 0x000007f0) | (way << 11);
@@ -34,6 +35,7 @@ static void sh2a_flush_oc_line(unsigned long v, int way)
34 __raw_writel(data, CACHE_OC_ADDRESS_ARRAY | addr); 35 __raw_writel(data, CACHE_OC_ADDRESS_ARRAY | addr);
35 } 36 }
36} 37}
38#endif
37 39
38static void sh2a_invalidate_line(unsigned long cache_addr, unsigned long v) 40static void sh2a_invalidate_line(unsigned long cache_addr, unsigned long v)
39{ 41{
diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
index a850b4d8d14..247904945d3 100644
--- a/arch/x86/include/asm/i387.h
+++ b/arch/x86/include/asm/i387.h
@@ -29,10 +29,11 @@ extern unsigned int sig_xstate_size;
29extern void fpu_init(void); 29extern void fpu_init(void);
30extern void mxcsr_feature_mask_init(void); 30extern void mxcsr_feature_mask_init(void);
31extern int init_fpu(struct task_struct *child); 31extern int init_fpu(struct task_struct *child);
32extern void __math_state_restore(struct task_struct *);
33extern void math_state_restore(void); 32extern void math_state_restore(void);
34extern int dump_fpu(struct pt_regs *, struct user_i387_struct *); 33extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);
35 34
35DECLARE_PER_CPU(struct task_struct *, fpu_owner_task);
36
36extern user_regset_active_fn fpregs_active, xfpregs_active; 37extern user_regset_active_fn fpregs_active, xfpregs_active;
37extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get, 38extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get,
38 xstateregs_get; 39 xstateregs_get;
@@ -269,6 +270,16 @@ static inline int fpu_restore_checking(struct fpu *fpu)
269 270
270static inline int restore_fpu_checking(struct task_struct *tsk) 271static inline int restore_fpu_checking(struct task_struct *tsk)
271{ 272{
273 /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
274 is pending. Clear the x87 state here by setting it to fixed
275 values. "m" is a random variable that should be in L1 */
276 alternative_input(
277 ASM_NOP8 ASM_NOP2,
278 "emms\n\t" /* clear stack tags */
279 "fildl %P[addr]", /* set F?P to defined value */
280 X86_FEATURE_FXSAVE_LEAK,
281 [addr] "m" (tsk->thread.fpu.has_fpu));
282
272 return fpu_restore_checking(&tsk->thread.fpu); 283 return fpu_restore_checking(&tsk->thread.fpu);
273} 284}
274 285
@@ -279,19 +290,21 @@ static inline int restore_fpu_checking(struct task_struct *tsk)
279 */ 290 */
280static inline int __thread_has_fpu(struct task_struct *tsk) 291static inline int __thread_has_fpu(struct task_struct *tsk)
281{ 292{
282 return tsk->thread.has_fpu; 293 return tsk->thread.fpu.has_fpu;
283} 294}
284 295
285/* Must be paired with an 'stts' after! */ 296/* Must be paired with an 'stts' after! */
286static inline void __thread_clear_has_fpu(struct task_struct *tsk) 297static inline void __thread_clear_has_fpu(struct task_struct *tsk)
287{ 298{
288 tsk->thread.has_fpu = 0; 299 tsk->thread.fpu.has_fpu = 0;
300 percpu_write(fpu_owner_task, NULL);
289} 301}
290 302
291/* Must be paired with a 'clts' before! */ 303/* Must be paired with a 'clts' before! */
292static inline void __thread_set_has_fpu(struct task_struct *tsk) 304static inline void __thread_set_has_fpu(struct task_struct *tsk)
293{ 305{
294 tsk->thread.has_fpu = 1; 306 tsk->thread.fpu.has_fpu = 1;
307 percpu_write(fpu_owner_task, tsk);
295} 308}
296 309
297/* 310/*
@@ -336,30 +349,36 @@ typedef struct { int preload; } fpu_switch_t;
336 * We don't do that yet, so "fpu_lazy_restore()" always returns 349 * We don't do that yet, so "fpu_lazy_restore()" always returns
337 * false, but some day.. 350 * false, but some day..
338 */ 351 */
339#define fpu_lazy_restore(tsk) (0) 352static inline int fpu_lazy_restore(struct task_struct *new, unsigned int cpu)
340#define fpu_lazy_state_intact(tsk) do { } while (0) 353{
354 return new == percpu_read_stable(fpu_owner_task) &&
355 cpu == new->thread.fpu.last_cpu;
356}
341 357
342static inline fpu_switch_t switch_fpu_prepare(struct task_struct *old, struct task_struct *new) 358static inline fpu_switch_t switch_fpu_prepare(struct task_struct *old, struct task_struct *new, int cpu)
343{ 359{
344 fpu_switch_t fpu; 360 fpu_switch_t fpu;
345 361
346 fpu.preload = tsk_used_math(new) && new->fpu_counter > 5; 362 fpu.preload = tsk_used_math(new) && new->fpu_counter > 5;
347 if (__thread_has_fpu(old)) { 363 if (__thread_has_fpu(old)) {
348 if (__save_init_fpu(old)) 364 if (!__save_init_fpu(old))
349 fpu_lazy_state_intact(old); 365 cpu = ~0;
350 __thread_clear_has_fpu(old); 366 old->thread.fpu.last_cpu = cpu;
351 old->fpu_counter++; 367 old->thread.fpu.has_fpu = 0; /* But leave fpu_owner_task! */
352 368
353 /* Don't change CR0.TS if we just switch! */ 369 /* Don't change CR0.TS if we just switch! */
354 if (fpu.preload) { 370 if (fpu.preload) {
371 new->fpu_counter++;
355 __thread_set_has_fpu(new); 372 __thread_set_has_fpu(new);
356 prefetch(new->thread.fpu.state); 373 prefetch(new->thread.fpu.state);
357 } else 374 } else
358 stts(); 375 stts();
359 } else { 376 } else {
360 old->fpu_counter = 0; 377 old->fpu_counter = 0;
378 old->thread.fpu.last_cpu = ~0;
361 if (fpu.preload) { 379 if (fpu.preload) {
362 if (fpu_lazy_restore(new)) 380 new->fpu_counter++;
381 if (fpu_lazy_restore(new, cpu))
363 fpu.preload = 0; 382 fpu.preload = 0;
364 else 383 else
365 prefetch(new->thread.fpu.state); 384 prefetch(new->thread.fpu.state);
@@ -377,8 +396,10 @@ static inline fpu_switch_t switch_fpu_prepare(struct task_struct *old, struct ta
377 */ 396 */
378static inline void switch_fpu_finish(struct task_struct *new, fpu_switch_t fpu) 397static inline void switch_fpu_finish(struct task_struct *new, fpu_switch_t fpu)
379{ 398{
380 if (fpu.preload) 399 if (fpu.preload) {
381 __math_state_restore(new); 400 if (unlikely(restore_fpu_checking(new)))
401 __thread_fpu_end(new);
402 }
382} 403}
383 404
384/* 405/*
@@ -451,8 +472,10 @@ static inline void kernel_fpu_begin(void)
451 __save_init_fpu(me); 472 __save_init_fpu(me);
452 __thread_clear_has_fpu(me); 473 __thread_clear_has_fpu(me);
453 /* We do 'stts()' in kernel_fpu_end() */ 474 /* We do 'stts()' in kernel_fpu_end() */
454 } else 475 } else {
476 percpu_write(fpu_owner_task, NULL);
455 clts(); 477 clts();
478 }
456} 479}
457 480
458static inline void kernel_fpu_end(void) 481static inline void kernel_fpu_end(void)
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index f7c89e231c6..58545c97d07 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -374,6 +374,8 @@ union thread_xstate {
374}; 374};
375 375
376struct fpu { 376struct fpu {
377 unsigned int last_cpu;
378 unsigned int has_fpu;
377 union thread_xstate *state; 379 union thread_xstate *state;
378}; 380};
379 381
@@ -454,7 +456,6 @@ struct thread_struct {
454 unsigned long trap_no; 456 unsigned long trap_no;
455 unsigned long error_code; 457 unsigned long error_code;
456 /* floating point and extended processor state */ 458 /* floating point and extended processor state */
457 unsigned long has_fpu;
458 struct fpu fpu; 459 struct fpu fpu;
459#ifdef CONFIG_X86_32 460#ifdef CONFIG_X86_32
460 /* Virtual 86 mode info */ 461 /* Virtual 86 mode info */
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index d43cad74f16..c0f7d68d318 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -1044,6 +1044,9 @@ DEFINE_PER_CPU(char *, irq_stack_ptr) =
1044 1044
1045DEFINE_PER_CPU(unsigned int, irq_count) = -1; 1045DEFINE_PER_CPU(unsigned int, irq_count) = -1;
1046 1046
1047DEFINE_PER_CPU(struct task_struct *, fpu_owner_task);
1048EXPORT_PER_CPU_SYMBOL(fpu_owner_task);
1049
1047/* 1050/*
1048 * Special IST stacks which the CPU switches to when it calls 1051 * Special IST stacks which the CPU switches to when it calls
1049 * an IST-marked descriptor entry. Up to 7 stacks (hardware 1052 * an IST-marked descriptor entry. Up to 7 stacks (hardware
@@ -1111,6 +1114,8 @@ void debug_stack_reset(void)
1111 1114
1112DEFINE_PER_CPU(struct task_struct *, current_task) = &init_task; 1115DEFINE_PER_CPU(struct task_struct *, current_task) = &init_task;
1113EXPORT_PER_CPU_SYMBOL(current_task); 1116EXPORT_PER_CPU_SYMBOL(current_task);
1117DEFINE_PER_CPU(struct task_struct *, fpu_owner_task);
1118EXPORT_PER_CPU_SYMBOL(fpu_owner_task);
1114 1119
1115#ifdef CONFIG_CC_STACKPROTECTOR 1120#ifdef CONFIG_CC_STACKPROTECTOR
1116DEFINE_PER_CPU_ALIGNED(struct stack_canary, stack_canary); 1121DEFINE_PER_CPU_ALIGNED(struct stack_canary, stack_canary);
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 80bfe1ab003..c08d1ff12b7 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -214,6 +214,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
214 214
215 task_user_gs(p) = get_user_gs(regs); 215 task_user_gs(p) = get_user_gs(regs);
216 216
217 p->fpu_counter = 0;
217 p->thread.io_bitmap_ptr = NULL; 218 p->thread.io_bitmap_ptr = NULL;
218 tsk = current; 219 tsk = current;
219 err = -ENOMEM; 220 err = -ENOMEM;
@@ -303,7 +304,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
303 304
304 /* never put a printk in __switch_to... printk() calls wake_up*() indirectly */ 305 /* never put a printk in __switch_to... printk() calls wake_up*() indirectly */
305 306
306 fpu = switch_fpu_prepare(prev_p, next_p); 307 fpu = switch_fpu_prepare(prev_p, next_p, cpu);
307 308
308 /* 309 /*
309 * Reload esp0. 310 * Reload esp0.
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 1fd94bc4279..cfa5c90c01d 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -286,6 +286,7 @@ int copy_thread(unsigned long clone_flags, unsigned long sp,
286 286
287 set_tsk_thread_flag(p, TIF_FORK); 287 set_tsk_thread_flag(p, TIF_FORK);
288 288
289 p->fpu_counter = 0;
289 p->thread.io_bitmap_ptr = NULL; 290 p->thread.io_bitmap_ptr = NULL;
290 291
291 savesegment(gs, p->thread.gsindex); 292 savesegment(gs, p->thread.gsindex);
@@ -388,7 +389,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
388 unsigned fsindex, gsindex; 389 unsigned fsindex, gsindex;
389 fpu_switch_t fpu; 390 fpu_switch_t fpu;
390 391
391 fpu = switch_fpu_prepare(prev_p, next_p); 392 fpu = switch_fpu_prepare(prev_p, next_p, cpu);
392 393
393 /* 394 /*
394 * Reload esp0, LDT and the page table pointer: 395 * Reload esp0, LDT and the page table pointer:
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 77da5b475ad..4bbe04d9674 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -571,37 +571,6 @@ asmlinkage void __attribute__((weak)) smp_threshold_interrupt(void)
571} 571}
572 572
573/* 573/*
574 * This gets called with the process already owning the
575 * FPU state, and with CR0.TS cleared. It just needs to
576 * restore the FPU register state.
577 */
578void __math_state_restore(struct task_struct *tsk)
579{
580 /* We need a safe address that is cheap to find and that is already
581 in L1. We've just brought in "tsk->thread.has_fpu", so use that */
582#define safe_address (tsk->thread.has_fpu)
583
584 /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
585 is pending. Clear the x87 state here by setting it to fixed
586 values. safe_address is a random variable that should be in L1 */
587 alternative_input(
588 ASM_NOP8 ASM_NOP2,
589 "emms\n\t" /* clear stack tags */
590 "fildl %P[addr]", /* set F?P to defined value */
591 X86_FEATURE_FXSAVE_LEAK,
592 [addr] "m" (safe_address));
593
594 /*
595 * Paranoid restore. send a SIGSEGV if we fail to restore the state.
596 */
597 if (unlikely(restore_fpu_checking(tsk))) {
598 __thread_fpu_end(tsk);
599 force_sig(SIGSEGV, tsk);
600 return;
601 }
602}
603
604/*
605 * 'math_state_restore()' saves the current math information in the 574 * 'math_state_restore()' saves the current math information in the
606 * old math state array, and gets the new ones from the current task 575 * old math state array, and gets the new ones from the current task
607 * 576 *
@@ -631,7 +600,14 @@ void math_state_restore(void)
631 } 600 }
632 601
633 __thread_fpu_begin(tsk); 602 __thread_fpu_begin(tsk);
634 __math_state_restore(tsk); 603 /*
604 * Paranoid restore. send a SIGSEGV if we fail to restore the state.
605 */
606 if (unlikely(restore_fpu_checking(tsk))) {
607 __thread_fpu_end(tsk);
608 force_sig(SIGSEGV, tsk);
609 return;
610 }
635 611
636 tsk->fpu_counter++; 612 tsk->fpu_counter++;
637} 613}