aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig85
-rw-r--r--arch/arm/Makefile4
-rw-r--r--arch/arm/boot/compressed/head.S16
-rw-r--r--arch/arm/common/sa1111.c8
-rw-r--r--arch/arm/common/timer-sp.c82
-rw-r--r--arch/arm/common/vic.c69
-rw-r--r--arch/arm/configs/mxs_defconfig129
-rw-r--r--arch/arm/configs/ns9xxx_defconfig56
-rw-r--r--arch/arm/configs/realview-smp_defconfig2
-rw-r--r--arch/arm/configs/realview_defconfig2
-rw-r--r--arch/arm/configs/spear310_defconfig52
-rw-r--r--arch/arm/configs/spear320_defconfig52
-rw-r--r--arch/arm/configs/spear3xx_defconfig (renamed from arch/arm/configs/spear300_defconfig)4
-rw-r--r--arch/arm/configs/spear6xx_defconfig (renamed from arch/arm/configs/spear600_defconfig)2
-rw-r--r--arch/arm/configs/stmp378x_defconfig128
-rw-r--r--arch/arm/configs/stmp37xx_defconfig108
-rw-r--r--arch/arm/configs/versatile_defconfig2
-rw-r--r--arch/arm/include/asm/dma.h4
-rw-r--r--arch/arm/include/asm/elf.h1
-rw-r--r--arch/arm/include/asm/futex.h137
-rw-r--r--arch/arm/include/asm/hardware/timer-sp.h4
-rw-r--r--arch/arm/include/asm/i8253.h15
-rw-r--r--arch/arm/include/asm/mach/time.h1
-rw-r--r--arch/arm/include/asm/memory.h10
-rw-r--r--arch/arm/include/asm/ptrace.h6
-rw-r--r--arch/arm/include/asm/sizes.h42
-rw-r--r--arch/arm/include/asm/smp.h6
-rw-r--r--arch/arm/include/asm/spinlock.h2
-rw-r--r--arch/arm/include/asm/system.h2
-rw-r--r--arch/arm/kernel/leds.c28
-rw-r--r--arch/arm/kernel/perf_event.c5
-rw-r--r--arch/arm/kernel/ptrace.c348
-rw-r--r--arch/arm/kernel/setup.c13
-rw-r--r--arch/arm/kernel/signal.c90
-rw-r--r--arch/arm/kernel/smp.c12
-rw-r--r--arch/arm/kernel/time.c35
-rw-r--r--arch/arm/kernel/traps.c1
-rw-r--r--arch/arm/mach-bcmring/arch.c1
-rw-r--r--arch/arm/mach-bcmring/core.c227
-rw-r--r--arch/arm/mach-bcmring/core.h1
-rw-r--r--arch/arm/mach-davinci/cpufreq.c4
-rw-r--r--arch/arm/mach-davinci/include/mach/memory.h18
-rw-r--r--arch/arm/mach-ep93xx/gpio.c24
-rw-r--r--arch/arm/mach-exynos4/include/mach/smp.h19
-rw-r--r--arch/arm/mach-exynos4/platsmp.c5
-rw-r--r--arch/arm/mach-exynos4/pm.c45
-rw-r--r--arch/arm/mach-footbridge/Kconfig2
-rw-r--r--arch/arm/mach-footbridge/isa-timer.c45
-rw-r--r--arch/arm/mach-h720x/include/mach/memory.h3
-rw-r--r--arch/arm/mach-integrator/Kconfig1
-rw-r--r--arch/arm/mach-integrator/integrator_ap.c60
-rw-r--r--arch/arm/mach-integrator/integrator_cp.c24
-rw-r--r--arch/arm/mach-ixp4xx/common-pci.c23
-rw-r--r--arch/arm/mach-ixp4xx/common.c16
-rw-r--r--arch/arm/mach-ixp4xx/include/mach/memory.h12
-rw-r--r--arch/arm/mach-lpc32xx/timer.c17
-rw-r--r--arch/arm/mach-msm/include/mach/smp.h23
-rw-r--r--arch/arm/mach-msm/platsmp.c4
-rw-r--r--arch/arm/mach-mxs/Kconfig10
-rw-r--r--arch/arm/mach-mxs/Makefile1
-rw-r--r--arch/arm/mach-mxs/mach-stmp378x_devb.c120
-rw-r--r--arch/arm/mach-mxs/timer.c20
-rw-r--r--arch/arm/mach-netx/time.c16
-rw-r--r--arch/arm/mach-ns9xxx/Kconfig40
-rw-r--r--arch/arm/mach-ns9xxx/Makefile12
-rw-r--r--arch/arm/mach-ns9xxx/Makefile.boot2
-rw-r--r--arch/arm/mach-ns9xxx/board-a9m9750dev.c156
-rw-r--r--arch/arm/mach-ns9xxx/board-a9m9750dev.h15
-rw-r--r--arch/arm/mach-ns9xxx/board-jscc9p9360.c17
-rw-r--r--arch/arm/mach-ns9xxx/board-jscc9p9360.h13
-rw-r--r--arch/arm/mach-ns9xxx/clock.c215
-rw-r--r--arch/arm/mach-ns9xxx/clock.h35
-rw-r--r--arch/arm/mach-ns9xxx/generic.c19
-rw-r--r--arch/arm/mach-ns9xxx/generic.h16
-rw-r--r--arch/arm/mach-ns9xxx/gpio-ns9360.c118
-rw-r--r--arch/arm/mach-ns9xxx/gpio-ns9360.h13
-rw-r--r--arch/arm/mach-ns9xxx/gpio.c147
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/board.h40
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/debug-macro.S21
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/entry-macro.S28
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/gpio.h47
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/hardware.h77
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/io.h20
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/irqs.h86
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/memory.h24
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/module.h55
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/processor-ns9360.h32
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/processor.h42
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/regs-bbu.h45
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/regs-board-a9m9750dev.h24
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/regs-mem.h135
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/regs-sys-common.h31
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/regs-sys-ns9360.h148
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/system.h35
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/timex.h20
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/uncompress.h164
-rw-r--r--arch/arm/mach-ns9xxx/include/mach/vmalloc.h16
-rw-r--r--arch/arm/mach-ns9xxx/irq.c74
-rw-r--r--arch/arm/mach-ns9xxx/mach-cc9p9360dev.c43
-rw-r--r--arch/arm/mach-ns9xxx/mach-cc9p9360js.c31
-rw-r--r--arch/arm/mach-ns9xxx/plat-serial8250.c70
-rw-r--r--arch/arm/mach-ns9xxx/processor-ns9360.c53
-rw-r--r--arch/arm/mach-ns9xxx/time-ns9360.c181
-rw-r--r--arch/arm/mach-omap1/flash.c2
-rw-r--r--arch/arm/mach-omap1/pm_bus.c69
-rw-r--r--arch/arm/mach-omap1/time.c69
-rw-r--r--arch/arm/mach-omap2/Makefile6
-rw-r--r--arch/arm/mach-omap2/clkt34xx_dpll3m2.c1
-rw-r--r--arch/arm/mach-omap2/include/mach/omap4-common.h7
-rw-r--r--arch/arm/mach-omap2/omap-smp.c5
-rw-r--r--arch/arm/mach-omap2/pm_bus.c85
-rw-r--r--arch/arm/mach-pxa/balloon3.c1
-rw-r--r--arch/arm/mach-pxa/clock-pxa2xx.c18
-rw-r--r--arch/arm/mach-pxa/clock-pxa3xx.c17
-rw-r--r--arch/arm/mach-pxa/clock.h7
-rw-r--r--arch/arm/mach-pxa/cm-x270.c1
-rw-r--r--arch/arm/mach-pxa/cm-x2xx-pci.c27
-rw-r--r--arch/arm/mach-pxa/cm-x2xx.c23
-rw-r--r--arch/arm/mach-pxa/colibri-evalboard.c1
-rw-r--r--arch/arm/mach-pxa/colibri-pxa270-income.c1
-rw-r--r--arch/arm/mach-pxa/colibri-pxa270.c1
-rw-r--r--arch/arm/mach-pxa/generic.h8
-rw-r--r--arch/arm/mach-pxa/hx4700.c2
-rw-r--r--arch/arm/mach-pxa/include/mach/memory.h10
-rw-r--r--arch/arm/mach-pxa/irq.c17
-rw-r--r--arch/arm/mach-pxa/lpd270.c20
-rw-r--r--arch/arm/mach-pxa/lubbock.c21
-rw-r--r--arch/arm/mach-pxa/magician.c2
-rw-r--r--arch/arm/mach-pxa/mainstone.c22
-rw-r--r--arch/arm/mach-pxa/mfp-pxa2xx.c12
-rw-r--r--arch/arm/mach-pxa/mfp-pxa3xx.c21
-rw-r--r--arch/arm/mach-pxa/mioa701.c43
-rw-r--r--arch/arm/mach-pxa/palmld.c1
-rw-r--r--arch/arm/mach-pxa/palmtreo.c1
-rw-r--r--arch/arm/mach-pxa/palmz72.c24
-rw-r--r--arch/arm/mach-pxa/pxa25x.c25
-rw-r--r--arch/arm/mach-pxa/pxa27x.c25
-rw-r--r--arch/arm/mach-pxa/pxa3xx.c25
-rw-r--r--arch/arm/mach-pxa/pxa95x.c20
-rw-r--r--arch/arm/mach-pxa/raumfeld.c1
-rw-r--r--arch/arm/mach-pxa/smemc.c29
-rw-r--r--arch/arm/mach-pxa/time.c17
-rw-r--r--arch/arm/mach-pxa/trizeps4.c1
-rw-r--r--arch/arm/mach-pxa/viper.c12
-rw-r--r--arch/arm/mach-pxa/vpac270.c1
-rw-r--r--arch/arm/mach-realview/core.c63
-rw-r--r--arch/arm/mach-realview/include/mach/barriers.h2
-rw-r--r--arch/arm/mach-realview/include/mach/memory.h9
-rw-r--r--arch/arm/mach-realview/include/mach/smp.h14
-rw-r--r--arch/arm/mach-realview/platsmp.c3
-rw-r--r--arch/arm/mach-s3c2410/irq.c30
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c17
-rw-r--r--arch/arm/mach-s3c2410/nor-simtec.c2
-rw-r--r--arch/arm/mach-s3c2410/pm.c13
-rw-r--r--arch/arm/mach-s3c2410/s3c2410.c5
-rw-r--r--arch/arm/mach-s3c2412/irq.c2
-rw-r--r--arch/arm/mach-s3c2412/mach-jive.c19
-rw-r--r--arch/arm/mach-s3c2412/pm.c27
-rw-r--r--arch/arm/mach-s3c2412/s3c2412.c4
-rw-r--r--arch/arm/mach-s3c2416/irq.c2
-rw-r--r--arch/arm/mach-s3c2416/pm.c27
-rw-r--r--arch/arm/mach-s3c2416/s3c2416.c5
-rw-r--r--arch/arm/mach-s3c2440/mach-osiris.c18
-rw-r--r--arch/arm/mach-s3c2440/s3c2440.c8
-rw-r--r--arch/arm/mach-s3c2440/s3c2442.c6
-rw-r--r--arch/arm/mach-s3c2440/s3c244x-irq.c4
-rw-r--r--arch/arm/mach-s3c2440/s3c244x.c62
-rw-r--r--arch/arm/mach-s3c64xx/irq-pm.c18
-rw-r--r--arch/arm/mach-s5pv210/pm.c25
-rw-r--r--arch/arm/mach-sa1100/include/mach/memory.h12
-rw-r--r--arch/arm/mach-sa1100/irq.c19
-rw-r--r--arch/arm/mach-sa1100/time.c24
-rw-r--r--arch/arm/mach-shark/include/mach/memory.h20
-rw-r--r--arch/arm/mach-shmobile/include/mach/smp.h16
-rw-r--r--arch/arm/mach-shmobile/platsmp.c3
-rw-r--r--arch/arm/mach-shmobile/pm_runtime.c145
-rw-r--r--arch/arm/mach-spear3xx/Kconfig30
-rw-r--r--arch/arm/mach-spear3xx/Kconfig30017
-rw-r--r--arch/arm/mach-spear3xx/Kconfig31017
-rw-r--r--arch/arm/mach-spear3xx/Kconfig32017
-rw-r--r--arch/arm/mach-spear3xx/clock.c74
-rw-r--r--arch/arm/mach-spear3xx/include/mach/generic.h205
-rw-r--r--arch/arm/mach-spear3xx/include/mach/irqs.h206
-rw-r--r--arch/arm/mach-spear3xx/include/mach/spear300.h26
-rw-r--r--arch/arm/mach-spear3xx/include/mach/spear310.h44
-rw-r--r--arch/arm/mach-spear3xx/include/mach/spear320.h48
-rw-r--r--arch/arm/mach-spear3xx/spear300.c163
-rw-r--r--arch/arm/mach-spear3xx/spear300_evb.c32
-rw-r--r--arch/arm/mach-spear3xx/spear310.c149
-rw-r--r--arch/arm/mach-spear3xx/spear310_evb.c45
-rw-r--r--arch/arm/mach-spear3xx/spear320.c251
-rw-r--r--arch/arm/mach-spear3xx/spear320_evb.c40
-rw-r--r--arch/arm/mach-spear3xx/spear3xx.c132
-rw-r--r--arch/arm/mach-spear6xx/Kconfig15
-rw-r--r--arch/arm/mach-spear6xx/Kconfig60017
-rw-r--r--arch/arm/mach-spear6xx/clock.c4
-rw-r--r--arch/arm/mach-spear6xx/include/mach/generic.h2
-rw-r--r--arch/arm/mach-spear6xx/spear6xx.c2
-rw-r--r--arch/arm/mach-stmp378x/Makefile2
-rw-r--r--arch/arm/mach-stmp378x/Makefile.boot3
-rw-r--r--arch/arm/mach-stmp378x/include/mach/entry-macro.S35
-rw-r--r--arch/arm/mach-stmp378x/include/mach/irqs.h95
-rw-r--r--arch/arm/mach-stmp378x/include/mach/pins.h151
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-apbh.h101
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-apbx.h119
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-audioin.h63
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-audioout.h104
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-bch.h56
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-clkctrl.h88
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-dcp.h87
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-digctl.h38
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-dram.h27
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-dri.h45
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-ecc8.h39
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-emi.h25
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-gpmi.h78
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-i2c.h55
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-icoll.h45
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-ir.h23
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-lcdif.h195
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-lradc.h99
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-ocotp.h40
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-pinctrl.h90
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-power.h63
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-pwm.h53
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-pxp.h140
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-rtc.h59
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-saif.h21
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-spdif.h49
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-ssp.h102
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-sydma.h23
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-timrot.h68
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-tvenc.h67
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-uartapp.h87
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-uartdbg.h268
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-usbctrl.h40
-rw-r--r--arch/arm/mach-stmp378x/include/mach/regs-usbphy.h37
-rw-r--r--arch/arm/mach-stmp378x/stmp378x.c299
-rw-r--r--arch/arm/mach-stmp378x/stmp378x.h25
-rw-r--r--arch/arm/mach-stmp378x/stmp378x_devb.c332
-rw-r--r--arch/arm/mach-stmp37xx/Makefile2
-rw-r--r--arch/arm/mach-stmp37xx/Makefile.boot3
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/entry-macro.S37
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/irqs.h99
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/pins.h147
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-apbh.h97
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-apbx.h113
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-audioin.h61
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-audioout.h111
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-clkctrl.h72
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-digctl.h24
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-ecc8.h37
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-gpmi.h63
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-i2c.h55
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-icoll.h43
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-lcdif.h89
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-lradc.h97
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-pinctrl.h88
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-power.h56
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-pwm.h51
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-rtc.h57
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-ssp.h101
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-timrot.h49
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-uartapp.h85
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-uartdbg.h268
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-usbctl.h22
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-usbctrl.h22
-rw-r--r--arch/arm/mach-stmp37xx/include/mach/regs-usbphy.h37
-rw-r--r--arch/arm/mach-stmp37xx/stmp37xx.c219
-rw-r--r--arch/arm/mach-stmp37xx/stmp37xx.h24
-rw-r--r--arch/arm/mach-stmp37xx/stmp37xx_devb.c99
-rw-r--r--arch/arm/mach-tcc8k/time.c16
-rw-r--r--arch/arm/mach-tegra/include/mach/barriers.h2
-rw-r--r--arch/arm/mach-tegra/include/mach/smp.h14
-rw-r--r--arch/arm/mach-tegra/platsmp.c3
-rw-r--r--arch/arm/mach-tegra/timer.c16
-rw-r--r--arch/arm/mach-u300/timer.c18
-rw-r--r--arch/arm/mach-ux500/include/mach/smp.h24
-rw-r--r--arch/arm/mach-ux500/platsmp.c8
-rw-r--r--arch/arm/mach-versatile/core.c44
-rw-r--r--arch/arm/mach-vexpress/ct-ca9x4.c19
-rw-r--r--arch/arm/mach-vexpress/include/mach/smp.h13
-rw-r--r--arch/arm/mach-vexpress/v2m.c39
-rw-r--r--arch/arm/mach-w90x900/time.c17
-rw-r--r--arch/arm/mm/flush.c7
-rw-r--r--arch/arm/mm/init.c39
-rw-r--r--arch/arm/plat-mxc/epit.c18
-rw-r--r--arch/arm/plat-mxc/time.c38
-rw-r--r--arch/arm/plat-nomadik/Kconfig1
-rw-r--r--arch/arm/plat-nomadik/timer.c31
-rw-r--r--arch/arm/plat-omap/Kconfig1
-rw-r--r--arch/arm/plat-omap/gpio.c35
-rw-r--r--arch/arm/plat-omap/include/plat/flash.h2
-rw-r--r--arch/arm/plat-omap/include/plat/smp.h36
-rw-r--r--arch/arm/plat-omap/iommu.c2
-rw-r--r--arch/arm/plat-omap/omap_device.c23
-rw-r--r--arch/arm/plat-orion/time.c21
-rw-r--r--arch/arm/plat-pxa/gpio.c17
-rw-r--r--arch/arm/plat-pxa/mfp.c1
-rw-r--r--arch/arm/plat-s3c24xx/dma.c68
-rw-r--r--arch/arm/plat-s3c24xx/irq-pm.c7
-rw-r--r--arch/arm/plat-s5p/irq-pm.c7
-rw-r--r--arch/arm/plat-s5p/s5p-time.c58
-rw-r--r--arch/arm/plat-samsung/include/plat/cpu.h6
-rw-r--r--arch/arm/plat-samsung/include/plat/pm.h6
-rw-r--r--arch/arm/plat-spear/clock.c5
-rw-r--r--arch/arm/plat-spear/include/plat/clock.h1
-rw-r--r--arch/arm/plat-spear/time.c16
-rw-r--r--arch/arm/plat-stmp3xxx/Kconfig37
-rw-r--r--arch/arm/plat-stmp3xxx/Makefile5
-rw-r--r--arch/arm/plat-stmp3xxx/clock.c1134
-rw-r--r--arch/arm/plat-stmp3xxx/clock.h61
-rw-r--r--arch/arm/plat-stmp3xxx/core.c128
-rw-r--r--arch/arm/plat-stmp3xxx/devices.c389
-rw-r--r--arch/arm/plat-stmp3xxx/dma.c464
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/clkdev.h18
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/cputype.h33
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/debug-macro.S39
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/dma.h153
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/gpio.h28
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/gpmi.h12
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/hardware.h32
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/io.h25
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/memory.h22
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/mmc.h14
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/pinmux.h157
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/pins.h30
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/platform.h68
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/stmp3xxx.h54
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/system.h49
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/timex.h20
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/uncompress.h53
-rw-r--r--arch/arm/plat-stmp3xxx/include/mach/vmalloc.h12
-rw-r--r--arch/arm/plat-stmp3xxx/irq.c50
-rw-r--r--arch/arm/plat-stmp3xxx/pinmux.c550
-rw-r--r--arch/arm/plat-stmp3xxx/timer.c186
-rw-r--r--arch/arm/plat-versatile/platsmp.c3
-rw-r--r--arch/arm/tools/mach-types142
-rw-r--r--arch/arm/vfp/vfpmodule.c19
339 files changed, 2447 insertions, 15508 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 9b63baba4296..7275009686e6 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -197,15 +197,21 @@ config ARM_PATCH_PHYS_VIRT
197 depends on !XIP_KERNEL && MMU 197 depends on !XIP_KERNEL && MMU
198 depends on !ARCH_REALVIEW || !SPARSEMEM 198 depends on !ARCH_REALVIEW || !SPARSEMEM
199 help 199 help
200 Patch phys-to-virt translation functions at runtime according to 200 Patch phys-to-virt and virt-to-phys translation functions at
201 the position of the kernel in system memory. 201 boot and module load time according to the position of the
202 kernel in system memory.
202 203
203 This can only be used with non-XIP with MMU kernels where 204 This can only be used with non-XIP MMU kernels where the base
204 the base of physical memory is at a 16MB boundary. 205 of physical memory is at a 16MB boundary, or theoretically 64K
206 for the MSM machine class.
205 207
206config ARM_PATCH_PHYS_VIRT_16BIT 208config ARM_PATCH_PHYS_VIRT_16BIT
207 def_bool y 209 def_bool y
208 depends on ARM_PATCH_PHYS_VIRT && ARCH_MSM 210 depends on ARM_PATCH_PHYS_VIRT && ARCH_MSM
211 help
212 This option extends the physical to virtual translation patching
213 to allow physical memory down to a theoretical minimum of 64K
214 boundaries.
209 215
210source "init/Kconfig" 216source "init/Kconfig"
211 217
@@ -297,6 +303,7 @@ config ARCH_BCMRING
297 depends on MMU 303 depends on MMU
298 select CPU_V6 304 select CPU_V6
299 select ARM_AMBA 305 select ARM_AMBA
306 select ARM_TIMER_SP804
300 select CLKDEV_LOOKUP 307 select CLKDEV_LOOKUP
301 select GENERIC_CLOCKEVENTS 308 select GENERIC_CLOCKEVENTS
302 select ARCH_WANT_OPTIONAL_GPIOLIB 309 select ARCH_WANT_OPTIONAL_GPIOLIB
@@ -366,6 +373,7 @@ config ARCH_MXC
366 select GENERIC_CLOCKEVENTS 373 select GENERIC_CLOCKEVENTS
367 select ARCH_REQUIRE_GPIOLIB 374 select ARCH_REQUIRE_GPIOLIB
368 select CLKDEV_LOOKUP 375 select CLKDEV_LOOKUP
376 select CLKSRC_MMIO
369 select HAVE_SCHED_CLOCK 377 select HAVE_SCHED_CLOCK
370 help 378 help
371 Support for Freescale MXC/iMX-based family of processors 379 Support for Freescale MXC/iMX-based family of processors
@@ -375,21 +383,13 @@ config ARCH_MXS
375 select GENERIC_CLOCKEVENTS 383 select GENERIC_CLOCKEVENTS
376 select ARCH_REQUIRE_GPIOLIB 384 select ARCH_REQUIRE_GPIOLIB
377 select CLKDEV_LOOKUP 385 select CLKDEV_LOOKUP
386 select CLKSRC_MMIO
378 help 387 help
379 Support for Freescale MXS-based family of processors 388 Support for Freescale MXS-based family of processors
380 389
381config ARCH_STMP3XXX
382 bool "Freescale STMP3xxx"
383 select CPU_ARM926T
384 select CLKDEV_LOOKUP
385 select ARCH_REQUIRE_GPIOLIB
386 select GENERIC_CLOCKEVENTS
387 select USB_ARCH_HAS_EHCI
388 help
389 Support for systems based on the Freescale 3xxx CPUs.
390
391config ARCH_NETX 390config ARCH_NETX
392 bool "Hilscher NetX based" 391 bool "Hilscher NetX based"
392 select CLKSRC_MMIO
393 select CPU_ARM926T 393 select CPU_ARM926T
394 select ARM_VIC 394 select ARM_VIC
395 select GENERIC_CLOCKEVENTS 395 select GENERIC_CLOCKEVENTS
@@ -457,6 +457,7 @@ config ARCH_IXP2000
457config ARCH_IXP4XX 457config ARCH_IXP4XX
458 bool "IXP4xx-based" 458 bool "IXP4xx-based"
459 depends on MMU 459 depends on MMU
460 select CLKSRC_MMIO
460 select CPU_XSCALE 461 select CPU_XSCALE
461 select GENERIC_GPIO 462 select GENERIC_GPIO
462 select GENERIC_CLOCKEVENTS 463 select GENERIC_CLOCKEVENTS
@@ -497,6 +498,7 @@ config ARCH_LOKI
497 498
498config ARCH_LPC32XX 499config ARCH_LPC32XX
499 bool "NXP LPC32XX" 500 bool "NXP LPC32XX"
501 select CLKSRC_MMIO
500 select CPU_ARM926T 502 select CPU_ARM926T
501 select ARCH_REQUIRE_GPIOLIB 503 select ARCH_REQUIRE_GPIOLIB
502 select HAVE_IDE 504 select HAVE_IDE
@@ -554,23 +556,12 @@ config ARCH_KS8695
554 Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based 556 Support for Micrel/Kendin KS8695 "Centaur" (ARM922T) based
555 System-on-Chip devices. 557 System-on-Chip devices.
556 558
557config ARCH_NS9XXX
558 bool "NetSilicon NS9xxx"
559 select CPU_ARM926T
560 select GENERIC_GPIO
561 select GENERIC_CLOCKEVENTS
562 select HAVE_CLK
563 help
564 Say Y here if you intend to run this kernel on a NetSilicon NS9xxx
565 System.
566
567 <http://www.digi.com/products/microprocessors/index.jsp>
568
569config ARCH_W90X900 559config ARCH_W90X900
570 bool "Nuvoton W90X900 CPU" 560 bool "Nuvoton W90X900 CPU"
571 select CPU_ARM926T 561 select CPU_ARM926T
572 select ARCH_REQUIRE_GPIOLIB 562 select ARCH_REQUIRE_GPIOLIB
573 select CLKDEV_LOOKUP 563 select CLKDEV_LOOKUP
564 select CLKSRC_MMIO
574 select GENERIC_CLOCKEVENTS 565 select GENERIC_CLOCKEVENTS
575 help 566 help
576 Support for Nuvoton (Winbond logic dept.) ARM9 processor, 567 Support for Nuvoton (Winbond logic dept.) ARM9 processor,
@@ -592,6 +583,7 @@ config ARCH_NUC93X
592config ARCH_TEGRA 583config ARCH_TEGRA
593 bool "NVIDIA Tegra" 584 bool "NVIDIA Tegra"
594 select CLKDEV_LOOKUP 585 select CLKDEV_LOOKUP
586 select CLKSRC_MMIO
595 select GENERIC_TIME 587 select GENERIC_TIME
596 select GENERIC_CLOCKEVENTS 588 select GENERIC_CLOCKEVENTS
597 select GENERIC_GPIO 589 select GENERIC_GPIO
@@ -617,6 +609,7 @@ config ARCH_PXA
617 select ARCH_MTD_XIP 609 select ARCH_MTD_XIP
618 select ARCH_HAS_CPUFREQ 610 select ARCH_HAS_CPUFREQ
619 select CLKDEV_LOOKUP 611 select CLKDEV_LOOKUP
612 select CLKSRC_MMIO
620 select ARCH_REQUIRE_GPIOLIB 613 select ARCH_REQUIRE_GPIOLIB
621 select GENERIC_CLOCKEVENTS 614 select GENERIC_CLOCKEVENTS
622 select HAVE_SCHED_CLOCK 615 select HAVE_SCHED_CLOCK
@@ -667,6 +660,7 @@ config ARCH_RPC
667 660
668config ARCH_SA1100 661config ARCH_SA1100
669 bool "SA1100-based" 662 bool "SA1100-based"
663 select CLKSRC_MMIO
670 select CPU_SA1100 664 select CPU_SA1100
671 select ISA 665 select ISA
672 select ARCH_SPARSEMEM_ENABLE 666 select ARCH_SPARSEMEM_ENABLE
@@ -803,6 +797,7 @@ config ARCH_SHARK
803 797
804config ARCH_TCC_926 798config ARCH_TCC_926
805 bool "Telechips TCC ARM926-based systems" 799 bool "Telechips TCC ARM926-based systems"
800 select CLKSRC_MMIO
806 select CPU_ARM926T 801 select CPU_ARM926T
807 select HAVE_CLK 802 select HAVE_CLK
808 select CLKDEV_LOOKUP 803 select CLKDEV_LOOKUP
@@ -813,6 +808,7 @@ config ARCH_TCC_926
813config ARCH_U300 808config ARCH_U300
814 bool "ST-Ericsson U300 Series" 809 bool "ST-Ericsson U300 Series"
815 depends on MMU 810 depends on MMU
811 select CLKSRC_MMIO
816 select CPU_ARM926T 812 select CPU_ARM926T
817 select HAVE_SCHED_CLOCK 813 select HAVE_SCHED_CLOCK
818 select HAVE_TCM 814 select HAVE_TCM
@@ -875,6 +871,7 @@ config PLAT_SPEAR
875 select ARM_AMBA 871 select ARM_AMBA
876 select ARCH_REQUIRE_GPIOLIB 872 select ARCH_REQUIRE_GPIOLIB
877 select CLKDEV_LOOKUP 873 select CLKDEV_LOOKUP
874 select CLKSRC_MMIO
878 select GENERIC_CLOCKEVENTS 875 select GENERIC_CLOCKEVENTS
879 select HAVE_CLK 876 select HAVE_CLK
880 help 877 help
@@ -952,8 +949,6 @@ source "arch/arm/mach-netx/Kconfig"
952source "arch/arm/mach-nomadik/Kconfig" 949source "arch/arm/mach-nomadik/Kconfig"
953source "arch/arm/plat-nomadik/Kconfig" 950source "arch/arm/plat-nomadik/Kconfig"
954 951
955source "arch/arm/mach-ns9xxx/Kconfig"
956
957source "arch/arm/mach-nuc93x/Kconfig" 952source "arch/arm/mach-nuc93x/Kconfig"
958 953
959source "arch/arm/plat-omap/Kconfig" 954source "arch/arm/plat-omap/Kconfig"
@@ -1006,8 +1001,6 @@ source "arch/arm/mach-exynos4/Kconfig"
1006 1001
1007source "arch/arm/mach-shmobile/Kconfig" 1002source "arch/arm/mach-shmobile/Kconfig"
1008 1003
1009source "arch/arm/plat-stmp3xxx/Kconfig"
1010
1011source "arch/arm/mach-tegra/Kconfig" 1004source "arch/arm/mach-tegra/Kconfig"
1012 1005
1013source "arch/arm/mach-u300/Kconfig" 1006source "arch/arm/mach-u300/Kconfig"
@@ -1034,6 +1027,7 @@ config PLAT_IOP
1034 1027
1035config PLAT_ORION 1028config PLAT_ORION
1036 bool 1029 bool
1030 select CLKSRC_MMIO
1037 select GENERIC_IRQ_CHIP 1031 select GENERIC_IRQ_CHIP
1038 select HAVE_SCHED_CLOCK 1032 select HAVE_SCHED_CLOCK
1039 1033
@@ -1045,6 +1039,7 @@ config PLAT_VERSATILE
1045 1039
1046config ARM_TIMER_SP804 1040config ARM_TIMER_SP804
1047 bool 1041 bool
1042 select CLKSRC_MMIO
1048 1043
1049source arch/arm/mm/Kconfig 1044source arch/arm/mm/Kconfig
1050 1045
@@ -1320,8 +1315,7 @@ menu "Kernel Features"
1320source "kernel/time/Kconfig" 1315source "kernel/time/Kconfig"
1321 1316
1322config SMP 1317config SMP
1323 bool "Symmetric Multi-Processing (EXPERIMENTAL)" 1318 bool "Symmetric Multi-Processing"
1324 depends on EXPERIMENTAL
1325 depends on CPU_V6K || CPU_V7 1319 depends on CPU_V6K || CPU_V7
1326 depends on GENERIC_CLOCKEVENTS 1320 depends on GENERIC_CLOCKEVENTS
1327 depends on REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP || \ 1321 depends on REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP || \
@@ -1523,8 +1517,8 @@ config ARCH_SELECT_MEMORY_MODEL
1523 def_bool ARCH_SPARSEMEM_ENABLE 1517 def_bool ARCH_SPARSEMEM_ENABLE
1524 1518
1525config HIGHMEM 1519config HIGHMEM
1526 bool "High Memory Support (EXPERIMENTAL)" 1520 bool "High Memory Support"
1527 depends on MMU && EXPERIMENTAL 1521 depends on MMU
1528 help 1522 help
1529 The address space of ARM processors is only 4 Gigabytes large 1523 The address space of ARM processors is only 4 Gigabytes large
1530 and it has to accommodate user address space, kernel address 1524 and it has to accommodate user address space, kernel address
@@ -1744,16 +1738,31 @@ config CMDLINE
1744 time by entering them here. As a minimum, you should specify the 1738 time by entering them here. As a minimum, you should specify the
1745 memory size and the root device (e.g., mem=64M root=/dev/nfs). 1739 memory size and the root device (e.g., mem=64M root=/dev/nfs).
1746 1740
1741choice
1742 prompt "Kernel command line type" if CMDLINE != ""
1743 default CMDLINE_FROM_BOOTLOADER
1744
1745config CMDLINE_FROM_BOOTLOADER
1746 bool "Use bootloader kernel arguments if available"
1747 help
1748 Uses the command-line options passed by the boot loader. If
1749 the boot loader doesn't provide any, the default kernel command
1750 string provided in CMDLINE will be used.
1751
1752config CMDLINE_EXTEND
1753 bool "Extend bootloader kernel arguments"
1754 help
1755 The command-line arguments provided by the boot loader will be
1756 appended to the default kernel command string.
1757
1747config CMDLINE_FORCE 1758config CMDLINE_FORCE
1748 bool "Always use the default kernel command string" 1759 bool "Always use the default kernel command string"
1749 depends on CMDLINE != ""
1750 help 1760 help
1751 Always use the default kernel command string, even if the boot 1761 Always use the default kernel command string, even if the boot
1752 loader passes other arguments to the kernel. 1762 loader passes other arguments to the kernel.
1753 This is useful if you cannot or don't want to change the 1763 This is useful if you cannot or don't want to change the
1754 command-line options your boot loader passes to the kernel. 1764 command-line options your boot loader passes to the kernel.
1755 1765endchoice
1756 If unsure, say N.
1757 1766
1758config XIP_KERNEL 1767config XIP_KERNEL
1759 bool "Kernel Execute-In-Place from ROM" 1768 bool "Kernel Execute-In-Place from ROM"
@@ -2012,7 +2021,7 @@ menu "Power management options"
2012source "kernel/power/Kconfig" 2021source "kernel/power/Kconfig"
2013 2022
2014config ARCH_SUSPEND_POSSIBLE 2023config ARCH_SUSPEND_POSSIBLE
2015 depends on !ARCH_S5P64X0 && !ARCH_S5P6442 2024 depends on !ARCH_S5P64X0 && !ARCH_S5P6442 && !ARCH_S5PC100
2016 depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \ 2025 depends on CPU_ARM920T || CPU_ARM926T || CPU_SA1100 || \
2017 CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE 2026 CPU_V6 || CPU_V6K || CPU_V7 || CPU_XSC3 || CPU_XSCALE
2018 def_bool y 2027 def_bool y
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 2b390306a091..25750bcb3397 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -163,7 +163,6 @@ machine-$(CONFIG_ARCH_MX5) := mx5
163machine-$(CONFIG_ARCH_MXS) := mxs 163machine-$(CONFIG_ARCH_MXS) := mxs
164machine-$(CONFIG_ARCH_NETX) := netx 164machine-$(CONFIG_ARCH_NETX) := netx
165machine-$(CONFIG_ARCH_NOMADIK) := nomadik 165machine-$(CONFIG_ARCH_NOMADIK) := nomadik
166machine-$(CONFIG_ARCH_NS9XXX) := ns9xxx
167machine-$(CONFIG_ARCH_OMAP1) := omap1 166machine-$(CONFIG_ARCH_OMAP1) := omap1
168machine-$(CONFIG_ARCH_OMAP2) := omap2 167machine-$(CONFIG_ARCH_OMAP2) := omap2
169machine-$(CONFIG_ARCH_OMAP3) := omap2 168machine-$(CONFIG_ARCH_OMAP3) := omap2
@@ -184,8 +183,6 @@ machine-$(CONFIG_ARCH_EXYNOS4) := exynos4
184machine-$(CONFIG_ARCH_SA1100) := sa1100 183machine-$(CONFIG_ARCH_SA1100) := sa1100
185machine-$(CONFIG_ARCH_SHARK) := shark 184machine-$(CONFIG_ARCH_SHARK) := shark
186machine-$(CONFIG_ARCH_SHMOBILE) := shmobile 185machine-$(CONFIG_ARCH_SHMOBILE) := shmobile
187machine-$(CONFIG_ARCH_STMP378X) := stmp378x
188machine-$(CONFIG_ARCH_STMP37XX) := stmp37xx
189machine-$(CONFIG_ARCH_TCC8K) := tcc8k 186machine-$(CONFIG_ARCH_TCC8K) := tcc8k
190machine-$(CONFIG_ARCH_TEGRA) := tegra 187machine-$(CONFIG_ARCH_TEGRA) := tegra
191machine-$(CONFIG_ARCH_U300) := u300 188machine-$(CONFIG_ARCH_U300) := u300
@@ -206,7 +203,6 @@ machine-$(CONFIG_MACH_SPEAR600) := spear6xx
206plat-$(CONFIG_ARCH_MXC) := mxc 203plat-$(CONFIG_ARCH_MXC) := mxc
207plat-$(CONFIG_ARCH_OMAP) := omap 204plat-$(CONFIG_ARCH_OMAP) := omap
208plat-$(CONFIG_ARCH_S3C64XX) := samsung 205plat-$(CONFIG_ARCH_S3C64XX) := samsung
209plat-$(CONFIG_ARCH_STMP3XXX) := stmp3xxx
210plat-$(CONFIG_ARCH_TCC_926) := tcc 206plat-$(CONFIG_ARCH_TCC_926) := tcc
211plat-$(CONFIG_PLAT_IOP) := iop 207plat-$(CONFIG_PLAT_IOP) := iop
212plat-$(CONFIG_PLAT_NOMADIK) := nomadik 208plat-$(CONFIG_PLAT_NOMADIK) := nomadik
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index c363458a4e63..f9da41921c52 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -473,7 +473,11 @@ __setup_mmu: sub r3, r4, #16384 @ Page directory size
473 orr r1, r1, #3 << 10 473 orr r1, r1, #3 << 10
474 add r2, r3, #16384 474 add r2, r3, #16384
4751: cmp r1, r9 @ if virt > start of RAM 4751: cmp r1, r9 @ if virt > start of RAM
476#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
477 orrhs r1, r1, #0x08 @ set cacheable
478#else
476 orrhs r1, r1, #0x0c @ set cacheable, bufferable 479 orrhs r1, r1, #0x0c @ set cacheable, bufferable
480#endif
477 cmp r1, r10 @ if virt > end of RAM 481 cmp r1, r10 @ if virt > end of RAM
478 bichs r1, r1, #0x0c @ clear cacheable, bufferable 482 bichs r1, r1, #0x0c @ clear cacheable, bufferable
479 str r1, [r0], #4 @ 1:1 mapping 483 str r1, [r0], #4 @ 1:1 mapping
@@ -498,6 +502,12 @@ __setup_mmu: sub r3, r4, #16384 @ Page directory size
498 mov pc, lr 502 mov pc, lr
499ENDPROC(__setup_mmu) 503ENDPROC(__setup_mmu)
500 504
505__arm926ejs_mmu_cache_on:
506#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
507 mov r0, #4 @ put dcache in WT mode
508 mcr p15, 7, r0, c15, c0, 0
509#endif
510
501__armv4_mmu_cache_on: 511__armv4_mmu_cache_on:
502 mov r12, lr 512 mov r12, lr
503#ifdef CONFIG_MMU 513#ifdef CONFIG_MMU
@@ -679,6 +689,12 @@ proc_types:
679 W(b) __armv4_mpu_cache_off 689 W(b) __armv4_mpu_cache_off
680 W(b) __armv4_mpu_cache_flush 690 W(b) __armv4_mpu_cache_flush
681 691
692 .word 0x41069260 @ ARM926EJ-S (v5TEJ)
693 .word 0xff0ffff0
694 b __arm926ejs_mmu_cache_on
695 b __armv4_mmu_cache_off
696 b __armv5tej_mmu_cache_flush
697
682 .word 0x00007000 @ ARM7 IDs 698 .word 0x00007000 @ ARM7 IDs
683 .word 0x0000f000 699 .word 0x0000f000
684 mov pc, lr 700 mov pc, lr
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index a12b33c0dc42..9c49a46a2b7a 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -185,14 +185,6 @@ static struct sa1111_dev_info sa1111_devices[] = {
185 }, 185 },
186}; 186};
187 187
188void __init sa1111_adjust_zones(unsigned long *size, unsigned long *holes)
189{
190 unsigned int sz = SZ_1M >> PAGE_SHIFT;
191
192 size[1] = size[0] - sz;
193 size[0] = sz;
194}
195
196/* 188/*
197 * SA1111 interrupt support. Since clearing an IRQ while there are 189 * SA1111 interrupt support. Since clearing an IRQ while there are
198 * active IRQs causes the interrupt output to pulse, the upper levels 190 * active IRQs causes the interrupt output to pulse, the upper levels
diff --git a/arch/arm/common/timer-sp.c b/arch/arm/common/timer-sp.c
index 6ef3342153b9..41df47875122 100644
--- a/arch/arm/common/timer-sp.c
+++ b/arch/arm/common/timer-sp.c
@@ -18,53 +18,67 @@
18 * along with this program; if not, write to the Free Software 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 19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 20 */
21#include <linux/clk.h>
21#include <linux/clocksource.h> 22#include <linux/clocksource.h>
22#include <linux/clockchips.h> 23#include <linux/clockchips.h>
24#include <linux/err.h>
23#include <linux/interrupt.h> 25#include <linux/interrupt.h>
24#include <linux/irq.h> 26#include <linux/irq.h>
25#include <linux/io.h> 27#include <linux/io.h>
26 28
27#include <asm/hardware/arm_timer.h> 29#include <asm/hardware/arm_timer.h>
28 30
29/* 31static long __init sp804_get_clock_rate(const char *name)
30 * These timers are currently always setup to be clocked at 1MHz. 32{
31 */ 33 struct clk *clk;
32#define TIMER_FREQ_KHZ (1000) 34 long rate;
33#define TIMER_RELOAD (TIMER_FREQ_KHZ * 1000 / HZ) 35 int err;
36
37 clk = clk_get_sys("sp804", name);
38 if (IS_ERR(clk)) {
39 pr_err("sp804: %s clock not found: %d\n", name,
40 (int)PTR_ERR(clk));
41 return PTR_ERR(clk);
42 }
34 43
35static void __iomem *clksrc_base; 44 err = clk_enable(clk);
45 if (err) {
46 pr_err("sp804: %s clock failed to enable: %d\n", name, err);
47 clk_put(clk);
48 return err;
49 }
36 50
37static cycle_t sp804_read(struct clocksource *cs) 51 rate = clk_get_rate(clk);
38{ 52 if (rate < 0) {
39 return ~readl(clksrc_base + TIMER_VALUE); 53 pr_err("sp804: %s clock failed to get rate: %ld\n", name, rate);
40} 54 clk_disable(clk);
55 clk_put(clk);
56 }
41 57
42static struct clocksource clocksource_sp804 = { 58 return rate;
43 .name = "timer3", 59}
44 .rating = 200,
45 .read = sp804_read,
46 .mask = CLOCKSOURCE_MASK(32),
47 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
48};
49 60
50void __init sp804_clocksource_init(void __iomem *base) 61void __init sp804_clocksource_init(void __iomem *base, const char *name)
51{ 62{
52 struct clocksource *cs = &clocksource_sp804; 63 long rate = sp804_get_clock_rate(name);
53 64
54 clksrc_base = base; 65 if (rate < 0)
66 return;
55 67
56 /* setup timer 0 as free-running clocksource */ 68 /* setup timer 0 as free-running clocksource */
57 writel(0, clksrc_base + TIMER_CTRL); 69 writel(0, base + TIMER_CTRL);
58 writel(0xffffffff, clksrc_base + TIMER_LOAD); 70 writel(0xffffffff, base + TIMER_LOAD);
59 writel(0xffffffff, clksrc_base + TIMER_VALUE); 71 writel(0xffffffff, base + TIMER_VALUE);
60 writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC, 72 writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC,
61 clksrc_base + TIMER_CTRL); 73 base + TIMER_CTRL);
62 74
63 clocksource_register_khz(cs, TIMER_FREQ_KHZ); 75 clocksource_mmio_init(base + TIMER_VALUE, name,
76 rate, 200, 32, clocksource_mmio_readl_down);
64} 77}
65 78
66 79
67static void __iomem *clkevt_base; 80static void __iomem *clkevt_base;
81static unsigned long clkevt_reload;
68 82
69/* 83/*
70 * IRQ handler for the timer 84 * IRQ handler for the timer
@@ -90,7 +104,7 @@ static void sp804_set_mode(enum clock_event_mode mode,
90 104
91 switch (mode) { 105 switch (mode) {
92 case CLOCK_EVT_MODE_PERIODIC: 106 case CLOCK_EVT_MODE_PERIODIC:
93 writel(TIMER_RELOAD, clkevt_base + TIMER_LOAD); 107 writel(clkevt_reload, clkevt_base + TIMER_LOAD);
94 ctrl |= TIMER_CTRL_PERIODIC | TIMER_CTRL_ENABLE; 108 ctrl |= TIMER_CTRL_PERIODIC | TIMER_CTRL_ENABLE;
95 break; 109 break;
96 110
@@ -120,7 +134,6 @@ static int sp804_set_next_event(unsigned long next,
120} 134}
121 135
122static struct clock_event_device sp804_clockevent = { 136static struct clock_event_device sp804_clockevent = {
123 .name = "timer0",
124 .shift = 32, 137 .shift = 32,
125 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 138 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
126 .set_mode = sp804_set_mode, 139 .set_mode = sp804_set_mode,
@@ -136,17 +149,24 @@ static struct irqaction sp804_timer_irq = {
136 .dev_id = &sp804_clockevent, 149 .dev_id = &sp804_clockevent,
137}; 150};
138 151
139void __init sp804_clockevents_init(void __iomem *base, unsigned int timer_irq) 152void __init sp804_clockevents_init(void __iomem *base, unsigned int irq,
153 const char *name)
140{ 154{
141 struct clock_event_device *evt = &sp804_clockevent; 155 struct clock_event_device *evt = &sp804_clockevent;
156 long rate = sp804_get_clock_rate(name);
157
158 if (rate < 0)
159 return;
142 160
143 clkevt_base = base; 161 clkevt_base = base;
162 clkevt_reload = DIV_ROUND_CLOSEST(rate, HZ);
144 163
145 evt->irq = timer_irq; 164 evt->name = name;
146 evt->mult = div_sc(TIMER_FREQ_KHZ, NSEC_PER_MSEC, evt->shift); 165 evt->irq = irq;
166 evt->mult = div_sc(rate, NSEC_PER_SEC, evt->shift);
147 evt->max_delta_ns = clockevent_delta2ns(0xffffffff, evt); 167 evt->max_delta_ns = clockevent_delta2ns(0xffffffff, evt);
148 evt->min_delta_ns = clockevent_delta2ns(0xf, evt); 168 evt->min_delta_ns = clockevent_delta2ns(0xf, evt);
149 169
150 setup_irq(timer_irq, &sp804_timer_irq); 170 setup_irq(irq, &sp804_timer_irq);
151 clockevents_register_device(evt); 171 clockevents_register_device(evt);
152} 172}
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
index 113085a77123..7aa4262ada7a 100644
--- a/arch/arm/common/vic.c
+++ b/arch/arm/common/vic.c
@@ -22,17 +22,16 @@
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/list.h> 23#include <linux/list.h>
24#include <linux/io.h> 24#include <linux/io.h>
25#include <linux/sysdev.h> 25#include <linux/syscore_ops.h>
26#include <linux/device.h> 26#include <linux/device.h>
27#include <linux/amba/bus.h> 27#include <linux/amba/bus.h>
28 28
29#include <asm/mach/irq.h> 29#include <asm/mach/irq.h>
30#include <asm/hardware/vic.h> 30#include <asm/hardware/vic.h>
31 31
32#if defined(CONFIG_PM) 32#ifdef CONFIG_PM
33/** 33/**
34 * struct vic_device - VIC PM device 34 * struct vic_device - VIC PM device
35 * @sysdev: The system device which is registered.
36 * @irq: The IRQ number for the base of the VIC. 35 * @irq: The IRQ number for the base of the VIC.
37 * @base: The register base for the VIC. 36 * @base: The register base for the VIC.
38 * @resume_sources: A bitmask of interrupts for resume. 37 * @resume_sources: A bitmask of interrupts for resume.
@@ -43,8 +42,6 @@
43 * @protect: Save for VIC_PROTECT. 42 * @protect: Save for VIC_PROTECT.
44 */ 43 */
45struct vic_device { 44struct vic_device {
46 struct sys_device sysdev;
47
48 void __iomem *base; 45 void __iomem *base;
49 int irq; 46 int irq;
50 u32 resume_sources; 47 u32 resume_sources;
@@ -59,11 +56,6 @@ struct vic_device {
59static struct vic_device vic_devices[CONFIG_ARM_VIC_NR]; 56static struct vic_device vic_devices[CONFIG_ARM_VIC_NR];
60 57
61static int vic_id; 58static int vic_id;
62
63static inline struct vic_device *to_vic(struct sys_device *sys)
64{
65 return container_of(sys, struct vic_device, sysdev);
66}
67#endif /* CONFIG_PM */ 59#endif /* CONFIG_PM */
68 60
69/** 61/**
@@ -85,10 +77,9 @@ static void vic_init2(void __iomem *base)
85 writel(32, base + VIC_PL190_DEF_VECT_ADDR); 77 writel(32, base + VIC_PL190_DEF_VECT_ADDR);
86} 78}
87 79
88#if defined(CONFIG_PM) 80#ifdef CONFIG_PM
89static int vic_class_resume(struct sys_device *dev) 81static void resume_one_vic(struct vic_device *vic)
90{ 82{
91 struct vic_device *vic = to_vic(dev);
92 void __iomem *base = vic->base; 83 void __iomem *base = vic->base;
93 84
94 printk(KERN_DEBUG "%s: resuming vic at %p\n", __func__, base); 85 printk(KERN_DEBUG "%s: resuming vic at %p\n", __func__, base);
@@ -107,13 +98,18 @@ static int vic_class_resume(struct sys_device *dev)
107 98
108 writel(vic->soft_int, base + VIC_INT_SOFT); 99 writel(vic->soft_int, base + VIC_INT_SOFT);
109 writel(~vic->soft_int, base + VIC_INT_SOFT_CLEAR); 100 writel(~vic->soft_int, base + VIC_INT_SOFT_CLEAR);
101}
110 102
111 return 0; 103static void vic_resume(void)
104{
105 int id;
106
107 for (id = vic_id - 1; id >= 0; id--)
108 resume_one_vic(vic_devices + id);
112} 109}
113 110
114static int vic_class_suspend(struct sys_device *dev, pm_message_t state) 111static void suspend_one_vic(struct vic_device *vic)
115{ 112{
116 struct vic_device *vic = to_vic(dev);
117 void __iomem *base = vic->base; 113 void __iomem *base = vic->base;
118 114
119 printk(KERN_DEBUG "%s: suspending vic at %p\n", __func__, base); 115 printk(KERN_DEBUG "%s: suspending vic at %p\n", __func__, base);
@@ -128,14 +124,21 @@ static int vic_class_suspend(struct sys_device *dev, pm_message_t state)
128 124
129 writel(vic->resume_irqs, base + VIC_INT_ENABLE); 125 writel(vic->resume_irqs, base + VIC_INT_ENABLE);
130 writel(~vic->resume_irqs, base + VIC_INT_ENABLE_CLEAR); 126 writel(~vic->resume_irqs, base + VIC_INT_ENABLE_CLEAR);
127}
128
129static int vic_suspend(void)
130{
131 int id;
132
133 for (id = 0; id < vic_id; id++)
134 suspend_one_vic(vic_devices + id);
131 135
132 return 0; 136 return 0;
133} 137}
134 138
135struct sysdev_class vic_class = { 139struct syscore_ops vic_syscore_ops = {
136 .name = "vic", 140 .suspend = vic_suspend,
137 .suspend = vic_class_suspend, 141 .resume = vic_resume,
138 .resume = vic_class_resume,
139}; 142};
140 143
141/** 144/**
@@ -147,30 +150,8 @@ struct sysdev_class vic_class = {
147*/ 150*/
148static int __init vic_pm_init(void) 151static int __init vic_pm_init(void)
149{ 152{
150 struct vic_device *dev = vic_devices; 153 if (vic_id > 0)
151 int err; 154 register_syscore_ops(&vic_syscore_ops);
152 int id;
153
154 if (vic_id == 0)
155 return 0;
156
157 err = sysdev_class_register(&vic_class);
158 if (err) {
159 printk(KERN_ERR "%s: cannot register class\n", __func__);
160 return err;
161 }
162
163 for (id = 0; id < vic_id; id++, dev++) {
164 dev->sysdev.id = id;
165 dev->sysdev.cls = &vic_class;
166
167 err = sysdev_register(&dev->sysdev);
168 if (err) {
169 printk(KERN_ERR "%s: failed to register device\n",
170 __func__);
171 return err;
172 }
173 }
174 155
175 return 0; 156 return 0;
176} 157}
diff --git a/arch/arm/configs/mxs_defconfig b/arch/arm/configs/mxs_defconfig
new file mode 100644
index 000000000000..2bf224310fb4
--- /dev/null
+++ b/arch/arm/configs/mxs_defconfig
@@ -0,0 +1,129 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_TASKSTATS=y
4CONFIG_TASK_DELAY_ACCT=y
5CONFIG_TASK_XACCT=y
6CONFIG_TASK_IO_ACCOUNTING=y
7CONFIG_IKCONFIG=y
8CONFIG_IKCONFIG_PROC=y
9# CONFIG_UTS_NS is not set
10# CONFIG_IPC_NS is not set
11# CONFIG_USER_NS is not set
12# CONFIG_PID_NS is not set
13# CONFIG_NET_NS is not set
14CONFIG_PERF_EVENTS=y
15# CONFIG_COMPAT_BRK is not set
16CONFIG_MODULES=y
17CONFIG_MODULE_FORCE_LOAD=y
18CONFIG_MODULE_UNLOAD=y
19CONFIG_MODULE_FORCE_UNLOAD=y
20CONFIG_MODVERSIONS=y
21CONFIG_BLK_DEV_INTEGRITY=y
22# CONFIG_IOSCHED_DEADLINE is not set
23# CONFIG_IOSCHED_CFQ is not set
24CONFIG_ARCH_MXS=y
25CONFIG_MACH_STMP378X_DEVB=y
26CONFIG_MACH_TX28=y
27# CONFIG_ARM_THUMB is not set
28CONFIG_NO_HZ=y
29CONFIG_HIGH_RES_TIMERS=y
30CONFIG_PREEMPT_VOLUNTARY=y
31CONFIG_AEABI=y
32CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
33CONFIG_AUTO_ZRELADDR=y
34CONFIG_FPE_NWFPE=y
35CONFIG_NET=y
36CONFIG_PACKET=y
37CONFIG_UNIX=y
38CONFIG_INET=y
39CONFIG_IP_PNP=y
40CONFIG_IP_PNP_DHCP=y
41CONFIG_SYN_COOKIES=y
42# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
43# CONFIG_INET_XFRM_MODE_TUNNEL is not set
44# CONFIG_INET_XFRM_MODE_BEET is not set
45# CONFIG_INET_LRO is not set
46# CONFIG_INET_DIAG is not set
47# CONFIG_IPV6 is not set
48CONFIG_CAN=m
49CONFIG_CAN_RAW=m
50CONFIG_CAN_BCM=m
51CONFIG_CAN_DEV=m
52CONFIG_CAN_FLEXCAN=m
53# CONFIG_WIRELESS is not set
54CONFIG_DEVTMPFS=y
55# CONFIG_FIRMWARE_IN_KERNEL is not set
56# CONFIG_BLK_DEV is not set
57CONFIG_NETDEVICES=y
58CONFIG_NET_ETHERNET=y
59CONFIG_ENC28J60=y
60# CONFIG_NETDEV_1000 is not set
61# CONFIG_NETDEV_10000 is not set
62# CONFIG_WLAN is not set
63# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
64CONFIG_INPUT_EVDEV=m
65# CONFIG_INPUT_KEYBOARD is not set
66# CONFIG_INPUT_MOUSE is not set
67CONFIG_INPUT_TOUCHSCREEN=y
68CONFIG_TOUCHSCREEN_TSC2007=m
69# CONFIG_SERIO is not set
70CONFIG_VT_HW_CONSOLE_BINDING=y
71CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
72# CONFIG_LEGACY_PTYS is not set
73# CONFIG_DEVKMEM is not set
74CONFIG_SERIAL_AMBA_PL011=y
75CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
76# CONFIG_HW_RANDOM is not set
77CONFIG_I2C=m
78# CONFIG_I2C_COMPAT is not set
79CONFIG_I2C_CHARDEV=m
80CONFIG_I2C_MXS=m
81CONFIG_SPI=y
82CONFIG_SPI_GPIO=m
83CONFIG_DEBUG_GPIO=y
84CONFIG_GPIO_SYSFS=y
85# CONFIG_HWMON is not set
86# CONFIG_MFD_SUPPORT is not set
87CONFIG_DISPLAY_SUPPORT=m
88# CONFIG_HID_SUPPORT is not set
89# CONFIG_USB_SUPPORT is not set
90CONFIG_MMC=y
91CONFIG_MMC_MXS=y
92CONFIG_RTC_CLASS=m
93CONFIG_RTC_DRV_DS1307=m
94CONFIG_DMADEVICES=y
95CONFIG_MXS_DMA=y
96CONFIG_EXT3_FS=y
97# CONFIG_DNOTIFY is not set
98CONFIG_FSCACHE=m
99CONFIG_FSCACHE_STATS=y
100CONFIG_CACHEFILES=m
101CONFIG_TMPFS=y
102CONFIG_TMPFS_POSIX_ACL=y
103# CONFIG_MISC_FILESYSTEMS is not set
104CONFIG_NFS_FS=y
105CONFIG_NFS_V3=y
106CONFIG_NFS_V3_ACL=y
107CONFIG_NFS_V4=y
108CONFIG_ROOT_NFS=y
109CONFIG_PRINTK_TIME=y
110CONFIG_FRAME_WARN=2048
111CONFIG_MAGIC_SYSRQ=y
112CONFIG_UNUSED_SYMBOLS=y
113CONFIG_DEBUG_KERNEL=y
114CONFIG_LOCKUP_DETECTOR=y
115CONFIG_DETECT_HUNG_TASK=y
116CONFIG_TIMER_STATS=y
117CONFIG_PROVE_LOCKING=y
118CONFIG_DEBUG_SPINLOCK_SLEEP=y
119CONFIG_DEBUG_INFO=y
120CONFIG_SYSCTL_SYSCALL_CHECK=y
121CONFIG_BLK_DEV_IO_TRACE=y
122CONFIG_STRICT_DEVMEM=y
123CONFIG_DEBUG_USER=y
124CONFIG_CRYPTO=y
125CONFIG_CRYPTO_CRC32C=m
126# CONFIG_CRYPTO_ANSI_CPRNG is not set
127# CONFIG_CRYPTO_HW is not set
128CONFIG_CRC_ITU_T=m
129CONFIG_CRC7=m
diff --git a/arch/arm/configs/ns9xxx_defconfig b/arch/arm/configs/ns9xxx_defconfig
deleted file mode 100644
index 1f528a002983..000000000000
--- a/arch/arm/configs/ns9xxx_defconfig
+++ /dev/null
@@ -1,56 +0,0 @@
1CONFIG_IKCONFIG=y
2CONFIG_IKCONFIG_PROC=y
3CONFIG_BLK_DEV_INITRD=y
4CONFIG_MODULES=y
5CONFIG_MODULE_UNLOAD=y
6# CONFIG_IOSCHED_DEADLINE is not set
7# CONFIG_IOSCHED_CFQ is not set
8CONFIG_ARCH_NS9XXX=y
9CONFIG_MACH_CC9P9360DEV=y
10CONFIG_MACH_CC9P9360JS=y
11CONFIG_NO_HZ=y
12CONFIG_HIGH_RES_TIMERS=y
13CONFIG_FPE_NWFPE=y
14CONFIG_NET=y
15CONFIG_PACKET=m
16CONFIG_INET=y
17CONFIG_IP_PNP=y
18CONFIG_SYN_COOKIES=y
19CONFIG_MTD=m
20CONFIG_MTD_CONCAT=m
21CONFIG_MTD_CHAR=m
22CONFIG_MTD_BLOCK=m
23CONFIG_MTD_CFI=m
24CONFIG_MTD_JEDECPROBE=m
25CONFIG_MTD_CFI_AMDSTD=m
26CONFIG_MTD_PHYSMAP=m
27CONFIG_BLK_DEV_LOOP=m
28CONFIG_NETDEVICES=y
29CONFIG_NET_ETHERNET=y
30# CONFIG_SERIO_SERPORT is not set
31CONFIG_SERIAL_8250=y
32CONFIG_SERIAL_8250_CONSOLE=y
33# CONFIG_LEGACY_PTYS is not set
34# CONFIG_HW_RANDOM is not set
35CONFIG_I2C=m
36CONFIG_I2C_GPIO=m
37# CONFIG_HWMON is not set
38# CONFIG_VGA_CONSOLE is not set
39# CONFIG_USB_SUPPORT is not set
40CONFIG_NEW_LEDS=y
41CONFIG_LEDS_CLASS=m
42CONFIG_LEDS_GPIO=m
43CONFIG_LEDS_TRIGGERS=y
44CONFIG_LEDS_TRIGGER_TIMER=m
45CONFIG_LEDS_TRIGGER_HEARTBEAT=m
46CONFIG_RTC_CLASS=m
47CONFIG_EXT2_FS=m
48CONFIG_TMPFS=y
49CONFIG_JFFS2_FS=m
50CONFIG_NFS_FS=y
51CONFIG_ROOT_NFS=y
52# CONFIG_ENABLE_MUST_CHECK is not set
53CONFIG_DEBUG_KERNEL=y
54CONFIG_DEBUG_INFO=y
55CONFIG_DEBUG_USER=y
56CONFIG_DEBUG_ERRORS=y
diff --git a/arch/arm/configs/realview-smp_defconfig b/arch/arm/configs/realview-smp_defconfig
index 5ca7a61f7c01..abe61bf379d2 100644
--- a/arch/arm/configs/realview-smp_defconfig
+++ b/arch/arm/configs/realview-smp_defconfig
@@ -38,7 +38,7 @@ CONFIG_MTD_BLOCK=y
38CONFIG_MTD_CFI=y 38CONFIG_MTD_CFI=y
39CONFIG_MTD_CFI_INTELEXT=y 39CONFIG_MTD_CFI_INTELEXT=y
40CONFIG_MTD_CFI_AMDSTD=y 40CONFIG_MTD_CFI_AMDSTD=y
41CONFIG_MTD_ARM_INTEGRATOR=y 41CONFIG_MTD_PHYSMAP=y
42CONFIG_ARM_CHARLCD=y 42CONFIG_ARM_CHARLCD=y
43CONFIG_NETDEVICES=y 43CONFIG_NETDEVICES=y
44CONFIG_SMSC_PHY=y 44CONFIG_SMSC_PHY=y
diff --git a/arch/arm/configs/realview_defconfig b/arch/arm/configs/realview_defconfig
index fcaa60328051..7079cbe898a8 100644
--- a/arch/arm/configs/realview_defconfig
+++ b/arch/arm/configs/realview_defconfig
@@ -37,7 +37,7 @@ CONFIG_MTD_BLOCK=y
37CONFIG_MTD_CFI=y 37CONFIG_MTD_CFI=y
38CONFIG_MTD_CFI_INTELEXT=y 38CONFIG_MTD_CFI_INTELEXT=y
39CONFIG_MTD_CFI_AMDSTD=y 39CONFIG_MTD_CFI_AMDSTD=y
40CONFIG_MTD_ARM_INTEGRATOR=y 40CONFIG_MTD_PHYSMAP=y
41CONFIG_ARM_CHARLCD=y 41CONFIG_ARM_CHARLCD=y
42CONFIG_NETDEVICES=y 42CONFIG_NETDEVICES=y
43CONFIG_SMSC_PHY=y 43CONFIG_SMSC_PHY=y
diff --git a/arch/arm/configs/spear310_defconfig b/arch/arm/configs/spear310_defconfig
deleted file mode 100644
index 824e44418b18..000000000000
--- a/arch/arm/configs/spear310_defconfig
+++ /dev/null
@@ -1,52 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_BSD_PROCESS_ACCT=y
4CONFIG_BLK_DEV_INITRD=y
5CONFIG_KALLSYMS_EXTRA_PASS=y
6CONFIG_MODULES=y
7CONFIG_MODULE_UNLOAD=y
8CONFIG_MODVERSIONS=y
9CONFIG_PLAT_SPEAR=y
10CONFIG_MACH_SPEAR310=y
11CONFIG_BINFMT_MISC=y
12CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
13CONFIG_BLK_DEV_RAM=y
14CONFIG_BLK_DEV_RAM_SIZE=16384
15CONFIG_INPUT_FF_MEMLESS=y
16# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
17# CONFIG_INPUT_KEYBOARD is not set
18# CONFIG_INPUT_MOUSE is not set
19CONFIG_SERIAL_AMBA_PL011=y
20CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
21# CONFIG_LEGACY_PTYS is not set
22# CONFIG_HW_RANDOM is not set
23CONFIG_RAW_DRIVER=y
24CONFIG_MAX_RAW_DEVS=8192
25CONFIG_GPIO_SYSFS=y
26CONFIG_GPIO_PL061=y
27# CONFIG_HWMON is not set
28# CONFIG_VGA_CONSOLE is not set
29# CONFIG_HID_SUPPORT is not set
30# CONFIG_USB_SUPPORT is not set
31CONFIG_EXT2_FS=y
32CONFIG_EXT2_FS_XATTR=y
33CONFIG_EXT2_FS_SECURITY=y
34CONFIG_EXT3_FS=y
35CONFIG_EXT3_FS_SECURITY=y
36CONFIG_AUTOFS4_FS=m
37CONFIG_MSDOS_FS=m
38CONFIG_VFAT_FS=m
39CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
40CONFIG_TMPFS=y
41CONFIG_PARTITION_ADVANCED=y
42CONFIG_NLS=y
43CONFIG_NLS_DEFAULT="utf8"
44CONFIG_NLS_CODEPAGE_437=y
45CONFIG_NLS_ASCII=m
46CONFIG_MAGIC_SYSRQ=y
47CONFIG_DEBUG_FS=y
48CONFIG_DEBUG_KERNEL=y
49CONFIG_DEBUG_SPINLOCK=y
50CONFIG_DEBUG_SPINLOCK_SLEEP=y
51CONFIG_DEBUG_INFO=y
52# CONFIG_CRC32 is not set
diff --git a/arch/arm/configs/spear320_defconfig b/arch/arm/configs/spear320_defconfig
deleted file mode 100644
index 842f7f3c512a..000000000000
--- a/arch/arm/configs/spear320_defconfig
+++ /dev/null
@@ -1,52 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_BSD_PROCESS_ACCT=y
4CONFIG_BLK_DEV_INITRD=y
5CONFIG_KALLSYMS_EXTRA_PASS=y
6CONFIG_MODULES=y
7CONFIG_MODULE_UNLOAD=y
8CONFIG_MODVERSIONS=y
9CONFIG_PLAT_SPEAR=y
10CONFIG_MACH_SPEAR320=y
11CONFIG_BINFMT_MISC=y
12CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
13CONFIG_BLK_DEV_RAM=y
14CONFIG_BLK_DEV_RAM_SIZE=16384
15CONFIG_INPUT_FF_MEMLESS=y
16# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
17# CONFIG_INPUT_KEYBOARD is not set
18# CONFIG_INPUT_MOUSE is not set
19CONFIG_SERIAL_AMBA_PL011=y
20CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
21# CONFIG_LEGACY_PTYS is not set
22# CONFIG_HW_RANDOM is not set
23CONFIG_RAW_DRIVER=y
24CONFIG_MAX_RAW_DEVS=8192
25CONFIG_GPIO_SYSFS=y
26CONFIG_GPIO_PL061=y
27# CONFIG_HWMON is not set
28# CONFIG_VGA_CONSOLE is not set
29# CONFIG_HID_SUPPORT is not set
30# CONFIG_USB_SUPPORT is not set
31CONFIG_EXT2_FS=y
32CONFIG_EXT2_FS_XATTR=y
33CONFIG_EXT2_FS_SECURITY=y
34CONFIG_EXT3_FS=y
35CONFIG_EXT3_FS_SECURITY=y
36CONFIG_AUTOFS4_FS=m
37CONFIG_MSDOS_FS=m
38CONFIG_VFAT_FS=m
39CONFIG_FAT_DEFAULT_IOCHARSET="ascii"
40CONFIG_TMPFS=y
41CONFIG_PARTITION_ADVANCED=y
42CONFIG_NLS=y
43CONFIG_NLS_DEFAULT="utf8"
44CONFIG_NLS_CODEPAGE_437=y
45CONFIG_NLS_ASCII=m
46CONFIG_MAGIC_SYSRQ=y
47CONFIG_DEBUG_FS=y
48CONFIG_DEBUG_KERNEL=y
49CONFIG_DEBUG_SPINLOCK=y
50CONFIG_DEBUG_SPINLOCK_SLEEP=y
51CONFIG_DEBUG_INFO=y
52# CONFIG_CRC32 is not set
diff --git a/arch/arm/configs/spear300_defconfig b/arch/arm/configs/spear3xx_defconfig
index cf29f3e56922..fea7e1f026a3 100644
--- a/arch/arm/configs/spear300_defconfig
+++ b/arch/arm/configs/spear3xx_defconfig
@@ -7,6 +7,9 @@ CONFIG_MODULES=y
7CONFIG_MODULE_UNLOAD=y 7CONFIG_MODULE_UNLOAD=y
8CONFIG_MODVERSIONS=y 8CONFIG_MODVERSIONS=y
9CONFIG_PLAT_SPEAR=y 9CONFIG_PLAT_SPEAR=y
10CONFIG_BOARD_SPEAR300_EVB=y
11CONFIG_BOARD_SPEAR310_EVB=y
12CONFIG_BOARD_SPEAR320_EVB=y
10CONFIG_BINFMT_MISC=y 13CONFIG_BINFMT_MISC=y
11CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 14CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
12CONFIG_BLK_DEV_RAM=y 15CONFIG_BLK_DEV_RAM=y
@@ -24,7 +27,6 @@ CONFIG_MAX_RAW_DEVS=8192
24CONFIG_GPIO_SYSFS=y 27CONFIG_GPIO_SYSFS=y
25CONFIG_GPIO_PL061=y 28CONFIG_GPIO_PL061=y
26# CONFIG_HWMON is not set 29# CONFIG_HWMON is not set
27# CONFIG_VGA_CONSOLE is not set
28# CONFIG_HID_SUPPORT is not set 30# CONFIG_HID_SUPPORT is not set
29# CONFIG_USB_SUPPORT is not set 31# CONFIG_USB_SUPPORT is not set
30CONFIG_EXT2_FS=y 32CONFIG_EXT2_FS=y
diff --git a/arch/arm/configs/spear600_defconfig b/arch/arm/configs/spear6xx_defconfig
index 6777c11f63e7..cef2e836afd2 100644
--- a/arch/arm/configs/spear600_defconfig
+++ b/arch/arm/configs/spear6xx_defconfig
@@ -8,6 +8,7 @@ CONFIG_MODULE_UNLOAD=y
8CONFIG_MODVERSIONS=y 8CONFIG_MODVERSIONS=y
9CONFIG_PLAT_SPEAR=y 9CONFIG_PLAT_SPEAR=y
10CONFIG_ARCH_SPEAR6XX=y 10CONFIG_ARCH_SPEAR6XX=y
11CONFIG_BOARD_SPEAR600_EVB=y
11CONFIG_BINFMT_MISC=y 12CONFIG_BINFMT_MISC=y
12CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" 13CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
13CONFIG_BLK_DEV_RAM=y 14CONFIG_BLK_DEV_RAM=y
@@ -22,7 +23,6 @@ CONFIG_MAX_RAW_DEVS=8192
22CONFIG_GPIO_SYSFS=y 23CONFIG_GPIO_SYSFS=y
23CONFIG_GPIO_PL061=y 24CONFIG_GPIO_PL061=y
24# CONFIG_HWMON is not set 25# CONFIG_HWMON is not set
25# CONFIG_VGA_CONSOLE is not set
26# CONFIG_HID_SUPPORT is not set 26# CONFIG_HID_SUPPORT is not set
27# CONFIG_USB_SUPPORT is not set 27# CONFIG_USB_SUPPORT is not set
28CONFIG_EXT2_FS=y 28CONFIG_EXT2_FS=y
diff --git a/arch/arm/configs/stmp378x_defconfig b/arch/arm/configs/stmp378x_defconfig
deleted file mode 100644
index 1079c2b6eb3a..000000000000
--- a/arch/arm/configs/stmp378x_defconfig
+++ /dev/null
@@ -1,128 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_LOCALVERSION="-default"
3CONFIG_SYSVIPC=y
4CONFIG_POSIX_MQUEUE=y
5CONFIG_BSD_PROCESS_ACCT=y
6CONFIG_SYSFS_DEPRECATED_V2=y
7CONFIG_BLK_DEV_INITRD=y
8CONFIG_EXPERT=y
9CONFIG_SLAB=y
10CONFIG_MODULES=y
11CONFIG_MODULE_UNLOAD=y
12CONFIG_MODULE_FORCE_UNLOAD=y
13CONFIG_MODVERSIONS=y
14CONFIG_MODULE_SRCVERSION_ALL=y
15# CONFIG_BLK_DEV_BSG is not set
16CONFIG_ARCH_STMP3XXX=y
17CONFIG_ARCH_STMP378X=y
18CONFIG_NO_HZ=y
19CONFIG_HIGH_RES_TIMERS=y
20CONFIG_PREEMPT=y
21CONFIG_AEABI=y
22CONFIG_HIGHMEM=y
23CONFIG_ZBOOT_ROM_TEXT=0x0
24CONFIG_ZBOOT_ROM_BSS=0x0
25CONFIG_CMDLINE="console=ttySDBG0,115200 mem=32M"
26CONFIG_NET=y
27CONFIG_PACKET=y
28CONFIG_UNIX=y
29CONFIG_INET=y
30CONFIG_IP_MULTICAST=y
31CONFIG_IP_ADVANCED_ROUTER=y
32CONFIG_IP_MULTIPLE_TABLES=y
33CONFIG_IP_ROUTE_MULTIPATH=y
34CONFIG_IP_ROUTE_VERBOSE=y
35CONFIG_IP_PNP=y
36CONFIG_IP_PNP_DHCP=y
37CONFIG_IP_PNP_BOOTP=y
38CONFIG_IP_MROUTE=y
39CONFIG_IP_PIMSM_V1=y
40CONFIG_IP_PIMSM_V2=y
41CONFIG_SYN_COOKIES=y
42# CONFIG_INET_LRO is not set
43# CONFIG_IPV6 is not set
44CONFIG_NET_SCHED=y
45# CONFIG_WIRELESS is not set
46CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
47# CONFIG_STANDALONE is not set
48CONFIG_MTD=y
49CONFIG_MTD_CHAR=y
50CONFIG_MTD_NAND=y
51CONFIG_MTD_UBI=y
52CONFIG_MTD_UBI_GLUEBI=y
53CONFIG_BLK_DEV_LOOP=y
54CONFIG_BLK_DEV_CRYPTOLOOP=y
55CONFIG_BLK_DEV_RAM=y
56CONFIG_BLK_DEV_RAM_COUNT=4
57CONFIG_BLK_DEV_RAM_SIZE=6144
58# CONFIG_MISC_DEVICES is not set
59CONFIG_SCSI=y
60CONFIG_BLK_DEV_SD=y
61CONFIG_CHR_DEV_SG=y
62# CONFIG_SCSI_LOWLEVEL is not set
63CONFIG_INPUT_POLLDEV=y
64CONFIG_INPUT_MOUSEDEV_SCREEN_X=320
65CONFIG_INPUT_MOUSEDEV_SCREEN_Y=240
66CONFIG_INPUT_EVDEV=y
67# CONFIG_KEYBOARD_ATKBD is not set
68# CONFIG_INPUT_MOUSE is not set
69CONFIG_INPUT_TOUCHSCREEN=y
70CONFIG_INPUT_MISC=y
71# CONFIG_SERIO_SERPORT is not set
72CONFIG_VT_HW_CONSOLE_BINDING=y
73# CONFIG_LEGACY_PTYS is not set
74CONFIG_HW_RANDOM=y
75CONFIG_DEBUG_GPIO=y
76CONFIG_GPIO_SYSFS=y
77# CONFIG_HWMON is not set
78CONFIG_FB=y
79CONFIG_BACKLIGHT_LCD_SUPPORT=y
80CONFIG_LCD_CLASS_DEVICE=y
81CONFIG_BACKLIGHT_CLASS_DEVICE=y
82# CONFIG_VGA_CONSOLE is not set
83CONFIG_FRAMEBUFFER_CONSOLE=y
84CONFIG_LOGO=y
85# CONFIG_HID_SUPPORT is not set
86# CONFIG_USB_SUPPORT is not set
87# CONFIG_DNOTIFY is not set
88CONFIG_TMPFS=y
89CONFIG_CONFIGFS_FS=m
90# CONFIG_MISC_FILESYSTEMS is not set
91# CONFIG_NETWORK_FILESYSTEMS is not set
92# CONFIG_ENABLE_MUST_CHECK is not set
93CONFIG_STRIP_ASM_SYMS=y
94CONFIG_DEBUG_KERNEL=y
95CONFIG_DEBUG_SHIRQ=y
96# CONFIG_SCHED_DEBUG is not set
97CONFIG_DEBUG_OBJECTS=y
98CONFIG_DEBUG_OBJECTS_SELFTEST=y
99CONFIG_DEBUG_OBJECTS_FREE=y
100CONFIG_DEBUG_OBJECTS_TIMERS=y
101CONFIG_DEBUG_SLAB=y
102CONFIG_DEBUG_SLAB_LEAK=y
103CONFIG_DEBUG_RT_MUTEXES=y
104CONFIG_PROVE_LOCKING=y
105CONFIG_DEBUG_SPINLOCK_SLEEP=y
106CONFIG_DEBUG_KOBJECT=y
107# CONFIG_DEBUG_BUGVERBOSE is not set
108CONFIG_DEBUG_INFO=y
109# CONFIG_RCU_CPU_STALL_DETECTOR is not set
110CONFIG_SYSCTL_SYSCALL_CHECK=y
111CONFIG_BOOT_TRACER=y
112CONFIG_STACK_TRACER=y
113CONFIG_BLK_DEV_IO_TRACE=y
114CONFIG_KEYS=y
115CONFIG_KEYS_DEBUG_PROC_KEYS=y
116CONFIG_SECURITY=y
117CONFIG_CRYPTO_TEST=m
118CONFIG_CRYPTO_ECB=y
119CONFIG_CRYPTO_HMAC=y
120CONFIG_CRYPTO_MD5=y
121CONFIG_CRYPTO_SHA1=m
122CONFIG_CRYPTO_AES=m
123CONFIG_CRYPTO_DES=y
124CONFIG_CRYPTO_DEFLATE=y
125CONFIG_CRYPTO_LZO=y
126# CONFIG_CRYPTO_ANSI_CPRNG is not set
127CONFIG_CRC_CCITT=m
128CONFIG_CRC16=y
diff --git a/arch/arm/configs/stmp37xx_defconfig b/arch/arm/configs/stmp37xx_defconfig
deleted file mode 100644
index 564a5cc44085..000000000000
--- a/arch/arm/configs/stmp37xx_defconfig
+++ /dev/null
@@ -1,108 +0,0 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_LOCALVERSION="-default"
3CONFIG_SYSVIPC=y
4CONFIG_POSIX_MQUEUE=y
5CONFIG_BSD_PROCESS_ACCT=y
6CONFIG_SYSFS_DEPRECATED_V2=y
7CONFIG_BLK_DEV_INITRD=y
8CONFIG_EXPERT=y
9CONFIG_SLAB=y
10CONFIG_MODULES=y
11CONFIG_MODULE_UNLOAD=y
12CONFIG_MODULE_FORCE_UNLOAD=y
13CONFIG_MODVERSIONS=y
14CONFIG_MODULE_SRCVERSION_ALL=y
15# CONFIG_BLK_DEV_BSG is not set
16CONFIG_ARCH_STMP3XXX=y
17CONFIG_NO_HZ=y
18CONFIG_HIGH_RES_TIMERS=y
19CONFIG_PREEMPT=y
20CONFIG_AEABI=y
21CONFIG_ZBOOT_ROM_TEXT=0x0
22CONFIG_ZBOOT_ROM_BSS=0x0
23CONFIG_CMDLINE="console=ttySDBG0,115200 mem=32M lcd_panel=lms350 rdinit=/bin/sh ignore_loglevel"
24CONFIG_NET=y
25CONFIG_PACKET=y
26CONFIG_UNIX=y
27CONFIG_INET=y
28CONFIG_IP_MULTICAST=y
29CONFIG_IP_ADVANCED_ROUTER=y
30CONFIG_IP_MULTIPLE_TABLES=y
31CONFIG_IP_ROUTE_MULTIPATH=y
32CONFIG_IP_ROUTE_VERBOSE=y
33CONFIG_IP_PNP=y
34CONFIG_IP_PNP_DHCP=y
35CONFIG_IP_PNP_BOOTP=y
36CONFIG_IP_MROUTE=y
37CONFIG_IP_PIMSM_V1=y
38CONFIG_IP_PIMSM_V2=y
39CONFIG_SYN_COOKIES=y
40# CONFIG_INET_LRO is not set
41# CONFIG_IPV6 is not set
42CONFIG_NET_SCHED=y
43# CONFIG_WIRELESS is not set
44CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
45# CONFIG_STANDALONE is not set
46CONFIG_BLK_DEV_LOOP=y
47CONFIG_BLK_DEV_CRYPTOLOOP=y
48CONFIG_BLK_DEV_RAM=y
49CONFIG_BLK_DEV_RAM_COUNT=4
50CONFIG_BLK_DEV_RAM_SIZE=6144
51# CONFIG_MISC_DEVICES is not set
52CONFIG_SCSI=y
53CONFIG_BLK_DEV_SD=y
54CONFIG_CHR_DEV_SG=y
55# CONFIG_SCSI_LOWLEVEL is not set
56CONFIG_INPUT_POLLDEV=y
57CONFIG_INPUT_MOUSEDEV_SCREEN_X=320
58CONFIG_INPUT_MOUSEDEV_SCREEN_Y=240
59CONFIG_INPUT_EVDEV=y
60# CONFIG_KEYBOARD_ATKBD is not set
61# CONFIG_INPUT_MOUSE is not set
62CONFIG_INPUT_TOUCHSCREEN=y
63CONFIG_INPUT_MISC=y
64# CONFIG_SERIO_SERPORT is not set
65CONFIG_VT_HW_CONSOLE_BINDING=y
66# CONFIG_LEGACY_PTYS is not set
67CONFIG_HW_RANDOM=y
68CONFIG_DEBUG_GPIO=y
69CONFIG_GPIO_SYSFS=y
70# CONFIG_HWMON is not set
71CONFIG_FB=y
72CONFIG_BACKLIGHT_LCD_SUPPORT=y
73CONFIG_LCD_CLASS_DEVICE=y
74CONFIG_BACKLIGHT_CLASS_DEVICE=y
75# CONFIG_VGA_CONSOLE is not set
76CONFIG_FRAMEBUFFER_CONSOLE=y
77CONFIG_LOGO=y
78# CONFIG_HID_SUPPORT is not set
79# CONFIG_USB_SUPPORT is not set
80# CONFIG_DNOTIFY is not set
81CONFIG_TMPFS=y
82CONFIG_CONFIGFS_FS=m
83# CONFIG_MISC_FILESYSTEMS is not set
84# CONFIG_NETWORK_FILESYSTEMS is not set
85# CONFIG_ENABLE_MUST_CHECK is not set
86CONFIG_DEBUG_KERNEL=y
87# CONFIG_DEBUG_BUGVERBOSE is not set
88# CONFIG_RCU_CPU_STALL_DETECTOR is not set
89CONFIG_SYSCTL_SYSCALL_CHECK=y
90CONFIG_BOOT_TRACER=y
91CONFIG_STACK_TRACER=y
92CONFIG_BLK_DEV_IO_TRACE=y
93CONFIG_DEBUG_LL=y
94CONFIG_KEYS=y
95CONFIG_KEYS_DEBUG_PROC_KEYS=y
96CONFIG_SECURITY=y
97CONFIG_CRYPTO_TEST=m
98CONFIG_CRYPTO_ECB=y
99CONFIG_CRYPTO_HMAC=y
100CONFIG_CRYPTO_MD5=y
101CONFIG_CRYPTO_SHA1=m
102CONFIG_CRYPTO_AES=m
103CONFIG_CRYPTO_DES=y
104CONFIG_CRYPTO_DEFLATE=y
105CONFIG_CRYPTO_LZO=y
106# CONFIG_CRYPTO_ANSI_CPRNG is not set
107CONFIG_CRC_CCITT=m
108CONFIG_CRC16=y
diff --git a/arch/arm/configs/versatile_defconfig b/arch/arm/configs/versatile_defconfig
index 0ce710f47500..cdd4d2bd3962 100644
--- a/arch/arm/configs/versatile_defconfig
+++ b/arch/arm/configs/versatile_defconfig
@@ -32,7 +32,7 @@ CONFIG_MTD_BLOCK=y
32CONFIG_MTD_CFI=y 32CONFIG_MTD_CFI=y
33CONFIG_MTD_CFI_ADV_OPTIONS=y 33CONFIG_MTD_CFI_ADV_OPTIONS=y
34CONFIG_MTD_CFI_INTELEXT=y 34CONFIG_MTD_CFI_INTELEXT=y
35CONFIG_MTD_ARM_INTEGRATOR=y 35CONFIG_MTD_PHYSMAP=y
36CONFIG_BLK_DEV_RAM=y 36CONFIG_BLK_DEV_RAM=y
37CONFIG_EEPROM_LEGACY=m 37CONFIG_EEPROM_LEGACY=m
38CONFIG_NETDEVICES=y 38CONFIG_NETDEVICES=y
diff --git a/arch/arm/include/asm/dma.h b/arch/arm/include/asm/dma.h
index ca51143f97f1..42005542932b 100644
--- a/arch/arm/include/asm/dma.h
+++ b/arch/arm/include/asm/dma.h
@@ -6,8 +6,10 @@
6/* 6/*
7 * This is the maximum virtual address which can be DMA'd from. 7 * This is the maximum virtual address which can be DMA'd from.
8 */ 8 */
9#ifndef MAX_DMA_ADDRESS 9#ifndef ARM_DMA_ZONE_SIZE
10#define MAX_DMA_ADDRESS 0xffffffff 10#define MAX_DMA_ADDRESS 0xffffffff
11#else
12#define MAX_DMA_ADDRESS (PAGE_OFFSET + ARM_DMA_ZONE_SIZE)
11#endif 13#endif
12 14
13#ifdef CONFIG_ISA_DMA_API 15#ifdef CONFIG_ISA_DMA_API
diff --git a/arch/arm/include/asm/elf.h b/arch/arm/include/asm/elf.h
index c3cd8755e648..0e9ce8d9686e 100644
--- a/arch/arm/include/asm/elf.h
+++ b/arch/arm/include/asm/elf.h
@@ -108,6 +108,7 @@ struct task_struct;
108int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs); 108int dump_task_regs(struct task_struct *t, elf_gregset_t *elfregs);
109#define ELF_CORE_COPY_TASK_REGS dump_task_regs 109#define ELF_CORE_COPY_TASK_REGS dump_task_regs
110 110
111#define CORE_DUMP_USE_REGSET
111#define ELF_EXEC_PAGESIZE 4096 112#define ELF_EXEC_PAGESIZE 4096
112 113
113/* This is the location that an ET_DYN program is loaded if exec'ed. Typical 114/* This is the location that an ET_DYN program is loaded if exec'ed. Typical
diff --git a/arch/arm/include/asm/futex.h b/arch/arm/include/asm/futex.h
index 199a6b6de7f4..8c73900da9ed 100644
--- a/arch/arm/include/asm/futex.h
+++ b/arch/arm/include/asm/futex.h
@@ -3,16 +3,74 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#if defined(CONFIG_CPU_USE_DOMAINS) && defined(CONFIG_SMP)
7/* ARM doesn't provide unprivileged exclusive memory accessors */
8#include <asm-generic/futex.h>
9#else
10
11#include <linux/futex.h>
12#include <linux/uaccess.h>
13#include <asm/errno.h>
14
15#define __futex_atomic_ex_table(err_reg) \
16 "3:\n" \
17 " .pushsection __ex_table,\"a\"\n" \
18 " .align 3\n" \
19 " .long 1b, 4f, 2b, 4f\n" \
20 " .popsection\n" \
21 " .pushsection .fixup,\"ax\"\n" \
22 "4: mov %0, " err_reg "\n" \
23 " b 3b\n" \
24 " .popsection"
25
6#ifdef CONFIG_SMP 26#ifdef CONFIG_SMP
7 27
8#include <asm-generic/futex.h> 28#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \
29 smp_mb(); \
30 __asm__ __volatile__( \
31 "1: ldrex %1, [%2]\n" \
32 " " insn "\n" \
33 "2: strex %1, %0, [%2]\n" \
34 " teq %1, #0\n" \
35 " bne 1b\n" \
36 " mov %0, #0\n" \
37 __futex_atomic_ex_table("%4") \
38 : "=&r" (ret), "=&r" (oldval) \
39 : "r" (uaddr), "r" (oparg), "Ir" (-EFAULT) \
40 : "cc", "memory")
41
42static inline int
43futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
44 u32 oldval, u32 newval)
45{
46 int ret;
47 u32 val;
48
49 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
50 return -EFAULT;
51
52 smp_mb();
53 __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n"
54 "1: ldrex %1, [%4]\n"
55 " teq %1, %2\n"
56 " ite eq @ explicit IT needed for the 2b label\n"
57 "2: strexeq %0, %3, [%4]\n"
58 " movne %0, #0\n"
59 " teq %0, #0\n"
60 " bne 1b\n"
61 __futex_atomic_ex_table("%5")
62 : "=&r" (ret), "=&r" (val)
63 : "r" (oldval), "r" (newval), "r" (uaddr), "Ir" (-EFAULT)
64 : "cc", "memory");
65 smp_mb();
66
67 *uval = val;
68 return ret;
69}
9 70
10#else /* !SMP, we can work around lack of atomic ops by disabling preemption */ 71#else /* !SMP, we can work around lack of atomic ops by disabling preemption */
11 72
12#include <linux/futex.h>
13#include <linux/preempt.h> 73#include <linux/preempt.h>
14#include <linux/uaccess.h>
15#include <asm/errno.h>
16#include <asm/domain.h> 74#include <asm/domain.h>
17 75
18#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \ 76#define __futex_atomic_op(insn, ret, oldval, uaddr, oparg) \
@@ -21,20 +79,38 @@
21 " " insn "\n" \ 79 " " insn "\n" \
22 "2: " T(str) " %0, [%2]\n" \ 80 "2: " T(str) " %0, [%2]\n" \
23 " mov %0, #0\n" \ 81 " mov %0, #0\n" \
24 "3:\n" \ 82 __futex_atomic_ex_table("%4") \
25 " .pushsection __ex_table,\"a\"\n" \
26 " .align 3\n" \
27 " .long 1b, 4f, 2b, 4f\n" \
28 " .popsection\n" \
29 " .pushsection .fixup,\"ax\"\n" \
30 "4: mov %0, %4\n" \
31 " b 3b\n" \
32 " .popsection" \
33 : "=&r" (ret), "=&r" (oldval) \ 83 : "=&r" (ret), "=&r" (oldval) \
34 : "r" (uaddr), "r" (oparg), "Ir" (-EFAULT) \ 84 : "r" (uaddr), "r" (oparg), "Ir" (-EFAULT) \
35 : "cc", "memory") 85 : "cc", "memory")
36 86
37static inline int 87static inline int
88futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
89 u32 oldval, u32 newval)
90{
91 int ret = 0;
92 u32 val;
93
94 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
95 return -EFAULT;
96
97 __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n"
98 "1: " T(ldr) " %1, [%4]\n"
99 " teq %1, %2\n"
100 " it eq @ explicit IT needed for the 2b label\n"
101 "2: " T(streq) " %3, [%4]\n"
102 __futex_atomic_ex_table("%5")
103 : "+r" (ret), "=&r" (val)
104 : "r" (oldval), "r" (newval), "r" (uaddr), "Ir" (-EFAULT)
105 : "cc", "memory");
106
107 *uval = val;
108 return ret;
109}
110
111#endif /* !SMP */
112
113static inline int
38futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr) 114futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr)
39{ 115{
40 int op = (encoded_op >> 28) & 7; 116 int op = (encoded_op >> 28) & 7;
@@ -87,39 +163,6 @@ futex_atomic_op_inuser (int encoded_op, u32 __user *uaddr)
87 return ret; 163 return ret;
88} 164}
89 165
90static inline int 166#endif /* !(CPU_USE_DOMAINS && SMP) */
91futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
92 u32 oldval, u32 newval)
93{
94 int ret = 0;
95 u32 val;
96
97 if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
98 return -EFAULT;
99
100 __asm__ __volatile__("@futex_atomic_cmpxchg_inatomic\n"
101 "1: " T(ldr) " %1, [%4]\n"
102 " teq %1, %2\n"
103 " it eq @ explicit IT needed for the 2b label\n"
104 "2: " T(streq) " %3, [%4]\n"
105 "3:\n"
106 " .pushsection __ex_table,\"a\"\n"
107 " .align 3\n"
108 " .long 1b, 4f, 2b, 4f\n"
109 " .popsection\n"
110 " .pushsection .fixup,\"ax\"\n"
111 "4: mov %0, %5\n"
112 " b 3b\n"
113 " .popsection"
114 : "+r" (ret), "=&r" (val)
115 : "r" (oldval), "r" (newval), "r" (uaddr), "Ir" (-EFAULT)
116 : "cc", "memory");
117
118 *uval = val;
119 return ret;
120}
121
122#endif /* !SMP */
123
124#endif /* __KERNEL__ */ 167#endif /* __KERNEL__ */
125#endif /* _ASM_ARM_FUTEX_H */ 168#endif /* _ASM_ARM_FUTEX_H */
diff --git a/arch/arm/include/asm/hardware/timer-sp.h b/arch/arm/include/asm/hardware/timer-sp.h
index 21e75e30d497..4384d81eee79 100644
--- a/arch/arm/include/asm/hardware/timer-sp.h
+++ b/arch/arm/include/asm/hardware/timer-sp.h
@@ -1,2 +1,2 @@
1void sp804_clocksource_init(void __iomem *); 1void sp804_clocksource_init(void __iomem *, const char *);
2void sp804_clockevents_init(void __iomem *, unsigned int); 2void sp804_clockevents_init(void __iomem *, unsigned int, const char *);
diff --git a/arch/arm/include/asm/i8253.h b/arch/arm/include/asm/i8253.h
new file mode 100644
index 000000000000..70656b69d5ce
--- /dev/null
+++ b/arch/arm/include/asm/i8253.h
@@ -0,0 +1,15 @@
1#ifndef __ASMARM_I8253_H
2#define __ASMARM_I8253_H
3
4/* i8253A PIT registers */
5#define PIT_MODE 0x43
6#define PIT_CH0 0x40
7
8#define PIT_LATCH ((PIT_TICK_RATE + HZ / 2) / HZ)
9
10extern raw_spinlock_t i8253_lock;
11
12#define outb_pit outb_p
13#define inb_pit inb_p
14
15#endif
diff --git a/arch/arm/include/asm/mach/time.h b/arch/arm/include/asm/mach/time.h
index 883f6be5117a..d5adaae5ee2c 100644
--- a/arch/arm/include/asm/mach/time.h
+++ b/arch/arm/include/asm/mach/time.h
@@ -34,7 +34,6 @@
34 * timer interrupt which may be pending. 34 * timer interrupt which may be pending.
35 */ 35 */
36struct sys_timer { 36struct sys_timer {
37 struct sys_device dev;
38 void (*init)(void); 37 void (*init)(void);
39 void (*suspend)(void); 38 void (*suspend)(void);
40 void (*resume)(void); 39 void (*resume)(void);
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
index 431077c5a867..af44a8fb3480 100644
--- a/arch/arm/include/asm/memory.h
+++ b/arch/arm/include/asm/memory.h
@@ -209,14 +209,10 @@ static inline unsigned long __phys_to_virt(unsigned long x)
209 * allocations. This must be the smallest DMA mask in the system, 209 * allocations. This must be the smallest DMA mask in the system,
210 * so a successful GFP_DMA allocation will always satisfy this. 210 * so a successful GFP_DMA allocation will always satisfy this.
211 */ 211 */
212#ifndef ISA_DMA_THRESHOLD 212#ifndef ARM_DMA_ZONE_SIZE
213#define ISA_DMA_THRESHOLD (0xffffffffULL) 213#define ISA_DMA_THRESHOLD (0xffffffffULL)
214#endif 214#else
215 215#define ISA_DMA_THRESHOLD (PHYS_OFFSET + ARM_DMA_ZONE_SIZE - 1)
216#ifndef arch_adjust_zones
217#define arch_adjust_zones(size,holes) do { } while (0)
218#elif !defined(CONFIG_ZONE_DMA)
219#error "custom arch_adjust_zones() requires CONFIG_ZONE_DMA"
220#endif 216#endif
221 217
222/* 218/*
diff --git a/arch/arm/include/asm/ptrace.h b/arch/arm/include/asm/ptrace.h
index a8ff22b2a391..312d10877bd7 100644
--- a/arch/arm/include/asm/ptrace.h
+++ b/arch/arm/include/asm/ptrace.h
@@ -128,6 +128,12 @@ struct pt_regs {
128#define ARM_r0 uregs[0] 128#define ARM_r0 uregs[0]
129#define ARM_ORIG_r0 uregs[17] 129#define ARM_ORIG_r0 uregs[17]
130 130
131/*
132 * The size of the user-visible VFP state as seen by PTRACE_GET/SETVFPREGS
133 * and core dumps.
134 */
135#define ARM_VFPREGS_SIZE ( 32 * 8 /*fpregs*/ + 4 /*fpscr*/ )
136
131#ifdef __KERNEL__ 137#ifdef __KERNEL__
132 138
133#define user_mode(regs) \ 139#define user_mode(regs) \
diff --git a/arch/arm/include/asm/sizes.h b/arch/arm/include/asm/sizes.h
index 316bb2b2be3d..154b89b81d3e 100644
--- a/arch/arm/include/asm/sizes.h
+++ b/arch/arm/include/asm/sizes.h
@@ -16,44 +16,6 @@
16/* Size definitions 16/* Size definitions
17 * Copyright (C) ARM Limited 1998. All rights reserved. 17 * Copyright (C) ARM Limited 1998. All rights reserved.
18 */ 18 */
19#include <asm-generic/sizes.h>
19 20
20#ifndef __sizes_h 21#define SZ_48M (SZ_32M + SZ_16M)
21#define __sizes_h 1
22
23/* handy sizes */
24#define SZ_16 0x00000010
25#define SZ_32 0x00000020
26#define SZ_64 0x00000040
27#define SZ_128 0x00000080
28#define SZ_256 0x00000100
29#define SZ_512 0x00000200
30
31#define SZ_1K 0x00000400
32#define SZ_2K 0x00000800
33#define SZ_4K 0x00001000
34#define SZ_8K 0x00002000
35#define SZ_16K 0x00004000
36#define SZ_32K 0x00008000
37#define SZ_64K 0x00010000
38#define SZ_128K 0x00020000
39#define SZ_256K 0x00040000
40#define SZ_512K 0x00080000
41
42#define SZ_1M 0x00100000
43#define SZ_2M 0x00200000
44#define SZ_4M 0x00400000
45#define SZ_8M 0x00800000
46#define SZ_16M 0x01000000
47#define SZ_32M 0x02000000
48#define SZ_48M 0x03000000
49#define SZ_64M 0x04000000
50#define SZ_128M 0x08000000
51#define SZ_256M 0x10000000
52#define SZ_512M 0x20000000
53
54#define SZ_1G 0x40000000
55#define SZ_2G 0x80000000
56
57#endif
58
59/* END */
diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
index 96ed521f2408..a87664f54f93 100644
--- a/arch/arm/include/asm/smp.h
+++ b/arch/arm/include/asm/smp.h
@@ -14,8 +14,6 @@
14#include <linux/cpumask.h> 14#include <linux/cpumask.h>
15#include <linux/thread_info.h> 15#include <linux/thread_info.h>
16 16
17#include <mach/smp.h>
18
19#ifndef CONFIG_SMP 17#ifndef CONFIG_SMP
20# error "<asm/smp.h> included in non-SMP build" 18# error "<asm/smp.h> included in non-SMP build"
21#endif 19#endif
@@ -47,9 +45,9 @@ extern void smp_init_cpus(void);
47 45
48 46
49/* 47/*
50 * Raise an IPI cross call on CPUs in callmap. 48 * Provide a function to raise an IPI cross call on CPUs in callmap.
51 */ 49 */
52extern void smp_cross_call(const struct cpumask *mask, int ipi); 50extern void set_smp_cross_call(void (*)(const struct cpumask *, unsigned int));
53 51
54/* 52/*
55 * Boot a secondary CPU, and assign it the specified idle task. 53 * Boot a secondary CPU, and assign it the specified idle task.
diff --git a/arch/arm/include/asm/spinlock.h b/arch/arm/include/asm/spinlock.h
index fdd3820edff8..65fa3c88095c 100644
--- a/arch/arm/include/asm/spinlock.h
+++ b/arch/arm/include/asm/spinlock.h
@@ -5,6 +5,8 @@
5#error SMP not supported on pre-ARMv6 CPUs 5#error SMP not supported on pre-ARMv6 CPUs
6#endif 6#endif
7 7
8#include <asm/processor.h>
9
8/* 10/*
9 * sev and wfe are ARMv6K extensions. Uniprocessor ARMv6 may not have the K 11 * sev and wfe are ARMv6K extensions. Uniprocessor ARMv6 may not have the K
10 * extensions, so when running on UP, we have to patch these instructions away. 12 * extensions, so when running on UP, we have to patch these instructions away.
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 885be097769d..832888d0c20c 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -159,7 +159,7 @@ extern unsigned int user_debug;
159#include <mach/barriers.h> 159#include <mach/barriers.h>
160#elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP) 160#elif defined(CONFIG_ARM_DMA_MEM_BUFFERABLE) || defined(CONFIG_SMP)
161#define mb() do { dsb(); outer_sync(); } while (0) 161#define mb() do { dsb(); outer_sync(); } while (0)
162#define rmb() dmb() 162#define rmb() dsb()
163#define wmb() mb() 163#define wmb() mb()
164#else 164#else
165#include <asm/memory.h> 165#include <asm/memory.h>
diff --git a/arch/arm/kernel/leds.c b/arch/arm/kernel/leds.c
index 31a316c1777b..0f107dcb0347 100644
--- a/arch/arm/kernel/leds.c
+++ b/arch/arm/kernel/leds.c
@@ -10,6 +10,7 @@
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/sysdev.h> 12#include <linux/sysdev.h>
13#include <linux/syscore_ops.h>
13 14
14#include <asm/leds.h> 15#include <asm/leds.h>
15 16
@@ -69,36 +70,37 @@ static ssize_t leds_store(struct sys_device *dev,
69 70
70static SYSDEV_ATTR(event, 0200, NULL, leds_store); 71static SYSDEV_ATTR(event, 0200, NULL, leds_store);
71 72
72static int leds_suspend(struct sys_device *dev, pm_message_t state) 73static struct sysdev_class leds_sysclass = {
74 .name = "leds",
75};
76
77static struct sys_device leds_device = {
78 .id = 0,
79 .cls = &leds_sysclass,
80};
81
82static int leds_suspend(void)
73{ 83{
74 leds_event(led_stop); 84 leds_event(led_stop);
75 return 0; 85 return 0;
76} 86}
77 87
78static int leds_resume(struct sys_device *dev) 88static void leds_resume(void)
79{ 89{
80 leds_event(led_start); 90 leds_event(led_start);
81 return 0;
82} 91}
83 92
84static int leds_shutdown(struct sys_device *dev) 93static void leds_shutdown(void)
85{ 94{
86 leds_event(led_halted); 95 leds_event(led_halted);
87 return 0;
88} 96}
89 97
90static struct sysdev_class leds_sysclass = { 98static struct syscore_ops leds_syscore_ops = {
91 .name = "leds",
92 .shutdown = leds_shutdown, 99 .shutdown = leds_shutdown,
93 .suspend = leds_suspend, 100 .suspend = leds_suspend,
94 .resume = leds_resume, 101 .resume = leds_resume,
95}; 102};
96 103
97static struct sys_device leds_device = {
98 .id = 0,
99 .cls = &leds_sysclass,
100};
101
102static int __init leds_init(void) 104static int __init leds_init(void)
103{ 105{
104 int ret; 106 int ret;
@@ -107,6 +109,8 @@ static int __init leds_init(void)
107 ret = sysdev_register(&leds_device); 109 ret = sysdev_register(&leds_device);
108 if (ret == 0) 110 if (ret == 0)
109 ret = sysdev_create_file(&leds_device, &attr_event); 111 ret = sysdev_create_file(&leds_device, &attr_event);
112 if (ret == 0)
113 register_syscore_ops(&leds_syscore_ops);
110 return ret; 114 return ret;
111} 115}
112 116
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 139e3c827369..d53c0abc4dd3 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -560,11 +560,6 @@ static int armpmu_event_init(struct perf_event *event)
560 event->destroy = hw_perf_event_destroy; 560 event->destroy = hw_perf_event_destroy;
561 561
562 if (!atomic_inc_not_zero(&active_events)) { 562 if (!atomic_inc_not_zero(&active_events)) {
563 if (atomic_read(&active_events) > armpmu->num_events) {
564 atomic_dec(&active_events);
565 return -ENOSPC;
566 }
567
568 mutex_lock(&pmu_reserve_mutex); 563 mutex_lock(&pmu_reserve_mutex);
569 if (atomic_read(&active_events) == 0) { 564 if (atomic_read(&active_events) == 0) {
570 err = armpmu_reserve_hardware(); 565 err = armpmu_reserve_hardware();
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index 8182f45ca493..97260060bf26 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -21,6 +21,7 @@
21#include <linux/uaccess.h> 21#include <linux/uaccess.h>
22#include <linux/perf_event.h> 22#include <linux/perf_event.h>
23#include <linux/hw_breakpoint.h> 23#include <linux/hw_breakpoint.h>
24#include <linux/regset.h>
24 25
25#include <asm/pgtable.h> 26#include <asm/pgtable.h>
26#include <asm/system.h> 27#include <asm/system.h>
@@ -308,58 +309,6 @@ static int ptrace_write_user(struct task_struct *tsk, unsigned long off,
308 return put_user_reg(tsk, off >> 2, val); 309 return put_user_reg(tsk, off >> 2, val);
309} 310}
310 311
311/*
312 * Get all user integer registers.
313 */
314static int ptrace_getregs(struct task_struct *tsk, void __user *uregs)
315{
316 struct pt_regs *regs = task_pt_regs(tsk);
317
318 return copy_to_user(uregs, regs, sizeof(struct pt_regs)) ? -EFAULT : 0;
319}
320
321/*
322 * Set all user integer registers.
323 */
324static int ptrace_setregs(struct task_struct *tsk, void __user *uregs)
325{
326 struct pt_regs newregs;
327 int ret;
328
329 ret = -EFAULT;
330 if (copy_from_user(&newregs, uregs, sizeof(struct pt_regs)) == 0) {
331 struct pt_regs *regs = task_pt_regs(tsk);
332
333 ret = -EINVAL;
334 if (valid_user_regs(&newregs)) {
335 *regs = newregs;
336 ret = 0;
337 }
338 }
339
340 return ret;
341}
342
343/*
344 * Get the child FPU state.
345 */
346static int ptrace_getfpregs(struct task_struct *tsk, void __user *ufp)
347{
348 return copy_to_user(ufp, &task_thread_info(tsk)->fpstate,
349 sizeof(struct user_fp)) ? -EFAULT : 0;
350}
351
352/*
353 * Set the child FPU state.
354 */
355static int ptrace_setfpregs(struct task_struct *tsk, void __user *ufp)
356{
357 struct thread_info *thread = task_thread_info(tsk);
358 thread->used_cp[1] = thread->used_cp[2] = 1;
359 return copy_from_user(&thread->fpstate, ufp,
360 sizeof(struct user_fp)) ? -EFAULT : 0;
361}
362
363#ifdef CONFIG_IWMMXT 312#ifdef CONFIG_IWMMXT
364 313
365/* 314/*
@@ -418,56 +367,6 @@ static int ptrace_setcrunchregs(struct task_struct *tsk, void __user *ufp)
418} 367}
419#endif 368#endif
420 369
421#ifdef CONFIG_VFP
422/*
423 * Get the child VFP state.
424 */
425static int ptrace_getvfpregs(struct task_struct *tsk, void __user *data)
426{
427 struct thread_info *thread = task_thread_info(tsk);
428 union vfp_state *vfp = &thread->vfpstate;
429 struct user_vfp __user *ufp = data;
430
431 vfp_sync_hwstate(thread);
432
433 /* copy the floating point registers */
434 if (copy_to_user(&ufp->fpregs, &vfp->hard.fpregs,
435 sizeof(vfp->hard.fpregs)))
436 return -EFAULT;
437
438 /* copy the status and control register */
439 if (put_user(vfp->hard.fpscr, &ufp->fpscr))
440 return -EFAULT;
441
442 return 0;
443}
444
445/*
446 * Set the child VFP state.
447 */
448static int ptrace_setvfpregs(struct task_struct *tsk, void __user *data)
449{
450 struct thread_info *thread = task_thread_info(tsk);
451 union vfp_state *vfp = &thread->vfpstate;
452 struct user_vfp __user *ufp = data;
453
454 vfp_sync_hwstate(thread);
455
456 /* copy the floating point registers */
457 if (copy_from_user(&vfp->hard.fpregs, &ufp->fpregs,
458 sizeof(vfp->hard.fpregs)))
459 return -EFAULT;
460
461 /* copy the status and control register */
462 if (get_user(vfp->hard.fpscr, &ufp->fpscr))
463 return -EFAULT;
464
465 vfp_flush_hwstate(thread);
466
467 return 0;
468}
469#endif
470
471#ifdef CONFIG_HAVE_HW_BREAKPOINT 370#ifdef CONFIG_HAVE_HW_BREAKPOINT
472/* 371/*
473 * Convert a virtual register number into an index for a thread_info 372 * Convert a virtual register number into an index for a thread_info
@@ -694,6 +593,219 @@ out:
694} 593}
695#endif 594#endif
696 595
596/* regset get/set implementations */
597
598static int gpr_get(struct task_struct *target,
599 const struct user_regset *regset,
600 unsigned int pos, unsigned int count,
601 void *kbuf, void __user *ubuf)
602{
603 struct pt_regs *regs = task_pt_regs(target);
604
605 return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
606 regs,
607 0, sizeof(*regs));
608}
609
610static int gpr_set(struct task_struct *target,
611 const struct user_regset *regset,
612 unsigned int pos, unsigned int count,
613 const void *kbuf, const void __user *ubuf)
614{
615 int ret;
616 struct pt_regs newregs;
617
618 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
619 &newregs,
620 0, sizeof(newregs));
621 if (ret)
622 return ret;
623
624 if (!valid_user_regs(&newregs))
625 return -EINVAL;
626
627 *task_pt_regs(target) = newregs;
628 return 0;
629}
630
631static int fpa_get(struct task_struct *target,
632 const struct user_regset *regset,
633 unsigned int pos, unsigned int count,
634 void *kbuf, void __user *ubuf)
635{
636 return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
637 &task_thread_info(target)->fpstate,
638 0, sizeof(struct user_fp));
639}
640
641static int fpa_set(struct task_struct *target,
642 const struct user_regset *regset,
643 unsigned int pos, unsigned int count,
644 const void *kbuf, const void __user *ubuf)
645{
646 struct thread_info *thread = task_thread_info(target);
647
648 thread->used_cp[1] = thread->used_cp[2] = 1;
649
650 return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
651 &thread->fpstate,
652 0, sizeof(struct user_fp));
653}
654
655#ifdef CONFIG_VFP
656/*
657 * VFP register get/set implementations.
658 *
659 * With respect to the kernel, struct user_fp is divided into three chunks:
660 * 16 or 32 real VFP registers (d0-d15 or d0-31)
661 * These are transferred to/from the real registers in the task's
662 * vfp_hard_struct. The number of registers depends on the kernel
663 * configuration.
664 *
665 * 16 or 0 fake VFP registers (d16-d31 or empty)
666 * i.e., the user_vfp structure has space for 32 registers even if
667 * the kernel doesn't have them all.
668 *
669 * vfp_get() reads this chunk as zero where applicable
670 * vfp_set() ignores this chunk
671 *
672 * 1 word for the FPSCR
673 *
674 * The bounds-checking logic built into user_regset_copyout and friends
675 * means that we can make a simple sequence of calls to map the relevant data
676 * to/from the specified slice of the user regset structure.
677 */
678static int vfp_get(struct task_struct *target,
679 const struct user_regset *regset,
680 unsigned int pos, unsigned int count,
681 void *kbuf, void __user *ubuf)
682{
683 int ret;
684 struct thread_info *thread = task_thread_info(target);
685 struct vfp_hard_struct const *vfp = &thread->vfpstate.hard;
686 const size_t user_fpregs_offset = offsetof(struct user_vfp, fpregs);
687 const size_t user_fpscr_offset = offsetof(struct user_vfp, fpscr);
688
689 vfp_sync_hwstate(thread);
690
691 ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
692 &vfp->fpregs,
693 user_fpregs_offset,
694 user_fpregs_offset + sizeof(vfp->fpregs));
695 if (ret)
696 return ret;
697
698 ret = user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf,
699 user_fpregs_offset + sizeof(vfp->fpregs),
700 user_fpscr_offset);
701 if (ret)
702 return ret;
703
704 return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
705 &vfp->fpscr,
706 user_fpscr_offset,
707 user_fpscr_offset + sizeof(vfp->fpscr));
708}
709
710/*
711 * For vfp_set() a read-modify-write is done on the VFP registers,
712 * in order to avoid writing back a half-modified set of registers on
713 * failure.
714 */
715static int vfp_set(struct task_struct *target,
716 const struct user_regset *regset,
717 unsigned int pos, unsigned int count,
718 const void *kbuf, const void __user *ubuf)
719{
720 int ret;
721 struct thread_info *thread = task_thread_info(target);
722 struct vfp_hard_struct new_vfp = thread->vfpstate.hard;
723 const size_t user_fpregs_offset = offsetof(struct user_vfp, fpregs);
724 const size_t user_fpscr_offset = offsetof(struct user_vfp, fpscr);
725
726 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
727 &new_vfp.fpregs,
728 user_fpregs_offset,
729 user_fpregs_offset + sizeof(new_vfp.fpregs));
730 if (ret)
731 return ret;
732
733 ret = user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
734 user_fpregs_offset + sizeof(new_vfp.fpregs),
735 user_fpscr_offset);
736 if (ret)
737 return ret;
738
739 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
740 &new_vfp.fpscr,
741 user_fpscr_offset,
742 user_fpscr_offset + sizeof(new_vfp.fpscr));
743 if (ret)
744 return ret;
745
746 vfp_sync_hwstate(thread);
747 thread->vfpstate.hard = new_vfp;
748 vfp_flush_hwstate(thread);
749
750 return 0;
751}
752#endif /* CONFIG_VFP */
753
754enum arm_regset {
755 REGSET_GPR,
756 REGSET_FPR,
757#ifdef CONFIG_VFP
758 REGSET_VFP,
759#endif
760};
761
762static const struct user_regset arm_regsets[] = {
763 [REGSET_GPR] = {
764 .core_note_type = NT_PRSTATUS,
765 .n = ELF_NGREG,
766 .size = sizeof(u32),
767 .align = sizeof(u32),
768 .get = gpr_get,
769 .set = gpr_set
770 },
771 [REGSET_FPR] = {
772 /*
773 * For the FPA regs in fpstate, the real fields are a mixture
774 * of sizes, so pretend that the registers are word-sized:
775 */
776 .core_note_type = NT_PRFPREG,
777 .n = sizeof(struct user_fp) / sizeof(u32),
778 .size = sizeof(u32),
779 .align = sizeof(u32),
780 .get = fpa_get,
781 .set = fpa_set
782 },
783#ifdef CONFIG_VFP
784 [REGSET_VFP] = {
785 /*
786 * Pretend that the VFP regs are word-sized, since the FPSCR is
787 * a single word dangling at the end of struct user_vfp:
788 */
789 .core_note_type = NT_ARM_VFP,
790 .n = ARM_VFPREGS_SIZE / sizeof(u32),
791 .size = sizeof(u32),
792 .align = sizeof(u32),
793 .get = vfp_get,
794 .set = vfp_set
795 },
796#endif /* CONFIG_VFP */
797};
798
799static const struct user_regset_view user_arm_view = {
800 .name = "arm", .e_machine = ELF_ARCH, .ei_osabi = ELF_OSABI,
801 .regsets = arm_regsets, .n = ARRAY_SIZE(arm_regsets)
802};
803
804const struct user_regset_view *task_user_regset_view(struct task_struct *task)
805{
806 return &user_arm_view;
807}
808
697long arch_ptrace(struct task_struct *child, long request, 809long arch_ptrace(struct task_struct *child, long request,
698 unsigned long addr, unsigned long data) 810 unsigned long addr, unsigned long data)
699{ 811{
@@ -710,19 +822,31 @@ long arch_ptrace(struct task_struct *child, long request,
710 break; 822 break;
711 823
712 case PTRACE_GETREGS: 824 case PTRACE_GETREGS:
713 ret = ptrace_getregs(child, datap); 825 ret = copy_regset_to_user(child,
826 &user_arm_view, REGSET_GPR,
827 0, sizeof(struct pt_regs),
828 datap);
714 break; 829 break;
715 830
716 case PTRACE_SETREGS: 831 case PTRACE_SETREGS:
717 ret = ptrace_setregs(child, datap); 832 ret = copy_regset_from_user(child,
833 &user_arm_view, REGSET_GPR,
834 0, sizeof(struct pt_regs),
835 datap);
718 break; 836 break;
719 837
720 case PTRACE_GETFPREGS: 838 case PTRACE_GETFPREGS:
721 ret = ptrace_getfpregs(child, datap); 839 ret = copy_regset_to_user(child,
840 &user_arm_view, REGSET_FPR,
841 0, sizeof(union fp_state),
842 datap);
722 break; 843 break;
723 844
724 case PTRACE_SETFPREGS: 845 case PTRACE_SETFPREGS:
725 ret = ptrace_setfpregs(child, datap); 846 ret = copy_regset_from_user(child,
847 &user_arm_view, REGSET_FPR,
848 0, sizeof(union fp_state),
849 datap);
726 break; 850 break;
727 851
728#ifdef CONFIG_IWMMXT 852#ifdef CONFIG_IWMMXT
@@ -757,11 +881,17 @@ long arch_ptrace(struct task_struct *child, long request,
757 881
758#ifdef CONFIG_VFP 882#ifdef CONFIG_VFP
759 case PTRACE_GETVFPREGS: 883 case PTRACE_GETVFPREGS:
760 ret = ptrace_getvfpregs(child, datap); 884 ret = copy_regset_to_user(child,
885 &user_arm_view, REGSET_VFP,
886 0, ARM_VFPREGS_SIZE,
887 datap);
761 break; 888 break;
762 889
763 case PTRACE_SETVFPREGS: 890 case PTRACE_SETVFPREGS:
764 ret = ptrace_setvfpregs(child, datap); 891 ret = copy_regset_from_user(child,
892 &user_arm_view, REGSET_VFP,
893 0, ARM_VFPREGS_SIZE,
894 datap);
765 break; 895 break;
766#endif 896#endif
767 897
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 006c1e884eaf..6dce209a623b 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -672,11 +672,16 @@ __tagtable(ATAG_REVISION, parse_tag_revision);
672 672
673static int __init parse_tag_cmdline(const struct tag *tag) 673static int __init parse_tag_cmdline(const struct tag *tag)
674{ 674{
675#ifndef CONFIG_CMDLINE_FORCE 675#if defined(CONFIG_CMDLINE_EXTEND)
676 strlcpy(default_command_line, tag->u.cmdline.cmdline, COMMAND_LINE_SIZE); 676 strlcat(default_command_line, " ", COMMAND_LINE_SIZE);
677#else 677 strlcat(default_command_line, tag->u.cmdline.cmdline,
678 COMMAND_LINE_SIZE);
679#elif defined(CONFIG_CMDLINE_FORCE)
678 pr_warning("Ignoring tag cmdline (using the default kernel command line)\n"); 680 pr_warning("Ignoring tag cmdline (using the default kernel command line)\n");
679#endif /* CONFIG_CMDLINE_FORCE */ 681#else
682 strlcpy(default_command_line, tag->u.cmdline.cmdline,
683 COMMAND_LINE_SIZE);
684#endif
680 return 0; 685 return 0;
681} 686}
682 687
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index cb8398317644..0340224cf73c 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -597,19 +597,13 @@ setup_rt_frame(int usig, struct k_sigaction *ka, siginfo_t *info,
597 return err; 597 return err;
598} 598}
599 599
600static inline void setup_syscall_restart(struct pt_regs *regs)
601{
602 regs->ARM_r0 = regs->ARM_ORIG_r0;
603 regs->ARM_pc -= thumb_mode(regs) ? 2 : 4;
604}
605
606/* 600/*
607 * OK, we're invoking a handler 601 * OK, we're invoking a handler
608 */ 602 */
609static int 603static int
610handle_signal(unsigned long sig, struct k_sigaction *ka, 604handle_signal(unsigned long sig, struct k_sigaction *ka,
611 siginfo_t *info, sigset_t *oldset, 605 siginfo_t *info, sigset_t *oldset,
612 struct pt_regs * regs, int syscall) 606 struct pt_regs * regs)
613{ 607{
614 struct thread_info *thread = current_thread_info(); 608 struct thread_info *thread = current_thread_info();
615 struct task_struct *tsk = current; 609 struct task_struct *tsk = current;
@@ -617,26 +611,6 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
617 int ret; 611 int ret;
618 612
619 /* 613 /*
620 * If we were from a system call, check for system call restarting...
621 */
622 if (syscall) {
623 switch (regs->ARM_r0) {
624 case -ERESTART_RESTARTBLOCK:
625 case -ERESTARTNOHAND:
626 regs->ARM_r0 = -EINTR;
627 break;
628 case -ERESTARTSYS:
629 if (!(ka->sa.sa_flags & SA_RESTART)) {
630 regs->ARM_r0 = -EINTR;
631 break;
632 }
633 /* fallthrough */
634 case -ERESTARTNOINTR:
635 setup_syscall_restart(regs);
636 }
637 }
638
639 /*
640 * translate the signal 614 * translate the signal
641 */ 615 */
642 if (usig < 32 && thread->exec_domain && thread->exec_domain->signal_invmap) 616 if (usig < 32 && thread->exec_domain && thread->exec_domain->signal_invmap)
@@ -685,6 +659,7 @@ handle_signal(unsigned long sig, struct k_sigaction *ka,
685 */ 659 */
686static void do_signal(struct pt_regs *regs, int syscall) 660static void do_signal(struct pt_regs *regs, int syscall)
687{ 661{
662 unsigned int retval = 0, continue_addr = 0, restart_addr = 0;
688 struct k_sigaction ka; 663 struct k_sigaction ka;
689 siginfo_t info; 664 siginfo_t info;
690 int signr; 665 int signr;
@@ -698,18 +673,61 @@ static void do_signal(struct pt_regs *regs, int syscall)
698 if (!user_mode(regs)) 673 if (!user_mode(regs))
699 return; 674 return;
700 675
676 /*
677 * If we were from a system call, check for system call restarting...
678 */
679 if (syscall) {
680 continue_addr = regs->ARM_pc;
681 restart_addr = continue_addr - (thumb_mode(regs) ? 2 : 4);
682 retval = regs->ARM_r0;
683
684 /*
685 * Prepare for system call restart. We do this here so that a
686 * debugger will see the already changed PSW.
687 */
688 switch (retval) {
689 case -ERESTARTNOHAND:
690 case -ERESTARTSYS:
691 case -ERESTARTNOINTR:
692 regs->ARM_r0 = regs->ARM_ORIG_r0;
693 regs->ARM_pc = restart_addr;
694 break;
695 case -ERESTART_RESTARTBLOCK:
696 regs->ARM_r0 = -EINTR;
697 break;
698 }
699 }
700
701 if (try_to_freeze()) 701 if (try_to_freeze())
702 goto no_signal; 702 goto no_signal;
703 703
704 /*
705 * Get the signal to deliver. When running under ptrace, at this
706 * point the debugger may change all our registers ...
707 */
704 signr = get_signal_to_deliver(&info, &ka, regs, NULL); 708 signr = get_signal_to_deliver(&info, &ka, regs, NULL);
705 if (signr > 0) { 709 if (signr > 0) {
706 sigset_t *oldset; 710 sigset_t *oldset;
707 711
712 /*
713 * Depending on the signal settings we may need to revert the
714 * decision to restart the system call. But skip this if a
715 * debugger has chosen to restart at a different PC.
716 */
717 if (regs->ARM_pc == restart_addr) {
718 if (retval == -ERESTARTNOHAND
719 || (retval == -ERESTARTSYS
720 && !(ka.sa.sa_flags & SA_RESTART))) {
721 regs->ARM_r0 = -EINTR;
722 regs->ARM_pc = continue_addr;
723 }
724 }
725
708 if (test_thread_flag(TIF_RESTORE_SIGMASK)) 726 if (test_thread_flag(TIF_RESTORE_SIGMASK))
709 oldset = &current->saved_sigmask; 727 oldset = &current->saved_sigmask;
710 else 728 else
711 oldset = &current->blocked; 729 oldset = &current->blocked;
712 if (handle_signal(signr, &ka, &info, oldset, regs, syscall) == 0) { 730 if (handle_signal(signr, &ka, &info, oldset, regs) == 0) {
713 /* 731 /*
714 * A signal was successfully delivered; the saved 732 * A signal was successfully delivered; the saved
715 * sigmask will have been stored in the signal frame, 733 * sigmask will have been stored in the signal frame,
@@ -723,11 +741,14 @@ static void do_signal(struct pt_regs *regs, int syscall)
723 } 741 }
724 742
725 no_signal: 743 no_signal:
726 /*
727 * No signal to deliver to the process - restart the syscall.
728 */
729 if (syscall) { 744 if (syscall) {
730 if (regs->ARM_r0 == -ERESTART_RESTARTBLOCK) { 745 /*
746 * Handle restarting a different system call. As above,
747 * if a debugger has chosen to restart at a different PC,
748 * ignore the restart.
749 */
750 if (retval == -ERESTART_RESTARTBLOCK
751 && regs->ARM_pc == continue_addr) {
731 if (thumb_mode(regs)) { 752 if (thumb_mode(regs)) {
732 regs->ARM_r7 = __NR_restart_syscall - __NR_SYSCALL_BASE; 753 regs->ARM_r7 = __NR_restart_syscall - __NR_SYSCALL_BASE;
733 regs->ARM_pc -= 2; 754 regs->ARM_pc -= 2;
@@ -750,11 +771,6 @@ static void do_signal(struct pt_regs *regs, int syscall)
750#endif 771#endif
751 } 772 }
752 } 773 }
753 if (regs->ARM_r0 == -ERESTARTNOHAND ||
754 regs->ARM_r0 == -ERESTARTSYS ||
755 regs->ARM_r0 == -ERESTARTNOINTR) {
756 setup_syscall_restart(regs);
757 }
758 774
759 /* If there's no signal to deliver, we just put the saved sigmask 775 /* If there's no signal to deliver, we just put the saved sigmask
760 * back. 776 * back.
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index f29b8a29b174..d439a8f4c078 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -376,6 +376,13 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
376 } 376 }
377} 377}
378 378
379static void (*smp_cross_call)(const struct cpumask *, unsigned int);
380
381void __init set_smp_cross_call(void (*fn)(const struct cpumask *, unsigned int))
382{
383 smp_cross_call = fn;
384}
385
379void arch_send_call_function_ipi_mask(const struct cpumask *mask) 386void arch_send_call_function_ipi_mask(const struct cpumask *mask)
380{ 387{
381 smp_cross_call(mask, IPI_CALL_FUNC); 388 smp_cross_call(mask, IPI_CALL_FUNC);
@@ -560,10 +567,7 @@ asmlinkage void __exception_irq_entry do_IPI(int ipinr, struct pt_regs *regs)
560 break; 567 break;
561 568
562 case IPI_RESCHEDULE: 569 case IPI_RESCHEDULE:
563 /* 570 scheduler_ipi();
564 * nothing more to do - eveything is
565 * done on the interrupt return path
566 */
567 break; 571 break;
568 572
569 case IPI_CALL_FUNC: 573 case IPI_CALL_FUNC:
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index 1ff46cabc7ef..cb634c3e28e9 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -21,7 +21,7 @@
21#include <linux/timex.h> 21#include <linux/timex.h>
22#include <linux/errno.h> 22#include <linux/errno.h>
23#include <linux/profile.h> 23#include <linux/profile.h>
24#include <linux/sysdev.h> 24#include <linux/syscore_ops.h>
25#include <linux/timer.h> 25#include <linux/timer.h>
26#include <linux/irq.h> 26#include <linux/irq.h>
27 27
@@ -115,48 +115,37 @@ void timer_tick(void)
115#endif 115#endif
116 116
117#if defined(CONFIG_PM) && !defined(CONFIG_GENERIC_CLOCKEVENTS) 117#if defined(CONFIG_PM) && !defined(CONFIG_GENERIC_CLOCKEVENTS)
118static int timer_suspend(struct sys_device *dev, pm_message_t state) 118static int timer_suspend(void)
119{ 119{
120 struct sys_timer *timer = container_of(dev, struct sys_timer, dev); 120 if (system_timer->suspend)
121 121 system_timer->suspend();
122 if (timer->suspend != NULL)
123 timer->suspend();
124 122
125 return 0; 123 return 0;
126} 124}
127 125
128static int timer_resume(struct sys_device *dev) 126static void timer_resume(void)
129{ 127{
130 struct sys_timer *timer = container_of(dev, struct sys_timer, dev); 128 if (system_timer->resume)
131 129 system_timer->resume();
132 if (timer->resume != NULL)
133 timer->resume();
134
135 return 0;
136} 130}
137#else 131#else
138#define timer_suspend NULL 132#define timer_suspend NULL
139#define timer_resume NULL 133#define timer_resume NULL
140#endif 134#endif
141 135
142static struct sysdev_class timer_sysclass = { 136static struct syscore_ops timer_syscore_ops = {
143 .name = "timer",
144 .suspend = timer_suspend, 137 .suspend = timer_suspend,
145 .resume = timer_resume, 138 .resume = timer_resume,
146}; 139};
147 140
148static int __init timer_init_sysfs(void) 141static int __init timer_init_syscore_ops(void)
149{ 142{
150 int ret = sysdev_class_register(&timer_sysclass); 143 register_syscore_ops(&timer_syscore_ops);
151 if (ret == 0) {
152 system_timer->dev.cls = &timer_sysclass;
153 ret = sysdev_register(&system_timer->dev);
154 }
155 144
156 return ret; 145 return 0;
157} 146}
158 147
159device_initcall(timer_init_sysfs); 148device_initcall(timer_init_syscore_ops);
160 149
161void __init time_init(void) 150void __init time_init(void)
162{ 151{
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 3b54ad19d489..d52eec268b47 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -234,7 +234,6 @@ static int __die(const char *str, int err, struct thread_info *thread, struct pt
234 234
235 printk(KERN_EMERG "Internal error: %s: %x [#%d]" S_PREEMPT S_SMP "\n", 235 printk(KERN_EMERG "Internal error: %s: %x [#%d]" S_PREEMPT S_SMP "\n",
236 str, err, ++die_counter); 236 str, err, ++die_counter);
237 sysfs_printk_last_file();
238 237
239 /* trap and error numbers are mostly meaningless on ARM */ 238 /* trap and error numbers are mostly meaningless on ARM */
240 ret = notify_die(DIE_OOPS, str, regs, err, tsk->thread.trap_no, SIGSEGV); 239 ret = notify_die(DIE_OOPS, str, regs, err, tsk->thread.trap_no, SIGSEGV);
diff --git a/arch/arm/mach-bcmring/arch.c b/arch/arm/mach-bcmring/arch.c
index 73eb066d2329..a604b9ebb501 100644
--- a/arch/arm/mach-bcmring/arch.c
+++ b/arch/arm/mach-bcmring/arch.c
@@ -169,6 +169,7 @@ MACHINE_START(BCMRING, "BCMRING")
169 /* Maintainer: Broadcom Corporation */ 169 /* Maintainer: Broadcom Corporation */
170 .fixup = bcmring_fixup, 170 .fixup = bcmring_fixup,
171 .map_io = bcmring_map_io, 171 .map_io = bcmring_map_io,
172 .init_early = bcmring_init_early,
172 .init_irq = bcmring_init_irq, 173 .init_irq = bcmring_init_irq,
173 .timer = &bcmring_timer, 174 .timer = &bcmring_timer,
174 .init_machine = bcmring_init_machine 175 .init_machine = bcmring_init_machine
diff --git a/arch/arm/mach-bcmring/core.c b/arch/arm/mach-bcmring/core.c
index 8fc2035759fb..43eadbcc29ed 100644
--- a/arch/arm/mach-bcmring/core.c
+++ b/arch/arm/mach-bcmring/core.c
@@ -28,8 +28,6 @@
28#include <linux/sysdev.h> 28#include <linux/sysdev.h>
29#include <linux/interrupt.h> 29#include <linux/interrupt.h>
30#include <linux/amba/bus.h> 30#include <linux/amba/bus.h>
31#include <linux/clocksource.h>
32#include <linux/clockchips.h>
33#include <linux/clkdev.h> 31#include <linux/clkdev.h>
34 32
35#include <mach/csp/mm_addr.h> 33#include <mach/csp/mm_addr.h>
@@ -37,6 +35,7 @@
37#include <linux/io.h> 35#include <linux/io.h>
38#include <asm/irq.h> 36#include <asm/irq.h>
39#include <asm/hardware/arm_timer.h> 37#include <asm/hardware/arm_timer.h>
38#include <asm/hardware/timer-sp.h>
40#include <asm/mach-types.h> 39#include <asm/mach-types.h>
41 40
42#include <asm/mach/arch.h> 41#include <asm/mach/arch.h>
@@ -97,6 +96,35 @@ static struct clk dummy_apb_pclk = {
97 .mode = CLK_MODE_XTAL, 96 .mode = CLK_MODE_XTAL,
98}; 97};
99 98
99/* Timer 0 - 25 MHz, Timer3 at bus clock rate, typically 150-166 MHz */
100#if defined(CONFIG_ARCH_FPGA11107)
101/* fpga cpu/bus are currently 30 times slower so scale frequency as well to */
102/* slow down Linux's sense of time */
103#define TIMER0_FREQUENCY_MHZ (tmrHw_LOW_FREQUENCY_MHZ * 30)
104#define TIMER1_FREQUENCY_MHZ (tmrHw_LOW_FREQUENCY_MHZ * 30)
105#define TIMER3_FREQUENCY_MHZ (tmrHw_HIGH_FREQUENCY_MHZ * 30)
106#define TIMER3_FREQUENCY_KHZ (tmrHw_HIGH_FREQUENCY_HZ / 1000 * 30)
107#else
108#define TIMER0_FREQUENCY_MHZ tmrHw_LOW_FREQUENCY_MHZ
109#define TIMER1_FREQUENCY_MHZ tmrHw_LOW_FREQUENCY_MHZ
110#define TIMER3_FREQUENCY_MHZ tmrHw_HIGH_FREQUENCY_MHZ
111#define TIMER3_FREQUENCY_KHZ (tmrHw_HIGH_FREQUENCY_HZ / 1000)
112#endif
113
114static struct clk sp804_timer012_clk = {
115 .name = "sp804-timer-0,1,2",
116 .type = CLK_TYPE_PRIMARY,
117 .mode = CLK_MODE_XTAL,
118 .rate_hz = TIMER1_FREQUENCY_MHZ * 1000000,
119};
120
121static struct clk sp804_timer3_clk = {
122 .name = "sp804-timer-3",
123 .type = CLK_TYPE_PRIMARY,
124 .mode = CLK_MODE_XTAL,
125 .rate_hz = TIMER3_FREQUENCY_KHZ * 1000,
126};
127
100static struct clk_lookup lookups[] = { 128static struct clk_lookup lookups[] = {
101 { /* Bus clock */ 129 { /* Bus clock */
102 .con_id = "apb_pclk", 130 .con_id = "apb_pclk",
@@ -107,6 +135,18 @@ static struct clk_lookup lookups[] = {
107 }, { /* UART1 */ 135 }, { /* UART1 */
108 .dev_id = "uartb", 136 .dev_id = "uartb",
109 .clk = &uart_clk, 137 .clk = &uart_clk,
138 }, { /* SP804 timer 0 */
139 .dev_id = "sp804",
140 .con_id = "timer0",
141 .clk = &sp804_timer012_clk,
142 }, { /* SP804 timer 1 */
143 .dev_id = "sp804",
144 .con_id = "timer1",
145 .clk = &sp804_timer012_clk,
146 }, { /* SP804 timer 3 */
147 .dev_id = "sp804",
148 .con_id = "timer3",
149 .clk = &sp804_timer3_clk,
110 } 150 }
111}; 151};
112 152
@@ -151,8 +191,6 @@ void __init bcmring_amba_init(void)
151 191
152 chipcHw_busInterfaceClockEnable(bus_clock); 192 chipcHw_busInterfaceClockEnable(bus_clock);
153 193
154 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
155
156 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 194 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
157 struct amba_device *d = amba_devs[i]; 195 struct amba_device *d = amba_devs[i];
158 amba_device_register(d, &iomem_resource); 196 amba_device_register(d, &iomem_resource);
@@ -162,170 +200,18 @@ void __init bcmring_amba_init(void)
162/* 200/*
163 * Where is the timer (VA)? 201 * Where is the timer (VA)?
164 */ 202 */
165#define TIMER0_VA_BASE MM_IO_BASE_TMR 203#define TIMER0_VA_BASE ((void __iomem *)MM_IO_BASE_TMR)
166#define TIMER1_VA_BASE (MM_IO_BASE_TMR + 0x20) 204#define TIMER1_VA_BASE ((void __iomem *)(MM_IO_BASE_TMR + 0x20))
167#define TIMER2_VA_BASE (MM_IO_BASE_TMR + 0x40) 205#define TIMER2_VA_BASE ((void __iomem *)(MM_IO_BASE_TMR + 0x40))
168#define TIMER3_VA_BASE (MM_IO_BASE_TMR + 0x60) 206#define TIMER3_VA_BASE ((void __iomem *)(MM_IO_BASE_TMR + 0x60))
169
170/* Timer 0 - 25 MHz, Timer3 at bus clock rate, typically 150-166 MHz */
171#if defined(CONFIG_ARCH_FPGA11107)
172/* fpga cpu/bus are currently 30 times slower so scale frequency as well to */
173/* slow down Linux's sense of time */
174#define TIMER0_FREQUENCY_MHZ (tmrHw_LOW_FREQUENCY_MHZ * 30)
175#define TIMER1_FREQUENCY_MHZ (tmrHw_LOW_FREQUENCY_MHZ * 30)
176#define TIMER3_FREQUENCY_MHZ (tmrHw_HIGH_FREQUENCY_MHZ * 30)
177#define TIMER3_FREQUENCY_KHZ (tmrHw_HIGH_FREQUENCY_HZ / 1000 * 30)
178#else
179#define TIMER0_FREQUENCY_MHZ tmrHw_LOW_FREQUENCY_MHZ
180#define TIMER1_FREQUENCY_MHZ tmrHw_LOW_FREQUENCY_MHZ
181#define TIMER3_FREQUENCY_MHZ tmrHw_HIGH_FREQUENCY_MHZ
182#define TIMER3_FREQUENCY_KHZ (tmrHw_HIGH_FREQUENCY_HZ / 1000)
183#endif
184
185#define TICKS_PER_uSEC TIMER0_FREQUENCY_MHZ
186
187/*
188 * These are useconds NOT ticks.
189 *
190 */
191#define mSEC_1 1000
192#define mSEC_5 (mSEC_1 * 5)
193#define mSEC_10 (mSEC_1 * 10)
194#define mSEC_25 (mSEC_1 * 25)
195#define SEC_1 (mSEC_1 * 1000)
196
197/*
198 * How long is the timer interval?
199 */
200#define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_10)
201#if TIMER_INTERVAL >= 0x100000
202#define TIMER_RELOAD (TIMER_INTERVAL >> 8)
203#define TIMER_DIVISOR (TIMER_CTRL_DIV256)
204#define TICKS2USECS(x) (256 * (x) / TICKS_PER_uSEC)
205#elif TIMER_INTERVAL >= 0x10000
206#define TIMER_RELOAD (TIMER_INTERVAL >> 4) /* Divide by 16 */
207#define TIMER_DIVISOR (TIMER_CTRL_DIV16)
208#define TICKS2USECS(x) (16 * (x) / TICKS_PER_uSEC)
209#else
210#define TIMER_RELOAD (TIMER_INTERVAL)
211#define TIMER_DIVISOR (TIMER_CTRL_DIV1)
212#define TICKS2USECS(x) ((x) / TICKS_PER_uSEC)
213#endif
214
215static void timer_set_mode(enum clock_event_mode mode,
216 struct clock_event_device *clk)
217{
218 unsigned long ctrl;
219
220 switch (mode) {
221 case CLOCK_EVT_MODE_PERIODIC:
222 writel(TIMER_RELOAD, TIMER0_VA_BASE + TIMER_LOAD);
223
224 ctrl = TIMER_CTRL_PERIODIC;
225 ctrl |=
226 TIMER_DIVISOR | TIMER_CTRL_32BIT | TIMER_CTRL_IE |
227 TIMER_CTRL_ENABLE;
228 break;
229 case CLOCK_EVT_MODE_ONESHOT:
230 /* period set, and timer enabled in 'next_event' hook */
231 ctrl = TIMER_CTRL_ONESHOT;
232 ctrl |= TIMER_DIVISOR | TIMER_CTRL_32BIT | TIMER_CTRL_IE;
233 break;
234 case CLOCK_EVT_MODE_UNUSED:
235 case CLOCK_EVT_MODE_SHUTDOWN:
236 default:
237 ctrl = 0;
238 }
239
240 writel(ctrl, TIMER0_VA_BASE + TIMER_CTRL);
241}
242
243static int timer_set_next_event(unsigned long evt,
244 struct clock_event_device *unused)
245{
246 unsigned long ctrl = readl(TIMER0_VA_BASE + TIMER_CTRL);
247
248 writel(evt, TIMER0_VA_BASE + TIMER_LOAD);
249 writel(ctrl | TIMER_CTRL_ENABLE, TIMER0_VA_BASE + TIMER_CTRL);
250
251 return 0;
252}
253
254static struct clock_event_device timer0_clockevent = {
255 .name = "timer0",
256 .shift = 32,
257 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
258 .set_mode = timer_set_mode,
259 .set_next_event = timer_set_next_event,
260};
261
262/*
263 * IRQ handler for the timer
264 */
265static irqreturn_t bcmring_timer_interrupt(int irq, void *dev_id)
266{
267 struct clock_event_device *evt = &timer0_clockevent;
268
269 writel(1, TIMER0_VA_BASE + TIMER_INTCLR);
270
271 evt->event_handler(evt);
272
273 return IRQ_HANDLED;
274}
275
276static struct irqaction bcmring_timer_irq = {
277 .name = "bcmring Timer Tick",
278 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
279 .handler = bcmring_timer_interrupt,
280};
281
282static cycle_t bcmring_get_cycles_timer1(struct clocksource *cs)
283{
284 return ~readl(TIMER1_VA_BASE + TIMER_VALUE);
285}
286
287static cycle_t bcmring_get_cycles_timer3(struct clocksource *cs)
288{
289 return ~readl(TIMER3_VA_BASE + TIMER_VALUE);
290}
291
292static struct clocksource clocksource_bcmring_timer1 = {
293 .name = "timer1",
294 .rating = 200,
295 .read = bcmring_get_cycles_timer1,
296 .mask = CLOCKSOURCE_MASK(32),
297 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
298};
299
300static struct clocksource clocksource_bcmring_timer3 = {
301 .name = "timer3",
302 .rating = 100,
303 .read = bcmring_get_cycles_timer3,
304 .mask = CLOCKSOURCE_MASK(32),
305 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
306};
307 207
308static int __init bcmring_clocksource_init(void) 208static int __init bcmring_clocksource_init(void)
309{ 209{
310 /* setup timer1 as free-running clocksource */ 210 /* setup timer1 as free-running clocksource */
311 writel(0, TIMER1_VA_BASE + TIMER_CTRL); 211 sp804_clocksource_init(TIMER1_VA_BASE, "timer1");
312 writel(0xffffffff, TIMER1_VA_BASE + TIMER_LOAD);
313 writel(0xffffffff, TIMER1_VA_BASE + TIMER_VALUE);
314 writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC,
315 TIMER1_VA_BASE + TIMER_CTRL);
316
317 clocksource_register_khz(&clocksource_bcmring_timer1,
318 TIMER1_FREQUENCY_MHZ * 1000);
319 212
320 /* setup timer3 as free-running clocksource */ 213 /* setup timer3 as free-running clocksource */
321 writel(0, TIMER3_VA_BASE + TIMER_CTRL); 214 sp804_clocksource_init(TIMER3_VA_BASE, "timer3");
322 writel(0xffffffff, TIMER3_VA_BASE + TIMER_LOAD);
323 writel(0xffffffff, TIMER3_VA_BASE + TIMER_VALUE);
324 writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC,
325 TIMER3_VA_BASE + TIMER_CTRL);
326
327 clocksource_register_khz(&clocksource_bcmring_timer3,
328 TIMER3_FREQUENCY_KHZ);
329 215
330 return 0; 216 return 0;
331} 217}
@@ -347,21 +233,16 @@ void __init bcmring_init_timer(void)
347 /* 233 /*
348 * Make irqs happen for the system timer 234 * Make irqs happen for the system timer
349 */ 235 */
350 setup_irq(IRQ_TIMER0, &bcmring_timer_irq);
351
352 bcmring_clocksource_init(); 236 bcmring_clocksource_init();
353 237
354 timer0_clockevent.mult = 238 sp804_clockevents_register(TIMER0_VA_BASE, IRQ_TIMER0, "timer0");
355 div_sc(1000000, NSEC_PER_SEC, timer0_clockevent.shift);
356 timer0_clockevent.max_delta_ns =
357 clockevent_delta2ns(0xffffffff, &timer0_clockevent);
358 timer0_clockevent.min_delta_ns =
359 clockevent_delta2ns(0xf, &timer0_clockevent);
360
361 timer0_clockevent.cpumask = cpumask_of(0);
362 clockevents_register_device(&timer0_clockevent);
363} 239}
364 240
365struct sys_timer bcmring_timer = { 241struct sys_timer bcmring_timer = {
366 .init = bcmring_init_timer, 242 .init = bcmring_init_timer,
367}; 243};
244
245void __init bcmring_init_early(void)
246{
247 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
248}
diff --git a/arch/arm/mach-bcmring/core.h b/arch/arm/mach-bcmring/core.h
index b197ba48e36e..e0e02c48f9b1 100644
--- a/arch/arm/mach-bcmring/core.h
+++ b/arch/arm/mach-bcmring/core.h
@@ -25,6 +25,7 @@
25void __init bcmring_amba_init(void); 25void __init bcmring_amba_init(void);
26void __init bcmring_map_io(void); 26void __init bcmring_map_io(void);
27void __init bcmring_init_irq(void); 27void __init bcmring_init_irq(void);
28void __init bcmring_init_early(void);
28 29
29extern struct sys_timer bcmring_timer; 30extern struct sys_timer bcmring_timer;
30#endif 31#endif
diff --git a/arch/arm/mach-davinci/cpufreq.c b/arch/arm/mach-davinci/cpufreq.c
index 0a95be1512bb..41669ecc1f91 100644
--- a/arch/arm/mach-davinci/cpufreq.c
+++ b/arch/arm/mach-davinci/cpufreq.c
@@ -94,9 +94,7 @@ static int davinci_target(struct cpufreq_policy *policy,
94 if (freqs.old == freqs.new) 94 if (freqs.old == freqs.new)
95 return ret; 95 return ret;
96 96
97 cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, 97 dev_dbg(&cpufreq.dev, "transition: %u --> %u\n", freqs.old, freqs.new);
98 dev_driver_string(cpufreq.dev),
99 "transition: %u --> %u\n", freqs.old, freqs.new);
100 98
101 ret = cpufreq_frequency_table_target(policy, pdata->freq_table, 99 ret = cpufreq_frequency_table_target(policy, pdata->freq_table,
102 freqs.new, relation, &idx); 100 freqs.new, relation, &idx);
diff --git a/arch/arm/mach-davinci/include/mach/memory.h b/arch/arm/mach-davinci/include/mach/memory.h
index 78822723f382..491249ef209c 100644
--- a/arch/arm/mach-davinci/include/mach/memory.h
+++ b/arch/arm/mach-davinci/include/mach/memory.h
@@ -41,27 +41,11 @@
41 */ 41 */
42#define CONSISTENT_DMA_SIZE (14<<20) 42#define CONSISTENT_DMA_SIZE (14<<20)
43 43
44#ifndef __ASSEMBLY__
45/* 44/*
46 * Restrict DMA-able region to workaround silicon bug. The bug 45 * Restrict DMA-able region to workaround silicon bug. The bug
47 * restricts buffers available for DMA to video hardware to be 46 * restricts buffers available for DMA to video hardware to be
48 * below 128M 47 * below 128M
49 */ 48 */
50static inline void 49#define ARM_DMA_ZONE_SIZE SZ_128M
51__arch_adjust_zones(unsigned long *size, unsigned long *holes)
52{
53 unsigned int sz = (128<<20) >> PAGE_SHIFT;
54
55 size[1] = size[0] - sz;
56 size[0] = sz;
57}
58
59#define arch_adjust_zones(zone_size, holes) \
60 if ((meminfo.bank[0].size >> 20) > 128) __arch_adjust_zones(zone_size, holes)
61
62#define ISA_DMA_THRESHOLD (PHYS_OFFSET + (128<<20) - 1)
63#define MAX_DMA_ADDRESS (PAGE_OFFSET + (128<<20))
64
65#endif
66 50
67#endif /* __ASM_ARCH_MEMORY_H */ 51#endif /* __ASM_ARCH_MEMORY_H */
diff --git a/arch/arm/mach-ep93xx/gpio.c b/arch/arm/mach-ep93xx/gpio.c
index a5a9ff70b198..415dce37b88c 100644
--- a/arch/arm/mach-ep93xx/gpio.c
+++ b/arch/arm/mach-ep93xx/gpio.c
@@ -356,29 +356,6 @@ static int ep93xx_gpio_set_debounce(struct gpio_chip *chip,
356 return 0; 356 return 0;
357} 357}
358 358
359static void ep93xx_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
360{
361 struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip);
362 u8 data_reg, data_dir_reg;
363 int gpio, i;
364
365 data_reg = __raw_readb(ep93xx_chip->data_reg);
366 data_dir_reg = __raw_readb(ep93xx_chip->data_dir_reg);
367
368 gpio = ep93xx_chip->chip.base;
369 for (i = 0; i < chip->ngpio; i++, gpio++) {
370 int is_out = data_dir_reg & (1 << i);
371 int irq = gpio_to_irq(gpio);
372
373 seq_printf(s, " %s%d gpio-%-3d (%-12s) %s %s %s\n",
374 chip->label, i, gpio,
375 gpiochip_is_requested(chip, i) ? : "",
376 is_out ? "out" : "in ",
377 (data_reg & (1<< i)) ? "hi" : "lo",
378 (!is_out && irq>= 0) ? "(interrupt)" : "");
379 }
380}
381
382#define EP93XX_GPIO_BANK(name, dr, ddr, base_gpio) \ 359#define EP93XX_GPIO_BANK(name, dr, ddr, base_gpio) \
383 { \ 360 { \
384 .chip = { \ 361 .chip = { \
@@ -387,7 +364,6 @@ static void ep93xx_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
387 .direction_output = ep93xx_gpio_direction_output, \ 364 .direction_output = ep93xx_gpio_direction_output, \
388 .get = ep93xx_gpio_get, \ 365 .get = ep93xx_gpio_get, \
389 .set = ep93xx_gpio_set, \ 366 .set = ep93xx_gpio_set, \
390 .dbg_show = ep93xx_gpio_dbg_show, \
391 .base = base_gpio, \ 367 .base = base_gpio, \
392 .ngpio = 8, \ 368 .ngpio = 8, \
393 }, \ 369 }, \
diff --git a/arch/arm/mach-exynos4/include/mach/smp.h b/arch/arm/mach-exynos4/include/mach/smp.h
deleted file mode 100644
index a463dcebcfd3..000000000000
--- a/arch/arm/mach-exynos4/include/mach/smp.h
+++ /dev/null
@@ -1,19 +0,0 @@
1/* linux/arch/arm/mach-exynos4/include/mach/smp.h
2 *
3 * Cloned from arch/arm/mach-realview/include/mach/smp.h
4*/
5
6#ifndef ASM_ARCH_SMP_H
7#define ASM_ARCH_SMP_H __FILE__
8
9#include <asm/hardware/gic.h>
10
11/*
12 * We use IRQ1 as the IPI
13 */
14static inline void smp_cross_call(const struct cpumask *mask, int ipi)
15{
16 gic_raise_softirq(mask, ipi);
17}
18
19#endif
diff --git a/arch/arm/mach-exynos4/platsmp.c b/arch/arm/mach-exynos4/platsmp.c
index 6d35878ec1aa..c5e65a02be8d 100644
--- a/arch/arm/mach-exynos4/platsmp.c
+++ b/arch/arm/mach-exynos4/platsmp.c
@@ -22,6 +22,7 @@
22#include <linux/io.h> 22#include <linux/io.h>
23 23
24#include <asm/cacheflush.h> 24#include <asm/cacheflush.h>
25#include <asm/hardware/gic.h>
25#include <asm/smp_scu.h> 26#include <asm/smp_scu.h>
26#include <asm/unified.h> 27#include <asm/unified.h>
27 28
@@ -104,7 +105,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
104 * the boot monitor to read the system wide flags register, 105 * the boot monitor to read the system wide flags register,
105 * and branch to the address found there. 106 * and branch to the address found there.
106 */ 107 */
107 smp_cross_call(cpumask_of(cpu), 1); 108 gic_raise_softirq(cpumask_of(cpu), 1);
108 109
109 timeout = jiffies + (1 * HZ); 110 timeout = jiffies + (1 * HZ);
110 while (time_before(jiffies, timeout)) { 111 while (time_before(jiffies, timeout)) {
@@ -147,6 +148,8 @@ void __init smp_init_cpus(void)
147 148
148 for (i = 0; i < ncores; i++) 149 for (i = 0; i < ncores; i++)
149 set_cpu_possible(i, true); 150 set_cpu_possible(i, true);
151
152 set_smp_cross_call(gic_raise_softirq);
150} 153}
151 154
152void __init platform_smp_prepare_cpus(unsigned int max_cpus) 155void __init platform_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-exynos4/pm.c b/arch/arm/mach-exynos4/pm.c
index 10d917d9e3ad..8755ca8dd48d 100644
--- a/arch/arm/mach-exynos4/pm.c
+++ b/arch/arm/mach-exynos4/pm.c
@@ -16,6 +16,7 @@
16 16
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/suspend.h> 18#include <linux/suspend.h>
19#include <linux/syscore_ops.h>
19#include <linux/io.h> 20#include <linux/io.h>
20 21
21#include <asm/cacheflush.h> 22#include <asm/cacheflush.h>
@@ -372,7 +373,27 @@ void exynos4_scu_enable(void __iomem *scu_base)
372 flush_cache_all(); 373 flush_cache_all();
373} 374}
374 375
375static int exynos4_pm_resume(struct sys_device *dev) 376static struct sysdev_driver exynos4_pm_driver = {
377 .add = exynos4_pm_add,
378};
379
380static __init int exynos4_pm_drvinit(void)
381{
382 unsigned int tmp;
383
384 s3c_pm_init();
385
386 /* All wakeup disable */
387
388 tmp = __raw_readl(S5P_WAKEUP_MASK);
389 tmp |= ((0xFF << 8) | (0x1F << 1));
390 __raw_writel(tmp, S5P_WAKEUP_MASK);
391
392 return sysdev_driver_register(&exynos4_sysclass, &exynos4_pm_driver);
393}
394arch_initcall(exynos4_pm_drvinit);
395
396static void exynos4_pm_resume(void)
376{ 397{
377 /* For release retention */ 398 /* For release retention */
378 399
@@ -394,27 +415,15 @@ static int exynos4_pm_resume(struct sys_device *dev)
394 /* enable L2X0*/ 415 /* enable L2X0*/
395 writel_relaxed(1, S5P_VA_L2CC + L2X0_CTRL); 416 writel_relaxed(1, S5P_VA_L2CC + L2X0_CTRL);
396#endif 417#endif
397
398 return 0;
399} 418}
400 419
401static struct sysdev_driver exynos4_pm_driver = { 420static struct syscore_ops exynos4_pm_syscore_ops = {
402 .add = exynos4_pm_add,
403 .resume = exynos4_pm_resume, 421 .resume = exynos4_pm_resume,
404}; 422};
405 423
406static __init int exynos4_pm_drvinit(void) 424static __init int exynos4_pm_syscore_init(void)
407{ 425{
408 unsigned int tmp; 426 register_syscore_ops(&exynos4_pm_syscore_ops);
409 427 return 0;
410 s3c_pm_init();
411
412 /* All wakeup disable */
413
414 tmp = __raw_readl(S5P_WAKEUP_MASK);
415 tmp |= ((0xFF << 8) | (0x1F << 1));
416 __raw_writel(tmp, S5P_WAKEUP_MASK);
417
418 return sysdev_driver_register(&exynos4_sysclass, &exynos4_pm_driver);
419} 428}
420arch_initcall(exynos4_pm_drvinit); 429arch_initcall(exynos4_pm_syscore_init);
diff --git a/arch/arm/mach-footbridge/Kconfig b/arch/arm/mach-footbridge/Kconfig
index bdd257921cfb..46adca068f2c 100644
--- a/arch/arm/mach-footbridge/Kconfig
+++ b/arch/arm/mach-footbridge/Kconfig
@@ -4,6 +4,7 @@ menu "Footbridge Implementations"
4 4
5config ARCH_CATS 5config ARCH_CATS
6 bool "CATS" 6 bool "CATS"
7 select CLKSRC_I8253
7 select FOOTBRIDGE_HOST 8 select FOOTBRIDGE_HOST
8 select ISA 9 select ISA
9 select ISA_DMA 10 select ISA_DMA
@@ -59,6 +60,7 @@ config ARCH_EBSA285_HOST
59 60
60config ARCH_NETWINDER 61config ARCH_NETWINDER
61 bool "NetWinder" 62 bool "NetWinder"
63 select CLKSRC_I8253
62 select FOOTBRIDGE_HOST 64 select FOOTBRIDGE_HOST
63 select ISA 65 select ISA
64 select ISA_DMA 66 select ISA_DMA
diff --git a/arch/arm/mach-footbridge/isa-timer.c b/arch/arm/mach-footbridge/isa-timer.c
index 441c6ce0d555..7020f1a3feca 100644
--- a/arch/arm/mach-footbridge/isa-timer.c
+++ b/arch/arm/mach-footbridge/isa-timer.c
@@ -10,53 +10,16 @@
10#include <linux/interrupt.h> 10#include <linux/interrupt.h>
11#include <linux/irq.h> 11#include <linux/irq.h>
12#include <linux/io.h> 12#include <linux/io.h>
13#include <linux/spinlock.h>
13#include <linux/timex.h> 14#include <linux/timex.h>
14 15
15#include <asm/irq.h> 16#include <asm/irq.h>
16 17#include <asm/i8253.h>
17#include <asm/mach/time.h> 18#include <asm/mach/time.h>
18 19
19#include "common.h" 20#include "common.h"
20 21
21#define PIT_MODE 0x43 22DEFINE_RAW_SPINLOCK(i8253_lock);
22#define PIT_CH0 0x40
23
24#define PIT_LATCH ((PIT_TICK_RATE + HZ / 2) / HZ)
25
26static cycle_t pit_read(struct clocksource *cs)
27{
28 unsigned long flags;
29 static int old_count;
30 static u32 old_jifs;
31 int count;
32 u32 jifs;
33
34 raw_local_irq_save(flags);
35
36 jifs = jiffies;
37 outb_p(0x00, PIT_MODE); /* latch the count */
38 count = inb_p(PIT_CH0); /* read the latched count */
39 count |= inb_p(PIT_CH0) << 8;
40
41 if (count > old_count && jifs == old_jifs)
42 count = old_count;
43
44 old_count = count;
45 old_jifs = jifs;
46
47 raw_local_irq_restore(flags);
48
49 count = (PIT_LATCH - 1) - count;
50
51 return (cycle_t)(jifs * PIT_LATCH) + count;
52}
53
54static struct clocksource pit_cs = {
55 .name = "pit",
56 .rating = 110,
57 .read = pit_read,
58 .mask = CLOCKSOURCE_MASK(32),
59};
60 23
61static void pit_set_mode(enum clock_event_mode mode, 24static void pit_set_mode(enum clock_event_mode mode,
62 struct clock_event_device *evt) 25 struct clock_event_device *evt)
@@ -121,7 +84,7 @@ static void __init isa_timer_init(void)
121 pit_ce.max_delta_ns = clockevent_delta2ns(0x7fff, &pit_ce); 84 pit_ce.max_delta_ns = clockevent_delta2ns(0x7fff, &pit_ce);
122 pit_ce.min_delta_ns = clockevent_delta2ns(0x000f, &pit_ce); 85 pit_ce.min_delta_ns = clockevent_delta2ns(0x000f, &pit_ce);
123 86
124 clocksource_register_hz(&pit_cs, PIT_TICK_RATE); 87 clocksource_i8253_init();
125 88
126 setup_irq(pit_ce.irq, &pit_timer_irq); 89 setup_irq(pit_ce.irq, &pit_timer_irq);
127 clockevents_register_device(&pit_ce); 90 clockevents_register_device(&pit_ce);
diff --git a/arch/arm/mach-h720x/include/mach/memory.h b/arch/arm/mach-h720x/include/mach/memory.h
index 9d3687651462..b0b3baec9acf 100644
--- a/arch/arm/mach-h720x/include/mach/memory.h
+++ b/arch/arm/mach-h720x/include/mach/memory.h
@@ -13,7 +13,6 @@
13 * There should not be more than (0xd0000000 - 0xc0000000) 13 * There should not be more than (0xd0000000 - 0xc0000000)
14 * bytes of RAM. 14 * bytes of RAM.
15 */ 15 */
16#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_256M - 1) 16#define ARM_DMA_ZONE_SIZE SZ_256M
17#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_256M)
18 17
19#endif 18#endif
diff --git a/arch/arm/mach-integrator/Kconfig b/arch/arm/mach-integrator/Kconfig
index d701d32a07f1..dfd18f3b50e8 100644
--- a/arch/arm/mach-integrator/Kconfig
+++ b/arch/arm/mach-integrator/Kconfig
@@ -4,6 +4,7 @@ menu "Integrator Options"
4 4
5config ARCH_INTEGRATOR_AP 5config ARCH_INTEGRATOR_AP
6 bool "Support Integrator/AP and Integrator/PP2 platforms" 6 bool "Support Integrator/AP and Integrator/PP2 platforms"
7 select CLKSRC_MMIO
7 select MIGHT_HAVE_PCI 8 select MIGHT_HAVE_PCI
8 help 9 help
9 Include support for the ARM(R) Integrator/AP and 10 Include support for the ARM(R) Integrator/AP and
diff --git a/arch/arm/mach-integrator/integrator_ap.c b/arch/arm/mach-integrator/integrator_ap.c
index 980803ff348c..2fbbdd5eac35 100644
--- a/arch/arm/mach-integrator/integrator_ap.c
+++ b/arch/arm/mach-integrator/integrator_ap.c
@@ -24,13 +24,14 @@
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/string.h> 26#include <linux/string.h>
27#include <linux/sysdev.h> 27#include <linux/syscore_ops.h>
28#include <linux/amba/bus.h> 28#include <linux/amba/bus.h>
29#include <linux/amba/kmi.h> 29#include <linux/amba/kmi.h>
30#include <linux/clocksource.h> 30#include <linux/clocksource.h>
31#include <linux/clockchips.h> 31#include <linux/clockchips.h>
32#include <linux/interrupt.h> 32#include <linux/interrupt.h>
33#include <linux/io.h> 33#include <linux/io.h>
34#include <linux/mtd/physmap.h>
34 35
35#include <mach/hardware.h> 36#include <mach/hardware.h>
36#include <mach/platform.h> 37#include <mach/platform.h>
@@ -43,7 +44,6 @@
43#include <mach/lm.h> 44#include <mach/lm.h>
44 45
45#include <asm/mach/arch.h> 46#include <asm/mach/arch.h>
46#include <asm/mach/flash.h>
47#include <asm/mach/irq.h> 47#include <asm/mach/irq.h>
48#include <asm/mach/map.h> 48#include <asm/mach/map.h>
49#include <asm/mach/time.h> 49#include <asm/mach/time.h>
@@ -180,13 +180,13 @@ static void __init ap_init_irq(void)
180#ifdef CONFIG_PM 180#ifdef CONFIG_PM
181static unsigned long ic_irq_enable; 181static unsigned long ic_irq_enable;
182 182
183static int irq_suspend(struct sys_device *dev, pm_message_t state) 183static int irq_suspend(void)
184{ 184{
185 ic_irq_enable = readl(VA_IC_BASE + IRQ_ENABLE); 185 ic_irq_enable = readl(VA_IC_BASE + IRQ_ENABLE);
186 return 0; 186 return 0;
187} 187}
188 188
189static int irq_resume(struct sys_device *dev) 189static void irq_resume(void)
190{ 190{
191 /* disable all irq sources */ 191 /* disable all irq sources */
192 writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR); 192 writel(-1, VA_CMIC_BASE + IRQ_ENABLE_CLEAR);
@@ -194,33 +194,25 @@ static int irq_resume(struct sys_device *dev)
194 writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR); 194 writel(-1, VA_IC_BASE + FIQ_ENABLE_CLEAR);
195 195
196 writel(ic_irq_enable, VA_IC_BASE + IRQ_ENABLE_SET); 196 writel(ic_irq_enable, VA_IC_BASE + IRQ_ENABLE_SET);
197 return 0;
198} 197}
199#else 198#else
200#define irq_suspend NULL 199#define irq_suspend NULL
201#define irq_resume NULL 200#define irq_resume NULL
202#endif 201#endif
203 202
204static struct sysdev_class irq_class = { 203static struct syscore_ops irq_syscore_ops = {
205 .name = "irq",
206 .suspend = irq_suspend, 204 .suspend = irq_suspend,
207 .resume = irq_resume, 205 .resume = irq_resume,
208}; 206};
209 207
210static struct sys_device irq_device = { 208static int __init irq_syscore_init(void)
211 .id = 0,
212 .cls = &irq_class,
213};
214
215static int __init irq_init_sysfs(void)
216{ 209{
217 int ret = sysdev_class_register(&irq_class); 210 register_syscore_ops(&irq_syscore_ops);
218 if (ret == 0) 211
219 ret = sysdev_register(&irq_device); 212 return 0;
220 return ret;
221} 213}
222 214
223device_initcall(irq_init_sysfs); 215device_initcall(irq_syscore_init);
224 216
225/* 217/*
226 * Flash handling. 218 * Flash handling.
@@ -230,7 +222,7 @@ device_initcall(irq_init_sysfs);
230#define EBI_CSR1 (VA_EBI_BASE + INTEGRATOR_EBI_CSR1_OFFSET) 222#define EBI_CSR1 (VA_EBI_BASE + INTEGRATOR_EBI_CSR1_OFFSET)
231#define EBI_LOCK (VA_EBI_BASE + INTEGRATOR_EBI_LOCK_OFFSET) 223#define EBI_LOCK (VA_EBI_BASE + INTEGRATOR_EBI_LOCK_OFFSET)
232 224
233static int ap_flash_init(void) 225static int ap_flash_init(struct platform_device *dev)
234{ 226{
235 u32 tmp; 227 u32 tmp;
236 228
@@ -247,7 +239,7 @@ static int ap_flash_init(void)
247 return 0; 239 return 0;
248} 240}
249 241
250static void ap_flash_exit(void) 242static void ap_flash_exit(struct platform_device *dev)
251{ 243{
252 u32 tmp; 244 u32 tmp;
253 245
@@ -263,15 +255,14 @@ static void ap_flash_exit(void)
263 } 255 }
264} 256}
265 257
266static void ap_flash_set_vpp(int on) 258static void ap_flash_set_vpp(struct platform_device *pdev, int on)
267{ 259{
268 void __iomem *reg = on ? SC_CTRLS : SC_CTRLC; 260 void __iomem *reg = on ? SC_CTRLS : SC_CTRLC;
269 261
270 writel(INTEGRATOR_SC_CTRL_nFLVPPEN, reg); 262 writel(INTEGRATOR_SC_CTRL_nFLVPPEN, reg);
271} 263}
272 264
273static struct flash_platform_data ap_flash_data = { 265static struct physmap_flash_data ap_flash_data = {
274 .map_name = "cfi_probe",
275 .width = 4, 266 .width = 4,
276 .init = ap_flash_init, 267 .init = ap_flash_init,
277 .exit = ap_flash_exit, 268 .exit = ap_flash_exit,
@@ -285,7 +276,7 @@ static struct resource cfi_flash_resource = {
285}; 276};
286 277
287static struct platform_device cfi_flash_device = { 278static struct platform_device cfi_flash_device = {
288 .name = "armflash", 279 .name = "physmap-flash",
289 .id = 0, 280 .id = 0,
290 .dev = { 281 .dev = {
291 .platform_data = &ap_flash_data, 282 .platform_data = &ap_flash_data,
@@ -343,25 +334,9 @@ static void __init ap_init(void)
343 334
344static unsigned long timer_reload; 335static unsigned long timer_reload;
345 336
346static void __iomem * const clksrc_base = (void __iomem *)TIMER2_VA_BASE;
347
348static cycle_t timersp_read(struct clocksource *cs)
349{
350 return ~(readl(clksrc_base + TIMER_VALUE) & 0xffff);
351}
352
353static struct clocksource clocksource_timersp = {
354 .name = "timer2",
355 .rating = 200,
356 .read = timersp_read,
357 .mask = CLOCKSOURCE_MASK(16),
358 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
359};
360
361static void integrator_clocksource_init(u32 khz) 337static void integrator_clocksource_init(u32 khz)
362{ 338{
363 struct clocksource *cs = &clocksource_timersp; 339 void __iomem *base = (void __iomem *)TIMER2_VA_BASE;
364 void __iomem *base = clksrc_base;
365 u32 ctrl = TIMER_CTRL_ENABLE; 340 u32 ctrl = TIMER_CTRL_ENABLE;
366 341
367 if (khz >= 1500) { 342 if (khz >= 1500) {
@@ -372,7 +347,8 @@ static void integrator_clocksource_init(u32 khz)
372 writel(ctrl, base + TIMER_CTRL); 347 writel(ctrl, base + TIMER_CTRL);
373 writel(0xffff, base + TIMER_LOAD); 348 writel(0xffff, base + TIMER_LOAD);
374 349
375 clocksource_register_khz(cs, khz); 350 clocksource_mmio_init(base + TIMER_VALUE, "timer2",
351 khz * 1000, 200, 16, clocksource_mmio_readl_down);
376} 352}
377 353
378static void __iomem * const clkevt_base = (void __iomem *)TIMER1_VA_BASE; 354static void __iomem * const clkevt_base = (void __iomem *)TIMER1_VA_BASE;
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c
index 9e3ce26023e8..4eb03ab5cb46 100644
--- a/arch/arm/mach-integrator/integrator_cp.c
+++ b/arch/arm/mach-integrator/integrator_cp.c
@@ -22,6 +22,7 @@
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/gfp.h> 23#include <linux/gfp.h>
24#include <linux/clkdev.h> 24#include <linux/clkdev.h>
25#include <linux/mtd/physmap.h>
25 26
26#include <mach/hardware.h> 27#include <mach/hardware.h>
27#include <mach/platform.h> 28#include <mach/platform.h>
@@ -35,7 +36,6 @@
35#include <mach/lm.h> 36#include <mach/lm.h>
36 37
37#include <asm/mach/arch.h> 38#include <asm/mach/arch.h>
38#include <asm/mach/flash.h>
39#include <asm/mach/irq.h> 39#include <asm/mach/irq.h>
40#include <asm/mach/map.h> 40#include <asm/mach/map.h>
41#include <asm/mach/time.h> 41#include <asm/mach/time.h>
@@ -229,17 +229,24 @@ static struct clk cp_auxclk = {
229 .vcoreg = CM_AUXOSC, 229 .vcoreg = CM_AUXOSC,
230}; 230};
231 231
232static struct clk sp804_clk = {
233 .rate = 1000000,
234};
235
232static struct clk_lookup cp_lookups[] = { 236static struct clk_lookup cp_lookups[] = {
233 { /* CLCD */ 237 { /* CLCD */
234 .dev_id = "mb:c0", 238 .dev_id = "mb:c0",
235 .clk = &cp_auxclk, 239 .clk = &cp_auxclk,
240 }, { /* SP804 timers */
241 .dev_id = "sp804",
242 .clk = &sp804_clk,
236 }, 243 },
237}; 244};
238 245
239/* 246/*
240 * Flash handling. 247 * Flash handling.
241 */ 248 */
242static int intcp_flash_init(void) 249static int intcp_flash_init(struct platform_device *dev)
243{ 250{
244 u32 val; 251 u32 val;
245 252
@@ -250,7 +257,7 @@ static int intcp_flash_init(void)
250 return 0; 257 return 0;
251} 258}
252 259
253static void intcp_flash_exit(void) 260static void intcp_flash_exit(struct platform_device *dev)
254{ 261{
255 u32 val; 262 u32 val;
256 263
@@ -259,7 +266,7 @@ static void intcp_flash_exit(void)
259 writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG); 266 writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG);
260} 267}
261 268
262static void intcp_flash_set_vpp(int on) 269static void intcp_flash_set_vpp(struct platform_device *pdev, int on)
263{ 270{
264 u32 val; 271 u32 val;
265 272
@@ -271,8 +278,7 @@ static void intcp_flash_set_vpp(int on)
271 writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG); 278 writel(val, INTCP_VA_CTRL_BASE + INTCP_FLASHPROG);
272} 279}
273 280
274static struct flash_platform_data intcp_flash_data = { 281static struct physmap_flash_data intcp_flash_data = {
275 .map_name = "cfi_probe",
276 .width = 4, 282 .width = 4,
277 .init = intcp_flash_init, 283 .init = intcp_flash_init,
278 .exit = intcp_flash_exit, 284 .exit = intcp_flash_exit,
@@ -286,7 +292,7 @@ static struct resource intcp_flash_resource = {
286}; 292};
287 293
288static struct platform_device intcp_flash_device = { 294static struct platform_device intcp_flash_device = {
289 .name = "armflash", 295 .name = "physmap-flash",
290 .id = 0, 296 .id = 0,
291 .dev = { 297 .dev = {
292 .platform_data = &intcp_flash_data, 298 .platform_data = &intcp_flash_data,
@@ -476,8 +482,8 @@ static void __init intcp_timer_init(void)
476 writel(0, TIMER1_VA_BASE + TIMER_CTRL); 482 writel(0, TIMER1_VA_BASE + TIMER_CTRL);
477 writel(0, TIMER2_VA_BASE + TIMER_CTRL); 483 writel(0, TIMER2_VA_BASE + TIMER_CTRL);
478 484
479 sp804_clocksource_init(TIMER2_VA_BASE); 485 sp804_clocksource_init(TIMER2_VA_BASE, "timer2");
480 sp804_clockevents_init(TIMER1_VA_BASE, IRQ_TIMERINT1); 486 sp804_clockevents_init(TIMER1_VA_BASE, IRQ_TIMERINT1, "timer1");
481} 487}
482 488
483static struct sys_timer cp_timer = { 489static struct sys_timer cp_timer = {
diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c
index a54b3db80366..e9a589395723 100644
--- a/arch/arm/mach-ixp4xx/common-pci.c
+++ b/arch/arm/mach-ixp4xx/common-pci.c
@@ -342,29 +342,6 @@ int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
342 return (dev->bus == &pci_bus_type ) && ((dma_addr + size) >= SZ_64M); 342 return (dev->bus == &pci_bus_type ) && ((dma_addr + size) >= SZ_64M);
343} 343}
344 344
345/*
346 * Only first 64MB of memory can be accessed via PCI.
347 * We use GFP_DMA to allocate safe buffers to do map/unmap.
348 * This is really ugly and we need a better way of specifying
349 * DMA-capable regions of memory.
350 */
351void __init ixp4xx_adjust_zones(unsigned long *zone_size,
352 unsigned long *zhole_size)
353{
354 unsigned int sz = SZ_64M >> PAGE_SHIFT;
355
356 /*
357 * Only adjust if > 64M on current system
358 */
359 if (zone_size[0] <= sz)
360 return;
361
362 zone_size[1] = zone_size[0] - sz;
363 zone_size[0] = sz;
364 zhole_size[1] = zhole_size[0];
365 zhole_size[0] = 0;
366}
367
368void __init ixp4xx_pci_preinit(void) 345void __init ixp4xx_pci_preinit(void)
369{ 346{
370 unsigned long cpuid = read_cpuid_id(); 347 unsigned long cpuid = read_cpuid_id();
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index ed19bc314318..74ed81a3cb1a 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -419,26 +419,14 @@ static void notrace ixp4xx_update_sched_clock(void)
419/* 419/*
420 * clocksource 420 * clocksource
421 */ 421 */
422static cycle_t ixp4xx_get_cycles(struct clocksource *cs)
423{
424 return *IXP4XX_OSTS;
425}
426
427static struct clocksource clocksource_ixp4xx = {
428 .name = "OSTS",
429 .rating = 200,
430 .read = ixp4xx_get_cycles,
431 .mask = CLOCKSOURCE_MASK(32),
432 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
433};
434
435unsigned long ixp4xx_timer_freq = IXP4XX_TIMER_FREQ; 422unsigned long ixp4xx_timer_freq = IXP4XX_TIMER_FREQ;
436EXPORT_SYMBOL(ixp4xx_timer_freq); 423EXPORT_SYMBOL(ixp4xx_timer_freq);
437static void __init ixp4xx_clocksource_init(void) 424static void __init ixp4xx_clocksource_init(void)
438{ 425{
439 init_sched_clock(&cd, ixp4xx_update_sched_clock, 32, ixp4xx_timer_freq); 426 init_sched_clock(&cd, ixp4xx_update_sched_clock, 32, ixp4xx_timer_freq);
440 427
441 clocksource_register_hz(&clocksource_ixp4xx, ixp4xx_timer_freq); 428 clocksource_mmio_init(&IXP4XX_OSTS, "OSTS", ixp4xx_timer_freq, 200, 32,
429 clocksource_mmio_readl_up);
442} 430}
443 431
444/* 432/*
diff --git a/arch/arm/mach-ixp4xx/include/mach/memory.h b/arch/arm/mach-ixp4xx/include/mach/memory.h
index 6d388c9d0e20..34e79404671a 100644
--- a/arch/arm/mach-ixp4xx/include/mach/memory.h
+++ b/arch/arm/mach-ixp4xx/include/mach/memory.h
@@ -14,16 +14,8 @@
14 */ 14 */
15#define PLAT_PHYS_OFFSET UL(0x00000000) 15#define PLAT_PHYS_OFFSET UL(0x00000000)
16 16
17#if !defined(__ASSEMBLY__) && defined(CONFIG_PCI) 17#ifdef CONFIG_PCI
18 18#define ARM_DMA_ZONE_SIZE SZ_64M
19void ixp4xx_adjust_zones(unsigned long *size, unsigned long *holes);
20
21#define arch_adjust_zones(size, holes) \
22 ixp4xx_adjust_zones(size, holes)
23
24#define ISA_DMA_THRESHOLD (SZ_64M - 1)
25#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_64M)
26
27#endif 19#endif
28 20
29#endif 21#endif
diff --git a/arch/arm/mach-lpc32xx/timer.c b/arch/arm/mach-lpc32xx/timer.c
index 6162ac308c20..b42c909bbeeb 100644
--- a/arch/arm/mach-lpc32xx/timer.c
+++ b/arch/arm/mach-lpc32xx/timer.c
@@ -31,19 +31,6 @@
31#include <mach/platform.h> 31#include <mach/platform.h>
32#include "common.h" 32#include "common.h"
33 33
34static cycle_t lpc32xx_clksrc_read(struct clocksource *cs)
35{
36 return (cycle_t)__raw_readl(LCP32XX_TIMER_TC(LPC32XX_TIMER1_BASE));
37}
38
39static struct clocksource lpc32xx_clksrc = {
40 .name = "lpc32xx_clksrc",
41 .rating = 300,
42 .read = lpc32xx_clksrc_read,
43 .mask = CLOCKSOURCE_MASK(32),
44 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
45};
46
47static int lpc32xx_clkevt_next_event(unsigned long delta, 34static int lpc32xx_clkevt_next_event(unsigned long delta,
48 struct clock_event_device *dev) 35 struct clock_event_device *dev)
49{ 36{
@@ -170,7 +157,9 @@ static void __init lpc32xx_timer_init(void)
170 __raw_writel(0, LCP32XX_TIMER_MCR(LPC32XX_TIMER1_BASE)); 157 __raw_writel(0, LCP32XX_TIMER_MCR(LPC32XX_TIMER1_BASE));
171 __raw_writel(LCP32XX_TIMER_CNTR_TCR_EN, 158 __raw_writel(LCP32XX_TIMER_CNTR_TCR_EN,
172 LCP32XX_TIMER_TCR(LPC32XX_TIMER1_BASE)); 159 LCP32XX_TIMER_TCR(LPC32XX_TIMER1_BASE));
173 clocksource_register_hz(&lpc32xx_clksrc, clkrate); 160
161 clocksource_mmio_init(LCP32XX_TIMER_TC(LPC32XX_TIMER1_BASE),
162 "lpc32xx_clksrc", clkrate, 300, 32, clocksource_mmio_readl_up);
174} 163}
175 164
176struct sys_timer lpc32xx_timer = { 165struct sys_timer lpc32xx_timer = {
diff --git a/arch/arm/mach-msm/include/mach/smp.h b/arch/arm/mach-msm/include/mach/smp.h
deleted file mode 100644
index 3c01000ecc80..000000000000
--- a/arch/arm/mach-msm/include/mach/smp.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/* Copyright (c) 2010, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef __ASM_ARCH_MSM_SMP_H
14#define __ASM_ARCH_MSM_SMP_H
15
16#include <asm/hardware/gic.h>
17
18static inline void smp_cross_call(const struct cpumask *mask, int ipi)
19{
20 gic_raise_softirq(mask, ipi);
21}
22
23#endif
diff --git a/arch/arm/mach-msm/platsmp.c b/arch/arm/mach-msm/platsmp.c
index 0f427bc94447..2034098cf015 100644
--- a/arch/arm/mach-msm/platsmp.c
+++ b/arch/arm/mach-msm/platsmp.c
@@ -119,7 +119,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
119 * the boot monitor to read the system wide flags register, 119 * the boot monitor to read the system wide flags register,
120 * and branch to the address found there. 120 * and branch to the address found there.
121 */ 121 */
122 smp_cross_call(cpumask_of(cpu), 1); 122 gic_raise_softirq(cpumask_of(cpu), 1);
123 123
124 timeout = jiffies + (1 * HZ); 124 timeout = jiffies + (1 * HZ);
125 while (time_before(jiffies, timeout)) { 125 while (time_before(jiffies, timeout)) {
@@ -151,6 +151,8 @@ void __init smp_init_cpus(void)
151 151
152 for (i = 0; i < NR_CPUS; i++) 152 for (i = 0; i < NR_CPUS; i++)
153 set_cpu_possible(i, true); 153 set_cpu_possible(i, true);
154
155 set_smp_cross_call(gic_raise_softirq);
154} 156}
155 157
156void __init platform_smp_prepare_cpus(unsigned int max_cpus) 158void __init platform_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-mxs/Kconfig b/arch/arm/mach-mxs/Kconfig
index 21de5d50673f..f114960622e0 100644
--- a/arch/arm/mach-mxs/Kconfig
+++ b/arch/arm/mach-mxs/Kconfig
@@ -17,6 +17,16 @@ config SOC_IMX28
17 17
18comment "MXS platforms:" 18comment "MXS platforms:"
19 19
20config MACH_STMP378X_DEVB
21 bool "Support STMP378x_devb Platform"
22 select SOC_IMX23
23 select MXS_HAVE_AMBA_DUART
24 select MXS_HAVE_PLATFORM_AUART
25 select MXS_HAVE_PLATFORM_MXS_MMC
26 help
27 Include support for STMP378x-devb platform. This includes specific
28 configurations for the board and its peripherals.
29
20config MACH_MX23EVK 30config MACH_MX23EVK
21 bool "Support MX23EVK Platform" 31 bool "Support MX23EVK Platform"
22 select SOC_IMX23 32 select SOC_IMX23
diff --git a/arch/arm/mach-mxs/Makefile b/arch/arm/mach-mxs/Makefile
index 2f1f6141ca71..58e892376bf2 100644
--- a/arch/arm/mach-mxs/Makefile
+++ b/arch/arm/mach-mxs/Makefile
@@ -7,6 +7,7 @@ obj-$(CONFIG_PM) += pm.o
7obj-$(CONFIG_SOC_IMX23) += clock-mx23.o mm-mx23.o 7obj-$(CONFIG_SOC_IMX23) += clock-mx23.o mm-mx23.o
8obj-$(CONFIG_SOC_IMX28) += clock-mx28.o mm-mx28.o 8obj-$(CONFIG_SOC_IMX28) += clock-mx28.o mm-mx28.o
9 9
10obj-$(CONFIG_MACH_STMP378X_DEVB) += mach-stmp378x_devb.o
10obj-$(CONFIG_MACH_MX23EVK) += mach-mx23evk.o 11obj-$(CONFIG_MACH_MX23EVK) += mach-mx23evk.o
11obj-$(CONFIG_MACH_MX28EVK) += mach-mx28evk.o 12obj-$(CONFIG_MACH_MX28EVK) += mach-mx28evk.o
12obj-$(CONFIG_MODULE_TX28) += module-tx28.o 13obj-$(CONFIG_MODULE_TX28) += module-tx28.o
diff --git a/arch/arm/mach-mxs/mach-stmp378x_devb.c b/arch/arm/mach-mxs/mach-stmp378x_devb.c
new file mode 100644
index 000000000000..7f38d82b69af
--- /dev/null
+++ b/arch/arm/mach-mxs/mach-stmp378x_devb.c
@@ -0,0 +1,120 @@
1/*
2 * board setup for STMP378x-Development-Board
3 *
4 * based on mx23evk board setup and information gained form the original
5 * plat-stmp based board setup, now converted to mach-mxs.
6 *
7 * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.
8 * Copyright (C) 2011 Wolfram Sang, Pengutronix e.K.
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 as published by
12 * the Free Software Foundation; version 2 of the License.
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
20#include <linux/platform_device.h>
21#include <linux/gpio.h>
22#include <linux/irq.h>
23#include <linux/spi/spi.h>
24
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27#include <asm/mach/time.h>
28
29#include <mach/common.h>
30#include <mach/iomux-mx23.h>
31
32#include "devices-mx23.h"
33
34#define STMP378X_DEVB_MMC0_WRITE_PROTECT MXS_GPIO_NR(1, 30)
35#define STMP378X_DEVB_MMC0_SLOT_POWER MXS_GPIO_NR(1, 29)
36
37#define STMP378X_DEVB_PAD_AUART (MXS_PAD_4MA | MXS_PAD_1V8 | MXS_PAD_NOPULL)
38
39static const iomux_cfg_t stmp378x_dvb_pads[] __initconst = {
40 /* duart (extended setup missing in old boardcode, too */
41 MX23_PAD_PWM0__DUART_RX,
42 MX23_PAD_PWM1__DUART_TX,
43
44 /* auart */
45 MX23_PAD_AUART1_RX__AUART1_RX | STMP378X_DEVB_PAD_AUART,
46 MX23_PAD_AUART1_TX__AUART1_TX | STMP378X_DEVB_PAD_AUART,
47 MX23_PAD_AUART1_CTS__AUART1_CTS | STMP378X_DEVB_PAD_AUART,
48 MX23_PAD_AUART1_RTS__AUART1_RTS | STMP378X_DEVB_PAD_AUART,
49
50 /* mmc */
51 MX23_PAD_SSP1_DATA0__SSP1_DATA0 |
52 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
53 MX23_PAD_SSP1_DATA1__SSP1_DATA1 |
54 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
55 MX23_PAD_SSP1_DATA2__SSP1_DATA2 |
56 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
57 MX23_PAD_SSP1_DATA3__SSP1_DATA3 |
58 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
59 MX23_PAD_SSP1_CMD__SSP1_CMD |
60 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_PULLUP),
61 MX23_PAD_SSP1_DETECT__SSP1_DETECT |
62 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
63 MX23_PAD_SSP1_SCK__SSP1_SCK |
64 (MXS_PAD_8MA | MXS_PAD_3V3 | MXS_PAD_NOPULL),
65 MX23_PAD_PWM4__GPIO_1_30 | MXS_PAD_CTRL, /* write protect */
66 MX23_PAD_PWM3__GPIO_1_29 | MXS_PAD_CTRL, /* power enable */
67};
68
69static struct mxs_mmc_platform_data stmp378x_dvb_mmc_pdata __initdata = {
70 .wp_gpio = STMP378X_DEVB_MMC0_WRITE_PROTECT,
71};
72
73static struct spi_board_info spi_board_info[] __initdata = {
74#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
75 {
76 .modalias = "enc28j60",
77 .max_speed_hz = 6 * 1000 * 1000,
78 .bus_num = 1,
79 .chip_select = 0,
80 .platform_data = NULL,
81 },
82#endif
83};
84
85static void __init stmp378x_dvb_init(void)
86{
87 int ret;
88
89 mxs_iomux_setup_multiple_pads(stmp378x_dvb_pads,
90 ARRAY_SIZE(stmp378x_dvb_pads));
91
92 mx23_add_duart();
93 mx23_add_auart0();
94
95 /* power on mmc slot */
96 ret = gpio_request_one(STMP378X_DEVB_MMC0_SLOT_POWER,
97 GPIOF_OUT_INIT_LOW, "mmc0-slot-power");
98 if (ret)
99 pr_warn("could not power mmc (%d)\n", ret);
100
101 mx23_add_mxs_mmc(0, &stmp378x_dvb_mmc_pdata);
102
103 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
104}
105
106static void __init stmp378x_dvb_timer_init(void)
107{
108 mx23_clocks_init();
109}
110
111static struct sys_timer stmp378x_dvb_timer = {
112 .init = stmp378x_dvb_timer_init,
113};
114
115MACHINE_START(STMP378X, "STMP378X")
116 .map_io = mx23_map_io,
117 .init_irq = mx23_init_irq,
118 .init_machine = stmp378x_dvb_init,
119 .timer = &stmp378x_dvb_timer,
120MACHINE_END
diff --git a/arch/arm/mach-mxs/timer.c b/arch/arm/mach-mxs/timer.c
index 13647f301860..cace0d2e5a55 100644
--- a/arch/arm/mach-mxs/timer.c
+++ b/arch/arm/mach-mxs/timer.c
@@ -101,11 +101,6 @@ static cycle_t timrotv1_get_cycles(struct clocksource *cs)
101 & 0xffff0000) >> 16); 101 & 0xffff0000) >> 16);
102} 102}
103 103
104static cycle_t timrotv2_get_cycles(struct clocksource *cs)
105{
106 return ~__raw_readl(mxs_timrot_base + HW_TIMROT_RUNNING_COUNTn(1));
107}
108
109static int timrotv1_set_next_event(unsigned long evt, 104static int timrotv1_set_next_event(unsigned long evt,
110 struct clock_event_device *dev) 105 struct clock_event_device *dev)
111{ 106{
@@ -230,8 +225,8 @@ static int __init mxs_clockevent_init(struct clk *timer_clk)
230static struct clocksource clocksource_mxs = { 225static struct clocksource clocksource_mxs = {
231 .name = "mxs_timer", 226 .name = "mxs_timer",
232 .rating = 200, 227 .rating = 200,
233 .read = timrotv2_get_cycles, 228 .read = timrotv1_get_cycles,
234 .mask = CLOCKSOURCE_MASK(32), 229 .mask = CLOCKSOURCE_MASK(16),
235 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 230 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
236}; 231};
237 232
@@ -239,12 +234,11 @@ static int __init mxs_clocksource_init(struct clk *timer_clk)
239{ 234{
240 unsigned int c = clk_get_rate(timer_clk); 235 unsigned int c = clk_get_rate(timer_clk);
241 236
242 if (timrot_is_v1()) { 237 if (timrot_is_v1())
243 clocksource_mxs.read = timrotv1_get_cycles; 238 clocksource_register_hz(&clocksource_mxs, c);
244 clocksource_mxs.mask = CLOCKSOURCE_MASK(16); 239 else
245 } 240 clocksource_mmio_init(mxs_timrot_base + HW_TIMROT_RUNNING_COUNTn(1),
246 241 "mxs_timer", c, 200, 32, clocksource_mmio_readl_down);
247 clocksource_register_hz(&clocksource_mxs, c);
248 242
249 return 0; 243 return 0;
250} 244}
diff --git a/arch/arm/mach-netx/time.c b/arch/arm/mach-netx/time.c
index f12f22d09b6c..e24c141ba489 100644
--- a/arch/arm/mach-netx/time.c
+++ b/arch/arm/mach-netx/time.c
@@ -104,19 +104,6 @@ static struct irqaction netx_timer_irq = {
104 .handler = netx_timer_interrupt, 104 .handler = netx_timer_interrupt,
105}; 105};
106 106
107cycle_t netx_get_cycles(struct clocksource *cs)
108{
109 return readl(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE));
110}
111
112static struct clocksource clocksource_netx = {
113 .name = "netx_timer",
114 .rating = 200,
115 .read = netx_get_cycles,
116 .mask = CLOCKSOURCE_MASK(32),
117 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
118};
119
120/* 107/*
121 * Set up timer interrupt 108 * Set up timer interrupt
122 */ 109 */
@@ -150,7 +137,8 @@ static void __init netx_timer_init(void)
150 writel(NETX_GPIO_COUNTER_CTRL_RUN, 137 writel(NETX_GPIO_COUNTER_CTRL_RUN,
151 NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKSOURCE)); 138 NETX_GPIO_COUNTER_CTRL(TIMER_CLOCKSOURCE));
152 139
153 clocksource_register_hz(&clocksource_netx, CLOCK_TICK_RATE); 140 clocksource_mmio_init(NETX_GPIO_COUNTER_CURRENT(TIMER_CLOCKSOURCE),
141 "netx_timer", CLOCK_TICK_RATE, 200, 32, clocksource_mmio_readl_up);
154 142
155 netx_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, 143 netx_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC,
156 netx_clockevent.shift); 144 netx_clockevent.shift);
diff --git a/arch/arm/mach-ns9xxx/Kconfig b/arch/arm/mach-ns9xxx/Kconfig
deleted file mode 100644
index dd0cd5ac4b8b..000000000000
--- a/arch/arm/mach-ns9xxx/Kconfig
+++ /dev/null
@@ -1,40 +0,0 @@
1if ARCH_NS9XXX
2
3menu "NS9xxx Implementations"
4
5config NS9XXX_HAVE_SERIAL8250
6 bool
7
8config PROCESSOR_NS9360
9 bool
10
11config MODULE_CC9P9360
12 bool
13 select PROCESSOR_NS9360
14
15config BOARD_A9M9750DEV
16 select NS9XXX_HAVE_SERIAL8250
17 bool
18
19config BOARD_JSCC9P9360
20 bool
21
22config MACH_CC9P9360DEV
23 bool "ConnectCore 9P 9360 on an A9M9750 Devboard"
24 select MODULE_CC9P9360
25 select BOARD_A9M9750DEV
26 help
27 Say Y here if you are using the Digi ConnectCore 9P 9360
28 on an A9M9750 Development Board.
29
30config MACH_CC9P9360JS
31 bool "ConnectCore 9P 9360 on a JSCC9P9360 Devboard"
32 select MODULE_CC9P9360
33 select BOARD_JSCC9P9360
34 help
35 Say Y here if you are using the Digi ConnectCore 9P 9360
36 on an JSCC9P9360 Development Board.
37
38endmenu
39
40endif
diff --git a/arch/arm/mach-ns9xxx/Makefile b/arch/arm/mach-ns9xxx/Makefile
deleted file mode 100644
index 41efaf9ad50b..000000000000
--- a/arch/arm/mach-ns9xxx/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
1obj-y := clock.o generic.o gpio.o irq.o
2
3obj-$(CONFIG_MACH_CC9P9360DEV) += mach-cc9p9360dev.o
4obj-$(CONFIG_MACH_CC9P9360JS) += mach-cc9p9360js.o
5
6obj-$(CONFIG_PROCESSOR_NS9360) += gpio-ns9360.o processor-ns9360.o time-ns9360.o
7
8obj-$(CONFIG_BOARD_A9M9750DEV) += board-a9m9750dev.o
9obj-$(CONFIG_BOARD_JSCC9P9360) += board-jscc9p9360.o
10
11# platform devices
12obj-$(CONFIG_NS9XXX_HAVE_SERIAL8250) += plat-serial8250.o
diff --git a/arch/arm/mach-ns9xxx/Makefile.boot b/arch/arm/mach-ns9xxx/Makefile.boot
deleted file mode 100644
index 54654919229b..000000000000
--- a/arch/arm/mach-ns9xxx/Makefile.boot
+++ /dev/null
@@ -1,2 +0,0 @@
1zreladdr-y := 0x8000
2params_phys-y := 0x100
diff --git a/arch/arm/mach-ns9xxx/board-a9m9750dev.c b/arch/arm/mach-ns9xxx/board-a9m9750dev.c
deleted file mode 100644
index e27687d53504..000000000000
--- a/arch/arm/mach-ns9xxx/board-a9m9750dev.c
+++ /dev/null
@@ -1,156 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/board-a9m9750dev.c
3 *
4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#include <linux/irq.h>
12
13#include <asm/mach/map.h>
14#include <asm/gpio.h>
15
16#include <mach/board.h>
17#include <mach/processor-ns9360.h>
18#include <mach/regs-sys-ns9360.h>
19#include <mach/regs-mem.h>
20#include <mach/regs-bbu.h>
21#include <mach/regs-board-a9m9750dev.h>
22
23#include "board-a9m9750dev.h"
24
25static struct map_desc board_a9m9750dev_io_desc[] __initdata = {
26 { /* FPGA on CS0 */
27 .virtual = io_p2v(NS9XXX_CSxSTAT_PHYS(0)),
28 .pfn = __phys_to_pfn(NS9XXX_CSxSTAT_PHYS(0)),
29 .length = NS9XXX_CS0STAT_LENGTH,
30 .type = MT_DEVICE,
31 },
32};
33
34void __init board_a9m9750dev_map_io(void)
35{
36 iotable_init(board_a9m9750dev_io_desc,
37 ARRAY_SIZE(board_a9m9750dev_io_desc));
38}
39
40static void a9m9750dev_fpga_ack_irq(struct irq_data *d)
41{
42 /* nothing */
43}
44
45static void a9m9750dev_fpga_mask_irq(struct irq_data *d)
46{
47 u8 ier;
48
49 ier = __raw_readb(FPGA_IER);
50
51 ier &= ~(1 << (d->irq - FPGA_IRQ(0)));
52
53 __raw_writeb(ier, FPGA_IER);
54}
55
56static void a9m9750dev_fpga_maskack_irq(struct irq_data *d)
57{
58 a9m9750dev_fpga_mask_irq(d);
59 a9m9750dev_fpga_ack_irq(d);
60}
61
62static void a9m9750dev_fpga_unmask_irq(struct irq_data *d)
63{
64 u8 ier;
65
66 ier = __raw_readb(FPGA_IER);
67
68 ier |= 1 << (d->irq - FPGA_IRQ(0));
69
70 __raw_writeb(ier, FPGA_IER);
71}
72
73static struct irq_chip a9m9750dev_fpga_chip = {
74 .irq_ack = a9m9750dev_fpga_ack_irq,
75 .irq_mask = a9m9750dev_fpga_mask_irq,
76 .irq_mask_ack = a9m9750dev_fpga_maskack_irq,
77 .irq_unmask = a9m9750dev_fpga_unmask_irq,
78};
79
80static void a9m9750dev_fpga_demux_handler(unsigned int irq,
81 struct irq_desc *desc)
82{
83 u8 stat = __raw_readb(FPGA_ISR);
84
85 desc->irq_data.chip->irq_mask_ack(&desc->irq_data);
86
87 while (stat != 0) {
88 int irqno = fls(stat) - 1;
89
90 stat &= ~(1 << irqno);
91
92 generic_handle_irq(FPGA_IRQ(irqno));
93 }
94
95 desc->irq_data.chip->irq_unmask(&desc->irq_data);
96}
97
98void __init board_a9m9750dev_init_irq(void)
99{
100 u32 eic;
101 int i;
102
103 if (gpio_request(11, "board a9m9750dev extirq2") == 0)
104 ns9360_gpio_configure(11, 0, 1);
105 else
106 printk(KERN_ERR "%s: cannot get gpio 11 for IRQ_NS9XXX_EXT2\n",
107 __func__);
108
109 for (i = FPGA_IRQ(0); i <= FPGA_IRQ(7); ++i) {
110 irq_set_chip_and_handler(i, &a9m9750dev_fpga_chip,
111 handle_level_irq);
112 set_irq_flags(i, IRQF_VALID);
113 }
114
115 /* IRQ_NS9XXX_EXT2: level sensitive + active low */
116 eic = __raw_readl(SYS_EIC(2));
117 REGSET(eic, SYS_EIC, PLTY, AL);
118 REGSET(eic, SYS_EIC, LVEDG, LEVEL);
119 __raw_writel(eic, SYS_EIC(2));
120
121 irq_set_chained_handler(IRQ_NS9XXX_EXT2,
122 a9m9750dev_fpga_demux_handler);
123}
124
125void __init board_a9m9750dev_init_machine(void)
126{
127 u32 reg;
128
129 /* setup static CS0: memory base ... */
130 reg = __raw_readl(SYS_SMCSSMB(0));
131 REGSETIM(reg, SYS_SMCSSMB, CSxB, NS9XXX_CSxSTAT_PHYS(0) >> 12);
132 __raw_writel(reg, SYS_SMCSSMB(0));
133
134 /* ... and mask */
135 reg = __raw_readl(SYS_SMCSSMM(0));
136 REGSETIM(reg, SYS_SMCSSMM, CSxM, 0xfffff);
137 REGSET(reg, SYS_SMCSSMM, CSEx, EN);
138 __raw_writel(reg, SYS_SMCSSMM(0));
139
140 /* setup static CS0: memory configuration */
141 reg = __raw_readl(MEM_SMC(0));
142 REGSET(reg, MEM_SMC, PSMC, OFF);
143 REGSET(reg, MEM_SMC, BSMC, OFF);
144 REGSET(reg, MEM_SMC, EW, OFF);
145 REGSET(reg, MEM_SMC, PB, 1);
146 REGSET(reg, MEM_SMC, PC, AL);
147 REGSET(reg, MEM_SMC, PM, DIS);
148 REGSET(reg, MEM_SMC, MW, 8);
149 __raw_writel(reg, MEM_SMC(0));
150
151 /* setup static CS0: timing */
152 __raw_writel(0x2, MEM_SMWED(0));
153 __raw_writel(0x2, MEM_SMOED(0));
154 __raw_writel(0x6, MEM_SMRD(0));
155 __raw_writel(0x6, MEM_SMWD(0));
156}
diff --git a/arch/arm/mach-ns9xxx/board-a9m9750dev.h b/arch/arm/mach-ns9xxx/board-a9m9750dev.h
deleted file mode 100644
index edc75abbc5dd..000000000000
--- a/arch/arm/mach-ns9xxx/board-a9m9750dev.h
+++ /dev/null
@@ -1,15 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/board-a9m9750dev.h
3 *
4 * Copyright (C) 2006 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#include <linux/init.h>
12
13void __init board_a9m9750dev_map_io(void);
14void __init board_a9m9750dev_init_machine(void);
15void __init board_a9m9750dev_init_irq(void);
diff --git a/arch/arm/mach-ns9xxx/board-jscc9p9360.c b/arch/arm/mach-ns9xxx/board-jscc9p9360.c
deleted file mode 100644
index 4bd3eec04bfe..000000000000
--- a/arch/arm/mach-ns9xxx/board-jscc9p9360.c
+++ /dev/null
@@ -1,17 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/board-jscc9p9360.c
3 *
4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#include "board-jscc9p9360.h"
12
13void __init board_jscc9p9360_init_machine(void)
14{
15 /* TODO: reserve GPIOs for push buttons, etc pp */
16}
17
diff --git a/arch/arm/mach-ns9xxx/board-jscc9p9360.h b/arch/arm/mach-ns9xxx/board-jscc9p9360.h
deleted file mode 100644
index 1a81a074df45..000000000000
--- a/arch/arm/mach-ns9xxx/board-jscc9p9360.h
+++ /dev/null
@@ -1,13 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/board-jscc9p9360.h
3 *
4 * Copyright (C) 2006 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#include <linux/init.h>
12
13void __init board_jscc9p9360_init_machine(void);
diff --git a/arch/arm/mach-ns9xxx/clock.c b/arch/arm/mach-ns9xxx/clock.c
deleted file mode 100644
index cf81cbc57544..000000000000
--- a/arch/arm/mach-ns9xxx/clock.c
+++ /dev/null
@@ -1,215 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/clock.c
3 *
4 * Copyright (C) 2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#include <linux/err.h>
12#include <linux/module.h>
13#include <linux/list.h>
14#include <linux/clk.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17#include <linux/semaphore.h>
18
19#include "clock.h"
20
21static LIST_HEAD(clocks);
22static DEFINE_SPINLOCK(clk_lock);
23
24struct clk *clk_get(struct device *dev, const char *id)
25{
26 struct clk *p, *ret = NULL, *retgen = NULL;
27 unsigned long flags;
28 int idno;
29
30 if (dev == NULL || dev->bus != &platform_bus_type)
31 idno = -1;
32 else
33 idno = to_platform_device(dev)->id;
34
35 spin_lock_irqsave(&clk_lock, flags);
36 list_for_each_entry(p, &clocks, node) {
37 if (strcmp(id, p->name) == 0) {
38 if (p->id == idno) {
39 if (!try_module_get(p->owner))
40 continue;
41 ret = p;
42 break;
43 } else if (p->id == -1)
44 /* remember match with id == -1 in case there is
45 * no clock for idno */
46 retgen = p;
47 }
48 }
49
50 if (!ret && retgen && try_module_get(retgen->owner))
51 ret = retgen;
52
53 if (ret)
54 ++ret->refcount;
55
56 spin_unlock_irqrestore(&clk_lock, flags);
57
58 return ret ? ret : ERR_PTR(-ENOENT);
59}
60EXPORT_SYMBOL(clk_get);
61
62void clk_put(struct clk *clk)
63{
64 module_put(clk->owner);
65 --clk->refcount;
66}
67EXPORT_SYMBOL(clk_put);
68
69static int clk_enable_unlocked(struct clk *clk)
70{
71 int ret = 0;
72 if (clk->parent) {
73 ret = clk_enable_unlocked(clk->parent);
74 if (ret)
75 return ret;
76 }
77
78 if (clk->usage++ == 0 && clk->endisable)
79 ret = clk->endisable(clk, 1);
80
81 return ret;
82}
83
84int clk_enable(struct clk *clk)
85{
86 int ret;
87 unsigned long flags;
88
89 spin_lock_irqsave(&clk_lock, flags);
90
91 ret = clk_enable_unlocked(clk);
92
93 spin_unlock_irqrestore(&clk_lock, flags);
94
95 return ret;
96}
97EXPORT_SYMBOL(clk_enable);
98
99static void clk_disable_unlocked(struct clk *clk)
100{
101 if (--clk->usage == 0 && clk->endisable)
102 clk->endisable(clk, 0);
103
104 if (clk->parent)
105 clk_disable_unlocked(clk->parent);
106}
107
108void clk_disable(struct clk *clk)
109{
110 unsigned long flags;
111
112 spin_lock_irqsave(&clk_lock, flags);
113
114 clk_disable_unlocked(clk);
115
116 spin_unlock_irqrestore(&clk_lock, flags);
117}
118EXPORT_SYMBOL(clk_disable);
119
120unsigned long clk_get_rate(struct clk *clk)
121{
122 if (clk->get_rate)
123 return clk->get_rate(clk);
124
125 if (clk->rate)
126 return clk->rate;
127
128 if (clk->parent)
129 return clk_get_rate(clk->parent);
130
131 return 0;
132}
133EXPORT_SYMBOL(clk_get_rate);
134
135int clk_register(struct clk *clk)
136{
137 unsigned long flags;
138
139 spin_lock_irqsave(&clk_lock, flags);
140
141 list_add(&clk->node, &clocks);
142
143 if (clk->parent)
144 ++clk->parent->refcount;
145
146 spin_unlock_irqrestore(&clk_lock, flags);
147
148 return 0;
149}
150
151int clk_unregister(struct clk *clk)
152{
153 int ret = 0;
154 unsigned long flags;
155
156 spin_lock_irqsave(&clk_lock, flags);
157
158 if (clk->usage || clk->refcount)
159 ret = -EBUSY;
160 else
161 list_del(&clk->node);
162
163 if (clk->parent)
164 --clk->parent->refcount;
165
166 spin_unlock_irqrestore(&clk_lock, flags);
167
168 return ret;
169}
170
171#if defined CONFIG_DEBUG_FS
172
173#include <linux/debugfs.h>
174#include <linux/seq_file.h>
175
176static int clk_debugfs_show(struct seq_file *s, void *null)
177{
178 unsigned long flags;
179 struct clk *p;
180
181 spin_lock_irqsave(&clk_lock, flags);
182
183 list_for_each_entry(p, &clocks, node)
184 seq_printf(s, "%s.%d: usage=%lu refcount=%lu rate=%lu\n",
185 p->name, p->id, p->usage, p->refcount,
186 p->usage ? clk_get_rate(p) : 0);
187
188 spin_unlock_irqrestore(&clk_lock, flags);
189
190 return 0;
191}
192
193static int clk_debugfs_open(struct inode *inode, struct file *file)
194{
195 return single_open(file, clk_debugfs_show, NULL);
196}
197
198static const struct file_operations clk_debugfs_operations = {
199 .open = clk_debugfs_open,
200 .read = seq_read,
201 .llseek = seq_lseek,
202 .release = single_release,
203};
204
205static int __init clk_debugfs_init(void)
206{
207 struct dentry *dentry;
208
209 dentry = debugfs_create_file("clk", S_IFREG | S_IRUGO, NULL, NULL,
210 &clk_debugfs_operations);
211 return IS_ERR(dentry) ? PTR_ERR(dentry) : 0;
212}
213subsys_initcall(clk_debugfs_init);
214
215#endif /* if defined CONFIG_DEBUG_FS */
diff --git a/arch/arm/mach-ns9xxx/clock.h b/arch/arm/mach-ns9xxx/clock.h
deleted file mode 100644
index b86c30dd79eb..000000000000
--- a/arch/arm/mach-ns9xxx/clock.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/clock.h
3 *
4 * Copyright (C) 2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __NS9XXX_CLOCK_H
12#define __NS9XXX_CLOCK_H
13
14#include <linux/list.h>
15
16struct clk {
17 struct module *owner;
18 const char *name;
19 int id;
20
21 struct clk *parent;
22
23 unsigned long rate;
24 int (*endisable)(struct clk *, int enable);
25 unsigned long (*get_rate)(struct clk *);
26
27 struct list_head node;
28 unsigned long refcount;
29 unsigned long usage;
30};
31
32int clk_register(struct clk *clk);
33int clk_unregister(struct clk *clk);
34
35#endif /* ifndef __NS9XXX_CLOCK_H */
diff --git a/arch/arm/mach-ns9xxx/generic.c b/arch/arm/mach-ns9xxx/generic.c
deleted file mode 100644
index 1e0f467879cc..000000000000
--- a/arch/arm/mach-ns9xxx/generic.c
+++ /dev/null
@@ -1,19 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/generic.c
3 *
4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <asm/memory.h>
14
15#include "generic.h"
16
17void __init ns9xxx_init_machine(void)
18{
19}
diff --git a/arch/arm/mach-ns9xxx/generic.h b/arch/arm/mach-ns9xxx/generic.h
deleted file mode 100644
index 82493191aad6..000000000000
--- a/arch/arm/mach-ns9xxx/generic.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/generic.h
3 *
4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#include <linux/time.h>
12#include <asm/mach/time.h>
13#include <linux/init.h>
14
15void __init ns9xxx_init_irq(void);
16void __init ns9xxx_init_machine(void);
diff --git a/arch/arm/mach-ns9xxx/gpio-ns9360.c b/arch/arm/mach-ns9xxx/gpio-ns9360.c
deleted file mode 100644
index 377330c1b250..000000000000
--- a/arch/arm/mach-ns9xxx/gpio-ns9360.c
+++ /dev/null
@@ -1,118 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/gpio-ns9360.c
3 *
4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#include <linux/bug.h>
12#include <linux/errno.h>
13#include <linux/io.h>
14#include <linux/kernel.h>
15#include <linux/module.h>
16
17#include <mach/regs-bbu.h>
18#include <mach/processor-ns9360.h>
19
20#include "gpio-ns9360.h"
21
22static inline int ns9360_valid_gpio(unsigned gpio)
23{
24 return gpio <= 72;
25}
26
27static inline void __iomem *ns9360_gpio_get_gconfaddr(unsigned gpio)
28{
29 if (gpio < 56)
30 return BBU_GCONFb1(gpio / 8);
31 else
32 /*
33 * this could be optimised away on
34 * ns9750 only builds, but it isn't ...
35 */
36 return BBU_GCONFb2((gpio - 56) / 8);
37}
38
39static inline void __iomem *ns9360_gpio_get_gctrladdr(unsigned gpio)
40{
41 if (gpio < 32)
42 return BBU_GCTRL1;
43 else if (gpio < 64)
44 return BBU_GCTRL2;
45 else
46 /* this could be optimised away on ns9750 only builds */
47 return BBU_GCTRL3;
48}
49
50static inline void __iomem *ns9360_gpio_get_gstataddr(unsigned gpio)
51{
52 if (gpio < 32)
53 return BBU_GSTAT1;
54 else if (gpio < 64)
55 return BBU_GSTAT2;
56 else
57 /* this could be optimised away on ns9750 only builds */
58 return BBU_GSTAT3;
59}
60
61/*
62 * each gpio can serve for 4 different purposes [0..3]. These are called
63 * "functions" and passed in the parameter func. Functions 0-2 are always some
64 * special things, function 3 is GPIO. If func == 3 dir specifies input or
65 * output, and with inv you can enable an inverter (independent of func).
66 */
67int __ns9360_gpio_configure(unsigned gpio, int dir, int inv, int func)
68{
69 void __iomem *conf = ns9360_gpio_get_gconfaddr(gpio);
70 u32 confval;
71
72 confval = __raw_readl(conf);
73 REGSETIM_IDX(confval, BBU_GCONFx, DIR, gpio & 7, dir);
74 REGSETIM_IDX(confval, BBU_GCONFx, INV, gpio & 7, inv);
75 REGSETIM_IDX(confval, BBU_GCONFx, FUNC, gpio & 7, func);
76 __raw_writel(confval, conf);
77
78 return 0;
79}
80
81int ns9360_gpio_configure(unsigned gpio, int inv, int func)
82{
83 if (likely(ns9360_valid_gpio(gpio))) {
84 if (func == 3) {
85 printk(KERN_WARNING "use gpio_direction_input "
86 "or gpio_direction_output\n");
87 return -EINVAL;
88 } else
89 return __ns9360_gpio_configure(gpio, 0, inv, func);
90 } else
91 return -EINVAL;
92}
93EXPORT_SYMBOL(ns9360_gpio_configure);
94
95int ns9360_gpio_get_value(unsigned gpio)
96{
97 void __iomem *stat = ns9360_gpio_get_gstataddr(gpio);
98 int ret;
99
100 ret = 1 & (__raw_readl(stat) >> (gpio & 31));
101
102 return ret;
103}
104
105void ns9360_gpio_set_value(unsigned gpio, int value)
106{
107 void __iomem *ctrl = ns9360_gpio_get_gctrladdr(gpio);
108 u32 ctrlval;
109
110 ctrlval = __raw_readl(ctrl);
111
112 if (value)
113 ctrlval |= 1 << (gpio & 31);
114 else
115 ctrlval &= ~(1 << (gpio & 31));
116
117 __raw_writel(ctrlval, ctrl);
118}
diff --git a/arch/arm/mach-ns9xxx/gpio-ns9360.h b/arch/arm/mach-ns9xxx/gpio-ns9360.h
deleted file mode 100644
index 131cd1715caa..000000000000
--- a/arch/arm/mach-ns9xxx/gpio-ns9360.h
+++ /dev/null
@@ -1,13 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/gpio-ns9360.h
3 *
4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11int __ns9360_gpio_configure(unsigned gpio, int dir, int inv, int func);
12int ns9360_gpio_get_value(unsigned gpio);
13void ns9360_gpio_set_value(unsigned gpio, int value);
diff --git a/arch/arm/mach-ns9xxx/gpio.c b/arch/arm/mach-ns9xxx/gpio.c
deleted file mode 100644
index 5503ca09c4ae..000000000000
--- a/arch/arm/mach-ns9xxx/gpio.c
+++ /dev/null
@@ -1,147 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/gpio.c
3 *
4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#include <linux/kernel.h>
12#include <linux/compiler.h>
13#include <linux/init.h>
14#include <linux/spinlock.h>
15#include <linux/module.h>
16#include <linux/bitops.h>
17
18#include <mach/gpio.h>
19#include <mach/processor.h>
20#include <mach/processor-ns9360.h>
21#include <asm/bug.h>
22#include <asm/types.h>
23
24#include "gpio-ns9360.h"
25
26#if defined(CONFIG_PROCESSOR_NS9360)
27#define GPIO_MAX 72
28#elif defined(CONFIG_PROCESSOR_NS9750)
29#define GPIO_MAX 49
30#endif
31
32/* protects BBU_GCONFx and BBU_GCTRLx */
33static spinlock_t gpio_lock = __SPIN_LOCK_UNLOCKED(gpio_lock);
34
35/* only access gpiores with atomic ops */
36static DECLARE_BITMAP(gpiores, GPIO_MAX + 1);
37
38static inline int ns9xxx_valid_gpio(unsigned gpio)
39{
40#if defined(CONFIG_PROCESSOR_NS9360)
41 if (processor_is_ns9360())
42 return gpio <= 72;
43 else
44#endif
45#if defined(CONFIG_PROCESSOR_NS9750)
46 if (processor_is_ns9750())
47 return gpio <= 49;
48 else
49#endif
50 {
51 BUG();
52 return 0;
53 }
54}
55
56int gpio_request(unsigned gpio, const char *label)
57{
58 if (likely(ns9xxx_valid_gpio(gpio)))
59 return test_and_set_bit(gpio, gpiores) ? -EBUSY : 0;
60 else
61 return -EINVAL;
62}
63EXPORT_SYMBOL(gpio_request);
64
65void gpio_free(unsigned gpio)
66{
67 might_sleep();
68 clear_bit(gpio, gpiores);
69 return;
70}
71EXPORT_SYMBOL(gpio_free);
72
73int gpio_direction_input(unsigned gpio)
74{
75 if (likely(ns9xxx_valid_gpio(gpio))) {
76 int ret = -EINVAL;
77 unsigned long flags;
78
79 spin_lock_irqsave(&gpio_lock, flags);
80#if defined(CONFIG_PROCESSOR_NS9360)
81 if (processor_is_ns9360())
82 ret = __ns9360_gpio_configure(gpio, 0, 0, 3);
83 else
84#endif
85 BUG();
86
87 spin_unlock_irqrestore(&gpio_lock, flags);
88
89 return ret;
90
91 } else
92 return -EINVAL;
93}
94EXPORT_SYMBOL(gpio_direction_input);
95
96int gpio_direction_output(unsigned gpio, int value)
97{
98 if (likely(ns9xxx_valid_gpio(gpio))) {
99 int ret = -EINVAL;
100 unsigned long flags;
101
102 gpio_set_value(gpio, value);
103
104 spin_lock_irqsave(&gpio_lock, flags);
105#if defined(CONFIG_PROCESSOR_NS9360)
106 if (processor_is_ns9360())
107 ret = __ns9360_gpio_configure(gpio, 1, 0, 3);
108 else
109#endif
110 BUG();
111
112 spin_unlock_irqrestore(&gpio_lock, flags);
113
114 return ret;
115 } else
116 return -EINVAL;
117}
118EXPORT_SYMBOL(gpio_direction_output);
119
120int gpio_get_value(unsigned gpio)
121{
122#if defined(CONFIG_PROCESSOR_NS9360)
123 if (processor_is_ns9360())
124 return ns9360_gpio_get_value(gpio);
125 else
126#endif
127 {
128 BUG();
129 return -EINVAL;
130 }
131}
132EXPORT_SYMBOL(gpio_get_value);
133
134void gpio_set_value(unsigned gpio, int value)
135{
136 unsigned long flags;
137 spin_lock_irqsave(&gpio_lock, flags);
138#if defined(CONFIG_PROCESSOR_NS9360)
139 if (processor_is_ns9360())
140 ns9360_gpio_set_value(gpio, value);
141 else
142#endif
143 BUG();
144
145 spin_unlock_irqrestore(&gpio_lock, flags);
146}
147EXPORT_SYMBOL(gpio_set_value);
diff --git a/arch/arm/mach-ns9xxx/include/mach/board.h b/arch/arm/mach-ns9xxx/include/mach/board.h
deleted file mode 100644
index 19ca6de46a45..000000000000
--- a/arch/arm/mach-ns9xxx/include/mach/board.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/include/mach/board.h
3 *
4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_BOARD_H
12#define __ASM_ARCH_BOARD_H
13
14#include <asm/mach-types.h>
15
16#define board_is_a9m9750dev() (0 \
17 || machine_is_cc9p9750dev() \
18 )
19
20#define board_is_a9mvali() (0 \
21 || machine_is_cc9p9750val() \
22 )
23
24#define board_is_jscc9p9210() (0 \
25 || machine_is_cc9p9210js() \
26 )
27
28#define board_is_jscc9p9215() (0 \
29 || machine_is_cc9p9215js() \
30 )
31
32#define board_is_jscc9p9360() (0 \
33 || machine_is_cc9p9360js() \
34 )
35
36#define board_is_uncbas() (0 \
37 || machine_is_cc7ucamry() \
38 )
39
40#endif /* ifndef __ASM_ARCH_BOARD_H */
diff --git a/arch/arm/mach-ns9xxx/include/mach/debug-macro.S b/arch/arm/mach-ns9xxx/include/mach/debug-macro.S
deleted file mode 100644
index 5a2acbdc3d67..000000000000
--- a/arch/arm/mach-ns9xxx/include/mach/debug-macro.S
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/include/mach/debug-macro.S
3 * Copyright (C) 2006 by Digi International Inc.
4 * All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by
8 * the Free Software Foundation.
9 */
10#include <mach/hardware.h>
11#include <asm/memory.h>
12
13#include <mach/regs-board-a9m9750dev.h>
14
15 .macro addruart, rp, rv
16 ldr \rp, =NS9XXX_CSxSTAT_PHYS(0)
17 ldr \rv, =io_p2v(NS9XXX_CSxSTAT_PHYS(0))
18 .endm
19
20#define UART_SHIFT 2
21#include <asm/hardware/debug-8250.S>
diff --git a/arch/arm/mach-ns9xxx/include/mach/entry-macro.S b/arch/arm/mach-ns9xxx/include/mach/entry-macro.S
deleted file mode 100644
index 71ca0319b547..000000000000
--- a/arch/arm/mach-ns9xxx/include/mach/entry-macro.S
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/include/mach/entry-macro.S
3 *
4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#include <mach/hardware.h>
12#include <mach/regs-sys-common.h>
13
14 .macro get_irqnr_preamble, base, tmp
15 ldr \base, =SYS_ISRADDR
16 .endm
17
18 .macro arch_ret_to_user, tmp1, tmp2
19 .endm
20
21 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
22 ldr \irqstat, [\base, #(SYS_ISA - SYS_ISRADDR)]
23 cmp \irqstat, #0
24 ldrne \irqnr, [\base]
25 .endm
26
27 .macro disable_fiq
28 .endm
diff --git a/arch/arm/mach-ns9xxx/include/mach/gpio.h b/arch/arm/mach-ns9xxx/include/mach/gpio.h
deleted file mode 100644
index 5eb349032579..000000000000
--- a/arch/arm/mach-ns9xxx/include/mach/gpio.h
+++ /dev/null
@@ -1,47 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/include/mach/gpio.h
3 *
4 * Copyright (C) 2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10*/
11#ifndef __ASM_ARCH_GPIO_H
12#define __ASM_ARCH_GPIO_H
13
14#include <asm/errno.h>
15
16int gpio_request(unsigned gpio, const char *label);
17
18void gpio_free(unsigned gpio);
19
20int ns9xxx_gpio_configure(unsigned gpio, int inv, int func);
21
22int gpio_direction_input(unsigned gpio);
23
24int gpio_direction_output(unsigned gpio, int value);
25
26int gpio_get_value(unsigned gpio);
27
28void gpio_set_value(unsigned gpio, int value);
29
30/*
31 * ns9xxx can use gpio pins to trigger an irq, but it's not generic
32 * enough to be supported by the gpio_to_irq/irq_to_gpio interface
33 */
34static inline int gpio_to_irq(unsigned gpio)
35{
36 return -EINVAL;
37}
38
39static inline int irq_to_gpio(unsigned irq)
40{
41 return -EINVAL;
42}
43
44/* get the cansleep() stubs */
45#include <asm-generic/gpio.h>
46
47#endif /* ifndef __ASM_ARCH_GPIO_H */
diff --git a/arch/arm/mach-ns9xxx/include/mach/hardware.h b/arch/arm/mach-ns9xxx/include/mach/hardware.h
deleted file mode 100644
index 76631128e11c..000000000000
--- a/arch/arm/mach-ns9xxx/include/mach/hardware.h
+++ /dev/null
@@ -1,77 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/include/mach/hardware.h
3 *
4 * Copyright (C) 2006 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_HARDWARE_H
12#define __ASM_ARCH_HARDWARE_H
13
14/*
15 * NetSilicon NS9xxx internal mapping:
16 *
17 * physical <--> virtual
18 * 0x90000000 - 0x906fffff <--> 0xf9000000 - 0xf96fffff
19 * 0xa0100000 - 0xa0afffff <--> 0xfa100000 - 0xfaafffff
20 */
21#define io_p2v(x) (0xf0000000 \
22 + (((x) & 0xf0000000) >> 4) \
23 + ((x) & 0x00ffffff))
24
25#define io_v2p(x) ((((x) & 0x0f000000) << 4) \
26 + ((x) & 0x00ffffff))
27
28#define __REGSHIFT(mask) ((mask) & (-(mask)))
29
30#define __REGBIT(bit) ((u32)1 << (bit))
31#define __REGBITS(hbit, lbit) ((((u32)1 << ((hbit) - (lbit) + 1)) - 1) << (lbit))
32#define __REGVAL(mask, value) (((value) * __REGSHIFT(mask)) & (mask))
33
34#ifndef __ASSEMBLY__
35
36# define __REG(x) ((void __iomem __force *)io_p2v((x)))
37# define __REG2(x, y) ((void __iomem __force *)(io_p2v((x)) + 4 * (y)))
38
39# define __REGSET(var, field, value) \
40 ((var) = (((var) & ~((field) & ~(value))) | (value)))
41
42# define REGSET(var, reg, field, value) \
43 __REGSET(var, reg ## _ ## field, reg ## _ ## field ## _ ## value)
44
45# define REGSET_IDX(var, reg, field, idx, value) \
46 __REGSET(var, reg ## _ ## field((idx)), reg ## _ ## field ## _ ## value((idx)))
47
48# define REGSETIM(var, reg, field, value) \
49 __REGSET(var, reg ## _ ## field, __REGVAL(reg ## _ ## field, (value)))
50
51# define REGSETIM_IDX(var, reg, field, idx, value) \
52 __REGSET(var, reg ## _ ## field((idx)), __REGVAL(reg ## _ ## field((idx)), (value)))
53
54# define __REGGET(var, field) \
55 (((var) & (field)))
56
57# define REGGET(var, reg, field) \
58 __REGGET(var, reg ## _ ## field)
59
60# define REGGET_IDX(var, reg, field, idx) \
61 __REGGET(var, reg ## _ ## field((idx)))
62
63# define REGGETIM(var, reg, field) \
64 __REGGET(var, reg ## _ ## field) / __REGSHIFT(reg ## _ ## field)
65
66# define REGGETIM_IDX(var, reg, field, idx) \
67 __REGGET(var, reg ## _ ## field((idx))) / \
68 __REGSHIFT(reg ## _ ## field((idx)))
69
70#else
71
72# define __REG(x) io_p2v(x)
73# define __REG2(x, y) io_p2v((x) + 4 * (y))
74
75#endif
76
77#endif /* ifndef __ASM_ARCH_HARDWARE_H */
diff --git a/arch/arm/mach-ns9xxx/include/mach/io.h b/arch/arm/mach-ns9xxx/include/mach/io.h
deleted file mode 100644
index f08451d2e1bc..000000000000
--- a/arch/arm/mach-ns9xxx/include/mach/io.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/include/mach/io.h
3 *
4 * Copyright (C) 2006 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_IO_H
12#define __ASM_ARCH_IO_H
13
14#define IO_SPACE_LIMIT 0xffffffff /* XXX */
15
16#define __io(a) __typesafe_io(a)
17#define __mem_pci(a) (a)
18#define __mem_isa(a) (IO_BASE + (a))
19
20#endif /* ifndef __ASM_ARCH_IO_H */
diff --git a/arch/arm/mach-ns9xxx/include/mach/irqs.h b/arch/arm/mach-ns9xxx/include/mach/irqs.h
deleted file mode 100644
index 13483949e210..000000000000
--- a/arch/arm/mach-ns9xxx/include/mach/irqs.h
+++ /dev/null
@@ -1,86 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/include/mach/irqs.h
3 *
4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_IRQS_H
12#define __ASM_ARCH_IRQS_H
13
14/* NetSilicon 9360 */
15#define IRQ_NS9XXX_WATCHDOG 0
16#define IRQ_NS9XXX_AHBBUSERR 1
17#define IRQ_NS9360_BBUSAGG 2
18/* irq 3 is reserved for NS9360 */
19#define IRQ_NS9XXX_ETHRX 4
20#define IRQ_NS9XXX_ETHTX 5
21#define IRQ_NS9XXX_ETHPHY 6
22#define IRQ_NS9360_LCD 7
23#define IRQ_NS9360_SERBRX 8
24#define IRQ_NS9360_SERBTX 9
25#define IRQ_NS9360_SERARX 10
26#define IRQ_NS9360_SERATX 11
27#define IRQ_NS9360_SERCRX 12
28#define IRQ_NS9360_SERCTX 13
29#define IRQ_NS9360_I2C 14
30#define IRQ_NS9360_BBUSDMA 15
31#define IRQ_NS9360_TIMER0 16
32#define IRQ_NS9360_TIMER1 17
33#define IRQ_NS9360_TIMER2 18
34#define IRQ_NS9360_TIMER3 19
35#define IRQ_NS9360_TIMER4 20
36#define IRQ_NS9360_TIMER5 21
37#define IRQ_NS9360_TIMER6 22
38#define IRQ_NS9360_TIMER7 23
39#define IRQ_NS9360_RTC 24
40#define IRQ_NS9360_USBHOST 25
41#define IRQ_NS9360_USBDEVICE 26
42#define IRQ_NS9360_IEEE1284 27
43#define IRQ_NS9XXX_EXT0 28
44#define IRQ_NS9XXX_EXT1 29
45#define IRQ_NS9XXX_EXT2 30
46#define IRQ_NS9XXX_EXT3 31
47
48#define BBUS_IRQ(irq) (32 + irq)
49
50#define IRQ_BBUS_DMA BBUS_IRQ(0)
51#define IRQ_BBUS_SERBRX BBUS_IRQ(2)
52#define IRQ_BBUS_SERBTX BBUS_IRQ(3)
53#define IRQ_BBUS_SERARX BBUS_IRQ(4)
54#define IRQ_BBUS_SERATX BBUS_IRQ(5)
55#define IRQ_BBUS_SERCRX BBUS_IRQ(6)
56#define IRQ_BBUS_SERCTX BBUS_IRQ(7)
57#define IRQ_BBUS_SERDRX BBUS_IRQ(8)
58#define IRQ_BBUS_SERDTX BBUS_IRQ(9)
59#define IRQ_BBUS_I2C BBUS_IRQ(10)
60#define IRQ_BBUS_1284 BBUS_IRQ(11)
61#define IRQ_BBUS_UTIL BBUS_IRQ(12)
62#define IRQ_BBUS_RTC BBUS_IRQ(13)
63#define IRQ_BBUS_USBHST BBUS_IRQ(14)
64#define IRQ_BBUS_USBDEV BBUS_IRQ(15)
65#define IRQ_BBUS_AHBDMA1 BBUS_IRQ(24)
66#define IRQ_BBUS_AHBDMA2 BBUS_IRQ(25)
67
68/*
69 * these Interrupts are specific for the a9m9750dev board.
70 * They are generated by an FPGA that interrupts the CPU on
71 * IRQ_NS9360_EXT2
72 */
73#define FPGA_IRQ(irq) (64 + irq)
74
75#define IRQ_FPGA_UARTA FPGA_IRQ(0)
76#define IRQ_FPGA_UARTB FPGA_IRQ(1)
77#define IRQ_FPGA_UARTC FPGA_IRQ(2)
78#define IRQ_FPGA_UARTD FPGA_IRQ(3)
79#define IRQ_FPGA_TOUCH FPGA_IRQ(4)
80#define IRQ_FPGA_CF FPGA_IRQ(5)
81#define IRQ_FPGA_CAN0 FPGA_IRQ(6)
82#define IRQ_FPGA_CAN1 FPGA_IRQ(7)
83
84#define NR_IRQS 72
85
86#endif /* __ASM_ARCH_IRQS_H */
diff --git a/arch/arm/mach-ns9xxx/include/mach/memory.h b/arch/arm/mach-ns9xxx/include/mach/memory.h
deleted file mode 100644
index 5c65aee6e7a9..000000000000
--- a/arch/arm/mach-ns9xxx/include/mach/memory.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/include/mach/memory.h
3 *
4 * Copyright (C) 2006 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10*/
11#ifndef __ASM_ARCH_MEMORY_H
12#define __ASM_ARCH_MEMORY_H
13
14/* x in [0..3] */
15#define NS9XXX_CSxSTAT_PHYS(x) UL(((x) + 4) << 28)
16
17#define NS9XXX_CS0STAT_LENGTH UL(0x1000)
18#define NS9XXX_CS1STAT_LENGTH UL(0x1000)
19#define NS9XXX_CS2STAT_LENGTH UL(0x1000)
20#define NS9XXX_CS3STAT_LENGTH UL(0x1000)
21
22#define PLAT_PHYS_OFFSET UL(0x00000000)
23
24#endif
diff --git a/arch/arm/mach-ns9xxx/include/mach/module.h b/arch/arm/mach-ns9xxx/include/mach/module.h
deleted file mode 100644
index 628e9752589b..000000000000
--- a/arch/arm/mach-ns9xxx/include/mach/module.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/include/mach/module.h
3 *
4 * Copyright (C) 2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_MODULE_H
12#define __ASM_ARCH_MODULE_H
13
14#include <asm/mach-types.h>
15
16#define module_is_cc7ucamry() (0 \
17 || machine_is_cc7ucamry() \
18 )
19
20#define module_is_cc9c() (0 \
21 )
22
23#define module_is_cc9p9210() (0 \
24 || machine_is_cc9p9210() \
25 || machine_is_cc9p9210js() \
26 )
27
28#define module_is_cc9p9215() (0 \
29 || machine_is_cc9p9215() \
30 || machine_is_cc9p9215js() \
31 )
32
33#define module_is_cc9p9360() (0 \
34 || machine_is_cc9p9360dev() \
35 || machine_is_cc9p9360js() \
36 )
37
38#define module_is_cc9p9750() (0 \
39 || machine_is_a9m9750() \
40 || machine_is_cc9p9750js() \
41 || machine_is_cc9p9750val() \
42 )
43
44#define module_is_ccw9c() (0 \
45 )
46
47#define module_is_inc20otter() (0 \
48 || machine_is_inc20otter() \
49 )
50
51#define module_is_otter() (0 \
52 || machine_is_otter() \
53 )
54
55#endif /* ifndef __ASM_ARCH_MODULE_H */
diff --git a/arch/arm/mach-ns9xxx/include/mach/processor-ns9360.h b/arch/arm/mach-ns9xxx/include/mach/processor-ns9360.h
deleted file mode 100644
index f41deda5129e..000000000000
--- a/arch/arm/mach-ns9xxx/include/mach/processor-ns9360.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/include/mach/processor-ns9360.h
3 *
4 * Copyright (C) 2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_PROCESSORNS9360_H
12#define __ASM_ARCH_PROCESSORNS9360_H
13
14#include <linux/init.h>
15
16void ns9360_reset(char mode);
17
18unsigned long ns9360_systemclock(void) __attribute__((const));
19
20static inline unsigned long ns9360_cpuclock(void) __attribute__((const));
21static inline unsigned long ns9360_cpuclock(void)
22{
23 return ns9360_systemclock() / 2;
24}
25
26void __init ns9360_map_io(void);
27
28extern struct sys_timer ns9360_timer;
29
30int ns9360_gpio_configure(unsigned gpio, int inv, int func);
31
32#endif /* ifndef __ASM_ARCH_PROCESSORNS9360_H */
diff --git a/arch/arm/mach-ns9xxx/include/mach/processor.h b/arch/arm/mach-ns9xxx/include/mach/processor.h
deleted file mode 100644
index 9f77f746a386..000000000000
--- a/arch/arm/mach-ns9xxx/include/mach/processor.h
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/include/mach/processor.h
3 *
4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_PROCESSOR_H
12#define __ASM_ARCH_PROCESSOR_H
13
14#include <mach/module.h>
15
16#define processor_is_ns9210() (0 \
17 || module_is_cc7ucamry() \
18 || module_is_cc9p9210() \
19 || module_is_inc20otter() \
20 || module_is_otter() \
21 )
22
23#define processor_is_ns9215() (0 \
24 || module_is_cc9p9215() \
25 )
26
27#define processor_is_ns9360() (0 \
28 || module_is_cc9p9360() \
29 || module_is_cc9c() \
30 || module_is_ccw9c() \
31 )
32
33#define processor_is_ns9750() (0 \
34 || module_is_cc9p9750() \
35 )
36
37#define processor_is_ns921x() (0 \
38 || processor_is_ns9210() \
39 || processor_is_ns9215() \
40 )
41
42#endif /* ifndef __ASM_ARCH_PROCESSOR_H */
diff --git a/arch/arm/mach-ns9xxx/include/mach/regs-bbu.h b/arch/arm/mach-ns9xxx/include/mach/regs-bbu.h
deleted file mode 100644
index af227c058fb9..000000000000
--- a/arch/arm/mach-ns9xxx/include/mach/regs-bbu.h
+++ /dev/null
@@ -1,45 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/include/mach/regs-bbu.h
3 *
4 * Copyright (C) 2006 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_REGSBBU_H
12#define __ASM_ARCH_REGSBBU_H
13
14#include <mach/hardware.h>
15
16/* BBus Utility */
17
18/* GPIO Configuration Registers block 1 */
19/* NOTE: the HRM starts counting at 1 for the GPIO registers, here the start is
20 * at 0 for each block. That is, BBU_GCONFb1(0) is GPIO Configuration Register
21 * #1, BBU_GCONFb2(0) is GPIO Configuration Register #8. */
22#define BBU_GCONFb1(x) __REG2(0x90600010, (x))
23#define BBU_GCONFb2(x) __REG2(0x90600100, (x))
24
25#define BBU_GCONFx_DIR(m) __REGBIT(3 + (((m) & 7) << 2))
26#define BBU_GCONFx_DIR_INPUT(m) __REGVAL(BBU_GCONFx_DIR(m), 0)
27#define BBU_GCONFx_DIR_OUTPUT(m) __REGVAL(BBU_GCONFx_DIR(m), 1)
28#define BBU_GCONFx_INV(m) __REGBIT(2 + (((m) & 7) << 2))
29#define BBU_GCONFx_INV_NO(m) __REGVAL(BBU_GCONFx_INV(m), 0)
30#define BBU_GCONFx_INV_YES(m) __REGVAL(BBU_GCONFx_INV(m), 1)
31#define BBU_GCONFx_FUNC(m) __REGBITS(1 + (((m) & 7) << 2), ((m) & 7) << 2)
32#define BBU_GCONFx_FUNC_0(m) __REGVAL(BBU_GCONFx_FUNC(m), 0)
33#define BBU_GCONFx_FUNC_1(m) __REGVAL(BBU_GCONFx_FUNC(m), 1)
34#define BBU_GCONFx_FUNC_2(m) __REGVAL(BBU_GCONFx_FUNC(m), 2)
35#define BBU_GCONFx_FUNC_3(m) __REGVAL(BBU_GCONFx_FUNC(m), 3)
36
37#define BBU_GCTRL1 __REG(0x90600030)
38#define BBU_GCTRL2 __REG(0x90600034)
39#define BBU_GCTRL3 __REG(0x90600120)
40
41#define BBU_GSTAT1 __REG(0x90600040)
42#define BBU_GSTAT2 __REG(0x90600044)
43#define BBU_GSTAT3 __REG(0x90600130)
44
45#endif /* ifndef __ASM_ARCH_REGSBBU_H */
diff --git a/arch/arm/mach-ns9xxx/include/mach/regs-board-a9m9750dev.h b/arch/arm/mach-ns9xxx/include/mach/regs-board-a9m9750dev.h
deleted file mode 100644
index cd1593693f56..000000000000
--- a/arch/arm/mach-ns9xxx/include/mach/regs-board-a9m9750dev.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/include/mach/regs-board-a9m9750dev.h
3 *
4 * Copyright (C) 2006 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_REGSBOARDA9M9750_H
12#define __ASM_ARCH_REGSBOARDA9M9750_H
13
14#include <mach/hardware.h>
15
16#define FPGA_UARTA_BASE io_p2v(NS9XXX_CSxSTAT_PHYS(0))
17#define FPGA_UARTB_BASE io_p2v(NS9XXX_CSxSTAT_PHYS(0) + 0x08)
18#define FPGA_UARTC_BASE io_p2v(NS9XXX_CSxSTAT_PHYS(0) + 0x10)
19#define FPGA_UARTD_BASE io_p2v(NS9XXX_CSxSTAT_PHYS(0) + 0x18)
20
21#define FPGA_IER __REG(NS9XXX_CSxSTAT_PHYS(0) + 0x50)
22#define FPGA_ISR __REG(NS9XXX_CSxSTAT_PHYS(0) + 0x60)
23
24#endif /* ifndef __ASM_ARCH_REGSBOARDA9M9750_H */
diff --git a/arch/arm/mach-ns9xxx/include/mach/regs-mem.h b/arch/arm/mach-ns9xxx/include/mach/regs-mem.h
deleted file mode 100644
index f1625bf8cdce..000000000000
--- a/arch/arm/mach-ns9xxx/include/mach/regs-mem.h
+++ /dev/null
@@ -1,135 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/include/mach/regs-mem.h
3 *
4 * Copyright (C) 2006 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_REGSMEM_H
12#define __ASM_ARCH_REGSMEM_H
13
14#include <mach/hardware.h>
15
16/* Memory Module */
17
18/* Control register */
19#define MEM_CTRL __REG(0xa0700000)
20
21/* Status register */
22#define MEM_STAT __REG(0xa0700004)
23
24/* Configuration register */
25#define MEM_CONF __REG(0xa0700008)
26
27/* Dynamic Memory Control register */
28#define MEM_DMCTRL __REG(0xa0700020)
29
30/* Dynamic Memory Refresh Timer */
31#define MEM_DMRT __REG(0xa0700024)
32
33/* Dynamic Memory Read Configuration register */
34#define MEM_DMRC __REG(0xa0700028)
35
36/* Dynamic Memory Precharge Command Period (tRP) */
37#define MEM_DMPCP __REG(0xa0700030)
38
39/* Dynamic Memory Active to Precharge Command Period (tRAS) */
40#define MEM_DMAPCP __REG(0xa0700034)
41
42/* Dynamic Memory Self-Refresh Exit Time (tSREX) */
43#define MEM_DMSRET __REG(0xa0700038)
44
45/* Dynamic Memory Last Data Out to Active Time (tAPR) */
46#define MEM_DMLDOAT __REG(0xa070003c)
47
48/* Dynamic Memory Data-in to Active Command Time (tDAL or TAPW) */
49#define MEM_DMDIACT __REG(0xa0700040)
50
51/* Dynamic Memory Write Recovery Time (tWR, tDPL, tRWL, tRDL) */
52#define MEM_DMWRT __REG(0xa0700044)
53
54/* Dynamic Memory Active to Active Command Period (tRC) */
55#define MEM_DMAACP __REG(0xa0700048)
56
57/* Dynamic Memory Auto Refresh Period, and Auto Refresh to Active Command Period (tRFC) */
58#define MEM_DMARP __REG(0xa070004c)
59
60/* Dynamic Memory Exit Self-Refresh to Active Command (tXSR) */
61#define MEM_DMESRAC __REG(0xa0700050)
62
63/* Dynamic Memory Active Bank A to Active B Time (tRRD) */
64#define MEM_DMABAABT __REG(0xa0700054)
65
66/* Dynamic Memory Load Mode register to Active Command Time (tMRD) */
67#define MEM_DMLMACT __REG(0xa0700058)
68
69/* Static Memory Extended Wait */
70#define MEM_SMEW __REG(0xa0700080)
71
72/* Dynamic Memory Configuration Register x */
73#define MEM_DMCONF(x) __REG2(0xa0700100, (x) << 3)
74
75/* Dynamic Memory RAS and CAS Delay x */
76#define MEM_DMRCD(x) __REG2(0xa0700104, (x) << 3)
77
78/* Static Memory Configuration Register x */
79#define MEM_SMC(x) __REG2(0xa0700200, (x) << 3)
80
81/* Static Memory Configuration Register x: Write protect */
82#define MEM_SMC_PSMC __REGBIT(20)
83#define MEM_SMC_PSMC_OFF __REGVAL(MEM_SMC_PSMC, 0)
84#define MEM_SMC_PSMC_ON __REGVAL(MEM_SMC_PSMC, 1)
85
86/* Static Memory Configuration Register x: Buffer enable */
87#define MEM_SMC_BSMC __REGBIT(19)
88#define MEM_SMC_BSMC_OFF __REGVAL(MEM_SMC_BSMC, 0)
89#define MEM_SMC_BSMC_ON __REGVAL(MEM_SMC_BSMC, 1)
90
91/* Static Memory Configuration Register x: Extended Wait */
92#define MEM_SMC_EW __REGBIT(8)
93#define MEM_SMC_EW_OFF __REGVAL(MEM_SMC_EW, 0)
94#define MEM_SMC_EW_ON __REGVAL(MEM_SMC_EW, 1)
95
96/* Static Memory Configuration Register x: Byte lane state */
97#define MEM_SMC_PB __REGBIT(7)
98#define MEM_SMC_PB_0 __REGVAL(MEM_SMC_PB, 0)
99#define MEM_SMC_PB_1 __REGVAL(MEM_SMC_PB, 1)
100
101/* Static Memory Configuration Register x: Chip select polarity */
102#define MEM_SMC_PC __REGBIT(6)
103#define MEM_SMC_PC_AL __REGVAL(MEM_SMC_PC, 0)
104#define MEM_SMC_PC_AH __REGVAL(MEM_SMC_PC, 1)
105
106/* static memory configuration register x: page mode*/
107#define MEM_SMC_PM __REGBIT(3)
108#define MEM_SMC_PM_DIS __REGVAL(MEM_SMC_PM, 0)
109#define MEM_SMC_PM_ASYNC __REGVAL(MEM_SMC_PM, 1)
110
111/* static memory configuration register x: Memory width */
112#define MEM_SMC_MW __REGBITS(1, 0)
113#define MEM_SMC_MW_8 __REGVAL(MEM_SMC_MW, 0)
114#define MEM_SMC_MW_16 __REGVAL(MEM_SMC_MW, 1)
115#define MEM_SMC_MW_32 __REGVAL(MEM_SMC_MW, 2)
116
117/* Static Memory Write Enable Delay x */
118#define MEM_SMWED(x) __REG2(0xa0700204, (x) << 3)
119
120/* Static Memory Output Enable Delay x */
121#define MEM_SMOED(x) __REG2(0xa0700208, (x) << 3)
122
123/* Static Memory Read Delay x */
124#define MEM_SMRD(x) __REG2(0xa070020c, (x) << 3)
125
126/* Static Memory Page Mode Read Delay 0 */
127#define MEM_SMPMRD(x) __REG2(0xa0700210, (x) << 3)
128
129/* Static Memory Write Delay */
130#define MEM_SMWD(x) __REG2(0xa0700214, (x) << 3)
131
132/* Static Memory Turn Round Delay x */
133#define MEM_SWT(x) __REG2(0xa0700218, (x) << 3)
134
135#endif /* ifndef __ASM_ARCH_REGSMEM_H */
diff --git a/arch/arm/mach-ns9xxx/include/mach/regs-sys-common.h b/arch/arm/mach-ns9xxx/include/mach/regs-sys-common.h
deleted file mode 100644
index 14f91dfd5736..000000000000
--- a/arch/arm/mach-ns9xxx/include/mach/regs-sys-common.h
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/include/mach/regs-sys-common.h
3 *
4 * Copyright (C) 2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11
12#ifndef __ASM_ARCH_REGSSYSCOMMON_H
13#define __ASM_ARCH_REGSSYSCOMMON_H
14#include <mach/hardware.h>
15
16/* Interrupt Vector Address Register Level x */
17#define SYS_IVA(x) __REG2(0xa09000c4, (x))
18
19/* Interrupt Configuration registers */
20#define SYS_IC(x) __REG2(0xa0900144, (x))
21
22/* ISRADDR */
23#define SYS_ISRADDR __REG(0xa0900164)
24
25/* Interrupt Status Active */
26#define SYS_ISA __REG(0xa0900168)
27
28/* Interrupt Status Raw */
29#define SYS_ISR __REG(0xa090016c)
30
31#endif /* ifndef __ASM_ARCH_REGSSYSCOMMON_H */
diff --git a/arch/arm/mach-ns9xxx/include/mach/regs-sys-ns9360.h b/arch/arm/mach-ns9xxx/include/mach/regs-sys-ns9360.h
deleted file mode 100644
index 8ff254d9901c..000000000000
--- a/arch/arm/mach-ns9xxx/include/mach/regs-sys-ns9360.h
+++ /dev/null
@@ -1,148 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/include/mach/regs-sys-ns9360.h
3 *
4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_REGSSYSNS9360_H
12#define __ASM_ARCH_REGSSYSNS9360_H
13
14#include <mach/hardware.h>
15
16/* System Control Module */
17
18/* AHB Arbiter Gen Configuration */
19#define SYS_AHBAGENCONF __REG(0xa0900000)
20
21/* BRC */
22#define SYS_BRC(x) __REG2(0xa0900004, (x))
23
24/* Timer x Reload Count register */
25#define SYS_TRC(x) __REG2(0xa0900044, (x))
26
27/* Timer x Read register */
28#define SYS_TR(x) __REG2(0xa0900084, (x))
29
30/* Timer Interrupt Status register */
31#define SYS_TIS __REG(0xa0900170)
32
33/* PLL Configuration register */
34#define SYS_PLL __REG(0xa0900188)
35
36/* PLL FS status */
37#define SYS_PLL_FS __REGBITS(24, 23)
38
39/* PLL ND status */
40#define SYS_PLL_ND __REGBITS(20, 16)
41
42/* PLL Configuration register: PLL SW change */
43#define SYS_PLL_SWC __REGBIT(15)
44#define SYS_PLL_SWC_NO __REGVAL(SYS_PLL_SWC, 0)
45#define SYS_PLL_SWC_YES __REGVAL(SYS_PLL_SWC, 1)
46
47/* Timer x Control register */
48#define SYS_TC(x) __REG2(0xa0900190, (x))
49
50/* Timer x Control register: Timer enable */
51#define SYS_TCx_TEN __REGBIT(15)
52#define SYS_TCx_TEN_DIS __REGVAL(SYS_TCx_TEN, 0)
53#define SYS_TCx_TEN_EN __REGVAL(SYS_TCx_TEN, 1)
54
55/* Timer x Control register: CPU debug mode */
56#define SYS_TCx_TDBG __REGBIT(10)
57#define SYS_TCx_TDBG_CONT __REGVAL(SYS_TCx_TDBG, 0)
58#define SYS_TCx_TDBG_STOP __REGVAL(SYS_TCx_TDBG, 1)
59
60/* Timer x Control register: Interrupt clear */
61#define SYS_TCx_INTC __REGBIT(9)
62#define SYS_TCx_INTC_UNSET __REGVAL(SYS_TCx_INTC, 0)
63#define SYS_TCx_INTC_SET __REGVAL(SYS_TCx_INTC, 1)
64
65/* Timer x Control register: Timer clock select */
66#define SYS_TCx_TLCS __REGBITS(8, 6)
67#define SYS_TCx_TLCS_CPU __REGVAL(SYS_TCx_TLCS, 0) /* CPU clock */
68#define SYS_TCx_TLCS_DIV2 __REGVAL(SYS_TCx_TLCS, 1) /* CPU clock / 2 */
69#define SYS_TCx_TLCS_DIV4 __REGVAL(SYS_TCx_TLCS, 2) /* CPU clock / 4 */
70#define SYS_TCx_TLCS_DIV8 __REGVAL(SYS_TCx_TLCS, 3) /* CPU clock / 8 */
71#define SYS_TCx_TLCS_DIV16 __REGVAL(SYS_TCx_TLCS, 4) /* CPU clock / 16 */
72#define SYS_TCx_TLCS_DIV32 __REGVAL(SYS_TCx_TLCS, 5) /* CPU clock / 32 */
73#define SYS_TCx_TLCS_DIV64 __REGVAL(SYS_TCx_TLCS, 6) /* CPU clock / 64 */
74#define SYS_TCx_TLCS_EXT __REGVAL(SYS_TCx_TLCS, 7)
75
76/* Timer x Control register: Timer mode */
77#define SYS_TCx_TM __REGBITS(5, 4)
78#define SYS_TCx_TM_IEE __REGVAL(SYS_TCx_TM, 0) /* Internal timer or external event */
79#define SYS_TCx_TM_ELL __REGVAL(SYS_TCx_TM, 1) /* External low-level, gated timer */
80#define SYS_TCx_TM_EHL __REGVAL(SYS_TCx_TM, 2) /* External high-level, gated timer */
81#define SYS_TCx_TM_CONCAT __REGVAL(SYS_TCx_TM, 3) /* Concatenate the lower timer. */
82
83/* Timer x Control register: Interrupt select */
84#define SYS_TCx_INTS __REGBIT(3)
85#define SYS_TCx_INTS_DIS __REGVAL(SYS_TCx_INTS, 0)
86#define SYS_TCx_INTS_EN __REGVAL(SYS_TCx_INTS, 1)
87
88/* Timer x Control register: Up/down select */
89#define SYS_TCx_UDS __REGBIT(2)
90#define SYS_TCx_UDS_UP __REGVAL(SYS_TCx_UDS, 0)
91#define SYS_TCx_UDS_DOWN __REGVAL(SYS_TCx_UDS, 1)
92
93/* Timer x Control register: 32- or 16-bit timer */
94#define SYS_TCx_TSZ __REGBIT(1)
95#define SYS_TCx_TSZ_16 __REGVAL(SYS_TCx_TSZ, 0)
96#define SYS_TCx_TSZ_32 __REGVAL(SYS_TCx_TSZ, 1)
97
98/* Timer x Control register: Reload enable */
99#define SYS_TCx_REN __REGBIT(0)
100#define SYS_TCx_REN_DIS __REGVAL(SYS_TCx_REN, 0)
101#define SYS_TCx_REN_EN __REGVAL(SYS_TCx_REN, 1)
102
103/* System Memory Chip Select x Dynamic Memory Base */
104#define SYS_SMCSDMB(x) __REG2(0xa09001d0, (x) << 1)
105
106/* System Memory Chip Select x Dynamic Memory Mask */
107#define SYS_SMCSDMM(x) __REG2(0xa09001d4, (x) << 1)
108
109/* System Memory Chip Select x Static Memory Base */
110#define SYS_SMCSSMB(x) __REG2(0xa09001f0, (x) << 1)
111
112/* System Memory Chip Select x Static Memory Base: Chip select x base */
113#define SYS_SMCSSMB_CSxB __REGBITS(31, 12)
114
115/* System Memory Chip Select x Static Memory Mask */
116#define SYS_SMCSSMM(x) __REG2(0xa09001f4, (x) << 1)
117
118/* System Memory Chip Select x Static Memory Mask: Chip select x mask */
119#define SYS_SMCSSMM_CSxM __REGBITS(31, 12)
120
121/* System Memory Chip Select x Static Memory Mask: Chip select x enable */
122#define SYS_SMCSSMM_CSEx __REGBIT(0)
123#define SYS_SMCSSMM_CSEx_DIS __REGVAL(SYS_SMCSSMM_CSEx, 0)
124#define SYS_SMCSSMM_CSEx_EN __REGVAL(SYS_SMCSSMM_CSEx, 1)
125
126/* General purpose, user-defined ID register */
127#define SYS_GENID __REG(0xa0900210)
128
129/* External Interrupt x Control register */
130#define SYS_EIC(x) __REG2(0xa0900214, (x))
131
132/* External Interrupt x Control register: Status */
133#define SYS_EIC_STS __REGBIT(3)
134
135/* External Interrupt x Control register: Clear */
136#define SYS_EIC_CLR __REGBIT(2)
137
138/* External Interrupt x Control register: Polarity */
139#define SYS_EIC_PLTY __REGBIT(1)
140#define SYS_EIC_PLTY_AH __REGVAL(SYS_EIC_PLTY, 0)
141#define SYS_EIC_PLTY_AL __REGVAL(SYS_EIC_PLTY, 1)
142
143/* External Interrupt x Control register: Level edge */
144#define SYS_EIC_LVEDG __REGBIT(0)
145#define SYS_EIC_LVEDG_LEVEL __REGVAL(SYS_EIC_LVEDG, 0)
146#define SYS_EIC_LVEDG_EDGE __REGVAL(SYS_EIC_LVEDG, 1)
147
148#endif /* ifndef __ASM_ARCH_REGSSYSNS9360_H */
diff --git a/arch/arm/mach-ns9xxx/include/mach/system.h b/arch/arm/mach-ns9xxx/include/mach/system.h
deleted file mode 100644
index 1561588ca364..000000000000
--- a/arch/arm/mach-ns9xxx/include/mach/system.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/include/mach/system.h
3 *
4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_SYSTEM_H
12#define __ASM_ARCH_SYSTEM_H
13
14#include <asm/proc-fns.h>
15#include <mach/processor.h>
16#include <mach/processor-ns9360.h>
17
18static inline void arch_idle(void)
19{
20 cpu_do_idle();
21}
22
23static inline void arch_reset(char mode, const char *cmd)
24{
25#ifdef CONFIG_PROCESSOR_NS9360
26 if (processor_is_ns9360())
27 ns9360_reset(mode);
28 else
29#endif
30 BUG();
31
32 BUG();
33}
34
35#endif /* ifndef __ASM_ARCH_SYSTEM_H */
diff --git a/arch/arm/mach-ns9xxx/include/mach/timex.h b/arch/arm/mach-ns9xxx/include/mach/timex.h
deleted file mode 100644
index 734a8d8bd578..000000000000
--- a/arch/arm/mach-ns9xxx/include/mach/timex.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/include/mach/timex.h
3 *
4 * Copyright (C) 2005-2006 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_TIMEX_H
12#define __ASM_ARCH_TIMEX_H
13
14/*
15 * value for CLOCK_TICK_RATE stolen from arch/arm/mach-s3c2410/include/mach/timex.h.
16 * See there for an explanation.
17 */
18#define CLOCK_TICK_RATE 12000000
19
20#endif /* ifndef __ASM_ARCH_TIMEX_H */
diff --git a/arch/arm/mach-ns9xxx/include/mach/uncompress.h b/arch/arm/mach-ns9xxx/include/mach/uncompress.h
deleted file mode 100644
index 00ef4a6d7cb4..000000000000
--- a/arch/arm/mach-ns9xxx/include/mach/uncompress.h
+++ /dev/null
@@ -1,164 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/include/mach/uncompress.h
3 *
4 * Copyright (C) 2006 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_UNCOMPRESS_H
12#define __ASM_ARCH_UNCOMPRESS_H
13
14#include <linux/io.h>
15
16#define __REG(x) ((void __iomem __force *)(x))
17
18static void putc_dummy(char c, void __iomem *base)
19{
20 /* nothing */
21}
22
23int timeout;
24
25static void putc_ns9360(char c, void __iomem *base)
26{
27 do {
28 if (timeout)
29 --timeout;
30
31 if (__raw_readl(base + 8) & (1 << 3)) {
32 __raw_writeb(c, base + 16);
33 timeout = 0x10000;
34 break;
35 }
36 } while (timeout);
37}
38
39static void putc_a9m9750dev(char c, void __iomem *base)
40{
41 do {
42 if (timeout)
43 --timeout;
44
45 if (__raw_readb(base + 5) & (1 << 5)) {
46 __raw_writeb(c, base);
47 timeout = 0x10000;
48 break;
49 }
50 } while (timeout);
51
52}
53
54static void putc_ns921x(char c, void __iomem *base)
55{
56 do {
57 if (timeout)
58 --timeout;
59
60 if (!(__raw_readl(base) & (1 << 11))) {
61 __raw_writeb(c, base + 0x0028);
62 timeout = 0x10000;
63 break;
64 }
65 } while (timeout);
66}
67
68#define MSCS __REG(0xA0900184)
69
70#define NS9360_UARTA __REG(0x90200040)
71#define NS9360_UARTB __REG(0x90200000)
72#define NS9360_UARTC __REG(0x90300000)
73#define NS9360_UARTD __REG(0x90300040)
74
75#define NS9360_UART_ENABLED(base) \
76 (__raw_readl(NS9360_UARTA) & (1 << 31))
77
78#define A9M9750DEV_UARTA __REG(0x40000000)
79
80#define NS921XSYS_CLOCK __REG(0xa090017c)
81#define NS921X_UARTA __REG(0x90010000)
82#define NS921X_UARTB __REG(0x90018000)
83#define NS921X_UARTC __REG(0x90020000)
84#define NS921X_UARTD __REG(0x90028000)
85
86#define NS921X_UART_ENABLED(base) \
87 (__raw_readl((base) + 0x1000) & (1 << 29))
88
89static void autodetect(void (**putc)(char, void __iomem *), void __iomem **base)
90{
91 timeout = 0x10000;
92 if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x00) {
93 /* ns9360 or ns9750 */
94 if (NS9360_UART_ENABLED(NS9360_UARTA)) {
95 *putc = putc_ns9360;
96 *base = NS9360_UARTA;
97 return;
98 } else if (NS9360_UART_ENABLED(NS9360_UARTB)) {
99 *putc = putc_ns9360;
100 *base = NS9360_UARTB;
101 return;
102 } else if (NS9360_UART_ENABLED(NS9360_UARTC)) {
103 *putc = putc_ns9360;
104 *base = NS9360_UARTC;
105 return;
106 } else if (NS9360_UART_ENABLED(NS9360_UARTD)) {
107 *putc = putc_ns9360;
108 *base = NS9360_UARTD;
109 return;
110 } else if (__raw_readl(__REG(0xa09001f4)) == 0xfffff001) {
111 *putc = putc_a9m9750dev;
112 *base = A9M9750DEV_UARTA;
113 return;
114 }
115 } else if (((__raw_readl(MSCS) >> 16) & 0xfe) == 0x02) {
116 /* ns921x */
117 u32 clock = __raw_readl(NS921XSYS_CLOCK);
118
119 if ((clock & (1 << 1)) &&
120 NS921X_UART_ENABLED(NS921X_UARTA)) {
121 *putc = putc_ns921x;
122 *base = NS921X_UARTA;
123 return;
124 } else if ((clock & (1 << 2)) &&
125 NS921X_UART_ENABLED(NS921X_UARTB)) {
126 *putc = putc_ns921x;
127 *base = NS921X_UARTB;
128 return;
129 } else if ((clock & (1 << 3)) &&
130 NS921X_UART_ENABLED(NS921X_UARTC)) {
131 *putc = putc_ns921x;
132 *base = NS921X_UARTC;
133 return;
134 } else if ((clock & (1 << 4)) &&
135 NS921X_UART_ENABLED(NS921X_UARTD)) {
136 *putc = putc_ns921x;
137 *base = NS921X_UARTD;
138 return;
139 }
140 }
141
142 *putc = putc_dummy;
143}
144
145void (*myputc)(char, void __iomem *);
146void __iomem *base;
147
148static void putc(char c)
149{
150 myputc(c, base);
151}
152
153static void arch_decomp_setup(void)
154{
155 autodetect(&myputc, &base);
156}
157#define arch_decomp_wdog()
158
159static void flush(void)
160{
161 /* nothing */
162}
163
164#endif /* ifndef __ASM_ARCH_UNCOMPRESS_H */
diff --git a/arch/arm/mach-ns9xxx/include/mach/vmalloc.h b/arch/arm/mach-ns9xxx/include/mach/vmalloc.h
deleted file mode 100644
index c8651974c4b0..000000000000
--- a/arch/arm/mach-ns9xxx/include/mach/vmalloc.h
+++ /dev/null
@@ -1,16 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/include/mach/vmalloc.h
3 *
4 * Copyright (C) 2006 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#ifndef __ASM_ARCH_VMALLOC_H
12#define __ASM_ARCH_VMALLOC_H
13
14#define VMALLOC_END (0xf0000000UL)
15
16#endif /* ifndef __ASM_ARCH_VMALLOC_H */
diff --git a/arch/arm/mach-ns9xxx/irq.c b/arch/arm/mach-ns9xxx/irq.c
deleted file mode 100644
index 37ab0a2b83ad..000000000000
--- a/arch/arm/mach-ns9xxx/irq.c
+++ /dev/null
@@ -1,74 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/irq.c
3 *
4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#include <linux/interrupt.h>
12#include <linux/kernel_stat.h>
13#include <linux/io.h>
14#include <asm/mach/irq.h>
15#include <mach/regs-sys-common.h>
16#include <mach/irqs.h>
17#include <mach/board.h>
18
19#include "generic.h"
20
21/* simple interrupt prio table: prio(x) < prio(y) <=> x < y */
22#define irq2prio(i) (i)
23#define prio2irq(p) (p)
24
25static void ns9xxx_mask_irq(struct irq_data *d)
26{
27 /* XXX: better use cpp symbols */
28 int prio = irq2prio(d->irq);
29 u32 ic = __raw_readl(SYS_IC(prio / 4));
30 ic &= ~(1 << (7 + 8 * (3 - (prio & 3))));
31 __raw_writel(ic, SYS_IC(prio / 4));
32}
33
34static void ns9xxx_eoi_irq(struct irq_data *d)
35{
36 __raw_writel(0, SYS_ISRADDR);
37}
38
39static void ns9xxx_unmask_irq(struct irq_data *d)
40{
41 /* XXX: better use cpp symbols */
42 int prio = irq2prio(d->irq);
43 u32 ic = __raw_readl(SYS_IC(prio / 4));
44 ic |= 1 << (7 + 8 * (3 - (prio & 3)));
45 __raw_writel(ic, SYS_IC(prio / 4));
46}
47
48static struct irq_chip ns9xxx_chip = {
49 .irq_eoi = ns9xxx_eoi_irq,
50 .irq_mask = ns9xxx_mask_irq,
51 .irq_unmask = ns9xxx_unmask_irq,
52};
53
54void __init ns9xxx_init_irq(void)
55{
56 int i;
57
58 /* disable all IRQs */
59 for (i = 0; i < 8; ++i)
60 __raw_writel(prio2irq(4 * i) << 24 |
61 prio2irq(4 * i + 1) << 16 |
62 prio2irq(4 * i + 2) << 8 |
63 prio2irq(4 * i + 3),
64 SYS_IC(i));
65
66 for (i = 0; i < 32; ++i)
67 __raw_writel(prio2irq(i), SYS_IVA(i));
68
69 for (i = 0; i <= 31; ++i) {
70 irq_set_chip_and_handler(i, &ns9xxx_chip, handle_fasteoi_irq);
71 set_irq_flags(i, IRQF_VALID);
72 irq_set_status_flags(i, IRQ_LEVEL);
73 }
74}
diff --git a/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c b/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c
deleted file mode 100644
index 2858417d8d8a..000000000000
--- a/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/mach-cc9p9360dev.c
3 *
4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#include <asm/mach/arch.h>
12#include <asm/mach-types.h>
13
14#include <mach/processor-ns9360.h>
15
16#include "board-a9m9750dev.h"
17#include "generic.h"
18
19static void __init mach_cc9p9360dev_map_io(void)
20{
21 ns9360_map_io();
22 board_a9m9750dev_map_io();
23}
24
25static void __init mach_cc9p9360dev_init_irq(void)
26{
27 ns9xxx_init_irq();
28 board_a9m9750dev_init_irq();
29}
30
31static void __init mach_cc9p9360dev_init_machine(void)
32{
33 ns9xxx_init_machine();
34 board_a9m9750dev_init_machine();
35}
36
37MACHINE_START(CC9P9360DEV, "Digi ConnectCore 9P 9360 on an A9M9750 Devboard")
38 .map_io = mach_cc9p9360dev_map_io,
39 .init_irq = mach_cc9p9360dev_init_irq,
40 .init_machine = mach_cc9p9360dev_init_machine,
41 .timer = &ns9360_timer,
42 .boot_params = 0x100,
43MACHINE_END
diff --git a/arch/arm/mach-ns9xxx/mach-cc9p9360js.c b/arch/arm/mach-ns9xxx/mach-cc9p9360js.c
deleted file mode 100644
index 729f68da4293..000000000000
--- a/arch/arm/mach-ns9xxx/mach-cc9p9360js.c
+++ /dev/null
@@ -1,31 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/mach-cc9p9360js.c
3 *
4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#include <asm/mach/arch.h>
12#include <asm/mach-types.h>
13
14#include <mach/processor-ns9360.h>
15
16#include "board-jscc9p9360.h"
17#include "generic.h"
18
19static void __init mach_cc9p9360js_init_machine(void)
20{
21 ns9xxx_init_machine();
22 board_jscc9p9360_init_machine();
23}
24
25MACHINE_START(CC9P9360JS, "Digi ConnectCore 9P 9360 on an JSCC9P9360 Devboard")
26 .map_io = ns9360_map_io,
27 .init_irq = ns9xxx_init_irq,
28 .init_machine = mach_cc9p9360js_init_machine,
29 .timer = &ns9360_timer,
30 .boot_params = 0x100,
31MACHINE_END
diff --git a/arch/arm/mach-ns9xxx/plat-serial8250.c b/arch/arm/mach-ns9xxx/plat-serial8250.c
deleted file mode 100644
index 463e92465fda..000000000000
--- a/arch/arm/mach-ns9xxx/plat-serial8250.c
+++ /dev/null
@@ -1,70 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/plat-serial8250.c
3 *
4 * Copyright (C) 2008 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#include <linux/platform_device.h>
12#include <linux/serial_8250.h>
13#include <linux/slab.h>
14
15#include <mach/regs-board-a9m9750dev.h>
16#include <mach/board.h>
17
18#define DRIVER_NAME "serial8250"
19
20static int __init ns9xxx_plat_serial8250_init(void)
21{
22 struct plat_serial8250_port *pdata;
23 struct platform_device *pdev;
24 int ret = -ENOMEM;
25 int i;
26
27 if (!board_is_a9m9750dev())
28 return -ENODEV;
29
30 pdev = platform_device_alloc(DRIVER_NAME, 0);
31 if (!pdev)
32 goto err;
33
34 pdata = kzalloc(5 * sizeof(*pdata), GFP_KERNEL);
35 if (!pdata)
36 goto err;
37
38 pdev->dev.platform_data = pdata;
39
40 pdata[0].iobase = FPGA_UARTA_BASE;
41 pdata[1].iobase = FPGA_UARTB_BASE;
42 pdata[2].iobase = FPGA_UARTC_BASE;
43 pdata[3].iobase = FPGA_UARTD_BASE;
44
45 for (i = 0; i < 4; ++i) {
46 pdata[i].membase = (void __iomem *)pdata[i].iobase;
47 pdata[i].mapbase = pdata[i].iobase;
48 pdata[i].iotype = UPIO_MEM;
49 pdata[i].uartclk = 18432000;
50 pdata[i].flags = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ;
51 }
52
53 pdata[0].irq = IRQ_FPGA_UARTA;
54 pdata[1].irq = IRQ_FPGA_UARTB;
55 pdata[2].irq = IRQ_FPGA_UARTC;
56 pdata[3].irq = IRQ_FPGA_UARTD;
57
58 ret = platform_device_add(pdev);
59 if (ret) {
60err:
61 platform_device_put(pdev);
62
63 printk(KERN_WARNING "Could not add %s (errno=%d)\n",
64 DRIVER_NAME, ret);
65 }
66
67 return 0;
68}
69
70arch_initcall(ns9xxx_plat_serial8250_init);
diff --git a/arch/arm/mach-ns9xxx/processor-ns9360.c b/arch/arm/mach-ns9xxx/processor-ns9360.c
deleted file mode 100644
index aed1999d24fc..000000000000
--- a/arch/arm/mach-ns9xxx/processor-ns9360.c
+++ /dev/null
@@ -1,53 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/processor-ns9360.c
3 *
4 * Copyright (C) 2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#include <linux/io.h>
12#include <linux/kernel.h>
13
14#include <asm/page.h>
15#include <asm/mach/map.h>
16#include <mach/processor-ns9360.h>
17#include <mach/regs-sys-ns9360.h>
18
19void ns9360_reset(char mode)
20{
21 u32 reg;
22
23 reg = __raw_readl(SYS_PLL) >> 16;
24 REGSET(reg, SYS_PLL, SWC, YES);
25 __raw_writel(reg, SYS_PLL);
26}
27
28#define CRYSTAL 29491200 /* Hz */
29unsigned long ns9360_systemclock(void)
30{
31 u32 pll = __raw_readl(SYS_PLL);
32 return CRYSTAL * (REGGETIM(pll, SYS_PLL, ND) + 1)
33 >> REGGETIM(pll, SYS_PLL, FS);
34}
35
36static struct map_desc ns9360_io_desc[] __initdata = {
37 { /* BBus */
38 .virtual = io_p2v(0x90000000),
39 .pfn = __phys_to_pfn(0x90000000),
40 .length = 0x00700000,
41 .type = MT_DEVICE,
42 }, { /* AHB */
43 .virtual = io_p2v(0xa0100000),
44 .pfn = __phys_to_pfn(0xa0100000),
45 .length = 0x00900000,
46 .type = MT_DEVICE,
47 },
48};
49
50void __init ns9360_map_io(void)
51{
52 iotable_init(ns9360_io_desc, ARRAY_SIZE(ns9360_io_desc));
53}
diff --git a/arch/arm/mach-ns9xxx/time-ns9360.c b/arch/arm/mach-ns9xxx/time-ns9360.c
deleted file mode 100644
index 9ca32f55728b..000000000000
--- a/arch/arm/mach-ns9xxx/time-ns9360.c
+++ /dev/null
@@ -1,181 +0,0 @@
1/*
2 * arch/arm/mach-ns9xxx/time-ns9360.c
3 *
4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#include <linux/jiffies.h>
12#include <linux/interrupt.h>
13#include <linux/irq.h>
14#include <linux/stringify.h>
15#include <linux/clocksource.h>
16#include <linux/clockchips.h>
17
18#include <mach/processor-ns9360.h>
19#include <mach/regs-sys-ns9360.h>
20#include <mach/irqs.h>
21#include <mach/system.h>
22#include "generic.h"
23
24#define TIMER_CLOCKSOURCE 0
25#define TIMER_CLOCKEVENT 1
26static u32 latch;
27
28static cycle_t ns9360_clocksource_read(struct clocksource *cs)
29{
30 return __raw_readl(SYS_TR(TIMER_CLOCKSOURCE));
31}
32
33static struct clocksource ns9360_clocksource = {
34 .name = "ns9360-timer" __stringify(TIMER_CLOCKSOURCE),
35 .rating = 300,
36 .read = ns9360_clocksource_read,
37 .mask = CLOCKSOURCE_MASK(32),
38 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
39};
40
41static void ns9360_clockevent_setmode(enum clock_event_mode mode,
42 struct clock_event_device *clk)
43{
44 u32 tc = __raw_readl(SYS_TC(TIMER_CLOCKEVENT));
45
46 switch (mode) {
47 case CLOCK_EVT_MODE_PERIODIC:
48 __raw_writel(latch, SYS_TRC(TIMER_CLOCKEVENT));
49 REGSET(tc, SYS_TCx, REN, EN);
50 REGSET(tc, SYS_TCx, INTS, EN);
51 REGSET(tc, SYS_TCx, TEN, EN);
52 break;
53
54 case CLOCK_EVT_MODE_ONESHOT:
55 REGSET(tc, SYS_TCx, REN, DIS);
56 REGSET(tc, SYS_TCx, INTS, EN);
57
58 /* fall through */
59
60 case CLOCK_EVT_MODE_UNUSED:
61 case CLOCK_EVT_MODE_SHUTDOWN:
62 case CLOCK_EVT_MODE_RESUME:
63 default:
64 REGSET(tc, SYS_TCx, TEN, DIS);
65 break;
66 }
67
68 __raw_writel(tc, SYS_TC(TIMER_CLOCKEVENT));
69}
70
71static int ns9360_clockevent_setnextevent(unsigned long evt,
72 struct clock_event_device *clk)
73{
74 u32 tc = __raw_readl(SYS_TC(TIMER_CLOCKEVENT));
75
76 if (REGGET(tc, SYS_TCx, TEN)) {
77 REGSET(tc, SYS_TCx, TEN, DIS);
78 __raw_writel(tc, SYS_TC(TIMER_CLOCKEVENT));
79 }
80
81 REGSET(tc, SYS_TCx, TEN, EN);
82
83 __raw_writel(evt, SYS_TRC(TIMER_CLOCKEVENT));
84
85 __raw_writel(tc, SYS_TC(TIMER_CLOCKEVENT));
86
87 return 0;
88}
89
90static struct clock_event_device ns9360_clockevent_device = {
91 .name = "ns9360-timer" __stringify(TIMER_CLOCKEVENT),
92 .shift = 20,
93 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
94 .set_mode = ns9360_clockevent_setmode,
95 .set_next_event = ns9360_clockevent_setnextevent,
96};
97
98static irqreturn_t ns9360_clockevent_handler(int irq, void *dev_id)
99{
100 int timerno = irq - IRQ_NS9360_TIMER0;
101 u32 tc;
102
103 struct clock_event_device *evt = &ns9360_clockevent_device;
104
105 /* clear irq */
106 tc = __raw_readl(SYS_TC(timerno));
107 if (REGGET(tc, SYS_TCx, REN) == SYS_TCx_REN_DIS) {
108 REGSET(tc, SYS_TCx, TEN, DIS);
109 __raw_writel(tc, SYS_TC(timerno));
110 }
111 REGSET(tc, SYS_TCx, INTC, SET);
112 __raw_writel(tc, SYS_TC(timerno));
113 REGSET(tc, SYS_TCx, INTC, UNSET);
114 __raw_writel(tc, SYS_TC(timerno));
115
116 evt->event_handler(evt);
117
118 return IRQ_HANDLED;
119}
120
121static struct irqaction ns9360_clockevent_action = {
122 .name = "ns9360-timer" __stringify(TIMER_CLOCKEVENT),
123 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
124 .handler = ns9360_clockevent_handler,
125};
126
127static void __init ns9360_timer_init(void)
128{
129 int tc;
130
131 tc = __raw_readl(SYS_TC(TIMER_CLOCKSOURCE));
132 if (REGGET(tc, SYS_TCx, TEN)) {
133 REGSET(tc, SYS_TCx, TEN, DIS);
134 __raw_writel(tc, SYS_TC(TIMER_CLOCKSOURCE));
135 }
136
137 __raw_writel(0, SYS_TRC(TIMER_CLOCKSOURCE));
138
139 REGSET(tc, SYS_TCx, TEN, EN);
140 REGSET(tc, SYS_TCx, TDBG, STOP);
141 REGSET(tc, SYS_TCx, TLCS, CPU);
142 REGSET(tc, SYS_TCx, TM, IEE);
143 REGSET(tc, SYS_TCx, INTS, DIS);
144 REGSET(tc, SYS_TCx, UDS, UP);
145 REGSET(tc, SYS_TCx, TSZ, 32);
146 REGSET(tc, SYS_TCx, REN, EN);
147
148 __raw_writel(tc, SYS_TC(TIMER_CLOCKSOURCE));
149
150 clocksource_register_hz(&ns9360_clocksource, ns9360_cpuclock());
151
152 latch = SH_DIV(ns9360_cpuclock(), HZ, 0);
153
154 tc = __raw_readl(SYS_TC(TIMER_CLOCKEVENT));
155 REGSET(tc, SYS_TCx, TEN, DIS);
156 REGSET(tc, SYS_TCx, TDBG, STOP);
157 REGSET(tc, SYS_TCx, TLCS, CPU);
158 REGSET(tc, SYS_TCx, TM, IEE);
159 REGSET(tc, SYS_TCx, INTS, DIS);
160 REGSET(tc, SYS_TCx, UDS, DOWN);
161 REGSET(tc, SYS_TCx, TSZ, 32);
162 REGSET(tc, SYS_TCx, REN, EN);
163 __raw_writel(tc, SYS_TC(TIMER_CLOCKEVENT));
164
165 ns9360_clockevent_device.mult = div_sc(ns9360_cpuclock(),
166 NSEC_PER_SEC, ns9360_clockevent_device.shift);
167 ns9360_clockevent_device.max_delta_ns =
168 clockevent_delta2ns(-1, &ns9360_clockevent_device);
169 ns9360_clockevent_device.min_delta_ns =
170 clockevent_delta2ns(1, &ns9360_clockevent_device);
171
172 ns9360_clockevent_device.cpumask = cpumask_of(0);
173 clockevents_register_device(&ns9360_clockevent_device);
174
175 setup_irq(IRQ_NS9360_TIMER0 + TIMER_CLOCKEVENT,
176 &ns9360_clockevent_action);
177}
178
179struct sys_timer ns9360_timer = {
180 .init = ns9360_timer_init,
181};
diff --git a/arch/arm/mach-omap1/flash.c b/arch/arm/mach-omap1/flash.c
index acd161666408..1749cb37dda0 100644
--- a/arch/arm/mach-omap1/flash.c
+++ b/arch/arm/mach-omap1/flash.c
@@ -13,7 +13,7 @@
13#include <plat/tc.h> 13#include <plat/tc.h>
14#include <plat/flash.h> 14#include <plat/flash.h>
15 15
16void omap1_set_vpp(struct map_info *map, int enable) 16void omap1_set_vpp(struct platform_device *pdev, int enable)
17{ 17{
18 static int count; 18 static int count;
19 u32 l; 19 u32 l;
diff --git a/arch/arm/mach-omap1/pm_bus.c b/arch/arm/mach-omap1/pm_bus.c
index 6588c22b8a64..fe31d933f0ed 100644
--- a/arch/arm/mach-omap1/pm_bus.c
+++ b/arch/arm/mach-omap1/pm_bus.c
@@ -24,75 +24,50 @@
24#ifdef CONFIG_PM_RUNTIME 24#ifdef CONFIG_PM_RUNTIME
25static int omap1_pm_runtime_suspend(struct device *dev) 25static int omap1_pm_runtime_suspend(struct device *dev)
26{ 26{
27 struct clk *iclk, *fclk; 27 int ret;
28 int ret = 0;
29 28
30 dev_dbg(dev, "%s\n", __func__); 29 dev_dbg(dev, "%s\n", __func__);
31 30
32 ret = pm_generic_runtime_suspend(dev); 31 ret = pm_generic_runtime_suspend(dev);
32 if (ret)
33 return ret;
33 34
34 fclk = clk_get(dev, "fck"); 35 ret = pm_runtime_clk_suspend(dev);
35 if (!IS_ERR(fclk)) { 36 if (ret) {
36 clk_disable(fclk); 37 pm_generic_runtime_resume(dev);
37 clk_put(fclk); 38 return ret;
38 }
39
40 iclk = clk_get(dev, "ick");
41 if (!IS_ERR(iclk)) {
42 clk_disable(iclk);
43 clk_put(iclk);
44 } 39 }
45 40
46 return 0; 41 return 0;
47}; 42}
48 43
49static int omap1_pm_runtime_resume(struct device *dev) 44static int omap1_pm_runtime_resume(struct device *dev)
50{ 45{
51 struct clk *iclk, *fclk;
52
53 dev_dbg(dev, "%s\n", __func__); 46 dev_dbg(dev, "%s\n", __func__);
54 47
55 iclk = clk_get(dev, "ick"); 48 pm_runtime_clk_resume(dev);
56 if (!IS_ERR(iclk)) { 49 return pm_generic_runtime_resume(dev);
57 clk_enable(iclk); 50}
58 clk_put(iclk);
59 }
60 51
61 fclk = clk_get(dev, "fck"); 52static struct dev_power_domain default_power_domain = {
62 if (!IS_ERR(fclk)) { 53 .ops = {
63 clk_enable(fclk); 54 .runtime_suspend = omap1_pm_runtime_suspend,
64 clk_put(fclk); 55 .runtime_resume = omap1_pm_runtime_resume,
65 } 56 USE_PLATFORM_PM_SLEEP_OPS
57 },
58};
66 59
67 return pm_generic_runtime_resume(dev); 60static struct pm_clk_notifier_block platform_bus_notifier = {
61 .pwr_domain = &default_power_domain,
62 .con_ids = { "ick", "fck", NULL, },
68}; 63};
69 64
70static int __init omap1_pm_runtime_init(void) 65static int __init omap1_pm_runtime_init(void)
71{ 66{
72 const struct dev_pm_ops *pm;
73 struct dev_pm_ops *omap_pm;
74
75 if (!cpu_class_is_omap1()) 67 if (!cpu_class_is_omap1())
76 return -ENODEV; 68 return -ENODEV;
77 69
78 pm = platform_bus_get_pm_ops(); 70 pm_runtime_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
79 if (!pm) {
80 pr_err("%s: unable to get dev_pm_ops from platform_bus\n",
81 __func__);
82 return -ENODEV;
83 }
84
85 omap_pm = kmemdup(pm, sizeof(struct dev_pm_ops), GFP_KERNEL);
86 if (!omap_pm) {
87 pr_err("%s: unable to alloc memory for new dev_pm_ops\n",
88 __func__);
89 return -ENOMEM;
90 }
91
92 omap_pm->runtime_suspend = omap1_pm_runtime_suspend;
93 omap_pm->runtime_resume = omap1_pm_runtime_resume;
94
95 platform_bus_set_pm_ops(omap_pm);
96 71
97 return 0; 72 return 0;
98} 73}
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index 6885d2fac183..03e1e1062ad4 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -68,49 +68,50 @@ typedef struct {
68} omap_mpu_timer_regs_t; 68} omap_mpu_timer_regs_t;
69 69
70#define omap_mpu_timer_base(n) \ 70#define omap_mpu_timer_base(n) \
71((volatile omap_mpu_timer_regs_t*)OMAP1_IO_ADDRESS(OMAP_MPU_TIMER_BASE + \ 71((omap_mpu_timer_regs_t __iomem *)OMAP1_IO_ADDRESS(OMAP_MPU_TIMER_BASE + \
72 (n)*OMAP_MPU_TIMER_OFFSET)) 72 (n)*OMAP_MPU_TIMER_OFFSET))
73 73
74static inline unsigned long notrace omap_mpu_timer_read(int nr) 74static inline unsigned long notrace omap_mpu_timer_read(int nr)
75{ 75{
76 volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); 76 omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr);
77 return timer->read_tim; 77 return readl(&timer->read_tim);
78} 78}
79 79
80static inline void omap_mpu_set_autoreset(int nr) 80static inline void omap_mpu_set_autoreset(int nr)
81{ 81{
82 volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); 82 omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr);
83 83
84 timer->cntl = timer->cntl | MPU_TIMER_AR; 84 writel(readl(&timer->cntl) | MPU_TIMER_AR, &timer->cntl);
85} 85}
86 86
87static inline void omap_mpu_remove_autoreset(int nr) 87static inline void omap_mpu_remove_autoreset(int nr)
88{ 88{
89 volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); 89 omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr);
90 90
91 timer->cntl = timer->cntl & ~MPU_TIMER_AR; 91 writel(readl(&timer->cntl) & ~MPU_TIMER_AR, &timer->cntl);
92} 92}
93 93
94static inline void omap_mpu_timer_start(int nr, unsigned long load_val, 94static inline void omap_mpu_timer_start(int nr, unsigned long load_val,
95 int autoreset) 95 int autoreset)
96{ 96{
97 volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); 97 omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr);
98 unsigned int timerflags = (MPU_TIMER_CLOCK_ENABLE | MPU_TIMER_ST); 98 unsigned int timerflags = MPU_TIMER_CLOCK_ENABLE | MPU_TIMER_ST;
99 99
100 if (autoreset) timerflags |= MPU_TIMER_AR; 100 if (autoreset)
101 timerflags |= MPU_TIMER_AR;
101 102
102 timer->cntl = MPU_TIMER_CLOCK_ENABLE; 103 writel(MPU_TIMER_CLOCK_ENABLE, &timer->cntl);
103 udelay(1); 104 udelay(1);
104 timer->load_tim = load_val; 105 writel(load_val, &timer->load_tim);
105 udelay(1); 106 udelay(1);
106 timer->cntl = timerflags; 107 writel(timerflags, &timer->cntl);
107} 108}
108 109
109static inline void omap_mpu_timer_stop(int nr) 110static inline void omap_mpu_timer_stop(int nr)
110{ 111{
111 volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); 112 omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(nr);
112 113
113 timer->cntl &= ~MPU_TIMER_ST; 114 writel(readl(&timer->cntl) & ~MPU_TIMER_ST, &timer->cntl);
114} 115}
115 116
116/* 117/*
@@ -189,38 +190,11 @@ static __init void omap_init_mpu_timer(unsigned long rate)
189 * --------------------------------------------------------------------------- 190 * ---------------------------------------------------------------------------
190 */ 191 */
191 192
192static unsigned long omap_mpu_timer2_overflows;
193
194static irqreturn_t omap_mpu_timer2_interrupt(int irq, void *dev_id)
195{
196 omap_mpu_timer2_overflows++;
197 return IRQ_HANDLED;
198}
199
200static struct irqaction omap_mpu_timer2_irq = {
201 .name = "mpu_timer2",
202 .flags = IRQF_DISABLED,
203 .handler = omap_mpu_timer2_interrupt,
204};
205
206static cycle_t mpu_read(struct clocksource *cs)
207{
208 return ~omap_mpu_timer_read(1);
209}
210
211static struct clocksource clocksource_mpu = {
212 .name = "mpu_timer2",
213 .rating = 300,
214 .read = mpu_read,
215 .mask = CLOCKSOURCE_MASK(32),
216 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
217};
218
219static DEFINE_CLOCK_DATA(cd); 193static DEFINE_CLOCK_DATA(cd);
220 194
221static inline unsigned long long notrace _omap_mpu_sched_clock(void) 195static inline unsigned long long notrace _omap_mpu_sched_clock(void)
222{ 196{
223 u32 cyc = mpu_read(&clocksource_mpu); 197 u32 cyc = ~omap_mpu_timer_read(1);
224 return cyc_to_sched_clock(&cd, cyc, (u32)~0); 198 return cyc_to_sched_clock(&cd, cyc, (u32)~0);
225} 199}
226 200
@@ -238,21 +212,22 @@ static unsigned long long notrace omap_mpu_sched_clock(void)
238 212
239static void notrace mpu_update_sched_clock(void) 213static void notrace mpu_update_sched_clock(void)
240{ 214{
241 u32 cyc = mpu_read(&clocksource_mpu); 215 u32 cyc = ~omap_mpu_timer_read(1);
242 update_sched_clock(&cd, cyc, (u32)~0); 216 update_sched_clock(&cd, cyc, (u32)~0);
243} 217}
244 218
245static void __init omap_init_clocksource(unsigned long rate) 219static void __init omap_init_clocksource(unsigned long rate)
246{ 220{
221 omap_mpu_timer_regs_t __iomem *timer = omap_mpu_timer_base(1);
247 static char err[] __initdata = KERN_ERR 222 static char err[] __initdata = KERN_ERR
248 "%s: can't register clocksource!\n"; 223 "%s: can't register clocksource!\n";
249 224
250 setup_irq(INT_TIMER2, &omap_mpu_timer2_irq);
251 omap_mpu_timer_start(1, ~0, 1); 225 omap_mpu_timer_start(1, ~0, 1);
252 init_sched_clock(&cd, mpu_update_sched_clock, 32, rate); 226 init_sched_clock(&cd, mpu_update_sched_clock, 32, rate);
253 227
254 if (clocksource_register_hz(&clocksource_mpu, rate)) 228 if (clocksource_mmio_init(&timer->read_tim, "mpu_timer2", rate,
255 printk(err, clocksource_mpu.name); 229 300, 32, clocksource_mmio_readl_down))
230 printk(err, "mpu_timer2");
256} 231}
257 232
258static void __init omap_mpu_timer_init(void) 233static void __init omap_mpu_timer_init(void)
diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 512b15204450..66dfbccacd25 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -59,10 +59,10 @@ endif
59# Power Management 59# Power Management
60ifeq ($(CONFIG_PM),y) 60ifeq ($(CONFIG_PM),y)
61obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o 61obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o
62obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o pm_bus.o 62obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o
63obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o \ 63obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o \
64 cpuidle34xx.o pm_bus.o 64 cpuidle34xx.o
65obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o pm_bus.o 65obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o
66obj-$(CONFIG_PM_DEBUG) += pm-debug.o 66obj-$(CONFIG_PM_DEBUG) += pm-debug.o
67obj-$(CONFIG_OMAP_SMARTREFLEX) += sr_device.o smartreflex.o 67obj-$(CONFIG_OMAP_SMARTREFLEX) += sr_device.o smartreflex.o
68obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS3) += smartreflex-class3.o 68obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS3) += smartreflex-class3.o
diff --git a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c
index b2b1e37bb6bb..d6e34dd9e7e7 100644
--- a/arch/arm/mach-omap2/clkt34xx_dpll3m2.c
+++ b/arch/arm/mach-omap2/clkt34xx_dpll3m2.c
@@ -115,6 +115,7 @@ int omap3_core_dpll_m2_set_rate(struct clk *clk, unsigned long rate)
115 sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla, 115 sdrc_cs0->rfr_ctrl, sdrc_cs0->actim_ctrla,
116 sdrc_cs0->actim_ctrlb, sdrc_cs0->mr, 116 sdrc_cs0->actim_ctrlb, sdrc_cs0->mr,
117 0, 0, 0, 0); 117 0, 0, 0, 0);
118 clk->rate = rate;
118 119
119 return 0; 120 return 0;
120} 121}
diff --git a/arch/arm/mach-omap2/include/mach/omap4-common.h b/arch/arm/mach-omap2/include/mach/omap4-common.h
index de441c05a6a6..e4bd87619734 100644
--- a/arch/arm/mach-omap2/include/mach/omap4-common.h
+++ b/arch/arm/mach-omap2/include/mach/omap4-common.h
@@ -33,4 +33,11 @@ extern void __iomem *gic_dist_base_addr;
33extern void __init gic_init_irq(void); 33extern void __init gic_init_irq(void);
34extern void omap_smc1(u32 fn, u32 arg); 34extern void omap_smc1(u32 fn, u32 arg);
35 35
36#ifdef CONFIG_SMP
37/* Needed for secondary core boot */
38extern void omap_secondary_startup(void);
39extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask);
40extern void omap_auxcoreboot_addr(u32 cpu_addr);
41extern u32 omap_read_auxcoreboot0(void);
42#endif
36#endif 43#endif
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c
index b66cfe8bc464..ecfe93c4b585 100644
--- a/arch/arm/mach-omap2/omap-smp.c
+++ b/arch/arm/mach-omap2/omap-smp.c
@@ -21,6 +21,7 @@
21#include <linux/io.h> 21#include <linux/io.h>
22 22
23#include <asm/cacheflush.h> 23#include <asm/cacheflush.h>
24#include <asm/hardware/gic.h>
24#include <asm/smp_scu.h> 25#include <asm/smp_scu.h>
25#include <mach/hardware.h> 26#include <mach/hardware.h>
26#include <mach/omap4-common.h> 27#include <mach/omap4-common.h>
@@ -63,7 +64,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
63 omap_modify_auxcoreboot0(0x200, 0xfffffdff); 64 omap_modify_auxcoreboot0(0x200, 0xfffffdff);
64 flush_cache_all(); 65 flush_cache_all();
65 smp_wmb(); 66 smp_wmb();
66 smp_cross_call(cpumask_of(cpu), 1); 67 gic_raise_softirq(cpumask_of(cpu), 1);
67 68
68 /* 69 /*
69 * Now the secondary core is starting up let it run its 70 * Now the secondary core is starting up let it run its
@@ -118,6 +119,8 @@ void __init smp_init_cpus(void)
118 119
119 for (i = 0; i < ncores; i++) 120 for (i = 0; i < ncores; i++)
120 set_cpu_possible(i, true); 121 set_cpu_possible(i, true);
122
123 set_smp_cross_call(gic_raise_softirq);
121} 124}
122 125
123void __init platform_smp_prepare_cpus(unsigned int max_cpus) 126void __init platform_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-omap2/pm_bus.c b/arch/arm/mach-omap2/pm_bus.c
deleted file mode 100644
index 5acd2ab298b1..000000000000
--- a/arch/arm/mach-omap2/pm_bus.c
+++ /dev/null
@@ -1,85 +0,0 @@
1/*
2 * Runtime PM support code for OMAP
3 *
4 * Author: Kevin Hilman, Deep Root Systems, LLC
5 *
6 * Copyright (C) 2010 Texas Instruments, Inc.
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12#include <linux/init.h>
13#include <linux/kernel.h>
14#include <linux/io.h>
15#include <linux/pm_runtime.h>
16#include <linux/platform_device.h>
17#include <linux/mutex.h>
18
19#include <plat/omap_device.h>
20#include <plat/omap-pm.h>
21
22#ifdef CONFIG_PM_RUNTIME
23static int omap_pm_runtime_suspend(struct device *dev)
24{
25 struct platform_device *pdev = to_platform_device(dev);
26 int r, ret = 0;
27
28 dev_dbg(dev, "%s\n", __func__);
29
30 ret = pm_generic_runtime_suspend(dev);
31
32 if (!ret && dev->parent == &omap_device_parent) {
33 r = omap_device_idle(pdev);
34 WARN_ON(r);
35 }
36
37 return ret;
38};
39
40static int omap_pm_runtime_resume(struct device *dev)
41{
42 struct platform_device *pdev = to_platform_device(dev);
43 int r;
44
45 dev_dbg(dev, "%s\n", __func__);
46
47 if (dev->parent == &omap_device_parent) {
48 r = omap_device_enable(pdev);
49 WARN_ON(r);
50 }
51
52 return pm_generic_runtime_resume(dev);
53};
54#else
55#define omap_pm_runtime_suspend NULL
56#define omap_pm_runtime_resume NULL
57#endif /* CONFIG_PM_RUNTIME */
58
59static int __init omap_pm_runtime_init(void)
60{
61 const struct dev_pm_ops *pm;
62 struct dev_pm_ops *omap_pm;
63
64 pm = platform_bus_get_pm_ops();
65 if (!pm) {
66 pr_err("%s: unable to get dev_pm_ops from platform_bus\n",
67 __func__);
68 return -ENODEV;
69 }
70
71 omap_pm = kmemdup(pm, sizeof(struct dev_pm_ops), GFP_KERNEL);
72 if (!omap_pm) {
73 pr_err("%s: unable to alloc memory for new dev_pm_ops\n",
74 __func__);
75 return -ENOMEM;
76 }
77
78 omap_pm->runtime_suspend = omap_pm_runtime_suspend;
79 omap_pm->runtime_resume = omap_pm_runtime_resume;
80
81 platform_bus_set_pm_ops(omap_pm);
82
83 return 0;
84}
85core_initcall(omap_pm_runtime_init);
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
index bfbecec6d05f..810a982a66f8 100644
--- a/arch/arm/mach-pxa/balloon3.c
+++ b/arch/arm/mach-pxa/balloon3.c
@@ -15,7 +15,6 @@
15 15
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/sysdev.h>
19#include <linux/interrupt.h> 18#include <linux/interrupt.h>
20#include <linux/sched.h> 19#include <linux/sched.h>
21#include <linux/bitops.h> 20#include <linux/bitops.h>
diff --git a/arch/arm/mach-pxa/clock-pxa2xx.c b/arch/arm/mach-pxa/clock-pxa2xx.c
index 1ce090448493..1d5859d9a0e3 100644
--- a/arch/arm/mach-pxa/clock-pxa2xx.c
+++ b/arch/arm/mach-pxa/clock-pxa2xx.c
@@ -9,7 +9,7 @@
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/sysdev.h> 12#include <linux/syscore_ops.h>
13 13
14#include <mach/pxa2xx-regs.h> 14#include <mach/pxa2xx-regs.h>
15 15
@@ -33,32 +33,22 @@ const struct clkops clk_pxa2xx_cken_ops = {
33#ifdef CONFIG_PM 33#ifdef CONFIG_PM
34static uint32_t saved_cken; 34static uint32_t saved_cken;
35 35
36static int pxa2xx_clock_suspend(struct sys_device *d, pm_message_t state) 36static int pxa2xx_clock_suspend(void)
37{ 37{
38 saved_cken = CKEN; 38 saved_cken = CKEN;
39 return 0; 39 return 0;
40} 40}
41 41
42static int pxa2xx_clock_resume(struct sys_device *d) 42static void pxa2xx_clock_resume(void)
43{ 43{
44 CKEN = saved_cken; 44 CKEN = saved_cken;
45 return 0;
46} 45}
47#else 46#else
48#define pxa2xx_clock_suspend NULL 47#define pxa2xx_clock_suspend NULL
49#define pxa2xx_clock_resume NULL 48#define pxa2xx_clock_resume NULL
50#endif 49#endif
51 50
52struct sysdev_class pxa2xx_clock_sysclass = { 51struct syscore_ops pxa2xx_clock_syscore_ops = {
53 .name = "pxa2xx-clock",
54 .suspend = pxa2xx_clock_suspend, 52 .suspend = pxa2xx_clock_suspend,
55 .resume = pxa2xx_clock_resume, 53 .resume = pxa2xx_clock_resume,
56}; 54};
57
58static int __init pxa2xx_clock_init(void)
59{
60 if (cpu_is_pxa2xx())
61 return sysdev_class_register(&pxa2xx_clock_sysclass);
62 return 0;
63}
64postcore_initcall(pxa2xx_clock_init);
diff --git a/arch/arm/mach-pxa/clock-pxa3xx.c b/arch/arm/mach-pxa/clock-pxa3xx.c
index 3f864cd0bd28..2a37a9a8f621 100644
--- a/arch/arm/mach-pxa/clock-pxa3xx.c
+++ b/arch/arm/mach-pxa/clock-pxa3xx.c
@@ -10,6 +10,7 @@
10#include <linux/kernel.h> 10#include <linux/kernel.h>
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/io.h> 12#include <linux/io.h>
13#include <linux/syscore_ops.h>
13 14
14#include <mach/smemc.h> 15#include <mach/smemc.h>
15#include <mach/pxa3xx-regs.h> 16#include <mach/pxa3xx-regs.h>
@@ -182,7 +183,7 @@ const struct clkops clk_pxa3xx_pout_ops = {
182static uint32_t cken[2]; 183static uint32_t cken[2];
183static uint32_t accr; 184static uint32_t accr;
184 185
185static int pxa3xx_clock_suspend(struct sys_device *d, pm_message_t state) 186static int pxa3xx_clock_suspend(void)
186{ 187{
187 cken[0] = CKENA; 188 cken[0] = CKENA;
188 cken[1] = CKENB; 189 cken[1] = CKENB;
@@ -190,28 +191,18 @@ static int pxa3xx_clock_suspend(struct sys_device *d, pm_message_t state)
190 return 0; 191 return 0;
191} 192}
192 193
193static int pxa3xx_clock_resume(struct sys_device *d) 194static void pxa3xx_clock_resume(void)
194{ 195{
195 ACCR = accr; 196 ACCR = accr;
196 CKENA = cken[0]; 197 CKENA = cken[0];
197 CKENB = cken[1]; 198 CKENB = cken[1];
198 return 0;
199} 199}
200#else 200#else
201#define pxa3xx_clock_suspend NULL 201#define pxa3xx_clock_suspend NULL
202#define pxa3xx_clock_resume NULL 202#define pxa3xx_clock_resume NULL
203#endif 203#endif
204 204
205struct sysdev_class pxa3xx_clock_sysclass = { 205struct syscore_ops pxa3xx_clock_syscore_ops = {
206 .name = "pxa3xx-clock",
207 .suspend = pxa3xx_clock_suspend, 206 .suspend = pxa3xx_clock_suspend,
208 .resume = pxa3xx_clock_resume, 207 .resume = pxa3xx_clock_resume,
209}; 208};
210
211static int __init pxa3xx_clock_init(void)
212{
213 if (cpu_is_pxa3xx() || cpu_is_pxa95x())
214 return sysdev_class_register(&pxa3xx_clock_sysclass);
215 return 0;
216}
217postcore_initcall(pxa3xx_clock_init);
diff --git a/arch/arm/mach-pxa/clock.h b/arch/arm/mach-pxa/clock.h
index f9f349a21b54..1f2fb9c43f06 100644
--- a/arch/arm/mach-pxa/clock.h
+++ b/arch/arm/mach-pxa/clock.h
@@ -1,5 +1,5 @@
1#include <linux/clkdev.h> 1#include <linux/clkdev.h>
2#include <linux/sysdev.h> 2#include <linux/syscore_ops.h>
3 3
4struct clkops { 4struct clkops {
5 void (*enable)(struct clk *); 5 void (*enable)(struct clk *);
@@ -54,7 +54,7 @@ extern const struct clkops clk_pxa2xx_cken_ops;
54void clk_pxa2xx_cken_enable(struct clk *clk); 54void clk_pxa2xx_cken_enable(struct clk *clk);
55void clk_pxa2xx_cken_disable(struct clk *clk); 55void clk_pxa2xx_cken_disable(struct clk *clk);
56 56
57extern struct sysdev_class pxa2xx_clock_sysclass; 57extern struct syscore_ops pxa2xx_clock_syscore_ops;
58 58
59#if defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x) 59#if defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x)
60#define DEFINE_PXA3_CKEN(_name, _cken, _rate, _delay) \ 60#define DEFINE_PXA3_CKEN(_name, _cken, _rate, _delay) \
@@ -74,5 +74,6 @@ extern const struct clkops clk_pxa3xx_smemc_ops;
74extern void clk_pxa3xx_cken_enable(struct clk *); 74extern void clk_pxa3xx_cken_enable(struct clk *);
75extern void clk_pxa3xx_cken_disable(struct clk *); 75extern void clk_pxa3xx_cken_disable(struct clk *);
76 76
77extern struct sysdev_class pxa3xx_clock_sysclass; 77extern struct syscore_ops pxa3xx_clock_syscore_ops;
78
78#endif 79#endif
diff --git a/arch/arm/mach-pxa/cm-x270.c b/arch/arm/mach-pxa/cm-x270.c
index b88d601a8090..13518a705399 100644
--- a/arch/arm/mach-pxa/cm-x270.c
+++ b/arch/arm/mach-pxa/cm-x270.c
@@ -10,7 +10,6 @@
10 */ 10 */
11 11
12#include <linux/platform_device.h> 12#include <linux/platform_device.h>
13#include <linux/sysdev.h>
14#include <linux/irq.h> 13#include <linux/irq.h>
15#include <linux/gpio.h> 14#include <linux/gpio.h>
16#include <linux/delay.h> 15#include <linux/delay.h>
diff --git a/arch/arm/mach-pxa/cm-x2xx-pci.c b/arch/arm/mach-pxa/cm-x2xx-pci.c
index 8b1a30959fae..1afc0fb7d6d5 100644
--- a/arch/arm/mach-pxa/cm-x2xx-pci.c
+++ b/arch/arm/mach-pxa/cm-x2xx-pci.c
@@ -29,33 +29,6 @@
29unsigned long it8152_base_address; 29unsigned long it8152_base_address;
30static int cmx2xx_it8152_irq_gpio; 30static int cmx2xx_it8152_irq_gpio;
31 31
32/*
33 * Only first 64MB of memory can be accessed via PCI.
34 * We use GFP_DMA to allocate safe buffers to do map/unmap.
35 * This is really ugly and we need a better way of specifying
36 * DMA-capable regions of memory.
37 */
38void __init cmx2xx_pci_adjust_zones(unsigned long *zone_size,
39 unsigned long *zhole_size)
40{
41 unsigned int sz = SZ_64M >> PAGE_SHIFT;
42
43 if (machine_is_armcore()) {
44 pr_info("Adjusting zones for CM-X2XX\n");
45
46 /*
47 * Only adjust if > 64M on current system
48 */
49 if (zone_size[0] <= sz)
50 return;
51
52 zone_size[1] = zone_size[0] - sz;
53 zone_size[0] = sz;
54 zhole_size[1] = zhole_size[0];
55 zhole_size[0] = 0;
56 }
57}
58
59static void cmx2xx_it8152_irq_demux(unsigned int irq, struct irq_desc *desc) 32static void cmx2xx_it8152_irq_demux(unsigned int irq, struct irq_desc *desc)
60{ 33{
61 /* clear our parent irq */ 34 /* clear our parent irq */
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c
index 8225e2e58c6e..a10996782476 100644
--- a/arch/arm/mach-pxa/cm-x2xx.c
+++ b/arch/arm/mach-pxa/cm-x2xx.c
@@ -10,7 +10,7 @@
10 */ 10 */
11 11
12#include <linux/platform_device.h> 12#include <linux/platform_device.h>
13#include <linux/sysdev.h> 13#include <linux/syscore_ops.h>
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16 16
@@ -388,7 +388,7 @@ static inline void cmx2xx_init_display(void) {}
388#ifdef CONFIG_PM 388#ifdef CONFIG_PM
389static unsigned long sleep_save_msc[10]; 389static unsigned long sleep_save_msc[10];
390 390
391static int cmx2xx_suspend(struct sys_device *dev, pm_message_t state) 391static int cmx2xx_suspend(void)
392{ 392{
393 cmx2xx_pci_suspend(); 393 cmx2xx_pci_suspend();
394 394
@@ -412,7 +412,7 @@ static int cmx2xx_suspend(struct sys_device *dev, pm_message_t state)
412 return 0; 412 return 0;
413} 413}
414 414
415static int cmx2xx_resume(struct sys_device *dev) 415static void cmx2xx_resume(void)
416{ 416{
417 cmx2xx_pci_resume(); 417 cmx2xx_pci_resume();
418 418
@@ -420,27 +420,18 @@ static int cmx2xx_resume(struct sys_device *dev)
420 __raw_writel(sleep_save_msc[0], MSC0); 420 __raw_writel(sleep_save_msc[0], MSC0);
421 __raw_writel(sleep_save_msc[1], MSC1); 421 __raw_writel(sleep_save_msc[1], MSC1);
422 __raw_writel(sleep_save_msc[2], MSC2); 422 __raw_writel(sleep_save_msc[2], MSC2);
423
424 return 0;
425} 423}
426 424
427static struct sysdev_class cmx2xx_pm_sysclass = { 425static struct syscore_ops cmx2xx_pm_syscore_ops = {
428 .name = "pm",
429 .resume = cmx2xx_resume, 426 .resume = cmx2xx_resume,
430 .suspend = cmx2xx_suspend, 427 .suspend = cmx2xx_suspend,
431}; 428};
432 429
433static struct sys_device cmx2xx_pm_device = {
434 .cls = &cmx2xx_pm_sysclass,
435};
436
437static int __init cmx2xx_pm_init(void) 430static int __init cmx2xx_pm_init(void)
438{ 431{
439 int error; 432 register_syscore_ops(&cmx2xx_pm_syscore_ops);
440 error = sysdev_class_register(&cmx2xx_pm_sysclass); 433
441 if (error == 0) 434 return 0;
442 error = sysdev_register(&cmx2xx_pm_device);
443 return error;
444} 435}
445#else 436#else
446static int __init cmx2xx_pm_init(void) { return 0; } 437static int __init cmx2xx_pm_init(void) { return 0; }
diff --git a/arch/arm/mach-pxa/colibri-evalboard.c b/arch/arm/mach-pxa/colibri-evalboard.c
index 81c3c433e2d6..d28e802e2448 100644
--- a/arch/arm/mach-pxa/colibri-evalboard.c
+++ b/arch/arm/mach-pxa/colibri-evalboard.c
@@ -13,7 +13,6 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/sysdev.h>
17#include <linux/interrupt.h> 16#include <linux/interrupt.h>
18#include <linux/gpio.h> 17#include <linux/gpio.h>
19#include <asm/mach-types.h> 18#include <asm/mach-types.h>
diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c b/arch/arm/mach-pxa/colibri-pxa270-income.c
index 44c1b77ece67..80538b8806ed 100644
--- a/arch/arm/mach-pxa/colibri-pxa270-income.c
+++ b/arch/arm/mach-pxa/colibri-pxa270-income.c
@@ -22,7 +22,6 @@
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/pwm_backlight.h> 23#include <linux/pwm_backlight.h>
24#include <linux/i2c/pxa-i2c.h> 24#include <linux/i2c/pxa-i2c.h>
25#include <linux/sysdev.h>
26 25
27#include <asm/irq.h> 26#include <asm/irq.h>
28#include <asm/mach-types.h> 27#include <asm/mach-types.h>
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
index 6fc5d328ba7f..7545a48ed88b 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -17,7 +17,6 @@
17#include <linux/mtd/partitions.h> 17#include <linux/mtd/partitions.h>
18#include <linux/mtd/physmap.h> 18#include <linux/mtd/physmap.h>
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/sysdev.h>
21#include <linux/ucb1400.h> 20#include <linux/ucb1400.h>
22 21
23#include <asm/mach/arch.h> 22#include <asm/mach/arch.h>
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h
index a079d8baa45a..e6c9344a95ae 100644
--- a/arch/arm/mach-pxa/generic.h
+++ b/arch/arm/mach-pxa/generic.h
@@ -61,10 +61,10 @@ extern unsigned pxa3xx_get_clk_frequency_khz(int);
61#define pxa3xx_get_clk_frequency_khz(x) (0) 61#define pxa3xx_get_clk_frequency_khz(x) (0)
62#endif 62#endif
63 63
64extern struct sysdev_class pxa_irq_sysclass; 64extern struct syscore_ops pxa_irq_syscore_ops;
65extern struct sysdev_class pxa_gpio_sysclass; 65extern struct syscore_ops pxa_gpio_syscore_ops;
66extern struct sysdev_class pxa2xx_mfp_sysclass; 66extern struct syscore_ops pxa2xx_mfp_syscore_ops;
67extern struct sysdev_class pxa3xx_mfp_sysclass; 67extern struct syscore_ops pxa3xx_mfp_syscore_ops;
68 68
69void __init pxa_set_ffuart_info(void *info); 69void __init pxa_set_ffuart_info(void *info);
70void __init pxa_set_btuart_info(void *info); 70void __init pxa_set_btuart_info(void *info);
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
index 9cdcca597924..f941a495a4a8 100644
--- a/arch/arm/mach-pxa/hx4700.c
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -735,7 +735,7 @@ static struct platform_device bq24022 = {
735 * StrataFlash 735 * StrataFlash
736 */ 736 */
737 737
738static void hx4700_set_vpp(struct map_info *map, int vpp) 738static void hx4700_set_vpp(struct platform_device *pdev, int vpp)
739{ 739{
740 gpio_set_value(GPIO91_HX4700_FLASH_VPEN, vpp); 740 gpio_set_value(GPIO91_HX4700_FLASH_VPEN, vpp);
741} 741}
diff --git a/arch/arm/mach-pxa/include/mach/memory.h b/arch/arm/mach-pxa/include/mach/memory.h
index 7f68724dcc27..07734f37f8fd 100644
--- a/arch/arm/mach-pxa/include/mach/memory.h
+++ b/arch/arm/mach-pxa/include/mach/memory.h
@@ -17,14 +17,8 @@
17 */ 17 */
18#define PLAT_PHYS_OFFSET UL(0xa0000000) 18#define PLAT_PHYS_OFFSET UL(0xa0000000)
19 19
20#if !defined(__ASSEMBLY__) && defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI) 20#if defined(CONFIG_MACH_ARMCORE) && defined(CONFIG_PCI)
21void cmx2xx_pci_adjust_zones(unsigned long *size, unsigned long *holes); 21#define ARM_DMA_ZONE_SIZE SZ_64M
22
23#define arch_adjust_zones(size, holes) \
24 cmx2xx_pci_adjust_zones(size, holes)
25
26#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_64M - 1)
27#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_64M)
28#endif 22#endif
29 23
30#endif 24#endif
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index 6251e3f5c62c..32ed551bf9c5 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c
@@ -15,7 +15,7 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/sysdev.h> 18#include <linux/syscore_ops.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/irq.h> 20#include <linux/irq.h>
21 21
@@ -183,7 +183,7 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
183static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32]; 183static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32];
184static unsigned long saved_ipr[MAX_INTERNAL_IRQS]; 184static unsigned long saved_ipr[MAX_INTERNAL_IRQS];
185 185
186static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) 186static int pxa_irq_suspend(void)
187{ 187{
188 int i; 188 int i;
189 189
@@ -202,7 +202,7 @@ static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
202 return 0; 202 return 0;
203} 203}
204 204
205static int pxa_irq_resume(struct sys_device *dev) 205static void pxa_irq_resume(void)
206{ 206{
207 int i; 207 int i;
208 208
@@ -218,22 +218,13 @@ static int pxa_irq_resume(struct sys_device *dev)
218 __raw_writel(saved_ipr[i], IRQ_BASE + IPR(i)); 218 __raw_writel(saved_ipr[i], IRQ_BASE + IPR(i));
219 219
220 __raw_writel(1, IRQ_BASE + ICCR); 220 __raw_writel(1, IRQ_BASE + ICCR);
221 return 0;
222} 221}
223#else 222#else
224#define pxa_irq_suspend NULL 223#define pxa_irq_suspend NULL
225#define pxa_irq_resume NULL 224#define pxa_irq_resume NULL
226#endif 225#endif
227 226
228struct sysdev_class pxa_irq_sysclass = { 227struct syscore_ops pxa_irq_syscore_ops = {
229 .name = "irq",
230 .suspend = pxa_irq_suspend, 228 .suspend = pxa_irq_suspend,
231 .resume = pxa_irq_resume, 229 .resume = pxa_irq_resume,
232}; 230};
233
234static int __init pxa_irq_init(void)
235{
236 return sysdev_class_register(&pxa_irq_sysclass);
237}
238
239core_initcall(pxa_irq_init);
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index f5de541725b1..6cf8180bf5bd 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -15,7 +15,7 @@
15 15
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/sysdev.h> 18#include <linux/syscore_ops.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/sched.h> 20#include <linux/sched.h>
21#include <linux/bitops.h> 21#include <linux/bitops.h>
@@ -159,30 +159,22 @@ static void __init lpd270_init_irq(void)
159 159
160 160
161#ifdef CONFIG_PM 161#ifdef CONFIG_PM
162static int lpd270_irq_resume(struct sys_device *dev) 162static void lpd270_irq_resume(void)
163{ 163{
164 __raw_writew(lpd270_irq_enabled, LPD270_INT_MASK); 164 __raw_writew(lpd270_irq_enabled, LPD270_INT_MASK);
165 return 0;
166} 165}
167 166
168static struct sysdev_class lpd270_irq_sysclass = { 167static struct syscore_ops lpd270_irq_syscore_ops = {
169 .name = "cpld_irq",
170 .resume = lpd270_irq_resume, 168 .resume = lpd270_irq_resume,
171}; 169};
172 170
173static struct sys_device lpd270_irq_device = {
174 .cls = &lpd270_irq_sysclass,
175};
176
177static int __init lpd270_irq_device_init(void) 171static int __init lpd270_irq_device_init(void)
178{ 172{
179 int ret = -ENODEV;
180 if (machine_is_logicpd_pxa270()) { 173 if (machine_is_logicpd_pxa270()) {
181 ret = sysdev_class_register(&lpd270_irq_sysclass); 174 register_syscore_ops(&lpd270_irq_syscore_ops);
182 if (ret == 0) 175 return 0;
183 ret = sysdev_register(&lpd270_irq_device);
184 } 176 }
185 return ret; 177 return -ENODEV;
186} 178}
187 179
188device_initcall(lpd270_irq_device_init); 180device_initcall(lpd270_irq_device_init);
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index 3ede978c83d9..e10ddb827147 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -15,7 +15,7 @@
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/sysdev.h> 18#include <linux/syscore_ops.h>
19#include <linux/major.h> 19#include <linux/major.h>
20#include <linux/fb.h> 20#include <linux/fb.h>
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
@@ -176,31 +176,22 @@ static void __init lubbock_init_irq(void)
176 176
177#ifdef CONFIG_PM 177#ifdef CONFIG_PM
178 178
179static int lubbock_irq_resume(struct sys_device *dev) 179static void lubbock_irq_resume(void)
180{ 180{
181 LUB_IRQ_MASK_EN = lubbock_irq_enabled; 181 LUB_IRQ_MASK_EN = lubbock_irq_enabled;
182 return 0;
183} 182}
184 183
185static struct sysdev_class lubbock_irq_sysclass = { 184static struct syscore_ops lubbock_irq_syscore_ops = {
186 .name = "cpld_irq",
187 .resume = lubbock_irq_resume, 185 .resume = lubbock_irq_resume,
188}; 186};
189 187
190static struct sys_device lubbock_irq_device = {
191 .cls = &lubbock_irq_sysclass,
192};
193
194static int __init lubbock_irq_device_init(void) 188static int __init lubbock_irq_device_init(void)
195{ 189{
196 int ret = -ENODEV;
197
198 if (machine_is_lubbock()) { 190 if (machine_is_lubbock()) {
199 ret = sysdev_class_register(&lubbock_irq_sysclass); 191 register_syscore_ops(&lubbock_irq_syscore_ops);
200 if (ret == 0) 192 return 0;
201 ret = sysdev_register(&lubbock_irq_device);
202 } 193 }
203 return ret; 194 return -ENODEV;
204} 195}
205 196
206device_initcall(lubbock_irq_device_init); 197device_initcall(lubbock_irq_device_init);
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 9984ef70bd79..e1920572948a 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -662,7 +662,7 @@ static struct pxaohci_platform_data magician_ohci_info = {
662 * StrataFlash 662 * StrataFlash
663 */ 663 */
664 664
665static void magician_set_vpp(struct map_info *map, int vpp) 665static void magician_set_vpp(struct platform_device *pdev, int vpp)
666{ 666{
667 gpio_set_value(EGPIO_MAGICIAN_FLASH_VPP, vpp); 667 gpio_set_value(EGPIO_MAGICIAN_FLASH_VPP, vpp);
668} 668}
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 95163baca29e..3479e2b3b511 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -15,7 +15,7 @@
15 15
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/sysdev.h> 18#include <linux/syscore_ops.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/sched.h> 20#include <linux/sched.h>
21#include <linux/bitops.h> 21#include <linux/bitops.h>
@@ -185,31 +185,21 @@ static void __init mainstone_init_irq(void)
185 185
186#ifdef CONFIG_PM 186#ifdef CONFIG_PM
187 187
188static int mainstone_irq_resume(struct sys_device *dev) 188static void mainstone_irq_resume(void)
189{ 189{
190 MST_INTMSKENA = mainstone_irq_enabled; 190 MST_INTMSKENA = mainstone_irq_enabled;
191 return 0;
192} 191}
193 192
194static struct sysdev_class mainstone_irq_sysclass = { 193static struct syscore_ops mainstone_irq_syscore_ops = {
195 .name = "cpld_irq",
196 .resume = mainstone_irq_resume, 194 .resume = mainstone_irq_resume,
197}; 195};
198 196
199static struct sys_device mainstone_irq_device = {
200 .cls = &mainstone_irq_sysclass,
201};
202
203static int __init mainstone_irq_device_init(void) 197static int __init mainstone_irq_device_init(void)
204{ 198{
205 int ret = -ENODEV; 199 if (machine_is_mainstone())
200 register_syscore_ops(&mainstone_irq_syscore_ops);
206 201
207 if (machine_is_mainstone()) { 202 return 0;
208 ret = sysdev_class_register(&mainstone_irq_sysclass);
209 if (ret == 0)
210 ret = sysdev_register(&mainstone_irq_device);
211 }
212 return ret;
213} 203}
214 204
215device_initcall(mainstone_irq_device_init); 205device_initcall(mainstone_irq_device_init);
diff --git a/arch/arm/mach-pxa/mfp-pxa2xx.c b/arch/arm/mach-pxa/mfp-pxa2xx.c
index 1d1419b73457..87ae3129f4f7 100644
--- a/arch/arm/mach-pxa/mfp-pxa2xx.c
+++ b/arch/arm/mach-pxa/mfp-pxa2xx.c
@@ -16,7 +16,7 @@
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/sysdev.h> 19#include <linux/syscore_ops.h>
20 20
21#include <mach/gpio.h> 21#include <mach/gpio.h>
22#include <mach/pxa2xx-regs.h> 22#include <mach/pxa2xx-regs.h>
@@ -338,7 +338,7 @@ static unsigned long saved_gafr[2][4];
338static unsigned long saved_gpdr[4]; 338static unsigned long saved_gpdr[4];
339static unsigned long saved_pgsr[4]; 339static unsigned long saved_pgsr[4];
340 340
341static int pxa2xx_mfp_suspend(struct sys_device *d, pm_message_t state) 341static int pxa2xx_mfp_suspend(void)
342{ 342{
343 int i; 343 int i;
344 344
@@ -365,7 +365,7 @@ static int pxa2xx_mfp_suspend(struct sys_device *d, pm_message_t state)
365 return 0; 365 return 0;
366} 366}
367 367
368static int pxa2xx_mfp_resume(struct sys_device *d) 368static void pxa2xx_mfp_resume(void)
369{ 369{
370 int i; 370 int i;
371 371
@@ -376,15 +376,13 @@ static int pxa2xx_mfp_resume(struct sys_device *d)
376 PGSR(i) = saved_pgsr[i]; 376 PGSR(i) = saved_pgsr[i];
377 } 377 }
378 PSSR = PSSR_RDH | PSSR_PH; 378 PSSR = PSSR_RDH | PSSR_PH;
379 return 0;
380} 379}
381#else 380#else
382#define pxa2xx_mfp_suspend NULL 381#define pxa2xx_mfp_suspend NULL
383#define pxa2xx_mfp_resume NULL 382#define pxa2xx_mfp_resume NULL
384#endif 383#endif
385 384
386struct sysdev_class pxa2xx_mfp_sysclass = { 385struct syscore_ops pxa2xx_mfp_syscore_ops = {
387 .name = "mfp",
388 .suspend = pxa2xx_mfp_suspend, 386 .suspend = pxa2xx_mfp_suspend,
389 .resume = pxa2xx_mfp_resume, 387 .resume = pxa2xx_mfp_resume,
390}; 388};
@@ -409,6 +407,6 @@ static int __init pxa2xx_mfp_init(void)
409 for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++) 407 for (i = 0; i <= gpio_to_bank(pxa_last_gpio); i++)
410 gpdr_lpm[i] = GPDR(i * 32); 408 gpdr_lpm[i] = GPDR(i * 32);
411 409
412 return sysdev_class_register(&pxa2xx_mfp_sysclass); 410 return 0;
413} 411}
414postcore_initcall(pxa2xx_mfp_init); 412postcore_initcall(pxa2xx_mfp_init);
diff --git a/arch/arm/mach-pxa/mfp-pxa3xx.c b/arch/arm/mach-pxa/mfp-pxa3xx.c
index 7a270eecd480..89863a01ecd7 100644
--- a/arch/arm/mach-pxa/mfp-pxa3xx.c
+++ b/arch/arm/mach-pxa/mfp-pxa3xx.c
@@ -17,7 +17,7 @@
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/sysdev.h> 20#include <linux/syscore_ops.h>
21 21
22#include <mach/hardware.h> 22#include <mach/hardware.h>
23#include <mach/mfp-pxa3xx.h> 23#include <mach/mfp-pxa3xx.h>
@@ -31,13 +31,13 @@
31 * a pull-down mode if they're an active low chip select, and we're 31 * a pull-down mode if they're an active low chip select, and we're
32 * just entering standby. 32 * just entering standby.
33 */ 33 */
34static int pxa3xx_mfp_suspend(struct sys_device *d, pm_message_t state) 34static int pxa3xx_mfp_suspend(void)
35{ 35{
36 mfp_config_lpm(); 36 mfp_config_lpm();
37 return 0; 37 return 0;
38} 38}
39 39
40static int pxa3xx_mfp_resume(struct sys_device *d) 40static void pxa3xx_mfp_resume(void)
41{ 41{
42 mfp_config_run(); 42 mfp_config_run();
43 43
@@ -47,24 +47,13 @@ static int pxa3xx_mfp_resume(struct sys_device *d)
47 * preserve them here in case they will be referenced later 47 * preserve them here in case they will be referenced later
48 */ 48 */
49 ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S); 49 ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S);
50 return 0;
51} 50}
52#else 51#else
53#define pxa3xx_mfp_suspend NULL 52#define pxa3xx_mfp_suspend NULL
54#define pxa3xx_mfp_resume NULL 53#define pxa3xx_mfp_resume NULL
55#endif 54#endif
56 55
57struct sysdev_class pxa3xx_mfp_sysclass = { 56struct syscore_ops pxa3xx_mfp_syscore_ops = {
58 .name = "mfp",
59 .suspend = pxa3xx_mfp_suspend, 57 .suspend = pxa3xx_mfp_suspend,
60 .resume = pxa3xx_mfp_resume, 58 .resume = pxa3xx_mfp_resume,
61}; 59};
62
63static int __init mfp_init_devicefs(void)
64{
65 if (cpu_is_pxa3xx())
66 return sysdev_class_register(&pxa3xx_mfp_sysclass);
67
68 return 0;
69}
70postcore_initcall(mfp_init_devicefs);
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index 23925db8ff74..e3470137c934 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -22,7 +22,7 @@
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/sysdev.h> 25#include <linux/syscore_ops.h>
26#include <linux/input.h> 26#include <linux/input.h>
27#include <linux/delay.h> 27#include <linux/delay.h>
28#include <linux/gpio_keys.h> 28#include <linux/gpio_keys.h>
@@ -488,7 +488,7 @@ static void install_bootstrap(void)
488} 488}
489 489
490 490
491static int mioa701_sys_suspend(struct sys_device *sysdev, pm_message_t state) 491static int mioa701_sys_suspend(void)
492{ 492{
493 int i = 0, is_bt_on; 493 int i = 0, is_bt_on;
494 u32 *mem_resume_vector = phys_to_virt(RESUME_VECTOR_ADDR); 494 u32 *mem_resume_vector = phys_to_virt(RESUME_VECTOR_ADDR);
@@ -514,7 +514,7 @@ static int mioa701_sys_suspend(struct sys_device *sysdev, pm_message_t state)
514 return 0; 514 return 0;
515} 515}
516 516
517static int mioa701_sys_resume(struct sys_device *sysdev) 517static void mioa701_sys_resume(void)
518{ 518{
519 int i = 0; 519 int i = 0;
520 u32 *mem_resume_vector = phys_to_virt(RESUME_VECTOR_ADDR); 520 u32 *mem_resume_vector = phys_to_virt(RESUME_VECTOR_ADDR);
@@ -527,43 +527,18 @@ static int mioa701_sys_resume(struct sys_device *sysdev)
527 *mem_resume_enabler = save_buffer[i++]; 527 *mem_resume_enabler = save_buffer[i++];
528 *mem_resume_bt = save_buffer[i++]; 528 *mem_resume_bt = save_buffer[i++];
529 *mem_resume_unknown = save_buffer[i++]; 529 *mem_resume_unknown = save_buffer[i++];
530
531 return 0;
532} 530}
533 531
534static struct sysdev_class mioa701_sysclass = { 532static struct syscore_ops mioa701_syscore_ops = {
535 .name = "mioa701", 533 .suspend = mioa701_sys_suspend,
536}; 534 .resume = mioa701_sys_resume,
537
538static struct sys_device sysdev_bootstrap = {
539 .cls = &mioa701_sysclass,
540};
541
542static struct sysdev_driver driver_bootstrap = {
543 .suspend = &mioa701_sys_suspend,
544 .resume = &mioa701_sys_resume,
545}; 535};
546 536
547static int __init bootstrap_init(void) 537static int __init bootstrap_init(void)
548{ 538{
549 int rc;
550 int save_size = mioa701_bootstrap_lg + (sizeof(u32) * 3); 539 int save_size = mioa701_bootstrap_lg + (sizeof(u32) * 3);
551 540
552 rc = sysdev_class_register(&mioa701_sysclass); 541 register_syscore_ops(&mioa701_syscore_ops);
553 if (rc) {
554 printk(KERN_ERR "Failed registering mioa701 sys class\n");
555 return -ENODEV;
556 }
557 rc = sysdev_register(&sysdev_bootstrap);
558 if (rc) {
559 printk(KERN_ERR "Failed registering mioa701 sys device\n");
560 return -ENODEV;
561 }
562 rc = sysdev_driver_register(&mioa701_sysclass, &driver_bootstrap);
563 if (rc) {
564 printk(KERN_ERR "Failed registering PMU sys driver\n");
565 return -ENODEV;
566 }
567 542
568 save_buffer = kmalloc(save_size, GFP_KERNEL); 543 save_buffer = kmalloc(save_size, GFP_KERNEL);
569 if (!save_buffer) 544 if (!save_buffer)
@@ -576,9 +551,7 @@ static int __init bootstrap_init(void)
576static void bootstrap_exit(void) 551static void bootstrap_exit(void)
577{ 552{
578 kfree(save_buffer); 553 kfree(save_buffer);
579 sysdev_driver_unregister(&mioa701_sysclass, &driver_bootstrap); 554 unregister_syscore_ops(&mioa701_syscore_ops);
580 sysdev_unregister(&sysdev_bootstrap);
581 sysdev_class_unregister(&mioa701_sysclass);
582 555
583 printk(KERN_CRIT "Unregistering mioa701 suspend will hang next" 556 printk(KERN_CRIT "Unregistering mioa701 suspend will hang next"
584 "resume !!!\n"); 557 "resume !!!\n");
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c
index a6f898cbfac9..4061ecddee70 100644
--- a/arch/arm/mach-pxa/palmld.c
+++ b/arch/arm/mach-pxa/palmld.c
@@ -24,7 +24,6 @@
24#include <linux/gpio.h> 24#include <linux/gpio.h>
25#include <linux/wm97xx.h> 25#include <linux/wm97xx.h>
26#include <linux/power_supply.h> 26#include <linux/power_supply.h>
27#include <linux/sysdev.h>
28#include <linux/mtd/mtd.h> 27#include <linux/mtd/mtd.h>
29#include <linux/mtd/partitions.h> 28#include <linux/mtd/partitions.h>
30#include <linux/mtd/physmap.h> 29#include <linux/mtd/physmap.h>
diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c
index 8aadad55fbe4..20d1b18b1733 100644
--- a/arch/arm/mach-pxa/palmtreo.c
+++ b/arch/arm/mach-pxa/palmtreo.c
@@ -25,7 +25,6 @@
25#include <linux/pwm_backlight.h> 25#include <linux/pwm_backlight.h>
26#include <linux/gpio.h> 26#include <linux/gpio.h>
27#include <linux/power_supply.h> 27#include <linux/power_supply.h>
28#include <linux/sysdev.h>
29#include <linux/w1-gpio.h> 28#include <linux/w1-gpio.h>
30 29
31#include <asm/mach-types.h> 30#include <asm/mach-types.h>
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c
index 3b8a4f37dbbe..65f24f0b77e8 100644
--- a/arch/arm/mach-pxa/palmz72.c
+++ b/arch/arm/mach-pxa/palmz72.c
@@ -19,7 +19,7 @@
19 */ 19 */
20 20
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/sysdev.h> 22#include <linux/syscore_ops.h>
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/irq.h> 24#include <linux/irq.h>
25#include <linux/gpio_keys.h> 25#include <linux/gpio_keys.h>
@@ -233,9 +233,9 @@ static struct palmz72_resume_info palmz72_resume_info = {
233 233
234static unsigned long store_ptr; 234static unsigned long store_ptr;
235 235
236/* sys_device for Palm Zire 72 PM */ 236/* syscore_ops for Palm Zire 72 PM */
237 237
238static int palmz72_pm_suspend(struct sys_device *dev, pm_message_t msg) 238static int palmz72_pm_suspend(void)
239{ 239{
240 /* setup the resume_info struct for the original bootloader */ 240 /* setup the resume_info struct for the original bootloader */
241 palmz72_resume_info.resume_addr = (u32) cpu_resume; 241 palmz72_resume_info.resume_addr = (u32) cpu_resume;
@@ -249,31 +249,23 @@ static int palmz72_pm_suspend(struct sys_device *dev, pm_message_t msg)
249 return 0; 249 return 0;
250} 250}
251 251
252static int palmz72_pm_resume(struct sys_device *dev) 252static void palmz72_pm_resume(void)
253{ 253{
254 *PALMZ72_SAVE_DWORD = store_ptr; 254 *PALMZ72_SAVE_DWORD = store_ptr;
255 return 0;
256} 255}
257 256
258static struct sysdev_class palmz72_pm_sysclass = { 257static struct syscore_ops palmz72_pm_syscore_ops = {
259 .name = "palmz72_pm",
260 .suspend = palmz72_pm_suspend, 258 .suspend = palmz72_pm_suspend,
261 .resume = palmz72_pm_resume, 259 .resume = palmz72_pm_resume,
262}; 260};
263 261
264static struct sys_device palmz72_pm_device = {
265 .cls = &palmz72_pm_sysclass,
266};
267
268static int __init palmz72_pm_init(void) 262static int __init palmz72_pm_init(void)
269{ 263{
270 int ret = -ENODEV;
271 if (machine_is_palmz72()) { 264 if (machine_is_palmz72()) {
272 ret = sysdev_class_register(&palmz72_pm_sysclass); 265 register_syscore_ops(&palmz72_pm_syscore_ops);
273 if (ret == 0) 266 return 0;
274 ret = sysdev_register(&palmz72_pm_device);
275 } 267 }
276 return ret; 268 return -ENODEV;
277} 269}
278 270
279device_initcall(palmz72_pm_init); 271device_initcall(palmz72_pm_init);
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index a4af8c52d7ee..fed363cec9c6 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -21,7 +21,7 @@
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/suspend.h> 23#include <linux/suspend.h>
24#include <linux/sysdev.h> 24#include <linux/syscore_ops.h>
25#include <linux/irq.h> 25#include <linux/irq.h>
26 26
27#include <asm/mach/map.h> 27#include <asm/mach/map.h>
@@ -350,21 +350,9 @@ static struct platform_device *pxa25x_devices[] __initdata = {
350 &pxa_device_asoc_platform, 350 &pxa_device_asoc_platform,
351}; 351};
352 352
353static struct sys_device pxa25x_sysdev[] = {
354 {
355 .cls = &pxa_irq_sysclass,
356 }, {
357 .cls = &pxa2xx_mfp_sysclass,
358 }, {
359 .cls = &pxa_gpio_sysclass,
360 }, {
361 .cls = &pxa2xx_clock_sysclass,
362 }
363};
364
365static int __init pxa25x_init(void) 353static int __init pxa25x_init(void)
366{ 354{
367 int i, ret = 0; 355 int ret = 0;
368 356
369 if (cpu_is_pxa25x()) { 357 if (cpu_is_pxa25x()) {
370 358
@@ -377,11 +365,10 @@ static int __init pxa25x_init(void)
377 365
378 pxa25x_init_pm(); 366 pxa25x_init_pm();
379 367
380 for (i = 0; i < ARRAY_SIZE(pxa25x_sysdev); i++) { 368 register_syscore_ops(&pxa_irq_syscore_ops);
381 ret = sysdev_register(&pxa25x_sysdev[i]); 369 register_syscore_ops(&pxa2xx_mfp_syscore_ops);
382 if (ret) 370 register_syscore_ops(&pxa_gpio_syscore_ops);
383 pr_err("failed to register sysdev[%d]\n", i); 371 register_syscore_ops(&pxa2xx_clock_syscore_ops);
384 }
385 372
386 ret = platform_add_devices(pxa25x_devices, 373 ret = platform_add_devices(pxa25x_devices,
387 ARRAY_SIZE(pxa25x_devices)); 374 ARRAY_SIZE(pxa25x_devices));
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 909756eaf4b7..2fecbec58d88 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -16,7 +16,7 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/suspend.h> 17#include <linux/suspend.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19#include <linux/sysdev.h> 19#include <linux/syscore_ops.h>
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <linux/i2c/pxa-i2c.h> 22#include <linux/i2c/pxa-i2c.h>
@@ -428,21 +428,9 @@ static struct platform_device *devices[] __initdata = {
428 &pxa27x_device_pwm1, 428 &pxa27x_device_pwm1,
429}; 429};
430 430
431static struct sys_device pxa27x_sysdev[] = {
432 {
433 .cls = &pxa_irq_sysclass,
434 }, {
435 .cls = &pxa2xx_mfp_sysclass,
436 }, {
437 .cls = &pxa_gpio_sysclass,
438 }, {
439 .cls = &pxa2xx_clock_sysclass,
440 }
441};
442
443static int __init pxa27x_init(void) 431static int __init pxa27x_init(void)
444{ 432{
445 int i, ret = 0; 433 int ret = 0;
446 434
447 if (cpu_is_pxa27x()) { 435 if (cpu_is_pxa27x()) {
448 436
@@ -455,11 +443,10 @@ static int __init pxa27x_init(void)
455 443
456 pxa27x_init_pm(); 444 pxa27x_init_pm();
457 445
458 for (i = 0; i < ARRAY_SIZE(pxa27x_sysdev); i++) { 446 register_syscore_ops(&pxa_irq_syscore_ops);
459 ret = sysdev_register(&pxa27x_sysdev[i]); 447 register_syscore_ops(&pxa2xx_mfp_syscore_ops);
460 if (ret) 448 register_syscore_ops(&pxa_gpio_syscore_ops);
461 pr_err("failed to register sysdev[%d]\n", i); 449 register_syscore_ops(&pxa2xx_clock_syscore_ops);
462 }
463 450
464 ret = platform_add_devices(devices, ARRAY_SIZE(devices)); 451 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
465 } 452 }
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index 8dd107391157..8521d7d6f1da 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -20,7 +20,7 @@
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <linux/io.h> 22#include <linux/io.h>
23#include <linux/sysdev.h> 23#include <linux/syscore_ops.h>
24#include <linux/i2c/pxa-i2c.h> 24#include <linux/i2c/pxa-i2c.h>
25 25
26#include <asm/mach/map.h> 26#include <asm/mach/map.h>
@@ -427,21 +427,9 @@ static struct platform_device *devices[] __initdata = {
427 &pxa27x_device_pwm1, 427 &pxa27x_device_pwm1,
428}; 428};
429 429
430static struct sys_device pxa3xx_sysdev[] = {
431 {
432 .cls = &pxa_irq_sysclass,
433 }, {
434 .cls = &pxa3xx_mfp_sysclass,
435 }, {
436 .cls = &pxa_gpio_sysclass,
437 }, {
438 .cls = &pxa3xx_clock_sysclass,
439 }
440};
441
442static int __init pxa3xx_init(void) 430static int __init pxa3xx_init(void)
443{ 431{
444 int i, ret = 0; 432 int ret = 0;
445 433
446 if (cpu_is_pxa3xx()) { 434 if (cpu_is_pxa3xx()) {
447 435
@@ -462,11 +450,10 @@ static int __init pxa3xx_init(void)
462 450
463 pxa3xx_init_pm(); 451 pxa3xx_init_pm();
464 452
465 for (i = 0; i < ARRAY_SIZE(pxa3xx_sysdev); i++) { 453 register_syscore_ops(&pxa_irq_syscore_ops);
466 ret = sysdev_register(&pxa3xx_sysdev[i]); 454 register_syscore_ops(&pxa3xx_mfp_syscore_ops);
467 if (ret) 455 register_syscore_ops(&pxa_gpio_syscore_ops);
468 pr_err("failed to register sysdev[%d]\n", i); 456 register_syscore_ops(&pxa3xx_clock_syscore_ops);
469 }
470 457
471 ret = platform_add_devices(devices, ARRAY_SIZE(devices)); 458 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
472 } 459 }
diff --git a/arch/arm/mach-pxa/pxa95x.c b/arch/arm/mach-pxa/pxa95x.c
index 23b229bd06e9..ecc82a330fad 100644
--- a/arch/arm/mach-pxa/pxa95x.c
+++ b/arch/arm/mach-pxa/pxa95x.c
@@ -18,7 +18,7 @@
18#include <linux/i2c/pxa-i2c.h> 18#include <linux/i2c/pxa-i2c.h>
19#include <linux/irq.h> 19#include <linux/irq.h>
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/sysdev.h> 21#include <linux/syscore_ops.h>
22 22
23#include <mach/hardware.h> 23#include <mach/hardware.h>
24#include <mach/gpio.h> 24#include <mach/gpio.h>
@@ -260,16 +260,6 @@ static struct platform_device *devices[] __initdata = {
260 &pxa27x_device_pwm1, 260 &pxa27x_device_pwm1,
261}; 261};
262 262
263static struct sys_device pxa95x_sysdev[] = {
264 {
265 .cls = &pxa_irq_sysclass,
266 }, {
267 .cls = &pxa_gpio_sysclass,
268 }, {
269 .cls = &pxa3xx_clock_sysclass,
270 }
271};
272
273static int __init pxa95x_init(void) 263static int __init pxa95x_init(void)
274{ 264{
275 int ret = 0, i; 265 int ret = 0, i;
@@ -293,11 +283,9 @@ static int __init pxa95x_init(void)
293 if ((ret = pxa_init_dma(IRQ_DMA, 32))) 283 if ((ret = pxa_init_dma(IRQ_DMA, 32)))
294 return ret; 284 return ret;
295 285
296 for (i = 0; i < ARRAY_SIZE(pxa95x_sysdev); i++) { 286 register_syscore_ops(&pxa_irq_syscore_ops);
297 ret = sysdev_register(&pxa95x_sysdev[i]); 287 register_syscore_ops(&pxa_gpio_syscore_ops);
298 if (ret) 288 register_syscore_ops(&pxa3xx_clock_syscore_ops);
299 pr_err("failed to register sysdev[%d]\n", i);
300 }
301 289
302 ret = platform_add_devices(devices, ARRAY_SIZE(devices)); 290 ret = platform_add_devices(devices, ARRAY_SIZE(devices));
303 } 291 }
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c
index cd1861351f75..d130f77b6d11 100644
--- a/arch/arm/mach-pxa/raumfeld.c
+++ b/arch/arm/mach-pxa/raumfeld.c
@@ -18,7 +18,6 @@
18 18
19#include <linux/init.h> 19#include <linux/init.h>
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/sysdev.h>
22#include <linux/platform_device.h> 21#include <linux/platform_device.h>
23#include <linux/interrupt.h> 22#include <linux/interrupt.h>
24#include <linux/gpio.h> 23#include <linux/gpio.h>
diff --git a/arch/arm/mach-pxa/smemc.c b/arch/arm/mach-pxa/smemc.c
index 232b7316ec08..79923058d10f 100644
--- a/arch/arm/mach-pxa/smemc.c
+++ b/arch/arm/mach-pxa/smemc.c
@@ -6,7 +6,7 @@
6#include <linux/kernel.h> 6#include <linux/kernel.h>
7#include <linux/init.h> 7#include <linux/init.h>
8#include <linux/io.h> 8#include <linux/io.h>
9#include <linux/sysdev.h> 9#include <linux/syscore_ops.h>
10 10
11#include <mach/hardware.h> 11#include <mach/hardware.h>
12#include <mach/smemc.h> 12#include <mach/smemc.h>
@@ -16,7 +16,7 @@ static unsigned long msc[2];
16static unsigned long sxcnfg, memclkcfg; 16static unsigned long sxcnfg, memclkcfg;
17static unsigned long csadrcfg[4]; 17static unsigned long csadrcfg[4];
18 18
19static int pxa3xx_smemc_suspend(struct sys_device *dev, pm_message_t state) 19static int pxa3xx_smemc_suspend(void)
20{ 20{
21 msc[0] = __raw_readl(MSC0); 21 msc[0] = __raw_readl(MSC0);
22 msc[1] = __raw_readl(MSC1); 22 msc[1] = __raw_readl(MSC1);
@@ -30,7 +30,7 @@ static int pxa3xx_smemc_suspend(struct sys_device *dev, pm_message_t state)
30 return 0; 30 return 0;
31} 31}
32 32
33static int pxa3xx_smemc_resume(struct sys_device *dev) 33static void pxa3xx_smemc_resume(void)
34{ 34{
35 __raw_writel(msc[0], MSC0); 35 __raw_writel(msc[0], MSC0);
36 __raw_writel(msc[1], MSC1); 36 __raw_writel(msc[1], MSC1);
@@ -40,34 +40,19 @@ static int pxa3xx_smemc_resume(struct sys_device *dev)
40 __raw_writel(csadrcfg[1], CSADRCFG1); 40 __raw_writel(csadrcfg[1], CSADRCFG1);
41 __raw_writel(csadrcfg[2], CSADRCFG2); 41 __raw_writel(csadrcfg[2], CSADRCFG2);
42 __raw_writel(csadrcfg[3], CSADRCFG3); 42 __raw_writel(csadrcfg[3], CSADRCFG3);
43
44 return 0;
45} 43}
46 44
47static struct sysdev_class smemc_sysclass = { 45static struct syscore_ops smemc_syscore_ops = {
48 .name = "smemc",
49 .suspend = pxa3xx_smemc_suspend, 46 .suspend = pxa3xx_smemc_suspend,
50 .resume = pxa3xx_smemc_resume, 47 .resume = pxa3xx_smemc_resume,
51}; 48};
52 49
53static struct sys_device smemc_sysdev = {
54 .id = 0,
55 .cls = &smemc_sysclass,
56};
57
58static int __init smemc_init(void) 50static int __init smemc_init(void)
59{ 51{
60 int ret = 0; 52 if (cpu_is_pxa3xx())
53 register_syscore_ops(&smemc_syscore_ops);
61 54
62 if (cpu_is_pxa3xx()) { 55 return 0;
63 ret = sysdev_class_register(&smemc_sysclass);
64 if (ret)
65 return ret;
66
67 ret = sysdev_register(&smemc_sysdev);
68 }
69
70 return ret;
71} 56}
72subsys_initcall(smemc_init); 57subsys_initcall(smemc_init);
73#endif 58#endif
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c
index 428da3ff33a5..de684701449c 100644
--- a/arch/arm/mach-pxa/time.c
+++ b/arch/arm/mach-pxa/time.c
@@ -105,19 +105,6 @@ static struct clock_event_device ckevt_pxa_osmr0 = {
105 .set_mode = pxa_osmr0_set_mode, 105 .set_mode = pxa_osmr0_set_mode,
106}; 106};
107 107
108static cycle_t pxa_read_oscr(struct clocksource *cs)
109{
110 return OSCR;
111}
112
113static struct clocksource cksrc_pxa_oscr0 = {
114 .name = "oscr0",
115 .rating = 200,
116 .read = pxa_read_oscr,
117 .mask = CLOCKSOURCE_MASK(32),
118 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
119};
120
121static struct irqaction pxa_ost0_irq = { 108static struct irqaction pxa_ost0_irq = {
122 .name = "ost0", 109 .name = "ost0",
123 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 110 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
@@ -134,7 +121,6 @@ static void __init pxa_timer_init(void)
134 121
135 init_sched_clock(&cd, pxa_update_sched_clock, 32, clock_tick_rate); 122 init_sched_clock(&cd, pxa_update_sched_clock, 32, clock_tick_rate);
136 123
137 clocksource_calc_mult_shift(&cksrc_pxa_oscr0, clock_tick_rate, 4);
138 clockevents_calc_mult_shift(&ckevt_pxa_osmr0, clock_tick_rate, 4); 124 clockevents_calc_mult_shift(&ckevt_pxa_osmr0, clock_tick_rate, 4);
139 ckevt_pxa_osmr0.max_delta_ns = 125 ckevt_pxa_osmr0.max_delta_ns =
140 clockevent_delta2ns(0x7fffffff, &ckevt_pxa_osmr0); 126 clockevent_delta2ns(0x7fffffff, &ckevt_pxa_osmr0);
@@ -144,7 +130,8 @@ static void __init pxa_timer_init(void)
144 130
145 setup_irq(IRQ_OST0, &pxa_ost0_irq); 131 setup_irq(IRQ_OST0, &pxa_ost0_irq);
146 132
147 clocksource_register_hz(&cksrc_pxa_oscr0, clock_tick_rate); 133 clocksource_mmio_init(&OSCR, "oscr0", clock_tick_rate, 200, 32,
134 clocksource_mmio_readl_up);
148 clockevents_register_device(&ckevt_pxa_osmr0); 135 clockevents_register_device(&ckevt_pxa_osmr0);
149} 136}
150 137
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
index b9cfbebdfe9c..687417a93698 100644
--- a/arch/arm/mach-pxa/trizeps4.c
+++ b/arch/arm/mach-pxa/trizeps4.c
@@ -15,7 +15,6 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/sysdev.h>
19#include <linux/interrupt.h> 18#include <linux/interrupt.h>
20#include <linux/sched.h> 19#include <linux/sched.h>
21#include <linux/bitops.h> 20#include <linux/bitops.h>
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c
index b523f119e0f0..903218eab56d 100644
--- a/arch/arm/mach-pxa/viper.c
+++ b/arch/arm/mach-pxa/viper.c
@@ -44,6 +44,7 @@
44#include <linux/mtd/mtd.h> 44#include <linux/mtd/mtd.h>
45#include <linux/mtd/partitions.h> 45#include <linux/mtd/partitions.h>
46#include <linux/mtd/physmap.h> 46#include <linux/mtd/physmap.h>
47#include <linux/syscore_ops.h>
47 48
48#include <mach/pxa25x.h> 49#include <mach/pxa25x.h>
49#include <mach/audio.h> 50#include <mach/audio.h>
@@ -130,20 +131,19 @@ static u8 viper_hw_version(void)
130 return v1; 131 return v1;
131} 132}
132 133
133/* CPU sysdev */ 134/* CPU system core operations. */
134static int viper_cpu_suspend(struct sys_device *sysdev, pm_message_t state) 135static int viper_cpu_suspend(void)
135{ 136{
136 viper_icr_set_bit(VIPER_ICR_R_DIS); 137 viper_icr_set_bit(VIPER_ICR_R_DIS);
137 return 0; 138 return 0;
138} 139}
139 140
140static int viper_cpu_resume(struct sys_device *sysdev) 141static void viper_cpu_resume(void)
141{ 142{
142 viper_icr_clear_bit(VIPER_ICR_R_DIS); 143 viper_icr_clear_bit(VIPER_ICR_R_DIS);
143 return 0;
144} 144}
145 145
146static struct sysdev_driver viper_cpu_sysdev_driver = { 146static struct syscore_ops viper_cpu_syscore_ops = {
147 .suspend = viper_cpu_suspend, 147 .suspend = viper_cpu_suspend,
148 .resume = viper_cpu_resume, 148 .resume = viper_cpu_resume,
149}; 149};
@@ -945,7 +945,7 @@ static void __init viper_init(void)
945 viper_init_vcore_gpios(); 945 viper_init_vcore_gpios();
946 viper_init_cpufreq(); 946 viper_init_cpufreq();
947 947
948 sysdev_driver_register(&cpu_sysdev_class, &viper_cpu_sysdev_driver); 948 register_syscore_ops(&viper_cpu_syscore_ops);
949 949
950 if (version) { 950 if (version) {
951 pr_info("viper: hardware v%di%d detected. " 951 pr_info("viper: hardware v%di%d detected. "
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
index f71d377c8640..67bd41488bf8 100644
--- a/arch/arm/mach-pxa/vpac270.c
+++ b/arch/arm/mach-pxa/vpac270.c
@@ -16,7 +16,6 @@
16#include <linux/gpio_keys.h> 16#include <linux/gpio_keys.h>
17#include <linux/input.h> 17#include <linux/input.h>
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19#include <linux/sysdev.h>
20#include <linux/usb/gpio_vbus.h> 19#include <linux/usb/gpio_vbus.h>
21#include <linux/mtd/mtd.h> 20#include <linux/mtd/mtd.h>
22#include <linux/mtd/partitions.h> 21#include <linux/mtd/partitions.h>
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 75dbc8791d05..5c23450d2d1d 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -31,6 +31,7 @@
31#include <linux/amba/mmci.h> 31#include <linux/amba/mmci.h>
32#include <linux/gfp.h> 32#include <linux/gfp.h>
33#include <linux/clkdev.h> 33#include <linux/clkdev.h>
34#include <linux/mtd/physmap.h>
34 35
35#include <asm/system.h> 36#include <asm/system.h>
36#include <mach/hardware.h> 37#include <mach/hardware.h>
@@ -41,7 +42,6 @@
41#include <asm/hardware/icst.h> 42#include <asm/hardware/icst.h>
42 43
43#include <asm/mach/arch.h> 44#include <asm/mach/arch.h>
44#include <asm/mach/flash.h>
45#include <asm/mach/irq.h> 45#include <asm/mach/irq.h>
46#include <asm/mach/map.h> 46#include <asm/mach/map.h>
47 47
@@ -56,48 +56,9 @@
56 56
57#include "core.h" 57#include "core.h"
58 58
59#ifdef CONFIG_ZONE_DMA
60/*
61 * Adjust the zones if there are restrictions for DMA access.
62 */
63void __init realview_adjust_zones(unsigned long *size, unsigned long *hole)
64{
65 unsigned long dma_size = SZ_256M >> PAGE_SHIFT;
66
67 if (!machine_is_realview_pbx() || size[0] <= dma_size)
68 return;
69
70 size[ZONE_NORMAL] = size[0] - dma_size;
71 size[ZONE_DMA] = dma_size;
72 hole[ZONE_NORMAL] = hole[0];
73 hole[ZONE_DMA] = 0;
74}
75#endif
76
77
78#define REALVIEW_FLASHCTRL (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET) 59#define REALVIEW_FLASHCTRL (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET)
79 60
80static int realview_flash_init(void) 61static void realview_flash_set_vpp(struct platform_device *pdev, int on)
81{
82 u32 val;
83
84 val = __raw_readl(REALVIEW_FLASHCTRL);
85 val &= ~REALVIEW_FLASHPROG_FLVPPEN;
86 __raw_writel(val, REALVIEW_FLASHCTRL);
87
88 return 0;
89}
90
91static void realview_flash_exit(void)
92{
93 u32 val;
94
95 val = __raw_readl(REALVIEW_FLASHCTRL);
96 val &= ~REALVIEW_FLASHPROG_FLVPPEN;
97 __raw_writel(val, REALVIEW_FLASHCTRL);
98}
99
100static void realview_flash_set_vpp(int on)
101{ 62{
102 u32 val; 63 u32 val;
103 64
@@ -109,16 +70,13 @@ static void realview_flash_set_vpp(int on)
109 __raw_writel(val, REALVIEW_FLASHCTRL); 70 __raw_writel(val, REALVIEW_FLASHCTRL);
110} 71}
111 72
112static struct flash_platform_data realview_flash_data = { 73static struct physmap_flash_data realview_flash_data = {
113 .map_name = "cfi_probe",
114 .width = 4, 74 .width = 4,
115 .init = realview_flash_init,
116 .exit = realview_flash_exit,
117 .set_vpp = realview_flash_set_vpp, 75 .set_vpp = realview_flash_set_vpp,
118}; 76};
119 77
120struct platform_device realview_flash_device = { 78struct platform_device realview_flash_device = {
121 .name = "armflash", 79 .name = "physmap-flash",
122 .id = 0, 80 .id = 0,
123 .dev = { 81 .dev = {
124 .platform_data = &realview_flash_data, 82 .platform_data = &realview_flash_data,
@@ -315,6 +273,10 @@ static struct clk ref24_clk = {
315 .rate = 24000000, 273 .rate = 24000000,
316}; 274};
317 275
276static struct clk sp804_clk = {
277 .rate = 1000000,
278};
279
318static struct clk dummy_apb_pclk; 280static struct clk dummy_apb_pclk;
319 281
320static struct clk_lookup lookups[] = { 282static struct clk_lookup lookups[] = {
@@ -357,7 +319,10 @@ static struct clk_lookup lookups[] = {
357 }, { /* SSP */ 319 }, { /* SSP */
358 .dev_id = "dev:ssp0", 320 .dev_id = "dev:ssp0",
359 .clk = &ref24_clk, 321 .clk = &ref24_clk,
360 } 322 }, { /* SP804 timers */
323 .dev_id = "sp804",
324 .clk = &sp804_clk,
325 },
361}; 326};
362 327
363void __init realview_init_early(void) 328void __init realview_init_early(void)
@@ -545,8 +510,8 @@ void __init realview_timer_init(unsigned int timer_irq)
545 writel(0, timer2_va_base + TIMER_CTRL); 510 writel(0, timer2_va_base + TIMER_CTRL);
546 writel(0, timer3_va_base + TIMER_CTRL); 511 writel(0, timer3_va_base + TIMER_CTRL);
547 512
548 sp804_clocksource_init(timer3_va_base); 513 sp804_clocksource_init(timer3_va_base, "timer3");
549 sp804_clockevents_init(timer0_va_base, timer_irq); 514 sp804_clockevents_init(timer0_va_base, timer_irq, "timer0");
550} 515}
551 516
552/* 517/*
diff --git a/arch/arm/mach-realview/include/mach/barriers.h b/arch/arm/mach-realview/include/mach/barriers.h
index 0c5d749d7b5f..9a732195aa1c 100644
--- a/arch/arm/mach-realview/include/mach/barriers.h
+++ b/arch/arm/mach-realview/include/mach/barriers.h
@@ -4,5 +4,5 @@
4 * operation to deadlock the system. 4 * operation to deadlock the system.
5 */ 5 */
6#define mb() dsb() 6#define mb() dsb()
7#define rmb() dmb() 7#define rmb() dsb()
8#define wmb() mb() 8#define wmb() mb()
diff --git a/arch/arm/mach-realview/include/mach/memory.h b/arch/arm/mach-realview/include/mach/memory.h
index e05fc2c4c080..1759fa673eea 100644
--- a/arch/arm/mach-realview/include/mach/memory.h
+++ b/arch/arm/mach-realview/include/mach/memory.h
@@ -29,13 +29,8 @@
29#define PLAT_PHYS_OFFSET UL(0x00000000) 29#define PLAT_PHYS_OFFSET UL(0x00000000)
30#endif 30#endif
31 31
32#if !defined(__ASSEMBLY__) && defined(CONFIG_ZONE_DMA) 32#ifdef CONFIG_ZONE_DMA
33extern void realview_adjust_zones(unsigned long *size, unsigned long *hole); 33#define ARM_DMA_ZONE_SIZE SZ_256M
34#define arch_adjust_zones(size, hole) \
35 realview_adjust_zones(size, hole)
36
37#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_256M - 1)
38#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_256M)
39#endif 34#endif
40 35
41#ifdef CONFIG_SPARSEMEM 36#ifdef CONFIG_SPARSEMEM
diff --git a/arch/arm/mach-realview/include/mach/smp.h b/arch/arm/mach-realview/include/mach/smp.h
deleted file mode 100644
index c8221b38ee7c..000000000000
--- a/arch/arm/mach-realview/include/mach/smp.h
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifndef ASMARM_ARCH_SMP_H
2#define ASMARM_ARCH_SMP_H
3
4#include <asm/hardware/gic.h>
5
6/*
7 * We use IRQ1 as the IPI
8 */
9static inline void smp_cross_call(const struct cpumask *mask, int ipi)
10{
11 gic_raise_softirq(mask, ipi);
12}
13
14#endif
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c
index 23919229e12d..963bf0d8119a 100644
--- a/arch/arm/mach-realview/platsmp.c
+++ b/arch/arm/mach-realview/platsmp.c
@@ -14,6 +14,7 @@
14#include <linux/io.h> 14#include <linux/io.h>
15 15
16#include <mach/hardware.h> 16#include <mach/hardware.h>
17#include <asm/hardware/gic.h>
17#include <asm/mach-types.h> 18#include <asm/mach-types.h>
18#include <asm/smp_scu.h> 19#include <asm/smp_scu.h>
19#include <asm/unified.h> 20#include <asm/unified.h>
@@ -61,6 +62,8 @@ void __init smp_init_cpus(void)
61 62
62 for (i = 0; i < ncores; i++) 63 for (i = 0; i < ncores; i++)
63 set_cpu_possible(i, true); 64 set_cpu_possible(i, true);
65
66 set_smp_cross_call(gic_raise_softirq);
64} 67}
65 68
66void __init platform_smp_prepare_cpus(unsigned int max_cpus) 69void __init platform_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-s3c2410/irq.c b/arch/arm/mach-s3c2410/irq.c
index 5e2f35332056..2854129f8cc7 100644
--- a/arch/arm/mach-s3c2410/irq.c
+++ b/arch/arm/mach-s3c2410/irq.c
@@ -23,38 +23,12 @@
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/ioport.h> 25#include <linux/ioport.h>
26#include <linux/sysdev.h> 26#include <linux/syscore_ops.h>
27 27
28#include <plat/cpu.h> 28#include <plat/cpu.h>
29#include <plat/pm.h> 29#include <plat/pm.h>
30 30
31static int s3c2410_irq_add(struct sys_device *sysdev) 31struct syscore_ops s3c24xx_irq_syscore_ops = {
32{
33 return 0;
34}
35
36static struct sysdev_driver s3c2410_irq_driver = {
37 .add = s3c2410_irq_add,
38 .suspend = s3c24xx_irq_suspend, 32 .suspend = s3c24xx_irq_suspend,
39 .resume = s3c24xx_irq_resume, 33 .resume = s3c24xx_irq_resume,
40}; 34};
41
42static int __init s3c2410_irq_init(void)
43{
44 return sysdev_driver_register(&s3c2410_sysclass, &s3c2410_irq_driver);
45}
46
47arch_initcall(s3c2410_irq_init);
48
49static struct sysdev_driver s3c2410a_irq_driver = {
50 .add = s3c2410_irq_add,
51 .suspend = s3c24xx_irq_suspend,
52 .resume = s3c24xx_irq_resume,
53};
54
55static int __init s3c2410a_irq_init(void)
56{
57 return sysdev_driver_register(&s3c2410a_sysclass, &s3c2410a_irq_driver);
58}
59
60arch_initcall(s3c2410a_irq_init);
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index 2970ea9f7c2b..1e2d536adda9 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -17,7 +17,7 @@
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/sysdev.h> 20#include <linux/syscore_ops.h>
21#include <linux/serial_core.h> 21#include <linux/serial_core.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/dm9000.h> 23#include <linux/dm9000.h>
@@ -214,17 +214,16 @@ static struct s3c2410_uartcfg bast_uartcfgs[] __initdata = {
214/* NAND Flash on BAST board */ 214/* NAND Flash on BAST board */
215 215
216#ifdef CONFIG_PM 216#ifdef CONFIG_PM
217static int bast_pm_suspend(struct sys_device *sd, pm_message_t state) 217static int bast_pm_suspend(void)
218{ 218{
219 /* ensure that an nRESET is not generated on resume. */ 219 /* ensure that an nRESET is not generated on resume. */
220 gpio_direction_output(S3C2410_GPA(21), 1); 220 gpio_direction_output(S3C2410_GPA(21), 1);
221 return 0; 221 return 0;
222} 222}
223 223
224static int bast_pm_resume(struct sys_device *sd) 224static void bast_pm_resume(void)
225{ 225{
226 s3c_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT); 226 s3c_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT);
227 return 0;
228} 227}
229 228
230#else 229#else
@@ -232,16 +231,11 @@ static int bast_pm_resume(struct sys_device *sd)
232#define bast_pm_resume NULL 231#define bast_pm_resume NULL
233#endif 232#endif
234 233
235static struct sysdev_class bast_pm_sysclass = { 234static struct syscore_ops bast_pm_syscore_ops = {
236 .name = "mach-bast",
237 .suspend = bast_pm_suspend, 235 .suspend = bast_pm_suspend,
238 .resume = bast_pm_resume, 236 .resume = bast_pm_resume,
239}; 237};
240 238
241static struct sys_device bast_pm_sysdev = {
242 .cls = &bast_pm_sysclass,
243};
244
245static int smartmedia_map[] = { 0 }; 239static int smartmedia_map[] = { 0 };
246static int chip0_map[] = { 1 }; 240static int chip0_map[] = { 1 };
247static int chip1_map[] = { 2 }; 241static int chip1_map[] = { 2 };
@@ -642,8 +636,7 @@ static void __init bast_map_io(void)
642 636
643static void __init bast_init(void) 637static void __init bast_init(void)
644{ 638{
645 sysdev_class_register(&bast_pm_sysclass); 639 register_syscore_ops(&bast_pm_syscore_ops);
646 sysdev_register(&bast_pm_sysdev);
647 640
648 s3c_i2c0_set_platdata(&bast_i2c_info); 641 s3c_i2c0_set_platdata(&bast_i2c_info);
649 s3c_nand_set_platdata(&bast_nand_info); 642 s3c_nand_set_platdata(&bast_nand_info);
diff --git a/arch/arm/mach-s3c2410/nor-simtec.c b/arch/arm/mach-s3c2410/nor-simtec.c
index 598d130633dc..ad9f750f1e55 100644
--- a/arch/arm/mach-s3c2410/nor-simtec.c
+++ b/arch/arm/mach-s3c2410/nor-simtec.c
@@ -32,7 +32,7 @@
32 32
33#include "nor-simtec.h" 33#include "nor-simtec.h"
34 34
35static void simtec_nor_vpp(struct map_info *map, int vpp) 35static void simtec_nor_vpp(struct platform_device *pdev, int vpp)
36{ 36{
37 unsigned int val; 37 unsigned int val;
38 unsigned long flags; 38 unsigned long flags;
diff --git a/arch/arm/mach-s3c2410/pm.c b/arch/arm/mach-s3c2410/pm.c
index 725636fc4dc3..4728f9aa7df1 100644
--- a/arch/arm/mach-s3c2410/pm.c
+++ b/arch/arm/mach-s3c2410/pm.c
@@ -25,6 +25,7 @@
25#include <linux/errno.h> 25#include <linux/errno.h>
26#include <linux/time.h> 26#include <linux/time.h>
27#include <linux/sysdev.h> 27#include <linux/sysdev.h>
28#include <linux/syscore_ops.h>
28#include <linux/gpio.h> 29#include <linux/gpio.h>
29#include <linux/io.h> 30#include <linux/io.h>
30 31
@@ -92,7 +93,7 @@ static void s3c2410_pm_prepare(void)
92 } 93 }
93} 94}
94 95
95static int s3c2410_pm_resume(struct sys_device *dev) 96static void s3c2410_pm_resume(void)
96{ 97{
97 unsigned long tmp; 98 unsigned long tmp;
98 99
@@ -104,10 +105,12 @@ static int s3c2410_pm_resume(struct sys_device *dev)
104 105
105 if ( machine_is_aml_m5900() ) 106 if ( machine_is_aml_m5900() )
106 s3c2410_gpio_setpin(S3C2410_GPF(2), 0); 107 s3c2410_gpio_setpin(S3C2410_GPF(2), 0);
107
108 return 0;
109} 108}
110 109
110struct syscore_ops s3c2410_pm_syscore_ops = {
111 .resume = s3c2410_pm_resume,
112};
113
111static int s3c2410_pm_add(struct sys_device *dev) 114static int s3c2410_pm_add(struct sys_device *dev)
112{ 115{
113 pm_cpu_prep = s3c2410_pm_prepare; 116 pm_cpu_prep = s3c2410_pm_prepare;
@@ -119,7 +122,6 @@ static int s3c2410_pm_add(struct sys_device *dev)
119#if defined(CONFIG_CPU_S3C2410) 122#if defined(CONFIG_CPU_S3C2410)
120static struct sysdev_driver s3c2410_pm_driver = { 123static struct sysdev_driver s3c2410_pm_driver = {
121 .add = s3c2410_pm_add, 124 .add = s3c2410_pm_add,
122 .resume = s3c2410_pm_resume,
123}; 125};
124 126
125/* register ourselves */ 127/* register ourselves */
@@ -133,7 +135,6 @@ arch_initcall(s3c2410_pm_drvinit);
133 135
134static struct sysdev_driver s3c2410a_pm_driver = { 136static struct sysdev_driver s3c2410a_pm_driver = {
135 .add = s3c2410_pm_add, 137 .add = s3c2410_pm_add,
136 .resume = s3c2410_pm_resume,
137}; 138};
138 139
139static int __init s3c2410a_pm_drvinit(void) 140static int __init s3c2410a_pm_drvinit(void)
@@ -147,7 +148,6 @@ arch_initcall(s3c2410a_pm_drvinit);
147#if defined(CONFIG_CPU_S3C2440) 148#if defined(CONFIG_CPU_S3C2440)
148static struct sysdev_driver s3c2440_pm_driver = { 149static struct sysdev_driver s3c2440_pm_driver = {
149 .add = s3c2410_pm_add, 150 .add = s3c2410_pm_add,
150 .resume = s3c2410_pm_resume,
151}; 151};
152 152
153static int __init s3c2440_pm_drvinit(void) 153static int __init s3c2440_pm_drvinit(void)
@@ -161,7 +161,6 @@ arch_initcall(s3c2440_pm_drvinit);
161#if defined(CONFIG_CPU_S3C2442) 161#if defined(CONFIG_CPU_S3C2442)
162static struct sysdev_driver s3c2442_pm_driver = { 162static struct sysdev_driver s3c2442_pm_driver = {
163 .add = s3c2410_pm_add, 163 .add = s3c2410_pm_add,
164 .resume = s3c2410_pm_resume,
165}; 164};
166 165
167static int __init s3c2442_pm_drvinit(void) 166static int __init s3c2442_pm_drvinit(void)
diff --git a/arch/arm/mach-s3c2410/s3c2410.c b/arch/arm/mach-s3c2410/s3c2410.c
index adc90a3c5890..f1d3bd8f6f17 100644
--- a/arch/arm/mach-s3c2410/s3c2410.c
+++ b/arch/arm/mach-s3c2410/s3c2410.c
@@ -19,6 +19,7 @@
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/clk.h> 20#include <linux/clk.h>
21#include <linux/sysdev.h> 21#include <linux/sysdev.h>
22#include <linux/syscore_ops.h>
22#include <linux/serial_core.h> 23#include <linux/serial_core.h>
23#include <linux/platform_device.h> 24#include <linux/platform_device.h>
24#include <linux/io.h> 25#include <linux/io.h>
@@ -40,6 +41,7 @@
40#include <plat/devs.h> 41#include <plat/devs.h>
41#include <plat/clock.h> 42#include <plat/clock.h>
42#include <plat/pll.h> 43#include <plat/pll.h>
44#include <plat/pm.h>
43 45
44#include <plat/gpio-core.h> 46#include <plat/gpio-core.h>
45#include <plat/gpio-cfg.h> 47#include <plat/gpio-cfg.h>
@@ -168,6 +170,9 @@ int __init s3c2410_init(void)
168{ 170{
169 printk("S3C2410: Initialising architecture\n"); 171 printk("S3C2410: Initialising architecture\n");
170 172
173 register_syscore_ops(&s3c2410_pm_syscore_ops);
174 register_syscore_ops(&s3c24xx_irq_syscore_ops);
175
171 return sysdev_register(&s3c2410_sysdev); 176 return sysdev_register(&s3c2410_sysdev);
172} 177}
173 178
diff --git a/arch/arm/mach-s3c2412/irq.c b/arch/arm/mach-s3c2412/irq.c
index f3355d2ec634..1a1aa220972b 100644
--- a/arch/arm/mach-s3c2412/irq.c
+++ b/arch/arm/mach-s3c2412/irq.c
@@ -202,8 +202,6 @@ static int s3c2412_irq_add(struct sys_device *sysdev)
202 202
203static struct sysdev_driver s3c2412_irq_driver = { 203static struct sysdev_driver s3c2412_irq_driver = {
204 .add = s3c2412_irq_add, 204 .add = s3c2412_irq_add,
205 .suspend = s3c24xx_irq_suspend,
206 .resume = s3c24xx_irq_resume,
207}; 205};
208 206
209static int s3c2412_irq_init(void) 207static int s3c2412_irq_init(void)
diff --git a/arch/arm/mach-s3c2412/mach-jive.c b/arch/arm/mach-s3c2412/mach-jive.c
index 923e01bdf017..85dcaeb9e62f 100644
--- a/arch/arm/mach-s3c2412/mach-jive.c
+++ b/arch/arm/mach-s3c2412/mach-jive.c
@@ -17,7 +17,7 @@
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/sysdev.h> 20#include <linux/syscore_ops.h>
21#include <linux/serial_core.h> 21#include <linux/serial_core.h>
22#include <linux/platform_device.h> 22#include <linux/platform_device.h>
23#include <linux/i2c.h> 23#include <linux/i2c.h>
@@ -486,7 +486,7 @@ static struct s3c2410_udc_mach_info jive_udc_cfg __initdata = {
486/* Jive power management device */ 486/* Jive power management device */
487 487
488#ifdef CONFIG_PM 488#ifdef CONFIG_PM
489static int jive_pm_suspend(struct sys_device *sd, pm_message_t state) 489static int jive_pm_suspend(void)
490{ 490{
491 /* Write the magic value u-boot uses to check for resume into 491 /* Write the magic value u-boot uses to check for resume into
492 * the INFORM0 register, and ensure INFORM1 is set to the 492 * the INFORM0 register, and ensure INFORM1 is set to the
@@ -498,10 +498,9 @@ static int jive_pm_suspend(struct sys_device *sd, pm_message_t state)
498 return 0; 498 return 0;
499} 499}
500 500
501static int jive_pm_resume(struct sys_device *sd) 501static void jive_pm_resume(void)
502{ 502{
503 __raw_writel(0x0, S3C2412_INFORM0); 503 __raw_writel(0x0, S3C2412_INFORM0);
504 return 0;
505} 504}
506 505
507#else 506#else
@@ -509,16 +508,11 @@ static int jive_pm_resume(struct sys_device *sd)
509#define jive_pm_resume NULL 508#define jive_pm_resume NULL
510#endif 509#endif
511 510
512static struct sysdev_class jive_pm_sysclass = { 511static struct syscore_ops jive_pm_syscore_ops = {
513 .name = "jive-pm",
514 .suspend = jive_pm_suspend, 512 .suspend = jive_pm_suspend,
515 .resume = jive_pm_resume, 513 .resume = jive_pm_resume,
516}; 514};
517 515
518static struct sys_device jive_pm_sysdev = {
519 .cls = &jive_pm_sysclass,
520};
521
522static void __init jive_map_io(void) 516static void __init jive_map_io(void)
523{ 517{
524 s3c24xx_init_io(jive_iodesc, ARRAY_SIZE(jive_iodesc)); 518 s3c24xx_init_io(jive_iodesc, ARRAY_SIZE(jive_iodesc));
@@ -536,10 +530,9 @@ static void jive_power_off(void)
536 530
537static void __init jive_machine_init(void) 531static void __init jive_machine_init(void)
538{ 532{
539 /* register system devices for managing low level suspend */ 533 /* register system core operations for managing low level suspend */
540 534
541 sysdev_class_register(&jive_pm_sysclass); 535 register_syscore_ops(&jive_pm_syscore_ops);
542 sysdev_register(&jive_pm_sysdev);
543 536
544 /* write our sleep configurations for the IO. Pull down all unused 537 /* write our sleep configurations for the IO. Pull down all unused
545 * IO, ensure that we have turned off all peripherals we do not 538 * IO, ensure that we have turned off all peripherals we do not
diff --git a/arch/arm/mach-s3c2412/pm.c b/arch/arm/mach-s3c2412/pm.c
index a7417c479ffe..752b13a7b3db 100644
--- a/arch/arm/mach-s3c2412/pm.c
+++ b/arch/arm/mach-s3c2412/pm.c
@@ -17,6 +17,7 @@
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/sysdev.h> 19#include <linux/sysdev.h>
20#include <linux/syscore_ops.h>
20#include <linux/platform_device.h> 21#include <linux/platform_device.h>
21#include <linux/io.h> 22#include <linux/io.h>
22 23
@@ -86,13 +87,24 @@ static struct sleep_save s3c2412_sleep[] = {
86 SAVE_ITEM(S3C2413_GPJSLPCON), 87 SAVE_ITEM(S3C2413_GPJSLPCON),
87}; 88};
88 89
89static int s3c2412_pm_suspend(struct sys_device *dev, pm_message_t state) 90static struct sysdev_driver s3c2412_pm_driver = {
91 .add = s3c2412_pm_add,
92};
93
94static __init int s3c2412_pm_init(void)
95{
96 return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_pm_driver);
97}
98
99arch_initcall(s3c2412_pm_init);
100
101static int s3c2412_pm_suspend(void)
90{ 102{
91 s3c_pm_do_save(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep)); 103 s3c_pm_do_save(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep));
92 return 0; 104 return 0;
93} 105}
94 106
95static int s3c2412_pm_resume(struct sys_device *dev) 107static void s3c2412_pm_resume(void)
96{ 108{
97 unsigned long tmp; 109 unsigned long tmp;
98 110
@@ -102,18 +114,9 @@ static int s3c2412_pm_resume(struct sys_device *dev)
102 __raw_writel(tmp, S3C2412_PWRCFG); 114 __raw_writel(tmp, S3C2412_PWRCFG);
103 115
104 s3c_pm_do_restore(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep)); 116 s3c_pm_do_restore(s3c2412_sleep, ARRAY_SIZE(s3c2412_sleep));
105 return 0;
106} 117}
107 118
108static struct sysdev_driver s3c2412_pm_driver = { 119struct syscore_ops s3c2412_pm_syscore_ops = {
109 .add = s3c2412_pm_add,
110 .suspend = s3c2412_pm_suspend, 120 .suspend = s3c2412_pm_suspend,
111 .resume = s3c2412_pm_resume, 121 .resume = s3c2412_pm_resume,
112}; 122};
113
114static __init int s3c2412_pm_init(void)
115{
116 return sysdev_driver_register(&s3c2412_sysclass, &s3c2412_pm_driver);
117}
118
119arch_initcall(s3c2412_pm_init);
diff --git a/arch/arm/mach-s3c2412/s3c2412.c b/arch/arm/mach-s3c2412/s3c2412.c
index 4c6df51ddf33..ef0958d3e5c6 100644
--- a/arch/arm/mach-s3c2412/s3c2412.c
+++ b/arch/arm/mach-s3c2412/s3c2412.c
@@ -19,6 +19,7 @@
19#include <linux/clk.h> 19#include <linux/clk.h>
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/sysdev.h> 21#include <linux/sysdev.h>
22#include <linux/syscore_ops.h>
22#include <linux/serial_core.h> 23#include <linux/serial_core.h>
23#include <linux/platform_device.h> 24#include <linux/platform_device.h>
24#include <linux/io.h> 25#include <linux/io.h>
@@ -244,5 +245,8 @@ int __init s3c2412_init(void)
244{ 245{
245 printk("S3C2412: Initialising architecture\n"); 246 printk("S3C2412: Initialising architecture\n");
246 247
248 register_syscore_ops(&s3c2412_pm_syscore_ops);
249 register_syscore_ops(&s3c24xx_irq_syscore_ops);
250
247 return sysdev_register(&s3c2412_sysdev); 251 return sysdev_register(&s3c2412_sysdev);
248} 252}
diff --git a/arch/arm/mach-s3c2416/irq.c b/arch/arm/mach-s3c2416/irq.c
index 77b38f2381c1..28ad20d42445 100644
--- a/arch/arm/mach-s3c2416/irq.c
+++ b/arch/arm/mach-s3c2416/irq.c
@@ -236,8 +236,6 @@ static int __init s3c2416_irq_add(struct sys_device *sysdev)
236 236
237static struct sysdev_driver s3c2416_irq_driver = { 237static struct sysdev_driver s3c2416_irq_driver = {
238 .add = s3c2416_irq_add, 238 .add = s3c2416_irq_add,
239 .suspend = s3c24xx_irq_suspend,
240 .resume = s3c24xx_irq_resume,
241}; 239};
242 240
243static int __init s3c2416_irq_init(void) 241static int __init s3c2416_irq_init(void)
diff --git a/arch/arm/mach-s3c2416/pm.c b/arch/arm/mach-s3c2416/pm.c
index 4a04205b04d5..41db2b21e213 100644
--- a/arch/arm/mach-s3c2416/pm.c
+++ b/arch/arm/mach-s3c2416/pm.c
@@ -11,6 +11,7 @@
11*/ 11*/
12 12
13#include <linux/sysdev.h> 13#include <linux/sysdev.h>
14#include <linux/syscore_ops.h>
14#include <linux/io.h> 15#include <linux/io.h>
15 16
16#include <asm/cacheflush.h> 17#include <asm/cacheflush.h>
@@ -55,30 +56,26 @@ static int s3c2416_pm_add(struct sys_device *sysdev)
55 return 0; 56 return 0;
56} 57}
57 58
58static int s3c2416_pm_suspend(struct sys_device *dev, pm_message_t state) 59static struct sysdev_driver s3c2416_pm_driver = {
60 .add = s3c2416_pm_add,
61};
62
63static __init int s3c2416_pm_init(void)
59{ 64{
60 return 0; 65 return sysdev_driver_register(&s3c2416_sysclass, &s3c2416_pm_driver);
61} 66}
62 67
63static int s3c2416_pm_resume(struct sys_device *dev) 68arch_initcall(s3c2416_pm_init);
69
70
71static void s3c2416_pm_resume(void)
64{ 72{
65 /* unset the return-from-sleep amd inform flags */ 73 /* unset the return-from-sleep amd inform flags */
66 __raw_writel(0x0, S3C2443_PWRMODE); 74 __raw_writel(0x0, S3C2443_PWRMODE);
67 __raw_writel(0x0, S3C2412_INFORM0); 75 __raw_writel(0x0, S3C2412_INFORM0);
68 __raw_writel(0x0, S3C2412_INFORM1); 76 __raw_writel(0x0, S3C2412_INFORM1);
69
70 return 0;
71} 77}
72 78
73static struct sysdev_driver s3c2416_pm_driver = { 79struct syscore_ops s3c2416_pm_syscore_ops = {
74 .add = s3c2416_pm_add,
75 .suspend = s3c2416_pm_suspend,
76 .resume = s3c2416_pm_resume, 80 .resume = s3c2416_pm_resume,
77}; 81};
78
79static __init int s3c2416_pm_init(void)
80{
81 return sysdev_driver_register(&s3c2416_sysclass, &s3c2416_pm_driver);
82}
83
84arch_initcall(s3c2416_pm_init);
diff --git a/arch/arm/mach-s3c2416/s3c2416.c b/arch/arm/mach-s3c2416/s3c2416.c
index ba7fd8737434..494ce913dc95 100644
--- a/arch/arm/mach-s3c2416/s3c2416.c
+++ b/arch/arm/mach-s3c2416/s3c2416.c
@@ -32,6 +32,7 @@
32#include <linux/platform_device.h> 32#include <linux/platform_device.h>
33#include <linux/serial_core.h> 33#include <linux/serial_core.h>
34#include <linux/sysdev.h> 34#include <linux/sysdev.h>
35#include <linux/syscore_ops.h>
35#include <linux/clk.h> 36#include <linux/clk.h>
36#include <linux/io.h> 37#include <linux/io.h>
37 38
@@ -54,6 +55,7 @@
54#include <plat/devs.h> 55#include <plat/devs.h>
55#include <plat/cpu.h> 56#include <plat/cpu.h>
56#include <plat/sdhci.h> 57#include <plat/sdhci.h>
58#include <plat/pm.h>
57 59
58#include <plat/iic-core.h> 60#include <plat/iic-core.h>
59#include <plat/fb-core.h> 61#include <plat/fb-core.h>
@@ -95,6 +97,9 @@ int __init s3c2416_init(void)
95 97
96 s3c_fb_setname("s3c2443-fb"); 98 s3c_fb_setname("s3c2443-fb");
97 99
100 register_syscore_ops(&s3c2416_pm_syscore_ops);
101 register_syscore_ops(&s3c24xx_irq_syscore_ops);
102
98 return sysdev_register(&s3c2416_sysdev); 103 return sysdev_register(&s3c2416_sysdev);
99} 104}
100 105
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c
index 14dc67897757..d88536393310 100644
--- a/arch/arm/mach-s3c2440/mach-osiris.c
+++ b/arch/arm/mach-s3c2440/mach-osiris.c
@@ -17,7 +17,7 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19#include <linux/device.h> 19#include <linux/device.h>
20#include <linux/sysdev.h> 20#include <linux/syscore_ops.h>
21#include <linux/serial_core.h> 21#include <linux/serial_core.h>
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/i2c.h> 23#include <linux/i2c.h>
@@ -284,7 +284,7 @@ static struct platform_device osiris_pcmcia = {
284#ifdef CONFIG_PM 284#ifdef CONFIG_PM
285static unsigned char pm_osiris_ctrl0; 285static unsigned char pm_osiris_ctrl0;
286 286
287static int osiris_pm_suspend(struct sys_device *sd, pm_message_t state) 287static int osiris_pm_suspend(void)
288{ 288{
289 unsigned int tmp; 289 unsigned int tmp;
290 290
@@ -304,7 +304,7 @@ static int osiris_pm_suspend(struct sys_device *sd, pm_message_t state)
304 return 0; 304 return 0;
305} 305}
306 306
307static int osiris_pm_resume(struct sys_device *sd) 307static void osiris_pm_resume(void)
308{ 308{
309 if (pm_osiris_ctrl0 & OSIRIS_CTRL0_FIX8) 309 if (pm_osiris_ctrl0 & OSIRIS_CTRL0_FIX8)
310 __raw_writeb(OSIRIS_CTRL1_FIX8, OSIRIS_VA_CTRL1); 310 __raw_writeb(OSIRIS_CTRL1_FIX8, OSIRIS_VA_CTRL1);
@@ -312,8 +312,6 @@ static int osiris_pm_resume(struct sys_device *sd)
312 __raw_writeb(pm_osiris_ctrl0, OSIRIS_VA_CTRL0); 312 __raw_writeb(pm_osiris_ctrl0, OSIRIS_VA_CTRL0);
313 313
314 s3c_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT); 314 s3c_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT);
315
316 return 0;
317} 315}
318 316
319#else 317#else
@@ -321,16 +319,11 @@ static int osiris_pm_resume(struct sys_device *sd)
321#define osiris_pm_resume NULL 319#define osiris_pm_resume NULL
322#endif 320#endif
323 321
324static struct sysdev_class osiris_pm_sysclass = { 322static struct syscore_ops osiris_pm_syscore_ops = {
325 .name = "mach-osiris",
326 .suspend = osiris_pm_suspend, 323 .suspend = osiris_pm_suspend,
327 .resume = osiris_pm_resume, 324 .resume = osiris_pm_resume,
328}; 325};
329 326
330static struct sys_device osiris_pm_sysdev = {
331 .cls = &osiris_pm_sysclass,
332};
333
334/* Link for DVS driver to TPS65011 */ 327/* Link for DVS driver to TPS65011 */
335 328
336static void osiris_tps_release(struct device *dev) 329static void osiris_tps_release(struct device *dev)
@@ -439,8 +432,7 @@ static void __init osiris_map_io(void)
439 432
440static void __init osiris_init(void) 433static void __init osiris_init(void)
441{ 434{
442 sysdev_class_register(&osiris_pm_sysclass); 435 register_syscore_ops(&osiris_pm_syscore_ops);
443 sysdev_register(&osiris_pm_sysdev);
444 436
445 s3c_i2c0_set_platdata(NULL); 437 s3c_i2c0_set_platdata(NULL);
446 s3c_nand_set_platdata(&osiris_nand_info); 438 s3c_nand_set_platdata(&osiris_nand_info);
diff --git a/arch/arm/mach-s3c2440/s3c2440.c b/arch/arm/mach-s3c2440/s3c2440.c
index f7663f731ea0..ce99ff72838d 100644
--- a/arch/arm/mach-s3c2440/s3c2440.c
+++ b/arch/arm/mach-s3c2440/s3c2440.c
@@ -19,6 +19,7 @@
19#include <linux/platform_device.h> 19#include <linux/platform_device.h>
20#include <linux/serial_core.h> 20#include <linux/serial_core.h>
21#include <linux/sysdev.h> 21#include <linux/sysdev.h>
22#include <linux/syscore_ops.h>
22#include <linux/gpio.h> 23#include <linux/gpio.h>
23#include <linux/clk.h> 24#include <linux/clk.h>
24#include <linux/io.h> 25#include <linux/io.h>
@@ -33,6 +34,7 @@
33#include <plat/devs.h> 34#include <plat/devs.h>
34#include <plat/cpu.h> 35#include <plat/cpu.h>
35#include <plat/s3c244x.h> 36#include <plat/s3c244x.h>
37#include <plat/pm.h>
36 38
37#include <plat/gpio-core.h> 39#include <plat/gpio-core.h>
38#include <plat/gpio-cfg.h> 40#include <plat/gpio-cfg.h>
@@ -51,6 +53,12 @@ int __init s3c2440_init(void)
51 s3c_device_wdt.resource[1].start = IRQ_S3C2440_WDT; 53 s3c_device_wdt.resource[1].start = IRQ_S3C2440_WDT;
52 s3c_device_wdt.resource[1].end = IRQ_S3C2440_WDT; 54 s3c_device_wdt.resource[1].end = IRQ_S3C2440_WDT;
53 55
56 /* register suspend/resume handlers */
57
58 register_syscore_ops(&s3c2410_pm_syscore_ops);
59 register_syscore_ops(&s3c244x_pm_syscore_ops);
60 register_syscore_ops(&s3c24xx_irq_syscore_ops);
61
54 /* register our system device for everything else */ 62 /* register our system device for everything else */
55 63
56 return sysdev_register(&s3c2440_sysdev); 64 return sysdev_register(&s3c2440_sysdev);
diff --git a/arch/arm/mach-s3c2440/s3c2442.c b/arch/arm/mach-s3c2440/s3c2442.c
index ecf813546554..6224bad4d604 100644
--- a/arch/arm/mach-s3c2440/s3c2442.c
+++ b/arch/arm/mach-s3c2440/s3c2442.c
@@ -29,6 +29,7 @@
29#include <linux/err.h> 29#include <linux/err.h>
30#include <linux/device.h> 30#include <linux/device.h>
31#include <linux/sysdev.h> 31#include <linux/sysdev.h>
32#include <linux/syscore_ops.h>
32#include <linux/interrupt.h> 33#include <linux/interrupt.h>
33#include <linux/ioport.h> 34#include <linux/ioport.h>
34#include <linux/mutex.h> 35#include <linux/mutex.h>
@@ -45,6 +46,7 @@
45#include <plat/clock.h> 46#include <plat/clock.h>
46#include <plat/cpu.h> 47#include <plat/cpu.h>
47#include <plat/s3c244x.h> 48#include <plat/s3c244x.h>
49#include <plat/pm.h>
48 50
49#include <plat/gpio-core.h> 51#include <plat/gpio-core.h>
50#include <plat/gpio-cfg.h> 52#include <plat/gpio-cfg.h>
@@ -167,6 +169,10 @@ int __init s3c2442_init(void)
167{ 169{
168 printk("S3C2442: Initialising architecture\n"); 170 printk("S3C2442: Initialising architecture\n");
169 171
172 register_syscore_ops(&s3c2410_pm_syscore_ops);
173 register_syscore_ops(&s3c244x_pm_syscore_ops);
174 register_syscore_ops(&s3c24xx_irq_syscore_ops);
175
170 return sysdev_register(&s3c2442_sysdev); 176 return sysdev_register(&s3c2442_sysdev);
171} 177}
172 178
diff --git a/arch/arm/mach-s3c2440/s3c244x-irq.c b/arch/arm/mach-s3c2440/s3c244x-irq.c
index de07c2feaa32..c63e8f26d901 100644
--- a/arch/arm/mach-s3c2440/s3c244x-irq.c
+++ b/arch/arm/mach-s3c2440/s3c244x-irq.c
@@ -116,8 +116,6 @@ static int s3c244x_irq_add(struct sys_device *sysdev)
116 116
117static struct sysdev_driver s3c2440_irq_driver = { 117static struct sysdev_driver s3c2440_irq_driver = {
118 .add = s3c244x_irq_add, 118 .add = s3c244x_irq_add,
119 .suspend = s3c24xx_irq_suspend,
120 .resume = s3c24xx_irq_resume,
121}; 119};
122 120
123static int s3c2440_irq_init(void) 121static int s3c2440_irq_init(void)
@@ -129,8 +127,6 @@ arch_initcall(s3c2440_irq_init);
129 127
130static struct sysdev_driver s3c2442_irq_driver = { 128static struct sysdev_driver s3c2442_irq_driver = {
131 .add = s3c244x_irq_add, 129 .add = s3c244x_irq_add,
132 .suspend = s3c24xx_irq_suspend,
133 .resume = s3c24xx_irq_resume,
134}; 130};
135 131
136 132
diff --git a/arch/arm/mach-s3c2440/s3c244x.c b/arch/arm/mach-s3c2440/s3c244x.c
index 90c1707b9c95..7e8a23d2098a 100644
--- a/arch/arm/mach-s3c2440/s3c244x.c
+++ b/arch/arm/mach-s3c2440/s3c244x.c
@@ -19,6 +19,7 @@
19#include <linux/serial_core.h> 19#include <linux/serial_core.h>
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21#include <linux/sysdev.h> 21#include <linux/sysdev.h>
22#include <linux/syscore_ops.h>
22#include <linux/clk.h> 23#include <linux/clk.h>
23#include <linux/io.h> 24#include <linux/io.h>
24 25
@@ -134,45 +135,14 @@ void __init s3c244x_init_clocks(int xtal)
134 s3c2410_baseclk_add(); 135 s3c2410_baseclk_add();
135} 136}
136 137
137#ifdef CONFIG_PM
138
139static struct sleep_save s3c244x_sleep[] = {
140 SAVE_ITEM(S3C2440_DSC0),
141 SAVE_ITEM(S3C2440_DSC1),
142 SAVE_ITEM(S3C2440_GPJDAT),
143 SAVE_ITEM(S3C2440_GPJCON),
144 SAVE_ITEM(S3C2440_GPJUP)
145};
146
147static int s3c244x_suspend(struct sys_device *dev, pm_message_t state)
148{
149 s3c_pm_do_save(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep));
150 return 0;
151}
152
153static int s3c244x_resume(struct sys_device *dev)
154{
155 s3c_pm_do_restore(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep));
156 return 0;
157}
158
159#else
160#define s3c244x_suspend NULL
161#define s3c244x_resume NULL
162#endif
163
164/* Since the S3C2442 and S3C2440 share items, put both sysclasses here */ 138/* Since the S3C2442 and S3C2440 share items, put both sysclasses here */
165 139
166struct sysdev_class s3c2440_sysclass = { 140struct sysdev_class s3c2440_sysclass = {
167 .name = "s3c2440-core", 141 .name = "s3c2440-core",
168 .suspend = s3c244x_suspend,
169 .resume = s3c244x_resume
170}; 142};
171 143
172struct sysdev_class s3c2442_sysclass = { 144struct sysdev_class s3c2442_sysclass = {
173 .name = "s3c2442-core", 145 .name = "s3c2442-core",
174 .suspend = s3c244x_suspend,
175 .resume = s3c244x_resume
176}; 146};
177 147
178/* need to register class before we actually register the device, and 148/* need to register class before we actually register the device, and
@@ -194,3 +164,33 @@ static int __init s3c2442_core_init(void)
194} 164}
195 165
196core_initcall(s3c2442_core_init); 166core_initcall(s3c2442_core_init);
167
168
169#ifdef CONFIG_PM
170static struct sleep_save s3c244x_sleep[] = {
171 SAVE_ITEM(S3C2440_DSC0),
172 SAVE_ITEM(S3C2440_DSC1),
173 SAVE_ITEM(S3C2440_GPJDAT),
174 SAVE_ITEM(S3C2440_GPJCON),
175 SAVE_ITEM(S3C2440_GPJUP)
176};
177
178static int s3c244x_suspend(void)
179{
180 s3c_pm_do_save(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep));
181 return 0;
182}
183
184static void s3c244x_resume(void)
185{
186 s3c_pm_do_restore(s3c244x_sleep, ARRAY_SIZE(s3c244x_sleep));
187}
188#else
189#define s3c244x_suspend NULL
190#define s3c244x_resume NULL
191#endif
192
193struct syscore_ops s3c244x_pm_syscore_ops = {
194 .suspend = s3c244x_suspend,
195 .resume = s3c244x_resume,
196};
diff --git a/arch/arm/mach-s3c64xx/irq-pm.c b/arch/arm/mach-s3c64xx/irq-pm.c
index da1bec64b9da..8bec61e242c7 100644
--- a/arch/arm/mach-s3c64xx/irq-pm.c
+++ b/arch/arm/mach-s3c64xx/irq-pm.c
@@ -13,7 +13,7 @@
13 */ 13 */
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/sysdev.h> 16#include <linux/syscore_ops.h>
17#include <linux/interrupt.h> 17#include <linux/interrupt.h>
18#include <linux/serial_core.h> 18#include <linux/serial_core.h>
19#include <linux/irq.h> 19#include <linux/irq.h>
@@ -54,7 +54,7 @@ static struct irq_grp_save {
54 54
55static u32 irq_uart_mask[CONFIG_SERIAL_SAMSUNG_UARTS]; 55static u32 irq_uart_mask[CONFIG_SERIAL_SAMSUNG_UARTS];
56 56
57static int s3c64xx_irq_pm_suspend(struct sys_device *dev, pm_message_t state) 57static int s3c64xx_irq_pm_suspend(void)
58{ 58{
59 struct irq_grp_save *grp = eint_grp_save; 59 struct irq_grp_save *grp = eint_grp_save;
60 int i; 60 int i;
@@ -75,7 +75,7 @@ static int s3c64xx_irq_pm_suspend(struct sys_device *dev, pm_message_t state)
75 return 0; 75 return 0;
76} 76}
77 77
78static int s3c64xx_irq_pm_resume(struct sys_device *dev) 78static void s3c64xx_irq_pm_resume(void)
79{ 79{
80 struct irq_grp_save *grp = eint_grp_save; 80 struct irq_grp_save *grp = eint_grp_save;
81 int i; 81 int i;
@@ -94,18 +94,18 @@ static int s3c64xx_irq_pm_resume(struct sys_device *dev)
94 } 94 }
95 95
96 S3C_PMDBG("%s: IRQ configuration restored\n", __func__); 96 S3C_PMDBG("%s: IRQ configuration restored\n", __func__);
97 return 0;
98} 97}
99 98
100static struct sysdev_driver s3c64xx_irq_driver = { 99struct syscore_ops s3c64xx_irq_syscore_ops = {
101 .suspend = s3c64xx_irq_pm_suspend, 100 .suspend = s3c64xx_irq_pm_suspend,
102 .resume = s3c64xx_irq_pm_resume, 101 .resume = s3c64xx_irq_pm_resume,
103}; 102};
104 103
105static int __init s3c64xx_irq_pm_init(void) 104static __init int s3c64xx_syscore_init(void)
106{ 105{
107 return sysdev_driver_register(&s3c64xx_sysclass, &s3c64xx_irq_driver); 106 register_syscore_ops(&s3c64xx_irq_syscore_ops);
108}
109 107
110arch_initcall(s3c64xx_irq_pm_init); 108 return 0;
109}
111 110
111core_initcall(s3c64xx_syscore_init);
diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c
index 549d7924fd4c..24febae3d4c0 100644
--- a/arch/arm/mach-s5pv210/pm.c
+++ b/arch/arm/mach-s5pv210/pm.c
@@ -16,6 +16,7 @@
16 16
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/suspend.h> 18#include <linux/suspend.h>
19#include <linux/syscore_ops.h>
19#include <linux/io.h> 20#include <linux/io.h>
20 21
21#include <plat/cpu.h> 22#include <plat/cpu.h>
@@ -140,7 +141,17 @@ static int s5pv210_pm_add(struct sys_device *sysdev)
140 return 0; 141 return 0;
141} 142}
142 143
143static int s5pv210_pm_resume(struct sys_device *dev) 144static struct sysdev_driver s5pv210_pm_driver = {
145 .add = s5pv210_pm_add,
146};
147
148static __init int s5pv210_pm_drvinit(void)
149{
150 return sysdev_driver_register(&s5pv210_sysclass, &s5pv210_pm_driver);
151}
152arch_initcall(s5pv210_pm_drvinit);
153
154static void s5pv210_pm_resume(void)
144{ 155{
145 u32 tmp; 156 u32 tmp;
146 157
@@ -150,17 +161,15 @@ static int s5pv210_pm_resume(struct sys_device *dev)
150 __raw_writel(tmp , S5P_OTHERS); 161 __raw_writel(tmp , S5P_OTHERS);
151 162
152 s3c_pm_do_restore_core(s5pv210_core_save, ARRAY_SIZE(s5pv210_core_save)); 163 s3c_pm_do_restore_core(s5pv210_core_save, ARRAY_SIZE(s5pv210_core_save));
153
154 return 0;
155} 164}
156 165
157static struct sysdev_driver s5pv210_pm_driver = { 166static struct syscore_ops s5pv210_pm_syscore_ops = {
158 .add = s5pv210_pm_add,
159 .resume = s5pv210_pm_resume, 167 .resume = s5pv210_pm_resume,
160}; 168};
161 169
162static __init int s5pv210_pm_drvinit(void) 170static __init int s5pv210_pm_syscore_init(void)
163{ 171{
164 return sysdev_driver_register(&s5pv210_sysclass, &s5pv210_pm_driver); 172 register_syscore_ops(&s5pv210_pm_syscore_ops);
173 return 0;
165} 174}
166arch_initcall(s5pv210_pm_drvinit); 175arch_initcall(s5pv210_pm_syscore_init);
diff --git a/arch/arm/mach-sa1100/include/mach/memory.h b/arch/arm/mach-sa1100/include/mach/memory.h
index a44da6a2916c..cff31ee246b7 100644
--- a/arch/arm/mach-sa1100/include/mach/memory.h
+++ b/arch/arm/mach-sa1100/include/mach/memory.h
@@ -14,18 +14,8 @@
14 */ 14 */
15#define PLAT_PHYS_OFFSET UL(0xc0000000) 15#define PLAT_PHYS_OFFSET UL(0xc0000000)
16 16
17#ifndef __ASSEMBLY__
18
19#ifdef CONFIG_SA1111 17#ifdef CONFIG_SA1111
20void sa1111_adjust_zones(unsigned long *size, unsigned long *holes); 18#define ARM_DMA_ZONE_SIZE SZ_1M
21
22#define arch_adjust_zones(size, holes) \
23 sa1111_adjust_zones(size, holes)
24
25#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_1M - 1)
26#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_1M)
27
28#endif
29#endif 19#endif
30 20
31/* 21/*
diff --git a/arch/arm/mach-sa1100/irq.c b/arch/arm/mach-sa1100/irq.c
index 423ddb3d65e9..dfbf824a69fa 100644
--- a/arch/arm/mach-sa1100/irq.c
+++ b/arch/arm/mach-sa1100/irq.c
@@ -14,7 +14,7 @@
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <linux/irq.h> 15#include <linux/irq.h>
16#include <linux/ioport.h> 16#include <linux/ioport.h>
17#include <linux/sysdev.h> 17#include <linux/syscore_ops.h>
18 18
19#include <mach/hardware.h> 19#include <mach/hardware.h>
20#include <asm/mach/irq.h> 20#include <asm/mach/irq.h>
@@ -234,7 +234,7 @@ static struct sa1100irq_state {
234 unsigned int iccr; 234 unsigned int iccr;
235} sa1100irq_state; 235} sa1100irq_state;
236 236
237static int sa1100irq_suspend(struct sys_device *dev, pm_message_t state) 237static int sa1100irq_suspend(void)
238{ 238{
239 struct sa1100irq_state *st = &sa1100irq_state; 239 struct sa1100irq_state *st = &sa1100irq_state;
240 240
@@ -264,7 +264,7 @@ static int sa1100irq_suspend(struct sys_device *dev, pm_message_t state)
264 return 0; 264 return 0;
265} 265}
266 266
267static int sa1100irq_resume(struct sys_device *dev) 267static void sa1100irq_resume(void)
268{ 268{
269 struct sa1100irq_state *st = &sa1100irq_state; 269 struct sa1100irq_state *st = &sa1100irq_state;
270 270
@@ -277,24 +277,17 @@ static int sa1100irq_resume(struct sys_device *dev)
277 277
278 ICMR = st->icmr; 278 ICMR = st->icmr;
279 } 279 }
280 return 0;
281} 280}
282 281
283static struct sysdev_class sa1100irq_sysclass = { 282static struct syscore_ops sa1100irq_syscore_ops = {
284 .name = "sa11x0-irq",
285 .suspend = sa1100irq_suspend, 283 .suspend = sa1100irq_suspend,
286 .resume = sa1100irq_resume, 284 .resume = sa1100irq_resume,
287}; 285};
288 286
289static struct sys_device sa1100irq_device = {
290 .id = 0,
291 .cls = &sa1100irq_sysclass,
292};
293
294static int __init sa1100irq_init_devicefs(void) 287static int __init sa1100irq_init_devicefs(void)
295{ 288{
296 sysdev_class_register(&sa1100irq_sysclass); 289 register_syscore_ops(&sa1100irq_syscore_ops);
297 return sysdev_register(&sa1100irq_device); 290 return 0;
298} 291}
299 292
300device_initcall(sa1100irq_init_devicefs); 293device_initcall(sa1100irq_init_devicefs);
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
index ae4f3d80416f..fa6602491d54 100644
--- a/arch/arm/mach-sa1100/time.c
+++ b/arch/arm/mach-sa1100/time.c
@@ -92,25 +92,11 @@ sa1100_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *c)
92static struct clock_event_device ckevt_sa1100_osmr0 = { 92static struct clock_event_device ckevt_sa1100_osmr0 = {
93 .name = "osmr0", 93 .name = "osmr0",
94 .features = CLOCK_EVT_FEAT_ONESHOT, 94 .features = CLOCK_EVT_FEAT_ONESHOT,
95 .shift = 32,
96 .rating = 200, 95 .rating = 200,
97 .set_next_event = sa1100_osmr0_set_next_event, 96 .set_next_event = sa1100_osmr0_set_next_event,
98 .set_mode = sa1100_osmr0_set_mode, 97 .set_mode = sa1100_osmr0_set_mode,
99}; 98};
100 99
101static cycle_t sa1100_read_oscr(struct clocksource *s)
102{
103 return OSCR;
104}
105
106static struct clocksource cksrc_sa1100_oscr = {
107 .name = "oscr",
108 .rating = 200,
109 .read = sa1100_read_oscr,
110 .mask = CLOCKSOURCE_MASK(32),
111 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
112};
113
114static struct irqaction sa1100_timer_irq = { 100static struct irqaction sa1100_timer_irq = {
115 .name = "ost0", 101 .name = "ost0",
116 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 102 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
@@ -120,14 +106,13 @@ static struct irqaction sa1100_timer_irq = {
120 106
121static void __init sa1100_timer_init(void) 107static void __init sa1100_timer_init(void)
122{ 108{
123 OIER = 0; /* disable any timer interrupts */ 109 OIER = 0;
124 OSSR = 0xf; /* clear status on all timers */ 110 OSSR = OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3;
125 111
126 init_fixed_sched_clock(&cd, sa1100_update_sched_clock, 32, 112 init_fixed_sched_clock(&cd, sa1100_update_sched_clock, 32,
127 3686400, SC_MULT, SC_SHIFT); 113 3686400, SC_MULT, SC_SHIFT);
128 114
129 ckevt_sa1100_osmr0.mult = 115 clockevents_calc_mult_shift(&ckevt_sa1100_osmr0, 3686400, 4);
130 div_sc(3686400, NSEC_PER_SEC, ckevt_sa1100_osmr0.shift);
131 ckevt_sa1100_osmr0.max_delta_ns = 116 ckevt_sa1100_osmr0.max_delta_ns =
132 clockevent_delta2ns(0x7fffffff, &ckevt_sa1100_osmr0); 117 clockevent_delta2ns(0x7fffffff, &ckevt_sa1100_osmr0);
133 ckevt_sa1100_osmr0.min_delta_ns = 118 ckevt_sa1100_osmr0.min_delta_ns =
@@ -136,7 +121,8 @@ static void __init sa1100_timer_init(void)
136 121
137 setup_irq(IRQ_OST0, &sa1100_timer_irq); 122 setup_irq(IRQ_OST0, &sa1100_timer_irq);
138 123
139 clocksource_register_hz(&cksrc_sa1100_oscr, CLOCK_TICK_RATE); 124 clocksource_mmio_init(&OSCR, "oscr", CLOCK_TICK_RATE, 200, 32,
125 clocksource_mmio_readl_up);
140 clockevents_register_device(&ckevt_sa1100_osmr0); 126 clockevents_register_device(&ckevt_sa1100_osmr0);
141} 127}
142 128
diff --git a/arch/arm/mach-shark/include/mach/memory.h b/arch/arm/mach-shark/include/mach/memory.h
index 9afb17000008..4c0831f83b0c 100644
--- a/arch/arm/mach-shark/include/mach/memory.h
+++ b/arch/arm/mach-shark/include/mach/memory.h
@@ -17,25 +17,7 @@
17 */ 17 */
18#define PLAT_PHYS_OFFSET UL(0x08000000) 18#define PLAT_PHYS_OFFSET UL(0x08000000)
19 19
20#ifndef __ASSEMBLY__ 20#define ARM_DMA_ZONE_SIZE SZ_4M
21
22static inline void __arch_adjust_zones(unsigned long *zone_size, unsigned long *zhole_size)
23{
24 /* Only the first 4 MB (=1024 Pages) are usable for DMA */
25 /* See dev / -> .properties in OpenFirmware. */
26 zone_size[1] = zone_size[0] - 1024;
27 zone_size[0] = 1024;
28 zhole_size[1] = zhole_size[0];
29 zhole_size[0] = 0;
30}
31
32#define arch_adjust_zones(size, holes) \
33 __arch_adjust_zones(size, holes)
34
35#define ISA_DMA_THRESHOLD (PHYS_OFFSET + SZ_4M - 1)
36#define MAX_DMA_ADDRESS (PAGE_OFFSET + SZ_4M)
37
38#endif
39 21
40/* 22/*
41 * Cache flushing area 23 * Cache flushing area
diff --git a/arch/arm/mach-shmobile/include/mach/smp.h b/arch/arm/mach-shmobile/include/mach/smp.h
deleted file mode 100644
index 50db94e927ad..000000000000
--- a/arch/arm/mach-shmobile/include/mach/smp.h
+++ /dev/null
@@ -1,16 +0,0 @@
1#ifndef __MACH_SMP_H
2#define __MACH_SMP_H
3
4#include <asm/hardware/gic.h>
5
6/*
7 * We use IRQ1 as the IPI
8 */
9static inline void smp_cross_call(const struct cpumask *mask, int ipi)
10{
11#if defined(CONFIG_ARM_GIC)
12 gic_raise_softirq(mask, ipi);
13#endif
14}
15
16#endif
diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c
index 65e879bab4dc..f3888feb1c68 100644
--- a/arch/arm/mach-shmobile/platsmp.c
+++ b/arch/arm/mach-shmobile/platsmp.c
@@ -16,6 +16,7 @@
16#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/smp.h> 17#include <linux/smp.h>
18#include <linux/io.h> 18#include <linux/io.h>
19#include <asm/hardware/gic.h>
19#include <asm/localtimer.h> 20#include <asm/localtimer.h>
20#include <asm/mach-types.h> 21#include <asm/mach-types.h>
21#include <mach/common.h> 22#include <mach/common.h>
@@ -57,6 +58,8 @@ void __init smp_init_cpus(void)
57 58
58 for (i = 0; i < ncores; i++) 59 for (i = 0; i < ncores; i++)
59 set_cpu_possible(i, true); 60 set_cpu_possible(i, true);
61
62 set_smp_cross_call(gic_raise_softirq);
60} 63}
61 64
62void __init platform_smp_prepare_cpus(unsigned int max_cpus) 65void __init platform_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-shmobile/pm_runtime.c b/arch/arm/mach-shmobile/pm_runtime.c
index 94912d3944d3..2d1b67a59e4a 100644
--- a/arch/arm/mach-shmobile/pm_runtime.c
+++ b/arch/arm/mach-shmobile/pm_runtime.c
@@ -18,152 +18,41 @@
18#include <linux/clk.h> 18#include <linux/clk.h>
19#include <linux/sh_clk.h> 19#include <linux/sh_clk.h>
20#include <linux/bitmap.h> 20#include <linux/bitmap.h>
21#include <linux/slab.h>
21 22
22#ifdef CONFIG_PM_RUNTIME 23#ifdef CONFIG_PM_RUNTIME
23#define BIT_ONCE 0
24#define BIT_ACTIVE 1
25#define BIT_CLK_ENABLED 2
26 24
27struct pm_runtime_data { 25static int default_platform_runtime_idle(struct device *dev)
28 unsigned long flags;
29 struct clk *clk;
30};
31
32static void __devres_release(struct device *dev, void *res)
33{
34 struct pm_runtime_data *prd = res;
35
36 dev_dbg(dev, "__devres_release()\n");
37
38 if (test_bit(BIT_CLK_ENABLED, &prd->flags))
39 clk_disable(prd->clk);
40
41 if (test_bit(BIT_ACTIVE, &prd->flags))
42 clk_put(prd->clk);
43}
44
45static struct pm_runtime_data *__to_prd(struct device *dev)
46{
47 return devres_find(dev, __devres_release, NULL, NULL);
48}
49
50static void platform_pm_runtime_init(struct device *dev,
51 struct pm_runtime_data *prd)
52{
53 if (prd && !test_and_set_bit(BIT_ONCE, &prd->flags)) {
54 prd->clk = clk_get(dev, NULL);
55 if (!IS_ERR(prd->clk)) {
56 set_bit(BIT_ACTIVE, &prd->flags);
57 dev_info(dev, "clocks managed by runtime pm\n");
58 }
59 }
60}
61
62static void platform_pm_runtime_bug(struct device *dev,
63 struct pm_runtime_data *prd)
64{
65 if (prd && !test_and_set_bit(BIT_ONCE, &prd->flags))
66 dev_err(dev, "runtime pm suspend before resume\n");
67}
68
69int platform_pm_runtime_suspend(struct device *dev)
70{
71 struct pm_runtime_data *prd = __to_prd(dev);
72
73 dev_dbg(dev, "platform_pm_runtime_suspend()\n");
74
75 platform_pm_runtime_bug(dev, prd);
76
77 if (prd && test_bit(BIT_ACTIVE, &prd->flags)) {
78 clk_disable(prd->clk);
79 clear_bit(BIT_CLK_ENABLED, &prd->flags);
80 }
81
82 return 0;
83}
84
85int platform_pm_runtime_resume(struct device *dev)
86{
87 struct pm_runtime_data *prd = __to_prd(dev);
88
89 dev_dbg(dev, "platform_pm_runtime_resume()\n");
90
91 platform_pm_runtime_init(dev, prd);
92
93 if (prd && test_bit(BIT_ACTIVE, &prd->flags)) {
94 clk_enable(prd->clk);
95 set_bit(BIT_CLK_ENABLED, &prd->flags);
96 }
97
98 return 0;
99}
100
101int platform_pm_runtime_idle(struct device *dev)
102{ 26{
103 /* suspend synchronously to disable clocks immediately */ 27 /* suspend synchronously to disable clocks immediately */
104 return pm_runtime_suspend(dev); 28 return pm_runtime_suspend(dev);
105} 29}
106 30
107static int platform_bus_notify(struct notifier_block *nb, 31static struct dev_power_domain default_power_domain = {
108 unsigned long action, void *data) 32 .ops = {
109{ 33 .runtime_suspend = pm_runtime_clk_suspend,
110 struct device *dev = data; 34 .runtime_resume = pm_runtime_clk_resume,
111 struct pm_runtime_data *prd; 35 .runtime_idle = default_platform_runtime_idle,
112 36 USE_PLATFORM_PM_SLEEP_OPS
113 dev_dbg(dev, "platform_bus_notify() %ld !\n", action); 37 },
114 38};
115 if (action == BUS_NOTIFY_BIND_DRIVER) {
116 prd = devres_alloc(__devres_release, sizeof(*prd), GFP_KERNEL);
117 if (prd)
118 devres_add(dev, prd);
119 else
120 dev_err(dev, "unable to alloc memory for runtime pm\n");
121 }
122
123 return 0;
124}
125
126#else /* CONFIG_PM_RUNTIME */
127
128static int platform_bus_notify(struct notifier_block *nb,
129 unsigned long action, void *data)
130{
131 struct device *dev = data;
132 struct clk *clk;
133 39
134 dev_dbg(dev, "platform_bus_notify() %ld !\n", action); 40#define DEFAULT_PWR_DOMAIN_PTR (&default_power_domain)
135 41
136 switch (action) { 42#else
137 case BUS_NOTIFY_BIND_DRIVER:
138 clk = clk_get(dev, NULL);
139 if (!IS_ERR(clk)) {
140 clk_enable(clk);
141 clk_put(clk);
142 dev_info(dev, "runtime pm disabled, clock forced on\n");
143 }
144 break;
145 case BUS_NOTIFY_UNBOUND_DRIVER:
146 clk = clk_get(dev, NULL);
147 if (!IS_ERR(clk)) {
148 clk_disable(clk);
149 clk_put(clk);
150 dev_info(dev, "runtime pm disabled, clock forced off\n");
151 }
152 break;
153 }
154 43
155 return 0; 44#define DEFAULT_PWR_DOMAIN_PTR NULL
156}
157 45
158#endif /* CONFIG_PM_RUNTIME */ 46#endif /* CONFIG_PM_RUNTIME */
159 47
160static struct notifier_block platform_bus_notifier = { 48static struct pm_clk_notifier_block platform_bus_notifier = {
161 .notifier_call = platform_bus_notify 49 .pwr_domain = DEFAULT_PWR_DOMAIN_PTR,
50 .con_ids = { NULL, },
162}; 51};
163 52
164static int __init sh_pm_runtime_init(void) 53static int __init sh_pm_runtime_init(void)
165{ 54{
166 bus_register_notifier(&platform_bus_type, &platform_bus_notifier); 55 pm_runtime_clk_add_notifier(&platform_bus_type, &platform_bus_notifier);
167 return 0; 56 return 0;
168} 57}
169core_initcall(sh_pm_runtime_init); 58core_initcall(sh_pm_runtime_init);
diff --git a/arch/arm/mach-spear3xx/Kconfig b/arch/arm/mach-spear3xx/Kconfig
index 20d1317cc486..2cee6b0de371 100644
--- a/arch/arm/mach-spear3xx/Kconfig
+++ b/arch/arm/mach-spear3xx/Kconfig
@@ -4,9 +4,26 @@
4 4
5if ARCH_SPEAR3XX 5if ARCH_SPEAR3XX
6 6
7choice 7menu "SPEAr3xx Implementations"
8 prompt "SPEAr3XX Family" 8config BOARD_SPEAR300_EVB
9 default MACH_SPEAR300 9 bool "SPEAr300 Evaluation Board"
10 select MACH_SPEAR300
11 help
12 Supports ST SPEAr300 Evaluation Board
13
14config BOARD_SPEAR310_EVB
15 bool "SPEAr310 Evaluation Board"
16 select MACH_SPEAR310
17 help
18 Supports ST SPEAr310 Evaluation Board
19
20config BOARD_SPEAR320_EVB
21 bool "SPEAr320 Evaluation Board"
22 select MACH_SPEAR320
23 help
24 Supports ST SPEAr320 Evaluation Board
25
26endmenu
10 27
11config MACH_SPEAR300 28config MACH_SPEAR300
12 bool "SPEAr300" 29 bool "SPEAr300"
@@ -23,11 +40,4 @@ config MACH_SPEAR320
23 help 40 help
24 Supports ST SPEAr320 Machine 41 Supports ST SPEAr320 Machine
25 42
26endchoice
27
28# Adding SPEAr3XX machine specific configuration files
29source "arch/arm/mach-spear3xx/Kconfig300"
30source "arch/arm/mach-spear3xx/Kconfig310"
31source "arch/arm/mach-spear3xx/Kconfig320"
32
33endif #ARCH_SPEAR3XX 43endif #ARCH_SPEAR3XX
diff --git a/arch/arm/mach-spear3xx/Kconfig300 b/arch/arm/mach-spear3xx/Kconfig300
deleted file mode 100644
index c519a05b4ab4..000000000000
--- a/arch/arm/mach-spear3xx/Kconfig300
+++ /dev/null
@@ -1,17 +0,0 @@
1#
2# SPEAr300 machine configuration file
3#
4
5if MACH_SPEAR300
6
7choice
8 prompt "SPEAr300 Boards"
9 default BOARD_SPEAR300_EVB
10
11config BOARD_SPEAR300_EVB
12 bool "SPEAr300 Evaluation Board"
13 help
14 Supports ST SPEAr300 Evaluation Board
15endchoice
16
17endif #MACH_SPEAR300
diff --git a/arch/arm/mach-spear3xx/Kconfig310 b/arch/arm/mach-spear3xx/Kconfig310
deleted file mode 100644
index 60e7442d75bd..000000000000
--- a/arch/arm/mach-spear3xx/Kconfig310
+++ /dev/null
@@ -1,17 +0,0 @@
1#
2# SPEAr310 machine configuration file
3#
4
5if MACH_SPEAR310
6
7choice
8 prompt "SPEAr310 Boards"
9 default BOARD_SPEAR310_EVB
10
11config BOARD_SPEAR310_EVB
12 bool "SPEAr310 Evaluation Board"
13 help
14 Supports ST SPEAr310 Evaluation Board
15endchoice
16
17endif #MACH_SPEAR310
diff --git a/arch/arm/mach-spear3xx/Kconfig320 b/arch/arm/mach-spear3xx/Kconfig320
deleted file mode 100644
index 1c1d438399b8..000000000000
--- a/arch/arm/mach-spear3xx/Kconfig320
+++ /dev/null
@@ -1,17 +0,0 @@
1#
2# SPEAr320 machine configuration file
3#
4
5if MACH_SPEAR320
6
7choice
8 prompt "SPEAr320 Boards"
9 default BOARD_SPEAR320_EVB
10
11config BOARD_SPEAR320_EVB
12 bool "SPEAr320 Evaluation Board"
13 help
14 Supports ST SPEAr320 Evaluation Board
15endchoice
16
17endif #MACH_SPEAR320
diff --git a/arch/arm/mach-spear3xx/clock.c b/arch/arm/mach-spear3xx/clock.c
index 98bc7edc95a6..f67860cd649f 100644
--- a/arch/arm/mach-spear3xx/clock.c
+++ b/arch/arm/mach-spear3xx/clock.c
@@ -13,6 +13,7 @@
13 13
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <asm/mach-types.h>
16#include <plat/clock.h> 17#include <plat/clock.h>
17#include <mach/misc_regs.h> 18#include <mach/misc_regs.h>
18 19
@@ -688,56 +689,71 @@ static struct clk_lookup spear_clk_lookups[] = {
688 { .dev_id = "adc", .clk = &adc_clk}, 689 { .dev_id = "adc", .clk = &adc_clk},
689 { .dev_id = "ssp-pl022.0", .clk = &ssp0_clk}, 690 { .dev_id = "ssp-pl022.0", .clk = &ssp0_clk},
690 { .dev_id = "gpio", .clk = &gpio_clk}, 691 { .dev_id = "gpio", .clk = &gpio_clk},
691#if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320) 692};
692 { .dev_id = "physmap-flash", .clk = &emi_clk},
693#endif
694#if defined(CONFIG_MACH_SPEAR300) || defined(CONFIG_MACH_SPEAR310) || \
695 defined(CONFIG_MACH_SPEAR320)
696 { .con_id = "fsmc", .clk = &fsmc_clk},
697#endif
698
699/* common clocks to spear310 and spear320 */
700#if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320)
701 { .dev_id = "uart1", .clk = &uart1_clk},
702 { .dev_id = "uart2", .clk = &uart2_clk},
703#endif
704
705 /* common clock to spear300 and spear320 */
706#if defined(CONFIG_MACH_SPEAR300) || defined(CONFIG_MACH_SPEAR320)
707 { .dev_id = "clcd", .clk = &clcd_clk},
708 { .dev_id = "sdhci", .clk = &sdhci_clk},
709#endif /* CONFIG_MACH_SPEAR300 || CONFIG_MACH_SPEAR320 */
710 693
711 /* spear300 machine specific clock structures */ 694/* array of all spear 300 clock lookups */
712#ifdef CONFIG_MACH_SPEAR300 695#ifdef CONFIG_MACH_SPEAR300
696static struct clk_lookup spear300_clk_lookups[] = {
697 { .dev_id = "clcd", .clk = &clcd_clk},
698 { .con_id = "fsmc", .clk = &fsmc_clk},
713 { .dev_id = "gpio1", .clk = &gpio1_clk}, 699 { .dev_id = "gpio1", .clk = &gpio1_clk},
714 { .dev_id = "keyboard", .clk = &kbd_clk}, 700 { .dev_id = "keyboard", .clk = &kbd_clk},
701 { .dev_id = "sdhci", .clk = &sdhci_clk},
702};
715#endif 703#endif
716 704
717 /* spear310 machine specific clock structures */ 705/* array of all spear 310 clock lookups */
718#ifdef CONFIG_MACH_SPEAR310 706#ifdef CONFIG_MACH_SPEAR310
707static struct clk_lookup spear310_clk_lookups[] = {
708 { .con_id = "fsmc", .clk = &fsmc_clk},
709 { .con_id = "emi", .clk = &emi_clk},
710 { .dev_id = "uart1", .clk = &uart1_clk},
711 { .dev_id = "uart2", .clk = &uart2_clk},
719 { .dev_id = "uart3", .clk = &uart3_clk}, 712 { .dev_id = "uart3", .clk = &uart3_clk},
720 { .dev_id = "uart4", .clk = &uart4_clk}, 713 { .dev_id = "uart4", .clk = &uart4_clk},
721 { .dev_id = "uart5", .clk = &uart5_clk}, 714 { .dev_id = "uart5", .clk = &uart5_clk},
722 715};
723#endif 716#endif
724 /* spear320 machine specific clock structures */ 717
718/* array of all spear 320 clock lookups */
725#ifdef CONFIG_MACH_SPEAR320 719#ifdef CONFIG_MACH_SPEAR320
720static struct clk_lookup spear320_clk_lookups[] = {
721 { .dev_id = "clcd", .clk = &clcd_clk},
722 { .con_id = "fsmc", .clk = &fsmc_clk},
723 { .dev_id = "i2c_designware.1", .clk = &i2c1_clk},
724 { .con_id = "emi", .clk = &emi_clk},
725 { .dev_id = "pwm", .clk = &pwm_clk},
726 { .dev_id = "sdhci", .clk = &sdhci_clk},
726 { .dev_id = "c_can_platform.0", .clk = &can0_clk}, 727 { .dev_id = "c_can_platform.0", .clk = &can0_clk},
727 { .dev_id = "c_can_platform.1", .clk = &can1_clk}, 728 { .dev_id = "c_can_platform.1", .clk = &can1_clk},
728 { .dev_id = "i2c_designware.1", .clk = &i2c1_clk},
729 { .dev_id = "ssp-pl022.1", .clk = &ssp1_clk}, 729 { .dev_id = "ssp-pl022.1", .clk = &ssp1_clk},
730 { .dev_id = "ssp-pl022.2", .clk = &ssp2_clk}, 730 { .dev_id = "ssp-pl022.2", .clk = &ssp2_clk},
731 { .dev_id = "pwm", .clk = &pwm_clk}, 731 { .dev_id = "uart1", .clk = &uart1_clk},
732#endif 732 { .dev_id = "uart2", .clk = &uart2_clk},
733}; 733};
734#endif
734 735
735void __init clk_init(void) 736void __init spear3xx_clk_init(void)
736{ 737{
737 int i; 738 int i, cnt;
739 struct clk_lookup *lookups;
740
741 if (machine_is_spear300()) {
742 cnt = ARRAY_SIZE(spear300_clk_lookups);
743 lookups = spear300_clk_lookups;
744 } else if (machine_is_spear310()) {
745 cnt = ARRAY_SIZE(spear310_clk_lookups);
746 lookups = spear310_clk_lookups;
747 } else {
748 cnt = ARRAY_SIZE(spear320_clk_lookups);
749 lookups = spear320_clk_lookups;
750 }
738 751
739 for (i = 0; i < ARRAY_SIZE(spear_clk_lookups); i++) 752 for (i = 0; i < ARRAY_SIZE(spear_clk_lookups); i++)
740 clk_register(&spear_clk_lookups[i]); 753 clk_register(&spear_clk_lookups[i]);
741 754
742 recalc_root_clocks(); 755 for (i = 0; i < cnt; i++)
756 clk_register(&lookups[i]);
757
758 clk_init();
743} 759}
diff --git a/arch/arm/mach-spear3xx/include/mach/generic.h b/arch/arm/mach-spear3xx/include/mach/generic.h
index 8e30636909ef..b8f31c3935f7 100644
--- a/arch/arm/mach-spear3xx/include/mach/generic.h
+++ b/arch/arm/mach-spear3xx/include/mach/generic.h
@@ -27,16 +27,16 @@
27 * Following GPT channels will be used as clock source and clockevent 27 * Following GPT channels will be used as clock source and clockevent
28 */ 28 */
29#define SPEAR_GPT0_BASE SPEAR3XX_ML1_TMR_BASE 29#define SPEAR_GPT0_BASE SPEAR3XX_ML1_TMR_BASE
30#define SPEAR_GPT0_CHAN0_IRQ IRQ_CPU_GPT1_1 30#define SPEAR_GPT0_CHAN0_IRQ SPEAR3XX_IRQ_CPU_GPT1_1
31#define SPEAR_GPT0_CHAN1_IRQ IRQ_CPU_GPT1_2 31#define SPEAR_GPT0_CHAN1_IRQ SPEAR3XX_IRQ_CPU_GPT1_2
32 32
33/* Add spear3xx family device structure declarations here */ 33/* Add spear3xx family device structure declarations here */
34extern struct amba_device gpio_device; 34extern struct amba_device spear3xx_gpio_device;
35extern struct amba_device uart_device; 35extern struct amba_device spear3xx_uart_device;
36extern struct sys_timer spear3xx_timer; 36extern struct sys_timer spear3xx_timer;
37 37
38/* Add spear3xx family function declarations here */ 38/* Add spear3xx family function declarations here */
39void __init clk_init(void); 39void __init spear3xx_clk_init(void);
40void __init spear_setup_timer(void); 40void __init spear_setup_timer(void);
41void __init spear3xx_map_io(void); 41void __init spear3xx_map_io(void);
42void __init spear3xx_init_irq(void); 42void __init spear3xx_init_irq(void);
@@ -60,81 +60,80 @@ void __init spear3xx_init(void);
60#define PMX_TIMER_1_2_MASK (1 << 0) 60#define PMX_TIMER_1_2_MASK (1 << 0)
61 61
62/* pad mux devices */ 62/* pad mux devices */
63extern struct pmx_dev pmx_firda; 63extern struct pmx_dev spear3xx_pmx_firda;
64extern struct pmx_dev pmx_i2c; 64extern struct pmx_dev spear3xx_pmx_i2c;
65extern struct pmx_dev pmx_ssp_cs; 65extern struct pmx_dev spear3xx_pmx_ssp_cs;
66extern struct pmx_dev pmx_ssp; 66extern struct pmx_dev spear3xx_pmx_ssp;
67extern struct pmx_dev pmx_mii; 67extern struct pmx_dev spear3xx_pmx_mii;
68extern struct pmx_dev pmx_gpio_pin0; 68extern struct pmx_dev spear3xx_pmx_gpio_pin0;
69extern struct pmx_dev pmx_gpio_pin1; 69extern struct pmx_dev spear3xx_pmx_gpio_pin1;
70extern struct pmx_dev pmx_gpio_pin2; 70extern struct pmx_dev spear3xx_pmx_gpio_pin2;
71extern struct pmx_dev pmx_gpio_pin3; 71extern struct pmx_dev spear3xx_pmx_gpio_pin3;
72extern struct pmx_dev pmx_gpio_pin4; 72extern struct pmx_dev spear3xx_pmx_gpio_pin4;
73extern struct pmx_dev pmx_gpio_pin5; 73extern struct pmx_dev spear3xx_pmx_gpio_pin5;
74extern struct pmx_dev pmx_uart0_modem; 74extern struct pmx_dev spear3xx_pmx_uart0_modem;
75extern struct pmx_dev pmx_uart0; 75extern struct pmx_dev spear3xx_pmx_uart0;
76extern struct pmx_dev pmx_timer_3_4; 76extern struct pmx_dev spear3xx_pmx_timer_3_4;
77extern struct pmx_dev pmx_timer_1_2; 77extern struct pmx_dev spear3xx_pmx_timer_1_2;
78 78
79#if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320) 79#if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320)
80/* padmux plgpio devices */ 80/* padmux plgpio devices */
81extern struct pmx_dev pmx_plgpio_0_1; 81extern struct pmx_dev spear3xx_pmx_plgpio_0_1;
82extern struct pmx_dev pmx_plgpio_2_3; 82extern struct pmx_dev spear3xx_pmx_plgpio_2_3;
83extern struct pmx_dev pmx_plgpio_4_5; 83extern struct pmx_dev spear3xx_pmx_plgpio_4_5;
84extern struct pmx_dev pmx_plgpio_6_9; 84extern struct pmx_dev spear3xx_pmx_plgpio_6_9;
85extern struct pmx_dev pmx_plgpio_10_27; 85extern struct pmx_dev spear3xx_pmx_plgpio_10_27;
86extern struct pmx_dev pmx_plgpio_28; 86extern struct pmx_dev spear3xx_pmx_plgpio_28;
87extern struct pmx_dev pmx_plgpio_29; 87extern struct pmx_dev spear3xx_pmx_plgpio_29;
88extern struct pmx_dev pmx_plgpio_30; 88extern struct pmx_dev spear3xx_pmx_plgpio_30;
89extern struct pmx_dev pmx_plgpio_31; 89extern struct pmx_dev spear3xx_pmx_plgpio_31;
90extern struct pmx_dev pmx_plgpio_32; 90extern struct pmx_dev spear3xx_pmx_plgpio_32;
91extern struct pmx_dev pmx_plgpio_33; 91extern struct pmx_dev spear3xx_pmx_plgpio_33;
92extern struct pmx_dev pmx_plgpio_34_36; 92extern struct pmx_dev spear3xx_pmx_plgpio_34_36;
93extern struct pmx_dev pmx_plgpio_37_42; 93extern struct pmx_dev spear3xx_pmx_plgpio_37_42;
94extern struct pmx_dev pmx_plgpio_43_44_47_48; 94extern struct pmx_dev spear3xx_pmx_plgpio_43_44_47_48;
95extern struct pmx_dev pmx_plgpio_45_46_49_50; 95extern struct pmx_dev spear3xx_pmx_plgpio_45_46_49_50;
96#endif 96#endif
97 97
98extern struct pmx_driver pmx_driver;
99
100/* spear300 declarations */ 98/* spear300 declarations */
101#ifdef CONFIG_MACH_SPEAR300 99#ifdef CONFIG_MACH_SPEAR300
102/* Add spear300 machine device structure declarations here */ 100/* Add spear300 machine device structure declarations here */
103extern struct amba_device gpio1_device; 101extern struct amba_device spear300_gpio1_device;
104 102
105/* pad mux modes */ 103/* pad mux modes */
106extern struct pmx_mode nand_mode; 104extern struct pmx_mode spear300_nand_mode;
107extern struct pmx_mode nor_mode; 105extern struct pmx_mode spear300_nor_mode;
108extern struct pmx_mode photo_frame_mode; 106extern struct pmx_mode spear300_photo_frame_mode;
109extern struct pmx_mode lend_ip_phone_mode; 107extern struct pmx_mode spear300_lend_ip_phone_mode;
110extern struct pmx_mode hend_ip_phone_mode; 108extern struct pmx_mode spear300_hend_ip_phone_mode;
111extern struct pmx_mode lend_wifi_phone_mode; 109extern struct pmx_mode spear300_lend_wifi_phone_mode;
112extern struct pmx_mode hend_wifi_phone_mode; 110extern struct pmx_mode spear300_hend_wifi_phone_mode;
113extern struct pmx_mode ata_pabx_wi2s_mode; 111extern struct pmx_mode spear300_ata_pabx_wi2s_mode;
114extern struct pmx_mode ata_pabx_i2s_mode; 112extern struct pmx_mode spear300_ata_pabx_i2s_mode;
115extern struct pmx_mode caml_lcdw_mode; 113extern struct pmx_mode spear300_caml_lcdw_mode;
116extern struct pmx_mode camu_lcd_mode; 114extern struct pmx_mode spear300_camu_lcd_mode;
117extern struct pmx_mode camu_wlcd_mode; 115extern struct pmx_mode spear300_camu_wlcd_mode;
118extern struct pmx_mode caml_lcd_mode; 116extern struct pmx_mode spear300_caml_lcd_mode;
119 117
120/* pad mux devices */ 118/* pad mux devices */
121extern struct pmx_dev pmx_fsmc_2_chips; 119extern struct pmx_dev spear300_pmx_fsmc_2_chips;
122extern struct pmx_dev pmx_fsmc_4_chips; 120extern struct pmx_dev spear300_pmx_fsmc_4_chips;
123extern struct pmx_dev pmx_keyboard; 121extern struct pmx_dev spear300_pmx_keyboard;
124extern struct pmx_dev pmx_clcd; 122extern struct pmx_dev spear300_pmx_clcd;
125extern struct pmx_dev pmx_telecom_gpio; 123extern struct pmx_dev spear300_pmx_telecom_gpio;
126extern struct pmx_dev pmx_telecom_tdm; 124extern struct pmx_dev spear300_pmx_telecom_tdm;
127extern struct pmx_dev pmx_telecom_spi_cs_i2c_clk; 125extern struct pmx_dev spear300_pmx_telecom_spi_cs_i2c_clk;
128extern struct pmx_dev pmx_telecom_camera; 126extern struct pmx_dev spear300_pmx_telecom_camera;
129extern struct pmx_dev pmx_telecom_dac; 127extern struct pmx_dev spear300_pmx_telecom_dac;
130extern struct pmx_dev pmx_telecom_i2s; 128extern struct pmx_dev spear300_pmx_telecom_i2s;
131extern struct pmx_dev pmx_telecom_boot_pins; 129extern struct pmx_dev spear300_pmx_telecom_boot_pins;
132extern struct pmx_dev pmx_telecom_sdhci_4bit; 130extern struct pmx_dev spear300_pmx_telecom_sdhci_4bit;
133extern struct pmx_dev pmx_telecom_sdhci_8bit; 131extern struct pmx_dev spear300_pmx_telecom_sdhci_8bit;
134extern struct pmx_dev pmx_gpio1; 132extern struct pmx_dev spear300_pmx_gpio1;
135 133
136/* Add spear300 machine function declarations here */ 134/* Add spear300 machine function declarations here */
137void __init spear300_init(void); 135void __init spear300_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
136 u8 pmx_dev_count);
138 137
139#endif /* CONFIG_MACH_SPEAR300 */ 138#endif /* CONFIG_MACH_SPEAR300 */
140 139
@@ -143,17 +142,18 @@ void __init spear300_init(void);
143/* Add spear310 machine device structure declarations here */ 142/* Add spear310 machine device structure declarations here */
144 143
145/* pad mux devices */ 144/* pad mux devices */
146extern struct pmx_dev pmx_emi_cs_0_1_4_5; 145extern struct pmx_dev spear310_pmx_emi_cs_0_1_4_5;
147extern struct pmx_dev pmx_emi_cs_2_3; 146extern struct pmx_dev spear310_pmx_emi_cs_2_3;
148extern struct pmx_dev pmx_uart1; 147extern struct pmx_dev spear310_pmx_uart1;
149extern struct pmx_dev pmx_uart2; 148extern struct pmx_dev spear310_pmx_uart2;
150extern struct pmx_dev pmx_uart3_4_5; 149extern struct pmx_dev spear310_pmx_uart3_4_5;
151extern struct pmx_dev pmx_fsmc; 150extern struct pmx_dev spear310_pmx_fsmc;
152extern struct pmx_dev pmx_rs485_0_1; 151extern struct pmx_dev spear310_pmx_rs485_0_1;
153extern struct pmx_dev pmx_tdm0; 152extern struct pmx_dev spear310_pmx_tdm0;
154 153
155/* Add spear310 machine function declarations here */ 154/* Add spear310 machine function declarations here */
156void __init spear310_init(void); 155void __init spear310_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
156 u8 pmx_dev_count);
157 157
158#endif /* CONFIG_MACH_SPEAR310 */ 158#endif /* CONFIG_MACH_SPEAR310 */
159 159
@@ -162,37 +162,38 @@ void __init spear310_init(void);
162/* Add spear320 machine device structure declarations here */ 162/* Add spear320 machine device structure declarations here */
163 163
164/* pad mux modes */ 164/* pad mux modes */
165extern struct pmx_mode auto_net_smii_mode; 165extern struct pmx_mode spear320_auto_net_smii_mode;
166extern struct pmx_mode auto_net_mii_mode; 166extern struct pmx_mode spear320_auto_net_mii_mode;
167extern struct pmx_mode auto_exp_mode; 167extern struct pmx_mode spear320_auto_exp_mode;
168extern struct pmx_mode small_printers_mode; 168extern struct pmx_mode spear320_small_printers_mode;
169 169
170/* pad mux devices */ 170/* pad mux devices */
171extern struct pmx_dev pmx_clcd; 171extern struct pmx_dev spear320_pmx_clcd;
172extern struct pmx_dev pmx_emi; 172extern struct pmx_dev spear320_pmx_emi;
173extern struct pmx_dev pmx_fsmc; 173extern struct pmx_dev spear320_pmx_fsmc;
174extern struct pmx_dev pmx_spp; 174extern struct pmx_dev spear320_pmx_spp;
175extern struct pmx_dev pmx_sdhci; 175extern struct pmx_dev spear320_pmx_sdhci;
176extern struct pmx_dev pmx_i2s; 176extern struct pmx_dev spear320_pmx_i2s;
177extern struct pmx_dev pmx_uart1; 177extern struct pmx_dev spear320_pmx_uart1;
178extern struct pmx_dev pmx_uart1_modem; 178extern struct pmx_dev spear320_pmx_uart1_modem;
179extern struct pmx_dev pmx_uart2; 179extern struct pmx_dev spear320_pmx_uart2;
180extern struct pmx_dev pmx_touchscreen; 180extern struct pmx_dev spear320_pmx_touchscreen;
181extern struct pmx_dev pmx_can; 181extern struct pmx_dev spear320_pmx_can;
182extern struct pmx_dev pmx_sdhci_led; 182extern struct pmx_dev spear320_pmx_sdhci_led;
183extern struct pmx_dev pmx_pwm0; 183extern struct pmx_dev spear320_pmx_pwm0;
184extern struct pmx_dev pmx_pwm1; 184extern struct pmx_dev spear320_pmx_pwm1;
185extern struct pmx_dev pmx_pwm2; 185extern struct pmx_dev spear320_pmx_pwm2;
186extern struct pmx_dev pmx_pwm3; 186extern struct pmx_dev spear320_pmx_pwm3;
187extern struct pmx_dev pmx_ssp1; 187extern struct pmx_dev spear320_pmx_ssp1;
188extern struct pmx_dev pmx_ssp2; 188extern struct pmx_dev spear320_pmx_ssp2;
189extern struct pmx_dev pmx_mii1; 189extern struct pmx_dev spear320_pmx_mii1;
190extern struct pmx_dev pmx_smii0; 190extern struct pmx_dev spear320_pmx_smii0;
191extern struct pmx_dev pmx_smii1; 191extern struct pmx_dev spear320_pmx_smii1;
192extern struct pmx_dev pmx_i2c1; 192extern struct pmx_dev spear320_pmx_i2c1;
193 193
194/* Add spear320 machine function declarations here */ 194/* Add spear320 machine function declarations here */
195void __init spear320_init(void); 195void __init spear320_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
196 u8 pmx_dev_count);
196 197
197#endif /* CONFIG_MACH_SPEAR320 */ 198#endif /* CONFIG_MACH_SPEAR320 */
198 199
diff --git a/arch/arm/mach-spear3xx/include/mach/irqs.h b/arch/arm/mach-spear3xx/include/mach/irqs.h
index a1a7f481866d..6e265442808e 100644
--- a/arch/arm/mach-spear3xx/include/mach/irqs.h
+++ b/arch/arm/mach-spear3xx/include/mach/irqs.h
@@ -15,138 +15,140 @@
15#define __MACH_IRQS_H 15#define __MACH_IRQS_H
16 16
17/* SPEAr3xx IRQ definitions */ 17/* SPEAr3xx IRQ definitions */
18#define IRQ_HW_ACCEL_MOD_0 0 18#define SPEAR3XX_IRQ_HW_ACCEL_MOD_0 0
19#define IRQ_INTRCOMM_RAS_ARM 1 19#define SPEAR3XX_IRQ_INTRCOMM_RAS_ARM 1
20#define IRQ_CPU_GPT1_1 2 20#define SPEAR3XX_IRQ_CPU_GPT1_1 2
21#define IRQ_CPU_GPT1_2 3 21#define SPEAR3XX_IRQ_CPU_GPT1_2 3
22#define IRQ_BASIC_GPT1_1 4 22#define SPEAR3XX_IRQ_BASIC_GPT1_1 4
23#define IRQ_BASIC_GPT1_2 5 23#define SPEAR3XX_IRQ_BASIC_GPT1_2 5
24#define IRQ_BASIC_GPT2_1 6 24#define SPEAR3XX_IRQ_BASIC_GPT2_1 6
25#define IRQ_BASIC_GPT2_2 7 25#define SPEAR3XX_IRQ_BASIC_GPT2_2 7
26#define IRQ_BASIC_DMA 8 26#define SPEAR3XX_IRQ_BASIC_DMA 8
27#define IRQ_BASIC_SMI 9 27#define SPEAR3XX_IRQ_BASIC_SMI 9
28#define IRQ_BASIC_RTC 10 28#define SPEAR3XX_IRQ_BASIC_RTC 10
29#define IRQ_BASIC_GPIO 11 29#define SPEAR3XX_IRQ_BASIC_GPIO 11
30#define IRQ_BASIC_WDT 12 30#define SPEAR3XX_IRQ_BASIC_WDT 12
31#define IRQ_DDR_CONTROLLER 13 31#define SPEAR3XX_IRQ_DDR_CONTROLLER 13
32#define IRQ_SYS_ERROR 14 32#define SPEAR3XX_IRQ_SYS_ERROR 14
33#define IRQ_WAKEUP_RCV 15 33#define SPEAR3XX_IRQ_WAKEUP_RCV 15
34#define IRQ_JPEG 16 34#define SPEAR3XX_IRQ_JPEG 16
35#define IRQ_IRDA 17 35#define SPEAR3XX_IRQ_IRDA 17
36#define IRQ_ADC 18 36#define SPEAR3XX_IRQ_ADC 18
37#define IRQ_UART 19 37#define SPEAR3XX_IRQ_UART 19
38#define IRQ_SSP 20 38#define SPEAR3XX_IRQ_SSP 20
39#define IRQ_I2C 21 39#define SPEAR3XX_IRQ_I2C 21
40#define IRQ_MAC_1 22 40#define SPEAR3XX_IRQ_MAC_1 22
41#define IRQ_MAC_2 23 41#define SPEAR3XX_IRQ_MAC_2 23
42#define IRQ_USB_DEV 24 42#define SPEAR3XX_IRQ_USB_DEV 24
43#define IRQ_USB_H_OHCI_0 25 43#define SPEAR3XX_IRQ_USB_H_OHCI_0 25
44#define IRQ_USB_H_EHCI_0 26 44#define SPEAR3XX_IRQ_USB_H_EHCI_0 26
45#define IRQ_USB_H_EHCI_1 IRQ_USB_H_EHCI_0 45#define SPEAR3XX_IRQ_USB_H_EHCI_1 SPEAR3XX_IRQ_USB_H_EHCI_0
46#define IRQ_USB_H_OHCI_1 27 46#define SPEAR3XX_IRQ_USB_H_OHCI_1 27
47#define IRQ_GEN_RAS_1 28 47#define SPEAR3XX_IRQ_GEN_RAS_1 28
48#define IRQ_GEN_RAS_2 29 48#define SPEAR3XX_IRQ_GEN_RAS_2 29
49#define IRQ_GEN_RAS_3 30 49#define SPEAR3XX_IRQ_GEN_RAS_3 30
50#define IRQ_HW_ACCEL_MOD_1 31 50#define SPEAR3XX_IRQ_HW_ACCEL_MOD_1 31
51#define IRQ_VIC_END 32 51#define SPEAR3XX_IRQ_VIC_END 32
52 52
53#define VIRQ_START IRQ_VIC_END 53#define SPEAR3XX_VIRQ_START SPEAR3XX_IRQ_VIC_END
54 54
55/* SPEAr300 Virtual irq definitions */ 55/* SPEAr300 Virtual irq definitions */
56#ifdef CONFIG_MACH_SPEAR300
57/* IRQs sharing IRQ_GEN_RAS_1 */ 56/* IRQs sharing IRQ_GEN_RAS_1 */
58#define VIRQ_IT_PERS_S (VIRQ_START + 0) 57#define SPEAR300_VIRQ_IT_PERS_S (SPEAR3XX_VIRQ_START + 0)
59#define VIRQ_IT_CHANGE_S (VIRQ_START + 1) 58#define SPEAR300_VIRQ_IT_CHANGE_S (SPEAR3XX_VIRQ_START + 1)
60#define VIRQ_I2S (VIRQ_START + 2) 59#define SPEAR300_VIRQ_I2S (SPEAR3XX_VIRQ_START + 2)
61#define VIRQ_TDM (VIRQ_START + 3) 60#define SPEAR300_VIRQ_TDM (SPEAR3XX_VIRQ_START + 3)
62#define VIRQ_CAMERA_L (VIRQ_START + 4) 61#define SPEAR300_VIRQ_CAMERA_L (SPEAR3XX_VIRQ_START + 4)
63#define VIRQ_CAMERA_F (VIRQ_START + 5) 62#define SPEAR300_VIRQ_CAMERA_F (SPEAR3XX_VIRQ_START + 5)
64#define VIRQ_CAMERA_V (VIRQ_START + 6) 63#define SPEAR300_VIRQ_CAMERA_V (SPEAR3XX_VIRQ_START + 6)
65#define VIRQ_KEYBOARD (VIRQ_START + 7) 64#define SPEAR300_VIRQ_KEYBOARD (SPEAR3XX_VIRQ_START + 7)
66#define VIRQ_GPIO1 (VIRQ_START + 8) 65#define SPEAR300_VIRQ_GPIO1 (SPEAR3XX_VIRQ_START + 8)
67 66
68/* IRQs sharing IRQ_GEN_RAS_3 */ 67/* IRQs sharing IRQ_GEN_RAS_3 */
69#define IRQ_CLCD IRQ_GEN_RAS_3 68#define SPEAR300_IRQ_CLCD SPEAR3XX_IRQ_GEN_RAS_3
70 69
71/* IRQs sharing IRQ_INTRCOMM_RAS_ARM */ 70/* IRQs sharing IRQ_INTRCOMM_RAS_ARM */
72#define IRQ_SDHCI IRQ_INTRCOMM_RAS_ARM 71#define SPEAR300_IRQ_SDHCI SPEAR3XX_IRQ_INTRCOMM_RAS_ARM
73
74/* GPIO pins virtual irqs */
75#define SPEAR_GPIO_INT_BASE (VIRQ_START + 9)
76#define SPEAR_GPIO1_INT_BASE (SPEAR_GPIO_INT_BASE + 8)
77#define SPEAR_GPIO_INT_END (SPEAR_GPIO1_INT_BASE + 8)
78 72
79/* SPEAr310 Virtual irq definitions */ 73/* SPEAr310 Virtual irq definitions */
80#elif defined(CONFIG_MACH_SPEAR310)
81/* IRQs sharing IRQ_GEN_RAS_1 */ 74/* IRQs sharing IRQ_GEN_RAS_1 */
82#define VIRQ_SMII0 (VIRQ_START + 0) 75#define SPEAR310_VIRQ_SMII0 (SPEAR3XX_VIRQ_START + 0)
83#define VIRQ_SMII1 (VIRQ_START + 1) 76#define SPEAR310_VIRQ_SMII1 (SPEAR3XX_VIRQ_START + 1)
84#define VIRQ_SMII2 (VIRQ_START + 2) 77#define SPEAR310_VIRQ_SMII2 (SPEAR3XX_VIRQ_START + 2)
85#define VIRQ_SMII3 (VIRQ_START + 3) 78#define SPEAR310_VIRQ_SMII3 (SPEAR3XX_VIRQ_START + 3)
86#define VIRQ_WAKEUP_SMII0 (VIRQ_START + 4) 79#define SPEAR310_VIRQ_WAKEUP_SMII0 (SPEAR3XX_VIRQ_START + 4)
87#define VIRQ_WAKEUP_SMII1 (VIRQ_START + 5) 80#define SPEAR310_VIRQ_WAKEUP_SMII1 (SPEAR3XX_VIRQ_START + 5)
88#define VIRQ_WAKEUP_SMII2 (VIRQ_START + 6) 81#define SPEAR310_VIRQ_WAKEUP_SMII2 (SPEAR3XX_VIRQ_START + 6)
89#define VIRQ_WAKEUP_SMII3 (VIRQ_START + 7) 82#define SPEAR310_VIRQ_WAKEUP_SMII3 (SPEAR3XX_VIRQ_START + 7)
90 83
91/* IRQs sharing IRQ_GEN_RAS_2 */ 84/* IRQs sharing IRQ_GEN_RAS_2 */
92#define VIRQ_UART1 (VIRQ_START + 8) 85#define SPEAR310_VIRQ_UART1 (SPEAR3XX_VIRQ_START + 8)
93#define VIRQ_UART2 (VIRQ_START + 9) 86#define SPEAR310_VIRQ_UART2 (SPEAR3XX_VIRQ_START + 9)
94#define VIRQ_UART3 (VIRQ_START + 10) 87#define SPEAR310_VIRQ_UART3 (SPEAR3XX_VIRQ_START + 10)
95#define VIRQ_UART4 (VIRQ_START + 11) 88#define SPEAR310_VIRQ_UART4 (SPEAR3XX_VIRQ_START + 11)
96#define VIRQ_UART5 (VIRQ_START + 12) 89#define SPEAR310_VIRQ_UART5 (SPEAR3XX_VIRQ_START + 12)
97 90
98/* IRQs sharing IRQ_GEN_RAS_3 */ 91/* IRQs sharing IRQ_GEN_RAS_3 */
99#define VIRQ_EMI (VIRQ_START + 13) 92#define SPEAR310_VIRQ_EMI (SPEAR3XX_VIRQ_START + 13)
100#define VIRQ_PLGPIO (VIRQ_START + 14) 93#define SPEAR310_VIRQ_PLGPIO (SPEAR3XX_VIRQ_START + 14)
101 94
102/* IRQs sharing IRQ_INTRCOMM_RAS_ARM */ 95/* IRQs sharing IRQ_INTRCOMM_RAS_ARM */
103#define VIRQ_TDM_HDLC (VIRQ_START + 15) 96#define SPEAR310_VIRQ_TDM_HDLC (SPEAR3XX_VIRQ_START + 15)
104#define VIRQ_RS485_0 (VIRQ_START + 16) 97#define SPEAR310_VIRQ_RS485_0 (SPEAR3XX_VIRQ_START + 16)
105#define VIRQ_RS485_1 (VIRQ_START + 17) 98#define SPEAR310_VIRQ_RS485_1 (SPEAR3XX_VIRQ_START + 17)
106
107/* GPIO pins virtual irqs */
108#define SPEAR_GPIO_INT_BASE (VIRQ_START + 18)
109 99
110/* SPEAr320 Virtual irq definitions */ 100/* SPEAr320 Virtual irq definitions */
111#else
112/* IRQs sharing IRQ_GEN_RAS_1 */ 101/* IRQs sharing IRQ_GEN_RAS_1 */
113#define VIRQ_EMI (VIRQ_START + 0) 102#define SPEAR320_VIRQ_EMI (SPEAR3XX_VIRQ_START + 0)
114#define VIRQ_CLCD (VIRQ_START + 1) 103#define SPEAR320_VIRQ_CLCD (SPEAR3XX_VIRQ_START + 1)
115#define VIRQ_SPP (VIRQ_START + 2) 104#define SPEAR320_VIRQ_SPP (SPEAR3XX_VIRQ_START + 2)
116 105
117/* IRQs sharing IRQ_GEN_RAS_2 */ 106/* IRQs sharing IRQ_GEN_RAS_2 */
118#define IRQ_SDHCI IRQ_GEN_RAS_2 107#define SPEAR320_IRQ_SDHCI SPEAR3XX_IRQ_GEN_RAS_2
119 108
120/* IRQs sharing IRQ_GEN_RAS_3 */ 109/* IRQs sharing IRQ_GEN_RAS_3 */
121#define VIRQ_PLGPIO (VIRQ_START + 3) 110#define SPEAR320_VIRQ_PLGPIO (SPEAR3XX_VIRQ_START + 3)
122#define VIRQ_I2S_PLAY (VIRQ_START + 4) 111#define SPEAR320_VIRQ_I2S_PLAY (SPEAR3XX_VIRQ_START + 4)
123#define VIRQ_I2S_REC (VIRQ_START + 5) 112#define SPEAR320_VIRQ_I2S_REC (SPEAR3XX_VIRQ_START + 5)
124 113
125/* IRQs sharing IRQ_INTRCOMM_RAS_ARM */ 114/* IRQs sharing IRQ_INTRCOMM_RAS_ARM */
126#define VIRQ_CANU (VIRQ_START + 6) 115#define SPEAR320_VIRQ_CANU (SPEAR3XX_VIRQ_START + 6)
127#define VIRQ_CANL (VIRQ_START + 7) 116#define SPEAR320_VIRQ_CANL (SPEAR3XX_VIRQ_START + 7)
128#define VIRQ_UART1 (VIRQ_START + 8) 117#define SPEAR320_VIRQ_UART1 (SPEAR3XX_VIRQ_START + 8)
129#define VIRQ_UART2 (VIRQ_START + 9) 118#define SPEAR320_VIRQ_UART2 (SPEAR3XX_VIRQ_START + 9)
130#define VIRQ_SSP1 (VIRQ_START + 10) 119#define SPEAR320_VIRQ_SSP1 (SPEAR3XX_VIRQ_START + 10)
131#define VIRQ_SSP2 (VIRQ_START + 11) 120#define SPEAR320_VIRQ_SSP2 (SPEAR3XX_VIRQ_START + 11)
132#define VIRQ_SMII0 (VIRQ_START + 12) 121#define SPEAR320_VIRQ_SMII0 (SPEAR3XX_VIRQ_START + 12)
133#define VIRQ_MII1_SMII1 (VIRQ_START + 13) 122#define SPEAR320_VIRQ_MII1_SMII1 (SPEAR3XX_VIRQ_START + 13)
134#define VIRQ_WAKEUP_SMII0 (VIRQ_START + 14) 123#define SPEAR320_VIRQ_WAKEUP_SMII0 (SPEAR3XX_VIRQ_START + 14)
135#define VIRQ_WAKEUP_MII1_SMII1 (VIRQ_START + 15) 124#define SPEAR320_VIRQ_WAKEUP_MII1_SMII1 (SPEAR3XX_VIRQ_START + 15)
136#define VIRQ_I2C (VIRQ_START + 16) 125#define SPEAR320_VIRQ_I2C1 (SPEAR3XX_VIRQ_START + 16)
137
138/* GPIO pins virtual irqs */
139#define SPEAR_GPIO_INT_BASE (VIRQ_START + 17)
140 126
127/*
128 * GPIO pins virtual irqs
129 * Use the lowest number for the GPIO virtual IRQs base on which subarchs
130 * we have compiled in
131 */
132#if defined(CONFIG_MACH_SPEAR310)
133#define SPEAR3XX_GPIO_INT_BASE (SPEAR3XX_VIRQ_START + 18)
134#elif defined(CONFIG_MACH_SPEAR320)
135#define SPEAR3XX_GPIO_INT_BASE (SPEAR3XX_VIRQ_START + 17)
136#else
137#define SPEAR3XX_GPIO_INT_BASE (SPEAR3XX_VIRQ_START + 9)
141#endif 138#endif
142 139
143/* PLGPIO Virtual IRQs */ 140#define SPEAR300_GPIO1_INT_BASE (SPEAR3XX_GPIO_INT_BASE + 8)
141#define SPEAR3XX_PLGPIO_COUNT 102
142
144#if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320) 143#if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320)
145#define SPEAR_PLGPIO_INT_BASE (SPEAR_GPIO_INT_BASE + 8) 144#define SPEAR3XX_PLGPIO_INT_BASE (SPEAR3XX_GPIO_INT_BASE + 8)
146#define SPEAR_GPIO_INT_END (SPEAR_PLGPIO_INT_BASE + 102) 145#define SPEAR3XX_GPIO_INT_END (SPEAR3XX_PLGPIO_INT_BASE + \
146 SPEAR3XX_PLGPIO_COUNT)
147#else
148#define SPEAR3XX_GPIO_INT_END (SPEAR300_GPIO1_INT_BASE + 8)
147#endif 149#endif
148 150
149#define VIRQ_END SPEAR_GPIO_INT_END 151#define SPEAR3XX_VIRQ_END SPEAR3XX_GPIO_INT_END
150#define NR_IRQS VIRQ_END 152#define NR_IRQS SPEAR3XX_VIRQ_END
151 153
152#endif /* __MACH_IRQS_H */ 154#endif /* __MACH_IRQS_H */
diff --git a/arch/arm/mach-spear3xx/include/mach/spear300.h b/arch/arm/mach-spear3xx/include/mach/spear300.h
index c723515f8853..3b6ea0729040 100644
--- a/arch/arm/mach-spear3xx/include/mach/spear300.h
+++ b/arch/arm/mach-spear3xx/include/mach/spear300.h
@@ -20,19 +20,19 @@
20#define SPEAR300_TELECOM_BASE UL(0x50000000) 20#define SPEAR300_TELECOM_BASE UL(0x50000000)
21 21
22/* Interrupt registers offsets and masks */ 22/* Interrupt registers offsets and masks */
23#define INT_ENB_MASK_REG 0x54 23#define SPEAR300_INT_ENB_MASK_REG 0x54
24#define INT_STS_MASK_REG 0x58 24#define SPEAR300_INT_STS_MASK_REG 0x58
25#define IT_PERS_S_IRQ_MASK (1 << 0) 25#define SPEAR300_IT_PERS_S_IRQ_MASK (1 << 0)
26#define IT_CHANGE_S_IRQ_MASK (1 << 1) 26#define SPEAR300_IT_CHANGE_S_IRQ_MASK (1 << 1)
27#define I2S_IRQ_MASK (1 << 2) 27#define SPEAR300_I2S_IRQ_MASK (1 << 2)
28#define TDM_IRQ_MASK (1 << 3) 28#define SPEAR300_TDM_IRQ_MASK (1 << 3)
29#define CAMERA_L_IRQ_MASK (1 << 4) 29#define SPEAR300_CAMERA_L_IRQ_MASK (1 << 4)
30#define CAMERA_F_IRQ_MASK (1 << 5) 30#define SPEAR300_CAMERA_F_IRQ_MASK (1 << 5)
31#define CAMERA_V_IRQ_MASK (1 << 6) 31#define SPEAR300_CAMERA_V_IRQ_MASK (1 << 6)
32#define KEYBOARD_IRQ_MASK (1 << 7) 32#define SPEAR300_KEYBOARD_IRQ_MASK (1 << 7)
33#define GPIO1_IRQ_MASK (1 << 8) 33#define SPEAR300_GPIO1_IRQ_MASK (1 << 8)
34 34
35#define SHIRQ_RAS1_MASK 0x1FF 35#define SPEAR300_SHIRQ_RAS1_MASK 0x1FF
36 36
37#define SPEAR300_CLCD_BASE UL(0x60000000) 37#define SPEAR300_CLCD_BASE UL(0x60000000)
38#define SPEAR300_SDHCI_BASE UL(0x70000000) 38#define SPEAR300_SDHCI_BASE UL(0x70000000)
diff --git a/arch/arm/mach-spear3xx/include/mach/spear310.h b/arch/arm/mach-spear3xx/include/mach/spear310.h
index 1e853479b8cd..1567d0da725f 100644
--- a/arch/arm/mach-spear3xx/include/mach/spear310.h
+++ b/arch/arm/mach-spear3xx/include/mach/spear310.h
@@ -29,29 +29,29 @@
29#define SPEAR310_SOC_CONFIG_BASE UL(0xB4000000) 29#define SPEAR310_SOC_CONFIG_BASE UL(0xB4000000)
30 30
31/* Interrupt registers offsets and masks */ 31/* Interrupt registers offsets and masks */
32#define INT_STS_MASK_REG 0x04 32#define SPEAR310_INT_STS_MASK_REG 0x04
33#define SMII0_IRQ_MASK (1 << 0) 33#define SPEAR310_SMII0_IRQ_MASK (1 << 0)
34#define SMII1_IRQ_MASK (1 << 1) 34#define SPEAR310_SMII1_IRQ_MASK (1 << 1)
35#define SMII2_IRQ_MASK (1 << 2) 35#define SPEAR310_SMII2_IRQ_MASK (1 << 2)
36#define SMII3_IRQ_MASK (1 << 3) 36#define SPEAR310_SMII3_IRQ_MASK (1 << 3)
37#define WAKEUP_SMII0_IRQ_MASK (1 << 4) 37#define SPEAR310_WAKEUP_SMII0_IRQ_MASK (1 << 4)
38#define WAKEUP_SMII1_IRQ_MASK (1 << 5) 38#define SPEAR310_WAKEUP_SMII1_IRQ_MASK (1 << 5)
39#define WAKEUP_SMII2_IRQ_MASK (1 << 6) 39#define SPEAR310_WAKEUP_SMII2_IRQ_MASK (1 << 6)
40#define WAKEUP_SMII3_IRQ_MASK (1 << 7) 40#define SPEAR310_WAKEUP_SMII3_IRQ_MASK (1 << 7)
41#define UART1_IRQ_MASK (1 << 8) 41#define SPEAR310_UART1_IRQ_MASK (1 << 8)
42#define UART2_IRQ_MASK (1 << 9) 42#define SPEAR310_UART2_IRQ_MASK (1 << 9)
43#define UART3_IRQ_MASK (1 << 10) 43#define SPEAR310_UART3_IRQ_MASK (1 << 10)
44#define UART4_IRQ_MASK (1 << 11) 44#define SPEAR310_UART4_IRQ_MASK (1 << 11)
45#define UART5_IRQ_MASK (1 << 12) 45#define SPEAR310_UART5_IRQ_MASK (1 << 12)
46#define EMI_IRQ_MASK (1 << 13) 46#define SPEAR310_EMI_IRQ_MASK (1 << 13)
47#define TDM_HDLC_IRQ_MASK (1 << 14) 47#define SPEAR310_TDM_HDLC_IRQ_MASK (1 << 14)
48#define RS485_0_IRQ_MASK (1 << 15) 48#define SPEAR310_RS485_0_IRQ_MASK (1 << 15)
49#define RS485_1_IRQ_MASK (1 << 16) 49#define SPEAR310_RS485_1_IRQ_MASK (1 << 16)
50 50
51#define SHIRQ_RAS1_MASK 0x000FF 51#define SPEAR310_SHIRQ_RAS1_MASK 0x000FF
52#define SHIRQ_RAS2_MASK 0x01F00 52#define SPEAR310_SHIRQ_RAS2_MASK 0x01F00
53#define SHIRQ_RAS3_MASK 0x02000 53#define SPEAR310_SHIRQ_RAS3_MASK 0x02000
54#define SHIRQ_INTRCOMM_RAS_MASK 0x1C000 54#define SPEAR310_SHIRQ_INTRCOMM_RAS_MASK 0x1C000
55 55
56#endif /* __MACH_SPEAR310_H */ 56#endif /* __MACH_SPEAR310_H */
57 57
diff --git a/arch/arm/mach-spear3xx/include/mach/spear320.h b/arch/arm/mach-spear3xx/include/mach/spear320.h
index 940f0d85d959..8cfa83fa1296 100644
--- a/arch/arm/mach-spear3xx/include/mach/spear320.h
+++ b/arch/arm/mach-spear3xx/include/mach/spear320.h
@@ -36,31 +36,31 @@
36#define SPEAR320_SOC_CONFIG_BASE UL(0xB3000000) 36#define SPEAR320_SOC_CONFIG_BASE UL(0xB3000000)
37 37
38/* Interrupt registers offsets and masks */ 38/* Interrupt registers offsets and masks */
39#define INT_STS_MASK_REG 0x04 39#define SPEAR320_INT_STS_MASK_REG 0x04
40#define INT_CLR_MASK_REG 0x04 40#define SPEAR320_INT_CLR_MASK_REG 0x04
41#define INT_ENB_MASK_REG 0x08 41#define SPEAR320_INT_ENB_MASK_REG 0x08
42#define GPIO_IRQ_MASK (1 << 0) 42#define SPEAR320_GPIO_IRQ_MASK (1 << 0)
43#define I2S_PLAY_IRQ_MASK (1 << 1) 43#define SPEAR320_I2S_PLAY_IRQ_MASK (1 << 1)
44#define I2S_REC_IRQ_MASK (1 << 2) 44#define SPEAR320_I2S_REC_IRQ_MASK (1 << 2)
45#define EMI_IRQ_MASK (1 << 7) 45#define SPEAR320_EMI_IRQ_MASK (1 << 7)
46#define CLCD_IRQ_MASK (1 << 8) 46#define SPEAR320_CLCD_IRQ_MASK (1 << 8)
47#define SPP_IRQ_MASK (1 << 9) 47#define SPEAR320_SPP_IRQ_MASK (1 << 9)
48#define SDHCI_IRQ_MASK (1 << 10) 48#define SPEAR320_SDHCI_IRQ_MASK (1 << 10)
49#define CAN_U_IRQ_MASK (1 << 11) 49#define SPEAR320_CAN_U_IRQ_MASK (1 << 11)
50#define CAN_L_IRQ_MASK (1 << 12) 50#define SPEAR320_CAN_L_IRQ_MASK (1 << 12)
51#define UART1_IRQ_MASK (1 << 13) 51#define SPEAR320_UART1_IRQ_MASK (1 << 13)
52#define UART2_IRQ_MASK (1 << 14) 52#define SPEAR320_UART2_IRQ_MASK (1 << 14)
53#define SSP1_IRQ_MASK (1 << 15) 53#define SPEAR320_SSP1_IRQ_MASK (1 << 15)
54#define SSP2_IRQ_MASK (1 << 16) 54#define SPEAR320_SSP2_IRQ_MASK (1 << 16)
55#define SMII0_IRQ_MASK (1 << 17) 55#define SPEAR320_SMII0_IRQ_MASK (1 << 17)
56#define MII1_SMII1_IRQ_MASK (1 << 18) 56#define SPEAR320_MII1_SMII1_IRQ_MASK (1 << 18)
57#define WAKEUP_SMII0_IRQ_MASK (1 << 19) 57#define SPEAR320_WAKEUP_SMII0_IRQ_MASK (1 << 19)
58#define WAKEUP_MII1_SMII1_IRQ_MASK (1 << 20) 58#define SPEAR320_WAKEUP_MII1_SMII1_IRQ_MASK (1 << 20)
59#define I2C1_IRQ_MASK (1 << 21) 59#define SPEAR320_I2C1_IRQ_MASK (1 << 21)
60 60
61#define SHIRQ_RAS1_MASK 0x000380 61#define SPEAR320_SHIRQ_RAS1_MASK 0x000380
62#define SHIRQ_RAS3_MASK 0x000007 62#define SPEAR320_SHIRQ_RAS3_MASK 0x000007
63#define SHIRQ_INTRCOMM_RAS_MASK 0x3FF800 63#define SPEAR320_SHIRQ_INTRCOMM_RAS_MASK 0x3FF800
64 64
65#endif /* __MACH_SPEAR320_H */ 65#endif /* __MACH_SPEAR320_H */
66 66
diff --git a/arch/arm/mach-spear3xx/spear300.c b/arch/arm/mach-spear3xx/spear300.c
index 2697e65adf86..a5e46b4ade20 100644
--- a/arch/arm/mach-spear3xx/spear300.c
+++ b/arch/arm/mach-spear3xx/spear300.c
@@ -40,86 +40,86 @@
40#define CAML_LCD_MODE (1 << 12) 40#define CAML_LCD_MODE (1 << 12)
41#define ALL_MODES 0x1FFF 41#define ALL_MODES 0x1FFF
42 42
43struct pmx_mode nand_mode = { 43struct pmx_mode spear300_nand_mode = {
44 .id = NAND_MODE, 44 .id = NAND_MODE,
45 .name = "nand mode", 45 .name = "nand mode",
46 .mask = 0x00, 46 .mask = 0x00,
47}; 47};
48 48
49struct pmx_mode nor_mode = { 49struct pmx_mode spear300_nor_mode = {
50 .id = NOR_MODE, 50 .id = NOR_MODE,
51 .name = "nor mode", 51 .name = "nor mode",
52 .mask = 0x01, 52 .mask = 0x01,
53}; 53};
54 54
55struct pmx_mode photo_frame_mode = { 55struct pmx_mode spear300_photo_frame_mode = {
56 .id = PHOTO_FRAME_MODE, 56 .id = PHOTO_FRAME_MODE,
57 .name = "photo frame mode", 57 .name = "photo frame mode",
58 .mask = 0x02, 58 .mask = 0x02,
59}; 59};
60 60
61struct pmx_mode lend_ip_phone_mode = { 61struct pmx_mode spear300_lend_ip_phone_mode = {
62 .id = LEND_IP_PHONE_MODE, 62 .id = LEND_IP_PHONE_MODE,
63 .name = "lend ip phone mode", 63 .name = "lend ip phone mode",
64 .mask = 0x03, 64 .mask = 0x03,
65}; 65};
66 66
67struct pmx_mode hend_ip_phone_mode = { 67struct pmx_mode spear300_hend_ip_phone_mode = {
68 .id = HEND_IP_PHONE_MODE, 68 .id = HEND_IP_PHONE_MODE,
69 .name = "hend ip phone mode", 69 .name = "hend ip phone mode",
70 .mask = 0x04, 70 .mask = 0x04,
71}; 71};
72 72
73struct pmx_mode lend_wifi_phone_mode = { 73struct pmx_mode spear300_lend_wifi_phone_mode = {
74 .id = LEND_WIFI_PHONE_MODE, 74 .id = LEND_WIFI_PHONE_MODE,
75 .name = "lend wifi phone mode", 75 .name = "lend wifi phone mode",
76 .mask = 0x05, 76 .mask = 0x05,
77}; 77};
78 78
79struct pmx_mode hend_wifi_phone_mode = { 79struct pmx_mode spear300_hend_wifi_phone_mode = {
80 .id = HEND_WIFI_PHONE_MODE, 80 .id = HEND_WIFI_PHONE_MODE,
81 .name = "hend wifi phone mode", 81 .name = "hend wifi phone mode",
82 .mask = 0x06, 82 .mask = 0x06,
83}; 83};
84 84
85struct pmx_mode ata_pabx_wi2s_mode = { 85struct pmx_mode spear300_ata_pabx_wi2s_mode = {
86 .id = ATA_PABX_WI2S_MODE, 86 .id = ATA_PABX_WI2S_MODE,
87 .name = "ata pabx wi2s mode", 87 .name = "ata pabx wi2s mode",
88 .mask = 0x07, 88 .mask = 0x07,
89}; 89};
90 90
91struct pmx_mode ata_pabx_i2s_mode = { 91struct pmx_mode spear300_ata_pabx_i2s_mode = {
92 .id = ATA_PABX_I2S_MODE, 92 .id = ATA_PABX_I2S_MODE,
93 .name = "ata pabx i2s mode", 93 .name = "ata pabx i2s mode",
94 .mask = 0x08, 94 .mask = 0x08,
95}; 95};
96 96
97struct pmx_mode caml_lcdw_mode = { 97struct pmx_mode spear300_caml_lcdw_mode = {
98 .id = CAML_LCDW_MODE, 98 .id = CAML_LCDW_MODE,
99 .name = "caml lcdw mode", 99 .name = "caml lcdw mode",
100 .mask = 0x0C, 100 .mask = 0x0C,
101}; 101};
102 102
103struct pmx_mode camu_lcd_mode = { 103struct pmx_mode spear300_camu_lcd_mode = {
104 .id = CAMU_LCD_MODE, 104 .id = CAMU_LCD_MODE,
105 .name = "camu lcd mode", 105 .name = "camu lcd mode",
106 .mask = 0x0D, 106 .mask = 0x0D,
107}; 107};
108 108
109struct pmx_mode camu_wlcd_mode = { 109struct pmx_mode spear300_camu_wlcd_mode = {
110 .id = CAMU_WLCD_MODE, 110 .id = CAMU_WLCD_MODE,
111 .name = "camu wlcd mode", 111 .name = "camu wlcd mode",
112 .mask = 0x0E, 112 .mask = 0x0E,
113}; 113};
114 114
115struct pmx_mode caml_lcd_mode = { 115struct pmx_mode spear300_caml_lcd_mode = {
116 .id = CAML_LCD_MODE, 116 .id = CAML_LCD_MODE,
117 .name = "caml lcd mode", 117 .name = "caml lcd mode",
118 .mask = 0x0F, 118 .mask = 0x0F,
119}; 119};
120 120
121/* devices */ 121/* devices */
122struct pmx_dev_mode pmx_fsmc_2_chips_modes[] = { 122static struct pmx_dev_mode pmx_fsmc_2_chips_modes[] = {
123 { 123 {
124 .ids = NAND_MODE | NOR_MODE | PHOTO_FRAME_MODE | 124 .ids = NAND_MODE | NOR_MODE | PHOTO_FRAME_MODE |
125 ATA_PABX_WI2S_MODE | ATA_PABX_I2S_MODE, 125 ATA_PABX_WI2S_MODE | ATA_PABX_I2S_MODE,
@@ -127,14 +127,14 @@ struct pmx_dev_mode pmx_fsmc_2_chips_modes[] = {
127 }, 127 },
128}; 128};
129 129
130struct pmx_dev pmx_fsmc_2_chips = { 130struct pmx_dev spear300_pmx_fsmc_2_chips = {
131 .name = "fsmc_2_chips", 131 .name = "fsmc_2_chips",
132 .modes = pmx_fsmc_2_chips_modes, 132 .modes = pmx_fsmc_2_chips_modes,
133 .mode_count = ARRAY_SIZE(pmx_fsmc_2_chips_modes), 133 .mode_count = ARRAY_SIZE(pmx_fsmc_2_chips_modes),
134 .enb_on_reset = 1, 134 .enb_on_reset = 1,
135}; 135};
136 136
137struct pmx_dev_mode pmx_fsmc_4_chips_modes[] = { 137static struct pmx_dev_mode pmx_fsmc_4_chips_modes[] = {
138 { 138 {
139 .ids = NAND_MODE | NOR_MODE | PHOTO_FRAME_MODE | 139 .ids = NAND_MODE | NOR_MODE | PHOTO_FRAME_MODE |
140 ATA_PABX_WI2S_MODE | ATA_PABX_I2S_MODE, 140 ATA_PABX_WI2S_MODE | ATA_PABX_I2S_MODE,
@@ -142,14 +142,14 @@ struct pmx_dev_mode pmx_fsmc_4_chips_modes[] = {
142 }, 142 },
143}; 143};
144 144
145struct pmx_dev pmx_fsmc_4_chips = { 145struct pmx_dev spear300_pmx_fsmc_4_chips = {
146 .name = "fsmc_4_chips", 146 .name = "fsmc_4_chips",
147 .modes = pmx_fsmc_4_chips_modes, 147 .modes = pmx_fsmc_4_chips_modes,
148 .mode_count = ARRAY_SIZE(pmx_fsmc_4_chips_modes), 148 .mode_count = ARRAY_SIZE(pmx_fsmc_4_chips_modes),
149 .enb_on_reset = 1, 149 .enb_on_reset = 1,
150}; 150};
151 151
152struct pmx_dev_mode pmx_keyboard_modes[] = { 152static struct pmx_dev_mode pmx_keyboard_modes[] = {
153 { 153 {
154 .ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE | 154 .ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE |
155 LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE | 155 LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE |
@@ -159,14 +159,14 @@ struct pmx_dev_mode pmx_keyboard_modes[] = {
159 }, 159 },
160}; 160};
161 161
162struct pmx_dev pmx_keyboard = { 162struct pmx_dev spear300_pmx_keyboard = {
163 .name = "keyboard", 163 .name = "keyboard",
164 .modes = pmx_keyboard_modes, 164 .modes = pmx_keyboard_modes,
165 .mode_count = ARRAY_SIZE(pmx_keyboard_modes), 165 .mode_count = ARRAY_SIZE(pmx_keyboard_modes),
166 .enb_on_reset = 1, 166 .enb_on_reset = 1,
167}; 167};
168 168
169struct pmx_dev_mode pmx_clcd_modes[] = { 169static struct pmx_dev_mode pmx_clcd_modes[] = {
170 { 170 {
171 .ids = PHOTO_FRAME_MODE, 171 .ids = PHOTO_FRAME_MODE,
172 .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK , 172 .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK ,
@@ -177,14 +177,14 @@ struct pmx_dev_mode pmx_clcd_modes[] = {
177 }, 177 },
178}; 178};
179 179
180struct pmx_dev pmx_clcd = { 180struct pmx_dev spear300_pmx_clcd = {
181 .name = "clcd", 181 .name = "clcd",
182 .modes = pmx_clcd_modes, 182 .modes = pmx_clcd_modes,
183 .mode_count = ARRAY_SIZE(pmx_clcd_modes), 183 .mode_count = ARRAY_SIZE(pmx_clcd_modes),
184 .enb_on_reset = 1, 184 .enb_on_reset = 1,
185}; 185};
186 186
187struct pmx_dev_mode pmx_telecom_gpio_modes[] = { 187static struct pmx_dev_mode pmx_telecom_gpio_modes[] = {
188 { 188 {
189 .ids = PHOTO_FRAME_MODE | CAMU_LCD_MODE | CAML_LCD_MODE, 189 .ids = PHOTO_FRAME_MODE | CAMU_LCD_MODE | CAML_LCD_MODE,
190 .mask = PMX_MII_MASK, 190 .mask = PMX_MII_MASK,
@@ -204,14 +204,14 @@ struct pmx_dev_mode pmx_telecom_gpio_modes[] = {
204 }, 204 },
205}; 205};
206 206
207struct pmx_dev pmx_telecom_gpio = { 207struct pmx_dev spear300_pmx_telecom_gpio = {
208 .name = "telecom_gpio", 208 .name = "telecom_gpio",
209 .modes = pmx_telecom_gpio_modes, 209 .modes = pmx_telecom_gpio_modes,
210 .mode_count = ARRAY_SIZE(pmx_telecom_gpio_modes), 210 .mode_count = ARRAY_SIZE(pmx_telecom_gpio_modes),
211 .enb_on_reset = 1, 211 .enb_on_reset = 1,
212}; 212};
213 213
214struct pmx_dev_mode pmx_telecom_tdm_modes[] = { 214static struct pmx_dev_mode pmx_telecom_tdm_modes[] = {
215 { 215 {
216 .ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE | 216 .ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE |
217 HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE 217 HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE
@@ -222,14 +222,14 @@ struct pmx_dev_mode pmx_telecom_tdm_modes[] = {
222 }, 222 },
223}; 223};
224 224
225struct pmx_dev pmx_telecom_tdm = { 225struct pmx_dev spear300_pmx_telecom_tdm = {
226 .name = "telecom_tdm", 226 .name = "telecom_tdm",
227 .modes = pmx_telecom_tdm_modes, 227 .modes = pmx_telecom_tdm_modes,
228 .mode_count = ARRAY_SIZE(pmx_telecom_tdm_modes), 228 .mode_count = ARRAY_SIZE(pmx_telecom_tdm_modes),
229 .enb_on_reset = 1, 229 .enb_on_reset = 1,
230}; 230};
231 231
232struct pmx_dev_mode pmx_telecom_spi_cs_i2c_clk_modes[] = { 232static struct pmx_dev_mode pmx_telecom_spi_cs_i2c_clk_modes[] = {
233 { 233 {
234 .ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE | 234 .ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE |
235 LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE 235 LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE
@@ -239,14 +239,14 @@ struct pmx_dev_mode pmx_telecom_spi_cs_i2c_clk_modes[] = {
239 }, 239 },
240}; 240};
241 241
242struct pmx_dev pmx_telecom_spi_cs_i2c_clk = { 242struct pmx_dev spear300_pmx_telecom_spi_cs_i2c_clk = {
243 .name = "telecom_spi_cs_i2c_clk", 243 .name = "telecom_spi_cs_i2c_clk",
244 .modes = pmx_telecom_spi_cs_i2c_clk_modes, 244 .modes = pmx_telecom_spi_cs_i2c_clk_modes,
245 .mode_count = ARRAY_SIZE(pmx_telecom_spi_cs_i2c_clk_modes), 245 .mode_count = ARRAY_SIZE(pmx_telecom_spi_cs_i2c_clk_modes),
246 .enb_on_reset = 1, 246 .enb_on_reset = 1,
247}; 247};
248 248
249struct pmx_dev_mode pmx_telecom_camera_modes[] = { 249static struct pmx_dev_mode pmx_telecom_camera_modes[] = {
250 { 250 {
251 .ids = CAML_LCDW_MODE | CAML_LCD_MODE, 251 .ids = CAML_LCDW_MODE | CAML_LCD_MODE,
252 .mask = PMX_MII_MASK, 252 .mask = PMX_MII_MASK,
@@ -256,14 +256,14 @@ struct pmx_dev_mode pmx_telecom_camera_modes[] = {
256 }, 256 },
257}; 257};
258 258
259struct pmx_dev pmx_telecom_camera = { 259struct pmx_dev spear300_pmx_telecom_camera = {
260 .name = "telecom_camera", 260 .name = "telecom_camera",
261 .modes = pmx_telecom_camera_modes, 261 .modes = pmx_telecom_camera_modes,
262 .mode_count = ARRAY_SIZE(pmx_telecom_camera_modes), 262 .mode_count = ARRAY_SIZE(pmx_telecom_camera_modes),
263 .enb_on_reset = 1, 263 .enb_on_reset = 1,
264}; 264};
265 265
266struct pmx_dev_mode pmx_telecom_dac_modes[] = { 266static struct pmx_dev_mode pmx_telecom_dac_modes[] = {
267 { 267 {
268 .ids = ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE 268 .ids = ATA_PABX_I2S_MODE | CAML_LCDW_MODE | CAMU_LCD_MODE
269 | CAMU_WLCD_MODE | CAML_LCD_MODE, 269 | CAMU_WLCD_MODE | CAML_LCD_MODE,
@@ -271,14 +271,14 @@ struct pmx_dev_mode pmx_telecom_dac_modes[] = {
271 }, 271 },
272}; 272};
273 273
274struct pmx_dev pmx_telecom_dac = { 274struct pmx_dev spear300_pmx_telecom_dac = {
275 .name = "telecom_dac", 275 .name = "telecom_dac",
276 .modes = pmx_telecom_dac_modes, 276 .modes = pmx_telecom_dac_modes,
277 .mode_count = ARRAY_SIZE(pmx_telecom_dac_modes), 277 .mode_count = ARRAY_SIZE(pmx_telecom_dac_modes),
278 .enb_on_reset = 1, 278 .enb_on_reset = 1,
279}; 279};
280 280
281struct pmx_dev_mode pmx_telecom_i2s_modes[] = { 281static struct pmx_dev_mode pmx_telecom_i2s_modes[] = {
282 { 282 {
283 .ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE 283 .ids = LEND_IP_PHONE_MODE | HEND_IP_PHONE_MODE
284 | LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE | 284 | LEND_WIFI_PHONE_MODE | HEND_WIFI_PHONE_MODE |
@@ -288,14 +288,14 @@ struct pmx_dev_mode pmx_telecom_i2s_modes[] = {
288 }, 288 },
289}; 289};
290 290
291struct pmx_dev pmx_telecom_i2s = { 291struct pmx_dev spear300_pmx_telecom_i2s = {
292 .name = "telecom_i2s", 292 .name = "telecom_i2s",
293 .modes = pmx_telecom_i2s_modes, 293 .modes = pmx_telecom_i2s_modes,
294 .mode_count = ARRAY_SIZE(pmx_telecom_i2s_modes), 294 .mode_count = ARRAY_SIZE(pmx_telecom_i2s_modes),
295 .enb_on_reset = 1, 295 .enb_on_reset = 1,
296}; 296};
297 297
298struct pmx_dev_mode pmx_telecom_boot_pins_modes[] = { 298static struct pmx_dev_mode pmx_telecom_boot_pins_modes[] = {
299 { 299 {
300 .ids = NAND_MODE | NOR_MODE, 300 .ids = NAND_MODE | NOR_MODE,
301 .mask = PMX_UART0_MODEM_MASK | PMX_TIMER_1_2_MASK | 301 .mask = PMX_UART0_MODEM_MASK | PMX_TIMER_1_2_MASK |
@@ -303,14 +303,14 @@ struct pmx_dev_mode pmx_telecom_boot_pins_modes[] = {
303 }, 303 },
304}; 304};
305 305
306struct pmx_dev pmx_telecom_boot_pins = { 306struct pmx_dev spear300_pmx_telecom_boot_pins = {
307 .name = "telecom_boot_pins", 307 .name = "telecom_boot_pins",
308 .modes = pmx_telecom_boot_pins_modes, 308 .modes = pmx_telecom_boot_pins_modes,
309 .mode_count = ARRAY_SIZE(pmx_telecom_boot_pins_modes), 309 .mode_count = ARRAY_SIZE(pmx_telecom_boot_pins_modes),
310 .enb_on_reset = 1, 310 .enb_on_reset = 1,
311}; 311};
312 312
313struct pmx_dev_mode pmx_telecom_sdhci_4bit_modes[] = { 313static struct pmx_dev_mode pmx_telecom_sdhci_4bit_modes[] = {
314 { 314 {
315 .ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE | 315 .ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE |
316 HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE | 316 HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE |
@@ -323,14 +323,14 @@ struct pmx_dev_mode pmx_telecom_sdhci_4bit_modes[] = {
323 }, 323 },
324}; 324};
325 325
326struct pmx_dev pmx_telecom_sdhci_4bit = { 326struct pmx_dev spear300_pmx_telecom_sdhci_4bit = {
327 .name = "telecom_sdhci_4bit", 327 .name = "telecom_sdhci_4bit",
328 .modes = pmx_telecom_sdhci_4bit_modes, 328 .modes = pmx_telecom_sdhci_4bit_modes,
329 .mode_count = ARRAY_SIZE(pmx_telecom_sdhci_4bit_modes), 329 .mode_count = ARRAY_SIZE(pmx_telecom_sdhci_4bit_modes),
330 .enb_on_reset = 1, 330 .enb_on_reset = 1,
331}; 331};
332 332
333struct pmx_dev_mode pmx_telecom_sdhci_8bit_modes[] = { 333static struct pmx_dev_mode pmx_telecom_sdhci_8bit_modes[] = {
334 { 334 {
335 .ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE | 335 .ids = PHOTO_FRAME_MODE | LEND_IP_PHONE_MODE |
336 HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE | 336 HEND_IP_PHONE_MODE | LEND_WIFI_PHONE_MODE |
@@ -342,14 +342,14 @@ struct pmx_dev_mode pmx_telecom_sdhci_8bit_modes[] = {
342 }, 342 },
343}; 343};
344 344
345struct pmx_dev pmx_telecom_sdhci_8bit = { 345struct pmx_dev spear300_pmx_telecom_sdhci_8bit = {
346 .name = "telecom_sdhci_8bit", 346 .name = "telecom_sdhci_8bit",
347 .modes = pmx_telecom_sdhci_8bit_modes, 347 .modes = pmx_telecom_sdhci_8bit_modes,
348 .mode_count = ARRAY_SIZE(pmx_telecom_sdhci_8bit_modes), 348 .mode_count = ARRAY_SIZE(pmx_telecom_sdhci_8bit_modes),
349 .enb_on_reset = 1, 349 .enb_on_reset = 1,
350}; 350};
351 351
352struct pmx_dev_mode pmx_gpio1_modes[] = { 352static struct pmx_dev_mode pmx_gpio1_modes[] = {
353 { 353 {
354 .ids = PHOTO_FRAME_MODE, 354 .ids = PHOTO_FRAME_MODE,
355 .mask = PMX_UART0_MODEM_MASK | PMX_TIMER_1_2_MASK | 355 .mask = PMX_UART0_MODEM_MASK | PMX_TIMER_1_2_MASK |
@@ -357,7 +357,7 @@ struct pmx_dev_mode pmx_gpio1_modes[] = {
357 }, 357 },
358}; 358};
359 359
360struct pmx_dev pmx_gpio1 = { 360struct pmx_dev spear300_pmx_gpio1 = {
361 .name = "arm gpio1", 361 .name = "arm gpio1",
362 .modes = pmx_gpio1_modes, 362 .modes = pmx_gpio1_modes,
363 .mode_count = ARRAY_SIZE(pmx_gpio1_modes), 363 .mode_count = ARRAY_SIZE(pmx_gpio1_modes),
@@ -365,60 +365,60 @@ struct pmx_dev pmx_gpio1 = {
365}; 365};
366 366
367/* pmx driver structure */ 367/* pmx driver structure */
368struct pmx_driver pmx_driver = { 368static struct pmx_driver pmx_driver = {
369 .mode_reg = {.offset = MODE_CONFIG_REG, .mask = 0x0000000f}, 369 .mode_reg = {.offset = MODE_CONFIG_REG, .mask = 0x0000000f},
370 .mux_reg = {.offset = PAD_MUX_CONFIG_REG, .mask = 0x00007fff}, 370 .mux_reg = {.offset = PAD_MUX_CONFIG_REG, .mask = 0x00007fff},
371}; 371};
372 372
373/* spear3xx shared irq */ 373/* spear3xx shared irq */
374struct shirq_dev_config shirq_ras1_config[] = { 374static struct shirq_dev_config shirq_ras1_config[] = {
375 { 375 {
376 .virq = VIRQ_IT_PERS_S, 376 .virq = SPEAR300_VIRQ_IT_PERS_S,
377 .enb_mask = IT_PERS_S_IRQ_MASK, 377 .enb_mask = SPEAR300_IT_PERS_S_IRQ_MASK,
378 .status_mask = IT_PERS_S_IRQ_MASK, 378 .status_mask = SPEAR300_IT_PERS_S_IRQ_MASK,
379 }, { 379 }, {
380 .virq = VIRQ_IT_CHANGE_S, 380 .virq = SPEAR300_VIRQ_IT_CHANGE_S,
381 .enb_mask = IT_CHANGE_S_IRQ_MASK, 381 .enb_mask = SPEAR300_IT_CHANGE_S_IRQ_MASK,
382 .status_mask = IT_CHANGE_S_IRQ_MASK, 382 .status_mask = SPEAR300_IT_CHANGE_S_IRQ_MASK,
383 }, { 383 }, {
384 .virq = VIRQ_I2S, 384 .virq = SPEAR300_VIRQ_I2S,
385 .enb_mask = I2S_IRQ_MASK, 385 .enb_mask = SPEAR300_I2S_IRQ_MASK,
386 .status_mask = I2S_IRQ_MASK, 386 .status_mask = SPEAR300_I2S_IRQ_MASK,
387 }, { 387 }, {
388 .virq = VIRQ_TDM, 388 .virq = SPEAR300_VIRQ_TDM,
389 .enb_mask = TDM_IRQ_MASK, 389 .enb_mask = SPEAR300_TDM_IRQ_MASK,
390 .status_mask = TDM_IRQ_MASK, 390 .status_mask = SPEAR300_TDM_IRQ_MASK,
391 }, { 391 }, {
392 .virq = VIRQ_CAMERA_L, 392 .virq = SPEAR300_VIRQ_CAMERA_L,
393 .enb_mask = CAMERA_L_IRQ_MASK, 393 .enb_mask = SPEAR300_CAMERA_L_IRQ_MASK,
394 .status_mask = CAMERA_L_IRQ_MASK, 394 .status_mask = SPEAR300_CAMERA_L_IRQ_MASK,
395 }, { 395 }, {
396 .virq = VIRQ_CAMERA_F, 396 .virq = SPEAR300_VIRQ_CAMERA_F,
397 .enb_mask = CAMERA_F_IRQ_MASK, 397 .enb_mask = SPEAR300_CAMERA_F_IRQ_MASK,
398 .status_mask = CAMERA_F_IRQ_MASK, 398 .status_mask = SPEAR300_CAMERA_F_IRQ_MASK,
399 }, { 399 }, {
400 .virq = VIRQ_CAMERA_V, 400 .virq = SPEAR300_VIRQ_CAMERA_V,
401 .enb_mask = CAMERA_V_IRQ_MASK, 401 .enb_mask = SPEAR300_CAMERA_V_IRQ_MASK,
402 .status_mask = CAMERA_V_IRQ_MASK, 402 .status_mask = SPEAR300_CAMERA_V_IRQ_MASK,
403 }, { 403 }, {
404 .virq = VIRQ_KEYBOARD, 404 .virq = SPEAR300_VIRQ_KEYBOARD,
405 .enb_mask = KEYBOARD_IRQ_MASK, 405 .enb_mask = SPEAR300_KEYBOARD_IRQ_MASK,
406 .status_mask = KEYBOARD_IRQ_MASK, 406 .status_mask = SPEAR300_KEYBOARD_IRQ_MASK,
407 }, { 407 }, {
408 .virq = VIRQ_GPIO1, 408 .virq = SPEAR300_VIRQ_GPIO1,
409 .enb_mask = GPIO1_IRQ_MASK, 409 .enb_mask = SPEAR300_GPIO1_IRQ_MASK,
410 .status_mask = GPIO1_IRQ_MASK, 410 .status_mask = SPEAR300_GPIO1_IRQ_MASK,
411 }, 411 },
412}; 412};
413 413
414struct spear_shirq shirq_ras1 = { 414static struct spear_shirq shirq_ras1 = {
415 .irq = IRQ_GEN_RAS_1, 415 .irq = SPEAR3XX_IRQ_GEN_RAS_1,
416 .dev_config = shirq_ras1_config, 416 .dev_config = shirq_ras1_config,
417 .dev_count = ARRAY_SIZE(shirq_ras1_config), 417 .dev_count = ARRAY_SIZE(shirq_ras1_config),
418 .regs = { 418 .regs = {
419 .enb_reg = INT_ENB_MASK_REG, 419 .enb_reg = SPEAR300_INT_ENB_MASK_REG,
420 .status_reg = INT_STS_MASK_REG, 420 .status_reg = SPEAR300_INT_STS_MASK_REG,
421 .status_reg_mask = SHIRQ_RAS1_MASK, 421 .status_reg_mask = SPEAR300_SHIRQ_RAS1_MASK,
422 .clear_reg = -1, 422 .clear_reg = -1,
423 }, 423 },
424}; 424};
@@ -427,10 +427,10 @@ struct spear_shirq shirq_ras1 = {
427/* arm gpio1 device registration */ 427/* arm gpio1 device registration */
428static struct pl061_platform_data gpio1_plat_data = { 428static struct pl061_platform_data gpio1_plat_data = {
429 .gpio_base = 8, 429 .gpio_base = 8,
430 .irq_base = SPEAR_GPIO1_INT_BASE, 430 .irq_base = SPEAR300_GPIO1_INT_BASE,
431}; 431};
432 432
433struct amba_device gpio1_device = { 433struct amba_device spear300_gpio1_device = {
434 .dev = { 434 .dev = {
435 .init_name = "gpio1", 435 .init_name = "gpio1",
436 .platform_data = &gpio1_plat_data, 436 .platform_data = &gpio1_plat_data,
@@ -440,11 +440,12 @@ struct amba_device gpio1_device = {
440 .end = SPEAR300_GPIO_BASE + SZ_4K - 1, 440 .end = SPEAR300_GPIO_BASE + SZ_4K - 1,
441 .flags = IORESOURCE_MEM, 441 .flags = IORESOURCE_MEM,
442 }, 442 },
443 .irq = {VIRQ_GPIO1, NO_IRQ}, 443 .irq = {SPEAR300_VIRQ_GPIO1, NO_IRQ},
444}; 444};
445 445
446/* spear300 routines */ 446/* spear300 routines */
447void __init spear300_init(void) 447void __init spear300_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
448 u8 pmx_dev_count)
448{ 449{
449 int ret = 0; 450 int ret = 0;
450 451
@@ -460,6 +461,10 @@ void __init spear300_init(void)
460 } 461 }
461 462
462 /* pmx initialization */ 463 /* pmx initialization */
464 pmx_driver.mode = pmx_mode;
465 pmx_driver.devs = pmx_devs;
466 pmx_driver.devs_count = pmx_dev_count;
467
463 pmx_driver.base = ioremap(SPEAR300_SOC_CONFIG_BASE, SZ_4K); 468 pmx_driver.base = ioremap(SPEAR300_SOC_CONFIG_BASE, SZ_4K);
464 if (pmx_driver.base) { 469 if (pmx_driver.base) {
465 ret = pmx_register(&pmx_driver); 470 ret = pmx_register(&pmx_driver);
diff --git a/arch/arm/mach-spear3xx/spear300_evb.c b/arch/arm/mach-spear3xx/spear300_evb.c
index 42d2253ef540..69006f694220 100644
--- a/arch/arm/mach-spear3xx/spear300_evb.c
+++ b/arch/arm/mach-spear3xx/spear300_evb.c
@@ -19,26 +19,26 @@
19/* padmux devices to enable */ 19/* padmux devices to enable */
20static struct pmx_dev *pmx_devs[] = { 20static struct pmx_dev *pmx_devs[] = {
21 /* spear3xx specific devices */ 21 /* spear3xx specific devices */
22 &pmx_i2c, 22 &spear3xx_pmx_i2c,
23 &pmx_ssp_cs, 23 &spear3xx_pmx_ssp_cs,
24 &pmx_ssp, 24 &spear3xx_pmx_ssp,
25 &pmx_mii, 25 &spear3xx_pmx_mii,
26 &pmx_uart0, 26 &spear3xx_pmx_uart0,
27 27
28 /* spear300 specific devices */ 28 /* spear300 specific devices */
29 &pmx_fsmc_2_chips, 29 &spear300_pmx_fsmc_2_chips,
30 &pmx_clcd, 30 &spear300_pmx_clcd,
31 &pmx_telecom_sdhci_4bit, 31 &spear300_pmx_telecom_sdhci_4bit,
32 &pmx_gpio1, 32 &spear300_pmx_gpio1,
33}; 33};
34 34
35static struct amba_device *amba_devs[] __initdata = { 35static struct amba_device *amba_devs[] __initdata = {
36 /* spear3xx specific devices */ 36 /* spear3xx specific devices */
37 &gpio_device, 37 &spear3xx_gpio_device,
38 &uart_device, 38 &spear3xx_uart_device,
39 39
40 /* spear300 specific devices */ 40 /* spear300 specific devices */
41 &gpio1_device, 41 &spear300_gpio1_device,
42}; 42};
43 43
44static struct platform_device *plat_devs[] __initdata = { 44static struct platform_device *plat_devs[] __initdata = {
@@ -51,13 +51,9 @@ static void __init spear300_evb_init(void)
51{ 51{
52 unsigned int i; 52 unsigned int i;
53 53
54 /* padmux initialization, must be done before spear300_init */
55 pmx_driver.mode = &photo_frame_mode;
56 pmx_driver.devs = pmx_devs;
57 pmx_driver.devs_count = ARRAY_SIZE(pmx_devs);
58
59 /* call spear300 machine init function */ 54 /* call spear300 machine init function */
60 spear300_init(); 55 spear300_init(&spear300_photo_frame_mode, pmx_devs,
56 ARRAY_SIZE(pmx_devs));
61 57
62 /* Add Platform Devices */ 58 /* Add Platform Devices */
63 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs)); 59 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
diff --git a/arch/arm/mach-spear3xx/spear310.c b/arch/arm/mach-spear3xx/spear310.c
index 5c0a67b60c2a..9004cf9f01bf 100644
--- a/arch/arm/mach-spear3xx/spear310.c
+++ b/arch/arm/mach-spear3xx/spear310.c
@@ -22,112 +22,112 @@
22#define PAD_MUX_CONFIG_REG 0x08 22#define PAD_MUX_CONFIG_REG 0x08
23 23
24/* devices */ 24/* devices */
25struct pmx_dev_mode pmx_emi_cs_0_1_4_5_modes[] = { 25static struct pmx_dev_mode pmx_emi_cs_0_1_4_5_modes[] = {
26 { 26 {
27 .ids = 0x00, 27 .ids = 0x00,
28 .mask = PMX_TIMER_3_4_MASK, 28 .mask = PMX_TIMER_3_4_MASK,
29 }, 29 },
30}; 30};
31 31
32struct pmx_dev pmx_emi_cs_0_1_4_5 = { 32struct pmx_dev spear310_pmx_emi_cs_0_1_4_5 = {
33 .name = "emi_cs_0_1_4_5", 33 .name = "emi_cs_0_1_4_5",
34 .modes = pmx_emi_cs_0_1_4_5_modes, 34 .modes = pmx_emi_cs_0_1_4_5_modes,
35 .mode_count = ARRAY_SIZE(pmx_emi_cs_0_1_4_5_modes), 35 .mode_count = ARRAY_SIZE(pmx_emi_cs_0_1_4_5_modes),
36 .enb_on_reset = 1, 36 .enb_on_reset = 1,
37}; 37};
38 38
39struct pmx_dev_mode pmx_emi_cs_2_3_modes[] = { 39static struct pmx_dev_mode pmx_emi_cs_2_3_modes[] = {
40 { 40 {
41 .ids = 0x00, 41 .ids = 0x00,
42 .mask = PMX_TIMER_1_2_MASK, 42 .mask = PMX_TIMER_1_2_MASK,
43 }, 43 },
44}; 44};
45 45
46struct pmx_dev pmx_emi_cs_2_3 = { 46struct pmx_dev spear310_pmx_emi_cs_2_3 = {
47 .name = "emi_cs_2_3", 47 .name = "emi_cs_2_3",
48 .modes = pmx_emi_cs_2_3_modes, 48 .modes = pmx_emi_cs_2_3_modes,
49 .mode_count = ARRAY_SIZE(pmx_emi_cs_2_3_modes), 49 .mode_count = ARRAY_SIZE(pmx_emi_cs_2_3_modes),
50 .enb_on_reset = 1, 50 .enb_on_reset = 1,
51}; 51};
52 52
53struct pmx_dev_mode pmx_uart1_modes[] = { 53static struct pmx_dev_mode pmx_uart1_modes[] = {
54 { 54 {
55 .ids = 0x00, 55 .ids = 0x00,
56 .mask = PMX_FIRDA_MASK, 56 .mask = PMX_FIRDA_MASK,
57 }, 57 },
58}; 58};
59 59
60struct pmx_dev pmx_uart1 = { 60struct pmx_dev spear310_pmx_uart1 = {
61 .name = "uart1", 61 .name = "uart1",
62 .modes = pmx_uart1_modes, 62 .modes = pmx_uart1_modes,
63 .mode_count = ARRAY_SIZE(pmx_uart1_modes), 63 .mode_count = ARRAY_SIZE(pmx_uart1_modes),
64 .enb_on_reset = 1, 64 .enb_on_reset = 1,
65}; 65};
66 66
67struct pmx_dev_mode pmx_uart2_modes[] = { 67static struct pmx_dev_mode pmx_uart2_modes[] = {
68 { 68 {
69 .ids = 0x00, 69 .ids = 0x00,
70 .mask = PMX_TIMER_1_2_MASK, 70 .mask = PMX_TIMER_1_2_MASK,
71 }, 71 },
72}; 72};
73 73
74struct pmx_dev pmx_uart2 = { 74struct pmx_dev spear310_pmx_uart2 = {
75 .name = "uart2", 75 .name = "uart2",
76 .modes = pmx_uart2_modes, 76 .modes = pmx_uart2_modes,
77 .mode_count = ARRAY_SIZE(pmx_uart2_modes), 77 .mode_count = ARRAY_SIZE(pmx_uart2_modes),
78 .enb_on_reset = 1, 78 .enb_on_reset = 1,
79}; 79};
80 80
81struct pmx_dev_mode pmx_uart3_4_5_modes[] = { 81static struct pmx_dev_mode pmx_uart3_4_5_modes[] = {
82 { 82 {
83 .ids = 0x00, 83 .ids = 0x00,
84 .mask = PMX_UART0_MODEM_MASK, 84 .mask = PMX_UART0_MODEM_MASK,
85 }, 85 },
86}; 86};
87 87
88struct pmx_dev pmx_uart3_4_5 = { 88struct pmx_dev spear310_pmx_uart3_4_5 = {
89 .name = "uart3_4_5", 89 .name = "uart3_4_5",
90 .modes = pmx_uart3_4_5_modes, 90 .modes = pmx_uart3_4_5_modes,
91 .mode_count = ARRAY_SIZE(pmx_uart3_4_5_modes), 91 .mode_count = ARRAY_SIZE(pmx_uart3_4_5_modes),
92 .enb_on_reset = 1, 92 .enb_on_reset = 1,
93}; 93};
94 94
95struct pmx_dev_mode pmx_fsmc_modes[] = { 95static struct pmx_dev_mode pmx_fsmc_modes[] = {
96 { 96 {
97 .ids = 0x00, 97 .ids = 0x00,
98 .mask = PMX_SSP_CS_MASK, 98 .mask = PMX_SSP_CS_MASK,
99 }, 99 },
100}; 100};
101 101
102struct pmx_dev pmx_fsmc = { 102struct pmx_dev spear310_pmx_fsmc = {
103 .name = "fsmc", 103 .name = "fsmc",
104 .modes = pmx_fsmc_modes, 104 .modes = pmx_fsmc_modes,
105 .mode_count = ARRAY_SIZE(pmx_fsmc_modes), 105 .mode_count = ARRAY_SIZE(pmx_fsmc_modes),
106 .enb_on_reset = 1, 106 .enb_on_reset = 1,
107}; 107};
108 108
109struct pmx_dev_mode pmx_rs485_0_1_modes[] = { 109static struct pmx_dev_mode pmx_rs485_0_1_modes[] = {
110 { 110 {
111 .ids = 0x00, 111 .ids = 0x00,
112 .mask = PMX_MII_MASK, 112 .mask = PMX_MII_MASK,
113 }, 113 },
114}; 114};
115 115
116struct pmx_dev pmx_rs485_0_1 = { 116struct pmx_dev spear310_pmx_rs485_0_1 = {
117 .name = "rs485_0_1", 117 .name = "rs485_0_1",
118 .modes = pmx_rs485_0_1_modes, 118 .modes = pmx_rs485_0_1_modes,
119 .mode_count = ARRAY_SIZE(pmx_rs485_0_1_modes), 119 .mode_count = ARRAY_SIZE(pmx_rs485_0_1_modes),
120 .enb_on_reset = 1, 120 .enb_on_reset = 1,
121}; 121};
122 122
123struct pmx_dev_mode pmx_tdm0_modes[] = { 123static struct pmx_dev_mode pmx_tdm0_modes[] = {
124 { 124 {
125 .ids = 0x00, 125 .ids = 0x00,
126 .mask = PMX_MII_MASK, 126 .mask = PMX_MII_MASK,
127 }, 127 },
128}; 128};
129 129
130struct pmx_dev pmx_tdm0 = { 130struct pmx_dev spear310_pmx_tdm0 = {
131 .name = "tdm0", 131 .name = "tdm0",
132 .modes = pmx_tdm0_modes, 132 .modes = pmx_tdm0_modes,
133 .mode_count = ARRAY_SIZE(pmx_tdm0_modes), 133 .mode_count = ARRAY_SIZE(pmx_tdm0_modes),
@@ -135,122 +135,122 @@ struct pmx_dev pmx_tdm0 = {
135}; 135};
136 136
137/* pmx driver structure */ 137/* pmx driver structure */
138struct pmx_driver pmx_driver = { 138static struct pmx_driver pmx_driver = {
139 .mux_reg = {.offset = PAD_MUX_CONFIG_REG, .mask = 0x00007fff}, 139 .mux_reg = {.offset = PAD_MUX_CONFIG_REG, .mask = 0x00007fff},
140}; 140};
141 141
142/* spear3xx shared irq */ 142/* spear3xx shared irq */
143struct shirq_dev_config shirq_ras1_config[] = { 143static struct shirq_dev_config shirq_ras1_config[] = {
144 { 144 {
145 .virq = VIRQ_SMII0, 145 .virq = SPEAR310_VIRQ_SMII0,
146 .status_mask = SMII0_IRQ_MASK, 146 .status_mask = SPEAR310_SMII0_IRQ_MASK,
147 }, { 147 }, {
148 .virq = VIRQ_SMII1, 148 .virq = SPEAR310_VIRQ_SMII1,
149 .status_mask = SMII1_IRQ_MASK, 149 .status_mask = SPEAR310_SMII1_IRQ_MASK,
150 }, { 150 }, {
151 .virq = VIRQ_SMII2, 151 .virq = SPEAR310_VIRQ_SMII2,
152 .status_mask = SMII2_IRQ_MASK, 152 .status_mask = SPEAR310_SMII2_IRQ_MASK,
153 }, { 153 }, {
154 .virq = VIRQ_SMII3, 154 .virq = SPEAR310_VIRQ_SMII3,
155 .status_mask = SMII3_IRQ_MASK, 155 .status_mask = SPEAR310_SMII3_IRQ_MASK,
156 }, { 156 }, {
157 .virq = VIRQ_WAKEUP_SMII0, 157 .virq = SPEAR310_VIRQ_WAKEUP_SMII0,
158 .status_mask = WAKEUP_SMII0_IRQ_MASK, 158 .status_mask = SPEAR310_WAKEUP_SMII0_IRQ_MASK,
159 }, { 159 }, {
160 .virq = VIRQ_WAKEUP_SMII1, 160 .virq = SPEAR310_VIRQ_WAKEUP_SMII1,
161 .status_mask = WAKEUP_SMII1_IRQ_MASK, 161 .status_mask = SPEAR310_WAKEUP_SMII1_IRQ_MASK,
162 }, { 162 }, {
163 .virq = VIRQ_WAKEUP_SMII2, 163 .virq = SPEAR310_VIRQ_WAKEUP_SMII2,
164 .status_mask = WAKEUP_SMII2_IRQ_MASK, 164 .status_mask = SPEAR310_WAKEUP_SMII2_IRQ_MASK,
165 }, { 165 }, {
166 .virq = VIRQ_WAKEUP_SMII3, 166 .virq = SPEAR310_VIRQ_WAKEUP_SMII3,
167 .status_mask = WAKEUP_SMII3_IRQ_MASK, 167 .status_mask = SPEAR310_WAKEUP_SMII3_IRQ_MASK,
168 }, 168 },
169}; 169};
170 170
171struct spear_shirq shirq_ras1 = { 171static struct spear_shirq shirq_ras1 = {
172 .irq = IRQ_GEN_RAS_1, 172 .irq = SPEAR3XX_IRQ_GEN_RAS_1,
173 .dev_config = shirq_ras1_config, 173 .dev_config = shirq_ras1_config,
174 .dev_count = ARRAY_SIZE(shirq_ras1_config), 174 .dev_count = ARRAY_SIZE(shirq_ras1_config),
175 .regs = { 175 .regs = {
176 .enb_reg = -1, 176 .enb_reg = -1,
177 .status_reg = INT_STS_MASK_REG, 177 .status_reg = SPEAR310_INT_STS_MASK_REG,
178 .status_reg_mask = SHIRQ_RAS1_MASK, 178 .status_reg_mask = SPEAR310_SHIRQ_RAS1_MASK,
179 .clear_reg = -1, 179 .clear_reg = -1,
180 }, 180 },
181}; 181};
182 182
183struct shirq_dev_config shirq_ras2_config[] = { 183static struct shirq_dev_config shirq_ras2_config[] = {
184 { 184 {
185 .virq = VIRQ_UART1, 185 .virq = SPEAR310_VIRQ_UART1,
186 .status_mask = UART1_IRQ_MASK, 186 .status_mask = SPEAR310_UART1_IRQ_MASK,
187 }, { 187 }, {
188 .virq = VIRQ_UART2, 188 .virq = SPEAR310_VIRQ_UART2,
189 .status_mask = UART2_IRQ_MASK, 189 .status_mask = SPEAR310_UART2_IRQ_MASK,
190 }, { 190 }, {
191 .virq = VIRQ_UART3, 191 .virq = SPEAR310_VIRQ_UART3,
192 .status_mask = UART3_IRQ_MASK, 192 .status_mask = SPEAR310_UART3_IRQ_MASK,
193 }, { 193 }, {
194 .virq = VIRQ_UART4, 194 .virq = SPEAR310_VIRQ_UART4,
195 .status_mask = UART4_IRQ_MASK, 195 .status_mask = SPEAR310_UART4_IRQ_MASK,
196 }, { 196 }, {
197 .virq = VIRQ_UART5, 197 .virq = SPEAR310_VIRQ_UART5,
198 .status_mask = UART5_IRQ_MASK, 198 .status_mask = SPEAR310_UART5_IRQ_MASK,
199 }, 199 },
200}; 200};
201 201
202struct spear_shirq shirq_ras2 = { 202static struct spear_shirq shirq_ras2 = {
203 .irq = IRQ_GEN_RAS_2, 203 .irq = SPEAR3XX_IRQ_GEN_RAS_2,
204 .dev_config = shirq_ras2_config, 204 .dev_config = shirq_ras2_config,
205 .dev_count = ARRAY_SIZE(shirq_ras2_config), 205 .dev_count = ARRAY_SIZE(shirq_ras2_config),
206 .regs = { 206 .regs = {
207 .enb_reg = -1, 207 .enb_reg = -1,
208 .status_reg = INT_STS_MASK_REG, 208 .status_reg = SPEAR310_INT_STS_MASK_REG,
209 .status_reg_mask = SHIRQ_RAS2_MASK, 209 .status_reg_mask = SPEAR310_SHIRQ_RAS2_MASK,
210 .clear_reg = -1, 210 .clear_reg = -1,
211 }, 211 },
212}; 212};
213 213
214struct shirq_dev_config shirq_ras3_config[] = { 214static struct shirq_dev_config shirq_ras3_config[] = {
215 { 215 {
216 .virq = VIRQ_EMI, 216 .virq = SPEAR310_VIRQ_EMI,
217 .status_mask = EMI_IRQ_MASK, 217 .status_mask = SPEAR310_EMI_IRQ_MASK,
218 }, 218 },
219}; 219};
220 220
221struct spear_shirq shirq_ras3 = { 221static struct spear_shirq shirq_ras3 = {
222 .irq = IRQ_GEN_RAS_3, 222 .irq = SPEAR3XX_IRQ_GEN_RAS_3,
223 .dev_config = shirq_ras3_config, 223 .dev_config = shirq_ras3_config,
224 .dev_count = ARRAY_SIZE(shirq_ras3_config), 224 .dev_count = ARRAY_SIZE(shirq_ras3_config),
225 .regs = { 225 .regs = {
226 .enb_reg = -1, 226 .enb_reg = -1,
227 .status_reg = INT_STS_MASK_REG, 227 .status_reg = SPEAR310_INT_STS_MASK_REG,
228 .status_reg_mask = SHIRQ_RAS3_MASK, 228 .status_reg_mask = SPEAR310_SHIRQ_RAS3_MASK,
229 .clear_reg = -1, 229 .clear_reg = -1,
230 }, 230 },
231}; 231};
232 232
233struct shirq_dev_config shirq_intrcomm_ras_config[] = { 233static struct shirq_dev_config shirq_intrcomm_ras_config[] = {
234 { 234 {
235 .virq = VIRQ_TDM_HDLC, 235 .virq = SPEAR310_VIRQ_TDM_HDLC,
236 .status_mask = TDM_HDLC_IRQ_MASK, 236 .status_mask = SPEAR310_TDM_HDLC_IRQ_MASK,
237 }, { 237 }, {
238 .virq = VIRQ_RS485_0, 238 .virq = SPEAR310_VIRQ_RS485_0,
239 .status_mask = RS485_0_IRQ_MASK, 239 .status_mask = SPEAR310_RS485_0_IRQ_MASK,
240 }, { 240 }, {
241 .virq = VIRQ_RS485_1, 241 .virq = SPEAR310_VIRQ_RS485_1,
242 .status_mask = RS485_1_IRQ_MASK, 242 .status_mask = SPEAR310_RS485_1_IRQ_MASK,
243 }, 243 },
244}; 244};
245 245
246struct spear_shirq shirq_intrcomm_ras = { 246static struct spear_shirq shirq_intrcomm_ras = {
247 .irq = IRQ_INTRCOMM_RAS_ARM, 247 .irq = SPEAR3XX_IRQ_INTRCOMM_RAS_ARM,
248 .dev_config = shirq_intrcomm_ras_config, 248 .dev_config = shirq_intrcomm_ras_config,
249 .dev_count = ARRAY_SIZE(shirq_intrcomm_ras_config), 249 .dev_count = ARRAY_SIZE(shirq_intrcomm_ras_config),
250 .regs = { 250 .regs = {
251 .enb_reg = -1, 251 .enb_reg = -1,
252 .status_reg = INT_STS_MASK_REG, 252 .status_reg = SPEAR310_INT_STS_MASK_REG,
253 .status_reg_mask = SHIRQ_INTRCOMM_RAS_MASK, 253 .status_reg_mask = SPEAR310_SHIRQ_INTRCOMM_RAS_MASK,
254 .clear_reg = -1, 254 .clear_reg = -1,
255 }, 255 },
256}; 256};
@@ -258,7 +258,8 @@ struct spear_shirq shirq_intrcomm_ras = {
258/* Add spear310 specific devices here */ 258/* Add spear310 specific devices here */
259 259
260/* spear310 routines */ 260/* spear310 routines */
261void __init spear310_init(void) 261void __init spear310_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
262 u8 pmx_dev_count)
262{ 263{
263 void __iomem *base; 264 void __iomem *base;
264 int ret = 0; 265 int ret = 0;
@@ -296,6 +297,10 @@ void __init spear310_init(void)
296 297
297 /* pmx initialization */ 298 /* pmx initialization */
298 pmx_driver.base = base; 299 pmx_driver.base = base;
300 pmx_driver.mode = pmx_mode;
301 pmx_driver.devs = pmx_devs;
302 pmx_driver.devs_count = pmx_dev_count;
303
299 ret = pmx_register(&pmx_driver); 304 ret = pmx_register(&pmx_driver);
300 if (ret) 305 if (ret)
301 printk(KERN_ERR "padmux: registeration failed. err no: %d\n", 306 printk(KERN_ERR "padmux: registeration failed. err no: %d\n",
diff --git a/arch/arm/mach-spear3xx/spear310_evb.c b/arch/arm/mach-spear3xx/spear310_evb.c
index 2d7f333bd67b..c8684ce1f9b3 100644
--- a/arch/arm/mach-spear3xx/spear310_evb.c
+++ b/arch/arm/mach-spear3xx/spear310_evb.c
@@ -19,31 +19,31 @@
19/* padmux devices to enable */ 19/* padmux devices to enable */
20static struct pmx_dev *pmx_devs[] = { 20static struct pmx_dev *pmx_devs[] = {
21 /* spear3xx specific devices */ 21 /* spear3xx specific devices */
22 &pmx_i2c, 22 &spear3xx_pmx_i2c,
23 &pmx_ssp, 23 &spear3xx_pmx_ssp,
24 &pmx_gpio_pin0, 24 &spear3xx_pmx_gpio_pin0,
25 &pmx_gpio_pin1, 25 &spear3xx_pmx_gpio_pin1,
26 &pmx_gpio_pin2, 26 &spear3xx_pmx_gpio_pin2,
27 &pmx_gpio_pin3, 27 &spear3xx_pmx_gpio_pin3,
28 &pmx_gpio_pin4, 28 &spear3xx_pmx_gpio_pin4,
29 &pmx_gpio_pin5, 29 &spear3xx_pmx_gpio_pin5,
30 &pmx_uart0, 30 &spear3xx_pmx_uart0,
31 31
32 /* spear310 specific devices */ 32 /* spear310 specific devices */
33 &pmx_emi_cs_0_1_4_5, 33 &spear310_pmx_emi_cs_0_1_4_5,
34 &pmx_emi_cs_2_3, 34 &spear310_pmx_emi_cs_2_3,
35 &pmx_uart1, 35 &spear310_pmx_uart1,
36 &pmx_uart2, 36 &spear310_pmx_uart2,
37 &pmx_uart3_4_5, 37 &spear310_pmx_uart3_4_5,
38 &pmx_fsmc, 38 &spear310_pmx_fsmc,
39 &pmx_rs485_0_1, 39 &spear310_pmx_rs485_0_1,
40 &pmx_tdm0, 40 &spear310_pmx_tdm0,
41}; 41};
42 42
43static struct amba_device *amba_devs[] __initdata = { 43static struct amba_device *amba_devs[] __initdata = {
44 /* spear3xx specific devices */ 44 /* spear3xx specific devices */
45 &gpio_device, 45 &spear3xx_gpio_device,
46 &uart_device, 46 &spear3xx_uart_device,
47 47
48 /* spear310 specific devices */ 48 /* spear310 specific devices */
49}; 49};
@@ -58,13 +58,8 @@ static void __init spear310_evb_init(void)
58{ 58{
59 unsigned int i; 59 unsigned int i;
60 60
61 /* padmux initialization, must be done before spear310_init */
62 pmx_driver.mode = NULL;
63 pmx_driver.devs = pmx_devs;
64 pmx_driver.devs_count = ARRAY_SIZE(pmx_devs);
65
66 /* call spear310 machine init function */ 61 /* call spear310 machine init function */
67 spear310_init(); 62 spear310_init(NULL, pmx_devs, ARRAY_SIZE(pmx_devs));
68 63
69 /* Add Platform Devices */ 64 /* Add Platform Devices */
70 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs)); 65 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
diff --git a/arch/arm/mach-spear3xx/spear320.c b/arch/arm/mach-spear3xx/spear320.c
index 741c1f414cbd..ee29bef43074 100644
--- a/arch/arm/mach-spear3xx/spear320.c
+++ b/arch/arm/mach-spear3xx/spear320.c
@@ -29,88 +29,88 @@
29#define SMALL_PRINTERS_MODE (1 << 3) 29#define SMALL_PRINTERS_MODE (1 << 3)
30#define ALL_MODES 0xF 30#define ALL_MODES 0xF
31 31
32struct pmx_mode auto_net_smii_mode = { 32struct pmx_mode spear320_auto_net_smii_mode = {
33 .id = AUTO_NET_SMII_MODE, 33 .id = AUTO_NET_SMII_MODE,
34 .name = "Automation Networking SMII Mode", 34 .name = "Automation Networking SMII Mode",
35 .mask = 0x00, 35 .mask = 0x00,
36}; 36};
37 37
38struct pmx_mode auto_net_mii_mode = { 38struct pmx_mode spear320_auto_net_mii_mode = {
39 .id = AUTO_NET_MII_MODE, 39 .id = AUTO_NET_MII_MODE,
40 .name = "Automation Networking MII Mode", 40 .name = "Automation Networking MII Mode",
41 .mask = 0x01, 41 .mask = 0x01,
42}; 42};
43 43
44struct pmx_mode auto_exp_mode = { 44struct pmx_mode spear320_auto_exp_mode = {
45 .id = AUTO_EXP_MODE, 45 .id = AUTO_EXP_MODE,
46 .name = "Automation Expanded Mode", 46 .name = "Automation Expanded Mode",
47 .mask = 0x02, 47 .mask = 0x02,
48}; 48};
49 49
50struct pmx_mode small_printers_mode = { 50struct pmx_mode spear320_small_printers_mode = {
51 .id = SMALL_PRINTERS_MODE, 51 .id = SMALL_PRINTERS_MODE,
52 .name = "Small Printers Mode", 52 .name = "Small Printers Mode",
53 .mask = 0x03, 53 .mask = 0x03,
54}; 54};
55 55
56/* devices */ 56/* devices */
57struct pmx_dev_mode pmx_clcd_modes[] = { 57static struct pmx_dev_mode pmx_clcd_modes[] = {
58 { 58 {
59 .ids = AUTO_NET_SMII_MODE, 59 .ids = AUTO_NET_SMII_MODE,
60 .mask = 0x0, 60 .mask = 0x0,
61 }, 61 },
62}; 62};
63 63
64struct pmx_dev pmx_clcd = { 64struct pmx_dev spear320_pmx_clcd = {
65 .name = "clcd", 65 .name = "clcd",
66 .modes = pmx_clcd_modes, 66 .modes = pmx_clcd_modes,
67 .mode_count = ARRAY_SIZE(pmx_clcd_modes), 67 .mode_count = ARRAY_SIZE(pmx_clcd_modes),
68 .enb_on_reset = 1, 68 .enb_on_reset = 1,
69}; 69};
70 70
71struct pmx_dev_mode pmx_emi_modes[] = { 71static struct pmx_dev_mode pmx_emi_modes[] = {
72 { 72 {
73 .ids = AUTO_EXP_MODE, 73 .ids = AUTO_EXP_MODE,
74 .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK, 74 .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK,
75 }, 75 },
76}; 76};
77 77
78struct pmx_dev pmx_emi = { 78struct pmx_dev spear320_pmx_emi = {
79 .name = "emi", 79 .name = "emi",
80 .modes = pmx_emi_modes, 80 .modes = pmx_emi_modes,
81 .mode_count = ARRAY_SIZE(pmx_emi_modes), 81 .mode_count = ARRAY_SIZE(pmx_emi_modes),
82 .enb_on_reset = 1, 82 .enb_on_reset = 1,
83}; 83};
84 84
85struct pmx_dev_mode pmx_fsmc_modes[] = { 85static struct pmx_dev_mode pmx_fsmc_modes[] = {
86 { 86 {
87 .ids = ALL_MODES, 87 .ids = ALL_MODES,
88 .mask = 0x0, 88 .mask = 0x0,
89 }, 89 },
90}; 90};
91 91
92struct pmx_dev pmx_fsmc = { 92struct pmx_dev spear320_pmx_fsmc = {
93 .name = "fsmc", 93 .name = "fsmc",
94 .modes = pmx_fsmc_modes, 94 .modes = pmx_fsmc_modes,
95 .mode_count = ARRAY_SIZE(pmx_fsmc_modes), 95 .mode_count = ARRAY_SIZE(pmx_fsmc_modes),
96 .enb_on_reset = 1, 96 .enb_on_reset = 1,
97}; 97};
98 98
99struct pmx_dev_mode pmx_spp_modes[] = { 99static struct pmx_dev_mode pmx_spp_modes[] = {
100 { 100 {
101 .ids = SMALL_PRINTERS_MODE, 101 .ids = SMALL_PRINTERS_MODE,
102 .mask = 0x0, 102 .mask = 0x0,
103 }, 103 },
104}; 104};
105 105
106struct pmx_dev pmx_spp = { 106struct pmx_dev spear320_pmx_spp = {
107 .name = "spp", 107 .name = "spp",
108 .modes = pmx_spp_modes, 108 .modes = pmx_spp_modes,
109 .mode_count = ARRAY_SIZE(pmx_spp_modes), 109 .mode_count = ARRAY_SIZE(pmx_spp_modes),
110 .enb_on_reset = 1, 110 .enb_on_reset = 1,
111}; 111};
112 112
113struct pmx_dev_mode pmx_sdhci_modes[] = { 113static struct pmx_dev_mode pmx_sdhci_modes[] = {
114 { 114 {
115 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | 115 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE |
116 SMALL_PRINTERS_MODE, 116 SMALL_PRINTERS_MODE,
@@ -118,42 +118,42 @@ struct pmx_dev_mode pmx_sdhci_modes[] = {
118 }, 118 },
119}; 119};
120 120
121struct pmx_dev pmx_sdhci = { 121struct pmx_dev spear320_pmx_sdhci = {
122 .name = "sdhci", 122 .name = "sdhci",
123 .modes = pmx_sdhci_modes, 123 .modes = pmx_sdhci_modes,
124 .mode_count = ARRAY_SIZE(pmx_sdhci_modes), 124 .mode_count = ARRAY_SIZE(pmx_sdhci_modes),
125 .enb_on_reset = 1, 125 .enb_on_reset = 1,
126}; 126};
127 127
128struct pmx_dev_mode pmx_i2s_modes[] = { 128static struct pmx_dev_mode pmx_i2s_modes[] = {
129 { 129 {
130 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE, 130 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE,
131 .mask = PMX_UART0_MODEM_MASK, 131 .mask = PMX_UART0_MODEM_MASK,
132 }, 132 },
133}; 133};
134 134
135struct pmx_dev pmx_i2s = { 135struct pmx_dev spear320_pmx_i2s = {
136 .name = "i2s", 136 .name = "i2s",
137 .modes = pmx_i2s_modes, 137 .modes = pmx_i2s_modes,
138 .mode_count = ARRAY_SIZE(pmx_i2s_modes), 138 .mode_count = ARRAY_SIZE(pmx_i2s_modes),
139 .enb_on_reset = 1, 139 .enb_on_reset = 1,
140}; 140};
141 141
142struct pmx_dev_mode pmx_uart1_modes[] = { 142static struct pmx_dev_mode pmx_uart1_modes[] = {
143 { 143 {
144 .ids = ALL_MODES, 144 .ids = ALL_MODES,
145 .mask = PMX_GPIO_PIN0_MASK | PMX_GPIO_PIN1_MASK, 145 .mask = PMX_GPIO_PIN0_MASK | PMX_GPIO_PIN1_MASK,
146 }, 146 },
147}; 147};
148 148
149struct pmx_dev pmx_uart1 = { 149struct pmx_dev spear320_pmx_uart1 = {
150 .name = "uart1", 150 .name = "uart1",
151 .modes = pmx_uart1_modes, 151 .modes = pmx_uart1_modes,
152 .mode_count = ARRAY_SIZE(pmx_uart1_modes), 152 .mode_count = ARRAY_SIZE(pmx_uart1_modes),
153 .enb_on_reset = 1, 153 .enb_on_reset = 1,
154}; 154};
155 155
156struct pmx_dev_mode pmx_uart1_modem_modes[] = { 156static struct pmx_dev_mode pmx_uart1_modem_modes[] = {
157 { 157 {
158 .ids = AUTO_EXP_MODE, 158 .ids = AUTO_EXP_MODE,
159 .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK | 159 .mask = PMX_TIMER_1_2_MASK | PMX_TIMER_3_4_MASK |
@@ -165,42 +165,42 @@ struct pmx_dev_mode pmx_uart1_modem_modes[] = {
165 }, 165 },
166}; 166};
167 167
168struct pmx_dev pmx_uart1_modem = { 168struct pmx_dev spear320_pmx_uart1_modem = {
169 .name = "uart1_modem", 169 .name = "uart1_modem",
170 .modes = pmx_uart1_modem_modes, 170 .modes = pmx_uart1_modem_modes,
171 .mode_count = ARRAY_SIZE(pmx_uart1_modem_modes), 171 .mode_count = ARRAY_SIZE(pmx_uart1_modem_modes),
172 .enb_on_reset = 1, 172 .enb_on_reset = 1,
173}; 173};
174 174
175struct pmx_dev_mode pmx_uart2_modes[] = { 175static struct pmx_dev_mode pmx_uart2_modes[] = {
176 { 176 {
177 .ids = ALL_MODES, 177 .ids = ALL_MODES,
178 .mask = PMX_FIRDA_MASK, 178 .mask = PMX_FIRDA_MASK,
179 }, 179 },
180}; 180};
181 181
182struct pmx_dev pmx_uart2 = { 182struct pmx_dev spear320_pmx_uart2 = {
183 .name = "uart2", 183 .name = "uart2",
184 .modes = pmx_uart2_modes, 184 .modes = pmx_uart2_modes,
185 .mode_count = ARRAY_SIZE(pmx_uart2_modes), 185 .mode_count = ARRAY_SIZE(pmx_uart2_modes),
186 .enb_on_reset = 1, 186 .enb_on_reset = 1,
187}; 187};
188 188
189struct pmx_dev_mode pmx_touchscreen_modes[] = { 189static struct pmx_dev_mode pmx_touchscreen_modes[] = {
190 { 190 {
191 .ids = AUTO_NET_SMII_MODE, 191 .ids = AUTO_NET_SMII_MODE,
192 .mask = PMX_SSP_CS_MASK, 192 .mask = PMX_SSP_CS_MASK,
193 }, 193 },
194}; 194};
195 195
196struct pmx_dev pmx_touchscreen = { 196struct pmx_dev spear320_pmx_touchscreen = {
197 .name = "touchscreen", 197 .name = "touchscreen",
198 .modes = pmx_touchscreen_modes, 198 .modes = pmx_touchscreen_modes,
199 .mode_count = ARRAY_SIZE(pmx_touchscreen_modes), 199 .mode_count = ARRAY_SIZE(pmx_touchscreen_modes),
200 .enb_on_reset = 1, 200 .enb_on_reset = 1,
201}; 201};
202 202
203struct pmx_dev_mode pmx_can_modes[] = { 203static struct pmx_dev_mode pmx_can_modes[] = {
204 { 204 {
205 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | AUTO_EXP_MODE, 205 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE | AUTO_EXP_MODE,
206 .mask = PMX_GPIO_PIN2_MASK | PMX_GPIO_PIN3_MASK | 206 .mask = PMX_GPIO_PIN2_MASK | PMX_GPIO_PIN3_MASK |
@@ -208,28 +208,28 @@ struct pmx_dev_mode pmx_can_modes[] = {
208 }, 208 },
209}; 209};
210 210
211struct pmx_dev pmx_can = { 211struct pmx_dev spear320_pmx_can = {
212 .name = "can", 212 .name = "can",
213 .modes = pmx_can_modes, 213 .modes = pmx_can_modes,
214 .mode_count = ARRAY_SIZE(pmx_can_modes), 214 .mode_count = ARRAY_SIZE(pmx_can_modes),
215 .enb_on_reset = 1, 215 .enb_on_reset = 1,
216}; 216};
217 217
218struct pmx_dev_mode pmx_sdhci_led_modes[] = { 218static struct pmx_dev_mode pmx_sdhci_led_modes[] = {
219 { 219 {
220 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE, 220 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE,
221 .mask = PMX_SSP_CS_MASK, 221 .mask = PMX_SSP_CS_MASK,
222 }, 222 },
223}; 223};
224 224
225struct pmx_dev pmx_sdhci_led = { 225struct pmx_dev spear320_pmx_sdhci_led = {
226 .name = "sdhci_led", 226 .name = "sdhci_led",
227 .modes = pmx_sdhci_led_modes, 227 .modes = pmx_sdhci_led_modes,
228 .mode_count = ARRAY_SIZE(pmx_sdhci_led_modes), 228 .mode_count = ARRAY_SIZE(pmx_sdhci_led_modes),
229 .enb_on_reset = 1, 229 .enb_on_reset = 1,
230}; 230};
231 231
232struct pmx_dev_mode pmx_pwm0_modes[] = { 232static struct pmx_dev_mode pmx_pwm0_modes[] = {
233 { 233 {
234 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE, 234 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE,
235 .mask = PMX_UART0_MODEM_MASK, 235 .mask = PMX_UART0_MODEM_MASK,
@@ -239,14 +239,14 @@ struct pmx_dev_mode pmx_pwm0_modes[] = {
239 }, 239 },
240}; 240};
241 241
242struct pmx_dev pmx_pwm0 = { 242struct pmx_dev spear320_pmx_pwm0 = {
243 .name = "pwm0", 243 .name = "pwm0",
244 .modes = pmx_pwm0_modes, 244 .modes = pmx_pwm0_modes,
245 .mode_count = ARRAY_SIZE(pmx_pwm0_modes), 245 .mode_count = ARRAY_SIZE(pmx_pwm0_modes),
246 .enb_on_reset = 1, 246 .enb_on_reset = 1,
247}; 247};
248 248
249struct pmx_dev_mode pmx_pwm1_modes[] = { 249static struct pmx_dev_mode pmx_pwm1_modes[] = {
250 { 250 {
251 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE, 251 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE,
252 .mask = PMX_UART0_MODEM_MASK, 252 .mask = PMX_UART0_MODEM_MASK,
@@ -256,14 +256,14 @@ struct pmx_dev_mode pmx_pwm1_modes[] = {
256 }, 256 },
257}; 257};
258 258
259struct pmx_dev pmx_pwm1 = { 259struct pmx_dev spear320_pmx_pwm1 = {
260 .name = "pwm1", 260 .name = "pwm1",
261 .modes = pmx_pwm1_modes, 261 .modes = pmx_pwm1_modes,
262 .mode_count = ARRAY_SIZE(pmx_pwm1_modes), 262 .mode_count = ARRAY_SIZE(pmx_pwm1_modes),
263 .enb_on_reset = 1, 263 .enb_on_reset = 1,
264}; 264};
265 265
266struct pmx_dev_mode pmx_pwm2_modes[] = { 266static struct pmx_dev_mode pmx_pwm2_modes[] = {
267 { 267 {
268 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE, 268 .ids = AUTO_NET_SMII_MODE | AUTO_NET_MII_MODE,
269 .mask = PMX_SSP_CS_MASK, 269 .mask = PMX_SSP_CS_MASK,
@@ -273,105 +273,105 @@ struct pmx_dev_mode pmx_pwm2_modes[] = {
273 }, 273 },
274}; 274};
275 275
276struct pmx_dev pmx_pwm2 = { 276struct pmx_dev spear320_pmx_pwm2 = {
277 .name = "pwm2", 277 .name = "pwm2",
278 .modes = pmx_pwm2_modes, 278 .modes = pmx_pwm2_modes,
279 .mode_count = ARRAY_SIZE(pmx_pwm2_modes), 279 .mode_count = ARRAY_SIZE(pmx_pwm2_modes),
280 .enb_on_reset = 1, 280 .enb_on_reset = 1,
281}; 281};
282 282
283struct pmx_dev_mode pmx_pwm3_modes[] = { 283static struct pmx_dev_mode pmx_pwm3_modes[] = {
284 { 284 {
285 .ids = AUTO_EXP_MODE | SMALL_PRINTERS_MODE | AUTO_NET_SMII_MODE, 285 .ids = AUTO_EXP_MODE | SMALL_PRINTERS_MODE | AUTO_NET_SMII_MODE,
286 .mask = PMX_MII_MASK, 286 .mask = PMX_MII_MASK,
287 }, 287 },
288}; 288};
289 289
290struct pmx_dev pmx_pwm3 = { 290struct pmx_dev spear320_pmx_pwm3 = {
291 .name = "pwm3", 291 .name = "pwm3",
292 .modes = pmx_pwm3_modes, 292 .modes = pmx_pwm3_modes,
293 .mode_count = ARRAY_SIZE(pmx_pwm3_modes), 293 .mode_count = ARRAY_SIZE(pmx_pwm3_modes),
294 .enb_on_reset = 1, 294 .enb_on_reset = 1,
295}; 295};
296 296
297struct pmx_dev_mode pmx_ssp1_modes[] = { 297static struct pmx_dev_mode pmx_ssp1_modes[] = {
298 { 298 {
299 .ids = SMALL_PRINTERS_MODE | AUTO_NET_SMII_MODE, 299 .ids = SMALL_PRINTERS_MODE | AUTO_NET_SMII_MODE,
300 .mask = PMX_MII_MASK, 300 .mask = PMX_MII_MASK,
301 }, 301 },
302}; 302};
303 303
304struct pmx_dev pmx_ssp1 = { 304struct pmx_dev spear320_pmx_ssp1 = {
305 .name = "ssp1", 305 .name = "ssp1",
306 .modes = pmx_ssp1_modes, 306 .modes = pmx_ssp1_modes,
307 .mode_count = ARRAY_SIZE(pmx_ssp1_modes), 307 .mode_count = ARRAY_SIZE(pmx_ssp1_modes),
308 .enb_on_reset = 1, 308 .enb_on_reset = 1,
309}; 309};
310 310
311struct pmx_dev_mode pmx_ssp2_modes[] = { 311static struct pmx_dev_mode pmx_ssp2_modes[] = {
312 { 312 {
313 .ids = AUTO_NET_SMII_MODE, 313 .ids = AUTO_NET_SMII_MODE,
314 .mask = PMX_MII_MASK, 314 .mask = PMX_MII_MASK,
315 }, 315 },
316}; 316};
317 317
318struct pmx_dev pmx_ssp2 = { 318struct pmx_dev spear320_pmx_ssp2 = {
319 .name = "ssp2", 319 .name = "ssp2",
320 .modes = pmx_ssp2_modes, 320 .modes = pmx_ssp2_modes,
321 .mode_count = ARRAY_SIZE(pmx_ssp2_modes), 321 .mode_count = ARRAY_SIZE(pmx_ssp2_modes),
322 .enb_on_reset = 1, 322 .enb_on_reset = 1,
323}; 323};
324 324
325struct pmx_dev_mode pmx_mii1_modes[] = { 325static struct pmx_dev_mode pmx_mii1_modes[] = {
326 { 326 {
327 .ids = AUTO_NET_MII_MODE, 327 .ids = AUTO_NET_MII_MODE,
328 .mask = 0x0, 328 .mask = 0x0,
329 }, 329 },
330}; 330};
331 331
332struct pmx_dev pmx_mii1 = { 332struct pmx_dev spear320_pmx_mii1 = {
333 .name = "mii1", 333 .name = "mii1",
334 .modes = pmx_mii1_modes, 334 .modes = pmx_mii1_modes,
335 .mode_count = ARRAY_SIZE(pmx_mii1_modes), 335 .mode_count = ARRAY_SIZE(pmx_mii1_modes),
336 .enb_on_reset = 1, 336 .enb_on_reset = 1,
337}; 337};
338 338
339struct pmx_dev_mode pmx_smii0_modes[] = { 339static struct pmx_dev_mode pmx_smii0_modes[] = {
340 { 340 {
341 .ids = AUTO_NET_SMII_MODE | AUTO_EXP_MODE | SMALL_PRINTERS_MODE, 341 .ids = AUTO_NET_SMII_MODE | AUTO_EXP_MODE | SMALL_PRINTERS_MODE,
342 .mask = PMX_MII_MASK, 342 .mask = PMX_MII_MASK,
343 }, 343 },
344}; 344};
345 345
346struct pmx_dev pmx_smii0 = { 346struct pmx_dev spear320_pmx_smii0 = {
347 .name = "smii0", 347 .name = "smii0",
348 .modes = pmx_smii0_modes, 348 .modes = pmx_smii0_modes,
349 .mode_count = ARRAY_SIZE(pmx_smii0_modes), 349 .mode_count = ARRAY_SIZE(pmx_smii0_modes),
350 .enb_on_reset = 1, 350 .enb_on_reset = 1,
351}; 351};
352 352
353struct pmx_dev_mode pmx_smii1_modes[] = { 353static struct pmx_dev_mode pmx_smii1_modes[] = {
354 { 354 {
355 .ids = AUTO_NET_SMII_MODE | SMALL_PRINTERS_MODE, 355 .ids = AUTO_NET_SMII_MODE | SMALL_PRINTERS_MODE,
356 .mask = PMX_MII_MASK, 356 .mask = PMX_MII_MASK,
357 }, 357 },
358}; 358};
359 359
360struct pmx_dev pmx_smii1 = { 360struct pmx_dev spear320_pmx_smii1 = {
361 .name = "smii1", 361 .name = "smii1",
362 .modes = pmx_smii1_modes, 362 .modes = pmx_smii1_modes,
363 .mode_count = ARRAY_SIZE(pmx_smii1_modes), 363 .mode_count = ARRAY_SIZE(pmx_smii1_modes),
364 .enb_on_reset = 1, 364 .enb_on_reset = 1,
365}; 365};
366 366
367struct pmx_dev_mode pmx_i2c1_modes[] = { 367static struct pmx_dev_mode pmx_i2c1_modes[] = {
368 { 368 {
369 .ids = AUTO_EXP_MODE, 369 .ids = AUTO_EXP_MODE,
370 .mask = 0x0, 370 .mask = 0x0,
371 }, 371 },
372}; 372};
373 373
374struct pmx_dev pmx_i2c1 = { 374struct pmx_dev spear320_pmx_i2c1 = {
375 .name = "i2c1", 375 .name = "i2c1",
376 .modes = pmx_i2c1_modes, 376 .modes = pmx_i2c1_modes,
377 .mode_count = ARRAY_SIZE(pmx_i2c1_modes), 377 .mode_count = ARRAY_SIZE(pmx_i2c1_modes),
@@ -379,131 +379,131 @@ struct pmx_dev pmx_i2c1 = {
379}; 379};
380 380
381/* pmx driver structure */ 381/* pmx driver structure */
382struct pmx_driver pmx_driver = { 382static struct pmx_driver pmx_driver = {
383 .mode_reg = {.offset = MODE_CONFIG_REG, .mask = 0x00000007}, 383 .mode_reg = {.offset = MODE_CONFIG_REG, .mask = 0x00000007},
384 .mux_reg = {.offset = PAD_MUX_CONFIG_REG, .mask = 0x00007fff}, 384 .mux_reg = {.offset = PAD_MUX_CONFIG_REG, .mask = 0x00007fff},
385}; 385};
386 386
387/* spear3xx shared irq */ 387/* spear3xx shared irq */
388struct shirq_dev_config shirq_ras1_config[] = { 388static struct shirq_dev_config shirq_ras1_config[] = {
389 { 389 {
390 .virq = VIRQ_EMI, 390 .virq = SPEAR320_VIRQ_EMI,
391 .status_mask = EMI_IRQ_MASK, 391 .status_mask = SPEAR320_EMI_IRQ_MASK,
392 .clear_mask = EMI_IRQ_MASK, 392 .clear_mask = SPEAR320_EMI_IRQ_MASK,
393 }, { 393 }, {
394 .virq = VIRQ_CLCD, 394 .virq = SPEAR320_VIRQ_CLCD,
395 .status_mask = CLCD_IRQ_MASK, 395 .status_mask = SPEAR320_CLCD_IRQ_MASK,
396 .clear_mask = CLCD_IRQ_MASK, 396 .clear_mask = SPEAR320_CLCD_IRQ_MASK,
397 }, { 397 }, {
398 .virq = VIRQ_SPP, 398 .virq = SPEAR320_VIRQ_SPP,
399 .status_mask = SPP_IRQ_MASK, 399 .status_mask = SPEAR320_SPP_IRQ_MASK,
400 .clear_mask = SPP_IRQ_MASK, 400 .clear_mask = SPEAR320_SPP_IRQ_MASK,
401 }, 401 },
402}; 402};
403 403
404struct spear_shirq shirq_ras1 = { 404static struct spear_shirq shirq_ras1 = {
405 .irq = IRQ_GEN_RAS_1, 405 .irq = SPEAR3XX_IRQ_GEN_RAS_1,
406 .dev_config = shirq_ras1_config, 406 .dev_config = shirq_ras1_config,
407 .dev_count = ARRAY_SIZE(shirq_ras1_config), 407 .dev_count = ARRAY_SIZE(shirq_ras1_config),
408 .regs = { 408 .regs = {
409 .enb_reg = -1, 409 .enb_reg = -1,
410 .status_reg = INT_STS_MASK_REG, 410 .status_reg = SPEAR320_INT_STS_MASK_REG,
411 .status_reg_mask = SHIRQ_RAS1_MASK, 411 .status_reg_mask = SPEAR320_SHIRQ_RAS1_MASK,
412 .clear_reg = INT_CLR_MASK_REG, 412 .clear_reg = SPEAR320_INT_CLR_MASK_REG,
413 .reset_to_clear = 1, 413 .reset_to_clear = 1,
414 }, 414 },
415}; 415};
416 416
417struct shirq_dev_config shirq_ras3_config[] = { 417static struct shirq_dev_config shirq_ras3_config[] = {
418 { 418 {
419 .virq = VIRQ_PLGPIO, 419 .virq = SPEAR320_VIRQ_PLGPIO,
420 .enb_mask = GPIO_IRQ_MASK, 420 .enb_mask = SPEAR320_GPIO_IRQ_MASK,
421 .status_mask = GPIO_IRQ_MASK, 421 .status_mask = SPEAR320_GPIO_IRQ_MASK,
422 .clear_mask = GPIO_IRQ_MASK, 422 .clear_mask = SPEAR320_GPIO_IRQ_MASK,
423 }, { 423 }, {
424 .virq = VIRQ_I2S_PLAY, 424 .virq = SPEAR320_VIRQ_I2S_PLAY,
425 .enb_mask = I2S_PLAY_IRQ_MASK, 425 .enb_mask = SPEAR320_I2S_PLAY_IRQ_MASK,
426 .status_mask = I2S_PLAY_IRQ_MASK, 426 .status_mask = SPEAR320_I2S_PLAY_IRQ_MASK,
427 .clear_mask = I2S_PLAY_IRQ_MASK, 427 .clear_mask = SPEAR320_I2S_PLAY_IRQ_MASK,
428 }, { 428 }, {
429 .virq = VIRQ_I2S_REC, 429 .virq = SPEAR320_VIRQ_I2S_REC,
430 .enb_mask = I2S_REC_IRQ_MASK, 430 .enb_mask = SPEAR320_I2S_REC_IRQ_MASK,
431 .status_mask = I2S_REC_IRQ_MASK, 431 .status_mask = SPEAR320_I2S_REC_IRQ_MASK,
432 .clear_mask = I2S_REC_IRQ_MASK, 432 .clear_mask = SPEAR320_I2S_REC_IRQ_MASK,
433 }, 433 },
434}; 434};
435 435
436struct spear_shirq shirq_ras3 = { 436static struct spear_shirq shirq_ras3 = {
437 .irq = IRQ_GEN_RAS_3, 437 .irq = SPEAR3XX_IRQ_GEN_RAS_3,
438 .dev_config = shirq_ras3_config, 438 .dev_config = shirq_ras3_config,
439 .dev_count = ARRAY_SIZE(shirq_ras3_config), 439 .dev_count = ARRAY_SIZE(shirq_ras3_config),
440 .regs = { 440 .regs = {
441 .enb_reg = INT_ENB_MASK_REG, 441 .enb_reg = SPEAR320_INT_ENB_MASK_REG,
442 .reset_to_enb = 1, 442 .reset_to_enb = 1,
443 .status_reg = INT_STS_MASK_REG, 443 .status_reg = SPEAR320_INT_STS_MASK_REG,
444 .status_reg_mask = SHIRQ_RAS3_MASK, 444 .status_reg_mask = SPEAR320_SHIRQ_RAS3_MASK,
445 .clear_reg = INT_CLR_MASK_REG, 445 .clear_reg = SPEAR320_INT_CLR_MASK_REG,
446 .reset_to_clear = 1, 446 .reset_to_clear = 1,
447 }, 447 },
448}; 448};
449 449
450struct shirq_dev_config shirq_intrcomm_ras_config[] = { 450static struct shirq_dev_config shirq_intrcomm_ras_config[] = {
451 { 451 {
452 .virq = VIRQ_CANU, 452 .virq = SPEAR320_VIRQ_CANU,
453 .status_mask = CAN_U_IRQ_MASK, 453 .status_mask = SPEAR320_CAN_U_IRQ_MASK,
454 .clear_mask = CAN_U_IRQ_MASK, 454 .clear_mask = SPEAR320_CAN_U_IRQ_MASK,
455 }, { 455 }, {
456 .virq = VIRQ_CANL, 456 .virq = SPEAR320_VIRQ_CANL,
457 .status_mask = CAN_L_IRQ_MASK, 457 .status_mask = SPEAR320_CAN_L_IRQ_MASK,
458 .clear_mask = CAN_L_IRQ_MASK, 458 .clear_mask = SPEAR320_CAN_L_IRQ_MASK,
459 }, { 459 }, {
460 .virq = VIRQ_UART1, 460 .virq = SPEAR320_VIRQ_UART1,
461 .status_mask = UART1_IRQ_MASK, 461 .status_mask = SPEAR320_UART1_IRQ_MASK,
462 .clear_mask = UART1_IRQ_MASK, 462 .clear_mask = SPEAR320_UART1_IRQ_MASK,
463 }, { 463 }, {
464 .virq = VIRQ_UART2, 464 .virq = SPEAR320_VIRQ_UART2,
465 .status_mask = UART2_IRQ_MASK, 465 .status_mask = SPEAR320_UART2_IRQ_MASK,
466 .clear_mask = UART2_IRQ_MASK, 466 .clear_mask = SPEAR320_UART2_IRQ_MASK,
467 }, { 467 }, {
468 .virq = VIRQ_SSP1, 468 .virq = SPEAR320_VIRQ_SSP1,
469 .status_mask = SSP1_IRQ_MASK, 469 .status_mask = SPEAR320_SSP1_IRQ_MASK,
470 .clear_mask = SSP1_IRQ_MASK, 470 .clear_mask = SPEAR320_SSP1_IRQ_MASK,
471 }, { 471 }, {
472 .virq = VIRQ_SSP2, 472 .virq = SPEAR320_VIRQ_SSP2,
473 .status_mask = SSP2_IRQ_MASK, 473 .status_mask = SPEAR320_SSP2_IRQ_MASK,
474 .clear_mask = SSP2_IRQ_MASK, 474 .clear_mask = SPEAR320_SSP2_IRQ_MASK,
475 }, { 475 }, {
476 .virq = VIRQ_SMII0, 476 .virq = SPEAR320_VIRQ_SMII0,
477 .status_mask = SMII0_IRQ_MASK, 477 .status_mask = SPEAR320_SMII0_IRQ_MASK,
478 .clear_mask = SMII0_IRQ_MASK, 478 .clear_mask = SPEAR320_SMII0_IRQ_MASK,
479 }, { 479 }, {
480 .virq = VIRQ_MII1_SMII1, 480 .virq = SPEAR320_VIRQ_MII1_SMII1,
481 .status_mask = MII1_SMII1_IRQ_MASK, 481 .status_mask = SPEAR320_MII1_SMII1_IRQ_MASK,
482 .clear_mask = MII1_SMII1_IRQ_MASK, 482 .clear_mask = SPEAR320_MII1_SMII1_IRQ_MASK,
483 }, { 483 }, {
484 .virq = VIRQ_WAKEUP_SMII0, 484 .virq = SPEAR320_VIRQ_WAKEUP_SMII0,
485 .status_mask = WAKEUP_SMII0_IRQ_MASK, 485 .status_mask = SPEAR320_WAKEUP_SMII0_IRQ_MASK,
486 .clear_mask = WAKEUP_SMII0_IRQ_MASK, 486 .clear_mask = SPEAR320_WAKEUP_SMII0_IRQ_MASK,
487 }, { 487 }, {
488 .virq = VIRQ_WAKEUP_MII1_SMII1, 488 .virq = SPEAR320_VIRQ_WAKEUP_MII1_SMII1,
489 .status_mask = WAKEUP_MII1_SMII1_IRQ_MASK, 489 .status_mask = SPEAR320_WAKEUP_MII1_SMII1_IRQ_MASK,
490 .clear_mask = WAKEUP_MII1_SMII1_IRQ_MASK, 490 .clear_mask = SPEAR320_WAKEUP_MII1_SMII1_IRQ_MASK,
491 }, { 491 }, {
492 .virq = VIRQ_I2C, 492 .virq = SPEAR320_VIRQ_I2C1,
493 .status_mask = I2C1_IRQ_MASK, 493 .status_mask = SPEAR320_I2C1_IRQ_MASK,
494 .clear_mask = I2C1_IRQ_MASK, 494 .clear_mask = SPEAR320_I2C1_IRQ_MASK,
495 }, 495 },
496}; 496};
497 497
498struct spear_shirq shirq_intrcomm_ras = { 498static struct spear_shirq shirq_intrcomm_ras = {
499 .irq = IRQ_INTRCOMM_RAS_ARM, 499 .irq = SPEAR3XX_IRQ_INTRCOMM_RAS_ARM,
500 .dev_config = shirq_intrcomm_ras_config, 500 .dev_config = shirq_intrcomm_ras_config,
501 .dev_count = ARRAY_SIZE(shirq_intrcomm_ras_config), 501 .dev_count = ARRAY_SIZE(shirq_intrcomm_ras_config),
502 .regs = { 502 .regs = {
503 .enb_reg = -1, 503 .enb_reg = -1,
504 .status_reg = INT_STS_MASK_REG, 504 .status_reg = SPEAR320_INT_STS_MASK_REG,
505 .status_reg_mask = SHIRQ_INTRCOMM_RAS_MASK, 505 .status_reg_mask = SPEAR320_SHIRQ_INTRCOMM_RAS_MASK,
506 .clear_reg = INT_CLR_MASK_REG, 506 .clear_reg = SPEAR320_INT_CLR_MASK_REG,
507 .reset_to_clear = 1, 507 .reset_to_clear = 1,
508 }, 508 },
509}; 509};
@@ -511,7 +511,8 @@ struct spear_shirq shirq_intrcomm_ras = {
511/* Add spear320 specific devices here */ 511/* Add spear320 specific devices here */
512 512
513/* spear320 routines */ 513/* spear320 routines */
514void __init spear320_init(void) 514void __init spear320_init(struct pmx_mode *pmx_mode, struct pmx_dev **pmx_devs,
515 u8 pmx_dev_count)
515{ 516{
516 void __iomem *base; 517 void __iomem *base;
517 int ret = 0; 518 int ret = 0;
@@ -543,6 +544,10 @@ void __init spear320_init(void)
543 544
544 /* pmx initialization */ 545 /* pmx initialization */
545 pmx_driver.base = base; 546 pmx_driver.base = base;
547 pmx_driver.mode = pmx_mode;
548 pmx_driver.devs = pmx_devs;
549 pmx_driver.devs_count = pmx_dev_count;
550
546 ret = pmx_register(&pmx_driver); 551 ret = pmx_register(&pmx_driver);
547 if (ret) 552 if (ret)
548 printk(KERN_ERR "padmux: registeration failed. err no: %d\n", 553 printk(KERN_ERR "padmux: registeration failed. err no: %d\n",
diff --git a/arch/arm/mach-spear3xx/spear320_evb.c b/arch/arm/mach-spear3xx/spear320_evb.c
index 8213e4b66c14..a12b353940d6 100644
--- a/arch/arm/mach-spear3xx/spear320_evb.c
+++ b/arch/arm/mach-spear3xx/spear320_evb.c
@@ -19,28 +19,28 @@
19/* padmux devices to enable */ 19/* padmux devices to enable */
20static struct pmx_dev *pmx_devs[] = { 20static struct pmx_dev *pmx_devs[] = {
21 /* spear3xx specific devices */ 21 /* spear3xx specific devices */
22 &pmx_i2c, 22 &spear3xx_pmx_i2c,
23 &pmx_ssp, 23 &spear3xx_pmx_ssp,
24 &pmx_mii, 24 &spear3xx_pmx_mii,
25 &pmx_uart0, 25 &spear3xx_pmx_uart0,
26 26
27 /* spear320 specific devices */ 27 /* spear320 specific devices */
28 &pmx_fsmc, 28 &spear320_pmx_fsmc,
29 &pmx_sdhci, 29 &spear320_pmx_sdhci,
30 &pmx_i2s, 30 &spear320_pmx_i2s,
31 &pmx_uart1, 31 &spear320_pmx_uart1,
32 &pmx_uart2, 32 &spear320_pmx_uart2,
33 &pmx_can, 33 &spear320_pmx_can,
34 &pmx_pwm0, 34 &spear320_pmx_pwm0,
35 &pmx_pwm1, 35 &spear320_pmx_pwm1,
36 &pmx_pwm2, 36 &spear320_pmx_pwm2,
37 &pmx_mii1, 37 &spear320_pmx_mii1,
38}; 38};
39 39
40static struct amba_device *amba_devs[] __initdata = { 40static struct amba_device *amba_devs[] __initdata = {
41 /* spear3xx specific devices */ 41 /* spear3xx specific devices */
42 &gpio_device, 42 &spear3xx_gpio_device,
43 &uart_device, 43 &spear3xx_uart_device,
44 44
45 /* spear320 specific devices */ 45 /* spear320 specific devices */
46}; 46};
@@ -55,13 +55,9 @@ static void __init spear320_evb_init(void)
55{ 55{
56 unsigned int i; 56 unsigned int i;
57 57
58 /* padmux initialization, must be done before spear320_init */
59 pmx_driver.mode = &auto_net_mii_mode;
60 pmx_driver.devs = pmx_devs;
61 pmx_driver.devs_count = ARRAY_SIZE(pmx_devs);
62
63 /* call spear320 machine init function */ 58 /* call spear320 machine init function */
64 spear320_init(); 59 spear320_init(&spear320_auto_net_mii_mode, pmx_devs,
60 ARRAY_SIZE(pmx_devs));
65 61
66 /* Add Platform Devices */ 62 /* Add Platform Devices */
67 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs)); 63 platform_add_devices(plat_devs, ARRAY_SIZE(plat_devs));
diff --git a/arch/arm/mach-spear3xx/spear3xx.c b/arch/arm/mach-spear3xx/spear3xx.c
index d3ba8ca1bc59..10af45da86a0 100644
--- a/arch/arm/mach-spear3xx/spear3xx.c
+++ b/arch/arm/mach-spear3xx/spear3xx.c
@@ -25,10 +25,10 @@
25/* gpio device registration */ 25/* gpio device registration */
26static struct pl061_platform_data gpio_plat_data = { 26static struct pl061_platform_data gpio_plat_data = {
27 .gpio_base = 0, 27 .gpio_base = 0,
28 .irq_base = SPEAR_GPIO_INT_BASE, 28 .irq_base = SPEAR3XX_GPIO_INT_BASE,
29}; 29};
30 30
31struct amba_device gpio_device = { 31struct amba_device spear3xx_gpio_device = {
32 .dev = { 32 .dev = {
33 .init_name = "gpio", 33 .init_name = "gpio",
34 .platform_data = &gpio_plat_data, 34 .platform_data = &gpio_plat_data,
@@ -38,11 +38,11 @@ struct amba_device gpio_device = {
38 .end = SPEAR3XX_ICM3_GPIO_BASE + SZ_4K - 1, 38 .end = SPEAR3XX_ICM3_GPIO_BASE + SZ_4K - 1,
39 .flags = IORESOURCE_MEM, 39 .flags = IORESOURCE_MEM,
40 }, 40 },
41 .irq = {IRQ_BASIC_GPIO, NO_IRQ}, 41 .irq = {SPEAR3XX_IRQ_BASIC_GPIO, NO_IRQ},
42}; 42};
43 43
44/* uart device registration */ 44/* uart device registration */
45struct amba_device uart_device = { 45struct amba_device spear3xx_uart_device = {
46 .dev = { 46 .dev = {
47 .init_name = "uart", 47 .init_name = "uart",
48 }, 48 },
@@ -51,7 +51,7 @@ struct amba_device uart_device = {
51 .end = SPEAR3XX_ICM1_UART_BASE + SZ_4K - 1, 51 .end = SPEAR3XX_ICM1_UART_BASE + SZ_4K - 1,
52 .flags = IORESOURCE_MEM, 52 .flags = IORESOURCE_MEM,
53 }, 53 },
54 .irq = {IRQ_UART, NO_IRQ}, 54 .irq = {SPEAR3XX_IRQ_UART, NO_IRQ},
55}; 55};
56 56
57/* Do spear3xx familiy common initialization part here */ 57/* Do spear3xx familiy common initialization part here */
@@ -97,215 +97,215 @@ void __init spear3xx_map_io(void)
97 iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc)); 97 iotable_init(spear3xx_io_desc, ARRAY_SIZE(spear3xx_io_desc));
98 98
99 /* This will initialize clock framework */ 99 /* This will initialize clock framework */
100 clk_init(); 100 spear3xx_clk_init();
101} 101}
102 102
103/* pad multiplexing support */ 103/* pad multiplexing support */
104/* devices */ 104/* devices */
105struct pmx_dev_mode pmx_firda_modes[] = { 105static struct pmx_dev_mode pmx_firda_modes[] = {
106 { 106 {
107 .ids = 0xffffffff, 107 .ids = 0xffffffff,
108 .mask = PMX_FIRDA_MASK, 108 .mask = PMX_FIRDA_MASK,
109 }, 109 },
110}; 110};
111 111
112struct pmx_dev pmx_firda = { 112struct pmx_dev spear3xx_pmx_firda = {
113 .name = "firda", 113 .name = "firda",
114 .modes = pmx_firda_modes, 114 .modes = pmx_firda_modes,
115 .mode_count = ARRAY_SIZE(pmx_firda_modes), 115 .mode_count = ARRAY_SIZE(pmx_firda_modes),
116 .enb_on_reset = 0, 116 .enb_on_reset = 0,
117}; 117};
118 118
119struct pmx_dev_mode pmx_i2c_modes[] = { 119static struct pmx_dev_mode pmx_i2c_modes[] = {
120 { 120 {
121 .ids = 0xffffffff, 121 .ids = 0xffffffff,
122 .mask = PMX_I2C_MASK, 122 .mask = PMX_I2C_MASK,
123 }, 123 },
124}; 124};
125 125
126struct pmx_dev pmx_i2c = { 126struct pmx_dev spear3xx_pmx_i2c = {
127 .name = "i2c", 127 .name = "i2c",
128 .modes = pmx_i2c_modes, 128 .modes = pmx_i2c_modes,
129 .mode_count = ARRAY_SIZE(pmx_i2c_modes), 129 .mode_count = ARRAY_SIZE(pmx_i2c_modes),
130 .enb_on_reset = 0, 130 .enb_on_reset = 0,
131}; 131};
132 132
133struct pmx_dev_mode pmx_ssp_cs_modes[] = { 133static struct pmx_dev_mode pmx_ssp_cs_modes[] = {
134 { 134 {
135 .ids = 0xffffffff, 135 .ids = 0xffffffff,
136 .mask = PMX_SSP_CS_MASK, 136 .mask = PMX_SSP_CS_MASK,
137 }, 137 },
138}; 138};
139 139
140struct pmx_dev pmx_ssp_cs = { 140struct pmx_dev spear3xx_pmx_ssp_cs = {
141 .name = "ssp_chip_selects", 141 .name = "ssp_chip_selects",
142 .modes = pmx_ssp_cs_modes, 142 .modes = pmx_ssp_cs_modes,
143 .mode_count = ARRAY_SIZE(pmx_ssp_cs_modes), 143 .mode_count = ARRAY_SIZE(pmx_ssp_cs_modes),
144 .enb_on_reset = 0, 144 .enb_on_reset = 0,
145}; 145};
146 146
147struct pmx_dev_mode pmx_ssp_modes[] = { 147static struct pmx_dev_mode pmx_ssp_modes[] = {
148 { 148 {
149 .ids = 0xffffffff, 149 .ids = 0xffffffff,
150 .mask = PMX_SSP_MASK, 150 .mask = PMX_SSP_MASK,
151 }, 151 },
152}; 152};
153 153
154struct pmx_dev pmx_ssp = { 154struct pmx_dev spear3xx_pmx_ssp = {
155 .name = "ssp", 155 .name = "ssp",
156 .modes = pmx_ssp_modes, 156 .modes = pmx_ssp_modes,
157 .mode_count = ARRAY_SIZE(pmx_ssp_modes), 157 .mode_count = ARRAY_SIZE(pmx_ssp_modes),
158 .enb_on_reset = 0, 158 .enb_on_reset = 0,
159}; 159};
160 160
161struct pmx_dev_mode pmx_mii_modes[] = { 161static struct pmx_dev_mode pmx_mii_modes[] = {
162 { 162 {
163 .ids = 0xffffffff, 163 .ids = 0xffffffff,
164 .mask = PMX_MII_MASK, 164 .mask = PMX_MII_MASK,
165 }, 165 },
166}; 166};
167 167
168struct pmx_dev pmx_mii = { 168struct pmx_dev spear3xx_pmx_mii = {
169 .name = "mii", 169 .name = "mii",
170 .modes = pmx_mii_modes, 170 .modes = pmx_mii_modes,
171 .mode_count = ARRAY_SIZE(pmx_mii_modes), 171 .mode_count = ARRAY_SIZE(pmx_mii_modes),
172 .enb_on_reset = 0, 172 .enb_on_reset = 0,
173}; 173};
174 174
175struct pmx_dev_mode pmx_gpio_pin0_modes[] = { 175static struct pmx_dev_mode pmx_gpio_pin0_modes[] = {
176 { 176 {
177 .ids = 0xffffffff, 177 .ids = 0xffffffff,
178 .mask = PMX_GPIO_PIN0_MASK, 178 .mask = PMX_GPIO_PIN0_MASK,
179 }, 179 },
180}; 180};
181 181
182struct pmx_dev pmx_gpio_pin0 = { 182struct pmx_dev spear3xx_pmx_gpio_pin0 = {
183 .name = "gpio_pin0", 183 .name = "gpio_pin0",
184 .modes = pmx_gpio_pin0_modes, 184 .modes = pmx_gpio_pin0_modes,
185 .mode_count = ARRAY_SIZE(pmx_gpio_pin0_modes), 185 .mode_count = ARRAY_SIZE(pmx_gpio_pin0_modes),
186 .enb_on_reset = 0, 186 .enb_on_reset = 0,
187}; 187};
188 188
189struct pmx_dev_mode pmx_gpio_pin1_modes[] = { 189static struct pmx_dev_mode pmx_gpio_pin1_modes[] = {
190 { 190 {
191 .ids = 0xffffffff, 191 .ids = 0xffffffff,
192 .mask = PMX_GPIO_PIN1_MASK, 192 .mask = PMX_GPIO_PIN1_MASK,
193 }, 193 },
194}; 194};
195 195
196struct pmx_dev pmx_gpio_pin1 = { 196struct pmx_dev spear3xx_pmx_gpio_pin1 = {
197 .name = "gpio_pin1", 197 .name = "gpio_pin1",
198 .modes = pmx_gpio_pin1_modes, 198 .modes = pmx_gpio_pin1_modes,
199 .mode_count = ARRAY_SIZE(pmx_gpio_pin1_modes), 199 .mode_count = ARRAY_SIZE(pmx_gpio_pin1_modes),
200 .enb_on_reset = 0, 200 .enb_on_reset = 0,
201}; 201};
202 202
203struct pmx_dev_mode pmx_gpio_pin2_modes[] = { 203static struct pmx_dev_mode pmx_gpio_pin2_modes[] = {
204 { 204 {
205 .ids = 0xffffffff, 205 .ids = 0xffffffff,
206 .mask = PMX_GPIO_PIN2_MASK, 206 .mask = PMX_GPIO_PIN2_MASK,
207 }, 207 },
208}; 208};
209 209
210struct pmx_dev pmx_gpio_pin2 = { 210struct pmx_dev spear3xx_pmx_gpio_pin2 = {
211 .name = "gpio_pin2", 211 .name = "gpio_pin2",
212 .modes = pmx_gpio_pin2_modes, 212 .modes = pmx_gpio_pin2_modes,
213 .mode_count = ARRAY_SIZE(pmx_gpio_pin2_modes), 213 .mode_count = ARRAY_SIZE(pmx_gpio_pin2_modes),
214 .enb_on_reset = 0, 214 .enb_on_reset = 0,
215}; 215};
216 216
217struct pmx_dev_mode pmx_gpio_pin3_modes[] = { 217static struct pmx_dev_mode pmx_gpio_pin3_modes[] = {
218 { 218 {
219 .ids = 0xffffffff, 219 .ids = 0xffffffff,
220 .mask = PMX_GPIO_PIN3_MASK, 220 .mask = PMX_GPIO_PIN3_MASK,
221 }, 221 },
222}; 222};
223 223
224struct pmx_dev pmx_gpio_pin3 = { 224struct pmx_dev spear3xx_pmx_gpio_pin3 = {
225 .name = "gpio_pin3", 225 .name = "gpio_pin3",
226 .modes = pmx_gpio_pin3_modes, 226 .modes = pmx_gpio_pin3_modes,
227 .mode_count = ARRAY_SIZE(pmx_gpio_pin3_modes), 227 .mode_count = ARRAY_SIZE(pmx_gpio_pin3_modes),
228 .enb_on_reset = 0, 228 .enb_on_reset = 0,
229}; 229};
230 230
231struct pmx_dev_mode pmx_gpio_pin4_modes[] = { 231static struct pmx_dev_mode pmx_gpio_pin4_modes[] = {
232 { 232 {
233 .ids = 0xffffffff, 233 .ids = 0xffffffff,
234 .mask = PMX_GPIO_PIN4_MASK, 234 .mask = PMX_GPIO_PIN4_MASK,
235 }, 235 },
236}; 236};
237 237
238struct pmx_dev pmx_gpio_pin4 = { 238struct pmx_dev spear3xx_pmx_gpio_pin4 = {
239 .name = "gpio_pin4", 239 .name = "gpio_pin4",
240 .modes = pmx_gpio_pin4_modes, 240 .modes = pmx_gpio_pin4_modes,
241 .mode_count = ARRAY_SIZE(pmx_gpio_pin4_modes), 241 .mode_count = ARRAY_SIZE(pmx_gpio_pin4_modes),
242 .enb_on_reset = 0, 242 .enb_on_reset = 0,
243}; 243};
244 244
245struct pmx_dev_mode pmx_gpio_pin5_modes[] = { 245static struct pmx_dev_mode pmx_gpio_pin5_modes[] = {
246 { 246 {
247 .ids = 0xffffffff, 247 .ids = 0xffffffff,
248 .mask = PMX_GPIO_PIN5_MASK, 248 .mask = PMX_GPIO_PIN5_MASK,
249 }, 249 },
250}; 250};
251 251
252struct pmx_dev pmx_gpio_pin5 = { 252struct pmx_dev spear3xx_pmx_gpio_pin5 = {
253 .name = "gpio_pin5", 253 .name = "gpio_pin5",
254 .modes = pmx_gpio_pin5_modes, 254 .modes = pmx_gpio_pin5_modes,
255 .mode_count = ARRAY_SIZE(pmx_gpio_pin5_modes), 255 .mode_count = ARRAY_SIZE(pmx_gpio_pin5_modes),
256 .enb_on_reset = 0, 256 .enb_on_reset = 0,
257}; 257};
258 258
259struct pmx_dev_mode pmx_uart0_modem_modes[] = { 259static struct pmx_dev_mode pmx_uart0_modem_modes[] = {
260 { 260 {
261 .ids = 0xffffffff, 261 .ids = 0xffffffff,
262 .mask = PMX_UART0_MODEM_MASK, 262 .mask = PMX_UART0_MODEM_MASK,
263 }, 263 },
264}; 264};
265 265
266struct pmx_dev pmx_uart0_modem = { 266struct pmx_dev spear3xx_pmx_uart0_modem = {
267 .name = "uart0_modem", 267 .name = "uart0_modem",
268 .modes = pmx_uart0_modem_modes, 268 .modes = pmx_uart0_modem_modes,
269 .mode_count = ARRAY_SIZE(pmx_uart0_modem_modes), 269 .mode_count = ARRAY_SIZE(pmx_uart0_modem_modes),
270 .enb_on_reset = 0, 270 .enb_on_reset = 0,
271}; 271};
272 272
273struct pmx_dev_mode pmx_uart0_modes[] = { 273static struct pmx_dev_mode pmx_uart0_modes[] = {
274 { 274 {
275 .ids = 0xffffffff, 275 .ids = 0xffffffff,
276 .mask = PMX_UART0_MASK, 276 .mask = PMX_UART0_MASK,
277 }, 277 },
278}; 278};
279 279
280struct pmx_dev pmx_uart0 = { 280struct pmx_dev spear3xx_pmx_uart0 = {
281 .name = "uart0", 281 .name = "uart0",
282 .modes = pmx_uart0_modes, 282 .modes = pmx_uart0_modes,
283 .mode_count = ARRAY_SIZE(pmx_uart0_modes), 283 .mode_count = ARRAY_SIZE(pmx_uart0_modes),
284 .enb_on_reset = 0, 284 .enb_on_reset = 0,
285}; 285};
286 286
287struct pmx_dev_mode pmx_timer_3_4_modes[] = { 287static struct pmx_dev_mode pmx_timer_3_4_modes[] = {
288 { 288 {
289 .ids = 0xffffffff, 289 .ids = 0xffffffff,
290 .mask = PMX_TIMER_3_4_MASK, 290 .mask = PMX_TIMER_3_4_MASK,
291 }, 291 },
292}; 292};
293 293
294struct pmx_dev pmx_timer_3_4 = { 294struct pmx_dev spear3xx_pmx_timer_3_4 = {
295 .name = "timer_3_4", 295 .name = "timer_3_4",
296 .modes = pmx_timer_3_4_modes, 296 .modes = pmx_timer_3_4_modes,
297 .mode_count = ARRAY_SIZE(pmx_timer_3_4_modes), 297 .mode_count = ARRAY_SIZE(pmx_timer_3_4_modes),
298 .enb_on_reset = 0, 298 .enb_on_reset = 0,
299}; 299};
300 300
301struct pmx_dev_mode pmx_timer_1_2_modes[] = { 301static struct pmx_dev_mode pmx_timer_1_2_modes[] = {
302 { 302 {
303 .ids = 0xffffffff, 303 .ids = 0xffffffff,
304 .mask = PMX_TIMER_1_2_MASK, 304 .mask = PMX_TIMER_1_2_MASK,
305 }, 305 },
306}; 306};
307 307
308struct pmx_dev pmx_timer_1_2 = { 308struct pmx_dev spear3xx_pmx_timer_1_2 = {
309 .name = "timer_1_2", 309 .name = "timer_1_2",
310 .modes = pmx_timer_1_2_modes, 310 .modes = pmx_timer_1_2_modes,
311 .mode_count = ARRAY_SIZE(pmx_timer_1_2_modes), 311 .mode_count = ARRAY_SIZE(pmx_timer_1_2_modes),
@@ -314,210 +314,210 @@ struct pmx_dev pmx_timer_1_2 = {
314 314
315#if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320) 315#if defined(CONFIG_MACH_SPEAR310) || defined(CONFIG_MACH_SPEAR320)
316/* plgpios devices */ 316/* plgpios devices */
317struct pmx_dev_mode pmx_plgpio_0_1_modes[] = { 317static struct pmx_dev_mode pmx_plgpio_0_1_modes[] = {
318 { 318 {
319 .ids = 0x00, 319 .ids = 0x00,
320 .mask = PMX_FIRDA_MASK, 320 .mask = PMX_FIRDA_MASK,
321 }, 321 },
322}; 322};
323 323
324struct pmx_dev pmx_plgpio_0_1 = { 324struct pmx_dev spear3xx_pmx_plgpio_0_1 = {
325 .name = "plgpio 0 and 1", 325 .name = "plgpio 0 and 1",
326 .modes = pmx_plgpio_0_1_modes, 326 .modes = pmx_plgpio_0_1_modes,
327 .mode_count = ARRAY_SIZE(pmx_plgpio_0_1_modes), 327 .mode_count = ARRAY_SIZE(pmx_plgpio_0_1_modes),
328 .enb_on_reset = 1, 328 .enb_on_reset = 1,
329}; 329};
330 330
331struct pmx_dev_mode pmx_plgpio_2_3_modes[] = { 331static struct pmx_dev_mode pmx_plgpio_2_3_modes[] = {
332 { 332 {
333 .ids = 0x00, 333 .ids = 0x00,
334 .mask = PMX_UART0_MASK, 334 .mask = PMX_UART0_MASK,
335 }, 335 },
336}; 336};
337 337
338struct pmx_dev pmx_plgpio_2_3 = { 338struct pmx_dev spear3xx_pmx_plgpio_2_3 = {
339 .name = "plgpio 2 and 3", 339 .name = "plgpio 2 and 3",
340 .modes = pmx_plgpio_2_3_modes, 340 .modes = pmx_plgpio_2_3_modes,
341 .mode_count = ARRAY_SIZE(pmx_plgpio_2_3_modes), 341 .mode_count = ARRAY_SIZE(pmx_plgpio_2_3_modes),
342 .enb_on_reset = 1, 342 .enb_on_reset = 1,
343}; 343};
344 344
345struct pmx_dev_mode pmx_plgpio_4_5_modes[] = { 345static struct pmx_dev_mode pmx_plgpio_4_5_modes[] = {
346 { 346 {
347 .ids = 0x00, 347 .ids = 0x00,
348 .mask = PMX_I2C_MASK, 348 .mask = PMX_I2C_MASK,
349 }, 349 },
350}; 350};
351 351
352struct pmx_dev pmx_plgpio_4_5 = { 352struct pmx_dev spear3xx_pmx_plgpio_4_5 = {
353 .name = "plgpio 4 and 5", 353 .name = "plgpio 4 and 5",
354 .modes = pmx_plgpio_4_5_modes, 354 .modes = pmx_plgpio_4_5_modes,
355 .mode_count = ARRAY_SIZE(pmx_plgpio_4_5_modes), 355 .mode_count = ARRAY_SIZE(pmx_plgpio_4_5_modes),
356 .enb_on_reset = 1, 356 .enb_on_reset = 1,
357}; 357};
358 358
359struct pmx_dev_mode pmx_plgpio_6_9_modes[] = { 359static struct pmx_dev_mode pmx_plgpio_6_9_modes[] = {
360 { 360 {
361 .ids = 0x00, 361 .ids = 0x00,
362 .mask = PMX_SSP_MASK, 362 .mask = PMX_SSP_MASK,
363 }, 363 },
364}; 364};
365 365
366struct pmx_dev pmx_plgpio_6_9 = { 366struct pmx_dev spear3xx_pmx_plgpio_6_9 = {
367 .name = "plgpio 6 to 9", 367 .name = "plgpio 6 to 9",
368 .modes = pmx_plgpio_6_9_modes, 368 .modes = pmx_plgpio_6_9_modes,
369 .mode_count = ARRAY_SIZE(pmx_plgpio_6_9_modes), 369 .mode_count = ARRAY_SIZE(pmx_plgpio_6_9_modes),
370 .enb_on_reset = 1, 370 .enb_on_reset = 1,
371}; 371};
372 372
373struct pmx_dev_mode pmx_plgpio_10_27_modes[] = { 373static struct pmx_dev_mode pmx_plgpio_10_27_modes[] = {
374 { 374 {
375 .ids = 0x00, 375 .ids = 0x00,
376 .mask = PMX_MII_MASK, 376 .mask = PMX_MII_MASK,
377 }, 377 },
378}; 378};
379 379
380struct pmx_dev pmx_plgpio_10_27 = { 380struct pmx_dev spear3xx_pmx_plgpio_10_27 = {
381 .name = "plgpio 10 to 27", 381 .name = "plgpio 10 to 27",
382 .modes = pmx_plgpio_10_27_modes, 382 .modes = pmx_plgpio_10_27_modes,
383 .mode_count = ARRAY_SIZE(pmx_plgpio_10_27_modes), 383 .mode_count = ARRAY_SIZE(pmx_plgpio_10_27_modes),
384 .enb_on_reset = 1, 384 .enb_on_reset = 1,
385}; 385};
386 386
387struct pmx_dev_mode pmx_plgpio_28_modes[] = { 387static struct pmx_dev_mode pmx_plgpio_28_modes[] = {
388 { 388 {
389 .ids = 0x00, 389 .ids = 0x00,
390 .mask = PMX_GPIO_PIN0_MASK, 390 .mask = PMX_GPIO_PIN0_MASK,
391 }, 391 },
392}; 392};
393 393
394struct pmx_dev pmx_plgpio_28 = { 394struct pmx_dev spear3xx_pmx_plgpio_28 = {
395 .name = "plgpio 28", 395 .name = "plgpio 28",
396 .modes = pmx_plgpio_28_modes, 396 .modes = pmx_plgpio_28_modes,
397 .mode_count = ARRAY_SIZE(pmx_plgpio_28_modes), 397 .mode_count = ARRAY_SIZE(pmx_plgpio_28_modes),
398 .enb_on_reset = 1, 398 .enb_on_reset = 1,
399}; 399};
400 400
401struct pmx_dev_mode pmx_plgpio_29_modes[] = { 401static struct pmx_dev_mode pmx_plgpio_29_modes[] = {
402 { 402 {
403 .ids = 0x00, 403 .ids = 0x00,
404 .mask = PMX_GPIO_PIN1_MASK, 404 .mask = PMX_GPIO_PIN1_MASK,
405 }, 405 },
406}; 406};
407 407
408struct pmx_dev pmx_plgpio_29 = { 408struct pmx_dev spear3xx_pmx_plgpio_29 = {
409 .name = "plgpio 29", 409 .name = "plgpio 29",
410 .modes = pmx_plgpio_29_modes, 410 .modes = pmx_plgpio_29_modes,
411 .mode_count = ARRAY_SIZE(pmx_plgpio_29_modes), 411 .mode_count = ARRAY_SIZE(pmx_plgpio_29_modes),
412 .enb_on_reset = 1, 412 .enb_on_reset = 1,
413}; 413};
414 414
415struct pmx_dev_mode pmx_plgpio_30_modes[] = { 415static struct pmx_dev_mode pmx_plgpio_30_modes[] = {
416 { 416 {
417 .ids = 0x00, 417 .ids = 0x00,
418 .mask = PMX_GPIO_PIN2_MASK, 418 .mask = PMX_GPIO_PIN2_MASK,
419 }, 419 },
420}; 420};
421 421
422struct pmx_dev pmx_plgpio_30 = { 422struct pmx_dev spear3xx_pmx_plgpio_30 = {
423 .name = "plgpio 30", 423 .name = "plgpio 30",
424 .modes = pmx_plgpio_30_modes, 424 .modes = pmx_plgpio_30_modes,
425 .mode_count = ARRAY_SIZE(pmx_plgpio_30_modes), 425 .mode_count = ARRAY_SIZE(pmx_plgpio_30_modes),
426 .enb_on_reset = 1, 426 .enb_on_reset = 1,
427}; 427};
428 428
429struct pmx_dev_mode pmx_plgpio_31_modes[] = { 429static struct pmx_dev_mode pmx_plgpio_31_modes[] = {
430 { 430 {
431 .ids = 0x00, 431 .ids = 0x00,
432 .mask = PMX_GPIO_PIN3_MASK, 432 .mask = PMX_GPIO_PIN3_MASK,
433 }, 433 },
434}; 434};
435 435
436struct pmx_dev pmx_plgpio_31 = { 436struct pmx_dev spear3xx_pmx_plgpio_31 = {
437 .name = "plgpio 31", 437 .name = "plgpio 31",
438 .modes = pmx_plgpio_31_modes, 438 .modes = pmx_plgpio_31_modes,
439 .mode_count = ARRAY_SIZE(pmx_plgpio_31_modes), 439 .mode_count = ARRAY_SIZE(pmx_plgpio_31_modes),
440 .enb_on_reset = 1, 440 .enb_on_reset = 1,
441}; 441};
442 442
443struct pmx_dev_mode pmx_plgpio_32_modes[] = { 443static struct pmx_dev_mode pmx_plgpio_32_modes[] = {
444 { 444 {
445 .ids = 0x00, 445 .ids = 0x00,
446 .mask = PMX_GPIO_PIN4_MASK, 446 .mask = PMX_GPIO_PIN4_MASK,
447 }, 447 },
448}; 448};
449 449
450struct pmx_dev pmx_plgpio_32 = { 450struct pmx_dev spear3xx_pmx_plgpio_32 = {
451 .name = "plgpio 32", 451 .name = "plgpio 32",
452 .modes = pmx_plgpio_32_modes, 452 .modes = pmx_plgpio_32_modes,
453 .mode_count = ARRAY_SIZE(pmx_plgpio_32_modes), 453 .mode_count = ARRAY_SIZE(pmx_plgpio_32_modes),
454 .enb_on_reset = 1, 454 .enb_on_reset = 1,
455}; 455};
456 456
457struct pmx_dev_mode pmx_plgpio_33_modes[] = { 457static struct pmx_dev_mode pmx_plgpio_33_modes[] = {
458 { 458 {
459 .ids = 0x00, 459 .ids = 0x00,
460 .mask = PMX_GPIO_PIN5_MASK, 460 .mask = PMX_GPIO_PIN5_MASK,
461 }, 461 },
462}; 462};
463 463
464struct pmx_dev pmx_plgpio_33 = { 464struct pmx_dev spear3xx_pmx_plgpio_33 = {
465 .name = "plgpio 33", 465 .name = "plgpio 33",
466 .modes = pmx_plgpio_33_modes, 466 .modes = pmx_plgpio_33_modes,
467 .mode_count = ARRAY_SIZE(pmx_plgpio_33_modes), 467 .mode_count = ARRAY_SIZE(pmx_plgpio_33_modes),
468 .enb_on_reset = 1, 468 .enb_on_reset = 1,
469}; 469};
470 470
471struct pmx_dev_mode pmx_plgpio_34_36_modes[] = { 471static struct pmx_dev_mode pmx_plgpio_34_36_modes[] = {
472 { 472 {
473 .ids = 0x00, 473 .ids = 0x00,
474 .mask = PMX_SSP_CS_MASK, 474 .mask = PMX_SSP_CS_MASK,
475 }, 475 },
476}; 476};
477 477
478struct pmx_dev pmx_plgpio_34_36 = { 478struct pmx_dev spear3xx_pmx_plgpio_34_36 = {
479 .name = "plgpio 34 to 36", 479 .name = "plgpio 34 to 36",
480 .modes = pmx_plgpio_34_36_modes, 480 .modes = pmx_plgpio_34_36_modes,
481 .mode_count = ARRAY_SIZE(pmx_plgpio_34_36_modes), 481 .mode_count = ARRAY_SIZE(pmx_plgpio_34_36_modes),
482 .enb_on_reset = 1, 482 .enb_on_reset = 1,
483}; 483};
484 484
485struct pmx_dev_mode pmx_plgpio_37_42_modes[] = { 485static struct pmx_dev_mode pmx_plgpio_37_42_modes[] = {
486 { 486 {
487 .ids = 0x00, 487 .ids = 0x00,
488 .mask = PMX_UART0_MODEM_MASK, 488 .mask = PMX_UART0_MODEM_MASK,
489 }, 489 },
490}; 490};
491 491
492struct pmx_dev pmx_plgpio_37_42 = { 492struct pmx_dev spear3xx_pmx_plgpio_37_42 = {
493 .name = "plgpio 37 to 42", 493 .name = "plgpio 37 to 42",
494 .modes = pmx_plgpio_37_42_modes, 494 .modes = pmx_plgpio_37_42_modes,
495 .mode_count = ARRAY_SIZE(pmx_plgpio_37_42_modes), 495 .mode_count = ARRAY_SIZE(pmx_plgpio_37_42_modes),
496 .enb_on_reset = 1, 496 .enb_on_reset = 1,
497}; 497};
498 498
499struct pmx_dev_mode pmx_plgpio_43_44_47_48_modes[] = { 499static struct pmx_dev_mode pmx_plgpio_43_44_47_48_modes[] = {
500 { 500 {
501 .ids = 0x00, 501 .ids = 0x00,
502 .mask = PMX_TIMER_1_2_MASK, 502 .mask = PMX_TIMER_1_2_MASK,
503 }, 503 },
504}; 504};
505 505
506struct pmx_dev pmx_plgpio_43_44_47_48 = { 506struct pmx_dev spear3xx_pmx_plgpio_43_44_47_48 = {
507 .name = "plgpio 43, 44, 47 and 48", 507 .name = "plgpio 43, 44, 47 and 48",
508 .modes = pmx_plgpio_43_44_47_48_modes, 508 .modes = pmx_plgpio_43_44_47_48_modes,
509 .mode_count = ARRAY_SIZE(pmx_plgpio_43_44_47_48_modes), 509 .mode_count = ARRAY_SIZE(pmx_plgpio_43_44_47_48_modes),
510 .enb_on_reset = 1, 510 .enb_on_reset = 1,
511}; 511};
512 512
513struct pmx_dev_mode pmx_plgpio_45_46_49_50_modes[] = { 513static struct pmx_dev_mode pmx_plgpio_45_46_49_50_modes[] = {
514 { 514 {
515 .ids = 0x00, 515 .ids = 0x00,
516 .mask = PMX_TIMER_3_4_MASK, 516 .mask = PMX_TIMER_3_4_MASK,
517 }, 517 },
518}; 518};
519 519
520struct pmx_dev pmx_plgpio_45_46_49_50 = { 520struct pmx_dev spear3xx_pmx_plgpio_45_46_49_50 = {
521 .name = "plgpio 45, 46, 49 and 50", 521 .name = "plgpio 45, 46, 49 and 50",
522 .modes = pmx_plgpio_45_46_49_50_modes, 522 .modes = pmx_plgpio_45_46_49_50_modes,
523 .mode_count = ARRAY_SIZE(pmx_plgpio_45_46_49_50_modes), 523 .mode_count = ARRAY_SIZE(pmx_plgpio_45_46_49_50_modes),
diff --git a/arch/arm/mach-spear6xx/Kconfig b/arch/arm/mach-spear6xx/Kconfig
index bddba034f862..ff4ae5ba00f1 100644
--- a/arch/arm/mach-spear6xx/Kconfig
+++ b/arch/arm/mach-spear6xx/Kconfig
@@ -4,17 +4,18 @@
4 4
5if ARCH_SPEAR6XX 5if ARCH_SPEAR6XX
6 6
7choice 7menu "SPEAr6xx Implementations"
8 prompt "SPEAr6XX Family" 8config BOARD_SPEAR600_EVB
9 default MACH_SPEAR600 9 bool "SPEAr600 Evaluation Board"
10 select MACH_SPEAR600
11 help
12 Supports ST SPEAr600 Evaluation Board
13
14endmenu
10 15
11config MACH_SPEAR600 16config MACH_SPEAR600
12 bool "SPEAr600" 17 bool "SPEAr600"
13 help 18 help
14 Supports ST SPEAr600 Machine 19 Supports ST SPEAr600 Machine
15endchoice
16
17# Adding SPEAr6XX machine specific configuration files
18source "arch/arm/mach-spear6xx/Kconfig600"
19 20
20endif #ARCH_SPEAR6XX 21endif #ARCH_SPEAR6XX
diff --git a/arch/arm/mach-spear6xx/Kconfig600 b/arch/arm/mach-spear6xx/Kconfig600
deleted file mode 100644
index 9e19f65eb78e..000000000000
--- a/arch/arm/mach-spear6xx/Kconfig600
+++ /dev/null
@@ -1,17 +0,0 @@
1#
2# SPEAr600 machine configuration file
3#
4
5if MACH_SPEAR600
6
7choice
8 prompt "SPEAr600 Boards"
9 default BOARD_SPEAR600_EVB
10
11config BOARD_SPEAR600_EVB
12 bool "SPEAr600 Evaluation Board"
13 help
14 Supports ST SPEAr600 Evaluation Board
15endchoice
16
17endif #MACH_SPEAR600
diff --git a/arch/arm/mach-spear6xx/clock.c b/arch/arm/mach-spear6xx/clock.c
index 88b748b5be80..ac70e0d88fef 100644
--- a/arch/arm/mach-spear6xx/clock.c
+++ b/arch/arm/mach-spear6xx/clock.c
@@ -671,12 +671,12 @@ static struct clk_lookup spear_clk_lookups[] = {
671 { .dev_id = "gpio2", .clk = &gpio2_clk}, 671 { .dev_id = "gpio2", .clk = &gpio2_clk},
672}; 672};
673 673
674void __init clk_init(void) 674void __init spear6xx_clk_init(void)
675{ 675{
676 int i; 676 int i;
677 677
678 for (i = 0; i < ARRAY_SIZE(spear_clk_lookups); i++) 678 for (i = 0; i < ARRAY_SIZE(spear_clk_lookups); i++)
679 clk_register(&spear_clk_lookups[i]); 679 clk_register(&spear_clk_lookups[i]);
680 680
681 recalc_root_clocks(); 681 clk_init();
682} 682}
diff --git a/arch/arm/mach-spear6xx/include/mach/generic.h b/arch/arm/mach-spear6xx/include/mach/generic.h
index 94cf4a648b57..183f0238c5e2 100644
--- a/arch/arm/mach-spear6xx/include/mach/generic.h
+++ b/arch/arm/mach-spear6xx/include/mach/generic.h
@@ -39,7 +39,7 @@ void __init spear6xx_map_io(void);
39void __init spear6xx_init_irq(void); 39void __init spear6xx_init_irq(void);
40void __init spear6xx_init(void); 40void __init spear6xx_init(void);
41void __init spear600_init(void); 41void __init spear600_init(void);
42void __init clk_init(void); 42void __init spear6xx_clk_init(void);
43 43
44/* Add spear600 machine device structure declarations here */ 44/* Add spear600 machine device structure declarations here */
45 45
diff --git a/arch/arm/mach-spear6xx/spear6xx.c b/arch/arm/mach-spear6xx/spear6xx.c
index 981812961ac7..e0f6628c8b2c 100644
--- a/arch/arm/mach-spear6xx/spear6xx.c
+++ b/arch/arm/mach-spear6xx/spear6xx.c
@@ -148,7 +148,7 @@ void __init spear6xx_map_io(void)
148 iotable_init(spear6xx_io_desc, ARRAY_SIZE(spear6xx_io_desc)); 148 iotable_init(spear6xx_io_desc, ARRAY_SIZE(spear6xx_io_desc));
149 149
150 /* This will initialize clock framework */ 150 /* This will initialize clock framework */
151 clk_init(); 151 spear6xx_clk_init();
152} 152}
153 153
154static void __init spear6xx_timer_init(void) 154static void __init spear6xx_timer_init(void)
diff --git a/arch/arm/mach-stmp378x/Makefile b/arch/arm/mach-stmp378x/Makefile
deleted file mode 100644
index d156f76b379f..000000000000
--- a/arch/arm/mach-stmp378x/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
1obj-$(CONFIG_ARCH_STMP378X) += stmp378x.o
2obj-$(CONFIG_MACH_STMP378X) += stmp378x_devb.o
diff --git a/arch/arm/mach-stmp378x/Makefile.boot b/arch/arm/mach-stmp378x/Makefile.boot
deleted file mode 100644
index 1568ad404d59..000000000000
--- a/arch/arm/mach-stmp378x/Makefile.boot
+++ /dev/null
@@ -1,3 +0,0 @@
1 zreladdr-y := 0x40008000
2params_phys-y := 0x40000100
3initrd_phys-y := 0x40800000
diff --git a/arch/arm/mach-stmp378x/include/mach/entry-macro.S b/arch/arm/mach-stmp378x/include/mach/entry-macro.S
deleted file mode 100644
index 731a92286da2..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/entry-macro.S
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * Low-level IRQ helper macros for Freescale STMP378X
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18
19 .macro disable_fiq
20 .endm
21
22 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
23
24 mov \base, #0xf0000000 @ vm address of IRQ controller
25 ldr \irqnr, [\base, #0x70] @ HW_ICOLL_STAT
26 cmp \irqnr, #0x7f
27 moveqs \irqnr, #0 @ Zero flag set for no IRQ
28
29 .endm
30
31 .macro get_irqnr_preamble, base, tmp
32 .endm
33
34 .macro arch_ret_to_user, tmp1, tmp2
35 .endm
diff --git a/arch/arm/mach-stmp378x/include/mach/irqs.h b/arch/arm/mach-stmp378x/include/mach/irqs.h
deleted file mode 100644
index cc59673becdd..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/irqs.h
+++ /dev/null
@@ -1,95 +0,0 @@
1/*
2 * Freescale STMP378X interrupts
3 *
4 * Copyright (C) 2005 Sigmatel Inc
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18
19#define IRQ_DEBUG_UART 0
20#define IRQ_COMMS_RX 1
21#define IRQ_COMMS_TX 1
22#define IRQ_SSP2_ERROR 2
23#define IRQ_VDD5V 3
24#define IRQ_HEADPHONE_SHORT 4
25#define IRQ_DAC_DMA 5
26#define IRQ_DAC_ERROR 6
27#define IRQ_ADC_DMA 7
28#define IRQ_ADC_ERROR 8
29#define IRQ_SPDIF_DMA 9
30#define IRQ_SAIF2_DMA 9
31#define IRQ_SPDIF_ERROR 10
32#define IRQ_SAIF1_IRQ 10
33#define IRQ_SAIF2_IRQ 10
34#define IRQ_USB_CTRL 11
35#define IRQ_USB_WAKEUP 12
36#define IRQ_GPMI_DMA 13
37#define IRQ_SSP1_DMA 14
38#define IRQ_SSP_ERROR 15
39#define IRQ_GPIO0 16
40#define IRQ_GPIO1 17
41#define IRQ_GPIO2 18
42#define IRQ_SAIF1_DMA 19
43#define IRQ_SSP2_DMA 20
44#define IRQ_ECC8_IRQ 21
45#define IRQ_RTC_ALARM 22
46#define IRQ_UARTAPP_TX_DMA 23
47#define IRQ_UARTAPP_INTERNAL 24
48#define IRQ_UARTAPP_RX_DMA 25
49#define IRQ_I2C_DMA 26
50#define IRQ_I2C_ERROR 27
51#define IRQ_TIMER0 28
52#define IRQ_TIMER1 29
53#define IRQ_TIMER2 30
54#define IRQ_TIMER3 31
55#define IRQ_BATT_BRNOUT 32
56#define IRQ_VDDD_BRNOUT 33
57#define IRQ_VDDIO_BRNOUT 34
58#define IRQ_VDD18_BRNOUT 35
59#define IRQ_TOUCH_DETECT 36
60#define IRQ_LRADC_CH0 37
61#define IRQ_LRADC_CH1 38
62#define IRQ_LRADC_CH2 39
63#define IRQ_LRADC_CH3 40
64#define IRQ_LRADC_CH4 41
65#define IRQ_LRADC_CH5 42
66#define IRQ_LRADC_CH6 43
67#define IRQ_LRADC_CH7 44
68#define IRQ_LCDIF_DMA 45
69#define IRQ_LCDIF_ERROR 46
70#define IRQ_DIGCTL_DEBUG_TRAP 47
71#define IRQ_RTC_1MSEC 48
72#define IRQ_DRI_DMA 49
73#define IRQ_DRI_ATTENTION 50
74#define IRQ_GPMI_ATTENTION 51
75#define IRQ_IR 52
76#define IRQ_DCP_VMI 53
77#define IRQ_DCP 54
78#define IRQ_BCH 56
79#define IRQ_PXP 57
80#define IRQ_UARTAPP2_TX_DMA 58
81#define IRQ_UARTAPP2_INTERNAL 59
82#define IRQ_UARTAPP2_RX_DMA 60
83#define IRQ_VDAC_DETECT 61
84#define IRQ_VDD5V_DROOP 64
85#define IRQ_DCDC4P2_BO 65
86
87
88#define NR_REAL_IRQS 128
89#define NR_IRQS (NR_REAL_IRQS + 32 * 3)
90
91/* All interrupts are FIQ capable */
92#define FIQ_START IRQ_DEBUG_UART
93
94/* Hard disk IRQ is a GPMI attention IRQ */
95#define IRQ_HARDDISK IRQ_GPMI_ATTENTION
diff --git a/arch/arm/mach-stmp378x/include/mach/pins.h b/arch/arm/mach-stmp378x/include/mach/pins.h
deleted file mode 100644
index 93f952d35969..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/pins.h
+++ /dev/null
@@ -1,151 +0,0 @@
1/*
2 * Freescale STMP378X SoC pin multiplexing
3 *
4 * Author: Vladislav Buzov <vbuzov@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __ASM_ARCH_PINS_H
19#define __ASM_ARCH_PINS_H
20
21/*
22 * Define all STMP378x pins, a pin name corresponds to a STMP378x hardware
23 * interface this pin belongs to.
24 */
25
26/* Bank 0 */
27#define PINID_GPMI_D00 STMP3XXX_PINID(0, 0)
28#define PINID_GPMI_D01 STMP3XXX_PINID(0, 1)
29#define PINID_GPMI_D02 STMP3XXX_PINID(0, 2)
30#define PINID_GPMI_D03 STMP3XXX_PINID(0, 3)
31#define PINID_GPMI_D04 STMP3XXX_PINID(0, 4)
32#define PINID_GPMI_D05 STMP3XXX_PINID(0, 5)
33#define PINID_GPMI_D06 STMP3XXX_PINID(0, 6)
34#define PINID_GPMI_D07 STMP3XXX_PINID(0, 7)
35#define PINID_GPMI_D08 STMP3XXX_PINID(0, 8)
36#define PINID_GPMI_D09 STMP3XXX_PINID(0, 9)
37#define PINID_GPMI_D10 STMP3XXX_PINID(0, 10)
38#define PINID_GPMI_D11 STMP3XXX_PINID(0, 11)
39#define PINID_GPMI_D12 STMP3XXX_PINID(0, 12)
40#define PINID_GPMI_D13 STMP3XXX_PINID(0, 13)
41#define PINID_GPMI_D14 STMP3XXX_PINID(0, 14)
42#define PINID_GPMI_D15 STMP3XXX_PINID(0, 15)
43#define PINID_GPMI_CLE STMP3XXX_PINID(0, 16)
44#define PINID_GPMI_ALE STMP3XXX_PINID(0, 17)
45#define PINID_GMPI_CE2N STMP3XXX_PINID(0, 18)
46#define PINID_GPMI_RDY0 STMP3XXX_PINID(0, 19)
47#define PINID_GPMI_RDY1 STMP3XXX_PINID(0, 20)
48#define PINID_GPMI_RDY2 STMP3XXX_PINID(0, 21)
49#define PINID_GPMI_RDY3 STMP3XXX_PINID(0, 22)
50#define PINID_GPMI_WPN STMP3XXX_PINID(0, 23)
51#define PINID_GPMI_WRN STMP3XXX_PINID(0, 24)
52#define PINID_GPMI_RDN STMP3XXX_PINID(0, 25)
53#define PINID_AUART1_CTS STMP3XXX_PINID(0, 26)
54#define PINID_AUART1_RTS STMP3XXX_PINID(0, 27)
55#define PINID_AUART1_RX STMP3XXX_PINID(0, 28)
56#define PINID_AUART1_TX STMP3XXX_PINID(0, 29)
57#define PINID_I2C_SCL STMP3XXX_PINID(0, 30)
58#define PINID_I2C_SDA STMP3XXX_PINID(0, 31)
59
60/* Bank 1 */
61#define PINID_LCD_D00 STMP3XXX_PINID(1, 0)
62#define PINID_LCD_D01 STMP3XXX_PINID(1, 1)
63#define PINID_LCD_D02 STMP3XXX_PINID(1, 2)
64#define PINID_LCD_D03 STMP3XXX_PINID(1, 3)
65#define PINID_LCD_D04 STMP3XXX_PINID(1, 4)
66#define PINID_LCD_D05 STMP3XXX_PINID(1, 5)
67#define PINID_LCD_D06 STMP3XXX_PINID(1, 6)
68#define PINID_LCD_D07 STMP3XXX_PINID(1, 7)
69#define PINID_LCD_D08 STMP3XXX_PINID(1, 8)
70#define PINID_LCD_D09 STMP3XXX_PINID(1, 9)
71#define PINID_LCD_D10 STMP3XXX_PINID(1, 10)
72#define PINID_LCD_D11 STMP3XXX_PINID(1, 11)
73#define PINID_LCD_D12 STMP3XXX_PINID(1, 12)
74#define PINID_LCD_D13 STMP3XXX_PINID(1, 13)
75#define PINID_LCD_D14 STMP3XXX_PINID(1, 14)
76#define PINID_LCD_D15 STMP3XXX_PINID(1, 15)
77#define PINID_LCD_D16 STMP3XXX_PINID(1, 16)
78#define PINID_LCD_D17 STMP3XXX_PINID(1, 17)
79#define PINID_LCD_RESET STMP3XXX_PINID(1, 18)
80#define PINID_LCD_RS STMP3XXX_PINID(1, 19)
81#define PINID_LCD_WR STMP3XXX_PINID(1, 20)
82#define PINID_LCD_CS STMP3XXX_PINID(1, 21)
83#define PINID_LCD_DOTCK STMP3XXX_PINID(1, 22)
84#define PINID_LCD_ENABLE STMP3XXX_PINID(1, 23)
85#define PINID_LCD_HSYNC STMP3XXX_PINID(1, 24)
86#define PINID_LCD_VSYNC STMP3XXX_PINID(1, 25)
87#define PINID_PWM0 STMP3XXX_PINID(1, 26)
88#define PINID_PWM1 STMP3XXX_PINID(1, 27)
89#define PINID_PWM2 STMP3XXX_PINID(1, 28)
90#define PINID_PWM3 STMP3XXX_PINID(1, 29)
91#define PINID_PWM4 STMP3XXX_PINID(1, 30)
92
93/* Bank 2 */
94#define PINID_SSP1_CMD STMP3XXX_PINID(2, 0)
95#define PINID_SSP1_DETECT STMP3XXX_PINID(2, 1)
96#define PINID_SSP1_DATA0 STMP3XXX_PINID(2, 2)
97#define PINID_SSP1_DATA1 STMP3XXX_PINID(2, 3)
98#define PINID_SSP1_DATA2 STMP3XXX_PINID(2, 4)
99#define PINID_SSP1_DATA3 STMP3XXX_PINID(2, 5)
100#define PINID_SSP1_SCK STMP3XXX_PINID(2, 6)
101#define PINID_ROTARYA STMP3XXX_PINID(2, 7)
102#define PINID_ROTARYB STMP3XXX_PINID(2, 8)
103#define PINID_EMI_A00 STMP3XXX_PINID(2, 9)
104#define PINID_EMI_A01 STMP3XXX_PINID(2, 10)
105#define PINID_EMI_A02 STMP3XXX_PINID(2, 11)
106#define PINID_EMI_A03 STMP3XXX_PINID(2, 12)
107#define PINID_EMI_A04 STMP3XXX_PINID(2, 13)
108#define PINID_EMI_A05 STMP3XXX_PINID(2, 14)
109#define PINID_EMI_A06 STMP3XXX_PINID(2, 15)
110#define PINID_EMI_A07 STMP3XXX_PINID(2, 16)
111#define PINID_EMI_A08 STMP3XXX_PINID(2, 17)
112#define PINID_EMI_A09 STMP3XXX_PINID(2, 18)
113#define PINID_EMI_A10 STMP3XXX_PINID(2, 19)
114#define PINID_EMI_A11 STMP3XXX_PINID(2, 20)
115#define PINID_EMI_A12 STMP3XXX_PINID(2, 21)
116#define PINID_EMI_BA0 STMP3XXX_PINID(2, 22)
117#define PINID_EMI_BA1 STMP3XXX_PINID(2, 23)
118#define PINID_EMI_CASN STMP3XXX_PINID(2, 24)
119#define PINID_EMI_CE0N STMP3XXX_PINID(2, 25)
120#define PINID_EMI_CE1N STMP3XXX_PINID(2, 26)
121#define PINID_GPMI_CE1N STMP3XXX_PINID(2, 27)
122#define PINID_GPMI_CE0N STMP3XXX_PINID(2, 28)
123#define PINID_EMI_CKE STMP3XXX_PINID(2, 29)
124#define PINID_EMI_RASN STMP3XXX_PINID(2, 30)
125#define PINID_EMI_WEN STMP3XXX_PINID(2, 31)
126
127/* Bank 3 */
128#define PINID_EMI_D00 STMP3XXX_PINID(3, 0)
129#define PINID_EMI_D01 STMP3XXX_PINID(3, 1)
130#define PINID_EMI_D02 STMP3XXX_PINID(3, 2)
131#define PINID_EMI_D03 STMP3XXX_PINID(3, 3)
132#define PINID_EMI_D04 STMP3XXX_PINID(3, 4)
133#define PINID_EMI_D05 STMP3XXX_PINID(3, 5)
134#define PINID_EMI_D06 STMP3XXX_PINID(3, 6)
135#define PINID_EMI_D07 STMP3XXX_PINID(3, 7)
136#define PINID_EMI_D08 STMP3XXX_PINID(3, 8)
137#define PINID_EMI_D09 STMP3XXX_PINID(3, 9)
138#define PINID_EMI_D10 STMP3XXX_PINID(3, 10)
139#define PINID_EMI_D11 STMP3XXX_PINID(3, 11)
140#define PINID_EMI_D12 STMP3XXX_PINID(3, 12)
141#define PINID_EMI_D13 STMP3XXX_PINID(3, 13)
142#define PINID_EMI_D14 STMP3XXX_PINID(3, 14)
143#define PINID_EMI_D15 STMP3XXX_PINID(3, 15)
144#define PINID_EMI_DQM0 STMP3XXX_PINID(3, 16)
145#define PINID_EMI_DQM1 STMP3XXX_PINID(3, 17)
146#define PINID_EMI_DQS0 STMP3XXX_PINID(3, 18)
147#define PINID_EMI_DQS1 STMP3XXX_PINID(3, 19)
148#define PINID_EMI_CLK STMP3XXX_PINID(3, 20)
149#define PINID_EMI_CLKN STMP3XXX_PINID(3, 21)
150
151#endif /* __ASM_ARCH_PINS_H */
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-apbh.h b/arch/arm/mach-stmp378x/include/mach/regs-apbh.h
deleted file mode 100644
index dbcf85b6ac2a..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-apbh.h
+++ /dev/null
@@ -1,101 +0,0 @@
1/*
2 * stmp378x: APBH register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#ifndef _MACH_REGS_APBH
22#define _MACH_REGS_APBH
23
24#define REGS_APBH_BASE (STMP3XXX_REGS_BASE + 0x4000)
25#define REGS_APBH_PHYS 0x80004000
26#define REGS_APBH_SIZE 0x2000
27
28#define HW_APBH_CTRL0 0x0
29#define BM_APBH_CTRL0_RESET_CHANNEL 0x00FF0000
30#define BP_APBH_CTRL0_RESET_CHANNEL 16
31#define BM_APBH_CTRL0_CLKGATE 0x40000000
32#define BM_APBH_CTRL0_SFTRST 0x80000000
33
34#define HW_APBH_CTRL1 0x10
35#define BM_APBH_CTRL1_CH0_CMDCMPLT_IRQ 0x00000001
36#define BP_APBH_CTRL1_CH0_CMDCMPLT_IRQ 0
37
38#define HW_APBH_CTRL2 0x20
39
40#define HW_APBH_DEVSEL 0x30
41
42#define HW_APBH_CH0_NXTCMDAR (0x50 + 0 * 0x70)
43#define HW_APBH_CH1_NXTCMDAR (0x50 + 1 * 0x70)
44#define HW_APBH_CH2_NXTCMDAR (0x50 + 2 * 0x70)
45#define HW_APBH_CH3_NXTCMDAR (0x50 + 3 * 0x70)
46#define HW_APBH_CH4_NXTCMDAR (0x50 + 4 * 0x70)
47#define HW_APBH_CH5_NXTCMDAR (0x50 + 5 * 0x70)
48#define HW_APBH_CH6_NXTCMDAR (0x50 + 6 * 0x70)
49#define HW_APBH_CH7_NXTCMDAR (0x50 + 7 * 0x70)
50#define HW_APBH_CH8_NXTCMDAR (0x50 + 8 * 0x70)
51#define HW_APBH_CH9_NXTCMDAR (0x50 + 9 * 0x70)
52#define HW_APBH_CH10_NXTCMDAR (0x50 + 10 * 0x70)
53#define HW_APBH_CH11_NXTCMDAR (0x50 + 11 * 0x70)
54#define HW_APBH_CH12_NXTCMDAR (0x50 + 12 * 0x70)
55#define HW_APBH_CH13_NXTCMDAR (0x50 + 13 * 0x70)
56#define HW_APBH_CH14_NXTCMDAR (0x50 + 14 * 0x70)
57#define HW_APBH_CH15_NXTCMDAR (0x50 + 15 * 0x70)
58
59#define HW_APBH_CHn_NXTCMDAR 0x50
60
61#define BV_APBH_CHn_CMD_COMMAND__NO_DMA_XFER 0
62#define BV_APBH_CHn_CMD_COMMAND__DMA_WRITE 1
63#define BV_APBH_CHn_CMD_COMMAND__DMA_READ 2
64#define BV_APBH_CHn_CMD_COMMAND__DMA_SENSE 3
65#define BM_APBH_CHn_CMD_COMMAND 0x00000003
66#define BP_APBH_CHn_CMD_COMMAND 0
67#define BM_APBH_CHn_CMD_CHAIN 0x00000004
68#define BM_APBH_CHn_CMD_IRQONCMPLT 0x00000008
69#define BM_APBH_CHn_CMD_NANDLOCK 0x00000010
70#define BM_APBH_CHn_CMD_NANDWAIT4READY 0x00000020
71#define BM_APBH_CHn_CMD_SEMAPHORE 0x00000040
72#define BM_APBH_CHn_CMD_WAIT4ENDCMD 0x00000080
73#define BM_APBH_CHn_CMD_CMDWORDS 0x0000F000
74#define BP_APBH_CHn_CMD_CMDWORDS 12
75#define BM_APBH_CHn_CMD_XFER_COUNT 0xFFFF0000
76#define BP_APBH_CHn_CMD_XFER_COUNT 16
77
78#define HW_APBH_CH0_SEMA (0x80 + 0 * 0x70)
79#define HW_APBH_CH1_SEMA (0x80 + 1 * 0x70)
80#define HW_APBH_CH2_SEMA (0x80 + 2 * 0x70)
81#define HW_APBH_CH3_SEMA (0x80 + 3 * 0x70)
82#define HW_APBH_CH4_SEMA (0x80 + 4 * 0x70)
83#define HW_APBH_CH5_SEMA (0x80 + 5 * 0x70)
84#define HW_APBH_CH6_SEMA (0x80 + 6 * 0x70)
85#define HW_APBH_CH7_SEMA (0x80 + 7 * 0x70)
86#define HW_APBH_CH8_SEMA (0x80 + 8 * 0x70)
87#define HW_APBH_CH9_SEMA (0x80 + 9 * 0x70)
88#define HW_APBH_CH10_SEMA (0x80 + 10 * 0x70)
89#define HW_APBH_CH11_SEMA (0x80 + 11 * 0x70)
90#define HW_APBH_CH12_SEMA (0x80 + 12 * 0x70)
91#define HW_APBH_CH13_SEMA (0x80 + 13 * 0x70)
92#define HW_APBH_CH14_SEMA (0x80 + 14 * 0x70)
93#define HW_APBH_CH15_SEMA (0x80 + 15 * 0x70)
94
95#define HW_APBH_CHn_SEMA 0x80
96#define BM_APBH_CHn_SEMA_INCREMENT_SEMA 0x000000FF
97#define BP_APBH_CHn_SEMA_INCREMENT_SEMA 0
98#define BM_APBH_CHn_SEMA_PHORE 0x00FF0000
99#define BP_APBH_CHn_SEMA_PHORE 16
100
101#endif
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-apbx.h b/arch/arm/mach-stmp378x/include/mach/regs-apbx.h
deleted file mode 100644
index 3b934a4d27f0..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-apbx.h
+++ /dev/null
@@ -1,119 +0,0 @@
1/*
2 * stmp378x: APBX register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#ifndef _MACH_REGS_APBX
22#define _MACH_REGS_APBX
23
24#define REGS_APBX_BASE (STMP3XXX_REGS_BASE + 0x24000)
25#define REGS_APBX_PHYS 0x80024000
26#define REGS_APBX_SIZE 0x2000
27
28#define HW_APBX_CTRL0 0x0
29#define BM_APBX_CTRL0_CLKGATE 0x40000000
30#define BM_APBX_CTRL0_SFTRST 0x80000000
31
32#define HW_APBX_CTRL1 0x10
33
34#define HW_APBX_CTRL2 0x20
35
36#define HW_APBX_CHANNEL_CTRL 0x30
37#define BM_APBX_CHANNEL_CTRL_RESET_CHANNEL 0xFFFF0000
38#define BP_APBX_CHANNEL_CTRL_RESET_CHANNEL 16
39
40#define HW_APBX_DEVSEL 0x40
41
42#define HW_APBX_CH0_NXTCMDAR (0x110 + 0 * 0x70)
43#define HW_APBX_CH1_NXTCMDAR (0x110 + 1 * 0x70)
44#define HW_APBX_CH2_NXTCMDAR (0x110 + 2 * 0x70)
45#define HW_APBX_CH3_NXTCMDAR (0x110 + 3 * 0x70)
46#define HW_APBX_CH4_NXTCMDAR (0x110 + 4 * 0x70)
47#define HW_APBX_CH5_NXTCMDAR (0x110 + 5 * 0x70)
48#define HW_APBX_CH6_NXTCMDAR (0x110 + 6 * 0x70)
49#define HW_APBX_CH7_NXTCMDAR (0x110 + 7 * 0x70)
50#define HW_APBX_CH8_NXTCMDAR (0x110 + 8 * 0x70)
51#define HW_APBX_CH9_NXTCMDAR (0x110 + 9 * 0x70)
52#define HW_APBX_CH10_NXTCMDAR (0x110 + 10 * 0x70)
53#define HW_APBX_CH11_NXTCMDAR (0x110 + 11 * 0x70)
54#define HW_APBX_CH12_NXTCMDAR (0x110 + 12 * 0x70)
55#define HW_APBX_CH13_NXTCMDAR (0x110 + 13 * 0x70)
56#define HW_APBX_CH14_NXTCMDAR (0x110 + 14 * 0x70)
57#define HW_APBX_CH15_NXTCMDAR (0x110 + 15 * 0x70)
58
59#define HW_APBX_CHn_NXTCMDAR 0x110
60#define BM_APBX_CHn_CMD_COMMAND 0x00000003
61#define BP_APBX_CHn_CMD_COMMAND 0
62#define BV_APBX_CHn_CMD_COMMAND__NO_DMA_XFER 0
63#define BV_APBX_CHn_CMD_COMMAND__DMA_WRITE 1
64#define BV_APBX_CHn_CMD_COMMAND__DMA_READ 2
65#define BV_APBX_CHn_CMD_COMMAND__DMA_SENSE 3
66#define BM_APBX_CHn_CMD_CHAIN 0x00000004
67#define BM_APBX_CHn_CMD_IRQONCMPLT 0x00000008
68#define BM_APBX_CHn_CMD_SEMAPHORE 0x00000040
69#define BM_APBX_CHn_CMD_WAIT4ENDCMD 0x00000080
70#define BM_APBX_CHn_CMD_HALTONTERMINATE 0x00000100
71#define BM_APBX_CHn_CMD_CMDWORDS 0x0000F000
72#define BP_APBX_CHn_CMD_CMDWORDS 12
73#define BM_APBX_CHn_CMD_XFER_COUNT 0xFFFF0000
74#define BP_APBX_CHn_CMD_XFER_COUNT 16
75
76#define HW_APBX_CH0_BAR (0x130 + 0 * 0x70)
77#define HW_APBX_CH1_BAR (0x130 + 1 * 0x70)
78#define HW_APBX_CH2_BAR (0x130 + 2 * 0x70)
79#define HW_APBX_CH3_BAR (0x130 + 3 * 0x70)
80#define HW_APBX_CH4_BAR (0x130 + 4 * 0x70)
81#define HW_APBX_CH5_BAR (0x130 + 5 * 0x70)
82#define HW_APBX_CH6_BAR (0x130 + 6 * 0x70)
83#define HW_APBX_CH7_BAR (0x130 + 7 * 0x70)
84#define HW_APBX_CH8_BAR (0x130 + 8 * 0x70)
85#define HW_APBX_CH9_BAR (0x130 + 9 * 0x70)
86#define HW_APBX_CH10_BAR (0x130 + 10 * 0x70)
87#define HW_APBX_CH11_BAR (0x130 + 11 * 0x70)
88#define HW_APBX_CH12_BAR (0x130 + 12 * 0x70)
89#define HW_APBX_CH13_BAR (0x130 + 13 * 0x70)
90#define HW_APBX_CH14_BAR (0x130 + 14 * 0x70)
91#define HW_APBX_CH15_BAR (0x130 + 15 * 0x70)
92
93#define HW_APBX_CHn_BAR 0x130
94
95#define HW_APBX_CH0_SEMA (0x140 + 0 * 0x70)
96#define HW_APBX_CH1_SEMA (0x140 + 1 * 0x70)
97#define HW_APBX_CH2_SEMA (0x140 + 2 * 0x70)
98#define HW_APBX_CH3_SEMA (0x140 + 3 * 0x70)
99#define HW_APBX_CH4_SEMA (0x140 + 4 * 0x70)
100#define HW_APBX_CH5_SEMA (0x140 + 5 * 0x70)
101#define HW_APBX_CH6_SEMA (0x140 + 6 * 0x70)
102#define HW_APBX_CH7_SEMA (0x140 + 7 * 0x70)
103#define HW_APBX_CH8_SEMA (0x140 + 8 * 0x70)
104#define HW_APBX_CH9_SEMA (0x140 + 9 * 0x70)
105#define HW_APBX_CH10_SEMA (0x140 + 10 * 0x70)
106#define HW_APBX_CH11_SEMA (0x140 + 11 * 0x70)
107#define HW_APBX_CH12_SEMA (0x140 + 12 * 0x70)
108#define HW_APBX_CH13_SEMA (0x140 + 13 * 0x70)
109#define HW_APBX_CH14_SEMA (0x140 + 14 * 0x70)
110#define HW_APBX_CH15_SEMA (0x140 + 15 * 0x70)
111
112#define HW_APBX_CHn_SEMA 0x140
113#define BM_APBX_CHn_SEMA_INCREMENT_SEMA 0x000000FF
114#define BP_APBX_CHn_SEMA_INCREMENT_SEMA 0
115#define BM_APBX_CHn_SEMA_PHORE 0x00FF0000
116#define BP_APBX_CHn_SEMA_PHORE 16
117
118#endif
119
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-audioin.h b/arch/arm/mach-stmp378x/include/mach/regs-audioin.h
deleted file mode 100644
index 641ac6126f83..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-audioin.h
+++ /dev/null
@@ -1,63 +0,0 @@
1/*
2 * stmp378x: AUDIOIN register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_AUDIOIN_BASE (STMP3XXX_REGS_BASE + 0x4C000)
22#define REGS_AUDIOIN_PHYS 0x8004C000
23#define REGS_AUDIOIN_SIZE 0x2000
24
25#define HW_AUDIOIN_CTRL 0x0
26#define BM_AUDIOIN_CTRL_RUN 0x00000001
27#define BP_AUDIOIN_CTRL_RUN 0
28#define BM_AUDIOIN_CTRL_FIFO_ERROR_IRQ_EN 0x00000002
29#define BM_AUDIOIN_CTRL_FIFO_OVERFLOW_IRQ 0x00000004
30#define BM_AUDIOIN_CTRL_FIFO_UNDERFLOW_IRQ 0x00000008
31#define BM_AUDIOIN_CTRL_WORD_LENGTH 0x00000020
32#define BM_AUDIOIN_CTRL_CLKGATE 0x40000000
33#define BM_AUDIOIN_CTRL_SFTRST 0x80000000
34
35#define HW_AUDIOIN_STAT 0x10
36
37#define HW_AUDIOIN_ADCSRR 0x20
38
39#define HW_AUDIOIN_ADCVOLUME 0x30
40#define BM_AUDIOIN_ADCVOLUME_VOLUME_RIGHT 0x000000FF
41#define BP_AUDIOIN_ADCVOLUME_VOLUME_RIGHT 0
42#define BM_AUDIOIN_ADCVOLUME_VOLUME_LEFT 0x00FF0000
43#define BP_AUDIOIN_ADCVOLUME_VOLUME_LEFT 16
44
45#define HW_AUDIOIN_ADCDEBUG 0x40
46
47#define HW_AUDIOIN_ADCVOL 0x50
48#define BM_AUDIOIN_ADCVOL_GAIN_RIGHT 0x0000000F
49#define BP_AUDIOIN_ADCVOL_GAIN_RIGHT 0
50#define BM_AUDIOIN_ADCVOL_SELECT_RIGHT 0x00000030
51#define BP_AUDIOIN_ADCVOL_SELECT_RIGHT 4
52#define BM_AUDIOIN_ADCVOL_GAIN_LEFT 0x00000F00
53#define BP_AUDIOIN_ADCVOL_GAIN_LEFT 8
54#define BM_AUDIOIN_ADCVOL_SELECT_LEFT 0x00003000
55#define BP_AUDIOIN_ADCVOL_SELECT_LEFT 12
56#define BM_AUDIOIN_ADCVOL_MUTE 0x01000000
57
58#define HW_AUDIOIN_MICLINE 0x60
59
60#define HW_AUDIOIN_ANACLKCTRL 0x70
61#define BM_AUDIOIN_ANACLKCTRL_CLKGATE 0x80000000
62
63#define HW_AUDIOIN_DATA 0x80
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-audioout.h b/arch/arm/mach-stmp378x/include/mach/regs-audioout.h
deleted file mode 100644
index f533e23694a0..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-audioout.h
+++ /dev/null
@@ -1,104 +0,0 @@
1/*
2 * stmp378x: AUDIOOUT register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_AUDIOOUT_BASE (STMP3XXX_REGS_BASE + 0x48000)
22#define REGS_AUDIOOUT_PHYS 0x80048000
23#define REGS_AUDIOOUT_SIZE 0x2000
24
25#define HW_AUDIOOUT_CTRL 0x0
26#define BM_AUDIOOUT_CTRL_RUN 0x00000001
27#define BP_AUDIOOUT_CTRL_RUN 0
28#define BM_AUDIOOUT_CTRL_FIFO_ERROR_IRQ_EN 0x00000002
29#define BM_AUDIOOUT_CTRL_FIFO_OVERFLOW_IRQ 0x00000004
30#define BM_AUDIOOUT_CTRL_FIFO_UNDERFLOW_IRQ 0x00000008
31#define BM_AUDIOOUT_CTRL_WORD_LENGTH 0x00000040
32#define BM_AUDIOOUT_CTRL_CLKGATE 0x40000000
33#define BM_AUDIOOUT_CTRL_SFTRST 0x80000000
34
35#define HW_AUDIOOUT_STAT 0x10
36
37#define HW_AUDIOOUT_DACSRR 0x20
38#define BM_AUDIOOUT_DACSRR_SRC_FRAC 0x00001FFF
39#define BP_AUDIOOUT_DACSRR_SRC_FRAC 0
40#define BM_AUDIOOUT_DACSRR_SRC_INT 0x001F0000
41#define BP_AUDIOOUT_DACSRR_SRC_INT 16
42#define BM_AUDIOOUT_DACSRR_SRC_HOLD 0x07000000
43#define BP_AUDIOOUT_DACSRR_SRC_HOLD 24
44#define BM_AUDIOOUT_DACSRR_BASEMULT 0x70000000
45#define BP_AUDIOOUT_DACSRR_BASEMULT 28
46
47#define HW_AUDIOOUT_DACVOLUME 0x30
48#define BM_AUDIOOUT_DACVOLUME_MUTE_RIGHT 0x00000100
49#define BM_AUDIOOUT_DACVOLUME_MUTE_LEFT 0x01000000
50#define BM_AUDIOOUT_DACVOLUME_EN_ZCD 0x02000000
51
52#define HW_AUDIOOUT_DACDEBUG 0x40
53
54#define HW_AUDIOOUT_HPVOL 0x50
55#define BM_AUDIOOUT_HPVOL_MUTE 0x01000000
56#define BM_AUDIOOUT_HPVOL_EN_MSTR_ZCD 0x02000000
57
58#define HW_AUDIOOUT_PWRDN 0x70
59#define BM_AUDIOOUT_PWRDN_HEADPHONE 0x00000001
60#define BP_AUDIOOUT_PWRDN_HEADPHONE 0
61#define BM_AUDIOOUT_PWRDN_CAPLESS 0x00000010
62#define BM_AUDIOOUT_PWRDN_ADC 0x00000100
63#define BM_AUDIOOUT_PWRDN_DAC 0x00001000
64#define BM_AUDIOOUT_PWRDN_RIGHT_ADC 0x00010000
65#define BM_AUDIOOUT_PWRDN_SPEAKER 0x01000000
66
67#define HW_AUDIOOUT_REFCTRL 0x80
68#define BM_AUDIOOUT_REFCTRL_VAG_VAL 0x000000F0
69#define BP_AUDIOOUT_REFCTRL_VAG_VAL 4
70#define BM_AUDIOOUT_REFCTRL_ADC_REFVAL 0x00000F00
71#define BP_AUDIOOUT_REFCTRL_ADC_REFVAL 8
72#define BM_AUDIOOUT_REFCTRL_ADJ_VAG 0x00001000
73#define BM_AUDIOOUT_REFCTRL_ADJ_ADC 0x00002000
74#define BM_AUDIOOUT_REFCTRL_BIAS_CTRL 0x00030000
75#define BP_AUDIOOUT_REFCTRL_BIAS_CTRL 16
76#define BM_AUDIOOUT_REFCTRL_LOW_PWR 0x00080000
77#define BM_AUDIOOUT_REFCTRL_VBG_ADJ 0x00700000
78#define BP_AUDIOOUT_REFCTRL_VBG_ADJ 20
79#define BM_AUDIOOUT_REFCTRL_XTAL_BGR_BIAS 0x01000000
80#define BM_AUDIOOUT_REFCTRL_RAISE_REF 0x02000000
81
82#define HW_AUDIOOUT_ANACTRL 0x90
83#define BM_AUDIOOUT_ANACTRL_HP_CLASSAB 0x00000010
84#define BM_AUDIOOUT_ANACTRL_HP_HOLD_GND 0x00000020
85
86#define HW_AUDIOOUT_TEST 0xA0
87#define BM_AUDIOOUT_TEST_HP_I1_ADJ 0x00C00000
88#define BP_AUDIOOUT_TEST_HP_I1_ADJ 22
89
90#define HW_AUDIOOUT_BISTCTRL 0xB0
91
92#define HW_AUDIOOUT_BISTSTAT0 0xC0
93
94#define HW_AUDIOOUT_BISTSTAT1 0xD0
95
96#define HW_AUDIOOUT_ANACLKCTRL 0xE0
97#define BM_AUDIOOUT_ANACLKCTRL_CLKGATE 0x80000000
98
99#define HW_AUDIOOUT_DATA 0xF0
100
101#define HW_AUDIOOUT_SPEAKERCTRL 0x100
102#define BM_AUDIOOUT_SPEAKERCTRL_MUTE 0x01000000
103
104#define HW_AUDIOOUT_VERSION 0x200
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-bch.h b/arch/arm/mach-stmp378x/include/mach/regs-bch.h
deleted file mode 100644
index 532d24650717..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-bch.h
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2 * stmp378x: BCH register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_BCH_BASE (STMP3XXX_REGS_BASE + 0xA000)
22#define REGS_BCH_PHYS 0x8000A000
23#define REGS_BCH_SIZE 0x2000
24
25#define HW_BCH_CTRL 0x0
26#define BM_BCH_CTRL_COMPLETE_IRQ 0x00000001
27#define BP_BCH_CTRL_COMPLETE_IRQ 0
28#define BM_BCH_CTRL_COMPLETE_IRQ_EN 0x00000100
29
30#define HW_BCH_STATUS0 0x10
31#define BM_BCH_STATUS0_UNCORRECTABLE 0x00000004
32#define BM_BCH_STATUS0_CORRECTED 0x00000008
33#define BM_BCH_STATUS0_STATUS_BLK0 0x0000FF00
34#define BP_BCH_STATUS0_STATUS_BLK0 8
35#define BM_BCH_STATUS0_COMPLETED_CE 0x000F0000
36#define BP_BCH_STATUS0_COMPLETED_CE 16
37
38#define HW_BCH_LAYOUTSELECT 0x70
39
40#define HW_BCH_FLASH0LAYOUT0 0x80
41#define BM_BCH_FLASH0LAYOUT0_DATA0_SIZE 0x00000FFF
42#define BP_BCH_FLASH0LAYOUT0_DATA0_SIZE 0
43#define BM_BCH_FLASH0LAYOUT0_ECC0 0x0000F000
44#define BP_BCH_FLASH0LAYOUT0_ECC0 12
45#define BM_BCH_FLASH0LAYOUT0_META_SIZE 0x00FF0000
46#define BP_BCH_FLASH0LAYOUT0_META_SIZE 16
47#define BM_BCH_FLASH0LAYOUT0_NBLOCKS 0xFF000000
48#define BP_BCH_FLASH0LAYOUT0_NBLOCKS 24
49#define BM_BCH_FLASH0LAYOUT1_DATAN_SIZE 0x00000FFF
50#define BP_BCH_FLASH0LAYOUT1_DATAN_SIZE 0
51#define BM_BCH_FLASH0LAYOUT1_ECCN 0x0000F000
52#define BP_BCH_FLASH0LAYOUT1_ECCN 12
53#define BM_BCH_FLASH0LAYOUT1_PAGE_SIZE 0xFFFF0000
54#define BP_BCH_FLASH0LAYOUT1_PAGE_SIZE 16
55
56#define HW_BCH_BLOCKNAME 0x150
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-clkctrl.h b/arch/arm/mach-stmp378x/include/mach/regs-clkctrl.h
deleted file mode 100644
index 7c546afd57a3..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-clkctrl.h
+++ /dev/null
@@ -1,88 +0,0 @@
1/*
2 * stmp378x: CLKCTRL register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#ifndef _MACH_REGS_CLKCTRL
22#define _MACH_REGS_CLKCTRL
23
24#define REGS_CLKCTRL_BASE (STMP3XXX_REGS_BASE + 0x40000)
25#define REGS_CLKCTRL_PHYS 0x80040000
26#define REGS_CLKCTRL_SIZE 0x2000
27
28#define HW_CLKCTRL_PLLCTRL0 0x0
29#define BM_CLKCTRL_PLLCTRL0_EN_USB_CLKS 0x00040000
30
31#define HW_CLKCTRL_CPU 0x20
32#define BM_CLKCTRL_CPU_DIV_CPU 0x0000003F
33#define BP_CLKCTRL_CPU_DIV_CPU 0
34
35#define HW_CLKCTRL_HBUS 0x30
36#define BM_CLKCTRL_HBUS_DIV 0x0000001F
37#define BP_CLKCTRL_HBUS_DIV 0
38#define BM_CLKCTRL_HBUS_DIV_FRAC_EN 0x00000020
39
40#define HW_CLKCTRL_XBUS 0x40
41
42#define HW_CLKCTRL_XTAL 0x50
43#define BM_CLKCTRL_XTAL_DRI_CLK24M_GATE 0x10000000
44
45#define HW_CLKCTRL_PIX 0x60
46#define BM_CLKCTRL_PIX_DIV 0x00000FFF
47#define BP_CLKCTRL_PIX_DIV 0
48#define BM_CLKCTRL_PIX_CLKGATE 0x80000000
49
50#define HW_CLKCTRL_SSP 0x70
51
52#define HW_CLKCTRL_GPMI 0x80
53
54#define HW_CLKCTRL_SPDIF 0x90
55
56#define HW_CLKCTRL_EMI 0xA0
57#define BM_CLKCTRL_EMI_DIV_EMI 0x0000003F
58#define BP_CLKCTRL_EMI_DIV_EMI 0
59#define BM_CLKCTRL_EMI_DCC_RESYNC_ENABLE 0x00010000
60#define BM_CLKCTRL_EMI_BUSY_DCC_RESYNC 0x00020000
61#define BM_CLKCTRL_EMI_BUSY_REF_EMI 0x10000000
62#define BM_CLKCTRL_EMI_BUSY_REF_XTAL 0x20000000
63
64#define HW_CLKCTRL_IR 0xB0
65
66#define HW_CLKCTRL_SAIF 0xC0
67
68#define HW_CLKCTRL_TV 0xD0
69
70#define HW_CLKCTRL_ETM 0xE0
71
72#define HW_CLKCTRL_FRAC 0xF0
73#define BM_CLKCTRL_FRAC_EMIFRAC 0x00003F00
74#define BP_CLKCTRL_FRAC_EMIFRAC 8
75#define BM_CLKCTRL_FRAC_PIXFRAC 0x003F0000
76#define BP_CLKCTRL_FRAC_PIXFRAC 16
77#define BM_CLKCTRL_FRAC_CLKGATEPIX 0x00800000
78
79#define HW_CLKCTRL_FRAC1 0x100
80
81#define HW_CLKCTRL_CLKSEQ 0x110
82#define BM_CLKCTRL_CLKSEQ_BYPASS_PIX 0x00000002
83
84#define HW_CLKCTRL_RESET 0x120
85#define BM_CLKCTRL_RESET_DIG 0x00000001
86#define BP_CLKCTRL_RESET_DIG 0
87
88#endif
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-dcp.h b/arch/arm/mach-stmp378x/include/mach/regs-dcp.h
deleted file mode 100644
index fdedd00c0e28..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-dcp.h
+++ /dev/null
@@ -1,87 +0,0 @@
1/*
2 * stmp378x: DCP register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_DCP_BASE (STMP3XXX_REGS_BASE + 0x28000)
22#define REGS_DCP_PHYS 0x80028000
23#define REGS_DCP_SIZE 0x2000
24
25#define HW_DCP_CTRL 0x0
26#define BM_DCP_CTRL_CHANNEL_INTERRUPT_ENABLE 0x000000FF
27#define BP_DCP_CTRL_CHANNEL_INTERRUPT_ENABLE 0
28#define BM_DCP_CTRL_ENABLE_CONTEXT_CACHING 0x00400000
29#define BM_DCP_CTRL_GATHER_RESIDUAL_WRITES 0x00800000
30#define BM_DCP_CTRL_CLKGATE 0x40000000
31#define BM_DCP_CTRL_SFTRST 0x80000000
32
33#define HW_DCP_STAT 0x10
34#define BM_DCP_STAT_IRQ 0x0000000F
35#define BP_DCP_STAT_IRQ 0
36
37#define HW_DCP_CHANNELCTRL 0x20
38#define BM_DCP_CHANNELCTRL_ENABLE_CHANNEL 0x000000FF
39#define BP_DCP_CHANNELCTRL_ENABLE_CHANNEL 0
40
41#define HW_DCP_CONTEXT 0x50
42#define BM_DCP_PACKET1_INTERRUPT 0x00000001
43#define BP_DCP_PACKET1_INTERRUPT 0
44#define BM_DCP_PACKET1_DECR_SEMAPHORE 0x00000002
45#define BM_DCP_PACKET1_CHAIN 0x00000004
46#define BM_DCP_PACKET1_CHAIN_CONTIGUOUS 0x00000008
47#define BM_DCP_PACKET1_ENABLE_CIPHER 0x00000020
48#define BM_DCP_PACKET1_ENABLE_HASH 0x00000040
49#define BM_DCP_PACKET1_CIPHER_ENCRYPT 0x00000100
50#define BM_DCP_PACKET1_CIPHER_INIT 0x00000200
51#define BM_DCP_PACKET1_OTP_KEY 0x00000400
52#define BM_DCP_PACKET1_PAYLOAD_KEY 0x00000800
53#define BM_DCP_PACKET1_HASH_INIT 0x00001000
54#define BM_DCP_PACKET1_HASH_TERM 0x00002000
55#define BM_DCP_PACKET2_CIPHER_SELECT 0x0000000F
56#define BP_DCP_PACKET2_CIPHER_SELECT 0
57#define BM_DCP_PACKET2_CIPHER_MODE 0x000000F0
58#define BP_DCP_PACKET2_CIPHER_MODE 4
59#define BM_DCP_PACKET2_KEY_SELECT 0x0000FF00
60#define BP_DCP_PACKET2_KEY_SELECT 8
61#define BM_DCP_PACKET2_HASH_SELECT 0x000F0000
62#define BP_DCP_PACKET2_HASH_SELECT 16
63#define BM_DCP_PACKET2_CIPHER_CFG 0xFF000000
64#define BP_DCP_PACKET2_CIPHER_CFG 24
65
66#define HW_DCP_CH0CMDPTR (0x100 + 0 * 0x40)
67#define HW_DCP_CH1CMDPTR (0x100 + 1 * 0x40)
68#define HW_DCP_CH2CMDPTR (0x100 + 2 * 0x40)
69#define HW_DCP_CH3CMDPTR (0x100 + 3 * 0x40)
70
71#define HW_DCP_CHnCMDPTR 0x100
72
73#define HW_DCP_CH0SEMA (0x110 + 0 * 0x40)
74#define HW_DCP_CH1SEMA (0x110 + 1 * 0x40)
75#define HW_DCP_CH2SEMA (0x110 + 2 * 0x40)
76#define HW_DCP_CH3SEMA (0x110 + 3 * 0x40)
77
78#define HW_DCP_CHnSEMA 0x110
79#define BM_DCP_CHnSEMA_INCREMENT 0x000000FF
80#define BP_DCP_CHnSEMA_INCREMENT 0
81
82#define HW_DCP_CH0STAT (0x120 + 0 * 0x40)
83#define HW_DCP_CH1STAT (0x120 + 1 * 0x40)
84#define HW_DCP_CH2STAT (0x120 + 2 * 0x40)
85#define HW_DCP_CH3STAT (0x120 + 3 * 0x40)
86
87#define HW_DCP_CHnSTAT 0x120
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-digctl.h b/arch/arm/mach-stmp378x/include/mach/regs-digctl.h
deleted file mode 100644
index 5293005523b3..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-digctl.h
+++ /dev/null
@@ -1,38 +0,0 @@
1/*
2 * stmp378x: DIGCTL register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_DIGCTL_BASE (STMP3XXX_REGS_BASE + 0x1C000)
22#define REGS_DIGCTL_PHYS 0x8001C000
23#define REGS_DIGCTL_SIZE 0x2000
24
25#define HW_DIGCTL_CTRL 0x0
26#define BM_DIGCTL_CTRL_USB_CLKGATE 0x00000004
27
28#define HW_DIGCTL_ARMCACHE 0x2B0
29#define BM_DIGCTL_ARMCACHE_ITAG_SS 0x00000003
30#define BP_DIGCTL_ARMCACHE_ITAG_SS 0
31#define BM_DIGCTL_ARMCACHE_DTAG_SS 0x00000030
32#define BP_DIGCTL_ARMCACHE_DTAG_SS 4
33#define BM_DIGCTL_ARMCACHE_CACHE_SS 0x00000300
34#define BP_DIGCTL_ARMCACHE_CACHE_SS 8
35#define BM_DIGCTL_ARMCACHE_DRTY_SS 0x00003000
36#define BP_DIGCTL_ARMCACHE_DRTY_SS 12
37#define BM_DIGCTL_ARMCACHE_VALID_SS 0x00030000
38#define BP_DIGCTL_ARMCACHE_VALID_SS 16
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-dram.h b/arch/arm/mach-stmp378x/include/mach/regs-dram.h
deleted file mode 100644
index 02851431677c..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-dram.h
+++ /dev/null
@@ -1,27 +0,0 @@
1/*
2 * stmp378x: DRAM register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_DRAM_BASE (STMP3XXX_REGS_BASE + 0xE0000)
22#define REGS_DRAM_PHYS 0x800E0000
23#define REGS_DRAM_SIZE 0x2000
24
25#define HW_DRAM_CTL06 0x18
26
27#define HW_DRAM_CTL08 0x20
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-dri.h b/arch/arm/mach-stmp378x/include/mach/regs-dri.h
deleted file mode 100644
index da25f7e397e5..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-dri.h
+++ /dev/null
@@ -1,45 +0,0 @@
1/*
2 * stmp378x: DRI register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_DRI_BASE (STMP3XXX_REGS_BASE + 0x74000)
22#define REGS_DRI_PHYS 0x80074000
23#define REGS_DRI_SIZE 0x2000
24
25#define HW_DRI_CTRL 0x0
26#define BM_DRI_CTRL_RUN 0x00000001
27#define BP_DRI_CTRL_RUN 0
28#define BM_DRI_CTRL_ATTENTION_IRQ 0x00000002
29#define BM_DRI_CTRL_PILOT_SYNC_LOSS_IRQ 0x00000004
30#define BM_DRI_CTRL_OVERFLOW_IRQ 0x00000008
31#define BM_DRI_CTRL_ATTENTION_IRQ_EN 0x00000200
32#define BM_DRI_CTRL_PILOT_SYNC_LOSS_IRQ_EN 0x00000400
33#define BM_DRI_CTRL_OVERFLOW_IRQ_EN 0x00000800
34#define BM_DRI_CTRL_REACQUIRE_PHASE 0x00008000
35#define BM_DRI_CTRL_STOP_ON_PILOT_ERROR 0x02000000
36#define BM_DRI_CTRL_STOP_ON_OFLOW_ERROR 0x04000000
37#define BM_DRI_CTRL_ENABLE_INPUTS 0x20000000
38#define BM_DRI_CTRL_CLKGATE 0x40000000
39#define BM_DRI_CTRL_SFTRST 0x80000000
40
41#define HW_DRI_TIMING 0x10
42#define BM_DRI_TIMING_GAP_DETECTION_INTERVAL 0x000000FF
43#define BP_DRI_TIMING_GAP_DETECTION_INTERVAL 0
44#define BM_DRI_TIMING_PILOT_REP_RATE 0x000F0000
45#define BP_DRI_TIMING_PILOT_REP_RATE 16
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-ecc8.h b/arch/arm/mach-stmp378x/include/mach/regs-ecc8.h
deleted file mode 100644
index cc353bec331b..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-ecc8.h
+++ /dev/null
@@ -1,39 +0,0 @@
1/*
2 * stmp378x: ECC8 register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_ECC8_BASE (STMP3XXX_REGS_BASE + 0x8000)
22#define REGS_ECC8_PHYS 0x80008000
23#define REGS_ECC8_SIZE 0x2000
24
25#define HW_ECC8_CTRL 0x0
26#define BM_ECC8_CTRL_COMPLETE_IRQ 0x00000001
27#define BP_ECC8_CTRL_COMPLETE_IRQ 0
28#define BM_ECC8_CTRL_COMPLETE_IRQ_EN 0x00000100
29#define BM_ECC8_CTRL_AHBM_SFTRST 0x20000000
30
31#define HW_ECC8_STATUS0 0x10
32#define BM_ECC8_STATUS0_UNCORRECTABLE 0x00000004
33#define BM_ECC8_STATUS0_CORRECTED 0x00000008
34#define BM_ECC8_STATUS0_STATUS_AUX 0x00000F00
35#define BP_ECC8_STATUS0_STATUS_AUX 8
36#define BM_ECC8_STATUS0_COMPLETED_CE 0x000F0000
37#define BP_ECC8_STATUS0_COMPLETED_CE 16
38
39#define HW_ECC8_STATUS1 0x20
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-emi.h b/arch/arm/mach-stmp378x/include/mach/regs-emi.h
deleted file mode 100644
index 98773fc33d7b..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-emi.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * stmp378x: EMI register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_EMI_BASE (STMP3XXX_REGS_BASE + 0x20000)
22#define REGS_EMI_PHYS 0x80020000
23#define REGS_EMI_SIZE 0x2000
24
25#define HW_EMI_STAT 0x10
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-gpmi.h b/arch/arm/mach-stmp378x/include/mach/regs-gpmi.h
deleted file mode 100644
index 2cc8bbe91687..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-gpmi.h
+++ /dev/null
@@ -1,78 +0,0 @@
1/*
2 * stmp378x: GPMI register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_GPMI_BASE (STMP3XXX_REGS_BASE + 0xC000)
22#define REGS_GPMI_PHYS 0x8000C000
23#define REGS_GPMI_SIZE 0x2000
24
25#define HW_GPMI_CTRL0 0x0
26#define BM_GPMI_CTRL0_XFER_COUNT 0x0000FFFF
27#define BP_GPMI_CTRL0_XFER_COUNT 0
28#define BM_GPMI_CTRL0_CS 0x00300000
29#define BP_GPMI_CTRL0_CS 20
30#define BM_GPMI_CTRL0_LOCK_CS 0x00400000
31#define BM_GPMI_CTRL0_WORD_LENGTH 0x00800000
32#define BM_GPMI_CTRL0_ADDRESS 0x000E0000
33#define BP_GPMI_CTRL0_ADDRESS 17
34#define BV_GPMI_CTRL0_ADDRESS__NAND_DATA 0x0
35#define BV_GPMI_CTRL0_ADDRESS__NAND_CLE 0x1
36#define BV_GPMI_CTRL0_ADDRESS__NAND_ALE 0x2
37#define BM_GPMI_CTRL0_ADDRESS_INCREMENT 0x00010000
38#define BM_GPMI_CTRL0_COMMAND_MODE 0x03000000
39#define BP_GPMI_CTRL0_COMMAND_MODE 24
40#define BV_GPMI_CTRL0_COMMAND_MODE__WRITE 0x0
41#define BV_GPMI_CTRL0_COMMAND_MODE__READ 0x1
42#define BV_GPMI_CTRL0_COMMAND_MODE__READ_AND_COMPARE 0x2
43#define BV_GPMI_CTRL0_COMMAND_MODE__WAIT_FOR_READY 0x3
44#define BM_GPMI_CTRL0_RUN 0x20000000
45#define BM_GPMI_CTRL0_CLKGATE 0x40000000
46#define BM_GPMI_CTRL0_SFTRST 0x80000000
47#define BM_GPMI_ECCCTRL_BUFFER_MASK 0x000001FF
48#define BP_GPMI_ECCCTRL_BUFFER_MASK 0
49#define BM_GPMI_ECCCTRL_ENABLE_ECC 0x00001000
50#define BM_GPMI_ECCCTRL_ECC_CMD 0x00006000
51#define BP_GPMI_ECCCTRL_ECC_CMD 13
52#define BV_GPMI_ECCCTRL_ECC_CMD__DECODE_4_BIT 0
53#define BV_GPMI_ECCCTRL_ECC_CMD__ENCODE_4_BIT 1
54#define BV_GPMI_ECCCTRL_ECC_CMD__DECODE_8_BIT 2
55#define BV_GPMI_ECCCTRL_ECC_CMD__ENCODE_8_BIT 3
56
57#define HW_GPMI_CTRL1 0x60
58#define BM_GPMI_CTRL1_GPMI_MODE 0x00000001
59#define BP_GPMI_CTRL1_GPMI_MODE 0
60#define BM_GPMI_CTRL1_ATA_IRQRDY_POLARITY 0x00000004
61#define BM_GPMI_CTRL1_DEV_RESET 0x00000008
62#define BM_GPMI_CTRL1_TIMEOUT_IRQ 0x00000200
63#define BM_GPMI_CTRL1_DEV_IRQ 0x00000400
64#define BM_GPMI_CTRL1_RDN_DELAY 0x0000F000
65#define BP_GPMI_CTRL1_RDN_DELAY 12
66#define BM_GPMI_CTRL1_BCH_MODE 0x00040000
67
68#define HW_GPMI_TIMING0 0x70
69#define BM_GPMI_TIMING0_DATA_SETUP 0x000000FF
70#define BP_GPMI_TIMING0_DATA_SETUP 0
71#define BM_GPMI_TIMING0_DATA_HOLD 0x0000FF00
72#define BP_GPMI_TIMING0_DATA_HOLD 8
73#define BM_GPMI_TIMING0_ADDRESS_SETUP 0x00FF0000
74#define BP_GPMI_TIMING0_ADDRESS_SETUP 16
75
76#define HW_GPMI_TIMING1 0x80
77#define BM_GPMI_TIMING1_DEVICE_BUSY_TIMEOUT 0xFFFF0000
78#define BP_GPMI_TIMING1_DEVICE_BUSY_TIMEOUT 16
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-i2c.h b/arch/arm/mach-stmp378x/include/mach/regs-i2c.h
deleted file mode 100644
index 13a234c99433..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-i2c.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * stmp378x: I2C register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_I2C_BASE (STMP3XXX_REGS_BASE + 0x58000)
22#define REGS_I2C_PHYS 0x80058000
23#define REGS_I2C_SIZE 0x2000
24
25#define HW_I2C_CTRL0 0x0
26#define BM_I2C_CTRL0_XFER_COUNT 0x0000FFFF
27#define BP_I2C_CTRL0_XFER_COUNT 0
28#define BM_I2C_CTRL0_DIRECTION 0x00010000
29#define BM_I2C_CTRL0_MASTER_MODE 0x00020000
30#define BM_I2C_CTRL0_PRE_SEND_START 0x00080000
31#define BM_I2C_CTRL0_POST_SEND_STOP 0x00100000
32#define BM_I2C_CTRL0_RETAIN_CLOCK 0x00200000
33#define BM_I2C_CTRL0_SEND_NAK_ON_LAST 0x02000000
34#define BM_I2C_CTRL0_CLKGATE 0x40000000
35#define BM_I2C_CTRL0_SFTRST 0x80000000
36
37#define HW_I2C_TIMING0 0x10
38
39#define HW_I2C_TIMING1 0x20
40
41#define HW_I2C_TIMING2 0x30
42
43#define HW_I2C_CTRL1 0x40
44#define BM_I2C_CTRL1_SLAVE_IRQ 0x00000001
45#define BP_I2C_CTRL1_SLAVE_IRQ 0
46#define BM_I2C_CTRL1_SLAVE_STOP_IRQ 0x00000002
47#define BM_I2C_CTRL1_MASTER_LOSS_IRQ 0x00000004
48#define BM_I2C_CTRL1_EARLY_TERM_IRQ 0x00000008
49#define BM_I2C_CTRL1_OVERSIZE_XFER_TERM_IRQ 0x00000010
50#define BM_I2C_CTRL1_NO_SLAVE_ACK_IRQ 0x00000020
51#define BM_I2C_CTRL1_DATA_ENGINE_CMPLT_IRQ 0x00000040
52#define BM_I2C_CTRL1_BUS_FREE_IRQ 0x00000080
53#define BM_I2C_CTRL1_CLR_GOT_A_NAK 0x10000000
54
55#define HW_I2C_VERSION 0x90
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-icoll.h b/arch/arm/mach-stmp378x/include/mach/regs-icoll.h
deleted file mode 100644
index f996e80f40e7..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-icoll.h
+++ /dev/null
@@ -1,45 +0,0 @@
1/*
2 * stmp378x: ICOLL register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#ifndef _MACH_REGS_ICOLL
22#define _MACH_REGS_ICOLL
23
24#define REGS_ICOLL_BASE (STMP3XXX_REGS_BASE + 0x0)
25#define REGS_ICOLL_PHYS 0x80000000
26#define REGS_ICOLL_SIZE 0x2000
27
28#define HW_ICOLL_VECTOR 0x0
29
30#define HW_ICOLL_LEVELACK 0x10
31#define BM_ICOLL_LEVELACK_IRQLEVELACK 0x0000000F
32#define BP_ICOLL_LEVELACK_IRQLEVELACK 0
33
34#define HW_ICOLL_CTRL 0x20
35#define BM_ICOLL_CTRL_CLKGATE 0x40000000
36#define BM_ICOLL_CTRL_SFTRST 0x80000000
37
38#define HW_ICOLL_STAT 0x70
39
40#define HW_ICOLL_INTERRUPTn 0x120
41
42#define HW_ICOLL_INTERRUPTn 0x120
43#define BM_ICOLL_INTERRUPTn_ENABLE 0x00000004
44
45#endif
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-ir.h b/arch/arm/mach-stmp378x/include/mach/regs-ir.h
deleted file mode 100644
index a5b4ef10fab8..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-ir.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * stmp378x: IR register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_IR_BASE (STMP3XXX_REGS_BASE + 0x78000)
22#define REGS_IR_PHYS 0x80078000
23#define REGS_IR_SIZE 0x2000
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-lcdif.h b/arch/arm/mach-stmp378x/include/mach/regs-lcdif.h
deleted file mode 100644
index 9cdbef4badc3..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-lcdif.h
+++ /dev/null
@@ -1,195 +0,0 @@
1/*
2 * stmp378x: LCDIF register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_LCDIF_BASE (STMP3XXX_REGS_BASE + 0x30000)
22#define REGS_LCDIF_PHYS 0x80030000
23#define REGS_LCDIF_SIZE 0x2000
24
25#define HW_LCDIF_CTRL 0x0
26#define BM_LCDIF_CTRL_RUN 0x00000001
27#define BP_LCDIF_CTRL_RUN 0
28#define BM_LCDIF_CTRL_LCDIF_MASTER 0x00000020
29#define BM_LCDIF_CTRL_RGB_TO_YCBCR422_CSC 0x00000080
30#define BM_LCDIF_CTRL_WORD_LENGTH 0x00000300
31#define BP_LCDIF_CTRL_WORD_LENGTH 8
32#define BM_LCDIF_CTRL_LCD_DATABUS_WIDTH 0x00000C00
33#define BP_LCDIF_CTRL_LCD_DATABUS_WIDTH 10
34#define BM_LCDIF_CTRL_INPUT_DATA_SWIZZLE 0x0000C000
35#define BP_LCDIF_CTRL_INPUT_DATA_SWIZZLE 14
36#define BM_LCDIF_CTRL_DATA_SELECT 0x00010000
37#define BM_LCDIF_CTRL_DOTCLK_MODE 0x00020000
38#define BM_LCDIF_CTRL_VSYNC_MODE 0x00040000
39#define BM_LCDIF_CTRL_BYPASS_COUNT 0x00080000
40#define BM_LCDIF_CTRL_DVI_MODE 0x00100000
41#define BM_LCDIF_CTRL_SHIFT_NUM_BITS 0x03E00000
42#define BP_LCDIF_CTRL_SHIFT_NUM_BITS 21
43#define BM_LCDIF_CTRL_DATA_SHIFT_DIR 0x04000000
44#define BM_LCDIF_CTRL_WAIT_FOR_VSYNC_EDGE 0x08000000
45#define BM_LCDIF_CTRL_CLKGATE 0x40000000
46#define BM_LCDIF_CTRL_SFTRST 0x80000000
47
48#define HW_LCDIF_CTRL1 0x10
49#define BM_LCDIF_CTRL1_RESET 0x00000001
50#define BP_LCDIF_CTRL1_RESET 0
51#define BM_LCDIF_CTRL1_MODE86 0x00000002
52#define BM_LCDIF_CTRL1_BUSY_ENABLE 0x00000004
53#define BM_LCDIF_CTRL1_VSYNC_EDGE_IRQ 0x00000100
54#define BM_LCDIF_CTRL1_CUR_FRAME_DONE_IRQ 0x00000200
55#define BM_LCDIF_CTRL1_UNDERFLOW_IRQ 0x00000400
56#define BM_LCDIF_CTRL1_OVERFLOW_IRQ 0x00000800
57#define BM_LCDIF_CTRL1_VSYNC_EDGE_IRQ_EN 0x00001000
58#define BM_LCDIF_CTRL1_BYTE_PACKING_FORMAT 0x000F0000
59#define BP_LCDIF_CTRL1_BYTE_PACKING_FORMAT 16
60#define BM_LCDIF_CTRL1_INTERLACE_FIELDS 0x00800000
61#define BM_LCDIF_CTRL1_RECOVER_ON_UNDERFLOW 0x01000000
62
63#define HW_LCDIF_TRANSFER_COUNT 0x20
64#define BM_LCDIF_TRANSFER_COUNT_H_COUNT 0x0000FFFF
65#define BP_LCDIF_TRANSFER_COUNT_H_COUNT 0
66#define BM_LCDIF_TRANSFER_COUNT_V_COUNT 0xFFFF0000
67#define BP_LCDIF_TRANSFER_COUNT_V_COUNT 16
68
69#define HW_LCDIF_CUR_BUF 0x30
70
71#define HW_LCDIF_NEXT_BUF 0x40
72
73#define HW_LCDIF_TIMING 0x60
74
75#define HW_LCDIF_VDCTRL0 0x70
76#define BM_LCDIF_VDCTRL0_VSYNC_PULSE_WIDTH 0x0003FFFF
77#define BP_LCDIF_VDCTRL0_VSYNC_PULSE_WIDTH 0
78#define BM_LCDIF_VDCTRL0_VSYNC_PULSE_WIDTH_UNIT 0x00100000
79#define BM_LCDIF_VDCTRL0_VSYNC_PERIOD_UNIT 0x00200000
80#define BM_LCDIF_VDCTRL0_ENABLE_POL 0x01000000
81#define BM_LCDIF_VDCTRL0_DOTCLK_POL 0x02000000
82#define BM_LCDIF_VDCTRL0_HSYNC_POL 0x04000000
83#define BM_LCDIF_VDCTRL0_VSYNC_POL 0x08000000
84#define BM_LCDIF_VDCTRL0_ENABLE_PRESENT 0x10000000
85#define BM_LCDIF_VDCTRL0_VSYNC_OEB 0x20000000
86
87#define HW_LCDIF_VDCTRL1 0x80
88#define BM_LCDIF_VDCTRL1_VSYNC_PERIOD 0xFFFFFFFF
89#define BP_LCDIF_VDCTRL1_VSYNC_PERIOD 0
90
91#define HW_LCDIF_VDCTRL2 0x90
92#define BM_LCDIF_VDCTRL2_HSYNC_PERIOD 0x0003FFFF
93#define BP_LCDIF_VDCTRL2_HSYNC_PERIOD 0
94#define BM_LCDIF_VDCTRL2_HSYNC_PULSE_WIDTH 0xFF000000
95#define BP_LCDIF_VDCTRL2_HSYNC_PULSE_WIDTH 24
96
97#define HW_LCDIF_VDCTRL3 0xA0
98#define BM_LCDIF_VDCTRL3_VERTICAL_WAIT_CNT 0x0000FFFF
99#define BP_LCDIF_VDCTRL3_VERTICAL_WAIT_CNT 0
100#define BM_LCDIF_VDCTRL3_HORIZONTAL_WAIT_CNT 0x0FFF0000
101#define BP_LCDIF_VDCTRL3_HORIZONTAL_WAIT_CNT 16
102
103#define HW_LCDIF_VDCTRL4 0xB0
104#define BM_LCDIF_VDCTRL4_DOTCLK_H_VALID_DATA_CNT 0x0003FFFF
105#define BP_LCDIF_VDCTRL4_DOTCLK_H_VALID_DATA_CNT 0
106#define BM_LCDIF_VDCTRL4_SYNC_SIGNALS_ON 0x00040000
107
108#define HW_LCDIF_DVICTRL0 0xC0
109#define BM_LCDIF_DVICTRL0_V_LINES_CNT 0x000003FF
110#define BP_LCDIF_DVICTRL0_V_LINES_CNT 0
111#define BM_LCDIF_DVICTRL0_H_BLANKING_CNT 0x000FFC00
112#define BP_LCDIF_DVICTRL0_H_BLANKING_CNT 10
113#define BM_LCDIF_DVICTRL0_H_ACTIVE_CNT 0x7FF00000
114#define BP_LCDIF_DVICTRL0_H_ACTIVE_CNT 20
115
116#define HW_LCDIF_DVICTRL1 0xD0
117#define BM_LCDIF_DVICTRL1_F2_START_LINE 0x000003FF
118#define BP_LCDIF_DVICTRL1_F2_START_LINE 0
119#define BM_LCDIF_DVICTRL1_F1_END_LINE 0x000FFC00
120#define BP_LCDIF_DVICTRL1_F1_END_LINE 10
121#define BM_LCDIF_DVICTRL1_F1_START_LINE 0x3FF00000
122#define BP_LCDIF_DVICTRL1_F1_START_LINE 20
123
124#define HW_LCDIF_DVICTRL2 0xE0
125#define BM_LCDIF_DVICTRL2_V1_BLANK_END_LINE 0x000003FF
126#define BP_LCDIF_DVICTRL2_V1_BLANK_END_LINE 0
127#define BM_LCDIF_DVICTRL2_V1_BLANK_START_LINE 0x000FFC00
128#define BP_LCDIF_DVICTRL2_V1_BLANK_START_LINE 10
129#define BM_LCDIF_DVICTRL2_F2_END_LINE 0x3FF00000
130#define BP_LCDIF_DVICTRL2_F2_END_LINE 20
131
132#define HW_LCDIF_DVICTRL3 0xF0
133#define BM_LCDIF_DVICTRL3_V2_BLANK_END_LINE 0x000003FF
134#define BP_LCDIF_DVICTRL3_V2_BLANK_END_LINE 0
135#define BM_LCDIF_DVICTRL3_V2_BLANK_START_LINE 0x03FF0000
136#define BP_LCDIF_DVICTRL3_V2_BLANK_START_LINE 16
137
138#define HW_LCDIF_DVICTRL4 0x100
139#define BM_LCDIF_DVICTRL4_H_FILL_CNT 0x000000FF
140#define BP_LCDIF_DVICTRL4_H_FILL_CNT 0
141#define BM_LCDIF_DVICTRL4_CR_FILL_VALUE 0x0000FF00
142#define BP_LCDIF_DVICTRL4_CR_FILL_VALUE 8
143#define BM_LCDIF_DVICTRL4_CB_FILL_VALUE 0x00FF0000
144#define BP_LCDIF_DVICTRL4_CB_FILL_VALUE 16
145#define BM_LCDIF_DVICTRL4_Y_FILL_VALUE 0xFF000000
146#define BP_LCDIF_DVICTRL4_Y_FILL_VALUE 24
147
148#define HW_LCDIF_CSC_COEFF0 0x110
149#define BM_LCDIF_CSC_COEFF0_CSC_SUBSAMPLE_FILTER 0x00000003
150#define BP_LCDIF_CSC_COEFF0_CSC_SUBSAMPLE_FILTER 0
151#define BM_LCDIF_CSC_COEFF0_C0 0x03FF0000
152#define BP_LCDIF_CSC_COEFF0_C0 16
153
154#define HW_LCDIF_CSC_COEFF1 0x120
155#define BM_LCDIF_CSC_COEFF1_C1 0x000003FF
156#define BP_LCDIF_CSC_COEFF1_C1 0
157#define BM_LCDIF_CSC_COEFF1_C2 0x03FF0000
158#define BP_LCDIF_CSC_COEFF1_C2 16
159
160#define HW_LCDIF_CSC_COEFF2 0x130
161#define BM_LCDIF_CSC_COEFF2_C3 0x000003FF
162#define BP_LCDIF_CSC_COEFF2_C3 0
163#define BM_LCDIF_CSC_COEFF2_C4 0x03FF0000
164#define BP_LCDIF_CSC_COEFF2_C4 16
165
166#define HW_LCDIF_CSC_COEFF3 0x140
167#define BM_LCDIF_CSC_COEFF3_C5 0x000003FF
168#define BP_LCDIF_CSC_COEFF3_C5 0
169#define BM_LCDIF_CSC_COEFF3_C6 0x03FF0000
170#define BP_LCDIF_CSC_COEFF3_C6 16
171
172#define HW_LCDIF_CSC_COEFF4 0x150
173#define BM_LCDIF_CSC_COEFF4_C7 0x000003FF
174#define BP_LCDIF_CSC_COEFF4_C7 0
175#define BM_LCDIF_CSC_COEFF4_C8 0x03FF0000
176#define BP_LCDIF_CSC_COEFF4_C8 16
177
178#define HW_LCDIF_CSC_OFFSET 0x160
179#define BM_LCDIF_CSC_OFFSET_Y_OFFSET 0x000001FF
180#define BP_LCDIF_CSC_OFFSET_Y_OFFSET 0
181#define BM_LCDIF_CSC_OFFSET_CBCR_OFFSET 0x01FF0000
182#define BP_LCDIF_CSC_OFFSET_CBCR_OFFSET 16
183
184#define HW_LCDIF_CSC_LIMIT 0x170
185#define BM_LCDIF_CSC_LIMIT_Y_MAX 0x000000FF
186#define BP_LCDIF_CSC_LIMIT_Y_MAX 0
187#define BM_LCDIF_CSC_LIMIT_Y_MIN 0x0000FF00
188#define BP_LCDIF_CSC_LIMIT_Y_MIN 8
189#define BM_LCDIF_CSC_LIMIT_CBCR_MAX 0x00FF0000
190#define BP_LCDIF_CSC_LIMIT_CBCR_MAX 16
191#define BM_LCDIF_CSC_LIMIT_CBCR_MIN 0xFF000000
192#define BP_LCDIF_CSC_LIMIT_CBCR_MIN 24
193
194#define HW_LCDIF_STAT 0x1D0
195#define BM_LCDIF_STAT_TXFIFO_EMPTY 0x04000000
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-lradc.h b/arch/arm/mach-stmp378x/include/mach/regs-lradc.h
deleted file mode 100644
index cb8cb06f8277..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-lradc.h
+++ /dev/null
@@ -1,99 +0,0 @@
1/*
2 * stmp378x: LRADC register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_LRADC_BASE (STMP3XXX_REGS_BASE + 0x50000)
22#define REGS_LRADC_PHYS 0x80050000
23#define REGS_LRADC_SIZE 0x2000
24
25#define HW_LRADC_CTRL0 0x0
26#define BM_LRADC_CTRL0_SCHEDULE 0x000000FF
27#define BP_LRADC_CTRL0_SCHEDULE 0
28#define BM_LRADC_CTRL0_XPLUS_ENABLE 0x00010000
29#define BM_LRADC_CTRL0_YPLUS_ENABLE 0x00020000
30#define BM_LRADC_CTRL0_XMINUS_ENABLE 0x00040000
31#define BM_LRADC_CTRL0_YMINUS_ENABLE 0x00080000
32#define BM_LRADC_CTRL0_TOUCH_DETECT_ENABLE 0x00100000
33#define BM_LRADC_CTRL0_ONCHIP_GROUNDREF 0x00200000
34#define BM_LRADC_CTRL0_CLKGATE 0x40000000
35#define BM_LRADC_CTRL0_SFTRST 0x80000000
36
37#define HW_LRADC_CTRL1 0x10
38#define BM_LRADC_CTRL1_LRADC0_IRQ 0x00000001
39#define BP_LRADC_CTRL1_LRADC0_IRQ 0
40#define BM_LRADC_CTRL1_LRADC5_IRQ 0x00000020
41#define BM_LRADC_CTRL1_LRADC6_IRQ 0x00000040
42#define BM_LRADC_CTRL1_TOUCH_DETECT_IRQ 0x00000100
43#define BM_LRADC_CTRL1_LRADC0_IRQ_EN 0x00010000
44#define BM_LRADC_CTRL1_LRADC5_IRQ_EN 0x00200000
45#define BM_LRADC_CTRL1_TOUCH_DETECT_IRQ_EN 0x01000000
46
47#define HW_LRADC_CTRL2 0x20
48#define BM_LRADC_CTRL2_BL_BRIGHTNESS 0x001F0000
49#define BP_LRADC_CTRL2_BL_BRIGHTNESS 16
50#define BM_LRADC_CTRL2_BL_MUX_SELECT 0x00200000
51#define BM_LRADC_CTRL2_BL_ENABLE 0x00400000
52#define BM_LRADC_CTRL2_DIVIDE_BY_TWO 0xFF000000
53#define BP_LRADC_CTRL2_DIVIDE_BY_TWO 24
54
55#define HW_LRADC_CTRL3 0x30
56#define BM_LRADC_CTRL3_CYCLE_TIME 0x00000300
57#define BP_LRADC_CTRL3_CYCLE_TIME 8
58
59#define HW_LRADC_STATUS 0x40
60#define BM_LRADC_STATUS_TOUCH_DETECT_RAW 0x00000001
61#define BP_LRADC_STATUS_TOUCH_DETECT_RAW 0
62
63#define HW_LRADC_CH0 (0x50 + 0 * 0x10)
64#define HW_LRADC_CH1 (0x50 + 1 * 0x10)
65#define HW_LRADC_CH2 (0x50 + 2 * 0x10)
66#define HW_LRADC_CH3 (0x50 + 3 * 0x10)
67#define HW_LRADC_CH4 (0x50 + 4 * 0x10)
68#define HW_LRADC_CH5 (0x50 + 5 * 0x10)
69#define HW_LRADC_CH6 (0x50 + 6 * 0x10)
70#define HW_LRADC_CH7 (0x50 + 7 * 0x10)
71
72#define HW_LRADC_CHn 0x50
73#define BM_LRADC_CHn_VALUE 0x0003FFFF
74#define BP_LRADC_CHn_VALUE 0
75#define BM_LRADC_CHn_NUM_SAMPLES 0x1F000000
76#define BP_LRADC_CHn_NUM_SAMPLES 24
77#define BM_LRADC_CHn_ACCUMULATE 0x20000000
78
79#define HW_LRADC_DELAY0 (0xD0 + 0 * 0x10)
80#define HW_LRADC_DELAY1 (0xD0 + 1 * 0x10)
81#define HW_LRADC_DELAY2 (0xD0 + 2 * 0x10)
82#define HW_LRADC_DELAY3 (0xD0 + 3 * 0x10)
83
84#define HW_LRADC_DELAYn 0xD0
85#define BM_LRADC_DELAYn_DELAY 0x000007FF
86#define BP_LRADC_DELAYn_DELAY 0
87#define BM_LRADC_DELAYn_LOOP_COUNT 0x0000F800
88#define BP_LRADC_DELAYn_LOOP_COUNT 11
89#define BM_LRADC_DELAYn_TRIGGER_DELAYS 0x000F0000
90#define BP_LRADC_DELAYn_TRIGGER_DELAYS 16
91#define BM_LRADC_DELAYn_KICK 0x00100000
92#define BM_LRADC_DELAYn_TRIGGER_LRADCS 0xFF000000
93#define BP_LRADC_DELAYn_TRIGGER_LRADCS 24
94
95#define HW_LRADC_CTRL4 0x140
96#define BM_LRADC_CTRL4_LRADC6SELECT 0x0F000000
97#define BP_LRADC_CTRL4_LRADC6SELECT 24
98#define BM_LRADC_CTRL4_LRADC7SELECT 0xF0000000
99#define BP_LRADC_CTRL4_LRADC7SELECT 28
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-ocotp.h b/arch/arm/mach-stmp378x/include/mach/regs-ocotp.h
deleted file mode 100644
index f0af64d9937e..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-ocotp.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * stmp378x: OCOTP register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_OCOTP_BASE (STMP3XXX_REGS_BASE + 0x2C000)
22#define REGS_OCOTP_PHYS 0x8002C000
23#define REGS_OCOTP_SIZE 0x2000
24
25#define HW_OCOTP_CTRL 0x0
26#define BM_OCOTP_CTRL_BUSY 0x00000100
27#define BM_OCOTP_CTRL_ERROR 0x00000200
28#define BM_OCOTP_CTRL_RD_BANK_OPEN 0x00001000
29#define BM_OCOTP_CTRL_RELOAD_SHADOWS 0x00002000
30#define BM_OCOTP_CTRL_WR_UNLOCK 0xFFFF0000
31#define BP_OCOTP_CTRL_WR_UNLOCK 16
32
33#define HW_OCOTP_DATA 0x10
34
35#define HW_OCOTP_CUST0 (0x20 + 0 * 0x10)
36#define HW_OCOTP_CUST1 (0x20 + 1 * 0x10)
37#define HW_OCOTP_CUST2 (0x20 + 2 * 0x10)
38#define HW_OCOTP_CUST3 (0x20 + 3 * 0x10)
39
40#define HW_OCOTP_CUSTn 0x20
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-pinctrl.h b/arch/arm/mach-stmp378x/include/mach/regs-pinctrl.h
deleted file mode 100644
index 50d90ea1b136..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-pinctrl.h
+++ /dev/null
@@ -1,90 +0,0 @@
1/*
2 * stmp378x: PINCTRL register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#ifndef _MACH_REGS_PINCTRL
22#define _MACH_REGS_PINCTRL
23
24#define REGS_PINCTRL_BASE (STMP3XXX_REGS_BASE + 0x18000)
25#define REGS_PINCTRL_PHYS 0x80018000
26#define REGS_PINCTRL_SIZE 0x2000
27
28#define HW_PINCTRL_MUXSEL0 0x100
29#define HW_PINCTRL_MUXSEL1 0x110
30#define HW_PINCTRL_MUXSEL2 0x120
31#define HW_PINCTRL_MUXSEL3 0x130
32#define HW_PINCTRL_MUXSEL4 0x140
33#define HW_PINCTRL_MUXSEL5 0x150
34#define HW_PINCTRL_MUXSEL6 0x160
35#define HW_PINCTRL_MUXSEL7 0x170
36
37#define HW_PINCTRL_DRIVE0 0x200
38#define HW_PINCTRL_DRIVE1 0x210
39#define HW_PINCTRL_DRIVE2 0x220
40#define HW_PINCTRL_DRIVE3 0x230
41#define HW_PINCTRL_DRIVE4 0x240
42#define HW_PINCTRL_DRIVE5 0x250
43#define HW_PINCTRL_DRIVE6 0x260
44#define HW_PINCTRL_DRIVE7 0x270
45#define HW_PINCTRL_DRIVE8 0x280
46#define HW_PINCTRL_DRIVE9 0x290
47#define HW_PINCTRL_DRIVE10 0x2A0
48#define HW_PINCTRL_DRIVE11 0x2B0
49#define HW_PINCTRL_DRIVE12 0x2C0
50#define HW_PINCTRL_DRIVE13 0x2D0
51#define HW_PINCTRL_DRIVE14 0x2E0
52
53#define HW_PINCTRL_PULL0 0x400
54#define HW_PINCTRL_PULL1 0x410
55#define HW_PINCTRL_PULL2 0x420
56#define HW_PINCTRL_PULL3 0x430
57
58#define HW_PINCTRL_DOUT0 0x500
59#define HW_PINCTRL_DOUT1 0x510
60#define HW_PINCTRL_DOUT2 0x520
61
62#define HW_PINCTRL_DIN0 0x600
63#define HW_PINCTRL_DIN1 0x610
64#define HW_PINCTRL_DIN2 0x620
65
66#define HW_PINCTRL_DOE0 0x700
67#define HW_PINCTRL_DOE1 0x710
68#define HW_PINCTRL_DOE2 0x720
69
70#define HW_PINCTRL_PIN2IRQ0 0x800
71#define HW_PINCTRL_PIN2IRQ1 0x810
72#define HW_PINCTRL_PIN2IRQ2 0x820
73
74#define HW_PINCTRL_IRQEN0 0x900
75#define HW_PINCTRL_IRQEN1 0x910
76#define HW_PINCTRL_IRQEN2 0x920
77
78#define HW_PINCTRL_IRQLEVEL0 0xA00
79#define HW_PINCTRL_IRQLEVEL1 0xA10
80#define HW_PINCTRL_IRQLEVEL2 0xA20
81
82#define HW_PINCTRL_IRQPOL0 0xB00
83#define HW_PINCTRL_IRQPOL1 0xB10
84#define HW_PINCTRL_IRQPOL2 0xB20
85
86#define HW_PINCTRL_IRQSTAT0 0xC00
87#define HW_PINCTRL_IRQSTAT1 0xC10
88#define HW_PINCTRL_IRQSTAT2 0xC20
89
90#endif
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-power.h b/arch/arm/mach-stmp378x/include/mach/regs-power.h
deleted file mode 100644
index e454c830f076..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-power.h
+++ /dev/null
@@ -1,63 +0,0 @@
1/*
2 * stmp378x: POWER register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#ifndef _MACH_REGS_POWER
22#define _MACH_REGS_POWER
23
24#define REGS_POWER_BASE (STMP3XXX_REGS_BASE + 0x44000)
25#define REGS_POWER_PHYS 0x80044000
26#define REGS_POWER_SIZE 0x2000
27
28#define HW_POWER_CTRL 0x0
29#define BM_POWER_CTRL_ENIRQ_VDD5V_GT_VDDIO 0x00000001
30#define BP_POWER_CTRL_ENIRQ_VDD5V_GT_VDDIO 0
31#define BM_POWER_CTRL_ENIRQ_PSWITCH 0x00020000
32#define BM_POWER_CTRL_PSWITCH_IRQ 0x00100000
33#define BM_POWER_CTRL_CLKGATE 0x40000000
34
35#define HW_POWER_5VCTRL 0x10
36#define BM_POWER_5VCTRL_ENABLE_LINREG_ILIMIT 0x00000040
37
38#define HW_POWER_MINPWR 0x20
39
40#define HW_POWER_CHARGE 0x30
41
42#define HW_POWER_VDDDCTRL 0x40
43
44#define HW_POWER_VDDACTRL 0x50
45
46#define HW_POWER_VDDIOCTRL 0x60
47#define BM_POWER_VDDIOCTRL_TRG 0x0000001F
48#define BP_POWER_VDDIOCTRL_TRG 0
49
50#define HW_POWER_STS 0xC0
51#define BM_POWER_STS_VBUSVALID 0x00000002
52#define BM_POWER_STS_BVALID 0x00000004
53#define BM_POWER_STS_AVALID 0x00000008
54#define BM_POWER_STS_DC_OK 0x00000200
55
56#define HW_POWER_RESET 0x100
57
58#define HW_POWER_DEBUG 0x110
59#define BM_POWER_DEBUG_BVALIDPIOLOCK 0x00000002
60#define BM_POWER_DEBUG_AVALIDPIOLOCK 0x00000004
61#define BM_POWER_DEBUG_VBUSVALIDPIOLOCK 0x00000008
62
63#endif
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-pwm.h b/arch/arm/mach-stmp378x/include/mach/regs-pwm.h
deleted file mode 100644
index 0d0f9e56ec77..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-pwm.h
+++ /dev/null
@@ -1,53 +0,0 @@
1/*
2 * stmp378x: PWM register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_PWM_BASE (STMP3XXX_REGS_BASE + 0x64000)
22#define REGS_PWM_PHYS 0x80064000
23#define REGS_PWM_SIZE 0x2000
24
25#define HW_PWM_CTRL 0x0
26#define BM_PWM_CTRL_PWM2_ENABLE 0x00000004
27#define BM_PWM_CTRL_PWM2_ANA_CTRL_ENABLE 0x00000020
28
29#define HW_PWM_ACTIVE0 (0x10 + 0 * 0x20)
30#define HW_PWM_ACTIVE1 (0x10 + 1 * 0x20)
31#define HW_PWM_ACTIVE2 (0x10 + 2 * 0x20)
32#define HW_PWM_ACTIVE3 (0x10 + 3 * 0x20)
33
34#define HW_PWM_ACTIVEn 0x10
35#define BM_PWM_ACTIVEn_ACTIVE 0x0000FFFF
36#define BP_PWM_ACTIVEn_ACTIVE 0
37#define BM_PWM_ACTIVEn_INACTIVE 0xFFFF0000
38#define BP_PWM_ACTIVEn_INACTIVE 16
39
40#define HW_PWM_PERIOD0 (0x20 + 0 * 0x20)
41#define HW_PWM_PERIOD1 (0x20 + 1 * 0x20)
42#define HW_PWM_PERIOD2 (0x20 + 2 * 0x20)
43#define HW_PWM_PERIOD3 (0x20 + 3 * 0x20)
44
45#define HW_PWM_PERIODn 0x20
46#define BM_PWM_PERIODn_PERIOD 0x0000FFFF
47#define BP_PWM_PERIODn_PERIOD 0
48#define BM_PWM_PERIODn_ACTIVE_STATE 0x00030000
49#define BP_PWM_PERIODn_ACTIVE_STATE 16
50#define BM_PWM_PERIODn_INACTIVE_STATE 0x000C0000
51#define BP_PWM_PERIODn_INACTIVE_STATE 18
52#define BM_PWM_PERIODn_CDIV 0x00700000
53#define BP_PWM_PERIODn_CDIV 20
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-pxp.h b/arch/arm/mach-stmp378x/include/mach/regs-pxp.h
deleted file mode 100644
index 54d297896de8..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-pxp.h
+++ /dev/null
@@ -1,140 +0,0 @@
1/*
2 * stmp378x: PXP register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_PXP_BASE (STMP3XXX_REGS_BASE + 0x2A000)
22#define REGS_PXP_PHYS 0x8002A000
23#define REGS_PXP_SIZE 0x2000
24
25#define HW_PXP_CTRL 0x0
26#define BM_PXP_CTRL_ENABLE 0x00000001
27#define BP_PXP_CTRL_ENABLE 0
28#define BM_PXP_CTRL_IRQ_ENABLE 0x00000002
29#define BM_PXP_CTRL_OUTPUT_RGB_FORMAT 0x000000F0
30#define BP_PXP_CTRL_OUTPUT_RGB_FORMAT 4
31#define BM_PXP_CTRL_ROTATE 0x00000300
32#define BP_PXP_CTRL_ROTATE 8
33#define BM_PXP_CTRL_HFLIP 0x00000400
34#define BM_PXP_CTRL_VFLIP 0x00000800
35#define BM_PXP_CTRL_S0_FORMAT 0x0000F000
36#define BP_PXP_CTRL_S0_FORMAT 12
37#define BM_PXP_CTRL_SCALE 0x00040000
38#define BM_PXP_CTRL_CROP 0x00080000
39
40#define HW_PXP_STAT 0x10
41#define BM_PXP_STAT_IRQ 0x00000001
42#define BP_PXP_STAT_IRQ 0
43
44#define HW_PXP_RGBBUF 0x20
45
46#define HW_PXP_RGBSIZE 0x40
47#define BM_PXP_RGBSIZE_HEIGHT 0x00000FFF
48#define BP_PXP_RGBSIZE_HEIGHT 0
49#define BM_PXP_RGBSIZE_WIDTH 0x00FFF000
50#define BP_PXP_RGBSIZE_WIDTH 12
51
52#define HW_PXP_S0BUF 0x50
53
54#define HW_PXP_S0UBUF 0x60
55
56#define HW_PXP_S0VBUF 0x70
57
58#define HW_PXP_S0PARAM 0x80
59#define BM_PXP_S0PARAM_HEIGHT 0x000000FF
60#define BP_PXP_S0PARAM_HEIGHT 0
61#define BM_PXP_S0PARAM_WIDTH 0x0000FF00
62#define BP_PXP_S0PARAM_WIDTH 8
63#define BM_PXP_S0PARAM_YBASE 0x00FF0000
64#define BP_PXP_S0PARAM_YBASE 16
65#define BM_PXP_S0PARAM_XBASE 0xFF000000
66#define BP_PXP_S0PARAM_XBASE 24
67
68#define HW_PXP_S0BACKGROUND 0x90
69
70#define HW_PXP_S0CROP 0xA0
71#define BM_PXP_S0CROP_HEIGHT 0x000000FF
72#define BP_PXP_S0CROP_HEIGHT 0
73#define BM_PXP_S0CROP_WIDTH 0x0000FF00
74#define BP_PXP_S0CROP_WIDTH 8
75#define BM_PXP_S0CROP_YBASE 0x00FF0000
76#define BP_PXP_S0CROP_YBASE 16
77#define BM_PXP_S0CROP_XBASE 0xFF000000
78#define BP_PXP_S0CROP_XBASE 24
79
80#define HW_PXP_S0SCALE 0xB0
81#define BM_PXP_S0SCALE_XSCALE 0x00003FFF
82#define BP_PXP_S0SCALE_XSCALE 0
83#define BM_PXP_S0SCALE_YSCALE 0x3FFF0000
84#define BP_PXP_S0SCALE_YSCALE 16
85
86#define HW_PXP_CSCCOEFF0 0xD0
87
88#define HW_PXP_CSCCOEFF1 0xE0
89
90#define HW_PXP_CSCCOEFF2 0xF0
91
92#define HW_PXP_S0COLORKEYLOW 0x180
93
94#define HW_PXP_S0COLORKEYHIGH 0x190
95
96#define HW_PXP_OL0 (0x200 + 0 * 0x40)
97#define HW_PXP_OL1 (0x200 + 1 * 0x40)
98#define HW_PXP_OL2 (0x200 + 2 * 0x40)
99#define HW_PXP_OL3 (0x200 + 3 * 0x40)
100#define HW_PXP_OL4 (0x200 + 4 * 0x40)
101#define HW_PXP_OL5 (0x200 + 5 * 0x40)
102#define HW_PXP_OL6 (0x200 + 6 * 0x40)
103#define HW_PXP_OL7 (0x200 + 7 * 0x40)
104
105#define HW_PXP_OLn 0x200
106
107#define HW_PXP_OL0SIZE (0x210 + 0 * 0x40)
108#define HW_PXP_OL1SIZE (0x210 + 1 * 0x40)
109#define HW_PXP_OL2SIZE (0x210 + 2 * 0x40)
110#define HW_PXP_OL3SIZE (0x210 + 3 * 0x40)
111#define HW_PXP_OL4SIZE (0x210 + 4 * 0x40)
112#define HW_PXP_OL5SIZE (0x210 + 5 * 0x40)
113#define HW_PXP_OL6SIZE (0x210 + 6 * 0x40)
114#define HW_PXP_OL7SIZE (0x210 + 7 * 0x40)
115
116#define HW_PXP_OLnSIZE 0x210
117#define BM_PXP_OLnSIZE_HEIGHT 0x000000FF
118#define BP_PXP_OLnSIZE_HEIGHT 0
119#define BM_PXP_OLnSIZE_WIDTH 0x0000FF00
120#define BP_PXP_OLnSIZE_WIDTH 8
121
122#define HW_PXP_OL0PARAM (0x220 + 0 * 0x40)
123#define HW_PXP_OL1PARAM (0x220 + 1 * 0x40)
124#define HW_PXP_OL2PARAM (0x220 + 2 * 0x40)
125#define HW_PXP_OL3PARAM (0x220 + 3 * 0x40)
126#define HW_PXP_OL4PARAM (0x220 + 4 * 0x40)
127#define HW_PXP_OL5PARAM (0x220 + 5 * 0x40)
128#define HW_PXP_OL6PARAM (0x220 + 6 * 0x40)
129#define HW_PXP_OL7PARAM (0x220 + 7 * 0x40)
130
131#define HW_PXP_OLnPARAM 0x220
132#define BM_PXP_OLnPARAM_ENABLE 0x00000001
133#define BP_PXP_OLnPARAM_ENABLE 0
134#define BM_PXP_OLnPARAM_ALPHA_CNTL 0x00000006
135#define BP_PXP_OLnPARAM_ALPHA_CNTL 1
136#define BM_PXP_OLnPARAM_ENABLE_COLORKEY 0x00000008
137#define BM_PXP_OLnPARAM_FORMAT 0x000000F0
138#define BP_PXP_OLnPARAM_FORMAT 4
139#define BM_PXP_OLnPARAM_ALPHA 0x0000FF00
140#define BP_PXP_OLnPARAM_ALPHA 8
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-rtc.h b/arch/arm/mach-stmp378x/include/mach/regs-rtc.h
deleted file mode 100644
index b8dbd6742d98..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-rtc.h
+++ /dev/null
@@ -1,59 +0,0 @@
1/*
2 * stmp378x: RTC register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_RTC_BASE (STMP3XXX_REGS_BASE + 0x5C000)
22#define REGS_RTC_PHYS 0x8005C000
23#define REGS_RTC_SIZE 0x2000
24
25#define HW_RTC_CTRL 0x0
26#define BM_RTC_CTRL_ALARM_IRQ_EN 0x00000001
27#define BP_RTC_CTRL_ALARM_IRQ_EN 0
28#define BM_RTC_CTRL_ONEMSEC_IRQ_EN 0x00000002
29#define BM_RTC_CTRL_ALARM_IRQ 0x00000004
30#define BM_RTC_CTRL_ONEMSEC_IRQ 0x00000008
31#define BM_RTC_CTRL_WATCHDOGEN 0x00000010
32
33#define HW_RTC_STAT 0x10
34#define BM_RTC_STAT_NEW_REGS 0x0000FF00
35#define BP_RTC_STAT_NEW_REGS 8
36#define BM_RTC_STAT_STALE_REGS 0x00FF0000
37#define BP_RTC_STAT_STALE_REGS 16
38#define BM_RTC_STAT_RTC_PRESENT 0x80000000
39
40#define HW_RTC_SECONDS 0x30
41
42#define HW_RTC_ALARM 0x40
43
44#define HW_RTC_WATCHDOG 0x50
45
46#define HW_RTC_PERSISTENT0 0x60
47#define BM_RTC_PERSISTENT0_ALARM_WAKE_EN 0x00000002
48#define BM_RTC_PERSISTENT0_ALARM_EN 0x00000004
49#define BM_RTC_PERSISTENT0_XTAL24MHZ_PWRUP 0x00000010
50#define BM_RTC_PERSISTENT0_XTAL32KHZ_PWRUP 0x00000020
51#define BM_RTC_PERSISTENT0_ALARM_WAKE 0x00000080
52#define BM_RTC_PERSISTENT0_SPARE_ANALOG 0xFFFC0000
53#define BP_RTC_PERSISTENT0_SPARE_ANALOG 18
54
55#define HW_RTC_PERSISTENT1 0x70
56#define BM_RTC_PERSISTENT1_GENERAL 0xFFFFFFFF
57#define BP_RTC_PERSISTENT1_GENERAL 0
58
59#define HW_RTC_VERSION 0xD0
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-saif.h b/arch/arm/mach-stmp378x/include/mach/regs-saif.h
deleted file mode 100644
index 6df41762c2a3..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-saif.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * stmp378x: SAIF register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_SAIF_SIZE 0x2000
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-spdif.h b/arch/arm/mach-stmp378x/include/mach/regs-spdif.h
deleted file mode 100644
index 801539848c28..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-spdif.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * stmp378x: SPDIF register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_SPDIF_BASE (STMP3XXX_REGS_BASE + 0x54000)
22#define REGS_SPDIF_PHYS 0x80054000
23#define REGS_SPDIF_SIZE 0x2000
24
25#define HW_SPDIF_CTRL 0x0
26#define BM_SPDIF_CTRL_RUN 0x00000001
27#define BP_SPDIF_CTRL_RUN 0
28#define BM_SPDIF_CTRL_FIFO_ERROR_IRQ_EN 0x00000002
29#define BM_SPDIF_CTRL_FIFO_OVERFLOW_IRQ 0x00000004
30#define BM_SPDIF_CTRL_FIFO_UNDERFLOW_IRQ 0x00000008
31#define BM_SPDIF_CTRL_WORD_LENGTH 0x00000010
32#define BM_SPDIF_CTRL_CLKGATE 0x40000000
33#define BM_SPDIF_CTRL_SFTRST 0x80000000
34
35#define HW_SPDIF_STAT 0x10
36
37#define HW_SPDIF_FRAMECTRL 0x20
38
39#define HW_SPDIF_SRR 0x30
40#define BM_SPDIF_SRR_RATE 0x000FFFFF
41#define BP_SPDIF_SRR_RATE 0
42#define BM_SPDIF_SRR_BASEMULT 0x70000000
43#define BP_SPDIF_SRR_BASEMULT 28
44
45#define HW_SPDIF_DEBUG 0x40
46
47#define HW_SPDIF_DATA 0x50
48
49#define HW_SPDIF_VERSION 0x60
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-ssp.h b/arch/arm/mach-stmp378x/include/mach/regs-ssp.h
deleted file mode 100644
index 28aacf0f58ed..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-ssp.h
+++ /dev/null
@@ -1,102 +0,0 @@
1/*
2 * stmp378x: SSP register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_SSP1_BASE (STMP3XXX_REGS_BASE + 0x10000)
22#define REGS_SSP1_PHYS 0x80010000
23#define REGS_SSP2_BASE (STMP3XXX_REGS_BASE + 0x34000)
24#define REGS_SSP2_PHYS 0x80034000
25#define REGS_SSP_SIZE 0x2000
26
27#define HW_SSP_CTRL0 0x0
28#define BM_SSP_CTRL0_XFER_COUNT 0x0000FFFF
29#define BP_SSP_CTRL0_XFER_COUNT 0
30#define BM_SSP_CTRL0_ENABLE 0x00010000
31#define BM_SSP_CTRL0_GET_RESP 0x00020000
32#define BM_SSP_CTRL0_LONG_RESP 0x00080000
33#define BM_SSP_CTRL0_WAIT_FOR_CMD 0x00100000
34#define BM_SSP_CTRL0_WAIT_FOR_IRQ 0x00200000
35#define BM_SSP_CTRL0_BUS_WIDTH 0x00C00000
36#define BP_SSP_CTRL0_BUS_WIDTH 22
37#define BM_SSP_CTRL0_DATA_XFER 0x01000000
38#define BM_SSP_CTRL0_READ 0x02000000
39#define BM_SSP_CTRL0_IGNORE_CRC 0x04000000
40#define BM_SSP_CTRL0_LOCK_CS 0x08000000
41#define BM_SSP_CTRL0_RUN 0x20000000
42#define BM_SSP_CTRL0_CLKGATE 0x40000000
43#define BM_SSP_CTRL0_SFTRST 0x80000000
44
45#define HW_SSP_CMD0 0x10
46#define BM_SSP_CMD0_CMD 0x000000FF
47#define BP_SSP_CMD0_CMD 0
48#define BM_SSP_CMD0_BLOCK_COUNT 0x0000FF00
49#define BP_SSP_CMD0_BLOCK_COUNT 8
50#define BM_SSP_CMD0_BLOCK_SIZE 0x000F0000
51#define BP_SSP_CMD0_BLOCK_SIZE 16
52#define BM_SSP_CMD0_APPEND_8CYC 0x00100000
53#define BM_SSP_CMD1_CMD_ARG 0xFFFFFFFF
54#define BP_SSP_CMD1_CMD_ARG 0
55
56#define HW_SSP_TIMING 0x50
57#define BM_SSP_TIMING_CLOCK_RATE 0x000000FF
58#define BP_SSP_TIMING_CLOCK_RATE 0
59#define BM_SSP_TIMING_CLOCK_DIVIDE 0x0000FF00
60#define BP_SSP_TIMING_CLOCK_DIVIDE 8
61#define BM_SSP_TIMING_TIMEOUT 0xFFFF0000
62#define BP_SSP_TIMING_TIMEOUT 16
63
64#define HW_SSP_CTRL1 0x60
65#define BM_SSP_CTRL1_SSP_MODE 0x0000000F
66#define BP_SSP_CTRL1_SSP_MODE 0
67#define BM_SSP_CTRL1_WORD_LENGTH 0x000000F0
68#define BP_SSP_CTRL1_WORD_LENGTH 4
69#define BM_SSP_CTRL1_POLARITY 0x00000200
70#define BM_SSP_CTRL1_PHASE 0x00000400
71#define BM_SSP_CTRL1_DMA_ENABLE 0x00002000
72#define BM_SSP_CTRL1_FIFO_OVERRUN_IRQ 0x00008000
73#define BM_SSP_CTRL1_RECV_TIMEOUT_IRQ_EN 0x00010000
74#define BM_SSP_CTRL1_RECV_TIMEOUT_IRQ 0x00020000
75#define BM_SSP_CTRL1_FIFO_UNDERRUN_IRQ 0x00200000
76#define BM_SSP_CTRL1_DATA_CRC_IRQ_EN 0x00400000
77#define BM_SSP_CTRL1_DATA_CRC_IRQ 0x00800000
78#define BM_SSP_CTRL1_DATA_TIMEOUT_IRQ_EN 0x01000000
79#define BM_SSP_CTRL1_DATA_TIMEOUT_IRQ 0x02000000
80#define BM_SSP_CTRL1_RESP_TIMEOUT_IRQ_EN 0x04000000
81#define BM_SSP_CTRL1_RESP_TIMEOUT_IRQ 0x08000000
82#define BM_SSP_CTRL1_RESP_ERR_IRQ_EN 0x10000000
83#define BM_SSP_CTRL1_RESP_ERR_IRQ 0x20000000
84#define BM_SSP_CTRL1_SDIO_IRQ 0x80000000
85
86#define HW_SSP_DATA 0x70
87
88#define HW_SSP_SDRESP0 0x80
89
90#define HW_SSP_SDRESP1 0x90
91
92#define HW_SSP_SDRESP2 0xA0
93
94#define HW_SSP_SDRESP3 0xB0
95
96#define HW_SSP_STATUS 0xC0
97#define BM_SSP_STATUS_FIFO_EMPTY 0x00000020
98#define BM_SSP_STATUS_TIMEOUT 0x00001000
99#define BM_SSP_STATUS_RESP_TIMEOUT 0x00004000
100#define BM_SSP_STATUS_RESP_ERR 0x00008000
101#define BM_SSP_STATUS_RESP_CRC_ERR 0x00010000
102#define BM_SSP_STATUS_CARD_DETECT 0x10000000
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-sydma.h b/arch/arm/mach-stmp378x/include/mach/regs-sydma.h
deleted file mode 100644
index 08343a8b5566..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-sydma.h
+++ /dev/null
@@ -1,23 +0,0 @@
1/*
2 * stmp378x: SYDMA register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_SYDMA_BASE (STMP3XXX_REGS_BASE + 0x26000)
22#define REGS_SYDMA_PHYS 0x80026000
23#define REGS_SYDMA_SIZE 0x2000
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-timrot.h b/arch/arm/mach-stmp378x/include/mach/regs-timrot.h
deleted file mode 100644
index b5527957c67f..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-timrot.h
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * stmp378x: TIMROT register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#ifndef _MACH_REGS_TIMROT
22#define _MACH_REGS_TIMROT
23
24#define REGS_TIMROT_BASE (STMP3XXX_REGS_BASE + 0x68000)
25#define REGS_TIMROT_PHYS 0x80068000
26#define REGS_TIMROT_SIZE 0x2000
27
28#define HW_TIMROT_ROTCTRL 0x0
29#define BM_TIMROT_ROTCTRL_SELECT_A 0x00000007
30#define BP_TIMROT_ROTCTRL_SELECT_A 0
31#define BM_TIMROT_ROTCTRL_SELECT_B 0x00000070
32#define BP_TIMROT_ROTCTRL_SELECT_B 4
33#define BM_TIMROT_ROTCTRL_POLARITY_A 0x00000100
34#define BM_TIMROT_ROTCTRL_POLARITY_B 0x00000200
35#define BM_TIMROT_ROTCTRL_OVERSAMPLE 0x00000C00
36#define BP_TIMROT_ROTCTRL_OVERSAMPLE 10
37#define BM_TIMROT_ROTCTRL_RELATIVE 0x00001000
38#define BM_TIMROT_ROTCTRL_DIVIDER 0x003F0000
39#define BP_TIMROT_ROTCTRL_DIVIDER 16
40#define BM_TIMROT_ROTCTRL_ROTARY_PRESENT 0x20000000
41#define BM_TIMROT_ROTCTRL_CLKGATE 0x40000000
42#define BM_TIMROT_ROTCTRL_SFTRST 0x80000000
43
44#define HW_TIMROT_ROTCOUNT 0x10
45#define BM_TIMROT_ROTCOUNT_UPDOWN 0x0000FFFF
46#define BP_TIMROT_ROTCOUNT_UPDOWN 0
47
48#define HW_TIMROT_TIMCTRL0 (0x20 + 0 * 0x20)
49#define HW_TIMROT_TIMCTRL1 (0x20 + 1 * 0x20)
50#define HW_TIMROT_TIMCTRL2 (0x20 + 2 * 0x20)
51
52#define HW_TIMROT_TIMCTRLn 0x20
53#define BM_TIMROT_TIMCTRLn_SELECT 0x0000000F
54#define BP_TIMROT_TIMCTRLn_SELECT 0
55#define BM_TIMROT_TIMCTRLn_PRESCALE 0x00000030
56#define BP_TIMROT_TIMCTRLn_PRESCALE 4
57#define BM_TIMROT_TIMCTRLn_RELOAD 0x00000040
58#define BM_TIMROT_TIMCTRLn_UPDATE 0x00000080
59#define BM_TIMROT_TIMCTRLn_IRQ_EN 0x00004000
60#define BM_TIMROT_TIMCTRLn_IRQ 0x00008000
61
62#define HW_TIMROT_TIMCOUNT0 (0x30 + 0 * 0x20)
63#define HW_TIMROT_TIMCOUNT1 (0x30 + 1 * 0x20)
64#define HW_TIMROT_TIMCOUNT2 (0x30 + 2 * 0x20)
65
66#define HW_TIMROT_TIMCOUNTn 0x30
67
68#endif
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-tvenc.h b/arch/arm/mach-stmp378x/include/mach/regs-tvenc.h
deleted file mode 100644
index 7f895cb34350..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-tvenc.h
+++ /dev/null
@@ -1,67 +0,0 @@
1/*
2 * stmp378x: TVENC register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_TVENC_BASE (STMP3XXX_REGS_BASE + 0x38000)
22#define REGS_TVENC_PHYS 0x80038000
23#define REGS_TVENC_SIZE 0x2000
24
25#define HW_TVENC_CTRL 0x0
26#define BM_TVENC_CTRL_CLKGATE 0x40000000
27#define BM_TVENC_CTRL_SFTRST 0x80000000
28
29#define HW_TVENC_CONFIG 0x10
30#define BM_TVENC_CONFIG_ENCD_MODE 0x00000007
31#define BP_TVENC_CONFIG_ENCD_MODE 0
32#define BM_TVENC_CONFIG_SYNC_MODE 0x00000070
33#define BP_TVENC_CONFIG_SYNC_MODE 4
34#define BM_TVENC_CONFIG_FSYNC_PHS 0x00000200
35#define BM_TVENC_CONFIG_CGAIN 0x0000C000
36#define BP_TVENC_CONFIG_CGAIN 14
37#define BM_TVENC_CONFIG_YGAIN_SEL 0x00030000
38#define BP_TVENC_CONFIG_YGAIN_SEL 16
39#define BM_TVENC_CONFIG_PAL_SHAPE 0x00100000
40
41#define HW_TVENC_SYNCOFFSET 0x30
42
43#define HW_TVENC_COLORSUB0 0xC0
44
45#define HW_TVENC_COLORBURST 0x140
46#define BM_TVENC_COLORBURST_PBA 0x00FF0000
47#define BP_TVENC_COLORBURST_PBA 16
48#define BM_TVENC_COLORBURST_NBA 0xFF000000
49#define BP_TVENC_COLORBURST_NBA 24
50
51#define HW_TVENC_MACROVISION0 0x150
52
53#define HW_TVENC_MACROVISION1 0x160
54
55#define HW_TVENC_MACROVISION2 0x170
56
57#define HW_TVENC_MACROVISION3 0x180
58
59#define HW_TVENC_MACROVISION4 0x190
60
61#define HW_TVENC_DACCTRL 0x1A0
62#define BM_TVENC_DACCTRL_RVAL 0x00000070
63#define BP_TVENC_DACCTRL_RVAL 4
64#define BM_TVENC_DACCTRL_DUMP_TOVDD1 0x00000100
65#define BM_TVENC_DACCTRL_PWRUP1 0x00001000
66#define BM_TVENC_DACCTRL_GAINUP 0x00040000
67#define BM_TVENC_DACCTRL_GAINDN 0x00080000
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-uartapp.h b/arch/arm/mach-stmp378x/include/mach/regs-uartapp.h
deleted file mode 100644
index a251e68bb3a1..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-uartapp.h
+++ /dev/null
@@ -1,87 +0,0 @@
1/*
2 * stmp378x: UARTAPP register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_UARTAPP1_BASE (STMP3XXX_REGS_BASE + 0x6C000)
22#define REGS_UARTAPP1_PHYS 0x8006C000
23#define REGS_UARTAPP2_BASE (STMP3XXX_REGS_BASE + 0x6E000)
24#define REGS_UARTAPP2_PHYS 0x8006E000
25#define REGS_UARTAPP_SIZE 0x2000
26
27#define HW_UARTAPP_CTRL0 0x0
28#define BM_UARTAPP_CTRL0_XFER_COUNT 0x0000FFFF
29#define BP_UARTAPP_CTRL0_XFER_COUNT 0
30#define BM_UARTAPP_CTRL0_RXTIMEOUT 0x07FF0000
31#define BP_UARTAPP_CTRL0_RXTIMEOUT 16
32#define BM_UARTAPP_CTRL0_RXTO_ENABLE 0x08000000
33#define BM_UARTAPP_CTRL0_RUN 0x20000000
34#define BM_UARTAPP_CTRL0_SFTRST 0x80000000
35#define BM_UARTAPP_CTRL1_XFER_COUNT 0x0000FFFF
36#define BP_UARTAPP_CTRL1_XFER_COUNT 0
37#define BM_UARTAPP_CTRL1_RUN 0x10000000
38
39#define HW_UARTAPP_CTRL2 0x20
40#define BM_UARTAPP_CTRL2_UARTEN 0x00000001
41#define BP_UARTAPP_CTRL2_UARTEN 0
42#define BM_UARTAPP_CTRL2_TXE 0x00000100
43#define BM_UARTAPP_CTRL2_RXE 0x00000200
44#define BM_UARTAPP_CTRL2_RTS 0x00000800
45#define BM_UARTAPP_CTRL2_RTSEN 0x00004000
46#define BM_UARTAPP_CTRL2_CTSEN 0x00008000
47#define BM_UARTAPP_CTRL2_RXDMAE 0x01000000
48#define BM_UARTAPP_CTRL2_TXDMAE 0x02000000
49#define BM_UARTAPP_CTRL2_DMAONERR 0x04000000
50
51#define HW_UARTAPP_LINECTRL 0x30
52#define BM_UARTAPP_LINECTRL_BRK 0x00000001
53#define BP_UARTAPP_LINECTRL_BRK 0
54#define BM_UARTAPP_LINECTRL_PEN 0x00000002
55#define BM_UARTAPP_LINECTRL_EPS 0x00000004
56#define BM_UARTAPP_LINECTRL_STP2 0x00000008
57#define BM_UARTAPP_LINECTRL_FEN 0x00000010
58#define BM_UARTAPP_LINECTRL_WLEN 0x00000060
59#define BP_UARTAPP_LINECTRL_WLEN 5
60#define BM_UARTAPP_LINECTRL_SPS 0x00000080
61#define BM_UARTAPP_LINECTRL_BAUD_DIVFRAC 0x00003F00
62#define BP_UARTAPP_LINECTRL_BAUD_DIVFRAC 8
63#define BM_UARTAPP_LINECTRL_BAUD_DIVINT 0xFFFF0000
64#define BP_UARTAPP_LINECTRL_BAUD_DIVINT 16
65
66#define HW_UARTAPP_INTR 0x50
67#define BM_UARTAPP_INTR_CTSMIS 0x00000002
68#define BM_UARTAPP_INTR_RTIS 0x00000040
69#define BM_UARTAPP_INTR_CTSMIEN 0x00020000
70#define BM_UARTAPP_INTR_RXIEN 0x00100000
71#define BM_UARTAPP_INTR_RTIEN 0x00400000
72
73#define HW_UARTAPP_DATA 0x60
74
75#define HW_UARTAPP_STAT 0x70
76#define BM_UARTAPP_STAT_RXCOUNT 0x0000FFFF
77#define BP_UARTAPP_STAT_RXCOUNT 0
78#define BM_UARTAPP_STAT_FERR 0x00010000
79#define BM_UARTAPP_STAT_PERR 0x00020000
80#define BM_UARTAPP_STAT_BERR 0x00040000
81#define BM_UARTAPP_STAT_OERR 0x00080000
82#define BM_UARTAPP_STAT_RXFE 0x01000000
83#define BM_UARTAPP_STAT_TXFF 0x02000000
84#define BM_UARTAPP_STAT_TXFE 0x08000000
85#define BM_UARTAPP_STAT_CTS 0x10000000
86
87#define HW_UARTAPP_VERSION 0x90
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-uartdbg.h b/arch/arm/mach-stmp378x/include/mach/regs-uartdbg.h
deleted file mode 100644
index b810deb552a9..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-uartdbg.h
+++ /dev/null
@@ -1,268 +0,0 @@
1/*
2 * stmp378x: UARTDBG register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_UARTDBG_BASE (STMP3XXX_REGS_BASE + 0x70000)
22#define REGS_UARTDBG_PHYS 0x80070000
23#define REGS_UARTDBG_SIZE 0x2000
24
25#define HW_UARTDBGDR 0x00000000
26#define BP_UARTDBGDR_UNAVAILABLE 16
27#define BM_UARTDBGDR_UNAVAILABLE 0xFFFF0000
28#define BF_UARTDBGDR_UNAVAILABLE(v) \
29 (((v) << 16) & BM_UARTDBGDR_UNAVAILABLE)
30#define BP_UARTDBGDR_RESERVED 12
31#define BM_UARTDBGDR_RESERVED 0x0000F000
32#define BF_UARTDBGDR_RESERVED(v) \
33 (((v) << 12) & BM_UARTDBGDR_RESERVED)
34#define BM_UARTDBGDR_OE 0x00000800
35#define BM_UARTDBGDR_BE 0x00000400
36#define BM_UARTDBGDR_PE 0x00000200
37#define BM_UARTDBGDR_FE 0x00000100
38#define BP_UARTDBGDR_DATA 0
39#define BM_UARTDBGDR_DATA 0x000000FF
40#define BF_UARTDBGDR_DATA(v) \
41 (((v) << 0) & BM_UARTDBGDR_DATA)
42#define HW_UARTDBGRSR_ECR 0x00000004
43#define BP_UARTDBGRSR_ECR_UNAVAILABLE 8
44#define BM_UARTDBGRSR_ECR_UNAVAILABLE 0xFFFFFF00
45#define BF_UARTDBGRSR_ECR_UNAVAILABLE(v) \
46 (((v) << 8) & BM_UARTDBGRSR_ECR_UNAVAILABLE)
47#define BP_UARTDBGRSR_ECR_EC 4
48#define BM_UARTDBGRSR_ECR_EC 0x000000F0
49#define BF_UARTDBGRSR_ECR_EC(v) \
50 (((v) << 4) & BM_UARTDBGRSR_ECR_EC)
51#define BM_UARTDBGRSR_ECR_OE 0x00000008
52#define BM_UARTDBGRSR_ECR_BE 0x00000004
53#define BM_UARTDBGRSR_ECR_PE 0x00000002
54#define BM_UARTDBGRSR_ECR_FE 0x00000001
55#define HW_UARTDBGFR 0x00000018
56#define BP_UARTDBGFR_UNAVAILABLE 16
57#define BM_UARTDBGFR_UNAVAILABLE 0xFFFF0000
58#define BF_UARTDBGFR_UNAVAILABLE(v) \
59 (((v) << 16) & BM_UARTDBGFR_UNAVAILABLE)
60#define BP_UARTDBGFR_RESERVED 9
61#define BM_UARTDBGFR_RESERVED 0x0000FE00
62#define BF_UARTDBGFR_RESERVED(v) \
63 (((v) << 9) & BM_UARTDBGFR_RESERVED)
64#define BM_UARTDBGFR_RI 0x00000100
65#define BM_UARTDBGFR_TXFE 0x00000080
66#define BM_UARTDBGFR_RXFF 0x00000040
67#define BM_UARTDBGFR_TXFF 0x00000020
68#define BM_UARTDBGFR_RXFE 0x00000010
69#define BM_UARTDBGFR_BUSY 0x00000008
70#define BM_UARTDBGFR_DCD 0x00000004
71#define BM_UARTDBGFR_DSR 0x00000002
72#define BM_UARTDBGFR_CTS 0x00000001
73#define HW_UARTDBGILPR 0x00000020
74#define BP_UARTDBGILPR_UNAVAILABLE 8
75#define BM_UARTDBGILPR_UNAVAILABLE 0xFFFFFF00
76#define BF_UARTDBGILPR_UNAVAILABLE(v) \
77 (((v) << 8) & BM_UARTDBGILPR_UNAVAILABLE)
78#define BP_UARTDBGILPR_ILPDVSR 0
79#define BM_UARTDBGILPR_ILPDVSR 0x000000FF
80#define BF_UARTDBGILPR_ILPDVSR(v) \
81 (((v) << 0) & BM_UARTDBGILPR_ILPDVSR)
82#define HW_UARTDBGIBRD 0x00000024
83#define BP_UARTDBGIBRD_UNAVAILABLE 16
84#define BM_UARTDBGIBRD_UNAVAILABLE 0xFFFF0000
85#define BF_UARTDBGIBRD_UNAVAILABLE(v) \
86 (((v) << 16) & BM_UARTDBGIBRD_UNAVAILABLE)
87#define BP_UARTDBGIBRD_BAUD_DIVINT 0
88#define BM_UARTDBGIBRD_BAUD_DIVINT 0x0000FFFF
89#define BF_UARTDBGIBRD_BAUD_DIVINT(v) \
90 (((v) << 0) & BM_UARTDBGIBRD_BAUD_DIVINT)
91#define HW_UARTDBGFBRD 0x00000028
92#define BP_UARTDBGFBRD_UNAVAILABLE 8
93#define BM_UARTDBGFBRD_UNAVAILABLE 0xFFFFFF00
94#define BF_UARTDBGFBRD_UNAVAILABLE(v) \
95 (((v) << 8) & BM_UARTDBGFBRD_UNAVAILABLE)
96#define BP_UARTDBGFBRD_RESERVED 6
97#define BM_UARTDBGFBRD_RESERVED 0x000000C0
98#define BF_UARTDBGFBRD_RESERVED(v) \
99 (((v) << 6) & BM_UARTDBGFBRD_RESERVED)
100#define BP_UARTDBGFBRD_BAUD_DIVFRAC 0
101#define BM_UARTDBGFBRD_BAUD_DIVFRAC 0x0000003F
102#define BF_UARTDBGFBRD_BAUD_DIVFRAC(v) \
103 (((v) << 0) & BM_UARTDBGFBRD_BAUD_DIVFRAC)
104#define HW_UARTDBGLCR_H 0x0000002c
105#define BP_UARTDBGLCR_H_UNAVAILABLE 16
106#define BM_UARTDBGLCR_H_UNAVAILABLE 0xFFFF0000
107#define BF_UARTDBGLCR_H_UNAVAILABLE(v) \
108 (((v) << 16) & BM_UARTDBGLCR_H_UNAVAILABLE)
109#define BP_UARTDBGLCR_H_RESERVED 8
110#define BM_UARTDBGLCR_H_RESERVED 0x0000FF00
111#define BF_UARTDBGLCR_H_RESERVED(v) \
112 (((v) << 8) & BM_UARTDBGLCR_H_RESERVED)
113#define BM_UARTDBGLCR_H_SPS 0x00000080
114#define BP_UARTDBGLCR_H_WLEN 5
115#define BM_UARTDBGLCR_H_WLEN 0x00000060
116#define BF_UARTDBGLCR_H_WLEN(v) \
117 (((v) << 5) & BM_UARTDBGLCR_H_WLEN)
118#define BM_UARTDBGLCR_H_FEN 0x00000010
119#define BM_UARTDBGLCR_H_STP2 0x00000008
120#define BM_UARTDBGLCR_H_EPS 0x00000004
121#define BM_UARTDBGLCR_H_PEN 0x00000002
122#define BM_UARTDBGLCR_H_BRK 0x00000001
123#define HW_UARTDBGCR 0x00000030
124#define BP_UARTDBGCR_UNAVAILABLE 16
125#define BM_UARTDBGCR_UNAVAILABLE 0xFFFF0000
126#define BF_UARTDBGCR_UNAVAILABLE(v) \
127 (((v) << 16) & BM_UARTDBGCR_UNAVAILABLE)
128#define BM_UARTDBGCR_CTSEN 0x00008000
129#define BM_UARTDBGCR_RTSEN 0x00004000
130#define BM_UARTDBGCR_OUT2 0x00002000
131#define BM_UARTDBGCR_OUT1 0x00001000
132#define BM_UARTDBGCR_RTS 0x00000800
133#define BM_UARTDBGCR_DTR 0x00000400
134#define BM_UARTDBGCR_RXE 0x00000200
135#define BM_UARTDBGCR_TXE 0x00000100
136#define BM_UARTDBGCR_LBE 0x00000080
137#define BP_UARTDBGCR_RESERVED 3
138#define BM_UARTDBGCR_RESERVED 0x00000078
139#define BF_UARTDBGCR_RESERVED(v) \
140 (((v) << 3) & BM_UARTDBGCR_RESERVED)
141#define BM_UARTDBGCR_SIRLP 0x00000004
142#define BM_UARTDBGCR_SIREN 0x00000002
143#define BM_UARTDBGCR_UARTEN 0x00000001
144#define HW_UARTDBGIFLS 0x00000034
145#define BP_UARTDBGIFLS_UNAVAILABLE 16
146#define BM_UARTDBGIFLS_UNAVAILABLE 0xFFFF0000
147#define BF_UARTDBGIFLS_UNAVAILABLE(v) \
148 (((v) << 16) & BM_UARTDBGIFLS_UNAVAILABLE)
149#define BP_UARTDBGIFLS_RESERVED 6
150#define BM_UARTDBGIFLS_RESERVED 0x0000FFC0
151#define BF_UARTDBGIFLS_RESERVED(v) \
152 (((v) << 6) & BM_UARTDBGIFLS_RESERVED)
153#define BP_UARTDBGIFLS_RXIFLSEL 3
154#define BM_UARTDBGIFLS_RXIFLSEL 0x00000038
155#define BF_UARTDBGIFLS_RXIFLSEL(v) \
156 (((v) << 3) & BM_UARTDBGIFLS_RXIFLSEL)
157#define BV_UARTDBGIFLS_RXIFLSEL__NOT_EMPTY 0x0
158#define BV_UARTDBGIFLS_RXIFLSEL__ONE_QUARTER 0x1
159#define BV_UARTDBGIFLS_RXIFLSEL__ONE_HALF 0x2
160#define BV_UARTDBGIFLS_RXIFLSEL__THREE_QUARTERS 0x3
161#define BV_UARTDBGIFLS_RXIFLSEL__SEVEN_EIGHTHS 0x4
162#define BV_UARTDBGIFLS_RXIFLSEL__INVALID5 0x5
163#define BV_UARTDBGIFLS_RXIFLSEL__INVALID6 0x6
164#define BV_UARTDBGIFLS_RXIFLSEL__INVALID7 0x7
165#define BP_UARTDBGIFLS_TXIFLSEL 0
166#define BM_UARTDBGIFLS_TXIFLSEL 0x00000007
167#define BF_UARTDBGIFLS_TXIFLSEL(v) \
168 (((v) << 0) & BM_UARTDBGIFLS_TXIFLSEL)
169#define BV_UARTDBGIFLS_TXIFLSEL__EMPTY 0x0
170#define BV_UARTDBGIFLS_TXIFLSEL__ONE_QUARTER 0x1
171#define BV_UARTDBGIFLS_TXIFLSEL__ONE_HALF 0x2
172#define BV_UARTDBGIFLS_TXIFLSEL__THREE_QUARTERS 0x3
173#define BV_UARTDBGIFLS_TXIFLSEL__SEVEN_EIGHTHS 0x4
174#define BV_UARTDBGIFLS_TXIFLSEL__INVALID5 0x5
175#define BV_UARTDBGIFLS_TXIFLSEL__INVALID6 0x6
176#define BV_UARTDBGIFLS_TXIFLSEL__INVALID7 0x7
177#define HW_UARTDBGIMSC 0x00000038
178#define BP_UARTDBGIMSC_UNAVAILABLE 16
179#define BM_UARTDBGIMSC_UNAVAILABLE 0xFFFF0000
180#define BF_UARTDBGIMSC_UNAVAILABLE(v) \
181 (((v) << 16) & BM_UARTDBGIMSC_UNAVAILABLE)
182#define BP_UARTDBGIMSC_RESERVED 11
183#define BM_UARTDBGIMSC_RESERVED 0x0000F800
184#define BF_UARTDBGIMSC_RESERVED(v) \
185 (((v) << 11) & BM_UARTDBGIMSC_RESERVED)
186#define BM_UARTDBGIMSC_OEIM 0x00000400
187#define BM_UARTDBGIMSC_BEIM 0x00000200
188#define BM_UARTDBGIMSC_PEIM 0x00000100
189#define BM_UARTDBGIMSC_FEIM 0x00000080
190#define BM_UARTDBGIMSC_RTIM 0x00000040
191#define BM_UARTDBGIMSC_TXIM 0x00000020
192#define BM_UARTDBGIMSC_RXIM 0x00000010
193#define BM_UARTDBGIMSC_DSRMIM 0x00000008
194#define BM_UARTDBGIMSC_DCDMIM 0x00000004
195#define BM_UARTDBGIMSC_CTSMIM 0x00000002
196#define BM_UARTDBGIMSC_RIMIM 0x00000001
197#define HW_UARTDBGRIS 0x0000003c
198#define BP_UARTDBGRIS_UNAVAILABLE 16
199#define BM_UARTDBGRIS_UNAVAILABLE 0xFFFF0000
200#define BF_UARTDBGRIS_UNAVAILABLE(v) \
201 (((v) << 16) & BM_UARTDBGRIS_UNAVAILABLE)
202#define BP_UARTDBGRIS_RESERVED 11
203#define BM_UARTDBGRIS_RESERVED 0x0000F800
204#define BF_UARTDBGRIS_RESERVED(v) \
205 (((v) << 11) & BM_UARTDBGRIS_RESERVED)
206#define BM_UARTDBGRIS_OERIS 0x00000400
207#define BM_UARTDBGRIS_BERIS 0x00000200
208#define BM_UARTDBGRIS_PERIS 0x00000100
209#define BM_UARTDBGRIS_FERIS 0x00000080
210#define BM_UARTDBGRIS_RTRIS 0x00000040
211#define BM_UARTDBGRIS_TXRIS 0x00000020
212#define BM_UARTDBGRIS_RXRIS 0x00000010
213#define BM_UARTDBGRIS_DSRRMIS 0x00000008
214#define BM_UARTDBGRIS_DCDRMIS 0x00000004
215#define BM_UARTDBGRIS_CTSRMIS 0x00000002
216#define BM_UARTDBGRIS_RIRMIS 0x00000001
217#define HW_UARTDBGMIS 0x00000040
218#define BP_UARTDBGMIS_UNAVAILABLE 16
219#define BM_UARTDBGMIS_UNAVAILABLE 0xFFFF0000
220#define BF_UARTDBGMIS_UNAVAILABLE(v) \
221 (((v) << 16) & BM_UARTDBGMIS_UNAVAILABLE)
222#define BP_UARTDBGMIS_RESERVED 11
223#define BM_UARTDBGMIS_RESERVED 0x0000F800
224#define BF_UARTDBGMIS_RESERVED(v) \
225 (((v) << 11) & BM_UARTDBGMIS_RESERVED)
226#define BM_UARTDBGMIS_OEMIS 0x00000400
227#define BM_UARTDBGMIS_BEMIS 0x00000200
228#define BM_UARTDBGMIS_PEMIS 0x00000100
229#define BM_UARTDBGMIS_FEMIS 0x00000080
230#define BM_UARTDBGMIS_RTMIS 0x00000040
231#define BM_UARTDBGMIS_TXMIS 0x00000020
232#define BM_UARTDBGMIS_RXMIS 0x00000010
233#define BM_UARTDBGMIS_DSRMMIS 0x00000008
234#define BM_UARTDBGMIS_DCDMMIS 0x00000004
235#define BM_UARTDBGMIS_CTSMMIS 0x00000002
236#define BM_UARTDBGMIS_RIMMIS 0x00000001
237#define HW_UARTDBGICR 0x00000044
238#define BP_UARTDBGICR_UNAVAILABLE 16
239#define BM_UARTDBGICR_UNAVAILABLE 0xFFFF0000
240#define BF_UARTDBGICR_UNAVAILABLE(v) \
241 (((v) << 16) & BM_UARTDBGICR_UNAVAILABLE)
242#define BP_UARTDBGICR_RESERVED 11
243#define BM_UARTDBGICR_RESERVED 0x0000F800
244#define BF_UARTDBGICR_RESERVED(v) \
245 (((v) << 11) & BM_UARTDBGICR_RESERVED)
246#define BM_UARTDBGICR_OEIC 0x00000400
247#define BM_UARTDBGICR_BEIC 0x00000200
248#define BM_UARTDBGICR_PEIC 0x00000100
249#define BM_UARTDBGICR_FEIC 0x00000080
250#define BM_UARTDBGICR_RTIC 0x00000040
251#define BM_UARTDBGICR_TXIC 0x00000020
252#define BM_UARTDBGICR_RXIC 0x00000010
253#define BM_UARTDBGICR_DSRMIC 0x00000008
254#define BM_UARTDBGICR_DCDMIC 0x00000004
255#define BM_UARTDBGICR_CTSMIC 0x00000002
256#define BM_UARTDBGICR_RIMIC 0x00000001
257#define HW_UARTDBGDMACR 0x00000048
258#define BP_UARTDBGDMACR_UNAVAILABLE 16
259#define BM_UARTDBGDMACR_UNAVAILABLE 0xFFFF0000
260#define BF_UARTDBGDMACR_UNAVAILABLE(v) \
261 (((v) << 16) & BM_UARTDBGDMACR_UNAVAILABLE)
262#define BP_UARTDBGDMACR_RESERVED 3
263#define BM_UARTDBGDMACR_RESERVED 0x0000FFF8
264#define BF_UARTDBGDMACR_RESERVED(v) \
265 (((v) << 3) & BM_UARTDBGDMACR_RESERVED)
266#define BM_UARTDBGDMACR_DMAONERR 0x00000004
267#define BM_UARTDBGDMACR_TXDMAE 0x00000002
268#define BM_UARTDBGDMACR_RXDMAE 0x00000001
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-usbctrl.h b/arch/arm/mach-stmp378x/include/mach/regs-usbctrl.h
deleted file mode 100644
index 25112c1aa608..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-usbctrl.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * stmp378x: USBCTRL register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_USBCTRL_BASE (STMP3XXX_REGS_BASE + 0x80000)
22#define REGS_USBCTRL_PHYS 0x80080000
23#define REGS_USBCTRL_SIZE 0x2000
24
25#define HW_USBCTRL_USBCMD 0x140
26#define BM_USBCTRL_USBCMD_RS 0x00000001
27#define BP_USBCTRL_USBCMD_RS 0
28#define BM_USBCTRL_USBCMD_RST 0x00000002
29
30#define HW_USBCTRL_USBINTR 0x148
31#define BM_USBCTRL_USBINTR_UE 0x00000001
32#define BP_USBCTRL_USBINTR_UE 0
33
34#define HW_USBCTRL_PORTSC1 0x184
35#define BM_USBCTRL_PORTSC1_PHCD 0x00800000
36
37#define HW_USBCTRL_OTGSC 0x1A4
38#define BM_USBCTRL_OTGSC_ID 0x00000100
39#define BM_USBCTRL_OTGSC_IDIS 0x00010000
40#define BM_USBCTRL_OTGSC_IDIE 0x01000000
diff --git a/arch/arm/mach-stmp378x/include/mach/regs-usbphy.h b/arch/arm/mach-stmp378x/include/mach/regs-usbphy.h
deleted file mode 100644
index 11f3b732dc92..000000000000
--- a/arch/arm/mach-stmp378x/include/mach/regs-usbphy.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * stmp378x: USBPHY register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_USBPHY_BASE (STMP3XXX_REGS_BASE + 0x7C000)
22#define REGS_USBPHY_PHYS 0x8007C000
23#define REGS_USBPHY_SIZE 0x2000
24
25#define HW_USBPHY_PWD 0x0
26
27#define HW_USBPHY_CTRL 0x30
28#define BM_USBPHY_CTRL_ENHOSTDISCONDETECT 0x00000002
29#define BM_USBPHY_CTRL_ENDEVPLUGINDETECT 0x00000010
30#define BM_USBPHY_CTRL_ENOTGIDDETECT 0x00000080
31#define BM_USBPHY_CTRL_ENIRQDEVPLUGIN 0x00000800
32#define BM_USBPHY_CTRL_CLKGATE 0x40000000
33#define BM_USBPHY_CTRL_SFTRST 0x80000000
34
35#define HW_USBPHY_STATUS 0x40
36#define BM_USBPHY_STATUS_DEVPLUGIN_STATUS 0x00000040
37#define BM_USBPHY_STATUS_OTGID_STATUS 0x00000100
diff --git a/arch/arm/mach-stmp378x/stmp378x.c b/arch/arm/mach-stmp378x/stmp378x.c
deleted file mode 100644
index c2f9fe04c112..000000000000
--- a/arch/arm/mach-stmp378x/stmp378x.c
+++ /dev/null
@@ -1,299 +0,0 @@
1/*
2 * Freescale STMP378X platform support
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/platform_device.h>
21#include <linux/irq.h>
22#include <linux/dma-mapping.h>
23
24#include <asm/dma.h>
25#include <asm/setup.h>
26#include <asm/mach-types.h>
27
28#include <asm/mach/arch.h>
29#include <asm/mach/irq.h>
30#include <asm/mach/map.h>
31#include <asm/mach/time.h>
32
33#include <mach/pins.h>
34#include <mach/pinmux.h>
35#include <mach/dma.h>
36#include <mach/hardware.h>
37#include <mach/system.h>
38#include <mach/platform.h>
39#include <mach/stmp3xxx.h>
40#include <mach/regs-icoll.h>
41#include <mach/regs-apbh.h>
42#include <mach/regs-apbx.h>
43#include <mach/regs-pxp.h>
44#include <mach/regs-i2c.h>
45
46#include "stmp378x.h"
47/*
48 * IRQ handling
49 */
50static void stmp378x_ack_irq(struct irq_data *d)
51{
52 /* Tell ICOLL to release IRQ line */
53 __raw_writel(0, REGS_ICOLL_BASE + HW_ICOLL_VECTOR);
54
55 /* ACK current interrupt */
56 __raw_writel(0x01 /* BV_ICOLL_LEVELACK_IRQLEVELACK__LEVEL0 */,
57 REGS_ICOLL_BASE + HW_ICOLL_LEVELACK);
58
59 /* Barrier */
60 (void)__raw_readl(REGS_ICOLL_BASE + HW_ICOLL_STAT);
61}
62
63static void stmp378x_mask_irq(struct irq_data *d)
64{
65 /* IRQ disable */
66 stmp3xxx_clearl(BM_ICOLL_INTERRUPTn_ENABLE,
67 REGS_ICOLL_BASE + HW_ICOLL_INTERRUPTn + d->irq * 0x10);
68}
69
70static void stmp378x_unmask_irq(struct irq_data *d)
71{
72 /* IRQ enable */
73 stmp3xxx_setl(BM_ICOLL_INTERRUPTn_ENABLE,
74 REGS_ICOLL_BASE + HW_ICOLL_INTERRUPTn + d->irq * 0x10);
75}
76
77static struct irq_chip stmp378x_chip = {
78 .irq_ack = stmp378x_ack_irq,
79 .irq_mask = stmp378x_mask_irq,
80 .irq_unmask = stmp378x_unmask_irq,
81};
82
83void __init stmp378x_init_irq(void)
84{
85 stmp3xxx_init_irq(&stmp378x_chip);
86}
87
88/*
89 * DMA interrupt handling
90 */
91void stmp3xxx_arch_dma_enable_interrupt(int channel)
92{
93 void __iomem *c1, *c2;
94
95 switch (STMP3XXX_DMA_BUS(channel)) {
96 case STMP3XXX_BUS_APBH:
97 c1 = REGS_APBH_BASE + HW_APBH_CTRL1;
98 c2 = REGS_APBH_BASE + HW_APBH_CTRL2;
99 break;
100
101 case STMP3XXX_BUS_APBX:
102 c1 = REGS_APBX_BASE + HW_APBX_CTRL1;
103 c2 = REGS_APBX_BASE + HW_APBX_CTRL2;
104 break;
105
106 default:
107 return;
108 }
109 stmp3xxx_setl(1 << (16 + STMP3XXX_DMA_CHANNEL(channel)), c1);
110 stmp3xxx_setl(1 << (16 + STMP3XXX_DMA_CHANNEL(channel)), c2);
111}
112EXPORT_SYMBOL(stmp3xxx_arch_dma_enable_interrupt);
113
114void stmp3xxx_arch_dma_clear_interrupt(int channel)
115{
116 void __iomem *c1, *c2;
117
118 switch (STMP3XXX_DMA_BUS(channel)) {
119 case STMP3XXX_BUS_APBH:
120 c1 = REGS_APBH_BASE + HW_APBH_CTRL1;
121 c2 = REGS_APBH_BASE + HW_APBH_CTRL2;
122 break;
123
124 case STMP3XXX_BUS_APBX:
125 c1 = REGS_APBX_BASE + HW_APBX_CTRL1;
126 c2 = REGS_APBX_BASE + HW_APBX_CTRL2;
127 break;
128
129 default:
130 return;
131 }
132 stmp3xxx_clearl(1 << STMP3XXX_DMA_CHANNEL(channel), c1);
133 stmp3xxx_clearl(1 << STMP3XXX_DMA_CHANNEL(channel), c2);
134}
135EXPORT_SYMBOL(stmp3xxx_arch_dma_clear_interrupt);
136
137int stmp3xxx_arch_dma_is_interrupt(int channel)
138{
139 int r = 0;
140
141 switch (STMP3XXX_DMA_BUS(channel)) {
142 case STMP3XXX_BUS_APBH:
143 r = __raw_readl(REGS_APBH_BASE + HW_APBH_CTRL1) &
144 (1 << STMP3XXX_DMA_CHANNEL(channel));
145 break;
146
147 case STMP3XXX_BUS_APBX:
148 r = __raw_readl(REGS_APBX_BASE + HW_APBX_CTRL1) &
149 (1 << STMP3XXX_DMA_CHANNEL(channel));
150 break;
151 }
152 return r;
153}
154EXPORT_SYMBOL(stmp3xxx_arch_dma_is_interrupt);
155
156void stmp3xxx_arch_dma_reset_channel(int channel)
157{
158 unsigned chbit = 1 << STMP3XXX_DMA_CHANNEL(channel);
159 void __iomem *c0;
160 u32 mask;
161
162 switch (STMP3XXX_DMA_BUS(channel)) {
163 case STMP3XXX_BUS_APBH:
164 c0 = REGS_APBH_BASE + HW_APBH_CTRL0;
165 mask = chbit << BP_APBH_CTRL0_RESET_CHANNEL;
166 break;
167 case STMP3XXX_BUS_APBX:
168 c0 = REGS_APBX_BASE + HW_APBX_CHANNEL_CTRL;
169 mask = chbit << BP_APBX_CHANNEL_CTRL_RESET_CHANNEL;
170 break;
171 default:
172 return;
173 }
174
175 /* Reset channel and wait for it to complete */
176 stmp3xxx_setl(mask, c0);
177 while (__raw_readl(c0) & mask)
178 cpu_relax();
179}
180EXPORT_SYMBOL(stmp3xxx_arch_dma_reset_channel);
181
182void stmp3xxx_arch_dma_freeze(int channel)
183{
184 unsigned chbit = 1 << STMP3XXX_DMA_CHANNEL(channel);
185 u32 mask = 1 << chbit;
186
187 switch (STMP3XXX_DMA_BUS(channel)) {
188 case STMP3XXX_BUS_APBH:
189 stmp3xxx_setl(mask, REGS_APBH_BASE + HW_APBH_CTRL0);
190 break;
191 case STMP3XXX_BUS_APBX:
192 stmp3xxx_setl(mask, REGS_APBX_BASE + HW_APBX_CHANNEL_CTRL);
193 break;
194 }
195}
196EXPORT_SYMBOL(stmp3xxx_arch_dma_freeze);
197
198void stmp3xxx_arch_dma_unfreeze(int channel)
199{
200 unsigned chbit = 1 << STMP3XXX_DMA_CHANNEL(channel);
201 u32 mask = 1 << chbit;
202
203 switch (STMP3XXX_DMA_BUS(channel)) {
204 case STMP3XXX_BUS_APBH:
205 stmp3xxx_clearl(mask, REGS_APBH_BASE + HW_APBH_CTRL0);
206 break;
207 case STMP3XXX_BUS_APBX:
208 stmp3xxx_clearl(mask, REGS_APBX_BASE + HW_APBX_CHANNEL_CTRL);
209 break;
210 }
211}
212EXPORT_SYMBOL(stmp3xxx_arch_dma_unfreeze);
213
214/*
215 * The registers are all very closely mapped, so we might as well map them all
216 * with a single mapping
217 *
218 * Logical Physical
219 * f0000000 80000000 On-chip registers
220 * f1000000 00000000 32k on-chip SRAM
221 */
222
223static struct map_desc stmp378x_io_desc[] __initdata = {
224 {
225 .virtual = (u32)STMP3XXX_REGS_BASE,
226 .pfn = __phys_to_pfn(STMP3XXX_REGS_PHBASE),
227 .length = STMP3XXX_REGS_SIZE,
228 .type = MT_DEVICE,
229 },
230 {
231 .virtual = (u32)STMP3XXX_OCRAM_BASE,
232 .pfn = __phys_to_pfn(STMP3XXX_OCRAM_PHBASE),
233 .length = STMP3XXX_OCRAM_SIZE,
234 .type = MT_DEVICE,
235 },
236};
237
238
239static u64 common_dmamask = DMA_BIT_MASK(32);
240
241/*
242 * devices that are present only on stmp378x, not on all 3xxx boards:
243 * PxP
244 * I2C
245 */
246static struct resource pxp_resource[] = {
247 {
248 .flags = IORESOURCE_MEM,
249 .start = REGS_PXP_PHYS,
250 .end = REGS_PXP_PHYS + REGS_PXP_SIZE,
251 }, {
252 .flags = IORESOURCE_IRQ,
253 .start = IRQ_PXP,
254 .end = IRQ_PXP,
255 },
256};
257
258struct platform_device stmp378x_pxp = {
259 .name = "stmp3xxx-pxp",
260 .id = -1,
261 .dev = {
262 .dma_mask = &common_dmamask,
263 .coherent_dma_mask = DMA_BIT_MASK(32),
264 },
265 .num_resources = ARRAY_SIZE(pxp_resource),
266 .resource = pxp_resource,
267};
268
269static struct resource i2c_resources[] = {
270 {
271 .flags = IORESOURCE_IRQ,
272 .start = IRQ_I2C_ERROR,
273 .end = IRQ_I2C_ERROR,
274 }, {
275 .flags = IORESOURCE_MEM,
276 .start = REGS_I2C_PHYS,
277 .end = REGS_I2C_PHYS + REGS_I2C_SIZE,
278 }, {
279 .flags = IORESOURCE_DMA,
280 .start = STMP3XXX_DMA(3, STMP3XXX_BUS_APBX),
281 .end = STMP3XXX_DMA(3, STMP3XXX_BUS_APBX),
282 },
283};
284
285struct platform_device stmp378x_i2c = {
286 .name = "i2c_stmp3xxx",
287 .id = 0,
288 .dev = {
289 .dma_mask = &common_dmamask,
290 .coherent_dma_mask = DMA_BIT_MASK(32),
291 },
292 .resource = i2c_resources,
293 .num_resources = ARRAY_SIZE(i2c_resources),
294};
295
296void __init stmp378x_map_io(void)
297{
298 iotable_init(stmp378x_io_desc, ARRAY_SIZE(stmp378x_io_desc));
299}
diff --git a/arch/arm/mach-stmp378x/stmp378x.h b/arch/arm/mach-stmp378x/stmp378x.h
deleted file mode 100644
index 0dc15b3c891f..000000000000
--- a/arch/arm/mach-stmp378x/stmp378x.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * Freescale STMP37XX/STMP378X internal functions and data declarations
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __MACH_STMP378X_H
19#define __MACH_STMP378X_H
20
21void stmp378x_map_io(void);
22void stmp378x_init_irq(void);
23
24extern struct platform_device stmp378x_pxp, stmp378x_i2c;
25#endif /* __MACH_STMP378X_COMMON_H */
diff --git a/arch/arm/mach-stmp378x/stmp378x_devb.c b/arch/arm/mach-stmp378x/stmp378x_devb.c
deleted file mode 100644
index 06158848afd9..000000000000
--- a/arch/arm/mach-stmp378x/stmp378x_devb.c
+++ /dev/null
@@ -1,332 +0,0 @@
1/*
2 * Freescale STMP378X development board support
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/io.h>
21#include <linux/platform_device.h>
22#include <linux/delay.h>
23#include <linux/clk.h>
24#include <linux/err.h>
25#include <linux/spi/spi.h>
26
27#include <asm/setup.h>
28#include <asm/mach-types.h>
29#include <asm/mach/arch.h>
30
31#include <mach/pins.h>
32#include <mach/pinmux.h>
33#include <mach/platform.h>
34#include <mach/stmp3xxx.h>
35#include <mach/mmc.h>
36#include <mach/gpmi.h>
37
38#include "stmp378x.h"
39
40static struct platform_device *devices[] = {
41 &stmp3xxx_dbguart,
42 &stmp3xxx_appuart,
43 &stmp3xxx_watchdog,
44 &stmp3xxx_touchscreen,
45 &stmp3xxx_rtc,
46 &stmp3xxx_keyboard,
47 &stmp3xxx_framebuffer,
48 &stmp3xxx_backlight,
49 &stmp3xxx_rotdec,
50 &stmp3xxx_persistent,
51 &stmp3xxx_dcp_bootstream,
52 &stmp3xxx_dcp,
53 &stmp3xxx_battery,
54 &stmp378x_pxp,
55 &stmp378x_i2c,
56};
57
58static struct pin_desc i2c_pins_desc[] = {
59 { PINID_I2C_SCL, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
60 { PINID_I2C_SDA, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
61};
62
63static struct pin_group i2c_pins = {
64 .pins = i2c_pins_desc,
65 .nr_pins = ARRAY_SIZE(i2c_pins_desc),
66};
67
68static struct pin_desc dbguart_pins_0[] = {
69 { PINID_PWM0, PIN_FUN3, },
70 { PINID_PWM1, PIN_FUN3, },
71};
72
73static struct pin_group dbguart_pins[] = {
74 [0] = {
75 .pins = dbguart_pins_0,
76 .nr_pins = ARRAY_SIZE(dbguart_pins_0),
77 },
78};
79
80static int dbguart_pins_control(int id, int request)
81{
82 int r = 0;
83
84 if (request)
85 r = stmp3xxx_request_pin_group(&dbguart_pins[id], "debug uart");
86 else
87 stmp3xxx_release_pin_group(&dbguart_pins[id], "debug uart");
88 return r;
89}
90
91static struct pin_desc appuart_pins_0[] = {
92 { PINID_AUART1_CTS, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
93 { PINID_AUART1_RTS, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
94 { PINID_AUART1_RX, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
95 { PINID_AUART1_TX, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
96};
97
98static struct pin_desc appuart_pins_1[] = {
99#if 0 /* enable these when second appuart will be connected */
100 { PINID_AUART2_CTS, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
101 { PINID_AUART2_RTS, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
102 { PINID_AUART2_RX, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
103 { PINID_AUART2_TX, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
104#endif
105};
106
107static struct pin_desc mmc_pins_desc[] = {
108 { PINID_SSP1_DATA0, PIN_FUN1, PIN_8MA, PIN_3_3V, 1 },
109 { PINID_SSP1_DATA1, PIN_FUN1, PIN_8MA, PIN_3_3V, 1 },
110 { PINID_SSP1_DATA2, PIN_FUN1, PIN_8MA, PIN_3_3V, 1 },
111 { PINID_SSP1_DATA3, PIN_FUN1, PIN_8MA, PIN_3_3V, 1 },
112 { PINID_SSP1_CMD, PIN_FUN1, PIN_8MA, PIN_3_3V, 1 },
113 { PINID_SSP1_SCK, PIN_FUN1, PIN_8MA, PIN_3_3V, 0 },
114 { PINID_SSP1_DETECT, PIN_FUN1, PIN_8MA, PIN_3_3V, 0 },
115};
116
117static struct pin_group mmc_pins = {
118 .pins = mmc_pins_desc,
119 .nr_pins = ARRAY_SIZE(mmc_pins_desc),
120};
121
122static int stmp3xxxmmc_get_wp(void)
123{
124 return gpio_get_value(PINID_PWM4);
125}
126
127static int stmp3xxxmmc_hw_init_ssp1(void)
128{
129 int ret;
130
131 ret = stmp3xxx_request_pin_group(&mmc_pins, "mmc");
132 if (ret)
133 goto out;
134
135 /* Configure write protect GPIO pin */
136 ret = gpio_request(PINID_PWM4, "mmc wp");
137 if (ret)
138 goto out_wp;
139
140 gpio_direction_input(PINID_PWM4);
141
142 /* Configure POWER pin as gpio to drive power to MMC slot */
143 ret = gpio_request(PINID_PWM3, "mmc power");
144 if (ret)
145 goto out_power;
146
147 gpio_direction_output(PINID_PWM3, 0);
148 mdelay(100);
149
150 return 0;
151
152out_power:
153 gpio_free(PINID_PWM4);
154out_wp:
155 stmp3xxx_release_pin_group(&mmc_pins, "mmc");
156out:
157 return ret;
158}
159
160static void stmp3xxxmmc_hw_release_ssp1(void)
161{
162 gpio_free(PINID_PWM3);
163 gpio_free(PINID_PWM4);
164 stmp3xxx_release_pin_group(&mmc_pins, "mmc");
165}
166
167static void stmp3xxxmmc_cmd_pullup_ssp1(int enable)
168{
169 stmp3xxx_pin_pullup(PINID_SSP1_CMD, enable, "mmc");
170}
171
172static unsigned long
173stmp3xxxmmc_setclock_ssp1(void __iomem *base, unsigned long hz)
174{
175 struct clk *ssp, *parent;
176 char *p;
177 long r;
178
179 ssp = clk_get(NULL, "ssp");
180
181 /* using SSP1, no timeout, clock rate 1 */
182 writel(BF(2, SSP_TIMING_CLOCK_DIVIDE) |
183 BF(0xFFFF, SSP_TIMING_TIMEOUT),
184 base + HW_SSP_TIMING);
185
186 p = (hz > 1000000) ? "io" : "osc_24M";
187 parent = clk_get(NULL, p);
188 clk_set_parent(ssp, parent);
189 r = clk_set_rate(ssp, 2 * hz / 1000);
190 clk_put(parent);
191 clk_put(ssp);
192
193 return hz;
194}
195
196static struct stmp3xxxmmc_platform_data mmc_data = {
197 .hw_init = stmp3xxxmmc_hw_init_ssp1,
198 .hw_release = stmp3xxxmmc_hw_release_ssp1,
199 .get_wp = stmp3xxxmmc_get_wp,
200 .cmd_pullup = stmp3xxxmmc_cmd_pullup_ssp1,
201 .setclock = stmp3xxxmmc_setclock_ssp1,
202};
203
204
205static struct pin_group appuart_pins[] = {
206 [0] = {
207 .pins = appuart_pins_0,
208 .nr_pins = ARRAY_SIZE(appuart_pins_0),
209 },
210 [1] = {
211 .pins = appuart_pins_1,
212 .nr_pins = ARRAY_SIZE(appuart_pins_1),
213 },
214};
215
216static struct pin_desc ssp1_pins_desc[] = {
217 { PINID_SSP1_SCK, PIN_FUN1, PIN_8MA, PIN_3_3V, 0, },
218 { PINID_SSP1_CMD, PIN_FUN1, PIN_4MA, PIN_3_3V, 0, },
219 { PINID_SSP1_DATA0, PIN_FUN1, PIN_4MA, PIN_3_3V, 0, },
220 { PINID_SSP1_DATA3, PIN_FUN1, PIN_4MA, PIN_3_3V, 0, },
221};
222
223static struct pin_desc ssp2_pins_desc[] = {
224 { PINID_GPMI_WRN, PIN_FUN3, PIN_8MA, PIN_3_3V, 0, },
225 { PINID_GPMI_RDY1, PIN_FUN3, PIN_4MA, PIN_3_3V, 0, },
226 { PINID_GPMI_D00, PIN_FUN3, PIN_4MA, PIN_3_3V, 0, },
227 { PINID_GPMI_D03, PIN_FUN3, PIN_4MA, PIN_3_3V, 0, },
228};
229
230static struct pin_group ssp1_pins = {
231 .pins = ssp1_pins_desc,
232 .nr_pins = ARRAY_SIZE(ssp1_pins_desc),
233};
234
235static struct pin_group ssp2_pins = {
236 .pins = ssp1_pins_desc,
237 .nr_pins = ARRAY_SIZE(ssp2_pins_desc),
238};
239
240static struct pin_desc gpmi_pins_desc[] = {
241 { PINID_GPMI_CE0N, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
242 { PINID_GPMI_CE1N, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
243 { PINID_GMPI_CE2N, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
244 { PINID_GPMI_CLE, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
245 { PINID_GPMI_ALE, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
246 { PINID_GPMI_WPN, PIN_FUN1, PIN_12MA, PIN_3_3V, 0 },
247 { PINID_GPMI_RDY1, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
248 { PINID_GPMI_D00, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
249 { PINID_GPMI_D01, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
250 { PINID_GPMI_D02, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
251 { PINID_GPMI_D03, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
252 { PINID_GPMI_D04, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
253 { PINID_GPMI_D05, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
254 { PINID_GPMI_D06, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
255 { PINID_GPMI_D07, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
256 { PINID_GPMI_RDY0, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
257 { PINID_GPMI_RDY2, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
258 { PINID_GPMI_RDY3, PIN_FUN1, PIN_4MA, PIN_3_3V, 0 },
259 { PINID_GPMI_WRN, PIN_FUN1, PIN_12MA, PIN_3_3V, 0 },
260 { PINID_GPMI_RDN, PIN_FUN1, PIN_12MA, PIN_3_3V, 0 },
261};
262
263static struct pin_group gpmi_pins = {
264 .pins = gpmi_pins_desc,
265 .nr_pins = ARRAY_SIZE(gpmi_pins_desc),
266};
267
268static struct mtd_partition gpmi_partitions[] = {
269 [0] = {
270 .name = "boot",
271 .size = 10 * SZ_1M,
272 .offset = 0,
273 },
274 [1] = {
275 .name = "data",
276 .size = MTDPART_SIZ_FULL,
277 .offset = MTDPART_OFS_APPEND,
278 },
279};
280
281static struct gpmi_platform_data gpmi_data = {
282 .pins = &gpmi_pins,
283 .nr_parts = ARRAY_SIZE(gpmi_partitions),
284 .parts = gpmi_partitions,
285 .part_types = { "cmdline", NULL },
286};
287
288static struct spi_board_info spi_board_info[] __initdata = {
289#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE)
290 {
291 .modalias = "enc28j60",
292 .max_speed_hz = 6 * 1000 * 1000,
293 .bus_num = 1,
294 .chip_select = 0,
295 .platform_data = NULL,
296 },
297#endif
298};
299
300static void __init stmp378x_devb_init(void)
301{
302 stmp3xxx_pinmux_init(NR_REAL_IRQS);
303
304 /* init stmp3xxx platform */
305 stmp3xxx_init();
306
307 stmp3xxx_dbguart.dev.platform_data = dbguart_pins_control;
308 stmp3xxx_appuart.dev.platform_data = appuart_pins;
309 stmp3xxx_mmc.dev.platform_data = &mmc_data;
310 stmp3xxx_gpmi.dev.platform_data = &gpmi_data;
311 stmp3xxx_spi1.dev.platform_data = &ssp1_pins;
312 stmp3xxx_spi2.dev.platform_data = &ssp2_pins;
313 stmp378x_i2c.dev.platform_data = &i2c_pins;
314
315 /* register spi devices */
316 spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
317
318 /* add board's devices */
319 platform_add_devices(devices, ARRAY_SIZE(devices));
320
321 /* add devices selected by command line ssp1= and ssp2= options */
322 stmp3xxx_ssp1_device_register();
323 stmp3xxx_ssp2_device_register();
324}
325
326MACHINE_START(STMP378X, "STMP378X")
327 .boot_params = 0x40000100,
328 .map_io = stmp378x_map_io,
329 .init_irq = stmp378x_init_irq,
330 .timer = &stmp3xxx_timer,
331 .init_machine = stmp378x_devb_init,
332MACHINE_END
diff --git a/arch/arm/mach-stmp37xx/Makefile b/arch/arm/mach-stmp37xx/Makefile
deleted file mode 100644
index 57deffd09fbf..000000000000
--- a/arch/arm/mach-stmp37xx/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
1obj-$(CONFIG_ARCH_STMP37XX) += stmp37xx.o
2obj-$(CONFIG_MACH_STMP37XX) += stmp37xx_devb.o
diff --git a/arch/arm/mach-stmp37xx/Makefile.boot b/arch/arm/mach-stmp37xx/Makefile.boot
deleted file mode 100644
index 1568ad404d59..000000000000
--- a/arch/arm/mach-stmp37xx/Makefile.boot
+++ /dev/null
@@ -1,3 +0,0 @@
1 zreladdr-y := 0x40008000
2params_phys-y := 0x40000100
3initrd_phys-y := 0x40800000
diff --git a/arch/arm/mach-stmp37xx/include/mach/entry-macro.S b/arch/arm/mach-stmp37xx/include/mach/entry-macro.S
deleted file mode 100644
index fed2787b6c34..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/entry-macro.S
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * Low-level IRQ helper macros for Freescale STMP37XX
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18
19 .macro disable_fiq
20 .endm
21
22 .macro get_irqnr_and_base, irqnr, irqstat, base, tmp
23
24 mov \base, #0xf0000000 @ vm address of IRQ controller
25 ldr \irqnr, [\base, #0x30] @ HW_ICOLL_STAT
26 cmp \irqnr, #0x3f
27 movne \irqstat, #0 @ Ack this IRQ
28 strne \irqstat, [\base, #0x00]@ HW_ICOLL_VECTOR
29 moveqs \irqnr, #0 @ Zero flag set for no IRQ
30
31 .endm
32
33 .macro get_irqnr_preamble, base, tmp
34 .endm
35
36 .macro arch_ret_to_user, tmp1, tmp2
37 .endm
diff --git a/arch/arm/mach-stmp37xx/include/mach/irqs.h b/arch/arm/mach-stmp37xx/include/mach/irqs.h
deleted file mode 100644
index 98f12938550d..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/irqs.h
+++ /dev/null
@@ -1,99 +0,0 @@
1/*
2 * Freescale STMP37XX interrupts
3 *
4 * Copyright (C) 2005 Sigmatel Inc
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef _ASM_ARCH_IRQS_H
19#define _ASM_ARCH_IRQS_H
20
21#define IRQ_DEBUG_UART 0
22#define IRQ_COMMS_RX 1
23#define IRQ_COMMS_TX 1
24#define IRQ_SSP2_ERROR 2
25#define IRQ_VDD5V 3
26#define IRQ_HEADPHONE_SHORT 4
27#define IRQ_DAC_DMA 5
28#define IRQ_DAC_ERROR 6
29#define IRQ_ADC_DMA 7
30#define IRQ_ADC_ERROR 8
31#define IRQ_SPDIF_DMA 9
32#define IRQ_SAIF2_DMA 9
33#define IRQ_SPDIF_ERROR 10
34#define IRQ_SAIF1_IRQ 10
35#define IRQ_SAIF2_IRQ 10
36#define IRQ_USB_CTRL 11
37#define IRQ_USB_WAKEUP 12
38#define IRQ_GPMI_DMA 13
39#define IRQ_SSP1_DMA 14
40#define IRQ_SSP_ERROR 15
41#define IRQ_GPIO0 16
42#define IRQ_GPIO1 17
43#define IRQ_GPIO2 18
44#define IRQ_SAIF1_DMA 19
45#define IRQ_SSP2_DMA 20
46#define IRQ_ECC8_IRQ 21
47#define IRQ_RTC_ALARM 22
48#define IRQ_UARTAPP_TX_DMA 23
49#define IRQ_UARTAPP_INTERNAL 24
50#define IRQ_UARTAPP_RX_DMA 25
51#define IRQ_I2C_DMA 26
52#define IRQ_I2C_ERROR 27
53#define IRQ_TIMER0 28
54#define IRQ_TIMER1 29
55#define IRQ_TIMER2 30
56#define IRQ_TIMER3 31
57#define IRQ_BATT_BRNOUT 32
58#define IRQ_VDDD_BRNOUT 33
59#define IRQ_VDDIO_BRNOUT 34
60#define IRQ_VDD18_BRNOUT 35
61#define IRQ_TOUCH_DETECT 36
62#define IRQ_LRADC_CH0 37
63#define IRQ_LRADC_CH1 38
64#define IRQ_LRADC_CH2 39
65#define IRQ_LRADC_CH3 40
66#define IRQ_LRADC_CH4 41
67#define IRQ_LRADC_CH5 42
68#define IRQ_LRADC_CH6 43
69#define IRQ_LRADC_CH7 44
70#define IRQ_LCDIF_DMA 45
71#define IRQ_LCDIF_ERROR 46
72#define IRQ_DIGCTL_DEBUG_TRAP 47
73#define IRQ_RTC_1MSEC 48
74#define IRQ_DRI_DMA 49
75#define IRQ_DRI_ATTENTION 50
76#define IRQ_GPMI_ATTENTION 51
77#define IRQ_IR 52
78#define IRQ_DCP_VMI 53
79#define IRQ_DCP 54
80#define IRQ_RESERVED_55 55
81#define IRQ_RESERVED_56 56
82#define IRQ_RESERVED_57 57
83#define IRQ_RESERVED_58 58
84#define IRQ_RESERVED_59 59
85#define SW_IRQ_60 60
86#define SW_IRQ_61 61
87#define SW_IRQ_62 62
88#define SW_IRQ_63 63
89
90#define NR_REAL_IRQS 64
91#define NR_IRQS (NR_REAL_IRQS + 32 * 3)
92
93/* TIMER and BRNOUT are FIQ capable */
94#define FIQ_START IRQ_TIMER0
95
96/* Hard disk IRQ is a GPMI attention IRQ */
97#define IRQ_HARDDISK IRQ_GPMI_ATTENTION
98
99#endif /* _ASM_ARCH_IRQS_H */
diff --git a/arch/arm/mach-stmp37xx/include/mach/pins.h b/arch/arm/mach-stmp37xx/include/mach/pins.h
deleted file mode 100644
index d56de0c471d8..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/pins.h
+++ /dev/null
@@ -1,147 +0,0 @@
1/*
2 * Freescale STMP37XX SoC pin multiplexing
3 *
4 * Author: Vladislav Buzov <vbuzov@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __ASM_ARCH_PINS_H
19#define __ASM_ARCH_PINS_H
20
21/*
22 * Define all STMP37XX pins, a pin name corresponds to a STMP37xx hardware
23 * interface this pin belongs to.
24 */
25
26/* Bank 0 */
27#define PINID_GPMI_D00 STMP3XXX_PINID(0, 0)
28#define PINID_GPMI_D01 STMP3XXX_PINID(0, 1)
29#define PINID_GPMI_D02 STMP3XXX_PINID(0, 2)
30#define PINID_GPMI_D03 STMP3XXX_PINID(0, 3)
31#define PINID_GPMI_D04 STMP3XXX_PINID(0, 4)
32#define PINID_GPMI_D05 STMP3XXX_PINID(0, 5)
33#define PINID_GPMI_D06 STMP3XXX_PINID(0, 6)
34#define PINID_GPMI_D07 STMP3XXX_PINID(0, 7)
35#define PINID_GPMI_D08 STMP3XXX_PINID(0, 8)
36#define PINID_GPMI_D09 STMP3XXX_PINID(0, 9)
37#define PINID_GPMI_D10 STMP3XXX_PINID(0, 10)
38#define PINID_GPMI_D11 STMP3XXX_PINID(0, 11)
39#define PINID_GPMI_D12 STMP3XXX_PINID(0, 12)
40#define PINID_GPMI_D13 STMP3XXX_PINID(0, 13)
41#define PINID_GPMI_D14 STMP3XXX_PINID(0, 14)
42#define PINID_GPMI_D15 STMP3XXX_PINID(0, 15)
43#define PINID_GPMI_A0 STMP3XXX_PINID(0, 16)
44#define PINID_GPMI_A1 STMP3XXX_PINID(0, 17)
45#define PINID_GPMI_A2 STMP3XXX_PINID(0, 18)
46#define PINID_GPMI_RDY0 STMP3XXX_PINID(0, 19)
47#define PINID_GPMI_RDY2 STMP3XXX_PINID(0, 20)
48#define PINID_GPMI_RDY3 STMP3XXX_PINID(0, 21)
49#define PINID_GPMI_RESETN STMP3XXX_PINID(0, 22)
50#define PINID_GPMI_IRQ STMP3XXX_PINID(0, 23)
51#define PINID_GPMI_WRN STMP3XXX_PINID(0, 24)
52#define PINID_GPMI_RDN STMP3XXX_PINID(0, 25)
53#define PINID_UART2_CTS STMP3XXX_PINID(0, 26)
54#define PINID_UART2_RTS STMP3XXX_PINID(0, 27)
55#define PINID_UART2_RX STMP3XXX_PINID(0, 28)
56#define PINID_UART2_TX STMP3XXX_PINID(0, 29)
57
58/* Bank 1 */
59#define PINID_LCD_D00 STMP3XXX_PINID(1, 0)
60#define PINID_LCD_D01 STMP3XXX_PINID(1, 1)
61#define PINID_LCD_D02 STMP3XXX_PINID(1, 2)
62#define PINID_LCD_D03 STMP3XXX_PINID(1, 3)
63#define PINID_LCD_D04 STMP3XXX_PINID(1, 4)
64#define PINID_LCD_D05 STMP3XXX_PINID(1, 5)
65#define PINID_LCD_D06 STMP3XXX_PINID(1, 6)
66#define PINID_LCD_D07 STMP3XXX_PINID(1, 7)
67#define PINID_LCD_D08 STMP3XXX_PINID(1, 8)
68#define PINID_LCD_D09 STMP3XXX_PINID(1, 9)
69#define PINID_LCD_D10 STMP3XXX_PINID(1, 10)
70#define PINID_LCD_D11 STMP3XXX_PINID(1, 11)
71#define PINID_LCD_D12 STMP3XXX_PINID(1, 12)
72#define PINID_LCD_D13 STMP3XXX_PINID(1, 13)
73#define PINID_LCD_D14 STMP3XXX_PINID(1, 14)
74#define PINID_LCD_D15 STMP3XXX_PINID(1, 15)
75#define PINID_LCD_RESET STMP3XXX_PINID(1, 16)
76#define PINID_LCD_RS STMP3XXX_PINID(1, 17)
77#define PINID_LCD_WR_RWN STMP3XXX_PINID(1, 18)
78#define PINID_LCD_RD_E STMP3XXX_PINID(1, 19)
79#define PINID_LCD_CS STMP3XXX_PINID(1, 20)
80#define PINID_LCD_BUSY STMP3XXX_PINID(1, 21)
81#define PINID_SSP1_CMD STMP3XXX_PINID(1, 22)
82#define PINID_SSP1_SCK STMP3XXX_PINID(1, 23)
83#define PINID_SSP1_DATA0 STMP3XXX_PINID(1, 24)
84#define PINID_SSP1_DATA1 STMP3XXX_PINID(1, 25)
85#define PINID_SSP1_DATA2 STMP3XXX_PINID(1, 26)
86#define PINID_SSP1_DATA3 STMP3XXX_PINID(1, 27)
87#define PINID_SSP1_DETECT STMP3XXX_PINID(1, 28)
88
89/* Bank 2 */
90#define PINID_PWM0 STMP3XXX_PINID(2, 0)
91#define PINID_PWM1 STMP3XXX_PINID(2, 1)
92#define PINID_PWM2 STMP3XXX_PINID(2, 2)
93#define PINID_PWM3 STMP3XXX_PINID(2, 3)
94#define PINID_PWM4 STMP3XXX_PINID(2, 4)
95#define PINID_I2C_SCL STMP3XXX_PINID(2, 5)
96#define PINID_I2C_SDA STMP3XXX_PINID(2, 6)
97#define PINID_ROTTARYA STMP3XXX_PINID(2, 7)
98#define PINID_ROTTARYB STMP3XXX_PINID(2, 8)
99#define PINID_EMI_CKE STMP3XXX_PINID(2, 9)
100#define PINID_EMI_RASN STMP3XXX_PINID(2, 10)
101#define PINID_EMI_CASN STMP3XXX_PINID(2, 11)
102#define PINID_EMI_CE0N STMP3XXX_PINID(2, 12)
103#define PINID_EMI_CE1N STMP3XXX_PINID(2, 13)
104#define PINID_EMI_CE2N STMP3XXX_PINID(2, 14)
105#define PINID_EMI_CE3N STMP3XXX_PINID(2, 15)
106#define PINID_EMI_A00 STMP3XXX_PINID(2, 16)
107#define PINID_EMI_A01 STMP3XXX_PINID(2, 17)
108#define PINID_EMI_A02 STMP3XXX_PINID(2, 18)
109#define PINID_EMI_A03 STMP3XXX_PINID(2, 19)
110#define PINID_EMI_A04 STMP3XXX_PINID(2, 20)
111#define PINID_EMI_A05 STMP3XXX_PINID(2, 21)
112#define PINID_EMI_A06 STMP3XXX_PINID(2, 22)
113#define PINID_EMI_A07 STMP3XXX_PINID(2, 23)
114#define PINID_EMI_A08 STMP3XXX_PINID(2, 24)
115#define PINID_EMI_A09 STMP3XXX_PINID(2, 25)
116#define PINID_EMI_A10 STMP3XXX_PINID(2, 26)
117#define PINID_EMI_A11 STMP3XXX_PINID(2, 27)
118#define PINID_EMI_A12 STMP3XXX_PINID(2, 28)
119#define PINID_EMI_A13 STMP3XXX_PINID(2, 29)
120#define PINID_EMI_A14 STMP3XXX_PINID(2, 30)
121#define PINID_EMI_WEN STMP3XXX_PINID(2, 31)
122
123/* Bank 3 */
124#define PINID_EMI_D00 STMP3XXX_PINID(3, 0)
125#define PINID_EMI_D01 STMP3XXX_PINID(3, 1)
126#define PINID_EMI_D02 STMP3XXX_PINID(3, 2)
127#define PINID_EMI_D03 STMP3XXX_PINID(3, 3)
128#define PINID_EMI_D04 STMP3XXX_PINID(3, 4)
129#define PINID_EMI_D05 STMP3XXX_PINID(3, 5)
130#define PINID_EMI_D06 STMP3XXX_PINID(3, 6)
131#define PINID_EMI_D07 STMP3XXX_PINID(3, 7)
132#define PINID_EMI_D08 STMP3XXX_PINID(3, 8)
133#define PINID_EMI_D09 STMP3XXX_PINID(3, 9)
134#define PINID_EMI_D10 STMP3XXX_PINID(3, 10)
135#define PINID_EMI_D11 STMP3XXX_PINID(3, 11)
136#define PINID_EMI_D12 STMP3XXX_PINID(3, 12)
137#define PINID_EMI_D13 STMP3XXX_PINID(3, 13)
138#define PINID_EMI_D14 STMP3XXX_PINID(3, 14)
139#define PINID_EMI_D15 STMP3XXX_PINID(3, 15)
140#define PINID_EMI_DQS0 STMP3XXX_PINID(3, 16)
141#define PINID_EMI_DQS1 STMP3XXX_PINID(3, 17)
142#define PINID_EMI_DQM0 STMP3XXX_PINID(3, 18)
143#define PINID_EMI_DQM1 STMP3XXX_PINID(3, 19)
144#define PINID_EMI_CLK STMP3XXX_PINID(3, 20)
145#define PINID_EMI_CLKN STMP3XXX_PINID(3, 21)
146
147#endif /* __ASM_ARCH_PINS_H */
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-apbh.h b/arch/arm/mach-stmp37xx/include/mach/regs-apbh.h
deleted file mode 100644
index a323aa9a21f2..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-apbh.h
+++ /dev/null
@@ -1,97 +0,0 @@
1/*
2 * stmp37xx: APBH register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#ifndef _MACH_REGS_APBH
22#define _MACH_REGS_APBH
23
24#define REGS_APBH_BASE (STMP3XXX_REGS_BASE + 0x4000)
25
26#define HW_APBH_CTRL0 0x0
27#define BM_APBH_CTRL0_RESET_CHANNEL 0x00FF0000
28#define BP_APBH_CTRL0_RESET_CHANNEL 16
29#define BM_APBH_CTRL0_CLKGATE 0x40000000
30#define BM_APBH_CTRL0_SFTRST 0x80000000
31
32#define HW_APBH_CTRL1 0x10
33#define BM_APBH_CTRL1_CH0_CMDCMPLT_IRQ 0x00000001
34#define BP_APBH_CTRL1_CH0_CMDCMPLT_IRQ 0
35
36#define HW_APBH_DEVSEL 0x20
37
38#define HW_APBH_CH0_NXTCMDAR (0x50 + 0 * 0x70)
39#define HW_APBH_CH1_NXTCMDAR (0x50 + 1 * 0x70)
40#define HW_APBH_CH2_NXTCMDAR (0x50 + 2 * 0x70)
41#define HW_APBH_CH3_NXTCMDAR (0x50 + 3 * 0x70)
42#define HW_APBH_CH4_NXTCMDAR (0x50 + 4 * 0x70)
43#define HW_APBH_CH5_NXTCMDAR (0x50 + 5 * 0x70)
44#define HW_APBH_CH6_NXTCMDAR (0x50 + 6 * 0x70)
45#define HW_APBH_CH7_NXTCMDAR (0x50 + 7 * 0x70)
46#define HW_APBH_CH8_NXTCMDAR (0x50 + 8 * 0x70)
47#define HW_APBH_CH9_NXTCMDAR (0x50 + 9 * 0x70)
48#define HW_APBH_CH10_NXTCMDAR (0x50 + 10 * 0x70)
49#define HW_APBH_CH11_NXTCMDAR (0x50 + 11 * 0x70)
50#define HW_APBH_CH12_NXTCMDAR (0x50 + 12 * 0x70)
51#define HW_APBH_CH13_NXTCMDAR (0x50 + 13 * 0x70)
52#define HW_APBH_CH14_NXTCMDAR (0x50 + 14 * 0x70)
53#define HW_APBH_CH15_NXTCMDAR (0x50 + 15 * 0x70)
54
55#define HW_APBH_CHn_NXTCMDAR 0x50
56
57#define BM_APBH_CHn_CMD_MODE 0x00000003
58#define BP_APBH_CHn_CMD_MODE 0x00000001
59#define BV_APBH_CHn_CMD_MODE_NOOP 0
60#define BV_APBH_CHn_CMD_MODE_WRITE 1
61#define BV_APBH_CHn_CMD_MODE_READ 2
62#define BV_APBH_CHn_CMD_MODE_SENSE 3
63#define BM_APBH_CHn_CMD_CHAIN 0x00000004
64#define BM_APBH_CHn_CMD_IRQONCMPLT 0x00000008
65#define BM_APBH_CHn_CMD_NANDLOCK 0x00000010
66#define BM_APBH_CHn_CMD_NANDWAIT4READY 0x00000020
67#define BM_APBH_CHn_CMD_SEMAPHORE 0x00000040
68#define BM_APBH_CHn_CMD_WAIT4ENDCMD 0x00000080
69#define BM_APBH_CHn_CMD_CMDWORDS 0x0000F000
70#define BP_APBH_CHn_CMD_CMDWORDS 12
71#define BM_APBH_CHn_CMD_XFER_COUNT 0xFFFF0000
72#define BP_APBH_CHn_CMD_XFER_COUNT 16
73
74#define HW_APBH_CH0_SEMA (0x80 + 0 * 0x70)
75#define HW_APBH_CH1_SEMA (0x80 + 1 * 0x70)
76#define HW_APBH_CH2_SEMA (0x80 + 2 * 0x70)
77#define HW_APBH_CH3_SEMA (0x80 + 3 * 0x70)
78#define HW_APBH_CH4_SEMA (0x80 + 4 * 0x70)
79#define HW_APBH_CH5_SEMA (0x80 + 5 * 0x70)
80#define HW_APBH_CH6_SEMA (0x80 + 6 * 0x70)
81#define HW_APBH_CH7_SEMA (0x80 + 7 * 0x70)
82#define HW_APBH_CH8_SEMA (0x80 + 8 * 0x70)
83#define HW_APBH_CH9_SEMA (0x80 + 9 * 0x70)
84#define HW_APBH_CH10_SEMA (0x80 + 10 * 0x70)
85#define HW_APBH_CH11_SEMA (0x80 + 11 * 0x70)
86#define HW_APBH_CH12_SEMA (0x80 + 12 * 0x70)
87#define HW_APBH_CH13_SEMA (0x80 + 13 * 0x70)
88#define HW_APBH_CH14_SEMA (0x80 + 14 * 0x70)
89#define HW_APBH_CH15_SEMA (0x80 + 15 * 0x70)
90
91#define HW_APBH_CHn_SEMA 0x80
92#define BM_APBH_CHn_SEMA_INCREMENT_SEMA 0x000000FF
93#define BP_APBH_CHn_SEMA_INCREMENT_SEMA 0
94#define BM_APBH_CHn_SEMA_PHORE 0x00FF0000
95#define BP_APBH_CHn_SEMA_PHORE 16
96
97#endif
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-apbx.h b/arch/arm/mach-stmp37xx/include/mach/regs-apbx.h
deleted file mode 100644
index 6d080cd5b702..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-apbx.h
+++ /dev/null
@@ -1,113 +0,0 @@
1/*
2 * stmp37xx: APBX register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#ifndef _MACH_REGS_APBX
22#define _MACH_REGS_APBX
23
24#define REGS_APBX_BASE (STMP3XXX_REGS_BASE + 0x24000)
25
26#define HW_APBX_CTRL0 0x0
27#define BM_APBX_CTRL0_RESET_CHANNEL 0x00FF0000
28#define BP_APBX_CTRL0_RESET_CHANNEL 16
29#define BM_APBX_CTRL0_CLKGATE 0x40000000
30#define BM_APBX_CTRL0_SFTRST 0x80000000
31
32#define HW_APBX_CTRL1 0x10
33
34#define HW_APBX_DEVSEL 0x20
35
36#define HW_APBX_CH0_NXTCMDAR (0x50 + 0 * 0x70)
37#define HW_APBX_CH1_NXTCMDAR (0x50 + 1 * 0x70)
38#define HW_APBX_CH2_NXTCMDAR (0x50 + 2 * 0x70)
39#define HW_APBX_CH3_NXTCMDAR (0x50 + 3 * 0x70)
40#define HW_APBX_CH4_NXTCMDAR (0x50 + 4 * 0x70)
41#define HW_APBX_CH5_NXTCMDAR (0x50 + 5 * 0x70)
42#define HW_APBX_CH6_NXTCMDAR (0x50 + 6 * 0x70)
43#define HW_APBX_CH7_NXTCMDAR (0x50 + 7 * 0x70)
44#define HW_APBX_CH8_NXTCMDAR (0x50 + 8 * 0x70)
45#define HW_APBX_CH9_NXTCMDAR (0x50 + 9 * 0x70)
46#define HW_APBX_CH10_NXTCMDAR (0x50 + 10 * 0x70)
47#define HW_APBX_CH11_NXTCMDAR (0x50 + 11 * 0x70)
48#define HW_APBX_CH12_NXTCMDAR (0x50 + 12 * 0x70)
49#define HW_APBX_CH13_NXTCMDAR (0x50 + 13 * 0x70)
50#define HW_APBX_CH14_NXTCMDAR (0x50 + 14 * 0x70)
51#define HW_APBX_CH15_NXTCMDAR (0x50 + 15 * 0x70)
52
53#define HW_APBX_CHn_NXTCMDAR 0x50
54#define BM_APBX_CHn_CMD_MODE 0x00000003
55#define BP_APBX_CHn_CMD_MODE 0x00000001
56#define BV_APBX_CHn_CMD_MODE_NOOP 0
57#define BV_APBX_CHn_CMD_MODE_WRITE 1
58#define BV_APBX_CHn_CMD_MODE_READ 2
59#define BV_APBX_CHn_CMD_MODE_SENSE 3
60#define BM_APBX_CHn_CMD_COMMAND 0x00000003
61#define BP_APBX_CHn_CMD_COMMAND 0
62#define BM_APBX_CHn_CMD_CHAIN 0x00000004
63#define BM_APBX_CHn_CMD_IRQONCMPLT 0x00000008
64#define BM_APBX_CHn_CMD_SEMAPHORE 0x00000040
65#define BM_APBX_CHn_CMD_WAIT4ENDCMD 0x00000080
66#define BM_APBX_CHn_CMD_CMDWORDS 0x0000F000
67#define BP_APBX_CHn_CMD_CMDWORDS 12
68#define BM_APBX_CHn_CMD_XFER_COUNT 0xFFFF0000
69#define BP_APBX_CHn_CMD_XFER_COUNT 16
70
71#define HW_APBX_CH0_BAR (0x70 + 0 * 0x70)
72#define HW_APBX_CH1_BAR (0x70 + 1 * 0x70)
73#define HW_APBX_CH2_BAR (0x70 + 2 * 0x70)
74#define HW_APBX_CH3_BAR (0x70 + 3 * 0x70)
75#define HW_APBX_CH4_BAR (0x70 + 4 * 0x70)
76#define HW_APBX_CH5_BAR (0x70 + 5 * 0x70)
77#define HW_APBX_CH6_BAR (0x70 + 6 * 0x70)
78#define HW_APBX_CH7_BAR (0x70 + 7 * 0x70)
79#define HW_APBX_CH8_BAR (0x70 + 8 * 0x70)
80#define HW_APBX_CH9_BAR (0x70 + 9 * 0x70)
81#define HW_APBX_CH10_BAR (0x70 + 10 * 0x70)
82#define HW_APBX_CH11_BAR (0x70 + 11 * 0x70)
83#define HW_APBX_CH12_BAR (0x70 + 12 * 0x70)
84#define HW_APBX_CH13_BAR (0x70 + 13 * 0x70)
85#define HW_APBX_CH14_BAR (0x70 + 14 * 0x70)
86#define HW_APBX_CH15_BAR (0x70 + 15 * 0x70)
87
88#define HW_APBX_CHn_BAR 0x70
89
90#define HW_APBX_CH0_SEMA (0x80 + 0 * 0x70)
91#define HW_APBX_CH1_SEMA (0x80 + 1 * 0x70)
92#define HW_APBX_CH2_SEMA (0x80 + 2 * 0x70)
93#define HW_APBX_CH3_SEMA (0x80 + 3 * 0x70)
94#define HW_APBX_CH4_SEMA (0x80 + 4 * 0x70)
95#define HW_APBX_CH5_SEMA (0x80 + 5 * 0x70)
96#define HW_APBX_CH6_SEMA (0x80 + 6 * 0x70)
97#define HW_APBX_CH7_SEMA (0x80 + 7 * 0x70)
98#define HW_APBX_CH8_SEMA (0x80 + 8 * 0x70)
99#define HW_APBX_CH9_SEMA (0x80 + 9 * 0x70)
100#define HW_APBX_CH10_SEMA (0x80 + 10 * 0x70)
101#define HW_APBX_CH11_SEMA (0x80 + 11 * 0x70)
102#define HW_APBX_CH12_SEMA (0x80 + 12 * 0x70)
103#define HW_APBX_CH13_SEMA (0x80 + 13 * 0x70)
104#define HW_APBX_CH14_SEMA (0x80 + 14 * 0x70)
105#define HW_APBX_CH15_SEMA (0x80 + 15 * 0x70)
106
107#define HW_APBX_CHn_SEMA 0x80
108#define BM_APBX_CHn_SEMA_INCREMENT_SEMA 0x000000FF
109#define BP_APBX_CHn_SEMA_INCREMENT_SEMA 0
110#define BM_APBX_CHn_SEMA_PHORE 0x00FF0000
111#define BP_APBX_CHn_SEMA_PHORE 16
112
113#endif
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-audioin.h b/arch/arm/mach-stmp37xx/include/mach/regs-audioin.h
deleted file mode 100644
index 3b511f947a53..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-audioin.h
+++ /dev/null
@@ -1,61 +0,0 @@
1/*
2 * stmp37xx: AUDIOIN register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_AUDIOIN_BASE (STMP3XXX_REGS_BASE + 0x4C000)
22
23#define HW_AUDIOIN_CTRL 0x0
24#define BM_AUDIOIN_CTRL_RUN 0x00000001
25#define BP_AUDIOIN_CTRL_RUN 0
26#define BM_AUDIOIN_CTRL_FIFO_ERROR_IRQ_EN 0x00000002
27#define BM_AUDIOIN_CTRL_FIFO_OVERFLOW_IRQ 0x00000004
28#define BM_AUDIOIN_CTRL_FIFO_UNDERFLOW_IRQ 0x00000008
29#define BM_AUDIOIN_CTRL_WORD_LENGTH 0x00000020
30#define BM_AUDIOIN_CTRL_CLKGATE 0x40000000
31#define BM_AUDIOIN_CTRL_SFTRST 0x80000000
32
33#define HW_AUDIOIN_STAT 0x10
34
35#define HW_AUDIOIN_ADCSRR 0x20
36
37#define HW_AUDIOIN_ADCVOLUME 0x30
38#define BM_AUDIOIN_ADCVOLUME_VOLUME_RIGHT 0x000000FF
39#define BP_AUDIOIN_ADCVOLUME_VOLUME_RIGHT 0
40#define BM_AUDIOIN_ADCVOLUME_VOLUME_LEFT 0x00FF0000
41#define BP_AUDIOIN_ADCVOLUME_VOLUME_LEFT 16
42
43#define HW_AUDIOIN_ADCDEBUG 0x40
44
45#define HW_AUDIOIN_ADCVOL 0x50
46#define BM_AUDIOIN_ADCVOL_GAIN_RIGHT 0x0000000F
47#define BP_AUDIOIN_ADCVOL_GAIN_RIGHT 0
48#define BM_AUDIOIN_ADCVOL_SELECT_RIGHT 0x00000030
49#define BP_AUDIOIN_ADCVOL_SELECT_RIGHT 4
50#define BM_AUDIOIN_ADCVOL_GAIN_LEFT 0x00000F00
51#define BP_AUDIOIN_ADCVOL_GAIN_LEFT 8
52#define BM_AUDIOIN_ADCVOL_SELECT_LEFT 0x00003000
53#define BP_AUDIOIN_ADCVOL_SELECT_LEFT 12
54#define BM_AUDIOIN_ADCVOL_MUTE 0x01000000
55
56#define HW_AUDIOIN_MICLINE 0x60
57
58#define HW_AUDIOIN_ANACLKCTRL 0x70
59#define BM_AUDIOIN_ANACLKCTRL_CLKGATE 0x80000000
60
61#define HW_AUDIOIN_DATA 0x80
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-audioout.h b/arch/arm/mach-stmp37xx/include/mach/regs-audioout.h
deleted file mode 100644
index ca1942b8a3e9..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-audioout.h
+++ /dev/null
@@ -1,111 +0,0 @@
1/*
2 * stmp37xx: AUDIOOUT register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_AUDIOOUT_BASE (STMP3XXX_REGS_BASE + 0x48000)
22
23#define HW_AUDIOOUT_CTRL 0x0
24#define BM_AUDIOOUT_CTRL_RUN 0x00000001
25#define BP_AUDIOOUT_CTRL_RUN 0
26#define BM_AUDIOOUT_CTRL_FIFO_ERROR_IRQ_EN 0x00000002
27#define BM_AUDIOOUT_CTRL_FIFO_OVERFLOW_IRQ 0x00000004
28#define BM_AUDIOOUT_CTRL_FIFO_UNDERFLOW_IRQ 0x00000008
29#define BM_AUDIOOUT_CTRL_WORD_LENGTH 0x00000040
30#define BM_AUDIOOUT_CTRL_CLKGATE 0x40000000
31#define BM_AUDIOOUT_CTRL_SFTRST 0x80000000
32
33#define HW_AUDIOOUT_STAT 0x10
34
35#define HW_AUDIOOUT_DACSRR 0x20
36#define BM_AUDIOOUT_DACSRR_SRC_FRAC 0x00001FFF
37#define BP_AUDIOOUT_DACSRR_SRC_FRAC 0
38#define BM_AUDIOOUT_DACSRR_SRC_INT 0x001F0000
39#define BP_AUDIOOUT_DACSRR_SRC_INT 16
40#define BM_AUDIOOUT_DACSRR_SRC_HOLD 0x07000000
41#define BP_AUDIOOUT_DACSRR_SRC_HOLD 24
42#define BM_AUDIOOUT_DACSRR_BASEMULT 0x70000000
43#define BP_AUDIOOUT_DACSRR_BASEMULT 28
44
45#define HW_AUDIOOUT_DACVOLUME 0x30
46#define BM_AUDIOOUT_DACVOLUME_MUTE_RIGHT 0x00000100
47#define BM_AUDIOOUT_DACVOLUME_MUTE_LEFT 0x01000000
48#define BM_AUDIOOUT_DACVOLUME_EN_ZCD 0x02000000
49
50#define HW_AUDIOOUT_DACDEBUG 0x40
51
52#define HW_AUDIOOUT_HPVOL 0x50
53#define BM_AUDIOOUT_HPVOL_MUTE 0x01000000
54#define BM_AUDIOOUT_HPVOL_EN_MSTR_ZCD 0x02000000
55
56#define HW_AUDIOOUT_PWRDN 0x70
57#define BM_AUDIOOUT_PWRDN_HEADPHONE 0x00000001
58#define BP_AUDIOOUT_PWRDN_HEADPHONE 0
59#define BM_AUDIOOUT_PWRDN_CAPLESS 0x00000010
60#define BM_AUDIOOUT_PWRDN_ADC 0x00000100
61#define BM_AUDIOOUT_PWRDN_DAC 0x00001000
62#define BM_AUDIOOUT_PWRDN_RIGHT_ADC 0x00010000
63#define BM_AUDIOOUT_PWRDN_LINEOUT 0x01000000
64
65#define HW_AUDIOOUT_REFCTRL 0x80
66#define BM_AUDIOOUT_REFCTRL_VAG_VAL 0x000000F0
67#define BP_AUDIOOUT_REFCTRL_VAG_VAL 4
68#define BM_AUDIOOUT_REFCTRL_ADC_REFVAL 0x00000F00
69#define BP_AUDIOOUT_REFCTRL_ADC_REFVAL 8
70#define BM_AUDIOOUT_REFCTRL_ADJ_VAG 0x00001000
71#define BM_AUDIOOUT_REFCTRL_ADJ_ADC 0x00002000
72#define BM_AUDIOOUT_REFCTRL_BIAS_CTRL 0x00030000
73#define BP_AUDIOOUT_REFCTRL_BIAS_CTRL 16
74#define BM_AUDIOOUT_REFCTRL_LOW_PWR 0x00080000
75#define BM_AUDIOOUT_REFCTRL_VBG_ADJ 0x00700000
76#define BP_AUDIOOUT_REFCTRL_VBG_ADJ 20
77#define BM_AUDIOOUT_REFCTRL_XTAL_BGR_BIAS 0x01000000
78#define BM_AUDIOOUT_REFCTRL_RAISE_REF 0x02000000
79
80#define HW_AUDIOOUT_ANACTRL 0x90
81#define BM_AUDIOOUT_ANACTRL_HP_CLASSAB 0x00000010
82#define BM_AUDIOOUT_ANACTRL_HP_HOLD_GND 0x00000020
83
84#define HW_AUDIOOUT_TEST 0xA0
85#define BM_AUDIOOUT_TEST_HP_I1_ADJ 0x00C00000
86#define BP_AUDIOOUT_TEST_HP_I1_ADJ 22
87
88#define HW_AUDIOOUT_BISTCTRL 0xB0
89
90#define HW_AUDIOOUT_BISTSTAT0 0xC0
91
92#define HW_AUDIOOUT_BISTSTAT1 0xD0
93
94#define HW_AUDIOOUT_ANACLKCTRL 0xE0
95#define BM_AUDIOOUT_ANACLKCTRL_CLKGATE 0x80000000
96
97#define HW_AUDIOOUT_DATA 0xF0
98
99#define HW_AUDIOOUT_LINEOUTCTRL 0x100
100#define BM_AUDIOOUT_LINEOUTCTRL_VOL_RIGHT 0x0000001F
101#define BP_AUDIOOUT_LINEOUTCTRL_VOL_RIGHT 0
102#define BM_AUDIOOUT_LINEOUTCTRL_VOL_LEFT 0x00001F00
103#define BP_AUDIOOUT_LINEOUTCTRL_VOL_LEFT 8
104#define BM_AUDIOOUT_LINEOUTCTRL_CHARGE_CAP 0x00007000
105#define BP_AUDIOOUT_LINEOUTCTRL_CHARGE_CAP 12
106#define BM_AUDIOOUT_LINEOUTCTRL_VAG_CTRL 0x00F00000
107#define BP_AUDIOOUT_LINEOUTCTRL_VAG_CTRL 20
108#define BM_AUDIOOUT_LINEOUTCTRL_MUTE 0x01000000
109#define BM_AUDIOOUT_LINEOUTCTRL_EN_ZCD 0x02000000
110
111#define HW_AUDIOOUT_VERSION 0x200
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-clkctrl.h b/arch/arm/mach-stmp37xx/include/mach/regs-clkctrl.h
deleted file mode 100644
index 47f5c92fdaf6..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-clkctrl.h
+++ /dev/null
@@ -1,72 +0,0 @@
1/*
2 * stmp37xx: CLKCTRL register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#ifndef _MACH_REGS_CLKCTRL
22#define _MACH_REGS_CLKCTRL
23
24#define REGS_CLKCTRL_BASE (STMP3XXX_REGS_BASE + 0x40000)
25
26#define HW_CLKCTRL_PLLCTRL0 0x0
27#define BM_CLKCTRL_PLLCTRL0_EN_USB_CLKS 0x00040000
28
29#define HW_CLKCTRL_CPU 0x20
30#define BM_CLKCTRL_CPU_DIV_CPU 0x0000003F
31#define BP_CLKCTRL_CPU_DIV_CPU 0
32
33#define HW_CLKCTRL_HBUS 0x30
34#define BM_CLKCTRL_HBUS_DIV 0x0000001F
35#define BP_CLKCTRL_HBUS_DIV 0
36
37#define HW_CLKCTRL_XBUS 0x40
38
39#define HW_CLKCTRL_XTAL 0x50
40
41#define HW_CLKCTRL_PIX 0x60
42#define BM_CLKCTRL_PIX_DIV 0x00007FFF
43#define BP_CLKCTRL_PIX_DIV 0
44#define BM_CLKCTRL_PIX_CLKGATE 0x80000000
45
46#define HW_CLKCTRL_SSP 0x70
47
48#define HW_CLKCTRL_GPMI 0x80
49
50#define HW_CLKCTRL_SPDIF 0x90
51
52#define HW_CLKCTRL_EMI 0xA0
53
54#define HW_CLKCTRL_IR 0xB0
55
56#define HW_CLKCTRL_SAIF 0xC0
57
58#define HW_CLKCTRL_FRAC 0xD0
59#define BM_CLKCTRL_FRAC_EMIFRAC 0x00003F00
60#define BP_CLKCTRL_FRAC_EMIFRAC 8
61#define BM_CLKCTRL_FRAC_PIXFRAC 0x003F0000
62#define BP_CLKCTRL_FRAC_PIXFRAC 16
63#define BM_CLKCTRL_FRAC_CLKGATEPIX 0x00800000
64
65#define HW_CLKCTRL_CLKSEQ 0xE0
66#define BM_CLKCTRL_CLKSEQ_BYPASS_PIX 0x00000002
67
68#define HW_CLKCTRL_RESET 0xF0
69#define BM_CLKCTRL_RESET_DIG 0x00000001
70#define BP_CLKCTRL_RESET_DIG 0
71
72#endif
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-digctl.h b/arch/arm/mach-stmp37xx/include/mach/regs-digctl.h
deleted file mode 100644
index ba1bbe265c20..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-digctl.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * stmp37xx: DIGCTL register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_DIGCTL_BASE (STMP3XXX_REGS_BASE + 0x1C000)
22
23#define HW_DIGCTL_CTRL 0x0
24#define BM_DIGCTL_CTRL_USB_CLKGATE 0x00000004
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-ecc8.h b/arch/arm/mach-stmp37xx/include/mach/regs-ecc8.h
deleted file mode 100644
index 3b6d990a3af5..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-ecc8.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * stmp37xx: ECC8 register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_ECC8_BASE (STMP3XXX_REGS_BASE + 0x8000)
22
23#define HW_ECC8_CTRL 0x0
24#define BM_ECC8_CTRL_COMPLETE_IRQ 0x00000001
25#define BP_ECC8_CTRL_COMPLETE_IRQ 0
26#define BM_ECC8_CTRL_COMPLETE_IRQ_EN 0x00000100
27#define BM_ECC8_CTRL_AHBM_SFTRST 0x20000000
28
29#define HW_ECC8_STATUS0 0x10
30#define BM_ECC8_STATUS0_UNCORRECTABLE 0x00000004
31#define BM_ECC8_STATUS0_CORRECTED 0x00000008
32#define BM_ECC8_STATUS0_STATUS_AUX 0x00000F00
33#define BP_ECC8_STATUS0_STATUS_AUX 8
34#define BM_ECC8_STATUS0_COMPLETED_CE 0x000F0000
35#define BP_ECC8_STATUS0_COMPLETED_CE 16
36
37#define HW_ECC8_STATUS1 0x20
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-gpmi.h b/arch/arm/mach-stmp37xx/include/mach/regs-gpmi.h
deleted file mode 100644
index f2b304f54490..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-gpmi.h
+++ /dev/null
@@ -1,63 +0,0 @@
1/*
2 * stmp37xx: GPMI register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_GPMI_BASE (STMP3XXX_REGS_BASE + 0xC000)
22#define REGS_GPMI_PHYS 0x8000C000
23#define REGS_GPMI_SIZE 0x2000
24
25#define HW_GPMI_CTRL0 0x0
26#define BM_GPMI_CTRL0_XFER_COUNT 0x0000FFFF
27#define BP_GPMI_CTRL0_XFER_COUNT 0
28#define BM_GPMI_CTRL0_CS 0x00300000
29#define BP_GPMI_CTRL0_CS 20
30#define BM_GPMI_CTRL0_LOCK_CS 0x00400000
31#define BM_GPMI_CTRL0_WORD_LENGTH 0x00800000
32#define BM_GPMI_CTRL0_COMMAND_MODE 0x03000000
33#define BP_GPMI_CTRL0_COMMAND_MODE 24
34#define BV_GPMI_CTRL0_COMMAND_MODE__WRITE 0x0
35#define BV_GPMI_CTRL0_COMMAND_MODE__READ 0x1
36#define BV_GPMI_CTRL0_COMMAND_MODE__READ_AND_COMPARE 0x2
37#define BV_GPMI_CTRL0_COMMAND_MODE__WAIT_FOR_READY 0x3
38#define BM_GPMI_CTRL0_RUN 0x20000000
39#define BM_GPMI_CTRL0_CLKGATE 0x40000000
40#define BM_GPMI_CTRL0_SFTRST 0x80000000
41#define BM_GPMI_ECCCTRL_ENABLE_ECC 0x00001000
42#define BM_GPMI_ECCCTRL_ECC_CMD 0x00006000
43#define BP_GPMI_ECCCTRL_ECC_CMD 13
44
45#define HW_GPMI_CTRL1 0x60
46#define BM_GPMI_CTRL1_GPMI_MODE 0x00000003
47#define BP_GPMI_CTRL1_GPMI_MODE 0
48#define BM_GPMI_CTRL1_ATA_IRQRDY_POLARITY 0x00000004
49#define BM_GPMI_CTRL1_DEV_RESET 0x00000008
50#define BM_GPMI_CTRL1_TIMEOUT_IRQ 0x00000200
51#define BM_GPMI_CTRL1_DEV_IRQ 0x00000400
52#define BM_GPMI_CTRL1_DSAMPLE_TIME 0x00007000
53#define BP_GPMI_CTRL1_DSAMPLE_TIME 12
54
55#define HW_GPMI_TIMING0 0x70
56#define BM_GPMI_TIMING0_DATA_SETUP 0x000000FF
57#define BP_GPMI_TIMING0_DATA_SETUP 0
58#define BM_GPMI_TIMING0_DATA_HOLD 0x0000FF00
59#define BP_GPMI_TIMING0_DATA_HOLD 8
60
61#define HW_GPMI_TIMING1 0x80
62#define BM_GPMI_TIMING1_DEVICE_BUSY_TIMEOUT 0xFFFF0000
63#define BP_GPMI_TIMING1_DEVICE_BUSY_TIMEOUT 16
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-i2c.h b/arch/arm/mach-stmp37xx/include/mach/regs-i2c.h
deleted file mode 100644
index 35882a9b8bc5..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-i2c.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * stmp37xx: I2C register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_I2C_BASE (STMP3XXX_REGS_BASE + 0x58000)
22#define REGS_I2C_PHYS 0x80058000
23#define REGS_I2C_SIZE 0x2000
24
25#define HW_I2C_CTRL0 0x0
26#define BM_I2C_CTRL0_XFER_COUNT 0x0000FFFF
27#define BP_I2C_CTRL0_XFER_COUNT 0
28#define BM_I2C_CTRL0_DIRECTION 0x00010000
29#define BM_I2C_CTRL0_MASTER_MODE 0x00020000
30#define BM_I2C_CTRL0_PRE_SEND_START 0x00080000
31#define BM_I2C_CTRL0_POST_SEND_STOP 0x00100000
32#define BM_I2C_CTRL0_RETAIN_CLOCK 0x00200000
33#define BM_I2C_CTRL0_SEND_NAK_ON_LAST 0x02000000
34#define BM_I2C_CTRL0_CLKGATE 0x40000000
35#define BM_I2C_CTRL0_SFTRST 0x80000000
36
37#define HW_I2C_TIMING0 0x10
38
39#define HW_I2C_TIMING1 0x20
40
41#define HW_I2C_TIMING2 0x30
42
43#define HW_I2C_CTRL1 0x40
44#define BM_I2C_CTRL1_SLAVE_IRQ 0x00000001
45#define BP_I2C_CTRL1_SLAVE_IRQ 0
46#define BM_I2C_CTRL1_SLAVE_STOP_IRQ 0x00000002
47#define BM_I2C_CTRL1_MASTER_LOSS_IRQ 0x00000004
48#define BM_I2C_CTRL1_EARLY_TERM_IRQ 0x00000008
49#define BM_I2C_CTRL1_OVERSIZE_XFER_TERM_IRQ 0x00000010
50#define BM_I2C_CTRL1_NO_SLAVE_ACK_IRQ 0x00000020
51#define BM_I2C_CTRL1_DATA_ENGINE_CMPLT_IRQ 0x00000040
52#define BM_I2C_CTRL1_BUS_FREE_IRQ 0x00000080
53#define BM_I2C_CTRL1_CLR_GOT_A_NAK 0x10000000
54
55#define HW_I2C_VERSION 0x90
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-icoll.h b/arch/arm/mach-stmp37xx/include/mach/regs-icoll.h
deleted file mode 100644
index 3b7c92239e20..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-icoll.h
+++ /dev/null
@@ -1,43 +0,0 @@
1/*
2 * stmp37xx: ICOLL register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#ifndef _MACH_REGS_ICOLL
22#define _MACH_REGS_ICOLL
23
24#define REGS_ICOLL_BASE (STMP3XXX_REGS_BASE + 0x0)
25
26#define HW_ICOLL_VECTOR 0x0
27
28#define HW_ICOLL_LEVELACK 0x10
29
30#define HW_ICOLL_CTRL 0x20
31#define BM_ICOLL_CTRL_CLKGATE 0x40000000
32#define BM_ICOLL_CTRL_SFTRST 0x80000000
33
34#define HW_ICOLL_STAT 0x30
35
36#define HW_ICOLL_PRIORITY0 (0x60 + 0 * 0x10)
37#define HW_ICOLL_PRIORITY1 (0x60 + 1 * 0x10)
38#define HW_ICOLL_PRIORITY2 (0x60 + 2 * 0x10)
39#define HW_ICOLL_PRIORITY3 (0x60 + 3 * 0x10)
40
41#define HW_ICOLL_PRIORITYn 0x60
42
43#endif
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-lcdif.h b/arch/arm/mach-stmp37xx/include/mach/regs-lcdif.h
deleted file mode 100644
index 72514e8b0737..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-lcdif.h
+++ /dev/null
@@ -1,89 +0,0 @@
1/*
2 * stmp37xx: LCDIF register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_LCDIF_BASE (STMP3XXX_REGS_BASE + 0x30000)
22#define REGS_LCDIF_PHYS 0x80030000
23#define REGS_LCDIF_SIZE 0x2000
24
25#define HW_LCDIF_CTRL 0x0
26#define BM_LCDIF_CTRL_COUNT 0x0000FFFF
27#define BP_LCDIF_CTRL_COUNT 0
28#define BM_LCDIF_CTRL_RUN 0x00010000
29#define BM_LCDIF_CTRL_WORD_LENGTH 0x00020000
30#define BM_LCDIF_CTRL_DATA_SELECT 0x00040000
31#define BM_LCDIF_CTRL_DOTCLK_MODE 0x00080000
32#define BM_LCDIF_CTRL_VSYNC_MODE 0x00100000
33#define BM_LCDIF_CTRL_DATA_SWIZZLE 0x00600000
34#define BP_LCDIF_CTRL_DATA_SWIZZLE 21
35#define BM_LCDIF_CTRL_BYPASS_COUNT 0x00800000
36#define BM_LCDIF_CTRL_SHIFT_NUM_BITS 0x06000000
37#define BP_LCDIF_CTRL_SHIFT_NUM_BITS 25
38#define BM_LCDIF_CTRL_DATA_SHIFT_DIR 0x08000000
39#define BM_LCDIF_CTRL_WAIT_FOR_VSYNC_EDGE 0x10000000
40#define BM_LCDIF_CTRL_CLKGATE 0x40000000
41#define BM_LCDIF_CTRL_SFTRST 0x80000000
42
43#define HW_LCDIF_CTRL1 0x10
44#define BM_LCDIF_CTRL1_RESET 0x00000001
45#define BP_LCDIF_CTRL1_RESET 0
46#define BM_LCDIF_CTRL1_MODE86 0x00000002
47#define BM_LCDIF_CTRL1_BUSY_ENABLE 0x00000004
48#define BM_LCDIF_CTRL1_VSYNC_EDGE_IRQ 0x00000100
49#define BM_LCDIF_CTRL1_CUR_FRAME_DONE_IRQ 0x00000200
50#define BM_LCDIF_CTRL1_UNDERFLOW_IRQ 0x00000400
51#define BM_LCDIF_CTRL1_OVERFLOW_IRQ 0x00000800
52#define BM_LCDIF_CTRL1_VSYNC_EDGE_IRQ_EN 0x00001000
53#define BM_LCDIF_CTRL1_BYTE_PACKING_FORMAT 0x000F0000
54#define BP_LCDIF_CTRL1_BYTE_PACKING_FORMAT 16
55
56#define HW_LCDIF_TIMING 0x20
57
58#define HW_LCDIF_VDCTRL0 0x30
59#define BM_LCDIF_VDCTRL0_VALID_DATA_CNT 0x000003FF
60#define BP_LCDIF_VDCTRL0_VALID_DATA_CNT 0
61#define BM_LCDIF_VDCTRL0_VSYNC_PULSE_WIDTH_UNIT 0x00100000
62#define BM_LCDIF_VDCTRL0_VSYNC_PERIOD_UNIT 0x00200000
63#define BM_LCDIF_VDCTRL0_ENABLE_POL 0x01000000
64#define BM_LCDIF_VDCTRL0_DOTCLK_POL 0x02000000
65#define BM_LCDIF_VDCTRL0_HSYNC_POL 0x04000000
66#define BM_LCDIF_VDCTRL0_VSYNC_POL 0x08000000
67#define BM_LCDIF_VDCTRL0_ENABLE_PRESENT 0x10000000
68#define BM_LCDIF_VDCTRL0_VSYNC_OEB 0x20000000
69
70#define HW_LCDIF_VDCTRL1 0x40
71#define BM_LCDIF_VDCTRL1_VSYNC_PERIOD 0x000FFFFF
72#define BP_LCDIF_VDCTRL1_VSYNC_PERIOD 0
73#define BM_LCDIF_VDCTRL1_VSYNC_PULSE_WIDTH 0xFFF00000
74#define BP_LCDIF_VDCTRL1_VSYNC_PULSE_WIDTH 20
75
76#define HW_LCDIF_VDCTRL2 0x50
77#define BM_LCDIF_VDCTRL2_VALID_DATA_CNT 0x000007FF
78#define BP_LCDIF_VDCTRL2_VALID_DATA_CNT 0
79#define BM_LCDIF_VDCTRL2_HSYNC_PERIOD 0x007FF800
80#define BP_LCDIF_VDCTRL2_HSYNC_PERIOD 11
81#define BM_LCDIF_VDCTRL2_HSYNC_PULSE_WIDTH 0xFF800000
82#define BP_LCDIF_VDCTRL2_HSYNC_PULSE_WIDTH 23
83
84#define HW_LCDIF_VDCTRL3 0x60
85#define BM_LCDIF_VDCTRL3_VERTICAL_WAIT_CNT 0x000001FF
86#define BP_LCDIF_VDCTRL3_VERTICAL_WAIT_CNT 0
87#define BM_LCDIF_VDCTRL3_HORIZONTAL_WAIT_CNT 0x00FFF000
88#define BP_LCDIF_VDCTRL3_HORIZONTAL_WAIT_CNT 12
89#define BM_LCDIF_VDCTRL3_SYNC_SIGNALS_ON 0x01000000
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-lradc.h b/arch/arm/mach-stmp37xx/include/mach/regs-lradc.h
deleted file mode 100644
index cc7b4702d1cd..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-lradc.h
+++ /dev/null
@@ -1,97 +0,0 @@
1/*
2 * stmp37xx: LRADC register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_LRADC_BASE (STMP3XXX_REGS_BASE + 0x50000)
22
23#define HW_LRADC_CTRL0 0x0
24#define BM_LRADC_CTRL0_SCHEDULE 0x000000FF
25#define BP_LRADC_CTRL0_SCHEDULE 0
26#define BM_LRADC_CTRL0_XPLUS_ENABLE 0x00010000
27#define BM_LRADC_CTRL0_YPLUS_ENABLE 0x00020000
28#define BM_LRADC_CTRL0_XMINUS_ENABLE 0x00040000
29#define BM_LRADC_CTRL0_YMINUS_ENABLE 0x00080000
30#define BM_LRADC_CTRL0_TOUCH_DETECT_ENABLE 0x00100000
31#define BM_LRADC_CTRL0_ONCHIP_GROUNDREF 0x00200000
32#define BM_LRADC_CTRL0_CLKGATE 0x40000000
33#define BM_LRADC_CTRL0_SFTRST 0x80000000
34
35#define HW_LRADC_CTRL1 0x10
36#define BM_LRADC_CTRL1_LRADC0_IRQ 0x00000001
37#define BP_LRADC_CTRL1_LRADC0_IRQ 0
38#define BM_LRADC_CTRL1_LRADC5_IRQ 0x00000020
39#define BM_LRADC_CTRL1_LRADC6_IRQ 0x00000040
40#define BM_LRADC_CTRL1_TOUCH_DETECT_IRQ 0x00000100
41#define BM_LRADC_CTRL1_LRADC0_IRQ_EN 0x00010000
42#define BM_LRADC_CTRL1_LRADC5_IRQ_EN 0x00200000
43#define BM_LRADC_CTRL1_TOUCH_DETECT_IRQ_EN 0x01000000
44
45#define HW_LRADC_CTRL2 0x20
46#define BM_LRADC_CTRL2_BL_BRIGHTNESS 0x001F0000
47#define BP_LRADC_CTRL2_BL_BRIGHTNESS 16
48#define BM_LRADC_CTRL2_BL_MUX_SELECT 0x00200000
49#define BM_LRADC_CTRL2_BL_ENABLE 0x00400000
50#define BM_LRADC_CTRL2_DIVIDE_BY_TWO 0xFF000000
51#define BP_LRADC_CTRL2_DIVIDE_BY_TWO 24
52
53#define HW_LRADC_CTRL3 0x30
54#define BM_LRADC_CTRL3_CYCLE_TIME 0x00000300
55#define BP_LRADC_CTRL3_CYCLE_TIME 8
56
57#define HW_LRADC_STATUS 0x40
58#define BM_LRADC_STATUS_TOUCH_DETECT_RAW 0x00000001
59#define BP_LRADC_STATUS_TOUCH_DETECT_RAW 0
60
61#define HW_LRADC_CH0 (0x50 + 0 * 0x10)
62#define HW_LRADC_CH1 (0x50 + 1 * 0x10)
63#define HW_LRADC_CH2 (0x50 + 2 * 0x10)
64#define HW_LRADC_CH3 (0x50 + 3 * 0x10)
65#define HW_LRADC_CH4 (0x50 + 4 * 0x10)
66#define HW_LRADC_CH5 (0x50 + 5 * 0x10)
67#define HW_LRADC_CH6 (0x50 + 6 * 0x10)
68#define HW_LRADC_CH7 (0x50 + 7 * 0x10)
69
70#define HW_LRADC_CHn 0x50
71#define BM_LRADC_CHn_VALUE 0x0003FFFF
72#define BP_LRADC_CHn_VALUE 0
73#define BM_LRADC_CHn_NUM_SAMPLES 0x1F000000
74#define BP_LRADC_CHn_NUM_SAMPLES 24
75#define BM_LRADC_CHn_ACCUMULATE 0x20000000
76
77#define HW_LRADC_DELAY0 (0xD0 + 0 * 0x10)
78#define HW_LRADC_DELAY1 (0xD0 + 1 * 0x10)
79#define HW_LRADC_DELAY2 (0xD0 + 2 * 0x10)
80#define HW_LRADC_DELAY3 (0xD0 + 3 * 0x10)
81
82#define HW_LRADC_DELAYn 0xD0
83#define BM_LRADC_DELAYn_DELAY 0x000007FF
84#define BP_LRADC_DELAYn_DELAY 0
85#define BM_LRADC_DELAYn_LOOP_COUNT 0x0000F800
86#define BP_LRADC_DELAYn_LOOP_COUNT 11
87#define BM_LRADC_DELAYn_TRIGGER_DELAYS 0x000F0000
88#define BP_LRADC_DELAYn_TRIGGER_DELAYS 16
89#define BM_LRADC_DELAYn_KICK 0x00100000
90#define BM_LRADC_DELAYn_TRIGGER_LRADCS 0xFF000000
91#define BP_LRADC_DELAYn_TRIGGER_LRADCS 24
92
93#define HW_LRADC_CTRL4 0x140
94#define BM_LRADC_CTRL4_LRADC6SELECT 0x0F000000
95#define BP_LRADC_CTRL4_LRADC6SELECT 24
96#define BM_LRADC_CTRL4_LRADC7SELECT 0xF0000000
97#define BP_LRADC_CTRL4_LRADC7SELECT 28
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-pinctrl.h b/arch/arm/mach-stmp37xx/include/mach/regs-pinctrl.h
deleted file mode 100644
index d5efce2388c7..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-pinctrl.h
+++ /dev/null
@@ -1,88 +0,0 @@
1/*
2 * stmp37xx: PINCTRL register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#ifndef _MACH_REGS_PINCTRL
22#define _MACH_REGS_PINCTRL
23
24#define REGS_PINCTRL_BASE (STMP3XXX_REGS_BASE + 0x18000)
25
26#define HW_PINCTRL_MUXSEL0 0x100
27#define HW_PINCTRL_MUXSEL1 0x110
28#define HW_PINCTRL_MUXSEL2 0x120
29#define HW_PINCTRL_MUXSEL3 0x130
30#define HW_PINCTRL_MUXSEL4 0x140
31#define HW_PINCTRL_MUXSEL5 0x150
32#define HW_PINCTRL_MUXSEL6 0x160
33#define HW_PINCTRL_MUXSEL7 0x170
34
35#define HW_PINCTRL_DRIVE0 0x200
36#define HW_PINCTRL_DRIVE1 0x210
37#define HW_PINCTRL_DRIVE2 0x220
38#define HW_PINCTRL_DRIVE3 0x230
39#define HW_PINCTRL_DRIVE4 0x240
40#define HW_PINCTRL_DRIVE5 0x250
41#define HW_PINCTRL_DRIVE6 0x260
42#define HW_PINCTRL_DRIVE7 0x270
43#define HW_PINCTRL_DRIVE8 0x280
44#define HW_PINCTRL_DRIVE9 0x290
45#define HW_PINCTRL_DRIVE10 0x2A0
46#define HW_PINCTRL_DRIVE11 0x2B0
47#define HW_PINCTRL_DRIVE12 0x2C0
48#define HW_PINCTRL_DRIVE13 0x2D0
49#define HW_PINCTRL_DRIVE14 0x2E0
50
51#define HW_PINCTRL_PULL0 0x300
52#define HW_PINCTRL_PULL1 0x310
53#define HW_PINCTRL_PULL2 0x320
54#define HW_PINCTRL_PULL3 0x330
55
56#define HW_PINCTRL_DOUT0 0x400
57#define HW_PINCTRL_DOUT1 0x410
58#define HW_PINCTRL_DOUT2 0x420
59
60#define HW_PINCTRL_DIN0 0x500
61#define HW_PINCTRL_DIN1 0x510
62#define HW_PINCTRL_DIN2 0x520
63
64#define HW_PINCTRL_DOE0 0x600
65#define HW_PINCTRL_DOE1 0x610
66#define HW_PINCTRL_DOE2 0x620
67
68#define HW_PINCTRL_PIN2IRQ0 0x700
69#define HW_PINCTRL_PIN2IRQ1 0x710
70#define HW_PINCTRL_PIN2IRQ2 0x720
71
72#define HW_PINCTRL_IRQEN0 0x800
73#define HW_PINCTRL_IRQEN1 0x810
74#define HW_PINCTRL_IRQEN2 0x820
75
76#define HW_PINCTRL_IRQLEVEL0 0x900
77#define HW_PINCTRL_IRQLEVEL1 0x910
78#define HW_PINCTRL_IRQLEVEL2 0x920
79
80#define HW_PINCTRL_IRQPOL0 0xA00
81#define HW_PINCTRL_IRQPOL1 0xA10
82#define HW_PINCTRL_IRQPOL2 0xA20
83
84#define HW_PINCTRL_IRQSTAT0 0xB00
85#define HW_PINCTRL_IRQSTAT1 0xB10
86#define HW_PINCTRL_IRQSTAT2 0xB20
87
88#endif
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-power.h b/arch/arm/mach-stmp37xx/include/mach/regs-power.h
deleted file mode 100644
index 0e733d74a229..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-power.h
+++ /dev/null
@@ -1,56 +0,0 @@
1/*
2 * stmp37xx: POWER register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#ifndef _MACH_REGS_POWER
22#define _MACH_REGS_POWER
23
24#define REGS_POWER_BASE (STMP3XXX_REGS_BASE + 0x44000)
25
26#define HW_POWER_CTRL 0x0
27#define BM_POWER_CTRL_CLKGATE 0x40000000
28
29#define HW_POWER_5VCTRL 0x10
30
31#define HW_POWER_MINPWR 0x20
32
33#define HW_POWER_CHARGE 0x30
34
35#define HW_POWER_VDDDCTRL 0x40
36
37#define HW_POWER_VDDACTRL 0x50
38
39#define HW_POWER_VDDIOCTRL 0x60
40#define BM_POWER_VDDIOCTRL_TRG 0x0000001F
41#define BP_POWER_VDDIOCTRL_TRG 0
42
43#define HW_POWER_STS 0xB0
44#define BM_POWER_STS_VBUSVALID 0x00000002
45#define BM_POWER_STS_BVALID 0x00000004
46#define BM_POWER_STS_AVALID 0x00000008
47#define BM_POWER_STS_DC_OK 0x00000100
48
49#define HW_POWER_RESET 0xE0
50
51#define HW_POWER_DEBUG 0xF0
52#define BM_POWER_DEBUG_BVALIDPIOLOCK 0x00000002
53#define BM_POWER_DEBUG_AVALIDPIOLOCK 0x00000004
54#define BM_POWER_DEBUG_VBUSVALIDPIOLOCK 0x00000008
55
56#endif
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-pwm.h b/arch/arm/mach-stmp37xx/include/mach/regs-pwm.h
deleted file mode 100644
index 15966a1b62e0..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-pwm.h
+++ /dev/null
@@ -1,51 +0,0 @@
1/*
2 * stmp37xx: PWM register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_PWM_BASE (STMP3XXX_REGS_BASE + 0x64000)
22
23#define HW_PWM_CTRL 0x0
24#define BM_PWM_CTRL_PWM2_ENABLE 0x00000004
25#define BM_PWM_CTRL_PWM2_ANA_CTRL_ENABLE 0x00000020
26
27#define HW_PWM_ACTIVE0 (0x10 + 0 * 0x20)
28#define HW_PWM_ACTIVE1 (0x10 + 1 * 0x20)
29#define HW_PWM_ACTIVE2 (0x10 + 2 * 0x20)
30#define HW_PWM_ACTIVE3 (0x10 + 3 * 0x20)
31
32#define HW_PWM_ACTIVEn 0x10
33#define BM_PWM_ACTIVEn_ACTIVE 0x0000FFFF
34#define BP_PWM_ACTIVEn_ACTIVE 0
35#define BM_PWM_ACTIVEn_INACTIVE 0xFFFF0000
36#define BP_PWM_ACTIVEn_INACTIVE 16
37
38#define HW_PWM_PERIOD0 (0x20 + 0 * 0x20)
39#define HW_PWM_PERIOD1 (0x20 + 1 * 0x20)
40#define HW_PWM_PERIOD2 (0x20 + 2 * 0x20)
41#define HW_PWM_PERIOD3 (0x20 + 3 * 0x20)
42
43#define HW_PWM_PERIODn 0x20
44#define BM_PWM_PERIODn_PERIOD 0x0000FFFF
45#define BP_PWM_PERIODn_PERIOD 0
46#define BM_PWM_PERIODn_ACTIVE_STATE 0x00030000
47#define BP_PWM_PERIODn_ACTIVE_STATE 16
48#define BM_PWM_PERIODn_INACTIVE_STATE 0x000C0000
49#define BP_PWM_PERIODn_INACTIVE_STATE 18
50#define BM_PWM_PERIODn_CDIV 0x00700000
51#define BP_PWM_PERIODn_CDIV 20
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-rtc.h b/arch/arm/mach-stmp37xx/include/mach/regs-rtc.h
deleted file mode 100644
index fac40edc38a1..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-rtc.h
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2 * stmp37xx: RTC register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_RTC_BASE (STMP3XXX_REGS_BASE + 0x5C000)
22#define REGS_RTC_PHYS 0x8005C000
23#define REGS_RTC_SIZE 0x2000
24
25#define HW_RTC_CTRL 0x0
26#define BM_RTC_CTRL_ALARM_IRQ_EN 0x00000001
27#define BP_RTC_CTRL_ALARM_IRQ_EN 0
28#define BM_RTC_CTRL_ONEMSEC_IRQ_EN 0x00000002
29#define BM_RTC_CTRL_ALARM_IRQ 0x00000004
30#define BM_RTC_CTRL_ONEMSEC_IRQ 0x00000008
31#define BM_RTC_CTRL_WATCHDOGEN 0x00000010
32
33#define HW_RTC_STAT 0x10
34#define BM_RTC_STAT_NEW_REGS 0x0000FF00
35#define BP_RTC_STAT_NEW_REGS 8
36#define BM_RTC_STAT_STALE_REGS 0x00FF0000
37#define BP_RTC_STAT_STALE_REGS 16
38#define BM_RTC_STAT_RTC_PRESENT 0x80000000
39
40#define HW_RTC_SECONDS 0x30
41
42#define HW_RTC_ALARM 0x40
43
44#define HW_RTC_WATCHDOG 0x50
45
46#define HW_RTC_PERSISTENT0 0x60
47#define BM_RTC_PERSISTENT0_ALARM_WAKE_EN 0x00000002
48#define BM_RTC_PERSISTENT0_ALARM_EN 0x00000004
49#define BM_RTC_PERSISTENT0_XTAL24MHZ_PWRUP 0x00000010
50#define BM_RTC_PERSISTENT0_XTAL32KHZ_PWRUP 0x00000020
51#define BM_RTC_PERSISTENT0_ALARM_WAKE 0x00000080
52#define BM_RTC_PERSISTENT0_SPARE_ANALOG 0xFFFC0000
53#define BP_RTC_PERSISTENT0_SPARE_ANALOG 18
54
55#define HW_RTC_PERSISTENT1 0x70
56
57#define HW_RTC_VERSION 0xD0
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-ssp.h b/arch/arm/mach-stmp37xx/include/mach/regs-ssp.h
deleted file mode 100644
index cbde891a06c2..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-ssp.h
+++ /dev/null
@@ -1,101 +0,0 @@
1/*
2 * stmp37xx: SSP register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_SSP_BASE (STMP3XXX_REGS_BASE + 0x10000)
22#define REGS_SSP1_PHYS 0x80010000
23#define REGS_SSP2_PHYS 0x80034000
24#define REGS_SSP_SIZE 0x2000
25
26#define HW_SSP_CTRL0 0x0
27#define BM_SSP_CTRL0_XFER_COUNT 0x0000FFFF
28#define BP_SSP_CTRL0_XFER_COUNT 0
29#define BM_SSP_CTRL0_ENABLE 0x00010000
30#define BM_SSP_CTRL0_GET_RESP 0x00020000
31#define BM_SSP_CTRL0_LONG_RESP 0x00080000
32#define BM_SSP_CTRL0_WAIT_FOR_CMD 0x00100000
33#define BM_SSP_CTRL0_WAIT_FOR_IRQ 0x00200000
34#define BM_SSP_CTRL0_BUS_WIDTH 0x00C00000
35#define BP_SSP_CTRL0_BUS_WIDTH 22
36#define BM_SSP_CTRL0_DATA_XFER 0x01000000
37#define BM_SSP_CTRL0_READ 0x02000000
38#define BM_SSP_CTRL0_IGNORE_CRC 0x04000000
39#define BM_SSP_CTRL0_LOCK_CS 0x08000000
40#define BM_SSP_CTRL0_RUN 0x20000000
41#define BM_SSP_CTRL0_CLKGATE 0x40000000
42#define BM_SSP_CTRL0_SFTRST 0x80000000
43
44#define HW_SSP_CMD0 0x10
45#define BM_SSP_CMD0_CMD 0x000000FF
46#define BP_SSP_CMD0_CMD 0
47#define BM_SSP_CMD0_BLOCK_COUNT 0x0000FF00
48#define BP_SSP_CMD0_BLOCK_COUNT 8
49#define BM_SSP_CMD0_BLOCK_SIZE 0x000F0000
50#define BP_SSP_CMD0_BLOCK_SIZE 16
51#define BM_SSP_CMD0_APPEND_8CYC 0x00100000
52#define BM_SSP_CMD1_CMD_ARG 0xFFFFFFFF
53#define BP_SSP_CMD1_CMD_ARG 0
54
55#define HW_SSP_TIMING 0x50
56#define BM_SSP_TIMING_CLOCK_RATE 0x000000FF
57#define BP_SSP_TIMING_CLOCK_RATE 0
58#define BM_SSP_TIMING_CLOCK_DIVIDE 0x0000FF00
59#define BP_SSP_TIMING_CLOCK_DIVIDE 8
60#define BM_SSP_TIMING_TIMEOUT 0xFFFF0000
61#define BP_SSP_TIMING_TIMEOUT 16
62
63#define HW_SSP_CTRL1 0x60
64#define BM_SSP_CTRL1_SSP_MODE 0x0000000F
65#define BP_SSP_CTRL1_SSP_MODE 0
66#define BM_SSP_CTRL1_WORD_LENGTH 0x000000F0
67#define BP_SSP_CTRL1_WORD_LENGTH 4
68#define BM_SSP_CTRL1_POLARITY 0x00000200
69#define BM_SSP_CTRL1_PHASE 0x00000400
70#define BM_SSP_CTRL1_DMA_ENABLE 0x00002000
71#define BM_SSP_CTRL1_FIFO_OVERRUN_IRQ 0x00008000
72#define BM_SSP_CTRL1_RECV_TIMEOUT_IRQ_EN 0x00010000
73#define BM_SSP_CTRL1_RECV_TIMEOUT_IRQ 0x00020000
74#define BM_SSP_CTRL1_FIFO_UNDERRUN_IRQ 0x00200000
75#define BM_SSP_CTRL1_DATA_CRC_IRQ_EN 0x00400000
76#define BM_SSP_CTRL1_DATA_CRC_IRQ 0x00800000
77#define BM_SSP_CTRL1_DATA_TIMEOUT_IRQ_EN 0x01000000
78#define BM_SSP_CTRL1_DATA_TIMEOUT_IRQ 0x02000000
79#define BM_SSP_CTRL1_RESP_TIMEOUT_IRQ_EN 0x04000000
80#define BM_SSP_CTRL1_RESP_TIMEOUT_IRQ 0x08000000
81#define BM_SSP_CTRL1_RESP_ERR_IRQ_EN 0x10000000
82#define BM_SSP_CTRL1_RESP_ERR_IRQ 0x20000000
83#define BM_SSP_CTRL1_SDIO_IRQ 0x80000000
84
85#define HW_SSP_DATA 0x70
86
87#define HW_SSP_SDRESP0 0x80
88
89#define HW_SSP_SDRESP1 0x90
90
91#define HW_SSP_SDRESP2 0xA0
92
93#define HW_SSP_SDRESP3 0xB0
94
95#define HW_SSP_STATUS 0xC0
96#define BM_SSP_STATUS_FIFO_EMPTY 0x00000020
97#define BM_SSP_STATUS_TIMEOUT 0x00001000
98#define BM_SSP_STATUS_RESP_TIMEOUT 0x00004000
99#define BM_SSP_STATUS_RESP_ERR 0x00008000
100#define BM_SSP_STATUS_RESP_CRC_ERR 0x00010000
101#define BM_SSP_STATUS_CARD_DETECT 0x10000000
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-timrot.h b/arch/arm/mach-stmp37xx/include/mach/regs-timrot.h
deleted file mode 100644
index 4af0f6edfa78..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-timrot.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * stmp37xx: TIMROT register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#ifndef _MACH_REGS_TIMROT
22#define _MACH_REGS_TIMROT
23
24#define REGS_TIMROT_BASE (STMP3XXX_REGS_BASE + 0x68000)
25
26#define HW_TIMROT_ROTCTRL 0x0
27#define BM_TIMROT_ROTCTRL_CLKGATE 0x40000000
28#define BM_TIMROT_ROTCTRL_SFTRST 0x80000000
29
30#define HW_TIMROT_TIMCTRL0 (0x20 + 0 * 0x20)
31#define HW_TIMROT_TIMCTRL1 (0x20 + 1 * 0x20)
32#define HW_TIMROT_TIMCTRL2 (0x20 + 2 * 0x20)
33
34#define HW_TIMROT_TIMCTRLn 0x20
35#define BM_TIMROT_TIMCTRLn_SELECT 0x0000000F
36#define BP_TIMROT_TIMCTRLn_SELECT 0
37#define BM_TIMROT_TIMCTRLn_PRESCALE 0x00000030
38#define BP_TIMROT_TIMCTRLn_PRESCALE 4
39#define BM_TIMROT_TIMCTRLn_RELOAD 0x00000040
40#define BM_TIMROT_TIMCTRLn_UPDATE 0x00000080
41#define BM_TIMROT_TIMCTRLn_IRQ_EN 0x00004000
42#define BM_TIMROT_TIMCTRLn_IRQ 0x00008000
43
44#define HW_TIMROT_TIMCOUNT0 (0x30 + 0 * 0x20)
45#define HW_TIMROT_TIMCOUNT1 (0x30 + 1 * 0x20)
46#define HW_TIMROT_TIMCOUNT2 (0x30 + 2 * 0x20)
47
48#define HW_TIMROT_TIMCOUNTn 0x30
49#endif
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-uartapp.h b/arch/arm/mach-stmp37xx/include/mach/regs-uartapp.h
deleted file mode 100644
index 0594275d860c..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-uartapp.h
+++ /dev/null
@@ -1,85 +0,0 @@
1/*
2 * stmp37xx: UARTAPP register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_UARTAPP_BASE (STMP3XXX_REGS_BASE + 0x6C000)
22#define REGS_UARTAPP1_PHYS 0x8006C000
23#define REGS_UARTAPP_SIZE 0x2000
24
25#define HW_UARTAPP_CTRL0 0x0
26#define BM_UARTAPP_CTRL0_XFER_COUNT 0x0000FFFF
27#define BP_UARTAPP_CTRL0_XFER_COUNT 0
28#define BM_UARTAPP_CTRL0_RXTIMEOUT 0x07FF0000
29#define BP_UARTAPP_CTRL0_RXTIMEOUT 16
30#define BM_UARTAPP_CTRL0_RXTO_ENABLE 0x08000000
31#define BM_UARTAPP_CTRL0_RUN 0x20000000
32#define BM_UARTAPP_CTRL0_SFTRST 0x80000000
33#define BM_UARTAPP_CTRL1_XFER_COUNT 0x0000FFFF
34#define BP_UARTAPP_CTRL1_XFER_COUNT 0
35#define BM_UARTAPP_CTRL1_RUN 0x10000000
36
37#define HW_UARTAPP_CTRL2 0x20
38#define BM_UARTAPP_CTRL2_UARTEN 0x00000001
39#define BP_UARTAPP_CTRL2_UARTEN 0
40#define BM_UARTAPP_CTRL2_TXE 0x00000100
41#define BM_UARTAPP_CTRL2_RXE 0x00000200
42#define BM_UARTAPP_CTRL2_RTS 0x00000800
43#define BM_UARTAPP_CTRL2_RTSEN 0x00004000
44#define BM_UARTAPP_CTRL2_CTSEN 0x00008000
45#define BM_UARTAPP_CTRL2_RXDMAE 0x01000000
46#define BM_UARTAPP_CTRL2_TXDMAE 0x02000000
47#define BM_UARTAPP_CTRL2_DMAONERR 0x04000000
48
49#define HW_UARTAPP_LINECTRL 0x30
50#define BM_UARTAPP_LINECTRL_BRK 0x00000001
51#define BP_UARTAPP_LINECTRL_BRK 0
52#define BM_UARTAPP_LINECTRL_PEN 0x00000002
53#define BM_UARTAPP_LINECTRL_EPS 0x00000004
54#define BM_UARTAPP_LINECTRL_STP2 0x00000008
55#define BM_UARTAPP_LINECTRL_FEN 0x00000010
56#define BM_UARTAPP_LINECTRL_WLEN 0x00000060
57#define BP_UARTAPP_LINECTRL_WLEN 5
58#define BM_UARTAPP_LINECTRL_SPS 0x00000080
59#define BM_UARTAPP_LINECTRL_BAUD_DIVFRAC 0x00003F00
60#define BP_UARTAPP_LINECTRL_BAUD_DIVFRAC 8
61#define BM_UARTAPP_LINECTRL_BAUD_DIVINT 0xFFFF0000
62#define BP_UARTAPP_LINECTRL_BAUD_DIVINT 16
63
64#define HW_UARTAPP_INTR 0x50
65#define BM_UARTAPP_INTR_CTSMIS 0x00000002
66#define BM_UARTAPP_INTR_RTIS 0x00000040
67#define BM_UARTAPP_INTR_CTSMIEN 0x00020000
68#define BM_UARTAPP_INTR_RXIEN 0x00100000
69#define BM_UARTAPP_INTR_RTIEN 0x00400000
70
71#define HW_UARTAPP_DATA 0x60
72
73#define HW_UARTAPP_STAT 0x70
74#define BM_UARTAPP_STAT_RXCOUNT 0x0000FFFF
75#define BP_UARTAPP_STAT_RXCOUNT 0
76#define BM_UARTAPP_STAT_FERR 0x00010000
77#define BM_UARTAPP_STAT_PERR 0x00020000
78#define BM_UARTAPP_STAT_BERR 0x00040000
79#define BM_UARTAPP_STAT_OERR 0x00080000
80#define BM_UARTAPP_STAT_RXFE 0x01000000
81#define BM_UARTAPP_STAT_TXFF 0x02000000
82#define BM_UARTAPP_STAT_TXFE 0x08000000
83#define BM_UARTAPP_STAT_CTS 0x10000000
84
85#define HW_UARTAPP_VERSION 0x90
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-uartdbg.h b/arch/arm/mach-stmp37xx/include/mach/regs-uartdbg.h
deleted file mode 100644
index b810deb552a9..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-uartdbg.h
+++ /dev/null
@@ -1,268 +0,0 @@
1/*
2 * stmp378x: UARTDBG register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_UARTDBG_BASE (STMP3XXX_REGS_BASE + 0x70000)
22#define REGS_UARTDBG_PHYS 0x80070000
23#define REGS_UARTDBG_SIZE 0x2000
24
25#define HW_UARTDBGDR 0x00000000
26#define BP_UARTDBGDR_UNAVAILABLE 16
27#define BM_UARTDBGDR_UNAVAILABLE 0xFFFF0000
28#define BF_UARTDBGDR_UNAVAILABLE(v) \
29 (((v) << 16) & BM_UARTDBGDR_UNAVAILABLE)
30#define BP_UARTDBGDR_RESERVED 12
31#define BM_UARTDBGDR_RESERVED 0x0000F000
32#define BF_UARTDBGDR_RESERVED(v) \
33 (((v) << 12) & BM_UARTDBGDR_RESERVED)
34#define BM_UARTDBGDR_OE 0x00000800
35#define BM_UARTDBGDR_BE 0x00000400
36#define BM_UARTDBGDR_PE 0x00000200
37#define BM_UARTDBGDR_FE 0x00000100
38#define BP_UARTDBGDR_DATA 0
39#define BM_UARTDBGDR_DATA 0x000000FF
40#define BF_UARTDBGDR_DATA(v) \
41 (((v) << 0) & BM_UARTDBGDR_DATA)
42#define HW_UARTDBGRSR_ECR 0x00000004
43#define BP_UARTDBGRSR_ECR_UNAVAILABLE 8
44#define BM_UARTDBGRSR_ECR_UNAVAILABLE 0xFFFFFF00
45#define BF_UARTDBGRSR_ECR_UNAVAILABLE(v) \
46 (((v) << 8) & BM_UARTDBGRSR_ECR_UNAVAILABLE)
47#define BP_UARTDBGRSR_ECR_EC 4
48#define BM_UARTDBGRSR_ECR_EC 0x000000F0
49#define BF_UARTDBGRSR_ECR_EC(v) \
50 (((v) << 4) & BM_UARTDBGRSR_ECR_EC)
51#define BM_UARTDBGRSR_ECR_OE 0x00000008
52#define BM_UARTDBGRSR_ECR_BE 0x00000004
53#define BM_UARTDBGRSR_ECR_PE 0x00000002
54#define BM_UARTDBGRSR_ECR_FE 0x00000001
55#define HW_UARTDBGFR 0x00000018
56#define BP_UARTDBGFR_UNAVAILABLE 16
57#define BM_UARTDBGFR_UNAVAILABLE 0xFFFF0000
58#define BF_UARTDBGFR_UNAVAILABLE(v) \
59 (((v) << 16) & BM_UARTDBGFR_UNAVAILABLE)
60#define BP_UARTDBGFR_RESERVED 9
61#define BM_UARTDBGFR_RESERVED 0x0000FE00
62#define BF_UARTDBGFR_RESERVED(v) \
63 (((v) << 9) & BM_UARTDBGFR_RESERVED)
64#define BM_UARTDBGFR_RI 0x00000100
65#define BM_UARTDBGFR_TXFE 0x00000080
66#define BM_UARTDBGFR_RXFF 0x00000040
67#define BM_UARTDBGFR_TXFF 0x00000020
68#define BM_UARTDBGFR_RXFE 0x00000010
69#define BM_UARTDBGFR_BUSY 0x00000008
70#define BM_UARTDBGFR_DCD 0x00000004
71#define BM_UARTDBGFR_DSR 0x00000002
72#define BM_UARTDBGFR_CTS 0x00000001
73#define HW_UARTDBGILPR 0x00000020
74#define BP_UARTDBGILPR_UNAVAILABLE 8
75#define BM_UARTDBGILPR_UNAVAILABLE 0xFFFFFF00
76#define BF_UARTDBGILPR_UNAVAILABLE(v) \
77 (((v) << 8) & BM_UARTDBGILPR_UNAVAILABLE)
78#define BP_UARTDBGILPR_ILPDVSR 0
79#define BM_UARTDBGILPR_ILPDVSR 0x000000FF
80#define BF_UARTDBGILPR_ILPDVSR(v) \
81 (((v) << 0) & BM_UARTDBGILPR_ILPDVSR)
82#define HW_UARTDBGIBRD 0x00000024
83#define BP_UARTDBGIBRD_UNAVAILABLE 16
84#define BM_UARTDBGIBRD_UNAVAILABLE 0xFFFF0000
85#define BF_UARTDBGIBRD_UNAVAILABLE(v) \
86 (((v) << 16) & BM_UARTDBGIBRD_UNAVAILABLE)
87#define BP_UARTDBGIBRD_BAUD_DIVINT 0
88#define BM_UARTDBGIBRD_BAUD_DIVINT 0x0000FFFF
89#define BF_UARTDBGIBRD_BAUD_DIVINT(v) \
90 (((v) << 0) & BM_UARTDBGIBRD_BAUD_DIVINT)
91#define HW_UARTDBGFBRD 0x00000028
92#define BP_UARTDBGFBRD_UNAVAILABLE 8
93#define BM_UARTDBGFBRD_UNAVAILABLE 0xFFFFFF00
94#define BF_UARTDBGFBRD_UNAVAILABLE(v) \
95 (((v) << 8) & BM_UARTDBGFBRD_UNAVAILABLE)
96#define BP_UARTDBGFBRD_RESERVED 6
97#define BM_UARTDBGFBRD_RESERVED 0x000000C0
98#define BF_UARTDBGFBRD_RESERVED(v) \
99 (((v) << 6) & BM_UARTDBGFBRD_RESERVED)
100#define BP_UARTDBGFBRD_BAUD_DIVFRAC 0
101#define BM_UARTDBGFBRD_BAUD_DIVFRAC 0x0000003F
102#define BF_UARTDBGFBRD_BAUD_DIVFRAC(v) \
103 (((v) << 0) & BM_UARTDBGFBRD_BAUD_DIVFRAC)
104#define HW_UARTDBGLCR_H 0x0000002c
105#define BP_UARTDBGLCR_H_UNAVAILABLE 16
106#define BM_UARTDBGLCR_H_UNAVAILABLE 0xFFFF0000
107#define BF_UARTDBGLCR_H_UNAVAILABLE(v) \
108 (((v) << 16) & BM_UARTDBGLCR_H_UNAVAILABLE)
109#define BP_UARTDBGLCR_H_RESERVED 8
110#define BM_UARTDBGLCR_H_RESERVED 0x0000FF00
111#define BF_UARTDBGLCR_H_RESERVED(v) \
112 (((v) << 8) & BM_UARTDBGLCR_H_RESERVED)
113#define BM_UARTDBGLCR_H_SPS 0x00000080
114#define BP_UARTDBGLCR_H_WLEN 5
115#define BM_UARTDBGLCR_H_WLEN 0x00000060
116#define BF_UARTDBGLCR_H_WLEN(v) \
117 (((v) << 5) & BM_UARTDBGLCR_H_WLEN)
118#define BM_UARTDBGLCR_H_FEN 0x00000010
119#define BM_UARTDBGLCR_H_STP2 0x00000008
120#define BM_UARTDBGLCR_H_EPS 0x00000004
121#define BM_UARTDBGLCR_H_PEN 0x00000002
122#define BM_UARTDBGLCR_H_BRK 0x00000001
123#define HW_UARTDBGCR 0x00000030
124#define BP_UARTDBGCR_UNAVAILABLE 16
125#define BM_UARTDBGCR_UNAVAILABLE 0xFFFF0000
126#define BF_UARTDBGCR_UNAVAILABLE(v) \
127 (((v) << 16) & BM_UARTDBGCR_UNAVAILABLE)
128#define BM_UARTDBGCR_CTSEN 0x00008000
129#define BM_UARTDBGCR_RTSEN 0x00004000
130#define BM_UARTDBGCR_OUT2 0x00002000
131#define BM_UARTDBGCR_OUT1 0x00001000
132#define BM_UARTDBGCR_RTS 0x00000800
133#define BM_UARTDBGCR_DTR 0x00000400
134#define BM_UARTDBGCR_RXE 0x00000200
135#define BM_UARTDBGCR_TXE 0x00000100
136#define BM_UARTDBGCR_LBE 0x00000080
137#define BP_UARTDBGCR_RESERVED 3
138#define BM_UARTDBGCR_RESERVED 0x00000078
139#define BF_UARTDBGCR_RESERVED(v) \
140 (((v) << 3) & BM_UARTDBGCR_RESERVED)
141#define BM_UARTDBGCR_SIRLP 0x00000004
142#define BM_UARTDBGCR_SIREN 0x00000002
143#define BM_UARTDBGCR_UARTEN 0x00000001
144#define HW_UARTDBGIFLS 0x00000034
145#define BP_UARTDBGIFLS_UNAVAILABLE 16
146#define BM_UARTDBGIFLS_UNAVAILABLE 0xFFFF0000
147#define BF_UARTDBGIFLS_UNAVAILABLE(v) \
148 (((v) << 16) & BM_UARTDBGIFLS_UNAVAILABLE)
149#define BP_UARTDBGIFLS_RESERVED 6
150#define BM_UARTDBGIFLS_RESERVED 0x0000FFC0
151#define BF_UARTDBGIFLS_RESERVED(v) \
152 (((v) << 6) & BM_UARTDBGIFLS_RESERVED)
153#define BP_UARTDBGIFLS_RXIFLSEL 3
154#define BM_UARTDBGIFLS_RXIFLSEL 0x00000038
155#define BF_UARTDBGIFLS_RXIFLSEL(v) \
156 (((v) << 3) & BM_UARTDBGIFLS_RXIFLSEL)
157#define BV_UARTDBGIFLS_RXIFLSEL__NOT_EMPTY 0x0
158#define BV_UARTDBGIFLS_RXIFLSEL__ONE_QUARTER 0x1
159#define BV_UARTDBGIFLS_RXIFLSEL__ONE_HALF 0x2
160#define BV_UARTDBGIFLS_RXIFLSEL__THREE_QUARTERS 0x3
161#define BV_UARTDBGIFLS_RXIFLSEL__SEVEN_EIGHTHS 0x4
162#define BV_UARTDBGIFLS_RXIFLSEL__INVALID5 0x5
163#define BV_UARTDBGIFLS_RXIFLSEL__INVALID6 0x6
164#define BV_UARTDBGIFLS_RXIFLSEL__INVALID7 0x7
165#define BP_UARTDBGIFLS_TXIFLSEL 0
166#define BM_UARTDBGIFLS_TXIFLSEL 0x00000007
167#define BF_UARTDBGIFLS_TXIFLSEL(v) \
168 (((v) << 0) & BM_UARTDBGIFLS_TXIFLSEL)
169#define BV_UARTDBGIFLS_TXIFLSEL__EMPTY 0x0
170#define BV_UARTDBGIFLS_TXIFLSEL__ONE_QUARTER 0x1
171#define BV_UARTDBGIFLS_TXIFLSEL__ONE_HALF 0x2
172#define BV_UARTDBGIFLS_TXIFLSEL__THREE_QUARTERS 0x3
173#define BV_UARTDBGIFLS_TXIFLSEL__SEVEN_EIGHTHS 0x4
174#define BV_UARTDBGIFLS_TXIFLSEL__INVALID5 0x5
175#define BV_UARTDBGIFLS_TXIFLSEL__INVALID6 0x6
176#define BV_UARTDBGIFLS_TXIFLSEL__INVALID7 0x7
177#define HW_UARTDBGIMSC 0x00000038
178#define BP_UARTDBGIMSC_UNAVAILABLE 16
179#define BM_UARTDBGIMSC_UNAVAILABLE 0xFFFF0000
180#define BF_UARTDBGIMSC_UNAVAILABLE(v) \
181 (((v) << 16) & BM_UARTDBGIMSC_UNAVAILABLE)
182#define BP_UARTDBGIMSC_RESERVED 11
183#define BM_UARTDBGIMSC_RESERVED 0x0000F800
184#define BF_UARTDBGIMSC_RESERVED(v) \
185 (((v) << 11) & BM_UARTDBGIMSC_RESERVED)
186#define BM_UARTDBGIMSC_OEIM 0x00000400
187#define BM_UARTDBGIMSC_BEIM 0x00000200
188#define BM_UARTDBGIMSC_PEIM 0x00000100
189#define BM_UARTDBGIMSC_FEIM 0x00000080
190#define BM_UARTDBGIMSC_RTIM 0x00000040
191#define BM_UARTDBGIMSC_TXIM 0x00000020
192#define BM_UARTDBGIMSC_RXIM 0x00000010
193#define BM_UARTDBGIMSC_DSRMIM 0x00000008
194#define BM_UARTDBGIMSC_DCDMIM 0x00000004
195#define BM_UARTDBGIMSC_CTSMIM 0x00000002
196#define BM_UARTDBGIMSC_RIMIM 0x00000001
197#define HW_UARTDBGRIS 0x0000003c
198#define BP_UARTDBGRIS_UNAVAILABLE 16
199#define BM_UARTDBGRIS_UNAVAILABLE 0xFFFF0000
200#define BF_UARTDBGRIS_UNAVAILABLE(v) \
201 (((v) << 16) & BM_UARTDBGRIS_UNAVAILABLE)
202#define BP_UARTDBGRIS_RESERVED 11
203#define BM_UARTDBGRIS_RESERVED 0x0000F800
204#define BF_UARTDBGRIS_RESERVED(v) \
205 (((v) << 11) & BM_UARTDBGRIS_RESERVED)
206#define BM_UARTDBGRIS_OERIS 0x00000400
207#define BM_UARTDBGRIS_BERIS 0x00000200
208#define BM_UARTDBGRIS_PERIS 0x00000100
209#define BM_UARTDBGRIS_FERIS 0x00000080
210#define BM_UARTDBGRIS_RTRIS 0x00000040
211#define BM_UARTDBGRIS_TXRIS 0x00000020
212#define BM_UARTDBGRIS_RXRIS 0x00000010
213#define BM_UARTDBGRIS_DSRRMIS 0x00000008
214#define BM_UARTDBGRIS_DCDRMIS 0x00000004
215#define BM_UARTDBGRIS_CTSRMIS 0x00000002
216#define BM_UARTDBGRIS_RIRMIS 0x00000001
217#define HW_UARTDBGMIS 0x00000040
218#define BP_UARTDBGMIS_UNAVAILABLE 16
219#define BM_UARTDBGMIS_UNAVAILABLE 0xFFFF0000
220#define BF_UARTDBGMIS_UNAVAILABLE(v) \
221 (((v) << 16) & BM_UARTDBGMIS_UNAVAILABLE)
222#define BP_UARTDBGMIS_RESERVED 11
223#define BM_UARTDBGMIS_RESERVED 0x0000F800
224#define BF_UARTDBGMIS_RESERVED(v) \
225 (((v) << 11) & BM_UARTDBGMIS_RESERVED)
226#define BM_UARTDBGMIS_OEMIS 0x00000400
227#define BM_UARTDBGMIS_BEMIS 0x00000200
228#define BM_UARTDBGMIS_PEMIS 0x00000100
229#define BM_UARTDBGMIS_FEMIS 0x00000080
230#define BM_UARTDBGMIS_RTMIS 0x00000040
231#define BM_UARTDBGMIS_TXMIS 0x00000020
232#define BM_UARTDBGMIS_RXMIS 0x00000010
233#define BM_UARTDBGMIS_DSRMMIS 0x00000008
234#define BM_UARTDBGMIS_DCDMMIS 0x00000004
235#define BM_UARTDBGMIS_CTSMMIS 0x00000002
236#define BM_UARTDBGMIS_RIMMIS 0x00000001
237#define HW_UARTDBGICR 0x00000044
238#define BP_UARTDBGICR_UNAVAILABLE 16
239#define BM_UARTDBGICR_UNAVAILABLE 0xFFFF0000
240#define BF_UARTDBGICR_UNAVAILABLE(v) \
241 (((v) << 16) & BM_UARTDBGICR_UNAVAILABLE)
242#define BP_UARTDBGICR_RESERVED 11
243#define BM_UARTDBGICR_RESERVED 0x0000F800
244#define BF_UARTDBGICR_RESERVED(v) \
245 (((v) << 11) & BM_UARTDBGICR_RESERVED)
246#define BM_UARTDBGICR_OEIC 0x00000400
247#define BM_UARTDBGICR_BEIC 0x00000200
248#define BM_UARTDBGICR_PEIC 0x00000100
249#define BM_UARTDBGICR_FEIC 0x00000080
250#define BM_UARTDBGICR_RTIC 0x00000040
251#define BM_UARTDBGICR_TXIC 0x00000020
252#define BM_UARTDBGICR_RXIC 0x00000010
253#define BM_UARTDBGICR_DSRMIC 0x00000008
254#define BM_UARTDBGICR_DCDMIC 0x00000004
255#define BM_UARTDBGICR_CTSMIC 0x00000002
256#define BM_UARTDBGICR_RIMIC 0x00000001
257#define HW_UARTDBGDMACR 0x00000048
258#define BP_UARTDBGDMACR_UNAVAILABLE 16
259#define BM_UARTDBGDMACR_UNAVAILABLE 0xFFFF0000
260#define BF_UARTDBGDMACR_UNAVAILABLE(v) \
261 (((v) << 16) & BM_UARTDBGDMACR_UNAVAILABLE)
262#define BP_UARTDBGDMACR_RESERVED 3
263#define BM_UARTDBGDMACR_RESERVED 0x0000FFF8
264#define BF_UARTDBGDMACR_RESERVED(v) \
265 (((v) << 3) & BM_UARTDBGDMACR_RESERVED)
266#define BM_UARTDBGDMACR_DMAONERR 0x00000004
267#define BM_UARTDBGDMACR_TXDMAE 0x00000002
268#define BM_UARTDBGDMACR_RXDMAE 0x00000001
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-usbctl.h b/arch/arm/mach-stmp37xx/include/mach/regs-usbctl.h
deleted file mode 100644
index 9145e22df32c..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-usbctl.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * stmp37xx: USBCTL register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_USBCTL_BASE (STMP3XXX_REGS_BASE + 0x80000)
22#define REGS_USBCTL_PHYS 0x80000
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-usbctrl.h b/arch/arm/mach-stmp37xx/include/mach/regs-usbctrl.h
deleted file mode 100644
index 1a2ae9cbdfed..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-usbctrl.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * stmp37xx: USBCTRL register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_USBCTRL_BASE (STMP3XXX_REGS_BASE + 0x80000)
22#define REGS_USBCTRL_PHYS 0x80080000
diff --git a/arch/arm/mach-stmp37xx/include/mach/regs-usbphy.h b/arch/arm/mach-stmp37xx/include/mach/regs-usbphy.h
deleted file mode 100644
index b7fce0fbc560..000000000000
--- a/arch/arm/mach-stmp37xx/include/mach/regs-usbphy.h
+++ /dev/null
@@ -1,37 +0,0 @@
1/*
2 * stmp37xx: USBPHY register definitions
3 *
4 * Copyright (c) 2008 Freescale Semiconductor
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
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#define REGS_USBPHY_BASE (STMP3XXX_REGS_BASE + 0x7C000)
22
23#define HW_USBPHY_PWD 0x0
24
25#define HW_USBPHY_CTRL 0x30
26#define BM_USBPHY_CTRL_ENHSPRECHARGEXMIT 0x00000001
27#define BP_USBPHY_CTRL_ENHSPRECHARGEXMIT 0
28#define BM_USBPHY_CTRL_ENHOSTDISCONDETECT 0x00000002
29#define BM_USBPHY_CTRL_ENDEVPLUGINDETECT 0x00000010
30#define BM_USBPHY_CTRL_ENOTGIDDETECT 0x00000080
31#define BM_USBPHY_CTRL_ENIRQDEVPLUGIN 0x00000800
32#define BM_USBPHY_CTRL_CLKGATE 0x40000000
33#define BM_USBPHY_CTRL_SFTRST 0x80000000
34
35#define HW_USBPHY_STATUS 0x40
36#define BM_USBPHY_STATUS_DEVPLUGIN_STATUS 0x00000040
37#define BM_USBPHY_STATUS_OTGID_STATUS 0x00000100
diff --git a/arch/arm/mach-stmp37xx/stmp37xx.c b/arch/arm/mach-stmp37xx/stmp37xx.c
deleted file mode 100644
index a9aed06ff376..000000000000
--- a/arch/arm/mach-stmp37xx/stmp37xx.c
+++ /dev/null
@@ -1,219 +0,0 @@
1/*
2 * Freescale STMP37XX platform support
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#include <linux/types.h>
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/device.h>
22#include <linux/platform_device.h>
23#include <linux/irq.h>
24#include <linux/io.h>
25
26#include <asm/setup.h>
27#include <asm/mach-types.h>
28
29#include <asm/mach/arch.h>
30#include <asm/mach/irq.h>
31#include <asm/mach/map.h>
32#include <asm/mach/time.h>
33
34#include <mach/stmp3xxx.h>
35#include <mach/dma.h>
36
37#include <mach/platform.h>
38#include <mach/regs-icoll.h>
39#include <mach/regs-apbh.h>
40#include <mach/regs-apbx.h>
41#include "stmp37xx.h"
42
43/*
44 * IRQ handling
45 */
46static void stmp37xx_ack_irq(struct irq_data *d)
47{
48 /* Disable IRQ */
49 stmp3xxx_clearl(0x04 << ((d->irq % 4) * 8),
50 REGS_ICOLL_BASE + HW_ICOLL_PRIORITYn + d->irq / 4 * 0x10);
51
52 /* ACK current interrupt */
53 __raw_writel(1, REGS_ICOLL_BASE + HW_ICOLL_LEVELACK);
54
55 /* Barrier */
56 (void)__raw_readl(REGS_ICOLL_BASE + HW_ICOLL_STAT);
57}
58
59static void stmp37xx_mask_irq(struct irq_data *d)
60{
61 /* IRQ disable */
62 stmp3xxx_clearl(0x04 << ((d->irq % 4) * 8),
63 REGS_ICOLL_BASE + HW_ICOLL_PRIORITYn + d->irq / 4 * 0x10);
64}
65
66static void stmp37xx_unmask_irq(struct irq_data *d)
67{
68 /* IRQ enable */
69 stmp3xxx_setl(0x04 << ((d->irq % 4) * 8),
70 REGS_ICOLL_BASE + HW_ICOLL_PRIORITYn + d->irq / 4 * 0x10);
71}
72
73static struct irq_chip stmp37xx_chip = {
74 .irq_ack = stmp37xx_ack_irq,
75 .irq_mask = stmp37xx_mask_irq,
76 .irq_unmask = stmp37xx_unmask_irq,
77};
78
79void __init stmp37xx_init_irq(void)
80{
81 stmp3xxx_init_irq(&stmp37xx_chip);
82}
83
84/*
85 * DMA interrupt handling
86 */
87void stmp3xxx_arch_dma_enable_interrupt(int channel)
88{
89 switch (STMP3XXX_DMA_BUS(channel)) {
90 case STMP3XXX_BUS_APBH:
91 stmp3xxx_setl(1 << (8 + STMP3XXX_DMA_CHANNEL(channel)),
92 REGS_APBH_BASE + HW_APBH_CTRL1);
93 break;
94
95 case STMP3XXX_BUS_APBX:
96 stmp3xxx_setl(1 << (8 + STMP3XXX_DMA_CHANNEL(channel)),
97 REGS_APBX_BASE + HW_APBX_CTRL1);
98 break;
99 }
100}
101EXPORT_SYMBOL(stmp3xxx_arch_dma_enable_interrupt);
102
103void stmp3xxx_arch_dma_clear_interrupt(int channel)
104{
105 switch (STMP3XXX_DMA_BUS(channel)) {
106 case STMP3XXX_BUS_APBH:
107 stmp3xxx_clearl(1 << STMP3XXX_DMA_CHANNEL(channel),
108 REGS_APBH_BASE + HW_APBH_CTRL1);
109 break;
110
111 case STMP3XXX_BUS_APBX:
112 stmp3xxx_clearl(1 << STMP3XXX_DMA_CHANNEL(channel),
113 REGS_APBX_BASE + HW_APBX_CTRL1);
114 break;
115 }
116}
117EXPORT_SYMBOL(stmp3xxx_arch_dma_clear_interrupt);
118
119int stmp3xxx_arch_dma_is_interrupt(int channel)
120{
121 int r = 0;
122
123 switch (STMP3XXX_DMA_BUS(channel)) {
124 case STMP3XXX_BUS_APBH:
125 r = __raw_readl(REGS_APBH_BASE + HW_APBH_CTRL1) &
126 (1 << STMP3XXX_DMA_CHANNEL(channel));
127 break;
128
129 case STMP3XXX_BUS_APBX:
130 r = __raw_readl(REGS_APBH_BASE + HW_APBH_CTRL1) &
131 (1 << STMP3XXX_DMA_CHANNEL(channel));
132 break;
133 }
134 return r;
135}
136EXPORT_SYMBOL(stmp3xxx_arch_dma_is_interrupt);
137
138void stmp3xxx_arch_dma_reset_channel(int channel)
139{
140 unsigned chbit = 1 << STMP3XXX_DMA_CHANNEL(channel);
141
142 switch (STMP3XXX_DMA_BUS(channel)) {
143 case STMP3XXX_BUS_APBH:
144 /* Reset channel and wait for it to complete */
145 stmp3xxx_setl(chbit << BP_APBH_CTRL0_RESET_CHANNEL,
146 REGS_APBH_BASE + HW_APBH_CTRL0);
147 while (__raw_readl(REGS_APBH_BASE + HW_APBH_CTRL0) &
148 (chbit << BP_APBH_CTRL0_RESET_CHANNEL))
149 cpu_relax();
150 break;
151
152 case STMP3XXX_BUS_APBX:
153 stmp3xxx_setl(chbit << BP_APBX_CTRL0_RESET_CHANNEL,
154 REGS_APBX_BASE + HW_APBX_CTRL0);
155 while (__raw_readl(REGS_APBX_BASE + HW_APBX_CTRL0) &
156 (chbit << BP_APBX_CTRL0_RESET_CHANNEL))
157 cpu_relax();
158 break;
159 }
160}
161EXPORT_SYMBOL(stmp3xxx_arch_dma_reset_channel);
162
163void stmp3xxx_arch_dma_freeze(int channel)
164{
165 unsigned chbit = 1 << STMP3XXX_DMA_CHANNEL(channel);
166
167 switch (STMP3XXX_DMA_BUS(channel)) {
168 case STMP3XXX_BUS_APBH:
169 stmp3xxx_setl(1 << chbit, REGS_APBH_BASE + HW_APBH_CTRL0);
170 break;
171 case STMP3XXX_BUS_APBX:
172 stmp3xxx_setl(1 << chbit, REGS_APBH_BASE + HW_APBH_CTRL0);
173 break;
174 }
175}
176EXPORT_SYMBOL(stmp3xxx_arch_dma_freeze);
177
178void stmp3xxx_arch_dma_unfreeze(int channel)
179{
180 unsigned chbit = 1 << STMP3XXX_DMA_CHANNEL(channel);
181
182 switch (STMP3XXX_DMA_BUS(channel)) {
183 case STMP3XXX_BUS_APBH:
184 stmp3xxx_clearl(1 << chbit, REGS_APBH_BASE + HW_APBH_CTRL0);
185 break;
186 case STMP3XXX_BUS_APBX:
187 stmp3xxx_clearl(1 << chbit, REGS_APBH_BASE + HW_APBH_CTRL0);
188 break;
189 }
190}
191EXPORT_SYMBOL(stmp3xxx_arch_dma_unfreeze);
192
193/*
194 * The registers are all very closely mapped, so we might as well map them all
195 * with a single mapping
196 *
197 * Logical Physical
198 * f0000000 80000000 On-chip registers
199 * f1000000 00000000 32k on-chip SRAM
200 */
201static struct map_desc stmp37xx_io_desc[] __initdata = {
202 {
203 .virtual = (u32)STMP3XXX_REGS_BASE,
204 .pfn = __phys_to_pfn(STMP3XXX_REGS_PHBASE),
205 .length = SZ_1M,
206 .type = MT_DEVICE
207 },
208 {
209 .virtual = (u32)STMP3XXX_OCRAM_BASE,
210 .pfn = __phys_to_pfn(STMP3XXX_OCRAM_PHBASE),
211 .length = STMP3XXX_OCRAM_SIZE,
212 .type = MT_DEVICE,
213 },
214};
215
216void __init stmp37xx_map_io(void)
217{
218 iotable_init(stmp37xx_io_desc, ARRAY_SIZE(stmp37xx_io_desc));
219}
diff --git a/arch/arm/mach-stmp37xx/stmp37xx.h b/arch/arm/mach-stmp37xx/stmp37xx.h
deleted file mode 100644
index 0b75fb796a64..000000000000
--- a/arch/arm/mach-stmp37xx/stmp37xx.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * Freescale STMP37XX/STMP378X internal functions and data declarations
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __MACH_STMP37XX_H
19#define __MACH_STMP37XX_H
20
21void stmp37xx_map_io(void);
22void stmp37xx_init_irq(void);
23
24#endif /* __MACH_STMP37XX_H */
diff --git a/arch/arm/mach-stmp37xx/stmp37xx_devb.c b/arch/arm/mach-stmp37xx/stmp37xx_devb.c
deleted file mode 100644
index 311d8552d362..000000000000
--- a/arch/arm/mach-stmp37xx/stmp37xx_devb.c
+++ /dev/null
@@ -1,99 +0,0 @@
1/*
2 * Freescale STMP37XX development board support
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/device.h>
21#include <linux/platform_device.h>
22#include <asm/setup.h>
23#include <asm/mach-types.h>
24#include <asm/mach/arch.h>
25
26#include <mach/stmp3xxx.h>
27#include <mach/pins.h>
28#include <mach/pinmux.h>
29#include "stmp37xx.h"
30
31/*
32 * List of STMP37xx development board specific devices
33 */
34static struct platform_device *stmp37xx_devb_devices[] = {
35 &stmp3xxx_dbguart,
36 &stmp3xxx_appuart,
37};
38
39static struct pin_desc dbguart_pins_0[] = {
40 { PINID_PWM0, PIN_FUN3, },
41 { PINID_PWM1, PIN_FUN3, },
42};
43
44struct pin_desc appuart_pins_0[] = {
45 { PINID_UART2_CTS, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
46 { PINID_UART2_RTS, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
47 { PINID_UART2_RX, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
48 { PINID_UART2_TX, PIN_FUN1, PIN_4MA, PIN_1_8V, 0, },
49};
50
51static struct pin_group appuart_pins[] = {
52 [0] = {
53 .pins = appuart_pins_0,
54 .nr_pins = ARRAY_SIZE(appuart_pins_0),
55 },
56 /* 37xx has the only app uart */
57};
58
59static struct pin_group dbguart_pins[] = {
60 [0] = {
61 .pins = dbguart_pins_0,
62 .nr_pins = ARRAY_SIZE(dbguart_pins_0),
63 },
64};
65
66static int dbguart_pins_control(int id, int request)
67{
68 int r = 0;
69
70 if (request)
71 r = stmp3xxx_request_pin_group(&dbguart_pins[id], "debug uart");
72 else
73 stmp3xxx_release_pin_group(&dbguart_pins[id], "debug uart");
74 return r;
75}
76
77
78static void __init stmp37xx_devb_init(void)
79{
80 stmp3xxx_pinmux_init(NR_REAL_IRQS);
81
82 /* Init STMP3xxx platform */
83 stmp3xxx_init();
84
85 stmp3xxx_dbguart.dev.platform_data = dbguart_pins_control;
86 stmp3xxx_appuart.dev.platform_data = appuart_pins;
87
88 /* Add STMP37xx development board devices */
89 platform_add_devices(stmp37xx_devb_devices,
90 ARRAY_SIZE(stmp37xx_devb_devices));
91}
92
93MACHINE_START(STMP37XX, "STMP37XX")
94 .boot_params = 0x40000100,
95 .map_io = stmp37xx_map_io,
96 .init_irq = stmp37xx_init_irq,
97 .timer = &stmp3xxx_timer,
98 .init_machine = stmp37xx_devb_init,
99MACHINE_END
diff --git a/arch/arm/mach-tcc8k/time.c b/arch/arm/mach-tcc8k/time.c
index e0a8d609afe1..a96babe83771 100644
--- a/arch/arm/mach-tcc8k/time.c
+++ b/arch/arm/mach-tcc8k/time.c
@@ -25,19 +25,6 @@
25 25
26static void __iomem *timer_base; 26static void __iomem *timer_base;
27 27
28static cycle_t tcc_get_cycles(struct clocksource *cs)
29{
30 return __raw_readl(timer_base + TC32MCNT_OFFS);
31}
32
33static struct clocksource clocksource_tcc = {
34 .name = "tcc_tc32",
35 .rating = 200,
36 .read = tcc_get_cycles,
37 .mask = CLOCKSOURCE_MASK(32),
38 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
39};
40
41static int tcc_set_next_event(unsigned long evt, 28static int tcc_set_next_event(unsigned long evt,
42 struct clock_event_device *unused) 29 struct clock_event_device *unused)
43{ 30{
@@ -102,7 +89,8 @@ static int __init tcc_clockevent_init(struct clk *clock)
102{ 89{
103 unsigned int c = clk_get_rate(clock); 90 unsigned int c = clk_get_rate(clock);
104 91
105 clocksource_register_hz(&clocksource_tcc, c); 92 clocksource_mmio_init(timer_base + TC32MCNT_OFFS, "tcc_tc32", c,
93 200, 32, clocksource_mmio_readl_up);
106 94
107 clockevent_tcc.mult = div_sc(c, NSEC_PER_SEC, 95 clockevent_tcc.mult = div_sc(c, NSEC_PER_SEC,
108 clockevent_tcc.shift); 96 clockevent_tcc.shift);
diff --git a/arch/arm/mach-tegra/include/mach/barriers.h b/arch/arm/mach-tegra/include/mach/barriers.h
index cc115174899b..425b42e91ef6 100644
--- a/arch/arm/mach-tegra/include/mach/barriers.h
+++ b/arch/arm/mach-tegra/include/mach/barriers.h
@@ -23,7 +23,7 @@
23 23
24#include <asm/outercache.h> 24#include <asm/outercache.h>
25 25
26#define rmb() dmb() 26#define rmb() dsb()
27#define wmb() do { dsb(); outer_sync(); } while (0) 27#define wmb() do { dsb(); outer_sync(); } while (0)
28#define mb() wmb() 28#define mb() wmb()
29 29
diff --git a/arch/arm/mach-tegra/include/mach/smp.h b/arch/arm/mach-tegra/include/mach/smp.h
deleted file mode 100644
index c8221b38ee7c..000000000000
--- a/arch/arm/mach-tegra/include/mach/smp.h
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifndef ASMARM_ARCH_SMP_H
2#define ASMARM_ARCH_SMP_H
3
4#include <asm/hardware/gic.h>
5
6/*
7 * We use IRQ1 as the IPI
8 */
9static inline void smp_cross_call(const struct cpumask *mask, int ipi)
10{
11 gic_raise_softirq(mask, ipi);
12}
13
14#endif
diff --git a/arch/arm/mach-tegra/platsmp.c b/arch/arm/mach-tegra/platsmp.c
index ec1f68924edf..b8ae3c978dee 100644
--- a/arch/arm/mach-tegra/platsmp.c
+++ b/arch/arm/mach-tegra/platsmp.c
@@ -20,6 +20,7 @@
20#include <linux/io.h> 20#include <linux/io.h>
21 21
22#include <asm/cacheflush.h> 22#include <asm/cacheflush.h>
23#include <asm/hardware/gic.h>
23#include <mach/hardware.h> 24#include <mach/hardware.h>
24#include <asm/mach-types.h> 25#include <asm/mach-types.h>
25#include <asm/smp_scu.h> 26#include <asm/smp_scu.h>
@@ -122,6 +123,8 @@ void __init smp_init_cpus(void)
122 123
123 for (i = 0; i < ncores; i++) 124 for (i = 0; i < ncores; i++)
124 cpu_set(i, cpu_possible_map); 125 cpu_set(i, cpu_possible_map);
126
127 set_smp_cross_call(gic_raise_softirq);
125} 128}
126 129
127void __init platform_smp_prepare_cpus(unsigned int max_cpus) 130void __init platform_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
index 0fcb1eb4214d..90350420c4e9 100644
--- a/arch/arm/mach-tegra/timer.c
+++ b/arch/arm/mach-tegra/timer.c
@@ -98,11 +98,6 @@ static void tegra_timer_set_mode(enum clock_event_mode mode,
98 } 98 }
99} 99}
100 100
101static cycle_t tegra_clocksource_read(struct clocksource *cs)
102{
103 return timer_readl(TIMERUS_CNTR_1US);
104}
105
106static struct clock_event_device tegra_clockevent = { 101static struct clock_event_device tegra_clockevent = {
107 .name = "timer0", 102 .name = "timer0",
108 .rating = 300, 103 .rating = 300,
@@ -111,14 +106,6 @@ static struct clock_event_device tegra_clockevent = {
111 .set_mode = tegra_timer_set_mode, 106 .set_mode = tegra_timer_set_mode,
112}; 107};
113 108
114static struct clocksource tegra_clocksource = {
115 .name = "timer_us",
116 .rating = 300,
117 .read = tegra_clocksource_read,
118 .mask = CLOCKSOURCE_MASK(32),
119 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
120};
121
122static DEFINE_CLOCK_DATA(cd); 109static DEFINE_CLOCK_DATA(cd);
123 110
124/* 111/*
@@ -234,7 +221,8 @@ static void __init tegra_init_timer(void)
234 init_fixed_sched_clock(&cd, tegra_update_sched_clock, 32, 221 init_fixed_sched_clock(&cd, tegra_update_sched_clock, 32,
235 1000000, SC_MULT, SC_SHIFT); 222 1000000, SC_MULT, SC_SHIFT);
236 223
237 if (clocksource_register_hz(&tegra_clocksource, 1000000)) { 224 if (clocksource_mmio_init(timer_reg_base + TIMERUS_CNTR_1US,
225 "timer_us", 1000000, 300, 32, clocksource_mmio_readl_up)) {
238 printk(KERN_ERR "Failed to register clocksource\n"); 226 printk(KERN_ERR "Failed to register clocksource\n");
239 BUG(); 227 BUG();
240 } 228 }
diff --git a/arch/arm/mach-u300/timer.c b/arch/arm/mach-u300/timer.c
index 3ec58bd2d6e4..891cf44591e0 100644
--- a/arch/arm/mach-u300/timer.c
+++ b/arch/arm/mach-u300/timer.c
@@ -333,20 +333,6 @@ static struct irqaction u300_timer_irq = {
333 .handler = u300_timer_interrupt, 333 .handler = u300_timer_interrupt,
334}; 334};
335 335
336/* Use general purpose timer 2 as clock source */
337static cycle_t u300_get_cycles(struct clocksource *cs)
338{
339 return (cycles_t) readl(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC);
340}
341
342static struct clocksource clocksource_u300_1mhz = {
343 .name = "GPT2",
344 .rating = 300, /* Reasonably fast and accurate clock source */
345 .read = u300_get_cycles,
346 .mask = CLOCKSOURCE_MASK(32), /* 32 bits */
347 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
348};
349
350/* 336/*
351 * Override the global weak sched_clock symbol with this 337 * Override the global weak sched_clock symbol with this
352 * local implementation which uses the clocksource to get some 338 * local implementation which uses the clocksource to get some
@@ -422,7 +408,9 @@ static void __init u300_timer_init(void)
422 writel(U300_TIMER_APP_EGPT2_TIMER_ENABLE, 408 writel(U300_TIMER_APP_EGPT2_TIMER_ENABLE,
423 U300_TIMER_APP_VBASE + U300_TIMER_APP_EGPT2); 409 U300_TIMER_APP_VBASE + U300_TIMER_APP_EGPT2);
424 410
425 if (clocksource_register_hz(&clocksource_u300_1mhz, rate)) 411 /* Use general purpose timer 2 as clock source */
412 if (clocksource_mmio_init(U300_TIMER_APP_VBASE + U300_TIMER_APP_GPT2CC,
413 "GPT2", rate, 300, 32, clocksource_mmio_readl_up))
426 printk(KERN_ERR "timer: failed to initialize clock " 414 printk(KERN_ERR "timer: failed to initialize clock "
427 "source %s\n", clocksource_u300_1mhz.name); 415 "source %s\n", clocksource_u300_1mhz.name);
428 416
diff --git a/arch/arm/mach-ux500/include/mach/smp.h b/arch/arm/mach-ux500/include/mach/smp.h
deleted file mode 100644
index ca2b15b1b3b1..000000000000
--- a/arch/arm/mach-ux500/include/mach/smp.h
+++ /dev/null
@@ -1,24 +0,0 @@
1/*
2 * This file is based ARM realview platform.
3 * Copyright (C) ARM Limited.
4 *
5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any
7 * warranty of any kind, whether express or implied.
8 */
9#ifndef ASMARM_ARCH_SMP_H
10#define ASMARM_ARCH_SMP_H
11
12#include <asm/hardware/gic.h>
13
14/* This is required to wakeup the secondary core */
15extern void u8500_secondary_startup(void);
16
17/*
18 * We use IRQ1 as the IPI
19 */
20static inline void smp_cross_call(const struct cpumask *mask, int ipi)
21{
22 gic_raise_softirq(mask, ipi);
23}
24#endif
diff --git a/arch/arm/mach-ux500/platsmp.c b/arch/arm/mach-ux500/platsmp.c
index 4fff4d408417..0c527fe2cebb 100644
--- a/arch/arm/mach-ux500/platsmp.c
+++ b/arch/arm/mach-ux500/platsmp.c
@@ -18,10 +18,14 @@
18#include <linux/io.h> 18#include <linux/io.h>
19 19
20#include <asm/cacheflush.h> 20#include <asm/cacheflush.h>
21#include <asm/hardware/gic.h>
21#include <asm/smp_scu.h> 22#include <asm/smp_scu.h>
22#include <mach/hardware.h> 23#include <mach/hardware.h>
23#include <mach/setup.h> 24#include <mach/setup.h>
24 25
26/* This is called from headsmp.S to wakeup the secondary core */
27extern void u8500_secondary_startup(void);
28
25/* 29/*
26 * control for which core is the next to come out of the secondary 30 * control for which core is the next to come out of the secondary
27 * boot "holding pen" 31 * boot "holding pen"
@@ -94,7 +98,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
94 */ 98 */
95 write_pen_release(cpu); 99 write_pen_release(cpu);
96 100
97 smp_cross_call(cpumask_of(cpu), 1); 101 gic_raise_softirq(cpumask_of(cpu), 1);
98 102
99 timeout = jiffies + (1 * HZ); 103 timeout = jiffies + (1 * HZ);
100 while (time_before(jiffies, timeout)) { 104 while (time_before(jiffies, timeout)) {
@@ -162,6 +166,8 @@ void __init smp_init_cpus(void)
162 166
163 for (i = 0; i < ncores; i++) 167 for (i = 0; i < ncores; i++)
164 set_cpu_possible(i, true); 168 set_cpu_possible(i, true);
169
170 set_smp_cross_call(gic_raise_softirq);
165} 171}
166 172
167void __init platform_smp_prepare_cpus(unsigned int max_cpus) 173void __init platform_smp_prepare_cpus(unsigned int max_cpus)
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index eb7ffa0ee8b5..0c99cf076c63 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -32,6 +32,7 @@
32#include <linux/io.h> 32#include <linux/io.h>
33#include <linux/gfp.h> 33#include <linux/gfp.h>
34#include <linux/clkdev.h> 34#include <linux/clkdev.h>
35#include <linux/mtd/physmap.h>
35 36
36#include <asm/system.h> 37#include <asm/system.h>
37#include <asm/irq.h> 38#include <asm/irq.h>
@@ -42,7 +43,6 @@
42#include <asm/mach-types.h> 43#include <asm/mach-types.h>
43 44
44#include <asm/mach/arch.h> 45#include <asm/mach/arch.h>
45#include <asm/mach/flash.h>
46#include <asm/mach/irq.h> 46#include <asm/mach/irq.h>
47#include <asm/mach/time.h> 47#include <asm/mach/time.h>
48#include <asm/mach/map.h> 48#include <asm/mach/map.h>
@@ -190,27 +190,7 @@ void __init versatile_map_io(void)
190 190
191#define VERSATILE_FLASHCTRL (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET) 191#define VERSATILE_FLASHCTRL (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET)
192 192
193static int versatile_flash_init(void) 193static void versatile_flash_set_vpp(struct platform_device *pdev, int on)
194{
195 u32 val;
196
197 val = __raw_readl(VERSATILE_FLASHCTRL);
198 val &= ~VERSATILE_FLASHPROG_FLVPPEN;
199 __raw_writel(val, VERSATILE_FLASHCTRL);
200
201 return 0;
202}
203
204static void versatile_flash_exit(void)
205{
206 u32 val;
207
208 val = __raw_readl(VERSATILE_FLASHCTRL);
209 val &= ~VERSATILE_FLASHPROG_FLVPPEN;
210 __raw_writel(val, VERSATILE_FLASHCTRL);
211}
212
213static void versatile_flash_set_vpp(int on)
214{ 194{
215 u32 val; 195 u32 val;
216 196
@@ -222,11 +202,8 @@ static void versatile_flash_set_vpp(int on)
222 __raw_writel(val, VERSATILE_FLASHCTRL); 202 __raw_writel(val, VERSATILE_FLASHCTRL);
223} 203}
224 204
225static struct flash_platform_data versatile_flash_data = { 205static struct physmap_flash_data versatile_flash_data = {
226 .map_name = "cfi_probe",
227 .width = 4, 206 .width = 4,
228 .init = versatile_flash_init,
229 .exit = versatile_flash_exit,
230 .set_vpp = versatile_flash_set_vpp, 207 .set_vpp = versatile_flash_set_vpp,
231}; 208};
232 209
@@ -237,7 +214,7 @@ static struct resource versatile_flash_resource = {
237}; 214};
238 215
239static struct platform_device versatile_flash_device = { 216static struct platform_device versatile_flash_device = {
240 .name = "armflash", 217 .name = "physmap-flash",
241 .id = 0, 218 .id = 0,
242 .dev = { 219 .dev = {
243 .platform_data = &versatile_flash_data, 220 .platform_data = &versatile_flash_data,
@@ -375,6 +352,10 @@ static struct clk ref24_clk = {
375 .rate = 24000000, 352 .rate = 24000000,
376}; 353};
377 354
355static struct clk sp804_clk = {
356 .rate = 1000000,
357};
358
378static struct clk dummy_apb_pclk; 359static struct clk dummy_apb_pclk;
379 360
380static struct clk_lookup lookups[] = { 361static struct clk_lookup lookups[] = {
@@ -411,7 +392,10 @@ static struct clk_lookup lookups[] = {
411 }, { /* CLCD */ 392 }, { /* CLCD */
412 .dev_id = "dev:20", 393 .dev_id = "dev:20",
413 .clk = &osc4_clk, 394 .clk = &osc4_clk,
414 } 395 }, { /* SP804 timers */
396 .dev_id = "sp804",
397 .clk = &sp804_clk,
398 },
415}; 399};
416 400
417/* 401/*
@@ -764,8 +748,8 @@ static void __init versatile_timer_init(void)
764 writel(0, TIMER2_VA_BASE + TIMER_CTRL); 748 writel(0, TIMER2_VA_BASE + TIMER_CTRL);
765 writel(0, TIMER3_VA_BASE + TIMER_CTRL); 749 writel(0, TIMER3_VA_BASE + TIMER_CTRL);
766 750
767 sp804_clocksource_init(TIMER3_VA_BASE); 751 sp804_clocksource_init(TIMER3_VA_BASE, "timer3");
768 sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMERINT0_1); 752 sp804_clockevents_init(TIMER0_VA_BASE, IRQ_TIMERINT0_1, "timer0");
769} 753}
770 754
771struct sys_timer versatile_timer = { 755struct sys_timer versatile_timer = {
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
index ebc22e759325..765a71ff7f3b 100644
--- a/arch/arm/mach-vexpress/ct-ca9x4.c
+++ b/arch/arm/mach-vexpress/ct-ca9x4.c
@@ -71,8 +71,9 @@ static void __init ct_ca9x4_timer_init(void)
71 writel(0, MMIO_P2V(CT_CA9X4_TIMER0) + TIMER_CTRL); 71 writel(0, MMIO_P2V(CT_CA9X4_TIMER0) + TIMER_CTRL);
72 writel(0, MMIO_P2V(CT_CA9X4_TIMER1) + TIMER_CTRL); 72 writel(0, MMIO_P2V(CT_CA9X4_TIMER1) + TIMER_CTRL);
73 73
74 sp804_clocksource_init(MMIO_P2V(CT_CA9X4_TIMER1)); 74 sp804_clocksource_init(MMIO_P2V(CT_CA9X4_TIMER1), "ct-timer1");
75 sp804_clockevents_init(MMIO_P2V(CT_CA9X4_TIMER0), IRQ_CT_CA9X4_TIMER0); 75 sp804_clockevents_init(MMIO_P2V(CT_CA9X4_TIMER0), IRQ_CT_CA9X4_TIMER0,
76 "ct-timer0");
76} 77}
77 78
78static struct sys_timer ct_ca9x4_timer = { 79static struct sys_timer ct_ca9x4_timer = {
@@ -141,10 +142,22 @@ static struct clk osc1_clk = {
141 .rate = 24000000, 142 .rate = 24000000,
142}; 143};
143 144
145static struct clk ct_sp804_clk = {
146 .rate = 1000000,
147};
148
144static struct clk_lookup lookups[] = { 149static struct clk_lookup lookups[] = {
145 { /* CLCD */ 150 { /* CLCD */
146 .dev_id = "ct:clcd", 151 .dev_id = "ct:clcd",
147 .clk = &osc1_clk, 152 .clk = &osc1_clk,
153 }, { /* SP804 timers */
154 .dev_id = "sp804",
155 .con_id = "ct-timer0",
156 .clk = &ct_sp804_clk,
157 }, { /* SP804 timers */
158 .dev_id = "sp804",
159 .con_id = "ct-timer1",
160 .clk = &ct_sp804_clk,
148 }, 161 },
149}; 162};
150 163
@@ -210,6 +223,8 @@ static void ct_ca9x4_init_cpu_map(void)
210 223
211 for (i = 0; i < ncores; ++i) 224 for (i = 0; i < ncores; ++i)
212 set_cpu_possible(i, true); 225 set_cpu_possible(i, true);
226
227 set_smp_cross_call(gic_raise_softirq);
213} 228}
214 229
215static void ct_ca9x4_smp_enable(unsigned int max_cpus) 230static void ct_ca9x4_smp_enable(unsigned int max_cpus)
diff --git a/arch/arm/mach-vexpress/include/mach/smp.h b/arch/arm/mach-vexpress/include/mach/smp.h
deleted file mode 100644
index 4c05e4a9713a..000000000000
--- a/arch/arm/mach-vexpress/include/mach/smp.h
+++ /dev/null
@@ -1,13 +0,0 @@
1#ifndef __MACH_SMP_H
2#define __MACH_SMP_H
3
4#include <asm/hardware/gic.h>
5
6/*
7 * We use IRQ1 as the IPI
8 */
9static inline void smp_cross_call(const struct cpumask *mask, int ipi)
10{
11 gic_raise_softirq(mask, ipi);
12}
13#endif
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index ba46e8e07437..285edcd2da2a 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -13,11 +13,11 @@
13#include <linux/sysdev.h> 13#include <linux/sysdev.h>
14#include <linux/usb/isp1760.h> 14#include <linux/usb/isp1760.h>
15#include <linux/clkdev.h> 15#include <linux/clkdev.h>
16#include <linux/mtd/physmap.h>
16 17
17#include <asm/mach-types.h> 18#include <asm/mach-types.h>
18#include <asm/sizes.h> 19#include <asm/sizes.h>
19#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
20#include <asm/mach/flash.h>
21#include <asm/mach/map.h> 21#include <asm/mach/map.h>
22#include <asm/mach/time.h> 22#include <asm/mach/time.h>
23#include <asm/hardware/arm_timer.h> 23#include <asm/hardware/arm_timer.h>
@@ -65,8 +65,9 @@ static void __init v2m_timer_init(void)
65 writel(0, MMIO_P2V(V2M_TIMER0) + TIMER_CTRL); 65 writel(0, MMIO_P2V(V2M_TIMER0) + TIMER_CTRL);
66 writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL); 66 writel(0, MMIO_P2V(V2M_TIMER1) + TIMER_CTRL);
67 67
68 sp804_clocksource_init(MMIO_P2V(V2M_TIMER1)); 68 sp804_clocksource_init(MMIO_P2V(V2M_TIMER1), "v2m-timer1");
69 sp804_clockevents_init(MMIO_P2V(V2M_TIMER0), IRQ_V2M_TIMER0); 69 sp804_clockevents_init(MMIO_P2V(V2M_TIMER0), IRQ_V2M_TIMER0,
70 "v2m-timer0");
70} 71}
71 72
72static struct sys_timer v2m_timer = { 73static struct sys_timer v2m_timer = {
@@ -206,27 +207,13 @@ static struct platform_device v2m_usb_device = {
206 .dev.platform_data = &v2m_usb_config, 207 .dev.platform_data = &v2m_usb_config,
207}; 208};
208 209
209static int v2m_flash_init(void) 210static void v2m_flash_set_vpp(struct platform_device *pdev, int on)
210{
211 writel(0, MMIO_P2V(V2M_SYS_FLASH));
212 return 0;
213}
214
215static void v2m_flash_exit(void)
216{
217 writel(0, MMIO_P2V(V2M_SYS_FLASH));
218}
219
220static void v2m_flash_set_vpp(int on)
221{ 211{
222 writel(on != 0, MMIO_P2V(V2M_SYS_FLASH)); 212 writel(on != 0, MMIO_P2V(V2M_SYS_FLASH));
223} 213}
224 214
225static struct flash_platform_data v2m_flash_data = { 215static struct physmap_flash_data v2m_flash_data = {
226 .map_name = "cfi_probe",
227 .width = 4, 216 .width = 4,
228 .init = v2m_flash_init,
229 .exit = v2m_flash_exit,
230 .set_vpp = v2m_flash_set_vpp, 217 .set_vpp = v2m_flash_set_vpp,
231}; 218};
232 219
@@ -243,7 +230,7 @@ static struct resource v2m_flash_resources[] = {
243}; 230};
244 231
245static struct platform_device v2m_flash_device = { 232static struct platform_device v2m_flash_device = {
246 .name = "armflash", 233 .name = "physmap-flash",
247 .id = -1, 234 .id = -1,
248 .resource = v2m_flash_resources, 235 .resource = v2m_flash_resources,
249 .num_resources = ARRAY_SIZE(v2m_flash_resources), 236 .num_resources = ARRAY_SIZE(v2m_flash_resources),
@@ -333,6 +320,10 @@ static struct clk osc2_clk = {
333 .rate = 24000000, 320 .rate = 24000000,
334}; 321};
335 322
323static struct clk v2m_sp804_clk = {
324 .rate = 1000000,
325};
326
336static struct clk dummy_apb_pclk; 327static struct clk dummy_apb_pclk;
337 328
338static struct clk_lookup v2m_lookups[] = { 329static struct clk_lookup v2m_lookups[] = {
@@ -363,6 +354,14 @@ static struct clk_lookup v2m_lookups[] = {
363 }, { /* CLCD */ 354 }, { /* CLCD */
364 .dev_id = "mb:clcd", 355 .dev_id = "mb:clcd",
365 .clk = &osc1_clk, 356 .clk = &osc1_clk,
357 }, { /* SP804 timers */
358 .dev_id = "sp804",
359 .con_id = "v2m-timer0",
360 .clk = &v2m_sp804_clk,
361 }, { /* SP804 timers */
362 .dev_id = "sp804",
363 .con_id = "v2m-timer1",
364 .clk = &v2m_sp804_clk,
366 }, 365 },
367}; 366};
368 367
diff --git a/arch/arm/mach-w90x900/time.c b/arch/arm/mach-w90x900/time.c
index 4b089cb930dc..a2c4e2d0a0d4 100644
--- a/arch/arm/mach-w90x900/time.c
+++ b/arch/arm/mach-w90x900/time.c
@@ -43,7 +43,6 @@
43#define PRESCALE 0x63 /* Divider = prescale + 1 */ 43#define PRESCALE 0x63 /* Divider = prescale + 1 */
44 44
45#define TDR_SHIFT 24 45#define TDR_SHIFT 24
46#define TDR_MASK ((1 << TDR_SHIFT) - 1)
47 46
48static unsigned int timer0_load; 47static unsigned int timer0_load;
49 48
@@ -143,19 +142,6 @@ static void __init nuc900_clockevents_init(void)
143 clockevents_register_device(&nuc900_clockevent_device); 142 clockevents_register_device(&nuc900_clockevent_device);
144} 143}
145 144
146static cycle_t nuc900_get_cycles(struct clocksource *cs)
147{
148 return (~__raw_readl(REG_TDR1)) & TDR_MASK;
149}
150
151static struct clocksource clocksource_nuc900 = {
152 .name = "nuc900-timer1",
153 .rating = 200,
154 .read = nuc900_get_cycles,
155 .mask = CLOCKSOURCE_MASK(TDR_SHIFT),
156 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
157};
158
159static void __init nuc900_clocksource_init(void) 145static void __init nuc900_clocksource_init(void)
160{ 146{
161 unsigned int val; 147 unsigned int val;
@@ -175,7 +161,8 @@ static void __init nuc900_clocksource_init(void)
175 val |= (COUNTEN | PERIOD | PRESCALE); 161 val |= (COUNTEN | PERIOD | PRESCALE);
176 __raw_writel(val, REG_TCSR1); 162 __raw_writel(val, REG_TCSR1);
177 163
178 clocksource_register_hz(&clocksource_nuc900, rate); 164 clocksource_mmio_init(REG_TDR1, "nuc900-timer1", rate, 200,
165 TDR_SHIFT, clocksource_mmio_readl_down);
179} 166}
180 167
181static void __init nuc900_timer_init(void) 168static void __init nuc900_timer_init(void)
diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c
index 2b269c955524..1a8d4aa821be 100644
--- a/arch/arm/mm/flush.c
+++ b/arch/arm/mm/flush.c
@@ -253,8 +253,8 @@ void __sync_icache_dcache(pte_t pteval)
253 253
254 if (!test_and_set_bit(PG_dcache_clean, &page->flags)) 254 if (!test_and_set_bit(PG_dcache_clean, &page->flags))
255 __flush_dcache_page(mapping, page); 255 __flush_dcache_page(mapping, page);
256 /* pte_exec() already checked above for non-aliasing VIPT cache */ 256
257 if (cache_is_vipt_nonaliasing() || pte_exec(pteval)) 257 if (pte_exec(pteval))
258 __flush_icache_all(); 258 __flush_icache_all();
259} 259}
260#endif 260#endif
@@ -275,7 +275,8 @@ void __sync_icache_dcache(pte_t pteval)
275 * kernel cache lines for later. Otherwise, we assume we have 275 * kernel cache lines for later. Otherwise, we assume we have
276 * aliasing mappings. 276 * aliasing mappings.
277 * 277 *
278 * Note that we disable the lazy flush for SMP. 278 * Note that we disable the lazy flush for SMP configurations where
279 * the cache maintenance operations are not automatically broadcasted.
279 */ 280 */
280void flush_dcache_page(struct page *page) 281void flush_dcache_page(struct page *page)
281{ 282{
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index e5f6fc428348..76f82ae44efb 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -201,6 +201,20 @@ static void __init arm_bootmem_init(unsigned long start_pfn,
201 } 201 }
202} 202}
203 203
204#ifdef CONFIG_ZONE_DMA
205static void __init arm_adjust_dma_zone(unsigned long *size, unsigned long *hole,
206 unsigned long dma_size)
207{
208 if (size[0] <= dma_size)
209 return;
210
211 size[ZONE_NORMAL] = size[0] - dma_size;
212 size[ZONE_DMA] = dma_size;
213 hole[ZONE_NORMAL] = hole[0];
214 hole[ZONE_DMA] = 0;
215}
216#endif
217
204static void __init arm_bootmem_free(unsigned long min, unsigned long max_low, 218static void __init arm_bootmem_free(unsigned long min, unsigned long max_low,
205 unsigned long max_high) 219 unsigned long max_high)
206{ 220{
@@ -243,11 +257,18 @@ static void __init arm_bootmem_free(unsigned long min, unsigned long max_low,
243#endif 257#endif
244 } 258 }
245 259
260#ifdef ARM_DMA_ZONE_SIZE
261#ifndef CONFIG_ZONE_DMA
262#error ARM_DMA_ZONE_SIZE set but no DMA zone to limit allocations
263#endif
264
246 /* 265 /*
247 * Adjust the sizes according to any special requirements for 266 * Adjust the sizes according to any special requirements for
248 * this machine type. 267 * this machine type.
249 */ 268 */
250 arch_adjust_zones(zone_size, zhole_size); 269 arm_adjust_dma_zone(zone_size, zhole_size,
270 ARM_DMA_ZONE_SIZE >> PAGE_SHIFT);
271#endif
251 272
252 free_area_init_node(0, zone_size, min, zhole_size); 273 free_area_init_node(0, zone_size, min, zhole_size);
253} 274}
@@ -392,7 +413,7 @@ free_memmap(unsigned long start_pfn, unsigned long end_pfn)
392 * Convert start_pfn/end_pfn to a struct page pointer. 413 * Convert start_pfn/end_pfn to a struct page pointer.
393 */ 414 */
394 start_pg = pfn_to_page(start_pfn - 1) + 1; 415 start_pg = pfn_to_page(start_pfn - 1) + 1;
395 end_pg = pfn_to_page(end_pfn); 416 end_pg = pfn_to_page(end_pfn - 1) + 1;
396 417
397 /* 418 /*
398 * Convert to physical addresses, and 419 * Convert to physical addresses, and
@@ -426,6 +447,14 @@ static void __init free_unused_memmap(struct meminfo *mi)
426 447
427 bank_start = bank_pfn_start(bank); 448 bank_start = bank_pfn_start(bank);
428 449
450#ifdef CONFIG_SPARSEMEM
451 /*
452 * Take care not to free memmap entries that don't exist
453 * due to SPARSEMEM sections which aren't present.
454 */
455 bank_start = min(bank_start,
456 ALIGN(prev_bank_end, PAGES_PER_SECTION));
457#endif
429 /* 458 /*
430 * If we had a previous bank, and there is a space 459 * If we had a previous bank, and there is a space
431 * between the current bank and the previous, free it. 460 * between the current bank and the previous, free it.
@@ -440,6 +469,12 @@ static void __init free_unused_memmap(struct meminfo *mi)
440 */ 469 */
441 prev_bank_end = ALIGN(bank_pfn_end(bank), MAX_ORDER_NR_PAGES); 470 prev_bank_end = ALIGN(bank_pfn_end(bank), MAX_ORDER_NR_PAGES);
442 } 471 }
472
473#ifdef CONFIG_SPARSEMEM
474 if (!IS_ALIGNED(prev_bank_end, PAGES_PER_SECTION))
475 free_memmap(prev_bank_end,
476 ALIGN(prev_bank_end, PAGES_PER_SECTION));
477#endif
443} 478}
444 479
445static void __init free_highpages(void) 480static void __init free_highpages(void)
diff --git a/arch/arm/plat-mxc/epit.c b/arch/arm/plat-mxc/epit.c
index d69d343ff61f..d3467f818c33 100644
--- a/arch/arm/plat-mxc/epit.c
+++ b/arch/arm/plat-mxc/epit.c
@@ -83,26 +83,12 @@ static void epit_irq_acknowledge(void)
83 __raw_writel(EPITSR_OCIF, timer_base + EPITSR); 83 __raw_writel(EPITSR_OCIF, timer_base + EPITSR);
84} 84}
85 85
86static cycle_t epit_read(struct clocksource *cs)
87{
88 return 0 - __raw_readl(timer_base + EPITCNR);
89}
90
91static struct clocksource clocksource_epit = {
92 .name = "epit",
93 .rating = 200,
94 .read = epit_read,
95 .mask = CLOCKSOURCE_MASK(32),
96 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
97};
98
99static int __init epit_clocksource_init(struct clk *timer_clk) 86static int __init epit_clocksource_init(struct clk *timer_clk)
100{ 87{
101 unsigned int c = clk_get_rate(timer_clk); 88 unsigned int c = clk_get_rate(timer_clk);
102 89
103 clocksource_register_hz(&clocksource_epit, c); 90 return clocksource_mmio_init(timer_base + EPITCNR, "epit", c, 200, 32,
104 91 clocksource_mmio_readl_down);
105 return 0;
106} 92}
107 93
108/* clock event */ 94/* clock event */
diff --git a/arch/arm/plat-mxc/time.c b/arch/arm/plat-mxc/time.c
index 40f32e7950ae..4b0fe285e83c 100644
--- a/arch/arm/plat-mxc/time.c
+++ b/arch/arm/plat-mxc/time.c
@@ -106,56 +106,32 @@ static void gpt_irq_acknowledge(void)
106 __raw_writel(V2_TSTAT_OF1, timer_base + V2_TSTAT); 106 __raw_writel(V2_TSTAT_OF1, timer_base + V2_TSTAT);
107} 107}
108 108
109static cycle_t dummy_get_cycles(struct clocksource *cs) 109static void __iomem *sched_clock_reg;
110{
111 return 0;
112}
113
114static cycle_t mx1_2_get_cycles(struct clocksource *cs)
115{
116 return __raw_readl(timer_base + MX1_2_TCN);
117}
118
119static cycle_t v2_get_cycles(struct clocksource *cs)
120{
121 return __raw_readl(timer_base + V2_TCN);
122}
123
124static struct clocksource clocksource_mxc = {
125 .name = "mxc_timer1",
126 .rating = 200,
127 .read = dummy_get_cycles,
128 .mask = CLOCKSOURCE_MASK(32),
129 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
130};
131 110
132static DEFINE_CLOCK_DATA(cd); 111static DEFINE_CLOCK_DATA(cd);
133unsigned long long notrace sched_clock(void) 112unsigned long long notrace sched_clock(void)
134{ 113{
135 cycle_t cyc = clocksource_mxc.read(&clocksource_mxc); 114 cycle_t cyc = sched_clock_reg ? __raw_readl(sched_clock_reg) : 0;
136 115
137 return cyc_to_sched_clock(&cd, cyc, (u32)~0); 116 return cyc_to_sched_clock(&cd, cyc, (u32)~0);
138} 117}
139 118
140static void notrace mxc_update_sched_clock(void) 119static void notrace mxc_update_sched_clock(void)
141{ 120{
142 cycle_t cyc = clocksource_mxc.read(&clocksource_mxc); 121 cycle_t cyc = sched_clock_reg ? __raw_readl(sched_clock_reg) : 0;
143 update_sched_clock(&cd, cyc, (u32)~0); 122 update_sched_clock(&cd, cyc, (u32)~0);
144} 123}
145 124
146static int __init mxc_clocksource_init(struct clk *timer_clk) 125static int __init mxc_clocksource_init(struct clk *timer_clk)
147{ 126{
148 unsigned int c = clk_get_rate(timer_clk); 127 unsigned int c = clk_get_rate(timer_clk);
128 void __iomem *reg = timer_base + (timer_is_v2() ? V2_TCN : MX1_2_TCN);
149 129
150 if (timer_is_v2()) 130 sched_clock_reg = reg;
151 clocksource_mxc.read = v2_get_cycles;
152 else
153 clocksource_mxc.read = mx1_2_get_cycles;
154 131
155 init_sched_clock(&cd, mxc_update_sched_clock, 32, c); 132 init_sched_clock(&cd, mxc_update_sched_clock, 32, c);
156 clocksource_register_hz(&clocksource_mxc, c); 133 return clocksource_mmio_init(reg, "mxc_timer1", c, 200, 32,
157 134 clocksource_mmio_readl_up);
158 return 0;
159} 135}
160 136
161/* clock event */ 137/* clock event */
diff --git a/arch/arm/plat-nomadik/Kconfig b/arch/arm/plat-nomadik/Kconfig
index 187f4e84bb22..18296ee68802 100644
--- a/arch/arm/plat-nomadik/Kconfig
+++ b/arch/arm/plat-nomadik/Kconfig
@@ -5,6 +5,7 @@
5config PLAT_NOMADIK 5config PLAT_NOMADIK
6 bool 6 bool
7 depends on ARCH_NOMADIK || ARCH_U8500 7 depends on ARCH_NOMADIK || ARCH_U8500
8 select CLKSRC_MMIO
8 default y 9 default y
9 help 10 help
10 Common platform code for Nomadik and other ST-Ericsson 11 Common platform code for Nomadik and other ST-Ericsson
diff --git a/arch/arm/plat-nomadik/timer.c b/arch/arm/plat-nomadik/timer.c
index 41723402006b..ef74e157a9d5 100644
--- a/arch/arm/plat-nomadik/timer.c
+++ b/arch/arm/plat-nomadik/timer.c
@@ -26,29 +26,6 @@
26void __iomem *mtu_base; /* Assigned by machine code */ 26void __iomem *mtu_base; /* Assigned by machine code */
27 27
28/* 28/*
29 * Kernel assumes that sched_clock can be called early
30 * but the MTU may not yet be initialized.
31 */
32static cycle_t nmdk_read_timer_dummy(struct clocksource *cs)
33{
34 return 0;
35}
36
37/* clocksource: MTU decrements, so we negate the value being read. */
38static cycle_t nmdk_read_timer(struct clocksource *cs)
39{
40 return -readl(mtu_base + MTU_VAL(0));
41}
42
43static struct clocksource nmdk_clksrc = {
44 .name = "mtu_0",
45 .rating = 200,
46 .read = nmdk_read_timer_dummy,
47 .mask = CLOCKSOURCE_MASK(32),
48 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
49};
50
51/*
52 * Override the global weak sched_clock symbol with this 29 * Override the global weak sched_clock symbol with this
53 * local implementation which uses the clocksource to get some 30 * local implementation which uses the clocksource to get some
54 * better resolution when scheduling the kernel. 31 * better resolution when scheduling the kernel.
@@ -172,12 +149,10 @@ void __init nmdk_timer_init(void)
172 writel(0, mtu_base + MTU_BGLR(0)); 149 writel(0, mtu_base + MTU_BGLR(0));
173 writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(0)); 150 writel(cr | MTU_CRn_ENA, mtu_base + MTU_CR(0));
174 151
175 /* Now the clock source is ready */ 152 if (clocksource_mmio_init(mtu_base + MTU_VAL(0), "mtu_0",
176 nmdk_clksrc.read = nmdk_read_timer; 153 rate, 200, 32, clocksource_mmio_readl_down))
177
178 if (clocksource_register_hz(&nmdk_clksrc, rate))
179 pr_err("timer: failed to initialize clock source %s\n", 154 pr_err("timer: failed to initialize clock source %s\n",
180 nmdk_clksrc.name); 155 "mtu_0");
181 156
182 init_sched_clock(&cd, nomadik_update_sched_clock, 32, rate); 157 init_sched_clock(&cd, nomadik_update_sched_clock, 32, rate);
183 158
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index 29b4c35adb0f..49a4c75243fc 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -12,6 +12,7 @@ choice
12config ARCH_OMAP1 12config ARCH_OMAP1
13 bool "TI OMAP1" 13 bool "TI OMAP1"
14 select CLKDEV_LOOKUP 14 select CLKDEV_LOOKUP
15 select CLKSRC_MMIO
15 help 16 help
16 "Systems based on omap7xx, omap15xx or omap16xx" 17 "Systems based on omap7xx, omap15xx or omap16xx"
17 18
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index a2478ebb53fa..efb869390199 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -17,7 +17,7 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/sysdev.h> 20#include <linux/syscore_ops.h>
21#include <linux/err.h> 21#include <linux/err.h>
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/io.h> 23#include <linux/io.h>
@@ -1373,9 +1373,7 @@ static const struct dev_pm_ops omap_mpuio_dev_pm_ops = {
1373 .resume_noirq = omap_mpuio_resume_noirq, 1373 .resume_noirq = omap_mpuio_resume_noirq,
1374}; 1374};
1375 1375
1376/* use platform_driver for this, now that there's no longer any 1376/* use platform_driver for this. */
1377 * point to sys_device (other than not disturbing old code).
1378 */
1379static struct platform_driver omap_mpuio_driver = { 1377static struct platform_driver omap_mpuio_driver = {
1380 .driver = { 1378 .driver = {
1381 .name = "mpuio", 1379 .name = "mpuio",
@@ -1746,7 +1744,7 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
1746} 1744}
1747 1745
1748#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS) 1746#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS)
1749static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg) 1747static int omap_gpio_suspend(void)
1750{ 1748{
1751 int i; 1749 int i;
1752 1750
@@ -1796,12 +1794,12 @@ static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg)
1796 return 0; 1794 return 0;
1797} 1795}
1798 1796
1799static int omap_gpio_resume(struct sys_device *dev) 1797static void omap_gpio_resume(void)
1800{ 1798{
1801 int i; 1799 int i;
1802 1800
1803 if (!cpu_class_is_omap2() && !cpu_is_omap16xx()) 1801 if (!cpu_class_is_omap2() && !cpu_is_omap16xx())
1804 return 0; 1802 return;
1805 1803
1806 for (i = 0; i < gpio_bank_count; i++) { 1804 for (i = 0; i < gpio_bank_count; i++) {
1807 struct gpio_bank *bank = &gpio_bank[i]; 1805 struct gpio_bank *bank = &gpio_bank[i];
@@ -1837,21 +1835,13 @@ static int omap_gpio_resume(struct sys_device *dev)
1837 __raw_writel(bank->saved_wakeup, wake_set); 1835 __raw_writel(bank->saved_wakeup, wake_set);
1838 spin_unlock_irqrestore(&bank->lock, flags); 1836 spin_unlock_irqrestore(&bank->lock, flags);
1839 } 1837 }
1840
1841 return 0;
1842} 1838}
1843 1839
1844static struct sysdev_class omap_gpio_sysclass = { 1840static struct syscore_ops omap_gpio_syscore_ops = {
1845 .name = "gpio",
1846 .suspend = omap_gpio_suspend, 1841 .suspend = omap_gpio_suspend,
1847 .resume = omap_gpio_resume, 1842 .resume = omap_gpio_resume,
1848}; 1843};
1849 1844
1850static struct sys_device omap_gpio_device = {
1851 .id = 0,
1852 .cls = &omap_gpio_sysclass,
1853};
1854
1855#endif 1845#endif
1856 1846
1857#ifdef CONFIG_ARCH_OMAP2PLUS 1847#ifdef CONFIG_ARCH_OMAP2PLUS
@@ -2109,21 +2099,14 @@ postcore_initcall(omap_gpio_drv_reg);
2109 2099
2110static int __init omap_gpio_sysinit(void) 2100static int __init omap_gpio_sysinit(void)
2111{ 2101{
2112 int ret = 0;
2113
2114 mpuio_init(); 2102 mpuio_init();
2115 2103
2116#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS) 2104#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS)
2117 if (cpu_is_omap16xx() || cpu_class_is_omap2()) { 2105 if (cpu_is_omap16xx() || cpu_class_is_omap2())
2118 if (ret == 0) { 2106 register_syscore_ops(&omap_gpio_syscore_ops);
2119 ret = sysdev_class_register(&omap_gpio_sysclass);
2120 if (ret == 0)
2121 ret = sysdev_register(&omap_gpio_device);
2122 }
2123 }
2124#endif 2107#endif
2125 2108
2126 return ret; 2109 return 0;
2127} 2110}
2128 2111
2129arch_initcall(omap_gpio_sysinit); 2112arch_initcall(omap_gpio_sysinit);
diff --git a/arch/arm/plat-omap/include/plat/flash.h b/arch/arm/plat-omap/include/plat/flash.h
index 3e6327016b40..3083195123ea 100644
--- a/arch/arm/plat-omap/include/plat/flash.h
+++ b/arch/arm/plat-omap/include/plat/flash.h
@@ -11,6 +11,6 @@
11 11
12#include <linux/mtd/map.h> 12#include <linux/mtd/map.h>
13 13
14extern void omap1_set_vpp(struct map_info *map, int enable); 14extern void omap1_set_vpp(struct platform_device *pdev, int enable);
15 15
16#endif 16#endif
diff --git a/arch/arm/plat-omap/include/plat/smp.h b/arch/arm/plat-omap/include/plat/smp.h
deleted file mode 100644
index 7a10257909ef..000000000000
--- a/arch/arm/plat-omap/include/plat/smp.h
+++ /dev/null
@@ -1,36 +0,0 @@
1/*
2 * OMAP4 machine specific smp.h
3 *
4 * Copyright (C) 2009 Texas Instruments, Inc.
5 *
6 * Author:
7 * Santosh Shilimkar <santosh.shilimkar@ti.com>
8 *
9 * Interface functions needed for the SMP. This file is based on arm
10 * realview smp platform.
11 * Copyright (c) 2003 ARM Limited.
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16 */
17#ifndef OMAP_ARCH_SMP_H
18#define OMAP_ARCH_SMP_H
19
20#include <asm/hardware/gic.h>
21
22/* Needed for secondary core boot */
23extern void omap_secondary_startup(void);
24extern u32 omap_modify_auxcoreboot0(u32 set_mask, u32 clear_mask);
25extern void omap_auxcoreboot_addr(u32 cpu_addr);
26extern u32 omap_read_auxcoreboot0(void);
27
28/*
29 * We use Soft IRQ1 as the IPI
30 */
31static inline void smp_cross_call(const struct cpumask *mask, int ipi)
32{
33 gic_raise_softirq(mask, ipi);
34}
35
36#endif
diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c
index 8a51fd58f656..34fc31ee9081 100644
--- a/arch/arm/plat-omap/iommu.c
+++ b/arch/arm/plat-omap/iommu.c
@@ -793,6 +793,8 @@ static irqreturn_t iommu_fault_handler(int irq, void *data)
793 clk_enable(obj->clk); 793 clk_enable(obj->clk);
794 errs = iommu_report_fault(obj, &da); 794 errs = iommu_report_fault(obj, &da);
795 clk_disable(obj->clk); 795 clk_disable(obj->clk);
796 if (errs == 0)
797 return IRQ_HANDLED;
796 798
797 /* Fault callback or TLB/PTE Dynamic loading */ 799 /* Fault callback or TLB/PTE Dynamic loading */
798 if (obj->isr && !obj->isr(obj, da, errs, obj->isr_priv)) 800 if (obj->isr && !obj->isr(obj, da, errs, obj->isr_priv))
diff --git a/arch/arm/plat-omap/omap_device.c b/arch/arm/plat-omap/omap_device.c
index 9bbda9acb73b..a37b8eb65b76 100644
--- a/arch/arm/plat-omap/omap_device.c
+++ b/arch/arm/plat-omap/omap_device.c
@@ -536,6 +536,28 @@ int omap_early_device_register(struct omap_device *od)
536 return 0; 536 return 0;
537} 537}
538 538
539static int _od_runtime_suspend(struct device *dev)
540{
541 struct platform_device *pdev = to_platform_device(dev);
542
543 return omap_device_idle(pdev);
544}
545
546static int _od_runtime_resume(struct device *dev)
547{
548 struct platform_device *pdev = to_platform_device(dev);
549
550 return omap_device_enable(pdev);
551}
552
553static struct dev_power_domain omap_device_power_domain = {
554 .ops = {
555 .runtime_suspend = _od_runtime_suspend,
556 .runtime_resume = _od_runtime_resume,
557 USE_PLATFORM_PM_SLEEP_OPS
558 }
559};
560
539/** 561/**
540 * omap_device_register - register an omap_device with one omap_hwmod 562 * omap_device_register - register an omap_device with one omap_hwmod
541 * @od: struct omap_device * to register 563 * @od: struct omap_device * to register
@@ -549,6 +571,7 @@ int omap_device_register(struct omap_device *od)
549 pr_debug("omap_device: %s: registering\n", od->pdev.name); 571 pr_debug("omap_device: %s: registering\n", od->pdev.name);
550 572
551 od->pdev.dev.parent = &omap_device_parent; 573 od->pdev.dev.parent = &omap_device_parent;
574 od->pdev.dev.pwr_domain = &omap_device_power_domain;
552 return platform_device_register(&od->pdev); 575 return platform_device_register(&od->pdev);
553} 576}
554 577
diff --git a/arch/arm/plat-orion/time.c b/arch/arm/plat-orion/time.c
index 742b0323c57b..69a61367e4b8 100644
--- a/arch/arm/plat-orion/time.c
+++ b/arch/arm/plat-orion/time.c
@@ -81,24 +81,6 @@ static void __init setup_sched_clock(unsigned long tclk)
81} 81}
82 82
83/* 83/*
84 * Clocksource handling.
85 */
86static cycle_t orion_clksrc_read(struct clocksource *cs)
87{
88 return 0xffffffff - readl(timer_base + TIMER0_VAL_OFF);
89}
90
91static struct clocksource orion_clksrc = {
92 .name = "orion_clocksource",
93 .rating = 300,
94 .read = orion_clksrc_read,
95 .mask = CLOCKSOURCE_MASK(32),
96 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
97};
98
99
100
101/*
102 * Clockevent handling. 84 * Clockevent handling.
103 */ 85 */
104static int 86static int
@@ -247,7 +229,8 @@ orion_time_init(u32 _bridge_base, u32 _bridge_timer1_clr_mask,
247 writel(u & ~BRIDGE_INT_TIMER0, bridge_base + BRIDGE_MASK_OFF); 229 writel(u & ~BRIDGE_INT_TIMER0, bridge_base + BRIDGE_MASK_OFF);
248 u = readl(timer_base + TIMER_CTRL_OFF); 230 u = readl(timer_base + TIMER_CTRL_OFF);
249 writel(u | TIMER0_EN | TIMER0_RELOAD_EN, timer_base + TIMER_CTRL_OFF); 231 writel(u | TIMER0_EN | TIMER0_RELOAD_EN, timer_base + TIMER_CTRL_OFF);
250 clocksource_register_hz(&orion_clksrc, tclk); 232 clocksource_mmio_init(timer_base + TIMER0_VAL_OFF, "orion_clocksource",
233 tclk, 300, 32, clocksource_mmio_readl_down);
251 234
252 /* 235 /*
253 * Setup clockevent timer (interrupt-driven). 236 * Setup clockevent timer (interrupt-driven).
diff --git a/arch/arm/plat-pxa/gpio.c b/arch/arm/plat-pxa/gpio.c
index dce088f45678..48ebb9479b61 100644
--- a/arch/arm/plat-pxa/gpio.c
+++ b/arch/arm/plat-pxa/gpio.c
@@ -15,7 +15,7 @@
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/irq.h> 16#include <linux/irq.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/sysdev.h> 18#include <linux/syscore_ops.h>
19#include <linux/slab.h> 19#include <linux/slab.h>
20 20
21#include <mach/gpio.h> 21#include <mach/gpio.h>
@@ -295,7 +295,7 @@ void __init pxa_init_gpio(int mux_irq, int start, int end, set_wake_t fn)
295} 295}
296 296
297#ifdef CONFIG_PM 297#ifdef CONFIG_PM
298static int pxa_gpio_suspend(struct sys_device *dev, pm_message_t state) 298static int pxa_gpio_suspend(void)
299{ 299{
300 struct pxa_gpio_chip *c; 300 struct pxa_gpio_chip *c;
301 int gpio; 301 int gpio;
@@ -312,7 +312,7 @@ static int pxa_gpio_suspend(struct sys_device *dev, pm_message_t state)
312 return 0; 312 return 0;
313} 313}
314 314
315static int pxa_gpio_resume(struct sys_device *dev) 315static void pxa_gpio_resume(void)
316{ 316{
317 struct pxa_gpio_chip *c; 317 struct pxa_gpio_chip *c;
318 int gpio; 318 int gpio;
@@ -326,22 +326,13 @@ static int pxa_gpio_resume(struct sys_device *dev)
326 __raw_writel(c->saved_gfer, c->regbase + GFER_OFFSET); 326 __raw_writel(c->saved_gfer, c->regbase + GFER_OFFSET);
327 __raw_writel(c->saved_gpdr, c->regbase + GPDR_OFFSET); 327 __raw_writel(c->saved_gpdr, c->regbase + GPDR_OFFSET);
328 } 328 }
329 return 0;
330} 329}
331#else 330#else
332#define pxa_gpio_suspend NULL 331#define pxa_gpio_suspend NULL
333#define pxa_gpio_resume NULL 332#define pxa_gpio_resume NULL
334#endif 333#endif
335 334
336struct sysdev_class pxa_gpio_sysclass = { 335struct syscore_ops pxa_gpio_syscore_ops = {
337 .name = "gpio",
338 .suspend = pxa_gpio_suspend, 336 .suspend = pxa_gpio_suspend,
339 .resume = pxa_gpio_resume, 337 .resume = pxa_gpio_resume,
340}; 338};
341
342static int __init pxa_gpio_init(void)
343{
344 return sysdev_class_register(&pxa_gpio_sysclass);
345}
346
347core_initcall(pxa_gpio_init);
diff --git a/arch/arm/plat-pxa/mfp.c b/arch/arm/plat-pxa/mfp.c
index a9aa5ad3f4eb..be12eadcce20 100644
--- a/arch/arm/plat-pxa/mfp.c
+++ b/arch/arm/plat-pxa/mfp.c
@@ -17,7 +17,6 @@
17#include <linux/kernel.h> 17#include <linux/kernel.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/sysdev.h>
21 20
22#include <plat/mfp.h> 21#include <plat/mfp.h>
23 22
diff --git a/arch/arm/plat-s3c24xx/dma.c b/arch/arm/plat-s3c24xx/dma.c
index 27ea852e3370..c10d10c56e2e 100644
--- a/arch/arm/plat-s3c24xx/dma.c
+++ b/arch/arm/plat-s3c24xx/dma.c
@@ -22,7 +22,7 @@
22#include <linux/sched.h> 22#include <linux/sched.h>
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <linux/interrupt.h> 24#include <linux/interrupt.h>
25#include <linux/sysdev.h> 25#include <linux/syscore_ops.h>
26#include <linux/slab.h> 26#include <linux/slab.h>
27#include <linux/errno.h> 27#include <linux/errno.h>
28#include <linux/io.h> 28#include <linux/io.h>
@@ -1195,19 +1195,12 @@ int s3c2410_dma_getposition(unsigned int channel, dma_addr_t *src, dma_addr_t *d
1195 1195
1196EXPORT_SYMBOL(s3c2410_dma_getposition); 1196EXPORT_SYMBOL(s3c2410_dma_getposition);
1197 1197
1198static inline struct s3c2410_dma_chan *to_dma_chan(struct sys_device *dev) 1198/* system core operations */
1199{
1200 return container_of(dev, struct s3c2410_dma_chan, dev);
1201}
1202
1203/* system device class */
1204 1199
1205#ifdef CONFIG_PM 1200#ifdef CONFIG_PM
1206 1201
1207static int s3c2410_dma_suspend(struct sys_device *dev, pm_message_t state) 1202static void s3c2410_dma_suspend_chan(s3c2410_dma_chan *cp)
1208{ 1203{
1209 struct s3c2410_dma_chan *cp = to_dma_chan(dev);
1210
1211 printk(KERN_DEBUG "suspending dma channel %d\n", cp->number); 1204 printk(KERN_DEBUG "suspending dma channel %d\n", cp->number);
1212 1205
1213 if (dma_rdreg(cp, S3C2410_DMA_DMASKTRIG) & S3C2410_DMASKTRIG_ON) { 1206 if (dma_rdreg(cp, S3C2410_DMA_DMASKTRIG) & S3C2410_DMASKTRIG_ON) {
@@ -1222,13 +1215,21 @@ static int s3c2410_dma_suspend(struct sys_device *dev, pm_message_t state)
1222 1215
1223 s3c2410_dma_dostop(cp); 1216 s3c2410_dma_dostop(cp);
1224 } 1217 }
1218}
1219
1220static int s3c2410_dma_suspend(void)
1221{
1222 struct s3c2410_dma_chan *cp = s3c2410_chans;
1223 int channel;
1224
1225 for (channel = 0; channel < dma_channels; cp++, channel++)
1226 s3c2410_dma_suspend_chan(cp);
1225 1227
1226 return 0; 1228 return 0;
1227} 1229}
1228 1230
1229static int s3c2410_dma_resume(struct sys_device *dev) 1231static void s3c2410_dma_resume_chan(struct s3c2410_dma_chan *cp)
1230{ 1232{
1231 struct s3c2410_dma_chan *cp = to_dma_chan(dev);
1232 unsigned int no = cp->number | DMACH_LOW_LEVEL; 1233 unsigned int no = cp->number | DMACH_LOW_LEVEL;
1233 1234
1234 /* restore channel's hardware configuration */ 1235 /* restore channel's hardware configuration */
@@ -1249,13 +1250,21 @@ static int s3c2410_dma_resume(struct sys_device *dev)
1249 return 0; 1250 return 0;
1250} 1251}
1251 1252
1253static void s3c2410_dma_resume(void)
1254{
1255 struct s3c2410_dma_chan *cp = s3c2410_chans + dma_channels - 1;
1256 int channel;
1257
1258 for (channel = dma_channels - 1; channel >= 0; cp++, channel--)
1259 s3c2410_dma_resume_chan(cp);
1260}
1261
1252#else 1262#else
1253#define s3c2410_dma_suspend NULL 1263#define s3c2410_dma_suspend NULL
1254#define s3c2410_dma_resume NULL 1264#define s3c2410_dma_resume NULL
1255#endif /* CONFIG_PM */ 1265#endif /* CONFIG_PM */
1256 1266
1257struct sysdev_class dma_sysclass = { 1267struct syscore_ops dma_syscore_ops = {
1258 .name = "s3c24xx-dma",
1259 .suspend = s3c2410_dma_suspend, 1268 .suspend = s3c2410_dma_suspend,
1260 .resume = s3c2410_dma_resume, 1269 .resume = s3c2410_dma_resume,
1261}; 1270};
@@ -1269,39 +1278,14 @@ static void s3c2410_dma_cache_ctor(void *p)
1269 1278
1270/* initialisation code */ 1279/* initialisation code */
1271 1280
1272static int __init s3c24xx_dma_sysclass_init(void) 1281static int __init s3c24xx_dma_syscore_init(void)
1273{ 1282{
1274 int ret = sysdev_class_register(&dma_sysclass); 1283 register_syscore_ops(&dma_syscore_ops);
1275
1276 if (ret != 0)
1277 printk(KERN_ERR "dma sysclass registration failed\n");
1278
1279 return ret;
1280}
1281
1282core_initcall(s3c24xx_dma_sysclass_init);
1283
1284static int __init s3c24xx_dma_sysdev_register(void)
1285{
1286 struct s3c2410_dma_chan *cp = s3c2410_chans;
1287 int channel, ret;
1288
1289 for (channel = 0; channel < dma_channels; cp++, channel++) {
1290 cp->dev.cls = &dma_sysclass;
1291 cp->dev.id = channel;
1292 ret = sysdev_register(&cp->dev);
1293
1294 if (ret) {
1295 printk(KERN_ERR "error registering dev for dma %d\n",
1296 channel);
1297 return ret;
1298 }
1299 }
1300 1284
1301 return 0; 1285 return 0;
1302} 1286}
1303 1287
1304late_initcall(s3c24xx_dma_sysdev_register); 1288late_initcall(s3c24xx_dma_syscore_init);
1305 1289
1306int __init s3c24xx_dma_init(unsigned int channels, unsigned int irq, 1290int __init s3c24xx_dma_init(unsigned int channels, unsigned int irq,
1307 unsigned int stride) 1291 unsigned int stride)
diff --git a/arch/arm/plat-s3c24xx/irq-pm.c b/arch/arm/plat-s3c24xx/irq-pm.c
index c3624d898630..0efb2e2848c8 100644
--- a/arch/arm/plat-s3c24xx/irq-pm.c
+++ b/arch/arm/plat-s3c24xx/irq-pm.c
@@ -14,7 +14,6 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/interrupt.h> 16#include <linux/interrupt.h>
17#include <linux/sysdev.h>
18#include <linux/irq.h> 17#include <linux/irq.h>
19 18
20#include <plat/cpu.h> 19#include <plat/cpu.h>
@@ -65,7 +64,7 @@ static unsigned long save_extint[3];
65static unsigned long save_eintflt[4]; 64static unsigned long save_eintflt[4];
66static unsigned long save_eintmask; 65static unsigned long save_eintmask;
67 66
68int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state) 67int s3c24xx_irq_suspend(void)
69{ 68{
70 unsigned int i; 69 unsigned int i;
71 70
@@ -81,7 +80,7 @@ int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state)
81 return 0; 80 return 0;
82} 81}
83 82
84int s3c24xx_irq_resume(struct sys_device *dev) 83void s3c24xx_irq_resume(void)
85{ 84{
86 unsigned int i; 85 unsigned int i;
87 86
@@ -93,6 +92,4 @@ int s3c24xx_irq_resume(struct sys_device *dev)
93 92
94 s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save)); 93 s3c_pm_do_restore(irq_save, ARRAY_SIZE(irq_save));
95 __raw_writel(save_eintmask, S3C24XX_EINTMASK); 94 __raw_writel(save_eintmask, S3C24XX_EINTMASK);
96
97 return 0;
98} 95}
diff --git a/arch/arm/plat-s5p/irq-pm.c b/arch/arm/plat-s5p/irq-pm.c
index 5259ad458bc8..327acb3a4464 100644
--- a/arch/arm/plat-s5p/irq-pm.c
+++ b/arch/arm/plat-s5p/irq-pm.c
@@ -16,7 +16,6 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/module.h> 17#include <linux/module.h>
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/sysdev.h>
20 19
21#include <plat/cpu.h> 20#include <plat/cpu.h>
22#include <plat/irqs.h> 21#include <plat/irqs.h>
@@ -77,17 +76,15 @@ static struct sleep_save eint_save[] = {
77 SAVE_ITEM(S5P_EINT_MASK(3)), 76 SAVE_ITEM(S5P_EINT_MASK(3)),
78}; 77};
79 78
80int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state) 79int s3c24xx_irq_suspend(void)
81{ 80{
82 s3c_pm_do_save(eint_save, ARRAY_SIZE(eint_save)); 81 s3c_pm_do_save(eint_save, ARRAY_SIZE(eint_save));
83 82
84 return 0; 83 return 0;
85} 84}
86 85
87int s3c24xx_irq_resume(struct sys_device *dev) 86void s3c24xx_irq_resume(void)
88{ 87{
89 s3c_pm_do_restore(eint_save, ARRAY_SIZE(eint_save)); 88 s3c_pm_do_restore(eint_save, ARRAY_SIZE(eint_save));
90
91 return 0;
92} 89}
93 90
diff --git a/arch/arm/plat-s5p/s5p-time.c b/arch/arm/plat-s5p/s5p-time.c
index 8090403eec0f..899a8cc011ff 100644
--- a/arch/arm/plat-s5p/s5p-time.c
+++ b/arch/arm/plat-s5p/s5p-time.c
@@ -290,7 +290,7 @@ static void __init s5p_clockevent_init(void)
290 setup_irq(irq_number, &s5p_clock_event_irq); 290 setup_irq(irq_number, &s5p_clock_event_irq);
291} 291}
292 292
293static cycle_t s5p_timer_read(struct clocksource *cs) 293static void __iomem *s5p_timer_reg(void)
294{ 294{
295 unsigned long offset = 0; 295 unsigned long offset = 0;
296 296
@@ -308,10 +308,17 @@ static cycle_t s5p_timer_read(struct clocksource *cs)
308 308
309 default: 309 default:
310 printk(KERN_ERR "Invalid Timer %d\n", timer_source.source_id); 310 printk(KERN_ERR "Invalid Timer %d\n", timer_source.source_id);
311 return 0; 311 return NULL;
312 } 312 }
313 313
314 return (cycle_t) ~__raw_readl(S3C_TIMERREG(offset)); 314 return S3C_TIMERREG(offset);
315}
316
317static cycle_t s5p_timer_read(struct clocksource *cs)
318{
319 void __iomem *reg = s5p_timer_reg();
320
321 return (cycle_t) (reg ? ~__raw_readl(reg) : 0);
315} 322}
316 323
317/* 324/*
@@ -325,53 +332,22 @@ static DEFINE_CLOCK_DATA(cd);
325 332
326unsigned long long notrace sched_clock(void) 333unsigned long long notrace sched_clock(void)
327{ 334{
328 u32 cyc; 335 void __iomem *reg = s5p_timer_reg();
329 unsigned long offset = 0;
330
331 switch (timer_source.source_id) {
332 case S5P_PWM0:
333 case S5P_PWM1:
334 case S5P_PWM2:
335 case S5P_PWM3:
336 offset = (timer_source.source_id * 0x0c) + 0x14;
337 break;
338
339 case S5P_PWM4:
340 offset = 0x40;
341 break;
342 336
343 default: 337 if (!reg)
344 printk(KERN_ERR "Invalid Timer %d\n", timer_source.source_id);
345 return 0; 338 return 0;
346 }
347 339
348 cyc = ~__raw_readl(S3C_TIMERREG(offset)); 340 return cyc_to_sched_clock(&cd, ~__raw_readl(reg), (u32)~0);
349 return cyc_to_sched_clock(&cd, cyc, (u32)~0);
350} 341}
351 342
352static void notrace s5p_update_sched_clock(void) 343static void notrace s5p_update_sched_clock(void)
353{ 344{
354 u32 cyc; 345 void __iomem *reg = s5p_timer_reg();
355 unsigned long offset = 0;
356 346
357 switch (timer_source.source_id) { 347 if (!reg)
358 case S5P_PWM0: 348 return;
359 case S5P_PWM1:
360 case S5P_PWM2:
361 case S5P_PWM3:
362 offset = (timer_source.source_id * 0x0c) + 0x14;
363 break;
364
365 case S5P_PWM4:
366 offset = 0x40;
367 break;
368
369 default:
370 printk(KERN_ERR "Invalid Timer %d\n", timer_source.source_id);
371 }
372 349
373 cyc = ~__raw_readl(S3C_TIMERREG(offset)); 350 update_sched_clock(&cd, ~__raw_readl(reg), (u32)~0);
374 update_sched_clock(&cd, cyc, (u32)~0);
375} 351}
376 352
377struct clocksource time_clocksource = { 353struct clocksource time_clocksource = {
diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h
index cedfff51c82b..3aedac0034ba 100644
--- a/arch/arm/plat-samsung/include/plat/cpu.h
+++ b/arch/arm/plat-samsung/include/plat/cpu.h
@@ -68,6 +68,12 @@ extern void s3c24xx_init_uartdevs(char *name,
68struct sys_timer; 68struct sys_timer;
69extern struct sys_timer s3c24xx_timer; 69extern struct sys_timer s3c24xx_timer;
70 70
71extern struct syscore_ops s3c2410_pm_syscore_ops;
72extern struct syscore_ops s3c2412_pm_syscore_ops;
73extern struct syscore_ops s3c2416_pm_syscore_ops;
74extern struct syscore_ops s3c244x_pm_syscore_ops;
75extern struct syscore_ops s3c64xx_irq_syscore_ops;
76
71/* system device classes */ 77/* system device classes */
72 78
73extern struct sysdev_class s3c2410_sysclass; 79extern struct sysdev_class s3c2410_sysclass;
diff --git a/arch/arm/plat-samsung/include/plat/pm.h b/arch/arm/plat-samsung/include/plat/pm.h
index 937cc2ace517..7fb6f6be8c81 100644
--- a/arch/arm/plat-samsung/include/plat/pm.h
+++ b/arch/arm/plat-samsung/include/plat/pm.h
@@ -103,14 +103,16 @@ extern void s3c_pm_do_restore_core(struct sleep_save *ptr, int count);
103 103
104#ifdef CONFIG_PM 104#ifdef CONFIG_PM
105extern int s3c_irqext_wake(struct irq_data *data, unsigned int state); 105extern int s3c_irqext_wake(struct irq_data *data, unsigned int state);
106extern int s3c24xx_irq_suspend(struct sys_device *dev, pm_message_t state); 106extern int s3c24xx_irq_suspend(void);
107extern int s3c24xx_irq_resume(struct sys_device *dev); 107extern void s3c24xx_irq_resume(void);
108#else 108#else
109#define s3c_irqext_wake NULL 109#define s3c_irqext_wake NULL
110#define s3c24xx_irq_suspend NULL 110#define s3c24xx_irq_suspend NULL
111#define s3c24xx_irq_resume NULL 111#define s3c24xx_irq_resume NULL
112#endif 112#endif
113 113
114extern struct syscore_ops s3c24xx_irq_syscore_ops;
115
114/* PM debug functions */ 116/* PM debug functions */
115 117
116#ifdef CONFIG_SAMSUNG_PM_DEBUG 118#ifdef CONFIG_SAMSUNG_PM_DEBUG
diff --git a/arch/arm/plat-spear/clock.c b/arch/arm/plat-spear/clock.c
index bdbd7ec9cb6b..6fa474cb398e 100644
--- a/arch/arm/plat-spear/clock.c
+++ b/arch/arm/plat-spear/clock.c
@@ -903,6 +903,11 @@ void recalc_root_clocks(void)
903 spin_unlock_irqrestore(&clocks_lock, flags); 903 spin_unlock_irqrestore(&clocks_lock, flags);
904} 904}
905 905
906void __init clk_init(void)
907{
908 recalc_root_clocks();
909}
910
906#ifdef CONFIG_DEBUG_FS 911#ifdef CONFIG_DEBUG_FS
907/* 912/*
908 * debugfs support to trace clock tree hierarchy and attributes 913 * debugfs support to trace clock tree hierarchy and attributes
diff --git a/arch/arm/plat-spear/include/plat/clock.h b/arch/arm/plat-spear/include/plat/clock.h
index fcc0d0ad4a1f..0062bafef12d 100644
--- a/arch/arm/plat-spear/include/plat/clock.h
+++ b/arch/arm/plat-spear/include/plat/clock.h
@@ -224,6 +224,7 @@ struct clcd_rate_tbl {
224}; 224};
225 225
226/* platform specific clock functions */ 226/* platform specific clock functions */
227void __init clk_init(void);
227void clk_register(struct clk_lookup *cl); 228void clk_register(struct clk_lookup *cl);
228void recalc_root_clocks(void); 229void recalc_root_clocks(void);
229 230
diff --git a/arch/arm/plat-spear/time.c b/arch/arm/plat-spear/time.c
index dbb6e4fff79d..0c77e4298675 100644
--- a/arch/arm/plat-spear/time.c
+++ b/arch/arm/plat-spear/time.c
@@ -70,19 +70,6 @@ static void clockevent_set_mode(enum clock_event_mode mode,
70static int clockevent_next_event(unsigned long evt, 70static int clockevent_next_event(unsigned long evt,
71 struct clock_event_device *clk_event_dev); 71 struct clock_event_device *clk_event_dev);
72 72
73static cycle_t clocksource_read_cycles(struct clocksource *cs)
74{
75 return (cycle_t) readw(gpt_base + COUNT(CLKSRC));
76}
77
78static struct clocksource clksrc = {
79 .name = "tmr1",
80 .rating = 200, /* its a pretty decent clock */
81 .read = clocksource_read_cycles,
82 .mask = 0xFFFF, /* 16 bits */
83 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
84};
85
86static void spear_clocksource_init(void) 73static void spear_clocksource_init(void)
87{ 74{
88 u32 tick_rate; 75 u32 tick_rate;
@@ -103,7 +90,8 @@ static void spear_clocksource_init(void)
103 writew(val, gpt_base + CR(CLKSRC)); 90 writew(val, gpt_base + CR(CLKSRC));
104 91
105 /* register the clocksource */ 92 /* register the clocksource */
106 clocksource_register_hz(&clksrc, tick_rate); 93 clocksource_mmio_init(gpt_base + COUNT(CLKSRC), "tmr1", tick_rate,
94 200, 16, clocksource_mmio_readw_up);
107} 95}
108 96
109static struct clock_event_device clkevt = { 97static struct clock_event_device clkevt = {
diff --git a/arch/arm/plat-stmp3xxx/Kconfig b/arch/arm/plat-stmp3xxx/Kconfig
deleted file mode 100644
index 2cf37c35951b..000000000000
--- a/arch/arm/plat-stmp3xxx/Kconfig
+++ /dev/null
@@ -1,37 +0,0 @@
1if ARCH_STMP3XXX
2
3menu "Freescale STMP3xxx implementations"
4
5choice
6 prompt "Select STMP3xxx chip family"
7
8config ARCH_STMP37XX
9 bool "Freescale SMTP37xx"
10 select CPU_ARM926T
11 ---help---
12 STMP37xx refers to 3700 through 3769 chips
13
14config ARCH_STMP378X
15 bool "Freescale STMP378x"
16 select CPU_ARM926T
17 ---help---
18 STMP378x refers to 3780 through 3789 chips
19
20endchoice
21
22choice
23 prompt "Select STMP3xxx board type"
24
25config MACH_STMP37XX
26 depends on ARCH_STMP37XX
27 bool "Freescale STMP37xx development board"
28
29config MACH_STMP378X
30 depends on ARCH_STMP378X
31 bool "Freescale STMP378x development board"
32
33endchoice
34
35endmenu
36
37endif
diff --git a/arch/arm/plat-stmp3xxx/Makefile b/arch/arm/plat-stmp3xxx/Makefile
deleted file mode 100644
index 31dd518f37a5..000000000000
--- a/arch/arm/plat-stmp3xxx/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
1#
2# Makefile for the linux kernel.
3#
4# Object file lists.
5obj-y += core.o timer.o irq.o dma.o clock.o pinmux.o devices.o
diff --git a/arch/arm/plat-stmp3xxx/clock.c b/arch/arm/plat-stmp3xxx/clock.c
deleted file mode 100644
index 2e712e17ce72..000000000000
--- a/arch/arm/plat-stmp3xxx/clock.c
+++ /dev/null
@@ -1,1134 +0,0 @@
1/*
2 * Clock manipulation routines for Freescale STMP37XX/STMP378X
3 *
4 * Author: Vitaly Wool <vital@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#define DEBUG
19#include <linux/kernel.h>
20#include <linux/module.h>
21#include <linux/init.h>
22#include <linux/clk.h>
23#include <linux/spinlock.h>
24#include <linux/errno.h>
25#include <linux/err.h>
26#include <linux/delay.h>
27#include <linux/io.h>
28#include <linux/clkdev.h>
29
30#include <asm/mach-types.h>
31#include <mach/platform.h>
32#include <mach/regs-clkctrl.h>
33
34#include "clock.h"
35
36static DEFINE_SPINLOCK(clocks_lock);
37
38static struct clk osc_24M;
39static struct clk pll_clk;
40static struct clk cpu_clk;
41static struct clk hclk;
42
43static int propagate_rate(struct clk *);
44
45static inline int clk_is_busy(struct clk *clk)
46{
47 return __raw_readl(clk->busy_reg) & (1 << clk->busy_bit);
48}
49
50static inline int clk_good(struct clk *clk)
51{
52 return clk && !IS_ERR(clk) && clk->ops;
53}
54
55static int std_clk_enable(struct clk *clk)
56{
57 if (clk->enable_reg) {
58 u32 clk_reg = __raw_readl(clk->enable_reg);
59 if (clk->enable_negate)
60 clk_reg &= ~(1 << clk->enable_shift);
61 else
62 clk_reg |= (1 << clk->enable_shift);
63 __raw_writel(clk_reg, clk->enable_reg);
64 if (clk->enable_wait)
65 udelay(clk->enable_wait);
66 return 0;
67 } else
68 return -EINVAL;
69}
70
71static int std_clk_disable(struct clk *clk)
72{
73 if (clk->enable_reg) {
74 u32 clk_reg = __raw_readl(clk->enable_reg);
75 if (clk->enable_negate)
76 clk_reg |= (1 << clk->enable_shift);
77 else
78 clk_reg &= ~(1 << clk->enable_shift);
79 __raw_writel(clk_reg, clk->enable_reg);
80 return 0;
81 } else
82 return -EINVAL;
83}
84
85static int io_set_rate(struct clk *clk, u32 rate)
86{
87 u32 reg_frac, clkctrl_frac;
88 int i, ret = 0, mask = 0x1f;
89
90 clkctrl_frac = (clk->parent->rate * 18 + rate - 1) / rate;
91
92 if (clkctrl_frac < 18 || clkctrl_frac > 35) {
93 ret = -EINVAL;
94 goto out;
95 }
96
97 reg_frac = __raw_readl(clk->scale_reg);
98 reg_frac &= ~(mask << clk->scale_shift);
99 __raw_writel(reg_frac | (clkctrl_frac << clk->scale_shift),
100 clk->scale_reg);
101 if (clk->busy_reg) {
102 for (i = 10000; i; i--)
103 if (!clk_is_busy(clk))
104 break;
105 if (!i)
106 ret = -ETIMEDOUT;
107 else
108 ret = 0;
109 }
110out:
111 return ret;
112}
113
114static long io_get_rate(struct clk *clk)
115{
116 long rate = clk->parent->rate * 18;
117 int mask = 0x1f;
118
119 rate /= (__raw_readl(clk->scale_reg) >> clk->scale_shift) & mask;
120 clk->rate = rate;
121
122 return rate;
123}
124
125static long per_get_rate(struct clk *clk)
126{
127 long rate = clk->parent->rate;
128 long div;
129 const int mask = 0xff;
130
131 if (clk->enable_reg &&
132 !(__raw_readl(clk->enable_reg) & clk->enable_shift))
133 clk->rate = 0;
134 else {
135 div = (__raw_readl(clk->scale_reg) >> clk->scale_shift) & mask;
136 if (div)
137 rate /= div;
138 clk->rate = rate;
139 }
140
141 return clk->rate;
142}
143
144static int per_set_rate(struct clk *clk, u32 rate)
145{
146 int ret = -EINVAL;
147 int div = (clk->parent->rate + rate - 1) / rate;
148 u32 reg_frac;
149 const int mask = 0xff;
150 int try = 10;
151 int i = -1;
152
153 if (div == 0 || div > mask)
154 goto out;
155
156 reg_frac = __raw_readl(clk->scale_reg);
157 reg_frac &= ~(mask << clk->scale_shift);
158
159 while (try--) {
160 __raw_writel(reg_frac | (div << clk->scale_shift),
161 clk->scale_reg);
162
163 if (clk->busy_reg) {
164 for (i = 10000; i; i--)
165 if (!clk_is_busy(clk))
166 break;
167 }
168 if (i)
169 break;
170 }
171
172 if (!i)
173 ret = -ETIMEDOUT;
174 else
175 ret = 0;
176
177out:
178 if (ret != 0)
179 printk(KERN_ERR "%s: error %d\n", __func__, ret);
180 return ret;
181}
182
183static long lcdif_get_rate(struct clk *clk)
184{
185 long rate = clk->parent->rate;
186 long div;
187 const int mask = 0xff;
188
189 div = (__raw_readl(clk->scale_reg) >> clk->scale_shift) & mask;
190 if (div) {
191 rate /= div;
192 div = (__raw_readl(REGS_CLKCTRL_BASE + HW_CLKCTRL_FRAC) &
193 BM_CLKCTRL_FRAC_PIXFRAC) >> BP_CLKCTRL_FRAC_PIXFRAC;
194 rate /= div;
195 }
196 clk->rate = rate;
197
198 return rate;
199}
200
201static int lcdif_set_rate(struct clk *clk, u32 rate)
202{
203 int ret = 0;
204 /*
205 * On 3700, we can get most timings exact by modifying ref_pix
206 * and the divider, but keeping the phase timings at 1 (2
207 * phases per cycle).
208 *
209 * ref_pix can be between 480e6*18/35=246.9MHz and 480e6*18/18=480MHz,
210 * which is between 18/(18*480e6)=2.084ns and 35/(18*480e6)=4.050ns.
211 *
212 * ns_cycle >= 2*18e3/(18*480) = 25/6
213 * ns_cycle <= 2*35e3/(18*480) = 875/108
214 *
215 * Multiply the ns_cycle by 'div' to lengthen it until it fits the
216 * bounds. This is the divider we'll use after ref_pix.
217 *
218 * 6 * ns_cycle >= 25 * div
219 * 108 * ns_cycle <= 875 * div
220 */
221 u32 ns_cycle = 1000000 / rate;
222 u32 div, reg_val;
223 u32 lowest_result = (u32) -1;
224 u32 lowest_div = 0, lowest_fracdiv = 0;
225
226 for (div = 1; div < 256; ++div) {
227 u32 fracdiv;
228 u32 ps_result;
229 int lower_bound = 6 * ns_cycle >= 25 * div;
230 int upper_bound = 108 * ns_cycle <= 875 * div;
231 if (!lower_bound)
232 break;
233 if (!upper_bound)
234 continue;
235 /*
236 * Found a matching div. Calculate fractional divider needed,
237 * rounded up.
238 */
239 fracdiv = ((clk->parent->rate / 1000 * 18 / 2) *
240 ns_cycle + 1000 * div - 1) /
241 (1000 * div);
242 if (fracdiv < 18 || fracdiv > 35) {
243 ret = -EINVAL;
244 goto out;
245 }
246 /* Calculate the actual cycle time this results in */
247 ps_result = 6250 * div * fracdiv / 27;
248
249 /* Use the fastest result that doesn't break ns_cycle */
250 if (ps_result <= lowest_result) {
251 lowest_result = ps_result;
252 lowest_div = div;
253 lowest_fracdiv = fracdiv;
254 }
255 }
256
257 if (div >= 256 || lowest_result == (u32) -1) {
258 ret = -EINVAL;
259 goto out;
260 }
261 pr_debug("Programming PFD=%u,DIV=%u ref_pix=%uMHz "
262 "PIXCLK=%uMHz cycle=%u.%03uns\n",
263 lowest_fracdiv, lowest_div,
264 480*18/lowest_fracdiv, 480*18/lowest_fracdiv/lowest_div,
265 lowest_result / 1000, lowest_result % 1000);
266
267 /* Program ref_pix phase fractional divider */
268 reg_val = __raw_readl(REGS_CLKCTRL_BASE + HW_CLKCTRL_FRAC);
269 reg_val &= ~BM_CLKCTRL_FRAC_PIXFRAC;
270 reg_val |= BF(lowest_fracdiv, CLKCTRL_FRAC_PIXFRAC);
271 __raw_writel(reg_val, REGS_CLKCTRL_BASE + HW_CLKCTRL_FRAC);
272
273 /* Ungate PFD */
274 stmp3xxx_clearl(BM_CLKCTRL_FRAC_CLKGATEPIX,
275 REGS_CLKCTRL_BASE + HW_CLKCTRL_FRAC);
276
277 /* Program pix divider */
278 reg_val = __raw_readl(clk->scale_reg);
279 reg_val &= ~(BM_CLKCTRL_PIX_DIV | BM_CLKCTRL_PIX_CLKGATE);
280 reg_val |= BF(lowest_div, CLKCTRL_PIX_DIV);
281 __raw_writel(reg_val, clk->scale_reg);
282
283 /* Wait for divider update */
284 if (clk->busy_reg) {
285 int i;
286 for (i = 10000; i; i--)
287 if (!clk_is_busy(clk))
288 break;
289 if (!i) {
290 ret = -ETIMEDOUT;
291 goto out;
292 }
293 }
294
295 /* Switch to ref_pix source */
296 reg_val = __raw_readl(REGS_CLKCTRL_BASE + HW_CLKCTRL_CLKSEQ);
297 reg_val &= ~BM_CLKCTRL_CLKSEQ_BYPASS_PIX;
298 __raw_writel(reg_val, REGS_CLKCTRL_BASE + HW_CLKCTRL_CLKSEQ);
299
300out:
301 return ret;
302}
303
304
305static int cpu_set_rate(struct clk *clk, u32 rate)
306{
307 u32 reg_val;
308
309 if (rate < 24000)
310 return -EINVAL;
311 else if (rate == 24000) {
312 /* switch to the 24M source */
313 clk_set_parent(clk, &osc_24M);
314 } else {
315 int i;
316 u32 clkctrl_cpu = 1;
317 u32 c = clkctrl_cpu;
318 u32 clkctrl_frac = 1;
319 u32 val;
320 for ( ; c < 0x40; c++) {
321 u32 f = (pll_clk.rate*18/c + rate/2) / rate;
322 int s1, s2;
323
324 if (f < 18 || f > 35)
325 continue;
326 s1 = pll_clk.rate*18/clkctrl_frac/clkctrl_cpu - rate;
327 s2 = pll_clk.rate*18/c/f - rate;
328 pr_debug("%s: s1 %d, s2 %d\n", __func__, s1, s2);
329 if (abs(s1) > abs(s2)) {
330 clkctrl_cpu = c;
331 clkctrl_frac = f;
332 }
333 if (s2 == 0)
334 break;
335 };
336 pr_debug("%s: clkctrl_cpu %d, clkctrl_frac %d\n", __func__,
337 clkctrl_cpu, clkctrl_frac);
338 if (c == 0x40) {
339 int d = pll_clk.rate*18/clkctrl_frac/clkctrl_cpu -
340 rate;
341 if (abs(d) > 100 ||
342 clkctrl_frac < 18 || clkctrl_frac > 35)
343 return -EINVAL;
344 }
345
346 /* 4.6.2 */
347 val = __raw_readl(clk->scale_reg);
348 val &= ~(0x3f << clk->scale_shift);
349 val |= clkctrl_frac;
350 clk_set_parent(clk, &osc_24M);
351 udelay(10);
352 __raw_writel(val, clk->scale_reg);
353 /* ungate */
354 __raw_writel(1<<7, clk->scale_reg + 8);
355 /* write clkctrl_cpu */
356 clk->saved_div = clkctrl_cpu;
357
358 reg_val = __raw_readl(REGS_CLKCTRL_BASE + HW_CLKCTRL_CPU);
359 reg_val &= ~0x3F;
360 reg_val |= clkctrl_cpu;
361 __raw_writel(reg_val, REGS_CLKCTRL_BASE + HW_CLKCTRL_CPU);
362
363 for (i = 10000; i; i--)
364 if (!clk_is_busy(clk))
365 break;
366 if (!i) {
367 printk(KERN_ERR "couldn't set up CPU divisor\n");
368 return -ETIMEDOUT;
369 }
370 clk_set_parent(clk, &pll_clk);
371 clk->saved_div = 0;
372 udelay(10);
373 }
374 return 0;
375}
376
377static long cpu_get_rate(struct clk *clk)
378{
379 long rate = clk->parent->rate * 18;
380
381 rate /= (__raw_readl(clk->scale_reg) >> clk->scale_shift) & 0x3f;
382 rate /= __raw_readl(REGS_CLKCTRL_BASE + HW_CLKCTRL_CPU) & 0x3f;
383 rate = ((rate + 9) / 10) * 10;
384 clk->rate = rate;
385
386 return rate;
387}
388
389static long cpu_round_rate(struct clk *clk, u32 rate)
390{
391 unsigned long r = 0;
392
393 if (rate <= 24000)
394 r = 24000;
395 else {
396 u32 clkctrl_cpu = 1;
397 u32 clkctrl_frac;
398 do {
399 clkctrl_frac =
400 (pll_clk.rate*18 / clkctrl_cpu + rate/2) / rate;
401 if (clkctrl_frac > 35)
402 continue;
403 if (pll_clk.rate*18 / clkctrl_frac / clkctrl_cpu/10 ==
404 rate / 10)
405 break;
406 } while (pll_clk.rate / 2 >= clkctrl_cpu++ * rate);
407 if (pll_clk.rate / 2 < (clkctrl_cpu - 1) * rate)
408 clkctrl_cpu--;
409 pr_debug("%s: clkctrl_cpu %d, clkctrl_frac %d\n", __func__,
410 clkctrl_cpu, clkctrl_frac);
411 if (clkctrl_frac < 18)
412 clkctrl_frac = 18;
413 if (clkctrl_frac > 35)
414 clkctrl_frac = 35;
415
416 r = pll_clk.rate * 18;
417 r /= clkctrl_frac;
418 r /= clkctrl_cpu;
419 r = 10 * ((r + 9) / 10);
420 }
421 return r;
422}
423
424static long emi_get_rate(struct clk *clk)
425{
426 long rate = clk->parent->rate * 18;
427
428 rate /= (__raw_readl(clk->scale_reg) >> clk->scale_shift) & 0x3f;
429 rate /= __raw_readl(REGS_CLKCTRL_BASE + HW_CLKCTRL_EMI) & 0x3f;
430 clk->rate = rate;
431
432 return rate;
433}
434
435static int clkseq_set_parent(struct clk *clk, struct clk *parent)
436{
437 int ret = -EINVAL;
438 int shift = 8;
439
440 /* bypass? */
441 if (parent == &osc_24M)
442 shift = 4;
443
444 if (clk->bypass_reg) {
445#ifdef CONFIG_ARCH_STMP378X
446 u32 hbus_val, cpu_val;
447
448 if (clk == &cpu_clk && shift == 4) {
449 hbus_val = __raw_readl(REGS_CLKCTRL_BASE +
450 HW_CLKCTRL_HBUS);
451 cpu_val = __raw_readl(REGS_CLKCTRL_BASE +
452 HW_CLKCTRL_CPU);
453
454 hbus_val &= ~(BM_CLKCTRL_HBUS_DIV_FRAC_EN |
455 BM_CLKCTRL_HBUS_DIV);
456 clk->saved_div = cpu_val & BM_CLKCTRL_CPU_DIV_CPU;
457 cpu_val &= ~BM_CLKCTRL_CPU_DIV_CPU;
458 cpu_val |= 1;
459
460 if (machine_is_stmp378x()) {
461 __raw_writel(hbus_val,
462 REGS_CLKCTRL_BASE + HW_CLKCTRL_HBUS);
463 __raw_writel(cpu_val,
464 REGS_CLKCTRL_BASE + HW_CLKCTRL_CPU);
465 hclk.rate = 0;
466 }
467 } else if (clk == &cpu_clk && shift == 8) {
468 hbus_val = __raw_readl(REGS_CLKCTRL_BASE +
469 HW_CLKCTRL_HBUS);
470 cpu_val = __raw_readl(REGS_CLKCTRL_BASE +
471 HW_CLKCTRL_CPU);
472 hbus_val &= ~(BM_CLKCTRL_HBUS_DIV_FRAC_EN |
473 BM_CLKCTRL_HBUS_DIV);
474 hbus_val |= 2;
475 cpu_val &= ~BM_CLKCTRL_CPU_DIV_CPU;
476 if (clk->saved_div)
477 cpu_val |= clk->saved_div;
478 else
479 cpu_val |= 2;
480
481 if (machine_is_stmp378x()) {
482 __raw_writel(hbus_val,
483 REGS_CLKCTRL_BASE + HW_CLKCTRL_HBUS);
484 __raw_writel(cpu_val,
485 REGS_CLKCTRL_BASE + HW_CLKCTRL_CPU);
486 hclk.rate = 0;
487 }
488 }
489#endif
490 __raw_writel(1 << clk->bypass_shift, clk->bypass_reg + shift);
491
492 ret = 0;
493 }
494
495 return ret;
496}
497
498static int hbus_set_rate(struct clk *clk, u32 rate)
499{
500 u8 div = 0;
501 int is_frac = 0;
502 u32 clkctrl_hbus;
503 struct clk *parent = clk->parent;
504
505 pr_debug("%s: rate %d, parent rate %d\n", __func__, rate,
506 parent->rate);
507
508 if (rate > parent->rate)
509 return -EINVAL;
510
511 if (((parent->rate + rate/2) / rate) * rate != parent->rate &&
512 parent->rate / rate < 32) {
513 pr_debug("%s: switching to fractional mode\n", __func__);
514 is_frac = 1;
515 }
516
517 if (is_frac)
518 div = (32 * rate + parent->rate / 2) / parent->rate;
519 else
520 div = (parent->rate + rate - 1) / rate;
521 pr_debug("%s: div calculated is %d\n", __func__, div);
522 if (!div || div > 0x1f)
523 return -EINVAL;
524
525 clk_set_parent(&cpu_clk, &osc_24M);
526 udelay(10);
527 clkctrl_hbus = __raw_readl(clk->scale_reg);
528 clkctrl_hbus &= ~0x3f;
529 clkctrl_hbus |= div;
530 clkctrl_hbus |= (is_frac << 5);
531
532 __raw_writel(clkctrl_hbus, clk->scale_reg);
533 if (clk->busy_reg) {
534 int i;
535 for (i = 10000; i; i--)
536 if (!clk_is_busy(clk))
537 break;
538 if (!i) {
539 printk(KERN_ERR "couldn't set up CPU divisor\n");
540 return -ETIMEDOUT;
541 }
542 }
543 clk_set_parent(&cpu_clk, &pll_clk);
544 __raw_writel(clkctrl_hbus, clk->scale_reg);
545 udelay(10);
546 return 0;
547}
548
549static long hbus_get_rate(struct clk *clk)
550{
551 long rate = clk->parent->rate;
552
553 if (__raw_readl(clk->scale_reg) & 0x20) {
554 rate *= __raw_readl(clk->scale_reg) & 0x1f;
555 rate /= 32;
556 } else
557 rate /= __raw_readl(clk->scale_reg) & 0x1f;
558 clk->rate = rate;
559
560 return rate;
561}
562
563static int xbus_set_rate(struct clk *clk, u32 rate)
564{
565 u16 div = 0;
566 u32 clkctrl_xbus;
567
568 pr_debug("%s: rate %d, parent rate %d\n", __func__, rate,
569 clk->parent->rate);
570
571 div = (clk->parent->rate + rate - 1) / rate;
572 pr_debug("%s: div calculated is %d\n", __func__, div);
573 if (!div || div > 0x3ff)
574 return -EINVAL;
575
576 clkctrl_xbus = __raw_readl(clk->scale_reg);
577 clkctrl_xbus &= ~0x3ff;
578 clkctrl_xbus |= div;
579 __raw_writel(clkctrl_xbus, clk->scale_reg);
580 if (clk->busy_reg) {
581 int i;
582 for (i = 10000; i; i--)
583 if (!clk_is_busy(clk))
584 break;
585 if (!i) {
586 printk(KERN_ERR "couldn't set up xbus divisor\n");
587 return -ETIMEDOUT;
588 }
589 }
590 return 0;
591}
592
593static long xbus_get_rate(struct clk *clk)
594{
595 long rate = clk->parent->rate;
596
597 rate /= __raw_readl(clk->scale_reg) & 0x3ff;
598 clk->rate = rate;
599
600 return rate;
601}
602
603
604/* Clock ops */
605
606static struct clk_ops std_ops = {
607 .enable = std_clk_enable,
608 .disable = std_clk_disable,
609 .get_rate = per_get_rate,
610 .set_rate = per_set_rate,
611 .set_parent = clkseq_set_parent,
612};
613
614static struct clk_ops min_ops = {
615 .enable = std_clk_enable,
616 .disable = std_clk_disable,
617};
618
619static struct clk_ops cpu_ops = {
620 .enable = std_clk_enable,
621 .disable = std_clk_disable,
622 .get_rate = cpu_get_rate,
623 .set_rate = cpu_set_rate,
624 .round_rate = cpu_round_rate,
625 .set_parent = clkseq_set_parent,
626};
627
628static struct clk_ops io_ops = {
629 .enable = std_clk_enable,
630 .disable = std_clk_disable,
631 .get_rate = io_get_rate,
632 .set_rate = io_set_rate,
633};
634
635static struct clk_ops hbus_ops = {
636 .get_rate = hbus_get_rate,
637 .set_rate = hbus_set_rate,
638};
639
640static struct clk_ops xbus_ops = {
641 .get_rate = xbus_get_rate,
642 .set_rate = xbus_set_rate,
643};
644
645static struct clk_ops lcdif_ops = {
646 .enable = std_clk_enable,
647 .disable = std_clk_disable,
648 .get_rate = lcdif_get_rate,
649 .set_rate = lcdif_set_rate,
650 .set_parent = clkseq_set_parent,
651};
652
653static struct clk_ops emi_ops = {
654 .get_rate = emi_get_rate,
655};
656
657/* List of on-chip clocks */
658
659static struct clk osc_24M = {
660 .flags = FIXED_RATE | ENABLED,
661 .rate = 24000,
662};
663
664static struct clk pll_clk = {
665 .parent = &osc_24M,
666 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_PLLCTRL0,
667 .enable_shift = 16,
668 .enable_wait = 10,
669 .flags = FIXED_RATE | ENABLED,
670 .rate = 480000,
671 .ops = &min_ops,
672};
673
674static struct clk cpu_clk = {
675 .parent = &pll_clk,
676 .scale_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_FRAC,
677 .scale_shift = 0,
678 .bypass_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_CLKSEQ,
679 .bypass_shift = 7,
680 .busy_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_CPU,
681 .busy_bit = 28,
682 .flags = RATE_PROPAGATES | ENABLED,
683 .ops = &cpu_ops,
684};
685
686static struct clk io_clk = {
687 .parent = &pll_clk,
688 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_FRAC,
689 .enable_shift = 31,
690 .enable_negate = 1,
691 .scale_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_FRAC,
692 .scale_shift = 24,
693 .flags = RATE_PROPAGATES | ENABLED,
694 .ops = &io_ops,
695};
696
697static struct clk hclk = {
698 .parent = &cpu_clk,
699 .scale_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_HBUS,
700 .bypass_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_CLKSEQ,
701 .bypass_shift = 7,
702 .busy_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_HBUS,
703 .busy_bit = 29,
704 .flags = RATE_PROPAGATES | ENABLED,
705 .ops = &hbus_ops,
706};
707
708static struct clk xclk = {
709 .parent = &osc_24M,
710 .scale_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_XBUS,
711 .busy_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_XBUS,
712 .busy_bit = 31,
713 .flags = RATE_PROPAGATES | ENABLED,
714 .ops = &xbus_ops,
715};
716
717static struct clk uart_clk = {
718 .parent = &xclk,
719 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_XTAL,
720 .enable_shift = 31,
721 .enable_negate = 1,
722 .flags = ENABLED,
723 .ops = &min_ops,
724};
725
726static struct clk audio_clk = {
727 .parent = &xclk,
728 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_XTAL,
729 .enable_shift = 30,
730 .enable_negate = 1,
731 .ops = &min_ops,
732};
733
734static struct clk pwm_clk = {
735 .parent = &xclk,
736 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_XTAL,
737 .enable_shift = 29,
738 .enable_negate = 1,
739 .ops = &min_ops,
740};
741
742static struct clk dri_clk = {
743 .parent = &xclk,
744 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_XTAL,
745 .enable_shift = 28,
746 .enable_negate = 1,
747 .ops = &min_ops,
748};
749
750static struct clk digctl_clk = {
751 .parent = &xclk,
752 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_XTAL,
753 .enable_shift = 27,
754 .enable_negate = 1,
755 .ops = &min_ops,
756};
757
758static struct clk timer_clk = {
759 .parent = &xclk,
760 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_XTAL,
761 .enable_shift = 26,
762 .enable_negate = 1,
763 .flags = ENABLED,
764 .ops = &min_ops,
765};
766
767static struct clk lcdif_clk = {
768 .parent = &pll_clk,
769 .scale_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_PIX,
770 .busy_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_PIX,
771 .busy_bit = 29,
772 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_PIX,
773 .enable_shift = 31,
774 .enable_negate = 1,
775 .bypass_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_CLKSEQ,
776 .bypass_shift = 1,
777 .flags = NEEDS_SET_PARENT,
778 .ops = &lcdif_ops,
779};
780
781static struct clk ssp_clk = {
782 .parent = &io_clk,
783 .scale_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_SSP,
784 .busy_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_SSP,
785 .busy_bit = 29,
786 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_SSP,
787 .enable_shift = 31,
788 .bypass_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_CLKSEQ,
789 .bypass_shift = 5,
790 .enable_negate = 1,
791 .flags = NEEDS_SET_PARENT,
792 .ops = &std_ops,
793};
794
795static struct clk gpmi_clk = {
796 .parent = &io_clk,
797 .scale_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_GPMI,
798 .busy_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_GPMI,
799 .busy_bit = 29,
800 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_GPMI,
801 .enable_shift = 31,
802 .enable_negate = 1,
803 .bypass_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_CLKSEQ,
804 .bypass_shift = 4,
805 .flags = NEEDS_SET_PARENT,
806 .ops = &std_ops,
807};
808
809static struct clk spdif_clk = {
810 .parent = &pll_clk,
811 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_SPDIF,
812 .enable_shift = 31,
813 .enable_negate = 1,
814 .ops = &min_ops,
815};
816
817static struct clk emi_clk = {
818 .parent = &pll_clk,
819 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_EMI,
820 .enable_shift = 31,
821 .enable_negate = 1,
822 .scale_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_FRAC,
823 .scale_shift = 8,
824 .busy_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_EMI,
825 .busy_bit = 28,
826 .bypass_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_CLKSEQ,
827 .bypass_shift = 6,
828 .flags = ENABLED,
829 .ops = &emi_ops,
830};
831
832static struct clk ir_clk = {
833 .parent = &io_clk,
834 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_IR,
835 .enable_shift = 31,
836 .enable_negate = 1,
837 .bypass_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_CLKSEQ,
838 .bypass_shift = 3,
839 .ops = &min_ops,
840};
841
842static struct clk saif_clk = {
843 .parent = &pll_clk,
844 .scale_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_SAIF,
845 .busy_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_SAIF,
846 .busy_bit = 29,
847 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_SAIF,
848 .enable_shift = 31,
849 .enable_negate = 1,
850 .bypass_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_CLKSEQ,
851 .bypass_shift = 0,
852 .ops = &std_ops,
853};
854
855static struct clk usb_clk = {
856 .parent = &pll_clk,
857 .enable_reg = REGS_CLKCTRL_BASE + HW_CLKCTRL_PLLCTRL0,
858 .enable_shift = 18,
859 .enable_negate = 1,
860 .ops = &min_ops,
861};
862
863/* list of all the clocks */
864static struct clk_lookup onchip_clks[] = {
865 {
866 .con_id = "osc_24M",
867 .clk = &osc_24M,
868 }, {
869 .con_id = "pll",
870 .clk = &pll_clk,
871 }, {
872 .con_id = "cpu",
873 .clk = &cpu_clk,
874 }, {
875 .con_id = "hclk",
876 .clk = &hclk,
877 }, {
878 .con_id = "xclk",
879 .clk = &xclk,
880 }, {
881 .con_id = "io",
882 .clk = &io_clk,
883 }, {
884 .con_id = "uart",
885 .clk = &uart_clk,
886 }, {
887 .con_id = "audio",
888 .clk = &audio_clk,
889 }, {
890 .con_id = "pwm",
891 .clk = &pwm_clk,
892 }, {
893 .con_id = "dri",
894 .clk = &dri_clk,
895 }, {
896 .con_id = "digctl",
897 .clk = &digctl_clk,
898 }, {
899 .con_id = "timer",
900 .clk = &timer_clk,
901 }, {
902 .con_id = "lcdif",
903 .clk = &lcdif_clk,
904 }, {
905 .con_id = "ssp",
906 .clk = &ssp_clk,
907 }, {
908 .con_id = "gpmi",
909 .clk = &gpmi_clk,
910 }, {
911 .con_id = "spdif",
912 .clk = &spdif_clk,
913 }, {
914 .con_id = "emi",
915 .clk = &emi_clk,
916 }, {
917 .con_id = "ir",
918 .clk = &ir_clk,
919 }, {
920 .con_id = "saif",
921 .clk = &saif_clk,
922 }, {
923 .con_id = "usb",
924 .clk = &usb_clk,
925 },
926};
927
928static int __init propagate_rate(struct clk *clk)
929{
930 struct clk_lookup *cl;
931
932 for (cl = onchip_clks; cl < onchip_clks + ARRAY_SIZE(onchip_clks);
933 cl++) {
934 if (unlikely(!clk_good(cl->clk)))
935 continue;
936 if (cl->clk->parent == clk && cl->clk->ops->get_rate) {
937 cl->clk->ops->get_rate(cl->clk);
938 if (cl->clk->flags & RATE_PROPAGATES)
939 propagate_rate(cl->clk);
940 }
941 }
942
943 return 0;
944}
945
946/* Exported API */
947unsigned long clk_get_rate(struct clk *clk)
948{
949 if (unlikely(!clk_good(clk)))
950 return 0;
951
952 if (clk->rate != 0)
953 return clk->rate;
954
955 if (clk->ops->get_rate != NULL)
956 return clk->ops->get_rate(clk);
957
958 return clk_get_rate(clk->parent);
959}
960EXPORT_SYMBOL(clk_get_rate);
961
962long clk_round_rate(struct clk *clk, unsigned long rate)
963{
964 if (unlikely(!clk_good(clk)))
965 return 0;
966
967 if (clk->ops->round_rate)
968 return clk->ops->round_rate(clk, rate);
969
970 return 0;
971}
972EXPORT_SYMBOL(clk_round_rate);
973
974static inline int close_enough(long rate1, long rate2)
975{
976 return rate1 && !((rate2 - rate1) * 1000 / rate1);
977}
978
979int clk_set_rate(struct clk *clk, unsigned long rate)
980{
981 int ret = -EINVAL;
982
983 if (unlikely(!clk_good(clk)))
984 goto out;
985
986 if (clk->flags & FIXED_RATE || !clk->ops->set_rate)
987 goto out;
988
989 else if (!close_enough(clk->rate, rate)) {
990 ret = clk->ops->set_rate(clk, rate);
991 if (ret < 0)
992 goto out;
993 clk->rate = rate;
994 if (clk->flags & RATE_PROPAGATES)
995 propagate_rate(clk);
996 } else
997 ret = 0;
998
999out:
1000 return ret;
1001}
1002EXPORT_SYMBOL(clk_set_rate);
1003
1004int clk_enable(struct clk *clk)
1005{
1006 unsigned long clocks_flags;
1007
1008 if (unlikely(!clk_good(clk)))
1009 return -EINVAL;
1010
1011 if (clk->parent)
1012 clk_enable(clk->parent);
1013
1014 spin_lock_irqsave(&clocks_lock, clocks_flags);
1015
1016 clk->usage++;
1017 if (clk->ops && clk->ops->enable)
1018 clk->ops->enable(clk);
1019
1020 spin_unlock_irqrestore(&clocks_lock, clocks_flags);
1021 return 0;
1022}
1023EXPORT_SYMBOL(clk_enable);
1024
1025static void local_clk_disable(struct clk *clk)
1026{
1027 if (unlikely(!clk_good(clk)))
1028 return;
1029
1030 if (clk->usage == 0 && clk->ops->disable)
1031 clk->ops->disable(clk);
1032
1033 if (clk->parent)
1034 local_clk_disable(clk->parent);
1035}
1036
1037void clk_disable(struct clk *clk)
1038{
1039 unsigned long clocks_flags;
1040
1041 if (unlikely(!clk_good(clk)))
1042 return;
1043
1044 spin_lock_irqsave(&clocks_lock, clocks_flags);
1045
1046 if ((--clk->usage) == 0 && clk->ops->disable)
1047 clk->ops->disable(clk);
1048
1049 spin_unlock_irqrestore(&clocks_lock, clocks_flags);
1050 if (clk->parent)
1051 clk_disable(clk->parent);
1052}
1053EXPORT_SYMBOL(clk_disable);
1054
1055/* Some additional API */
1056int clk_set_parent(struct clk *clk, struct clk *parent)
1057{
1058 int ret = -ENODEV;
1059 unsigned long clocks_flags;
1060
1061 if (unlikely(!clk_good(clk)))
1062 goto out;
1063
1064 if (!clk->ops->set_parent)
1065 goto out;
1066
1067 spin_lock_irqsave(&clocks_lock, clocks_flags);
1068
1069 ret = clk->ops->set_parent(clk, parent);
1070 if (!ret) {
1071 /* disable if usage count is 0 */
1072 local_clk_disable(parent);
1073
1074 parent->usage += clk->usage;
1075 clk->parent->usage -= clk->usage;
1076
1077 /* disable if new usage count is 0 */
1078 local_clk_disable(clk->parent);
1079
1080 clk->parent = parent;
1081 }
1082 spin_unlock_irqrestore(&clocks_lock, clocks_flags);
1083
1084out:
1085 return ret;
1086}
1087EXPORT_SYMBOL(clk_set_parent);
1088
1089struct clk *clk_get_parent(struct clk *clk)
1090{
1091 if (unlikely(!clk_good(clk)))
1092 return NULL;
1093 return clk->parent;
1094}
1095EXPORT_SYMBOL(clk_get_parent);
1096
1097static int __init clk_init(void)
1098{
1099 struct clk_lookup *cl;
1100 struct clk_ops *ops;
1101
1102 spin_lock_init(&clocks_lock);
1103
1104 for (cl = onchip_clks; cl < onchip_clks + ARRAY_SIZE(onchip_clks);
1105 cl++) {
1106 if (cl->clk->flags & ENABLED)
1107 clk_enable(cl->clk);
1108 else
1109 local_clk_disable(cl->clk);
1110
1111 ops = cl->clk->ops;
1112
1113 if ((cl->clk->flags & NEEDS_INITIALIZATION) &&
1114 ops && ops->set_rate)
1115 ops->set_rate(cl->clk, cl->clk->rate);
1116
1117 if (cl->clk->flags & FIXED_RATE) {
1118 if (cl->clk->flags & RATE_PROPAGATES)
1119 propagate_rate(cl->clk);
1120 } else {
1121 if (ops && ops->get_rate)
1122 ops->get_rate(cl->clk);
1123 }
1124
1125 if (cl->clk->flags & NEEDS_SET_PARENT) {
1126 if (ops && ops->set_parent)
1127 ops->set_parent(cl->clk, cl->clk->parent);
1128 }
1129 }
1130 clkdev_add_table(onchip_clks, ARRAY_SIZE(onchip_clks));
1131 return 0;
1132}
1133
1134arch_initcall(clk_init);
diff --git a/arch/arm/plat-stmp3xxx/clock.h b/arch/arm/plat-stmp3xxx/clock.h
deleted file mode 100644
index a6611e1a3510..000000000000
--- a/arch/arm/plat-stmp3xxx/clock.h
+++ /dev/null
@@ -1,61 +0,0 @@
1/*
2 * Clock control driver for Freescale STMP37XX/STMP378X - internal header file
3 *
4 * Author: Vitaly Wool <vital@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __ARCH_ARM_STMX3XXX_CLOCK_H__
19#define __ARCH_ARM_STMX3XXX_CLOCK_H__
20
21#ifndef __ASSEMBLER__
22
23struct clk_ops {
24 int (*enable) (struct clk *);
25 int (*disable) (struct clk *);
26 long (*get_rate) (struct clk *);
27 long (*round_rate) (struct clk *, u32);
28 int (*set_rate) (struct clk *, u32);
29 int (*set_parent) (struct clk *, struct clk *);
30};
31
32struct clk {
33 struct clk *parent;
34 u32 rate;
35 u32 flags;
36 u8 scale_shift;
37 u8 enable_shift;
38 u8 bypass_shift;
39 u8 busy_bit;
40 s8 usage;
41 int enable_wait;
42 int enable_negate;
43 u32 saved_div;
44 void __iomem *enable_reg;
45 void __iomem *scale_reg;
46 void __iomem *bypass_reg;
47 void __iomem *busy_reg;
48 struct clk_ops *ops;
49};
50
51#endif /* __ASSEMBLER__ */
52
53/* Flags */
54#define RATE_PROPAGATES (1<<0)
55#define NEEDS_INITIALIZATION (1<<1)
56#define PARENT_SET_RATE (1<<2)
57#define FIXED_RATE (1<<3)
58#define ENABLED (1<<4)
59#define NEEDS_SET_PARENT (1<<5)
60
61#endif
diff --git a/arch/arm/plat-stmp3xxx/core.c b/arch/arm/plat-stmp3xxx/core.c
deleted file mode 100644
index 37b8a09148a4..000000000000
--- a/arch/arm/plat-stmp3xxx/core.c
+++ /dev/null
@@ -1,128 +0,0 @@
1/*
2 * Freescale STMP37XX/STMP378X core routines
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/io.h>
21
22#include <mach/stmp3xxx.h>
23#include <mach/platform.h>
24#include <mach/dma.h>
25#include <mach/regs-clkctrl.h>
26
27static int __stmp3xxx_reset_block(void __iomem *hwreg, int just_enable)
28{
29 u32 c;
30 int timeout;
31
32 /* the process of software reset of IP block is done
33 in several steps:
34
35 - clear SFTRST and wait for block is enabled;
36 - clear clock gating (CLKGATE bit);
37 - set the SFTRST again and wait for block is in reset;
38 - clear SFTRST and wait for reset completion.
39 */
40 c = __raw_readl(hwreg);
41 c &= ~(1<<31); /* clear SFTRST */
42 __raw_writel(c, hwreg);
43 for (timeout = 1000000; timeout > 0; timeout--)
44 /* still in SFTRST state ? */
45 if ((__raw_readl(hwreg) & (1<<31)) == 0)
46 break;
47 if (timeout <= 0) {
48 printk(KERN_ERR"%s(%p): timeout when enabling\n",
49 __func__, hwreg);
50 return -ETIME;
51 }
52
53 c = __raw_readl(hwreg);
54 c &= ~(1<<30); /* clear CLKGATE */
55 __raw_writel(c, hwreg);
56
57 if (!just_enable) {
58 c = __raw_readl(hwreg);
59 c |= (1<<31); /* now again set SFTRST */
60 __raw_writel(c, hwreg);
61 for (timeout = 1000000; timeout > 0; timeout--)
62 /* poll until CLKGATE set */
63 if (__raw_readl(hwreg) & (1<<30))
64 break;
65 if (timeout <= 0) {
66 printk(KERN_ERR"%s(%p): timeout when resetting\n",
67 __func__, hwreg);
68 return -ETIME;
69 }
70
71 c = __raw_readl(hwreg);
72 c &= ~(1<<31); /* clear SFTRST */
73 __raw_writel(c, hwreg);
74 for (timeout = 1000000; timeout > 0; timeout--)
75 /* still in SFTRST state ? */
76 if ((__raw_readl(hwreg) & (1<<31)) == 0)
77 break;
78 if (timeout <= 0) {
79 printk(KERN_ERR"%s(%p): timeout when enabling "
80 "after reset\n", __func__, hwreg);
81 return -ETIME;
82 }
83
84 c = __raw_readl(hwreg);
85 c &= ~(1<<30); /* clear CLKGATE */
86 __raw_writel(c, hwreg);
87 }
88 for (timeout = 1000000; timeout > 0; timeout--)
89 /* still in SFTRST state ? */
90 if ((__raw_readl(hwreg) & (1<<30)) == 0)
91 break;
92
93 if (timeout <= 0) {
94 printk(KERN_ERR"%s(%p): timeout when unclockgating\n",
95 __func__, hwreg);
96 return -ETIME;
97 }
98
99 return 0;
100}
101
102int stmp3xxx_reset_block(void __iomem *hwreg, int just_enable)
103{
104 int try = 10;
105 int r;
106
107 while (try--) {
108 r = __stmp3xxx_reset_block(hwreg, just_enable);
109 if (!r)
110 break;
111 pr_debug("%s: try %d failed\n", __func__, 10 - try);
112 }
113 return r;
114}
115EXPORT_SYMBOL(stmp3xxx_reset_block);
116
117struct platform_device stmp3xxx_dbguart = {
118 .name = "stmp3xxx-dbguart",
119 .id = -1,
120};
121
122void __init stmp3xxx_init(void)
123{
124 /* Turn off auto-slow and other tricks */
125 stmp3xxx_clearl(0x7f00000, REGS_CLKCTRL_BASE + HW_CLKCTRL_HBUS);
126
127 stmp3xxx_dma_init();
128}
diff --git a/arch/arm/plat-stmp3xxx/devices.c b/arch/arm/plat-stmp3xxx/devices.c
deleted file mode 100644
index 68fed4b8746a..000000000000
--- a/arch/arm/plat-stmp3xxx/devices.c
+++ /dev/null
@@ -1,389 +0,0 @@
1/*
2* Freescale STMP37XX/STMP378X platform devices
3*
4* Embedded Alley Solutions, Inc <source@embeddedalley.com>
5*
6* Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7* Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8*/
9
10/*
11* The code contained herein is licensed under the GNU General Public
12* License. You may obtain a copy of the GNU General Public License
13* Version 2 or later at the following locations:
14*
15* http://www.opensource.org/licenses/gpl-license.html
16* http://www.gnu.org/copyleft/gpl.html
17*/
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/device.h>
21#include <linux/platform_device.h>
22#include <linux/dma-mapping.h>
23
24#include <mach/dma.h>
25#include <mach/platform.h>
26#include <mach/stmp3xxx.h>
27#include <mach/regs-lcdif.h>
28#include <mach/regs-uartapp.h>
29#include <mach/regs-gpmi.h>
30#include <mach/regs-usbctrl.h>
31#include <mach/regs-ssp.h>
32#include <mach/regs-rtc.h>
33
34static u64 common_dmamask = DMA_BIT_MASK(32);
35
36static struct resource appuart_resources[] = {
37 {
38 .start = IRQ_UARTAPP_INTERNAL,
39 .end = IRQ_UARTAPP_INTERNAL,
40 .flags = IORESOURCE_IRQ,
41 }, {
42 .start = IRQ_UARTAPP_RX_DMA,
43 .end = IRQ_UARTAPP_RX_DMA,
44 .flags = IORESOURCE_IRQ,
45 }, {
46 .start = IRQ_UARTAPP_TX_DMA,
47 .end = IRQ_UARTAPP_TX_DMA,
48 .flags = IORESOURCE_IRQ,
49 }, {
50 .start = REGS_UARTAPP1_PHYS,
51 .end = REGS_UARTAPP1_PHYS + REGS_UARTAPP_SIZE,
52 .flags = IORESOURCE_MEM,
53 }, {
54 /* Rx DMA channel */
55 .start = STMP3XXX_DMA(6, STMP3XXX_BUS_APBX),
56 .end = STMP3XXX_DMA(6, STMP3XXX_BUS_APBX),
57 .flags = IORESOURCE_DMA,
58 }, {
59 /* Tx DMA channel */
60 .start = STMP3XXX_DMA(7, STMP3XXX_BUS_APBX),
61 .end = STMP3XXX_DMA(7, STMP3XXX_BUS_APBX),
62 .flags = IORESOURCE_DMA,
63 },
64};
65
66struct platform_device stmp3xxx_appuart = {
67 .name = "stmp3xxx-appuart",
68 .id = 0,
69 .resource = appuart_resources,
70 .num_resources = ARRAY_SIZE(appuart_resources),
71 .dev = {
72 .dma_mask = &common_dmamask,
73 .coherent_dma_mask = DMA_BIT_MASK(32),
74 },
75};
76
77struct platform_device stmp3xxx_watchdog = {
78 .name = "stmp3xxx_wdt",
79 .id = -1,
80};
81
82static struct resource ts_resource[] = {
83 {
84 .flags = IORESOURCE_IRQ,
85 .start = IRQ_TOUCH_DETECT,
86 .end = IRQ_TOUCH_DETECT,
87 }, {
88 .flags = IORESOURCE_IRQ,
89 .start = IRQ_LRADC_CH5,
90 .end = IRQ_LRADC_CH5,
91 },
92};
93
94struct platform_device stmp3xxx_touchscreen = {
95 .name = "stmp3xxx_ts",
96 .id = -1,
97 .resource = ts_resource,
98 .num_resources = ARRAY_SIZE(ts_resource),
99};
100
101/*
102* Keypad device
103*/
104struct platform_device stmp3xxx_keyboard = {
105 .name = "stmp3xxx-keyboard",
106 .id = -1,
107};
108
109static struct resource gpmi_resources[] = {
110 {
111 .flags = IORESOURCE_MEM,
112 .start = REGS_GPMI_PHYS,
113 .end = REGS_GPMI_PHYS + REGS_GPMI_SIZE,
114 }, {
115 .flags = IORESOURCE_IRQ,
116 .start = IRQ_GPMI_DMA,
117 .end = IRQ_GPMI_DMA,
118 }, {
119 .flags = IORESOURCE_DMA,
120 .start = STMP3XXX_DMA(4, STMP3XXX_BUS_APBH),
121 .end = STMP3XXX_DMA(8, STMP3XXX_BUS_APBH),
122 },
123};
124
125struct platform_device stmp3xxx_gpmi = {
126 .name = "gpmi",
127 .id = -1,
128 .dev = {
129 .dma_mask = &common_dmamask,
130 .coherent_dma_mask = DMA_BIT_MASK(32),
131 },
132 .resource = gpmi_resources,
133 .num_resources = ARRAY_SIZE(gpmi_resources),
134};
135
136static struct resource mmc1_resource[] = {
137 {
138 .flags = IORESOURCE_MEM,
139 .start = REGS_SSP1_PHYS,
140 .end = REGS_SSP1_PHYS + REGS_SSP_SIZE,
141 }, {
142 .flags = IORESOURCE_DMA,
143 .start = STMP3XXX_DMA(1, STMP3XXX_BUS_APBH),
144 .end = STMP3XXX_DMA(1, STMP3XXX_BUS_APBH),
145 }, {
146 .flags = IORESOURCE_IRQ,
147 .start = IRQ_SSP1_DMA,
148 .end = IRQ_SSP1_DMA,
149 }, {
150 .flags = IORESOURCE_IRQ,
151 .start = IRQ_SSP_ERROR,
152 .end = IRQ_SSP_ERROR,
153 },
154};
155
156struct platform_device stmp3xxx_mmc = {
157 .name = "stmp3xxx-mmc",
158 .id = 1,
159 .dev = {
160 .dma_mask = &common_dmamask,
161 .coherent_dma_mask = DMA_BIT_MASK(32),
162 },
163 .resource = mmc1_resource,
164 .num_resources = ARRAY_SIZE(mmc1_resource),
165};
166
167static struct resource usb_resources[] = {
168 {
169 .start = REGS_USBCTRL_PHYS,
170 .end = REGS_USBCTRL_PHYS + SZ_4K,
171 .flags = IORESOURCE_MEM,
172 }, {
173 .start = IRQ_USB_CTRL,
174 .end = IRQ_USB_CTRL,
175 .flags = IORESOURCE_IRQ,
176 },
177};
178
179struct platform_device stmp3xxx_udc = {
180 .name = "fsl-usb2-udc",
181 .id = -1,
182 .dev = {
183 .dma_mask = &common_dmamask,
184 .coherent_dma_mask = DMA_BIT_MASK(32),
185 },
186 .resource = usb_resources,
187 .num_resources = ARRAY_SIZE(usb_resources),
188};
189
190struct platform_device stmp3xxx_ehci = {
191 .name = "fsl-ehci",
192 .id = -1,
193 .dev = {
194 .dma_mask = &common_dmamask,
195 .coherent_dma_mask = DMA_BIT_MASK(32),
196 },
197 .resource = usb_resources,
198 .num_resources = ARRAY_SIZE(usb_resources),
199};
200
201static struct resource rtc_resources[] = {
202 {
203 .start = REGS_RTC_PHYS,
204 .end = REGS_RTC_PHYS + REGS_RTC_SIZE,
205 .flags = IORESOURCE_MEM,
206 }, {
207 .start = IRQ_RTC_ALARM,
208 .end = IRQ_RTC_ALARM,
209 .flags = IORESOURCE_IRQ,
210 }, {
211 .start = IRQ_RTC_1MSEC,
212 .end = IRQ_RTC_1MSEC,
213 .flags = IORESOURCE_IRQ,
214 },
215};
216
217struct platform_device stmp3xxx_rtc = {
218 .name = "stmp3xxx-rtc",
219 .id = -1,
220 .resource = rtc_resources,
221 .num_resources = ARRAY_SIZE(rtc_resources),
222};
223
224static struct resource ssp1_resources[] = {
225 {
226 .start = REGS_SSP1_PHYS,
227 .end = REGS_SSP1_PHYS + REGS_SSP_SIZE,
228 .flags = IORESOURCE_MEM,
229 }, {
230 .start = IRQ_SSP1_DMA,
231 .end = IRQ_SSP1_DMA,
232 .flags = IORESOURCE_IRQ,
233 }, {
234 .start = STMP3XXX_DMA(1, STMP3XXX_BUS_APBH),
235 .end = STMP3XXX_DMA(1, STMP3XXX_BUS_APBH),
236 .flags = IORESOURCE_DMA,
237 },
238};
239
240static struct resource ssp2_resources[] = {
241 {
242 .start = REGS_SSP2_PHYS,
243 .end = REGS_SSP2_PHYS + REGS_SSP_SIZE,
244 .flags = IORESOURCE_MEM,
245 }, {
246 .start = IRQ_SSP2_DMA,
247 .end = IRQ_SSP2_DMA,
248 .flags = IORESOURCE_IRQ,
249 }, {
250 .start = STMP3XXX_DMA(2, STMP3XXX_BUS_APBH),
251 .end = STMP3XXX_DMA(2, STMP3XXX_BUS_APBH),
252 .flags = IORESOURCE_DMA,
253 },
254};
255
256struct platform_device stmp3xxx_spi1 = {
257 .name = "stmp3xxx_ssp",
258 .id = 1,
259 .dev = {
260 .dma_mask = &common_dmamask,
261 .coherent_dma_mask = DMA_BIT_MASK(32),
262 },
263 .resource = ssp1_resources,
264 .num_resources = ARRAY_SIZE(ssp1_resources),
265};
266
267struct platform_device stmp3xxx_spi2 = {
268 .name = "stmp3xxx_ssp",
269 .id = 2,
270 .dev = {
271 .dma_mask = &common_dmamask,
272 .coherent_dma_mask = DMA_BIT_MASK(32),
273 },
274 .resource = ssp2_resources,
275 .num_resources = ARRAY_SIZE(ssp2_resources),
276};
277
278static struct resource fb_resource[] = {
279 {
280 .flags = IORESOURCE_IRQ,
281 .start = IRQ_LCDIF_DMA,
282 .end = IRQ_LCDIF_DMA,
283 }, {
284 .flags = IORESOURCE_IRQ,
285 .start = IRQ_LCDIF_ERROR,
286 .end = IRQ_LCDIF_ERROR,
287 }, {
288 .flags = IORESOURCE_MEM,
289 .start = REGS_LCDIF_PHYS,
290 .end = REGS_LCDIF_PHYS + REGS_LCDIF_SIZE,
291 },
292};
293
294struct platform_device stmp3xxx_framebuffer = {
295 .name = "stmp3xxx-fb",
296 .id = -1,
297 .dev = {
298 .dma_mask = &common_dmamask,
299 .coherent_dma_mask = DMA_BIT_MASK(32),
300 },
301 .num_resources = ARRAY_SIZE(fb_resource),
302 .resource = fb_resource,
303};
304
305#define CMDLINE_DEVICE_CHOOSE(name, dev1, dev2) \
306 static char *cmdline_device_##name; \
307 static int cmdline_device_##name##_setup(char *dev) \
308 { \
309 cmdline_device_##name = dev + 1; \
310 return 0; \
311 } \
312 __setup(#name, cmdline_device_##name##_setup); \
313 int stmp3xxx_##name##_device_register(void) \
314 { \
315 struct platform_device *d = NULL; \
316 if (!cmdline_device_##name || \
317 !strcmp(cmdline_device_##name, #dev1)) \
318 d = &stmp3xxx_##dev1; \
319 else if (!strcmp(cmdline_device_##name, #dev2)) \
320 d = &stmp3xxx_##dev2; \
321 else \
322 printk(KERN_ERR"Unknown %s assignment '%s'.\n", \
323 #name, cmdline_device_##name); \
324 return d ? platform_device_register(d) : -ENOENT; \
325 }
326
327CMDLINE_DEVICE_CHOOSE(ssp1, mmc, spi1)
328CMDLINE_DEVICE_CHOOSE(ssp2, gpmi, spi2)
329
330struct platform_device stmp3xxx_backlight = {
331 .name = "stmp3xxx-bl",
332 .id = -1,
333};
334
335struct platform_device stmp3xxx_rotdec = {
336 .name = "stmp3xxx-rotdec",
337 .id = -1,
338};
339
340struct platform_device stmp3xxx_persistent = {
341 .name = "stmp3xxx-persistent",
342 .id = -1,
343};
344
345struct platform_device stmp3xxx_dcp_bootstream = {
346 .name = "stmp3xxx-dcpboot",
347 .id = -1,
348 .dev = {
349 .dma_mask = &common_dmamask,
350 .coherent_dma_mask = DMA_BIT_MASK(32),
351 },
352};
353
354static struct resource dcp_resources[] = {
355 {
356 .start = IRQ_DCP_VMI,
357 .end = IRQ_DCP_VMI,
358 .flags = IORESOURCE_IRQ,
359 }, {
360 .start = IRQ_DCP,
361 .end = IRQ_DCP,
362 .flags = IORESOURCE_IRQ,
363 },
364};
365
366struct platform_device stmp3xxx_dcp = {
367 .name = "stmp3xxx-dcp",
368 .id = -1,
369 .resource = dcp_resources,
370 .num_resources = ARRAY_SIZE(dcp_resources),
371 .dev = {
372 .dma_mask = &common_dmamask,
373 .coherent_dma_mask = DMA_BIT_MASK(32),
374 },
375};
376
377static struct resource battery_resource[] = {
378 {
379 .flags = IORESOURCE_IRQ,
380 .start = IRQ_VDD5V,
381 .end = IRQ_VDD5V,
382 },
383};
384
385struct platform_device stmp3xxx_battery = {
386 .name = "stmp3xxx-battery",
387 .resource = battery_resource,
388 .num_resources = ARRAY_SIZE(battery_resource),
389};
diff --git a/arch/arm/plat-stmp3xxx/dma.c b/arch/arm/plat-stmp3xxx/dma.c
deleted file mode 100644
index b4dcf8c0477d..000000000000
--- a/arch/arm/plat-stmp3xxx/dma.c
+++ /dev/null
@@ -1,464 +0,0 @@
1/*
2 * DMA helper routines for Freescale STMP37XX/STMP378X
3 *
4 * Author: dmitry pervushin <dpervushin@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#include <linux/gfp.h>
19#include <linux/kernel.h>
20#include <linux/device.h>
21#include <linux/dmapool.h>
22#include <linux/sysdev.h>
23#include <linux/cpufreq.h>
24
25#include <asm/page.h>
26
27#include <mach/platform.h>
28#include <mach/dma.h>
29#include <mach/regs-apbx.h>
30#include <mach/regs-apbh.h>
31
32static const size_t pool_item_size = sizeof(struct stmp3xxx_dma_command);
33static const size_t pool_alignment = 8;
34static struct stmp3xxx_dma_user {
35 void *pool;
36 int inuse;
37 const char *name;
38} channels[MAX_DMA_CHANNELS];
39
40#define IS_VALID_CHANNEL(ch) ((ch) >= 0 && (ch) < MAX_DMA_CHANNELS)
41#define IS_USED(ch) (channels[ch].inuse)
42
43int stmp3xxx_dma_request(int ch, struct device *dev, const char *name)
44{
45 struct stmp3xxx_dma_user *user;
46 int err = 0;
47
48 user = channels + ch;
49 if (!IS_VALID_CHANNEL(ch)) {
50 err = -ENODEV;
51 goto out;
52 }
53 if (IS_USED(ch)) {
54 err = -EBUSY;
55 goto out;
56 }
57 /* Create a pool to allocate dma commands from */
58 user->pool = dma_pool_create(name, dev, pool_item_size,
59 pool_alignment, PAGE_SIZE);
60 if (user->pool == NULL) {
61 err = -ENOMEM;
62 goto out;
63 }
64 user->name = name;
65 user->inuse++;
66out:
67 return err;
68}
69EXPORT_SYMBOL(stmp3xxx_dma_request);
70
71int stmp3xxx_dma_release(int ch)
72{
73 struct stmp3xxx_dma_user *user = channels + ch;
74 int err = 0;
75
76 if (!IS_VALID_CHANNEL(ch)) {
77 err = -ENODEV;
78 goto out;
79 }
80 if (!IS_USED(ch)) {
81 err = -EBUSY;
82 goto out;
83 }
84 BUG_ON(user->pool == NULL);
85 dma_pool_destroy(user->pool);
86 user->inuse--;
87out:
88 return err;
89}
90EXPORT_SYMBOL(stmp3xxx_dma_release);
91
92int stmp3xxx_dma_read_semaphore(int channel)
93{
94 int sem = -1;
95
96 switch (STMP3XXX_DMA_BUS(channel)) {
97 case STMP3XXX_BUS_APBH:
98 sem = __raw_readl(REGS_APBH_BASE + HW_APBH_CHn_SEMA +
99 STMP3XXX_DMA_CHANNEL(channel) * 0x70);
100 sem &= BM_APBH_CHn_SEMA_PHORE;
101 sem >>= BP_APBH_CHn_SEMA_PHORE;
102 break;
103
104 case STMP3XXX_BUS_APBX:
105 sem = __raw_readl(REGS_APBX_BASE + HW_APBX_CHn_SEMA +
106 STMP3XXX_DMA_CHANNEL(channel) * 0x70);
107 sem &= BM_APBX_CHn_SEMA_PHORE;
108 sem >>= BP_APBX_CHn_SEMA_PHORE;
109 break;
110 default:
111 BUG();
112 }
113 return sem;
114}
115EXPORT_SYMBOL(stmp3xxx_dma_read_semaphore);
116
117int stmp3xxx_dma_allocate_command(int channel,
118 struct stmp3xxx_dma_descriptor *descriptor)
119{
120 struct stmp3xxx_dma_user *user = channels + channel;
121 int err = 0;
122
123 if (!IS_VALID_CHANNEL(channel)) {
124 err = -ENODEV;
125 goto out;
126 }
127 if (!IS_USED(channel)) {
128 err = -EBUSY;
129 goto out;
130 }
131 if (descriptor == NULL) {
132 err = -EINVAL;
133 goto out;
134 }
135
136 /* Allocate memory for a command from the buffer */
137 descriptor->command =
138 dma_pool_alloc(user->pool, GFP_KERNEL, &descriptor->handle);
139
140 /* Check it worked */
141 if (!descriptor->command) {
142 err = -ENOMEM;
143 goto out;
144 }
145
146 memset(descriptor->command, 0, pool_item_size);
147out:
148 WARN_ON(err);
149 return err;
150}
151EXPORT_SYMBOL(stmp3xxx_dma_allocate_command);
152
153int stmp3xxx_dma_free_command(int channel,
154 struct stmp3xxx_dma_descriptor *descriptor)
155{
156 int err = 0;
157
158 if (!IS_VALID_CHANNEL(channel)) {
159 err = -ENODEV;
160 goto out;
161 }
162 if (!IS_USED(channel)) {
163 err = -EBUSY;
164 goto out;
165 }
166
167 /* Return the command memory to the pool */
168 dma_pool_free(channels[channel].pool, descriptor->command,
169 descriptor->handle);
170
171 /* Initialise descriptor so we're not tempted to use it */
172 descriptor->command = NULL;
173 descriptor->handle = 0;
174 descriptor->virtual_buf_ptr = NULL;
175 descriptor->next_descr = NULL;
176
177 WARN_ON(err);
178out:
179 return err;
180}
181EXPORT_SYMBOL(stmp3xxx_dma_free_command);
182
183void stmp3xxx_dma_go(int channel,
184 struct stmp3xxx_dma_descriptor *head, u32 semaphore)
185{
186 int ch = STMP3XXX_DMA_CHANNEL(channel);
187 void __iomem *c, *s;
188
189 switch (STMP3XXX_DMA_BUS(channel)) {
190 case STMP3XXX_BUS_APBH:
191 c = REGS_APBH_BASE + HW_APBH_CHn_NXTCMDAR + 0x70 * ch;
192 s = REGS_APBH_BASE + HW_APBH_CHn_SEMA + 0x70 * ch;
193 break;
194
195 case STMP3XXX_BUS_APBX:
196 c = REGS_APBX_BASE + HW_APBX_CHn_NXTCMDAR + 0x70 * ch;
197 s = REGS_APBX_BASE + HW_APBX_CHn_SEMA + 0x70 * ch;
198 break;
199
200 default:
201 return;
202 }
203
204 /* Set next command */
205 __raw_writel(head->handle, c);
206 /* Set counting semaphore (kicks off transfer). Assumes
207 peripheral has been set up correctly */
208 __raw_writel(semaphore, s);
209}
210EXPORT_SYMBOL(stmp3xxx_dma_go);
211
212int stmp3xxx_dma_running(int channel)
213{
214 switch (STMP3XXX_DMA_BUS(channel)) {
215 case STMP3XXX_BUS_APBH:
216 return (__raw_readl(REGS_APBH_BASE + HW_APBH_CHn_SEMA +
217 0x70 * STMP3XXX_DMA_CHANNEL(channel))) &
218 BM_APBH_CHn_SEMA_PHORE;
219
220 case STMP3XXX_BUS_APBX:
221 return (__raw_readl(REGS_APBX_BASE + HW_APBX_CHn_SEMA +
222 0x70 * STMP3XXX_DMA_CHANNEL(channel))) &
223 BM_APBX_CHn_SEMA_PHORE;
224 default:
225 BUG();
226 return 0;
227 }
228}
229EXPORT_SYMBOL(stmp3xxx_dma_running);
230
231/*
232 * Circular dma chain management
233 */
234void stmp3xxx_dma_free_chain(struct stmp37xx_circ_dma_chain *chain)
235{
236 int i;
237
238 for (i = 0; i < chain->total_count; i++)
239 stmp3xxx_dma_free_command(
240 STMP3XXX_DMA(chain->channel, chain->bus),
241 &chain->chain[i]);
242}
243EXPORT_SYMBOL(stmp3xxx_dma_free_chain);
244
245int stmp3xxx_dma_make_chain(int ch, struct stmp37xx_circ_dma_chain *chain,
246 struct stmp3xxx_dma_descriptor descriptors[],
247 unsigned items)
248{
249 int i;
250 int err = 0;
251
252 if (items == 0)
253 return err;
254
255 for (i = 0; i < items; i++) {
256 err = stmp3xxx_dma_allocate_command(ch, &descriptors[i]);
257 if (err) {
258 WARN_ON(err);
259 /*
260 * Couldn't allocate the whole chain.
261 * deallocate what has been allocated
262 */
263 if (i) {
264 do {
265 stmp3xxx_dma_free_command(ch,
266 &descriptors
267 [i]);
268 } while (i-- > 0);
269 }
270 return err;
271 }
272
273 /* link them! */
274 if (i > 0) {
275 descriptors[i - 1].next_descr = &descriptors[i];
276 descriptors[i - 1].command->next =
277 descriptors[i].handle;
278 }
279 }
280
281 /* make list circular */
282 descriptors[items - 1].next_descr = &descriptors[0];
283 descriptors[items - 1].command->next = descriptors[0].handle;
284
285 chain->total_count = items;
286 chain->chain = descriptors;
287 chain->free_index = 0;
288 chain->active_index = 0;
289 chain->cooked_index = 0;
290 chain->free_count = items;
291 chain->active_count = 0;
292 chain->cooked_count = 0;
293 chain->bus = STMP3XXX_DMA_BUS(ch);
294 chain->channel = STMP3XXX_DMA_CHANNEL(ch);
295 return err;
296}
297EXPORT_SYMBOL(stmp3xxx_dma_make_chain);
298
299void stmp37xx_circ_clear_chain(struct stmp37xx_circ_dma_chain *chain)
300{
301 BUG_ON(stmp3xxx_dma_running(STMP3XXX_DMA(chain->channel, chain->bus)));
302 chain->free_index = 0;
303 chain->active_index = 0;
304 chain->cooked_index = 0;
305 chain->free_count = chain->total_count;
306 chain->active_count = 0;
307 chain->cooked_count = 0;
308}
309EXPORT_SYMBOL(stmp37xx_circ_clear_chain);
310
311void stmp37xx_circ_advance_free(struct stmp37xx_circ_dma_chain *chain,
312 unsigned count)
313{
314 BUG_ON(chain->cooked_count < count);
315
316 chain->cooked_count -= count;
317 chain->cooked_index += count;
318 chain->cooked_index %= chain->total_count;
319 chain->free_count += count;
320}
321EXPORT_SYMBOL(stmp37xx_circ_advance_free);
322
323void stmp37xx_circ_advance_active(struct stmp37xx_circ_dma_chain *chain,
324 unsigned count)
325{
326 void __iomem *c;
327 u32 mask_clr, mask;
328 BUG_ON(chain->free_count < count);
329
330 chain->free_count -= count;
331 chain->free_index += count;
332 chain->free_index %= chain->total_count;
333 chain->active_count += count;
334
335 switch (chain->bus) {
336 case STMP3XXX_BUS_APBH:
337 c = REGS_APBH_BASE + HW_APBH_CHn_SEMA + 0x70 * chain->channel;
338 mask_clr = BM_APBH_CHn_SEMA_INCREMENT_SEMA;
339 mask = BF(count, APBH_CHn_SEMA_INCREMENT_SEMA);
340 break;
341 case STMP3XXX_BUS_APBX:
342 c = REGS_APBX_BASE + HW_APBX_CHn_SEMA + 0x70 * chain->channel;
343 mask_clr = BM_APBX_CHn_SEMA_INCREMENT_SEMA;
344 mask = BF(count, APBX_CHn_SEMA_INCREMENT_SEMA);
345 break;
346 default:
347 BUG();
348 return;
349 }
350
351 /* Set counting semaphore (kicks off transfer). Assumes
352 peripheral has been set up correctly */
353 stmp3xxx_clearl(mask_clr, c);
354 stmp3xxx_setl(mask, c);
355}
356EXPORT_SYMBOL(stmp37xx_circ_advance_active);
357
358unsigned stmp37xx_circ_advance_cooked(struct stmp37xx_circ_dma_chain *chain)
359{
360 unsigned cooked;
361
362 cooked = chain->active_count -
363 stmp3xxx_dma_read_semaphore(STMP3XXX_DMA(chain->channel, chain->bus));
364
365 chain->active_count -= cooked;
366 chain->active_index += cooked;
367 chain->active_index %= chain->total_count;
368
369 chain->cooked_count += cooked;
370
371 return cooked;
372}
373EXPORT_SYMBOL(stmp37xx_circ_advance_cooked);
374
375void stmp3xxx_dma_set_alt_target(int channel, int function)
376{
377#if defined(CONFIG_ARCH_STMP37XX)
378 unsigned bits = 4;
379#elif defined(CONFIG_ARCH_STMP378X)
380 unsigned bits = 2;
381#else
382#error wrong arch
383#endif
384 int shift = STMP3XXX_DMA_CHANNEL(channel) * bits;
385 unsigned mask = (1<<bits) - 1;
386 void __iomem *c;
387
388 BUG_ON(function < 0 || function >= (1<<bits));
389 pr_debug("%s: channel = %d, using mask %x, "
390 "shift = %d\n", __func__, channel, mask, shift);
391
392 switch (STMP3XXX_DMA_BUS(channel)) {
393 case STMP3XXX_BUS_APBH:
394 c = REGS_APBH_BASE + HW_APBH_DEVSEL;
395 break;
396 case STMP3XXX_BUS_APBX:
397 c = REGS_APBX_BASE + HW_APBX_DEVSEL;
398 break;
399 default:
400 BUG();
401 }
402 stmp3xxx_clearl(mask << shift, c);
403 stmp3xxx_setl(mask << shift, c);
404}
405EXPORT_SYMBOL(stmp3xxx_dma_set_alt_target);
406
407void stmp3xxx_dma_suspend(void)
408{
409 stmp3xxx_setl(BM_APBH_CTRL0_CLKGATE, REGS_APBH_BASE + HW_APBH_CTRL0);
410 stmp3xxx_setl(BM_APBX_CTRL0_CLKGATE, REGS_APBX_BASE + HW_APBX_CTRL0);
411}
412
413void stmp3xxx_dma_resume(void)
414{
415 stmp3xxx_clearl(BM_APBH_CTRL0_CLKGATE | BM_APBH_CTRL0_SFTRST,
416 REGS_APBH_BASE + HW_APBH_CTRL0);
417 stmp3xxx_clearl(BM_APBX_CTRL0_CLKGATE | BM_APBX_CTRL0_SFTRST,
418 REGS_APBX_BASE + HW_APBX_CTRL0);
419}
420
421#ifdef CONFIG_CPU_FREQ
422
423struct dma_notifier_block {
424 struct notifier_block nb;
425 void *data;
426};
427
428static int dma_cpufreq_notifier(struct notifier_block *self,
429 unsigned long phase, void *p)
430{
431 switch (phase) {
432 case CPUFREQ_POSTCHANGE:
433 stmp3xxx_dma_resume();
434 break;
435
436 case CPUFREQ_PRECHANGE:
437 stmp3xxx_dma_suspend();
438 break;
439
440 default:
441 break;
442 }
443
444 return NOTIFY_DONE;
445}
446
447static struct dma_notifier_block dma_cpufreq_nb = {
448 .nb = {
449 .notifier_call = dma_cpufreq_notifier,
450 },
451};
452#endif /* CONFIG_CPU_FREQ */
453
454void __init stmp3xxx_dma_init(void)
455{
456 stmp3xxx_clearl(BM_APBH_CTRL0_CLKGATE | BM_APBH_CTRL0_SFTRST,
457 REGS_APBH_BASE + HW_APBH_CTRL0);
458 stmp3xxx_clearl(BM_APBX_CTRL0_CLKGATE | BM_APBX_CTRL0_SFTRST,
459 REGS_APBX_BASE + HW_APBX_CTRL0);
460#ifdef CONFIG_CPU_FREQ
461 cpufreq_register_notifier(&dma_cpufreq_nb.nb,
462 CPUFREQ_TRANSITION_NOTIFIER);
463#endif /* CONFIG_CPU_FREQ */
464}
diff --git a/arch/arm/plat-stmp3xxx/include/mach/clkdev.h b/arch/arm/plat-stmp3xxx/include/mach/clkdev.h
deleted file mode 100644
index f9c39772d7c5..000000000000
--- a/arch/arm/plat-stmp3xxx/include/mach/clkdev.h
+++ /dev/null
@@ -1,18 +0,0 @@
1/*
2 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
4 *
5 * The code contained herein is licensed under the GNU General Public
6 * License. You may obtain a copy of the GNU General Public License
7 * Version 2 or later at the following locations:
8 *
9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html
11 */
12#ifndef __ASM_MACH_CLKDEV_H
13#define __ASM_MACH_CLKDEV_H
14
15#define __clk_get(clk) ({ 1; })
16#define __clk_put(clk) do { } while (0)
17
18#endif
diff --git a/arch/arm/plat-stmp3xxx/include/mach/cputype.h b/arch/arm/plat-stmp3xxx/include/mach/cputype.h
deleted file mode 100644
index b4e205b95f2c..000000000000
--- a/arch/arm/plat-stmp3xxx/include/mach/cputype.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/*
2 * Freescale STMP37XX/STMP378X CPU type detection
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __ASM_PLAT_CPU_H
19#define __ASM_PLAT_CPU_H
20
21#ifdef CONFIG_ARCH_STMP37XX
22#define cpu_is_stmp37xx() (1)
23#else
24#define cpu_is_stmp37xx() (0)
25#endif
26
27#ifdef CONFIG_ARCH_STMP378X
28#define cpu_is_stmp378x() (1)
29#else
30#define cpu_is_stmp378x() (0)
31#endif
32
33#endif /* __ASM_PLAT_CPU_H */
diff --git a/arch/arm/plat-stmp3xxx/include/mach/debug-macro.S b/arch/arm/plat-stmp3xxx/include/mach/debug-macro.S
deleted file mode 100644
index d3a0985c9681..000000000000
--- a/arch/arm/plat-stmp3xxx/include/mach/debug-macro.S
+++ /dev/null
@@ -1,39 +0,0 @@
1/*
2 * Debugging macro include header
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18
19 .macro addruart, rp, rv
20 mov \rp, #0x00070000
21 add \rv, \rp, #0xf0000000 @ virtual base
22 add \rp, \rp, #0x80000000 @ physical base
23 .endm
24
25 .macro senduart,rd,rx
26 strb \rd, [\rx, #0] @ data register at 0
27 .endm
28
29 .macro waituart,rd,rx
301001: ldr \rd, [\rx, #0x18] @ UARTFLG
31 tst \rd, #1 << 5 @ UARTFLGUTXFF - 1 when full
32 bne 1001b
33 .endm
34
35 .macro busyuart,rd,rx
361001: ldr \rd, [\rx, #0x18] @ UARTFLG
37 tst \rd, #1 << 3 @ UARTFLGUBUSY - 1 when busy
38 bne 1001b
39 .endm
diff --git a/arch/arm/plat-stmp3xxx/include/mach/dma.h b/arch/arm/plat-stmp3xxx/include/mach/dma.h
deleted file mode 100644
index 7c58557c6766..000000000000
--- a/arch/arm/plat-stmp3xxx/include/mach/dma.h
+++ /dev/null
@@ -1,153 +0,0 @@
1/*
2 * Freescale STMP37XX/STMP378X DMA helper interface
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __ASM_PLAT_STMP3XXX_DMA_H
19#define __ASM_PLAT_STMP3XXX_DMA_H
20
21#include <linux/platform_device.h>
22#include <linux/dmapool.h>
23
24#if !defined(MAX_PIO_WORDS)
25#define MAX_PIO_WORDS (15)
26#endif
27
28#define STMP3XXX_BUS_APBH 0
29#define STMP3XXX_BUS_APBX 1
30#define STMP3XXX_DMA_MAX_CHANNEL 16
31#define STMP3XXX_DMA_BUS(dma) ((dma) / 16)
32#define STMP3XXX_DMA_CHANNEL(dma) ((dma) % 16)
33#define STMP3XXX_DMA(channel, bus) ((bus) * 16 + (channel))
34#define MAX_DMA_ADDRESS 0xffffffff
35#define MAX_DMA_CHANNELS 32
36
37struct stmp3xxx_dma_command {
38 u32 next;
39 u32 cmd;
40 union {
41 u32 buf_ptr;
42 u32 alternate;
43 };
44 u32 pio_words[MAX_PIO_WORDS];
45};
46
47struct stmp3xxx_dma_descriptor {
48 struct stmp3xxx_dma_command *command;
49 dma_addr_t handle;
50
51 /* The virtual address of the buffer pointer */
52 void *virtual_buf_ptr;
53 /* The next descriptor in a the DMA chain (optional) */
54 struct stmp3xxx_dma_descriptor *next_descr;
55};
56
57struct stmp37xx_circ_dma_chain {
58 unsigned total_count;
59 struct stmp3xxx_dma_descriptor *chain;
60
61 unsigned free_index;
62 unsigned free_count;
63 unsigned active_index;
64 unsigned active_count;
65 unsigned cooked_index;
66 unsigned cooked_count;
67
68 int bus;
69 unsigned channel;
70};
71
72static inline struct stmp3xxx_dma_descriptor
73 *stmp3xxx_dma_circ_get_free_head(struct stmp37xx_circ_dma_chain *chain)
74{
75 return &(chain->chain[chain->free_index]);
76}
77
78static inline struct stmp3xxx_dma_descriptor
79 *stmp3xxx_dma_circ_get_cooked_head(struct stmp37xx_circ_dma_chain *chain)
80{
81 return &(chain->chain[chain->cooked_index]);
82}
83
84int stmp3xxx_dma_request(int ch, struct device *dev, const char *name);
85int stmp3xxx_dma_release(int ch);
86int stmp3xxx_dma_allocate_command(int ch,
87 struct stmp3xxx_dma_descriptor *descriptor);
88int stmp3xxx_dma_free_command(int ch,
89 struct stmp3xxx_dma_descriptor *descriptor);
90void stmp3xxx_dma_continue(int channel, u32 semaphore);
91void stmp3xxx_dma_go(int ch, struct stmp3xxx_dma_descriptor *head,
92 u32 semaphore);
93int stmp3xxx_dma_running(int ch);
94int stmp3xxx_dma_make_chain(int ch, struct stmp37xx_circ_dma_chain *chain,
95 struct stmp3xxx_dma_descriptor descriptors[],
96 unsigned items);
97void stmp3xxx_dma_free_chain(struct stmp37xx_circ_dma_chain *chain);
98void stmp37xx_circ_clear_chain(struct stmp37xx_circ_dma_chain *chain);
99void stmp37xx_circ_advance_free(struct stmp37xx_circ_dma_chain *chain,
100 unsigned count);
101void stmp37xx_circ_advance_active(struct stmp37xx_circ_dma_chain *chain,
102 unsigned count);
103unsigned stmp37xx_circ_advance_cooked(struct stmp37xx_circ_dma_chain *chain);
104int stmp3xxx_dma_read_semaphore(int ch);
105void stmp3xxx_dma_init(void);
106void stmp3xxx_dma_set_alt_target(int ch, int target);
107void stmp3xxx_dma_suspend(void);
108void stmp3xxx_dma_resume(void);
109
110/*
111 * STMP37xx and STMP378x have different DMA control
112 * registers layout
113 */
114
115void stmp3xxx_arch_dma_freeze(int ch);
116void stmp3xxx_arch_dma_unfreeze(int ch);
117void stmp3xxx_arch_dma_reset_channel(int ch);
118void stmp3xxx_arch_dma_enable_interrupt(int ch);
119void stmp3xxx_arch_dma_clear_interrupt(int ch);
120int stmp3xxx_arch_dma_is_interrupt(int ch);
121
122static inline void stmp3xxx_dma_reset_channel(int ch)
123{
124 stmp3xxx_arch_dma_reset_channel(ch);
125}
126
127
128static inline void stmp3xxx_dma_freeze(int ch)
129{
130 stmp3xxx_arch_dma_freeze(ch);
131}
132
133static inline void stmp3xxx_dma_unfreeze(int ch)
134{
135 stmp3xxx_arch_dma_unfreeze(ch);
136}
137
138static inline void stmp3xxx_dma_enable_interrupt(int ch)
139{
140 stmp3xxx_arch_dma_enable_interrupt(ch);
141}
142
143static inline void stmp3xxx_dma_clear_interrupt(int ch)
144{
145 stmp3xxx_arch_dma_clear_interrupt(ch);
146}
147
148static inline int stmp3xxx_dma_is_interrupt(int ch)
149{
150 return stmp3xxx_arch_dma_is_interrupt(ch);
151}
152
153#endif /* __ASM_PLAT_STMP3XXX_DMA_H */
diff --git a/arch/arm/plat-stmp3xxx/include/mach/gpio.h b/arch/arm/plat-stmp3xxx/include/mach/gpio.h
deleted file mode 100644
index a8b579256170..000000000000
--- a/arch/arm/plat-stmp3xxx/include/mach/gpio.h
+++ /dev/null
@@ -1,28 +0,0 @@
1/*
2 * Freescale STMP37XX/STMP378X GPIO interface
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __ASM_PLAT_GPIO_H
19#define __ASM_PLAT_GPIO_H
20
21#define ARCH_NR_GPIOS (32 * 3)
22#define gpio_to_irq(gpio) __gpio_to_irq(gpio)
23#define gpio_get_value(gpio) __gpio_get_value(gpio)
24#define gpio_set_value(gpio, value) __gpio_set_value(gpio, value)
25
26#include <asm-generic/gpio.h>
27
28#endif /* __ASM_PLAT_GPIO_H */
diff --git a/arch/arm/plat-stmp3xxx/include/mach/gpmi.h b/arch/arm/plat-stmp3xxx/include/mach/gpmi.h
deleted file mode 100644
index e166432910ad..000000000000
--- a/arch/arm/plat-stmp3xxx/include/mach/gpmi.h
+++ /dev/null
@@ -1,12 +0,0 @@
1#ifndef __MACH_GPMI_H
2
3#include <linux/mtd/partitions.h>
4#include <mach/regs-gpmi.h>
5
6struct gpmi_platform_data {
7 void *pins;
8 int nr_parts;
9 struct mtd_partition *parts;
10 const char *part_types[];
11};
12#endif
diff --git a/arch/arm/plat-stmp3xxx/include/mach/hardware.h b/arch/arm/plat-stmp3xxx/include/mach/hardware.h
deleted file mode 100644
index 47b8978405bc..000000000000
--- a/arch/arm/plat-stmp3xxx/include/mach/hardware.h
+++ /dev/null
@@ -1,32 +0,0 @@
1/*
2 * This file contains the hardware definitions of the Freescale STMP3XXX
3 *
4 * Copyright (C) 2005 Sigmatel Inc
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __ASM_ARCH_HARDWARE_H
19#define __ASM_ARCH_HARDWARE_H
20
21/*
22 * Where in virtual memory the IO devices (timers, system controllers
23 * and so on)
24 */
25#define IO_BASE 0xF0000000 /* VA of IO */
26#define IO_SIZE 0x00100000 /* How much? */
27#define IO_START 0x80000000 /* PA of IO */
28
29/* macro to get at IO space when running virtually */
30#define IO_ADDRESS(x) (((x) & 0x000fffff) | IO_BASE)
31
32#endif
diff --git a/arch/arm/plat-stmp3xxx/include/mach/io.h b/arch/arm/plat-stmp3xxx/include/mach/io.h
deleted file mode 100644
index d08b1b7f3d1c..000000000000
--- a/arch/arm/plat-stmp3xxx/include/mach/io.h
+++ /dev/null
@@ -1,25 +0,0 @@
1/*
2 * Copyright (C) 2005 Sigmatel Inc
3 *
4 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 */
7
8/*
9 * The code contained herein is licensed under the GNU General Public
10 * License. You may obtain a copy of the GNU General Public License
11 * Version 2 or later at the following locations:
12 *
13 * http://www.opensource.org/licenses/gpl-license.html
14 * http://www.gnu.org/copyleft/gpl.html
15 */
16#ifndef __ASM_ARM_ARCH_IO_H
17#define __ASM_ARM_ARCH_IO_H
18
19#define IO_SPACE_LIMIT 0xffffffff
20
21#define __io(a) __typesafe_io(a)
22#define __mem_pci(a) (a)
23#define __mem_isa(a) (a)
24
25#endif
diff --git a/arch/arm/plat-stmp3xxx/include/mach/memory.h b/arch/arm/plat-stmp3xxx/include/mach/memory.h
deleted file mode 100644
index 61fa54882e12..000000000000
--- a/arch/arm/plat-stmp3xxx/include/mach/memory.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/*
2 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
4 */
5
6/*
7 * The code contained herein is licensed under the GNU General Public
8 * License. You may obtain a copy of the GNU General Public License
9 * Version 2 or later at the following locations:
10 *
11 * http://www.opensource.org/licenses/gpl-license.html
12 * http://www.gnu.org/copyleft/gpl.html
13 */
14#ifndef __ASM_ARCH_MEMORY_H
15#define __ASM_ARCH_MEMORY_H
16
17/*
18 * Physical DRAM offset.
19 */
20#define PLAT_PHYS_OFFSET UL(0x40000000)
21
22#endif
diff --git a/arch/arm/plat-stmp3xxx/include/mach/mmc.h b/arch/arm/plat-stmp3xxx/include/mach/mmc.h
deleted file mode 100644
index ba81e1543761..000000000000
--- a/arch/arm/plat-stmp3xxx/include/mach/mmc.h
+++ /dev/null
@@ -1,14 +0,0 @@
1#ifndef _MACH_MMC_H
2#define _MACH_MMC_H
3
4#include <mach/regs-ssp.h>
5
6struct stmp3xxxmmc_platform_data {
7 int (*get_wp)(void);
8 unsigned long (*setclock)(void __iomem *base, unsigned long);
9 void (*cmd_pullup)(int);
10 int (*hw_init)(void);
11 void (*hw_release)(void);
12};
13
14#endif
diff --git a/arch/arm/plat-stmp3xxx/include/mach/pinmux.h b/arch/arm/plat-stmp3xxx/include/mach/pinmux.h
deleted file mode 100644
index cc5af82279ad..000000000000
--- a/arch/arm/plat-stmp3xxx/include/mach/pinmux.h
+++ /dev/null
@@ -1,157 +0,0 @@
1/*
2 * Freescale STMP37XX/STMP378X Pin Multiplexing
3 *
4 * Author: Vladislav Buzov <vbuzov@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __PINMUX_H
19#define __PINMUX_H
20
21#include <linux/spinlock.h>
22#include <linux/types.h>
23#include <linux/gpio.h>
24#include <asm-generic/gpio.h>
25
26/* Pin definitions */
27#include "pins.h"
28#include <mach/pins.h>
29
30/*
31 * Each pin may be routed up to four different HW interfaces
32 * including GPIO
33 */
34enum pin_fun {
35 PIN_FUN1 = 0,
36 PIN_FUN2,
37 PIN_FUN3,
38 PIN_GPIO,
39};
40
41/*
42 * Each pin may have different output drive strength in range from
43 * 4mA to 20mA. The most common case is 4, 8 and 12 mA strengths.
44 */
45enum pin_strength {
46 PIN_4MA = 0,
47 PIN_8MA,
48 PIN_12MA,
49 PIN_16MA,
50 PIN_20MA,
51};
52
53/*
54 * Each pin can be programmed for 1.8V or 3.3V
55 */
56enum pin_voltage {
57 PIN_1_8V = 0,
58 PIN_3_3V,
59};
60
61/*
62 * Structure to define a group of pins and their parameters
63 */
64struct pin_desc {
65 unsigned id;
66 enum pin_fun fun;
67 enum pin_strength strength;
68 enum pin_voltage voltage;
69 unsigned pullup:1;
70};
71
72struct pin_group {
73 struct pin_desc *pins;
74 int nr_pins;
75};
76
77/* Set pin drive strength */
78void stmp3xxx_pin_strength(unsigned id, enum pin_strength strength,
79 const char *label);
80
81/* Set pin voltage */
82void stmp3xxx_pin_voltage(unsigned id, enum pin_voltage voltage,
83 const char *label);
84
85/* Enable pull-up resistor for a pin */
86void stmp3xxx_pin_pullup(unsigned id, int enable, const char *label);
87
88/*
89 * Request a pin ownership, only one module (identified by @label)
90 * may own a pin.
91 */
92int stmp3xxx_request_pin(unsigned id, enum pin_fun fun, const char *label);
93
94/* Release pin */
95void stmp3xxx_release_pin(unsigned id, const char *label);
96
97void stmp3xxx_set_pin_type(unsigned id, enum pin_fun fun);
98
99/*
100 * Each bank is associated with a number of registers to control
101 * pin function, drive strength, voltage and pull-up reigster. The
102 * number of registers of a given type depends on the number of bits
103 * describin particular pin.
104 */
105#define HW_MUXSEL_NUM 2 /* registers per bank */
106#define HW_MUXSEL_PIN_LEN 2 /* bits per pin */
107#define HW_MUXSEL_PIN_NUM 16 /* pins per register */
108#define HW_MUXSEL_PINFUN_MASK 0x3 /* pin function mask */
109#define HW_MUXSEL_PINFUN_NUM 4 /* four options for a pin */
110
111#define HW_DRIVE_NUM 4 /* registers per bank */
112#define HW_DRIVE_PIN_LEN 4 /* bits per pin */
113#define HW_DRIVE_PIN_NUM 8 /* pins per register */
114#define HW_DRIVE_PINDRV_MASK 0x3 /* pin strength mask - 2 bits */
115#define HW_DRIVE_PINDRV_NUM 5 /* five possible strength values */
116#define HW_DRIVE_PINV_MASK 0x4 /* pin voltage mask - 1 bit */
117
118
119struct stmp3xxx_pinmux_bank {
120 struct gpio_chip chip;
121
122 /* Pins allocation map */
123 unsigned long pin_map;
124
125 /* Pin owner names */
126 const char *pin_labels[32];
127
128 /* Bank registers */
129 void __iomem *hw_muxsel[HW_MUXSEL_NUM];
130 void __iomem *hw_drive[HW_DRIVE_NUM];
131 void __iomem *hw_pull;
132
133 void __iomem *pin2irq,
134 *irqlevel,
135 *irqpolarity,
136 *irqen,
137 *irqstat;
138
139 /* HW MUXSEL register function bit values */
140 u8 functions[HW_MUXSEL_PINFUN_NUM];
141
142 /*
143 * HW DRIVE register strength bit values:
144 * 0xff - requested strength is not supported for this bank
145 */
146 u8 strengths[HW_DRIVE_PINDRV_NUM];
147
148 /* GPIO things */
149 void __iomem *hw_gpio_in,
150 *hw_gpio_out,
151 *hw_gpio_doe;
152 int irq, virq;
153};
154
155int __init stmp3xxx_pinmux_init(int virtual_irq_start);
156
157#endif /* __PINMUX_H */
diff --git a/arch/arm/plat-stmp3xxx/include/mach/pins.h b/arch/arm/plat-stmp3xxx/include/mach/pins.h
deleted file mode 100644
index c573318e1caa..000000000000
--- a/arch/arm/plat-stmp3xxx/include/mach/pins.h
+++ /dev/null
@@ -1,30 +0,0 @@
1/*
2 * Freescale STMP37XX/STMP378X Pin multiplexing interface definitions
3 *
4 * Author: Vladislav Buzov <vbuzov@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __ASM_PLAT_PINS_H
19#define __ASM_PLAT_PINS_H
20
21#define STMP3XXX_PINID(bank, pin) (bank * 32 + pin)
22#define STMP3XXX_PINID_TO_BANK(pinid) (pinid / 32)
23#define STMP3XXX_PINID_TO_PINNUM(pinid) (pinid % 32)
24
25/*
26 * Special invalid pin identificator to show a pin doesn't exist
27 */
28#define PINID_NO_PIN STMP3XXX_PINID(0xFF, 0xFF)
29
30#endif /* __ASM_PLAT_PINS_H */
diff --git a/arch/arm/plat-stmp3xxx/include/mach/platform.h b/arch/arm/plat-stmp3xxx/include/mach/platform.h
deleted file mode 100644
index 7007ddaa91eb..000000000000
--- a/arch/arm/plat-stmp3xxx/include/mach/platform.h
+++ /dev/null
@@ -1,68 +0,0 @@
1/*
2 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
4 */
5
6/*
7 * The code contained herein is licensed under the GNU General Public
8 * License. You may obtain a copy of the GNU General Public License
9 * Version 2 or later at the following locations:
10 *
11 * http://www.opensource.org/licenses/gpl-license.html
12 * http://www.gnu.org/copyleft/gpl.html
13 */
14#ifndef __ASM_PLAT_PLATFORM_H
15#define __ASM_PLAT_PLATFORM_H
16
17#ifndef __ASSEMBLER__
18#include <linux/io.h>
19#endif
20#include <asm/sizes.h>
21
22/* Virtual address where registers are mapped */
23#define STMP3XXX_REGS_PHBASE 0x80000000
24#ifdef __ASSEMBLER__
25#define STMP3XXX_REGS_BASE 0xF0000000
26#else
27#define STMP3XXX_REGS_BASE (void __iomem *)0xF0000000
28#endif
29#define STMP3XXX_REGS_SIZE SZ_1M
30
31/* Virtual address where OCRAM is mapped */
32#define STMP3XXX_OCRAM_PHBASE 0x00000000
33#ifdef __ASSEMBLER__
34#define STMP3XXX_OCRAM_BASE 0xf1000000
35#else
36#define STMP3XXX_OCRAM_BASE (void __iomem *)0xf1000000
37#endif
38#define STMP3XXX_OCRAM_SIZE (32 * SZ_1K)
39
40#ifdef CONFIG_ARCH_STMP37XX
41#define IRQ_PRIORITY_REG_RD HW_ICOLL_PRIORITYn_RD
42#define IRQ_PRIORITY_REG_WR HW_ICOLL_PRIORITYn_WR
43#endif
44
45#ifdef CONFIG_ARCH_STMP378X
46#define IRQ_PRIORITY_REG_RD HW_ICOLL_INTERRUPTn_RD
47#define IRQ_PRIORITY_REG_WR HW_ICOLL_INTERRUPTn_WR
48#endif
49
50#define HW_STMP3XXX_SET 0x04
51#define HW_STMP3XXX_CLR 0x08
52#define HW_STMP3XXX_TOG 0x0c
53
54#ifndef __ASSEMBLER__
55static inline void stmp3xxx_clearl(u32 v, void __iomem *r)
56{
57 __raw_writel(v, r + HW_STMP3XXX_CLR);
58}
59
60static inline void stmp3xxx_setl(u32 v, void __iomem *r)
61{
62 __raw_writel(v, r + HW_STMP3XXX_SET);
63}
64#endif
65
66#define BF(value, field) (((value) << BP_##field) & BM_##field)
67
68#endif /* __ASM_ARCH_PLATFORM_H */
diff --git a/arch/arm/plat-stmp3xxx/include/mach/stmp3xxx.h b/arch/arm/plat-stmp3xxx/include/mach/stmp3xxx.h
deleted file mode 100644
index 2e300feaa4cf..000000000000
--- a/arch/arm/plat-stmp3xxx/include/mach/stmp3xxx.h
+++ /dev/null
@@ -1,54 +0,0 @@
1/*
2 * Freescale STMP37XX/STMP378X core structure and function declarations
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#ifndef __ASM_PLAT_STMP3XXX_H
19#define __ASM_PLAT_STMP3XXX_H
20
21#include <linux/irq.h>
22
23extern struct sys_timer stmp3xxx_timer;
24
25void stmp3xxx_init_irq(struct irq_chip *chip);
26void stmp3xxx_init(void);
27int stmp3xxx_reset_block(void __iomem *hwreg, int just_enable);
28extern struct platform_device stmp3xxx_dbguart,
29 stmp3xxx_appuart,
30 stmp3xxx_watchdog,
31 stmp3xxx_touchscreen,
32 stmp3xxx_keyboard,
33 stmp3xxx_gpmi,
34 stmp3xxx_mmc,
35 stmp3xxx_udc,
36 stmp3xxx_ehci,
37 stmp3xxx_rtc,
38 stmp3xxx_spi1,
39 stmp3xxx_spi2,
40 stmp3xxx_backlight,
41 stmp3xxx_rotdec,
42 stmp3xxx_dcp,
43 stmp3xxx_dcp_bootstream,
44 stmp3xxx_persistent,
45 stmp3xxx_framebuffer,
46 stmp3xxx_battery;
47int stmp3xxx_ssp1_device_register(void);
48int stmp3xxx_ssp2_device_register(void);
49
50struct pin_group;
51void stmp3xxx_release_pin_group(struct pin_group *pin_group, const char *label);
52int stmp3xxx_request_pin_group(struct pin_group *pin_group, const char *label);
53
54#endif /* __ASM_PLAT_STMP3XXX_H */
diff --git a/arch/arm/plat-stmp3xxx/include/mach/system.h b/arch/arm/plat-stmp3xxx/include/mach/system.h
deleted file mode 100644
index 28a988889319..000000000000
--- a/arch/arm/plat-stmp3xxx/include/mach/system.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * Copyright (C) 2005 Sigmatel Inc
3 *
4 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 */
7
8/*
9 * The code contained herein is licensed under the GNU General Public
10 * License. You may obtain a copy of the GNU General Public License
11 * Version 2 or later at the following locations:
12 *
13 * http://www.opensource.org/licenses/gpl-license.html
14 * http://www.gnu.org/copyleft/gpl.html
15 */
16#ifndef __ASM_ARCH_SYSTEM_H
17#define __ASM_ARCH_SYSTEM_H
18
19#include <asm/proc-fns.h>
20#include <mach/platform.h>
21#include <mach/regs-clkctrl.h>
22#include <mach/regs-power.h>
23
24static inline void arch_idle(void)
25{
26 /*
27 * This should do all the clock switching
28 * and wait for interrupt tricks
29 */
30
31 cpu_do_idle();
32}
33
34static inline void arch_reset(char mode, const char *cmd)
35{
36 /* Set BATTCHRG to default value */
37 __raw_writel(0x00010000, REGS_POWER_BASE + HW_POWER_CHARGE);
38
39 /* Set MINPWR to default value */
40 __raw_writel(0, REGS_POWER_BASE + HW_POWER_MINPWR);
41
42 /* Reset digital side of chip (but not power or RTC) */
43 __raw_writel(BM_CLKCTRL_RESET_DIG,
44 REGS_CLKCTRL_BASE + HW_CLKCTRL_RESET);
45
46 /* Should not return */
47}
48
49#endif
diff --git a/arch/arm/plat-stmp3xxx/include/mach/timex.h b/arch/arm/plat-stmp3xxx/include/mach/timex.h
deleted file mode 100644
index 3373985d7a8e..000000000000
--- a/arch/arm/plat-stmp3xxx/include/mach/timex.h
+++ /dev/null
@@ -1,20 +0,0 @@
1/*
2 * Copyright (C) 1999 ARM Limited
3 *
4 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
5 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
6 */
7
8/*
9 * The code contained herein is licensed under the GNU General Public
10 * License. You may obtain a copy of the GNU General Public License
11 * Version 2 or later at the following locations:
12 *
13 * http://www.opensource.org/licenses/gpl-license.html
14 * http://www.gnu.org/copyleft/gpl.html
15 */
16
17/*
18 * System time clock is sourced from the 32k clock
19 */
20#define CLOCK_TICK_RATE (32768)
diff --git a/arch/arm/plat-stmp3xxx/include/mach/uncompress.h b/arch/arm/plat-stmp3xxx/include/mach/uncompress.h
deleted file mode 100644
index f79f5ee56cd4..000000000000
--- a/arch/arm/plat-stmp3xxx/include/mach/uncompress.h
+++ /dev/null
@@ -1,53 +0,0 @@
1/*
2 *
3 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
4 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
5 */
6
7/*
8 * The code contained herein is licensed under the GNU General Public
9 * License. You may obtain a copy of the GNU General Public License
10 * Version 2 or later at the following locations:
11 *
12 * http://www.opensource.org/licenses/gpl-license.html
13 * http://www.gnu.org/copyleft/gpl.html
14 */
15#ifndef __ASM_PLAT_UNCOMPRESS_H
16#define __ASM_PLAT_UNCOMPRESS_H
17
18/*
19 * Register includes are for when the MMU enabled; we need to define our
20 * own stuff here for pre-MMU use
21 */
22#define UARTDBG_BASE 0x80070000
23#define UART(c) (((volatile unsigned *)UARTDBG_BASE)[c])
24
25/*
26 * This does not append a newline
27 */
28static void putc(char c)
29{
30 /* Wait for TX fifo empty */
31 while ((UART(6) & (1<<7)) == 0)
32 continue;
33
34 /* Write byte */
35 UART(0) = c;
36
37 /* Wait for last bit to exit the UART */
38 while (UART(6) & (1<<3))
39 continue;
40}
41
42static void flush(void)
43{
44}
45
46/*
47 * nothing to do
48 */
49#define arch_decomp_setup()
50
51#define arch_decomp_wdog()
52
53#endif /* __ASM_PLAT_UNCOMPRESS_H */
diff --git a/arch/arm/plat-stmp3xxx/include/mach/vmalloc.h b/arch/arm/plat-stmp3xxx/include/mach/vmalloc.h
deleted file mode 100644
index 943c1a29d641..000000000000
--- a/arch/arm/plat-stmp3xxx/include/mach/vmalloc.h
+++ /dev/null
@@ -1,12 +0,0 @@
1/*
2 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
3 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
4 *
5 * The code contained herein is licensed under the GNU General Public
6 * License. You may obtain a copy of the GNU General Public License
7 * Version 2 or later at the following locations:
8 *
9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html
11 */
12#define VMALLOC_END 0xf0000000UL
diff --git a/arch/arm/plat-stmp3xxx/irq.c b/arch/arm/plat-stmp3xxx/irq.c
deleted file mode 100644
index 6fdf9acf82ed..000000000000
--- a/arch/arm/plat-stmp3xxx/irq.c
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 * Freescale STMP37XX/STMP378X common interrupt handling code
3 *
4 * Author: Vladislav Buzov <vbuzov@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#include <linux/init.h>
19#include <linux/interrupt.h>
20#include <linux/delay.h>
21#include <linux/irq.h>
22#include <linux/sysdev.h>
23
24#include <mach/stmp3xxx.h>
25#include <mach/platform.h>
26#include <mach/regs-icoll.h>
27
28void __init stmp3xxx_init_irq(struct irq_chip *chip)
29{
30 unsigned int i, lv;
31
32 /* Reset the interrupt controller */
33 stmp3xxx_reset_block(REGS_ICOLL_BASE + HW_ICOLL_CTRL, true);
34
35 /* Disable all interrupts initially */
36 for (i = 0; i < NR_REAL_IRQS; i++) {
37 chip->irq_mask(irq_get_irq_data(i));
38 irq_set_chip_and_handler(i, chip, handle_level_irq);
39 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);
40 }
41
42 /* Ensure vector is cleared */
43 for (lv = 0; lv < 4; lv++)
44 __raw_writel(1 << lv, REGS_ICOLL_BASE + HW_ICOLL_LEVELACK);
45 __raw_writel(0, REGS_ICOLL_BASE + HW_ICOLL_VECTOR);
46
47 /* Barrier */
48 (void)__raw_readl(REGS_ICOLL_BASE + HW_ICOLL_STAT);
49}
50
diff --git a/arch/arm/plat-stmp3xxx/pinmux.c b/arch/arm/plat-stmp3xxx/pinmux.c
deleted file mode 100644
index 3def03b3217d..000000000000
--- a/arch/arm/plat-stmp3xxx/pinmux.c
+++ /dev/null
@@ -1,550 +0,0 @@
1/*
2 * Freescale STMP378X/STMP378X Pin Multiplexing
3 *
4 * Author: Vladislav Buzov <vbuzov@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#define DEBUG
19#include <linux/module.h>
20#include <linux/kernel.h>
21#include <linux/errno.h>
22#include <linux/sysdev.h>
23#include <linux/string.h>
24#include <linux/bitops.h>
25#include <linux/irq.h>
26
27#include <mach/hardware.h>
28#include <mach/platform.h>
29#include <mach/regs-pinctrl.h>
30#include <mach/pins.h>
31#include <mach/pinmux.h>
32
33#define NR_BANKS ARRAY_SIZE(pinmux_banks)
34static struct stmp3xxx_pinmux_bank pinmux_banks[] = {
35 [0] = {
36 .hw_muxsel = {
37 REGS_PINCTRL_BASE + HW_PINCTRL_MUXSEL0,
38 REGS_PINCTRL_BASE + HW_PINCTRL_MUXSEL1,
39 },
40 .hw_drive = {
41 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE0,
42 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE1,
43 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE2,
44 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE3,
45 },
46 .hw_pull = REGS_PINCTRL_BASE + HW_PINCTRL_PULL0,
47 .functions = { 0x0, 0x1, 0x2, 0x3 },
48 .strengths = { 0x0, 0x1, 0x2, 0x3, 0xff },
49
50 .hw_gpio_in = REGS_PINCTRL_BASE + HW_PINCTRL_DIN0,
51 .hw_gpio_out = REGS_PINCTRL_BASE + HW_PINCTRL_DOUT0,
52 .hw_gpio_doe = REGS_PINCTRL_BASE + HW_PINCTRL_DOE0,
53 .irq = IRQ_GPIO0,
54
55 .pin2irq = REGS_PINCTRL_BASE + HW_PINCTRL_PIN2IRQ0,
56 .irqstat = REGS_PINCTRL_BASE + HW_PINCTRL_IRQSTAT0,
57 .irqlevel = REGS_PINCTRL_BASE + HW_PINCTRL_IRQLEVEL0,
58 .irqpolarity = REGS_PINCTRL_BASE + HW_PINCTRL_IRQPOL0,
59 .irqen = REGS_PINCTRL_BASE + HW_PINCTRL_IRQEN0,
60 },
61 [1] = {
62 .hw_muxsel = {
63 REGS_PINCTRL_BASE + HW_PINCTRL_MUXSEL2,
64 REGS_PINCTRL_BASE + HW_PINCTRL_MUXSEL3,
65 },
66 .hw_drive = {
67 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE4,
68 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE5,
69 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE6,
70 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE7,
71 },
72 .hw_pull = REGS_PINCTRL_BASE + HW_PINCTRL_PULL1,
73 .functions = { 0x0, 0x1, 0x2, 0x3 },
74 .strengths = { 0x0, 0x1, 0x2, 0x3, 0xff },
75
76 .hw_gpio_in = REGS_PINCTRL_BASE + HW_PINCTRL_DIN1,
77 .hw_gpio_out = REGS_PINCTRL_BASE + HW_PINCTRL_DOUT1,
78 .hw_gpio_doe = REGS_PINCTRL_BASE + HW_PINCTRL_DOE1,
79 .irq = IRQ_GPIO1,
80
81 .pin2irq = REGS_PINCTRL_BASE + HW_PINCTRL_PIN2IRQ1,
82 .irqstat = REGS_PINCTRL_BASE + HW_PINCTRL_IRQSTAT1,
83 .irqlevel = REGS_PINCTRL_BASE + HW_PINCTRL_IRQLEVEL1,
84 .irqpolarity = REGS_PINCTRL_BASE + HW_PINCTRL_IRQPOL1,
85 .irqen = REGS_PINCTRL_BASE + HW_PINCTRL_IRQEN1,
86 },
87 [2] = {
88 .hw_muxsel = {
89 REGS_PINCTRL_BASE + HW_PINCTRL_MUXSEL4,
90 REGS_PINCTRL_BASE + HW_PINCTRL_MUXSEL5,
91 },
92 .hw_drive = {
93 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE8,
94 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE9,
95 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE10,
96 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE11,
97 },
98 .hw_pull = REGS_PINCTRL_BASE + HW_PINCTRL_PULL2,
99 .functions = { 0x0, 0x1, 0x2, 0x3 },
100 .strengths = { 0x0, 0x1, 0x2, 0x1, 0x2 },
101
102 .hw_gpio_in = REGS_PINCTRL_BASE + HW_PINCTRL_DIN2,
103 .hw_gpio_out = REGS_PINCTRL_BASE + HW_PINCTRL_DOUT2,
104 .hw_gpio_doe = REGS_PINCTRL_BASE + HW_PINCTRL_DOE2,
105 .irq = IRQ_GPIO2,
106
107 .pin2irq = REGS_PINCTRL_BASE + HW_PINCTRL_PIN2IRQ2,
108 .irqstat = REGS_PINCTRL_BASE + HW_PINCTRL_IRQSTAT2,
109 .irqlevel = REGS_PINCTRL_BASE + HW_PINCTRL_IRQLEVEL2,
110 .irqpolarity = REGS_PINCTRL_BASE + HW_PINCTRL_IRQPOL2,
111 .irqen = REGS_PINCTRL_BASE + HW_PINCTRL_IRQEN2,
112 },
113 [3] = {
114 .hw_muxsel = {
115 REGS_PINCTRL_BASE + HW_PINCTRL_MUXSEL6,
116 REGS_PINCTRL_BASE + HW_PINCTRL_MUXSEL7,
117 },
118 .hw_drive = {
119 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE12,
120 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE13,
121 REGS_PINCTRL_BASE + HW_PINCTRL_DRIVE14,
122 NULL,
123 },
124 .hw_pull = REGS_PINCTRL_BASE + HW_PINCTRL_PULL3,
125 .functions = {0x0, 0x1, 0x2, 0x3},
126 .strengths = {0x0, 0x1, 0x2, 0x3, 0xff},
127 },
128};
129
130static inline struct stmp3xxx_pinmux_bank *
131stmp3xxx_pinmux_bank(unsigned id, unsigned *bank, unsigned *pin)
132{
133 unsigned b, p;
134
135 b = STMP3XXX_PINID_TO_BANK(id);
136 p = STMP3XXX_PINID_TO_PINNUM(id);
137 BUG_ON(b >= NR_BANKS);
138 if (bank)
139 *bank = b;
140 if (pin)
141 *pin = p;
142 return &pinmux_banks[b];
143}
144
145/* Check if requested pin is owned by caller */
146static int stmp3xxx_check_pin(unsigned id, const char *label)
147{
148 unsigned pin;
149 struct stmp3xxx_pinmux_bank *pm = stmp3xxx_pinmux_bank(id, NULL, &pin);
150
151 if (!test_bit(pin, &pm->pin_map)) {
152 printk(KERN_WARNING
153 "%s: Accessing free pin %x, caller %s\n",
154 __func__, id, label);
155
156 return -EINVAL;
157 }
158
159 if (label && pm->pin_labels[pin] &&
160 strcmp(label, pm->pin_labels[pin])) {
161 printk(KERN_WARNING
162 "%s: Wrong pin owner %x, caller %s owner %s\n",
163 __func__, id, label, pm->pin_labels[pin]);
164
165 return -EINVAL;
166 }
167 return 0;
168}
169
170void stmp3xxx_pin_strength(unsigned id, enum pin_strength strength,
171 const char *label)
172{
173 struct stmp3xxx_pinmux_bank *pbank;
174 void __iomem *hwdrive;
175 u32 shift, val;
176 u32 bank, pin;
177
178 pbank = stmp3xxx_pinmux_bank(id, &bank, &pin);
179 pr_debug("%s: label %s bank %d pin %d strength %d\n", __func__, label,
180 bank, pin, strength);
181
182 hwdrive = pbank->hw_drive[pin / HW_DRIVE_PIN_NUM];
183 shift = (pin % HW_DRIVE_PIN_NUM) * HW_DRIVE_PIN_LEN;
184 val = pbank->strengths[strength];
185 if (val == 0xff) {
186 printk(KERN_WARNING
187 "%s: strength is not supported for bank %d, caller %s",
188 __func__, bank, label);
189 return;
190 }
191
192 if (stmp3xxx_check_pin(id, label))
193 return;
194
195 pr_debug("%s: writing 0x%x to 0x%p register\n", __func__,
196 val << shift, hwdrive);
197 stmp3xxx_clearl(HW_DRIVE_PINDRV_MASK << shift, hwdrive);
198 stmp3xxx_setl(val << shift, hwdrive);
199}
200
201void stmp3xxx_pin_voltage(unsigned id, enum pin_voltage voltage,
202 const char *label)
203{
204 struct stmp3xxx_pinmux_bank *pbank;
205 void __iomem *hwdrive;
206 u32 shift;
207 u32 bank, pin;
208
209 pbank = stmp3xxx_pinmux_bank(id, &bank, &pin);
210 pr_debug("%s: label %s bank %d pin %d voltage %d\n", __func__, label,
211 bank, pin, voltage);
212
213 hwdrive = pbank->hw_drive[pin / HW_DRIVE_PIN_NUM];
214 shift = (pin % HW_DRIVE_PIN_NUM) * HW_DRIVE_PIN_LEN;
215
216 if (stmp3xxx_check_pin(id, label))
217 return;
218
219 pr_debug("%s: changing 0x%x bit in 0x%p register\n",
220 __func__, HW_DRIVE_PINV_MASK << shift, hwdrive);
221 if (voltage == PIN_1_8V)
222 stmp3xxx_clearl(HW_DRIVE_PINV_MASK << shift, hwdrive);
223 else
224 stmp3xxx_setl(HW_DRIVE_PINV_MASK << shift, hwdrive);
225}
226
227void stmp3xxx_pin_pullup(unsigned id, int enable, const char *label)
228{
229 struct stmp3xxx_pinmux_bank *pbank;
230 void __iomem *hwpull;
231 u32 bank, pin;
232
233 pbank = stmp3xxx_pinmux_bank(id, &bank, &pin);
234 pr_debug("%s: label %s bank %d pin %d enable %d\n", __func__, label,
235 bank, pin, enable);
236
237 hwpull = pbank->hw_pull;
238
239 if (stmp3xxx_check_pin(id, label))
240 return;
241
242 pr_debug("%s: changing 0x%x bit in 0x%p register\n",
243 __func__, 1 << pin, hwpull);
244 if (enable)
245 stmp3xxx_setl(1 << pin, hwpull);
246 else
247 stmp3xxx_clearl(1 << pin, hwpull);
248}
249
250int stmp3xxx_request_pin(unsigned id, enum pin_fun fun, const char *label)
251{
252 struct stmp3xxx_pinmux_bank *pbank;
253 u32 bank, pin;
254 int ret = 0;
255
256 pbank = stmp3xxx_pinmux_bank(id, &bank, &pin);
257 pr_debug("%s: label %s bank %d pin %d fun %d\n", __func__, label,
258 bank, pin, fun);
259
260 if (test_bit(pin, &pbank->pin_map)) {
261 printk(KERN_WARNING
262 "%s: CONFLICT DETECTED pin %d:%d caller %s owner %s\n",
263 __func__, bank, pin, label, pbank->pin_labels[pin]);
264 return -EBUSY;
265 }
266
267 set_bit(pin, &pbank->pin_map);
268 pbank->pin_labels[pin] = label;
269
270 stmp3xxx_set_pin_type(id, fun);
271
272 return ret;
273}
274
275void stmp3xxx_set_pin_type(unsigned id, enum pin_fun fun)
276{
277 struct stmp3xxx_pinmux_bank *pbank;
278 void __iomem *hwmux;
279 u32 shift, val;
280 u32 bank, pin;
281
282 pbank = stmp3xxx_pinmux_bank(id, &bank, &pin);
283
284 hwmux = pbank->hw_muxsel[pin / HW_MUXSEL_PIN_NUM];
285 shift = (pin % HW_MUXSEL_PIN_NUM) * HW_MUXSEL_PIN_LEN;
286
287 val = pbank->functions[fun];
288 shift = (pin % HW_MUXSEL_PIN_NUM) * HW_MUXSEL_PIN_LEN;
289 pr_debug("%s: writing 0x%x to 0x%p register\n",
290 __func__, val << shift, hwmux);
291 stmp3xxx_clearl(HW_MUXSEL_PINFUN_MASK << shift, hwmux);
292 stmp3xxx_setl(val << shift, hwmux);
293}
294
295void stmp3xxx_release_pin(unsigned id, const char *label)
296{
297 struct stmp3xxx_pinmux_bank *pbank;
298 u32 bank, pin;
299
300 pbank = stmp3xxx_pinmux_bank(id, &bank, &pin);
301 pr_debug("%s: label %s bank %d pin %d\n", __func__, label, bank, pin);
302
303 if (stmp3xxx_check_pin(id, label))
304 return;
305
306 clear_bit(pin, &pbank->pin_map);
307 pbank->pin_labels[pin] = NULL;
308}
309
310int stmp3xxx_request_pin_group(struct pin_group *pin_group, const char *label)
311{
312 struct pin_desc *pin;
313 int p;
314 int err = 0;
315
316 /* Allocate and configure pins */
317 for (p = 0; p < pin_group->nr_pins; p++) {
318 pr_debug("%s: #%d\n", __func__, p);
319 pin = &pin_group->pins[p];
320
321 err = stmp3xxx_request_pin(pin->id, pin->fun, label);
322 if (err)
323 goto out_err;
324
325 stmp3xxx_pin_strength(pin->id, pin->strength, label);
326 stmp3xxx_pin_voltage(pin->id, pin->voltage, label);
327 stmp3xxx_pin_pullup(pin->id, pin->pullup, label);
328 }
329
330 return 0;
331
332out_err:
333 /* Release allocated pins in case of error */
334 while (--p >= 0) {
335 pr_debug("%s: releasing #%d\n", __func__, p);
336 stmp3xxx_release_pin(pin_group->pins[p].id, label);
337 }
338 return err;
339}
340EXPORT_SYMBOL(stmp3xxx_request_pin_group);
341
342void stmp3xxx_release_pin_group(struct pin_group *pin_group, const char *label)
343{
344 struct pin_desc *pin;
345 int p;
346
347 for (p = 0; p < pin_group->nr_pins; p++) {
348 pin = &pin_group->pins[p];
349 stmp3xxx_release_pin(pin->id, label);
350 }
351}
352EXPORT_SYMBOL(stmp3xxx_release_pin_group);
353
354static int stmp3xxx_irq_data_to_gpio(struct irq_data *d,
355 struct stmp3xxx_pinmux_bank **bank, unsigned *gpio)
356{
357 struct stmp3xxx_pinmux_bank *pm;
358
359 for (pm = pinmux_banks; pm < pinmux_banks + NR_BANKS; pm++)
360 if (pm->virq <= d->irq && d->irq < pm->virq + 32) {
361 *bank = pm;
362 *gpio = d->irq - pm->virq;
363 return 0;
364 }
365 return -ENOENT;
366}
367
368static int stmp3xxx_set_irqtype(struct irq_data *d, unsigned type)
369{
370 struct stmp3xxx_pinmux_bank *pm;
371 unsigned gpio;
372 int l, p;
373
374 stmp3xxx_irq_data_to_gpio(d, &pm, &gpio);
375 switch (type) {
376 case IRQ_TYPE_EDGE_RISING:
377 l = 0; p = 1; break;
378 case IRQ_TYPE_EDGE_FALLING:
379 l = 0; p = 0; break;
380 case IRQ_TYPE_LEVEL_HIGH:
381 l = 1; p = 1; break;
382 case IRQ_TYPE_LEVEL_LOW:
383 l = 1; p = 0; break;
384 default:
385 pr_debug("%s: Incorrect GPIO interrupt type 0x%x\n",
386 __func__, type);
387 return -ENXIO;
388 }
389
390 if (l)
391 stmp3xxx_setl(1 << gpio, pm->irqlevel);
392 else
393 stmp3xxx_clearl(1 << gpio, pm->irqlevel);
394 if (p)
395 stmp3xxx_setl(1 << gpio, pm->irqpolarity);
396 else
397 stmp3xxx_clearl(1 << gpio, pm->irqpolarity);
398 return 0;
399}
400
401static void stmp3xxx_pin_ack_irq(struct irq_data *d)
402{
403 u32 stat;
404 struct stmp3xxx_pinmux_bank *pm;
405 unsigned gpio;
406
407 stmp3xxx_irq_data_to_gpio(d, &pm, &gpio);
408 stat = __raw_readl(pm->irqstat) & (1 << gpio);
409 stmp3xxx_clearl(stat, pm->irqstat);
410}
411
412static void stmp3xxx_pin_mask_irq(struct irq_data *d)
413{
414 struct stmp3xxx_pinmux_bank *pm;
415 unsigned gpio;
416
417 stmp3xxx_irq_data_to_gpio(d, &pm, &gpio);
418 stmp3xxx_clearl(1 << gpio, pm->irqen);
419 stmp3xxx_clearl(1 << gpio, pm->pin2irq);
420}
421
422static void stmp3xxx_pin_unmask_irq(struct irq_data *d)
423{
424 struct stmp3xxx_pinmux_bank *pm;
425 unsigned gpio;
426
427 stmp3xxx_irq_data_to_gpio(d, &pm, &gpio);
428 stmp3xxx_setl(1 << gpio, pm->irqen);
429 stmp3xxx_setl(1 << gpio, pm->pin2irq);
430}
431
432static inline
433struct stmp3xxx_pinmux_bank *to_pinmux_bank(struct gpio_chip *chip)
434{
435 return container_of(chip, struct stmp3xxx_pinmux_bank, chip);
436}
437
438static int stmp3xxx_gpio_to_irq(struct gpio_chip *chip, unsigned offset)
439{
440 struct stmp3xxx_pinmux_bank *pm = to_pinmux_bank(chip);
441 return pm->virq + offset;
442}
443
444static int stmp3xxx_gpio_get(struct gpio_chip *chip, unsigned offset)
445{
446 struct stmp3xxx_pinmux_bank *pm = to_pinmux_bank(chip);
447 unsigned v;
448
449 v = __raw_readl(pm->hw_gpio_in) & (1 << offset);
450 return v ? 1 : 0;
451}
452
453static void stmp3xxx_gpio_set(struct gpio_chip *chip, unsigned offset, int v)
454{
455 struct stmp3xxx_pinmux_bank *pm = to_pinmux_bank(chip);
456
457 if (v)
458 stmp3xxx_setl(1 << offset, pm->hw_gpio_out);
459 else
460 stmp3xxx_clearl(1 << offset, pm->hw_gpio_out);
461}
462
463static int stmp3xxx_gpio_output(struct gpio_chip *chip, unsigned offset, int v)
464{
465 struct stmp3xxx_pinmux_bank *pm = to_pinmux_bank(chip);
466
467 stmp3xxx_setl(1 << offset, pm->hw_gpio_doe);
468 stmp3xxx_gpio_set(chip, offset, v);
469 return 0;
470}
471
472static int stmp3xxx_gpio_input(struct gpio_chip *chip, unsigned offset)
473{
474 struct stmp3xxx_pinmux_bank *pm = to_pinmux_bank(chip);
475
476 stmp3xxx_clearl(1 << offset, pm->hw_gpio_doe);
477 return 0;
478}
479
480static int stmp3xxx_gpio_request(struct gpio_chip *chip, unsigned offset)
481{
482 return stmp3xxx_request_pin(chip->base + offset, PIN_GPIO, "gpio");
483}
484
485static void stmp3xxx_gpio_free(struct gpio_chip *chip, unsigned offset)
486{
487 stmp3xxx_release_pin(chip->base + offset, "gpio");
488}
489
490static void stmp3xxx_gpio_irq(u32 irq, struct irq_desc *desc)
491{
492 struct stmp3xxx_pinmux_bank *pm = irq_get_handler_data(irq);
493 int gpio_irq = pm->virq;
494 u32 stat = __raw_readl(pm->irqstat);
495
496 while (stat) {
497 if (stat & 1)
498 generic_handle_irq(gpio_irq);
499 gpio_irq++;
500 stat >>= 1;
501 }
502}
503
504static struct irq_chip gpio_irq_chip = {
505 .irq_ack = stmp3xxx_pin_ack_irq,
506 .irq_mask = stmp3xxx_pin_mask_irq,
507 .irq_unmask = stmp3xxx_pin_unmask_irq,
508 .irq_set_type = stmp3xxx_set_irqtype,
509};
510
511int __init stmp3xxx_pinmux_init(int virtual_irq_start)
512{
513 int b, r = 0;
514 struct stmp3xxx_pinmux_bank *pm;
515 int virq;
516
517 for (b = 0; b < 3; b++) {
518 /* only banks 0,1,2 are allowed to GPIO */
519 pm = pinmux_banks + b;
520 pm->chip.base = 32 * b;
521 pm->chip.ngpio = 32;
522 pm->chip.owner = THIS_MODULE;
523 pm->chip.can_sleep = 1;
524 pm->chip.exported = 1;
525 pm->chip.to_irq = stmp3xxx_gpio_to_irq;
526 pm->chip.direction_input = stmp3xxx_gpio_input;
527 pm->chip.direction_output = stmp3xxx_gpio_output;
528 pm->chip.get = stmp3xxx_gpio_get;
529 pm->chip.set = stmp3xxx_gpio_set;
530 pm->chip.request = stmp3xxx_gpio_request;
531 pm->chip.free = stmp3xxx_gpio_free;
532 pm->virq = virtual_irq_start + b * 32;
533
534 for (virq = pm->virq; virq < pm->virq; virq++) {
535 gpio_irq_chip.irq_mask(irq_get_irq_data(virq));
536 irq_set_chip_and_handler(virq, &gpio_irq_chip,
537 handle_level_irq);
538 set_irq_flags(virq, IRQF_VALID);
539 }
540 r = gpiochip_add(&pm->chip);
541 if (r < 0)
542 break;
543 irq_set_chained_handler(pm->irq, stmp3xxx_gpio_irq);
544 irq_set_handler_data(pm->irq, pm);
545 }
546 return r;
547}
548
549MODULE_AUTHOR("Vladislav Buzov");
550MODULE_LICENSE("GPL");
diff --git a/arch/arm/plat-stmp3xxx/timer.c b/arch/arm/plat-stmp3xxx/timer.c
deleted file mode 100644
index c395630a6edc..000000000000
--- a/arch/arm/plat-stmp3xxx/timer.c
+++ /dev/null
@@ -1,186 +0,0 @@
1/*
2 * System timer for Freescale STMP37XX/STMP378X
3 *
4 * Embedded Alley Solutions, Inc <source@embeddedalley.com>
5 *
6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved.
8 */
9
10/*
11 * The code contained herein is licensed under the GNU General Public
12 * License. You may obtain a copy of the GNU General Public License
13 * Version 2 or later at the following locations:
14 *
15 * http://www.opensource.org/licenses/gpl-license.html
16 * http://www.gnu.org/copyleft/gpl.html
17 */
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/spinlock.h>
21#include <linux/clocksource.h>
22#include <linux/clockchips.h>
23#include <linux/io.h>
24#include <linux/irq.h>
25#include <linux/interrupt.h>
26
27#include <asm/mach/time.h>
28#include <mach/stmp3xxx.h>
29#include <mach/platform.h>
30#include <mach/regs-timrot.h>
31
32static irqreturn_t
33stmp3xxx_timer_interrupt(int irq, void *dev_id)
34{
35 struct clock_event_device *c = dev_id;
36
37 /* timer 0 */
38 if (__raw_readl(REGS_TIMROT_BASE + HW_TIMROT_TIMCTRL0) &
39 BM_TIMROT_TIMCTRLn_IRQ) {
40 stmp3xxx_clearl(BM_TIMROT_TIMCTRLn_IRQ,
41 REGS_TIMROT_BASE + HW_TIMROT_TIMCTRL0);
42 c->event_handler(c);
43 }
44
45 /* timer 1 */
46 else if (__raw_readl(REGS_TIMROT_BASE + HW_TIMROT_TIMCTRL1)
47 & BM_TIMROT_TIMCTRLn_IRQ) {
48 stmp3xxx_clearl(BM_TIMROT_TIMCTRLn_IRQ,
49 REGS_TIMROT_BASE + HW_TIMROT_TIMCTRL1);
50 stmp3xxx_clearl(BM_TIMROT_TIMCTRLn_IRQ_EN,
51 REGS_TIMROT_BASE + HW_TIMROT_TIMCTRL1);
52 __raw_writel(0xFFFF, REGS_TIMROT_BASE + HW_TIMROT_TIMCOUNT1);
53 }
54
55 return IRQ_HANDLED;
56}
57
58static cycle_t stmp3xxx_clock_read(struct clocksource *cs)
59{
60 return ~((__raw_readl(REGS_TIMROT_BASE + HW_TIMROT_TIMCOUNT1)
61 & 0xFFFF0000) >> 16);
62}
63
64static int
65stmp3xxx_timrot_set_next_event(unsigned long delta,
66 struct clock_event_device *dev)
67{
68 /* reload the timer */
69 __raw_writel(delta, REGS_TIMROT_BASE + HW_TIMROT_TIMCOUNT0);
70 return 0;
71}
72
73static void
74stmp3xxx_timrot_set_mode(enum clock_event_mode mode,
75 struct clock_event_device *dev)
76{
77}
78
79static struct clock_event_device ckevt_timrot = {
80 .name = "timrot",
81 .features = CLOCK_EVT_FEAT_ONESHOT,
82 .shift = 32,
83 .set_next_event = stmp3xxx_timrot_set_next_event,
84 .set_mode = stmp3xxx_timrot_set_mode,
85};
86
87static struct clocksource cksrc_stmp3xxx = {
88 .name = "cksrc_stmp3xxx",
89 .rating = 250,
90 .read = stmp3xxx_clock_read,
91 .mask = CLOCKSOURCE_MASK(16),
92 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
93};
94
95static struct irqaction stmp3xxx_timer_irq = {
96 .name = "stmp3xxx_timer",
97 .flags = IRQF_DISABLED | IRQF_TIMER,
98 .handler = stmp3xxx_timer_interrupt,
99 .dev_id = &ckevt_timrot,
100};
101
102
103/*
104 * Set up timer interrupt, and return the current time in seconds.
105 */
106static void __init stmp3xxx_init_timer(void)
107{
108 ckevt_timrot.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC,
109 ckevt_timrot.shift);
110 ckevt_timrot.min_delta_ns = clockevent_delta2ns(2, &ckevt_timrot);
111 ckevt_timrot.max_delta_ns = clockevent_delta2ns(0xFFF, &ckevt_timrot);
112 ckevt_timrot.cpumask = cpumask_of(0);
113
114 stmp3xxx_reset_block(REGS_TIMROT_BASE, false);
115
116 /* clear two timers */
117 __raw_writel(0, REGS_TIMROT_BASE + HW_TIMROT_TIMCOUNT0);
118 __raw_writel(0, REGS_TIMROT_BASE + HW_TIMROT_TIMCOUNT1);
119
120 /* configure them */
121 __raw_writel(
122 (8 << BP_TIMROT_TIMCTRLn_SELECT) | /* 32 kHz */
123 BM_TIMROT_TIMCTRLn_RELOAD |
124 BM_TIMROT_TIMCTRLn_UPDATE |
125 BM_TIMROT_TIMCTRLn_IRQ_EN,
126 REGS_TIMROT_BASE + HW_TIMROT_TIMCTRL0);
127 __raw_writel(
128 (8 << BP_TIMROT_TIMCTRLn_SELECT) | /* 32 kHz */
129 BM_TIMROT_TIMCTRLn_RELOAD |
130 BM_TIMROT_TIMCTRLn_UPDATE |
131 BM_TIMROT_TIMCTRLn_IRQ_EN,
132 REGS_TIMROT_BASE + HW_TIMROT_TIMCTRL1);
133
134 __raw_writel(CLOCK_TICK_RATE / HZ - 1,
135 REGS_TIMROT_BASE + HW_TIMROT_TIMCOUNT0);
136 __raw_writel(0xFFFF, REGS_TIMROT_BASE + HW_TIMROT_TIMCOUNT1);
137
138 setup_irq(IRQ_TIMER0, &stmp3xxx_timer_irq);
139
140 clocksource_register_hz(&cksrc_stmp3xxx, CLOCK_TICK_RATE);
141 clockevents_register_device(&ckevt_timrot);
142}
143
144#ifdef CONFIG_PM
145
146void stmp3xxx_suspend_timer(void)
147{
148 stmp3xxx_clearl(BM_TIMROT_TIMCTRLn_IRQ_EN | BM_TIMROT_TIMCTRLn_IRQ,
149 REGS_TIMROT_BASE + HW_TIMROT_TIMCTRL0);
150 stmp3xxx_setl(BM_TIMROT_ROTCTRL_CLKGATE,
151 REGS_TIMROT_BASE + HW_TIMROT_ROTCTRL);
152}
153
154void stmp3xxx_resume_timer(void)
155{
156 stmp3xxx_clearl(BM_TIMROT_ROTCTRL_SFTRST | BM_TIMROT_ROTCTRL_CLKGATE,
157 REGS_TIMROT_BASE + HW_TIMROT_ROTCTRL);
158 __raw_writel(
159 8 << BP_TIMROT_TIMCTRLn_SELECT | /* 32 kHz */
160 BM_TIMROT_TIMCTRLn_RELOAD |
161 BM_TIMROT_TIMCTRLn_UPDATE |
162 BM_TIMROT_TIMCTRLn_IRQ_EN,
163 REGS_TIMROT_BASE + HW_TIMROT_TIMCTRL0);
164 __raw_writel(
165 8 << BP_TIMROT_TIMCTRLn_SELECT | /* 32 kHz */
166 BM_TIMROT_TIMCTRLn_RELOAD |
167 BM_TIMROT_TIMCTRLn_UPDATE |
168 BM_TIMROT_TIMCTRLn_IRQ_EN,
169 REGS_TIMROT_BASE + HW_TIMROT_TIMCTRL1);
170 __raw_writel(CLOCK_TICK_RATE / HZ - 1,
171 REGS_TIMROT_BASE + HW_TIMROT_TIMCOUNT0);
172 __raw_writel(0xFFFF, REGS_TIMROT_BASE + HW_TIMROT_TIMCOUNT1);
173}
174
175#else
176
177#define stmp3xxx_suspend_timer NULL
178#define stmp3xxx_resume_timer NULL
179
180#endif /* CONFIG_PM */
181
182struct sys_timer stmp3xxx_timer = {
183 .init = stmp3xxx_init_timer,
184 .suspend = stmp3xxx_suspend_timer,
185 .resume = stmp3xxx_resume_timer,
186};
diff --git a/arch/arm/plat-versatile/platsmp.c b/arch/arm/plat-versatile/platsmp.c
index ba3d471d4bcf..51ecfea09b27 100644
--- a/arch/arm/plat-versatile/platsmp.c
+++ b/arch/arm/plat-versatile/platsmp.c
@@ -16,6 +16,7 @@
16#include <linux/smp.h> 16#include <linux/smp.h>
17 17
18#include <asm/cacheflush.h> 18#include <asm/cacheflush.h>
19#include <asm/hardware/gic.h>
19 20
20/* 21/*
21 * control for which core is the next to come out of the secondary 22 * control for which core is the next to come out of the secondary
@@ -83,7 +84,7 @@ int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
83 * the boot monitor to read the system wide flags register, 84 * the boot monitor to read the system wide flags register,
84 * and branch to the address found there. 85 * and branch to the address found there.
85 */ 86 */
86 smp_cross_call(cpumask_of(cpu), 1); 87 gic_raise_softirq(cpumask_of(cpu), 1);
87 88
88 timeout = jiffies + (1 * HZ); 89 timeout = jiffies + (1 * HZ);
89 while (time_before(jiffies, timeout)) { 90 while (time_before(jiffies, timeout)) {
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index 7ca41f0a09b1..3b3776d0a1a7 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -17,7 +17,7 @@
17# XXX: the last 12 months. If your entry is missing please email rmk at 17# XXX: the last 12 months. If your entry is missing please email rmk at
18# XXX: <linux@arm.linux.org.uk> 18# XXX: <linux@arm.linux.org.uk>
19# 19#
20# Last update: Sun Mar 20 18:06:11 2011 20# Last update: Sat May 7 08:48:24 2011
21# 21#
22# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number 22# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
23# 23#
@@ -377,6 +377,8 @@ davinci_da850_evm MACH_DAVINCI_DA850_EVM DAVINCI_DA850_EVM 2157
377at91sam9g10ek MACH_AT91SAM9G10EK AT91SAM9G10EK 2159 377at91sam9g10ek MACH_AT91SAM9G10EK AT91SAM9G10EK 2159
378omap_4430sdp MACH_OMAP_4430SDP OMAP_4430SDP 2160 378omap_4430sdp MACH_OMAP_4430SDP OMAP_4430SDP 2160
379magx_zn5 MACH_MAGX_ZN5 MAGX_ZN5 2162 379magx_zn5 MACH_MAGX_ZN5 MAGX_ZN5 2162
380btmavb101 MACH_BTMAVB101 BTMAVB101 2172
381btmawb101 MACH_BTMAWB101 BTMAWB101 2173
380omap3_torpedo MACH_OMAP3_TORPEDO OMAP3_TORPEDO 2178 382omap3_torpedo MACH_OMAP3_TORPEDO OMAP3_TORPEDO 2178
381anw6410 MACH_ANW6410 ANW6410 2183 383anw6410 MACH_ANW6410 ANW6410 2183
382imx27_visstrim_m10 MACH_IMX27_VISSTRIM_M10 IMX27_VISSTRIM_M10 2187 384imx27_visstrim_m10 MACH_IMX27_VISSTRIM_M10 IMX27_VISSTRIM_M10 2187
@@ -400,6 +402,7 @@ d2net MACH_D2NET D2NET 2282
400bigdisk MACH_BIGDISK BIGDISK 2283 402bigdisk MACH_BIGDISK BIGDISK 2283
401at91sam9g20ek_2mmc MACH_AT91SAM9G20EK_2MMC AT91SAM9G20EK_2MMC 2288 403at91sam9g20ek_2mmc MACH_AT91SAM9G20EK_2MMC AT91SAM9G20EK_2MMC 2288
402bcmring MACH_BCMRING BCMRING 2289 404bcmring MACH_BCMRING BCMRING 2289
405dp6xx MACH_DP6XX DP6XX 2302
403mahimahi MACH_MAHIMAHI MAHIMAHI 2304 406mahimahi MACH_MAHIMAHI MAHIMAHI 2304
404smdk6442 MACH_SMDK6442 SMDK6442 2324 407smdk6442 MACH_SMDK6442 SMDK6442 2324
405openrd_base MACH_OPENRD_BASE OPENRD_BASE 2325 408openrd_base MACH_OPENRD_BASE OPENRD_BASE 2325
@@ -424,6 +427,7 @@ smdkv210 MACH_SMDKV210 SMDKV210 2456
424omap_zoom3 MACH_OMAP_ZOOM3 OMAP_ZOOM3 2464 427omap_zoom3 MACH_OMAP_ZOOM3 OMAP_ZOOM3 2464
425omap_3630sdp MACH_OMAP_3630SDP OMAP_3630SDP 2465 428omap_3630sdp MACH_OMAP_3630SDP OMAP_3630SDP 2465
426smartq7 MACH_SMARTQ7 SMARTQ7 2479 429smartq7 MACH_SMARTQ7 SMARTQ7 2479
430watson_efm_plugin MACH_WATSON_EFM_PLUGIN WATSON_EFM_PLUGIN 2491
427g4evm MACH_G4EVM G4EVM 2493 431g4evm MACH_G4EVM G4EVM 2493
428omapl138_hawkboard MACH_OMAPL138_HAWKBOARD OMAPL138_HAWKBOARD 2495 432omapl138_hawkboard MACH_OMAPL138_HAWKBOARD OMAPL138_HAWKBOARD 2495
429ts41x MACH_TS41X TS41X 2502 433ts41x MACH_TS41X TS41X 2502
@@ -433,6 +437,8 @@ mx28evk MACH_MX28EVK MX28EVK 2531
433smartq5 MACH_SMARTQ5 SMARTQ5 2534 437smartq5 MACH_SMARTQ5 SMARTQ5 2534
434davinci_dm6467tevm MACH_DAVINCI_DM6467TEVM DAVINCI_DM6467TEVM 2548 438davinci_dm6467tevm MACH_DAVINCI_DM6467TEVM DAVINCI_DM6467TEVM 2548
435mxt_td60 MACH_MXT_TD60 MXT_TD60 2550 439mxt_td60 MACH_MXT_TD60 MXT_TD60 2550
440riot_bei2 MACH_RIOT_BEI2 RIOT_BEI2 2576
441riot_x37 MACH_RIOT_X37 RIOT_X37 2578
436capc7117 MACH_CAPC7117 CAPC7117 2612 442capc7117 MACH_CAPC7117 CAPC7117 2612
437icontrol MACH_ICONTROL ICONTROL 2624 443icontrol MACH_ICONTROL ICONTROL 2624
438qsd8x50a_st1_5 MACH_QSD8X50A_ST1_5 QSD8X50A_ST1_5 2627 444qsd8x50a_st1_5 MACH_QSD8X50A_ST1_5 QSD8X50A_ST1_5 2627
@@ -445,6 +451,7 @@ spear320 MACH_SPEAR320 SPEAR320 2661
445aquila MACH_AQUILA AQUILA 2676 451aquila MACH_AQUILA AQUILA 2676
446sheeva_esata MACH_ESATA_SHEEVAPLUG ESATA_SHEEVAPLUG 2678 452sheeva_esata MACH_ESATA_SHEEVAPLUG ESATA_SHEEVAPLUG 2678
447msm7x30_surf MACH_MSM7X30_SURF MSM7X30_SURF 2679 453msm7x30_surf MACH_MSM7X30_SURF MSM7X30_SURF 2679
454ea2478devkit MACH_EA2478DEVKIT EA2478DEVKIT 2683
448terastation_wxl MACH_TERASTATION_WXL TERASTATION_WXL 2697 455terastation_wxl MACH_TERASTATION_WXL TERASTATION_WXL 2697
449msm7x25_surf MACH_MSM7X25_SURF MSM7X25_SURF 2703 456msm7x25_surf MACH_MSM7X25_SURF MSM7X25_SURF 2703
450msm7x25_ffa MACH_MSM7X25_FFA MSM7X25_FFA 2704 457msm7x25_ffa MACH_MSM7X25_FFA MSM7X25_FFA 2704
@@ -463,75 +470,16 @@ wbd222 MACH_WBD222 WBD222 2753
463msm8x60_surf MACH_MSM8X60_SURF MSM8X60_SURF 2755 470msm8x60_surf MACH_MSM8X60_SURF MSM8X60_SURF 2755
464msm8x60_sim MACH_MSM8X60_SIM MSM8X60_SIM 2756 471msm8x60_sim MACH_MSM8X60_SIM MSM8X60_SIM 2756
465tcc8000_sdk MACH_TCC8000_SDK TCC8000_SDK 2758 472tcc8000_sdk MACH_TCC8000_SDK TCC8000_SDK 2758
466ap420 MACH_AP420 AP420 2765 473nanos MACH_NANOS NANOS 2759
467davinci_dm365_fc MACH_DAVINCI_DM365_FC DAVINCI_DM365_FC 2767 474stamp9g45 MACH_STAMP9G45 STAMP9G45 2761
468msm8x55_surf MACH_MSM8X55_SURF MSM8X55_SURF 2768
469msm8x55_ffa MACH_MSM8X55_FFA MSM8X55_FFA 2769
470esl_vamana MACH_ESL_VAMANA ESL_VAMANA 2770
471sbc35 MACH_SBC35 SBC35 2771
472mpx6446 MACH_MPX6446 MPX6446 2772
473oreo_controller MACH_OREO_CONTROLLER OREO_CONTROLLER 2773
474kopin_models MACH_KOPIN_MODELS KOPIN_MODELS 2774
475ttc_vision2 MACH_TTC_VISION2 TTC_VISION2 2775
476cns3420vb MACH_CNS3420VB CNS3420VB 2776 475cns3420vb MACH_CNS3420VB CNS3420VB 2776
477olympus MACH_OLYMPUS OLYMPUS 2778
478vortex MACH_VORTEX VORTEX 2779
479s5pc200 MACH_S5PC200 S5PC200 2780
480ecucore_9263 MACH_ECUCORE_9263 ECUCORE_9263 2781
481smdkc200 MACH_SMDKC200 SMDKC200 2782
482emsiso_sx27 MACH_EMSISO_SX27 EMSISO_SX27 2783
483apx_som9g45_ek MACH_APX_SOM9G45_EK APX_SOM9G45_EK 2784
484songshan MACH_SONGSHAN SONGSHAN 2785
485tianshan MACH_TIANSHAN TIANSHAN 2786
486vpx500 MACH_VPX500 VPX500 2787
487am3517sam MACH_AM3517SAM AM3517SAM 2788
488skat91_sim508 MACH_SKAT91_SIM508 SKAT91_SIM508 2789
489skat91_s3e MACH_SKAT91_S3E SKAT91_S3E 2790
490omap4_panda MACH_OMAP4_PANDA OMAP4_PANDA 2791 476omap4_panda MACH_OMAP4_PANDA OMAP4_PANDA 2791
491df7220 MACH_DF7220 DF7220 2792
492nemini MACH_NEMINI NEMINI 2793
493t8200 MACH_T8200 T8200 2794
494apf51 MACH_APF51 APF51 2795
495dr_rc_unit MACH_DR_RC_UNIT DR_RC_UNIT 2796
496bordeaux MACH_BORDEAUX BORDEAUX 2797
497catania_b MACH_CATANIA_B CATANIA_B 2798
498mx51_ocean MACH_MX51_OCEAN MX51_OCEAN 2799
499ti8168evm MACH_TI8168EVM TI8168EVM 2800 477ti8168evm MACH_TI8168EVM TI8168EVM 2800
500neocoreomap MACH_NEOCOREOMAP NEOCOREOMAP 2801
501withings_wbp MACH_WITHINGS_WBP WITHINGS_WBP 2802
502dbps MACH_DBPS DBPS 2803
503pcbfp0001 MACH_PCBFP0001 PCBFP0001 2805
504speedy MACH_SPEEDY SPEEDY 2806
505chrysaor MACH_CHRYSAOR CHRYSAOR 2807
506tango MACH_TANGO TANGO 2808
507synology_dsx11 MACH_SYNOLOGY_DSX11 SYNOLOGY_DSX11 2809
508hanlin_v3ext MACH_HANLIN_V3EXT HANLIN_V3EXT 2810
509hanlin_v5 MACH_HANLIN_V5 HANLIN_V5 2811
510hanlin_v3plus MACH_HANLIN_V3PLUS HANLIN_V3PLUS 2812
511iriver_story MACH_IRIVER_STORY IRIVER_STORY 2813
512irex_iliad MACH_IREX_ILIAD IREX_ILIAD 2814
513irex_dr1000 MACH_IREX_DR1000 IREX_DR1000 2815
514teton_bga MACH_TETON_BGA TETON_BGA 2816 478teton_bga MACH_TETON_BGA TETON_BGA 2816
515snapper9g45 MACH_SNAPPER9G45 SNAPPER9G45 2817
516tam3517 MACH_TAM3517 TAM3517 2818
517pdc100 MACH_PDC100 PDC100 2819
518eukrea_cpuimx25sd MACH_EUKREA_CPUIMX25 EUKREA_CPUIMX25 2820 479eukrea_cpuimx25sd MACH_EUKREA_CPUIMX25 EUKREA_CPUIMX25 2820
519eukrea_cpuimx35sd MACH_EUKREA_CPUIMX35 EUKREA_CPUIMX35 2821 480eukrea_cpuimx35sd MACH_EUKREA_CPUIMX35 EUKREA_CPUIMX35 2821
520eukrea_cpuimx51sd MACH_EUKREA_CPUIMX51SD EUKREA_CPUIMX51SD 2822 481eukrea_cpuimx51sd MACH_EUKREA_CPUIMX51SD EUKREA_CPUIMX51SD 2822
521eukrea_cpuimx51 MACH_EUKREA_CPUIMX51 EUKREA_CPUIMX51 2823 482eukrea_cpuimx51 MACH_EUKREA_CPUIMX51 EUKREA_CPUIMX51 2823
522p565 MACH_P565 P565 2824
523acer_a4 MACH_ACER_A4 ACER_A4 2825
524davinci_dm368_bip MACH_DAVINCI_DM368_BIP DAVINCI_DM368_BIP 2826
525eshare MACH_ESHARE ESHARE 2827
526wlbargn MACH_WLBARGN WLBARGN 2829
527bm170 MACH_BM170 BM170 2830
528netspace_mini_v2 MACH_NETSPACE_MINI_V2 NETSPACE_MINI_V2 2831
529netspace_plug_v2 MACH_NETSPACE_PLUG_V2 NETSPACE_PLUG_V2 2832
530siemens_l1 MACH_SIEMENS_L1 SIEMENS_L1 2833
531elv_lcu1 MACH_ELV_LCU1 ELV_LCU1 2834
532mcu1 MACH_MCU1 MCU1 2835
533omap3_tao3530 MACH_OMAP3_TAO3530 OMAP3_TAO3530 2836
534omap3_pcutouch MACH_OMAP3_PCUTOUCH OMAP3_PCUTOUCH 2837
535smdkc210 MACH_SMDKC210 SMDKC210 2838 483smdkc210 MACH_SMDKC210 SMDKC210 2838
536omap3_braillo MACH_OMAP3_BRAILLO OMAP3_BRAILLO 2839 484omap3_braillo MACH_OMAP3_BRAILLO OMAP3_BRAILLO 2839
537spyplug MACH_SPYPLUG SPYPLUG 2840 485spyplug MACH_SPYPLUG SPYPLUG 2840
@@ -973,9 +921,7 @@ isc3 MACH_ISC3 ISC3 3291
973rascal MACH_RASCAL RASCAL 3292 921rascal MACH_RASCAL RASCAL 3292
974hrefv60 MACH_HREFV60 HREFV60 3293 922hrefv60 MACH_HREFV60 HREFV60 3293
975tpt_2_0 MACH_TPT_2_0 TPT_2_0 3294 923tpt_2_0 MACH_TPT_2_0 TPT_2_0 3294
976pyramid_td MACH_PYRAMID_TD PYRAMID_TD 3295
977splendor MACH_SPLENDOR SPLENDOR 3296 924splendor MACH_SPLENDOR SPLENDOR 3296
978guf_planet MACH_GUF_PLANET GUF_PLANET 3297
979msm8x60_qt MACH_MSM8X60_QT MSM8X60_QT 3298 925msm8x60_qt MACH_MSM8X60_QT MSM8X60_QT 3298
980htc_hd_mini MACH_HTC_HD_MINI HTC_HD_MINI 3299 926htc_hd_mini MACH_HTC_HD_MINI HTC_HD_MINI 3299
981athene MACH_ATHENE ATHENE 3300 927athene MACH_ATHENE ATHENE 3300
@@ -1099,3 +1045,71 @@ ecuv5 MACH_ECUV5 ECUV5 3421
1099hsgx6d MACH_HSGX6D HSGX6D 3422 1045hsgx6d MACH_HSGX6D HSGX6D 3422
1100dawad7 MACH_DAWAD7 DAWAD7 3423 1046dawad7 MACH_DAWAD7 DAWAD7 3423
1101sam9repeater MACH_SAM9REPEATER SAM9REPEATER 3424 1047sam9repeater MACH_SAM9REPEATER SAM9REPEATER 3424
1048gt_i5700 MACH_GT_I5700 GT_I5700 3425
1049ctera_plug_c2 MACH_CTERA_PLUG_C2 CTERA_PLUG_C2 3426
1050marvelct MACH_MARVELCT MARVELCT 3427
1051ag11005 MACH_AG11005 AG11005 3428
1052vangogh MACH_VANGOGH VANGOGH 3430
1053matrix505 MACH_MATRIX505 MATRIX505 3431
1054oce_nigma MACH_OCE_NIGMA OCE_NIGMA 3432
1055t55 MACH_T55 T55 3433
1056bio3k MACH_BIO3K BIO3K 3434
1057expressct MACH_EXPRESSCT EXPRESSCT 3435
1058cardhu MACH_CARDHU CARDHU 3436
1059aruba MACH_ARUBA ARUBA 3437
1060bonaire MACH_BONAIRE BONAIRE 3438
1061nuc700evb MACH_NUC700EVB NUC700EVB 3439
1062nuc710evb MACH_NUC710EVB NUC710EVB 3440
1063nuc740evb MACH_NUC740EVB NUC740EVB 3441
1064nuc745evb MACH_NUC745EVB NUC745EVB 3442
1065transcede MACH_TRANSCEDE TRANSCEDE 3443
1066mora MACH_MORA MORA 3444
1067nda_evm MACH_NDA_EVM NDA_EVM 3445
1068timu MACH_TIMU TIMU 3446
1069expressh MACH_EXPRESSH EXPRESSH 3447
1070veridis_a300 MACH_VERIDIS_A300 VERIDIS_A300 3448
1071dm368_leopard MACH_DM368_LEOPARD DM368_LEOPARD 3449
1072omap_mcop MACH_OMAP_MCOP OMAP_MCOP 3450
1073tritip MACH_TRITIP TRITIP 3451
1074sm1k MACH_SM1K SM1K 3452
1075monch MACH_MONCH MONCH 3453
1076curacao MACH_CURACAO CURACAO 3454
1077origen MACH_ORIGEN ORIGEN 3455
1078epc10 MACH_EPC10 EPC10 3456
1079sgh_i740 MACH_SGH_I740 SGH_I740 3457
1080tuna MACH_TUNA TUNA 3458
1081mx51_tulip MACH_MX51_TULIP MX51_TULIP 3459
1082mx51_aster7 MACH_MX51_ASTER7 MX51_ASTER7 3460
1083acro37xbrd MACH_ACRO37XBRD ACRO37XBRD 3461
1084elke MACH_ELKE ELKE 3462
1085sbc6000x MACH_SBC6000X SBC6000X 3463
1086r1801e MACH_R1801E R1801E 3464
1087h1600 MACH_H1600 H1600 3465
1088mini210 MACH_MINI210 MINI210 3466
1089mini8168 MACH_MINI8168 MINI8168 3467
1090pc7308 MACH_PC7308 PC7308 3468
1091kmm2m01 MACH_KMM2M01 KMM2M01 3470
1092mx51erebus MACH_MX51EREBUS MX51EREBUS 3471
1093wm8650refboard MACH_WM8650REFBOARD WM8650REFBOARD 3472
1094tuxrail MACH_TUXRAIL TUXRAIL 3473
1095arthur MACH_ARTHUR ARTHUR 3474
1096doorboy MACH_DOORBOY DOORBOY 3475
1097xarina MACH_XARINA XARINA 3476
1098roverx7 MACH_ROVERX7 ROVERX7 3477
1099sdvr MACH_SDVR SDVR 3478
1100acer_maya MACH_ACER_MAYA ACER_MAYA 3479
1101pico MACH_PICO PICO 3480
1102cwmx233 MACH_CWMX233 CWMX233 3481
1103cwam1808 MACH_CWAM1808 CWAM1808 3482
1104cwdm365 MACH_CWDM365 CWDM365 3483
1105mx51_moray MACH_MX51_MORAY MX51_MORAY 3484
1106thales_cbc MACH_THALES_CBC THALES_CBC 3485
1107bluepoint MACH_BLUEPOINT BLUEPOINT 3486
1108dir665 MACH_DIR665 DIR665 3487
1109acmerover1 MACH_ACMEROVER1 ACMEROVER1 3488
1110shooter_ct MACH_SHOOTER_CT SHOOTER_CT 3489
1111bliss MACH_BLISS BLISS 3490
1112blissc MACH_BLISSC BLISSC 3491
1113thales_adc MACH_THALES_ADC THALES_ADC 3492
1114ubisys_p9d_evp MACH_UBISYS_P9D_EVP UBISYS_P9D_EVP 3493
1115atdgp318 MACH_ATDGP318 ATDGP318 3494
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index f74695075e64..f25e7ec89416 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -398,9 +398,9 @@ static void vfp_enable(void *unused)
398} 398}
399 399
400#ifdef CONFIG_PM 400#ifdef CONFIG_PM
401#include <linux/sysdev.h> 401#include <linux/syscore_ops.h>
402 402
403static int vfp_pm_suspend(struct sys_device *dev, pm_message_t state) 403static int vfp_pm_suspend(void)
404{ 404{
405 struct thread_info *ti = current_thread_info(); 405 struct thread_info *ti = current_thread_info();
406 u32 fpexc = fmrx(FPEXC); 406 u32 fpexc = fmrx(FPEXC);
@@ -420,34 +420,25 @@ static int vfp_pm_suspend(struct sys_device *dev, pm_message_t state)
420 return 0; 420 return 0;
421} 421}
422 422
423static int vfp_pm_resume(struct sys_device *dev) 423static void vfp_pm_resume(void)
424{ 424{
425 /* ensure we have access to the vfp */ 425 /* ensure we have access to the vfp */
426 vfp_enable(NULL); 426 vfp_enable(NULL);
427 427
428 /* and disable it to ensure the next usage restores the state */ 428 /* and disable it to ensure the next usage restores the state */
429 fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN); 429 fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN);
430
431 return 0;
432} 430}
433 431
434static struct sysdev_class vfp_pm_sysclass = { 432static struct syscore_ops vfp_pm_syscore_ops = {
435 .name = "vfp",
436 .suspend = vfp_pm_suspend, 433 .suspend = vfp_pm_suspend,
437 .resume = vfp_pm_resume, 434 .resume = vfp_pm_resume,
438}; 435};
439 436
440static struct sys_device vfp_pm_sysdev = {
441 .cls = &vfp_pm_sysclass,
442};
443
444static void vfp_pm_init(void) 437static void vfp_pm_init(void)
445{ 438{
446 sysdev_class_register(&vfp_pm_sysclass); 439 register_syscore_ops(&vfp_pm_syscore_ops);
447 sysdev_register(&vfp_pm_sysdev);
448} 440}
449 441
450
451#else 442#else
452static inline void vfp_pm_init(void) { } 443static inline void vfp_pm_init(void) { }
453#endif /* CONFIG_PM */ 444#endif /* CONFIG_PM */